Merge "Don't crash in window manager if we fail getting .apk resources." into jb-dev
diff --git a/Android.mk b/Android.mk
index 79e3140..4d567df 100644
--- a/Android.mk
+++ b/Android.mk
@@ -412,6 +412,7 @@
-since ./frameworks/base/api/13.xml 13 \
-since ./frameworks/base/api/14.txt 14 \
-since ./frameworks/base/api/15.txt 15 \
+ -since ./frameworks/base/api/16.txt 16 \
-werror -hide 113 \
-overview $(LOCAL_PATH)/core/java/overview.html
@@ -522,7 +523,7 @@
## SDK version identifiers used in the published docs
# major[.minor] version for current SDK. (full releases only)
-framework_docs_SDK_VERSION:=4.0
+framework_docs_SDK_VERSION:=4.1
# release version (ie "Release x") (full releases only)
framework_docs_SDK_REL_ID:=1
diff --git a/core/java/android/app/MediaRouteButton.java b/core/java/android/app/MediaRouteButton.java
index 18713f5..5863ad0 100644
--- a/core/java/android/app/MediaRouteButton.java
+++ b/core/java/android/app/MediaRouteButton.java
@@ -25,6 +25,7 @@
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.media.MediaRouter;
+import android.media.MediaRouter.RouteGroup;
import android.media.MediaRouter.RouteInfo;
import android.util.AttributeSet;
import android.util.Log;
@@ -157,8 +158,13 @@
final int N = mRouter.getRouteCount();
int count = 0;
for (int i = 0; i < N; i++) {
- if ((mRouter.getRouteAt(i).getSupportedTypes() & mRouteTypes) != 0) {
- count++;
+ final RouteInfo route = mRouter.getRouteAt(i);
+ if ((route.getSupportedTypes() & mRouteTypes) != 0) {
+ if (route instanceof RouteGroup) {
+ count += ((RouteGroup) route).getRouteCount();
+ } else {
+ count++;
+ }
}
}
diff --git a/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java b/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java
index b747694..2da8bf1 100644
--- a/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java
+++ b/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java
@@ -70,7 +70,6 @@
};
MediaRouter mRouter;
- AudioManager mAudio;
private int mRouteTypes;
private LayoutInflater mInflater;
@@ -98,7 +97,6 @@
public void onAttach(Activity activity) {
super.onAttach(activity);
mRouter = (MediaRouter) activity.getSystemService(Context.MEDIA_ROUTER_SERVICE);
- mAudio = (AudioManager) activity.getSystemService(Context.AUDIO_SERVICE);
}
@Override
@@ -150,7 +148,7 @@
final RouteInfo selectedRoute = mRouter.getSelectedRoute(mRouteTypes);
if (selectedRoute.getVolumeHandling() == RouteInfo.PLAYBACK_VOLUME_VARIABLE) {
- final int maxVolume = mAudio.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
+ final int maxVolume = selectedRoute.getVolumeMax();
newValue = Math.max(0, Math.min(newValue, maxVolume));
selectedRoute.requestSetVolume(newValue);
}
diff --git a/core/java/com/android/internal/widget/SizeAdaptiveLayout.java b/core/java/com/android/internal/widget/SizeAdaptiveLayout.java
index 7687ad1..273f6fe 100644
--- a/core/java/com/android/internal/widget/SizeAdaptiveLayout.java
+++ b/core/java/com/android/internal/widget/SizeAdaptiveLayout.java
@@ -53,6 +53,7 @@
private static final String TAG = "SizeAdaptiveLayout";
private static final boolean DEBUG = false;
+ private static final boolean REPORT_BAD_BOUNDS = true;
private static final long CROSSFADE_TIME = 250;
// TypedArray indices
@@ -175,7 +176,7 @@
height = Math.min(height, lp.maxHeight);
}
- if (DEBUG && heightIn != height) {
+ if (REPORT_BAD_BOUNDS && heightIn != height) {
Log.d(TAG, this + "child view " + child + " " +
"measured out of bounds at " + heightIn +"px " +
"clamped to " + height + "px");
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index 94e9729..6b4b4d7 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -942,8 +942,8 @@
<string name="no" msgid="5141531044935541497">"Cancel·la"</string>
<string name="dialog_alert_title" msgid="2049658708609043103">"Atenció"</string>
<string name="loading" msgid="7933681260296021180">"S\'està carregant…"</string>
- <string name="capital_on" msgid="1544682755514494298">"Activa"</string>
- <string name="capital_off" msgid="6815870386972805832">"Desactiva"</string>
+ <string name="capital_on" msgid="1544682755514494298">"SÍ"</string>
+ <string name="capital_off" msgid="6815870386972805832">"NO"</string>
<string name="whichApplication" msgid="4533185947064773386">"Completa l\'acció mitjançant"</string>
<string name="alwaysUse" msgid="4583018368000610438">"Utilitza-ho de manera predeterminada per a aquesta acció."</string>
<string name="clearDefaultHintMsg" msgid="3252584689512077257">"Esborra els paràmetres predeterminats a Configuració del sistema > Aplicacions > Baixades."</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 9dd7c73..bf76ca1 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -942,8 +942,8 @@
<string name="no" msgid="5141531044935541497">"Скасувати"</string>
<string name="dialog_alert_title" msgid="2049658708609043103">"Увага"</string>
<string name="loading" msgid="7933681260296021180">"Завантаження..."</string>
- <string name="capital_on" msgid="1544682755514494298">"УВІМК."</string>
- <string name="capital_off" msgid="6815870386972805832">"ВИМК."</string>
+ <string name="capital_on" msgid="1544682755514494298">"УВІМК"</string>
+ <string name="capital_off" msgid="6815870386972805832">"ВИМК"</string>
<string name="whichApplication" msgid="4533185947064773386">"Завершити дію за доп."</string>
<string name="alwaysUse" msgid="4583018368000610438">"Використ. за умовч. для цієї дії."</string>
<string name="clearDefaultHintMsg" msgid="3252584689512077257">"Очистити налаштування за умовчанням у меню Налаштування системи > Програми > Завантажені."</string>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index f623d48..ccc85a3 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -862,4 +862,7 @@
[bootmode]:[original USB mode]:[USB mode used]-->
<integer-array translatable="false" name="config_oemUsbModeOverride">
</integer-array>
+
+ <!-- Set to true to add links to Cell Broadcast app from Settings and MMS app. -->
+ <bool name="config_cellBroadcastAppLinks">false</bool>
</resources>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 303cf78..4fbc45f 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -243,6 +243,7 @@
<java-symbol type="bool" name="config_allowActionMenuItemTextWithIcon" />
<java-symbol type="bool" name="config_bluetooth_adapter_quick_switch" />
<java-symbol type="bool" name="config_bluetooth_sco_off_call" />
+ <java-symbol type="bool" name="config_cellBroadcastAppLinks" />
<java-symbol type="bool" name="config_duplicate_port_omadm_wappush" />
<java-symbol type="bool" name="config_enable_emergency_call_while_sim_locked" />
<java-symbol type="bool" name="config_enable_puk_unlock_screen" />
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index da4d37a..325b6fe 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3552,11 +3552,11 @@
<!-- Name of the default audio route for tablets when nothing
is connected to a headphone or other wired audio output jack. [CHAR LIMIT=50] -->
- <string name="default_audio_route_name" product="tablet">Tablet speakers</string>
+ <string name="default_audio_route_name" product="tablet">Tablet</string>
<!-- Name of the default audio route when nothing is connected to
a headphone or other wired audio output jack. [CHAR LIMIT=50] -->
- <string name="default_audio_route_name" product="default">Phone speaker</string>
+ <string name="default_audio_route_name" product="default">Phone</string>
<!-- Name of the default audio route when wired headphones are
connected. [CHAR LIMIT=50] -->
diff --git a/docs/html/about/about_toc.cs b/docs/html/about/about_toc.cs
new file mode 100644
index 0000000..04cc5a3
--- /dev/null
+++ b/docs/html/about/about_toc.cs
@@ -0,0 +1,44 @@
+<ul id="nav">
+
+<li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot?>about/index.html">Welcome</a></div>
+ <ul>
+ <!-- <li><a href="<?cs var:toroot ?>about/marketplace.html">Open Marketplace</a></li>
+
+ <li><a href="<?cs var:toroot ?>about/flexible.html">Flexible Framework</a></li>
+ -->
+ <li><a href="<?cs var:toroot?>about/start.html">Get Started</a></li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>about/versions/android-4.0-highlights.html">
+ <span class="en">Ice Cream Sandwich</span></a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>about/versions/android-4.0.3.html">Android 4.0.3 APIs</a></li>
+ <li><a href="<?cs var:toroot ?>about/versions/android-4.0.html">Android 4.0 APIs</a> </li>
+ </ul>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>about/versions/android-3.0-highlights.html">
+ <span class="en">Honeycomb</span></a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>about/versions/android-3.2.html">Android 3.2 APIs</a></li>
+ <li><a href="<?cs var:toroot ?>about/versions/android-3.1.html">Android 3.1 APIs</a></li>
+ <li><a href="<?cs var:toroot ?>about/versions/android-3.0.html">Android 3.0 APIs</a> </li>
+ </ul>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>about/versions/android-2.3-highlights.html">
+ <span class="en">Gingerbread</span></a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>about/versions/android-2.3.4.html">Android 2.3.4 APIs</a></li>
+ <li><a href="<?cs var:toroot ?>about/versions/android-2.3.3.html">Android 2.3.3 APIs</a></li>
+ </ul>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header empty"><a href="<?cs
+var:toroot?>about/dashboards/index.html">Dashboards</a></div>
+ </li>
+
+</ul>
\ No newline at end of file
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd
new file mode 100644
index 0000000..c18d398
--- /dev/null
+++ b/docs/html/about/dashboards/index.jd
@@ -0,0 +1,235 @@
+page.title=Dashboards
+header.hide=1
+@jd:body
+
+
+
+<h2 id="Platform">Platform Versions</h2>
+
+<p>This page provides data about the relative number of active devices
+running a given version of the Android platform. This can help you
+understand the landscape of device distribution and decide how to prioritize
+the development of your application features for the devices currently in
+the hands of users. For information about how to target your application to devices based on
+platform version, read about <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API levels</a>.</p>
+
+
+<h3 id="PlatformCurrent">Current Distribution</h3>
+
+<p>The following pie chart and table is based on the number of Android devices that have accessed
+Google Play within a 14-day period ending on the data collection date noted below.</p>
+
+<div class="col-6" style="margin-left:0">
+
+
+<table>
+<tr>
+ <th>Version</th>
+ <th>Codename</th>
+ <th>API Level</th>
+ <th>Distribution</th>
+</tr>
+<tr><td><a href="/about/versions/android-1.5.html">1.5</a></td><td>Cupcake</td> <td>3</td><td>0.3%</td></tr>
+<tr><td><a href="/about/versions/android-1.6.html">1.6</a></td><td>Donut</td> <td>4</td><td>0.6%</td></tr>
+<tr><td><a href="/about/versions/android-2.1.html">2.1</a></td><td>Eclair</td> <td>7</td><td>5.2%</td></tr>
+<tr><td><a href="/about/versions/android-2.2.html">2.2</a></td><td>Froyo</td> <td>8</td><td>19.1%</td></tr>
+<tr><td><a href="/about/versions/android-2.3.html">2.3 - 2.3.2</a>
+ </td><td rowspan="2">Gingerbread</td> <td>9</td><td>0.4%</td></tr>
+<tr><td><a href="/about/versions/android-2.3.3.html">2.3.3 - 2.3.7
+ </a></td><!-- Gingerbread --> <td>10</td><td>64.6%</td></tr>
+<tr><td><a href="/about/versions/android-3.1.html">3.1</a></td>
+ <td rowspan="2">Honeycomb</td> <td>12</td><td>0.7%</td></tr>
+<tr><td><a href="/about/versions/android-3.2.html">3.2</a></td><!-- Honeycomb --><td>13</td><td>2%</td></tr>
+<tr><td><a href="/about/versions/android-4.0.html">4.0 - 4.0.2</a></td>
+ <td rowspan="2">Ice Cream Sandwich</td><td>14</td><td>0.4%</td></tr>
+<tr><td><a href="/about/versions/android-4.0.3.html">4.0.3 - 4.0.4</a> </td><!-- ICS --> <td>15</td><td>6.7%</td></tr>
+</table>
+
+
+</div>
+
+<div class="col-7" style="margin-right:0">
+<img alt=""
+src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:0.3,0.6,5.2,19.1,0.4,64.6,0.7,2.0,0.4,6.7&chl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3|Android%202.3.3|Android%203.1|Android%203.2|Android%204.0|Android%204.0.3&chco=c4df9b,6fad0c&chf=bg,s,00000000" />
+
+</div><!-- end dashboard-panel -->
+
+<p style="clear:both"><em>Data collected during a 14-day period ending on June 1, 2012</em></p>
+<!--
+<p style="font-size:.9em">* <em>Other: 0.1% of devices running obsolete versions</em></p>
+-->
+
+<h3 id="PlatformHistorical">Historical Distribution</h3>
+
+<p>The following stacked line graph provides a history of the relative number of
+active Android devices running different versions of the Android platform. It also provides a
+valuable perspective of how many devices your application is compatible with, based on the
+platform version.</p>
+
+<p>Notice that the platform versions are stacked on top of each other with the oldest active
+version at the top. This format indicates the total percent of active devices that are compatible
+with a given version of Android. For example, if you develop your application for
+the version that is at the very top of the chart, then your application is
+compatible with 100% of active devices (and all future versions), because all Android APIs are
+forward compatible. Or, if you develop your application for a version lower on the chart,
+then it is currently compatible with the percentage of devices indicated on the y-axis, where the
+line for that version meets the y-axis on the right.</p>
+
+<p>Each dataset in the timeline is based on the number of Android devices that accessed
+Google Play within a 14-day period ending on the date indicated on the x-axis.</p>
+
+<img alt="" height="250" width="660"
+src="http://chart.apis.google.com/chart?&cht=lc&chs=660x250&chxt=x,x,y,r&chxr=0,0,12|1,0,12|2,0,100|3,0,100&chxl=0%3A%7C12/01%7C12/15%7C01/01%7C01/15%7C02/01%7C02/15%7C03/01%7C03/15%7C04/01%7C04/15%7C05/01%7C05/15%7C06/01%7C1%3A%7C2011%7C%7C2012%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C2012%7C2%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25%7C3%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25&chxp=0,0,1,2,3,4,5,6,7,8,9,10,11,12&chxtc=0,5&chd=t:98.6,98.5,98.3,98.2,98.6,98.4,98.4,98.6,98.5,98.6,98.8,98.7,98.9|97.3,97.3,97.2,97.2,97.6,97.5,97.6,97.8,97.8,97.9,98.1,98.1,98.3|87.7,88.1,88.7,89.2,89.9,90.3,90.8,91.4,91.8,92.1,92.5,92.7,93.1|52.4,55.2,58.2,60.1,62.0,63.7,65.2,66.8,68.6,69.9,71.5,72.6,74.0|2.3,2.6,3.5,3.6,4.0,4.1,4.3,4.6,5.5,6.5,7.6,8.2,9.4|1.2,1.3,2.0,2.2,2.6,3.0,3.2,3.5,4.5,5.5,6.6,7.4,8.7|0.0,0.0,0.3,0.4,0.7,0.8,1.1,1.3,2.3,3.3,4.4,5.3,6.7&chm=b,c3df9b,0,1,0|b,b6dc7d,1,2,0|tAndroid%202.2,5b831d,2,0,15,,t::-5|b,aadb5e,2,3,0|tAndroid%202.3.3,496c13,3,0,15,,t::-5|b,9ddb3d,3,4,0|b,91da1e,4,5,0|b,80c414,5,6,0|B,6fad0c,6,7,0&chg=7,25&chdl=Android%201.6|Android%202.1|Android%202.2|Android%202.3.3|Android%203.1|Android%203.2|Android%204.0.3&chco=add274,a0d155,94d134,84c323,73ad18,62960f,507d08&chf=bg,s,00000000" />
+
+<p><em>Last historical dataset collected during a 14-day period ending on June 1, 2012</em></p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h2 id="Screens">Screen Sizes and Densities</h2>
+
+<p>This section provides data about the relative number of active devices that have a particular
+screen configuration, defined by a combination of screen size and density. To simplify the way that
+you design your user interfaces for different screen configurations, Android divides the range of
+actual screen sizes and densities into:</p>
+
+<ul>
+<li>A set of four generalized <strong>sizes</strong>: <em>small</em>, <em>normal</em>,
+<em>large</em>, and <em>xlarge</em></em></li>
+<li>A set of four generalized <strong>densities</strong>: <em>ldpi</em> (low), <em>mdpi</em>
+(medium), <em>hdpi</em> (high), and <em>xhdpi</em> (extra high)</li>
+</ul>
+
+<p>For information about how you can support multiple screen configurations in your
+application, see <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
+Screens</a>.</p>
+
+<p class="note"><strong>Note:</strong> This data is based on the number
+of Android devices that have accessed Google Play within a 7-day period
+ending on the data collection date noted below.</p>
+
+
+<div class="col-6" style="margin-left:0">
+
+
+<table>
+<tr>
+<th></th>
+<th scope="col">ldpi</th>
+<th scope="col">mdpi</th>
+<th scope="col">hdpi</th>
+<th scope="col">xhdpi</th>
+</tr>
+<tr><th scope="row">small</th>
+<td>2.3%</td> <!-- small/ldpi -->
+<td></td> <!-- small/mdpi -->
+<td>2.4%</td> <!-- small/hdpi -->
+<td></td> <!-- small/xhdpi -->
+</tr>
+<tr><th scope="row">normal</th>
+<td>0.7%</td> <!-- normal/ldpi -->
+<td>26.2%</td> <!-- normal/mdpi -->
+<td>57.8%</td> <!-- normal/hdpi -->
+<td>0.9%</td> <!-- normal/xhdpi -->
+</tr>
+<tr><th scope="row">large</th>
+<td>0.3%</td> <!-- large/ldpi -->
+<td>2%</td> <!-- large/mdpi -->
+<td></td> <!-- large/hdpi -->
+<td></td> <!-- large/xhdpi -->
+</tr>
+<tr><th scope="row">xlarge</th>
+<td></td> <!-- xlarge/ldpi -->
+<td>7.4%</td> <!-- xlarge/mdpi -->
+<td></td> <!-- xlarge/hdpi -->
+<td></td> <!-- xlarge/xhdpi -->
+</tr>
+</table>
+
+
+</div>
+
+<div class="col-7" style="margin-right:0">
+<img alt=""
+src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=Xlarge%20/%20mdpi|Large%20/%20ldpi|Large%20/%20mdpi|Normal%20/%20hdpi|Normal%20/%20ldpi|Normal%20/%20mdpi|Normal%20/%20xhdpi|Small%20/%20hdpi|Small%20/%20ldpi&chd=t%3A7.4,0.3,2.0,57.8,0.7,26.2,0.9,2.4,2.3&chf=bg,s,00000000" />
+
+</div>
+
+<p style="clear:both"><em>Data collected during a 7-day period ending on May 1, 2012</em></p>
+
+
+
+
+
+
+
+
+
+
+
+<h2 id="OpenGL">Open GL Version</h2>
+
+<p>This section provides data about the relative number of active devices that support a particular
+version of OpenGL ES. Note that support for one particular version of OpenGL ES also implies
+support for any lower version (for example, support for version 2.0 also implies support for
+1.1).</p>
+
+<p>To declare which version of OpenGL ES your application requires, you should use the {@code
+android:glEsVersion} attribute of the <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
+element. You can also use the <a
+href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html">{@code
+<supports-gl-texture>}</a> element to declare the GL compression formats that your application
+uses.</p>
+
+<p class="note"><strong>Note:</strong> This data is based on the number
+of Android devices that have accessed Google Play within a 7-day period
+ending on the data collection date noted below.</p>
+
+
+<div class="col-6" style="margin-left:0">
+<table>
+<tr>
+<th scope="col">OpenGL ES Version</th>
+<th scope="col">Distribution</th>
+</tr>
+<tr>
+<td>1.1 only</th>
+<td>9.9%</td>
+</tr>
+<tr>
+<td>2.0 & 1.1</th>
+<td>90.1%</td>
+</tr>
+</table>
+</div>
+
+<div class="col-7" style="margin-right:0">
+<img alt=""
+src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=GL%201.1%20only|GL% 202.0%20%26%201.1&chd=t%3A9.9,90.1&chf=bg,s,00000000" />
+
+</div>
+
+
+<p style="clear:both"><em>Data collected during a 7-day period ending on June 4, 2012</em></p>
diff --git a/docs/html/about/flexible.jd b/docs/html/about/flexible.jd
new file mode 100644
index 0000000..ec3a44c
--- /dev/null
+++ b/docs/html/about/flexible.jd
@@ -0,0 +1,34 @@
+page.title=Flexible Framework
+walkthru=1
+
+@jd:body
+
+<style>
+blockquote {
+ color:#9933CC;
+}
+</style>
+
+<blockquote>Android's flexible framework means it runs on more devices and reaches more
+users</blockquote>
+
+<p>Android powers millions of devices around the world and in a variety of form-factors. The Android
+framework is specially built to run apps on more than just one screen size and hardware
+configuration. As an app developer, Android's scale and variety offers you the potential to quickly
+reach millions of users.</p>
+
+<p>Android apps are flexible and easily adapt to the device on which they are running. Although the
+system scales your assets when necessary, you can provide alternative app resources that are
+optimized for specific device categories, such as the screen size and density. Android applies the
+appropriate resources when running your app, based on the current device’s configuration.</p>
+
+<blockquote>You're in control of which devices can install your app</blockquote>
+
+<p>Some devices provide a different user experience when using apps, but you’re always in control of
+how your app behaves on each device. If you publish your app on Google Play, you also have
+control over which kinds of devices are allowed to install your app and you can closely control how
+your app is distributed.</p>
+
+<p>Every device that includes Google Play has been certified compatible. This means that
+the device has passed a rigorous test suite to ensure that the device uses a version of Android that
+supports all the platform APIs and will successfully run your app.</p>
\ No newline at end of file
diff --git a/docs/html/about/index.jd b/docs/html/about/index.jd
new file mode 100644
index 0000000..c2d6426
--- /dev/null
+++ b/docs/html/about/index.jd
@@ -0,0 +1,157 @@
+page.title=Android, the world's most popular mobile platform
+walkthru=0
+header.hide=0
+
+@jd:body
+
+<div style="position:absolute;width:440px;">
+<p>Android powers hundreds of millions of mobile devices in more than 190
+countries around the world. It's the largest installed base of any mobile platform
+and growing fast—every day another 900,000 users power up their
+Android devices for the first time and start looking for apps, games,
+and other digital content. </p>
+
+<div style="width:330px">
+<p>Android gives you a world-class platform for creating apps and games for
+Android users everywhere, as well as an open marketplace for distributing
+to them instantly.</p>
+</div>
+</div>
+
+<img src="{@docRoot}images/about/growth-chart.png" alt="" height="400" width="681"
+style="margin:20px 0 10px 30px;" />
+<div style="position:relative;left: 450px;width: 250px;top: -20px;color: #777;">
+ <em>Android growth in device activations</em></div>
+
+
+<h3>Global partnerships and large installed base</h3>
+
+<p>Building on the contributions of the open-source Linux community and more
+than 300 hardware, software, and carrier partners, Android has rapidly become
+the fastest-growing mobile OS.</p>
+
+<blockquote>Every day more than 900,000 new Android devices are activated worldwide.</blockquote>
+
+<p>Android’s openness has made it a favorite for consumers and developers alike,
+driving strong growth in app consumption. Android users download more than
+1 billion apps and games from Google Play each month. </p>
+
+<p>With it's partners, Android is continuously pushing the boundaries of hardware and software
+forward to bring new capabilities to users and developers. For developers,
+Android innovation lets you build powerful, differentiated applications
+that use the latest mobile technologies.</p>
+
+<!-- <h3>Rapid innovation</h3>
+
+<p>Android is continuously pushing the boundaries of hardware and software
+forward, to bring new capabilities to users and developers. For developers, the
+rapid evolution of Android technology lets you stay in front with powerful,
+differentiated applications.</p>
+
+<p>Android gives you access to the latest technologies and innovations across a
+multitude of device form-factors, chipset architectures, and price points. From
+multicore processing and high-performance graphics to state-of-the-art sensors,
+vibrant touchscreens, and emerging mobile technologies such as Near Field
+Communication (NFC), Wi-Fi Direct, and face tracking.</p> -->
+
+<h3>Powerful development framework</h3>
+
+<blockquote>Easily optimize a single binary for phones, tablets, and other devices.</blockquote>
+
+<p>Android gives you everything you need to build best-in-class app experiences.
+It gives you a single application model that lets you deploy
+your apps broadly to hundreds of millions of users across a wide range of
+devices—from phones to tablets and beyond.</p>
+
+<p>Android also gives you tools for creating apps that look great and take
+advantage of the hardware capabilities available on each device. It
+automatically adapts your UI to look it's best on each device, while giving you
+as much control as you want over your UI on different device
+types. </p>
+
+<p>For example, you can create a single app binary that's optimized for
+both phone and tablet form factors. You declare your UI in lightweight sets of XML
+resources, one set for parts of the UI that are common to all form factors and
+other sets for optimzations specific to phones or tablets.
+At runtime, Android applies the correct resource sets based on its screen size,
+density, locale,
+and so on.</p>
+
+
+<p>To help you develop efficiently, the <a href="{@docRoot}tools/index.html">Android
+ Developer Tools</a>
+offers a full Java IDE with advanced features for developing, debugging, and
+packaging Android apps. Using the IDE, you can develop on any available Android
+device or create virtual devices that emulate any hardware configuration.</p>
+
+<blockquote>A billion downloads a month and growing. Get your apps in front
+of millions of users at Google's scale.</blockquote>
+
+<h3>Open marketplace for distributing your apps</h3>
+
+<p>Google Play is the premier marketplace for selling and distributing Android apps.
+When you publish an app on Google Play, you reach the huge installed base of
+Android.</p>
+
+<div style="float:left;margin-right:24px;margin-top:12px;">
+<img src="{@docRoot}images/gp-device.png">
+</div>
+
+<p>As an open marketplace, Google Play puts you in control of how you sell your
+products. You can publish whenever you want, as often as you want, and to the
+customers you want. You can distribute broadly to all markets and
+devices or focus on specific segments, devices, or ranges of hardware
+capabilities.</p>
+
+<p>You can monetize in the way that works best for your business—priced or
+free, with in-app products or subscriptions—for highest engagement and
+revenues. You also have complete control of the pricing for your apps
+and in-app products and can set or change prices in any supported currency at
+any time.<p>
+
+<p>Beyond growing your customer base, Google Play helps you build visibility and
+engagement across your apps and brand. As your apps rise in popularity, Google
+Play gives them higher placement in weekly "top" charts and rankings, and for
+the best apps promotional slots in curated collections.
+</p>
+
+<p>Preinstalled on hundreds of millions of Android devices around the world,
+Google Play can be a growth engine for your business.</p>
+
+<p><a class="landing-page-link" href="{@docRoot}about/start.html">GET STARTED</a></p>
+
+<div style="background: #F0F0F0;
+ border-top: 1px solid #DDD;
+ padding: 20px 0 24px 0;
+ overflow: auto;
+ clear:both;
+ margin-bottom:-10px;
+ margin-top:60px;"">
+ <div style="padding:0 0 0 29px;">
+ <h4>Developer Story: Robot Invader</h4>
+ <img alt="" class="screenshot thumbnail" style="-webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px height:78px;
+ width: 78px;
+ float: left;
+ margin: 17px 20px 9px 0;" src=
+ "//g0.gstatic.com/android/market/com.robotinvader.knightmare/hi-256-0-9e08d83bc8d01649e167131d197ada1cd1783fb0">
+ <div style="width:700px;">
+ <p style="margin-top:26px;margin-bottom:12px;">Robot Invader chose
+ Android as the launch platform for their first game,
+ <a data-g-event="Developers Page" data-g-label="Case Study Link" href=
+ "//play.google.com/store/apps/details?id=com.robotinvader.knightmare"><em>Wind-up
+ Knight</em></a>.
+ </p>
+ <p>
+ Hear from the developers themselves how Android helped them reach more
+ than 100 devices with a single app binary, then iterate rapidly to ensure
+ a great experience for users.
+ </p>
+ </div>
+ <iframe style="float:left;
+ margin-right:24px;
+ margin-top:14px;" width="700" height="394" src=
+ "http://www.youtube.com/embed/hTtlLiUTowY" frameborder="0" allowfullscreen></iframe>
+ </div>
+</div>
\ No newline at end of file
diff --git a/docs/html/about/marketplace.jd b/docs/html/about/marketplace.jd
new file mode 100644
index 0000000..34f57a5
--- /dev/null
+++ b/docs/html/about/marketplace.jd
@@ -0,0 +1,62 @@
+page.title=Open Marketplace
+walkthru=1
+
+@jd:body
+
+<style>
+blockquote {
+ color:#9933CC;
+}
+</style>
+
+<p>Android offers an open distribution model, not a walled garden. Once you’ve developed an
+app for Android and want to distribute it, you have choice.</p>
+
+<p>Your final application is contained in an APK file that you can make available to users any
+way you want. For example, you can upload it to your own web site to allow visitors to
+install it onto their devices. More often, you’ll want to use a trusted
+marketplace where users can discover and search for your apps.</p>
+
+<p>How you choose to distribute your app affects precisely how many users your app will reach. Which
+distribution provider you choose also affects the kinds of services available to you as a publisher,
+such as licensing and in-app billing APIs, user bug reports, installation analytics, marketing
+services, and more.</p>
+
+<p>Among your choices is Google Play, the premier marketplace for selling and distributing apps
+to Android users around the world. When you publish an app on Google Play, you reach hundreds of
+millions of customers in over 130 countries.</p>
+
+
+<h3>Your business, your customers</h3>
+
+<blockquote>Google Play makes your apps available to your customers
+immediately</blockquote>
+
+<p>As an open marketplace, Google Play puts you in control of your business and makes it easy for
+you to manage how you sell your products. You can publish whenever you want, as often as you want,
+and to the exact set of customers you want.</p>
+
+
+<h3>Visibility for your apps</h3>
+
+<p>Beyond growing your customer base, Google Play helps you build visibility and engagement across
+your apps and brand. As your apps rise in popularity, Google Play gives you higher placement in
+weekly "top" lists and offers promotional slots in curated collections. You can engage customers
+using rich, colorful product pages that feature app screenshots, videos, and user reviews, as well
+as cross-marketing links to your other products.</p>
+
+<h3>Flexible monetizing and distribution</h3>
+
+<blockquote class="right">You can distribute
+your apps free or priced and you can sell in-app products for additional revenue</blockquote>
+
+<p>Google Play offers a choice of monetizing options to meet your business needs. You control the
+pricing of your apps and in-app products—you can set and change prices at any time, even
+individually in local currencies around the world. On purchase, Google Play handles transactions in
+the buyer’s currency and makes payouts in your own currency.</p>
+
+
+<p>After publishing, you can manage the distribution of your app. You can distribute broadly to all
+markets and devices or focus on specific segments, devices, or ranges of hardware capabilities.
+Google Play provides the tools for controlling distribution and ensures that your app is available
+only to the users who you are targeting.</p>
diff --git a/docs/html/about/start.jd b/docs/html/about/start.jd
new file mode 100644
index 0000000..af8344d
--- /dev/null
+++ b/docs/html/about/start.jd
@@ -0,0 +1,63 @@
+page.title=Get Started
+walkthru=0
+
+@jd:body
+
+<p>Everything you need to start developing apps for Android is available here on
+developer.android.com. You'll find everything from the developer SDK, API documentation, and design
+guidelines, to information about the current device landscape and how you can distribute and
+monetize your app.</p>
+
+<p>No two apps are built in the same way, but we've structured the information you need to build an
+app into the following three sections that represent the general order for app development.
+
+
+<style>
+h2.blue{color:#33B5E5}
+h2.blue+hr{background:#33B5E5}
+
+h2.orange{color:#FF8800}
+h2.orange+hr{background:#FF8800}
+
+h2.green{color:#99CC00}
+h2.green+hr{background:#99CC00}
+</style>
+
+<div class="col-4" style="margin-left:0">
+<h2 class="blue">1. Design</h2>
+
+<p>Before you write a single line of code, you need to design the user interface and make it fit
+the Android user experience. Although you may know what a user will <em>do</em> with your app, you
+should pause to focus on how a user will <em>interact</em> with it. Your design should be sleek,
+simple, powereful, and tailored to the Android experience.</p>
+
+<p>So whether your a one-man shop or a large team, you should study the <a
+href="{@docRoot}design/index.html">Design</a> guidelines first.</p>
+</div>
+
+<div class="col-5">
+<h2 class="orange">2. Develop</h2>
+<p>Once your design is finalized, all you need are the tools to turn your app ideas into reality.
+Android's framework provides you the APIs to build apps that take full advantage of
+device hardware, connected accessory devices, the Internet, software features, and more.
+With the power of Android, there's no limit to the power of your apps.</p>
+
+<p>Everything you need to learn about the app framework and developer tools is in the <a
+href="{@docRoot}develop/index.html">Develop</a> documentation.</p>
+
+</div>
+
+
+<div class="col-4" style="margin-right:0">
+<h2 class="green">3. Distribute</h2>
+<p>Now your app is complete. You've built it to support a variety of screen sizes and
+densities, and tested it on the Android emulator and on real devices. You're ready to ship your app.</p>
+
+<p>How you proceed depends on a variety of factors, such as your monetization strategy and which
+types of devices your app supports. Everything you need to get started with this process is
+available in the <a href="{@docRoot}distribute/index.html">Distribute</a> section.</p>
+</div>
+
+
+<p style="clear:both">Now that you know what's available, get started by installing the <a
+href="{@docRoot}sdk/index.html">Android SDK</a>.</p>
\ No newline at end of file
diff --git a/docs/html/sdk/android-1.1.jd b/docs/html/about/versions/android-1.1.jd
similarity index 100%
rename from docs/html/sdk/android-1.1.jd
rename to docs/html/about/versions/android-1.1.jd
diff --git a/docs/html/sdk/android-1.5-highlights.jd b/docs/html/about/versions/android-1.5-highlights.jd
similarity index 100%
rename from docs/html/sdk/android-1.5-highlights.jd
rename to docs/html/about/versions/android-1.5-highlights.jd
diff --git a/docs/html/about/versions/android-1.5.jd b/docs/html/about/versions/android-1.5.jd
new file mode 100644
index 0000000..78dcbd7
--- /dev/null
+++ b/docs/html/about/versions/android-1.5.jd
@@ -0,0 +1,375 @@
+page.title=Android 1.5 Platform
+sdk.platform.version=1.5
+sdk.platform.apiLevel=3
+sdk.platform.majorMinor=major
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#features">Platform Highlights</a></li>
+ <li><a href="#relnotes">Revisions</a></li>
+ <li><a href="#api-level">API Level</a></li>
+ <li><a href="#api">Framework API Changes</a>
+ <li><a href="#apps">Built-in Applications</a></li>
+ <li><a href="#locs">Locales</a></li>
+ <li><a href="#skins">Emulator Skins</a></li>
+
+ </ol>
+ </li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+<h2>See Also</h2>
+<ol>
+ <li><a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>
+<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release
+deployable to Android-powered handsets starting in May 2009.
+The release includes new features for users and developers, as well as changes
+in the Android framework API. </p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes a
+fully compliant Android library and system image, as well as a set of emulator
+skins, sample applications, and more. The downloadable platform is fully
+compliant and includes no external libraries. </p>
+
+<p>To get started developing or testing against the Android
+{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
+download the platform into your Android 1.6 or later SDK. For more information,
+see <a href="{@docRoot}sdk/exploring.html">Exploring the
+SDK</a>.</p>
+
+
+<h2 id="features">Platform Highlights</h2>
+
+<p>For a list of new user features and platform highlights, see the <a
+href="http://developer.android.com/about/versions/android-{@sdkPlatformVersion}-highlights.html">Android
+{@sdkPlatformVersion} Platform Highlights</a> document.</p>
+
+<h2 id="relnotes">Revisions</h2>
+
+<p>The sections below provide notes about successive releases of
+the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
+revision number. To determine what revision(s) of the Android
+{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
+the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
+
+<script type="text/javascript">
+function toggleDiv(link) {
+ var toggleable = $(link).parent();
+ if (toggleable.hasClass("closed")) {
+ //$(".toggleme", toggleable).slideDown("fast");
+ toggleable.removeClass("closed");
+ toggleable.addClass("open");
+ $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
+ } else {
+ //$(".toggleme", toggleable).slideUp("fast");
+ toggleable.removeClass("open");
+ toggleable.addClass("closed");
+ $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
+ }
+ return false;
+}
+</script>
+<style>
+.toggleable {
+ padding: .25em 1em 0em 1em;
+ margin-bottom: 0;
+}
+.toggleme {
+ padding: 1em 1em 0 2em;
+ line-height:1em;
+}
+.toggleable a {
+ text-decoration:none;
+}
+.toggleme a {
+ text-decoration:underline;
+}
+.toggleable.closed .toggleme {
+ display:none;
+}
+#jd-content .toggle-img {
+ margin:0;
+}
+</style>
+
+<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" />
+ Android 1.5, Revision 4</a> <em>(May 2010)</em></a>
+ <div class="toggleme">
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires SDK Tools r6 or higher.</p>
+</dd>
+
+<dt>Tools:</dt>
+<dd>
+<ul>
+<li>Adds support for library projects in the Ant build system.</li>
+<li>Fixes test project build in the Ant build system.</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" />
+ Android 1.5, Revision 3</a> <em>(July 2009)</em></a>
+ <div class="toggleme">
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires SDK Tools r3 or higher.</p>
+</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" />
+ Android 1.5, Revision 2</a> <em>(May 2009)</em></a>
+ <div class="toggleme">
+<p>Not available as an SDK component — please use Android 1.5, r3 instead. </p>
+ </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" />
+ Android 1.5, Revision 1</a> <em>(April 2009)</em></a>
+ <div class="toggleme">
+<p>Not available as an SDK component — please use Android 1.5, r3 instead. </p>
+ </div>
+</div>
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
+the framework API. The Android {@sdkPlatformVersion} API
+is assigned an integer identifier —
+<strong>{@sdkPlatformApiLevel}</strong> — that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your
+application, you need to set the proper value, "{@sdkPlatformApiLevel}", in the
+<code>android:minSdkVersion</code> attributes of the <code><uses-sdk></code>
+element in your application's manifest. </p>
+
+<p>For more information about how to use API Level, see the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Levels</a> document. </p>
+
+
+<h2 id="api">Framework API Changes</h2>
+
+<p>The sections below provide information about the application framework API provided by the Android {@sdkPlatformVersion} platform. </p>
+
+<h3>UI framework</h3>
+ <ul>
+ <li>Framework for easier background/UI thread interaction</li>
+ <li>New {@link android.widget.SlidingDrawer SlidingDrawer} widget</li>
+ <li>New {@link android.widget.HorizontalScrollView HorizontalScrollview} widget</li>
+ </ul>
+
+<h3>AppWidget framework</h3>
+ <ul>
+ <li>APIs for creating secure home screen {@link android.appwidget
+AppWidgets}. For information about how to use AppWidgets, see the Developer's
+Guide <a href="{@docRoot}guide/topics/appwidgets/index.html">AppWidgets</a>
+documentation. Also see <a
+href="http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html">
+Introducing home screen widgets and the AppWidget
+framework</a> on the Android Developer's Blog.</li>
+ <li>APIs for populating {@link android.provider.LiveFolders Live Folders}
+ with custom content.</li>
+ </ul>
+
+<h3>Media framework</h3>
+ <ul>
+ <li>Raw audio recording and playback APIs</li>
+ <li>Interactive MIDI playback engine</li>
+ <li>Video recording APIs for developers (3GP format)</li>
+ <li>Video and photo sharing Intents</li>
+ <li>Media search Intent</li>
+ </ul>
+
+<h3>Input Method framework </h3>
+ <ul>
+ <li>{@link android.inputmethodservice.InputMethodService Input Method
+ Service} framework</li>
+ <li>Text-prediction engine</li>
+ <li>Ability to provide downloadable IMEs to users</li>
+ </ul>
+
+<h3>Application-defined hardware requirements</h3>
+
+<p>Applications can now use a new element in their manifest files, <a
+href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><code><uses-configuration></code></a>
+ to indicate to the Android system what hardware features
+they require in order to function properly. For example, an application might
+use the element to specify that it requires a physical keyboard or a particular
+navigation device, such as a trackball. Prior to installing the application, the
+Android system checks the attributes defined for the
+<code><uses-configuration></code> element and allows the installation to
+continue only if the required hardware is present.</p>
+
+<h3>Speech recognition framework</h3>
+ <ul>
+ <li>Support for using speech recognition libraries via Intent. See {@link
+android.speech.RecognizerIntent RecognizerIntent}.</li>
+ </ul>
+
+<h3>Miscellaneous API additions</h3>
+ <ul>
+ <li>LocationManager - Applications can get location change updates via
+ Intent</li>
+ <li>WebView - Touch start/end/move/cancel DOM event support</li>
+ <li>Redesigned {@link android.hardware.SensorManager Sensor Manager
+ APIs}</li>
+ <li>GLSurfaceView - convenience framework for creating OpenGL
+ applications</li>
+ <li>Broadcast Intent for app update install succeeded - for smoother app
+ upgrade experience</li>
+ </ul>
+
+
+<h3 id="api-diff">API differences report</h3>
+
+<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
+the previous version, see the <a href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report</a>.</p>
+
+
+<h2 id="apps">Built-in Applications</h2>
+
+<p>The system image included in the downloadable platform provides these
+built-in applications:</p>
+
+<table style="border:0;padding-bottom:0;margin-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+ <ul>
+ <li>Alarm Clock</li>
+ <li>Browser</li>
+ <li>Calculator</li>
+ <li>Camcorder</li>
+ <li>Camera</li>
+ <li>Contacts</li>
+ <li>Custom Locale (developer app)</li>
+ <li>Dev Tools (developer app)</li>
+ </ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+ <ul>
+ <li>Dialer</li>
+ <li>Email</li>
+ <li>Gallery</li>
+ <li>IME for Japanese text input</li>
+ <li>Messaging</li>
+ <li>Music</li>
+ <li>Settings</li>
+ <li>Spare Parts (developer app)</li>
+ </ul>
+</td>
+</tr>
+</table>
+
+<h2 id="locs" style="margin-top:.75em;">Locales</h2>
+
+<p>The system image included in the downloadable platform provides a variety of
+built-in locales. In some cases, region-specific strings are available for the
+locales. In other cases, a default version of the language is used. The
+languages that are available in the Android {@sdkPlatformVersion} system
+image are listed below (with <em>language</em>_<em>country/region</em>
+locale descriptor).</p>
+
+<table style="border:0;padding-bottom:0;margin-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+<ul>
+<li>Chinese, PRC (zh_CN)</li>
+<li>Chinese, Taiwan (zh_TW)</li>
+<li>Czech (cs_CZ)</li>
+<li>Dutch, Netherlands (nl_NL)</li>
+<li>Dutch, Belgium (nl_BE)</li>
+<li>English, US (en_US)</li>
+<li>English, Britain (en_GB)</li>
+<li>English, Canada (en_CA)</li>
+<li>English, Australia (en_AU)</li>
+<li>English, New Zealand (en_NZ)</li>
+<li>English, Singapore(en_SG)</li>
+<li>French, France (fr_FR)</li>
+<li>French, Belgium (fr_BE)</li>
+</ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+<li>French, Canada (fr_CA)</li>
+<li>French, Switzerland (fr_CH)</li>
+<li>German, Germany (de_DE)</li>
+<li>German, Austria (de_AT)</li>
+<li>German, Switzerland (de_CH)</li>
+<li>German, Liechtenstein (de_LI)</li>
+<li>Italian, Italy (it_IT)</li>
+<li>Italian, Switzerland (it_CH)</li>
+<li>Japanese (ja_JP)</li>
+<li>Korean (ko_KR)</li>
+<li>Polish (pl_PL)</li>
+<li>Russian (ru_RU)</li>
+<li>Spanish (es_ES)</li>
+</td>
+</tr>
+</table>
+
+<p>Localized UI strings match the locales that are accessible
+through Settings.</p>
+
+<h2 id="skins">Emulator Skins</h2>
+
+<p>The downloadable platform includes a set of emulator skins that you can use for modeling your application in different screen sizes and resolutions. The emulator skins are: </p>
+
+<ul>
+ <li>
+ QVGA-P (240x320, low density, small screen)
+ </li>
+ <li>
+ QVGA-L (320x480, low density, small screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ HVGA-P (320x480, medium density, normal screen)
+ </li>
+ <li>
+ HVGA-L (320x480, medium density, normal screen)
+ </li>
+</ul>
+
+<p>For more information about how to develop an application that displays and functions properly on all Android-powered devices, see <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
diff --git a/docs/html/about/versions/android-1.6-highlights.jd b/docs/html/about/versions/android-1.6-highlights.jd
new file mode 100644
index 0000000..2ee1d80
--- /dev/null
+++ b/docs/html/about/versions/android-1.6-highlights.jd
@@ -0,0 +1,213 @@
+page.title=Android 1.6 Platform Highlights
+sdk.date=September 2009
+
+@jd:body
+
+
+<style type="text/css">
+#jd-content div.screenshot,
+#jd-content div.video {
+ float:right;
+ clear:right;
+ padding:15px 70px;
+ font-size:.9em;
+ font-weight:bold;
+ line-height:1.7em;
+}
+#jd-content div.video {
+ padding-top:0;
+ margin-top:-15px;
+}
+#jd-content div.screenshot img {
+ margin:0;
+}
+</style>
+
+<div class="video">
+<object width="278" height="180">
+<param name="movie" value="http://www.youtube.com/v/MBRFkLKRwFw&hl=en&fs=1&"></param>
+<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
+<embed src="http://www.youtube.com/v/MBRFkLKRwFw&hl=en&fs=1&" type="application/x-shockwave-flash"
+allowscriptaccess="always" allowfullscreen="true" width="278" height="180"></embed>
+</object>
+</div>
+
+
+<p>The Android 1.6 platform introduces new features for users and developers.
+This page provides an overview of some new features and technologies.</p>
+
+<ul>
+ <li><a href="#UserFeatures">New User Features</a></li>
+ <li><a href="#GooglePlayUpdates">Google Play Updates</a></li>
+ <li><a href="#PlatformTechnologies">New Platform Technologies</a></li>
+</ul>
+
+
+
+<h2 id="UserFeatures" style="clear:right">New User Features</h2>
+
+<!-- screenshots float right -->
+
+<div class="screenshot">
+<img src="images/search.png" class="screenshot" alt="" /><br/>
+Quick Search Box
+</div>
+
+<div class="screenshot">
+<img src="images/camera.png" class="screenshot" alt="" /><br/>
+New Camera/Camcorder UI
+</div>
+
+<div class="screenshot">
+<img src="images/battery.png" class="screenshot" alt="" /><br/>
+Battery Usage Indicator
+</div>
+
+
+<h3 id="QuickSearchBox">Quick Search Box for Android</h3>
+
+<p>Android 1.6 includes a redesigned search framework that provides a quick,
+effective, and consistent way for users to search across multiple sources—such as
+browser bookmarks & history, contacts, and the web—directly from
+the home screen.</p>
+
+<p>The system constantly learns which search results are more relevant based on what is
+clicked. So popular contacts or apps that have previously been picked will bubble up to
+the top when a user types the first few letters of a relevant query.</p>
+
+<p>The search framework also provides developers a way to easily expose relevant
+content from their applications in Quick Search Box.</p>
+
+<h3 id="Camera">Camera, Camcorder, and Gallery</h3>
+
+<p>An updated user interface provides an integrated camera, camcorder, and gallery experience.
+Users can quickly toggle between still and video capture modes. Additionally, the gallery
+enables users to select multiple photos for deletion.</p>
+
+<p>Android 1.6 also provides a much faster camera experience.
+Compared to the previous release, launching the camera is now 39% faster,
+and there is a 28% improvement in the time from completing one shot to the next.</p>
+
+
+<h3 id="VPN">VPN, 802.1x</h3>
+
+<p>A new Virtual Private Network (VPN) control panel in Settings allows users
+to configure and connect to the following types of VPNs:</p>
+
+<ul>
+ <li>L2TP/IPSEC pre-shared key based VPN</li>
+ <li>L2TP/IPsec certificate based VPN</li>
+ <li>L2TP only VPN</li>
+ <li>PPTP only VPN</li>
+</ul>
+
+
+<h3 id="Battery">Battery usage indicator</h3>
+
+<p>A new battery usage screen lets users see which apps and services are consuming
+battery power. If the user determines that a particular service or application is
+using too much power, they can take action to save the battery by
+adjusting settings, stopping the application, or uninstalling the application.</p>
+
+
+<h3 id="A11y">Accessibility</h3>
+
+<p>Users will be able to download new accessibility services built
+on the new accessibility framework and enable them in Settings.</p>
+
+
+
+
+<h2 id="GooglePlayUpdates" style="clear:right">Google Play Updates</h2>
+
+<div class="screenshot" style="margin-top:-35px">
+<img src="images/market.png" class="screenshot" alt="" /><br/>
+New Google Play UI
+</div>
+
+<p>For devices with Google Play, the latest version improves the overall user experience and makes
+it easier for users to discover great apps and games from developers.</p>
+
+<ul>
+ <li>At the homescreen, users can choose among <em>Apps</em>, <em>Games</em>, and <em>Downloads</em>.</li>
+ <li>Inside a category, users can explore titles that are <em>Top paid</em>, <em>Top free</em>, and <em>Just in</em>.</li>
+ <li>For each title, users can now see screenshots submitted by developers in addition to
+ reviews from other users.</li>
+</ul>
+
+
+
+
+<h2 id="PlatformTechnologies" style="clear:right">New Platform Technologies</h2>
+
+<h3 id="SearchFramework">Expanded Search Framework</h3>
+
+<p>The Android search framework has been redesigned and expanded to provide
+third-party applications the opportunity to surface
+content from their applications in Quick Search Box, the global search tool.
+To do this, developers will need to make their app "searchable" and provide
+suggestions in response to user queries.
+To enable application search suggestions, users simply select each application from which
+they'd like to receive suggestions, under Searchable items in the Search settings.</p>
+
+
+<h3 id="TTS">Text-to-speech engine</h3>
+
+<p>Android 1.6 features a multi-lingual speech synthesis engine called Pico.
+It allows any Android application to "speak" a string of text with an accent that matches the language.
+The engine supports the following languages: English (American and British accents), French,
+Italian, German and Spanish. If you're using a T-Mobile G1 or Dream device, you'll need to download the
+SpeechSynthesis Data Installer from Google Play, which includes the "voices" needed by the
+text-to-speech engine.</p>
+
+
+<h3 id="Gestures">Gestures</h3>
+
+<p>A new gestures framework provides application developers with a framework for creating, storing,
+loading, and recognizing gestures and associating them with specific actions.</p>
+
+<p>Developers can use the new GestureBuilder tool included in the Android 1.6 SDK to generate libraries
+of gestures to include with their application.</p>
+
+
+<h3 id="A11y">Accessibility</h3>
+
+<p>Android 1.6 provides a new accessibility framework.
+With this framework, developers can create accessibility plugins that respond to user input,
+such as making a sound when a new window is shown, vibrating when navigating to the top of
+a list, and providing spoken feedback.</p>
+
+
+<h3 id="Screens">Expanded support for screen densities and resolutions</h3>
+
+<p>Android 1.6 adds screen support that enables applications to be rendered properly on different
+display resolutions and densities. Developers can also specify the types of screens supported by their
+application.</p>
+
+
+<h3 id="CDMA">Telephony support for CDMA</h3>
+
+<p>Android 1.6 includes support for CDMA in the telephony stack.</p>
+
+
+<h3 id="OpenCore">New version of OpenCore</h3>
+
+<p>Android 1.6 includes the updated OpenCore 2 media engine, which has:</p>
+
+<ul>
+ <li>Support for OpenMAX encoders</li>
+ <li>Support for additional audio codecs in AuthorEngine</li>
+ <li>Improved buffering model supports shared buffers allocated in the decoder</li>
+</ul>
+
+<h3 id="LinuxKernel">2.6.29 Linux kernel</h3>
+
+<p>Android 1.6 upgrades the Linux kernel from 2.6.27 to 2.6.29.</p>
+
+
+<h3 id="DeveloperAPIs">New Framework APIs</h3>
+
+<p>For a detailed overview of new APIs, see the
+<a href="{@docRoot}about/versions/android-1.6.html#api-changes">Version Notes</a>.
+For a complete report of all API changes, see the
+<a href="{@docRoot}sdk/api_diff/4/changes.html">API Differences Report</a>.
diff --git a/docs/html/about/versions/android-1.6.jd b/docs/html/about/versions/android-1.6.jd
new file mode 100644
index 0000000..2a66cd3
--- /dev/null
+++ b/docs/html/about/versions/android-1.6.jd
@@ -0,0 +1,505 @@
+page.title=Android 1.6 Platform
+sdk.platform.version=1.6
+sdk.platform.apiLevel=4
+sdk.platform.majorMinor=minor
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#features">Platform Highlights</a></li>
+ <li><a href="#relnotes">Revisions</a></li>
+ <li><a href="#api-level">API Level</a></li>
+ <li><a href="#api">Framework API Changes</a>
+ <li><a href="#apps">Built-in Applications</a></li>
+ <li><a href="#locs">Locales</a></li>
+ <li><a href="#skins">Emulator Skins</a></li>
+
+ </ol>
+ </li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+<h2>See Also</h2>
+<ol>
+ <li><a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>
+<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release
+deployable to Android-powered handsets since October 2009.
+The platform includes new features for users and developers, as well as changes
+in the Android framework API. </p>
+
+<p>For developers, a new release of the Android {@sdkPlatformVersion} platform
+is available as a downloadable component for the Android SDK. The platform
+— Android 1.6 r2 — includes a fully compliant Android library and
+system image, as well as a set of emulator skins, sample applications, and minor
+development updates. The downloadable platform is fully compliant (API Level 4)
+and includes no external libraries.</p>
+
+<p>To get started developing or testing against the Android
+{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
+download the latest Android 1.6 platform into your Android 1.6 or later SDK. For
+more information, see <a href="{@docRoot}sdk/exploring.html">Exploring the
+SDK</a>.</p>
+
+
+<h2 id="features">Platform Highlights</h2>
+
+<p>For a list of new user features and platform highlights, see the <a
+href="http://developer.android.com/about/versions/android-{@sdkPlatformVersion}-highlights.html">Android
+{@sdkPlatformVersion} Platform Highlights</a> document.</p>
+
+
+<h2 id="relnotes">Revisions</h2>
+
+<p>The sections below provide notes about successive releases of
+the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
+revision number. To determine what revision(s) of the Android
+{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
+the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
+
+<script type="text/javascript">
+function toggleDiv(link) {
+ var toggleable = $(link).parent();
+ if (toggleable.hasClass("closed")) {
+ //$(".toggleme", toggleable).slideDown("fast");
+ toggleable.removeClass("closed");
+ toggleable.addClass("open");
+ $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
+ } else {
+ //$(".toggleme", toggleable).slideUp("fast");
+ toggleable.removeClass("open");
+ toggleable.addClass("closed");
+ $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
+ }
+ return false;
+}
+</script>
+<style>
+.toggleable {
+ padding: .25em 1em 0em 1em;
+ margin-bottom: 0;
+}
+.toggleme {
+ padding: 1em 1em 0 2em;
+ line-height:1em;
+}
+.toggleable a {
+ text-decoration:none;
+}
+.toggleme a {
+ text-decoration:underline;
+}
+.toggleable.closed .toggleme {
+ display:none;
+}
+#jd-content .toggle-img {
+ margin:0;
+}
+</style>
+
+<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" />
+ Android 1.6, Revision 3</a> <em>(May 2010)</em></a>
+ <div class="toggleme">
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires SDK Tools r6 or higher.</p>
+</dd>
+<dt>Tools:</dt>
+<dd>
+<ul>
+<li>Adds support for library projects in the Ant build system.</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" />
+ Android 1.6, Revision 2</a> <em>(December 2009)</em></a>
+ <div class="toggleme">
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires SDK Tools r4 or higher.</p>
+</dd>
+
+<dt>API related:</dt>
+<dd>
+<ul>
+<li>Properly exposes CDMA-related constants in <code><a href="{@docRoot}reference/android/telephony/TelephonyManager.html">android.telephony.TelephonyManager</a></code>: <code>DATA_ACTIVITY_DORMANT</code>,
+<code>PHONE_TYPE_CDMA</code>, <code>NETWORK_TYPE_CDMA</code>,
+<code>NETWORK_TYPE_EVDO_0</code>, <code>NETWORK_TYPE_EVDO_A</code>, and
+<code>NETWORK_TYPE_1xRTT</code>.</li>
+</ul>
+</dd>
+<dt>System image:</dt>
+<dd>
+<ul>
+<li>Fixes bug so that Bitmap's density is now propagated through Parcelable.</li>
+<li>Fixes NinePatchDrawable to properly scale its reported padding for compatibility mode.</li>
+<li>Fixes TextView to properly compute styled font metrics based on the screen density.</li>
+<li>Updates kernel to 2.6.29, to match kernel on commercially
+available Android-powered devices.</li>
+</ul>
+</dd>
+<dt>Tools:</dt>
+<dd>
+<ul>
+<li>Adds new Ant build system with support for Emma instrumentation projects
+(code coverage).</li>
+<li>Fixes emulator skins to properly emulate d-pad in landscape mode.</li>
+<li>Fixes density rendering in the layout editor in ADT.</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" />
+ Android 1.6, Revision 1</a> <em>(September 2009)</em></a>
+ <div class="toggleme">
+<dl>
+<dt>Dependencies</dt>
+<dd>
+<p>Requires SDK Tools r3 or higher.</p>
+</dd>
+</dl>
+ </div>
+</div>
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
+the framework API. The Android {@sdkPlatformVersion} API
+is assigned an integer identifier —
+<strong>{@sdkPlatformApiLevel}</strong> — that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your
+application, you need to set the proper value, "{@sdkPlatformApiLevel}", in the
+<code>android:minSdkVersion</code> attributes of the <code><uses-sdk></code>
+element in your application's manifest. </p>
+
+<p>For more information about how to use API Level, see the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Levels</a> document. </p>
+
+
+<h2 id="api">Framework API Changes</h2>
+
+<p>The sections below provide information about the application framework API provided by the Android {@sdkPlatformVersion} platform. </p>
+
+<h3 id="UIFramework">UI framework</h3>
+ <ul>
+ <li>New classes in {@link android.view.animation}
+ to control the behavior of animations:
+ <ul>
+ <li><code>AnticipateInterpolator</code></li>
+ <li><code>AnticipateOvershootInterpolator</code></li>
+ <li><code>BounceInterpolator</code></li>
+ <li><code>OvershootInterpolator</code></li>
+ </ul>
+ </li>
+ <li>New XML attribute <code>android:onClick</code> to specify a View's
+<a href="/reference/android/view/View.OnClickListener.html">View.OnClickListener</a>
+from a layout file.
+ </li>
+ <li>New support for dealing with varying screen densities. Density
+information is associated with Bitmap and Canvas for performing the
+correct scaling. The framework will automatically scale bitmaps and
+nine-patches based on the density the resource was found under and the
+density of the screen, etc.
+ </li><p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need to
+set the proper value, "{@sdkPlatformApiLevel}", in the attributes of the <code><uses-sdk></code>
+element in your application's manifest. </p>
+ </ul>
+
+<h3>Search framework</h3>
+ <ul>
+ <li>Applications can now expose relevant content to users as search
+suggestions in the Quick Search Box, a new device-wide search capability that is
+accessible from the home screen. To support this, the search framework adds new
+attributes to the searchable metadata file. For complete information, see the
+{@link android.app.SearchManager SearchManager} documentation.
+ </li>
+ </ul>
+
+<h3>Accessibility framework</h3>
+ <ul>
+ <li>New {@link android.view.accessibility android.accessibility} package
+that includes classes for capturing accessibility events and forwarding them to
+an {@link android.accessibilityservice AccessibilityService} handler. </li>
+ <li>New {@link android.accessibilityservice AccessibilityService} package
+that lets your application track user events and provide visual, audible, or
+haptic feedback to the user. </li>
+ </ul>
+
+<h3>Gesture input</h3>
+ <ul>
+ <li>New {@link android.gesture gesture} API for creating, recognizing,
+loading, and saving gestures.</li>
+ </ul>
+
+<h3>Text-to-speech</h3>
+ <ul>
+ <li>New {@link android.speech.tts android.speech.tts} package provides
+classes for synthesizing speech from text, for immediate playback or to create a
+sound file.</li>
+ </ul>
+
+<h3>Graphics</h3>
+ <ul>
+ <li>Classes in {@link android.graphics android.graphics} now support scaling
+for different screen densities.</li>
+ </ul>
+
+<h3>Telephony</h3>
+ <ul>
+ <li>New {@link android.telephony.SmsManager SmsManager} and other classes
+for sending and receiving SMS messages.</li>
+ </ul>
+
+<h3>Utilities</h3>
+ <ul>
+ <li>New {@link android.util.DisplayMetrics DisplayMetrics} fields for
+determining the density of the current device screen.</li>
+ </ul>
+
+<h3 id="AndroidManifest">Android Manifest elements</h3>
+
+ <ul>
+ <li>New <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
+ <supports-screens>}</a> element lets you specify the device screen sizes that your
+ application is designed and tested to support, where "size" is a combination
+ of resolution and density. If your application is run on a device whose screen
+ size is not specified in the <code><supports-screen></code> element, the system
+ displays the application in <em>compatibility mode</em>, which performs best-effort scaling
+ of the application UI to match the resolution and density of the screen.
+
+ <p>The attributes available for defining an application's screen support are:
+
+ <ul>
+
+ <li><code>smallScreen</code>: Boolean value that indicates whether the
+ application is designed to run on devices with small screens.
+ Examples: QVGA low density; VGA high density.
+ </li>
+ <li><code>normalScreens</code>: Boolean value that indicates whether
+ the application is designed to run on devices with normal screens.
+ Examples: WQVGA low density; HVGA medium density; WVGA high density.
+ </li>
+ <li><code>largeScreens</code>: Boolean value that indicates whether
+ the application is designed to run on devices with significantly
+ larger screens, such that special care may be required on
+ the application's part to make proper use of the screen area.
+ Examples: VGA medium density; WVGA medium density.
+ </li>
+ <li><code>anyDensity</code>: Boolean value that indicates whether
+ the application can accommodate any screen density.
+ </li>
+ <li><code>resizable</code>: Boolean value that indicates whether
+ the application can expand its layout to fit slightly larger screens.
+ </li>
+ </ul>
+ </p>
+ </li>
+
+ <li>New <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
+ element lets an application specify hardware (or other)
+ features that it requires to function normally. When an application
+ specifies such features, the system allows the application to be installed only
+ on devices that offer the required features. The element supports these
+ attributes:
+ <ul>
+ <li><code>name</code>: The name of the feature required by the application. Currently accepts
+ "android.hardware.camera" and "android.hardware.camera.autofocus" values, which specify that a
+ camera and camera autofocus are required, respectively.</li>
+ <li><code>glEsVersion</code>: Indicates the minimum version of OpenGL ES required.</li>
+ </ul>
+ </li>
+ <li>New attributes for the
+ <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element:
+ <ul>
+ <li><code>targetSdkVersion</code>: Indicates the API Level that the application is targeting.
+ It is able to run on older versions (down to minSdkVersion), but was explicitly tested to
+ work with the version specified here. Specifying this version allows the platform to
+ disable compatibility code that is not required or enable newer features that are not
+ available to older applications. </li>
+ <li><code>maxSdkVersion</code>: Indicates the maximum API Level on which an application is
+ designed to run. <strong>Important:</strong> Please read the <a
+ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+ documentation before using this attribute. </li>
+ </ul>
+ </li>
+
+ </li>
+ </ul>
+
+<h3>New permissions</h3>
+
+ <ul>
+ <li>{@link android.Manifest.permission#CHANGE_WIFI_MULTICAST_STATE
+ CHANGE_WIFI_MULTICAST_STATE}: Allows applications to enter Wi-Fi
+ Multicast mode.
+ </li>
+ <li>{@link android.Manifest.permission#GLOBAL_SEARCH}: Allows the
+ global search system to access the data of a specified content provider.
+ </li>
+ <li>{@link android.Manifest.permission#INSTALL_LOCATION_PROVIDER INSTALL_LOCATION_PROVIDER}:
+ Allows an application to install a location provider into the Location Manager.
+ </li>
+ <li>{@link android.Manifest.permission#READ_HISTORY_BOOKMARKS READ_HISTORY_BOOKMARKS}:
+ Allows an application to read (but not write) the user's browsing history
+ and bookmarks.
+ </li>
+ <li>{@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS WRITE_HISTORY_BOOKMARKS}:
+ Allows an application to write (but not read) the user's browsing history
+ and bookmarks.
+ </li>
+ <li>{@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE WRITE_EXTERNAL_STORAGE}:
+ Allows an application to write to external storage. Applications using API Level 3
+ and lower will be implicitly granted this permission (and this will be visible to
+ the user); Applications using API Level 4 or higher must explicitly request this
+ permission.
+ </li>
+ </ul>
+
+
+<h3 id="api-diff">API differences report</h3>
+
+<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
+the previous version, see the <a href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report</a>.</p>
+
+<h2 id="apps">Built-in Applications</h2>
+
+<p>The system image included in the downloadable platform provides these
+built-in applications:</p>
+
+<table style="border:0;padding-bottom:0;margin-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+ <ul>
+ <li>Alarm Clock</li>
+ <li>Browser</li>
+ <li>Calculator</li>
+ <li>Camcorder</li>
+ <li>Camera</li>
+ <li>Contacts</li>
+ <li>Custom Locale (developer app)</li>
+ <li>Dev Tools (developer app)</li>
+ <li>Dialer</li>
+ </ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+ <ul>
+ <li>Email</li>
+ <li>Gallery</li>
+ <li>Gestures Builder</li>
+ <li>IME for Japanese text input</li>
+ <li>Messaging</li>
+ <li>Music</li>
+ <li>Settings</li>
+ <li>Spare Parts (developer app)</li>
+ </ul>
+</td>
+</tr>
+</table>
+
+<h2 id="locs" style="margin-top:.75em;">Locales</h2>
+
+<p>The system image included in the downloadable platform provides a variety of
+built-in locales. In some cases, region-specific strings are available for the
+locales. In other cases, a default version of the language is used. The
+languages that are available in the Android {@sdkPlatformVersion} system
+image are listed below (with <em>language</em>_<em>country/region</em>
+locale descriptor).</p>
+
+<table style="border:0;margin-bottom:0;padding-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+<ul>
+<li>Chinese, PRC (zh_CN)</li>
+<li>Chinese, Taiwan (zh_TW)</li>
+<li>Czech (cs_CZ)</li>
+<li>Dutch, Netherlands (nl_NL)</li>
+<li>Dutch, Belgium (nl_BE)</li>
+<li>English, US (en_US)</li>
+<li>English, Britain (en_GB)</li>
+<li>English, Canada (en_CA)</li>
+<li>English, Australia (en_AU)</li>
+<li>English, New Zealand (en_NZ)</li>
+<li>English, Singapore(en_SG)</li>
+<li>French, France (fr_FR)</li>
+<li>French, Belgium (fr_BE)</li>
+</ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+<li>French, Canada (fr_CA)</li>
+<li>French, Switzerland (fr_CH)</li>
+<li>German, Germany (de_DE)</li>
+<li>German, Austria (de_AT)</li>
+<li>German, Switzerland (de_CH)</li>
+<li>German, Liechtenstein (de_LI)</li>
+<li>Italian, Italy (it_IT)</li>
+<li>Italian, Switzerland (it_CH)</li>
+<li>Japanese (ja_JP)</li>
+<li>Korean (ko_KR)</li>
+<li>Polish (pl_PL)</li>
+<li>Russian (ru_RU)</li>
+<li>Spanish (es_ES)</li>
+</td>
+</tr>
+</table>
+
+<p>Localized UI strings match the locales that are accessible
+through Settings.</p>
+
+<h2 id="skins">Emulator Skins</h2>
+
+<p>The downloadable platform includes a set of emulator skins that you can
+use for modeling your application in different screen sizes and resolutions.
+The emulator skins are: </p>
+
+<ul>
+ <li>
+ QVGA (240x320, low density, small screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ WVGA800 (480x800, high density, normal screen)
+ </li>
+ <li>
+ WVGA854 (480x854 high density, normal screen)
+ </li>
+</ul>
+
+<p>For more information about how to develop an application that displays and functions properly on all Android-powered devices, see <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
diff --git a/docs/html/about/versions/android-2.0-highlights.jd b/docs/html/about/versions/android-2.0-highlights.jd
new file mode 100644
index 0000000..2ba9ac7
--- /dev/null
+++ b/docs/html/about/versions/android-2.0-highlights.jd
@@ -0,0 +1,201 @@
+page.title=Android 2.0 Platform Highlights
+sdk.date=October 2009
+
+@jd:body
+
+
+<style type="text/css">
+#jd-content div.screenshot,
+#jd-content div.video {
+ float:right;
+ clear:right;
+ padding:15px 60px;
+ font-size:.9em;
+ font-weight:bold;
+ line-height:1.7em;
+}
+#jd-content div.video {
+ padding-top:0;
+ margin-top:-15px;
+}
+#jd-content div.screenshot.second {
+ clear:none;
+ padding:15px 0 15px 60px;
+}
+#jd-content div.screenshot img {
+ margin:0;
+ border:1px solid #ccc;
+}
+</style>
+
+<div class="video">
+<object width="278 height="180">
+<param name="movie" value="http://www.youtube.com/v/opZ69P-0Jbc&hl=en&fs=1&"></param>
+<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
+<embed src="http://www.youtube.com/v/opZ69P-0Jbc&hl=en&fs=1&" type="application/x-shockwave-flash"
+allowscriptaccess="always" allowfullscreen="true" width="278" height="180"></embed>
+</object>
+</div>
+
+
+<p>The Android 2.0 platform introduces many new and exciting features for
+users and developers. This document provides a glimpse at some of the new features
+and technologies in Android 2.0.</p>
+
+<ul>
+ <li><a href="#UserFeatures">New User Features</a></li>
+ <li><a href="#PlatformTechnologies">New Platform Technologies</a></li>
+</ul>
+
+
+
+<h2 id="UserFeatures" style="clear:right">New User Features</h2>
+
+<!-- screenshots float right -->
+
+<div class="screenshot">
+ <img src="images/2.0/quick-connect.png" class="screenshot" alt="" /><br/>
+ Quick Contact for Android
+</div>
+
+<div class="screenshot second">
+ <img src="images/2.0/multiple-accounts.png" class="screenshot" alt="" /><br/>
+ Multiple Accounts
+</div>
+
+<div class="screenshot">
+ <img src="images/2.0/mms-search.png" class="screenshot" alt="" /><br/>
+ Messaging Search
+</div>
+
+<div class="screenshot second">
+ <img src="images/2.0/email-inbox.png" class="screenshot" alt="" /><br/>
+ Email Combined Inbox
+</div>
+
+<div class="screenshot">
+ <img src="images/2.0/camera-modes.png" class="screenshot" alt="" /><br/>
+ Camera Modes
+</div>
+
+
+
+<h3 id="Contacts">Contacts and accounts</h3>
+
+<ul>
+ <li>Multiple accounts can be added to a device for email and contact
+synchronization, including Exchange accounts. (Handset manufacturers can
+choose whether to include Exchange support in their devices.)</li>
+ <li>Developers can create sync adapters that provide synchronization with
+additional data sources.</li>
+ <li>Quick Contact for Android provides instant access to
+a contact's information and communication modes. For example, a user can tap a
+contact photo and select to call, SMS, or email the person. Other applications
+such as Email, Messaging, and Calendar can also reveal the Quick Contact widget
+when you touch a contact photo or status icon.</li>
+</ul>
+
+
+<!--
+<ul>
+ <li>Sync support for contacts from multiple data sources including Exchange.
+ Handset manufacturers can choose whether or not to include Exchange support
+ in their devices.</li>
+ <li>New way to hover on a person to see more info and select communication
+ mode (for example, phone, SMS, email).</li>
+</ul>
+-->
+
+<h3 id="Email">Email</h3>
+
+<ul>
+ <li>Exchange support.</li>
+ <li>Combined inbox to browse email from multiple accounts in one page.</li>
+</ul>
+
+
+<h3 id="Messaging">Messaging</h3>
+
+<ul>
+ <li>Search functionality for all saved SMS and MMS messages.</li>
+ <li>Auto delete the oldest messages
+ in a conversation when a defined limit is reached.</li>
+</ul>
+
+
+<h3 id="Camera">Camera</h3>
+
+<ul>
+ <li>Built-in flash support</li>
+ <li>Digital zoom</li>
+ <li>Scene mode</li>
+ <li>White balance</li>
+ <li>Color effect</li>
+ <li>Macro focus</li>
+</ul>
+
+<h3 id="Keyboard">Android virtual keyboard</h3>
+
+<ul>
+ <li>An improved keyboard layout to makes it easier to hit the correct characters
+ and improve typing speed.</li>
+ <li>The framework's multi-touch support ensures that key presses aren't missed
+ while typing rapidly with two fingers.</li>
+ <li>A smarter dictionary learns from word usage and automatically includes
+ contact names as suggestions.</li>
+</ul>
+
+
+<h3 id="Browser">Browser</h3>
+
+<ul>
+ <li>Refreshed UI with actionable browser URL bar enables users to directly
+ tap the address bar for instant searches and navigation.</li>
+ <li>Bookmarks with web page thumbnails.</li>
+ <li>Support for double-tap zoom.</li>
+ <li>Support for HTML5:</p>
+ <ul>
+ <li>Database API support, for client-side databases using SQL.</li>
+ <li>Application cache support, for offline applications.</li>
+ <li>Geolocation API support, to provide location information about the device.</li>
+ <li>{@code <video>} tag support in fullscreen mode.</li>
+ </ul>
+ </li>
+</ul>
+
+
+<h3 id="Calendar">Calendar</h3>
+<ul>
+ <li>Agenda view provides infinite scrolling.</li>
+ <li>Events indicate the attending status for each invitee.</li>
+ <li>Invite new guests to events.</li>
+</ul>
+
+
+<h2 id="PlatformTechnologies" style="clear:right">New Platform Technologies</h2>
+
+<h3 id="MediaFramework">Media Framework</h3>
+
+<p>Revamped graphics architecture for improved performance that enables better
+hardware acceleration.</p>
+
+
+<h3 id="Bluetooth">Bluetooth</h3>
+
+<ul>
+ <li>Bluetooth 2.1</li>
+ <li>New BT profiles: Object Push Profile (OPP) and Phone Book Access Profile (PBAP)</li>
+</ul>
+
+
+<h3 id="DeveloperAPIs">New Framework APIs</h3>
+
+<p>Android 2.0 includes several new developer APIs.
+For an overview of new APIs, see the
+<a href="{@docRoot}about/versions/android-2.0.html#api">Android 2.0 version notes</a>.</p>
+
+<p>For a complete report of all API changes, see the
+<a href="{@docRoot}sdk/api_diff/5/changes.html">API Differences Report</a>.</p>
+
+
+
diff --git a/docs/html/about/versions/android-2.0.1.jd b/docs/html/about/versions/android-2.0.1.jd
new file mode 100644
index 0000000..bcba717
--- /dev/null
+++ b/docs/html/about/versions/android-2.0.1.jd
@@ -0,0 +1,361 @@
+page.title=Android 2.0.1, Release 1
+sdk.platform.version=2.0.1
+sdk.platform.apiLevel=6
+sdk.platform.majorMinor=minor
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#features">Platform Highlights</a></li>
+ <li><a href="#relnotes">Revisions</a></li>
+ <li><a href="#apps">Built-in Applications</a></li>
+ <li><a href="#locs">Locales</a></li>
+ <li><a href="#skins">Emulator Skins</a></li>
+ <li><a href="#dev-features">Developer Features</a></li>
+ <li><a href="#api">Framework API</a>
+ <ol>
+ <li><a href="#api-level">API level</a></li>
+ <li><a href="#api-changes">API changes summary</a></li>
+ <li><a href="#behavior-changes">Behavior changes</a></li>
+ <li><a href="#bug-fixes">Bug fixes</a></li>
+ <li><a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+differences report »</a> </li>
+ </ol>
+ </li>
+ </ol>
+
+ <h2>See Also</h2>
+ <ol>
+ <li><a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a></li>
+ </ol>
+
+</div>
+</div>
+
+<p>
+
+<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release
+deployable to Android-powered handsets starting in December 2009.
+This release includes minor API
+changes, bug fixes and framework behavioral changes. For information on changes
+and fixes, see the <a href="#api">Framework API</a> section.</p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes a
+fully compliant Android library and system image, as well as a set of emulator
+skins, sample applications, and more. The downloadable platform
+includes no external libraries. </p>
+
+<p>To get started developing or testing against the Android
+{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
+download the platform into your Android 1.6 or later SDK. For more information,
+see <a href="{@docRoot}sdk/exploring.html">Exploring the
+SDK</a>.</p>
+
+
+<h2 id="features">Platform Highlights</h2>
+
+<p>For a list of new user features and platform highlights, see the <a
+href="http://developer.android.com/about/versions/android-2.0-highlights.html">Android
+2.0 Platform Highlights</a> document.</p>
+
+<h2 id="relnotes">Revisions</h2>
+
+<p>The sections below provide notes about successive releases of
+the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
+revision number. To determine what revision(s) of the Android
+{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
+the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
+
+<script type="text/javascript">
+function toggleDiv(link) {
+ var toggleable = $(link).parent();
+ if (toggleable.hasClass("closed")) {
+ //$(".toggleme", toggleable).slideDown("fast");
+ toggleable.removeClass("closed");
+ toggleable.addClass("open");
+ $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
+ } else {
+ //$(".toggleme", toggleable).slideUp("fast");
+ toggleable.removeClass("open");
+ toggleable.addClass("closed");
+ $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
+ }
+ return false;
+}
+</script>
+<style>
+.toggleable {
+padding: .25em 1em;
+}
+.toggleme {
+ padding: 1em 1em 0 2em;
+ line-height:1em;
+}
+.toggleable a {
+ text-decoration:none;
+}
+.toggleable.closed .toggleme {
+ display:none;
+}
+#jd-content .toggle-img {
+ margin:0;
+}
+</style>
+
+<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" />
+ Android 2.0.1, Revision 1</a> <em>(December 2009)</em></a>
+ <div class="toggleme">
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires SDK Tools r4 or higher.</p>
+</dd>
+</dl>
+ </div>
+</div>
+
+<h2 id="apps">Built-in Applications</h2>
+
+<p>The system image included in the downloadable platform provides these
+built-in applications:</p>
+
+<table style="border:0;padding-bottom:0;margin-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+ <ul>
+ <li>Alarm Clock</li>
+ <li>Browser</li>
+ <li>Calculator</li>
+ <li>Camcorder</li>
+ <li>Camera</li>
+ <li>Contacts</li>
+ <li>Custom Locale (developer app)</li>
+ <li>Dev Tools (developer app)</li>
+ <li>Dialer</li>
+ </ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+ <ul>
+ <li>Email</li>
+ <li>Gallery</li>
+ <li>Gestures Builder</li>
+ <li>IME for Japanese text input</li>
+ <li>Messaging</li>
+ <li>Music</li>
+ <li>Settings</li>
+ <li>Spare Parts (developer app)</li>
+ </ul>
+</td>
+</tr>
+</table>
+
+<p><span class="new">New with 2.0.1</span> The Dev Tools app now
+includes a "Sync Tester" application to provide quick and easy testing of
+third-party sync adapters.</p>
+
+<h2 id="locs" style="margin-top:.75em;">Locales</h2>
+
+<p>The system image included in the downloadable platform provides a variety of
+built-in locales. In some cases, region-specific strings are available for the
+locales. In other cases, a default version of the language is used. The
+languages that are available in the Android {@sdkPlatformVersion} system
+image are listed below (with <em>language</em>_<em>country/region</em> locale
+descriptor).</p>
+
+<table style="border:0;padding-bottom:0;margin-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+<ul>
+<li>Chinese, PRC (zh_CN)</li>
+<li>Chinese, Taiwan (zh_TW)</li>
+<li>Czech (cs_CZ)</li>
+<li>Dutch, Netherlands (nl_NL)</li>
+<li>Dutch, Belgium (nl_BE)</li>
+<li>English, US (en_US)</li>
+<li>English, Britain (en_GB)</li>
+<li>English, Canada (en_CA)</li>
+<li>English, Australia (en_AU)</li>
+<li>English, New Zealand (en_NZ)</li>
+<li>English, Singapore(en_SG)</li>
+<li>French, France (fr_FR)</li>
+<li>French, Belgium (fr_BE)</li>
+</ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+<li>French, Canada (fr_CA)</li>
+<li>French, Switzerland (fr_CH)</li>
+<li>German, Germany (de_DE)</li>
+<li>German, Austria (de_AT)</li>
+<li>German, Switzerland (de_CH)</li>
+<li>German, Liechtenstein (de_LI)</li>
+<li>Italian, Italy (it_IT)</li>
+<li>Italian, Switzerland (it_CH)</li>
+<li>Japanese (ja_JP)</li>
+<li>Korean (ko_KR)</li>
+<li>Polish (pl_PL)</li>
+<li>Russian (ru_RU)</li>
+<li>Spanish (es_ES)</li>
+</td>
+</tr>
+</table>
+
+<p>Localized UI strings match the locales that are accessible
+through Settings.</p>
+
+<h2 id="skins">Emulator Skins</h2>
+
+<p>The downloadable platform includes a set of emulator skins that you can use for modeling your application in different screen sizes and resolutions. The emulator skins are: </p>
+
+<ul>
+ <li>
+ QVGA (240x320, low density, small screen)
+ </li>
+ <li>
+ WQVGA (240x400, low density, normal screen)
+ </li>
+ <li>
+ FWQVGA (240x432, low density, normal screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ WVGA800 (480x800, high density, normal screen)
+ </li>
+ <li>
+ WVGA854 (480x854 high density, normal screen)
+ </li>
+</ul>
+
+<p>For more information about how to develop an application that displays and functions properly on all Android-powered devices, see <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
+
+<h2 id="dev-features">Developer Features</h2>
+
+<p>The sections below provide information about new developer features offered by the downloadable Android 2.0 platform component.</p>
+
+<h3 id="ant">Ant Support</h3>
+
+<ul>
+<li>Debug- and release-mode application signing. Release-mode signing includes integrated support for <code>zipalign</code> optimization. For more information, see <a href="{@docRoot}tools/publishing/app-signing.html#releasecompile">Signing Your Applications</a>.</li>
+
+<li>Adds new Ant build system with support for Emma instrumentation projects (code coverage).</li>
+</ul>
+
+<h2 id="api">Framework API</h2>
+
+<p>The sections below provide information about changes made to the application
+framework API provided by the Android {@sdkPlatformVersion} platform. Note,
+however, that Android 2.0.1 is a minor release to Android 2.0, so for more
+information about the changes made to in Android 2.0, please refer to the
+<a href="{@docRoot}about/versions/android-2.0.html#api">Android 2.0 version notes</a>.</p>
+
+
+<h3 id="api-level">API level</h3>
+
+<p>The Android {@sdkPlatformVersion} platform delivers an updated version of the framework
+API. The Android {@sdkPlatformVersion} API
+is assigned an integer identifier — <strong>{@sdkPlatformApiLevel}</strong> — that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need to
+set the proper value, "{@sdkPlatformApiLevel}", in the attributes of the <code><uses-sdk></code>
+element in your application's manifest. </p>
+
+<p>For more information about how to use API Level, see the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Levels</a> document. </p>
+
+
+<h3 id="api-changes">API changes summary</h3>
+
+<p>The following is a summary of changes to the framework APIs.</p>
+
+<ul>
+<li>New {@code quickContactBadgeStyle*} attributes that let
+applications apply necessary styles to the {@link
+android.widget.QuickContactBadge} widget.</li>
+
+<li>Remove support for the {@link
+android.content.Intent#ACTION_CONFIGURATION_CHANGED} broadcast when declared as
+a filter in the manifest. To receive this broadcast, an application must
+do so from the application at run-time, with {@link
+android.content.Context#registerReceiver(BroadcastReceiver, IntentFilter)}.</li>
+</ul>
+
+<h3 id="behavior-changes">Behavior changes</h3>
+
+<p>The following is a summary of changes that affect the behavior of some
+framework APIs but do not add or remove API functionality.</p>
+
+<h4>Bluetooth</h4>
+
+<p>Changes to the values returned by {@link
+android.bluetooth.BluetoothAdapter#ACTION_REQUEST_ENABLE} and
+{@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_DISCOVERABLE}:</p>
+
+<ul>
+<li>{@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_ENABLE} now
+returns {@link android.app.Activity#RESULT_OK} if Bluetooth was successfully
+enabled and {@link android.app.Activity#RESULT_CANCELED} if the user rejected
+the request to enable Bluetooth, rather than 0 and -1 (or -2),
+respectively.</li>
+
+<li>{@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_DISCOVERABLE}
+now returns {@link android.app.Activity#RESULT_CANCELED} if the user rejected
+the request to enable discoverability or if Bluetooth is not enabled, rather
+than -1 and -2, respectively.</li>
+</ul>
+
+<h4>Contacts</h4>
+
+<p>The {@link android.content.Intent#ACTION_INSERT} Intent now returns {@link
+android.app.Activity#RESULT_CANCELED} in cases where the contact was not
+persisted (for example, if the save was trimmed to a no-op).</p>
+
+
+<h3 id="bug-fixes">Bug fixes</h3>
+
+<p>The following is a summary of bug fixes that affect some framework APIs.</p>
+
+<h4>Resources</h4>
+
+<p>The framework now correctly selects application resources in project
+folders that use the API Level qualifier. For example, {@code drawable-v4/} is a
+folder of drawable resources for API Level 4 (or higher) devices. This version
+matching did not work properly and has been fixed.</p>
+
+<h4>Contacts</h4>
+
+<p>The {@link android.content.Intent#ACTION_INSERT} Intent now returns the
+appropriate kind of URI when the request is made using the (now
+deprecated) {@link android.provider.Contacts} APIs.</p>
+
+<h4>Other Framework fixes</h4>
+
+<ul>
+<li>{@link android.app.Activity#getCallingPackage()} now properly reports the
+package name, rather than the process name.</li>
+</ul>
+
+
+<h3 id="api-diff">API differences report</h3>
+
+<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
+API Level 5, see the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report</a>. There are very few API changes in API Level 6,
+so you might also be interested in reviewing the <a
+href="{@docRoot}sdk/api_diff/5/changes.html">API
+differences between 4 and 5</a>.</p>
+
diff --git a/docs/html/about/versions/android-2.0.jd b/docs/html/about/versions/android-2.0.jd
new file mode 100644
index 0000000..7a12e48
--- /dev/null
+++ b/docs/html/about/versions/android-2.0.jd
@@ -0,0 +1,384 @@
+page.title=Android 2.0, Release 1
+sdk.platform.version=2.0
+sdk.platform.apiLevel=5
+sdk.platform.majorMinor=major
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#features">Platform Highlights</a></li>
+ <li><a href="#relnotes">Revisions</a></li>
+ <li><a href="#apps">Built-in Applications</a></li>
+ <li><a href="#locs">Locales</a></li>
+ <li><a href="#skins">Emulator Skins</a></li>
+ <li><a href="#dev-features">Developer Features</a></li>
+ <li><a href="#api">Framework API</a>
+ <ol>
+ <li><a href="#api-level">API level</a></li>
+ <li><a href="#api-changes">API changes summary</a></li>
+ <li><a href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API differences report »</a> </li>
+ </ol></li>
+ </ol>
+
+ <h2>See Also</h2>
+ <ol>
+ <li><a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a></li>
+ </ol>
+
+</div>
+</div>
+
+<p>
+<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release
+deployable to Android-powered handsets starting in November 2009.
+The release includes new features for users and developers, as well as changes
+in the Android framework API. </p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes a
+fully compliant Android library and system image, as well as a set of emulator
+skins, sample applications, and more. The downloadable platform is fully
+compliant and includes no external libraries. </p>
+
+<p>To get started developing or testing against the Android
+{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
+download the platform into your SDK. For more information,
+see <a href="{@docRoot}sdk/exploring.html">Exploring the
+SDK</a>.</p>
+
+
+<h2 id="features">Platform Highlights</h2>
+
+<p>For a list of new user features and platform highlights, see the <a
+href="http://developer.android.com/about/versions/android-{@sdkPlatformVersion}-highlights.html">Android
+{@sdkPlatformVersion} Platform Highlights</a> document.</p>
+
+<h2 id="relnotes">Revisions</h2>
+
+<p>The sections below provide notes about successive releases of
+the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
+revision number. To determine what revision(s) of the Android
+{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
+the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
+
+<script type="text/javascript">
+function toggleDiv(link) {
+ var toggleable = $(link).parent();
+ if (toggleable.hasClass("closed")) {
+ //$(".toggleme", toggleable).slideDown("fast");
+ toggleable.removeClass("closed");
+ toggleable.addClass("open");
+ $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
+ } else {
+ //$(".toggleme", toggleable).slideUp("fast");
+ toggleable.removeClass("open");
+ toggleable.addClass("closed");
+ $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
+ }
+ return false;
+}
+</script>
+<style>
+.toggleable {
+padding: .25em 1em;
+}
+.toggleme {
+ padding: 1em 1em 0 2em;
+ line-height:1em;
+}
+.toggleable a {
+ text-decoration:none;
+}
+.toggleable.closed .toggleme {
+ display:none;
+}
+#jd-content .toggle-img {
+ margin:0;
+}
+</style>
+
+<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" />
+ Android 2.0, Revision 1</a> <em>(October 2009)</em></a>
+ <div class="toggleme">
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires SDK Tools r3 or higher.</p>
+</dd>
+</dl>
+ </div>
+</div>
+
+<h2 id="apps">Built-in Applications</h2>
+
+<p>The system image included in the downloadable platform provides these
+built-in applications:</p>
+
+<table style="border:0;padding-bottom:0;margin-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+ <ul>
+ <li>Alarm Clock</li>
+ <li>Browser</li>
+ <li>Calculator</li>
+ <li>Camcorder</li>
+ <li>Camera</li>
+ <li>Contacts</li>
+ <li>Custom Locale (developer app)</li>
+ <li>Dev Tools (developer app)</li>
+ <li>Dialer</li>
+ </ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+ <ul>
+ <li>Email</li>
+ <li>Gallery</li>
+ <li>Gestures Builder</li>
+ <li>IME for Japanese text input</li>
+ <li>Messaging</li>
+ <li>Music</li>
+ <li>Settings</li>
+ <li>Spare Parts (developer app)</li>
+ </ul>
+</td>
+</tr>
+</table>
+
+<h2 id="locs" style="margin-top:.75em;">Locales</h2>
+
+<p>The system image included in the downloadable platform provides a variety of
+built-in locales. In some cases, region-specific strings are available for the
+locales. In other cases, a default version of the language is used. The
+languages that are available in the Android {@sdkPlatformVersion} system
+image are listed below (with <em>language</em>_<em>country/region</em> locale
+descriptor).</p>
+
+<table style="border:0;padding-bottom:0;margin-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+<ul>
+<li>Chinese, PRC (zh_CN)</li>
+<li>Chinese, Taiwan (zh_TW)</li>
+<li>Czech (cs_CZ)</li>
+<li>Dutch, Netherlands (nl_NL)</li>
+<li>Dutch, Belgium (nl_BE)</li>
+<li>English, US (en_US)</li>
+<li>English, Britain (en_GB)</li>
+<li>English, Canada (en_CA)</li>
+<li>English, Australia (en_AU)</li>
+<li>English, New Zealand (en_NZ)</li>
+<li>English, Singapore(en_SG)</li>
+<li>French, France (fr_FR)</li>
+<li>French, Belgium (fr_BE)</li>
+</ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+<li>French, Canada (fr_CA)</li>
+<li>French, Switzerland (fr_CH)</li>
+<li>German, Germany (de_DE)</li>
+<li>German, Austria (de_AT)</li>
+<li>German, Switzerland (de_CH)</li>
+<li>German, Liechtenstein (de_LI)</li>
+<li>Italian, Italy (it_IT)</li>
+<li>Italian, Switzerland (it_CH)</li>
+<li>Japanese (ja_JP)</li>
+<li>Korean (ko_KR)</li>
+<li>Polish (pl_PL)</li>
+<li>Russian (ru_RU)</li>
+<li>Spanish (es_ES)</li>
+</td>
+</tr>
+</table>
+
+<p>Localized UI strings match the locales that are accessible
+through Settings.</p>
+
+<h2 id="skins">Emulator Skins</h2>
+
+<p>The downloadable platform includes a set of emulator skins that you can use for modeling your application in different screen sizes and resolutions. The emulator skins are: </p>
+
+<ul>
+ <li>
+ QVGA (240x320, low density, small screen)
+ </li>
+ <li>
+ WQVGA (240x400, low density, normal screen)
+ </li>
+ <li>
+ FWQVGA (240x432, low density, normal screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ WVGA800 (480x800, high density, normal screen)
+ </li>
+ <li>
+ WVGA854 (480x854 high density, normal screen)
+ </li>
+</ul>
+
+<p>For more information about how to develop an application that displays and functions properly on all Android-powered devices, see <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
+
+<h2 id="dev-features">Developer Features</h2>
+
+<p>The sections below provide information about new developer features offered by the downloadable Android 2.0 platform component.</p>
+
+<h3 id="ant">Ant Support</h3>
+
+<ul>
+<li>Debug- and release-mode application signing. Release-mode signing includes integrated support for <code>zipalign</code> optimization. For more information, see <a href="{@docRoot}tools/publishing/app-signing.html#releasecompile">Signing Your Applications</a>.</li>
+
+<li>Adds new Ant build system with support for Emma instrumentation projects (code coverage).</li>
+</ul>
+
+<h2 id="api">Framework API</h2>
+
+<p>The sections below provide information about the application framework API provided by the Android {@sdkPlatformVersion} platform. </p>
+
+
+<h3 id="api-level">API level</h3>
+
+<p>The Android {@sdkPlatformVersion} platform delivers an updated version of the framework
+API. As with previous versions, the Android {@sdkPlatformVersion} API
+is assigned an integer identifier — <strong>{@sdkPlatformApiLevel}</strong> — that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need to
+set the proper value, "{@sdkPlatformApiLevel}", in the attributes of the <code><uses-sdk></code>
+element in your application's manifest. </p>
+
+<p>For more information about how to use API Level, see the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Levels</a> document. </p>
+
+
+<h3 id="api-changes">API changes summary</h3>
+
+<h4>Bluetooth</h4>
+<ul>
+<li>Turn on/off Bluetooth</li>
+<li>Device and service discovery</li>
+<li>Connect to a remote device using RFCOMM and send/receive data</li>
+<li>Advertise RFCOMM services and listen for incoming RFCOMM connection</li>
+</ul>
+
+<h4>Sync adapters </h4>
+<ul>
+<li>New APIs for sync adapters to connect to any backend</li>
+</ul>
+
+<h4>Account Manager</h4>
+<ul>
+<li>Centralized account manager API to securely store and access auth tokens/passwords </li>
+</ul>
+
+<h4>Contacts</h4>
+<ul>
+<li>New contacts APIs that allow for data from multiple accounts</li>
+<li>New Quick Contact framework APIs enable developers to create contact badges in their app. Clicking on the badge opens a window with a list of ways to contact the person with one click.</li>
+</ul>
+
+<h4>WebView</h4>
+<ul>
+<li>Deprecated classes: UrlInterceptHandler, Plugin, PluginData, PluginList, UrlInterceptRegistry.</li>
+</ul>
+
+<h4>Camera</h4>
+<ul>
+<li>New parameters for color effect, scene mode, flash mode, focus mode, white balance, rotation, and other settings.</li>
+<li>New ZoomCallback interface to perform actions when the zoom level has changed.</li>
+</ul>
+
+<h4>Media</h4>
+<ul>
+<li>MediaScanner now generates thumbnails for all images when they are inserted into MediaStore.</li>
+<li>New Thumbnail API for retrieving image and video thumbnails on demand.</li>
+</ul>
+
+<h4>Other Framework</h4>
+<ul>
+<li>New system themes in android.R.style to easily display activities on top of the current system wallpaper or keep the previous activity visible in the background. </li>
+<li>New WallpaperManager API replaces and extends the wallpaper APIs that were previously in Context, to allow applications to request and set the system wallpaper.</li>
+<li>New Service APIs to help applications correctly handle Service life-cycle, in particular low memory situations where a Service may be killed while it is running.
+ <ul>
+ <li>Service.setForeground() has been deprecated and now effectively performs no operation. This is replaced with a new API, startForeground(), that helps (and requires) associating an ongoing notification with the foreground state.</li>
+ </ul>
+</li>
+<li>MotionEvent can now report simultaneous-touch information for devices that support it. Up to three pointers can be tracked simultaneously. </li>
+<li>KeyEvent has new key dispatching APIs, to help implement action-on-up and long press behavior, as well a new mechanism to cancel key presses (for virtual keys).</li>
+<li>WindowManager.LayoutParams has new constants that allow a window to wake up the screen when it is displayed and show the window even if the screen is locked. This allows applications to more cleanly implement things like alarm clocks that should wake the device.</li>
+<li>New Intent APIs that broadcast the docking state of the device and allow applications to launch special activities when the device is placed in a desktop or car dock.</li>
+</ul>
+
+<h4>Key events executed on key-up</h4>
+
+<p>Android 2.0 is designed to run on devices that use virtual keys for HOME,
+MENU, BACK, and SEARCH, rather than physical keys. To support the best user
+experience on those devices, the Android platform now executes these buttons at
+key-up, for a key-down/key-up pair, rather than key-down. This helps prevent
+accidental button events and lets the user press the button area and then drag
+out of it without generating an event. </p>
+
+<p>This change in behavior should only affect your application if it is
+intercepting button events and taking an action on key-down, rather than on
+key-up. Especially if your application is intercepting the BACK key, you should
+make sure that your application is handling the key events properly. </p>
+
+<p>In general, intercepting the BACK key in an application is not recommended,
+however, if your application is doing so and it invokes some action on
+key-down, rather than key-up, you should modify your code. </p>
+
+<p>If your application will use APIs introduced in Android 2.0 (API Level 5),
+you can take advantage of new APIs for managing key-event pairs:</p>
+
+<ul>
+<li>If you are intercepting the BACK key in an activity or dialog, just
+implement the new {@link android.app.Activity#onBackPressed()} method. </li>
+<li>If you are intercepting the BACK key in a view, you should track the key
+event on key-down (through the new {@link android.view.KeyEvent#startTracking}
+method), then invoke the action at key up. Here's a pattern you can use:</li>
+
+<pre> public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK
+ && event.getRepeatCount() == 0) {
+ event.startTracking();
+ return true;
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+
+ public boolean onKeyUp(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK && event.isTracking()
+ && !event.isCanceled()) {
+ // *** DO ACTION HERE ***
+ return true;
+ }
+ return super.onKeyUp(keyCode, event);
+ }</pre>
+
+</ul>
+
+<p>If you want to update a legacy application so that its handling of the BACK
+key works properly for both Android 2.0 and older platform versions, you
+can use an approach similar to that shown above. Your code can catch the
+target button event on key-down, set a flag to track the key event, and
+then also catch the event on key-up, executing the desired action if the tracking
+flag is set. You'll also want to watch for focus changes and clear the tracking
+flag when gaining/losing focus.</p>
+
+<h3 id="api-diff">API differences report</h3>
+
+<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
+the previous version, see the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API Differences Report</a>.</p>
+
diff --git a/docs/html/about/versions/android-2.1.jd b/docs/html/about/versions/android-2.1.jd
new file mode 100644
index 0000000..3cb0708
--- /dev/null
+++ b/docs/html/about/versions/android-2.1.jd
@@ -0,0 +1,373 @@
+page.title=Android 2.1 Platform
+sdk.platform.version=2.1
+sdk.platform.apiLevel=7
+sdk.platform.majorMinor=minor
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#features">Platform Highlights</a></li>
+ <li><a href="#relnotes">Revisions</a></li>
+ <li><a href="#api-level">API Level</a></li>
+ <li><a href="#api">Framework API Changes</a>
+ <li><a href="#apps">Built-in Applications</a></li>
+ <li><a href="#locs">Locales</a></li>
+ <li><a href="#skins">Emulator Skins</a></li>
+
+ </ol>
+ </li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+<h2>See Also</h2>
+<ol>
+ <li><a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>
+<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release
+deployable to Android-powered handsets starting in January 2010.
+This release includes new API
+changes and bug fixes. For information on changes, see the <a href="#api">Framework API</a>
+section.</p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes a
+fully compliant Android library and system image, as well as a set of emulator
+skins, sample applications, and more. The downloadable platform
+includes no external libraries. </p>
+
+<p>To get started developing or testing against the Android
+{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
+download the platform into your SDK. For more information,
+see <a href="{@docRoot}sdk/exploring.html">Exploring the
+SDK</a>.</p>
+
+
+<h2 id="features">Platform Highlights</h2>
+
+<p>Android {@sdkPlatformVersion} does not add significant user features, see the <a
+href="http://developer.android.com/about/versions/android-2.0-highlights.html">Android
+2.0 Platform Highlights</a> document for the latest user features.</p>
+
+<h2 id="relnotes">Revisions</h2>
+
+<p>The sections below provide notes about successive releases of
+the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
+revision number. To determine what revision(s) of the Android
+{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
+the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
+
+
+<div class="toggle-content opened" style="padding-left:1em;">
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-opened.png"
+class="toggle-content-img" alt="" />
+ Android {@sdkPlatformVersion}, Revision 3</a> <em>(July 2011)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r12</a> or
+higher.</p>
+</dd>
+<dt>Notes:</dt>
+<dd>
+<p>Improvements to the platform's rendering library to support the visual layout editor in the ADT
+Eclipse plugin. This revision allows for more drawing features in ADT and fixes several
+bugs in the previous rendering library. It also unlocks several editor features that were added in
+ADT 12.</p>
+</dd>
+</dl>
+
+</div>
+</div>
+
+<div class="toggle-content closed" style="padding-left:1em;">
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android {@sdkPlatformVersion}, Revision 2</a> <em>(May 2010)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires SDK Tools r6 or higher.</p>
+</dd>
+
+<dt>Tools:</dt>
+<dd>
+<ul>
+<li>Adds support for library projects in the Ant build system.</li>
+<li>Adds improved layout rendering in ADT’s visual layout editor.</li>
+</ul>
+</dd>
+
+</dl>
+ </div>
+</div>
+
+<div class="toggle-content closed" style="padding-left:1em;">
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android {@sdkPlatformVersion}, Revision 1</a> <em>(January 2010)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires SDK Tools r4 or higher.</p>
+</dd>
+</dl>
+ </div>
+</div>
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
+the framework API. The Android {@sdkPlatformVersion} API
+is assigned an integer identifier —
+<strong>{@sdkPlatformApiLevel}</strong> — that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your
+application, you need to set the proper value, "{@sdkPlatformApiLevel}", in the
+<code>android:minSdkVersion</code> attributes of the <code><uses-sdk></code>
+element in your application's manifest. </p>
+
+<p>For more information about how to use API Level, see the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Levels</a> document. </p>
+
+
+<h2 id="api">Framework API Changes</h2>
+
+<p>The sections below provide information about changes made to the application
+framework API provided by the Android {@sdkPlatformVersion} platform.</p>
+
+<h3>Live Wallpapers</h3>
+
+<p>The following additions provide APIs for you to develop animated wallpapers:</p>
+<ul>
+<li>New {@link android.service.wallpaper} package.</li>
+<li>New {@link android.app.WallpaperInfo} class.</li>
+<li>Updated {@link android.app.WallpaperManager}.</li>
+</ul>
+
+<p>Additionally, if your application uses or provides Live Wallpapers, you must
+remember to add a <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></code></a>
+ element to the application's manifest, declaring the attribute
+<code>android:name="android.software.live_wallpaper"</code>. For example:</p>
+
+<pre class="no-pretty-print">
+<uses-feature android:name="android.software.live_wallpaper" />
+</pre>
+
+<p>When you've published your application, Google Play checks for the
+presence of this element and uses it as a filter, ensuring that your application
+is not made available to users whose devices do not support Live Wallpapers.
+</p>
+
+<h3>Telephony</h3>
+
+<ul>
+<li>New {@link android.telephony.SignalStrength} class provides information
+about the device's current network signal. This can be acquired from the
+new {@link
+android.telephony.PhoneStateListener#onSignalStrengthsChanged(SignalStrength)}
+callback.</li>
+
+<li>New {@link
+android.telephony.PhoneStateListener#onDataConnectionStateChanged(int,int)}
+callback.</li>
+</ul>
+
+<h3>Views</h3>
+
+<ul>
+<li>New {@link android.view.View} methods {@link android.view.View#isOpaque()}
+and {@link android.view.View#onDrawScrollBars(Canvas)}.</li>
+
+<li>New {@link android.widget.RemoteViews} methods {@link
+android.widget.RemoteViews#addView(int,RemoteViews)} and {@link
+android.widget.RemoteViews#removeAllViews(int)}.</li>
+
+<li>New {@link android.view.ViewGroup} methods {@link
+android.view.ViewGroup#isChildrenDrawingOrderEnabled()} and {@link
+android.view.ViewGroup#setChildrenDrawingOrderEnabled(boolean)}.</li>
+</ul>
+
+<h3>WebKit</h3>
+
+<ul>
+<li>New {@link android.webkit.WebStorage} methods to manipulate web
+storage databases.</li>
+
+<li>New {@link android.webkit.GeolocationPermissions} methods to
+get Geolocation permissions from, and set them on the WebView.</li>
+
+<li>New {@link android.webkit.WebSettings} methods to manage settings for
+app cache, web storage, and zooming based on screen density.</li>
+
+<li>New {@link android.webkit.WebChromeClient} methods for handling video,
+browsing history, custom Views, app cache limits, and more.</li>
+</ul>
+
+</ul>
+
+<!--
+<h3 id="behavior-changes">Behavior changes</h3>
+
+<h3 id="bug-fixes">Bug fixes</h3>
+-->
+
+<h3 id="api-diff">API differences report</h3>
+
+<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
+Level {@sdkPlatformApiLevel}), as compared to API Level 6, see the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report</a>.</p>
+
+<h2 id="apps">Built-in Applications</h2>
+
+<p>The system image included in the downloadable platform provides these
+built-in applications:</p>
+
+<table style="border:0;padding-bottom:0;margin-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+ <ul>
+ <li>Alarm Clock</li>
+ <li>Browser</li>
+ <li>Calculator</li>
+ <li>Camera</li>
+ <li>Contacts</li>
+ <li>Custom Locale (developer app)</li>
+ <li>Dev Tools (developer app)</li>
+ <li>Email</li>
+ </ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+ <ul>
+
+ <li>Gallery</li>
+ <li>IMEs for Japanese, Chinese, and Latin text input</li>
+ <li>Messaging</li>
+ <li>Music</li>
+ <li>Phone</li>
+ <li>Settings</li>
+ <li>Spare Parts (developer app)</li>
+ </ul>
+</td>
+</tr>
+</table>
+
+
+<h2 id="locs" style="margin-top:.75em;">Locales</h2>
+
+<p>The system image included in the downloadable platform provides a variety of
+built-in locales. In some cases, region-specific strings are available for the
+locales. In other cases, a default version of the language is used. The
+languages that are available in the Android {@sdkPlatformVersion} system
+image are listed below (with <em>language</em>_<em>country/region</em> locale
+descriptor).</p>
+
+<table style="border:0;padding-bottom:0;margin-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+<ul>
+<li>Chinese, PRC (zh_CN)</li>
+<li>Chinese, Taiwan (zh_TW)</li>
+<li>Czech (cs_CZ)</li>
+<li>Dutch, Netherlands (nl_NL)</li>
+<li>Dutch, Belgium (nl_BE)</li>
+<li>English, US (en_US)</li>
+<li>English, Britain (en_GB)</li>
+<li>English, Canada (en_CA)</li>
+<li>English, Australia (en_AU)</li>
+<li>English, New Zealand (en_NZ)</li>
+<li>English, Singapore(en_SG)</li>
+<li>French, France (fr_FR)</li>
+<li>French, Belgium (fr_BE)</li>
+</ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+<li>French, Canada (fr_CA)</li>
+<li>French, Switzerland (fr_CH)</li>
+<li>German, Germany (de_DE)</li>
+<li>German, Austria (de_AT)</li>
+<li>German, Switzerland (de_CH)</li>
+<li>German, Liechtenstein (de_LI)</li>
+<li>Italian, Italy (it_IT)</li>
+<li>Italian, Switzerland (it_CH)</li>
+<li>Japanese (ja_JP)</li>
+<li>Korean (ko_KR)</li>
+<li>Polish (pl_PL)</li>
+<li>Russian (ru_RU)</li>
+<li>Spanish (es_ES)</li>
+</td>
+</tr>
+</table>
+
+<p>Localized UI strings match the locales that are accessible
+through Settings.</p>
+
+<h2 id="skins">Emulator Skins</h2>
+
+<p>The downloadable platform includes a set of emulator skins that you can use
+for modeling your application in different screen sizes and resolutions. The
+emulator skins are:</p>
+
+<ul>
+ <li>
+ QVGA (240x320, low density, small screen)
+ </li>
+ <li>
+ WQVGA (240x400, low density, normal screen)
+ </li>
+ <li>
+ FWQVGA (240x432, low density, normal screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ WVGA800 (480x800, high density, normal screen)
+ </li>
+ <li>
+ WVGA854 (480x854 high density, normal screen)
+ </li>
+</ul>
+
+<p>For more information about how to develop an application that displays
+and functions properly on all Android-powered devices, see <a
+href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
+Screens</a>.</p>
diff --git a/docs/html/sdk/android-2.2-highlights.jd b/docs/html/about/versions/android-2.2-highlights.jd
similarity index 100%
rename from docs/html/sdk/android-2.2-highlights.jd
rename to docs/html/about/versions/android-2.2-highlights.jd
diff --git a/docs/html/about/versions/android-2.2.jd b/docs/html/about/versions/android-2.2.jd
new file mode 100644
index 0000000..361e8b6
--- /dev/null
+++ b/docs/html/about/versions/android-2.2.jd
@@ -0,0 +1,252 @@
+page.title=Android 2.2 Platform
+sdk.platform.version=2.2
+sdk.platform.apiLevel=8
+sdk.platform.majorMinor=minor
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#features">Platform Highlights</a></li>
+ <li><a href="#api-level">API Level</a></li>
+ <li><a href="#api">Framework API Changes</a>
+
+ </ol>
+ </li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+<h2>See Also</h2>
+<ol>
+ <li><a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>
+<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release including user
+features, developer features, API changes, and bug
+fixes. For information on developer features and API changes, see the
+<a href="#api">Framework API</a> section.</p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes
+an Android library and system image, as well as a set of emulator skins and
+more. To get started developing or testing against Android {@sdkPlatformVersion},
+use the Android SDK Manager to download the platform into your SDK.</p>
+
+
+<h2 id="features">Platform Highlights</h2>
+
+<p>For a list of new user features and platform highlights, see the <a
+href="http://developer.android.com/about/versions/android-2.2-highlights.html">Android
+2.2 Platform Highlights</a> document.</p>
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
+the framework API. The Android {@sdkPlatformVersion} API
+is assigned an integer identifier —
+<strong>{@sdkPlatformApiLevel}</strong> — that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your
+application, you need to set the proper value, "{@sdkPlatformApiLevel}", in the
+<code>android:minSdkVersion</code> attributes of the <code><uses-sdk></code>
+element in your application's manifest. </p>
+
+<p>For more information about how to use API Level, see the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Levels</a> document. </p>
+
+
+<h2 id="api">Framework API Changes</h2>
+
+<p>The sections below provide information about changes made to the application
+framework API provided by the Android {@sdkPlatformVersion} platform.</p>
+
+<h3 id="install-loc">App installation on external storage media</h3>
+
+<p>The Android platform now allows applications to request installation onto the
+device's external storage media (such as the SD card), as an alternative to
+installation onto the device's internal memory. </p>
+
+<p>Application developers can express the preferred installation location for
+their applications by means of a new attribute of <code><manifest></code>
+in the manifest file, <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#install"><code>
+android:installLocation</code></a>. The attribute supports three values:
+<code>"internalOnly"</code>, <code>"preferExternal"</code>, and
+<code>"auto"</code>. At install time, the system checks the value of
+<code>android:installLocation</code> and installs the application
+<code>.apk</code> according to the preferred location, if possible. If the
+application has requested external installation, the system installs it into a
+private, encrypted partition in the external media. Once an application .apk is
+installed externally, the system lets the user change the storage location of
+the .apk and move it onto the device's internal memory if needed (and vice
+versa), through Manage Applications in the user settings.</p>
+
+<p>By default, the system installs all applications onto the device's internal
+memory, except for those that explicitly request external installation. This
+means that the system will always install legacy applications onto internal
+memory, since they do not have access to the
+<code>android:installLocation</code> attribute. However, it is possible to
+configure and compile a legacy application such that it is installed internally
+on older versions of the platform and externally on Android 2.2 and later
+platforms, if necessary. </p>
+
+<p>Note that requesting installation onto the device's external media is not
+suitable for all applications, particularly because the external media may be
+removable and unmounting/remounting may disrupt the user experience and system
+settings.</p>
+
+<p>For more information about setting a preferred install location for your
+application, including a discussion of what types of applications should and
+should not request external installation, please read the <a
+href="{@docRoot}guide/appendix/install-location.html">App Install Location</a>
+document. </p>
+
+<h3 id="backup-manager">Data backup</h3>
+
+<p>The platform now provides a generalized backup service that
+applications can use to backup and restore user data, to ensure that users can
+maintain their data when switching devices or reinstalling the application. The
+Backup Manager handles the work of transporting the application data to and from
+the backup storage area in the cloud. The Backup Manager can store any type of
+data, from arbitrary data to files, and manages backup and restore operations
+in an atomic manner. For more information, see <a
+href="{@docRoot}guide/topics/data/backup.html">Data Backup</a>.</p>
+
+<h3>Graphics</h3>
+
+<ul>
+<li>New OpenGL ES 2.0 APIs in {@link android.opengl.GLES20 android.opengl.GLES20}.</li>
+<li>New {@link android.opengl.ETC1}, {@link android.opengl.ETC1Util}, and {@link android.opengl.ETC1Util.ETC1Texture} classes and utility methods for using ETC1 for texture compression.</li>
+<li>New {@link android.graphics.ImageFormat} class.</li>
+<li>New {@link android.graphics.YuvImage YUV image format API} to enable compression from YUV to JPEG and manipulation of YUV data.</li>
+</ul>
+
+<h3>Media</h3>
+
+<ul>
+<li>New APIs in {@link android.media.AudioManager android.media.AudioManager} for managing audio focus, transport control, transient loss of audio focus, ducking.</li>
+<li>New broadcast intent for routing audio to SCO — {@link android.media.AudioManager#ACTION_SCO_AUDIO_STATE_CHANGED} with extras indicating new state.</li>
+<li>New APIs in {@link android.media.SoundPool} to detect completion of sound-loading.</li>
+<li>New APIs in {@link android.media.SoundPool} for auto pause and resume.</li>
+<li>New APIs in {@link android.media.MediaRecorder} for specifying audio settings for number of channels, encoding and sampling rates, sampling rate.</li>
+<li>New APIs for adding files to the media database, so that they are automatically scanned. See {@link android.media.MediaScannerConnection#scanFile(Context, String[], String[], OnScanCompletedListener) MediaScannerConnection.scanFile} and {@link android.media.MediaScannerConnection.OnScanCompletedListener MediaScannerConnection.OnScanCompletedListener}.</li>
+</ul>
+
+<h3>Speech recognition and third-party recognition engines</h3>
+
+<ul>
+<li>The platform provides new speech-recognition APIs that allow applications to have a richer interaction with the available voice recognizer. For example, the APIs are sufficient to integrate voice recognition deeply into an IME.</li>
+<li>The platform also provides a {@link android.speech.RecognitionService} base class that lets third-party developers create plug-in recognition engines. </li>
+<li>New {@link android.speech.RecognitionListener} interface to receive callbacks.</li>
+<li>New {@link android.speech.RecognizerIntent} extras that let a requester app specify details as preferred language, minimum length in milliseconds, and so on.</li>
+</ul>
+
+<h3>Camera and camcorder</h3>
+
+<ul>
+<li>Changes to camera preview API to improve efficieny of preview pipeline. </li>
+<li>New display orientation for camera (it can now work in portrait orientation).</li>
+<li>New APIs in {@link android.hardware.Camera android.hardware.Camera} for managing zoom level.</li>
+<li>New APIs {@link android.hardware.Camera.Parameters android.hardware.Camera.Parameters} for querying and setting device camera settings such as focal length, exposure, zoom level, view angle, and others.</li>
+<li>New {@link android.media.ThumbnailUtils thumbnail} utility for video and image thumbnails.</li>
+<li>New {@link android.media.CamcorderProfile} and {@link android.media.CamcorderProfile} classes enable apps to determine device hardware camera capablities.</li>
+<li>New support in {@link android.media.ExifInterface android.media.ExifInterface} for retrieving GPS and focal length.</li>
+</ul>
+
+<h3>Device policy manager</h3>
+
+<p>New device policy management APIs allow developers to write "device
+administrator" applications that can control security features of the device,
+such as the minimum password strength, data wipe, and so on. Users can select
+the administrators that are enabled on their devices. For more information, see
+the {@link android.app.admin android.app.admin} classees or the example
+application code in <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html">DeviceAdminSample.java</a>.</p>
+
+<h3>UI Framework</h3>
+
+<ul>
+<li>New UI modes "car mode" and "night mode" and {@link android.app.UiModeManager} let applications adjust their application UI for specific user modes. </li>
+<li>New {@link android.view.ScaleGestureDetector} that lets Views detect and handle transformation gestures that involve more than one pointer (multitouch) using the supplied MotionEvents. </li>
+<li>Improvements in the way that multitouch events are reported in {@link android.view.MotionEvent} objects.</li>
+<li>The layout attribute <code>fill_parent</code> is renamed to <code>match_parent</code>. This affects both XML and Java code (see {@link android.view.ViewGroup.LayoutParams}). Note that the platform will continue to honor uses of <code>fill_parent</code> in legacy applications. </li>
+<li>New layout attributes {@link android.R.attr#tabStripEnabled}, {@link android.R.attr#tabStripRight}, and {@link android.R.attr#tabStripLeft} let developers customize the bottom strip of TabWidgets.</li>
+<li>Better support for managed dialogs in Activity.</li>
+</ul>
+
+<h3>Accounts and sync</h3>
+
+<ul>
+<li>New method {@link android.content.ContentResolver#addPeriodicSync(Account, String, Bundle, long) AddPeriodicSync()} lets you schedule a periodic sync with a specific account, authority, and extras at the given frequency.</li>
+</ul>
+
+<h3>New manifest elements and attributes</h3>
+
+<ul>
+<li>For specifying the application's preferred install location (see <a href="#install-loc">App Installation on External Storage Media</a>, above):
+
+<ul>
+ <li>New <code>android:installLocation</code> attribute of the <code><manifest></code> element. Specifies the default install location defined by an application.</li>
+</ul>
+</li>
+
+<li>For managing user data backup (see <a href="#backup-manager">Backup manager</a>, above, for more information):
+
+<ul>
+ <li> New <code>android:backupAgent</code> attribute of the
+<code><application></code> element. Specifies the component name of the
+BackupAgent subclass provided by the application to handle backup/restore
+operations, if any.</li>
+ <li> New <code>android:restoreAnyVersion</code> attribute of the
+<code><application></code> element. Boolean value that indicates whether
+the application is prepared to attempt a restore of any backed-up dataset, even
+if the backup is apparently from a newer version of the application than is
+currently installed on the device.</li>
+</ul>
+</li>
+
+<li>For managing the platform's JIT compiler:
+
+<ul>
+<li>New <code>android:vmSafeMode</code> attribute of the <code><application></code> element. Boolean value that specifies whether to disable JIT compiler optimizations when running the application.</li>
+</ul>
+</li>
+</ul>
+
+<h3>Permissions</h3>
+
+<ul>
+<li><code>android.permission.BIND_DEVICE_ADMIN</code> — Any device administration broadcast receiver must require this permission, to ensure that only the system can interact with it.</li>
+<li><code>android.permission.KILL_BACKGROUND_PROCESSES</code> — Allows an application to call {@link android.app.ActivityManager#killBackgroundProcesses(String)}.
+<li><code>android.permission.BIND_WALLPAPER</code> — Any {@link android.service.wallpaper.WallpaperService} must require this permission, to ensure that only the system can interact with it.</li>
+<li><code>android.permission.SET_TIME</code> — Allows an application to set the system time.</li>
+</ul>
+
+<h3 id="api-diff">API differences report</h3>
+
+<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
+Level {@sdkPlatformApiLevel}), see the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report</a>.</p>
+
+
+
diff --git a/docs/html/about/versions/android-2.3-highlights.jd b/docs/html/about/versions/android-2.3-highlights.jd
new file mode 100644
index 0000000..582bce9
--- /dev/null
+++ b/docs/html/about/versions/android-2.3-highlights.jd
@@ -0,0 +1,444 @@
+page.title=Gingerbread
+
+@jd:body
+
+
+<style type="text/css">
+#jd-content {
+ max-width:1200px;
+}
+#jd-content div.screenshot {
+ float:left;
+ clear:left;
+ padding:15px 30px 15px 0;
+}
+#jd-content div.video {
+ float:right;
+ padding:0 0 0 40px;
+}
+#jd-content table.columns {
+ margin:0 0 1em 0;
+}
+#jd-content table.columns td {
+ padding:0;
+}
+#jd-content table.columns td+td {
+ padding:0 2em;
+}
+#jd-content table.columns td img {
+ margin:0;
+}
+#jd-content table.columns td+td>*:first-child {
+ margin-top:-2em;
+}
+.green {
+ color:#8db529;
+ font-weight:bold;
+}
+</style>
+
+<p>The Android 2.3 platform introduces many new and exciting features for
+users and developers. This document provides a glimpse at some of the new features
+and technologies in Android 2.3. For detailed information about the new developer APIs, see the <a
+href="android-2.3.html">Android 2.3 version notes</a>.</p>
+
+<ul>
+ <li><a href="#UserFeatures">New User Features</a></li>
+ <li><a href="#DeveloperApis">New Developer Features</a></li>
+ <li><a href="#PlatformTechnologies">New Platform Technologies</a></li>
+</ul>
+
+
+<h2 id="UserFeatures" style="clear:right">New User Features</h2>
+
+<div>
+<img style="float:right;margin-left:20px;padding-bottom:2em;"
+src="{@docRoot}sdk/images/2.3/home-menu.png" alt="" height="280" />
+<img style="float:right;margin-left:20px;padding-bottom:2em;"
+src="{@docRoot}sdk/images/2.3/home-plain.png" alt="" height="280" />
+
+<h3>UI refinements for simplicity and speed</h3>
+
+<p>The user interface is refined in many ways across the system, making it
+easier to learn, faster to use, and more power-efficient. A simplified
+visual theme of colors against black brings vividness and contrast to the
+notification bar, menus, and other parts of the UI. Changes in menus and
+settings make it easier for the user to navigate and control the features
+of the system and device. </p>
+
+<h3>Faster, more intuitive text input</h3>
+
+<p>The Android soft keyboard is redesigned and optimized for faster text input
+and editing. The keys themselves are reshaped and repositioned for improved
+targeting, making them easier to see and press accurately, even at high speeds.
+The keyboard also displays the current character and dictionary suggestions in a
+larger, more vivid style that is easier to read.</p>
+
+<p>The keyboard adds the capability to correct entered words from suggestions in
+the dictionary. As the user selects a word already entered, the keyboard
+displays suggestions that the user can choose from, to replace the selection.
+The user can also switch to voice input mode to replace the selection. Smart
+suggestions let the user accept a suggestion and then return to correct it
+later, if needed, from the original set of suggestions.</p>
+
+<p>New multitouch key-chording lets the user quickly enter numbers and symbols
+by pressing Shift+<<em>letter</em>> and ?123+<<em>symbol</em>>,
+without needing to manually switch input modes. From certain keys, users can
+also access a popup menu of accented characters, numbers, and symbols by holding
+the key and sliding to select a character.</p>
+</div>
+
+<div style="padding-top:1em;">
+<div style="margin-right:1em;float:left;"><img src="{@docRoot}sdk/images/2.3/onetouch.png" alt=""
+height="260" /></div>
+<div style="padding-right:2em;float:left;"><img src="{@docRoot}sdk/images/2.3/selection.png" alt=""
+height="160" /></div>
+
+
+<h3>One-touch word selection and copy/paste</h3>
+
+<p>When entering text or viewing a web page, the user can quickly select a word
+by press-hold, then copy to the clipboard and paste. Pressing on a word enters a
+free-selection mode — the user can adjust the selection area as needed by
+dragging a set of bounding arrows to new positions, then copy the bounded area
+by pressing anywhere in the selection area. For text entry, the user can
+slide-press to enter a cursor mode, then reposition the cursor easily and
+accurately by dragging the cursor arrow. With both the selection and cursor
+modes, no use of a trackball is needed.</p>
+
+</div>
+
+<div style="clear:left">
+<div style="padding-right:2em;float:right;margin-left:20px;"><img
+src="{@docRoot}sdk/images/2.3/running.png" alt="" height="280" /></div>
+<div style="padding-left:1em;float:right;margin-left:20px;"><img
+src="{@docRoot}sdk/images/2.3/power.png" alt="" height="280" /></div>
+
+<h3>Improved power management </h3>
+
+<p>The Android system takes a more active role in managing apps that are keeping
+the device awake for too long or that are consuming CPU while running in the
+background. By managing such apps — closing them if appropriate —
+the system helps ensure best possible performance and maximum battery life.</p>
+
+<p>The system also gives the user more visibility over the power being consumed
+by system components and running apps. The Application settings provides an
+accurate overview of how the battery is being used, with details of the usage
+and relative power consumed by each component or application.</p>
+
+<h3>Control over applications</h3>
+
+<p>A shortcut to the Manage Applications control now appears in the Options Menu
+in the Home screen and Launcher, making it much easier to check and manage
+application activity. Once the user enters Manage Applications, a new Running
+tab displays a list of active applications and the storage and memory being used
+by each. The user can read further details about each application and if
+necessary stop an application or report feedback to its developer. </p>
+</div>
+
+<h3>New ways of communicating, organizing</h3>
+
+<p>An updated set of standard applications lets the user take new approaches to
+managing information and relationships. </p>
+
+<div style="padding-top:1em;">
+<div style="padding-right:1.5em;float:left;"><img src="{@docRoot}sdk/images/2.3/sipcall.png" alt=""
+height="190" align="left"/><br>
+<img src="{@docRoot}sdk/images/2.3/ffc.png" alt="" height="190" align="left"
+style="margin-bottom:1.5em;margin-top:.75em;"/><div></div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Internet calling</strong></p>
+
+<p>The user can make voice calls over the internet to other users who have SIP
+accounts. The user can add an internet calling number (a SIP address) to any
+Contact and can initiate a call from Quick Contact or Dialer. To use internet
+calling, the user must create an account at the SIP provider of their choice
+— SIP accounts are not provided as part of the internet calling feature.
+Additionally, support for the platform's SIP and internet calling features on
+specific devices is determined by their manufacturers and associated carriers.
+</p>
+
+<div style="padding-right:1.5em;float:right;margin-left:20px;;"><img
+src="{@docRoot}sdk/images/2.3/nfc.png" alt="" height="190" /> </div>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Near-field communications</strong></p>
+
+<p>An NFC Reader application lets the user read and interact with near-field
+communication (NFC) tags. For example, the user can “touch” or “swipe” an NFC
+tag that might be embedded in a poster, sticker, or advertisement, then act on
+the data read from the tag. A typical use would be to read a tag at a
+restaurant, store, or event and then rate or register by jumping to a web site
+whose URL is included in the tag data. NFC communication relies on wireless
+technology in the device hardware, so support for the platform's NFC features on
+specific devices is determined by their manufacturers.
+</p>
+</div>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Downloads management</strong></p>
+
+<p>The Downloads application gives the user easy access to any file downloaded from
+the browser, email, or another application. Downloads is built on an completely new
+download manager facility in the system that any other applications can use, to
+more easily manage and store their downloads.</p>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Camera</strong></p>
+
+<p>The application now lets the user access multiple cameras on the device,
+including a front-facing camera, if available. </p>
+
+
+<h2 id="DeveloperApis" style="clear:both">New Developer Features</h2>
+
+<p>Android 2.3 delivers a variety of features and APIs that
+let developers bring new types of applications to the Android
+platform.</p>
+
+ <ul>
+<li><a href="#gaming">Enhancements for gaming</a></li>
+<li><a href="#communication">New forms of communication</a></li>
+<li><a href="#multimedia">Rich multimedia</a></li>
+</ul>
+
+<h3 id="gaming">Enhancements for gaming</h3>
+
+<p style="margin-top:.75em;margin-bottom:.75em;"><strong>Performance</strong></p>
+
+<p>Android 2.3 includes a variety of improvements across the system that make
+common operations faster and more efficient for all applications. Of particular
+interest to game developers are:</p>
+
+<ul>
+<li>Concurrent garbage collector — The Dalivik VM introduces a new,
+concurrent garbage collector that minimizes application pauses, helping to
+ensure smoother animation and increased responsiveness in games and similar
+applications. </li>
+<li>Faster event distribution — The plaform now handles touch and keyboard
+events faster and more efficiently, minimizing CPU utilization during event
+distribution. The changes improve responsiveness for all applications, but
+especially benefit games that use touch events in combination with 3D graphics
+or other CPU-intensive operations. </li>
+<li>Updated video drivers — The platform uses updated third-party video
+drivers that improve the efficiency of OpenGL ES operations, for faster overall
+3D graphics performance. </li>
+</ul>
+
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Native input and
+sensor events</strong></p>
+
+<p>Applications that use native code can now receive and process input and
+sensor events directly in their native code, which dramatically improves
+efficiency and responsiveness. </p>
+
+<p>Native libraries exposed by the platform let applications handle the same
+types of input events as those available through the framework. Applications
+can receive events from all supported sensor types and can enable/disable
+specific sensors and manage event delivery rate and queueing. </p>
+
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Gyroscope and other
+new sensors, for improved 3D motion processing</strong></p>
+
+<p>Android 2.3 adds API support for several new sensor types, including
+gyroscope, rotation vector, linear acceleration, gravity, and barometer sensors.
+Applications can use the new sensors in combination with any other sensors
+available on the device, to track three-dimensional device motion and
+orientation change with high precision and accuracy. For example, a game
+application could use readings from a gyroscope and accelerometer on the device
+to recognize complex user gestures and motions, such as tilt, spin, thrust, and
+slice. </p>
+
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Open API for native
+audio</strong></p>
+
+<p>The platform provides a software implementation of <a
+href="http://www.khronos.org/opensles/">Khronos OpenSL ES</a>, a standard API
+that gives applications access to powerful audio controls and effects from
+native code. Applications can use the API to manage audio devices and control
+audio input, output, and processing directly from native code.</p>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Native graphics
+management</strong></p>
+
+<p>The platform provides an interface to its <a
+href="http://www.khronos.org/egl/">Khronos EGL</a> library, which lets
+applications manage graphics contexts and create and manage OpenGL ES textures
+and surfaces from native code.</p>
+
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Native access to
+Activity lifecycle, window management</strong></p>
+
+<p>Native applications can declare a new type of Activity class,
+<code>NativeActivity</code> whose lifecycle callbacks are implemented directly
+in native code. The <code>NativeActivity</code> and its underlying native code
+run in the system just as do other Activities — they run in the
+application's system process and execute on the application's main UI thread,
+and they receive the same lifecycle callbacks as do other Activities. </p>
+
+<p>The platform also exposes native APIs for managing windows, including the
+ability to lock/unlock the pixel buffer to draw directly into it. Through the
+API, applications can obtain a native window object associated with a framework
+Surface object and interact with it directly in native code.</p>
+
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Native access to
+assets, storage</strong></p>
+
+<p>Applications can now access a native Asset Manager API to retrieve
+application assets directly from native code without needing to go through JNI.
+If the assets are compressed, the platform does streaming decompression as the
+application reads the asset data. There is no longer a limit on the size of
+compressed <code>.apk</code> assets that can be read.</p>
+
+<p>Additionally, applications can access a native Storage Manager API to work
+directly with OBB files downloaded and managed by the system. Note that although
+platform support for OBB is available in Android 2.3, development tools for
+creating and managing OBB files will not be available until early 2011.</p>
+
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Robust native
+development environment</strong></p>
+
+<p>The Android NDK (r5 or higher) provides a complete set of tools, toolchains,
+and libraries for developing applications that use the rich native environment
+offered by the Android 2.3 platform. For more information or to download the
+NDK, please see the <a
+href="http://developer.android.com/sdk/ndk/index.html">Android NDK</a>
+page. </p>
+
+
+<h3 id="communication">New forms of communication</h3>
+
+<p style="margin-top:.75em;margin-bottom:.75em;"><strong>Internet
+telephony</strong></p>
+
+<p>Developers can now add SIP-based internet telephony features to their
+applications. Android 2.3 includes a full SIP protocol stack and integrated call
+management services that let applications easily set up outgoing and incoming
+voice calls, without having to manage sessions, transport-level communication,
+or audio record or playback directly. </p>
+
+<p>Support for the platform's SIP and internet calling features on specific
+devices is determined by their manufacturers and associated carriers.</p>
+
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Near Field
+Communications (NFC)</strong></p>
+
+<p>The platform's support for Near Field Communications (NFC) lets developers
+get started creating a whole new class of applications for Android. Developers
+can create new applications that offer proximity-based information and services
+to users, organizations, merchants, and advertisers. </p>
+
+<p>Using the NFC API,
+applications can read and respond to NFC tags “discovered” as the user “touches” an
+NFC-enabled device to elements embedded in stickers, smart posters, and even
+other devices. When a tag of interest is collected, applications can respond to
+the tag, read messages from it, and then store the messages, prompting
+the user as needed. </p>
+
+<p>Starting from Android 2.3.3, applications can also write to tags and
+set up peer-to-peer connections with other NFC devices.</p>
+
+<p>NFC communication relies on wireless technology in the device hardware, so
+support for the platform's NFC features on specific devices is determined by
+their manufacturers.</p>
+
+
+<h3 id="multimedia">Rich multimedia</h3>
+
+<p style="margin-top:.75em;margin-bottom:.75em;"><strong>Mixable audio
+effects</strong></p>
+
+<p>A new audio effects API lets developers easily create rich audio environments
+by adding equalization, bass boost, headphone virtualization (widened
+soundstage), and reverb to audio tracks and sounds. Developers can mix multiple
+audio effects in a local track or apply effects globally, across multiple
+tracks.</p>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Support for new media
+formats</strong></p>
+
+<p>The platform now offers built-in support for the VP8 open video compression
+format and the WebM open container format. The platform also adds support for
+AAC encoding and AMR wideband encoding (in software), so that applications can
+capture higher quality audio than narrowband. </p>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Access to multiple
+cameras</strong></p>
+
+<p>The Camera API now lets developers access any cameras that are available on a
+device, including a front-facing camera. Applications can query the platform for
+the number of cameras on the device and their types and characteristics, then
+open the camera needed. For example, a video chat application might want to access a
+front-facing camera that offers lower-resolution, while a photo application
+might prefer a back-facing camera that offers higher-resolution.</p>
+
+
+<h2 id="PlatformTechnologies">New Platform Technologies</h2>
+
+<h3>Media Framework</h3>
+
+<ul>
+<li>New media framework fully replaces OpenCore, maintaining all previous
+codec/container support for encoding and decoding.</li>
+<li>Integrated support for the VP8 open video compression format and the WebM
+open container format</li>
+<li>Adds AAC encoding and AMR wideband encoding</li>
+</ul>
+
+<h3>Linux Kernel </h3>
+<ul>
+<li>Upgraded to 2.6.35</li>
+</ul>
+
+<h3>Networking</h3>
+<ul>
+<li>SIP stack, configurable by device manufacturer
+<li>Support for Near Field Communications (NFC), configurable by device manufacturer</li>
+<li>Updated BlueZ stack</li>
+</ul>
+
+<h3>Dalvik runtime</h3>
+
+<ul>
+<li>Dalvik VM:
+<ul>
+<li>Concurrent garbage collector (target sub-3ms pauses)</li>
+<li>Adds further JIT (code-generation) optimizations</li>
+<li>Improved code verification</li>
+<li>StrictMode debugging, for identifying performance and memory issues</li>
+</ul>
+</li>
+
+
+<li>Core libraries:
+<ul>
+ <li>Expanded I18N support (full worldwide encodings, more locales)
+ <li>Faster Formatter and number formatting. For example, float formatting is 2.5x faster.</li>
+ <li>HTTP responses are gzipped by default. XML and JSON API response sizes may be reduced by 60% or more.</li>
+ <li>New collections and utilities APIs</li>
+ <li>Improved network APIs</li>
+ <li>Improved file read and write controls</li>
+ <li>Updated JDBC</li>
+</ul>
+</li>
+
+<li>Updates from upstream projects:
+ <ul>
+ <li>OpenSSL 1.0.0a</li>
+ <li>BouncyCastle 1.45</li>
+ <li>ICU 4.4</li>
+ <li>zlib 1.2.5</li>
+ </ul>
+</li>
+
+
+</ul>
+
+<p>For more information about the new developer APIs, see the <a
+href="android-2.3.html">Android 2.3 version notes</a> and the <a
+href="{@docRoot}sdk/api_diff/9/changes.html">API Differences Report</a>.</p>
diff --git a/docs/html/about/versions/android-2.3.3.jd b/docs/html/about/versions/android-2.3.3.jd
new file mode 100644
index 0000000..55ff346
--- /dev/null
+++ b/docs/html/about/versions/android-2.3.3.jd
@@ -0,0 +1,192 @@
+page.title=Android 2.3.3 Platform
+sdk.platform.version=2.3.3
+sdk.platform.apiLevel=10
+
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#api">API Overview</a></li>
+ <li><a href="#api-level">API Level</a></li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+</div>
+</div>
+
+<p>
+<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>Android 2.3.3 is a small feature release that adds several improvements
+and APIs to the Android 2.3 platform.</p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes
+an Android library and system image, as well as a set of emulator skins and
+more. To get started developing or testing against Android {@sdkPlatformVersion},
+use the Android SDK Manager to download the platform into your SDK.</p>
+
+
+
+<h2 id="api">API Overview</h2>
+
+<p>The sections below provide a technical overview of what's new for developers
+in {@sdkPlatformVersion}, including new features and changes in the framework
+API since the previous version.</p>
+
+<h3 id="nfc">Near Field Communications (NFC)</h3>
+
+<p>Android 2.3.3 provides improved and extended support for NFC, to allow
+applications to interact with more types of tags in new ways.</p>
+
+<p>A new, comprehensive set of APIs give applications read and write access
+to a wider range of standard tag technologies, including:</p>
+
+<ul>
+<li>NFC-A (ISO 14443-3A)</li>
+<li>NFC-B (ISO 14443-3B)</li>
+<li>NFC-F (JIS 6319-4)</li>
+<li>NFC-V (ISO 15693)</li>
+<li>ISO-DEP (ISO 14443-4)</li>
+<li>MIFARE Classic</li>
+<li>MIFARE Ultralight</li>
+<li>NFC Forum NDEF tags</li>
+</ul>
+
+<p>The platform also provides a limited peer-to-peer communication protocol
+and API. Foreground Activities can use the API to register an NDEF
+message that will get pushed to other NFC devices when they connect.</p>
+
+<p>Advanced tag dispatching now gives applications more control over how and
+when they are launched, when an NFC tag is discovered. Previously, the platform
+used a single-step intent dispatch to notify interested applications that a tag
+was discovered. The platform now uses a four-step process that enables the
+foreground application to take control of a tag event before it is passed to any
+other applications (<code>android.nfc.NfcAdapter.enableForegroundDispatch()</code>).
+
+The new dispatch process also lets apps listen for specific tag content and
+tag technologies, based on two new intent actions —
+<code>android.nfc.action.NDEF_DISCOVERED</code> and
+<code>android.nfc.action.TECH_DISCOVERED</code>.</p>
+
+<p>The NFC API is available in the {@link android.nfc} and
+{@link android.nfc.tech} packages. The key classes are: </p>
+
+<ul>
+<li>{@link android.nfc.NfcAdapter}, which represents the NFC hardware on the device.</li>
+<li>{@link android.nfc.NdefMessage}, which represents an NDEF data message,
+the standard format in which "records" carrying data are transmitted between
+devices and tags. An NDEF message certain many NDEF records of different types.
+Applications can receive these messages from
+{@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED NDEF_DISCOVERED},
+{@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED TECH_DISCOVERED}, or
+{@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED TAG_DISCOVERED} Intents.</li>
+<li>{@link android.nfc.NdefRecord}, delivered in an
+{@link android.nfc.NdefMessage}, which describes the type of data being shared
+and carries the data itself.</li>
+<li>{@link android.nfc.Tag}, which represents a tag scanned by the device.
+Multiple types of tags are supported, based on the underlying tag
+technology.</li>
+<li>{@link android.nfc.tech.TagTechnology}, an interface that gives applications
+access to tag properties and I/O operations based on the technologies present
+in the tag. For a full list of tag technologies supported in Android 2.3.3, see
+{@link android.nfc.tech}.</li>
+</ul>
+
+<p>NFC communication relies on wireless technology in the device hardware, and
+is not present in all Android devices. Android devices that do not support
+NFC will return a null object when
+{@link android.nfc.NfcAdapter#getDefaultAdapter(android.content.Context)
+getDefaultAdapter(Context)} is called, and
+<code>context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC)</code>
+will return <code>false</code>. The NFC API is always present, however, regardless of
+underlying hardware support.</p>
+
+<p>To use the NFC API, applications must request permission from the user by
+declaring <code><uses-permission
+android:name="android.permission.NFC"></code> in their manifest files.</p>
+
+<p>Additionally, developers can request filtering on Google Play, such that
+their applications are not discoverable to users whose devices do not support
+NFC. To request filtering, add
+<code><uses-feature android:name="android.hardware.nfc"
+android:required="true"></code> to the application's manifest.</p>
+
+<p class="note">To look at sample code for NFC, see
+<a href="{@docRoot}resources/samples/NFCDemo/index.html">NFCDemo app</a>, <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/TechFilter.html">filtering by tag technology</a></li>, <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/ForegroundDispatch.html">using foreground dispatch</a>, and <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/ForegroundNdefPush.html">foreground NDEF push (P2P)</a>.</p>
+
+<h3 id="bluetooth">Bluetooth</h3>
+
+<p>Android 2.3.3 adds platform and API support for Bluetooth nonsecure socket
+connections. This lets applications communicate with simple devices that may not
+offer a UI for authentication. See
+{@link android.bluetooth.BluetoothDevice#createInsecureRfcommSocketToServiceRecord(java.util.UUID)} and
+{@link android.bluetooth.BluetoothAdapter#listenUsingInsecureRfcommWithServiceRecord(java.lang.String, java.util.UUID)}
+for more information. </p>
+
+<h3 id="graphics">Graphics</h3>
+
+<ul>
+<li>A new {@link android.graphics.BitmapRegionDecoder} class lets applications
+decode a rectangle region from an image. The API is particularly useful when an
+original image is large and and the application only need parts of the image.
+</li>
+<li>A new {@link
+android.graphics.BitmapFactory.Options#inPreferQualityOverSpeed} field in {@link
+android.graphics.BitmapFactory.Options} allows applications to use a more accurate
+but slightly slower IDCT method in JPEG decode. This in turn improves the
+quality of the reconstructed image.</li>
+</ul>
+
+
+<h3 id="media">Media framework</h3>
+
+<ul>
+<li>A new {@link android.media.MediaMetadataRetriever} class provides a unified
+interface for retrieving frame and metadata from an input media file.</li>
+<li>{@link android.media.MediaRecorder.AudioEncoder} and {@link
+android.media.MediaRecorder.OutputFormat} include new fields for specifying AMR
+Wideband and AAC formats. </li>
+</ul>
+
+
+<h3 id="speech">Speech recognition</h3>
+
+<p>The speech-recognition API includes new constants to let you manage voice
+search results in new ways. Although the new constants are not needed for normal
+use of speech recognition, you could use them to offer a different view of voice
+search results in your application. For information, see {@link
+android.speech.RecognizerResultsIntent}.</p>
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
+the framework API. The Android {@sdkPlatformVersion} API
+is assigned an integer identifier —
+<strong>{@sdkPlatformApiLevel}</strong> — that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
+you need compile the application against the Android library that is provided in
+the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
+also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
+attribute to the <code><uses-sdk></code> element in the application's
+manifest. If your application is designed to run only on Android 2.3 and higher,
+declaring the attribute prevents the application from being installed on earlier
+versions of the platform.</p>
+
+<p>For more information, read <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">What is API
+Level?</a></p>
\ No newline at end of file
diff --git a/docs/html/about/versions/android-2.3.4.jd b/docs/html/about/versions/android-2.3.4.jd
new file mode 100644
index 0000000..bb4feec
--- /dev/null
+++ b/docs/html/about/versions/android-2.3.4.jd
@@ -0,0 +1,148 @@
+page.title=Android 2.3.4 Platform
+sdk.platform.version=2.3.4
+sdk.platform.apiLevel=10
+
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#api">API Overview</a></li>
+ <li><a href="#openaccessory">Open Accessory Library</a></li>
+ <li><a href="#api-level">API Level</a></li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+</div>
+</div>
+
+<p>
+<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>Android 2.3.4 is a maintenance release that adds several bug fixes and patches
+to the Android 2.3 platform, without any API changes from Android 2.3.3. Additionally,
+Android 2.3.4 brings support for the Open Accessory API to mobile devices,
+through the optional <a href="#usb">Open Accessory Library</a>. </p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes
+an Android library and system image, as well as a set of emulator skins and
+more. To get started developing or testing against Android {@sdkPlatformVersion},
+use the Android SDK Manager to download the platform into your SDK.</p>
+
+
+
+<h2 id="api">API Overview</h2>
+
+<p>Android 2.3.4 provides the same framework API to applications as Android 2.3.3
+(API level 10). For a summary of the API, see the
+<a href="{@docRoot}about/versions/android-2.3.3.html">Android 2.3.3 version notes</a>.</p>
+
+
+<h2 id="openaccessory">Open Accessory Library</h2>
+
+<p><em>Open Accessory</em> is a new capability for integrating
+connected peripherals with applications running on the platform. The capability
+is based on a USB (Universal Serial Bus) stack built into the platform and an
+API exposed to applications. Peripherals that attach to Android-powered devices
+as accessories connect as USB hosts. </p>
+
+<p>Open Accessory is introduced in <a
+href="{@docRoot}about/versions/android-3.1.html#usb">Android 3.1</a> (API level 12), but is
+made available to devices running Android 2.3.4 by means of an optional external
+library, the Open Accessory Library. The library exposes a framework API that
+lets applications discover, communicate with, and manage a variety of device
+types connected over USB. It also provides the implementation of the API against
+parts of the Android platform that are not directly exposed to applications in
+Android 2.3.4.</p>
+
+<p>The Open Accessory Library is optional on any given device. Device
+manufacturers may choose whether to include the Open Accessory Library in their
+products or exclude it. The library is forward-compatible with Android 3.1, so
+applications developed against Android 2.3.4 will run properly on devices
+running Android 3.1, if those devices support USB accessories. </p>
+
+<p>The API provided by the Open Accessory Library is based on the Open Accessory
+API provided in Android 3.1. In most areas, you can use the same techniques and
+APIs. However, developing for the Open Accessory Library on Android 2.3.4 differs
+from the standard USB API in these ways:
+
+<ul>
+<li>Obtaining a {@link android.hardware.usb.UsbManager} object — To obtain
+a {@link android.hardware.usb.UsbManager} object when using the add-on library,
+use the helper method <code>getInstance()</code> rather than {@link
+android.content.Context#getSystemService(java.lang.String) getSystemService()}
+For example:
+
+<pre>UsbManager manager = UsbManager.getInstance(this);</pre></li>
+
+<li>Obtaining a {@link android.hardware.usb.UsbAccessory} from a filtered intent
+— When you filter for a connected device or accessory with an intent
+filter, the {@link android.hardware.usb.UsbAccessory} object is contained
+inside the intent that is passed to your application. If you are using the
+add-on library, you can get the {@link android.hardware.usb.UsbAccessory} object
+in the following manner:
+
+<pre>UsbAccessory accessory = UsbManager.getAccessory(intent)</pre></li>
+
+<li>No USB host support — Android 2.3.4 and the Open Accessory Library do
+not support USB host mode (for example, through {@link
+android.hardware.usb.UsbDevice}), although USB host mode is supported in Android
+3.1. An Android-powered device running Android 2.3.4 can not function as a USB
+host. The library enables the Android-powered device to function as
+a peripheral only, with the connected accessory functioning as USB host
+(through {@link android.hardware.usb.UsbAccessory}).</li>
+</ul>
+
+<p>To develop apps using the Open Accessory Library, you need:</p>
+
+<ul>
+<li>The latest version of the Android SDK tools</li>
+<li>The latest version of the Google APIs add-on, which includes the library
+itself (for linking)</li>
+<li>An actual hardware device running Android 2.3.4 (or Android 3.1) with USB
+accessories support, for runtime testing against connected devices</li>
+</ul>
+
+<p>For a full discussion of how to develop applications that interact with USB
+accessories, please see the related <a
+href="{@docRoot}guide/topics/connectivity/usb/index.html">developer documentation</a>.</p>
+
+<p>Additionally, developers can request filtering on Google Play, such that
+their applications are not available to users whose devices do not provide the
+appropriate accessory support. To request filtering, add the element below
+to the application manifest:</p>
+
+<pre><uses-feature
+ android:name="android.hardware.usb.accessory"
+ android:required="true"></pre>
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android 2.3.4 platform does <em>not</em> increment the API level —
+it uses the same API level as Android 2.3.3, API level 10.
+
+<p>To use APIs introduced in API level 10 in your application,
+you need compile the application against the Android library that is provided in
+the latest version of the Google APIs Add-On, which also includes the Open
+Accessory Library.</p>
+
+<p>Depending on your needs, you might
+also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
+attribute to the <code><uses-sdk></code> element in the application's
+manifest. If your application is designed to run only on Android 2.3.3 and higher,
+declaring the attribute prevents the application from being installed on earlier
+versions of the platform.</p>
+
+<p>For more information, read <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">What is API
+Level?</a></p>
diff --git a/docs/html/about/versions/android-2.3.jd b/docs/html/about/versions/android-2.3.jd
new file mode 100644
index 0000000..2afa564
--- /dev/null
+++ b/docs/html/about/versions/android-2.3.jd
@@ -0,0 +1,710 @@
+page.title=Android 2.3 Platform
+sdk.platform.version=2.3
+sdk.platform.apiLevel=9
+
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#api">API Overview</a></li>
+ <li><a href="#api-level">API Level</a></li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+</div>
+</div>
+
+<p>
+<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes
+an Android library and system image, as well as a set of emulator skins and
+more. To get started developing or testing against Android {@sdkPlatformVersion},
+use the Android SDK Manager to download the platform into your SDK.</p>
+
+
+
+
+<h2 id="api">API Overview</h2>
+
+<p>The sections below provide a technical overview of what's new for developers
+in {@sdkPlatformVersion}, including new features and changes in the framework
+API since the previous version.</p>
+
+
+<h3 id="sip">SIP-based VoIP</h3>
+
+<p>The platform now includes a SIP protocol stack and framework API that lets
+developers build internet telephony applications. Using the API, applications can offer
+voice calling features without having to manage sessions, transport-level
+communication, or audio — these are handled
+transparently by the platform's SIP API and services.</p>
+
+<p>The SIP API is available in the {@link android.net.sip android.net.sip}
+package. The key class is {@link android.net.sip.SipManager}, which applications
+use to set up and manage SIP profiles, then initiate audio calls and receive
+audio calls. Once an audio call is established, applications can mute calls,
+turn on speaker mode, send DTMF tones, and more. Applications can also use the
+{@link android.net.sip.SipManager} to create generic SIP connections.</p>
+
+<p>The platform’s underlying SIP stack and services are available on devices at
+the discretion of the manufacturer and associated carrier. For this reason,
+applications should use the {@link android.net.sip.SipManager#isApiSupported
+isApiSupported()} method to check whether SIP support is available, before
+exposing calling functionality to users. </p>
+
+<p>To use the SIP API, applications must request permission from the user by
+declaring <code><uses-permission
+android:name="android.permission.INTERNET"></code> and <code><uses-permission
+android:name="android.permission.USE_SIP"></code> in their manifest files.</p>
+
+<p>Additionally, developers can request filtering on Google Play, such that
+their applications are not discoverable to users whose devices do not include
+the platform’s SIP stack and services. To request filtering, add <code><uses-feature
+android:name="android.software.sip"
+android:required="true"></code> and <code><uses-feature
+android:name="android.software.sip.voip"></code> to the application manifest.</p>
+
+<p class="note">To look at a sample application that uses the SIP API, see <a
+href="{@docRoot}resources/samples/SipDemo/index.html">SIP Demo</a>.</p>
+
+<h3 id="nfc">Near Field Communications (NFC)</h3>
+
+<p>Android 2.3 includes an NFC stack and framework API that lets developers
+read NDEF tags that are discovered as a user touches an NFC-enabled device
+to tag elements embedded in stickers, smart posters, and even other devices.</p>
+
+<p>The platform provides the underlying NFC services that work with the device
+hardware to discover tags when they come into range. On discovering a tag, the
+platform notifies applications by broadcasting an Intent, appending the tag's
+NDEF messages to the Intent as extras. Applications can create Intent filters to
+recognize and handle targeted tags and messages. For example, after receiving a
+tag by Intent, applications extract the NDEF messages, store them, alert the
+user, or handle them in other ways. </p>
+
+<p>The NFC API is available in the {@link android.nfc} package. The key classes are: </p>
+
+<ul><li>{@link android.nfc.NfcAdapter}, which represents the NFC hardware on the device.</li>
+<li>{@link android.nfc.NdefMessage}, which represents an NDEF data message,
+the standard format in which "records" carrying data are transmitted between
+devices and tags. Applications can receive these messages from {@link
+android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}</code> Intents.</li>
+<li>{@link android.nfc.NdefRecord}, delivered in an
+{@link android.nfc.NdefMessage}, which describes the type of data being shared and
+carries the data itself.</li>
+</ul>
+
+<p>NFC communication relies on wireless technology in the device hardware, so
+support for the platform's NFC features on specific devices is determined by
+their manufacturers. To determine the NFC support on the current device,
+applications can call {@link android.nfc.NfcAdapter#isEnabled isEnabled()} to
+query the {@link android.nfc.NfcAdapter}. The NFC API is always present,
+however, regardless of underlying hardware support.</p>
+
+<p>To use the NFC API, applications must request permission from the user by
+declaring <code><uses-permission
+android:name="android.permission.NFC"></code> in their manifest files.</p>
+
+<p>Additionally, developers can request filtering on Google Play, such that
+their applications are not discoverable to users whose devices do not support
+NFC. To request filtering, add
+<code><uses-feature android:name="android.hardware.nfc"
+android:required="true"></code> to the application's manifest.</p>
+
+<p class="note">To look at a sample application that uses the NFC API, see
+<a href="{@docRoot}resources/samples/NFCDemo/index.html">NFCDemo</a>.</p>
+
+<h3 id="sensors">Gyroscope and other sensors</h3>
+
+<p>Android 2.3 adds platform and API support for several new sensor reading
+types — gyroscope, rotation vector, linear acceleration, gravity, and barometer.
+Developers can use the new sensor readings to create applications that respond
+quickly and smoothly to precise changes in device position and motion. The
+Sensor API reports gyroscope and other sensor changes to interested
+applications, whether they are running on the application framework or in native
+code. </p>
+
+<p>Note that the specific set of hardware sensors available on any given device
+varies at the discretion of the device manufacturer. </p>
+
+<p>Developers can request filtering on Google Play, such that their
+applications are not discoverable to users whose devices do not offer a
+gyroscope sensor. To do so, add <code><uses-feature
+android:name="android.hardware.sensor.gyroscope"
+android:required="true"></code> to the application manifest.</p>
+
+<p>For API details, see {@link android.hardware.Sensor}.</p>
+
+
+<h3 id="cameras">Multiple cameras support</h3>
+
+<p>Applications can now make use of any cameras that are available on a device,
+for either photo or video capture. The {@link android.hardware.Camera} lets
+applications query for the number of cameras available and the unique
+characteristics of each. </p>
+
+<ul>
+<li>New {@link android.hardware.Camera.CameraInfo} class stores a camera's
+positional characteristics (orientation, front-facing or back-facing).</li>
+<li>New {@link android.hardware.Camera#getNumberOfCameras()} and {@link
+android.hardware.Camera#getCameraInfo(int,CameraInfo) getCameraInfo()} methods in the {@link
+android.hardware.Camera} class let applications query for the cameras available
+and open the camera that they need.</li>
+<li>New {@link android.media.CamcorderProfile#get get()} method lets
+applications retrieve a {@link android.media.CamcorderProfile} for a specific camera. </li>
+<li>New {@link android.media.CameraProfile#getJpegEncodingQualityParameter(int, int)
+getJpegEncodingQualityParameter()} lets applications obtain the still-image
+capture quality level for a specific camera.</li>
+</ul>
+
+<p class="note">To look at sample code for accessing a front-facing camera, see <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html">CameraPreview.java</a>
+in the ApiDemos sample application.</p>
+
+<p>The Camera API also adds: </p>
+<ul>
+<li>New parameters for cameras, including focus distance, focus mode, and
+preview fps maximum/minimum. New {@link
+android.hardware.Camera.Parameters#getFocusDistances(float[])
+getFocusDistances()}, {@link
+android.hardware.Camera.Parameters#getPreviewFpsRange(int[])
+getPreviewFpsRange()}, and {@link
+android.hardware.Camera.Parameters#getSupportedPreviewFpsRange()
+getSupportedPreviewFpsRange()} for getting camera parameters, as well as {@link
+android.hardware.Camera.Parameters#setPreviewFpsRange(int, int)
+setPreviewFpsRange()} for setting preview framerate. </li>
+</ul>
+
+<h3 id="media">Mixable audio effects</h3>
+
+<p>The platform's media framework adds support for new per-track or global audio effects,
+including bass boost, headphone virtualization, equalization, and reverb.</p>
+<ul>
+<li>New {@link android.media.audiofx android.media.audiofx} package provides the
+API to access audio effects.</li>
+<li>New {@link android.media.audiofx.AudioEffect AudioEffect} is the base class
+for controlling audio effects provided by the Android audio framework.
+<li>New audio session ID that lets an application associate a set of audio
+effects with an instance of {@link android.media.AudioTrack} or {@link
+android.media.MediaPlayer}.</li>
+<li>New {@link android.media.AudioTrack#AudioTrack(int, int, int, int, int, int,
+int) AudioTrack} class constructor that lets you create an {@link
+android.media.AudioTrack} with a specific session ID. New {@link
+android.media.AudioTrack#attachAuxEffect(int) attachAuxEffect()}, {@link
+android.media.AudioTrack#getAudioSessionId() getAudioSessionId()}, and {@link
+android.media.AudioTrack#setAuxEffectSendLevel(float) setAuxEffectSendLevel()}
+methods.</li>
+<li>New {@link android.media.MediaPlayer#attachAuxEffect(int)
+attachAuxEffect()}, {@link android.media.MediaPlayer#getAudioSessionId()
+getAudioSessionId()}, {@link android.media.MediaPlayer#setAudioSessionId(int)
+setAudioSessionId(int)}, and {@link
+android.media.MediaPlayer#setAuxEffectSendLevel(float) setAuxEffectSendLevel()}
+methods and supporting types.</li>
+</ul>
+
+<p class="note">To look at sample code for audio effects, see
+<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.html">AudioFxDemo.java</a>
+in the ApiDemos sample application.</p>
+
+<p>The media framework also adds:</p>
+<ul>
+<li>New support for altitude tag in EXIF metadata for JPEG files. New method
+{@link android.media.ExifInterface#getAltitude(double) getAltitude()} method to
+retrieve the value of the EXIF altitude tag.</li>
+<li>New {@link android.media.MediaRecorder#setOrientationHint(int)
+setOrientationHint()} method lets an application tell {@link
+android.media.MediaRecorder} of the orientation during video capture.</li>
+</ul>
+
+<h3 id="download">Download manager</h3>
+
+<p>The platform includes a new {@link android.app.DownloadManager} system service
+that handles long-running HTTP downloads. Applications can request that a URI be
+downloaded to a particular destination file. The <code>DownloadManager</code>
+will conduct the download in the background, taking care of HTTP interactions
+and retrying downloads after failures or across connectivity changes and system
+reboots. </p>
+<ul>
+<li>Applications can obtain an instance of the {@link android.app.DownloadManager}
+class by calling {@link
+android.content.Context#getSystemService(String)} and passing
+{@link android.content.Context#DOWNLOAD_SERVICE}. Applications that request
+downloads through this API should register a broadcast receiver for {@link
+android.app.DownloadManager#ACTION_NOTIFICATION_CLICKED}, to appropriately
+handle when the user clicks on a running download in a notification or from the
+Downloads UI.</li>
+<li>The {@link android.app.DownloadManager.Request} class lets an
+application provide all the information necessary to request a new download,
+such as request URI and download destination. A request URI is the only required
+parameter. Note that the default download destination is a shared volume where
+the system can delete your file if it needs to reclaim space for system use. For
+persistent storage of a download, specify a download destination on external
+storage (see {@link
+android.app.DownloadManager.Request#setDestinationUri(Uri)}).</li>
+<li>The {@link android.app.DownloadManager.Query} class provides methods that let
+an application query for and filter active downloads.</li>
+</ul>
+
+<h3 id="strictmode">StrictMode</h3>
+
+<p>To help developers monitor and improve the performance of their applications,
+the platform offers a new system facility called {@link android.os.StrictMode}.
+When implemented in an application, StrictMode catches and notifies the
+developer of accidental disk or network activity that could degrade application
+performance, such as activity taking place on the application's main thread
+(where UI operations are received and animations are also taking place).
+Developers can evaluate the network and disk usages issues raised in StrictMode
+and correct them if needed, keeping the main thread more responsive and
+preventing ANR dialogs from being shown to users.
+
+<ul>
+<li>{@link android.os.StrictMode} is the core class and is the main integration
+point with the system and VM. The class provides convenience methods for
+managing the thread and VM policies that apply to the instance.</li>
+<li>{@link android.os.StrictMode.ThreadPolicy} and {@link
+android.os.StrictMode.VmPolicy} hold the policies that you define and apply to
+thread and VM instances.</li>
+</ul>
+
+<p>For more information about how to use StrictMode to optimize your
+application, see the class documentation and sample code at {@link
+android.os.StrictMode android.os.StrictMode}.</p>
+
+<h3 id="ui">UI Framework</h3>
+
+<ul>
+<li>Support for overscroll
+<ul>
+<li>New support for overscroll in Views and Widgets. In Views, applications can
+enable/disable overscroll for a given view, set the overscoll mode, control the
+overscroll distance, and handle the results of overscrolling. </li>
+<li>In Widgets, applications can control overscroll characteristics such as
+animation, springback, and overscroll distance. For more information, see {@link
+android.view.View android.view.View} and {@link android.widget.OverScroller
+android.widget.OverScroller}. </li>
+<li>{@link android.view.ViewConfiguration} also provides methods {@link
+android.view.ViewConfiguration#getScaledOverflingDistance()} and {@link
+android.view.ViewConfiguration#getScaledOverscrollDistance()}.</li>
+<li>New <code>overScrollMode</code>, <code>overScrollFooter</code>, and
+<code>overScrollHeader</code> attributes for <code><ListView></code> elements,
+for controlling overscroll behavior.</li>
+</ul>
+</li>
+
+<li>Support for touch filtering
+<ul>
+<li>New support for touch filtering, which lets an application improve the
+security of Views that provide access to sensitive functionality. For example,
+touch filtering is appropriate to ensure the security of user actions such as
+granting a permission request, making a purchase, or clicking on an
+advertisement. For details, see the <a
+href="{@docRoot}reference/android/view/View.html#Security">View class
+documentation</a>.</li>
+<li>New <code>filterTouchesWhenObscured</code> attribute for view elements,
+which declares whether to filter touches when the view's window is obscured by
+another visible window. When set to <code>"true"</code>, the view will not
+receive touches whenever a toast, dialog or other window appears above the
+view's window. Refer to <a
+href="{@docRoot}reference/android/view/View.html#Security">View security
+documentation</a> for details.</li>
+</ul>
+
+<p class="note">To look at sample code for touch filtering, see
+<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/SecureView.html">SecureView.java</a>
+in the ApiDemos sample application.</p>
+</li>
+
+<li>Improved event management
+<ul>
+<li>New base class for input events, {@link android.view.InputEvent}. The class
+provides methods that let applications determine the meaning of the event, such
+as by querying for the InputDevice from which the event orginated. The {@link
+android.view.KeyEvent} and {@link android.view.MotionEvent} are subclasses of
+{@link android.view.InputEvent}.</li>
+<li>New base class for input devices, {@link android.view.InputDevice}. The
+class stores information about the capabilities of a particular input device and
+provides methods that let applications determine how to interpret events from an
+input device.</li>
+</ul>
+</li>
+
+<li>Improved motion events
+<ul>
+<li>The {@link android.view.MotionEvent} API is extended to include "pointer ID"
+information, which lets applications to keep track of individual fingers as they
+move up and down. The class adds a variety of methods that let an application
+work efficiently with motion events.</li>
+<li>The input system now has logic to generate motion events with the new
+pointer ID information, synthesizing identifiers as new pointers are down. The
+system tracks multiple pointer IDs separately during a motion event, and
+ensures proper continuity of pointers by evaluating at the distance
+between the last and next set of pointers.</li>
+</ul>
+</li>
+
+<li>Text selection controls
+<ul>
+<li>A new <code>setComposingRegion</code> method lets an application mark a
+region of text as composing text, maintaining the current styling. A
+<code>getSelectedText</code> method returns the selected text to the
+application. The methods are available in {@link
+android.view.inputmethod.BaseInputConnection}, {@link
+android.view.inputmethod.InputConnection}, and {@link
+android.view.inputmethod.InputConnectionWrapper}.</li>
+<li>New <code>textSelectHandle</code>, <code>textSelectHandleLeft</code>,
+<code>textSelectHandleRight</code>, and <code>textSelectHandleWindowStyle</code>
+attributes for <code><TextView></code>, for referencing drawables that will be
+used to display text-selection anchors and the style for the containing
+window.</li>
+</ul>
+</li>
+
+<li>Activity controls
+<ul>
+<li>{@link android.content.pm.ActivityInfo} adds new constants for managing
+Activity orientation:
+{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_FULL_SENSOR},
+{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_REVERSE_LANDSCAPE},
+{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_REVERSE_PORTRAIT},
+{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_SENSOR_LANDSCAPE},
+and
+{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_SENSOR_PORTRAIT}.
+</li>
+<li>New constant {@link
+android.app.ActivityManager.RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE} for
+the {@link android.app.ActivityManager.RunningAppProcessInfo#importance} field
+in {@link android.app.ActivityManager.RunningAppProcessInfo}. The value
+indicates that a specific process is running something that is considered to be
+actively perceptible to the user. An example would be an application performing
+background music playback.</li>
+<li>The Activity.setPersistent(boolean) method to mark an
+Activity as persistent is now deprecated and the implementation is a no-op.</li>
+</ul>
+</li>
+
+<li>Notification text and icon styles
+<ul>
+<li>New {@link android.R.style#TextAppearance_StatusBar_EventContent
+TextAppearance.StatusBar.EventContent},
+{@link android.R.style#TextAppearance_StatusBar_EventContent_Title
+TextAppearance.StatusBar.EventContent.Title},
+{@link android.R.style#TextAppearance_StatusBar_Icon
+TextAppearance.StatusBar.Icon}, and
+{@link android.R.style#TextAppearance_StatusBar_Title
+TextAppearance.StatusBar.Title} for managing
+notification style.</li>
+</ul>
+</li>
+
+<li>WebView
+<ul>
+<li>New {@link
+android.webkit.WebSettings#setUseWebViewBackgroundForOverscrollBackground(
+boolean) setUseWebViewBackgroundForOverscrollBackground()} method lets a {@link
+android.webkit.WebView} specify whether to use its own background for the
+overscroll background. </li>
+</ul>
+</li>
+</ul>
+
+<h3 id="extralargescreens">Extra Large Screens</h3>
+
+<p>The platform now supports extra large screen sizes, such as those that might
+be found on tablet devices. Developers can indicate that their applications are
+designed to support extra large screen sizes by adding a <code><supports
+screens ... android:xlargeScreens="true"></code> element to their manifest
+files. Applications can use a new resource qualifier, <code>xlarge</code>, to
+tag resources that are specific to extra large screens. For
+details on how to support extra large and other screen sizes, see <a
+href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
+Screens</a>.</p>
+
+<h3 id="graphics">Graphics</h3>
+
+<ul>
+<li>Adds remaining OpenGL ES 2.0 methods {@link
+android.opengl.GLES20#glDrawElements(int, int, int, int) glDrawElements()} and
+{@link android.opengl.GLES20#glVertexAttribPointer(int, int, int, boolean, int,
+int) glVertexAttribPointer()} in the {@link android.opengl.GLES20
+android.opengl.GLES20} class.</li>
+<li>Adds support for {@link android.graphics.ImageFormat#YV12} pixel format, a
+planar 4:2:0 YCrCb format.</li>
+</ul>
+
+<h3 id="providers">Content Providers</h3>
+
+<ul>
+<li>New {@link android.provider.AlarmClock} provider class for setting an alarm
+or handling an alarm. The provider contains a <code>ACTION_SET_ALARM</code> Intent
+action and extras that can be used to start an Activity to set a new alarm in an
+alarm clock application. Applications that wish to receive the
+<code>SET_ALARM</code> Intent should create an activity that requires the
+the SET_ALARM permission. Applications that wish to create a new
+alarm should use {@link
+android.content.Context#startActivity(android.content.Intent)
+Context.startActivity()}, so that the user has the option of choosing
+which alarm clock application to use.</li>
+
+<li>{@link android.provider.MediaStore} supports a new Intent action, {@link
+android.provider.MediaStore#INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH
+PLAY_FROM_SEARCH}, that lets an application search for music media and
+automatically play content from the result when possible. For example, an
+application could fire this Intent as the result of a voice recognition command
+to listen to music.</li>
+<li>{@link android.provider.MediaStore} also adds a new {@link
+android.provider.MediaStore#MEDIA_IGNORE_FILENAME} flag that tells the media
+scanner to ignore media in the containing directory and its subdirectories.
+Developers can use this to avoid having graphics appear in the Gallery and
+likewise prevent application sounds and music from showing up in the Music
+app.</li>
+
+<li>The {@link android.provider.Settings} provider adds the new Activity actions
+{@link android.provider.Settings#ACTION_APPLICATION_DETAILS_SETTINGS
+APPLICATION_DETAILS_SETTINGS} and {@link
+android.provider.Settings#ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS
+MANAGE_ALL_APPLICATIONS_SETTINGS}, which let an application show the details
+screen for a specific application or show the Manage Applications screen. </li>
+
+<li>The {@link android.provider.ContactsContract} provider adds the {@link
+android.provider.ContactsContract.CommonDataKinds.SipAddress} data kind, for
+storing a contact's SIP (Internet telephony) address. </li>
+</ul>
+
+<h3 id="location">Location</h3>
+
+<ul>
+<li>The {@link android.location.LocationManager} now tracks application
+requests that result in wake locks or wifi locks according to
+{@link android.os.WorkSource}, a system-managed class that identifies the
+application.
+<p>The <code>LocationManager</code> keeps track
+of all clients requesting periodic updates, and tells its providers
+about them as a <code>WorkSource</code> parameter, when setting their minimum
+update times.
+The network location provider uses <code>WorkSource</code> to track the
+wake and wifi locks initiated by an application and adds it to the application's
+battery usage reported in Manage Applications. </p></li>
+<li>The {@link android.location.LocationManager} adds several new methods that
+let an Activity register to receive periodic or one-time location updates based
+on specified criteria (see below).</li>
+<li>A new {@link android.location.Criteria} class lets an application specify a
+set of criteria for selecting a location provider. For example, providers may be
+ordered according to accuracy, power usage, ability to report altitude, speed,
+and bearing, and monetary cost. </li>
+</ul>
+
+<h3 id="storage">Storage</h3>
+
+<ul>
+<li>Android 2.3 adds a new {@link android.os.storage.StorageManager} that
+supports OBB (Opaque Binary Blob) files. Although platform support for OBB is
+available in Android 2.3, development tools for creating and managing OBB files
+will not be availble until early 2011.</li>
+<li>The Android 2.3 platform adds official support for devices that do not
+include SD cards (although it provides virtual SD Card partition, when no
+physical SD card is available). A convenience method, {@link
+android.os.Environment#isExternalStorageRemovable()}, lets applications
+determine whether a physical SD card is present.</li>
+</ul>
+
+<h3 id="packagemanager">Package Manager</h3>
+
+<ul>
+<li>New constants for declaring hardware and software features. See the list in
+the <a href="#feature_constants">New Feature Constants</a> section, below.</li>
+<li>{@link android.content.pm.PackageInfo} adds new {@link
+android.content.pm.PackageInfo#firstInstallTime} and {@link
+android.content.pm.PackageInfo#lastUpdateTime} fields that store the time of the
+package installation and last update. </li>
+<li>New {@link
+android.content.pm.PackageManager#getProviderInfo(android.content.ComponentName,
+int) getProviderInfo()} method for retrieving all of the information known about
+a particular content provider class.</li>
+</ul>
+
+<h3 id="telephony">Telephony</h3>
+
+<ul>
+<li>The {@link android.telephony.TelephonyManager} adds the constant {@link
+android.telephony.TelephonyManager#NETWORK_TYPE_EVDO_B} for specifying the CDMA
+EVDO Rev B network type.</li>
+<li>New {@link android.telephony.gsm.GsmCellLocation#getPsc()} method returns
+the primary scrambling code of the serving cell on a UMTS network.</li>
+</ul>
+
+<h3 id="native">Native access to Activity lifecycle, windows</h3>
+
+<p>Android 2.3 exposes a broad set of APIs to applications that use native
+code. Framework classes of interest to such applications include: </p>
+
+<ul>
+<li>{@link android.app.NativeActivity} is a new type of Activity class, whose
+lifecycle callbacks are implemented directly in native code. A
+<code>NativeActivity</code> and its underlying native code run in the system
+just as do other Activities — specifically they run in the Android
+application's system process and execute on the application's main UI thread,
+and they receive the same lifecycle callbacks as do other Activities. </li>
+<li>New {@link android.view.InputQueue} class and callback interface lets native
+code manage event queueing. </li>
+<li>New {@link android.view.SurfaceHolder.Callback2} interface lets native code
+manage a {@link android.view.SurfaceHolder}. </li>
+<li>New {@link
+android.view.Window#takeInputQueue(android.view.InputQueue.Callback)
+takeInputQueue} and {@link
+android.view.Window#takeSurface(android.view.SurfaceHolder.Callback2)
+takeSurface()} methods in {@link android.view.Window} let native code manage
+events and surfaces.</li>
+</ul>
+
+<p>For full information on working with native code or to download the NDK,
+see the <a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK</a> page.</p>
+
+
+<h3 id="dalvik">Dalvik Runtime</h3>
+
+<ul>
+<li>{@link dalvik.system dalvik.system}
+removes several classes that were previously deprecated.</li>
+<li>Dalvik core libraries:
+<ul>
+ <li>New collections: {@link java.util.ArrayDeque}, {@link java.util.NavigableMap},
+ {@link java.util.concurrent.ConcurrentSkipListMap},
+ {@link java.util.concurrent.LinkedBlockingDeque}</li>
+ <li>New {@link java.util.Arrays} utilities: <code>binarySearch()</code>,
+ <code>copyOf()</code>, <code>copyOfRange()</code>, and others.</li>
+ <li>{@link java.net.CookieManager} for {@link java.net.HttpURLConnection}.</li>
+ <li>More complete network APIs: {@link java.net.InterfaceAddress},
+ {@link java.net.NetworkInterface} and {@link java.net.IDN}</li>
+ <li>{@link java.io.File} read and write controls</li>
+ <li>{@link java.lang.String#isEmpty() String.isEmpty()}</li>
+ <li>{@link java.text.Normalizer} and {@link java.text.Normalizer.Form}</li>
+ <li>Improved {@link javax.net.ssl} server sockets.</li>
+</ul>
+</li>
+</ul>
+
+<h3 id="manifest">New manifest elements and attributes</h3>
+
+<ul>
+<li>New <code>xlargeScreens</code> attribute for <a
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
+<supports-screens>}</a>
+element, to indicate whether the application supports
+extra large screen form-factors. For details, see <a
+href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
+Screens</a>.</li>
+<li>New values for <code>android:screenOrientation</code> attribute of
+<code><activity></code> element:
+<ul>
+<li><code>"reverseLandscape"</code> — The Activity would like to have the
+screen in landscape orientation, turned in the opposite direction from normal
+landscape.</li>
+<li><code>"reversePortrait"</code> — The Activity would like to have the
+screen in portrait orientation, turned in the opposite direction from normal
+portrait.</li>
+<li><code>"sensorLandscape"</code> — The Activity would like to have the
+screen in landscape orientation, but can use the sensor to change which
+direction the screen is facing.</li>
+<li><code>"sensorPortrait"</code> — The Activity would like to have the
+screen in portrait orientation, but can use the sensor to change which direction
+the screen is facing.</li>
+<li><code>"fullSensor"</code> — Orientation is determined by a physical
+orientation sensor: the display will rotate based on how the user moves the
+device. This allows any of the 4 possible rotations, regardless of what the
+device will normally do (for example some devices won't normally use 180 degree
+rotation).</li>
+</ul>
+</li>
+</ul>
+
+<h3 id="permissions">New Permissions</h3>
+
+<ul>
+<li><code>com.android.permission.SET_ALARM</code> — Allows an application
+to broadcast an Intent to set an alarm for the user. An Activity that handles
+the {@link android.provider.AlarmClock#ACTION_SET_ALARM SET_ALARM} Intent action
+should require this permission.</li>
+<li><code>android.permission.USE_SIP</code> — Allows an application to use
+the {@link android.net.sip SIP API} to make or receive internet calls.
+<li><code>android.permission.NFC</code> — Allows an application to use the
+{@link android.nfc NFC API} to read NFC tags.</li>
+</ul>
+
+<h3 id="feature_constants">New Feature Constants</h3>
+
+<p>The platform adds several new hardware features that developers can declare
+in their application manifests as being required by their applications. This
+lets developers control how their application is filtered, when published on
+Google Play. </p>
+
+<ul>
+<li>{@link android.content.pm.PackageManager#FEATURE_AUDIO_LOW_LATENCY
+android.hardware.audio.low_latency} — The application uses a low-latency
+audio pipeline on the device and is sensitive to delays or lag in sound input or
+output.</li>
+<li>{@link android.content.pm.PackageManager#FEATURE_CAMERA_FRONT
+android.hardware.camera.front} — The application uses a front-facing
+camera on the device.</li>
+<li>{@link android.content.pm.PackageManager#FEATURE_NFC android.hardware.nfc}
+— The application uses NFC radio features in the device.</li>
+<li>{@link android.content.pm.PackageManager#FEATURE_SENSOR_BAROMETER
+android.hardware.sensor.barometer} — The application uses the device's
+barometer.</li>
+<li>{@link android.content.pm.PackageManager#FEATURE_SENSOR_GYROSCOPE
+android.hardware.sensor.gyroscope} — The application uses the device's
+gyroscope sensor.</li>
+<li>{@link android.content.pm.PackageManager#FEATURE_SIP android.software.sip}
+— The application uses the SIP API on the device.</li>
+<li>{@link android.content.pm.PackageManager#FEATURE_SIP_VOIP
+android.software.sip.voip} — The application uses a SIP-based VoIP
+service on the device.</li>
+<li>{@link
+android.content.pm.PackageManager#FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND
+android.hardware.touchscreen.multitouch.jazzhand} — The application uses
+advanced multipoint multitouch capabilities on the device screen, for tracking
+five or more points fully independently.</li>
+</ul>
+
+<p>For full information about how to declare features and use them for
+filtering, see the documentation for <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></code></a>.</p>
+
+<h3 id="api-diff">API differences report</h3>
+
+<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
+Level {@sdkPlatformApiLevel}), see the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report</a>.</p>
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
+the framework API. The Android {@sdkPlatformVersion} API
+is assigned an integer identifier —
+<strong>{@sdkPlatformApiLevel}</strong> — that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
+you need compile the application against the Android library that is provided in
+the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
+also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
+attribute to the <code><uses-sdk></code> element in the application's
+manifest. If your application is designed to run only on Android 2.3 and higher,
+declaring the attribute prevents the application from being installed on earlier
+versions of the platform.</p>
+
+<p>For more information, read <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">What is API
+Level?</a></p>
\ No newline at end of file
diff --git a/docs/html/about/versions/android-3.0-highlights.jd b/docs/html/about/versions/android-3.0-highlights.jd
new file mode 100644
index 0000000..21dbda6
--- /dev/null
+++ b/docs/html/about/versions/android-3.0-highlights.jd
@@ -0,0 +1,261 @@
+page.title=Honeycomb
+
+@jd:body
+
+
+<style type="text/css">
+#jd-content {
+ max-width:1200px;
+}
+#jd-content div.screenshot {
+ float:left;
+ clear:left;
+ padding:15px 30px 15px 0;
+}
+#jd-content div.video {
+ float:right;
+ padding:0 60px 40px;
+}
+#jd-content table.columns {
+ margin:0 0 1em 0;
+}
+#jd-content table.columns td {
+ padding:0;
+}
+#jd-content table.columns td+td {
+ padding:0 2em;
+}
+#jd-content table.columns td img {
+ margin:0;
+}
+#jd-content table.columns td+td>*:first-child {
+ margin-top:-2em;
+}
+.green {
+ color:#8db529;
+ font-weight:bold;
+}
+</style>
+
+
+<p>Welcome to Android 3.0!</p>
+
+<p>The Android 3.0 platform introduces many new and exciting features for users and developers.
+This document provides a glimpse of some of the new features and technologies, as delivered in
+Android 3.0. For a more detailed look at new developer APIs, see the <a
+href="{@docRoot}about/versions/android-3.0.html">Android 3.0 Platform</a> document.</p>
+
+<ul>
+ <li><a href="#UserFeatures">New User Features</a></li>
+ <li><a href="#DeveloperApis">New Developer Features</a></li>
+</ul>
+
+<h2 id="UserFeatures" style="clear:right">New User Features</h2>
+
+<div style="padding-top:0em;">
+<div style="float:right;margin-left:20px;"><a
+href="{@docRoot}sdk/images/3.0/home_hero1_full.png" target="_android"><img
+src="{@docRoot}sdk/images/3.0/home_hero1.png" alt="" height="280" /></a></div>
+
+<h3>New UI designed from the ground up for tablets</h3>
+
+<p>Android 3.0 is a new version of the Android platform that is specifically optimized for devices with larger screen sizes, particularly tablets. It introduces a brand new, truly virtual and “holographic” UI design, as well as an elegant, content-focused interaction model.</p>
+
+<p>Android 3.0 builds on the things people love most about Android — refined multitasking, rich notifications, Home screen customization, widgets, and more — and transforms them with a vibrant, 3D experience and deeper interactivity, making them familiar but even better than before.</p>
+
+<p>The new UI brings fresh paradigms for interaction, navigation, and customization and makes them available to all applications — even those built for earlier versions of the platform. Applications written for Android 3.0 are able to use an extended set of UI objects, powerful graphics, and media capabilities to engage users in new ways.</p>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>System Bar, for global status and notifications</strong></p>
+
+<p>Across the system and in all applications, users have quick access to notifications, system status, and soft navigation buttons in a System Bar, available at the bottom of the screen. The System Bar is always present and is a key touchpoint for users, but in a new "lights out mode" can also be dimmed for full-screen viewing, such as for videos.</p>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Action Bar, for application control</strong></p>
+
+<p>In every application, users have access to contextual options, navigation, widgets, or other types of content in an Action Bar, displayed at the top of the screen. The Action Bar is always present when an application is in use, although its content, theme, and other properties are managed by the application rather than the system. The Action Bar is another key touchpoint for users, especially with action items and an overflow dropdown menu, which users frequently access in a similar manner in most applications. </p>
+
+</div>
+
+<div style="padding-top:0em;">
+<div style="float:right;margin-left:20px;"><a
+href="{@docRoot}sdk/images/3.0/homescreen_cust_port_full.png" target="_android"><img
+src="{@docRoot}sdk/images/3.0/homescreen_cust_port.png" alt="" height="280" /></a></div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Customizable Home screens</strong></p>
+
+<p>Five customizable Home screens give users instant access to all parts of the system from any context. Each screen offers a large grid that maintains spatial arrangement in all orientations. Users can select and manipulate Home screen widgets, app shortcuts, and wallpapers using a dedicated visual layout mode. Visual cues and drop shadows improve visibility when adjusting the layout of shortcuts and widgets. Each Home screen also offers a familiar launcher for access to all installed applications, as well as a Search box for universal search of apps, contacts, media files, web content, and more.</p>
+
+</div>
+
+<div style="padding-top:0em;">
+<div style="margin-right:1.5em;float:left;"><a href="{@docRoot}sdk/images/3.0/tasks_full.png"
+target="_android"><img src="{@docRoot}sdk/images/3.0/tasks.png" alt="" height="280" /></a>
+
+<!--<p style="font-size:90%">Figure</p> --></div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Recent Apps, for easy visual multitasking</strong></p>
+
+<p>Multitasking is a key strength of Android and it is central to the Android 3.0 experience. As users launch applications to handle various tasks, they can use the Recent Apps list in the System Bar to see the tasks underway and quickly jump from one application context to another. To help users rapidly identify the task associated with each app, the list shows a snapshot of its actual state when the user last viewed it.</p>
+
+</div>
+
+
+<h3>Redesigned keyboard</h3>
+
+<p>The Android soft keyboard is redesigned to make entering text fast and accurate on larger screen sizes. The keys are reshaped and repositioned for improved targeting, and new keys have been added, such as a Tab key, to provide richer and more efficient text input. Users can touch-hold keys to access menus of special characters and switch text/voice input modes from a button in the System Bar.</p>
+
+<div style="padding-top:1em;">
+<div style="margin-left:20px;float:right;"><a href="{@docRoot}sdk/images/3.0/copy_full.png"
+target="_android"><img src="{@docRoot}sdk/images/3.0/copy.png" alt="" height="180" /></a></div>
+
+
+<h3>Improved text selection, copy and paste</h3>
+
+<p>When entering or viewing text, a new UI lets users quickly select a word by press-hold and then adjust the selection area as needed by dragging a set of bounding arrows to new positions. Users can then select an action from the Action Bar, such as copy to the clipboard, share, paste, web search, or find. </p>
+
+
+<h3>New connectivity options</h3>
+
+<p>Android 3.0 includes new connectivity features that add versatility and convenience for users. Built-in support for Media/Picture Transfer Protocol lets users instantly sync media files with a USB-connected camera or desktop computer, without needing to mount a USB mass-storage device. Users can also connect full keyboards over either USB or Bluetooth, for a familiar text-input environment. For improved wi-fi connectivity, a new combo scan reduces scan times across bands and filters. New support for Bluetooth tethering means that more types of devices can share the network connection of an Android-powered device.</p>
+
+
+<h3>Updated set of standard apps</h3>
+
+<div style="padding-top:0em;">
+<div style="margin-left:20px;float:right;;padding-top:0em;"><a
+href="{@docRoot}sdk/images/3.0/browser_full.png" target="_android"><img
+src="{@docRoot}sdk/images/3.0/browser.png" alt="" height="200" /></a><br>
+<a href="{@docRoot}sdk/images/3.0/camera_full.png" target="_android"><img
+src="{@docRoot}sdk/images/3.0/camera.png" alt="" height="200" /></a></div>
+
+<p>The Android 3.0 platform includes an updated set of standard applications that are designed for use on larger screen devices. The sections below highlight some of the new features. </p>
+
+<strong>Browser</strong></p>
+
+<p>The browser includes new features that let users navigate and organize more efficiently. Multiple tabs replace browser windows and a new “incognito” mode allows anonymous browsing. Bookmarks and history are presented and managed in a single unified view. Users can now choose to automatically sign into Google sites on the browser with a supplied account and sync bookmarks with Google Chrome. New multitouch support is now available to JavaScript and plugins. Users can enjoy a better browsing experience at non-mobile sites through an improved zoom and viewport model, overflow scrolling, support for fixed positioning, and more.</p>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Camera and Gallery</strong></p>
+
+<p>The Camera application has been redesigned to take advantage of a larger screen for quick access to exposure, focus, flash, zoom, front-facing camera, and more. To let users capture scenes in new ways, it adds built-in support for time-lapse video recording. The Gallery application lets users view albums and other collections in full-screen mode, with easy access to thumbnails for other photos in the collection. </p>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Contacts</strong></p>
+
+<p>The Contacts app uses a new two-pane UI and Fast Scroll to let users easily organize and locate contacts. The application offers improved formatting of international phone numbers as user types, based on home country and an international number parsing library. Contact information is presented in a card-like UI, making it easier for users to read and edit contacts.</p>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Email</strong></p>
+
+<p>The Email application uses a new two-pane UI to make viewing and organizing messages more efficient. The app lets users select one or more messages, then select an action from the Action Bar, such as moving them to a folder. Users can sync attachments for later viewing and keep track of email using a home screen Widget.</p>
+
+</div>
+
+
+<h2 id="DeveloperApis" style="clear:both">New Developer Features</h2>
+
+<p>The Android 3.0 platform is designed specially to meet the unique needs of applications on devices with larger screen sizes. It offers all of the tools developers need to create incredible visual and interaction experiences on these devices.</p>
+
+ <ul>
+<li><a href="#ui">New UI framework for creating great tablet apps</a></li>
+<li><a href="#graphics">High-performance 2D and 3D graphics</a></li>
+<li><a href="#multicore">Support for multicore processor architectures</a></li>
+<li><a href="#multimedia">Rich multimedia and connectivity</a></li>
+<li><a href="#enterprise">Enhancements for enterprise</a></li>
+<li><a href="#compatibility">Compatibility with existing apps</a></li>
+</ul>
+
+<h3 id="ui">New UI Framework for creating great tablet apps</h3>
+
+<div style="padding-top:0em;">
+<div style="float:right;margin-left:20px;"><a
+href="{@docRoot}sdk/images/3.0/contacts_full.png" target="_android"><img
+src="{@docRoot}sdk/images/3.0/contacts.png" alt="" height="200" /></a></div>
+
+
+<p style="margin-top:.75em;margin-bottom:.75em;"><strong>Activity fragments, for greater control of content and design flexibility</strong></p>
+
+<p>Starting with Android 3.0, developers can break the Activities of their applications into subcomponents called Fragments, then combine them in a variety of ways to create a richer, more interactive experience. For example, an application can use a set of Fragments to create a true multipane UI, with the user being able to interact with each pane independently. Fragments can be added, removed, replaced, and animated inside an Activity dynamically, and they are modular and reusable across multiple Activities. Because they are modular, Fragments also offer an efficient way for developers to write applications that can run properly on both larger screen as well as smaller screen devices.</p>
+
+</div>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Redesigned UI widgets</strong></p>
+
+<p>Android 3.0 offers an updated set of UI widgets that developers can use to quickly add new types of content to their applications. The new UI widgets are redesigned for use on larger screens such as tablets and incorporate the new holographic UI theme. Several new widget types are available, including a 3D stack, search box, a date/time picker, number picker, calendar, popup menu, and others. Most of the redesigned UI widgets can now be used as remote views in application widgets displayed on the home screen. Applications written for earlier versions can inherit the new Widget designs and themes.</p>
+
+
+<div style="padding-top:0em;">
+<div style="margin-right:1.5em;float:left;margin-left:0em;"><a
+href="{@docRoot}sdk/images/3.0/widgets.png" target="_android"><img
+src="{@docRoot}sdk/images/3.0/widgets.png" alt="" height="200" target="_android" /></a></div>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Expanded Home screen widgets</strong></p>
+
+<p>Home screen widgets are popular with users because they offer fast access to application-specific data directly from the home screen. Android 3.0 lets developers take home screen widgets to the next level, offering more types of content and new modes of interaction with users. Developers can now use more standard UI widget types home screen widgets, including widgets that let users flip through collections of content as 3D stacks, grids, or lists. Users can interact with the home screen widgets in new ways, such as by using touch gestures to scroll and flip the content displayed in a widget. </p>
+
+</div>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Persistent Action Bar</strong></p>
+
+<p>The platform provides each application with its own instance of the Action Bar at the top of the screen, which the application can use to give the user quick access to contextual options, widgets, status, navigation, and more. The application can also customize the display theme of its Action Bar instance. The Action Bar lets developers expose more features of their applications to users in a familiar location, while also unifying the experience of using an application that spans multiple Activities or states.</p>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Richer notifications</strong></p>
+
+<p>Notifications are a key part of the Android user experience because they let applications show key updates and status information to users in real time. Android 3.0 extends this capability, letting developers include richer content and control more properties. A new builder class lets developers quickly create notifications that include large and small icons, a title, a priority flag, and any properties already available in previous versions. Notifications can offer more types of content by building on the expanded set of UI Widgets that are now available as remote Views.</p>
+
+<div style="padding-top:0em;">
+<div style="float:right;margin-left:20px;"><a
+href="{@docRoot}sdk/images/3.0/mail_drag_full.png" target="_android"><img
+src="{@docRoot}sdk/images/3.0/mail_drag.png" alt="" height="200"
+style="padding-top:1em;"/></a></div>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Multiselect, clipboard, and drag-and-drop</strong></p>
+
+<p>The platform offers convenient new interaction modes that developers can use. For managing collections of items in lists or grids, developers can offer a new multiselect mode that lets users choose multiple items for an action. Developers can also use a new system-wide Clipboard to let users easily copy any type of data into and out of their applications. To make it easier for users to manage and organize files, developers can now add drag-and-drop interaction through a DragEvent framework.</p>
+
+</div>
+
+
+<h3 id="graphics">High-performance 2D and 3D graphics</h3>
+
+<p style="margin-top:.75em;margin-bottom:.75em;"><strong>New animation framework</strong></p>
+
+<p>The platform includes a flexible new animation framework that lets developers easily animate the properties of UI elements such as Views, Widgets, Fragments, Drawables, or any arbitrary object. Animations can create fades or movement between states, loop an animated image or an existing animation, change colors, and much more. Adding animation to UI elements can add visual interest to an application and refine the user experience, to keep users engaged.</p>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Hardware-accelerated 2D graphics</strong></p>
+
+<p>Android 3.0 offers a new hardware-accelerated OpenGL renderer that gives a performance boost to many common graphics operations for applications running in the Android framework. When the renderer is enabled, most operations in Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera are accelerated. Developers can control how hardware-acceleration is applied at every level, from enabling it globally in an application to enabling it in specific Activities and Views inside the application.</p>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Renderscript 3D graphics engine</strong></p>
+
+<p>Renderscript is a runtime 3D framework that provides both an API for building 3D scenes as well as a special, platform-independent shader language for maximum performance. Using Renderscript, you can accelerate graphics operations and data processing. Renderscript is an ideal way to create high-performance 3D effects for applications, wallpapers, carousels, and more.</p>
+
+
+<h3 id="multicore">Support for multicore processor architectures</h3>
+
+<p>Android 3.0 is the first version of the platform designed to run on either single or multicore processor architectures. A variety of changes in the Dalvik VM, Bionic library, and elsewhere add support for symmetric multiprocessing in multicore environments. These optimizations can benefit all applications, even those that are single-threaded. For example, with two active cores, a single-threaded application might still see a performance boost if the Dalvik garbage collector runs on the second core. The system will arrange for this automatically.</p>
+
+
+<h3 id="multimedia">Rich multimedia and connectivity</h3>
+
+<p style="margin-top:.75em;margin-bottom:.75em;"><strong>HTTP Live streaming</strong></p>
+
+<p>Applications can now pass an M3U playlist URL to the media framework to begin an HTTP Live streaming session. The media framework supports most of the HTTP Live streaming specification, including adaptive bit rate.</p>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Pluggable DRM framework</strong></p>
+
+<p>Android 3.0 includes an extensible DRM framework that lets applications manage protected content according to a variety of DRM mechanisms that may be available on the device. For application developers, the framework API offers an consistent, unified API that simplifies the management of protected content, regardless of the underlying DRM engines. </p>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Digital media file transfer</strong></p>
+
+<p>The platform includes built-in support for Media/Picture Transfer Protocol (MTP/PTP) over USB, which lets users easily transfer any type of media files between devices and to a host computer. Developers can build on this support, creating applications that let users create or manage media files that they may want to transfer or share across devices. </p>
+
+<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>More types of connectivity</strong></p>
+
+<p>The platform offers new connectivity that developers can build on. API support for Bluetooth A2DP and HSP profiles lets applications query Bluetooth profiles for connected devices, audio state, and more, then notify the user. For example, a music application can check connectivity and status and let the user know that music is playing through a stereo headset. Applications can also register to receive system broadcasts of pre-defined vendor-specific AT commands, such as Platronics Xevent. For example, an application could receive broadcasts that indicate a connected device's battery level and could notify the user or take other action as needed. Applications can also take advantage of the platform's new support for full keyboards connected by USB or Bluetooth. </p>
+
+
+<h3 id="enterprise">Enhancements for enterprise</h3>
+
+<p>In Android 3.0, developers of device administration applications can support new types of policies, including policies for encrypted storage, password expiration, password history, and password complex characters required. </p>
+
+<h3 id="compatibility">Compatibility with existing apps</h3>
+
+<p>Android 3.0 brings a new UI designed for tablets and other larger screen devices, but it also is fully compatible with applications developed for earlier versions of the platform, or for smaller screen sizes. Existing applications can seamlessly participate in the new holographic UI theme without code changes, by adding a single attribute in their manifest files. The platform emulates the Menu key, which is replaced by the overflow menu in the Action Bar in the new UI. Developers wanting to take fuller advantage of larger screen sizes can also create dedicated layouts and assets for larger screens and add them to their existing applications.</p>
+
diff --git a/docs/html/about/versions/android-3.0.jd b/docs/html/about/versions/android-3.0.jd
new file mode 100644
index 0000000..76e0795
--- /dev/null
+++ b/docs/html/about/versions/android-3.0.jd
@@ -0,0 +1,976 @@
+page.title=Android 3.0 Platform
+sdk.platform.version=3.0
+sdk.platform.apiLevel=11
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#api">API Overview</a></li>
+ <li><a href="#api-level">API Level</a></li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/11/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+</div>
+</div>
+
+
+<p><em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a downloadable
+component for the Android SDK. The downloadable platform includes an Android library and system
+image, as well as a set of emulator skins and more. The downloadable platform includes no external
+libraries.</p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes
+an Android library and system image, as well as a set of emulator skins and
+more. To get started developing or testing against Android {@sdkPlatformVersion},
+use the Android SDK Manager to download the platform into your SDK.</p>
+
+
+
+
+
+
+<h2 id="#api">API Overview</h2>
+
+<p>The sections below provide a technical overview of what's new for developers in Android 3.0,
+including new features and changes in the framework API since the previous version.</p>
+
+
+
+
+
+<h3>Fragments</h3>
+
+<p>A fragment is a new framework component that allows you to separate distinct elements of an
+activity into self-contained modules that define their own UI and lifecycle. To create a
+fragment, you must extend the {@link android.app.Fragment} class and implement several lifecycle
+callback methods, similar to an {@link android.app.Activity}. You can then combine multiple
+fragments in a single activity to build a multi-pane UI in which each
+pane manages its own lifecycle and user inputs.</p>
+
+<p>You can also use a fragment without providing a UI and instead use the fragment as a worker
+for the activity, such as to manage the progress of a download that occurs only while the
+activity is running.</p>
+
+<p>Additionally:</p>
+
+<ul>
+ <li>Fragments are self-contained and you can reuse them in multiple activities</li>
+ <li>You can add, remove, replace and animate fragments inside the activity</li>
+ <li>You can add fragments to a back stack managed by the activity, preserving the state of
+fragments as they are changed and allowing the user to navigate backward through the different
+states</li>
+ <li>By <a
+href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">providing
+alternative layouts</a>, you can mix and match fragments, based
+on the screen size and orientation</li>
+ <li>Fragments have direct access to their container activity and can contribute items to the
+activity's Action Bar (discussed next)</li>
+</ul>
+
+<p>To manage the fragments in your activity, you must use the {@link
+android.app.FragmentManager}, which provides several APIs for interacting with fragments, such
+as finding fragments in the activity and popping fragments off the back stack to restore their
+previous state.</p>
+
+<p>To perform a transaction, such as add or remove a fragment, you must create a {@link
+android.app.FragmentTransaction}. You can then call methods such as {@link
+android.app.FragmentTransaction#add add()} {@link android.app.FragmentTransaction#remove
+remove()}, or {@link android.app.FragmentTransaction#replace replace()}. Once you've applied all
+the changes you want to perform for the transaction, you must call {@link
+android.app.FragmentTransaction#commit commit()} and the system applies the fragment transaction to
+the activity.</p>
+
+<p>For more information about using fragments, read the <a
+href="{@docRoot}guide/components/fragments.html">Fragments</a> documentation. Several
+samples are also available in the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#Fragment">
+API Demos</a> application.</p>
+
+
+
+
+<h3>Action Bar</h3>
+
+<p>The Action Bar is a replacement for the traditional title bar at the top of the activity window.
+It includes the application logo in the left corner and provides a new interface for items in the
+<a href="{@docRoot}guide/topics/ui/menus.html#options-menu">Options Menu</a>. Additionally, the
+Action Bar allows you to:</p>
+
+<ul>
+ <li>Add menu items directly in the Action Bar—as "action items."
+ <p>In your XML declaration for the menu item, include the {@code
+android:showAsAction} attribute with a value of {@code "ifRoom"}. When there's enough room, the menu
+item appears directly in the Action Bar. Otherwise, the item is placed in the
+overflow menu, revealed by the menu icon on the right side of the Action Bar.</p></li>
+
+ <li>Replace an action item with a widget (such as a search box)—creating an
+"action view."
+ <p>In the XML declaration for the menu item, add the {@code android:actionViewLayout} attribute
+with a layout resource or the {@code android:actionViewClass} attribute with the class name of a
+widget. (You must also declare the {@code android:showAsAction} attribute so that the item appears
+in the Action Bar.) If there's not enough room in the Action Bar and the item appears in the
+overflow menu, it behaves like a regular menu item and does not show the widget.</p></li>
+
+ <li>Add an action to the application logo and replace it with a custom logo
+ <p>The application logo is automatically assigned the {@code android.R.id.home} ID,
+which the system delivers to your activity's {@link android.app.Activity#onOptionsItemSelected
+onOptionsItemSelected()} callback when touched. Simply respond to this ID in your callback
+method to perform an action such as go to your application's "home" activity.</p>
+ <p>To replace the icon with a logo, specify your application logo in the manifest file with the
+<a href="{@docRoot}guide/topics/manifest/application-element.html#logo">{@code android:logo}</a>
+attribute, then call {@link android.app.ActionBar#setDisplayUseLogoEnabled
+setDisplayUseLogoEnabled(true)} in your activity.</p></li>
+
+ <li>Add breadcrumbs to navigate backward through the back stack of fragments</li>
+ <li>Add tabs or a drop-down list to navigate through fragments</li>
+ <li>Customize the Action Bar with themes and backgrounds</li>
+</ul>
+
+<p>The Action Bar is standard for all applications that use the new holographic theme, which is
+also standard when you set either the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+android:minSdkVersion}</a> or <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+android:targetSdkVersion}</a> to {@code "11"}.</p>
+
+<p>For more information about the Action Bar, read the <a
+href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> documentation. Several
+samples are also available in the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#ActionBar">
+API Demos</a> application.</p>
+
+
+
+
+<h3>System clipboard</h3>
+
+<p>Applications can now copy and paste data (beyond mere text) to and from the system-wide
+clipboard. Clipped data can be plain text, a URI, or an intent.</p>
+
+<p>By providing the system access to the data you want the user to copy, through a content provider,
+the user can copy complex content (such as an image or data structure) from your application and
+paste it into another application that supports that type of content.</p>
+
+<p>To start using the clipboard, get the global {@link android.content.ClipboardManager} object
+by calling {@link android.content.Context#getSystemService getSystemService(CLIPBOARD_SERVICE)}.</p>
+
+<p>To copy an item to the clipboard, you need to create a new {@link
+android.content.ClipData} object, which holds one or more {@link android.content.ClipData.Item}
+objects, each describing a single entity. To create a {@link android.content.ClipData} object
+containing just one {@link android.content.ClipData.Item}, you can use one of the helper methods,
+such as {@link android.content.ClipData#newPlainText newPlainText()}, {@link
+android.content.ClipData#newUri newUri()}, and {@link android.content.ClipData#newIntent
+newIntent()}, which each return a {@link android.content.ClipData} object pre-loaded with the
+{@link android.content.ClipData.Item} you provide.</p>
+
+<p>To add the {@link android.content.ClipData} to the clipboard, pass it to {@link
+android.content.ClipboardManager#setPrimaryClip setPrimaryClip()} for your instance of {@link
+android.content.ClipboardManager}.</p>
+
+<p>You can then read a file from the clipboard (in order to paste it) by calling {@link
+android.content.ClipboardManager#getPrimaryClip()} on the {@link
+android.content.ClipboardManager}. Handling the {@link android.content.ClipData} you receive can
+be complicated and you need to be sure you can actually handle the data type in the clipboard
+before attempting to paste it.</p>
+
+<p>The clipboard holds only one piece of clipped data (a {@link android.content.ClipData}
+object) at a time, but one {@link android.content.ClipData} can contain multiple {@link
+android.content.ClipData.Item}s.</p>
+
+<p>For more information, read the <a href="{@docRoot}guide/topics/text/copy-paste.html">Copy
+and Paste</a> documentation. You can also see a simple implementation of copy and paste in the API Demos
+sample and a more complete implementation in the Note Pad sample.</p>
+
+
+
+
+<h3>Drag and drop</h3>
+
+<p>New APIs simplify drag and drop operations in your application's user interface. A drag
+operation is the transfer of some kind of data—carried in a {@link android.content.ClipData}
+object—from one place to another. The start and end point for the drag operation is a {@link
+android.view.View}, so the APIs that directly handle the drag and drop operations are
+in the {@link android.view.View} class.</p>
+
+<p>A drag and drop operation has a lifecycle that's defined by several drag actions—each
+defined by a {@link android.view.DragEvent} object—such as {@link
+android.view.DragEvent#ACTION_DRAG_STARTED}, {@link android.view.DragEvent#ACTION_DRAG_ENTERED}, and
+{@link android.view.DragEvent#ACTION_DROP}. Each view that wants to participate in a drag
+operation can listen for these actions.</p>
+
+<p>To begin dragging content in your activity, call {@link android.view.View#startDrag startDrag()}
+on a {@link android.view.View}, providing a {@link android.content.ClipData} object that represents
+the data to drag, a {@link android.view.View.DragShadowBuilder} to facilitate the "shadow"
+that users see under their fingers while dragging, and an {@link java.lang.Object} that can share
+information about the drag object with views that may receive the object.</p>
+
+<p>To accept a drag object in a {@link android.view.View} (receive the "drop"), register the view
+with an {@link android.view.View.OnDragListener OnDragListener} by calling {@link
+android.view.View#setOnDragListener setOnDragListener()}. When a drag event occurs on the view, the
+system calls {@link android.view.View.OnDragListener#onDrag onDrag()} for the {@link
+android.view.View.OnDragListener OnDragListener}, which receives a {@link android.view.DragEvent}
+describing the type of drag action has occurred (such as {@link
+android.view.DragEvent#ACTION_DRAG_STARTED}, {@link android.view.DragEvent#ACTION_DRAG_ENTERED}, and
+{@link android.view.DragEvent#ACTION_DROP}). During a drag, the system repeatedly calls {@link
+android.view.View.OnDragListener#onDrag onDrag()} for the view underneath the drag, to deliver a
+stream of drag events. The receiving view can inquire the event type delivered to {@link
+android.view.View#onDragEvent onDragEvent()} by calling {@link android.view.DragEvent#getAction
+getAction()} on the {@link android.view.DragEvent}.</p>
+
+<p class="note"><strong>Note:</strong> Although a drag event may carry a {@link
+android.content.ClipData} object, this is not related to the system clipboard. A drag and drop
+operation should never put the dragged data in the system clipboard.</p>
+
+<p>For more information, read the <a href="{@docRoot}guide/topics/ui/drag-drop.html">Dragging and
+Dropping</a> documentation. You can also see an implementation of drag and drop in the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/DragAndDropDemo.html">
+API Demos</a> application and the <a
+href="{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a>
+application.</p>
+
+
+
+<h3>App widgets</h3>
+
+<p>Android 3.0 supports several new widget classes for more interactive app widgets on the users
+Home screen, including: {@link android.widget.GridView}, {@link android.widget.ListView}, {@link
+android.widget.StackView}, {@link android.widget.ViewFlipper}, and {@link
+android.widget.AdapterViewFlipper}.</p>
+
+<p>More importantly, you can use the new {@link android.widget.RemoteViewsService} to create app
+widgets with collections, using widgets such as {@link android.widget.GridView}, {@link
+android.widget.ListView}, and {@link android.widget.StackView} that are backed by remote data,
+such as from a content provider.</p>
+
+<p>The {@link android.appwidget.AppWidgetProviderInfo} class (defined in XML with an {@code
+<appwidget-provider>} element) also supports two new fields: {@link
+android.appwidget.AppWidgetProviderInfo#autoAdvanceViewId} and {@link
+android.appwidget.AppWidgetProviderInfo#previewImage}. The {@link
+android.appwidget.AppWidgetProviderInfo#autoAdvanceViewId} field lets you specify the view ID of the
+app widget subview that should be auto-advanced by the app widget’s host. The
+{@link android.appwidget.AppWidgetProviderInfo#previewImage} field specifies a preview of what the
+app widget looks like and is shown to the user from the widget picker. If this field is not
+supplied, the app widget's icon is used for the preview.</p>
+
+<p>To help create a preview image for your app widget (to specify in the {@link
+android.appwidget.AppWidgetProviderInfo#previewImage} field), the Android emulator includes an
+application called "Widget Preview." To create a preview image, launch this application, select the
+app widget for your application and set it up how you'd like your preview image to appear, then save
+it and place it in your application's drawable resources.</p>
+
+<p>You can see an implementation of the new app widget features in the <a
+href="{@docRoot}resources/samples/StackWidget/index.html">StackView App Widget</a> and <a
+href="{@docRoot}resources/samples/WeatherListWidget/index.html">Weather List Widget</a>
+applications.</p>
+
+
+
+<h3>Status bar notifications</h3>
+
+<p>The {@link android.app.Notification} APIs have been extended to support more content-rich status
+bar notifications, plus a new {@link android.app.Notification.Builder} class allows you to easily
+create {@link android.app.Notification} objects.</p>
+<p>New features include:</p>
+<ul>
+ <li>Support for a large icon in the notification, using {@link
+android.app.Notification.Builder#setLargeIcon setLargeIcon()}. This is usually for
+social applications to show the contact photo of the person who is the source of the
+notification or for media apps to show an album thumbnail.</li>
+ <li>Support for custom layouts in the status bar ticker, using {@link
+android.app.Notification.Builder#setTicker(CharSequence,RemoteViews) setTicker()}.</li>
+ <li>Support for custom notification layouts to include buttons with {@link
+android.app.PendingIntent}s, for more interactive notification widgets. For example, a
+notification can control music playback without starting an activity.</li>
+</ul>
+
+
+
+<h3>Content loaders</h3>
+
+<p>New framework APIs facilitate asynchronous loading of data using the {@link
+android.content.Loader} class. You can use it in combination with UI components such as views and
+fragments to dynamically load data from worker threads. The {@link
+android.content.CursorLoader} subclass is specially designed to help you do so for data backed by
+a {@link android.content.ContentProvider}.</p>
+
+<p>All you need to do is implement the {@link android.app.LoaderManager.LoaderCallbacks
+LoaderCallbacks} interface to receive callbacks when a new loader is requested or the data has
+changed, then call {@link android.app.LoaderManager#initLoader initLoader()} to initialize the
+loader for your activity or fragment.</p>
+
+<p>For more information, read the <a
+href="{@docRoot}guide/components/loaders.html">Loaders</a> documentation. You can also see
+example code using loaders in the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderCursor.html">LoaderCursor</a>
+and <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderThrottle.html">
+LoaderThrottle</a> samples.</p>
+
+
+
+<h3>Bluetooth A2DP and headset APIs</h3>
+
+<p>Android now includes APIs for applications to verify the state of connected Bluetooth A2DP and
+headset profile devices. For example, applications can identify when a Bluetooth headset is
+connected for listening to music and notify the user as appropriate. Applications can also receive
+broadcasts for vendor specific AT commands and notify the user about the state of the connected
+device, such as when the connected device's battery is low.</p>
+
+<p>You can initialize the respective {@link android.bluetooth.BluetoothProfile} by calling {@link
+android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()} with either the {@link
+android.bluetooth.BluetoothProfile#A2DP} or {@link android.bluetooth.BluetoothProfile#HEADSET}
+profile constant and a {@link android.bluetooth.BluetoothProfile.ServiceListener} to receive
+callbacks when the Bluetooth client is connected or disconnected.</p>
+
+
+
+
+<h3 id="animation">Animation framework</h3>
+
+<p>An all new flexible animation framework allows you to animate arbitrary properties of any object
+(View, Drawable, Fragment, Object, or anything else). It allows you to define several aspects of an
+animation, such as:</p>
+<ul>
+ <li>Duration</li>
+ <li>Repeat amount and behavior</li>
+ <li>Type of time interpolation</li>
+ <li>Animator sets to play animations together, sequentially, or after specified delays</li>
+ <li>Frame refresh delay</li>
+</ul>
+
+ <p>You can define these animation aspects, and others, for an object's int, float, and hexadecimal
+color values, by default. That is, when an object has a property field for one of these types, you
+can change its value over time to affect an animation. To animate any other type of value, you tell
+the system how to calculate the values for that given type, by implementing the {@link
+android.animation.TypeEvaluator} interface.</p>
+
+<p>There are two animators you can use to animate the values of a property: {@link
+android.animation.ValueAnimator} and {@link android.animation.ObjectAnimator}. The {@link
+android.animation.ValueAnimator} computes the animation values, but is not aware of the specific
+object or property that is animated as a result. It simply performs the calculations, and you must
+listen for the updates and process the data with your own logic. The {@link
+android.animation.ObjectAnimator} is a subclass of {@link android.animation.ValueAnimator} and
+allows you to set the object and property to animate, and it handles all animation work.
+That is, you give the {@link android.animation.ObjectAnimator} the object to animate, the
+property of the object to change over time, and a set of values to apply to the property over
+time, then start the animation.</p>
+
+<p>Additionally, the {@link android.animation.LayoutTransition} class enables automatic transition
+animations for changes you make to your activity layout. To enable transitions for part of the
+layout, create a {@link android.animation.LayoutTransition} object and set it on
+any {@link android.view.ViewGroup} by calling {@link
+android.view.ViewGroup#setLayoutTransition setLayoutTransition()}. This causes default
+animations to run whenever items are added to or removed from the group. To specify custom
+animations, call {@link android.animation.LayoutTransition#setAnimator setAnimator()} on the {@link
+android.animation.LayoutTransition} and provide a custom {@link android.animation.Animator},
+such as a {@link android.animation.ValueAnimator} or {@link android.animation.ObjectAnimator}
+discussed above.</p>
+
+<p>For more information, see the <a
+href="{@docRoot}guide/topics/graphics/prop-animation.html">Property Animation</a> documentation. You can
+also see several samples using the animation APIs in the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/animation/index.html">API
+Demos</a> application.</p>
+
+
+
+
+<h3>Extended UI framework</h3>
+
+<ul>
+
+ <li><b>Multiple-choice selection for ListView and GridView</b>
+
+<p>New {@link android.widget.AbsListView#CHOICE_MODE_MULTIPLE_MODAL} mode for {@link
+android.widget.AbsListView#setChoiceMode setChoiceMode()} allows users to select multiple items
+from a {@link android.widget.ListView} or {@link android.widget.GridView}. When used in
+conjunction with the Action Bar, users can select multiple items and then select the action to
+perform from a list of options in the Action Bar (which has transformed into a Multi-choice
+Action Mode).</p>
+
+<p>To enable multiple-choice selection, call {@link
+android.widget.AbsListView#setChoiceMode setChoiceMode(CHOICE_MODE_MULTIPLE_MODAL)} and register a
+{@link android.widget.AbsListView.MultiChoiceModeListener MultiChoiceModeListener} with {@link
+android.widget.AbsListView#setMultiChoiceModeListener setMultiChoiceModeListener()}.</p>
+
+<p>When the user performs a long-press on an item, the Action Bar switches to the Multi-choice
+Action Mode. The system notifies the {@link android.widget.AbsListView.MultiChoiceModeListener
+MultiChoiceModeListener} when items are selected by calling {@link
+android.widget.AbsListView.MultiChoiceModeListener#onItemCheckedStateChanged
+onItemCheckedStateChanged()}.</p>
+
+<p>For an example of multiple-choice selection, see the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/List15.html">List15.
+java</a>
+class in the API Demos sample application.</p>
+ </li>
+
+
+ <li><b>New APIs to transform views</b>
+
+ <p>New APIs allow you to easily apply 2D and 3D transformations to views in your activity
+layout. New transformations are made possible with a set of object properties that define the view's
+layout position, orientation, transparency and more.</p>
+ <p>New methods to set the view properties include: {@link android.view.View#setAlpha
+setAlpha()}, {@link
+android.view.View#setBottom setBottom()}, {@link android.view.View#setLeft setLeft()}, {@link
+android.view.View#setRight setRight()}, {@link android.view.View#setBottom setBottom()}, {@link
+android.view.View#setPivotX setPivotX()}, {@link android.view.View#setPivotY setPivotY()}, {@link
+android.view.View#setRotationX setRotationX()}, {@link android.view.View#setRotationY
+setRotationY()}, {@link android.view.View#setScaleX setScaleX()}, {@link android.view.View#setScaleY
+setScaleY()}, {@link android.view.View#setAlpha setAlpha()}, and others.</p>
+
+ <p>Some methods also have a corresponding XML attribute that you can specify in your layout
+file, to apply a default transformation. Available attributes include: {@code translationX}, {@code
+translationY}, {@code rotation},
+{@code rotationX}, {@code rotationY}, {@code scaleX}, {@code scaleY}, {@code transformPivotX},
+{@code transformPivotY}, and {@code alpha}.</p>
+
+ <p>Using some of these new view properties in combination with the new <a
+href="#animation">animation framework</a> (discussed
+above), you can easily apply some fancy animations to your views. For example, to rotate a
+view on its y-axis, supply {@link android.animation.ObjectAnimator} with the {@link
+android.view.View}, the "rotationY" property, and the start and end values:</p>
+<pre>
+ObjectAnimator animator = ObjectAnimator.ofFloat(myView, "rotationY", 0, 360);
+animator.setDuration(2000);
+animator.start();
+</pre>
+ </li>
+
+
+ <li><b>New holographic themes</b>
+
+ <p>The standard system widgets and overall look have been redesigned and incorporate a new
+"holographic" user interface theme. The system applies the new theme
+using the standard <a href="{@docRoot}guide/topics/ui/themes.html">style and theme</a> system.</p>
+
+<p>Any application that targets the Android 3.0 platform—by setting either the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code android:minSdkVersion}</a>
+or <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+android:targetSdkVersion}</a> value to {@code "11"}—inherits the holographic theme by default.
+However, if your application also applies its own theme, then your theme will override the
+holographic theme, unless you update your styles to inherit the holographic theme.</p>
+
+<p>To apply the holographic theme to individual activities or to inherit them in your own theme
+definitions, use one of several new {@link android.R.style#Theme_Holo Theme.Holo}
+themes. If your application is compatible with version of Android lower than 3.0 and applies
+custom themes, then you should <a
+href="{@docRoot}guide/topics/ui/themes.html#SelectATheme">select a theme based on platform
+version</a>.</p>
+
+ </li>
+
+
+ <li><b>New widgets</b>
+
+ <ul>
+ <li>{@link android.widget.AdapterViewAnimator}
+ <p>Base class for an {@link android.widget.AdapterView} that performs animations when switching
+ between its views.</p></li>
+
+ <li>{@link android.widget.AdapterViewFlipper}
+ <p>Simple {@link android.widget.ViewAnimator} that animates between two or more views that have
+ been added to it. Only one child is shown at a time. If requested, it can automatically flip
+ between
+ each child at a regular interval.</p></li>
+
+ <li>{@link android.widget.CalendarView}
+ <p>Allows users to select dates from a calendar by touching the date and can scroll or fling the
+calendar to a desired date. You can configure the range of dates available in the widget.</p></li>
+
+ <li>{@link android.widget.ListPopupWindow}
+ <p>Anchors itself to a host view and displays a list of choices, such as for a list of
+ suggestions when typing into an {@link android.widget.EditText} view.</p></li>
+
+ <li>{@link android.widget.NumberPicker}
+ <p>Enables the user to select a number from a predefined range. The widget presents an input
+field and up and down buttons for selecting a number. Touching the input field allows the user to
+scroll through values or touch again to directly edit the current value. It also allows you to map
+positions to strings, so that the corresponding string is displayed instead of the index
+position.</p></li>
+
+ <li>{@link android.widget.PopupMenu}
+ <p>Displays a {@link android.view.Menu} in a modal popup window that's anchored to a view. The
+popup appears below the anchor view if there is room, or above it if there is not. If the IME (soft
+keyboard) is visible, the popup does not overlap the IME it until the user touches the
+menu.</p></li>
+
+ <li>{@link android.widget.SearchView}
+ <p>Provides a search box that you can configure to deliver search queries to a specified
+activity and display search suggestions (in the same manner as the traditional search dialog). This
+widget is particularly useful for offering a search widget in the Action Bar. For more information,
+see <a href="{@docRoot}guide/topics/search/search-dialog.html">Creating a Search Interface.</p></li>
+
+ <li>{@link android.widget.StackView}
+ <p>A view that displays its children in a 3D stack and allows users to swipe through
+ views like a rolodex.</p></li>
+
+ </ul>
+ </li>
+
+</ul>
+
+
+
+<h3>Graphics</h3>
+
+<ul>
+ <li><b>Hardware accelerated 2D graphics</b>
+
+<p>You can now enable the OpenGL renderer for your application by setting {@code
+android:hardwareAccelerated="true"} in your manifest element's <a
+href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
+element or for individual <a
+href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a>
+elements.</p>
+
+<p>This flag helps applications by making them draw faster. This results in smoother animations,
+smoother scrolling, and overall better performance and response to user interaction.</p></li>
+
+
+ <li><b>View support for hardware and software layers</b>
+
+ <p>By default, a {@link android.view.View} has no layer specified. You can specify that the
+view be backed by either a hardware or software layer, specified by values {@link
+android.view.View#LAYER_TYPE_HARDWARE} and {@link android.view.View#LAYER_TYPE_SOFTWARE}, using
+{@link android.view.View#setLayerType setLayerType()} or the <a
+href="{@docRoot}reference/android/view/View.html#attr_android:layerType">{@code layerType}</a>
+attribute.</p>
+ <p>A hardware layer is backed by a hardware specific texture (generally Frame Buffer Objects or
+FBO on OpenGL hardware) and causes the view to be rendered using Android's hardware rendering
+pipeline, but only if hardware acceleration is turned on for the view hierarchy. When hardware
+acceleration is turned off, hardware layers behave exactly as software layers.</p>
+ <p>A software layer is backed by a bitmap and causes the view to be rendered using Android's
+software rendering pipeline, even if hardware acceleration is enabled. Software layers should be
+avoided when the affected view tree updates often. Every update will require to re-render the
+software layer, which can potentially be slow.</p>
+ <p>For more information, see the {@link android.view.View#LAYER_TYPE_HARDWARE} and {@link
+android.view.View#LAYER_TYPE_SOFTWARE} documentation.</p>
+ </li>
+
+
+ <li><b>Renderscript 3D graphics engine</b>
+
+<p>Renderscript is a runtime 3D framework that provides both an API for building 3D scenes as well
+as a special, platform-independent shader language for maximum performance. Using Renderscript, you
+can accelerate graphics operations and data processing. Renderscript is an ideal way to create
+high-performance 3D effects for applications, wallpapers, carousels, and more.</p>
+<p>For more information, see the <a
+href="{@docRoot}guide/topics/graphics/renderscript.html">3D Rendering and Computation with
+Renderscript</a> documentation.</p></li>
+</ul>
+
+
+
+
+<h3>Media</h3>
+
+
+<ul>
+
+ <li><b>Time lapse video</b>
+
+<p>Camcorder APIs now support the ability to record time lapse video. The {@link
+android.media.MediaRecorder#setCaptureRate setCaptureRate()} sets the rate at which frames
+should be captured.</p></li>
+
+ <li><b>Texture support for image streams</b>
+
+<p>New {@link android.graphics.SurfaceTexture} allows you to capture an image stream as an OpenGL ES
+texture. By calling {@link android.hardware.Camera#setPreviewTexture setPreviewTexture()} for your
+{@link android.hardware.Camera} instance, you can specify the {@link
+android.graphics.SurfaceTexture} upon which to draw video playback or preview frames from the
+camera.</p></li>
+
+ <li><b>HTTP Live streaming</b>
+
+<p>Applications can now pass an M3U playlist URL to the media framework to begin an HTTP Live
+streaming session. The media framework supports most of the HTTP Live streaming specification,
+including adaptive bit rate. See the <a
+href="{@docRoot}guide/appendix/media-formats.html">Supported Media Formats</a> document for
+more information.</p></li>
+
+ <li><b>EXIF data</b>
+
+<p>The {@link android.media.ExifInterface} includes new fields for photo aperture, ISO, and exposure
+time.</p></li>
+
+ <li><b>Camcorder profiles</b>
+
+<p>New {@link android.media.CamcorderProfile#hasProfile hasProfile()} method and several video
+quality profiles (such as {@link android.media.CamcorderProfile#QUALITY_1080P}, {@link
+android.media.CamcorderProfile#QUALITY_720P}, {@link
+android.media.CamcorderProfile#QUALITY_CIF}, and others) allow you to determine camcorder
+quality options.</p></li>
+
+ <li><b>Digital media file transfer</b>
+
+<p>The platform includes built-in support for Media/Picture Transfer Protocol (MTP/PTP) over USB,
+which lets users easily transfer any type of media files between devices and to a host computer.
+Developers can build on this support, creating applications that let users create or manage rich
+media files that they may want to transfer or share across devices. </p></li>
+
+ <li><b>Digital rights management (DRM)</b>
+
+<p>New extensible digital rights management (DRM) framework for checking and enforcing digital
+rights. It's implemented in two architectural layers:</p>
+<ul>
+ <li>A DRM framework API, which is exposed to applications and runs through the Dalvik VM for
+standard applications.</li>
+ <li>A native code DRM manager that implements the framework API and exposes an interface for DRM
+plug-ins to handle rights management and decryption for various DRM schemes.</li>
+</ul>
+
+<p>For application developers, the framework offers an abstract, unified API that simplifies the
+management of protected content. The API hides the complexity of DRM operations and allows a
+consistent operation mode for both protected and unprotected content, and across a variety of DRM
+schemes.</p>
+
+<p>For device manufacturers, content owners, and Internet digital media providers the DRM
+framework?s plugin API provides a means of adding support for a DRM scheme of choice into the
+Android system, for secure enforcement of content protection.</p>
+
+<p>The preview release does not provide any native DRM plug-ins for checking and enforcing digital
+rights. However, device manufacturers may ship DRM plug-ins with their devices.</p>
+
+<p>You can find all of the DRM APIs in the {@link android.drm} package.</p></li>
+
+</ul>
+
+
+
+<h3>Keyboard support</h3>
+
+<ul>
+<li>Support for Control, Meta, Caps Lock, Num Lock and Scroll Lock modifiers. For more information,
+see {@link android.view.KeyEvent#META_CTRL_ON} and related fields.</li>
+
+<li>Support for full desktop-style keyboards, including support for keys such as Escape, Home, End,
+Delete and others. You can determine whether key events are coming from a full keyboard by
+querying {@link android.view.KeyCharacterMap#getKeyboardType()} and checking for {@link
+android.view.KeyCharacterMap#FULL KeyCharacterMap.FULL}</li>
+
+<li>{@link android.widget.TextView} now supports keyboard-based cut, copy, paste, and select-all,
+using the key combinations Ctrl+X, Ctrl+C, Ctrl+V, and Ctrl+A. It also supports PageUp/PageDown,
+Home/End, and keyboard-based text selection.</li>
+
+<li>{@link android.view.KeyEvent} adds several new methods to make it easier to check the key
+modifier state correctly and consistently. See {@link android.view.KeyEvent#hasModifiers(int)},
+{@link android.view.KeyEvent#hasNoModifiers()},
+{@link android.view.KeyEvent#metaStateHasModifiers(int,int) metaStateHasModifiers()},
+{@link android.view.KeyEvent#metaStateHasNoModifiers(int) metaStateHasNoModifiers()}.</li>
+
+<li>Applications can implement custom keyboard shortcuts by subclassing {@link
+android.app.Activity}, {@link android.app.Dialog}, or {@link android.view.View} and implementing
+{@link android.app.Activity#onKeyShortcut onKeyShortcut()}. The framework calls this method
+whenever a key is combined with Ctrl key. When creating an <a
+href="{@docRoot}guide/topics/ui/menus.html#options-menu">Options Menu</a>, you can register keyboard
+shortcuts by setting either the {@code android:alphabeticShortcut} or {@code
+android:numericShortcut} attribute for each <a
+href="{@docRoot}guide/topics/resources/menu-resource.html#item-element">{@code <item>}</a>
+element (or with {@link android.view.MenuItem#setShortcut setShortcut()}).</li>
+
+<li>Android 3.0 includes a new "virtual keyboard" device with the id {@link
+android.view.KeyCharacterMap#VIRTUAL_KEYBOARD KeyCharacterMap.VIRTUAL_KEYBOARD}. The virtual
+keyboard has a desktop-style US key map which is useful for synthesizing key events for testing
+input.</li>
+
+</ul>
+
+
+
+
+<h3>Split touch events</h3>
+
+<p>Previously, only a single view could accept touch events at one time. Android 3.0
+adds support for splitting touch events across views and even windows, so different views can accept
+simultaneous touch events.</p>
+
+<p>Split touch events is enabled by default when an application targets
+Android 3.0. That is, when the application has set either the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code android:minSdkVersion}</a>
+or <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+android:targetSdkVersion}</a> attribute's value to {@code "11"}.</p>
+
+<p>However, the following properties allow you to disable split touch events across views inside
+specific view groups and across windows.</p>
+
+<ul>
+<li>The {@link android.R.attr#splitMotionEvents android:splitMotionEvents} attribute for view groups
+allows you to disable split touch events that occur between child views in a layout. For example:
+<pre>
+<LinearLayout android:splitMotionEvents="false" ... >
+ ...
+</LinearLayout>
+</pre>
+<p>This way, child views in the linear layout cannot split touch events—only one view can
+receive touch events at a time.</p>
+</li>
+
+<li>The {@link android.R.attr#windowEnableSplitTouch android:windowEnableSplitTouch} style property
+allows you to disable split touch events across windows, by applying it to a theme for the activity
+or entire application. For example:
+<pre>
+<style name="NoSplitMotionEvents" parent="android:Theme.Holo">
+ <item name="android:windowEnableSplitTouch">false</item>
+ ...
+</style>
+</pre>
+<p>When this theme is applied to an <a
+href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> or <a
+href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>,
+only touch events within the current activity window are accepted. For example, by disabling split
+touch events across windows, the system bar cannot receive touch events at the same time as the
+activity. This does <em>not</em> affect whether views inside the activity can split touch
+events—by default, the activity can still split touch events across views.</p>
+
+<p>For more information about creating a theme, read <a
+href="{@docRoot}guide/topics/ui/themes.html">Applying Styles and Themes</a>.</p>
+</li>
+</ul>
+
+
+
+<h3>WebKit</h3>
+
+<ul>
+ <li>New {@link android.webkit.WebViewFragment} class to create a fragment composed of a
+{@link android.webkit.WebView}.</li>
+ <li>New {@link android.webkit.WebSettings} methods:
+ <ul>
+ <li>{@link
+android.webkit.WebSettings#setDisplayZoomControls setDisplayZoomControls()} allows you to hide
+the on-screen zoom controls while still allowing the user to zoom with finger gestures ({@link
+android.webkit.WebSettings#setBuiltInZoomControls setBuiltInZoomControls()} must be set
+{@code true}).</li>
+ <li>New {@link android.webkit.WebSettings} method, {@link
+android.webkit.WebSettings#setEnableSmoothTransition setEnableSmoothTransition()}, allows you
+to enable smooth transitions when panning and zooming. When enabled, WebView will choose a solution
+to maximize the performance (for example, the WebView's content may not update during the
+transition).</li>
+ </ul>
+ <li>New {@link android.webkit.WebView} methods:
+ <ul>
+ <li>{@link android.webkit.WebView#onPause onPause()} callback, to pause any processing
+associated with the WebView when it becomes hidden. This is useful to reduce unnecessary CPU or
+network traffic when the WebView is not in the foreground.</li>
+ <li>{@link android.webkit.WebView#onResume onResume()} callback, to resume processing
+associated with the WebView, which was paused during {@link android.webkit.WebView#onPause
+onPause()}.</li>
+ <li>{@link android.webkit.WebView#saveWebArchive saveWebArchive()} allows you to save the
+current view as a web archive on the device.</li>
+ <li>{@link android.webkit.WebView#showFindDialog showFindDialog()} initiates a text search in
+the current view.</li>
+ </ul>
+ </li>
+</ul>
+
+
+
+<h3>Browser</h3>
+
+<p>The Browser application adds the following features to support web applications:</p>
+
+<ul>
+ <li><b>Media capture</b>
+ <p>As defined by the <a href="http://dev.w3.org/2009/dap/camera/">HTML Media Capture</a>
+specification, the Browser allows web applications to access audio, image and video capture
+capabilities of the device. For example, the following HTML provides an input for the user to
+capture a photo to upload:</p>
+<pre>
+<input type="file" accept="image/*;capture=camera" />
+</pre>
+<p>Or by excluding the {@code capture=camera} parameter, the user can choose to either capture a
+new image with the camera or select one from the device (such as from the Gallery application).</p>
+ </li>
+
+ <li><b>Device Orientation</b>
+ <p>As defined by the <a
+href="http://dev.w3.org/geo/api/spec-source-orientation.html">Device Orientation Event</a>
+specification, the Browser allows web applications to listen to DOM events that provide information
+about the physical orientation and motion of the device.</p>
+ <p>The device orientation is expressed with the x, y, and z axes, in degrees and motion is
+expressed with acceleration and rotation rate data. A web page can register for orientation
+events by calling {@code window.addEventListener} with event type {@code "deviceorientation"}
+and register for motion events by registering the {@code "devicemotion"} event type.</p>
+ </li>
+
+ <li><b>CSS 3D Transforms</b>
+ <p>As defined by the <a href="http://www.w3.org/TR/css3-3d-transforms/">CSS 3D Transform
+Module</a> specification, the Browser allows elements rendered by CSS to be transformed in three
+dimensions.</p>
+ </li>
+</ul>
+
+
+
+<h3>JSON utilities</h3>
+
+<p>New classes, {@link android.util.JsonReader} and {@link android.util.JsonWriter}, help you
+read and write JSON streams. The new APIs complement the {@link org.json} classes, which manipulate
+a document in memory.</p>
+
+<p>You can create an instance of {@link android.util.JsonReader} by calling
+its constructor method and passing the {@link java.io.InputStreamReader} that feeds the JSON string.
+Then begin reading an object by calling {@link android.util.JsonReader#beginObject()}, read a
+key name with {@link android.util.JsonReader#nextName()}, read the value using methods
+respective to the type, such as {@link android.util.JsonReader#nextString()} and {@link
+android.util.JsonReader#nextInt()}, and continue doing so while {@link
+android.util.JsonReader#hasNext()} is true.</p>
+
+<p>You can create an instance of {@link android.util.JsonWriter} by calling its constructor and
+passing the appropriate {@link java.io.OutputStreamWriter}. Then write the JSON data in a manner
+similar to the reader, using {@link android.util.JsonWriter#name name()} to add a property name
+and an appropriate {@link android.util.JsonWriter#value value()} method to add the respective
+value.</p>
+
+<p>These classes are strict by default. The {@link android.util.JsonReader#setLenient setLenient()}
+method in each class configures them to be more liberal in what they accept. This lenient
+parse mode is also compatible with the {@link org.json}'s default parser.</p>
+
+
+
+
+<h3>New feature constants</h3>
+
+<p>The <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
+manfest element should be used to inform external entities (such as Google Play) of the set of
+hardware and software features on which your application depends. In this release, Android adds the
+following new constants that applications can declare with this element:</p>
+
+<ul>
+ <li>{@link android.content.pm.PackageManager#FEATURE_FAKETOUCH "android.hardware.faketouch"}
+ <p>When declared, this indicates that the application is compatible with a device that offers an
+emulated touchscreen (or better). A device that offers an emulated touchscreen provides a user input
+system that can emulate a subset of touchscreen
+capabilities. An example of such an input system is a mouse or remote control that drives an
+on-screen cursor. Such input systems support basic touch events like click down, click up, and drag.
+However, more complicated input types (such as gestures, flings, etc.) may be more difficult or
+impossible on faketouch devices (and multitouch gestures are definitely not possible).</p>
+ <p>If your application does <em>not</em> require complicated gestures and you do
+<em>not</em> want your application filtered from devices with an emulated touchscreen, you
+should declare {@link
+android.content.pm.PackageManager#FEATURE_FAKETOUCH "android.hardware.faketouch"} with a <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
+element. This way, your application will be available to the greatest number of device types,
+including those that provide only an emulated touchscreen input.</p>
+ <p>All devices that include a touchscreen also support {@link
+android.content.pm.PackageManager#FEATURE_FAKETOUCH "android.hardware.faketouch"}, because
+touchscreen capabilities are a superset of faketouch capabilities. Thus, unless you actually require
+a touchscreen, you should add a <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
+element for faketouch.</p>
+ </li>
+</ul>
+
+
+
+
+<h3>New permissions</h3>
+
+<ul>
+ <li>{@link android.Manifest.permission#BIND_REMOTEVIEWS
+"android.permission.BIND_REMOTEVIEWS"}
+ <p>This must be declared as a required permission in the <a
+href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> manifest
+element for an implementation of {@link android.widget.RemoteViewsService}. For example, when
+creating an App Widget that uses {@link android.widget.RemoteViewsService} to populate a
+collection view, the manifest entry may look like this:</p>
+<pre>
+<service android:name=".widget.WidgetService"
+ android:exported="false"
+ android:permission="android.permission.BIND_REMOTEVIEWS" />
+</pre>
+</ul>
+
+
+
+<h3>New platform technologies</h3>
+
+<ul>
+<li><strong>Storage</strong>
+ <ul>
+ <li>ext4 file system support to enable onboard eMMC storage.</li>
+ <li>FUSE file system to support MTP devices.</li>
+ <li>USB host mode support to support keyboards and USB hubs.</li>
+ <li>Support for MTP/PTP </li>
+ </ul>
+</li>
+
+<li><strong>Linux Kernel</strong>
+ <ul>
+ <li>Upgraded to 2.6.36</li>
+ </ul>
+</li>
+
+<li><strong>Dalvik VM</strong>
+ <ul>
+ <li>New code to support and optimize for SMP</li>
+ <li>Various improvements to the JIT infrastructure</li>
+ <li>Garbage collector improvements:
+ <ul>
+ <li>Tuned for SMP</li>
+ <li>Support for larger heap sizes</li>
+ <li>Unified handling for bitmaps and byte buffers</li>
+ </ul>
+ </li>
+ </ul>
+</li>
+
+<li><strong>Dalvik Core Libraries</strong>
+ <ul>
+ <li>New, much faster implementation of NIO (modern I/O library)</li>
+ <li>Improved exception messages</li>
+ <li>Correctness and performance fixes throughout</li>
+ </ul>
+</li>
+</ul>
+
+
+
+<h3 id="api-diff">API differences report</h3>
+
+<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API Level
+{@sdkPlatformApiLevel}), see the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API Differences Report</a>.</p>
+
+
+
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
+the framework API. The Android {@sdkPlatformVersion} API
+is assigned an integer identifier —
+<strong>{@sdkPlatformApiLevel}</strong> — that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
+you need compile the application against the Android library that is provided in
+the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
+also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
+attribute to the <code><uses-sdk></code> element in the application's
+manifest. If your application is designed to run only on Android 2.3 and higher,
+declaring the attribute prevents the application from being installed on earlier
+versions of the platform.</p>
+
+<p>For more information, read <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">What is API
+Level?</a></p>
diff --git a/docs/html/about/versions/android-3.1-highlights.jd b/docs/html/about/versions/android-3.1-highlights.jd
new file mode 100644
index 0000000..5283c2a
--- /dev/null
+++ b/docs/html/about/versions/android-3.1-highlights.jd
@@ -0,0 +1,381 @@
+page.title=Honeycomb MR1
+
+@jd:body
+
+
+<style type="text/css">
+#jd-content {
+ max-width:1200px;
+}
+#jd-content div.screenshot {
+ float:left;
+ clear:left;
+ padding:15px 30px 15px 0;
+}
+#jd-content div.video {
+ float:right;
+ padding:0 60px 40px;
+}
+#jd-content table.columns {
+ margin:0 0 1em 0;
+}
+#jd-content table.columns td {
+ padding:0;
+}
+#jd-content table.columns td+td {
+ padding:0 2em;
+}
+#jd-content table.columns td img {
+ margin:0;
+}
+#jd-content table.columns td+td>*:first-child {
+ margin-top:-2em;
+}
+.green {
+ color:#8db529;
+ font-weight:bold;
+}
+</style>
+
+<p>Welcome to Android 3.1!</p>
+
+<p>Android 3.1 is an incremental platform release that refines many of the
+features introduced in Android 3.0. It builds on the same tablet-optimized UI
+and features offered in Android 3.0 and adds several new capabilities for
+users and developers. This document provides an overview of the new features and
+technologies introduced in Android 3.1. For a more detailed look at new
+developer APIs, see the <a href="{@docRoot}about/versions/android-3.1.html">API
+Overview</a> document.</p>
+
+<p>For a high-level introduction to Android 3.0, please see the <a
+href="{@docRoot}about/versions/android-3.0-highlights.html">Android 3.0 Platform
+Highlights</a>.</p>
+
+<ul>
+ <li><a href="#UserFeatures">New User Features</a></li>
+ <li><a href="#DeveloperApis">New Developer Features</a></li>
+</ul>
+
+<h2 id="UserFeatures" style="clear:right">New User Features</h2>
+
+<div style="padding-top:0em;">
+<div style="margin-right:1em;margin-left:1em;float:right;padding-top:2em;"><a
+href="{@docRoot}sdk/images/3.1/home_full.png" target="_android"><img
+src="{@docRoot}sdk/images/3.1/home.png" alt="" height="280" /></a>
+<div style="padding-left:1.25em;padding-bottom:1.25em;width:450px;font-size:.9em"><strong>Figure 1.</strong> An Android 3.1 Home screen.</div>
+</div>
+
+<h3>UI refinements</h3>
+
+<p>The Android 3.1 platform adds a variety of refinements to make the user
+interface more intuitive and more efficient to use.</p>
+
+<p>UI transitions are improved throughout the system and across the standard
+apps. The Launcher animation is optimized for faster, smoother transition to and
+from the Apps list. Adjustments in color, positioning, and text make UI elements
+easier to see, understand, and use. Accessibility is improved with consistent
+audible feedback throughout the UI and a new setting to let users customize the
+touch-hold interval to meet their needs.</p>
+
+<p>Navigation to and from the five home screens is now easier — touching
+the Home button in the system bar now takes you to the home screen most recently
+used. Settings offers an improved view of internal storage,
+showing the storage used by a larger set of file types. </p>
+
+<h3 id="accessories">Connectivity for USB accessories</h3>
+
+<p>Android 3.1 adds broad platform support for a variety of USB-connected
+peripherals and accessories. Users can attach many types of input devices
+(keyboards, mice, game controllers) and digital cameras. Applications can build
+on the platform’s USB support to extend connectivity to almost any type of USB
+device.</p>
+
+<p>The platform also adds new support for USB accessories — external
+hardware devices designed to attach to Android-powered devices as USB hosts. When an
+accessory is attached, the framework will look for a corresponding application
+and offer to launch it for the user. The accessory can also present a URL
+to the user, for downloading an appropriate application if one is not already
+installed. Users can interact with the application to control powered accessories such
+as robotics controllers; docking stations; diagnostic and musical equipment;
+kiosks; card readers; and much more.</p>
+
+<p>The platform’s USB capabilities rely on components in device hardware, so
+support for USB on specific devices may vary and is determined by device
+manufacturers.</p>
+
+<div style="padding-top:0em;">
+<div style="margin-right:.8em;float:left;width:200px;"><img src="{@docRoot}sdk/images/3.1/tasks.png" alt="" />
+<div style="padding-left:1em;padding-bottom:1em;xwidth:auto;font-size:.9em"><strong>Figure 2.</strong> The Recent Apps menu is now expandable and scrollable.</div>
+</div>
+
+<h3 id="recentapps">Expanded Recent Apps list</h3>
+
+<p>For improved multitasking and instant visual access to a much larger number
+of apps, the Recent Apps list is now expandable. Users can now scroll the list
+of recent apps vertically to see thumbnail images all of the tasks in progress
+and recently used apps, then touch a thumbnail to jump back into that task.</p>
+
+<h3 id="resizewidgets">Resizeable Home screen widgets</h3>
+
+<p>For more flexible Home screen customization, users can now resize their Home
+screen widgets using drag bars provided by the system. Users can expand widgets
+both horizontally and/or vertically to include more content, where supported by
+each widget.</p>
+
+
+<h3 id="keyboards">Support for external keyboards
+and pointing devices</h3>
+
+<p>Users can now attach almost any type of external keyboard or mouse to their
+Android-powered devices, to create a familiar environment and work more
+efficiently. One or more input devices can be attached to the system simultaneously
+over USB and/or Bluetooth HID, in any combination. No special configuration or
+driver is needed, in most cases. When multiple devices are connected, users can
+conveniently manage the active keyboard and IME using the keyboard settings that
+are available from the System bar.</p>
+
+<p>For pointing devices, the platform supports most types of mouse with a single
+button and optionally a scroll wheel, as well as similar devices such as
+trackballs. When these are connected, users can interact with the UI using
+point, select, drag, scroll, hover, and other standard actions.</p>
+
+<h3 id="joysticks">Support for joysticks and gamepads</h3>
+
+<p>To make the platform even better for gaming, Android 3.1 adds support for
+most PC joysticks and gamepads that are connected over USB or Bluetooth HID.</p>
+
+<p>For example, users can connect PlayStation<sup>®</sup>3 and Xbox 360<sup>®</sup>
+game controllers over USB (but not Bluetooth), Logitech Dual Action™ gamepads and
+flight sticks, or a car racing controller. Game controllers that use proprietary
+networking or pairing are not supported by default, but in general, the platform
+supports most PC-connectible joysticks and gamepads.</p>
+
+<h3 id="wifi">Robust Wi-Fi networking</h3>
+
+<p>Android 3.1 adds robust Wi-Fi features, to make sure that users and their
+apps can take full advantage of higher-speed Wi-Fi access at home, at work, and
+while away.</p>
+
+<p>A new high-performance Wi-Fi lock lets applications maintain
+high-performance Wi-Fi connections even when the device screen is off. Users can
+take advantage of this to play continuous streamed music, video, and voice
+services for long periods, even when the device is otherwise idle and the screen
+is off. </p>
+
+<p>Users can now configure an HTTP proxy for each individual Wi-Fi access
+point, by touch-hold of the access point in Settings. The browser uses the HTTP
+proxy when communicating with the network over the access point and other apps
+may also choose to do so. The platform also provides backup and restore of the
+user-defined IP and proxy settings.</p>
+<p>The platform adds support for Preferred Network Offload (PNO), a background
+scanning capability that conserves battery power savings in cases where Wi-Fi
+needs to be available continuously for long periods of time.</p>
+
+<h3 id="apps">Updated set of standard apps</h3>
+
+<p>The Android 3.1 platform includes an updated set of standard applications
+that are optimized for use on larger screen devices. The sections below
+highlight some of the new features.</p>
+
+<div style="padding-top:0em;">
+<div style="margin-right:1em;float:right;margin-left:1em;margin-top:1.5em;margin-bottom:0;padding-bottom:0;"><img src="{@docRoot}sdk/images/3.1/controls.png" alt="" height="280px" />
+<div style="padding-left:1.25em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"><strong>Figure 3.</strong> Quick Controls menu in the Browser.</div>
+</div>
+</div>
+
+<p><strong>Browser</strong></p>
+
+<p>The Browser app includes a variety of new features and UI improvements that
+make viewing web content simpler, faster, and more convenient.</p>
+
+<p>The Quick Controls UI, accessible from Browser Settings, is extended and
+redesigned. Users can now use the controls to view thumbnails of open tabs and
+close the active tab, as well as access the overflow menu for instant access to
+Settings and other controls.</p>
+
+<p>To ensure a consistent viewing experience, the Browser extends it's support
+for popular web standards such as CSS 3D, animations, and CSS fixed
+positioning to all sites, mobile or desktop. It also adds support for embedded
+playback of HTML5 video content. To make it easier to manage favorite
+content, users can now save a web page locally for offline viewing, including
+all styling and images. For convenience when visiting Google sites, an improved
+auto-login UI lets users sign in quickly and manage access when multiple users
+are sharing a device.</p>
+
+<p>For best performance, the Browser adds support for plugins that use hardware
+accelerated rendering. Page zoom performance is also dramatically improved,
+making it faster to navigate and view web pages.</p>
+
+<p><strong>Gallery</strong></p>
+
+<p>The Gallery app now supports Picture Transfer Protocol (PTP), so that users
+can connect their cameras over USB and import their pictures to Gallery with a
+single touch. The app also copies the pictures to local storage and provides an
+indicator to let users see how much space is available.</p>
+
+<div style="padding-top:0em;">
+<div style="margin-right:1em;float:left;margin-left:0em;"><img src="{@docRoot}sdk/images/3.1/resizeable.png" alt="" width="170" target="_android" style="margin-bottom:0;" />
+<div style="padding-left:1.4em;padding-bottom:1em;width:180px;font-size:.9em"><strong>Figure
+4.</strong> Home screen widgets can now be resized.</div></div>
+
+<p><strong>Calendar</strong></p>
+
+<p>Calendar grids are larger, for better readability and more accurate
+touch-targeting. Additionally, users can create a larger viewing area for grids
+by hiding the calendar list controls. Controls in the date picker are
+redesigned, making them easier to see and use.</li>
+</ul>
+
+<p><strong>Contacts</strong></p>
+
+<p>The Contacts app now lets you locate contacts more easily using full text
+search. Search returns matching results from all fields that are stored for a
+contact.
+</p>
+
+<p><strong>Email</strong></p>
+
+<p>When replying or forwarding an HTML message, The Email app now sends both
+plain text and HTML bodies as a multi-part mime message. This ensures that the
+message will be formatted properly for all recipients. Folder prefixes for IMAP
+accounts are now easier to define and manage. To conserve battery power and
+minimize cell data usage, the application now prefetches email from the server
+only when the device is connected to a Wi-Fi access point. </p>
+
+<p>An updated Home screen widget give users quick access to more email. Users
+can touch Email icon at the top of the widget to cycle through labels such as
+Inbox, Unread, and Starred. The widget itself is now resizable, both
+horizontally and vertically.</p>
+
+<h3 id="enterprise">Enterprise support</h3>
+
+<p>Users can now configure an HTTP proxy for each connected Wi-Fi access point.
+This lets administrators work with users to set a proxy hostname, port, and any
+bypass subdomains. This proxy configuration is automatically used by the Browser
+when the Wi-Fi access point is connected, and may optionally be used by other
+apps. The proxy and IP configuration is now backed up and restored across system
+updates and resets.</p>
+
+<p>To meet the needs of tablet users, the platform now allows a "encrypted
+storage card" device policy to be accepted on devices with emulated storage
+cards and encrypted primary storage.</p>
+
+
+<h2 id="DeveloperApis" style="clear:both">New Developer Features</h2>
+
+<p>The Android 3.1 platform adds refinements and new capabilities that
+developers can build on, to create powerful and engaging application experiences
+on tablets and other large-screen devices. </p>
+
+<h3 id="accessory">Open Accessory API for rich interaction with
+peripherals</h3>
+
+<p>Android 3.1 introduces a new API for integrating hardware accessories with
+applications running on the platform. The API provides a way to interact across
+a wide range of peripherals, from robotics controllers to musical equipment,
+exercise bicycles, and more.</p>
+
+<p>The API is based on a new USB (Universal Serial Bus) stack and services
+that are built into the platform. The platform provides services for discovering
+and identifying connected hardware, as well as for notifying interested
+applications that the hardware is available.</p>
+
+<p>When a user plugs in a USB accessory, the platform receives
+identifying information such as product name, accessory type, manufacturer, and
+version. The platform sets up communication with the accessory and uses its
+information to notify and launch a targeted app, if one is available. Optionally,
+an accessory can provide a URL that lets users find and download an
+app that works with the accessory. These discovery features make
+first-time setup easier for the user and ensure that an appropriate application
+is available for interacting with the connected hardware. </p>
+
+<p>For application developers and accessory manufacturers, accessory mode offers
+many new ways to engage users and build powerful interaction experiences with
+connected hardware.</p>
+
+<p>To learn more about how to develop applications that interact with
+accessories, see the <a href="{@docRoot}guide/topics/connectivity/usb/accessory.html">USB
+Accessory</a> documentation.</p>
+
+<h3 id="host">USB host API</h3>
+
+<p>Android 3.1 provides built-in platform support for USB host mode and exposes
+an API that lets applications manage connected peripherals. On devices that
+support host mode, applications can use the API to identify and communicate with
+connected devices such as audio devices. input devices, communications devices,
+hubs, cameras, and more.</p>
+
+<p>To learn more about how to develop applications that interact with
+USB devices, see the <a href="{@docRoot}guide/topics/connectivity/usb/host.html">USB
+Host</a> documentation.</p>
+
+<h3 id="inputdevices">Input from mice, joysticks, and gamepads</h3>
+
+<p>Android 3.1 extends the input event system to support a variety of new input
+sources and motion events, across all views and windows. Developers can build on
+these capabilities to let users interact with their applications using mice,
+trackballs, joysticks, gamepads, and other devices, in addition to keyboards and
+touchscreens.</p>
+
+<p>For mouse and trackball input, the platform supports two new motion event
+actions: scroll (horizontal or vertical) such as from a scrollwheel; and hover,
+which reports the location of the mouse when no buttons are pressed.
+Applications can handle these events in any way needed.</p>
+
+<p>For joysticks and gamepads, the platform provides a large number of motion
+axes that applications can use from a given input source, such as X, Y, Hat X,
+Hat Y, rotation, throttle, pressure, size, touch, tool, orientation, and others.
+Developers can also define custom axes if needed, to capture motion in
+additional ways. The platform provides motion events to applications as a batch,
+and applications can query the details of the movements included in the batch,
+for more efficient and precise handling of events.</p>
+
+<p>Applications can query for the list of connected input devices and the motion
+ranges (axes) supported by each device. Applications can also handle multiple
+input and motion events from a single input device. For example, an application
+can use mouse and joystick and mouse event sources from a single input
+device.</p>
+
+<h3 id="resizewidgetsapp">Resizable Home screen widgets</h3>
+
+<p>Developers can now create Home screen widgets that users can resize
+horizontally, vertically, or both. By simply adding an attribute to the
+declaration of a widget, the widget becomes resizable horizontally, vertically,
+or both. This lets users customize the display of the widget content and display
+more of it on their Home screens.</p>
+
+<h3 id="mtp">MTP API for integrating with external cameras</h3>
+
+<p>In Android 3.1, a new MTP (Media Transfer Protocol) API lets developers write
+apps that interact directly with connected cameras and other PTP devices. The
+new API makes it easy for applications to receive notifications when devices are
+attached and removed, manage files and storage on those devices, and transfer
+files and metadata to and from them. The MTP API implements the PTP (Picture
+Transfer Protocol) subset of the MTP specification.</p>
+
+<h3 id="rtp">RTP API, for control over audio streaming sessions</h3>
+
+<p>Android 3.1 exposes an API to its built-in RTP (Real-time Transport Protocol)
+stack, which applications can use to directly manage on-demand or interactive
+data streaming. In particular, apps that provide VOIP, push-to-talk,
+conferencing, and audio streaming can use the API to initiate sessions and
+transmit or receive data streams over any available network.</p>
+
+<h3 id="performance">Performance optimizations</h3>
+
+<p>Android 3.1 includes a variety of performance optimizations that help make
+applications faster and more responsive. Some of the optimizations include:</p>
+
+<ul>
+<li>A new LRU cache class lets applications benefit from efficient caching.
+Applications can use the class to reduce the time spent computing or downloading
+data from the network, while maintaining a sensible memory footprint for the
+cached data.</li>
+<li>The UI framework now supports partial invalidates in hardware-accelerated
+Views, which makes drawing operations in those Views more efficient.</li>
+<li>A new graphics method, {@link android.graphics.Bitmap#setHasAlpha(boolean)
+setHasAlpha()}, allows apps to hint that a given bitmap is opaque. This provides
+an extra performance boost for some types of blits and is especially useful for
+applications that use ARGB_8888 bitmaps.</li>
+</ul>
+
diff --git a/docs/html/about/versions/android-3.1.jd b/docs/html/about/versions/android-3.1.jd
new file mode 100644
index 0000000..2a845f0
--- /dev/null
+++ b/docs/html/about/versions/android-3.1.jd
@@ -0,0 +1,863 @@
+page.title=Android 3.1 Platform
+sdk.platform.version=3.1
+sdk.platform.apiLevel=12
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#api">API Overview</a></li>
+ <li><a href="#api-level">API Level</a></li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/12/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+</div>
+</div>
+
+
+<p><em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes
+an Android library and system image, as well as a set of emulator skins and
+more. The downloadable platform includes no external libraries.</p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes
+an Android library and system image, as well as a set of emulator skins and
+more. To get started developing or testing against Android {@sdkPlatformVersion},
+use the Android SDK Manager to download the platform into your SDK.</p>
+
+
+
+<h2 id="#api" style="margin-top:1.5em;">API Overview</h2>
+
+<p>The sections below provide a technical overview of what's new for developers
+in Android 3.1, including new features and changes in the framework API since
+the previous version.</p>
+
+<h3 id="usb">USB APIs</h3>
+
+<p>Android 3.1 introduces powerful new APIs for
+integrating connected peripherals with applications running on the platform.
+The APIs are based on a USB (Universal Serial Bus) stack and services that are
+built into the platform, including support for both USB host and device
+interactions. Using the APIs, developers can create applications that are able to
+discover, communicate with, and manage a variety of device types connected over
+USB. </p>
+
+<p>The stack and APIs distinguish two basic types of USB hardware, based on
+whether the Android-powered device is acting as host or the external hardware
+is acting as host: </p>
+
+<ul>
+<li>A <em>USB device</em> is a piece of connected hardware that depends on the
+Android-powered device to serve as host. For example, most input devices, mice,
+and joysticks are USB devices, as are many cameras, hubs, and so on.</li>
+<li>A <em>USB accessory</em> is a piece of connected hardware that has a USB
+host controller, provides power, and is designed to communicate with
+Android-powered devices over USB, A variety of peripherals can connect as
+accessories, from robotics controllers to musical equipment, exercise bicycles,
+and more.</li>
+</ul>
+
+<p>For both types — USB devices and USB accessories — the
+platform's USB APIs support discovery by intent broadcast when attached or
+detached, as well as standard interfaces, endpoints, and transfer modes
+(control, bulk, and interrupt).</p>
+
+<p>The USB APIs are available in the package {@link android.hardware.usb}. The
+central class is {@link android.hardware.usb.UsbManager}, which provides
+helper methods for identifying and communicating with
+both USB devices and USB accessories. Applications can acquire an instance of
+{@link android.hardware.usb.UsbManager} and then query for the list of attached
+devices or accessories and then communicate with or manage them.
+{@link android.hardware.usb.UsbManager} also declares intent actions that the
+system broadcasts, to announce when a USB device or accessory is attached or
+detached.</p>
+
+<p>Other classes include:</p>
+
+<ul>
+<li>{@link android.hardware.usb.UsbDevice}, a class representing external
+hardware connected as a USB device (with the Android-powered device acting as
+host).</li>
+<li>{@link android.hardware.usb.UsbAccessory}, representing external hardware
+connected as the USB host (with the Android-powered device acting as a USB
+device).</li>
+<li>{@link android.hardware.usb.UsbInterface} and {@link
+android.hardware.usb.UsbEndpoint}, which provide access to standard USB
+interfaces and endpoints for a device.</li>
+<li>{@link android.hardware.usb.UsbDeviceConnection} and {@link
+android.hardware.usb.UsbRequest}, for sending and receiving data and control
+messages to or from a USB device, sychronously and asynchronously.
+<li>{@link android.hardware.usb.UsbConstants}, which provides constants for
+declaring endpoint types, device classes, and so on.</li>
+</ul>
+
+<p>Note that although the USB stack is built into the platform, actual support
+for USB host and open accessory modes on specific devices is determined by
+their manufacturers. In particular, host mode relies on appropriate USB
+controller hardware in the Android-powered device. </p>
+
+<p>Additionally, developers can request filtering on Google Play, such that
+their applications are not availabe to users whose devices do not provide the
+appropriate USB support. To request filtering, add one or both of the elements
+below to the application manifest, as appropriate: </p>
+
+<ul>
+<li>If the application should only be visible to devices that support USB
+host mode (connection of USB devices), declare this element:
+ <p style="margin-left:1.5em;"><code><uses-feature
+ android:name="android.hardware.usb.host"
+ android:required="true"></code></p>
+</li>
+<li>If the application should only be visible to devices that support USB
+accessories (connection of USB hosts), declare this element:
+ <p style="margin-left:1.5em;"><code><uses-feature
+ android:name="android.hardware.usb.accessory"
+ android:required="true"></code></p>
+</li>
+</ul>
+
+<p>For complete information about how to develop applications that interact with
+USB accessories, please see the
+<a href="{@docRoot}guide/topics/connectivity/usb/index.html">developer documentation</a>.</p>
+
+<p class="note">To look at sample applications that use the USB host API, see <a
+href="{@docRoot}resources/samples/USB/AdbTest/index.html">ADB Test</a> and <a
+href="{@docRoot}resources/samples/USB/MissileLauncher/index.html">Missile
+Launcher</a></p>
+
+<h3>MTP/PTP API</h3>
+
+<p>Android 3.1 exposes a new MTP API that lets applications interact directly
+with connected cameras and other PTP devices. The new API makes it easy for an
+application to receive notifications when devices are attached and removed,
+manage files and storage on those devices, and transfer files and metadata to
+and from them. The MTP API implements the PTP (Picture Transfer Protocol) subset
+of the MTP (Media Transfer Protocol) specification.</p>
+
+<p>The MTP API is available in the {@link android.mtp} package and provides
+these classes: </p>
+
+<ul>
+ <li>The {@link android.mtp.MtpDevice} encapsulates an MTP device that is
+connected over the USB host bus. An application can instantiate an object of
+this type and then use its methods to get information about the device and
+objects stored on it, as well as opening the connection and transferring data.
+Some of the methods include:
+ <ul>
+ <li>{@link android.mtp.MtpDevice#getObjectHandles(int, int, int)
+getObjectHandles()} returns a list of handles for all objects on the device that
+match a specified format and parent. To get information about an object, an
+application can pass a handle to {@link android.mtp.MtpDevice#getObjectInfo(int)
+getObjectInfo()}.</li>
+ <li>{@link android.mtp.MtpDevice#importFile(int, java.lang.String)
+importFile()} lets an application copy data for an object to a file in external
+storage. This call may block for an arbitrary amount of time depending on the
+size of the data and speed of the devices, so should be made from a spearate
+thread.</li>
+ <li>{@link
+android.mtp.MtpDevice#open(android.hardware.usb.UsbDeviceConnection) open()}
+lets an application open a connected MTP/PTP device. </li>
+ <li>{@link android.mtp.MtpDevice#getThumbnail(int) getThumbnail()} returns
+the thumbnail of the object as a byte array. </li>
+ </ul>
+ </li>
+ <li>{@link android.mtp.MtpStorageInfo} holds information about about a storage
+unit on an MTP device, corresponding to the StorageInfo Dataset described in
+section 5.2.2 of the MTP specification. Methods in the class let an application
+get a storage unit’s description string, free space, maximum storage capacity,
+storage ID, and volume identifier.</li>
+ <li>{@link android.mtp.MtpDeviceInfo} holds information about an MTP device
+corresponding to the DeviceInfo Dataset described in section 5.1.1 of the MTP
+specification. Methods in the class let applications get a device’s
+manufacturer, model, serial number, and version.</li>
+ <li>{@link android.mtp.MtpObjectInfo} holds information about an object stored
+on an MTP device, corresponding to the ObjectInfo Dataset described in section
+5.3.1 of the MTP specification. Methods in the class let applications get an
+object’s size, data format, association type, creation date, and thumbnail
+information.</li>
+ <li>{@link android.mtp.MtpConstants} provides constants for declaring MTP file
+format codes, association type, and protection status.</li>
+</ul>
+
+<h3 id="motionevents">Support for new input devices and motion events</h3>
+
+<p>Android 3.1 extends the input subsystem to support new input devices and new
+types of motion events, across all views and windows. Developers can build on
+these capabilities to let users interact with their applications using mice,
+trackballs, joysticks, gamepads, and other devices, in addition to keyboards and
+touchscreens. </p>
+
+<p>For handling mouse, scrollwheel, and trackball input, the platform supports
+two new motion event actions:</p>
+<ul>
+<li>{@link android.view.MotionEvent#ACTION_SCROLL}, which describes the pointer
+location at which a non-touch scroll motion, such as from a mouse scroll wheel,
+took place. In the MotionEvent, the value of the {@link
+android.view.MotionEvent#AXIS_HSCROLL} and {@link
+android.view.MotionEvent#AXIS_VSCROLL} axes specify the relative scroll
+movement. </li>
+<li>{@link android.view.MotionEvent#ACTION_HOVER_MOVE}, reports the current
+position of the mouse when no buttons are pressed, as well as any intermediate
+points since the last <code>HOVER_MOVE</code> event. Hover enter and exit
+notifications are not yet supported.</li>
+</ul>
+
+<p>To support joysticks and gamepads, the {@link android.view.InputDevice} class
+includes these new input device sources:</p>
+<ul>
+<li>{@link android.view.InputDevice#SOURCE_CLASS_JOYSTICK} — the source
+device has joystick axes.</li>
+<li>{@link android.view.InputDevice#SOURCE_CLASS_BUTTON} — the source
+device has buttons or keys.</li>
+<li>{@link android.view.InputDevice#SOURCE_GAMEPAD} — the source device
+has gamepad buttons such as {@link android.view.KeyEvent#KEYCODE_BUTTON_A}
+or {@link android.view.KeyEvent#KEYCODE_BUTTON_B}. Implies
+{@link android.view.InputDevice#SOURCE_CLASS_BUTTON}</li>
+<li>{@link android.view.InputDevice#SOURCE_JOYSTICK} — the source device
+has joystick axes. Implies SOURCE_CLASS_JOYSTICK.</li>
+</ul>
+
+<p>To describe motion events from these new sources, as well as those from mice
+and trackballs, the platform now defines axis codes on {@link
+android.view.MotionEvent}, similar to how it defines key codes on {@link
+android.view.KeyEvent}. New axis codes for joysticks
+and game controllers include
+{@link android.view.MotionEvent#AXIS_HAT_X}, {@link
+android.view.MotionEvent#AXIS_HAT_Y}, {@link
+android.view.MotionEvent#AXIS_RTRIGGER}, {@link
+android.view.MotionEvent#AXIS_ORIENTATION}, {@link
+android.view.MotionEvent#AXIS_THROTTLE}, and many others.
+Existing {@link android.view.MotionEvent} axes are represented by {@link
+android.view.MotionEvent#AXIS_X}, {@link android.view.MotionEvent#AXIS_Y},
+{@link android.view.MotionEvent#AXIS_PRESSURE}, {@link
+android.view.MotionEvent#AXIS_SIZE}, {@link
+android.view.MotionEvent#AXIS_TOUCH_MAJOR}, {@link
+android.view.MotionEvent#AXIS_TOUCH_MINOR}, {@link
+android.view.MotionEvent#AXIS_TOOL_MAJOR}, {@link
+android.view.MotionEvent#AXIS_TOOL_MINOR}, and {@link
+android.view.MotionEvent#AXIS_ORIENTATION}.</p>
+
+<p>Additionally, {@link android.view.MotionEvent} defines a number of generic
+axis codes that are used when the framework does not know how to map a
+particular axis. Specific devices can use the generic axis codes to pass custom
+motion data to applications. For a full list of axes and their intended
+interpretations, see the {@link android.view.MotionEvent} class documentation.
+</p>
+
+<p>The platform provides motion events to applications in batches, so a single
+event may contain a current position and multiple so-called historical movements.
+Applications should use {@link android.view.MotionEvent#getHistorySize()} to get
+the number of historical samples, then retrieve and process all historical
+samples in order using {@link
+android.view.MotionEvent#getHistoricalAxisValue(int, int, int)
+getHistoricalAxisValue()}. After that, applications should process the current
+sample using {@link android.view.MotionEvent#getAxisValue(int) getAxisValue()}.
+</p>
+
+<p>Some axes can be retrieved using special accessor methods. For example,
+instead of calling {@link android.view.MotionEvent#getAxisValue(int)
+getAxisValue()}, applications can call {@link android.view.MotionEvent#getX(int)
+getX()}. Axes that have built-in accessors include {@link
+android.view.MotionEvent#AXIS_X}, {@link android.view.MotionEvent#AXIS_Y},
+{@link android.view.MotionEvent#AXIS_PRESSURE}, {@link
+android.view.MotionEvent#AXIS_SIZE}, {@link
+android.view.MotionEvent#AXIS_TOUCH_MAJOR}, {@link
+android.view.MotionEvent#AXIS_TOUCH_MINOR}, {@link
+android.view.MotionEvent#AXIS_TOOL_MAJOR}, {@link
+android.view.MotionEvent#AXIS_TOOL_MINOR}, and {@link
+android.view.MotionEvent#AXIS_ORIENTATION}.</p>
+
+<p>Each input device has a unique, system-assigned ID and may also provide
+multiple sources. When a device provides multiple sources, more than one source
+can provide axis data using the same axis. For example, a touch event coming
+from the touch source uses the X axis for screen position data, while a joystick
+event coming from the joystick source will use the X axis for the stick position
+instead. For this reason, it's important for applications to interpret axis
+values according to the source from which they originate. When handling a motion
+event, applications should use methods on the {@link android.view.InputDevice}
+class to determine the axes supported by a device or source. Specifically,
+applications can use {@link android.view.InputDevice#getMotionRanges()
+getMotionRanges()} to query for all axes of a device or all axes of a given
+source of the device. In both cases, the range information for axes returned in
+the {@link android.view.InputDevice.MotionRange} object specifies the source for
+each axis value.</p>
+
+<p>Finally, since the motion events from joysticks, gamepads, mice, and
+trackballs are not touch events, the platform adds a new callback method for
+passing them to a {@link android.view.View} as "generic" motion events.
+Specifically, it reports the non-touch motion events to
+{@link android.view.View}s through a call to {@link
+android.view.View#onGenericMotionEvent(android.view.MotionEvent)
+onGenericMotionEvent()}, rather than to {@link
+android.view.View#onTouchEvent(android.view.MotionEvent)
+onTouchEvent()}.</p>
+
+<p>The platform dispatches generic motion events differently, depending on the
+event source class. {@link android.view.InputDevice#SOURCE_CLASS_POINTER} events
+go to the {@link android.view.View} under the pointer, similar to how touch
+events work. All others go to the currently focused {@link android.view.View}.
+For example, this means a {@link android.view.View} must take focus in order to
+receive joystick events. If needed, applications can handle these events at the
+level of Activity or Dialog by implementing {@link
+android.view.View#onGenericMotionEvent(android.view.MotionEvent)
+onGenericMotionEvent()} there instead.</p>
+
+<p class="note">To look at a sample application that uses joystick motion
+events, see <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/GameControllerInput.html">GameControllerInput</a>
+and <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/GameView.html">GameView</a>.</p>
+
+<h3>RTP API</h3>
+
+<p>Android 3.1 exposes an API to its built-in RTP (Real-time Transport Protocol)
+stack, which applications can use to manage on-demand or interactive data
+streaming. In particular, apps that provide VOIP, push-to-talk, conferencing,
+and audio streaming can use the API to initiate sessions and transmit or receive
+data streams over any available network.</p>
+
+<p>The RTP API is available in the {@link android.net.rtp} package. Classes
+include: </p>
+<ul>
+<li>{@link android.net.rtp.RtpStream}, the base class of streams that send and
+receive network packets with media payloads over RTP.</li>
+<li>{@link android.net.rtp.AudioStream}, a subclass of {@link
+android.net.rtp.RtpStream} that carries audio payloads over RTP.</li>
+<li>{@link android.net.rtp.AudioGroup}, a local audio hub for managing and
+mixing the device speaker, microphone, and {@link android.net.rtp.AudioStream}.</li>
+<li>{@link android.net.rtp.AudioCodec}, which holds a collection of codecs that
+you define for an {@link android.net.rtp.AudioStream}.</li>
+</ul>
+
+<p>To support audio conferencing and similar usages, an application instantiates
+two classes as endpoints for the stream:</p>
+
+<ul>
+<li>{@link android.net.rtp.AudioStream} specifies a remote endpoint and consists
+of network mapping and a configured {@link android.net.rtp.AudioCodec}.</li>
+<li>{@link android.net.rtp.AudioGroup} represents the local endpoint for one
+or more {@link android.net.rtp.AudioStream}s. The {@link android.net.rtp.AudioGroup} mixes
+all the {@link android.net.rtp.AudioStream}s and optionally interacts with the device
+speaker and the microphone at the same time.</li>
+</ul>
+
+<p>The simplest usage involves a single remote endpoint and local endpoint.
+For more complex usages, please refer to the limitations described for
+{@link android.net.rtp.AudioGroup}.</p>
+
+<p>To use the RTP API, applications must request permission from the user by
+declaring <code><uses-permission
+android:name="android.permission.INTERNET"></code>
+in their manifest files. To acquire the device microphone, the <code><uses-permission
+android:name="android.permission.RECORD_AUDIO"></code> permission is also required.</p>
+
+<h3 id="resizewidgets">Resizable app widgets</h3>
+
+<p>Starting in Android 3.1, developers can make their homescreen widgets
+resizeable — horizontally, vertically, or on both axes. Users touch-hold a
+widget to show its resize handles, then drag the horizontal and/or vertical
+handles to change the size on the layout grid. </p>
+
+<p>Developers can make any Home screen widget resizeable by defining a
+<code>resizeMode</code> attribute in the widget's {@link
+android.appwidget.AppWidgetProviderInfo} metadata. Values for the
+<code>resizeMode</code> attribute include "horizontal", "vertical", and "none".
+To declare a widget as resizeable horizontally and vertically, supply the value
+"horizontal|vertical".
+
+<p>Here's an example: </p>
+
+<pre><appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
+ android:minWidth="294dp"
+ android:minHeight="72dp"
+ android:updatePeriodMillis="86400000"
+ android:previewImage="@drawable/preview"
+ android:initialLayout="@layout/example_appwidget"
+ android:configure="com.example.android.ExampleAppWidgetConfigure"
+ android:resizeMode="horizontal|vertical" >
+</appwidget-provider></pre>
+
+<p>For more information about Home screen widgets, see the <a
+href="{@docRoot}guide/topics/appwidgets/index.html">App Widgets</a>
+documentation.</p>
+
+<h3 id="animation" style="margin-top:1.25em;">Animation framework</h3>
+
+<ul>
+<li>New ViewPropertyAnimator class
+ <ul>
+ <li>A new {@link android.view.ViewPropertyAnimator} class provides a
+convenient
+way for developers to animate select properties on {@link android.view.View} objects. The class
+automaties and optimizes the animation of the properties and makes it easier to
+manage multiple simulataneous animations on a {@link android.view.View} object.
+<p>Using the {@link android.view.ViewPropertyAnimator} is straightforward. To animate properties for
+a {@link android.view.View}, call {@link android.view.View#animate()} to
+construct a {@link android.view.ViewPropertyAnimator} object for that {@link android.view.View}. Use the
+methods on the {@link android.view.ViewPropertyAnimator} to specify what property to
+animate and how to animate it. For example, to fade the {@link android.view.View} to transparent,
+call <code>alpha(0);</code>. The {@link android.view.ViewPropertyAnimator} object
+handles the details of configuring the underlying {@link
+android.animation.Animator} class and starting it, then rendering the
+animation.</p></li>
+ </ul>
+</li>
+<li>Animation background color
+ <ul>
+ <li>New {@link android.view.animation.Animation#getBackgroundColor()} and
+ {@link android.view.animation.Animation#setBackgroundColor(int)} methods let
+ you get/set the background color behind animations, for window animations
+only. Currently the background must be black, with any desired alpha level.</li>
+ </ul>
+</li>
+<li>Getting animated fraction from <code>ViewAnimator</code>
+ <ul>
+ <li>A new {@link android.animation.ValueAnimator#getAnimatedFraction()}
+method
+lets you get the current animation fraction — the elapsed/interpolated
+fraction used in the most recent frame update — from a {@link
+android.animation.ValueAnimator}.</li>
+ </ul>
+</li>
+</ul>
+
+<h3 "ui">UI framework</h3>
+<ul>
+<li>Forced rendering of a layer
+ <ul>
+ <li>A new {@link android.view.View#buildLayer()} method lets an application
+force a View's layer to be created and the View rendered into it immediately.
+For example, an application could use this method to render a View into its
+layer before starting an animation. If the View is complex, rendering it into
+the layer before starting the animation will avoid skipping frames.</li>
+ </ul>
+</li>
+<li>Camera distance
+ <ul>
+ <li>Applications can use a new method
+{@link android.view.View#setCameraDistance(float)} to set the distance from the
+camera
+to a View. This gives applications improved control over 3D transformations of
+the View, such as rotations. </li>
+ </ul>
+</li>
+<li>Getting a calendar view from a DatePicker
+ <ul>
+ <li>A new {@link android.widget.DatePicker#getCalendarView()} method
+ lets you get a {@link android.widget.CalendarView} from a {@link
+android.widget.DatePicker}
+ instance.</li>
+ </ul>
+</li>
+<li>Getting callbacks when views are detached
+ <ul>
+ <li>A new {@link android.view.View.OnAttachStateChangeListener} lets you
+receive
+callbacks when a View is attached or detached from its window. Use {@link
+android.view.View#addOnAttachStateChangeListener(android.view.View.OnAttachStateChangeListener) addOnAttachStateChangeListener()}
+to add a listener and {@link
+android.view.View#removeOnAttachStateChangeListener(android.view.View.OnAttachStateChangeListener) addOnAttachStateChangeListener()} to remove it.</li>
+ </ul>
+</li>
+<li>Fragment breadcrumb listener, new onInflate() signature
+ <ul>
+ <li>A new method, {@link
+android.app.FragmentBreadCrumbs#setOnBreadCrumbClickListener(android.app.FragmentBreadCrumbs.OnBreadCrumbClickListener) setOnBreadCrumbClickListener()},
+provides a hook to let
+applications intercept fragment-breadcrumb clicks and take any action needed
+before going to the backstack entry or fragment that was clicked. </li>
+ <li>In the {@link android.app.Fragment} class, {@link
+android.app.Fragment#onInflate(android.util.AttributeSet, android.os.Bundle)
+onInflate(attrs, savedInstanceState)} is deprecated. Please use {@link
+android.app.Fragment#onInflate(android.app.Activity, android.util.AttributeSet,
+android.os.Bundle) onInflate(activity, attrs, savedInstanceState)} instead.</li>
+ </ul>
+</li>
+<li>Display search result in new tab
+ <ul>
+ <li>An {@link android.app.SearchManager#EXTRA_NEW_SEARCH} data key for {@link
+android.content.Intent#ACTION_WEB_SEARCH} intents lets you open a search in a
+new browser tab, rather than in an existing one.</li>
+ </ul>
+</li>
+
+<li>Drawable text cursor
+ <ul>
+<li>You can now specify a drawable to use as the text cursor using the new
+resource attribute {@link android.R.attr#textCursorDrawable}.</li>
+ </ul>
+</li>
+<li>Setting displayed child in remote views
+ <ul>
+ <li>A new convenience method, {@link
+android.widget.RemoteViews#setDisplayedChild(int, int) setDisplayedChild(viewId,
+childIndex)}, is available in {@link android.widget.RemoteViews} subclasses, to
+let you set the child displayed in {@link android.widget.ViewAnimator} and
+{@link android.widget.AdapterViewAnimator} subclasses such as {@link
+android.widget.AdapterViewFlipper}, {@link android.widget.StackView}, {@link
+android.widget.ViewFlipper}, and {@link android.widget.ViewSwitcher}.</li>
+ </ul>
+</li>
+<li>Generic keys for gamepads and other input devices
+ <ul>
+ <li>{@link android.view.KeyEvent} adds a range of generic keycodes to
+ accommodate gamepad buttons. The class also adds
+ {@link android.view.KeyEvent#isGamepadButton(int)} and several other
+ helper methods for working with keycodes.</li>
+ </ul>
+</li>
+</ul>
+
+<h3 id="graphics" style="margin-top:1.3em;">Graphics</h3>
+
+<ul>
+<li>Helpers for managing bitmaps
+ <ul>
+ <li>{@link android.graphics.Bitmap#setHasAlpha(boolean)} lets an app indicate that
+all of the pixels in a Bitmap are known to be opaque (false) or that some of the
+pixels may contain non-opaque alpha values (true). Note, for some configs (such
+as RGB_565) this call is ignored, since it does not support per-pixel alpha
+values. This is meant as a drawing hint, as in some cases a bitmap that is known
+to be opaque can take a faster drawing case than one that may have non-opaque
+per-pixel alpha values. </li>
+ <li>{@link android.graphics.Bitmap#getByteCount()} gets a Bitmap's size in
+bytes.</li>
+ <li>{@link android.graphics.Bitmap#getGenerationId()} lets an application find
+out whether a Bitmap has been modified, such as for caching.</li>
+ <li>{@link android.graphics.Bitmap#sameAs(android.graphics.Bitmap)} determines
+whether a given Bitmap differs from the current Bitmap, in dimension,
+configuration, or pixel data. </li>
+ </ul>
+</li>
+<li>Setting camera location and rotation
+ <ul>
+ <li>{@link android.graphics.Camera} adds two new methods {@link
+android.graphics.Camera#rotate(float, float, float) rotate()} and {@link
+android.graphics.Camera#setLocation(float, float, float) setLocation()} for
+control of the
+camera's location, for 3D transformations.</li>
+</ul>
+</li>
+</ul>
+
+<h3 id="network" style="margin-top:1.25em;">Network</h3>
+
+<ul>
+<li>High-performance Wi-Fi lock
+ <ul>
+ <li>A new high-performance Wi-Fi lock lets applications maintain
+high-performance Wi-Fi connections even when the device screen is off.
+Applications that stream music, video, or voice for long periods can acquire the
+high-performance Wi-Fi lock to ensure streaming performance even when the screen
+is off. Because it uses more power, applications should acquire the
+high-performance Wi-Fi when there is a need for a long-running active
+connection.
+<p>To create a high-performance lock, pass {@link
+android.net.wifi.WifiManager#WIFI_MODE_FULL_HIGH_PERF} as the lock mode in a
+call to {@link android.net.wifi.WifiManager#createWifiLock(int,
+java.lang.String) createWifiLock()}.</p></li>
+ </ul>
+</li>
+<li>More traffic stats
+ <ul>
+ <li>Applications can now access statistics about more types of network usage
+using new methods in {@link android.net.TrafficStats}. Applications can use the
+methods to get UDP stats, packet count, TCP transmit/receive payload bytes and
+segments for a given UID.</li>
+ </ul>
+</li>
+<li>SIP auth username
+ <ul>
+ <li>Applications can now get and set the SIP auth username for a profile
+using
+the new methods {@link android.net.sip.SipProfile#getAuthUserName()
+getAuthUserName()} and {@link
+android.net.sip.SipProfile.Builder#setAuthUserName(java.lang.String)
+setAuthUserName()}.</li>
+ </ul>
+</li>
+</ul>
+
+
+<h3 id="download" style="margin-top:1.25em;">Download Manager</h3>
+<ul>
+<li>Handling of completed downloads
+ <ul>
+ <li>Applications can now initiate downloads that notify users only on
+completion. To initiate this type of download, applications pass {@link
+android.app.DownloadManager.Request#VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION}
+in the {@link
+android.app.DownloadManager.Request#setNotificationVisibility(int)
+setNotificationVisibility()} method of
+the a request object.</li>
+ <li>A new method, {@link
+android.app.DownloadManager#addCompletedDownload(java.lang.String,
+java.lang.String, boolean, java.lang.String, java.lang.String, long, boolean)
+addCompletedDownload()}, lets an application add a file to the
+downloads database, so that it can be managed by the Downloads application.</li>
+ </ul>
+</li>
+<li>Show downloads sorted by size
+ <ul>
+ <li>Applications can start the Downloads application in sort-by-size mode by
+adding the new extra {@link
+android.app.DownloadManager#INTENT_EXTRAS_SORT_BY_SIZE} to an {@link
+android.app.DownloadManager#ACTION_VIEW_DOWNLOADS} intent.</li>
+ </ul>
+</li>
+</ul>
+
+<h3 id="ime" style="margin-top:1.25em;">IME framework</h3>
+
+<ul>
+<li>Getting an input method's extra value key
+ <ul><li>The {@link android.view.inputmethod.InputMethodSubtype} adds the
+method
+{@link
+android.view.inputmethod.InputMethodSubtype#containsExtraValueKey(java.lang.String) containsExtraValueKey()} to check whether an ExtraValue string is stored
+for the subtype and
+the method {@link
+android.view.inputmethod.InputMethodSubtype#getExtraValueOf(java.lang.String)
+getExtraValueOf()} to extract a specific key value from the ExtraValue hashmap.
+</li>
+ </ul>
+</li>
+</ul>
+
+<h3 id="media" style="margin-top:1.25em;">Media</h3>
+
+<ul>
+<li>New streaming audio formats
+ <ul>
+ <li>The media framework adds built-in support for raw ADTS AAC content, for
+improved streaming audio, as well as support for FLAC audio, for highest quality
+(lossless) compressed audio content. See the <a
+href="{@docRoot}guide/appendix/media-formats.html">Supported Media Formats</a>
+document for more information.</p></li>
+ </ul>
+</li>
+</ul>
+
+<h3 id="launchcontrols" style="margin-top:1.25em;">Launch controls on stopped
+applications</h3>
+
+<p>Starting from Android 3.1, the system's package manager keeps track of
+applications that are in a stopped state and provides a means of controlling
+their launch from background processes and other applications.</p>
+
+<p>Note that an application's stopped state is not the same as an Activity's
+stopped state. The system manages those two stopped states separately.</p>
+
+<p>The platform defines two new intent flags that let a sender specify
+whether the Intent should be allowed to activate components in stopped
+application.</p>
+
+<ul>
+<li>{@link android.content.Intent#FLAG_INCLUDE_STOPPED_PACKAGES} —
+Include intent filters of stopped applications in the list of potential targets
+to resolve against. </li>
+<li>{@link android.content.Intent#FLAG_EXCLUDE_STOPPED_PACKAGES} —
+Exclude intent filters of stopped applications from the list of potential
+targets.</li>
+</ul>
+
+<p>When neither or both of these flags is defined in an intent, the default
+behavior is to include filters of stopped applications in the list of
+potential targets.</p>
+
+<p>Note that the system adds {@link
+android.content.Intent#FLAG_EXCLUDE_STOPPED_PACKAGES} <em>to all broadcast
+intents</em>. It does this to prevent broadcasts from background services from
+inadvertently or unnecessarily launching components of stoppped applications.
+A background service or application can override this behavior by adding the
+{@link android.content.Intent#FLAG_INCLUDE_STOPPED_PACKAGES} flag to broadcast
+intents that should be allowed to activate stopped applications.</p>
+
+<p>Applications are in a stopped state when they are first installed but are not
+yet launched and when they are manually stopped by the user (in Manage
+Applications).</p>
+
+<h3 id="installnotification">Notification of application first launch and upgrade</h3>
+
+<p>The platform adds improved notification of application first launch and
+upgrades through two new intent actions:</p>
+
+<ul>
+<li>{@link android.content.Intent#ACTION_PACKAGE_FIRST_LAUNCH} — Sent to
+the installer package of an application when that application is first launched
+(that is, the first time it is moved out of a stopped state). The data
+contains the name of the package. </li>
+
+<li>{@link android.content.Intent#ACTION_MY_PACKAGE_REPLACED} — Notifies
+an application that it was updated, with a new version was installed over
+an existing version. This is only sent to the application that was replaced. It
+does not contain any additional data. To receive it, declare an intent filter
+for this action. You can use the intent to trigger code that helps get your
+application back in proper running shape after an upgrade.
+
+<p>This intent is sent directly to the application, but only if the application
+was upgraded while it was in started state (not in a stopped state).</p></li>
+
+</ul>
+
+<h3 id="other">Core utilities</h3>
+
+<ul>
+<li>LRU cache
+ <ul>
+ <li>A new {@link android.util.LruCache} class lets your applications benefit
+from efficient caching. Applications can use the class to reduce the time spent
+computing or downloading data from the network, while maintaining a sensible
+memory footprint for the cached data.{@link android.util.LruCache} is a cache
+that holds strong references to a limited number of values. Each time a value is
+accessed, it is moved to the head of a queue. When a value is added to a full
+cache, the value at the end of that queue is evicted and may become eligible for
+garbage collection.</li>
+ </ul>
+</li>
+<li>File descriptor as <code>int</code>
+ <ul>
+ <li>You can now get the native file descriptor int for a {@link
+android.os.ParcelFileDescriptor} using either of the new methods {@link
+android.os.ParcelFileDescriptor#getFd()} or {@link
+android.os.ParcelFileDescriptor#detachFd()}. </li>
+ </ul>
+</li>
+</ul>
+
+
+
+
+
+
+<h3 id="webkit" style="margin-top:1.25em;">WebKit</h3>
+
+<ul>
+
+<li>File scheme cookies
+ <ul>
+ <li>The {@link android.webkit.CookieManager} now supports cookies that use
+the
+<code>file:</code> URI scheme. You can use {@link
+android.webkit.CookieManager#setAcceptFileSchemeCookies(boolean)
+setAcceptFileSchemeCookies()} to
+enable/disable support for file scheme cookies, before constructing an instance
+of <code>WebView</code> or <code>CookieManager</code>. In a
+<code>CookieManager</code> instance, you can check whether file scheme cookies
+is enabled by calling {@link
+android.webkit.CookieManager#allowFileSchemeCookies()}.</li>
+ </ul>
+</li>
+<li>Notification of login request
+ <ul>
+ <li>To support the browser autologin features introduced in Android 3.0, the
+new
+method {@link
+android.webkit.WebViewClient#onReceivedLoginRequest(android.webkit.WebView,java.lang.String, java.lang.String, java.lang.String) onReceivedLoginRequest()}
+notifies the host
+application that an autologin request for the user was processed. </li>
+ </ul>
+</li>
+<li>Removed classes and interfaces
+ <ul>
+ <li>Several classes and interfaces were removed from the public API, after
+previously being in deprecated state. See the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report</a> for more information.</p></li>
+ </ul>
+ </li>
+</ul>
+
+
+
+<h3 id="browser" style="margin-top:1.25em;">Browser</h3>
+
+<p>The Browser application adds the following features to support web
+applications:</p>
+
+<ul>
+<li>Support for inline playback of video embedded in HTML5
+<code><video></code> tag. Playback is hardware-accelerated where possible.
+</li>
+<li>Layer support for fixed position elements for all sites (mobile and
+desktop).</li>
+</ul>
+
+
+
+
+
+<h3 id="features">New feature constants</h3>
+
+<p>The platform adds new hardware feature constants that developers can declare
+in their application manifests, to inform external entities such as Google
+Play of the application's requirement for new hardware capabilities supported
+in this version of the platform. Developers declare these and other feature
+constants in <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
+<uses-feature>}</a> manifest elements.
+
+<ul>
+ <li>{@link android.content.pm.PackageManager#FEATURE_USB_ACCESSORY
+android.hardware.usb.accessory} — The application uses the <a href="#usb">USB
+API</a> to communicate with external hardware devices connected over USB and
+function as hosts.</li>
+ <li>{@link android.content.pm.PackageManager#FEATURE_USB_HOST
+android.hardware.usb.host} — The application uses the <a href="#usb">USB API</a>
+to communicate with external hardware devices connected over USB and function as
+devices.</li>
+</ul>
+
+<p>Google Play filters applications based on features declared in <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
+<uses-feature>}</a> manifest elements. For more information about
+declaring features in an application manifest, read <a
+href="{@docRoot}guide/google/play/filters.html">Google Play
+Filters</a>.</p>
+
+
+
+<h3 id="api-diff">API Differences Report</h3>
+
+<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
+Level
+{@sdkPlatformApiLevel}), see the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report</a>.</p>
+
+
+
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
+the framework API. The Android {@sdkPlatformVersion} API
+is assigned an integer identifier —
+<strong>{@sdkPlatformApiLevel}</strong> — that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
+you need compile the application against the Android library that is provided in
+the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you
+might
+also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
+attribute to the <code><uses-sdk></code> element in the application's
+manifest.</p>
+
+<p>For more information, read <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">What is API
+Level?</a></p>
diff --git a/docs/html/about/versions/android-3.2.jd b/docs/html/about/versions/android-3.2.jd
new file mode 100644
index 0000000..02111a0
--- /dev/null
+++ b/docs/html/about/versions/android-3.2.jd
@@ -0,0 +1,556 @@
+page.title=Android 3.2 Platform
+sdk.platform.version=3.2
+sdk.platform.apiLevel=13
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#highlights">Highlights</a></li>
+ <li><a href="#api">API Overview</a></li>
+ <li><a href="#api-level">API Level</a></li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/13/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+</div>
+</div>
+
+
+<p><em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>Android 3.2 is an incremental platform release that adds new
+capabilities for users and developers. The sections below provide an overview
+of the new features and developer APIs.</p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes
+an Android library and system image, as well as a set of emulator skins and
+more. To get started developing or testing against Android {@sdkPlatformVersion},
+use the Android SDK Manager to download the platform into your SDK.</p>
+
+
+
+<h2 id="highlights" style="margin-top:1.5em;">Platform Highlights</h2>
+
+<h3>New user features</h3>
+
+<ul>
+<li><strong>Optimizations for a wider range of tablets</strong>
+
+<p>Android 3.2 includes a variety of optimizations across the system
+to ensure a great user experience on a wider range of tablet devices.</p></li>
+
+<li><strong>Compatibility zoom for fixed-sized apps</strong>
+
+<p>Android 3.2 introduces a new <em>compatibility zoom</em> mode that gives
+users a new way to view fixed-sized apps on larger devices. The new mode provides a
+pixel-scaled alternative to the standard UI stretching for apps that are not
+designed to run on larger screen sizes, such as on tablets. The new mode is
+accessible to users from a menu icon in the system bar, for apps that need
+compatibility support.</p></li>
+
+<li><strong>Media sync from SD card</strong>
+<p>On devices that support an SD card, users can now load media files directly
+from the SD card to apps that use them. A system facility makes the files
+accessible to apps from the system media store.</p></li>
+</ul>
+
+
+<h3>New developer features</h3>
+
+<ul>
+<li><strong>Extended API for managing screens support</strong>
+
+<p>Android 3.2 introduces extensions to the platform's screen support API to
+give developers additional ways to manage application UI across the range of
+Android-powered devices. The API includes new resource qualifiers and new
+manifest attributes that give you more precise control over how your
+apps are displayed on different sizes, rather than relying on generalized
+size categories.</p>
+
+<p>To ensure the best possible display for fixed-sized apps and apps with limited
+support for various screen sizes, the platform also provides a new zoom
+compatibility mode that renders the UI on a smaller screen area, then scales it
+up to fill the space available on the display. For more information about the
+screen support API and the controls it provides, see the sections below. </p></li>
+</ul>
+
+
+<h2 id="api">API Overview</h2>
+
+<h3 id="usb">Screens Support APIs</h3>
+
+<p>Android 3.2 introduces new screens support APIs that give you more
+control over how their applications are displayed across different screen sizes.
+The API builds on the existing screens-support API, including the platform's
+generalized screen density model, but extends it with the ability to precisely
+target specific screen ranges by their dimensions, measured in
+density-independent pixel units (such as 600dp or 720dp wide), rather than
+by their generalized screen sizes (such as large or xlarge)</p>
+
+<p>When designing an application's UI, you can still rely on the platform to
+provide density abstraction, which means that applications do not need to
+compensate for the differences in actual pixel density across devices. You
+can design the application UI according to the amount of horizontal or vertical
+space available. The platform expresses the amount of space available using three new
+characteristics: <em>smallestWidth</em>, <em>width</em>, and
+<em>height</em>.</p>
+
+<ul>
+<li>A screen's <em>smallestWidth</em> is its fundamental minimum size,
+measured in density-independent pixel ("dp") units. Of the screen's height or
+width, it is the shorter of the two. For a screen in portrait orientation, the
+smallestWidth is normally based on its width, while in landscape orientation it is based
+on its height. In all cases, the smallestWidth is derived from a fixed characteristic of the
+screen and the value does not change, regardless of orientation. The smallestWidth
+is important for applications because it represents the shortest possible width
+in which the application UI will need to be drawn, not including screen areas
+reserved by the system.
+</li>
+
+<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
+and portrait. </li>
+
+</ul>
+
+<p>The new screens support API is designed to let you manage application UI
+according to the smallestWidth of the current screen. You can also manage the
+UI according to current width or height, as needed. For those purposes, the API
+provides these tools:</p>
+
+<ul>
+<li>New resource qualifiers for targeting layouts and other resources to a
+minimum smallestWidth, width, or height, and</li>
+<li>New manifest attributes, for specifying the app's maximum
+screen compatibility range</li>
+</ul>
+
+<p>Additionally, applications can still query the system and manage UI and
+resource loading at runtime, as in the previous versions of the platform.</p>
+
+<p>Since the new API lets you target screens more directly through smallestWidth,
+width, and height, it's helpful to understand the typical
+characteristics of the different screen types. The table below provides some
+examples, measured in "dp" units. </p>
+
+<p class="caption"><strong>Table 1.</strong> Typical devices, with density
+and size in dp.</p>
+
+<table>
+<tr>
+<th>Type</th>
+<th>Density (generalized)</th>
+<th>Dimensions (dp)</th>
+<th>smallestWidth (dp)</th>
+</tr>
+<tr>
+<td>Baseline phone</td>
+<td>mdpi</td>
+<td>320x480</td>
+<td>320</td>
+</td>
+<tr>
+<td>Small tablet/large phone</td>
+<td>mdpi</td>
+<td>480x800</td>
+<td>480</td>
+</tr>
+<tr>
+<td>7-inch tablet</td>
+<td>mdpi</td>
+<td>600x1024</td>
+<td>600</td>
+</tr>
+<tr>
+<td>10-inch tablet</td>
+<td>mdpi</td>
+<td>800x1280</td>
+<td>800</td>
+</tr>
+</table>
+
+<p>The sections below provide more information about the new screen qualifiers
+and manifest attributes. For complete information about how to use the screen
+support API, see <a
+href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
+Screens</a>.</p>
+
+<h4>New resource qualifiers for screens support</h4>
+
+<p>The new resource qualifiers in Android 3.2 let you better target your layouts
+for ranges of screen sizes. Using the qualifiers, you can create resource
+configurations designed for a specific minimum smallestWidth, current width, or
+current height, measured in density-independent pixels.</p>
+
+<p>The new qualifiers are:</p>
+<ul>
+<li><code>swNNNdp</code> — Specifies the minimum smallestWidth on which
+the resource should be used, measured in "dp" units. As mentioned above, a
+screen's smallestWidth is constant, regardless of orientation. Examples:
+<code>sw320dp</code>, <code>sw720dp</code>, <code>sw720dp</code>.</li>
+
+<li><code>wNNNdp</code> and <code>hNNNdp</code> — Specifies the minimum
+width or height on which the resource should be used, measured in "dp" units. As
+mentioned above, a screen's width and height are relative to the orientation of
+the screen and change whenever the orientation changes. Examples:
+<code>w320dp</code>, <code>w720dp</code>, <code>h1024dp</code>.</p></li>
+</ul>
+
+<p>You can also create multiple overlapping resource configurations if needed.
+For example, you could tag some resources for use on any screen wider than 480
+dp, others for wider than 600 dp, and others for wider than 720 dp. When
+multiple resource configurations are qualified for a given screen, the system
+selects the configuration that is the closest match. For precise control over
+which resources are loaded on a given screen, you can tag resources with one
+qualifier or combine several new or existing qualifiers.
+
+<p>Based on the typical dimensions listed earlier, here are some examples of how
+you could use the new qualifiers:</p>
+
+<pre class="classic prettyprint">res/layout/main_activity.xml # For phones
+res/layout-sw600dp/main_activity.xml # For 7” tablets
+res/layout-sw720dp/main_activity.xml # For 10” tablets
+res/layout-w600dp/main_activity.xml # Multi-pane when enough width
+res/layout-sw600dp-w720dp/main_activity.xml # For large width</pre>
+
+<p>Older versions of the platform will ignore the new qualifiers, so you can
+mix them as needed to ensure that your app looks great on any device. Here
+are some examples:</p>
+
+<pre class="classic prettyprint">res/layout/main_activity.xml # For phones
+res/layout-xlarge/main_activity.xml # For pre-3.2 tablets
+res/layout-sw600dp/main_activity.xml # For 3.2 and up tablets</pre>
+
+<p>For complete information about how to use the new qualifiers, see <a href="{@docRoot}guide/practices/screens_support.html#NewQualifiers">Using new
+size qualifiers</a>.</p>
+
+<h4>New manifest attributes for screen-size compatibility</h4>
+
+<p>The framework offers a new set of <a
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><code><supports-screens></code></a> manifest attributes that let
+you manage your app's support for different screen sizess.
+Specifically, you can specify the largest and smallest screens on which your app
+is designed to run, as well as the largest screen on which it is designed run
+without needing the system's new <a href="{@docRoot}guide/practices/screen-compat-mode.html">screen
+compatibility mode</a>. Like the resource qualifiers described above, the new
+manifest attributes specify the range of screens that the application supports,
+as specified by the smallestWidth. </p>
+
+<p>The new manifest attributes for screen support are: </p>
+
+<ul>
+<li><code>android:compatibleWidthLimitDp="<em>numDp"</em></code> — This
+attribute lets you specify the maximum smallestWidth on which the application
+can run without needing compatibility mode. If the current screen is larger than
+the value specified, the system displays the application in normal mode but
+allows the user to optionally switch to compatibility mode through a setting in
+the system bar.</li>
+
+<li><code>android:largestWidthLimitDp="<em>numDp</em>"</code> — This
+attribute lets you specify the maximum smallestWidth on which the application
+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:requiresSmallestWidthDp="<em>numDp"</em></code> — 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
+from being installed and run.</li>
+</ul>
+
+<p class="note"><strong>Note:</strong> Google Play does not currently filter
+apps based on any of the attributes above. Support for filtering will be
+added in a later platform release. Applications that require
+filtering based on screen size can use the existing <code><supports-screens></code>
+attributes.</p>
+
+<p>For complete information about how to use the new attributes, see <a href="{@docRoot}guide/practices/screens_support.html#DeclaringScreenSizeSupport">Declaring
+screen size support</a>.</p>
+
+<h4>Screen compatibility mode</h4>
+
+<p>Android 3.2 provides a new screen compatibility mode for applications
+explicitly declaring that they do not support screens as large as the one on
+which they are running. This new "zoom" mode is a pixel-scaled — it
+renders the application in a smaller screen area and then scales the pixels to
+fill the current screen.</p>
+
+<p>By default, the system offers screen compatibility mode as an user option, for apps
+that require it. Users can turn the zoom mode on and off using a control available
+in the system bar. </p>
+
+<p>Because the new screen compatibility mode may not be appropriate for all
+applications, the platform allows the application to disable it using manifest
+attributes. When disabled by the app, the system does not offer "zoom" compatibility
+mode as an option for users when the app is running.</p>
+
+<p class="note"><strong>Note:</strong> For important information about how
+to control compatibility mode in your applications, please review the <a
+href="http://android-developers.blogspot.com/2011/07/new-mode-for-apps-on-large-
+screens.html">New Mode for Apps on Large Screens</a> article on the Android
+Developers Blog. </p>
+
+<h4>New screen density for 720p televisions and similar devices</h4>
+
+<p>To meet the needs of applications running on 720p televisions or similar with
+moderate density screens, Android 3.2 introduces a new generalized density,
+<code>tvdpi</code>, with an approximate dpi of 213. Applications can query for
+the new density in {@link android.util.DisplayMetrics#densityDpi} and can use
+the new <code>tvdpi</code> qualifier to tag resources for televisions and
+similar devices. For example:</p>
+
+<pre class="classic prettyprint">res/drawable-tvdpi/my_icon.png # Bitmap for tv density</pre>
+
+<p>In general, applications should not need to work with this density. For situations
+where output is needed for a 720p screen, the UI elements can be scaled
+automatically by the platform.</p>
+
+
+<h3 id="ui" style="margin-top:1.25em;">UI framework</h3>
+<ul>
+<li>Fragments
+ <ul>
+ <li>New {@link android.app.Fragment.SavedState} class holds the state
+ information retrieved from a fragment instance through
+ {@link android.app.FragmentManager#saveFragmentInstanceState(android.app.Fragment) saveFragmentInstanceState()}.</li>
+ <li>New method {@link android.app.FragmentManager#saveFragmentInstanceState(android.app.Fragment) saveFragmentInstanceState()}
+ saves the current instance state of
+ the given Fragment. The state can be used later when creating a new instance
+ of the Fragment that matches the current state.</li>
+ <li>New method {@link android.app.Fragment#setInitialSavedState(SavedState) setInitialSavedState()}
+ sets the initial saved state for a Fragment when first constructed.</li>
+ <li>New {@link android.app.Fragment#onViewCreated(android.view.View, android.os.Bundle)
+ onViewCreated()} callback method notifies the Fragment that
+ {@link android.app.Fragment#onCreateView(LayoutInflater, ViewGroup, Bundle) onCreateView()}
+ has returned, but before any saved state has been restored in to the View.</li>
+ <li>{@link android.app.Fragment#isDetached()} method determines whether
+ the Fragment has been explicitly detached from the UI.</li>
+ <li>New {@link android.app.FragmentTransaction#attach(android.app.Fragment) attach()}
+ and {@link android.app.FragmentTransaction#detach(android.app.Fragment) detach()}
+ methods let an application re-attach or detach fragments in the UI.</li>
+ <li>A new {@link android.app.FragmentTransaction#setCustomAnimations(int, int, int, int)
+ setCustomAnimations()} overload method lets you set specific animation
+ resources to run for enter/exit operations and specifically when
+ popping the back stack. The existing implementation does not account
+ for the different behavior of fragments when popping the back stack.</li>
+ </ul>
+</li>
+<li>Screen size information in ActivityInfo and ApplicationInfo
+ <ul>
+ <li>{@link android.content.pm.ActivityInfo} adds {@link android.content.pm.ActivityInfo#CONFIG_SCREEN_SIZE}
+ and {@link android.content.pm.ActivityInfo#CONFIG_SMALLEST_SCREEN_SIZE} as bit masks
+ in {@link android.R.attr#configChanges}. The bits indicate whether an Activity can
+ itself handle the screen size and smallest screen size.</li>
+ <li>{@link android.content.pm.ApplicationInfo} adds
+ {@link android.content.pm.ApplicationInfo#largestWidthLimitDp}, {@link android.content.pm.ApplicationInfo#compatibleWidthLimitDp},
+ and {@link android.content.pm.ApplicationInfo#requiresSmallestWidthDp} fields,
+ derived from the corresponding <code><supports-screens></code> attributes
+ in the application manifest file.</li>
+ </ul>
+</li>
+<li>Helpers for getting display size from WindowManager
+ <ul>
+ <li>New methods {@link android.view.Display#getSize(android.graphics.Point)
+ getSize()} and {@link android.view.Display#getRectSize(android.graphics.Rect)
+ getRectSize()} let applications get the raw size of the display.</li>
+ </ul>
+</li>
+<li>New public "holographic" styles
+ <ul>
+ <li>The platform now exposes a variety of public "holographic" styles
+ for text, actionbar widgets and tabs, and more. See
+ {@link android.R.style} for a full list.</li>
+ </ul>
+</li>
+<li>{@link android.app.LocalActivityManager}, {@link android.app.ActivityGroup}, and
+ {@link android.app.LocalActivityManager} are now deprecated
+ <ul>
+ <li>New applications should use Fragments instead of these classes. To
+ continue to run on older versions of the platform, you can use the v4 Support
+ Library (compatibility library), available in the Android SDK. The v4 Support
+ Library provides a version of the Fragment API that is compatible down to
+ Android 1.6 (API level 4).
+ <li>For apps developing against Android 3.0 (API level
+ 11) or higher, tabs are typically presented in the UI using the new
+ {@link android.app.ActionBar#newTab() ActionBar.newTab()} and related APIs
+ for placing tabs within their action bar area.</p></li>
+ </ul>
+</li>
+</ul>
+
+<h3 id="media" style="margin-top:1em;">Media framework</h3>
+<ul>
+ <li>Applications that use the platform's media provider ({@link
+ android.provider.MediaStore}) can now read media data directly from the
+ removeable SD card, where supported by the device. Applications can also
+ interact with the SD card files directly, using the MTP API. </li>
+
+</ul>
+<h3 id="graphics" style="margin-top:1.25em;">Graphics</h3>
+<ul>
+<li>Parcelable utilities in Point and PointF
+ <ul>
+ <li>{@link android.graphics.Point} and {@link android.graphics.PointF}
+ classes now include the {@link android.os.Parcelable} interface and utility methods {@link
+ android.graphics.Point#describeContents()}, {@link
+ android.graphics.Point#readFromParcel(android.os.Parcel) readFromParcel()}, and {@link
+ android.graphics.Point#writeToParcel(android.os.Parcel, int) writeToParcel()}.</li>
+ </ul>
+</li>
+</ul>
+
+
+<h3 id="ime" style="margin-top:1.25em;">IME framework</h3>
+<ul>
+ <li>New {@link android.view.KeyEvent#getModifiers()} method for
+ retrieving the current state of the modifier keys.</li>
+</ul>
+
+
+<h3 id="usb" style="margin-top:1.25em;">USB framework</h3>
+<ul>
+ <li>New {@link
+ android.hardware.usb.UsbDeviceConnection#getRawDescriptors()} method for
+ retrieving the raw USB descriptors for the device. You can use the
+ method to access descriptors not supported directly via the higher
+ level APIs.</li>
+</ul>
+
+
+<h3 id="network" style="margin-top:1.25em;">Network</h3>
+<ul>
+<li>Network type constants
+ <ul>
+ <li>{@link android.net.ConnectivityManager} adds the constants {@link
+ android.net.ConnectivityManager#TYPE_ETHERNET} and {@link
+ android.net.ConnectivityManager#TYPE_BLUETOOTH}.</li>
+ </ul>
+</li>
+</ul>
+
+
+<h3 id="telephony" style="margin-top:1.25em;">Telephony</h3>
+<ul>
+ <li>New {@link android.telephony.TelephonyManager#NETWORK_TYPE_HSPAP} network type constant.</li>
+</ul>
+
+<h3 id="other" style="margin-top:1.25em;">Core utilities</h3>
+<ul>
+<li>Parcelable utilities
+ <ul>
+ <li>New interface {@link android.os.Parcelable.ClassLoaderCreator} allows
+ the application to receive the ClassLoader in which the object is being created.</li>
+ <li>New {@link android.os.ParcelFileDescriptor#adoptFd(int) adoptFd}, {@link
+ android.os.ParcelFileDescriptor#dup(java.io.FileDescriptor) dup()}, and {@link
+ android.os.ParcelFileDescriptor#fromFd(int) fromFd()} for managing
+ {@link android.os.ParcelFileDescriptor} objects.</li>
+ </ul>
+</li>
+<li>Binder and IBinder
+ <ul>
+ <li>New method {@link android.os.Binder#dumpAsync(java.io.FileDescriptor, java.lang.String[]) dumpAsync()}
+ in {@link android.os.Binder} and {@link android.os.IBinder} let applications
+ dump to a specified file, ensuring that the target executes asynchronously.</li>
+ <li>New {@link android.os.IBinder} protocol transaction code {@link
+ android.os.IBinder#TWEET_TRANSACTION} lets applications send a tweet
+ to the target object.</li>
+ </ul>
+</li>
+</ul>
+
+
+
+
+<h3 id="features">New feature constants</h3>
+
+<p>The platform adds new hardware feature constants that you can declare
+in their application manifests, to inform external entities such as Google
+Play of required hardware and software capabilities. You declare these
+and other feature constants in <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
+<uses-feature>}</a> manifest elements.
+
+<p>Google Play filters applications based on their <code><uses-feature></code> attributes, to ensure that they are available only to devices on which their requirements are met. </p>
+
+<ul>
+<li>Feature constants for landscape or portrait requirements
+
+<p>Android 3.2 introduces new feature constants that let applications specify whether they require display in landscape orientation, portrait orientation, or both. Declaring these constants indicates that the application must not be installed on a device that doesn't offer the associated orientation. Conversely, if one or both of the constants are not declared, it indicates that the application does not have a preference for the undeclared orientations and may be installed on a device that doesn't offer them. </p>
+
+<ul>
+ <li>{@link android.content.pm.PackageManager#FEATURE_SCREEN_LANDSCAPE
+android.hardware.screen.landscape} — The application requires display in
+landscape orientation.</li>
+ <li>{@link android.content.pm.PackageManager#FEATURE_SCREEN_PORTRAIT
+android.hardware.screen.portrait} — The application requires display in
+portrait orientation.</li>
+</ul>
+
+<p>A typical application that functions properly in both landscape and portrait orientations would not normally need to declare an orientation requirement. Rather, an application designed primarily for one orientation, such as an app designed for a television, could declare one of the constants to ensure that it isn't available to devices that don't provide that orientation.</p>
+
+<p>If any of activities declared in the manifest request that they run in a specific orientation,
+using the <a href="{@docRoot}guide/topics/manifest/activity-element.html#screen">{@code
+android:screenOrientation}</a> attribute, then this also declares that the application
+requires that orientation.</p>
+
+</li>
+<li>Other feature constants
+
+<ul>
+ <li>{@link android.content.pm.PackageManager#FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT
+android.hardware.faketouch.multitouch.distinct} — The application requires support for emulated mulitouch input with distinct tracking of two or more points.</li>
+
+ <li>{@link android.content.pm.PackageManager#FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND
+android.hardware.faketouch.multitouch.jazzhand} — The application requires support for emulated mulitouch input with distinct tracking of five or more points.</li>
+</ul>
+
+</li>
+</ul>
+
+
+<h3 id="api-diff">API Differences Report</h3>
+
+<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
+Level
+{@sdkPlatformApiLevel}), see the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
+Differences Report</a>.</p>
+
+
+
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
+the framework API. The Android {@sdkPlatformVersion} API
+is assigned an integer identifier —
+<strong>{@sdkPlatformApiLevel}</strong> — that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
+you need compile the application against the Android library that is provided in
+the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you
+might
+also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
+attribute to the <code><uses-sdk></code> element in the application's
+manifest.</p>
+
+<p>For more information, read <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">What is API
+Level?</a></p>
+
+
diff --git a/docs/html/about/versions/android-4.0-highlights.jd b/docs/html/about/versions/android-4.0-highlights.jd
new file mode 100644
index 0000000..9fdb02c
--- /dev/null
+++ b/docs/html/about/versions/android-4.0-highlights.jd
@@ -0,0 +1,1066 @@
+page.title=Ice Cream Sandwich
+
+@jd:body
+
+
+<style type="text/css">
+#jd-content {
+ max-width:1024px;
+}
+#jd-content div.screenshot {
+ float:left;
+ clear:left;
+ padding:15px 30px 15px 0;
+}
+#jd-content div.video {
+ float:right;
+ padding:0 0 40px 60px;
+}
+#jd-content table.columns {
+ margin:0 0 1em 0;
+}
+#jd-content table.columns td {
+ padding:0;
+}
+#jd-content table.columns td+td {
+ padding:0 2em;
+}
+#jd-content table.columns td img {
+ margin:0;
+}
+#jd-content table.columns td+td>*:first-child {
+ margin-top:-2em;
+}
+.green {
+ color:#8db529;
+ font-weight:bold;
+}
+</style>
+
+<p>Welcome to Android 4.0!</p>
+
+<p>Android 4.0 delivers a refined, unified UI for phones and tablets and
+introduces innovative features for users and developers. This document provides
+a glimpse of the many new features and technologies that make Android 4.0
+simple, beautiful, and beyond smart. <!--For technical details about
+new developer APIs described below, see the <a
+href="{@docRoot}about/versions/android-4.0.html">Android 4.0 API Overview</a>
+document.--></p>
+
+<ul>
+ <li><a href="#UserFeatures">Android 4.0 for Users</a></li>
+ <li><a href="#DeveloperApis">Android 4.0 for Developers</a></li>
+</ul>
+
+<h2 id="UserFeatures" style="clear:right">Android 4.0 for Users</h2>
+
+<div style="padding-bottom:0em;">
+<a href="{@docRoot}sdk/images/4.0/home-lg.png" target="_android"><img
+style="margin-left:10px;float:right;xborder:1px solid #ddd;border-radius: 5px;"
+src="{@docRoot}sdk/images/4.0/home.png" alt="" height="300" width="180" /></a>
+<a href="{@docRoot}sdk/images/4.0/lock-lg.png" target="_android"><img
+style="margin-left:20px;float:right;border:1px solid #ddd;border-radius: 5px;"
+src="{@docRoot}sdk/images/4.0/lock.png" alt="" height="300" width="180" /></a>
+</div>
+
+
+<h3 id="simple" style="color:#258AAF">Simple, beautiful, beyond smart</h3>
+
+<p>Android 4.0 builds on the things people love most about Android — easy
+multitasking, rich notifications, customizable home screens, resizable widgets,
+and deep interactivity — and adds powerful new ways of communicating and
+sharing.</p>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Refined, evolved UI</strong></p>
+
+<p>Focused on bringing the power of Android to the surface, Android 4.0 makes
+<strong>common actions more visible</strong> and lets users navigate with
+simple, intuitive gestures. Refined <strong>animations</strong> and feedback
+throughout the system make interactions engaging and interesting. An entirely
+<strong>new typeface</strong> optimized for high-resolution screens improves
+readability and brings a polished, modern feel to the user interface.</p>
+
+<p>Virtual buttons in the System Bar let users navigate instantly to Back, Home,
+and Recent Apps. The <strong>System Bar</strong> and virtual buttons are present
+across all apps, but can be dimmed by applications for full-screen viewing.
+Users can access each application's contextual options in the <strong>Action
+Bar</strong>, displayed at the top (and sometimes also at the bottom) of the
+screen.</p>
+
+<p><strong>Multitasking</strong> is a key strength of Android and it's made even
+easier and more visual on Android 4.0. The Recent Apps button lets users jump
+instantly from one task to another using the list in the System Bar. The list
+pops up to show thumbnail images of apps used recently — tapping a
+thumbnail switches to the app.</p>
+
+<div style="padding-top:0em;">
+<div style="margin-right:.5em;float:left;width:182px;padding-top:.5em;">
+<a href="{@docRoot}sdk/images/4.0/tasks-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/tasks.png" alt="" height="240" width="144" style="border:1px
+solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-bottom:1em;font-size:.9em;padding-right:1em;">The Recent Apps list makes
+multitasking simple.</div>
+<a href="{@docRoot}sdk/images/4.0/lock-camera-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/lock-camera.png" alt="" height="240" width="144"
+style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-bottom:1em;font-size:.9em;padding-right:1.75em;">Jump to the camera or see
+notifications without unlocking.</div>
+<a href="{@docRoot}sdk/images/4.0/contact-call-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/contact-call.png" alt="" height="240" width="144"
+style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
+<!--<a href="{@docRoot}sdk/images/4.0/quick-response-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/quick-responses-new.png" alt="" height="240" width="144"
+style="border:1px solid #ddd;border-radius: 6px;" /></a>-->
+<div style="padding-bottom:.5em;font-size:.9em;padding-right:1.75em;">For incoming calls, you can
+respond instantly by text.</div>
+</div>
+</div>
+
+<p>Rich and interactive <strong>notifications</strong> let users keep in
+constant touch with incoming messages, play music tracks, see real-time updates
+from apps, and much more. On smaller-screen devices, notifications appear at the
+top of the screen, while on larger-screen devices they appear in the System
+Bar.</p>
+
+<div style="padding-top:0em;">
+<div
+style="float:right;margin-left:20px;margin-top:.5em;margin-bottom:0;padding-bottom:
+0 ; width:326px">
+<a href="{@docRoot}sdk/images/4.0/allapps-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/allapps.png" alt="" height="240" width="144" style="border:1px
+solid #ddd;border-radius: 6px;" /></a>
+<a href="{@docRoot}sdk/images/4.0/calendar-widget-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/calendar-widget.png" alt="" height="240" width="144"
+style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure
+3.</strong>-->The All Apps launcher (left) and resizable widgets (right) give you apps and rich
+content from the home screen.</div>
+</div>
+</div>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Home screen folders and
+favorites tray</strong></p>
+
+<p>New home screen <strong>folders</strong> offer a new way for users to group
+their apps and shortcuts logically, just by dragging one onto another. Also,
+in All Apps launcher, users can now simply <strong>drag an app</strong> to get
+information about it or immediately uninstall it, or disable a pre-installed app.</p>
+
+<p>On smaller-screen devices, the home screen now includes a customizable
+<strong>favorites tray</strong> visible from all home screens. Users can drag
+apps, shortcuts, folders, and other priority items in or out of the favorites
+tray for instant access from any home screen.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Resizable
+widgets</strong></p>
+
+<p>Home screens in Android 4.0 are designed to be content-rich and customizable.
+Users can do much more than add shortcuts — they can embed live
+application content directly through interactive <strong>widgets</strong>.
+Widgets let users check email, flip through a calendar, play music, check social
+streams, and more — right from the home screen, without having to launch
+apps. Widgets are resizable, so users can expand them to show more content or
+shrink them to save space.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>New lock screen
+actions</strong></p>
+
+<p>The lock screens now let users do more without unlocking. From the slide lock
+screen, users can <strong>jump directly to the camera</strong> for a picture or
+<strong>pull down the notifications window</strong> to check for messages. When
+listening to music, users can even manage music tracks and see album art. </p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Quick responses for
+incoming calls</strong></p>
+
+<p>When an incoming call arrives, users can now quickly <strong>respond by text
+message</strong>, without needing to pick up the call or unlock the device. On
+the incoming call screen, users simply slide a control to see a list of text
+responses and then tap to send and end the call. Users can add their own
+responses and manage the list from the Settings app.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Swipe to dismiss
+notifications, tasks, and browser tabs</strong></p>
+
+<p>Android 4.0 makes managing notifications, recent apps, and browser tabs even
+easier. Users can now dismiss individual notifications, apps from the Recent
+Apps list, and browser tabs with a simple swipe of a finger. </p>
+
+<div style="padding-top:0em;">
+<div
+style="float:right;margin-left:20px;margin-top:1.5em;margin-bottom:0;padding-bottom
+: 0 ; width:200px">
+<a href="{@docRoot}sdk/images/4.0/text-replace-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/text-replace.png" alt="" width="190" style="border:1px solid
+#ddd;border-radius: 6px;" /></a>
+<div style="padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure
+3.</strong>-->A spell-checker lets you find errors and fix them faster. </div>
+<a href="{@docRoot}sdk/images/4.0/tts-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/tts.png" alt="" width="190" style="border:1px solid
+#ddd;border-radius: 6px;" /></a>
+<div style="padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em">A powerful voice input
+engine lets you dictate continously.</div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Improved text input and
+spell-checking</strong></p>
+
+<p>The soft keyboard in Android 4.0 makes text input even faster and more
+accurate. Error correction and word suggestion are improved through a new set of
+default dictionaries and more accurate heuristics for handling cases such as
+double-typed characters, skipped letters, and omitted spaces. Word suggestion
+is also improved and the suggestion strip is simplified to show only three
+words at a time.</p>
+
+<p>To fix misspelled words more easily, Android 4.0 adds a
+<strong>spell-checker</strong> that locates and underlines errors and suggests
+replacement words. With one tap, users can choose from multiple spelling
+suggestions, delete a word, or add it to the dictionary. Users can even tap to
+see replacement suggestions for words that are spelled correctly. For
+specialized features or additional languages, users can now download and install
+third-party dictionaries, spell-checkers, and other text services.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Powerful voice input
+engine</strong></p>
+
+<p>Android 4.0 introduces a powerful new voice input engine that offers a
+continuous "open microphone" experience and streaming voice recognition. The new
+voice input engine lets users dictate the text they want, for as long as they
+want, using the language they want. Users can <strong>speak continously</strong> for a prolonged
+time, even pausing for intervals if needed, and dictate punctuation to create
+correct sentences. As the voice input engine enters text, it underlines possible
+dictation errors in gray. After dictating, users can tap the underlined words to
+quickly replace them from a list of suggestions.</p>
+
+<div style="padding-top:0em;">
+<div style="margsin-right:.8em;float:left;width:350px;padding-top:1em;">
+<a href="{@docRoot}sdk/images/4.0/usage-all-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/usage-all.png" alt="" height="240" width="144" style="border:1px
+solid #ddd;border-radius: 6px;" /></a>
+<a href="{@docRoot}sdk/images/4.0/usage-maps-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/usage-maps.png" alt="" height="240" width="144" style="border:1px
+solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-bottom:1em;font-size:.9em;padding-right:1.75em;"><!--<strong>Figure
+3.</strong>--> Data usage controls let you monitor total usage by network type and application and
+then set limits if needed.</div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Control over network
+data</strong></p>
+
+<p>Mobile devices can make extensive use of network data for streaming content,
+synchronizing data, downloading apps, and more. To meet the needs of users with
+<strong>tiered or metered data plans</strong>, Android 4.0 adds new controls for
+managing network data usage.</p>
+
+<p>In the Settings app, colorful charts show the total data usage on each
+network type (mobile or Wi-Fi), as well as amount of data used by each running
+application. Based on their data plans, users can optionally set warning levels
+or hard limits on data usage or disable mobile data altogether. Users can also
+manage the background data used by individual applications as needed.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Designed for
+accessibility</strong></p>
+
+<p>A variety of new features greatly enhance the accessibility of Android 4.0
+for blind or visually impaired users. Most important is a new
+<strong>explore-by-touch mode</strong> that lets users navigate without having
+to see the screen. Touching the screen once triggers audible feedback that
+identifies the UI component below; a second touch in the same component
+activates it with a full touch event. The new mode is especially important to
+support users on new devices that use virtual buttons in the System Bar, rather
+than dedicated hardware buttons or trackballs. Also, standard apps are updated
+to offer an improved accessibility experience. The <strong>Browser</strong>
+supports a script-based screen reader for reading favorite web content and
+navigating sites. For improved readability, users can also increase the default
+font size used across the system.</p>
+
+<p>The accessibility experience begins at first setup — a simple
+<strong>touch gesture</strong> during setup (clockwise square from upper left)
+activates all accessibility features and loads a setup tutorial. Once
+accessibility features are active, everything visible on the screen can be
+spoken aloud by the standard screen reader.</p>
+
+
+<h3 id="comms" style="color:#258AAF">Communication and sharing</h3>
+
+<div style="padding-top:0em;">
+<div
+style="float:right;margin-left:20px;margin-top:1.5em;margin-bottom:0;padding-bottom
+: 0 ; width:490px">
+<!--<img src="{@docRoot}sdk/images/4.0/contact-call.png" alt="" height="240" width="144"
+style="border:1px solid #ddd;border-radius: 6px;" />-->
+<a href="{@docRoot}sdk/images/4.0/contact-faves-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/contact-faves.png" alt="" height="240" width="144"
+style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
+<a href="{@docRoot}sdk/images/4.0/contact-connect-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/contact-connect.png" alt="" height="240" width="144"
+style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
+<a href="{@docRoot}sdk/images/4.0/contact-email-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/contact-email.png" alt="" height="240" width="144"
+style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
+
+<div style="padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure
+3.</strong>-->Contacts and profiles are integrated across apps and social networks, for a
+consistent, personal experience everywhere — from incoming calls to emails.</div>
+</div>
+</div>
+
+<p>Designed for the way people live, Android 4.0 integrates rich social
+communication and sharing touchpoints across the system, making it easy to talk,
+email, text, and share.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>People and
+profiles</strong></p>
+
+<p>Throughout the system, a user’s social groups, profiles, and contacts are
+linked together and integrated for easy accessibility. At the center is a new
+<strong>People app</strong> that offers richer profile information, including a
+large profile picture, phone numbers, addresses and accounts, status updates,
+events, stream items, and a new button for connecting on integrated social networks. </p>
+
+<p>The user's own contact information is stored in a new <strong>"Me"
+profile</strong>, allowing easier sharing with apps and people. All of the
+user's integrated contacts are displayed in an easy to manage list, including
+controls over which contacts are shown from any integrated account or social
+network. Wherever the user navigates across the system, tapping a profile photo
+displays Quick Contacts, with large profile pictures, shortcuts to phone numbers,
+text messaging, and more. </p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Unified calendar, visual
+voicemail</strong></p>
+
+<p>To help organize appointments and events, an updated <strong>Calendar
+app</strong> brings together personal, work, school, and social agendas. With
+user permission, other applications can contribute events to the calendar and
+manage reminders, for an integrated view across multiple calendar providers. The
+app is redesigned to let users manage events more easily. Calendars are
+color-coded and users can <strong>swipe left or right</strong> to change dates
+and pinch to zoom in or out agendas. </p>
+
+<p>In the phone app, a new <strong>visual voicemail</strong> features integrates
+incoming messages, voice transcriptions, and audio files from one or more
+providers. Third-party applications can integrate with the Phone app to add
+their own voice messages, transcriptions, and more to the visual voicemail
+inbox. </p>
+
+<div style="padding-top:0em;">
+<div style="margin-right:0em;float:left;width:282px;padding-top:1em;">
+<a href="{@docRoot}sdk/images/4.0/camera-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/camera.png" alt="" width="240" height="144" style="border:1px
+solid #ddd;border-radius: 6px;" /></a>
+<a href="{@docRoot}sdk/images/4.0/gallery-edit-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/gallery-edit.png" alt="" width="240" height="144"
+style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<a href="{@docRoot}sdk/images/4.0/gallery-share-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/gallery-share.png" alt="" width="240" height="144"
+style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-bottom:1em;font-size:.9em;padding-right:2.75em;">Capture the picture you want,
+edit, and share instantly. </div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Rich and versatile camera
+capabilities</strong></p>
+
+<p>The Camera app includes many new features that let users capture special moments
+with great photos and videos. After capturing images, they can edit and share
+them easily with friends. </p>
+
+<p>When taking pictures, <strong>continuous focus</strong>, <strong>zero shutter
+lag exposure</strong>, and decreased shot-to-shot speed help capture clear,
+precise images. <strong>Stabilized image zoom</strong> lets users compose photos
+and video in the way they want, including while video is recording. For new
+flexibility and convenience while shooting video, users can now take
+<strong>snapshots at full video resolution</strong> just by tapping the screen
+as video continues to record.</p>
+
+<p>To make it easier to take great pictures of people, built-in <strong>face
+detection</strong> locates faces in the frame and automatically sets focus. For
+more control, users can <strong>tap to focus</strong> anywhere in the preview
+image. </p>
+
+<p>For capturing larger scenes, the Camera introduces a <strong>single-motion
+panorama</strong> mode. In this mode, the user starts an exposure and then
+slowly turns the Camera to encompass as wide a perspective as needed. The Camera
+assembles the full range of continuous imagery into a single panoramic
+photo.</p>
+
+<p>After taking a picture or video, users can quickly share it by email, text
+message, bluetooth, social networks, and more, just by tapping the thumbnail in
+the camera controls. </p>
+
+
+<div style="padding-top:0em;">
+<div
+style="float:right;margin-left:20px;padding-top:1em;margin-bottom:1em;padding-
+bottom : 0 ;width:160px">
+<img src="{@docRoot}sdk/images/4.0/gallery-widget.png" alt="" width="144" style="border:1px solid
+#ddd;border-radius: 6px;" />
+<div style="padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em">A Photo Gallery widget
+on the home screen.</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Redesigned Gallery app
+with photo editor</strong></p>
+
+<p>The Gallery app now makes it easier to manage, show, and share photos and
+videos. For managing collections, a <strong>redesigned album layout</strong>
+shows many more albums and offers larger thumbnails. There are many ways to sort
+albums, including by time, location, people, and tags. To help pictures look
+their best, the Gallery now includes a powerful <strong>photo editor</strong>.
+Users can crop and rotate pictures, set levels, remove red eyes, add effects,
+and much more. After retouching, users can select one or multiple pictures or
+videos to share instantly over email, text messaging, bluetooth, social
+networks, or other apps.</p>
+
+<p>An improved <strong>Picture Gallery widget</strong> lets users look at
+pictures directly on their home screen. The widget can display pictures from a
+selected album, shuffle pictures from all albums, or show a single image. After
+adding the widget to the home screen, users can flick through the photo stacks
+to locate the image they want, then tap to load it in Gallery. </p>
+
+<div style="padding-top:0em;clear:right;">
+<div
+style="float:right;margin-left:20px;padding-top:1em;margin-bottom:1em;padding-
+bottom : 0 ;width:320px">
+<img src="{@docRoot}sdk/images/4.0/live-effects.png" alt="" width="297" style="border:1px solid
+#ddd;border-radius: 6px;" />
+<div style="padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em">Live Effects let you
+change backgrounds and use Silly Faces during video.</div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Live Effects for transforming
+video</strong></p>
+
+<p>Live Effects is a collection of graphical transformations that add interest
+and fun to videos captured in the Camera app. For example, users can
+<strong>change the background</strong> behind them to any stock or custom image,
+for just the right setting when shooting videeo. Also available for video is
+Silly Faces, a set of morphing effects that use state-of-the-art face
+recognition and GPU filters to transform facial features. For example, you can
+use effects such as small eyes, big mouth, big nose, face squeeze, and more.
+Outside of the Camera app, Live Effects is available during video chat in the
+Google Talk app.</p>
+
+<div style="padding-top:0em;">
+<div style="margsin-right:.8em;float:left;width:186px;padding-top:1em;">
+<a href="{@docRoot}sdk/images/4.0/screenshot-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/screenshot.png" alt="" height="240" width="144"
+style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"> Snapping a
+screenshot.</div>
+</div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Sharing with screenshots</strong></p>
+
+<p>Users can now share what's on their screens more easily by taking
+screenshots. Hardware buttons let them snap a <strong>screenshot</strong> and
+store it locally. Afterward, they can view, edit, and share the screen shot in
+Gallery or a similar app.</p>
+
+
+<h3 id="cloud" style="color:#258AAF">Cloud-connected experience</h3>
+
+<div style="padding-top:0em;">
+<div
+style="float:right;margin-left:20px;padding-top:1em;margin-bottom:0;padding-bottom:
+0 ; width:326px">
+<a href="{@docRoot}sdk/images/4.0/browser-tabs-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/browser-tabs.png" alt="" height="240" width="144"
+style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<a href="{@docRoot}sdk/images/4.0/browser-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/browser.png" alt="" height="240" width="144" style="border:1px
+solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure
+3.</strong>-->The Browser tabs menu <em>(left)</em> lets you quickly switch browser tabs. The
+options menu <em>(right)</em> gives you new ways to manage your browsing experience.</div>
+<img src="{@docRoot}sdk/images/4.0/bbench.png" alt="" width="310" />
+<div style="padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em">Benchmark comparisons of
+Android Browser.</div>
+</div>
+</div>
+
+<p>Android has always been cloud-connected, letting users browse the web and
+sync photos, apps, games, email, and contacts — wherever they are and
+across all of their devices. Android 4.0 adds new browsing and email
+capabilities to let users take even more with them and keep communication
+organized.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Powerful web
+browsing</strong></p>
+
+<p>The Android Browser offers an experience that’s as rich and convenient as a
+desktop browser. It lets users instantly sync and manage <strong>Google Chrome
+bookmarks</strong> from all of their accounts, jump to their favorite content
+faster, and even save it for reading later in case there's no network
+available.</p>
+
+<p>To get the most out of web content, users can now request full
+<strong>desktop versions</strong> of web sites, rather than their mobile
+versions. Users can set their preference for web sites separately for each
+<strong>browser tab</strong>. For longer content, users can save a copy for
+<strong>offline reading</strong>. To find and open saved pages, users can browse
+a visual list that’s included with browser bookmarks and history. For better
+readability and accessibility, users can increase the browser’s <strong>zoom
+levels</strong> and override the system default <strong>text sizes</strong>.</p>
+
+<p>Across all types of content, the Android Browser offers dramatically improved
+<strong>page rendering performance</strong> through updated versions of the
+WebKit core and the V8 Crankshaft compilation engine for JavaScript. In
+benchmarks run on a Nexus S device, the Android 4.0 browser showed an
+improvement of nearly 220% over the Android 2.3 browser in the V8 Benchmark
+Suite and more than 35% in the SunSpider 9.1 JavaScript Benchmark. When run on a
+Galaxy Nexus device, the Android 4.0 browser showed improvement of nearly 550%
+in the V8 benchmark and nearly 70% in the SunSpider benchmark.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Improved
+email</strong></p>
+
+<p>In Android 4.0, email is easier to send, read, and manage. For composing
+email, <strong>improved auto-completion</strong> of recipients helps with
+finding and adding frequent contacts more quickly. For easier input of frequent
+text, users can now create <strong>quick responses</strong> and store them in
+the app, then enter them from a convenient menu when composing. When replying to
+a message, users can now toggle the message to Reply All and Forward without
+changing screens.</p>
+
+<p>For easier browsing across accounts and labels, the app adds an
+<strong>integrated menu</strong> of accounts and recent labels. To help users
+locate and organize IMAP and Exchange email, the Email app now supports
+<strong>nested mail subfolders</strong>, each with synchronization rules. Users
+can also search across folders on the server, for faster results. </p>
+
+<p>For <strong>enterprises</strong>, the Email app supports EAS v14. It supports
+EAS certificate authentication, provides ABQ strings for device type and mode,
+and allows automatic sync to be disabled while roaming. Administrators can also
+limit attachment size or disable attachments.</p>
+
+<p>For keeping track of incoming email more easily, a <strong>resizable Email
+widget</strong> lets users flick through recent email right from the home
+screen, then jump into the Email app to compose or reply.</p>
+
+
+<div style="padding-top:0em;">
+<div style="margsin-right:.8em;float:left;width:186px;padding-top:1em;">
+<a href="{@docRoot}sdk/images/4.0/beam-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/beam.png" alt="" height="240" width="144" style="border:1px solid
+#ddd;border-radius: 6px;" /></a>
+<div
+style="padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em;padding-right:1.5em;">Android
+Beam lets users share what they are using with a single tap.</div>
+</div>
+</div>
+
+<h3 id="innovation" style="color:#258AAF">Innovation</h3>
+
+<p>Android is continously driving innovation forward, pushing the boundaries of
+communication and sharing with new capabilities and interactions.</p>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Android Beam for
+NFC-based sharing</strong></p>
+
+<p>Android Beam is an innovative, convenient feature for sharing across two
+NFC-enabled devices, It lets people instantly exchange favorite apps, contacts,
+music, videos — almost anything. It’s incredibly simple and convenient to
+use — there’s no menu to open, application to launch, or pairing needed.
+Just touch one Android-powered phone to another, then tap to send.</p>
+
+<p>For sharing apps, Android Beam pushes a link to the app's details page in
+Google Play. On the other device, the Google Play client app launches and loads the
+details page, for easy downloading of the app. Individual apps can build on
+Android Beam to add other types of interactions, such as passing game scores,
+initiating a multiplayer game or chat, and more.</p>
+
+<div style="padding-top:0em;">
+<div
+style="float:right;margin-left:20px;margin-top:.5em;margin-bottom:0;padding-bottom:
+0 ; width:160px">
+<a href="{@docRoot}sdk/images/4.0/face-unlock-lg.png" target="_android">
+<img src="{@docRoot}sdk/images/4.0/face-unlock.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
+<div style="padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em">Face recognition lets you
+unlock your phone with your face.</div>
+</div>
+</div>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Face Unlock</strong></p>
+
+<p>Android 4.0 introduces a completely new approach to securing a device, making
+each person's device even more personal — Face Unlock is a new screen-lock
+option that lets users unlock their devices with their faces. It takes advantage
+of the device front-facing camera and state-of-the-art facial recognition
+technology to register a face during setup and then to recognize it again when
+unlocking the device. Users just hold their devices in front of their faces to
+unlock, or use a backup PIN or pattern. </p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Wi-Fi Direct and Bluetooth HDP</strong></p>
+
+<p>Support for <strong>Wi-Fi Direct</strong> lets users connect directly to
+nearby peer devices over Wi-Fi, for more reliable, higher-speed communication.
+No internet connection or tethering is needed. Through third-party apps, users
+can connect to compatible devices to take advantage of new features such as
+instant sharing of files, photos, or other media; streaming video or audio from
+another device; or connecting to compatible printers or other devices.</p>
+
+<p>Android 4.0 also introduces built-in support for connecting to <strong>Bluetooth Health Device Profile (HDP)</strong> devices. With support from third-party apps, users can connect to wireless medical devices and sensors in hospitals, fitness centers, homes, and elsewhere.</p>
+
+
+<h2 id="DeveloperApis" style="clear:right">New Developer Features</h2>
+
+<!-- <ul>
+<li><a href="#ui-dev">Unified UI framework for phones, tablets, and more</a></li>
+<li><a href="#communication-dev">Communication and sharing</a></li>
+<li><a href="#media-dev">New media capabilities</a></li>
+<li><a href="#connectivity-dev">New types of connectivity</a></li>
+<li><a href="#uicomp-dev">New UI components and capabilities</a></li>
+<li><a href="input-dev">New input types and text services</a></li>
+<li><a href="#accessibility-dev">Enhanced accessibility APIs</a></li>
+<li><a href="#data-dev">Efficient network usage</a></li>
+<li><a href="#security-dev">Security for apps and content</a></li>
+<li><a href="#enterprise-dev">Enhancements for Enterprise</a></li>
+</ul>-->
+
+<h3 id="ui-dev">Unified UI framework for phones, tablets, and more</h3>
+
+<p>Android 4.0 brings a unified UI framework that lets developers create
+elegant, innovative apps for phones, tablets, and more. It includes all of the
+familiar Android 3.x interface elements and APIs — fragments, content
+loaders, Action Bar, rich notifications, resizable home screen widgets, and more
+— as well as new elements and APIs.</p>
+
+<p>For developers, the unified UI framework in Android 4.0 means new UI tools,
+consistent design practices, simplified code and resources, and streamlined
+development across the range of Android-powered devices.</p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <h3>Key Honeycomb developer features, <br>now for phones too</h3>
+
+<p>Core UI</p>
+<ul>
+<li>Fragments and content loaders</li>
+<li>Resizeable home screen widgets</li>
+<li>Rich notifications</li>
+<li>Multi-selection, drag-drop, clipboard</li>
+<li>Improved screen-support API</li>
+<li>Hardware-accelerated 2D graphics</li>
+</ul>
+
+<p>Graphics and animation</p>
+<ul>
+<li>Property-based animation</li>
+<li>Renderscript 3D graphics</li>
+</ul>
+
+<p>Media and connectivity</p>
+<ul>
+<li>HTTP Live streaming</li>
+<li>Bluetooth A2DP and HSP devices</li>
+<li>Support for RTP</li>
+<li>MTP/PTP file transfer</li>
+<li>DRM framework</li>
+<li>Input from keyboard, mouse, gamepad, joystick</li>
+</ul>
+
+<p>Enterprise</p>
+<ul>
+<li>Full device encryption</li>
+<li>DPM policies for encrypted storage and passwords</li>
+</ul>
+</div>
+</div>
+
+<h3 id="communication-dev">Communication and sharing</h3>
+
+<p>Android 4.0 extends social and sharing features to any application on the
+device. Applications can integrate contacts, profile data, stream items,
+and calendar events from any of the user’s activities or social networks.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Social API</strong></p>
+
+<p>A shared social provider and API provide a new unified store for contacts,
+profile data, stream items, and photos. Any app or social network with user
+permission can contribute raw contacts and make them accessible to other apps
+and networks. Applications with user permission can also read profile data from
+the provider and display it in their applications.</p>
+
+<p>The social API lets applications store standard contact data as well as new
+types of content for any given contact, including large profile photos, stream
+items, and recent activity feedback. Recent activity feedback is a standard way for
+applications to “tag” a contact with common activity, such as when the user
+calls the contact or sends an email or SMS message. The social provider uses the
+recent activity feedback as a new signal in ranking, such as for name
+auto-complete, to keep the most relevant contacts ranked closest to the top.</p>
+
+<p>Applications can also let users set up a social connection to a contact from
+the People app. When the user touches Add Connection in a contact, the app
+sends a public intent that other apps can handle, displaying any UI needed
+to create the social connection.</p>
+
+<p>Building on the social API, developers can add powerful new interactions that
+span multiple social networks and contacts sources.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Calendar API</strong></p>
+
+<p>A shared calendar content provider and framework API make it easier for
+developers to add calendar services to their apps.</p>
+
+<p>With user permission, any application can add events to the shared database
+and manage dates, attendees, alerts, and reminders. Applications can also read
+entries from the database, including events contributed by other applications,
+and handle the display of event alerts and reminders. Using the calendar
+provider, applications can take advantage of event data sourced from a variety
+of apps and protocols, to offer innovative ways of viewing and managing a user’s
+events. Apps can also use calendar data to improve the relevance of their
+other content.</p>
+
+<p>For lighter-weight access to calendar services, the Calendar app defines a
+set of public Intents for creating, viewing, and editing events. Rather than
+needing to implement a calendar UI and integrate directly with the calendar
+provider, applications can simply broadcast calendar Intents. When the Calendar
+app receives the Intents, it launches the appropriate UI and stores any event
+data entered. Using calendar Intents, for example, apps can let users add events
+directly from lists, dialogs, or home screen widgets, such as for making
+restaurant reservations or booking time with friends.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Visual voicemail
+API</strong></p>
+
+<p>A shared Voicemail provider and API allow developers to build applications
+that contribute to a unified voicemail store. Voicemails are displayed and
+played in the call log tab of the platform’s Phone app.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Android Beam</strong></p>
+
+<p>Android Beam is an NFC-based feature that lets users instantly share
+information about the apps they are using, just by touching two NFC-enabled
+phones together. When the devices are in range — within a few centimeters
+— the system sets up an NFC connection and displays a sharing UI. To share
+whatever they are viewing with the other device, users just touch the screen.
+</p>
+
+<p>For developers, Android Beam is a new way of triggering almost any type of
+proximity-based interaction. For example, it can let users instantly exchange
+contacts, set up multiplayer gaming, join a chat or video call, share a photo or
+video, and more. The system provides the low-level NFC support and the sharing
+UI, while the foreground app provides lightweight data to transfer to the other
+device. Developers have complete control over the data that is shared and how it
+is handled, so almost any interaction is possible. For larger payloads,
+developers can even use Android Beam to initiate a connection and transfer the
+data over Bluetooth, without the need for user-visible pairing.</p>
+
+<p>Even if developers do not add custom interactions based on Android Beam they
+can still benefit from it being deeply integrated into Android. By default the
+system shares the app’s Google Play URL, so it’s easy for the user to
+download or purchase the app right away.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Modular sharing
+widget</strong></p>
+
+<p>The UI framework includes a new widget, ShareActionProvider, that lets
+developers quickly embed standard share functionality and UI in the Action Bar
+of their applications. Developers simply add ShareActionProvider to the menu and
+set an intent that describes the desired sharing action. The system handles the
+rest, building up the list of applications that can handle the share intent and
+dispatching the intent when the user chooses from the menu.</p>
+
+
+<h3 id="media-dev">New media capabilities</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Low-level streaming
+multimedia</strong></p>
+
+<p>Android 4.0 provides a direct, efficient path for low-level streaming
+multimedia. The new path is ideal for applications that need to maintain
+complete control over media data before passing it to the platform for
+presentation. For example, media applications can now retrieve data from any
+source, apply proprietary encryption/decryption, and then send the data to the
+platform for display.</p>
+
+<p>Applications can now send processed data to the platform as a multiplexed
+stream of audio/video content in MPEG-2 transport stream format. The platform
+de-muxes, decodes, and renders the content. The audio track is rendered to the
+active audio device, while the video track is rendered to either a Surface or a
+SurfaceTexture. When rendering to a SurfaceTexture, the application can apply
+subsequent graphics effects to each frame using OpenGL.</p>
+
+<p>To support this low-level streaming, the platform introduces a new native API
+based on <a href="http://www.khronos.org/openmax/al/" target="_top">Khronos
+OpenMAX AL 1.0.1</a>. The API is implemented on the same underlying services as
+the platform’s existing OpenSL ES API, so developers can make use of both APIs
+together if needed. Tools support for low-level streaming multimedia will be
+available in an upcoming release of the Android NDK.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>New camera
+capabilities</strong></p>
+
+<p>Developers can take advantage of a variety of new camera features in Android
+4.0. ZSL exposure, continuous focus, and image zoom let apps capture better
+still and video images, including during video capture. Apps can even capture
+full-resolution snapshots while shooting video. Apps can now set custom metering
+regions in a camera preview, then manage white balance and exposure dynamically
+for those regions. For easier focusing and image processing, a face-detection
+service identifies and tracks faces in a preview and returns their screen
+coordinates.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Media effects for
+transforming images and video</strong></p>
+
+<p>A set of high-performance transformation filters let developers apply rich
+effects to any image passed as an OpenGL ES 2.0 texture. Developers can adjust
+color levels and brightness, change backgrounds, sharpen, crop, rotate, add lens
+distortion, and apply other effects. The transformations are processed by the
+GPU, so they are fast enough for processing image frames loaded from disk,
+camera, or video stream.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Audio remote
+controls</strong></p>
+
+<p>Android 4.0 adds a new audio remote control API that lets media applications
+integrate with playback controls that are displayed in a remote view. Media
+applications can integrate with a remote music playback control that’s built
+into in the platform’s lock screen, allowing users to control song selection and
+playback without having to unlock and navigate to the music app.</p>
+
+<p>Using the audio remote control API, any music or media app can register to
+receive media button events from the remote control and then manage play state
+accordingly. The application can also supply metadata to the remote control,
+such as album art or image, play state, track number and description, duration,
+genre, and more.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>New media codecs and
+containers</strong></p>
+
+<p>Android 4.0 adds support for additional media types and containers to give
+developers access to the formats they need. For high-quality compressed images,
+the media framework adds support for WebP content. For video, the framework now
+supports streaming VP8 content. For streaming multimedia, the framework supports
+HTTP Live streaming protocol version 3 and encoding of ADTS-contained AAC
+content. Additionally, developers can now use Matroska containers for Vorbis and
+VP8 content.</p>
+
+
+<h3 id="connectivity-dev">New types of connectivity</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Wi-Fi Direct</strong></p>
+
+<p>Developers can use a framework API to discover and connect directly to nearby
+devices over a high-performance, secure Wi-Fi Direct connection. No internet
+connection or hotspot is needed.</p>
+
+<p>Wi-Fi Direct opens new opportunities for developers to add innovative
+features to their applications. Applications can use Wi-Fi Direct to share
+files, photos, or other media between devices or between a desktop computer and
+an Android-powered device. Applications could also use Wi-Fi Direct to stream
+media content from a peer device such as a digital television or audio player,
+connect a group of users for gaming, print files, and more.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Bluetooth Health Device
+Profile (HDP)</strong></p>
+
+<p>Developers can now build powerful medical applications that use Bluetooth to
+communicate with wireless devices and sensors in hospitals, fitness centers,
+homes, and elsewhere. Applications can collect and manage data from HDP source
+devices and transmit it to backend medical applications such as records systems,
+data analysis services, and others.</p>
+
+<p>Using a framework API, applications can use Bluetooth to discover nearby
+devices, establish reliable or streaming data channels, and manage data
+transmission. Applications can supply any IEEE 11073 Manager to retrieve and
+interpret health data from Continua-certified devices such as heart-rate
+monitors, blood meters, thermometers, and scales. </p>
+
+
+<h3 id="uicomp-dev">New UI components and capabilities</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Layout
+enhancements</strong></p>
+
+<p>A new layout, GridLayout, improves the performance of Android applications by
+supporting flatter view hierarchies that are faster to layout and render.
+Because hierarchies are flatter, developers can also manage alignments between
+components that are visually related to each other even when they are not
+logically related, for precise control over application UI. GridLayout is also
+specifically designed to be configured by drag-and-drop design tools such as the
+ADT Plug-in for Eclipse.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>OpenGL ES texture
+views</strong></p>
+
+<p>A new TextureView object lets developers directly integrate OpenGL ES
+textures as rendering targets in a UI hierarchy. The object lets developers
+display and manipulate OpenGL ES rendering just as they would a normal view
+object in the hierarchy, including moving, transforming, and animating the view
+as needed. The TextureView object makes it easy for developers to embed camera
+preview, decoded video, OpenGL game scenes, and more. TextureView can be viewed
+as a more powerful version of the existing SurfaceView object, since it offers
+the same benefits of access to a GL rendering surface, with the added advantage
+of having that surface participate fully in the normal view hierarchy.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Hardware-accelerated 2D
+drawing</strong></p>
+
+<p>All Android-powered devices running Android 4.0 are required to support
+hardware-accelerated 2D drawing. Developers can take advantage of this to add
+great UI effects while maintaining optimal performance on high-resolution
+screens, even on phones. For example, developers can rely on accelerated
+scaling, rotation, and other 2D operations, as well as accelerated UI components
+such as TextureView and compositing modes such as filtering, blending, and
+opacity.</p>
+
+
+<h3 id="input-dev">New input types and text services</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Stylus input, button
+support, hover events</strong></p>
+
+<p>Android 4.0 includes full support for stylus input events, including tilt and
+distance axes, pressure, and related motion event properties. To help
+applications distinguish motion events from different sources, the platform adds
+distinct tool types for stylus, finger, mouse, and eraser. For improved input
+from multi-button pointing devices, the platform now provides distinct primary,
+secondary, and tertiary buttons, as well as back and forward buttons.
+Hover-enter and hover-exit events are also added, for improved navigation and
+accessibility. Developers can build on these new input features to add powerful
+interactions to their apps, such as precise drawing and gesturing, handwriting
+and shape recognition, improved mouse input, and others.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Text services API for
+integrating spelling checkers</strong></p>
+
+<p>Android 4.0 lets applications query available text services such as
+dictionaries and spell checkers for word suggestions, corrections, and similar
+data. The text services are external to the active IME, so developers can create
+and distribute dictionaries and suggestion engines that plug into the platform.
+When an application receives results from a text service — for example,
+word suggestions — it can display them in a dedicated suggestion popup
+window directly inside the text view, rather than relying on the IME to display
+them. </p>
+
+
+<h3 id="accessibility-dev">Enhanced accessibility APIs</h3>
+
+<p>Android 4.0 adds new accessibility features and an enhanced API to let
+developers improve the user experience in their apps, especially on devices that
+don’t have hardware buttons. For accessibility services such as screen readers
+in particular, the platform offers new APIs to query window content, for easier
+navigation, better feedback, and richer user interfaces.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Accessibility
+API</strong></p>
+
+<p>To let applications manage interactions more effectively when accessibility
+features are enabled, the platform adds accessibility events for
+explore-by-touch mode, scrolling, and text selection. For these and other
+events, the platform can attach a new object called an accessibility record that
+provides extra information about the event context.</p>
+
+<p>Using the accessibility record and related APIs, applications can now access
+the view hierarchy associated with an event. Applications can query for key
+properties such as parent and child nodes, available states, supported actions,
+screen position, and more. Applications can also request changes to certain
+properties to help manage focus and selected state. For example, an
+accessibility service could use these new capabilities to add convenient
+features such as screen-search by text. </p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Text-to-speech
+API</strong></p>
+
+<p>A new framework API lets developers write text-to-speech engines and make
+them available to any app requesting TTS capabilities.</p>
+
+
+<h3 id="data-dev">Efficient network usage</h3>
+
+<p>In Android 4.0, users can see how much network data their running apps are
+using. They can also set limits on data usage by network type and disable
+background data usage for specific applications. In this context, developers
+need to design their apps to run efficiently and follow best practices for
+checking the network connection. Android 4.0 provides network APIs to let
+applications meet those goals.</p>
+
+<p>As users move between networks or set limits on network data, the platform
+lets applications query for connection type and availability. Developers can use
+this information to dynamically manage network requests to ensure the best
+experience for users. Developers can also build custom network and data-usage
+options into their apps, then expose them to users directly from Settings by
+means of a new system Intent.</p>
+
+
+<h3 id="security-dev">Security for apps and content</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Secure management of
+credentials</strong></p>
+
+<p>Android 4.0 makes it easier for applications to manage authentication and
+secure sessions. A new keychain API and underlying encrypted storage let
+applications store and retrieve private keys and their corresponding certificate
+chains. Any application can use the keychain API to install and store user
+certificates and CAs securely.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Address Space Layout
+Randomization</strong></p>
+
+<p>Android 4.0 now provides address space layout randomization (ASLR) to help
+protect system and third party applications from exploitation due to
+memory-management issues.</p>
+
+
+<h3 id="enterprise-dev">Enhancements for Enterprise</h3>
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>VPN client
+API</strong></p>
+
+<p>Developers can now build or extend their own VPN solutions on the platform
+using a new VPN API and underlying secure credential storage. With user
+permission, applications can configure addresses and routing rules, process
+outgoing and incoming packets, and establish secure tunnels to a remote server.
+Enterprises can also take advantage of a standard VPN client built into the
+platform that provides access to L2TP and IPSec protocols.</p>
+
+
+<p style="margin-top:1em;margin-bottom:.75em;"><strong>Device policy management
+for camera</strong></p>
+
+<p>The platform adds a new policy control for administrators who manage devices
+using an installed Device Policy Manager. Administrators can now remotely
+disable the camera on a managed device for users working in sensitive
+environments.</p>
+
+
+
+
+
diff --git a/docs/html/about/versions/android-4.0.3.jd b/docs/html/about/versions/android-4.0.3.jd
new file mode 100644
index 0000000..b7d4db3
--- /dev/null
+++ b/docs/html/about/versions/android-4.0.3.jd
@@ -0,0 +1,304 @@
+page.title=Android 4.0.3 Platform
+sdk.platform.version=4.0.3
+sdk.platform.apiLevel=15
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#api">API Overview</a></li>
+ <li><a href="#Honeycomb">Previous APIs</a></li>
+ <li><a href="#api-level">API Level</a></li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/15/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+</div>
+</div>
+
+<p><em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>Android {@sdkPlatformVersion} is an incremental release of the Android 4.x
+(Ice Cream Sandwich) platform family. This release includes new features for
+users and developers, API changes, and various bug fixes.</p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes
+an Android library and system image, as well as a set of emulator skins and
+more. To get started developing or testing against Android {@sdkPlatformVersion},
+use the Android SDK Manager to download the platform into your SDK.</p>
+
+
+<h2 id="api">API Overview</h2>
+
+<p>The sections below provide a technical overview of new APIs in Android 4.0.3.</p>
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ <strong>Table of Contents</strong>
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em;">
+ <ol class="toc" style="margin-left:-1em">
+ <li><a href="#contacts">Social stream API in Contacts Provider</a></li>
+ <li><a href="#calendar">Calendar Provider</a></li>
+ <li><a href="#widgets">Home screen widgets</a></li>
+ <li><a href="#textservices">Spell-checking</a></li>
+ <li><a href="#bluetooth">Bluetooth</a></li>
+ <li><a href="#ui">UI toolkit</a></li>
+ <li><a href="#accessibility">Accessibility</a></li>
+ <li><a href="#tts">Text-to-speech</a></li>
+ <li><a href="#database">Database</a></li>
+ <li><a href="#intents">Intents</a></li>
+ <li><a href="#camera">Camera</a></li>
+ <li><a href="#permissions">Permissions</a></li>
+ </ol>
+ </div>
+</div>
+
+
+
+
+
+<h3 id="contacts">Social stream API in Contacts Provider</h3>
+
+<p>Applications that use social stream data such as status updates and check-ins
+can now sync that data with each of the user’s contacts, providing items in a
+stream along with photos for each.</p>
+
+<p>The database table that contains an individual contact’s social stream is
+defined by {@link android.provider.ContactsContract.StreamItems}, the Uri for
+which is nested within the {@link android.provider.ContactsContract.RawContacts}
+directory to which the stream items belong. Each social stream table includes
+several columns for metadata about each stream item, such as an icon
+representing the source (an avatar), a label for the item, the primary text
+content, comments about the item (such as responses from other people), and
+more. Photos associated with a stream are stored in another table, defined by
+{@link android.provider.ContactsContract.StreamItemPhotos}, which is available
+as a sub-directory of the {@link android.provider.ContactsContract.StreamItems}
+Uri.</p>
+
+<p>See {@link android.provider.ContactsContract.StreamItems} and
+{@link android.provider.ContactsContract.StreamItemPhotos} for more information.</p>
+
+<p>To read or write social stream items for a contact, an application must
+request permission from the user by declaring <code><uses-permission
+android:name="android.permission.READ_SOCIAL_STREAM"></code> and/or <code><uses-permission
+android:name="android.permission.WRITE_SOCIAL_STREAM"></code> in their manifest files.</p>
+
+<h3 id="calendar">Calendar Provider</h4>
+<ul>
+<li>Adds the class {@link android.provider.CalendarContract.Colors} to represent
+a color table in the <a href="{@docRoot}guide/topics/providers/calendar-provider.html">Calendar
+Provider</a>. The class provides fields for accessing
+colors available for a given account. Colors are referenced by
+{@link android.provider.CalendarContract.ColorsColumns#COLOR_KEY COLOR_KEY}
+which must be unique for a given account name/type. These values can only be
+updated by the sync adapter.</li>
+<li>Adds {@link android.provider.CalendarContract.CalendarColumns#ALLOWED_AVAILABILITY ALLOWED_AVAILABILITY}
+and
+{@link android.provider.CalendarContract.CalendarColumns#ALLOWED_ATTENDEE_TYPES ALLOWED_ATTENDEE_TYPES}
+for exchange/sync support.</li>
+<li>Adds {@link android.provider.CalendarContract.AttendeesColumns#TYPE_RESOURCE}
+(such as conference rooms) for attendees and
+{@link android.provider.CalendarContract.EventsColumns#AVAILABILITY_TENTATIVE},
+as well as {@link android.provider.CalendarContract.EventsColumns#EVENT_COLOR_KEY}
+for events.</li>
+</ul>
+
+<h3 id="widgets">Home screen widgets</h3>
+
+<p>Starting from Android 4.0, home screen widgets should no longer include their
+own padding. Instead, the system now automatically adds padding for each widget,
+based the characteristics of the current screen. This leads to a more uniform,
+consistent presentation of widgets in a grid. To assist applications that host
+home screen widgets, the platform provides a new method
+{@link android.appwidget.AppWidgetHostView#getDefaultPaddingForWidget(android.content.Context, android.content.ComponentName, android.graphics.Rect)
+getDefaultPaddingForWidget()}. Applications can call this method to get the
+system-defined padding and account for it when computing the number of cells to
+allocate to the widget.</p>
+
+<h3 id="textservices">Spell-checking</h3>
+
+<ul>
+<li>For apps that accessing spell-checker services, a new {@link
+android.view.textservice.SpellCheckerSession#cancel() cancel()} method cancels
+any pending and running spell-checker tasks in a session.</li>
+
+<li>For spell-checker services, a new suggestions flag,
+{@link android.view.textservice.SuggestionsInfo#RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS},
+lets the services distinguish higher-confidence suggestions from
+lower-confidence ones. For example, a spell-checker could set the flag if an
+input word is not in the user dictionary but has likely suggestions, or not set
+the flag if an input word is not in the dictionary and has suggestions that are
+likely to be less useful.
+
+<p>Apps connected to the spell-checker can use the {@link
+android.view.textservice.SuggestionsInfo#RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS}
+flag in combination with other suggestion attributes, as well as the {@link
+android.view.textservice.SuggestionsInfo#getSuggestionsAttributes()} and {@link
+android.view.textservice.SuggestionsInfo#getSuggestionsCount()} methods, to
+determine whether to mark input words as typos and offer suggestions.</p></li>
+
+<li>A new {@link android.text.style.SuggestionSpan#FLAG_AUTO_CORRECTION} style
+for text spans indicates that auto correction is about to be applied to a
+word/text that the user is typing/composing. This type of suggestion is rendered
+differently, to indicate the auto correction is happening.</li>
+</ul>
+
+<h3 id="bluetooth">Bluetooth</h3>
+<p>New public methods {@link
+android.bluetooth.BluetoothDevice#fetchUuidsWithSdp()} and {@link
+android.bluetooth.BluetoothDevice#getUuids()} let apps determine the features
+(UUIDs) supported by a remote device. In the case of {@link
+android.bluetooth.BluetoothDevice#fetchUuidsWithSdp()}, the system performs a
+service discovery on the remote device to get the UUIDs supported, then
+broadcasts the result in an {@link
+android.bluetooth.BluetoothDevice#ACTION_UUID} intent.</p>
+
+<h3 id="ui">UI toolkit</h3>
+
+<p>New methods {@link android.app.Fragment#setUserVisibleHint(boolean) setUserVisibleHint()} and
+{@link android.app.Fragment#getUserVisibleHint() getUserVisibleHint()} allow a
+fragment to set a hint of whether or not it is currently user-visible. The
+system defers the start of fragments that are not user-visible until the loaders
+for visible fragments have run. The visibility hint is "true" by default.</li>
+</p>
+
+<h3 id="graphics">Graphics</h3>
+
+<ul>
+<li>New method {@link android.graphics.SurfaceTexture#setDefaultBufferSize(int
+width, int height)} in {@link android.graphics.SurfaceTexture} sets the default size of the image
+buffers. This method may be used to set the image size when producing images
+with {@link android.graphics.Canvas} (via {@link
+android.view.Surface#lockCanvas}), or OpenGL ES (via an EGLSurface).</li>
+<li>Adds definitions for the enums of the GL_OES_EGL_image_external OpenGL ES extension —
+{@link android.opengl.GLES11Ext#GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES},
+{@link android.opengl.GLES11Ext#GL_SAMPLER_EXTERNAL_OES},
+{@link android.opengl.GLES11Ext#GL_TEXTURE_BINDING_EXTERNAL_OES}, and
+{@link android.opengl.GLES11Ext#GL_TEXTURE_EXTERNAL_OES}.</li>
+</ul>
+
+<h3 id="accessibility">Accessibility</h3>
+
+<ul>
+<li>Clients of {@link android.widget.RemoteViews} can now use the method {@link
+android.widget.RemoteViews#setContentDescription(int, java.lang.CharSequence)
+setContentDescription()} to set and get the content description of any View in
+the inflated layout.</li>
+
+<li>The methods {@link android.view.accessibility.AccessibilityRecord#getMaxScrollX()},
+{@link android.view.accessibility.AccessibilityRecord#getMaxScrollY()},
+{@link android.view.accessibility.AccessibilityRecord#setMaxScrollX(int) setMaxScrollX()}, and
+{@link android.view.accessibility.AccessibilityRecord#setMaxScrollY(int) setMaxScrollY()}
+allow apps to get and set the maximum scroll offset for an
+{@link android.view.accessibility.AccessibilityRecord} object.</li>
+
+<li>When touch-exploration mode is enabled, a new secure setting
+{@link android.provider.Settings.Secure#ACCESSIBILITY_SPEAK_PASSWORD}
+indicates whether the user requests the IME to speak text entered in password fields, even when
+a headset is not in use. By default, no password text is spoken unless a headset
+is in use.</li>
+</ul>
+
+<h3 id="tts">Text-to-speech</h3>
+
+<ul>
+<li>Adds the new method {@link
+android.speech.tts.TextToSpeech.Engine#getFeatures(java.util.Locale)
+getFeatures()}for querying and enabling network TTS support.
+<li>Adds a new listener class, {@link
+android.speech.tts.UtteranceProgressListener}, that engines can register to
+receive notification of speech-synthesis errors.</li>
+</ul>
+
+<h3 id="database">Database</h3>
+
+<ul>
+<li>A new {@link android.database.CrossProcessCursorWrapper} class lets content
+providers return results for a cross-process query more efficiently. The new
+class is a useful building block for wrapping cursors that will be sent to
+processes remotely. It can also transform normal {@link android.database.Cursor}
+objects into {@link android.database.CrossProcessCursor} objects
+transparently.
+
+<p>The {@link android.database.CrossProcessCursorWrapper} class fixes common
+performance issues and bugs that applications have encountered when
+implementing content providers.</p></li>
+
+<li>The {@link android.database.CursorWindow#CursorWindow(java.lang.String)}
+constructor now takes a name string as input. The system no longer distinguishes
+between local and remote cursor windows, so {@link
+android.database.CursorWindow#CursorWindow(boolean)} is now deprecated.</li>
+</ul>
+
+<h3 id="intents">Intents</h3>
+
+<p>Adds new categories for targeting common types of applications on the
+device, such as {@link android.content.Intent#CATEGORY_APP_BROWSER}, {@link
+android.content.Intent#CATEGORY_APP_CALENDAR}, {@link
+android.content.Intent#CATEGORY_APP_MAPS}, and more.</li>
+
+<h3 id="camera">Camera</h3>
+
+<ul>
+<li>{@link android.media.MediaMetadataRetriever} adds the new constant
+{@link android.media.MediaMetadataRetriever#METADATA_KEY_LOCATION} to let apps
+access retrieve location information for an image or video. </li>
+
+<li>{@link android.media.CamcorderProfile} adds the QVGA (320x240) resolution
+profiles. Quality level is represented by the
+{@link android.media.CamcorderProfile#QUALITY_QVGA}.and
+{@link android.media.CamcorderProfile#QUALITY_TIME_LAPSE_QVGA} constants.</li>
+
+<li>New methods {@link android.hardware.Camera.Parameters#setVideoStabilization(boolean) setVideoStabilization()},
+{@link android.hardware.Camera.Parameters#getVideoStabilization() setVideoStabilization()}, and {@link android.hardware.Camera.Parameters#isVideoStabilizationSupported() isVideoStabilizationSupported()}
+let you check and manage video stabilization for a {@link android.hardware.Camera}.</li>
+</ul>
+
+<h3 id="Permissions">Permissions</h3>
+
+<p>The following are new permissions:</p>
+<ul>
+<li>{@link android.Manifest.permission#READ_SOCIAL_STREAM} and
+{@link android.Manifest.permission#WRITE_SOCIAL_STREAM}: Allow a sync
+adapter to read and write social stream data to a contact in the shared
+Contacts Provider.</li>
+</ul>
+
+
+<div class="special" style="margin-top:2em">
+<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API Level
+{@sdkPlatformApiLevel}), see the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API Differences Report</a>.</p>
+</div>
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android {@sdkPlatformVersion} API is assigned an integer
+identifier—<strong>{@sdkPlatformApiLevel}</strong>—that is stored in the system itself.
+This identifier, called the "API level", allows the system to correctly determine whether an
+application is compatible with the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need compile the
+application against an Android platform that supports API level {@sdkPlatformApiLevel} or
+higher. Depending on your needs, you might also need to add an
+<code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code> attribute to the
+<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a>
+element.</p>
+
+<p>For more information, see the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Levels</a>
+document. </p>
+
diff --git a/docs/html/about/versions/android-4.0.jd b/docs/html/about/versions/android-4.0.jd
new file mode 100644
index 0000000..bea0725
--- /dev/null
+++ b/docs/html/about/versions/android-4.0.jd
@@ -0,0 +1,1829 @@
+page.title=Android 4.0 Platform
+sdk.platform.version=4.0
+sdk.platform.apiLevel=14
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#api">API Overview</a></li>
+ <li><a href="#Honeycomb">Previous APIs</a></li>
+ <li><a href="#api-level">API Level</a></li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/14/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+</div>
+</div>
+
+
+<p><em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
+
+<p>Android 4.0 is a major platform release that adds a variety of new features for users and app
+developers. Besides all the new features and APIs discussed below, Android 4.0 is an important
+platform release because it brings the extensive set of APIs and Holographic themes from Android 3.x
+to smaller screens. As an app developer, you now have a single platform and unified API framework
+that enables you to develop and publish your application with a single APK that provides an
+optimized user experience for handsets, tablets, and more, when running the same version of
+Android—Android 4.0 (API level 14) or greater.</p>
+
+<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
+downloadable component for the Android SDK. The downloadable platform includes
+an Android library and system image, as well as a set of emulator skins and
+more. To get started developing or testing against Android {@sdkPlatformVersion},
+use the Android SDK Manager to download the platform into your SDK.</p>
+
+<h2 id="api">API Overview</h2>
+
+<p>The sections below provide a technical overview of new APIs in Android 4.0.</p>
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ <strong>Table of Contents</strong>
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em;">
+ <ol class="toc" style="margin-left:-1em">
+ <li><a href="#Contacts">Social APIs in Contacts Provider</a></li>
+ <li><a href="#Calendar">Calendar Provider</a></li>
+ <li><a href="#Voicemail">Voicemail Provider</a></li>
+ <li><a href="#Multimedia">Multimedia</a></li>
+ <li><a href="#Camera">Camera</a></li>
+ <li><a href="#AndroidBeam">Android Beam (NDEF Push with NFC)</a></li>
+ <li><a href="#WiFiDirect">Wi-Fi Direct</a></li>
+ <li><a href="#Bluetooth">Bluetooth Health Devices</a></li>
+ <li><a href="#A11y">Accessibility</a></li>
+ <li><a href="#SpellChecker">Spell Checker Services</a></li>
+ <li><a href="#TTS">Text-to-speech Engines</a></li>
+ <li><a href="#NetworkUsage">Network Usage</a></li>
+ <li><a href="#RenderScript">RenderScript</a></li>
+ <li><a href="#Enterprise">Enterprise</a></li>
+ <li><a href="#Sensors">Device Sensors</a></li>
+ <li><a href="#ActionBar">Action Bar</a></li>
+ <li><a href="#UI">User Interface and Views</a></li>
+ <li><a href="#Input">Input Framework</a></li>
+ <li><a href="#Properties">Properties</a></li>
+ <li><a href="#HwAccel">Hardware Acceleration</a></li>
+ <li><a href="#Jni">JNI Changes</a></li>
+ <li><a href="#WebKit">WebKit</a></li>
+ <li><a href="#Permissions">Permissions</a></li>
+ <li><a href="#DeviceFeatures">Device Features</a></li>
+ </ol>
+ </div>
+</div>
+
+
+
+
+
+<h3 id="Contacts">Social APIs in Contacts Provider</h3>
+
+<p>The contact APIs defined by the {@link android.provider.ContactsContract} provider have been
+extended to support new social-oriented features such as a personal profile for the device owner and
+the ability for users to invite individual contacts to social networks that are installed on the
+device.</p>
+
+
+<h4>User Profile</h4>
+
+<p>Android now includes a personal profile that represents the device owner, as defined by the
+{@link android.provider.ContactsContract.Profile} table. Social apps that maintain a user identity
+can contribute to the user's profile data by creating a new {@link
+android.provider.ContactsContract.RawContacts} entry within the {@link
+android.provider.ContactsContract.Profile}. That is, raw contacts that represent the device user do
+not belong in the traditional raw contacts table defined by the {@link
+android.provider.ContactsContract.RawContacts} Uri; instead, you must add a profile raw contact in
+the table at {@link android.provider.ContactsContract.Profile#CONTENT_RAW_CONTACTS_URI}. Raw
+contacts in this table are then aggregated into the single user-visible profile labeled "Me".</p>
+
+<p>Adding a new raw contact for the profile requires the {@link
+android.Manifest.permission#WRITE_PROFILE} permission. Likewise, in order to read from the profile
+table, you must request the {@link android.Manifest.permission#READ_PROFILE} permission. However,
+most apps should not need to read the user profile, even when contributing data to the
+profile. Reading the user profile is a sensitive permission and you should expect users to be
+skeptical of apps that request it.</p>
+
+
+<h4>Invite Intent</h4>
+
+<p>The {@link android.provider.ContactsContract.Intents#INVITE_CONTACT} intent action allows an app
+to invoke an action that indicates the user wants to add a contact to a social network. The app
+receiving the app uses it to invite the specified contact to that
+social network. Most apps will be on the receiving-end of this operation. For example, the
+built-in People app invokes the invite intent when the user selects "Add connection" for a specific
+social app that's listed in a person's contact details.</p>
+
+<p>To make your app visible as in the "Add connection" list, your app must provide a sync adapter to
+sync contact information from your social network. You must then indicate to the system that your
+app responds to the {@link android.provider.ContactsContract.Intents#INVITE_CONTACT} intent by
+adding the {@code inviteContactActivity} attribute to your app’s sync configuration file, with a
+fully-qualified name of the activity that the system should start when sending the invite intent.
+The activity that starts can then retrieve the URI for the contact in question from the intent’s
+data and perform the necessary work to invite that contact to the network or add the person to the
+user’s connections.</p>
+
+<p>See the <a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">Sample Sync
+Adapter</a> app for an example (specifically, see the <a
+href="{@docRoot}resources/samples/SampleSyncAdapter/res/xml-v14/contacts.html">contacts.xml</a>
+file).</p>
+
+
+<h4>Large photos</h4>
+
+<p>Android now supports high resolution photos for contacts. Now, when you push a photo into a
+contact record, the system processes it into both a 96x96 thumbnail (as it has previously) and a
+256x256 "display photo" that's stored in a new file-based photo store (the exact dimensions that the
+system chooses may vary in the future). You can add a large photo to a contact by putting a large
+photo in the usual {@link android.provider.ContactsContract.CommonDataKinds.Photo#PHOTO} column of a
+data row, which the system will then process into the appropriate thumbnail and display photo
+records.</p>
+
+
+<h4>Contact Usage Feedback</h4>
+
+<p>The new {@link android.provider.ContactsContract.DataUsageFeedback} APIs allow you to help track
+how often the user uses particular methods of contacting people, such as how often the user uses
+each phone number or e-mail address. This information helps improve the ranking for each contact
+method associated with each person and provide better suggestions for contacting each person.</p>
+
+
+
+
+
+<h3 id="Calendar">Calendar Provider</h3>
+
+<p>The new calendar APIs allow you to read, add, modify and delete calendars, events, attendees,
+reminders and alerts, which are stored in the Calendar Provider.</p>
+
+<p>A variety of apps and widgets can use these APIs to read and modify calendar events. However,
+some of the most compelling use cases are sync adapters that synchronize the user's calendar from
+other calendar services with the Calendar Provider, in order to offer a unified location for all the
+user's events. Google Calendar events, for example, are synchronized with the Calendar Provider by
+the Google Calendar Sync Adapter, allowing these events to be viewed with Android's built-in
+Calendar app.</p>
+
+<p>The data model for calendars and event-related information in the Calendar Provider is
+defined by {@link android.provider.CalendarContract}. All the user’s calendar data is stored in a
+number of tables defined by various subclasses of {@link android.provider.CalendarContract}:</p>
+
+<ul>
+<li>The {@link android.provider.CalendarContract.Calendars} table holds the calendar-specific
+information. Each row in this table contains the details for a single calendar, such as the name,
+color, sync information, and so on.</li>
+
+<li>The {@link android.provider.CalendarContract.Events} table holds event-specific information.
+Each row in this table contains the information for a single event, such as the
+event title, location, start time, end time, and so on. The event can occur one time or recur
+multiple times. Attendees, reminders, and extended properties are stored in separate tables and
+use the event’s {@code _ID} to link them with the event.</li>
+
+<li>The {@link android.provider.CalendarContract.Instances} table holds the start and end time for
+occurrences of an event. Each row in this table represents a single occurrence. For one-time events
+there is a one-to-one mapping of instances to events. For recurring events, multiple rows are
+automatically generated to correspond to the multiple occurrences of that event.</li>
+
+<li>The {@link android.provider.CalendarContract.Attendees} table holds the event attendee or guest
+information. Each row represents a single guest of an event. It specifies the type of guest the
+person is and the person’s response for the event.</li>
+
+<li>The {@link android.provider.CalendarContract.Reminders} table holds the alert/notification data.
+Each row represents a single alert for an event. An event can have multiple reminders. The number of
+reminders per event is specified in {@code MAX_REMINDERS}, which is set by the sync adapter that
+owns the given calendar. Reminders are specified in number-of-minutes before the event is
+scheduled and specify an alarm method such as to use an alert, email, or SMS to remind
+the user.</li>
+
+<li>The {@link android.provider.CalendarContract.ExtendedProperties} table hold opaque data fields
+used by the sync adapter. The provider takes no action with items in this table except to delete
+them when their related events are deleted.</li>
+</ul>
+
+<p>To access a user’s calendar data with the Calendar Provider, your application must request
+the {@link android.Manifest.permission#READ_CALENDAR} permission (for read access) and
+{@link android.Manifest.permission#WRITE_CALENDAR} (for write access).</p>
+
+
+<h4>Event intent</h4>
+
+<p>If all you want to do is add an event to the user’s calendar, you can use an {@link
+android.content.Intent#ACTION_INSERT} intent with the data defined by {@link
+android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI} in order to start an
+activity in the Calendar app that creates new events. Using the intent does not require any
+permission and you can specify event details with the following extras:</p>
+
+<ul>
+ <li>{@link android.provider.CalendarContract.EventsColumns#TITLE Events.TITLE}: Name for the
+event</li>
+ <li>{@link
+android.provider.CalendarContract#EXTRA_EVENT_BEGIN_TIME CalendarContract.EXTRA_EVENT_BEGIN_TIME}:
+Event begin time in milliseconds from the
+epoch</li>
+ <li>{@link
+android.provider.CalendarContract#EXTRA_EVENT_END_TIME CalendarContract.EXTRA_EVENT_END_TIME}: Event
+end time in milliseconds from the epoch</li>
+ <li>{@link android.provider.CalendarContract.EventsColumns#EVENT_LOCATION Events.EVENT_LOCATION}:
+Location of the event</li>
+ <li>{@link android.provider.CalendarContract.EventsColumns#DESCRIPTION Events.DESCRIPTION}: Event
+description</li>
+ <li>{@link android.content.Intent#EXTRA_EMAIL Intent.EXTRA_EMAIL}: Email addresses of those to
+invite</li>
+ <li>{@link android.provider.CalendarContract.EventsColumns#RRULE Events.RRULE}: The recurrence
+rule for the event</li>
+ <li>{@link android.provider.CalendarContract.EventsColumns#ACCESS_LEVEL Events.ACCESS_LEVEL}:
+Whether the event is private or public</li>
+ <li>{@link android.provider.CalendarContract.EventsColumns#AVAILABILITY Events.AVAILABILITY}:
+Whether the time period of this event allows for other events to be scheduled at the same time</li>
+</ul>
+
+
+
+
+<h3 id="Voicemail">Voicemail Provider</h3>
+
+<p>The new Voicemail Provider allows applications to add voicemails to the
+device, in order to present all the user's voicemails in a single visual presentation. For instance,
+it’s possible that a user has multiple voicemail sources, such as
+one from the phone’s service provider and others from VoIP or other alternative voice
+services. These apps can use the Voicemail Provider APIs to add their voicemails to the device. The
+built-in Phone application then presents all voicemails to the user in a unified presentation.
+Although the system’s Phone application is the only application that can read all the voicemails,
+each application that provides voicemails can read those that it has added to the system (but cannot
+read voicemails from other services).</p>
+
+<p>Because the APIs currently do not allow third-party apps to read all the voicemails from the
+system, the only third-party apps that should use the voicemail APIs are those that have voicemail
+to deliver to the user.</p>
+
+<p>The {@link android.provider.VoicemailContract} class defines the content provider for the
+Voicemail Provder. The subclasses {@link android.provider.VoicemailContract.Voicemails} and {@link
+android.provider.VoicemailContract.Status} provide tables in which apps can
+insert voicemail data for storage on the device. For an example of a voicemail provider app, see the
+<a href="{@docRoot}resources/samples/VoicemailProviderDemo/index.html">Voicemail Provider
+Demo</a>.</p>
+
+
+
+
+
+<h3 id="Multimedia">Multimedia</h3>
+
+<p>Android 4.0 adds several new APIs for applications that interact with media such as photos,
+videos, and music.</p>
+
+
+<h4>Media Effects</h4>
+
+<p>A new media effects framework allows you to apply a variety of visual effects to images and
+videos. For example, image effects allow you to easily fix red-eye, convert an image to grayscale,
+adjust brightness, adjust saturation, rotate an image, apply a fisheye effect, and much more. The
+system performs all effects processing on the GPU to obtain maximum performance.</p>
+
+<p>For maximum performance, effects are applied directly to OpenGL textures, so your application
+must have a valid OpenGL context before it can use the effects APIs. The textures to which you apply
+effects may be from bitmaps, videos or even the camera. However, there are certain restrictions that
+textures must meet:</p>
+<ol>
+<li>They must be bound to a {@link android.opengl.GLES20#GL_TEXTURE_2D} texture image</li>
+<li>They must contain at least one mipmap level</li>
+</ol>
+
+<p>An {@link android.media.effect.Effect} object defines a single media effect that you can apply to
+an image frame. The basic workflow to create an {@link android.media.effect.Effect} is:</p>
+
+<ol>
+<li>Call {@link android.media.effect.EffectContext#createWithCurrentGlContext
+EffectContext.createWithCurrentGlContext()} from your OpenGL ES 2.0 context.</li>
+<li>Use the returned {@link android.media.effect.EffectContext} to call {@link
+android.media.effect.EffectContext#getFactory EffectContext.getFactory()}, which returns an instance
+of {@link android.media.effect.EffectFactory}.</li>
+<li>Call {@link android.media.effect.EffectFactory#createEffect createEffect()}, passing it an
+effect name from @link android.media.effect.EffectFactory}, such as {@link
+android.media.effect.EffectFactory#EFFECT_FISHEYE} or {@link
+android.media.effect.EffectFactory#EFFECT_VIGNETTE}.</li>
+</ol>
+
+<p>You can adjust an effect’s parameters by calling {@link android.media.effect.Effect#setParameter
+setParameter()} and passing a parameter name and parameter value. Each type of effect accepts
+different parameters, which are documented with the effect name. For example, {@link
+android.media.effect.EffectFactory#EFFECT_FISHEYE} has one parameter for the {@code scale} of the
+distortion.</p>
+
+<p>To apply an effect on a texture, call {@link android.media.effect.Effect#apply apply()} on the
+{@link
+android.media.effect.Effect} and pass in the input texture, it’s width and height, and the output
+texture. The input texture must be bound to a {@link android.opengl.GLES20#GL_TEXTURE_2D} texture
+image (usually done by calling the {@link android.opengl.GLES20#glTexImage2D glTexImage2D()}
+function). You may provide multiple mipmap levels. If the output texture has not been bound to a
+texture image, it will be automatically bound by the effect as a {@link
+android.opengl.GLES20#GL_TEXTURE_2D} and with one mipmap level (0), which will have the same
+size as the input.</p>
+
+<p>All effects listed in {@link android.media.effect.EffectFactory} are guaranteed to be supported.
+However, some additional effects available from external libraries are not supported by all devices,
+so you must first check if the desired effect from the external library is supported by calling
+{@link android.media.effect.EffectFactory#isEffectSupported isEffectSupported()}.</p>
+
+
+<h4>Remote control client</h4>
+
+<p>The new {@link android.media.RemoteControlClient} allows media players to enable playback
+controls from remote control clients such as the device lock screen. Media players can also expose
+information about the media currently playing for display on the remote control, such as track
+information and album art.</p>
+
+<p>To enable remote control clients for your media player, instantiate a {@link
+android.media.RemoteControlClient} with its constructor, passing it a {@link
+android.app.PendingIntent} that broadcasts {@link
+android.content.Intent#ACTION_MEDIA_BUTTON}. The intent must also declare the explicit {@link
+android.content.BroadcastReceiver} component in your app that handles the {@link
+android.content.Intent#ACTION_MEDIA_BUTTON} event.</p>
+
+<p>To declare which media control inputs your player can handle, you must call {@link
+android.media.RemoteControlClient#setTransportControlFlags setTransportControlFlags()} on your
+{@link android.media.RemoteControlClient}, passing a set of {@code FLAG_KEY_MEDIA_*} flags, such as
+{@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_PREVIOUS} and {@link
+android.media.RemoteControlClient#FLAG_KEY_MEDIA_NEXT}.</p>
+
+<p>You must then register your {@link android.media.RemoteControlClient} by passing it to {@link
+android.media.AudioManager#registerRemoteControlClient MediaManager.registerRemoteControlClient()}.
+Once registered, the broadcast receiver you declared when you instantiated the {@link
+android.media.RemoteControlClient} will receive {@link android.content.Intent#ACTION_MEDIA_BUTTON}
+events when a button is pressed from a remote control. The intent you receive includes the {@link
+android.view.KeyEvent} for the media key pressed, which you can retrieve from the intent with {@link
+android.content.Intent#getParcelableExtra getParcelableExtra(Intent.EXTRA_KEY_EVENT)}.</p>
+
+<p>To display information on the remote control about the media playing, call {@link
+android.media.RemoteControlClient#editMetadata editMetaData()} and add metadata to the returned
+{@link android.media.RemoteControlClient.MetadataEditor}. You can supply a bitmap for media artwork,
+numerical information such as elapsed time, and text information such as the track title. For
+information on available keys see the {@code METADATA_KEY_*} flags in {@link
+android.media.MediaMetadataRetriever}.</p>
+
+<p>For a sample implementation, see the <a
+href="{@docRoot}resources/samples/RandomMusicPlayer/index.html">Random Music Player</a>, which
+provides compatibility logic such that it enables the remote control client on Android 4.0
+devices while continuing to support devices back to Android 2.1.</p>
+
+
+<h4>Media player</h4>
+
+<ul>
+<li>Streaming online media from {@link android.media.MediaPlayer} now requires the {@link
+android.Manifest.permission#INTERNET} permission. If you use {@link android.media.MediaPlayer} to
+play content from the Internet, be sure to add the {@link android.Manifest.permission#INTERNET}
+permission to your manifest or else your media playback will not work beginning with Android
+4.0.</li>
+
+<li>{@link android.media.MediaPlayer#setSurface(Surface) setSurface()} allows you define a {@link
+android.view.Surface} to behave as the video sink.</li>
+
+<li>{@link android.media.MediaPlayer#setDataSource(Context,Uri,Map) setDataSource()} allows you to
+send additional HTTP headers with your request, which can be useful for HTTP(S) live streaming</li>
+
+<li>HTTP(S) live streaming now respects HTTP cookies across requests</li>
+</ul>
+
+
+<h4>Media types</h4>
+
+<p>Android 4.0 adds support for:</p>
+<ul>
+<li>HTTP/HTTPS live streaming protocol version 3 </li>
+<li>ADTS raw AAC audio encoding</li>
+<li>WEBP images</li>
+<li>Matroska video</li>
+</ul>
+<p>For more info, see <a href="{@docRoot}guide/appendix/media-formats.html">Supported Media
+Formats</a>.</p>
+
+
+
+
+
+<h3 id="Camera">Camera</h3>
+
+<p>The {@link android.hardware.Camera} class now includes APIs for detecting faces and controlling
+focus and metering areas.</p>
+
+
+<h4>Face detection</h4>
+
+<p>Camera apps can now enhance their abilities with Android’s face detection APIs, which not
+only detect the face of a subject, but also specific facial features, such as the eyes and mouth.
+</p>
+
+<p>To detect faces in your camera application, you must register a {@link
+android.hardware.Camera.FaceDetectionListener} by calling {@link
+android.hardware.Camera#setFaceDetectionListener setFaceDetectionListener()}. You can then start
+your camera surface and start detecting faces by calling {@link
+android.hardware.Camera#startFaceDetection}.</p>
+
+<p>When the system detects one or more faces in the camera scene, it calls the {@link
+android.hardware.Camera.FaceDetectionListener#onFaceDetection onFaceDetection()} callback in your
+implementation of {@link android.hardware.Camera.FaceDetectionListener}, including an array of
+{@link android.hardware.Camera.Face} objects.</p>
+
+<p>An instance of the {@link android.hardware.Camera.Face} class provides various information about
+the face detected, including:</p>
+<ul>
+<li>A {@link android.graphics.Rect} that specifies the bounds of the face, relative to the camera's
+current field of view</li>
+<li>An integer betwen 1 and 100 that indicates how confident the system is that the object is a
+human face</li>
+<li>A unique ID so you can track multiple faces</li>
+<li>Several {@link android.graphics.Point} objects that indicate where the eyes and mouth are
+located</li>
+</ul>
+
+<p class="note"><strong>Note:</strong> Face detection may not be supported on some
+devices, so you should check by calling {@link
+android.hardware.Camera.Parameters#getMaxNumDetectedFaces()} and ensure the return
+value is greater than zero. Also, some devices may not support identification of eyes and mouth,
+in which case, those fields in the {@link android.hardware.Camera.Face} object will be null.</p>
+
+
+<h4>Focus and metering areas</h4>
+
+<p>Camera apps can now control the areas that the camera uses for focus and for metering white
+balance
+and auto-exposure. Both features use the new {@link android.hardware.Camera.Area} class to specify
+the region of the camera’s current view that should be focused or metered. An instance of the {@link
+android.hardware.Camera.Area} class defines the bounds of the area with a {@link
+android.graphics.Rect} and the area's weight—representing the level of importance of that
+area, relative to other areas in consideration—with an integer.</p>
+
+<p>Before setting either a focus area or metering area, you should first call {@link
+android.hardware.Camera.Parameters#getMaxNumFocusAreas} or {@link
+android.hardware.Camera.Parameters#getMaxNumMeteringAreas}, respectively. If these return zero, then
+the device does not support the corresponding feature.</p>
+
+<p>To specify the focus or metering areas to use, simply call {@link
+android.hardware.Camera.Parameters#setFocusAreas setFocusAreas()} or {@link
+android.hardware.Camera.Parameters#setMeteringAreas setMeteringAreas()}. Each take a {@link
+java.util.List} of {@link android.hardware.Camera.Area} objects that indicate the areas to consider
+for focus or metering. For example, you might implement a feature that allows the user to set the
+focus area by touching an area of the preview, which you then translate to an {@link
+android.hardware.Camera.Area} object and request that the camera focus on that area of the scene.
+The focus or exposure in that area will continually update as the scene in the area changes.</p>
+
+
+<h4>Continuous auto focus for photos</h4>
+
+<p>You can now enable continuous auto focusing (CAF) when taking photos. To enable CAF in your
+camera app, pass {@link android.hardware.Camera.Parameters#FOCUS_MODE_CONTINUOUS_PICTURE}
+to {@link android.hardware.Camera.Parameters#setFocusMode setFocusMode()}. When ready to capture
+a photo, call {@link android.hardware.Camera#autoFocus autoFocus()}. Your {@link
+android.hardware.Camera.AutoFocusCallback} immediately receives a callback to indicate whether
+focus was achieved. To resume CAF after receiving the callback, you must call {@link
+android.hardware.Camera#cancelAutoFocus()}.</p>
+
+<p class="note"><strong>Note:</strong> Continuous auto focus is also supported when capturing
+video, using {@link android.hardware.Camera.Parameters#FOCUS_MODE_CONTINUOUS_VIDEO}, which was
+added in API level 9.</p>
+
+
+<h4>Other camera features</h4>
+
+<ul>
+<li>While recording video, you can now call {@link android.hardware.Camera#takePicture
+takePicture()} to save a photo without interrupting the video session. Before doing so, you should
+call {@link android.hardware.Camera.Parameters#isVideoSnapshotSupported} to be sure the hardware
+supports it.</li>
+
+<li>You can now lock auto exposure and white balance with {@link
+android.hardware.Camera.Parameters#setAutoExposureLock setAutoExposureLock()} and {@link
+android.hardware.Camera.Parameters#setAutoWhiteBalanceLock setAutoWhiteBalanceLock()} to prevent
+these properties from changing.</li>
+
+<li>You can now call {@link android.hardware.Camera#setDisplayOrientation
+setDisplayOrientation()} while the camera preview is running. Previously, you could call this
+only before beginning the preview, but you can now change the orientation at any time.</li>
+</ul>
+
+
+<h4>Camera broadcast intents</h4>
+
+<ul>
+<li>{@link android.hardware.Camera#ACTION_NEW_PICTURE Camera.ACTION_NEW_PICTURE}:
+This indicates that the user has captured a new photo. The built-in Camera app invokes this
+broadcast after a photo is captured and third-party camera apps should also broadcast this intent
+after capturing a photo.</li>
+<li>{@link android.hardware.Camera#ACTION_NEW_VIDEO Camera.ACTION_NEW_VIDEO}:
+This indicates that the user has captured a new video. The built-in Camera app invokes this
+broadcast after a video is recorded and third-party camera apps should also broadcast this intent
+after capturing a video.</li>
+</ul>
+
+
+
+
+
+<h3 id="AndroidBeam">Android Beam (NDEF Push with NFC)</h3>
+
+<p>Android Beam is a new NFC feature that allows you to send NDEF messages from one device to
+another (a process also known as “NDEF Push"). The data transfer is initiated when two
+Android-powered devices that support Android Beam are in close proximity (about 4 cm), usually with
+their backs touching. The data inside the NDEF message can contain any data that you wish to share
+between devices. For example, the People app shares contacts, YouTube shares videos, and Browser
+shares URLs using Android Beam.</p>
+
+<p>To transmit data between devices using Android Beam, you need to create an {@link
+android.nfc.NdefMessage} that contains the information you want to share while your activity is in
+the foreground. You must then pass the {@link android.nfc.NdefMessage} to the system in one of two
+ways:</p>
+
+<ul>
+<li>Define a single {@link android.nfc.NdefMessage} to push while in the activity:
+<p>Call {@link android.nfc.NfcAdapter#setNdefPushMessage setNdefPushMessage()} at any time to set
+the message you want to send. For instance, you might call this method and pass it your {@link
+android.nfc.NdefMessage} during your activity’s {@link android.app.Activity#onCreate onCreate()}
+method. Then, whenever Android Beam is activated with another device while the activity is in the
+foreground, the system sends the {@link android.nfc.NdefMessage} to the other device.</p></li>
+
+<li>Define the {@link android.nfc.NdefMessage} to push at the time that Android Beam is initiated:
+<p>Implement {@link android.nfc.NfcAdapter.CreateNdefMessageCallback}, in which your
+implementation of the {@link
+android.nfc.NfcAdapter.CreateNdefMessageCallback#createNdefMessage createNdefMessage()}
+method returns the {@link android.nfc.NdefMessage} you want to send. Then pass the {@link
+android.nfc.NfcAdapter.CreateNdefMessageCallback} implementation to {@link
+android.nfc.NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback()}.</p>
+<p>In this case, when Android Beam is activated with another device while your activity is in the
+foreground, the system calls {@link
+android.nfc.NfcAdapter.CreateNdefMessageCallback#createNdefMessage createNdefMessage()} to retrieve
+the {@link android.nfc.NdefMessage} you want to send. This allows you to define the {@link
+android.nfc.NdefMessage} to deliver only once Android Beam is initiated, in case the contents
+of the message might vary throughout the life of the activity.</p></li>
+</ul>
+
+<p>In case you want to run some specific code once the system has successfully delivered your NDEF
+message to the other device, you can implement {@link
+android.nfc.NfcAdapter.OnNdefPushCompleteCallback} and set it with {@link
+android.nfc.NfcAdapter#setOnNdefPushCompleteCallback setNdefPushCompleteCallback()}. The system will
+then call {@link android.nfc.NfcAdapter.OnNdefPushCompleteCallback#onNdefPushComplete
+onNdefPushComplete()} when the message is delivered.</p>
+
+<p>On the receiving device, the system dispatches NDEF Push messages in a similar way to regular NFC
+tags. The system invokes an intent with the {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED}
+action to start an activity, with either a URL or a MIME type set according to the first {@link
+android.nfc.NdefRecord} in the {@link android.nfc.NdefMessage}. For the activity you want to
+respond, you can declare intent filters for the URLs or MIME types your app cares about. For more
+information about Tag Dispatch see the <a
+href="{@docRoot}guide/topics/connectivity/nfc/index.html#dispatch">NFC</a> developer guide.</p>
+
+<p>If you want your {@link android.nfc.NdefMessage} to carry a URI, you can now use the convenience
+method {@link android.nfc.NdefRecord#createUri createUri} to construct a new {@link
+android.nfc.NdefRecord} based on either a string or a {@link android.net.Uri} object. If the URI is
+a special format that you want your application to also receive during an Android Beam event, you
+should create an intent filter for your activity using the same URI scheme in order to receive the
+incoming NDEF message.</p>
+
+<p>You should also pass an “Android application record" with your {@link android.nfc.NdefMessage} in
+order to guarantee that your application handles the incoming NDEF message, even if other
+applications filter for the same intent action. You can create an Android application record by
+calling {@link android.nfc.NdefRecord#createApplicationRecord createApplicationRecord()}, passing it
+your application’s package name. When the other device receives the NDEF message with the
+application record and multiple applications contain activities that handle the specified intent,
+the system always delivers the message to the activity in your application (based on the matching
+application record). If the target device does not currently have your application installed, the
+system uses the Android application record to launch Google Play and take the user to the
+application in order to install it.</p>
+
+<p>If your application doesn’t use NFC APIs to perform NDEF Push messaging, then Android provides a
+default behavior: When your application is in the foreground on one device and Android Beam is
+invoked with another Android-powered device, then the other device receives an NDEF message with an
+Android application record that identifies your application. If the receiving device has the
+application installed, the system launches it; if it’s not installed, Google Play opens and takes
+the user to your application in order to install it.</p>
+
+<p>You can read more about Android Beam and other NFC features in the <a
+href="{@docRoot}guide/topics/connectivity/nfc/nfc.html">NFC Basics</a> developer guide. For some example code
+using Android Beam, see the <a
+href="{@docRoot}resources/samples/AndroidBeamDemo/src/com/example/android/beam/Beam.html">Android
+Beam Demo</a>.</p>
+
+
+
+
+
+<h3 id="WiFiDirect">Wi-Fi Direct</h3>
+
+<p>Android now supports Wi-Fi Direct for peer-to-peer (P2P) connections between Android-powered
+devices and other device types without a hotspot or Internet connection. The Android framework
+provides a set of Wi-Fi P2P APIs that allow you to discover and connect to other devices when each
+device supports Wi-Fi Direct, then communicate over a speedy connection across distances much longer
+than a Bluetooth connection.</p>
+
+<p>A new package, {@link android.net.wifi.p2p}, contains all the APIs for performing peer-to-peer
+connections with Wi-Fi. The primary class you need to work with is {@link
+android.net.wifi.p2p.WifiP2pManager}, which you can acquire by calling {@link
+android.app.Activity#getSystemService getSystemService(WIFI_P2P_SERVICE)}. The {@link
+android.net.wifi.p2p.WifiP2pManager} includes APIs that allow you to:</p>
+<ul>
+<li>Initialize your application for P2P connections by calling {@link
+android.net.wifi.p2p.WifiP2pManager#initialize initialize()}</li>
+
+<li>Discover nearby devices by calling {@link android.net.wifi.p2p.WifiP2pManager#discoverPeers
+discoverPeers()}</li>
+
+<li>Start a P2P connection by calling {@link android.net.wifi.p2p.WifiP2pManager#connect
+connect()}</li>
+<li>And more</li>
+</ul>
+
+<p>Several other interfaces and classes are necessary as well, such as:</p>
+<ul>
+<li>The {@link android.net.wifi.p2p.WifiP2pManager.ActionListener} interface allows you to receive
+callbacks when an operation such as discovering peers or connecting to them succeeds or fails.</li>
+
+<li>{@link android.net.wifi.p2p.WifiP2pManager.PeerListListener} interface allows you to receive
+information about discovered peers. The callback provides a {@link
+android.net.wifi.p2p.WifiP2pDeviceList}, from which you can retrieve a {@link
+android.net.wifi.p2p.WifiP2pDevice} object for each device within range and get information such as
+the device name, address, device type, the WPS configurations the device supports, and more.</li>
+
+<li>The {@link android.net.wifi.p2p.WifiP2pManager.GroupInfoListener} interface allows you to
+receive information about a P2P group. The callback provides a {@link
+android.net.wifi.p2p.WifiP2pGroup} object, which provides group information such as the owner, the
+network name, and passphrase.</li>
+
+<li>{@link android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener} interface allows you to
+receive information about the current connection. The callback provides a {@link
+android.net.wifi.p2p.WifiP2pInfo} object, which has information such as whether a group has been
+formed and who is the group owner.</li>
+</ul>
+
+<p>In order to use the Wi-Fi P2P APIs, your app must request the following user permissions:</p>
+<ul>
+<li>{@link android.Manifest.permission#ACCESS_WIFI_STATE}</li>
+<li>{@link android.Manifest.permission#CHANGE_WIFI_STATE}</li>
+<li>{@link android.Manifest.permission#INTERNET} (although your app doesn’t technically connect
+to the Internet, communicating to Wi-Fi Direct peers with standard java sockets requires Internet
+permission).</li>
+</ul>
+
+<p>The Android system also broadcasts several different actions during certain Wi-Fi P2P events:</p>
+<ul>
+<li>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_CONNECTION_CHANGED_ACTION}: The P2P
+connection state has changed. This carries {@link
+android.net.wifi.p2p.WifiP2pManager#EXTRA_WIFI_P2P_INFO} with a {@link
+android.net.wifi.p2p.WifiP2pInfo} object and {@link
+android.net.wifi.p2p.WifiP2pManager#EXTRA_NETWORK_INFO} with a {@link android.net.NetworkInfo}
+object.</li>
+
+<li>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_CHANGED_ACTION}: The P2P state has
+changed between enabled and disabled. It carries {@link
+android.net.wifi.p2p.WifiP2pManager#EXTRA_WIFI_STATE} with either {@link
+android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_DISABLED} or {@link
+android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_ENABLED}</li>
+
+<li>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION}: The list of peer
+devices has changed.</li>
+
+<li>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_THIS_DEVICE_CHANGED_ACTION}: The details for
+this device have changed.</li>
+</ul>
+
+<p>See the {@link android.net.wifi.p2p.WifiP2pManager} documentation for more information. Also
+look at the <a href="{@docRoot}resources/samples/WiFiDirectDemo/index.html">Wi-Fi Direct Demo</a>
+sample application.</p>
+
+
+
+
+
+<h3 id="Bluetooth">Bluetooth Health Devices</h3>
+
+<p>Android now supports Bluetooth Health Profile devices, so you can create applications that use
+Bluetooth to communicate with health devices that support Bluetooth, such as heart-rate monitors,
+blood meters, thermometers, and scales.</p>
+
+<p>Similar to regular headset and A2DP profile devices, you must call {@link
+android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()} with a {@link
+android.bluetooth.BluetoothProfile.ServiceListener} and the {@link
+android.bluetooth.BluetoothProfile#HEALTH} profile type to establish a connection with the profile
+proxy object.</p>
+
+<p>Once you’ve acquired the Health Profile proxy (the {@link android.bluetooth.BluetoothHealth}
+object), connecting to and communicating with paired health devices involves the following new
+Bluetooth classes:</p>
+<ul>
+<li>{@link android.bluetooth.BluetoothHealthCallback}: You must extend this class and implement the
+callback methods to receive updates about changes in the application’s registration state and
+Bluetooth channel state.</li>
+<li>{@link android.bluetooth.BluetoothHealthAppConfiguration}: During callbacks to your {@link
+android.bluetooth.BluetoothHealthCallback}, you’ll receive an instance of this object, which
+provides configuration information about the available Bluetooth health device, which you must use
+to perform various operations such as initiate and terminate connections with the {@link
+android.bluetooth.BluetoothHealth} APIs.</li>
+</ul>
+
+<p>For more information about using the Bluetooth Health Profile, see the documentation for {@link
+android.bluetooth.BluetoothHealth}.</p>
+
+
+
+
+
+<h3 id="A11y">Accessibility</h3>
+
+<p>Android 4.0 improves accessibility for sight-impaired users with new explore-by-touch mode
+and extended APIs that allow you to provide more information about view content or
+develop advanced accessibility services.</p>
+
+
+<h4>Explore-by-touch mode</h4>
+
+<p>Users with vision loss can now explore the screen by touching and dragging a finger across the
+screen to hear voice descriptions of the content. Because the explore-by-touch mode works like a
+virtual cursor, it allows screen readers to identify the descriptive text the same way that screen
+readers can when the user navigates with a d-pad or trackball—by reading information provided
+by {@link android.R.attr#contentDescription android:contentDescription} and {@link
+android.view.View#setContentDescription setContentDescription()} upon a simulated "hover" event. So,
+consider this is a reminder that you should provide descriptive text for the views in your
+application, especially for {@link android.widget.ImageButton}, {@link android.widget.EditText},
+{@link android.widget.ImageView} and other widgets that might not naturally contain descriptive
+text.</p>
+
+
+<h4>Accessibility for views</h4>
+
+<p>To enhance the information available to accessibility services such as screen readers, you can
+implement new callback methods for accessibility events in your custom {@link
+android.view.View} components.</p>
+
+<p>It's important to first note that the behavior of the {@link
+android.view.View#sendAccessibilityEvent sendAccessibilityEvent()} method has changed in Android
+4.0. As with previous version of Android, when the user enables accessibility services on the device
+and an input event such as a click or hover occurs, the respective view is notified with a call to
+{@link android.view.View#sendAccessibilityEvent sendAccessibilityEvent()}. Previously, the
+implementation of {@link android.view.View#sendAccessibilityEvent sendAccessibilityEvent()} would
+initialize an {@link android.view.accessibility.AccessibilityEvent} and send it to {@link
+android.view.accessibility.AccessibilityManager}. The new behavior involves some additional callback
+methods that allow the view and its parents to add more contextual information to the event:
+<ol>
+ <li>When invoked, the {@link
+android.view.View#sendAccessibilityEvent sendAccessibilityEvent()} and {@link
+android.view.View#sendAccessibilityEventUnchecked sendAccessibilityEventUnchecked()} methods defer
+to {@link android.view.View#onInitializeAccessibilityEvent onInitializeAccessibilityEvent()}.
+ <p>Custom implementations of {@link android.view.View} might want to implement {@link
+android.view.View#onInitializeAccessibilityEvent onInitializeAccessibilityEvent()} to
+attach additional accessibility information to the {@link
+android.view.accessibility.AccessibilityEvent}, but should also call the super implementation to
+provide default information such as the standard content description, item index, and more.
+However, you should not add additional text content in this callback—that happens
+next.</p></li>
+ <li>Once initialized, if the event is one of several types that should be populated with text
+information, the view then receives a call to {@link
+android.view.View#dispatchPopulateAccessibilityEvent dispatchPopulateAccessibilityEvent()}, which
+defers to the {@link android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()}
+callback.
+ <p>Custom implementations of {@link android.view.View} should usually implement {@link
+android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()} to add additional
+text content to the {@link android.view.accessibility.AccessibilityEvent} if the {@link
+android.R.attr#contentDescription android:contentDescription} text is missing or
+insufficient. To add more text description to the
+{@link android.view.accessibility.AccessibilityEvent}, call {@link
+android.view.accessibility.AccessibilityEvent#getText()}.{@link java.util.List#add add()}.</p>
+</li>
+ <li>At this point, the {@link android.view.View} passes the event up the view hierarchy by calling
+{@link android.view.ViewGroup#requestSendAccessibilityEvent requestSendAccessibilityEvent()} on the
+parent view. Each parent view then has the chance to augment the accessibility information by
+adding an {@link android.view.accessibility.AccessibilityRecord}, until it
+ultimately reaches the root view, which sends the event to the {@link
+android.view.accessibility.AccessibilityManager} with {@link
+android.view.accessibility.AccessibilityManager#sendAccessibilityEvent
+sendAccessibilityEvent()}.</li>
+</ol>
+
+<p>In addition to the new methods above, which are useful when extending the {@link
+android.view.View} class, you can also intercept these event callbacks on any {@link
+android.view.View} by extending {@link
+android.view.View.AccessibilityDelegate AccessibilityDelegate} and setting it on the view with
+{@link android.view.View#setAccessibilityDelegate setAccessibilityDelegate()}.
+When you do, each accessibility method in the view defers the call to the corresponding method in
+the delegate. For example, when the view receives a call to {@link
+android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()}, it passes it to the
+same method in the {@link android.view.View.AccessibilityDelegate}. Any methods not handled by
+the delegate are given right back to the view for default behavior. This allows you to override only
+the methods necessary for any given view without extending the {@link android.view.View} class.</p>
+
+
+<p>If you want to maintain compatibility with Android versions prior to 4.0, while also supporting
+the new the accessibility APIs, you can do so with the latest version of the <em>v4 support
+library</em> (in <a href="{@docRoot}tools/extras/support-library.html">Compatibility Package, r4</a>)
+using a set of utility classes that provide the new accessibility APIs in a backward-compatible
+design.</p>
+
+
+
+
+<h4>Accessibility services</h4>
+
+<p>If you're developing an accessibility service, the information about various accessibility events
+has been significantly expanded to enable more advanced accessibility feedback for users. In
+particular, events are generated based on view composition, providing better context information and
+allowing accessibility services to traverse view hierarchies to get additional view information and
+deal with special cases.</p>
+
+<p>If you're developing an accessibility service (such as a screen reader), you can access
+additional content information and traverse view hierarchies with the following procedure:</p>
+<ol>
+<li>Upon receiving an {@link android.view.accessibility.AccessibilityEvent} from an application,
+call the {@link android.view.accessibility.AccessibilityEvent#getRecord(int)
+AccessibilityEvent.getRecord()} to retrieve a specific {@link
+android.view.accessibility.AccessibilityRecord} (there may be several records attached to the
+event).</li>
+
+<li>From either {@link android.view.accessibility.AccessibilityEvent} or an individual {@link
+android.view.accessibility.AccessibilityRecord}, you can call {@link
+android.view.accessibility.AccessibilityRecord#getSource() getSource()} to retrieve a {@link
+android.view.accessibility.AccessibilityNodeInfo} object.
+ <p>An {@link android.view.accessibility.AccessibilityNodeInfo} represents a single node
+of the window content in a format that allows you to query accessibility information about that
+node. The {@link android.view.accessibility.AccessibilityNodeInfo} object returned from {@link
+android.view.accessibility.AccessibilityEvent} describes the event source, whereas the source from
+an {@link android.view.accessibility.AccessibilityRecord} describes the predecessor of the event
+source.</p></li>
+
+<li>With the {@link android.view.accessibility.AccessibilityNodeInfo}, you can query information
+about it, call {@link
+android.view.accessibility.AccessibilityNodeInfo#getParent getParent()} or {@link
+android.view.accessibility.AccessibilityNodeInfo#getChild getChild()} to traverse the view
+hierarchy, and even add child views to the node.</li>
+</ol>
+
+<p>In order for your application to publish itself to the system as an accessibility service, it
+must declare an XML configuration file that corresponds to {@link
+android.accessibilityservice.AccessibilityServiceInfo}. For more information about creating an
+accessibility service, see {@link
+android.accessibilityservice.AccessibilityService} and {@link
+android.accessibilityservice.AccessibilityService#SERVICE_META_DATA
+SERVICE_META_DATA} for information about the XML configuration.</p>
+
+
+<h4>Other accessibility APIs</h4>
+
+<p>If you're interested in the device's accessibility state, the {@link
+android.view.accessibility.AccessibilityManager} has some new APIs such as:</p>
+<ul>
+ <li>{@link android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener}
+is an interface that allows you to receive a callback whenever accessibility is enabled or
+disabled.</li>
+ <li>{@link android.view.accessibility.AccessibilityManager#getEnabledAccessibilityServiceList
+ getEnabledAccessibilityServiceList()} provides information about which accessibility services
+ are currently enabled.</li>
+ <li>{@link android.view.accessibility.AccessibilityManager#isTouchExplorationEnabled()} tells
+ you whether the explore-by-touch mode is enabled.</li>
+</ul>
+
+
+
+
+
+
+<h3 id="SpellChecker">Spell Checker Services</h3>
+
+<p>A new spell checker framework allows apps to create spell checkers in a manner similar to the
+input method framework (for IMEs). To create a new spell checker, you must implement a service that
+extends
+{@link android.service.textservice.SpellCheckerService} and extend the {@link
+android.service.textservice.SpellCheckerService.Session} class to provide spelling suggestions based
+on text provided by the interface's callback methods. In the {@link
+android.service.textservice.SpellCheckerService.Session} callback methods, you must return the
+spelling suggestions as {@link android.view.textservice.SuggestionsInfo} objects. </p>
+
+<p>Applications with a spell checker service must declare the {@link
+android.Manifest.permission#BIND_TEXT_SERVICE} permission as required by the service.
+The service must also declare an intent filter with {@code <action
+android:name="android.service.textservice.SpellCheckerService" />} as the intent’s action and should
+include a {@code <meta-data>} element that declares configuration information for the spell
+checker. </p>
+
+<p>See the sample <a href="{@docRoot}resources/samples/SpellChecker/SampleSpellCheckerService/index.html">
+Spell Checker Service</a> app and
+sample <a href="{@docRoot}resources/samples/SpellChecker/HelloSpellChecker/index.html">
+Spell Checker Client</a> app for example code.</p>
+
+
+
+
+<h3 id="TTS">Text-to-speech Engines</h3>
+
+<p>Android’s text-to-speech (TTS) APIs have been significantly extended to allow applications to
+more easily implement custom TTS engines, while applications that want to use a TTS engine have a
+couple new APIs for selecting an engine.</p>
+
+
+<h4>Using text-to-speech engines</h4>
+
+<p>In previous versions of Android, you could use the {@link android.speech.tts.TextToSpeech} class
+to perform text-to-speech (TTS) operations using the TTS engine provided by the system or set a
+custom engine using {@link android.speech.tts.TextToSpeech#setEngineByPackageName
+setEngineByPackageName()}. In Android 4.0, the {@link
+android.speech.tts.TextToSpeech#setEngineByPackageName setEngineByPackageName()} method has been
+deprecated and you can now specify the engine to use with a new {@link
+android.speech.tts.TextToSpeech} constructor that accepts the package name of a TTS engine.</p>
+
+<p>You can also query the available TTS engines with {@link
+android.speech.tts.TextToSpeech#getEngines()}. This method returns a list of {@link
+android.speech.tts.TextToSpeech.EngineInfo} objects, which include meta data such as the engine’s
+icon, label, and package name.</p>
+
+
+<h4>Building text-to-speech engines</h4>
+
+<p>Previously, custom engines required that the engine be built using an undocumented native header
+file. In Android 4.0, there is a complete set of framework APIs for building TTS engines. </p>
+
+<p>The basic setup requires an implementation of {@link android.speech.tts.TextToSpeechService} that
+responds to the {@link android.speech.tts.TextToSpeech.Engine#INTENT_ACTION_TTS_SERVICE} intent. The
+primary work for a TTS engine happens during the {@link
+android.speech.tts.TextToSpeechService#onSynthesizeText onSynthesizeText()} callback in a service
+that extends {@link android.speech.tts.TextToSpeechService}. The system delivers this method two
+objects:</p>
+<ul>
+<li>{@link android.speech.tts.SynthesisRequest}: This contains various data including the text to
+synthesize, the locale, the speech rate, and voice pitch.</li>
+<li>{@link android.speech.tts.SynthesisCallback}: This is the interface by which your TTS engine
+delivers the resulting speech data as streaming audio. First the engine must call {@link
+android.speech.tts.SynthesisCallback#start start()} to indicate that the engine is ready to deliver
+the audio, then call {@link android.speech.tts.SynthesisCallback#audioAvailable audioAvailable()},
+passing it the audio data in a byte buffer. Once your engine has passed all audio through the
+buffer, call {@link android.speech.tts.SynthesisCallback#done()}.</li>
+</ul>
+
+<p>Now that the framework supports a true API for creating TTS engines, support for the native code
+implementation has been removed. Look for a blog post about a compatibility layer
+that you can use to convert your old TTS engines to the new framework.</p>
+
+<p>For an example TTS engine using the new APIs, see the <a
+href="{@docRoot}resources/samples/TtsEngine/index.html">Text To Speech Engine</a> sample app.</p>
+
+
+
+
+
+
+<h3 id="NetworkUsage">Network Usage</h3>
+
+<p>Android 4.0 gives users precise visibility of how much network data their applications are using.
+The Settings app provides controls that allow users to manage set limits for network data usage and
+even disable the use of background data for individual apps. In order to avoid users disabling your
+app’s access to data from the background, you should develop strategies to use the data
+connection efficiently and adjust your usage depending on the type of connection available.</p>
+
+<p>If your application performs a lot of network transactions, you should provide user settings that
+allow users to control your app’s data habits, such as how often your app syncs data, whether to
+perform uploads/downloads only when on Wi-Fi, whether to use data while roaming, etc. With these
+controls available to them, users are much less likely to disable your app’s access to data when
+they approach their limits, because they can instead precisely control how much data your app uses.
+If you provide a preference activity with these settings, you should include in its manifest
+declaration an intent filter for the {@link android.content.Intent#ACTION_MANAGE_NETWORK_USAGE}
+action. For example:</p>
+
+<pre>
+<activity android:name="DataPreferences" android:label="@string/title_preferences">
+ <intent-filter>
+ <action android:name="android.intent.action.MANAGE_NETWORK_USAGE" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+</activity>
+</pre>
+
+<p>This intent filter indicates to the system that this is the activity that controls your
+application’s data usage. Thus, when the user inspects how much data your app is using from the
+Settings app, a “View application settings" button is available that launches your
+preference activity so the user can refine how much data your app uses.</p>
+
+<p>Also beware that {@link android.net.ConnectivityManager#getBackgroundDataSetting()} is now
+deprecated and always returns true—use {@link
+android.net.ConnectivityManager#getActiveNetworkInfo()} instead. Before you attempt any network
+transactions, you should always call {@link android.net.ConnectivityManager#getActiveNetworkInfo()}
+to get the {@link android.net.NetworkInfo} that represents the current network and query {@link
+android.net.NetworkInfo#isConnected()} to check whether the device has a
+connection. You can then check other connection properties, such as whether the device is
+roaming or connected to Wi-Fi.</p>
+
+
+
+
+
+
+
+
+<h3 id="RenderScript">RenderScript</h3>
+
+<p>Three major features have been added to RenderScript:</p>
+
+<ul>
+ <li>Off-screen rendering to a framebuffer object</li>
+ <li>Rendering inside a view</li>
+ <li>RS for each from the framework APIs</li>
+</ul>
+
+<p>The {@link android.renderscript.Allocation} class now supports a {@link
+android.renderscript.Allocation#USAGE_GRAPHICS_RENDER_TARGET} memory space, which allows you to
+render things directly into the {@link android.renderscript.Allocation} and use it as a framebuffer
+object.</p>
+
+<p>{@link android.renderscript.RSTextureView} provides a means to display RenderScript graphics
+inside of a {@link android.view.View}, unlike {@link android.renderscript.RSSurfaceView}, which
+creates a separate window. This key difference allows you to do things such as move, transform, or
+animate an {@link android.renderscript.RSTextureView} as well as draw RenderScript graphics inside
+a view that lies within an activity layout.</p>
+
+<p>The {@link android.renderscript.Script#forEach Script.forEach()} method allows you to call
+RenderScript compute scripts from the VM level and have them automatically delegated to available
+cores on the device. You do not use this method directly, but any compute RenderScript that you
+write will have a {@link android.renderscript.Script#forEach forEach()} method that you can call in
+the reflected RenderScript class. You can call the reflected {@link
+android.renderscript.Script#forEach forEach()} method by passing in an input {@link
+android.renderscript.Allocation} to process, an output {@link android.renderscript.Allocation} to
+write the result to, and a {@link android.renderscript.FieldPacker} data structure in case the
+RenderScript needs more information. Only one of the {@link android.renderscript.Allocation}s is
+necessary and the data structure is optional.</p>
+
+
+
+
+
+
+
+
+
+<h3 id="Enterprise">Enterprise</h3>
+
+<p>Android 4.0 expands the capabilities for enterprise application with the following features.</p>
+
+<h4>VPN services</h4>
+
+<p>The new {@link android.net.VpnService} allows applications to build their own VPN (Virtual
+Private Network), running as a {@link android.app.Service}. A VPN service creates an interface for a
+virtual network with its own address and routing rules and performs all reading and writing with a
+file descriptor.</p>
+
+<p>To create a VPN service, use {@link android.net.VpnService.Builder}, which allows you to specify
+the network address, DNS server, network route, and more. When complete, you can establish the
+interface by calling {@link android.net.VpnService.Builder#establish()}, which returns a {@link
+android.os.ParcelFileDescriptor}. </p>
+
+<p>Because a VPN service can intercept packets, there are security implications. As such, if you
+implement {@link android.net.VpnService}, then your service must require the {@link
+android.Manifest.permission#BIND_VPN_SERVICE} to ensure that only the system can bind to it (only
+the system is granted this permission—apps cannot request it). To then use your VPN service,
+users must manually enable it in the system settings.</p>
+
+
+<h4>Device policies</h4>
+
+<p>Applications that manage the device restrictions can now disable the camera using {@link
+android.app.admin.DevicePolicyManager#setCameraDisabled setCameraDisabled()} and the {@link
+android.app.admin.DeviceAdminInfo#USES_POLICY_DISABLE_CAMERA} property (applied with a {@code
+<disable-camera />} element in the policy configuration file).</p>
+
+
+<h4>Certificate management</h4>
+
+<p>The new {@link android.security.KeyChain} class provides APIs that allow you to import and access
+certificates in the system key store. Certificates streamline the installation of both client
+certificates (to validate the identity of the user) and certificate authority certificates (to
+verify server identity). Applications such as web browsers or email clients can access the installed
+certificates to authenticate users to servers. See the {@link android.security.KeyChain}
+documentation for more information.</p>
+
+
+
+
+
+
+
+<h3 id="Sensors">Device Sensors</h3>
+
+<p>Two new sensor types have been added in Android 4.0:</p>
+
+<ul>
+ <li>{@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE}: A temperature sensor that provides
+the ambient (room) temperature in degrees Celsius.</li>
+ <li>{@link android.hardware.Sensor#TYPE_RELATIVE_HUMIDITY}: A humidity sensor that provides the
+relative ambient (room) humidity as a percentage.</li>
+</ul>
+
+<p>If a device has both {@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE} and {@link
+android.hardware.Sensor#TYPE_RELATIVE_HUMIDITY} sensors, you can use them to calculate the dew point
+and the absolute humidity.</p>
+
+<p>The previous temperature sensor, {@link android.hardware.Sensor#TYPE_TEMPERATURE}, has been
+deprecated. You should use the {@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE} sensor
+instead.</p>
+
+<p>Additionally, Android’s three synthetic sensors have been greatly improved so they now have lower
+latency and smoother output. These sensors include the gravity sensor ({@link
+android.hardware.Sensor#TYPE_GRAVITY}), rotation vector sensor ({@link
+android.hardware.Sensor#TYPE_ROTATION_VECTOR}), and linear acceleration sensor ({@link
+android.hardware.Sensor#TYPE_LINEAR_ACCELERATION}). The improved sensors rely on the gyroscope
+sensor to improve their output, so the sensors appear only on devices that have a gyroscope.</p>
+
+
+
+
+
+<h3 id="ActionBar">Action Bar</h3>
+
+<p>The {@link android.app.ActionBar} has been updated to support several new behaviors. Most
+importantly, the system gracefully manages the action bar’s size and configuration when running on
+smaller screens in order to provide an optimal user experience on all screen sizes. For example,
+when the screen is narrow (such as when a handset is in portrait orientation), the action bar’s
+navigation tabs appear in a “stacked bar," which appears directly below the main action bar. You can
+also opt-in to a “split action bar," which places all action items in a separate bar at the bottom
+of the screen when the screen is narrow.</p>
+
+
+<h4>Split action bar</h4>
+
+<p>If your action bar includes several action items, not all of them will fit into the action bar on
+a narrow screen, so the system will place more of them into the overflow menu. However, Android 4.0
+allows you to enable “split action bar" so that more action items can appear on the screen in a
+separate bar at the bottom of the screen. To enable split action bar, add {@link
+android.R.attr#uiOptions android:uiOptions} with {@code "splitActionBarWhenNarrow"} to either your
+<a href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
+tag or
+individual <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
+<activity>}</a> tags
+in your manifest file. When enabled, the system will add an additional bar at the bottom of the
+screen for all action items when the screen is narrow (no action items will appear in the primary
+action bar).</p>
+
+<p>If you want to use the navigation tabs provided by the {@link android.app.ActionBar.Tab} APIs,
+but don’t need the main action bar on top (you want only the tabs to appear at the top), then enable
+the split action bar as described above and also call {@link
+android.app.ActionBar#setDisplayShowHomeEnabled setDisplayShowHomeEnabled(false)} to disable the
+application icon in the action bar. With nothing left in the main action bar, it
+disappears—all that’s left are the navigation tabs at the top and the action items at the
+bottom of the screen.</p>
+
+
+<h4>Action bar styles</h4>
+
+<p>If you want to apply custom styling to the action bar, you can use new style properties {@link
+android.R.attr#backgroundStacked} and {@link android.R.attr#backgroundSplit} to apply a background
+drawable or color to the stacked bar and split bar, respectively. You can also set these styles at
+runtime with {@link android.app.ActionBar#setStackedBackgroundDrawable
+setStackedBackgroundDrawable()} and {@link android.app.ActionBar#setSplitBackgroundDrawable
+setSplitBackgroundDrawable()}.</p>
+
+
+<h4>Action provider</h4>
+
+<p>The new {@link android.view.ActionProvider} class allows you to create a specialized handler for
+action items. An action provider can define an action view, a default action behavior, and a submenu
+for each action item to which it is associated. When you want to create an action item that has
+dynamic behaviors (such as a variable action view, default action, or submenu), extending {@link
+android.view.ActionProvider} is a good solution in order to create a reusable component, rather than
+handling the various action item transformations in your fragment or activity.</p>
+
+<p>For example, the {@link android.widget.ShareActionProvider} is an extension of {@link
+android.view.ActionProvider} that facilitates a “share" action from the action bar. Instead of using
+traditional action item that invokes the {@link android.content.Intent#ACTION_SEND} intent, you can
+use this action provider to present an action view with a drop-down list of applications that handle
+the {@link android.content.Intent#ACTION_SEND} intent. When the user selects an application to use
+for the action, {@link android.widget.ShareActionProvider} remembers that selection and provides it
+in the action view for faster access to sharing with that app.</p>
+
+<p>To declare an action provider for an action item, include the {@code android:actionProviderClass}
+attribute in the <a href="{@docRoot}guide/topics/resources/menu-resource.html#item-element">{@code
+<item>}</a> element for your activity’s options menu, with the class name of the action
+provider as the value. For example:</p>
+
+<pre>
+<item android:id="@+id/menu_share"
+ android:title="Share"
+ android:showAsAction="ifRoom"
+ android:actionProviderClass="android.widget.ShareActionProvider" />
+</pre>
+
+<p>In your activity’s {@link android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()}
+callback method, retrieve an instance of the action provider from the menu item and set the
+intent:</p>
+
+<pre>
+public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.options, menu);
+ ShareActionProvider shareActionProvider =
+ (ShareActionProvider) menu.findItem(R.id.menu_share).getActionProvider();
+ // Set the share intent of the share action provider.
+ shareActionProvider.setShareIntent(createShareIntent());
+ ...
+ return super.onCreateOptionsMenu(menu);
+}
+</pre>
+
+<p>For an example using the {@link android.widget.ShareActionProvider}, see <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/ActionBarShareActionProviderActivity.html"
+>ActionBarShareActionProviderActivity</a> in ApiDemos.</p>
+
+
+<h4>Collapsible action views</h4>
+
+<p>Action items that provide an action view can now toggle between their action view state and
+traditional action item state. Previously only the {@link android.widget.SearchView} supported
+collapsing when used as an action view, but now you can add an action view for any action item and
+switch between the expanded state (action view is visible) and collapsed state (action item is
+visible).</p>
+
+<p>To declare that an action item that contains an action view be collapsible, include the {@code
+“collapseActionView"} flag in the {@code android:showAsAction} attribute for the <a
+href="{@docRoot}guide/topics/resources/menu-resource.html#item-element">{@code
+<item>}</a> element in the menu’s XML file.</p>
+
+<p>To receive callbacks when an action view switches between expanded and collapsed, register an
+instance of {@link android.view.MenuItem.OnActionExpandListener} with the respective {@link
+android.view.MenuItem} by calling {@link android.view.MenuItem#setOnActionExpandListener
+setOnActionExpandListener()}. Typically, you should do so during the {@link
+android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()} callback.</p>
+
+<p>To control a collapsible action view, you can call {@link
+android.view.MenuItem#collapseActionView()} and {@link android.view.MenuItem#expandActionView()} on
+the respective {@link android.view.MenuItem}.</p>
+
+<p>When creating a custom action view, you can also implement the new {@link
+android.view.CollapsibleActionView} interface to receive callbacks when the view is expanded and
+collapsed.</p>
+
+
+<h4>Other APIs for action bar</h4>
+<ul>
+<li>{@link android.app.ActionBar#setHomeButtonEnabled setHomeButtonEnabled()} allows you to specify
+whether the icon/logo behaves as a button to navigate home or “up" (pass “true" to make it behave as
+a button).</li>
+
+<li>{@link android.app.ActionBar#setIcon setIcon()} and {@link android.app.ActionBar#setLogo
+setLogo()} allow you to define the action bar icon or logo at runtime.</li>
+
+<li>{@link android.app.Fragment#setMenuVisibility Fragment.setMenuVisibility()} allows you to enable
+or disable the visibility of the options menu items declared by the fragment. This is useful if the
+fragment has been added to the activity, but is not visible, so the menu items should be
+hidden.</li>
+
+<li>{@link android.app.FragmentManager#invalidateOptionsMenu
+FragmentManager.invalidateOptionsMenu()}
+allows you to invalidate the activity options menu during various states of the fragment lifecycle
+in which using the equivalent method from {@link android.app.Activity} might not be available.</li>
+</ul>
+
+
+
+
+
+
+
+
+<h3 id="UI">User Interface and Views</h3>
+
+<p>Android 4.0 introduces a variety of new views and other UI components.</p>
+
+
+<h4>GridLayout</h4>
+
+<p>{@link android.widget.GridLayout} is a new view group that places child views in a rectangular
+grid. Unlike {@link android.widget.TableLayout}, {@link android.widget.GridLayout} relies on a flat
+hierarchy and does not make use of intermediate views such as table rows for providing structure.
+Instead, children specify which row(s) and column(s) they should occupy (cells can span multiple
+rows and/or columns), and by default are laid out sequentially across the grid’s rows and columns.
+The {@link android.widget.GridLayout} orientation determines whether sequential children are by
+default laid out horizontally or vertically. Space between children may be specified either by using
+instances of the new {@link android.widget.Space} view or by setting the relevant margin parameters
+on children.</p>
+
+<p>See <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/index.html">ApiDemos</a
+>
+for samples using {@link android.widget.GridLayout}.</p>
+
+
+
+<h4>TextureView</h4>
+
+<p>{@link android.view.TextureView} is a new view that allows you to display a content stream, such
+as a video or an OpenGL scene. Although similar to {@link android.view.SurfaceView}, {@link
+android.view.TextureView} is unique in that it behaves like a regular view, rather than creating a
+separate window, so you can treat it like any other {@link android.view.View} object. For example,
+you can apply transforms, animate it using {@link android.view.ViewPropertyAnimator}, or
+adjust its opacity with {@link android.view.View#setAlpha setAlpha()}.</p>
+
+<p>Beware that {@link android.view.TextureView} works only within a hardware accelerated window.</p>
+
+<p>For more information, see the {@link android.view.TextureView} documentation.</p>
+
+
+<h4>Switch widget</h4>
+
+<p>The new {@link android.widget.Switch} widget is a two-state toggle that users can drag to one
+side or the other (or simply tap) to toggle an option between two states.</p>
+
+<p>You can use the {@code android:textOn} and {@code android:textOff} attributes to specify the text
+to appear on the switch when in the on and off setting. The {@code android:text} attribute also
+allows you to place a label alongside the switch.</p>
+
+<p>For a sample using switches, see the <a
+href="{@docRoot}resources/samples/ApiDemos/res/layout/switches.html">switches.xml</a> layout file
+and respective <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/Switches.html">Switches
+</a> activity.</p>
+
+
+<h4>Popup menus</h4>
+
+<p>Android 3.0 introduced {@link android.widget.PopupMenu} to create short contextual menus that pop
+up at an anchor point you specify (usually at the point of the item selected). Android 4.0 extends
+the {@link android.widget.PopupMenu} with a couple useful features:</p>
+<ul>
+<li>You can now easily inflate the contents of a popup menu from an XML <a
+href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a> with {@link
+android.widget.PopupMenu#inflate inflate()}, passing it the menu resource ID.</li>
+<li>You can also now create a {@link android.widget.PopupMenu.OnDismissListener} that receives a
+callback when the menu is dismissed.</li>
+</ul>
+
+
+<h4>Preferences</h4>
+
+<p>A new {@link android.preference.TwoStatePreference} abstract class serves as the basis for
+preferences that provide a two-state selection option. The new {@link
+android.preference.SwitchPreference} is an extension of {@link
+android.preference.TwoStatePreference} that provides a {@link android.widget.Switch} widget in the
+preference view to allow users to toggle a setting on or off without the need to open an additional
+preference screen or dialog. For example, the Settings application uses a {@link
+android.preference.SwitchPreference} for the Wi-Fi and Bluetooth settings.</p>
+
+
+
+<h4>System themes</h4>
+
+<p>The default theme for all applications that target Android 4.0 (by setting either <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> or
+<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> to
+{@code “14"} or higher) is now the
+"device default" theme: {@link android.R.style#Theme_DeviceDefault Theme.DeviceDefault}. This may be
+the dark Holo theme or a different dark theme defined by the specific device.</p>
+
+<p>The {@link android.R.style#Theme_Holo Theme.Holo} family of themes are guaranteed to not change
+from one device to another when running the same version of Android. If you explicitly
+apply any of the {@link android.R.style#Theme_Holo Theme.Holo} themes to your activities, you can
+rest assured that these themes will not change character on different devices within the same
+platform version.</p>
+
+<p>If you wish for your app to blend in with the overall device theme (such as when different OEMs
+provide different default themes for the system), you should explicitly apply themes from the {@link
+android.R.style#Theme_DeviceDefault Theme.DeviceDefault} family.</p>
+
+
+<h4>Options menu button</h4>
+
+<p>Beginning with Android 4.0, you'll notice that handsets no longer require a Menu hardware button.
+However, there's no need for you to worry about this if your existing application provides an <a
+href="{@docRoot}guide/topics/ui/menus.html#options-menu">options menu</a> and expects there to be a
+Menu button. To ensure that existing apps continue to work as they expect, the system provides an
+on-screen Menu button for apps that were designed for older versions of Android.</p>
+
+<p>For the best user experience, new and updated apps should instead use the {@link
+android.app.ActionBar} to provide access to menu items and set <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to
+{@code "14"} to take advantage of the latest framework default behaviors.</p>
+
+
+
+<h4>Controls for system UI visibility</h4>
+
+<p>Since the early days of Android, the system has managed a UI component known as the <em>status
+bar</em>, which resides at the top of handset devices to deliver information such as the carrier
+signal, time, notifications, and so on. Android 3.0 added the <em>system bar</em> for tablet
+devices, which resides at the bottom of the screen to provide system navigation controls (Home,
+Back, and so forth) and also an interface for elements traditionally provided by the status bar. In
+Android 4.0, the system provides a new type of system UI called the <em>navigation bar</em>. You
+might consider the navigation bar a re-tuned version of the system bar designed for
+handsets—it provides navigation controls
+for devices that don’t have hardware counterparts for navigating the system, but it leaves out the
+system bar's notification UI and setting controls. As such, a device that provides the navigation
+bar also has the status bar at the top.</p>
+
+<p>To this day, you can hide the status bar on handsets using the {@link
+android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN} flag. In Android 4.0, the APIs that control
+the system bar’s visibility have been updated to better reflect the behavior of both the system bar
+and navigation bar:</p>
+<ul>
+<li>The {@link android.view.View#SYSTEM_UI_FLAG_LOW_PROFILE} flag replaces the {@code
+STATUS_BAR_HIDDEN} flag. When set, this flag enables “low profile" mode for the system bar or
+navigation bar. Navigation buttons dim and other elements in the system bar also hide. Enabling
+this is useful for creating more immersive games without distraction for the system navigation
+buttons.</li>
+
+<li>The {@link android.view.View#SYSTEM_UI_FLAG_VISIBLE} flag replaces the {@code
+STATUS_BAR_VISIBLE} flag to request the system bar or navigation bar be visible.</li>
+
+<li>The {@link android.view.View#SYSTEM_UI_FLAG_HIDE_NAVIGATION} is a new flag that requests
+the navigation bar hide completely. Be aware that this works only for the <em>navigation bar</em>
+used by some handsets (it does <strong>not</strong> hide the system bar on tablets). The navigation
+bar returns to view as soon as the system receives user input. As such, this mode is useful
+primarily for video playback or other cases in which the whole screen is needed but user input is
+not required.</li>
+</ul>
+
+<p>You can set each of these flags for the system bar and navigation bar by calling {@link
+android.view.View#setSystemUiVisibility setSystemUiVisibility()} on any view in your activity. The
+window manager combines (OR-together) all flags from all views in your window and
+apply them to the system UI as long as your window has input focus. When your window loses input
+focus (the user navigates away from your app, or a dialog appears), your flags cease to have effect.
+Similarly, if you remove those views from the view hierarchy their flags no longer apply.</p>
+
+<p>To synchronize other events in your activity with visibility changes to the system UI (for
+example, hide the action bar or other UI controls when the system UI hides), you should register a
+{@link android.view.View.OnSystemUiVisibilityChangeListener} to be notified when the visibility
+of the system bar or navigation bar changes.</p>
+
+<p>See the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/OverscanActivity.html">
+OverscanActivity</a> class for a demonstration of different system UI options.</p>
+
+
+
+
+
+<h3 id="Input">Input Framework</h3>
+
+<p>Android 4.0 adds support for cursor hover events and new stylus and mouse button events.</p>
+
+<h4>Hover events</h4>
+
+<p>The {@link android.view.View} class now supports “hover" events to enable richer interactions
+through the use of pointer devices (such as a mouse or other devices that drive an on-screen
+cursor).</p>
+
+<p>To receive hover events on a view, implement the {@link android.view.View.OnHoverListener} and
+register it with {@link android.view.View#setOnHoverListener setOnHoverListener()}. When a hover
+event occurs on the view, your listener receives a call to {@link
+android.view.View.OnHoverListener#onHover onHover()}, providing the {@link android.view.View} that
+received the event and a {@link android.view.MotionEvent} that describes the type of hover event
+that occurred. The hover event can be one of the following:</p>
+<ul>
+<li>{@link android.view.MotionEvent#ACTION_HOVER_ENTER}</li>
+<li>{@link android.view.MotionEvent#ACTION_HOVER_EXIT}</li>
+<li>{@link android.view.MotionEvent#ACTION_HOVER_MOVE}</li>
+</ul>
+
+<p>Your {@link android.view.View.OnHoverListener} should return true from {@link
+android.view.View.OnHoverListener#onHover onHover()} if it handles the hover event. If your
+listener returns false, then the hover event will be dispatched to the parent view as usual.</p>
+
+<p>If your application uses buttons or other widgets that change their appearance based on the
+current state, you can now use the {@code android:state_hovered} attribute in a <a
+href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList">state list drawable</a> to
+provide a different background drawable when a cursor hovers over the view.</p>
+
+<p>For a demonstration of the new hover events, see the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/Hover.html">Hover</a> class in
+ApiDemos.</p>
+
+
+<h4>Stylus and mouse button events</h4>
+
+<p>Android now provides APIs for receiving input from a stylus input device such as a digitizer
+tablet peripheral or a stylus-enabled touch screen.</p>
+
+<p>Stylus input operates in a similar manner to touch or mouse input. When the stylus is in contact
+with the digitizer, applications receive touch events just like they would when a finger is used to
+touch the display. When the stylus is hovering above the digitizer, applications receive hover
+events just like they would when a mouse pointer was being moved across the display when no buttons
+are pressed.</p>
+
+<p>Your application can distinguish between finger, mouse, stylus and eraser input by querying the
+“tool type" associated with each pointer in a {@link android.view.MotionEvent} using {@link
+android.view.MotionEvent#getToolType getToolType()}. The currently defined tool types are: {@link
+android.view.MotionEvent#TOOL_TYPE_UNKNOWN}, {@link android.view.MotionEvent#TOOL_TYPE_FINGER},
+{@link android.view.MotionEvent#TOOL_TYPE_MOUSE}, {@link android.view.MotionEvent#TOOL_TYPE_STYLUS},
+and {@link android.view.MotionEvent#TOOL_TYPE_ERASER}. By querying the tool type, your application
+can choose to handle stylus input in different ways from finger or mouse input.</p>
+
+<p>Your application can also query which mouse or stylus buttons are pressed by querying the “button
+state" of a {@link android.view.MotionEvent} using {@link android.view.MotionEvent#getButtonState
+getButtonState()}. The currently defined button states are: {@link
+android.view.MotionEvent#BUTTON_PRIMARY}, {@link android.view.MotionEvent#BUTTON_SECONDARY}, {@link
+android.view.MotionEvent#BUTTON_TERTIARY}, {@link android.view.MotionEvent#BUTTON_BACK}, and {@link
+android.view.MotionEvent#BUTTON_FORWARD}. For convenience, the back and forward mouse buttons are
+automatically mapped to the {@link android.view.KeyEvent#KEYCODE_BACK} and {@link
+android.view.KeyEvent#KEYCODE_FORWARD} keys. Your application can handle these keys to support
+mouse button based back and forward navigation.</p>
+
+<p>In addition to precisely measuring the position and pressure of a contact, some stylus input
+devices also report the distance between the stylus tip and the digitizer, the stylus tilt angle,
+and the stylus orientation angle. Your application can query this information using {@link
+android.view.MotionEvent#getAxisValue getAxisValue()} with the axis codes {@link
+android.view.MotionEvent#AXIS_DISTANCE}, {@link android.view.MotionEvent#AXIS_TILT}, and {@link
+android.view.MotionEvent#AXIS_ORIENTATION}.</p>
+
+<p>For a demonstration of tool types, button states and the new axis codes, see the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.html">TouchPaint
+</a> class in ApiDemos.</p>
+
+
+
+
+
+
+<h3 id="Properties">Properties</h3>
+
+<p>The new {@link android.util.Property} class provides a fast, efficient, and easy way to specify a
+property on any object that allows callers to generically set/get values on target objects. It also
+allows the functionality of passing around field/method references and allows code to set/get values
+of the property without knowing the details of what the fields/methods are.</p>
+
+<p>For example, if you want to set the value of field {@code bar} on object {@code foo}, you would
+previously do this:</p>
+<pre>
+foo.bar = value;
+</pre>
+
+<p>If you want to call the setter for an underlying private field {@code bar}, you would previously
+do this:</p>
+<pre>
+foo.setBar(value);
+</pre>
+
+<p>However, if you want to pass around the {@code foo} instance and have some other code set the
+{@code bar} value, there is really no way to do it prior to Android 4.0.</p>
+
+<p>Using the {@link android.util.Property} class, you can declare a {@link android.util.Property}
+object {@code BAR} on class {@code Foo} so that you can set the field on instance {@code foo} of
+class {@code Foo} like this:</p>
+<pre>
+BAR.set(foo, value);
+</pre>
+
+<p>The {@link android.view.View} class now leverages the {@link android.util.Property} class to
+allow you to set various fields, such as transform properties that were added in Android 3.0 ({@link
+android.view.View#ROTATION}, {@link android.view.View#ROTATION_X}, {@link
+android.view.View#TRANSLATION_X}, etc.).</p>
+
+<p>The {@link android.animation.ObjectAnimator} class also uses the {@link android.util.Property}
+class, so you can create an {@link android.animation.ObjectAnimator} with a {@link
+android.util.Property}, which is faster, more efficient, and more type-safe than the string-based
+approach.</p>
+
+
+
+
+
+
+<h3 id="HwAccel">Hardware Acceleration</h3>
+
+<p>Beginning with Android 4.0, hardware acceleration for all windows is enabled by default if your
+application has set either <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> or
+<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> to
+{@code “14"} or higher. Hardware acceleration generally results in smoother animations, smoother
+scrolling, and overall better performance and response to user interaction.</p>
+
+<p>If necessary, you can manually disable hardware acceleration with the <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#hwaccel">{@code hardwareAccelerated}</a>
+attribute for individual <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
+<activity>}</a> elements or the <a
+href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
+element. You can alternatively disable hardware acceleration for individual views by calling {@link
+android.view.View#setLayerType setLayerType(LAYER_TYPE_SOFTWARE)}.</p>
+
+<p>For more information about hardware acceleration, including a list of unsupported drawing
+operations, see the <a href="{@docRoot}guide/topics/graphics/hardware-accel.html">Hardware
+Acceleration</a> document.</p>
+
+
+
+<h3 id="Jni">JNI Changes</h3>
+
+<p>In previous versions of Android, JNI local references weren’t indirect handles; Android used
+direct pointers. This wasn't a problem as long as the garbage collector didn't move objects, but it
+seemed to work because it made it possible to write buggy code. In Android 4.0, the system now uses
+indirect references in order to detect these bugs.</p>
+
+<p>The ins and outs of JNI local references are described in “Local and Global References" in <a
+href="{@docRoot}guide/practices/jni.html">JNI Tips</a>. In Android 4.0, <a
+href="http://android-developers.blogspot.com/2011/07/debugging-android-jni-with-checkjni.html">
+CheckJNI</a> has been enhanced to detect these errors. Watch the <a
+href="http://android-developers.blogspot.com/">Android Developers Blog</a> for an upcoming post
+about common errors with JNI references and how you can fix them.</p>
+
+<p>This change in the JNI implementation only affects apps that target Android 4.0 by setting either
+the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+targetSdkVersion}</a> or <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+minSdkVersion}</a> to {@code “14"} or higher. If you’ve set these attributes to any lower value,
+then JNI local references behave the same as in previous versions.</p>
+
+
+
+
+
+<h3 id="WebKit">WebKit</h3>
+<ul>
+<li>WebKit updated to version 534.30</li>
+<li>Support for Indic fonts (Devanagari, Bengali, and Tamil, including the complex character support
+needed for combining glyphs) in {@link android.webkit.WebView} and the built-in Browser</li>
+<li>Support for Ethiopic, Georgian, and Armenian fonts in {@link android.webkit.WebView} and the
+built-in Browser</li>
+<li>Support for <a
+href="http://google-opensource.blogspot.com/2009/05/introducing-webdriver.html">WebDriver</a> makes
+it easier for you to test apps that use {@link android.webkit.WebView}</li>
+</ul>
+
+
+<h4>Android Browser</h4>
+
+<p>The Browser application adds the following features to support web applications:</p>
+<ul>
+<li>Updated V8 JavaScript compiler for faster performance</li>
+<li>Plus other notable enhancements carried over from <a
+href="{@docRoot}about/versions/android-3.0.html">Android
+3.0</a> are now available for handsets:
+<ul>
+<li>Support for fixed position elements on all pages</li>
+<li><a href="http://dev.w3.org/2009/dap/camera/">HTML media capture</a></li>
+<li><a href="http://dev.w3.org/geo/api/spec-source-orientation.html">Device orientation
+events</a></li>
+<li><a href="http://www.w3.org/TR/css3-3d-transforms/">CSS 3D transformations</a></li>
+</ul>
+</li>
+</ul>
+
+
+
+<h3 id="Permissions">Permissions</h3>
+
+<p>The following are new permissions:</p>
+<ul>
+<li>{@link android.Manifest.permission#ADD_VOICEMAIL}: Allows a voicemail service to add voicemail
+messages to the device.</li>
+<li>{@link android.Manifest.permission#BIND_TEXT_SERVICE}: A service that implements {@link
+android.service.textservice.SpellCheckerService} must require this permission for itself.</li>
+<li>{@link android.Manifest.permission#BIND_VPN_SERVICE}: A service that implements {@link
+android.net.VpnService} must require this permission for itself.</li>
+<li>{@link android.Manifest.permission#READ_PROFILE}: Provides read access to the {@link
+android.provider.ContactsContract.Profile} provider.</li>
+<li>{@link android.Manifest.permission#WRITE_PROFILE}: Provides write access to the {@link
+android.provider.ContactsContract.Profile} provider.</li>
+</ul>
+
+
+
+<h3 id="DeviceFeatures">Device Features</h3>
+
+<p>The following are new device features:</p>
+<ul>
+<li>{@link android.content.pm.PackageManager#FEATURE_WIFI_DIRECT}: Declares that the application
+uses
+Wi-Fi for peer-to-peer communications.</li>
+</ul>
+
+
+<div class="special" style="margin-top:3em">
+<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API Level
+{@sdkPlatformApiLevel}), see the <a
+href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API Differences Report</a>.</p>
+</div>
+
+
+<h2 id="Honeycomb">Previous APIs</h2>
+
+<p>In addition to everything above, Android 4.0 naturally supports all APIs from previous releases.
+Because the Android 3.x platform is available only for large-screen devices, if you've
+been developing primarily for handsets, then you might not be aware of all the APIs added to Android
+in these recent releases.</p>
+
+<p>Here's a look at some of the most notable APIs you might have missed that are now available
+on handsets as well:</p>
+
+<dl>
+ <dt><a href="android-3.0.html">Android 3.0</a></dt>
+ <dd>
+ <ul>
+ <li>{@link android.app.Fragment}: A framework component that allows you to separate distinct
+elements of an activity into self-contained modules that define their own UI and lifecycle. See the
+<a href="{@docRoot}guide/components/fragments.html">Fragments</a> developer guide.</li>
+ <li>{@link android.app.ActionBar}: A replacement for the traditional title bar at the top of
+the activity window. It includes the application logo in the left corner and provides a new
+interface for menu items. See the
+<a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide.</li>
+ <li>{@link android.content.Loader}: A framework component that facilitates asynchronous
+loading of data in combination with UI components to dynamically load data without blocking the
+main thread. See the
+<a href="{@docRoot}guide/components/loaders.html">Loaders</a> developer guide.</li>
+ <li>System clipboard: Applications can copy and paste data (beyond mere text) to and from
+the system-wide clipboard. Clipped data can be plain text, a URI, or an intent. See the
+<a href="{@docRoot}guide/topics/text/copy-paste.html">Copy and Paste</a> developer guide.</li>
+ <li>Drag and drop: A set of APIs built into the view framework that facilitates drag and drop
+operations. See the
+<a href="{@docRoot}guide/topics/ui/drag-drop.html">Drag and Drop</a> developer guide.</li>
+ <li>An all new flexible animation framework allows you to animate arbitrary properties of any
+object (View, Drawable, Fragment, Object, or anything else) and define animation aspects such
+as duration, interpolation, repeat and more. The new framework makes Animations in Android
+simpler than ever. See the
+<a href="{@docRoot}guide/topics/graphics/prop-animation.html">Property Animation</a> developer
+guide.</li>
+ <li>RenderScript graphics and compute engine: RenderScript offers a high performance 3D
+graphics rendering and compute API at the native level, which you write in the C (C99 standard),
+providing the type of performance you expect from a native environment while remaining portable
+across various CPUs and GPUs. See the
+<a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> developer
+guide.</li>
+ <li>Hardware accelerated 2D graphics: You can now enable the OpenGL renderer for your
+application by setting {android:hardwareAccelerated="true"} in your manifest element's <a
+href="{@docRoot}guide/topics/manifest/application-element.html"><code><application></code></a>
+element or for individual <a
+href="{@docRoot}guide/topics/manifest/activity-element.html"><code><activity></code></a>
+elements. This results
+in smoother animations, smoother scrolling, and overall better performance and response to user
+interaction.
+ <p class="note"><strong>Note:</strong> If you set your application's <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to
+{@code "14"} or higher, hardware acceleration is enabled by default.</p></li>
+ <li>And much, much more. See the <a href="android-3.0.html">Android 3.0 Platform</a>
+notes for more information.</li>
+ </ul>
+ </dd>
+
+ <dt><a href="android-3.1.html">Android 3.1</a></dt>
+ <dd>
+ <ul>
+ <li>USB APIs: Powerful new APIs for integrating connected peripherals with
+Android applications. The APIs are based on a USB stack and services that are
+built into the platform, including support for both USB host and device interactions. See the <a
+href="{@docRoot}guide/topics/connectivity/usb/index.html">USB Host and Accessory</a> developer guide.</li>
+ <li>MTP/PTP APIs: Applications can interact directly with connected cameras and other PTP
+devices to receive notifications when devices are attached and removed, manage files and storage on
+those devices, and transfer files and metadata to and from them. The MTP API implements the PTP
+(Picture Transfer Protocol) subset of the MTP (Media Transfer Protocol) specification. See the
+{@link android.mtp} documentation.</li>
+ <li>RTP APIs: Android exposes an API to its built-in RTP (Real-time Transport Protocol) stack,
+which applications can use to manage on-demand or interactive data streaming. In particular, apps
+that provide VOIP, push-to-talk, conferencing, and audio streaming can use the API to initiate
+sessions and transmit or receive data streams over any available network. See the {@link
+android.net.rtp} documentation.</li>
+ <li>Support for joysticks and other generic motion inputs.</li>
+ <li>See the <a href="android-3.1.html">Android 3.1 Platform</a>
+notes for many more new APIs.</li>
+ </ul>
+ </dd>
+
+ <dt><a href="android-3.2.html">Android 3.2</a></dt>
+ <dd>
+ <ul>
+ <li>New screens support APIs that give you more control over how your applications are
+displayed across different screen sizes. The API extends the existing screen support model with the
+ability to precisely target specific screen size ranges by dimensions, measured in
+density-independent pixel units (such as 600dp or 720dp wide), rather than by their generalized
+screen sizes (such as large or xlarge). For example, this is important in order to help you
+distinguish between a 5" device and a 7" device, which would both traditionally be bucketed as
+"large" screens. See the blog post, <a
+href="http://android-developers.blogspot.com/2011/07/new-tools-for-managing-screen-sizes.html">
+New Tools for Managing Screen Sizes</a>.</li>
+ <li>New constants for <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> to
+declare landscape or portrait screen orientation requirements.</li>
+ <li>The device "screen size" configuration now changes during a screen orientation
+change. If your app targets API level 13 or higher, you must handle the {@code "screenSize"}
+configuration change if you also want to handle the {@code "orientation"} configuration change. See
+<a href="{@docRoot}guide/topics/manifest/activity-element.html#config">{@code
+android:configChanges}</a> for more information.</li>
+ <li>See the <a href="android-3.2.html">Android 3.2 Platform</a>
+notes for other new APIs.</li>
+ </ul>
+ </dd>
+
+</dl>
+
+
+
+
+<h3 id="api-level">API Level</h3>
+
+<p>The Android {@sdkPlatformVersion} API is assigned an integer
+identifier—<strong>{@sdkPlatformApiLevel}</strong>—that is stored in the system itself.
+This identifier, called the "API level", allows the system to correctly determine whether an
+application is compatible with the system, prior to installing the application. </p>
+
+<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need compile the
+application against an Android platform that supports API level {@sdkPlatformApiLevel} or
+higher. Depending on your needs, you might also need to add an
+<code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code> attribute to the
+<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a>
+element.</p>
+
+<p>For more information, read <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">What is API
+Level?</a></p>
diff --git a/docs/html/about/versions/api-levels.jd b/docs/html/about/versions/api-levels.jd
new file mode 100644
index 0000000..525e2cb
--- /dev/null
+++ b/docs/html/about/versions/api-levels.jd
@@ -0,0 +1,421 @@
+page.title=Android API Levels
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+<ol>
+ <li><a href="#intro">What is API Level?</a></li>
+ <li><a href="#uses">Uses of API Level in Android</a></li>
+ <li><a href="#considerations">Development Considerations</a>
+ <ol>
+ <li><a href="#fc">Application forward compatibility</a></li>
+ <li><a href="#bc">Application backward compatibility</a></li>
+ <li><a href="#platform">Selecting a platform version and API Level</a></li>
+ <li><a href="#apilevel">Declaring a minimum API Level</a></li>
+ <li><a href="#testing">Testing against higher API Levels</a></li>
+ </ol>
+ </li>
+ <li><a href="#provisional">Using a Provisional API Level</a></li>
+ <li><a href="#filtering">Filtering the Documentation</a></li>
+</ol>
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a> manifest element</li>
+ </ol>
+
+</div>
+</div>
+
+<p>As you develop your application on Android, it's useful to understand the
+platform's general approach to API change management. It's also important to
+understand the API Level identifier and the role it plays in ensuring your
+application's compatibility with devices on which it may be installed. </p>
+
+<p>The sections below provide information about API Level and how it affects
+your applications. </p>
+
+<p>For information about how to use the "Filter by API Level" control
+available in the API reference documentation, see
+<a href="#filtering">Filtering the documentation</a> at the
+end of this document. </p>
+
+<h2 id="intro">What is API Level?</h2>
+
+<p>API Level is an integer value that uniquely identifies the framework API
+revision offered by a version of the Android platform.</p>
+
+<p>The Android platform provides a framework API that applications can use to
+interact with the underlying Android system. The framework API consists of:</p>
+
+<ul>
+<li>A core set of packages and classes</li>
+<li>A set of XML elements and attributes for declaring a manifest file</li>
+<li>A set of XML elements and attributes for declaring and accessing resources</li>
+<li>A set of Intents</li>
+<li>A set of permissions that applications can request, as well as permission
+enforcements included in the system</li>
+</ul>
+
+<p>Each successive version of the Android platform can include updates to the
+Android application framework API that it delivers. </p>
+
+<p>Updates to the framework API are designed so that the new API remains
+compatible with earlier versions of the API. That is, most changes in the API
+are additive and introduce new or replacement functionality. As parts of the API
+are upgraded, the older replaced parts are deprecated but are not removed, so
+that existing applications can still use them. In a very small number of cases,
+parts of the API may be modified or removed, although typically such changes are
+only needed to ensure API robustness and application or system security. All
+other API parts from earlier revisions are carried forward without
+modification.</p>
+
+<p>The framework API that an Android platform delivers is specified using an
+integer identifier called "API Level". Each Android platform version supports
+exactly one API Level, although support is implicit for all earlier API Levels
+(down to API Level 1). The initial release of the Android platform provided
+API Level 1 and subsequent releases have incremented the API Level.</p>
+
+<p>The following table specifies the API Level supported by each version of the
+Android platform.</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-4.0.3.html">Android 4.0.3</a></td>
+ <td><a href="{@docRoot}sdk/api_diff/15/changes.html" title="Diff Report">15</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1}</td>
+ <td rowspan="2"><a href="{@docRoot}about/versions/android-4.0-highlights.html">Platform
+Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-4.0.html">Android 4.0, 4.0.1, 4.0.2</a></td>
+ <td><a href="{@docRoot}sdk/api_diff/14/changes.html" title="Diff Report">14</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH}</td>
+ </tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-3.2.html">Android 3.2</a></td>
+ <td><a href="{@docRoot}sdk/api_diff/13/changes.html" title="Diff Report">13</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}</td>
+ <td><!-- <a href="{@docRoot}about/versions/android-3.2-highlights.html">Platform Highlights</a>--></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-3.1.html">Android 3.1.x</a></td>
+ <td><a href="{@docRoot}sdk/api_diff/12/changes.html" title="Diff Report">12</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB_MR1}</td>
+ <td><a href="{@docRoot}about/versions/android-3.1-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-3.0.html">Android 3.0.x</td>
+ <td><a href="{@docRoot}sdk/api_diff/11/changes.html" title="Diff Report">11</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB}</td>
+ <td><a href="{@docRoot}about/versions/android-3.0-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.3.3.html">Android 2.3.4<br>Android 2.3.3</td>
+ <td><a href="{@docRoot}sdk/api_diff/10/changes.html" title="Diff Report">10</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#GINGERBREAD_MR1}</td>
+ <td rowspan="2"><a href="{@docRoot}about/versions/android-2.3-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.3.html">Android 2.3.2<br>Android 2.3.1<br>Android 2.3</td>
+ <td><a href="{@docRoot}sdk/api_diff/9/changes.html" title="Diff Report">9</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#GINGERBREAD}</td>
+ </tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.2.html">Android 2.2.x</td>
+ <td ><a href="{@docRoot}sdk/api_diff/8/changes.html" title="Diff Report">8</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#FROYO}</td>
+ <td><a href="{@docRoot}about/versions/android-2.2-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.1.html">Android 2.1.x</td>
+ <td><a href="{@docRoot}sdk/api_diff/7/changes.html" title="Diff Report">7</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#ECLAIR_MR1}</td>
+ <td rowspan="3" ><a href="{@docRoot}about/versions/android-2.0-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.0.1.html">Android 2.0.1</td>
+ <td><a href="{@docRoot}sdk/api_diff/6/changes.html" title="Diff Report">6</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#ECLAIR_0_1}</td>
+ </tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.0.html">Android 2.0</td>
+ <td><a href="{@docRoot}sdk/api_diff/5/changes.html" title="Diff Report">5</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#ECLAIR}</td>
+ </tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-1.6.html">Android 1.6</td>
+ <td><a href="{@docRoot}sdk/api_diff/4/changes.html" title="Diff Report">4</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#DONUT}</td>
+ <td><a href="{@docRoot}about/versions/android-1.6-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-1.5.html">Android 1.5</td>
+ <td><a href="{@docRoot}sdk/api_diff/3/changes.html" title="Diff Report">3</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#CUPCAKE}</td>
+ <td><a href="{@docRoot}about/versions/android-1.5-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-1.1.html">Android 1.1</td>
+ <td>2</td>
+ <td>{@link android.os.Build.VERSION_CODES#BASE_1_1}</td><td></td></tr>
+
+ <tr><td>Android 1.0</td>
+ <td>1</td>
+ <td>{@link android.os.Build.VERSION_CODES#BASE}</td>
+ <td></td></tr>
+</table>
+
+
+<h2 id="uses">Uses of API Level in Android</h2>
+
+<p>The API Level identifier serves a key role in ensuring the best possible
+experience for users and application developers:
+
+<ul>
+<li>It lets the Android platform describe the maximum framework API revision
+that it supports</li>
+<li>It lets applications describe the framework API revision that they
+require</li>
+<li>It lets the system negotiate the installation of applications on the user's
+device, such that version-incompatible applications are not installed.</li>
+</ul>
+
+<p>Each Android platform version stores its API Level identifier internally, in
+the Android system itself. </p>
+
+<p>Applications can use a manifest element provided by the framework API —
+<code><uses-sdk></code> — to describe the minimum and maximum API
+Levels under which they are able to run, as well as the preferred API Level that
+they are designed to support. The element offers three key attributes:</p>
+
+<ul>
+<li><code>android:minSdkVersion</code> — Specifies the minimum API Level
+on which the application is able to run. The default value is "1".</li>
+<li><code>android:targetSdkVersion</code> — Specifies the API Level
+on which the application is designed to run. In some cases, this allows the
+application to use manifest elements or behaviors defined in the target
+API Level, rather than being restricted to using only those defined
+for the minimum API Level.</li>
+<li><code>android:maxSdkVersion</code> — Specifies the maximum API Level
+on which the application is able to run. <strong>Important:</strong> Please read the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+documentation before using this attribute. </li>
+</ul>
+
+<p>For example, to specify the minimum system API Level that an application
+requires in order to run, the application would include in its manifest a
+<code><uses-sdk></code> element with a <code>android:minSdkVersion</code>
+attribute. The value of <code>android:minSdkVersion</code> would be the integer
+corresponding to the API Level of the earliest version of the Android platform
+under which the application can run. </p>
+
+<p>When the user attempts to install an application, or when revalidating an
+appplication after a system update, the Android system first checks the
+<code><uses-sdk></code> attributes in the application's manifest and
+compares the values against its own internal API Level. The system allows the
+installation to begin only if these conditions are met:</p>
+
+<ul>
+<li>If a <code>android:minSdkVersion</code> attribute is declared, its value
+must be less than or equal to the system's API Level integer. If not declared,
+the system assumes that the application requires API Level 1. </li>
+<li>If a <code>android:maxSdkVersion</code> attribute is declared, its value
+must be equal to or greater than the system's API Level integer.
+If not declared, the system assumes that the application
+has no maximum API Level. Please read the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+documentation for more information about how the system handles this attribute.</li>
+</ul>
+
+<p>When declared in an application's manifest, a <code><uses-sdk></code>
+element might look like this: </p>
+
+<pre><manifest>
+ <uses-sdk android:minSdkVersion="5" />
+ ...
+</manifest></pre>
+
+<p>The principal reason that an application would declare an API Level in
+<code>android:minSdkVersion</code> is to tell the Android system that it is
+using APIs that were <em>introduced</em> in the API Level specified. If the
+application were to be somehow installed on a platform with a lower API Level,
+then it would crash at run-time when it tried to access APIs that don't exist.
+The system prevents such an outcome by not allowing the application to be
+installed if the lowest API Level it requires is higher than that of the
+platform version on the target device.</p>
+
+<p>For example, the {@link android.appwidget} package was introduced with API
+Level 3. If an application uses that API, it must declare a
+<code>android:minSdkVersion</code> attribute with a value of "3". The
+application will then be installable on platforms such as Android 1.5 (API Level
+3) and Android 1.6 (API Level 4), but not on the Android 1.1 (API Level 2) and
+Android 1.0 platforms (API Level 1).</p>
+
+<p>For more information about how to specify an application's API Level
+requirements, see the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+ section of the manifest file documentation.</p>
+
+
+<h2 id="considerations">Development Considerations</h2>
+
+<p>The sections below provide information related to API level that you should
+consider when developing your application.</p>
+
+<h3 id="fc">Application forward compatibility</h3>
+
+<p>Android applications are generally forward-compatible with new versions of
+the Android platform.</p>
+
+<p>Because almost all changes to the framework API are additive, an Android
+application developed using any given version of the API (as specified by its
+API Level) is forward-compatible with later versions of the Android platform and
+higher API levels. The application should be able to run on all later versions
+of the Android platform, except in isolated cases where the application uses a
+part of the API that is later removed for some reason. </p>
+
+<p>Forward compatibility is important because many Android-powered devices
+receive over-the-air (OTA) system updates. The user may install your
+application and use it successfully, then later receive an OTA update to a new
+version of the Android platform. Once the update is installed, your application
+will run in a new run-time version of the environment, but one that has the API
+and system capabilities that your application depends on. </p>
+
+<p>In some cases, changes <em>below</em> the API, such those in the underlying
+system itself, may affect your application when it is run in the new
+environment. For that reason it's important for you, as the application
+developer, to understand how the application will look and behave in each system
+environment. To help you test your application on various versions of the Android
+platform, the Android SDK includes multiple platforms that you can download.
+Each platform includes a compatible system image that you can run in an AVD, to
+test your application. </p>
+
+<h3 id="bc">Application backward compatibility</h3>
+
+<p>Android applications are not necessarily backward compatible with versions of
+the Android platform older than the version against which they were compiled.
+</p>
+
+<p>Each new version of the Android platform can include new framework APIs, such
+as those that give applications access to new platform capabilities or replace
+existing API parts. The new APIs are accessible to applications when running on
+the new platform and, as mentioned above, also when running on later versions of
+the platform, as specified by API Level. Conversely, because earlier versions of
+the platform do not include the new APIs, applications that use the new APIs are
+unable to run on those platforms.</p>
+
+<p>Although it's unlikely that an Android-powered device would be downgraded to
+a previous version of the platform, it's important to realize that there are
+likely to be many devices in the field that run earlier versions of the
+platform. Even among devices that receive OTA updates, some might lag and
+might not receive an update for a significant amount of time. </p>
+
+<h3 id="platform">Selecting a platform version and API Level</h3>
+
+<p>When you are developing your application, you will need to choose
+the platform version against which you will compile the application. In
+general, you should compile your application against the lowest possible
+version of the platform that your application can support.
+
+<p>You can determine the lowest possible platform version by compiling the
+application against successively lower build targets. After you determine the
+lowest version, you should create an AVD using the corresponding platform
+version (and API Level) and fully test your application. Make sure to declare a
+<code>android:minSdkVersion</code> attribute in the application's manifest and
+set its value to the API Level of the platform version. </p>
+
+<h3 id="apilevel">Declaring a minimum API Level</h3>
+
+<p>If you build an application that uses APIs or system features introduced in
+the latest platform version, you should set the
+<code>android:minSdkVersion</code> attribute to the API Level of the latest
+platform version. This ensures that users will only be able to install your
+application if their devices are running a compatible version of the Android
+platform. In turn, this ensures that your application can function properly on
+their devices. </p>
+
+<p>If your application uses APIs introduced in the latest platform version but
+does <em>not</em> declare a <code>android:minSdkVersion</code> attribute, then
+it will run properly on devices running the latest version of the platform, but
+<em>not</em> on devices running earlier versions of the platform. In the latter
+case, the application will crash at runtime when it tries to use APIs that don't
+exist on the earlier versions.</p>
+
+<h3 id="testing">Testing against higher API Levels</h3>
+
+<p>After compiling your application, you should make sure to test it on the
+platform specified in the application's <code>android:minSdkVersion</code>
+attribute. To do so, create an AVD that uses the platform version required by
+your application. Additionally, to ensure forward-compatibility, you should run
+and test the application on all platforms that use a higher API Level than that
+used by your application. </p>
+
+<p>The Android SDK includes multiple platform versions that you can use,
+including the latest version, and provides an updater tool that you can use to
+download other platform versions as necessary. </p>
+
+<p>To access the updater, use the <code>android</code> command-line tool,
+located in the <sdk>/tools directory. You can launch the SDK updater by
+executing <code>android sdk</code>. You can
+also simply double-click the android.bat (Windows) or android (OS X/Linux) file.
+In ADT, you can also access the updater by selecting
+<strong>Window</strong> > <strong>Android SDK
+Manager</strong>.</p>
+
+<p>To run your application against different platform versions in the emulator,
+create an AVD for each platform version that you want to test. For more
+information about AVDs, see <a
+href="{@docRoot}tools/devices/index.html">Creating and Managing Virtual Devices</a>. If
+you are using a physical device for testing, ensure that you know the API Level
+of the Android platform it runs. See the table at the top of this document for
+a list of platform versions and their API Levels. </p>
+
+<h2 id="provisional">Using a Provisional API Level</h2>
+
+<p>In some cases, an "Early Look" Android SDK platform may be available. To let
+you begin developing on the platform although the APIs may not be final, the
+platform's API Level integer will not be specified. You must instead use the
+platform's <em>provisional API Level</em> in your application manifest, in order
+to build applications against the platform. A provisional API Level is not an
+integer, but a string matching the codename of the unreleased platform version.
+The provisional API Level will be specified in the release notes for the Early
+Look SDK release notes and is case-sensitive.</p>
+
+<p>The use of a provisional API Level is designed to protect developers and
+device users from inadvertently publishing or installing applications based on
+the Early Look framework API, which may not run properly on actual devices
+running the final system image.</p>
+
+<p>The provisional API Level will only be valid while using the Early Look SDK
+and can only be used to run applications in the emulator. An application using
+the provisional API Level can never be installed on an Android device. At the
+final release of the platform, you must replace any instances of the provisional
+API Level in your application manifest with the final platform's actual API
+Level integer.</p>
+
+
+<h2 id="filtering">Filtering the Reference Documentation by API Level</h2>
+
+<p>Reference documentation pages on the Android Developers site offer a "Filter
+by API Level" control in the top-right area of each page. You can use the
+control to show documentation only for parts of the API that are actually
+accessible to your application, based on the API Level that it specifies in
+the <code>android:minSdkVersion</code> attribute of its manifest file. </p>
+
+<p>To use filtering, select the checkbox to enable filtering, just below the
+page search box. Then set the "Filter by API Level" control to the same API
+Level as specified by your application. Notice that APIs introduced in a later
+API Level are then grayed out and their content is masked, since they would not
+be accessible to your application. </p>
+
+<p>Filtering by API Level in the documentation does not provide a view
+of what is new or introduced in each API Level — it simply provides a way
+to view the entire API associated with a given API Level, while excluding API
+elements introduced in later API Levels.</p>
+
+<p>If you decide that you don't want to filter the API documentation, just
+disable the feature using the checkbox. By default, API Level filtering is
+disabled, so that you can view the full framework API, regardless of API Level.
+</p>
+
+<p>Also note that the reference documentation for individual API elements
+specifies the API Level at which each element was introduced. The API Level
+for packages and classes is specified as "Since <api level>" at the
+top-right corner of the content area on each documentation page. The API Level
+for class members is specified in their detailed description headers,
+at the right margin. </p>
diff --git a/docs/html/about/versions/index.jd b/docs/html/about/versions/index.jd
new file mode 100644
index 0000000..30826c0
--- /dev/null
+++ b/docs/html/about/versions/index.jd
@@ -0,0 +1,141 @@
+page.title=App Framework
+@jd:body
+
+<p>Android is a software stack for mobile devices that includes an operating
+system, middleware and key applications. The <a
+href="http://developer.android.com/sdk/index.html">Android SDK</a>
+provides the tools and APIs necessary to begin developing applications on the
+Android platform using the Java programming language.</p>
+
+<h2>Features</h2>
+
+<ul>
+ <li><strong>Application framework</strong> enabling reuse and replacement
+ of components</li>
+ <li><strong>Dalvik virtual machine</strong> optimized for mobile
+ devices</li>
+ <li><strong>Integrated browser</strong> based on the open source <a
+ href="http://webkit.org/">WebKit</a> engine </li>
+ <li><strong>Optimized graphics</strong> powered by a custom 2D graphics library; 3D
+ graphics based on the OpenGL ES 1.0 specification (hardware acceleration
+ optional)</li>
+ <li><strong>SQLite</strong> for structured data storage</li>
+ <li><strong>Media support</strong> for common audio, video, and still
+ image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG,
+ GIF)</li>
+ <li><strong>GSM Telephony</strong> (hardware dependent)</li>
+ <li><strong>Bluetooth, EDGE, 3G, and WiFi</strong> (hardware dependent)</li>
+ <li><strong>Camera, GPS, compass, and accelerometer</strong> (hardware dependent)</li>
+ <li><strong>Rich development environment</strong> including a device
+ emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE</li>
+</ul>
+
+<a name="os_architecture" id="os_architecture"></a>
+<h2>Android Architecture</h2>
+
+<p>The following diagram shows the major components of the Android operating
+system. Each section is described in more detail below.</p>
+
+<p><img src="{@docRoot}images/system-architecture.jpg" alt="Android System Architecture" width="713" height="512"></p>
+
+<a name="applications" id="applications"></a>
+<h2>Applications</h2>
+
+<p>Android will ship with a set of core applications including an email
+client, SMS program, calendar, maps, browser, contacts, and
+others. All applications are written using the Java programming language.</p>
+
+<a name="application_framework" id="application_framework"></a>
+<h2>Application Framework</h2>
+
+<p>By providing an open development platform, Android
+offers developers the ability to build extremely rich and innovative
+applications. Developers are free to take advantage of the
+device hardware, access location information, run background services, set alarms,
+add notifications to the status bar, and much, much more. </p>
+
+<p>Developers have full access to the same framework APIs used by the core
+applications. The application architecture is designed to simplify the reuse
+of components; any application can publish its capabilities and any other
+application may then make use of those capabilities (subject to security
+constraints enforced by the framework). This same mechanism allows components
+to be replaced by the user.</p>
+
+<p>Underlying all applications is a set of services and systems, including:
+<ul>
+ <li>A rich and extensible set of <a
+ href="{@docRoot}resources/tutorials/views/index.html">Views</a> that can be used to
+ build an application, including lists, grids, text boxes, buttons, and even
+ an embeddable web browser</li>
+ <li><a href="{@docRoot}guide/topics/providers/content-providers.html">Content
+ Providers</a> that enable applications to access data from other
+ applications (such as Contacts), or to share their own data</li> <li>A <a
+ href="{@docRoot}guide/topics/resources/resources-i18n.html">Resource
+ Manager</a>, providing access to non-code resources such as localized
+ strings, graphics, and layout files</li>
+ <li>A {@link android.app.NotificationManager Notification Manager} that enables
+ all applications to display custom alerts in the status bar</li>
+ <li>An {@link android.app.Activity Activity Manager} that manages the
+ lifecycle of applications and provides a common navigation backstack</li>
+</ul>
+
+<p>For more details and a walkthrough of an application, see the <a
+href="{@docRoot}resources/tutorials/notepad/index.html">Notepad Tutorial</a>.</p>
+
+<a name="libraries" id="libraries"></a>
+<h2>Libraries</h2>
+
+<p>Android includes a set of C/C++ libraries used by various components of the
+Android system. These capabilities are exposed to developers through the
+Android application framework. Some of the core libraries are listed below:</p>
+<ul>
+ <li><strong>System C library</strong> - a BSD-derived implementation of
+ the standard C system library (libc), tuned for embedded Linux-based
+ devices</li>
+ <li><strong>Media Libraries</strong> - based on PacketVideo's OpenCORE;
+ the libraries support playback and recording of many popular audio and video
+ formats, as well as static image files, including MPEG4, H.264, MP3, AAC,
+ AMR, JPG, and PNG</li>
+ <li><strong>Surface Manager</strong> - manages access to the display
+ subsystem and seamlessly composites 2D and 3D graphic layers from multiple
+ applications</li>
+ <li><strong>LibWebCore</strong> - a modern web browser engine which
+ powers both the Android browser and an embeddable web view</li>
+ <li><strong>SGL</strong> - the underlying 2D graphics
+ engine</li>
+ <li><strong>3D libraries</strong> - an implementation based on
+ OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration
+ (where available) or the included, highly optimized 3D software
+ rasterizer</li>
+ <li><strong>FreeType</strong> - bitmap and vector font rendering</li>
+ <li><strong>SQLite</strong> - a powerful and lightweight relational
+ database engine available to all applications</li>
+</ul>
+
+<a name="runtime" id="runtime"></a>
+
+<h2>Android Runtime</h2>
+
+<p>Android includes a set of core libraries that provides most of
+the functionality available in the core libraries of the Java programming
+language.</p>
+
+<p>Every Android application runs in its own process, with its own instance of
+the Dalvik virtual machine. Dalvik has been written so that a device can run
+multiple VMs efficiently. The Dalvik VM executes files in the Dalvik
+Executable (.dex) format which is optimized for minimal memory
+footprint. The VM is register-based, and runs classes
+compiled by a Java language compiler that have been transformed into the .dex
+format by the included "dx" tool.</p>
+
+<p>The Dalvik VM relies on the Linux kernel for underlying functionality such
+as threading and low-level memory management.</p>
+
+<a name="kernel" id="kernel"></a>
+
+<h2>Linux Kernel</h2>
+
+<p>Android relies on Linux version 2.6 for core system services such as
+security, memory management, process management, network stack, and driver
+model. The kernel also acts as an abstraction layer between the hardware and
+the rest of the software stack.</p>
diff --git a/docs/html/community/index.html b/docs/html/community/index.html
deleted file mode 100644
index fb2a0d35..0000000
--- a/docs/html/community/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/resources/community-groups.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should have been redirected. Please <a
-href="http://developer.android.com/resources/community-groups.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/design/building-blocks/index.jd b/docs/html/design/building-blocks/index.jd
index 52b4915..d915aae 100644
--- a/docs/html/design/building-blocks/index.jd
+++ b/docs/html/design/building-blocks/index.jd
@@ -10,7 +10,7 @@
#text-overlay {
position: absolute;
- left: 10px;
+ left: 0;
top: 472px;
width: 450px;
}
diff --git a/docs/html/design/building-blocks/progress.jd b/docs/html/design/building-blocks/progress.jd
index b188538..03fc09c 100644
--- a/docs/html/design/building-blocks/progress.jd
+++ b/docs/html/design/building-blocks/progress.jd
@@ -1,5 +1,4 @@
page.title=Progress and Activity
-header.title=Feedback
@jd:body
<p>When an operation of interest to the user is taking place over a relatively long period of time,
diff --git a/docs/html/design/design_toc.cs b/docs/html/design/design_toc.cs
index 6dd8d61..a31fdd3 100644
--- a/docs/html/design/design_toc.cs
+++ b/docs/html/design/design_toc.cs
@@ -63,8 +63,4 @@
<div class="nav-section-header empty"><a href="<?cs var:toroot ?>design/downloads/index.html">Downloads</a></div>
</li>
- <li>
- <div id="back-dac-section"><a href="<?cs var:toroot ?>index.html">Developers</a></div>
- </li>
-
</ul>
\ No newline at end of file
diff --git a/docs/html/design/index.jd b/docs/html/design/index.jd
index d404aa6..1e6b40c 100644
--- a/docs/html/design/index.jd
+++ b/docs/html/design/index.jd
@@ -1,4 +1,4 @@
-page.title=
+page.title=Design
header.hide=1
footer.hide=1
@jd:body
@@ -10,7 +10,7 @@
#text-overlay {
position: absolute;
- left: 10px;
+ left: 0;
top: 472px;
width: 280px;
}
diff --git a/docs/html/design/media/typography_sizes.png b/docs/html/design/media/typography_sizes.png
index fe6cdce..eda1d99 100644
--- a/docs/html/design/media/typography_sizes.png
+++ b/docs/html/design/media/typography_sizes.png
Binary files differ
diff --git a/docs/html/design/patterns/index.jd b/docs/html/design/patterns/index.jd
index 732e4db..6f88e6d 100644
--- a/docs/html/design/patterns/index.jd
+++ b/docs/html/design/patterns/index.jd
@@ -10,7 +10,7 @@
#text-overlay {
position: absolute;
- left: 10px;
+ left: 0;
top: 492px;
width: 200px;
}
diff --git a/docs/html/design/style/iconography.jd b/docs/html/design/style/iconography.jd
index c4e8bd6..775e45d 100644
--- a/docs/html/design/style/iconography.jd
+++ b/docs/html/design/style/iconography.jd
@@ -139,7 +139,7 @@
<ul>
<li class="no-bullet with-icon tablet">
- <p>Action bar icons for phones and tablets should be <strong>32x32 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
+ <p>Action bar icons for phones should be <strong>32x32 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
</ul>
</div>
diff --git a/docs/html/design/style/index.jd b/docs/html/design/style/index.jd
index d346aea..74d085b 100644
--- a/docs/html/design/style/index.jd
+++ b/docs/html/design/style/index.jd
@@ -10,7 +10,7 @@
#text-overlay {
position: absolute;
- left: 10px;
+ left: 0;
top: 402px;
width: 220px;
}
diff --git a/docs/html/develop/index.jd b/docs/html/develop/index.jd
new file mode 100644
index 0000000..6830b72
--- /dev/null
+++ b/docs/html/develop/index.jd
@@ -0,0 +1,366 @@
+fullpage=true
+page.title=Develop
+header.hide=1
+carousel=1
+tabbedList=1
+@jd:body
+
+<style>
+#noplayer-message {
+position:absolute;top:50%;left:0;width:100%;z-index:-1;text-align:center;display:none;
+}
+#player-frame object {z-index:1;}
+</style>
+
+<div id="player-wrapper">
+ <div id="player-frame">
+ <div id="noplayer-message">
+ <!-- busted flash player message -->
+ Your video is supposed to appear here.<br/>
+ Make sure you have the <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash® Player</a>.
+ </div>
+ <div id="player"><!-- Youtube embeds here... actually replaces this div --></div>
+ <a class="close" onclick="$('#player-wrapper').hide()">close video</a>
+ </div>
+</div>
+
+<div class="wrap">
+ <!-- Slideshow -->
+ <div class="slideshow-container slideshow-develop col-16">
+ <a href="" class="slideshow-prev">Prev</a>
+ <a href="" class="slideshow-next">Next</a>
+ <div class="frame">
+ <ul>
+ <li class="item carousel-home">
+ <div class="col-8">
+ <img
+src="http://1.bp.blogspot.com/-6qyjPxTuzv0/T6lde-Oq_fI/AAAAAAAABXc/zle7OFEGP44/s400/fddns%2Bcopy.png"
+class="play no-shadow no-transform" />
+ </div>
+ <div class="content-right col-6">
+ <p class="title-intro">From the blog:</p>
+ <h2>Using DialogFragments</h2>
+ <p>In this post, I'll show how to use DialogFragments with the <a
+href="http://developer.android.com/reference/android/support/v4/app/DialogFragment.html">v4 support
+library</a> (for backward compatibility on pre-Honeycomb devices) to show a simple edit dialog and
+return a result to the calling Activity using an interface.</p>
+ <p><a
+href="http://android-developers.blogspot.com/2012/05/using-dialogfragments.html" class="button">Read
+more</a></p>
+ </div>
+ </li>
+ <li class="item carousel-home">
+ <div class="col-8">
+ <img
+src="http://1.bp.blogspot.com/-6K1kfNOdek8/T72bXvtTSQI/AAAAAAAABmw/kYzmJt0_328/s1600/google-play-subscriptions.png" class="play"></div>
+ <div class="content-right col-6">
+ <p class="title-intro">From the blog:</p>
+ <h2>In-app Subscriptions in Google Play</h2>
+ <p>Starting today, developers can use In-app Billing to sell monthly or annual
+subscriptions from inside of their apps. All subscriptions are auto-renewing, for every app and game
+and every type of subscription product.</p>
+ <p><a class="button"
+href="http://android-developers.blogspot.com/2012/05/in-app-subscriptions-in-google-play.html">Read
+more</a></p>
+ </div>
+ </li>
+ <li class="item carousel-home">
+ <div class="col-8">
+ <img
+src="{@docRoot}images/home/developers_live.png" class="play"></div>
+ <div class="content-right col-6">
+ <h2>Learn what great apps are made of</h2>
+ <p>Every week we host a live broadcast in which we review a collection of apps and games
+ nominated by the creators. It's no-holds-barred and we tell you exactly what is flawed or
+ fantastic in each app and how to make improvements.</p>
+ <p><a href="" class="button" onclick="$('ul#DevelopersLive li:first
+a').click();return false;">Watch the latest review</a></p>
+ </div>
+ </li>
+ <li class="item carousel-home">
+ <div class="col-8">
+ <img style="margin-top:30px;width:300px"
+src="{@docRoot}images/home/ics-android.png" class="play no-shadow no-transform" />
+ </div>
+ <div class="content-right col-6">
+ <h2>Ice Cream Sandwich</h2>
+ <p>Android 4.0 brings handsets and tablets together with a unified
+ design and a set of APIs for you to build a great user experience on all devices.
+ For information about API changes in the latest release (API level 15),
+ read the <a href='{@docRoot}about/versions/android-4.0.3.html'>platform notes</a> and <a
+ href='{@docRoot}sdk/api_diff/15/changes.html'>diff report</a>.</p>
+ <p><a class="button"
+href="{@docRoot}about/versions/android-4.0-highlights.html">Read the highlights</a></p>
+ </div>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <!-- /End slideshow -->
+</div>
+<div class="wrap">
+ <!-- news and feature feed -->
+ <div class="feed col-8" style="margin-left:0">
+ <ul class="feed-nav">
+ <li class="active">DEVELOPER NEWS</li>
+ <li>FEATURED DOCS</li>
+ </ul>
+ <div class="feed-container">
+ <div class="feed-frame">
+ <!-- DEVELOPER NEWS -->
+ <ul>
+ <li><a href="http://android-developers.blogspot.com/2012/04/faster-emulator-with-better-hardware.html">
+ <div class="feed-image" style="background:url('../images/emulator-wvga800l.png') no-repeat 0 0">
+ </div>
+ <h4>A Faster Emulator with Better...</h4>
+ <p>Today we’re thrilled to announce several significant improvements to the emulator, including a dramatic...</p>
+ </a></li>
+ <li><a href="http://android-developers.blogspot.com/2012/04/android-c2dm-client-login-key.html">
+ <div class="feed-image" style="background:url('../images/develop/auth-code.png') no-repeat 0 0">
+ </div>
+ <h4>Android C2DM — Client Login key...</h4>
+ <p>In the upcoming weeks, some of the older Client
+ Login authentication keys will expire. If you generated the token you’re...</p>
+ </a></li>
+ <li><a href="http://android-developers.blogspot.com/2012/04/accessibility-are-you-serving-all-your.html">
+ <div class="feed-image">
+ </div>
+ <h4>Accessibility</h4>
+ <p>We recently published some new resources to help developers make their Android applications more accessible... </p>
+ </a></li>
+ <li><a href="http://android-developers.blogspot.com/2012/04/new-seller-countries-in-google-play.html">
+ <div class="feed-image" style="background:url('http://developer.android.com/images/home/play_logo.png') no-repeat 0 0" >
+ </div>
+ <h4>New Seller Countries in Google Play</h4>
+ <p>Over the past year we’ve been working to expand the list of
+ countries and currencies from which Android developers...</p>
+ </a></li>
+ </ul>
+ <!-- FEATURED DOCS -->
+ <ul>
+ <li><a href="{@docRoot}guide/google/play/billing/index.html">
+ <h4>Google Play In-app Billing</h4>
+ <p>In-app Billing is a Google Play service that lets you sell digital content from inside your applications. You can sell products as standard in-app products (one-time purchase) or with subscriptions (recurring...</p>
+ </a></li>
+ <li><a href="{@docRoot}guide/topics/providers/contacts-provider.html">
+ <h4>Contacts Provider</h4>
+ <p>The Contacts Provider is a powerful and flexible Android component that manages the device's central repository of data about people. You can use it to build powerful social features...</p>
+ </a></li>
+ <li><a href="{@docRoot}training/efficient-downloads/index.html">
+ <h4>Transferring Data Without Draining the Battery</h4>
+ <p>This training class demonstrates the best practices for scheduling and executing downloads using techniques such as caching, polling, and prefetching.</p>
+ </a></li>
+ <li><a href="{@docRoot}training/backward-compatible-ui/index.html">
+ <h4>Creating Backward-Compatible UIs</h4>
+ <p>This training class demonstrates how to use UI components and APIs available in newer versions of Android in a backward-compatible way, ensuring that your application still runs on previous versions...</p>
+ </a></li>
+ </ul>
+ </div>
+ </div>
+ </div> <!-- /news and feature feed -->
+ <!-- video feed -->
+ <div class="feed col-8" style="margin-right:0">
+ <ul class="feed-nav">
+ <li class="active">DEVELOPERS LIVE</li>
+ <li>VIDEO PLAYLISTS</li>
+ </ul>
+ <div class="feed-container">
+ <div class="feed-frame">
+ <ul id="DevelopersLive">
+ </ul>
+ <ul id="VideoPlaylists">
+ </ul>
+ </div>
+ </div>
+ </div>
+ <!-- /video feed -->
+</div>
+
+<br class="clearfix"/>
+ </div>
+
+
+
+
+
+
+
+
+
+
+<script src="//swfobject.googlecode.com/svn/trunk/swfobject/swfobject.js" type="text/javascript"></script>
+<script type="text/javascript">
+
+/* Load a video into the player box.
+ * @param id The YouTube video ID
+ * @param title The video title to display in the player box (character escaped)
+ * @param autoplay Whether to automatically play the video
+ */
+function loadVideo(id, title, autoplay) {
+ swfobject.embedSWF('//www.youtube.com/v/' + id + '&rel=1&border=0&fs=1&autoplay=' +
+ (autoplay?1:0), 'player', '525', '330', '9.0.0', false, false, {allowfullscreen: 'true'});
+ $("#videoPlayerTitle").html("<h2>" + unescape(title) + "</h2>");
+ $("#player-wrapper").show();
+ setTimeout(function(){$('#noplayer-message').show()}, 2000);
+}
+
+/* Draw all videos from a playlist into a 'videoPreviews' list
+ * @param data The feed data returned from the youtube request
+ */
+function renderVideoPlaylists(data) {
+ var MAX_LIST_DESC_LENGTH = 130; // the length at which we will trim the description
+ var MAX_VIDEO_DESC_LENGTH = 100; // the length at which we will trim the description
+ var MAX_LIST_LENGTH = 4; // number of videos to put in the list
+ var feed = data.feed;
+ var entries = feed.entry || [];
+ var playlistId = feed.yt$playlistId.$t;
+
+ var $ulVideos = $('<ul style="display:none"/>');
+ var summary = feed.media$group.media$description != null ? feed.media$group.media$description.$t : feed.subtitle.$t;
+
+ var $liPlaylist = $('<li class="playlist"></li>');
+ var $aPlaylist = $('<a href="" onclick="togglePlaylist(this);return false;"></a>');
+ $liPlaylist.append($aPlaylist);
+ $aPlaylist.append('<h4>' + feed.title.$t + '</h4>');
+
+ var playlistDescription = summary.substr(0, MAX_LIST_DESC_LENGTH);
+ playlistDescription += playlistDescription.length == MAX_LIST_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
+ $aPlaylist.append('<p>' + playlistDescription + '</p>');
+
+ // Loop through each entry (each video) and add it to the 'videoPreviews' list
+ var length = feed.entry.length < MAX_LIST_LENGTH ? feed.entry.length : MAX_LIST_LENGTH; // max of 4 videos per list
+ for (var i = 0; i < length; i++) {
+ var entry = entries[i];
+
+ var title = entry.title.$t;
+ var id = entry.media$group.yt$videoid.$t;
+ var thumbUrl = entry.media$group.media$thumbnail[0].url;
+ var fullDescription = entry.media$group.media$description.$t;
+ var playerUrl = entry.media$group.media$content[0].url;
+
+ var shortDescription = fullDescription.substr(0, MAX_VIDEO_DESC_LENGTH);
+ shortDescription += shortDescription.length == MAX_VIDEO_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
+
+ var img = $('<img src="' + thumbUrl + '" width="60" height="45"/>');
+ var a = $('<a href="#" onclick="loadVideo(\'' + id + '\',\'' + escape(title) + '\',true); return false;" />');
+ var pShortDescription = $('<p>' + shortDescription + '</p>');
+ var h5Title = "<h5>" + title + "</h5>";
+ var li = $('<li class="playlist-video"/>');
+
+ li.append(a);
+ a.append(img).append(h5Title).append(pShortDescription);
+
+ $ulVideos.append(li);
+
+ // use the first entry's thumbnail for the playlist
+ if (i == 0) {
+ $aPlaylist.prepend('<img src="' + thumbUrl + '" width="120" height="90"/>');
+ }
+ }
+
+ if (feed.entry.length > MAX_LIST_LENGTH) {
+ // add item to go to youtube for playlist
+ $ulVideos.append('<li class="more"><a href="//www.youtube.com/playlist?list=PL' + playlistId + '">More »</a></li>');
+ }
+
+ $liPlaylist.append($ulVideos);
+ $('#VideoPlaylists').append($liPlaylist);
+}
+
+
+function renderDevelopersLivePlaylist(data) {
+
+ var MAX_DESC_LENGTH = 125; // the length at which we will trim the description
+ var feed = data.feed;
+ var entries = feed.entry || [];
+ var playlistId = feed.yt$playlistId.$t;
+
+ var ul = $('#DevelopersLive');
+
+ // Loop through each entry (each video) and add it to the '#DevelopersLive' list
+ for (var i = 0; i < 4; i++) {
+ var entry = entries[i];
+
+ var title = entry.title.$t;
+ var id = entry.media$group.yt$videoid.$t;
+ var thumbUrl = entry.media$group.media$thumbnail[0].url;
+ var fullDescription = entry.media$group.media$description.$t;
+ var playerUrl = entry.media$group.media$content[0].url;
+ var shortDescription = fullDescription.substr(0, MAX_DESC_LENGTH);
+ shortDescription += shortDescription.length == MAX_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
+
+ var img = $('<img src="' + thumbUrl + '" width="120" height="90"/>');
+ var a = $('<a href="#" onclick="loadVideo(\'' + id + '\',\'' + escape(title) + '\',true); return false;" />');
+ var pShortDescription = $('<p>' + shortDescription + '</p>');
+ var h4Title = "<h4>" + title + "</h4>";
+ var li = $('<li/>');
+
+ li.append(a);
+ a.append(img).append(h4Title).append(pShortDescription);
+
+ ul.append(li);
+ }
+}
+
+
+
+/* This 'playlist' object defines the playlist IDs for each tab.
+ * Each name inside 'playlist' corresponds to class names for the tab that the playlists belong to (eg: "googleioTab" and "googleioBox" divs).
+ * Each string in 'ids' is the ID of a YouTube playlist that belongs in the corresponding tab.
+ */
+var playlists = {
+ 'googleio' : {
+ 'ids': ["734A052F802C96B9"]
+ },
+ 'fridayreview' : {
+ 'ids': ["B7B9B23D864A55C3"]
+ },
+ 'officehours' : {
+ 'ids': ["7383D9AADA6E6D55"]
+ },
+ 'about' : {
+ 'ids': ["D7C64411AF40DEA5"]
+ }
+};
+
+/* Request the playlist feeds from YouTube */
+function showVideosPlaylists() {
+ for (var x in playlists) {
+ var ids = playlists[x].ids;
+ for (var i in ids) {
+ var script = "<script type='text/javascript' src='//gdata.youtube.com/feeds/api/playlists/"
+ + ids[i] +
+ "?v=2&alt=json-in-script&max-results=50&callback=renderVideoPlaylists&orderby=published'><\/script>";
+ $("body").append(script);
+ }
+ }
+}
+
+
+/* Request the playlist feeds from YouTube */
+function showDevelopersLivePlaylist() {
+ var playlistId = "B7B9B23D864A55C3"; /* The Friday Review */
+ var script = "<script type='text/javascript' src='//gdata.youtube.com/feeds/api/playlists/"
+ + playlistId +
+ "?v=2&alt=json-in-script&max-results=10&callback=renderDevelopersLivePlaylist&orderby=published'><\/script > ";
+ $("body").append(script);
+}
+
+
+function togglePlaylist(listLink) {
+ var $list = $(listLink).parent();
+ var $ul = $list.find('ul');
+ if ($ul.is(":visible")) {
+ $ul.slideUp(function() {
+ $list.css({'height':'inherit'});
+ });
+ } else {
+ $list.closest('ul').find('li.playlist').find('ul').slideUp();
+ $ul.slideDown();
+ $list.css({'height':'auto'});
+ }
+}
+
+showDevelopersLivePlaylist();
+showVideosPlaylists();
+</script>
\ No newline at end of file
diff --git a/docs/html/distribute/distribute_toc.cs b/docs/html/distribute/distribute_toc.cs
new file mode 100644
index 0000000..bc028e5
--- /dev/null
+++ b/docs/html/distribute/distribute_toc.cs
@@ -0,0 +1,112 @@
+<ul id="nav">
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>distribute/index.html">
+ <span class="en">Google Play</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/about/visibility.html">
+ <span class="en">Visibility</a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/about/monetizing.html">
+ <span class="en">Monetizing</a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/about/distribution.html">
+ <span class="en">Distribution</a></li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>distribute/googleplay/publish/index.html">
+ <span class="en">Publishing</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/publish/register.html">
+ <span class="en">Get Started</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/publish/console.html">
+ <span class="en">Developer Console</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/publish/preparing.html">
+ <span class="en">Publishing Checklist</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/strategies/app-quality.html">
+ <span class="en">App Quality</span>
+ </a></li>
+ </ul>
+ </li>
+
+<!-- <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>distribute/googleplay/developer-console.html">
+ <span class="en">The Developer Console</span>
+ </a>
+ </div>
+ <ul>
+ <li class="nav-section"><a href="<?cs var:toroot ?>distribute/googleplay/register.html">
+ <span class="en">Get Started</span></a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/distribution-controls.html">
+ <span class="en">Managing Distribution</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/pricing-billing.html">
+ <span class="en">Pricing and Billing</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/app-data.html">
+ <span class="en">Reviewing App Data</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/advanced-options.html">
+ <span class="en">Advanced Options</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/publishing.html">
+ <span class="en">Publishing and Updating</span>
+ </a></li>
+ </ul>
+ </li> end of Developer Console -->
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>distribute/googleplay/promote/index.html">
+ <span class="en">Promoting</span></a>
+ </div>
+ <ul>
+<!-- <li><a href="<?cs var:toroot ?>distribute/googleplay/promote/product-pages.html">
+ <span class="en">Your Product Pages</a></li>
+-->
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/promote/linking.html">
+ <span class="en">Linking to Your Products</a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/promote/badges.html">
+ <span class="en">Google Play Badges</a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/promote/brand.html">
+ <span class="en">Brand Assets and Guidelines</a></li>
+ </ul>
+ </li>
+
+<!--
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>distribute/googleplay/after.html">
+ <span class="en">After Launch</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/errors.html.html">Reviewing Errors</a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/reviews.html">Tracking User Reviews</a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/supporting-users.html">Supporting Users</a></li>
+ </ul>
+ </li>
+-->
+
+<!--
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>distribute/googleplay/strategies/index.html">
+ <span class="en">Strategies</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/strategies/featuring.html">Featuring</a></li>
+ <li><a href="<?cs var:toroot ?>distribute/googleplay/strategies/app-quality.html">App Quality</a></li>
+ </ul>
+ </li>
+-->
+ <li class="nav-section">
+ <div class="nav-section-header empty">
+ <a href="<?cs var:toroot ?>distribute/open.html">
+ <span class="en">Open Distribution</span>
+ </a>
+ </div>
+ </li>
+</ul>
+
\ No newline at end of file
diff --git a/docs/html/distribute/googleplay/about/distribution.jd b/docs/html/distribute/googleplay/about/distribution.jd
new file mode 100644
index 0000000..291d559
--- /dev/null
+++ b/docs/html/distribute/googleplay/about/distribution.jd
@@ -0,0 +1,127 @@
+page.title=Distribution Control
+page.metaDescription=Reach the users you want, whenever you want.
+
+@jd:body
+
+<p>Deliver your apps to the users you want, on the devices you want, on <em>your</em> schedule. </p>
+
+<h2 id="instant">Instant publishing, instant updates</h2>
+
+<p>On Google Play, you can publish your products to customers instantly. Just
+upload and configure your product in the <span style="font-weight:500;">Google Play Android Developer Console</span>
+and press the Publish button—your app appears in the store listings within
+hours, not weeks. There are no delays for code or policy reviews, so you keep
+complete control over your release schedule.</p>
+
+<p>Once your app is published, you can update it as often as you want. You can
+change prices, configuration, and distribution options at any time through the
+Google Play Android Developer Console, without needing to update your app
+binary.</p>
+
+<p>Later, as you add features or address code issues, you can publish an updated
+binary at any time. Google Play makes the new version available immediately and
+notifies existing customers that an update is ready for download. To streamline
+the rollout across your customer base, Google Play also lets users accept
+automatic updates of your app, so that your updates are delivered and installed
+s soon as you publish them.</p>
+
+<h2>Reaching the customers you want</h2>
+
+<p>Google Play does more than connect your app with users—it helps you
+reach the broadest possible distribution across the Android ecosystem, while
+making sure that your app is only available to the audience that you want to
+reach.</p>
+
+<div style="float:right;margin-left:18px;border:1px solid #DDD;margin:1.5em;">
+<img src="{@docRoot}images/gp-dc-countries.png" style="width:400px;padding:4px;margin-bottom:0;">
+</div>
+
+<h3 id="geotargeting">Geographic targeting</h3>
+
+<p>You can use controls in the Google Play Android Developer Console to easily
+manage the geographic distribution of your apps, without any changes in your
+application binary. You can specify which countries and territories you want to
+distribute to, and even which carriers (for some countries). </p>
+
+<p>When users visit the store, Google Play makes sure that they are in one of
+your targeted countries before downloading your app. You can change your country
+and carrier targeting at any time just by saving changes in the Google Play
+Android Developer Console</p>
+
+<div style="float:right;margin-left:18px;border:1px solid #DDD;margin:1.5em;">
+<img src="{@docRoot}images/gp-supported-dev-requirements.png"
+style="width:400px;padding:4px;margin-bottom:0;">
+</div>
+
+<h3 id="captargeting">Capabilities targeting</h3>
+
+<p>Google Play also lets you control distribution according to device features
+or capabilities that your app depends on. There are several types of
+dependencies that the app can define in its manifest, such as hardware features,
+OpenGL texture compression formats, libraries, Android platform versions, and
+others.</p>
+
+<p>When you upload your app, Google Play reads the dependencies and sets up any
+necessary distribution rules. For technical information about declaring
+dependencies, read <a href="{@docRoot}guide/google/play/filters.html">Filters on
+Google Play</a>. </p>
+
+<p>For pinpoint control over distribution, Google Play lets you see all of the
+devices your app is available to based on its dependencies (if any). From the
+Google Play Android Developer Console, you can list the supported devices and
+even exclude specific devices if needed.</p>
+
+<h2 id="stats">Statistics for analyzing installs</h2>
+
+<p>Once you’ve published your app, Google Play makes it easy to see how it’s
+doing. The Google Play Android Developer Console gives you access to a variety
+of anonymized metrics that show your app’s installation performance measured by
+unique users and unique devices, across a variety of different dimensions such
+as country, Android version, device, country, carrier, and app version.</p>
+
+<div style="border:1px solid #DDD;margin:1.5em;margin-left:8%;width:608px">
+<img src="{@docRoot}images/gp-dc-stats-mini.png"
+style="width:600px;padding:4px;margin-bottom:0;">
+</div>
+<p>You can also view your installation data on timeline charts, for all metrics and
+dimensions. At a glance, these charts highlight your app’s installation peaks
+and longer-term trends, which you can correlate to promotions, app improvements,
+or other factors. You can even focus in on data inside a dimension by
+highlighting specific data points (such as individual platform versions or
+languages) on the timeline.</p>
+
+<p>So that you can “take your data with you”, you can download all of your
+installation data as a CSV file for viewing in the business program of your
+choice.</p>
+
+
+<h2 id="advanced">Advanced delivery options</h2>
+
+<p>Google Play offers convenient options for managing how your apps are
+delivered to users.</p>
+
+<p>In most cases, it’s easy to create an app that supports all of your targeted
+screen sizes and platform versions from a single APK. Distributing a single APK
+to all of your users is a highly recommended approach, because it’s the easiest
+way to manage and maintain the app. If you need to deliver a different APK to
+devices, Google Play provides a way to do that. </p>
+
+<p>An option called Multiple APK support lets you create multiple APK packages
+that use the same package name but differ in their OpenGL texture compression
+formats, screen-size support, or Android platform versions supported. You can
+upload all of the APKs to Google Play under a single product listing and Google
+Play selects the best APK to deliver to users, based on the characteristics of
+their devices. </p>
+
+<p>The APK Expansion Files option lets you upload up to two secondary downloads
+for each published APK, including multiple APKs. Each of the two expansion files
+can be up to 2GB each and can contain any type of code or assets. When you
+upload the expansion files, Google Play hosts them for free and handles the
+download of the files as part of the normal APK installation.</p>
+
+<h2 id="licensing">Protecting your App</h2>
+
+<p>To help you protect your application against piracy, Google Play offers a
+licensing service that you can implement in your app. It’s a network-based
+service that lets an application query a trusted Google Play licensing server to
+determine whether the application is licensed to the current device user.</p>
diff --git a/docs/html/distribute/googleplay/about/monetizing.jd b/docs/html/distribute/googleplay/about/monetizing.jd
new file mode 100644
index 0000000..1e3437b
--- /dev/null
+++ b/docs/html/distribute/googleplay/about/monetizing.jd
@@ -0,0 +1,152 @@
+page.title=Flexible Monetizing and Business Tools
+page.metaDescription=
+
+@jd:body
+
+<div style="float:right;margin-left:18px;padding:1.5em;">
+<img src="{@docRoot}images/gp-details-ww.png" style="width:180px">
+<img src="{@docRoot}images/gp-details-ww-purchase.png" style="width:180px">
+</div>
+
+<p>Sell your app in more than 130 countries. Flexible monetization options with
+in-app purchase, subscriptions, and more. </p>
+
+<h2>Streamlined purchase flow for users</h2>
+
+<p>When users find your app, they can purchase it instantly with a streamlined,
+consistent purchasing process and convenient payment methods.</p>
+
+<h3>Instant purchase from device or web</h3>
+
+<p>Google Play makes it fast and easy for your customers to buy your products,
+whether from a phone, a tablet, or a desktop computer. When users find an app or
+game that they want to buy, they can purchase it in as few as two steps—one
+to initiate the purchase and another to accept purchase details and permissions
+and complete the transaction.</p>
+
+<p>Google Play's convenient purchase experience is the same familiar process for
+all products everywhere across Google Play—apps, games, in-app products and
+subscriptions, and other digital content.</p>
+
+<h3 id="cloud-connected-purchase">Cloud-connected</h3>
+
+<p>Purchasing is even more convenient on Google Play because it’s
+cloud-connected. Users can find and purchase your products from anywhere—from
+their Android phones or using any web browser on any host computer. </p>
+
+<p>When users find an app or game they want to buy, they purchase it and download
+it instantly to their devices over-the-air. Users who sign in to the Google Play web site can also buy apps and games
+and push them instantly to their phones, tablets, or other devices. Google Play
+manages the application download.</p>
+
+<h3 id="payment-methods">Convenient payment options</h3>
+
+<p>Users can purchase your products on Google Play using several convenient
+payment methods—credit card, Direct Carrier Billing, and Google Play balance.</p>
+
+<p><span style="font-weight:500">Credit card</span> is the most common method of payment. Users can pay using any credit card
+that they’ve registered in Google Play. To make it easy for users to get started,
+registration is offered as a part of initial device setup process.</p>
+
+<div class="sidebox-wrapper" style="float:right;">
+<div class="sidebox">
+<h2>Payment methods on Google Play</h2>
+<ul>
+<li>Credit Card</li>
+<li>Direct Carrier Billing</li>
+</ul>
+</div>
+</div>
+
+<p>Subscribers on many popular carrier networks worldwide can charge purchases
+to their monthly mobile phone bills through <span style="font-weight:500">Direct
+Carrier Billing</span>. This form of payment is convenient and simple and is
+extremely popular in regions where credit cards are less common. More than 75
+million users in key markets around the world can purchase
+your products through Direct Carrier Billing. Many more will get the option in
+the months ahead.</p>
+
+<p>The payment methods available to users worldwide may vary, based on
+location, carrier network, and other factors.</p>
+
+<div style="float:left;margin-right:2em;margin-top:1em;width:220px;">
+<img src="{@docRoot}images/gp-subs.png" style="width:220px">
+</div>
+
+<h2 id="billing-models" style="margin-top:1.5em;">Choice of billing models</h2>
+
+<p>Google Play gives you a choice of billing models to let you monetize your
+products. </p>
+
+<p>You can offer apps to all users for free, or
+you can set an initial price for the app, paid before download. You can also
+sell one-time purchases and auto-renewing subscriptions from inside the app, and
+you can take advantage of AdMob integration to monetize your app through
+targeted advertising.</p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>Billing models on Google Play</h2>
+<ul>
+<li>Free (no charge to download)</li>
+<li>Priced (user charged before download)</li>
+<li>In-App products and subscriptions</li>
+</ul>
+</div>
+</div>
+
+<p>You can combine these billing models in different ways, based on your business
+needs or market conditions. </p>
+
+<p>For example, you can use a freemium or ad-supported model by distributing
+your app for free and selling in-app products or advertising. Alternatively you
+could set a nominal price for your app at download and sell value add-ons,
+gameplay levels, and upgrades as in-app products. The only restriction is that
+free apps must remain free (to download) for the life of the app.</p>
+
+<h2 id="buyer-currency" style="margin-top:1.5em;">Flexible pricing in the currencies of your customers</h2>
+
+<div style="float:right;margin-left:18px;border:1px solid #DDD;">
+<img src="{@docRoot}images/gp-buyer-currency.png" style="width:240px;padding:4px;margin-bottom:0;">
+</div>
+
+<p>Google Play gives you complete control over how you price your products. You
+can set prices in more than 130 countries, for millions of
+users around the world. When users browse your app’s product page or initiate a
+purchase, Google Play shows them the price they will be charged <em>in
+their local currency</em>.</p>
+
+<p>You can set and adjust your prices at any time, in any available currency.
+Your prices in available currencies are independent, so you can adjust one
+price without affecting others. This gives you the ability to run
+short-term promotions and discounts in specific countries and more easily
+manage shifts in exchange rates.</p>
+
+<p>You can set and manage prices for your apps and in-app products from the
+Google Play Android Developer Console.</p>
+
+<h2 id="payouts">Monthly payouts in your local currency</h2>
+
+<p>To sell products in Google Play, all you have to do is register for a Google
+Checkout merchant account and link it to your Google Play Android Developer
+Console account (see <a
+href="{@docRoot}distribute/googleplay/publish/register.html">Get Started with
+Publishing</a> for details). Once you’ve set up your account and published your
+apps, Google Play makes monthly payouts of sales proceeds to your merchant
+account, in your local currency.</p>
+
+<h2 id="reporting">Detailed financial reporting</h2>
+
+<p>When you sell priced apps or in-app products on Google Play, you get a
+variety of financial reports to help you track and project sales, optimize your
+marketing campaigns, and support your customers.</p>
+
+<p>To help you keep up-to-date with the current activity, you can download daily
+reports summarizing recent purchases of your products. The reports include
+estimated sales amounts and include a variety of other data for each
+transaction.</p>
+
+<p>At the close of the month, you can download a complete sales report that
+gives you the final details of all transactions that closed in the month,
+including the payout amounts and other data. Additional financial reports are
+available in your Google Checkout merchant account.</p>
diff --git a/docs/html/distribute/googleplay/about/visibility.jd b/docs/html/distribute/googleplay/about/visibility.jd
new file mode 100644
index 0000000..2c5dbe5
--- /dev/null
+++ b/docs/html/distribute/googleplay/about/visibility.jd
@@ -0,0 +1,247 @@
+page.title=Visibility for Your Apps
+page.metaDescription=
+
+@jd:body
+
+<div style="float:right;margin:0px 0px 24px 0px;">
+ <img src="{@docRoot}images/gp-tab.png" style="width:420px" style>
+</div>
+
+<p>A billion downloads a month and growing. Get your apps in front of millions
+of users at Google's scale. </p>
+
+
+<h2 id="reach">Worldwide reach, rapid growth</h2>
+
+<p>Google Play is the premier store for distributing Android apps. It’s
+preinstalled on more than 300 million devices worldwide, a number growing by
+almost a million every day. Android users have downloaded
+more than <strong style="text-wrap:none;">15 billion apps</strong> from Google
+Play, growing at a rate of more than 1 billion per month.</p>
+
+<p>When you publish on Google Play, you put your apps in front of Android's huge
+base of active customers, in more than 130 countries and territories across the
+world. </p>
+
+<p>Google Play is a central part of the Android experience. New users
+personalize their devices with apps, games, and other Google Play content.
+Existing users return regularly to see what's trending and new. Downloading new
+apps is extremely convenient and fast— Google Play pushes apps to the
+user's devices instantly, over the air. No cable or sync is ever needed.</p>
+
+<div style="float:left;margin:0px 20px 0px 0px;width:374px;">
+<div style="width:378px;padding:2px;">
+<img src="{@docRoot}images/gp-growth-downloads.png" style="width:600px;margin-bottom:0em;">
+</div>
+<p class="image-caption" style="padding:.5em"><span
+style="font-weight:500;">Growth in app consumption</span>: Users download more than
+1 billion apps from Google Play each month.</p>
+</div>
+
+<div>
+<p>Google Play is also a top destination for visitors from the the web. Anyone
+with a browser can explore everything that Google Play has to offer from its <a
+href="http://play.google.com/store">web site</a>. Android users can even buy and
+install the apps they want and Google Play pushes them automatically to their
+devices over the air. </p>
+
+<p>The accessiblility and convenience of the Google Play web
+site give you new ways to drive traffic to your products from online ads, web
+search, cross-linking, and more.</p>
+</div>
+
+ <div style="clear:both;">
+<h2>Built for app discovery</h2>
+
+<p>Google Play is designed to connect users with great apps and games. It
+provides key channels to help your app get noticed and gain traction in the
+marketplace.</p>
+
+<h3 id="ratings">User ratings and reviews</h3>
+
+<p>When you develop a great app, Android users show their appreciation through
+ratings and reviews. They rate your app (out of 5 stars) after downloading it
+and can post a short description of their experience. When other users are
+considering your app, they look at the ratings and reviews as key benchmarks of
+the app’s quality. </p>
+
+ </div>
+
+<p>Your app’s rating is one of the most important factors influencing its
+ranking in the various lists and search results in Google Play. It's also one of
+the key signals that the editorial staff looks for, when curating apps and games
+for promotion in the store.</p>
+
+<div style="border:1px solid #DDD;padding:1px;margin-left:110px;width:504px;">
+<img src="{@docRoot}images/gp-rating-web.png" style="width:500px;padding:0;margin:0;">
+</div>
+
+<h3 id="category" stdle="padding-top:2em;">Category browsing</h3>
+
+<p>When you publish an app in Google Play, you pick the category in which you
+want users to find your app. More than 30 categories are available. Inside each
+category, apps are ranked based on a combination of ratings, reviews, downloads,
+country, and other factors. Many popular categories also start with a collection
+of featured apps selected by the Google Play editorial staff.</p>
+
+<div style="clear:both;margin-top:2em;margin-left:10%;width:560px;">
+<div style="clear:both;margin-top:2em;">
+<img src="{@docRoot}images/gpp-cat-feature280-puzzle.png" style="width:180px">
+<img src="{@docRoot}images/gpp-cat-feature280-photo.png" style="width:180px">
+<img src="{@docRoot}images/gpp-cat-feature280-sports.png" style="width:180px">
+</div>
+<p class="image-caption"><span style="font-weight:500;">Featuring in
+categories</span>: Most app and game categories include a featured list curated
+by the editorial team.</p>
+</div>
+
+<h3 id="search">Search</h3>
+
+<p>Search on Google Play lets users pinpoint an app or game quickly. Search uses
+powerful heuristics to suggest terms as the user types, and it offers direct
+links to apps as suggestions. In results, users find the most relevant, most
+popular apps at the top. </p>
+
+<div style="float:left;margin:12px 24px 0px 0px;">
+<img src="{@docRoot}images/gp-top-new-paid.png" style="width:250px">
+</div>
+
+<h3 id="top-charts" style="padding-top:1em">Top charts and lists</h3>
+
+<p>Top charts keep users in touch with what’s popular and trending with Android
+users, right from the Apps and Games home pages. The charts are generated
+several times each day based on recent download activity, keeping them fresh and
+allowing new apps to move upward in the charts. To make the charts as relevant
+as possible for users across the world, they are also country-specific.</p>
+
+<p>As your apps get traction and build momentum in downloads and ratings,
+they’ll climb one or more of the top charts and gain even more exposure.</p>
+
+<div>
+<table style="width:440px">
+<tr>
+<td style="width:100px">Top Free</td><td>Free apps and games</td></tr>
+<td style="width:140px">Top Paid</td><td>Priced apps and games</td></tr>
+<td>Top New Free</td><td>Less than 30 days old</td></tr>
+<td>Top New Paid</td><td>Less than 30 days old</td></tr>
+<td>Top Grossing</td><td>Gross proceeds, free or priced</td></tr>
+<td>Best Selling</td><td>Popular priced games</td></tr>
+<td>Trending</td><td>New arrivals growing quickly in installs</td>
+</tr>
+</table>
+</div>
+
+<div style="clear:both">
+<h4 id="featured" style="padding-top:2.5em;">Featured, Staff Picks, Collections,
+and Badges</h4>
+
+
+<div style="float:right;margin-left:18px;">
+<img src="{@docRoot}images/gp-apps-home.png" style="width:180px">
+<img src="{@docRoot}images/gp-games-home.png" style="width:180px">
+</div>
+
+<p>The Google Play editorial team is dedicated to bringing the best apps to the
+attention of users. It constantly reviews apps from across Google Play to find
+not only the biggest apps and games, but also the “diamonds in the rough” that
+they want more people to see. </p>
+
+<p>When the team finds great apps and games they use the <em>Featured</em>,
+<em>Staff Picks</em>, and other collections to promote them. Any one of those
+can give your apps dramatically higher visibility and market penetration.</p>
+
+<p>You can’t nominate your app for featuring or pay for a promotional slot,
+because the editorial team wants to show the best apps and give the same chances
+to all developers. However, if you build an app that users love and that looks
+great on Android devices, the editorial team will notice. <!--In some cases,
+they will reach out to you before your app is featured to make sure that your
+app will be at its best during featuring.</p> -->
+</div>
+
+<h4>Featured and Staff Picks</h4>
+
+<p>Each week the the Google Play editorial staff selects a new set of apps to
+promote in its popular <em>Featured</em> and <em>Staff Picks</em> collections.
+</p>
+
+The <em>Featured</em> collections highlight the latest and greatest app and game
+titles available for Android. Category featuring highlights the best and most
+popular apps in the top categories.
+
+<em>Staff Picks</em> collects all recently featured apps and games on Google
+Play. To better reach tablet users, there’s a special <em>Staff Picks</em>
+collection that highlights the best apps for Android tablets.</p>
+
+<div style="float:left;margin-right:18px;">
+<img src="{@docRoot}images/gp-collectibles.png" stydle="width:180px">
+
+</div>
+
+<h4>App collections</h4>
+
+<p>From time to time the editorial staff puts together a collection of apps and
+games based on a theme or seasonal event. The collections are popular with
+customers because they are timely and relevant, and they provide a new way to
+showcase great Android apps to users.</p>
+
+<p>The editorial staff chooses apps for collection promotions in a similar way
+as for featuring—high-quality apps that show the best of Android on phones
+and tablets. For collections the staff also looks for apps that can make an
+interesting or unique contribution to the collection as a whole. </p>
+
+<h4><img style="margin-right:.25em;margin-bottom:.5em;"
+src="{@docRoot}images/editorschoice_ann.png"> EDITORS' CHOICE</h4>
+
+<p><em>Editors’ Choice</em> is a curated collection of apps that highlights some
+of the very best apps available on Android. These apps are chosen for high
+quality and great UI, long-term popularity, and innovative use of Android
+features.</p>
+
+<p>Apps chosen for <em>Editors’ Choice</em> also receive a badge that is
+displayed wherever the app name is seen in Google Play.</p>
+
+<h4><img style="margin-right:.25em;margin-bottom:.5em;"
+src="{@docRoot}images/topdev_ann.png"> TOP DEVELOPER</h4>
+
+<p>Top Developer is a badge recognizing established, respected developers for
+their commitment to launching high-quality and innovative apps on
+Android. The Google Play editorial staff selects developers awards a Top
+Developer badge from time to time, based on the cumulative work of the
+developer.</p>
+
+<p>The Top Developer badge appears next to the developer name wherever it is
+displayed in Google Play. For a developer, the badge means long-term recognition
+of all of your apps. For users, the badge signifies an additional level of trust
+and confidence in your products.</p>
+
+<h3 id="details">Rich, colorful product pages</h3>
+
+<p>In Google Play, your app’s storefront is its <em>product details page</em>
+— a rich and colorful page that lets you promote your app, highlight its
+ratings and reviews, and show what your app can do.
+
+<p>Your product details page is the one page where your users come to find out
+everything about your app. When they see your app listed in search results, top
+charts, category listings, and collections, one tap takes them directly to your
+product details page.</p>
+
+<div style="float:right;margin-left:10px;">
+<img src="{@docRoot}images/gp-details-pages-magicpiano.png" style="width:500px">
+</div>
+
+<p>You can manage your product details page through the <span
+style="font-weight:500">Google Play Android Develeper Console</span>, from any
+web browser. Just sign in, upload or update your brand assets, and enter your
+product details in the languages of your markets. </p>
+
+<p>When you publish, Google Play adds your app’s ratings, reviews, links to your
+other products, and more, and makes sure your product details page looks great
+on phones, tablets, or in a web browser.</p>
+
+<p>You can link web users directly to your product details page from outside
+Google Play, such as from your web site, an ad campaign, reviews, social media
+posts, and more. See <a href="{@docRoot}distribute/googleplay/promote/linking.html">Linking
+to Your Products</a> to find out how. </p>
+
+<p>To learn more about how to create your product details page, see
+<a href="{@docRoot}distribute/googleplay/publish/index.html">Publishing on Google Play</a>.</p>
diff --git a/docs/html/distribute/googleplay/index.html b/docs/html/distribute/googleplay/index.html
new file mode 100644
index 0000000..46a8ce2
--- /dev/null
+++ b/docs/html/distribute/googleplay/index.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/distribute/index.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should have been redirected. Please <a
+href="http://developer.android.com/distribute/index.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/distribute/googleplay/promote/badges.jd b/docs/html/distribute/googleplay/promote/badges.jd
new file mode 100644
index 0000000..de12e2a
--- /dev/null
+++ b/docs/html/distribute/googleplay/promote/badges.jd
@@ -0,0 +1,203 @@
+page.title=Google Play Badges
+@jd:body
+
+<p>Google Play badges give you an officially branded way of promoting your app to Android users. Use the form below to quickly create badges to link users to your products from web pages, ads, reviews, and more. See <a href="linking.html">Linking to your products</a> for more ways to bring users to your apps.</p>
+
+<p>Input your app's package or your publisher name, choose the style, size, and language, and click "Build my badge". The form will generate code for an embbeded button that links to your app's product page or a list of your apps. </p>
+
+<p>Note that you should not modify the Google Play badges after generating them, including colors, size, text, and logo. See <a href="http://www.android.com/branding.html">Android Brand Guidelines</a> for more information.</p>
+
+<style type="text/css">
+
+form.button-form {
+ margin-top:2em;
+}
+
+/* the label and input elements are blocks that float left in order to
+ keep the left edgets of the input aligned, and IE 6/7 do not fully support "inline-block" */
+label.block {
+ display: block;
+ float: left;
+ width: 100px;
+ padding-right: 10px;
+}
+
+input.text {
+ display: block;
+ float: left;
+ width: 250px;
+}
+
+div.button-row {
+ white-space:nowrap;
+ min-height:80px;
+}
+
+div.button-row input {
+ vertical-align:120%;
+}
+
+#jd-content div.button-row img {
+ margin: 0;
+}
+
+</style>
+
+<script type="text/javascript">
+
+// variables for creating 'try it out' demo button
+var imagePath = "http://www.android.com/images/brand/"
+var linkStart = "<a href=\"http://play.google.com/store/";
+var imageStart = "\">\n"
+ + " <img alt=\"";
+ // leaves opening for the alt text value
+var imageSrc = "\"\n src=\"" + imagePath;
+ // leaves opening for the image file name
+var imageEnd = ".png\" />\n</a>";
+
+// variables for creating code snippet
+var linkStartCode = "<a href=\"http://play.google.com/store/";
+var imageStartCode = "\">\n"
+ + " <img alt=\"";
+ // leaves opening for the alt text value
+var imageSrcCode = "\"\n src=\"" + imagePath;
+ // leaves opening for the image file name
+var imageEndCode = ".png\" />\n</a>";
+
+/** Generate the HTML snippet and demo based on form values */
+function buildButton(form) {
+ var selectedValue = $('form input[type=radio]:checked').val();
+ var altText = selectedValue.indexOf("get_it") != -1 ? "Get it on Google Play" : "Android app on Google Play";
+
+ if (form["package"].value != "com.example.android") {
+ $("#preview").show();
+ $("#snippet").show().html(linkStartCode + "apps/details?id=" + form["package"].value
+ + imageStartCode + altText + imageSrcCode
+ + selectedValue + imageEndCode);
+ $("#button-preview").html(linkStart + "apps/details?id=" + form["package"].value
+ + imageStart + altText + imageSrc
+ + selectedValue + imageEnd);
+ } else if (form["publisher"].value != "Example, Inc.") {
+ $("#preview").show();
+ $("#snippet").show().html(linkStartCode + "search?q=pub:" + form["publisher"].value
+ + imageStartCode + altText + imageSrcCode
+ + selectedValue + imageEndCode);
+ $("#button-preview").html(linkStart + "search?q=pub:" + form["publisher"].value
+ + imageStart + altText + imageSrc
+ + selectedValue + imageEnd);
+ } else {
+ alert("Please enter your package name or publisher name");
+ }
+ return false;
+}
+
+/** Listen for Enter key */
+function onTextEntered(event, form, me) {
+ // 13 = enter
+ if (event.keyCode == 13) {
+ buildButton(form);
+ }
+}
+
+/** When input is focused, remove example text and disable other input */
+function onInputFocus(object, example) {
+ if (object.value == example) {
+ $(object).val('').css({'color' : '#000'});
+ }
+ $('input[type="text"]:not(input[name='+object.name+'])',
+ object.parentNode).attr('disabled','true');
+ $('#'+object.name+'-clear').show();
+}
+
+/** When input is blured, restore example text if appropriate and enable other input */
+function onInputBlur(object, example) {
+ if (object.value.length < 1) {
+ $(object).attr('value',example).css({'color':'#ccc'});
+ $('input[type="text"]', object.parentNode).removeAttr('disabled');
+ $('#'+object.name+'-clear').hide();
+ }
+}
+
+/** Clear the form to start over */
+function clearLabel(id, example) {
+ $("#preview").hide();
+ $('#'+id+'').html('').attr('value',example).css({'color':'#ccc'});
+ $('input[type="text"]', $('#'+id+'').parent()).removeAttr('disabled');
+ $('#'+id+'-clear').hide();
+ return false;
+}
+
+/** When the doc is ready, find the inputs and color the input grey if the value is the example
+ text. This is necessary to handle back-navigation, which can auto-fill the form with previous
+ values (and text should not be grey) */
+$(document).ready(function() {
+ $(".button-form input.text").each(function(index) {
+ if ($(this).val() == $(this).attr("default")) {
+ $(this).css("color","#ccc");
+ } else {
+ /* This is necessary to handle back-navigation to the page after form was filled */
+ $('input[type="text"]:not(input[name='+this.name+'])',
+ this.parentNode).attr('disabled','true');
+ $('#'+this.name+'-clear').show();
+ }
+ });
+});
+
+</script>
+
+<form class="button-form">
+ <label class="block" for="package">Package name:</label>
+ <input class="text" type="text" id="package" name="package"
+ value="com.example.android"
+ default="com.example.android"
+ onfocus="onInputFocus(this, 'com.example.android')"
+ onblur="onInputBlur(this, 'com.example.android')"
+ onkeyup="return onTextEntered(event, this.parentNode, this)"/>
+ <a id="package-clear" style="display:none" href="#"
+ onclick="return clearLabel('package','com.example.android');">clear</a>
+ <p style="clear:both;margin:0"> <em>or</em></p>
+ <label class="block" style="margin-top:5px" for="publisher">Publisher name:</label>
+ <input class="text" type="text" id="publisher" name="publisher"
+ value="Example, Inc."
+ default="Example, Inc."
+ onfocus="onInputFocus(this, 'Example, Inc.')"
+ onblur="onInputBlur(this, 'Example, Inc.')"
+ onkeyup="return onTextEntered(event, this.parentNode, this)"/>
+ <a id="publisher-clear" style="display:none" href="#"
+ onclick="return clearLabel('publisher','Example, Inc.');">clear</a>
+ <br/><br/>
+
+<div class="button-row">
+ <input type="radio" name="buttonStyle" value="get_it_on_play_logo_small" id="ns" checked="checked" />
+ <label for="ns"><img src="http://www.android.com/images/brand/get_it_on_play_logo_small.png"
+alt="Get it on Google Play (small)" /></label>
+
+ <input type="radio" name="buttonStyle" value="get_it_on_play_logo_large" id="nm" />
+ <label for="nm"><img src="http://www.android.com/images/brand/get_it_on_play_logo_large.png"
+alt="Get it on Google Play (large)" /></label>
+</div>
+
+<div class="button-row">
+ <input type="radio" name="buttonStyle" value="android_app_on_play_logo_small" id="ws" />
+ <label for="ws"><img src="http://www.android.com/images/brand/android_app_on_play_logo_small.png"
+alt="Android app on Google Play (small)" /></label>
+
+ <input type="radio" name="buttonStyle" value="android_app_on_play_logo_large" id="wm" />
+ <label for="wm"><img src="http://www.android.com/images/brand/android_app_on_play_logo_large.png"
+alt="Android app on Google Play (large)" /></label>
+</div>
+
+ <input type="button" onclick="return buildButton(this.parentNode)" value="Build my badge"
+style="padding:5px" />
+ <br/>
+</form>
+
+<div id="preview" style="display:none">
+ <p>Copy and paste this HTML into your web site:</p>
+ <textarea id="snippet" cols="100" rows="5" onclick="this.select()"
+style="font-family:monospace;background-color:#efefef;padding:5px;display:none;margin-bottom:1em">
+ </textarea >
+
+<p>Try it out:</p>
+<div id="button-preview" style="margin-top:1em"></div>
+</div>
diff --git a/docs/html/distribute/googleplay/promote/brand.jd b/docs/html/distribute/googleplay/promote/brand.jd
new file mode 100644
index 0000000..8aafc48
--- /dev/null
+++ b/docs/html/distribute/googleplay/promote/brand.jd
@@ -0,0 +1,174 @@
+page.title=Brand Assets, Icons, and Guidelines
+@jd:body
+
+<p>We encourage you to use the Android and Google Play brands in your
+promotional materials. You can use the icons and other assets on this page in
+any way you want, provided that you follow the guidelines described below.</p>
+
+<h2 id="brand-android">Android Brand</h2>
+
+<div>
+ <div style="float:right;width:50%;padding:1.5em;">
+ <img alt="" src="{@docRoot}images/brand/droid.gif">
+ </div>
+
+ <div style="width:45%;">
+ <h4>01/ Android Robot</h4>
+
+ <p> Can be used, reproduced, and modified freely in marketing
+ communications. Our standard color value for print is PMS 376C. Our online hex
+ color is <span id= "android-green">#A4C639</span>.</p>
+
+ <p>When using the Android Robot or any modification of it, proper attribution is
+ required under the terms of the Creative Commons Attribution license. For more
+ details on proper attribution, please see the <a
+ href="{@docRoot}license.html#attribution">Content License</a> document. </p>
+ </div>
+<div>
+
+<div style="clear:both">
+ <div style="float:right;width:50%;padding:1.5em;">
+ <img alt="" src="{@docRoot}images/brand/logo_android.gif">
+ </div>
+
+ <div style="width:45%;">
+ <h4>02/ Android Logo</h4>
+
+ <p>The Android logo may not be used.</p>
+ </div>
+<div>
+
+<div style="clear:both">
+ <div style="float:right;width:50%;padding:1.5em;">
+ <img alt="" src="{@docRoot}images/brand/norad.gif">
+ </div>
+
+ <div style="width:45%;">
+ <h4>03/ Android Custom Typeface</h4>
+
+ <p>The custom typeface may not be used.</p>
+ </div>
+<div>
+
+<div style="clear:both">
+ <div style="float:right;width:50%;padding:1.5em;">
+ <img alt="" src="{@docRoot}images/brand/mediaplayer.gif">
+ </div>
+
+ <div style="width:45%;">
+ <h4>04/ Android in Official Names</h4>
+<p>Any name with 'Android' alone may not be used in a name without permission. Any name
+ with 'Droid' alone may not be used in a name.</p>
+
+ <p>The word 'Android' may be used only as a descriptor, 'for Android'. If used with your
+ logo, 'for Android' needs to be smaller in size than your logo. First instance of this
+ use should be followed by a TM symbol, 'for Android™'.</p>
+
+ <p>If you are not sure you meet these criteria, <a href=
+ "http://services.google.com/permissions/application">please contact us</a>. </p>
+ </div>
+<div>
+
+<div style="clear:both">
+ <div style="float:right;width:50%;padding:1.5em;">
+ <img alt="" src="{@docRoot}images/brand/learnmore.gif">
+ </div>
+
+ <div style="width:45%;">
+ <h4>05/ Android in Messaging</h4>
+ <p>
+ May be used in text as a descriptor, as long as it is followed by a proper generic term
+ (e.g. "Android™ application"). First instance of this use should be followed by a TM
+ symbol.
+ </p>
+ </div>
+<div>
+ <p class="caution"><strong>Note: Any usage of #04 or #05 needs to include footer attribution in your
+ communication:</strong><br /><span style="margin-left:1.5em">
+ "Android is a trademark of Google Inc."</span>
+ </p>
+
+<h2 id="brand-google_play">Google Play Brand</h2>
+
+<div style="clear:both">
+ <div style="float:right;width:50%;padding:1.5em;">
+ <p>
+ <img alt="Google Play logo" src="{@docRoot}images/brand/google_play_logo_450.png">
+ </p>
+ <p>
+ <img alt="Get it on Google Play badge, large" src=
+ "/images/brand/get_it_on_play_logo_large.png"><br>
+ Download: <a href="{@docRoot}images/brand/get_it_on_play_logo_small.png">Small</a> | <a href=
+ "/images/brand/get_it_on_play_logo_large.png">Large</a>
+ </p>
+ <p>
+ <img alt="Android App on Google Play badge, large" src=
+ "/images/brand/android_app_on_play_logo_large.png"><br>
+ Download: <a href="{@docRoot}images/brand/android_app_on_play_logo_small.png">Small</a> |
+ <a href="{@docRoot}images/brand/android_app_on_play_large.png">Large</a>
+ </p>
+ </div>
+
+ <div style="width:45%;">
+ <h4>06/ <em>Get it on Google Play</em> Badge
+ </h4>
+ <p>
+ The "Get it on Google Play" and "Android App on Google Play" logos are badges that you
+ can use on your web site and promotional materials, to point to your products on Google
+ Play.
+ </p>
+ <p>
+ The logos are available in two sizes:
+ </p>
+ <ul>
+ <li>Large: 60(h) x 172(w)</li>
+ </li>
+ <li>Small 45(h) x 129(w)
+ </li>
+ </ul>
+ <p>
+ Guidelines for usage:
+ </p>
+ <ul>
+ <li>Never separate the phrase “Get it on Google Play” or "Android App on Google Play"
+ from the Google Play logo, and do not change the color, proportions, spacing or any
+ other aspect of the logo.
+ </li>
+ </ul>
+ </div>
+
+ <ul>
+ <li>When used online, the badge logo should be used to direct users to:
+ <ul>
+ <li>The Google Play landing page: <br /><span style="margin-left:1em;"><a href=
+ "http://play.google.com/">play.google.com</a></span>
+ </li>
+ <li>The Google Play Apps landing page: <br /><a href="http://play.google.com/store/apps">
+ <span style="margin-left:1em;"> play.google.com/store/apps</a></span>
+ </li>
+ <li>A list of products that include your company name, for example, <br />
+ <span style="margin-left:1em;">http://play.google.com/store/search?q=<em>yourCompanyName</em></span>
+ </li>
+ <li>A list of products published by you, for example,<br />
+ <span style="margin-left:1em;">play.google.com/store/search?q=<em>publisherName</em>M/span>
+ </li>
+ <li>A specific app product details page within Google Play, for example,<br />
+ <span style="margin-left:1em;">play.google.com/store/apps/details?id=<em>packageName</em></span>
+ </li>
+ </ul>
+ </li>
+ <li>When used alongside logos for other application marketplaces, the Google Play logo
+ should be of equal or greater size</li>
+ </ul>
+
+ <p>For details on all the ways that you can link to your product details page in Google Play,
+ see <a href="{@docRoot}distribute/googleplay/promote/linking.html">Linking to your products</a></p>
+
+ <p>For convenience, if you are using the logos online, you can use the
+ <a href="{@docRoot}distribute/googleplay/promote/badges.html">badge generator</a>
+ to create the appropriate markup and link to your apps.</p>
+
+<h2>Other Brands</h2>
+
+<p>Any other brands or icons depicted on this site are <em>not</em> are the property of their
+repective owners and usage is reserved. You must seek the developer for appropriate permission to use them.</p>
diff --git a/docs/html/distribute/googleplay/promote/index.jd b/docs/html/distribute/googleplay/promote/index.jd
new file mode 100644
index 0000000..6882990
--- /dev/null
+++ b/docs/html/distribute/googleplay/promote/index.jd
@@ -0,0 +1,43 @@
+page.title=Promoting Your Apps
+page.metaDescription=Raise the visibility of your apps in Google Play through deep links and Google Play badges.
+header.hide=0
+footer.hide=0
+@jd:body
+
+<!--
+<style>
+#landing-graphic-container {
+ position: relative;
+}
+
+#text-overlay {
+ position: absolute;
+ left: 0;
+ top: 472px;
+ width: 280px;
+}
+</style>
+
+<div id="landing-graphic-container">
+ <div id="text-overlay">
+ Raise the visibility of your apps with badges and link users to your products on Google Play.
+ <br><br>
+ <a href="{@docRoot}distribute/googleplay/promote/product-pages.html" class="landing-page-link">Your Product Pages</a>
+ </div>
+
+ <a href="{@docRoot}distribute/googleplay/promote/index.html">
+ <img src="{@docRoot}design/media/index_landing_page.png">
+ </a>
+</div> -->
+
+<p>After you publish your app, you can bring Android users to your app's product details page by
+providing links in your social network posts, ad campaigns, app reviews and articles, your
+web site, and more. </p>
+
+<p>You can use the resources in this section to create deep links for your online placements.
+Google Play badges are an especially great way let Android users know that your app is available
+and link them directly to your download page. With the badge generator, they're also easy to make.</p>
+
+
+<p style="margin-top:1.5em;margin-bottom:1.5em;"><a href="{@docRoot}distribute/googleplay/promote/linking.html" class="landing-page-link">Linking to Your Products</a></p>
+
diff --git a/docs/html/distribute/googleplay/promote/linking.jd b/docs/html/distribute/googleplay/promote/linking.jd
new file mode 100644
index 0000000..4a1b198
--- /dev/null
+++ b/docs/html/distribute/googleplay/promote/linking.jd
@@ -0,0 +1,213 @@
+page.title=Linking to Your Products
+@jd:body
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<a href="badges.html">
+ <img alt="Get it on Google Play"
+ src="http://www.android.com/images/brand/get_it_on_play_logo_small.png" />
+</a>
+<p>For a link that includes the Google Play brand icon, check out the <a href="badges.html">Badges</a> page. </p>
+</div>
+</div>
+
+<p>Google Play provides several link formats that let you bring users to your
+products in the way you want, from Android apps, web pages, ads, reviews,
+articles, social media posts, and more.</p>
+
+<p>The link formats let you:</p>
+<ul>
+<li>Link to a specific app's <a href="#OpeningDetails">product details page</a></li>
+<li>Link to a <a href="#OpeningPublisher">list of all of your apps</a>, or</li>
+<li>Link to a <a href="#PerformingSearch">search result</a> of your choice</li>
+<li>Link to a <a href="#OpeningCollection">collection</a> on Google Play</li>
+</ul>
+
+<p>If you are linking from an Android app, you can also control whether the link
+launches the Play Store application or the browser, which takes the user
+to the Google Play web site.</p>
+
+<h2 id="OpeningDetails">Linking to a Product Details Page</h2>
+
+<p>Use the format below to deep-link users directly to a specific app's product
+details page. At the product details page, users can see the app description,
+screenshots, reviews and more, and then install it.</p>
+
+<p>To create the link, you need to know the app's fully qualified <em>package
+name</em>, which is declared in the app's <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#package">manifest
+file</a>. The package name is also visible in the Developer Console. </p>
+
+<dl>
+<dt><strong>From a web site:</strong></dt>
+<dd>
+<pre>http://play.google.com/store/apps/details?id=<package_name></pre>
+</dd>
+<dt><strong>From an Android app:</strong></dt>
+<dd>
+<pre>market://details?id=<package_name></pre>
+</dd>
+</dl>
+
+<p>Here's an example:</p>
+
+<p style="margin-left:1em;"><code><a href="http://play.google.com/store/apps/details?id=com.google.android.apps">http://play.google.com/store/apps/details?id=com.google.android.apps</a></code></p>
+
+<p>For details on how to send the link in an Android app, see <a href="#android-app">Linking from an Android App</a>.</p>
+
+
+
+<h2 id="OpeningPublisher">Linking to a Product List</h2>
+
+<p>Use the format below to link users to a list of apps published by you. The
+product list lets users see all of the apps from a specific publisher, with
+ratings, editorial badges, and an Install button for each. </p>
+
+<p>To create the link, you need to know your <em>publisher name</em>, which is
+available from the Developer Console. </p>
+
+<dl>
+<dt><strong>From a web site:</strong></dt>
+<dd>
+<pre>http://play.google.com/store/search?q=pub:<publisher_name></pre>
+</dd>
+<dt><strong>From an Android app:</strong></dt>
+<dd>
+<pre>market://search?q=pub:<publisher_name></pre>
+</dd>
+</dl>
+
+<p>Here's an example:</p>
+
+<p style="margin-left:1em;"><code><a href="http://play.google.com/store/search?q=pub:Google Inc.">http://play.google.com/store/search?q=pub:Google Inc.</a></code></p>
+
+<p>For details on how to send the link in an Android app, see <a href="#android-app">Linking from an Android App</a>.</p>
+
+
+<h2 id="PerformingSearch">Linking to a Search Result</h2>
+
+<p>Use the format below to link users to a search query result on Google Play.
+The search result page shows a list of apps (and optionally other content) that
+match the query, with ratings, badges, and an Install button for each. </p>
+
+<p>To create the link, you just need a search query string. If you want the
+query to search outside of the Google Play Apps listings, you can remove the
+<code>&c=apps</code> part of the link URL.</p>
+
+<dl>
+<dt><strong>From a web site:</strong></dt>
+<dd>
+<pre>http://play.google.com/store/search?q=<search_query>&c=apps</pre>
+</dd>
+<dt><strong>From an Android app:</strong></dt>
+<dd>
+<pre>market://search?q=<seach_query>&c=apps</pre>
+</dd>
+</dl>
+
+<p>Here's an example:</p>
+
+<p style="margin-left:1em;"><code><a href="http://play.google.com/store/search?q=maps&c=apps">http://play.google.com/store/search?q=maps&c=apps</a></code></p>
+
+<p>For details on how to send the link in an Android app, see <a href="#android-app">Linking from an Android App</a>.</p>
+
+
+
+<h2 id="OpeningCollection">Linking to a Collection</h2>
+
+<p>If your app is featured or appears in one of the Google Play Top charts or
+collections, you can use the format below to link users directly to the
+collection. The collection shows a ranked list of apps in the collection, with
+ratings, short descriptions, and an Install button.</p>
+
+<dl>
+<dt><strong>From a web site:</strong></dt>
+<dd>
+<pre>http://play.google.com/store/apps/collection/<collection_name></pre>
+</dd>
+<dt><strong>From an Android app:</strong></dt>
+<dd>
+<pre>market://apps/collection/<collection_name></pre>
+</dd>
+</dl>
+
+<p>Here's an example:</p>
+
+<p style="margin-left:1em;"><code><a href="http://play.google.com/store/apps/collection/editors_choice">http://play.google.com/store/apps/collection/editors_choice</a></code></p>
+
+<p>For details on how to send the link in an Android app, see <a href="#android-app">Linking from an Android App</a>.</p>
+
+<p class="table-caption"><strong>Table 1.</strong> Collections on Google Play</a>.</p>
+
+<table>
+<tr>
+<th>Collection</th><th>collection_name</th>
+</tr>
+<tr><td>Staff Picks (Featured)</td><td>featured</td></tr>
+<tr><td>Editor's Choice</td><td>editors_choice</td></tr>
+<tr><td>Top Paid</td><td>topselling_paid</td></tr>
+<tr><td>Top Free</td><td>topselling_free</td></tr>
+<tr><td>Top New Free</td><td>topselling_new_free</td></tr>
+<tr><td>Top New Paid</td><td>topselling_new_paid</td></tr>
+<tr><td>Top Grossing</td><td>topgrossing</td></tr>
+<tr><td>Trending</td><td>movers_shakers</td></tr>
+<tr><td>Best Selling in Games</td><td>topselling_paid_game</td></tr>
+</table>
+
+
+<h2 id="android-app">Linking from an Android App</h2>
+
+<p>There are two general formats for links that are accessible to users on
+Android devices, The two formats trigger slightly different behaviors on the
+device:</p>
+
+<ul>
+<li><code>market://</code> Launches the Play Store app to load the
+target page.</li>
+<li><code>http://</code> Lets the user choose whether to launch the
+Play Store app or the browser to handle the request. If the browser handles the
+request, it loads the target page on the Google Play web site.</li>
+</ul>
+
+<p>In general, you should use <code>http://</code> format for links on web pages
+and <code>market://</code> for links in Android apps.</p>
+
+<p>If you want to link to your products from an Android app, create an {@link
+android.content.Intent} that opens an Google Play URL, as shown in the example
+below.</p>
+
+<pre>
+Intent intent = new Intent(Intent.ACTION_VIEW);
+intent.setData(Uri.parse("market://details?id=com.example.android"));
+startActivity(intent);
+</pre>
+
+
+<h2 id="UriSummary">Summary of URL formats</h2>
+
+<p>The table below provides a summary of the URIs currently supported by the Google Play (both on
+the web and in an Android application), as discussed in the previous sections.</p>
+
+<table>
+<tr>
+<th>For this result</th>
+<th>Web page link</th>
+<th>Android app link</th>
+</tr>
+<tr>
+<td style="width:72px;">Show the product details page for a specific app</td>
+<td><code>http://play.google.com/store/apps/details?id=<package_name></code>
+<td><code>market://details?id=<package_name></code></td>
+</tr>
+<tr>
+<td>Show apps by a specific publisher</td>
+<td><nobr><code>http://play.google.com/store/search?q=pub:<publisher_name></code></nobr></td>
+<td><nobr><code>market://search?q=pub:<publisher_name></code></nobr></td>
+</tr>
+<tr>
+<td>Search for apps using a general string query.</td>
+<td><code>http://play.google.com/store/search?q=<query></code></td>
+<td><code>market://search?q=<query></code></td>
+</tr>
+</table>
+
diff --git a/docs/html/distribute/googleplay/promote/product-pages.jd b/docs/html/distribute/googleplay/promote/product-pages.jd
new file mode 100644
index 0000000..af5b2d5
--- /dev/null
+++ b/docs/html/distribute/googleplay/promote/product-pages.jd
@@ -0,0 +1,4 @@
+page.title=Your Product Pages
+@jd:body
+
+<p>Placeholder...</p>
\ No newline at end of file
diff --git a/docs/html/distribute/googleplay/publish/console.jd b/docs/html/distribute/googleplay/publish/console.jd
new file mode 100644
index 0000000..72b97ab
--- /dev/null
+++ b/docs/html/distribute/googleplay/publish/console.jd
@@ -0,0 +1,201 @@
+page.title=The Developer Console
+@jd:body
+
+
+<p>Once you've <a
+href="{@docRoot}distribute/googleplay/publish/register.html">registered</a> and
+received verification by email, you can sign in to your Google Play Android
+Developer Console, which will be the home for your app publishing operations and
+tools on Google Play. This sections below introduce a few of the key areas
+you'll find in the Developer Console.</p>
+
+<div style="width:610px;margin-left:">
+<div style="width:610px;border:1px solid #DDD;">
+<img src="{@docRoot}images/gp-dc-home.png" style="width:600px;padding:4px;margin-bottom:0em;">
+</div>
+<p class="image-caption" style="padding:.5em"><span
+style="font-weight:500;">Developer Console home page</span>: Gives you a quick
+overview of your apps, lets you jump to stats, reviews, or product details, or
+upload a new app. </p>
+</div>
+
+<h3 id="profile">Your Developer Profile</h3>
+
+<div style="width:408px;float:right;margin:1.5em;">
+<div style="width:410px;border:1px solid #DDD;">
+<img src="{@docRoot}images/gp-dc-profile.png" style="width:400px;padding:4px;margin-bottom:0em;">
+</div>
+<p class="image-caption" style="padding:.5em"><span
+style="font-weight:500;">Developer profile</span>: Specifies your developer
+identity and contact information, stores your developer key, and more.</p>
+</div>
+
+<p>Your developer profile identifies you to Google Play and to your customers.
+During registration you can provide information for your profile, but you can go
+back at any time to edit the information and change your settings. </p>
+
+<p>Your developer profile contains:</p>
+<ul>
+<li>Your developer name — the name you want to show users on your product
+details page and elsewhere on Google Play.
+<li>Your developer contact information — how Google can contact you if
+needed (this information isn't exposed to users.
+<li>Merchant information, in-app billing information.</li>
+<li>Your developer public key for licensing and In-app Billing.</li>
+</ul>
+
+<h3 id="user-accounts">Multiple user accounts</h3>
+
+<p>If you are working with a team, you can set up multiple user accounts to
+access different parts of your Developer Console. The first account registered
+is the <em>account owner</em>, with full access to all parts of the Console. The
+owner can add <em>user accounts</em> and manage what parts of the Console they
+have access to. For example, an owner can grant users access to publishing and
+app configuration, but not access to financial reports. </p>
+
+<h3 id="merchant">Linking your Merchant Account</h3>
+
+<p>If you want to sell apps or in-app products, you can link your Google
+Checkout Merchant account to your developer profile. Google Play uses the linked
+Checkout account for financial and tax identification and monthly payouts of
+sales. </p>
+
+<div style="width:410px;float:right;margin:1.5em;">
+<div style="width:410px;border:1px solid #DDD;">
+<img src="{@docRoot}images/gp-dc-details.png" style="width:400px;padding:4px;margin-bottom:0em;">
+</div>
+<p class="image-caption" style="padding:.5em"><span
+style="font-weight:500;">Product details page</span>: Lets you upload your
+graphic assets, description, support information, and other information to
+create the product details page for a specific app.</p>
+</div>
+
+<h3 id="details">Your product and listing details</h3>
+
+<p>The Developer Console lets you set up a colorful storefront page for your app
+called the <em>product details page</em>. Your product details page is the home
+for your app in Google Play — it's the page users see on their mobile
+phones or on the web when they want to learn about your app and download it.
+</p>
+
+<p>You can upload custom brand assets, screen shots, and videos to highlight
+what's great about your app, and you can provide a localized description, add
+notes about the latest version, and more. You can update your store listing at
+any time, even if you don’t have a new version of your application.</p>
+
+<h3 id="uploading">Uploading and publishing</h3>
+
+<p>From the Developer Console you can quickly upload a release-ready APK and
+publish it when you're ready. The app is a <em>draft</em> until you publish it,
+at which time Google Play makes your product details page and app available to
+users. You can unpublish the app at any time.</p>
+
+<h3 id="controls">Distribution Controls</h3>
+
+<p>In the Developer Console you can manage what countries and territories the
+app is distributed to and, for some countries, you can choose what carriers you
+want to target.</p>
+
+<p>You can also see the list of devices that your app is currently available to,
+based on any distribution rules declared in its manifest file.</p>
+
+<h3 id="profile">Selling and pricing your Products</h3>
+
+<p>The Developer Console gives you tools to set prices for your apps and in-app
+products. Your app can either be free to download or priced (charged before
+download). </p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<p>See <a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=138294&topic=2365624&ctx=topic">Supported locations for distributing applications</a> for a list of countries where you can distribute or sell your app,</p>
+</div>
+</div>
+
+<ul>
+<li>If you publish your app as free, <span style="font-weight:500;">it must
+remain free</span>. Free apps can be downloaded by any users in Google
+Play.</li>
+<li>If you publish it as priced, you can change it to free, Priced apps can be
+purchased and downloaded only from .</li>
+</ul>
+
+<p>In addition, you can sell in-app products and subscriptions in your app,
+whether it is free or priced. You can set prices separately for priced apps,
+in-app products, and subscriptions.</p>
+
+<p>If you are selling a priced app or in-app products or subscriptions, the
+Developer Console lets you set prices in a large number of different currencies.
+When users around the world visit your product details page, they see the price
+of your app in their own currency. For most countries, the price you set is the
+final price charged to users, inclusive of taxes. </p>
+
+<p>To help you manage your prices, the Developer Console provides an autofill
+capability that uses recent exchange rates to populate the prices in all
+supported currencies. You can change prices for apps and in-app products at any
+time, just by saving changes in the Develoer Console.</p>
+
+<h3>In-app Billing</h3>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>In-app Billing</h2>
+<p>For details on how to implement In-app Billing, see the
+<a href="{@docRoot}guide/google/play/billing/index.html">In-app Billing</span></a>
+developer documentation.</p></div></div>
+
+<p><a href="{@docRoot}guide/google/play/billing/index.html">In-app Billing</a> is a Google Play service that lets you monetize your apps in more ways by selling in-app products and subscriptions. In-app products are one-time purchases, while subscriptions are recurring charges on an monthly or annual basis.</p>
+
+<p>From the Developer Console you can create product lists for in-app
+products and subscriptions, set prices, and publish.</p>
+
+<div style="width:410px;float:right;margin:1.5em;">
+<div style="width:410px;border:1px solid #DDD;">
+<img src="{@docRoot}images/gp-dc-reviews.png" style="width:400px;padding:4px;margin-bottom:0em;">
+</div>
+<p class="image-caption" style="padding:.5em"><span style="font-weight:500;">User
+reviews page</span>: Gives you access to user reviews for a specific app.
+You can filter reviews in a number of ways to locate issues more easily
+and support your customers more effectively.</p>
+</div>
+
+<h3>User reviews and error reports</h3>
+
+<p>Google Play makes it easy for users to submit reviews of your app for the
+benefit of other users. The reviews are also extremely important to you, since
+they give you usability feedback, support requests, and important functionality
+issues direct from your customers. </p>
+
+<p>The Developer console also lets you see error reports, with stack trace and
+other data, submitted automatically from Android devices, for debugging and
+improving your app.</p>
+
+<h3>App statistics</h3>
+
+<p>The Developer Console gives you detailed statistics on the install
+performance of your app. </p>
+
+<p>You can view installations of your app measured by unique users, as well as
+by unique devices. For user installations, you can view active installs, total
+installs, and daily installs and uninstalls. For devices, you can see active
+installs as well as daily installs, uninstalls, and upgrades.</p>
+
+<p>You can zoom into the installation numbers along several dimensions,
+including Android platform version, device, country, language, app version, and
+carrier (mobile operator). You can see the installation data for each dimension
+on a timeline charts.</p>
+
+<p>At a glance, these charts highlight your app’s installation peaks and
+longer-term trends, which you can correlate to promotions, app improvements, or
+other factors. You can even focus in on data inside a dimension by adding
+specific points (such as individual platform versions or languages) to the
+timeline.</p>
+
+<div style="width:610px;margin:1.5em;margin-left:0">
+<div style="width:610px;border:1px solid #DDD;">
+<img src="{@docRoot}images/gp-dc-stats.png"
+style="width:600px;padding:4px;margin-bottom:0em;">
+</div>
+<p class="image-caption" style="padding:.5em"><span style="font-weight:500;">App
+installation statistics page</span>: Shows you a variety of statistics about a
+specific app's installation performance over time.</p>
+</div>
diff --git a/docs/html/distribute/googleplay/publish/index.jd b/docs/html/distribute/googleplay/publish/index.jd
new file mode 100644
index 0000000..5a5eaf2
--- /dev/null
+++ b/docs/html/distribute/googleplay/publish/index.jd
@@ -0,0 +1,23 @@
+page.title=Publishing on Google Play
+header.hide=1
+footer.hide=1
+page.metaDescription=Get started publishing apps on Google Play.
+
+@jd:body
+
+<div style="height:413px;padding-top:50px;">
+ <img src="{@docRoot}images/gp-devconsole-home.png" style="margin-top:0px;">
+</div>
+
+<div style="width:460px;padding-bottom:40px;margin-left:1.5em;">
+ <p>Upload apps, build your product pages, configure prices and
+ distribution, and publish. You can manage all phases of publishing
+ on Google Play through the Developer Console, from any web browser.</p>
+
+<p style="margin-top:1.5em;margin-bottom:1.5em;"><a href="{@docRoot}distribute/googleplay/publish/register.html" class="landing-page-link">Get started</a></p>
+</div>
+
+
+
+
+
diff --git a/docs/html/distribute/googleplay/publish/preparing.jd b/docs/html/distribute/googleplay/publish/preparing.jd
new file mode 100644
index 0000000..e50d3bf
--- /dev/null
+++ b/docs/html/distribute/googleplay/publish/preparing.jd
@@ -0,0 +1,570 @@
+page.title=Publishing Checklist for Google Play
+@jd:body
+
+<div id="qv-wrapper"><div id="qv">
+<h2>Checklist:</h2>
+<ol>
+<li><a href="#process">1. Understand the publishing process</a></li>
+<li><a href="#policies">2. Understand Google Play policies</a></li>
+<li><a href="#rating">3. Determine your content rating</a></li>
+<li><a href="#countries">4. Determine country distribution</a></li>
+<li><a href="#size">5. Confirm the app's overall size</a></li>
+<li><a href="#compatibility">6. Confirm app compatibility ranges</a></li>
+<li><a href="#free-priced">7. Decide on free or priced</a></li>
+<li><a href="#inapp-billing">8. Consider In-app Billing</a></li>
+<li><a href="#pricing">9. Set prices for your apps</a></li>
+<li><a href="#localize">10. Start localization</a></li>
+<li><a href="#localize">11. Prepare promotional graphics</a></li>
+<li><a href="#apk">12. Build the release-ready APK</a></li>
+<li><a href="#product-page">13. Complete the product details</a></li>
+<li><a href="#badges">14. Use Google Play badges and links to your promotional campaigns</a></li>
+<li><a href="#final-checks">15. Final checks and publishing</a></li>
+<li><a href="#support">16. Support users after launch</a></li>
+</ol>
+</div></div>
+
+
+<p>Before you publish your app on Google Play and distribute it to users, you
+need to get the app ready, test it, and prepare your promotional materials. </p>
+
+<p>This document helps you understand the publishing process and get ready for a
+successful product launch on Google Play. It summarizes some of the
+tasks you'll need to complete before publishing your app on Google Play, such as
+creating a signed, release-ready APK, understanding the requirements of the app,
+and creating the product page and graphic assets for your app.</p>
+
+<p>The preparation and publishing tasks are numbered to give you a rough idea of
+sequence. However, you can handle the tasks in any sequence that works for you
+or you can skip steps as appropriate.</p>
+
+<p>As you move toward publishing, a variety of support resources are available to
+you. Relevant links are provided in each step.</p>
+
+
+<h2 id="process">1. Understand the publishing process</h2>
+
+<p>Before you begin the steps in this checklist, you should take a moment to
+read and understand the overall publishing workflow and become familiar with how
+the process works. In particular, you or your development team will need to
+prepare your app for release using a process common to all Android apps.
+The <a
+href="{@docRoot}tools/publishing/publishing_overview.html">Publishing
+Workflow</a> documents provide the details on how publishing works and how to
+get an APK ready for release. </p>
+
+<p>Once you are familiar with publishing in general, read this document to
+understand the issues that you should consider when publishing an app on Google
+Play. </p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="{@docRoot}tools/publishing/publishing_overview.html">General Publishing Overview</a></strong> — Start here for an overview of publishing options for Android apps.</li>
+<li><strong><a href="{@docRoot}tools/publishing/preparing.html">Preparing for Release</a></strong> — Developer documentation on how to build the signed, release-ready APK. This process is the same for all Android apps. </li>
+<li><strong><a href="{@docRoot}distribute/googleplay/publish/publishing.html">Publishing on Google Play</a></strong> — Publishing process specific to Android apps being published on Google Play.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="policies">2. Understand Google Play policies and agreements</h2>
+
+<p>Make sure that you understand and follow the Google Play program policies
+that you accepted when registering. Google Play actively enforces the policies
+and any violations can lead to suspension of your app or, for repeated
+violations, termination of your developer account. </p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/topic.py?hl=en&topic=2364761&parent=2365624&ctx=topic">Policy and Best Practices
+</a></strong> — Help Center document describing various content policies and processes.</li>
+
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="rating">3. Determine your app's content rating</h2>
+
+<p>Google Play requires you to set a content rating for your app, which informs
+Google Play users of its maturity level. Before you publish, you should confirm
+what rating level you want to use. The available content rating levels are:</p>
+
+<ul>
+<li>Everyone</li>
+<li>Low maturity</li>
+<li>Medium maturity</li>
+<li>High maturity</li>
+</ul>
+
+<p>On their Android devices, Android users can set the desired maturity level
+for browsing. Google Play then filters apps based on the setting, so the content
+rating you select can affect the app's distribution to users. You can assign (or
+change) the content rating for your app in the Developer Console, so no changes
+are required in your app binary.</p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=188189">Rating your application content for Google Play</a></strong> — Help Center document describing content ratings levels and how to choose the appropriate one for your app.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="countries">4. Determine country distribution</h2>
+
+<p>Google Play lets you control what countries and territories your app is
+distributed to. For widest reach and the largest potential customer base, you
+would normally want to distribute to all available countries and territories.
+However, because of business needs, app requirements, or launch dependencies,
+you might want to exclude one or more countries from your distribution. </p>
+
+<p>It's important to determine the exact country distribution early, because it
+can affect:</p>
+<ul>
+<li>The need for localized resources in the app</li>
+<li>The need for a localized app description in the Developer Console</li>
+<li>Legal requirements for the app that may be specific to certain
+countries</li>
+<li>Time zone support, local pricing, and so on.</li>
+</ul>
+
+<p>With your country targeting in mind, you should assess what
+your localization needs are, both in your app and in its Google Play listing
+details, and start the work of localization well in advance of your
+launch target date.</p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=138294&topic=2365624&ctx=topic">Supported locations for distributing applications</a></strong> on Google Play.
+.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="size">5. Confirm the app's overall size</h2>
+
+<p>The overall size of your app can affect its design and how you publish it on
+Google Play. Currently, the maximum size for an APK published on Google Play is
+<strong>50 MB</strong>. If your app exceeds that size, or if you want to offer a
+secondary download, you can use <a
+href="{@docRoot}guide/google/play/expansion-files.html">APK Expansion Files</a>,
+which Google Play will host for free on its server infrastructure and
+automatically handle the download to devices.</p>
+
+<ul>
+<li>The maximum size for an APK published on Google Play is 50 MB.</li>
+<li>You can use up to two (2) APK Expansion Files, each up to 2 GB in size, for
+each APK.</li>
+</ul>
+
+<p>Using APK Expansion files is a convenient, cost-effective method of
+distributing large apps. However, the use of APK Expansion Files requires some
+changes in your app binary, so you will need to make those changes before
+creating your release-ready APK.</p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="{@docRoot}guide/google/play/expansion-files.html">APK Expansion Files</a></strong> — Developer documentation describing APK Expansion Files and how to support them in your app.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="compatibility">6. Confirm the app's platform and screen compatibility ranges</h2>
+
+<p>Before publishing, it's important to make sure that your app is designed to
+run properly on the Android platform versions and device screen sizes that you
+want to target.
+
+<p>From an app-compatibility perspective, Android platform versions are defined
+by <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level</a>. You should
+confirm the minimum version that your app is compatible with (<a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><minSdkVersion></code></a>),
+as that will affect its distribution to Android
+devices once it is published. </p>
+
+<p>For screen sizes, you should confirm that the app runs properly and looks
+good on the range of screen sizes and densities that you want to support. You
+should confirm the minimum screen-size and density support that your app
+declares (<a
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><code><supports-screens></code></a>),
+since that can affect its distribution to
+Android devices once it is published. </p>
+
+<p>To get a better understanding of the current device penetration of Android
+platform versions and screen sizes across all Android devices, see the <a
+href="{@docRoot}guide/topics/resources/localization.html">Device Dashboard</a>
+charts.</p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="{@docRoot}guide/topics/resources/localization.html">Device Dashboard</a></strong> — A chart showing global percentages of devices by Android version, screen size, and level of OpenGL ES support.</li>
+<li><strong><a href="{@docRoot}guide/topics/resources/localization.html">Android API Levels</a></strong> — A definition of API Levels and a list of which Android platform versions they are associated with. </li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="free-priced">7. Decide whether your app will be free or priced</h2>
+
+<p>On Google Play, you can publish apps as free to download or priced. Free apps
+can be downloaded by any Android user in Google Play.
+Paid apps can be downloaded only by users who have registered a form of payment
+in Google Play, such as a credit card or Direct Carrier Billing.</p>
+
+<p>Deciding whether you app will be free or paid is important because, on Google
+Play, <strong>free apps must remain free</strong>.</p>
+
+<ul>
+<li>Once you publish your app as a free app, you cannot ever change it to being
+a priced app. However, you can still sell in-app products and
+subscriptions through Google Play's In-app Billing service.</li>
+<li>If you publish your app as a priced app, you <em>can</em> change
+it at any time to being a free app (but cannot then change it back to
+priced). You can also sell in-app products and subscriptions. </li>
+</ul>
+
+<p> If your app is be priced, or if you'll be selling in-app products,
+you need set up a Checkout Merchant Account before you can publish.</p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="{@docRoot}guide/google/play/billing/index.html">In-app Billing</a></strong> — Developer introduction to Google Play In-app Billing.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="inapp-billing">8. Consider using In-app Billing</h2>
+
+<p>Google Play <a href="{@docRoot}guide/google/play/billing/index.html">In-app
+Billing</a> lets you sell digital content in your applications. You can use the
+service to sell a wide range of content, including downloadable content such as
+media files or photos, and virtual content such as game levels or potions.
+In-app Billing service lets you sell one-time purchases and subscriptions from
+inside your app. This can help you to monetize the app over its installed
+lifetime. </p>
+
+<p>If your are looking for more ways to monetize your app and build engagement,
+you should consider In-app Billing. The service has become very popular with
+both users and developers. To use In-app Billing, you need to make changes to
+your app binary, so you will need to complete and test your implementation
+before creating your release-ready APK.</p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="{@docRoot}guide/google/play/billing/index.html">In-app Billing</a></strong> — Developer documentation describing In-app Billing and how to support it in your app.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="pricing">9. Set prices for your products</h2>
+
+<p>If your app is priced or you will sell in-app products, Google Play lets you
+set prices for your products in a variety of currencies, for users in markets
+around the world. You can set prices individually in different currencies, so
+you have the flexibility to adjust your price according to market conditions and
+exchange rates. </p>
+
+<p>Before you publish, consider how you will price your products
+and what your prices will be in various currencies. Later, you can set prices
+in all available currencies through the Developer Console.</p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1169947&topic=15867&ctx=topic">Selling Apps in Multiple Currencies
+</a></strong> — Help Center document describing how pricing works in Google Play.</li>
+
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=138412&topic=15867&ctx=topic">Prices and supported currencies
+</a></strong> — Help Center document listing supported currencies for pricing your apps.</li>
+
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=112622&topic=15867&ctx=topic">Transaction Fees
+</a></strong> — Help Center document describing transaction fees for priced apps and in-app products.</li>
+
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=138000&topic=15867&ctx=topic">Specifying tax rates
+</a></strong> — Help Center document describing how to set tax rates for different countries. </li>
+
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="localize">10. Start localization</h2>
+
+<p>With your country targeting in mind, it's a good idea to assess your localization
+needs and start the work of localizing well in advance of your target
+launch date.</p>
+
+<p>There are at least two aspects of localization to consider:</p>
+
+<ul>
+<li>Localizing the strings, images, and other resources in your app</li>
+<li>Localizing you app's store listing details on Google Play</li>
+</ul>
+
+<p>To get started localizing your app, work with your development team to extract
+any resource or coded strings for translation. Also identify images, icons, or
+other assets that should be language- or locale-specific. Hand these off to
+a translator.</p>
+
+<p>To localize your store listing, first create and finalize your app title, description,
+and promotional text. Collect and send all of these for localization. You can optionally
+translate the "Recent Changes" text for app updates as well.</p>
+
+<p>When your translations are complete, move them into your app resources as needed and test
+that they are loaded properly. Save your app's translated listing details for later,
+when you upload assets and configure your product details.</p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="{@docRoot}guide/topics/resources/localization.html">Localization</a></strong> — How to supply localized resources in your app.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="graphics">11. Prepare promotional graphics</h2>
+
+<p>When you publish on Google Play, you can supply a variety of high-quality
+graphic assets to showcase your app or brand. After you publish, these appear on
+your product details page, in store listings and search results, and elsewhere.
+These graphic assets are key parts of a successful product details page that
+attracts and engages users, so you should consider having a professional produce
+them for you. Screen shots and videos are also very important, because they show
+what your app looks like, how it's used or played, and what makes it different.
+
+<p>All of your graphic assets should be designed so that they are easy to see
+and highlight your app or brand in a colorful, interesting way. The assets
+should reference the same logo and icon as users will actually find in the All
+Apps launcher once they have downloaded the app. Your graphic assets should also
+fit in well with the graphic assets of other apps published by you, which will
+be also be displayed to users on your product details page. </p>
+
+<p>Because these assets are so important, you should get started on them well in
+advance of your target publishing date. </p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1078870">Graphic Assets for your Application
+</a></strong> — Details about the graphic assets you need to upload before publishing.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="apk">12. Build and upload the release-ready APK</h2>
+
+<p>When you are satisfied that your app meets your UI, compatibility, and
+quality requirements, you can build the release-ready version of the app. The
+release-ready APK is what you you will upload to the Developer Console and
+distribute to users.
+
+<p>The process for preparing a release-ready APK is the same for all apps,
+regardless of how they are distributed. Generally the process includes basic code cleanup
+and optimization, building and signing with your release key, and final testing.
+When you are finished preparing your application for release, you'll have a signed
+APK file that you can upload to the Developer Console for distribution to
+users. </p>
+
+<p>For complete details on how to create a release-ready version of your app,
+read <a href="{@docRoot}tools/publishing/preparing.html">Preparing for
+Release</a>.</p>
+
+<p>Once you have the release-ready APK in hand, you can upload it to
+the Developer Console. If necessary, you can replace the APK with a more
+recent version before publishing. </p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="{@docRoot}tools/publishing/preparing.html">Preparing for Release</a></strong> — Essential information for preparing and packaging your app properly for distribution.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="product-page">13. Complete the app's product details</h2>
+
+<p>On Google Play, your app's product information is shown to users on its
+product details page, the page that users visit to learn more about your app and
+the page from which they will decide to purchase or download your app, on their
+Android devices or on the web.</p>
+
+<p>Google Play gives you a variety of ways to promote your app and engage with
+users on your product details page, from colorful graphics, screenshots, and
+videos to localized descriptions, release details, and links to your other apps.
+As you prepare to publish your app, make sure that you take advantage of all
+that your product details page can offer, making your app as compelling as
+possible to users.</p>
+
+<p>You should begin planning your product page in advance of your target launch
+date, arranging for localized description, high-quality graphic assets,
+screenshots and video, and so on. </p>
+
+<p>As you get near your target publishing date, you should become familiar with
+all the fields, options, and assets associated with the product details configuration
+page in the Developer Console. As you collect the information and assets for the
+page, make sure that you can enter or upload it to the Developer Console, until
+the page is complete and ready for publishing. </p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="{@docRoot}distribute/googleplay/promote/product-pages.html">Your Product Page</a></strong> — Tips and details on creating your product details page.</li>
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=113475&topic=2365760&ctx=topic">Category types
+</a></strong> — Help Center document listing available categories for apps.</li>
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1078870&topic=2365760&ctx=topic">Graphic Assets for your Application
+</a></strong> — Help Center document describing the various graphics you can add to your product listing.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="badges">14. Use Google Play badges and links in your promotional
+campaigns</h2>
+
+<p>Google Play badges give you an officially branded way of promoting your app
+to Android users. Use the <a
+href="{@docRoot}distribute/googleplay/promote/badges.html">Google Play Badge
+generator</a> to quickly create badges to link users to your products from web
+pages, ads, reviews, and more. You can also use special <a
+href="{@docRoot}distribute/googleplay/promote/linking.html">link formats</a>
+to link directly to your product details page, to a list of your products, or to
+search results.</p>
+
+<p>To help your app get traction after launch, it's strongly recommended that you support
+launch with a promotional campaign that announces your product through many channels as
+possible, in as many countries as possible. For example, you can promote the launch
+using ad placements, social network or blog posts, video and other media, interviews
+and reviews, or any other channel available.</p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="{@docRoot}distribute/googleplay/promote/badges.html">Google Play Badges</a></strong> — Generate a badge to bring users to your app in Google Play.</li>
+<li><strong><a href="{@docRoot}distribute/googleplay/promote/linking.html">Linking to Your Products</a></strong> — Link formats that you can use to bring users to your app in Google Play.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+<h2 id="final-checks">15. Final checks and publishing</h2>
+
+<p>When you think you are ready to publish, sign in to the Developer Console and take a few moments for a few
+final checks:</p>
+
+<p>Make sure that: </p>
+
+<ul>
+<li>Your developer profile has the correct information and is linked to the proper Google Checkout Merchant account (if you are selling products).</li>
+<li>You have the right version of the app uploaded.</li>
+<li>All parts of your Product Details are ready, including all graphic assets, screenshots, video, localized descriptions, and so on. </li>
+<li>You have set your app's pricing to free or priced.</li>
+<li>You have set country (and carrier) targeting and priced your products (if appropriate) in buyer currencies</li>
+<li>"Compatible devices" shows that your app is actually reaching the devices that you are targeting. If not, you should check with your development team on the apps requirements and filtering rules. </li>
+<li>You have provided the correct link to your web site and the correct support email address.</li>
+<li>Your app does not violate content policy guidelines.</li>
+<li>You have acknowledged that your app meets the guidelines for Android content on Google Play and also US export laws. </li>
+</ul>
+
+<p>Your app is now ready to publish!</p>
+
+<p>If you are releasing an update, make sure to read the <a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=113476&topic=2365760&ctx=topic">requirements for publishing updates</a>. </p>
+
+<p>When you are ready, click the <strong>Publish</strong> button in the Developer Console. Within a few hours, your app will become available to users and your product page will be appear in Google Play for browsing, searching, or linking from your promotional campaigns.</p>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="http://www.android.com/us/developer-content-policy.html">Google Play Developer Program Policies</a></strong> — Guidelines for what is acceptable conent in Google Play. Please read and understand the policies before publishing. </li>
+<li><strong><a href="{@docRoot}distribute/googleplay/promote/linking.html">Updates</a></strong> — Requirements for app updates in Google Play.</li>
+<li><strong><a href="{@docRoot}support.html">Developer Support</a></strong> — Support resources that you can use to find answers and report issues.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+
+<h2 id="support">16. Support users after launch</h2>
+
+<p>After you publish an app or an app update, it's crucial for you to support
+your customers. Prompt and courteous support can provide a better experience for
+users that results in better ratings and more positive reviews for your
+products. Users are likely to be more engaged with your app and recommend it if
+you are responsive to their needs and feedback. This is especially true after
+publishing if you are using a coordinated promotional campaign.</p>
+
+<p>There are a number of ways that you can keep in touch with users and offer
+them support. The most fundamental is to provide your <em>support email
+address</em> on your product details page. Beyond that, you can provide support
+in any way you choose, such as a forum, mailing list or a Google+ page. The
+Google Play team does provide user support for downloading, installing and
+payments issues, but issues that fall outside of these topics will fall under
+your domain. Examples of issues you can support include: feature requests,
+questions about using the app and questions about compatibility settings. </p>
+
+<p>After publishing, plan to: </p>
+<ul>
+<li>Check your ratings and reviews frequently on your app's product details
+page. Watch for recurring issues that could signal bugs or other issues. </li>
+<li>Be mindful of new Android platform version launches, as compatibility
+settings for your apps might need to be updated.</li>
+<li>Put a link to your support resources on your web site and set up any other
+support such as forums.</li>
+<li>Provide an appropriate support email address on your product details page
+and respond to users when they take the time to email you.</li>
+<li>Beyond the automatic refund window offered by Google Play, be generous with
+your own refund policy, as satisfied users will be more likely to purchase in
+the future. </li>
+<li>Acknowledge and fix issues in your app. It helps to be transparent and
+list known issues on your product details page proactively. </li>
+<li>Publish updates as frequently as you are able, without sacrificing quality
+or annoying users with too-frequent updates. </li>
+<li>With each update, make sure to provide a summary of what's changed. You can
+enter this information in the Developer Console. Users will read it and
+appreciate that you are serious about improving the quality of your app. </li>
+</ul>
+
+<table>
+<tr>
+<td><p>Related resources:</p>
+<ul style="margin-top:-.5em;">
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=113477&topic=2364761&ctx=topic">Supporting your users
+</a></strong> — Help Center document describing options for supporting users.</li>
+<li><strong><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1153479">In-app Billing</a></strong> — Help Center document describing how to correctly set up In-app Billing.</li>
+<li><strong><a href="https://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=138001">Issuing Refunds</a></strong> — -- Help Center document describing how to issue refunds.</li>
+</ul>
+</td>
+</tr>
+</table>
+
+
+
diff --git a/docs/html/distribute/googleplay/publish/register.jd b/docs/html/distribute/googleplay/publish/register.jd
new file mode 100644
index 0000000..7ca6696
--- /dev/null
+++ b/docs/html/distribute/googleplay/publish/register.jd
@@ -0,0 +1,72 @@
+page.title=Get Started with Publishing
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>Help topics</h2>
+<ul>
+ <li><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=113468">Developer Registration</a></li>
+ <li><a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=138294&topic=2365624&ctx=topic">Supported Locations for Distributing Apps</a></li>
+ <li><a href="http://support.google.com/googleplay/android-developer/bin/topic.py?hl=en&topic=2364761">Policy and Best Practices</a></li>
+ <li><a href="http://support.google.com/googleplay/android-developer/">Developer Support</a></li>
+</ul>
+
+<h2>Get Started</h2>
+<ol>
+ <li><a href="https://play.google.com/apps/publish/">Google Play Android Developer Console</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>You can set up to start publishing on Google Play in only a few minutes. Here's how you do it: </p>
+
+<ul>
+<li>Register for a Google Play publisher account</li>
+<li>If you will sell apps, set up a Google Checkout Merchant Account</li>
+<li>Explore the Google Play Android Developer Console and learn about the tools for publishing</li>
+</ul>
+
+
+<h3>Register for a publisher account</h3>
+
+<p>The first step is to visit the Google Play Android Developer Console and register for a publisher account.</p>
+
+<p>Here's what you will do during registration: </p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>Tips</h2>
+ <ul>
+ <li>You need a Google account to register. You can create one during the process. </li>
+ <li>If you are an organization, consider registering a new Google account rather than using a personal account.</li>
+ <li>Review the <a href="https://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=138294">developer countries</a> and <a href="https://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=150324">merchant countries</a> where you can distribute and sell apps.</li>
+ </ul>
+</div></div>
+
+
+<ol>
+<li>Visit the Google Play Android Developer Console at <a href="https://play.google.com/apps/publish/">https://play.google.com/apps/publish/</a>.
+<li>Enter basic information about your <strong>developer identity</strong> — developer name, email address, and so on. You can modify this information later.</li>
+<li>Read and accept the <strong>Developer Distribution Agreement</strong> that applies to your country or region. Note that apps and store listings that you publish on Google Play must comply with the Developer Program Policies and US export law,</li>
+<li>Pay a <strong>$25 USD registration fee</strong> using Google Checkout. If you don't have a Google Checkout account, you can quickly set one up during the process.</li>
+</ol>
+
+<p>When your registration is verified, you’ll be notified at the email address you specified during registration. </p>
+
+<h3>Set up a Google Checkout Merchant account</h3>
+
+<p>If you want to sell products on Google Play — priced apps, in-app products, or subscriptions — you will also need to set up a Google Checkout <a href="http://checkout.google.com/sell">Merchant Account</a>. You can do that at any time, but make sure to first review the list of <a href="https://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=150324">merchant countries</a>.</p>
+
+<p>To set up a Merchant account from the Developer Console:</p>
+
+<ol>
+<li><strong>Sign in</strong> to your Google Play Android Developer Console at <a href="https://play.google.com/apps/publish/">https://play.google.com/apps/publish/</a>
+<li>Click on the "<strong>Edit profile</strong>" link.
+<li>Select "<strong>Setup a Merchant Account at Google Checkout</strong>".</li>
+</ol>
+
+<p>This will take you to the Google Checkout site to sign up as a Merchant; you'll need to have information about your business handy to complete this step.</p>
+
+<h3>Explore the Developer Console</h3>
+<p>When your registration is verified, you can sign in to your Android Developer Console, which will be the home for your app publishing operations and tools on Google Play. </p>
diff --git a/docs/html/distribute/googleplay/strategies/app-quality.jd b/docs/html/distribute/googleplay/strategies/app-quality.jd
new file mode 100644
index 0000000..26d71d7
--- /dev/null
+++ b/docs/html/distribute/googleplay/strategies/app-quality.jd
@@ -0,0 +1,116 @@
+page.title=Improving App Quality
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>Strategies:</h2>
+<ul>
+<li><a href="#listen">Listen to Your Users</a></li>
+<li><a href="#stability">Improve Stability and Eliminate Bugs</a></li>
+<li><a href="#responsiveness">Improve UI Responsiveness</a></li>
+<li><a href="#usability">Improve Usability</a></li>
+<li><a href="#appearance">Professional Appearance and Aesthetics</a></li>
+<li><a href="#features">Deliver the Right Set of Features</a></li>
+<li><a href="#integrate">Integrate with the System and Third-Party Apps</a></li>
+<li><a href="#details">Pay Attention to Details</a></li>
+</ul>
+</div>
+</div>
+
+<p>
+With thousands of new apps being published in Google Play every week, it's important to look for any available way to get the most visibility and the highest ratings possible. One way of improving your app's visibility in the ecosystem is by deploying well-targeted mobile advertising campaigns and cross-app promotions. Another time-tested method of fueling the impression-install-ranking cycle is simply: <em>improve the product</em>!</p>
+<p>
+A better app can go a very long way: a higher quality app will translate to higher user ratings, generally better rankings, more downloads, and higher retention (longer install periods). High-quality apps also have a much higher likelihood of getting some unanticipated positive publicity such as being featured in Google Play or getting social media buzz.</p>
+<p>
+The upside to having a higher-quality app is obvious. However, it's not always clear how to make an app "better". The path to improving app quality isn't always well-lit. The term "quality" — along with "polish" and "fit and finish" — aren't always well-defined. Here we'll light the path by looking at some of the key factors in app quality and ways of improving your app along these dimensions.</p>
+
+<h2 id="listen">Listen to Your Users</h2>
+<p>
+Most ways of measuring the "success" of an app are dependent on user behavior. User-related metrics such as number of downloads, daily active installs, retention rates, and so on highlight the importance of users. If you aren't doing so already, it's a good idea to start thinking of your app's quality as it relates to your users.</p>
+<p>
+The most obvious way to listen to users is by reading and addressing comments on your app in Google Play. Although the comments aren't always productive or constructive, some will provide valuable insight on aspects of your app that you may not have consciously considered before. It's important to remember that users have the opportunity to change their ratings and comments about an app as much as they'd like.</p>
+<p>
+One way to reach users and help them address their concerns is to set up your own support and discussion destination(s). There are some great support tools out there that can put you in touch with your users directly such as <a href="http://groups.google.com">Google Groups</a>, <a href="http://discussions.zoho.com/">Zoho Discussions</a>, <a href="http://getsatisfaction.com">getsatisfaction.com</a> and <a href="http://uservoice.com">uservoice.com</a>. Once you get set up with such a tool, make sure to fill in the support link in your Google Play product details page — users do click through to these.</p>
+<p>
+Another way to better listen to your users is by having a public beta or trusted tester program. It's crucial to have some amount of real user testing before releasing something in Google Play. Fortunately, you can distribute your apps to users outside of Google Play via a website; this website can require a login or be publicly accessible — it's entirely up to you. Take advantage of this opportunity by offering your next planned update to some early adopters, before submitting to Google Play. You'll be surprised by how many little, yet impactful, improvements can come out of crowd-sourced, real-user testing.</p>
+
+
+<h2 id="stability">Improve Stability and Eliminate Bugs</h2>
+
+<p>
+The effect of overall app stability of ratings and user satisfaction is very well-known and there are many tools and techniques for testing and profiling your app on different devices and user scenarios.</p>
+<p>
+One noteworthy and yet relatively underused tool for catching stability issues such as crashes is the <a href="{@docRoot}tools/help/monkey.html">UI/Application Exerciser Monkey</a> (Monkey). Monkey will send random UI events to your app's activities, allowing you to trigger user flows that can uncover stability problems.</p>
+<p>
+Also, with the Google error-reporting features built into most Android devices, users now have a way to report application crashes to developers. The error reports show up in aggregate in the Google Play Developer Console. Make sure to read these reports often and act on them appropriately.</p>
+<p>
+Last, keep an external bug and feature request tracker and let users know how to find it. This will enable them to engage with the app at a closer level, by following features and bugs that affect them. User frustration with app problems can be effectively managed with diligent issue tracking and communication. Some of the community support tools listed above offer issue tracking features, and if your project is open source, most popular repository hosting sites such as <a href="http://code.google.com/hosting">Google Code</a> and <a href="https://github.com/">GitHub</a> will offer this as well.</p>
+
+<h2 id="responsiveness">Improve UI Responsiveness</h2>
+<p>
+One sure-fire way to lose your users is to give them a slow, unresponsive UI. Research has shown that <a href="http://googleresearch.blogspot.com/2009/06/speed-matters.html">speed matters</a>... for any interface, be it desktop, web, or mobile. In fact, the importance of speed is amplified on mobile devices since users often need their information on the go and in a hurry.</p>
+<p>
+You can improve your apps's UI responsiveness by moving long-running operations off the main thread to worker threads. Android offers built-in debugging facilities such as StrictMode for analyzing your app's performance and activities on the main thread. You can see more recommendations in <a href="http://www.youtube.com/watch?v=c4znvD-7VDA">Writing Zippy Android Apps</a>, a developer session from Google I/O 2010,</p>
+
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>More resources</h2>
+<ul>
+<li><a href="{@docRoot}design/index.html">Android Design</a></li>
+<li><a href="{@docRoot}guide/practices/performance.html">Designing for Performance</a></li>
+<li><a href="{@docRoot}guide/practices/responsiveness.html">Designing for Responsiveness</a>
+<li><a href="{@docRoot}guide/practices/seamlessness.html">Designing for seamlessness</a>
+</li>
+</ul>
+</div></div>
+<p>
+A great way to improve UI performance is to minimize the complexity of your layouts. If you open up <a href="{@docRoot}tools/help/hierarchy-viewer.html">hierarchyviewer</a> and see that your layouts are more than 5 levels deep, it may be time to simplify your layout. Consider refactoring those deeply nested LinearLayouts into RelativeLayout. The impact of View objects is cumulative — each one costs about 1 to 2 KB of memory, so large view hierarchies can be a recipe for disaster, causing frequent VM garbage collection passes which block the main (UI) thread. You can learn more in <a href="http://www.youtube.com/watch?v=wDBM6wVEO70">World of ListView</a>, another session at Google I/O.</p>
+<p>
+Lastly, pointed out in the blog post <a href="http://android-developers.blogspot.com/2010/10/traceview-war-story.html">Traceview War Story</a>, tools like <a href="{@docRoot}tools/traceview.html">traceview</code> and <a href="{@docRoot}tools/ddms.html">ddms</a> can be your best friends in improving your app by profiling method calls and monitoring VM memory allocations, respectively.</p>
+
+
+<h2 id="usability">Improve Usability</h2>
+<p>
+In usability and in app design too, you should listen carefully to your users. Ask a handful of real Android device users (friends, family, etc.) to try out your app and observe them as they interact with it. Look for cases where they get confused, are unsure of how to proceed, or are surprised by certain behaviors. Minimize these cases by rethinking some of the interactions in your app, perhaps working in some of the <a href="http://www.youtube.com/watch?v=M1ZBjlCRfz0">user interface patterns</a> the Android UI team discussed at Google I/O.</p>
+<p>
+In the same vein, two problems that can plague some Android user interfaces are small tap targets and excessively small font sizes. These are generally easy to fix and can make a big impact on usability and user satisfaction. As a general rule, optimize for ease of use and legibility, while minimizing, or at least carefully balancing, information density.</p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>More resources</h2>
+<ul>
+As you are designing or evaluating your app's UI, make sure to read and become familiar with the <a href="{@docRoot}design/index.html">Android Design</a> guidelines. Included are many examples of UI patterns, styles, and building blocks, as well as tools for the design process.</li>
+</ul>
+</div></div>
+
+<p>
+Another way to incrementally improve usability, based on real-world data, is to implement <a href="http://code.google.com/mobile/analytics/docs/">Analytics</a> throughout your app to log usage of particular sections. Consider demoting infrequently used sections to the overflow menu in the <a href="{@docRoot}design/patterns/actionbar.html">Action bar</a>, or removing them altogether. For often-used sections and UI elements, make sure they're immediately obvious and easily accessible in your app's UI so that users can get to them quickly.</p>
+<p>
+Lastly, usability is an extensive and well-documented subject, with close ties to interface design, cognitive science, and other disciplines.</p>
+
+<h2 id="appearance">Professional Appearance and Aesthetics</h2>
+<p>
+There's no substitute for a real user interface designer — ideally one who's well-versed in mobile and Android, and ideally handy with both interaction and visual design. One popular venue to post openings for designers is <a href="http://jobs.smashingmagazine.com">jobs.smashingmagazine.com</a>, and leveraging social connections on Twitter and LinkedIn can surface great talent.</p>
+<p>
+If you don't have the luxury of working with a UI designer, there are some ways in which you can improve your app's appearance yourself. First, get familiar with Adobe Photoshop, Adobe Fireworks, or some other raster image editing tool. Mastering the art of the pixel in these apps takes time, but honing this skill can help build polish across your interface designs. Also, master the resources framework by studying <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=core/res/res;h=a3562fe1af94134486a8a899f02a9c2f7986c8dd;hb=master">the framework UI</a> assets and layouts and reading through the new <a href="{@docRoot}guide/components/resources/available-resources.html">resources documentation</a>. Techniques such as 9-patches and resource directory qualifiers are somewhat unique to Android, and are crucial in building flexible yet aesthetic UIs.</p>
+<p>
+Before you get too far in designing your app and writing the code, make sure to visit the Android Design site and learn about the vision, the building blocks, and the tools of designing beautiful and inspiring user interfaces.</p>
+
+<h2 id="features">Deliver the Right Set of Features</h2>
+<p>
+Having the <em>right</em> set of features in your app is important. It's often easy to fall into the trap of feature-creep, building as much functionality into your app as possible. Providing instant gratification by immediately showing the most important or relevant information is crucial on mobile devices. Providing too much information can be as frustrating (or even more so) than not providing enough of it.</p>
+<p>
+Again, listen to your users by collecting and responding to feature requests. Be careful, though, to take feature requests with a grain of salt. Requests can be very useful in aggregate, to get a sense of what kinds of functionality you should be working on, but not every feature request needs to be implemented.</p>
+
+<h2 id="integrate">Integrate with the System and Third-Party apps</h2>
+<p>
+A great way to deliver a delightful user experience is to integrate tightly with the operating system. Features like <a href="{@docRoot}guide/topics/appwidgets/index.html">Home screen widgets</a>, <a href={@docRoot}design/patterns/notifications.html">rich notifications</a>, <a href="{@docRoot}guide/topics/search/index.html">global search integration</a>, and {@link android.widget.QuickContactBadge Quick Contacts} are fairly low-hanging fruit in this regard. </p>
+
+<p>For some app categories, basic features like home screen widgets are par for the course. Not including them is a sure-fire way to tarnish an otherwise positive user experience. Some apps can achieve even tighter OS integration with Android's contacts, accounts, and sync APIs. </p>
+<p>
+Third-party integrations can provide even more user delight and give the user a feeling of device cohesiveness. It's also a really nice way of adding functionality to your app without writing any extra code (by leveraging other apps' functionalities). For example, if you're creating a camera app, you can allow users to edit their photos in <a href=" http://mobile.photoshop.com/android/">Photoshop Express</a> before saving them to their collection, if they have that third-party application installed. More information on this subject is available in the class, <a href="{@docRoot}training/basics/intents/index.html">Interacting with Other Apps</a>.</p>
+
+<h2 id="details">Pay Attention to Details</h2>
+<p>
+One particular detail to pay close attention to is your app's icon quality and consistency. Make sure your app icons (especially your launcher icon) are crisp and pixel-perfect at all resolutions, and follow the <a href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">icon guidelines</a> as much as possible. If you're having trouble or don't have the resources to design the icons yourself, consider using the new <a href="http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html">Android Asset Studio</a> tool to generate a set.</p>
diff --git a/docs/html/distribute/googleplay/strategies/featuring.jd b/docs/html/distribute/googleplay/strategies/featuring.jd
new file mode 100644
index 0000000..4c4e67e
--- /dev/null
+++ b/docs/html/distribute/googleplay/strategies/featuring.jd
@@ -0,0 +1,4 @@
+page.title=Preparing for Featuring
+@jd:body
+
+<p>Placeholder...</p>
\ No newline at end of file
diff --git a/docs/html/distribute/googleplay/strategies/index.jd b/docs/html/distribute/googleplay/strategies/index.jd
new file mode 100644
index 0000000..3794bbf
--- /dev/null
+++ b/docs/html/distribute/googleplay/strategies/index.jd
@@ -0,0 +1,33 @@
+page.title=Success Strategies
+page.metaDescription=
+header.hide=1
+footer.hide=1
+
+@jd:body
+
+
+
+<style>
+#landing-graphic-container {
+ position: relative;
+}
+
+#text-overlay {
+ position: absolute;
+ left: 0;
+ top: 472px;
+ width: 280px;
+}
+</style>
+
+<div id="landing-graphic-container">
+ <div id="text-overlay">
+ Strategies for building ratings, improving reviews, monetizing, and more.
+ <br><br>
+ <a href="/distribute/googleplay/promote/product-pages.html" class="landing-page-link">Preparing for Featuring</a>
+ </div>
+
+ <a href="{@docRoot}distribute/googleplay/promote/index.html">
+ <img src="{@docRoot}design/media/index_landing_page.png">
+ </a>
+</div>
\ No newline at end of file
diff --git a/docs/html/distribute/index.jd b/docs/html/distribute/index.jd
new file mode 100644
index 0000000..ffdeb2f
--- /dev/null
+++ b/docs/html/distribute/index.jd
@@ -0,0 +1,39 @@
+page.title=Distribute Apps
+header.hide=1
+
+@jd:body
+
+
+
+ <div class="marquee">
+
+ <div continer>
+
+ <div class="madin-img" style="position:absolute;margin-left:42px;margin-top:76px;">
+ <img src="/images/home/google-play.png">
+ </div>
+ <div class="copy" style="position:relative;left:480px;width:360;">
+ <h1>Introducing Google Play</h1>
+ <p>The most visited store in the world for Android apps. Cloud-connected and always synced, it's never been easier for users to find and download your apps.</p>
+
+ <p><a class="landing-page-link" href="http://youtu.be/g5SzWc8-X0M">Watch a video</a></p>
+ </div> </div>
+</div>
+<div class="distribute-features col-13" style="clear:both;margin-top:246px;">
+ <ul>
+ <li><h5>Growth Engine</h5>
+ A billion downloads a month and growing. Get your apps in front of millions of users at Google's scale.<br />
+ <a href="{@docRoot}distribute/googleplay/about/visibility.html">Read More ›</a>
+ <li><h5>Build Your Business</h5> Sell your app in over 130 countries. Flexible monetization options with in-app purchase, subscriptions, and more. <br />
+ <a href="{@docRoot}distribute/googleplay/about/monetizing.html">Read More ›</a></li>
+ <li class="last"><h5>Distribution Control</h5> Deliver your apps to the users you want, on the devices you want, on <em>your</em> schedule. <br />
+ <a href="{@docRoot}distribute/googleplay/about/distribution.html">Read More ›</a></li>
+ </ul>
+</div>
+
+
+
+
+
+
+
diff --git a/docs/html/distribute/open.jd b/docs/html/distribute/open.jd
new file mode 100644
index 0000000..edcfc9c
--- /dev/null
+++ b/docs/html/distribute/open.jd
@@ -0,0 +1,107 @@
+page.title=Open Distribution
+@jd:body
+
+<p>As an open platform, Android offers choice. You
+distribute your Android apps to users in any way you want, using any
+distribution approach or combination of approaches that meets your needs.
+From publishing in an app marketplace to serving your apps from a web site or
+emailing them directly users, you are never locked into any
+particular distribution platform.</p>
+
+<p>The process for building and packaging your app for distribution is the same,
+regardless of how you will distribute your app. This saves you time and lets you
+automate parts of the process as needed. You can read <a
+href="{@docRoot}tools/publishing/preparing.html">Preparing
+for Release</a> for more information.</p>
+
+<p>The sections below highlight some of the alternatives for distributing
+your apps to users.</p>
+
+<h2 id="publishing-marketplace">Distributing through an App Marketplace</h2>
+
+<p>Usually, to reach the broadest possible audience, you would distribute your
+apps through a marketplace, such as Google Play.</p>
+
+<p>Google Play is the premier marketplace for Android apps and is particularly
+useful if you want to distribute your applications to a large global audience.
+However, you can distribute your apps through any app marketplace you want or
+you can use multiple marketplaces.</p>
+
+<h2 id="publishing-email">Distributing your application through email</h2>
+
+<div class="figure" style="width:246px">
+ <img src="{@docRoot}images/publishing/publishing_via_email.png"
+ alt="Screenshot showing the graphical user interface users see when you send them an app"
+ style="width:240px;" />
+ <p class="img-caption">
+ <strong>Figure 1.</strong> Users can simply click <strong>Install</strong> when you send them
+ an application via email.
+ </p>
+</div>
+
+<p>The easiest and quickest way to release your application is to send it to users through
+email. To do this, you prepare your application for release and then attach it to an email
+and send it to a user. When users open your email message on their Android-powered device,
+the Android system will recognize the APK and display an <strong>Install Now</strong>
+button in the email message (see figure 1). Users can install your application by touching the
+button.</p>
+
+<p class="note"><strong>Note:</strong> The <strong>Install Now</strong> button
+shown in Figure 1 appears only if users have configured their device to allow
+installation from <a href="#unknown-sources">unknown sources</a> and have opened your
+email with the native Gmail application.</p>
+
+<p>Distributing applications through email is convenient if you are sending your application to
+only a few trusted users, but it provides few protections from piracy and unauthorized
+distribution; that is, anyone you send your application to can simply forward it to someone else.</p>
+
+<h2 id="publishing-website">Distributing through a web site</h2>
+
+<p>If you do not want to release your app on a marketplace like Google Play, you
+can make the app available for download on your own website or server, including
+on a private or enterprise server. To do this, you must first prepare your
+application for release in the normal way. Then all you need to do is host the
+release-ready APK file on your website and provide a download link to users.
+</p>
+
+<p>When users browse to the download link from their Android-powered devices,
+the file is downloaded and Android system automatically starts installing it on
+the device. However, the installation process will start automatically only if
+users have configured their Settings to allow the installation of apps from
+<a href="#unknown-sources">unknown sources</a>.</p>
+
+<p>Although it is relatively easy to release your application on your own
+website, it can be inefficient. For example, if you want to monetize your
+application you will have to process and track all financial transactions
+yourself and you will not be able to use Google Play's <a
+href="{@docRoot}guide/google/play/billing/index.html">In-app Billing service</a>
+to sell in-app products. In addition, you will not be able to use the <a
+href="{@docRoot}guide/google/play/licensing/index.html">Licensing service</a> to
+help prevent unauthorized installation and use of your application.</p>
+
+
+<h2 id="unknown-sources">User Opt-In for Apps from Unknown Sources</h2>
+
+<div class="figure" style="width:246px;margin-top:0;">
+ <img src="{@docRoot}images/publishing/publishing_unknown_sources_sm.png"
+ alt="Screenshot showing the setting for accepting download and install of
+ apps from unknown sources." style="width:240px;" />
+ <p class="img-caption">
+ <strong>Figure 2.</strong> Users must enable the <strong>Unknown sources</strong>
+ setting before they can install apps not downloaded from Google Play.
+ </p>
+</div>
+
+<p>Android protects users from inadvertent download and install of apps from
+locations other than Google Play (which is trusted). It blocks such installs
+until the user opts-in <strong>Unknown sources</strong> in
+Settings <strong>></strong> Security, shown in Figure 2. To allow
+the installation of applications from other sources, users need to enable the
+Unknown sources setting on their devices, and they need to make this
+configuration change <em>before</em> they download your application to their
+devices.</p>
+
+<p class="note">Note that some network providers do not allow users to install
+applications from unknown sources.</p>
+
+
diff --git a/docs/html/favicon-a.ico b/docs/html/favicon-a.ico
new file mode 100644
index 0000000..d8884b7
--- /dev/null
+++ b/docs/html/favicon-a.ico
Binary files differ
diff --git a/docs/html/favicon.ico b/docs/html/favicon.ico
index d8884b7..c1076aa 100644
--- a/docs/html/favicon.ico
+++ b/docs/html/favicon.ico
Binary files differ
diff --git a/docs/html/guide/appendix/api-levels.jd b/docs/html/guide/appendix/api-levels.jd
deleted file mode 100644
index bc7d83b..0000000
--- a/docs/html/guide/appendix/api-levels.jd
+++ /dev/null
@@ -1,421 +0,0 @@
-page.title=Android API Levels
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
-<ol>
- <li><a href="#intro">What is API Level?</a></li>
- <li><a href="#uses">Uses of API Level in Android</a></li>
- <li><a href="#considerations">Development Considerations</a>
- <ol>
- <li><a href="#fc">Application forward compatibility</a></li>
- <li><a href="#bc">Application backward compatibility</a></li>
- <li><a href="#platform">Selecting a platform version and API Level</a></li>
- <li><a href="#apilevel">Declaring a minimum API Level</a></li>
- <li><a href="#testing">Testing against higher API Levels</a></li>
- </ol>
- </li>
- <li><a href="#provisional">Using a Provisional API Level</a></li>
- <li><a href="#filtering">Filtering the Documentation</a></li>
-</ol>
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a> manifest element</li>
- </ol>
-
-</div>
-</div>
-
-<p>As you develop your application on Android, it's useful to understand the
-platform's general approach to API change management. It's also important to
-understand the API Level identifier and the role it plays in ensuring your
-application's compatibility with devices on which it may be installed. </p>
-
-<p>The sections below provide information about API Level and how it affects
-your applications. </p>
-
-<p>For information about how to use the "Filter by API Level" control
-available in the API reference documentation, see
-<a href="#filtering">Filtering the documentation</a> at the
-end of this document. </p>
-
-<h2 id="intro">What is API Level?</h2>
-
-<p>API Level is an integer value that uniquely identifies the framework API
-revision offered by a version of the Android platform.</p>
-
-<p>The Android platform provides a framework API that applications can use to
-interact with the underlying Android system. The framework API consists of:</p>
-
-<ul>
-<li>A core set of packages and classes</li>
-<li>A set of XML elements and attributes for declaring a manifest file</li>
-<li>A set of XML elements and attributes for declaring and accessing resources</li>
-<li>A set of Intents</li>
-<li>A set of permissions that applications can request, as well as permission
-enforcements included in the system</li>
-</ul>
-
-<p>Each successive version of the Android platform can include updates to the
-Android application framework API that it delivers. </p>
-
-<p>Updates to the framework API are designed so that the new API remains
-compatible with earlier versions of the API. That is, most changes in the API
-are additive and introduce new or replacement functionality. As parts of the API
-are upgraded, the older replaced parts are deprecated but are not removed, so
-that existing applications can still use them. In a very small number of cases,
-parts of the API may be modified or removed, although typically such changes are
-only needed to ensure API robustness and application or system security. All
-other API parts from earlier revisions are carried forward without
-modification.</p>
-
-<p>The framework API that an Android platform delivers is specified using an
-integer identifier called "API Level". Each Android platform version supports
-exactly one API Level, although support is implicit for all earlier API Levels
-(down to API Level 1). The initial release of the Android platform provided
-API Level 1 and subsequent releases have incremented the API Level.</p>
-
-<p>The following table specifies the API Level supported by each version of the
-Android platform.</p>
-
-<table>
- <tr><th>Platform Version</th><th>API Level</th><th>VERSION_CODE</th><th>Notes</th></tr>
-
- <tr><td><a href="{@docRoot}sdk/android-4.0.3.html">Android 4.0.3</a></td>
- <td><a href="{@docRoot}sdk/api_diff/15/changes.html" title="Diff Report">15</a></td>
- <td>{@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1}</td>
- <td rowspan="2"><a href="{@docRoot}sdk/android-4.0-highlights.html">Platform
-Highlights</a></td></tr>
-
- <tr><td><a href="{@docRoot}sdk/android-4.0.html">Android 4.0, 4.0.1, 4.0.2</a></td>
- <td><a href="{@docRoot}sdk/api_diff/14/changes.html" title="Diff Report">14</a></td>
- <td>{@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH}</td>
- </tr>
-
- <tr><td><a href="{@docRoot}sdk/android-3.2.html">Android 3.2</a></td>
- <td><a href="{@docRoot}sdk/api_diff/13/changes.html" title="Diff Report">13</a></td>
- <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}</td>
- <td><!-- <a href="{@docRoot}sdk/android-3.2-highlights.html">Platform Highlights</a>--></td></tr>
-
- <tr><td><a href="{@docRoot}sdk/android-3.1.html">Android 3.1.x</a></td>
- <td><a href="{@docRoot}sdk/api_diff/12/changes.html" title="Diff Report">12</a></td>
- <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB_MR1}</td>
- <td><a href="{@docRoot}sdk/android-3.1-highlights.html">Platform Highlights</a></td></tr>
-
- <tr><td><a href="{@docRoot}sdk/android-3.0.html">Android 3.0.x</td>
- <td><a href="{@docRoot}sdk/api_diff/11/changes.html" title="Diff Report">11</a></td>
- <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB}</td>
- <td><a href="{@docRoot}sdk/android-3.0-highlights.html">Platform Highlights</a></td></tr>
-
- <tr><td><a href="{@docRoot}sdk/android-2.3.3.html">Android 2.3.4<br>Android 2.3.3</td>
- <td><a href="{@docRoot}sdk/api_diff/10/changes.html" title="Diff Report">10</a></td>
- <td>{@link android.os.Build.VERSION_CODES#GINGERBREAD_MR1}</td>
- <td rowspan="2"><a href="{@docRoot}sdk/android-2.3-highlights.html">Platform Highlights</a></td></tr>
-
- <tr><td><a href="{@docRoot}sdk/android-2.3.html">Android 2.3.2<br>Android 2.3.1<br>Android 2.3</td>
- <td><a href="{@docRoot}sdk/api_diff/9/changes.html" title="Diff Report">9</a></td>
- <td>{@link android.os.Build.VERSION_CODES#GINGERBREAD}</td>
- </tr>
-
- <tr><td><a href="{@docRoot}sdk/android-2.2.html">Android 2.2.x</td>
- <td ><a href="{@docRoot}sdk/api_diff/8/changes.html" title="Diff Report">8</a></td>
- <td>{@link android.os.Build.VERSION_CODES#FROYO}</td>
- <td><a href="{@docRoot}sdk/android-2.2-highlights.html">Platform Highlights</a></td></tr>
-
- <tr><td><a href="{@docRoot}sdk/android-2.1.html">Android 2.1.x</td>
- <td><a href="{@docRoot}sdk/api_diff/7/changes.html" title="Diff Report">7</a></td>
- <td>{@link android.os.Build.VERSION_CODES#ECLAIR_MR1}</td>
- <td rowspan="3" ><a href="{@docRoot}sdk/android-2.0-highlights.html">Platform Highlights</a></td></tr>
-
- <tr><td><a href="{@docRoot}sdk/android-2.0.1.html">Android 2.0.1</td>
- <td><a href="{@docRoot}sdk/api_diff/6/changes.html" title="Diff Report">6</a></td>
- <td>{@link android.os.Build.VERSION_CODES#ECLAIR_0_1}</td>
- </tr>
-
- <tr><td><a href="{@docRoot}sdk/android-2.0.html">Android 2.0</td>
- <td><a href="{@docRoot}sdk/api_diff/5/changes.html" title="Diff Report">5</a></td>
- <td>{@link android.os.Build.VERSION_CODES#ECLAIR}</td>
- </tr>
-
- <tr><td><a href="{@docRoot}sdk/android-1.6.html">Android 1.6</td>
- <td><a href="{@docRoot}sdk/api_diff/4/changes.html" title="Diff Report">4</a></td>
- <td>{@link android.os.Build.VERSION_CODES#DONUT}</td>
- <td><a href="{@docRoot}sdk/android-1.6-highlights.html">Platform Highlights</a></td></tr>
-
- <tr><td><a href="{@docRoot}sdk/android-1.5.html">Android 1.5</td>
- <td><a href="{@docRoot}sdk/api_diff/3/changes.html" title="Diff Report">3</a></td>
- <td>{@link android.os.Build.VERSION_CODES#CUPCAKE}</td>
- <td><a href="{@docRoot}sdk/android-1.5-highlights.html">Platform Highlights</a></td></tr>
-
- <tr><td><a href="{@docRoot}sdk/android-1.1.html">Android 1.1</td>
- <td>2</td>
- <td>{@link android.os.Build.VERSION_CODES#BASE_1_1}</td><td></td></tr>
-
- <tr><td>Android 1.0</td>
- <td>1</td>
- <td>{@link android.os.Build.VERSION_CODES#BASE}</td>
- <td></td></tr>
-</table>
-
-
-<h2 id="uses">Uses of API Level in Android</h2>
-
-<p>The API Level identifier serves a key role in ensuring the best possible
-experience for users and application developers:
-
-<ul>
-<li>It lets the Android platform describe the maximum framework API revision
-that it supports</li>
-<li>It lets applications describe the framework API revision that they
-require</li>
-<li>It lets the system negotiate the installation of applications on the user's
-device, such that version-incompatible applications are not installed.</li>
-</ul>
-
-<p>Each Android platform version stores its API Level identifier internally, in
-the Android system itself. </p>
-
-<p>Applications can use a manifest element provided by the framework API —
-<code><uses-sdk></code> — to describe the minimum and maximum API
-Levels under which they are able to run, as well as the preferred API Level that
-they are designed to support. The element offers three key attributes:</p>
-
-<ul>
-<li><code>android:minSdkVersion</code> — Specifies the minimum API Level
-on which the application is able to run. The default value is "1".</li>
-<li><code>android:targetSdkVersion</code> — Specifies the API Level
-on which the application is designed to run. In some cases, this allows the
-application to use manifest elements or behaviors defined in the target
-API Level, rather than being restricted to using only those defined
-for the minimum API Level.</li>
-<li><code>android:maxSdkVersion</code> — Specifies the maximum API Level
-on which the application is able to run. <strong>Important:</strong> Please read the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
-documentation before using this attribute. </li>
-</ul>
-
-<p>For example, to specify the minimum system API Level that an application
-requires in order to run, the application would include in its manifest a
-<code><uses-sdk></code> element with a <code>android:minSdkVersion</code>
-attribute. The value of <code>android:minSdkVersion</code> would be the integer
-corresponding to the API Level of the earliest version of the Android platform
-under which the application can run. </p>
-
-<p>When the user attempts to install an application, or when revalidating an
-appplication after a system update, the Android system first checks the
-<code><uses-sdk></code> attributes in the application's manifest and
-compares the values against its own internal API Level. The system allows the
-installation to begin only if these conditions are met:</p>
-
-<ul>
-<li>If a <code>android:minSdkVersion</code> attribute is declared, its value
-must be less than or equal to the system's API Level integer. If not declared,
-the system assumes that the application requires API Level 1. </li>
-<li>If a <code>android:maxSdkVersion</code> attribute is declared, its value
-must be equal to or greater than the system's API Level integer.
-If not declared, the system assumes that the application
-has no maximum API Level. Please read the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
-documentation for more information about how the system handles this attribute.</li>
-</ul>
-
-<p>When declared in an application's manifest, a <code><uses-sdk></code>
-element might look like this: </p>
-
-<pre><manifest>
- <uses-sdk android:minSdkVersion="5" />
- ...
-</manifest></pre>
-
-<p>The principal reason that an application would declare an API Level in
-<code>android:minSdkVersion</code> is to tell the Android system that it is
-using APIs that were <em>introduced</em> in the API Level specified. If the
-application were to be somehow installed on a platform with a lower API Level,
-then it would crash at run-time when it tried to access APIs that don't exist.
-The system prevents such an outcome by not allowing the application to be
-installed if the lowest API Level it requires is higher than that of the
-platform version on the target device.</p>
-
-<p>For example, the {@link android.appwidget} package was introduced with API
-Level 3. If an application uses that API, it must declare a
-<code>android:minSdkVersion</code> attribute with a value of "3". The
-application will then be installable on platforms such as Android 1.5 (API Level
-3) and Android 1.6 (API Level 4), but not on the Android 1.1 (API Level 2) and
-Android 1.0 platforms (API Level 1).</p>
-
-<p>For more information about how to specify an application's API Level
-requirements, see the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
- section of the manifest file documentation.</p>
-
-
-<h2 id="considerations">Development Considerations</h2>
-
-<p>The sections below provide information related to API level that you should
-consider when developing your application.</p>
-
-<h3 id="fc">Application forward compatibility</h3>
-
-<p>Android applications are generally forward-compatible with new versions of
-the Android platform.</p>
-
-<p>Because almost all changes to the framework API are additive, an Android
-application developed using any given version of the API (as specified by its
-API Level) is forward-compatible with later versions of the Android platform and
-higher API levels. The application should be able to run on all later versions
-of the Android platform, except in isolated cases where the application uses a
-part of the API that is later removed for some reason. </p>
-
-<p>Forward compatibility is important because many Android-powered devices
-receive over-the-air (OTA) system updates. The user may install your
-application and use it successfully, then later receive an OTA update to a new
-version of the Android platform. Once the update is installed, your application
-will run in a new run-time version of the environment, but one that has the API
-and system capabilities that your application depends on. </p>
-
-<p>In some cases, changes <em>below</em> the API, such those in the underlying
-system itself, may affect your application when it is run in the new
-environment. For that reason it's important for you, as the application
-developer, to understand how the application will look and behave in each system
-environment. To help you test your application on various versions of the Android
-platform, the Android SDK includes multiple platforms that you can download.
-Each platform includes a compatible system image that you can run in an AVD, to
-test your application. </p>
-
-<h3 id="bc">Application backward compatibility</h3>
-
-<p>Android applications are not necessarily backward compatible with versions of
-the Android platform older than the version against which they were compiled.
-</p>
-
-<p>Each new version of the Android platform can include new framework APIs, such
-as those that give applications access to new platform capabilities or replace
-existing API parts. The new APIs are accessible to applications when running on
-the new platform and, as mentioned above, also when running on later versions of
-the platform, as specified by API Level. Conversely, because earlier versions of
-the platform do not include the new APIs, applications that use the new APIs are
-unable to run on those platforms.</p>
-
-<p>Although it's unlikely that an Android-powered device would be downgraded to
-a previous version of the platform, it's important to realize that there are
-likely to be many devices in the field that run earlier versions of the
-platform. Even among devices that receive OTA updates, some might lag and
-might not receive an update for a significant amount of time. </p>
-
-<h3 id="platform">Selecting a platform version and API Level</h3>
-
-<p>When you are developing your application, you will need to choose
-the platform version against which you will compile the application. In
-general, you should compile your application against the lowest possible
-version of the platform that your application can support.
-
-<p>You can determine the lowest possible platform version by compiling the
-application against successively lower build targets. After you determine the
-lowest version, you should create an AVD using the corresponding platform
-version (and API Level) and fully test your application. Make sure to declare a
-<code>android:minSdkVersion</code> attribute in the application's manifest and
-set its value to the API Level of the platform version. </p>
-
-<h3 id="apilevel">Declaring a minimum API Level</h3>
-
-<p>If you build an application that uses APIs or system features introduced in
-the latest platform version, you should set the
-<code>android:minSdkVersion</code> attribute to the API Level of the latest
-platform version. This ensures that users will only be able to install your
-application if their devices are running a compatible version of the Android
-platform. In turn, this ensures that your application can function properly on
-their devices. </p>
-
-<p>If your application uses APIs introduced in the latest platform version but
-does <em>not</em> declare a <code>android:minSdkVersion</code> attribute, then
-it will run properly on devices running the latest version of the platform, but
-<em>not</em> on devices running earlier versions of the platform. In the latter
-case, the application will crash at runtime when it tries to use APIs that don't
-exist on the earlier versions.</p>
-
-<h3 id="testing">Testing against higher API Levels</h3>
-
-<p>After compiling your application, you should make sure to test it on the
-platform specified in the application's <code>android:minSdkVersion</code>
-attribute. To do so, create an AVD that uses the platform version required by
-your application. Additionally, to ensure forward-compatibility, you should run
-and test the application on all platforms that use a higher API Level than that
-used by your application. </p>
-
-<p>The Android SDK includes multiple platform versions that you can use,
-including the latest version, and provides an updater tool that you can use to
-download other platform versions as necessary. </p>
-
-<p>To access the updater, use the <code>android</code> command-line tool,
-located in the <sdk>/tools directory. You can launch the SDK updater by
-executing <code>android sdk</code>. You can
-also simply double-click the android.bat (Windows) or android (OS X/Linux) file.
-In ADT, you can also access the updater by selecting
-<strong>Window</strong> > <strong>Android SDK
-Manager</strong>.</p>
-
-<p>To run your application against different platform versions in the emulator,
-create an AVD for each platform version that you want to test. For more
-information about AVDs, see <a
-href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a>. If
-you are using a physical device for testing, ensure that you know the API Level
-of the Android platform it runs. See the table at the top of this document for
-a list of platform versions and their API Levels. </p>
-
-<h2 id="provisional">Using a Provisional API Level</h2>
-
-<p>In some cases, an "Early Look" Android SDK platform may be available. To let
-you begin developing on the platform although the APIs may not be final, the
-platform's API Level integer will not be specified. You must instead use the
-platform's <em>provisional API Level</em> in your application manifest, in order
-to build applications against the platform. A provisional API Level is not an
-integer, but a string matching the codename of the unreleased platform version.
-The provisional API Level will be specified in the release notes for the Early
-Look SDK release notes and is case-sensitive.</p>
-
-<p>The use of a provisional API Level is designed to protect developers and
-device users from inadvertently publishing or installing applications based on
-the Early Look framework API, which may not run properly on actual devices
-running the final system image.</p>
-
-<p>The provisional API Level will only be valid while using the Early Look SDK
-and can only be used to run applications in the emulator. An application using
-the provisional API Level can never be installed on an Android device. At the
-final release of the platform, you must replace any instances of the provisional
-API Level in your application manifest with the final platform's actual API
-Level integer.</p>
-
-
-<h2 id="filtering">Filtering the Reference Documentation by API Level</h2>
-
-<p>Reference documentation pages on the Android Developers site offer a "Filter
-by API Level" control in the top-right area of each page. You can use the
-control to show documentation only for parts of the API that are actually
-accessible to your application, based on the API Level that it specifies in
-the <code>android:minSdkVersion</code> attribute of its manifest file. </p>
-
-<p>To use filtering, select the checkbox to enable filtering, just below the
-page search box. Then set the "Filter by API Level" control to the same API
-Level as specified by your application. Notice that APIs introduced in a later
-API Level are then grayed out and their content is masked, since they would not
-be accessible to your application. </p>
-
-<p>Filtering by API Level in the documentation does not provide a view
-of what is new or introduced in each API Level — it simply provides a way
-to view the entire API associated with a given API Level, while excluding API
-elements introduced in later API Levels.</p>
-
-<p>If you decide that you don't want to filter the API documentation, just
-disable the feature using the checkbox. By default, API Level filtering is
-disabled, so that you can view the full framework API, regardless of API Level.
-</p>
-
-<p>Also note that the reference documentation for individual API elements
-specifies the API Level at which each element was introduced. The API Level
-for packages and classes is specified as "Since <api level>" at the
-top-right corner of the content area on each documentation page. The API Level
-for class members is specified in their detailed description headers,
-at the right margin. </p>
diff --git a/docs/html/guide/appendix/g-app-intents.jd b/docs/html/guide/appendix/g-app-intents.jd
index df9d29b..10ec01e 100644
--- a/docs/html/guide/appendix/g-app-intents.jd
+++ b/docs/html/guide/appendix/g-app-intents.jd
@@ -4,7 +4,7 @@
<div class="sidebox-wrapper">
<div class="sidebox">
For more information about intents, see the <a
-href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>.
+href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>.
</div>
</div>
diff --git a/docs/html/guide/appendix/glossary.jd b/docs/html/guide/appendix/glossary.jd
index 06fdef2..94cb0f0 100644
--- a/docs/html/guide/appendix/glossary.jd
+++ b/docs/html/guide/appendix/glossary.jd
@@ -42,7 +42,7 @@
SDK. It provides tools to browse the device, copy tools on the device, and
forward ports for debugging. If you are developing in Eclipse using the
ADT Plugin, adb is integrated into your development environment. See
- <a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a>
+ <a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a>
for more information. </dd>
<dt id="application">Application</dt>
@@ -91,7 +91,7 @@
with the SDK. It provides screen capture, log dump, and process
examination capabilities. If you are developing in Eclipse using the ADT
Plugin, DDMS is integrated into your development environment. See <a
- href="{@docRoot}guide/developing/debugging/ddms.html">Using DDMS</a> to learn more about the program.</dd>
+ href="{@docRoot}tools/debugging/ddms.html">Using DDMS</a> to learn more about the program.</dd>
<dt id="dialog">Dialog</dt> <dd> A floating window that that acts as a lightweight
form. A dialog can have button controls only and is intended to perform a
@@ -131,7 +131,7 @@
is responsible for resolving the best-available receiver for each Intent,
based on the criteria supplied in the Intent and the Intent Filters
defined by other applications. For more information, see <a
- href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and
+ href="{@docRoot}guide/components/intents-filters.html">Intents and
Intent Filters</a>.
<p>Related: <a href="#intentfilter">Intent Filter</a>, <a
href="#broadcastreceiver">Broadcast Receiver</a>.</p></dd>
@@ -145,7 +145,7 @@
available intent filters in all applications and passes the Intent to the
application/activity that best matches the Intent and criteria. For more
information, see <a
- href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and
+ href="{@docRoot}guide/components/intents-filters.html">Intents and
Intent Filters</a>.
<p>Related: <a href="#intent">Intent</a>, <a
href="#broadcastreceiver">Broadcast Receiver</a>.</p></dd>
diff --git a/docs/html/guide/appendix/install-location.jd b/docs/html/guide/appendix/install-location.jd
index 63a3817..19c4b39 100644
--- a/docs/html/guide/appendix/install-location.jd
+++ b/docs/html/guide/appendix/install-location.jd
@@ -174,7 +174,7 @@
<dt>Copy Protection</dt>
<dd>Your application cannot be installed to a device's SD card if it uses Google Play's
Copy Protection feature. However, if you use Google Play's
- <a href="{@docRoot}guide/market/licensing.html">Application Licensing</a> instead, your
+ <a href="{@docRoot}guide/google/play/licensing.html">Application Licensing</a> instead, your
application <em>can</em> be installed to internal or external storage, including SD cards.</dd>
</dl>
@@ -198,7 +198,7 @@
provide additional services when inactive. When external storage becomes unavailable and a game
process is killed, there should be no visible effect when the storage becomes available again and
the user restarts the game (assuming that the game properly saved its state during the normal
-<a href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">Activity lifecycle</a>).</p>
+<a href="{@docRoot}guide/components/activities.html#Lifecycle">Activity lifecycle</a>).</p>
<p>If your application requires several megabytes for the APK file, you should
carefully consider whether to enable the application to install on the external storage so that
diff --git a/docs/html/guide/appendix/market-filters.jd b/docs/html/guide/appendix/market-filters.jd
deleted file mode 100644
index 3e502d7..0000000
--- a/docs/html/guide/appendix/market-filters.jd
+++ /dev/null
@@ -1,454 +0,0 @@
-page.title=Filters on Google Play
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>Quickview</h2>
-<ul>
-<li>Google Play applies filters that control which Android-powered devices can access your
-application when the user is visiting the store.</li>
-<li>Filtering is determined by comparing device configurations that you declare in you app's
-manifest file to the configurations defined by the device, as well as other factors.</li> </ul>
-
-<h2>In this document</h2>
-
-<ol>
- <li><a href="#how-filters-work">How Filters Work on Google Play</a></li>
- <li><a href="#manifest-filters">Filtering based on Manifest Elements</a>
- <ol>
- <li><a href="#advanced-filters">Advanced manifest filters</a></li>
- </ol>
- </li>
- <li><a href="#other-filters">Other Filters</a></li>
- <li><a href="#MultiApks">Publishing Multiple APKs with Different Filters</a></li>
-</ol>
-
-<h2>See also</h2>
- <ol>
-<li><a
-href="{@docRoot}guide/practices/compatibility.html">Android Compatibility</a></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html"><supports-gl-texture></a></code></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><supports-screens></a></code></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><uses-configuration></a></code></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature></a></code></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library></a></code></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code></li>
-<li><code><a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></code></a></li>
-</ol>
-
-<div id="qv-extra">
- <img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
- <div id="qv-sub-rule">
- <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0 5px;">
- <h2 style="color:#669999;padding-top:1em;">Interested in publishing your app on Google Play?</h2>
- <p><a id="publish-link"
-href="http://play.google.com/apps/publish">Go to Google Play</a> to create a publisher
-account and upload your app.</p></div>
-</div>
-
-</div>
-</div>
-
-
-<p>When a user searches or browses on Google Play on an Android device, the results are filtered
-based on which applications are compatible with that device. For example, if an application
-requires a camera (as specified in the application manifest file), then Google Play will not show
-the app on any device that does not have a camera.</p>
-
-<p>Declarations in the manifest file that are compared to the device's configuration is not the
-only part of how applications are filtered. Filtering might also occur due to the user's country and
-carrier, the presence or absence of a SIM card, and other factors. </p>
-
-<p>Changes to the Google Play filters are independent of changes to the Android platform itself.
-This document is updated periodically to reflect any changes that affect the way Google Play
-filters applications.</p>
-
-
-<h2 id="how-filters-work">How Filters Work on Google Play</h2>
-
-<p>Google Play uses the filter restrictions described below to determine
-whether to show your application to a user who is browsing or searching for
-applications from the Google Play app. When determining whether to display your app,
-Google Play checks the device's hardware and software configuration, as well as it's
-carrier, location, and other characteristics. It then compares those against the
-restrictions and dependencies expressed by the application's
-manifest file and publishing details. If the application is
-compatible with the device according to the filter rules, Google Play displays the
-application to the user. Otherwise, Google Play hides your application from search
-results and category browsing, even if a user specifically requests
-the app by clicking a deep link that points directly to the app's ID within Google Play..</p>
-
-<p class="note"><strong>Note:</strong> When users browse the <a
-href="http://play.google.com/apps">Google Play web site</a>, they can see all published
-applications. The Google Play web site compares the application requirements to each of the
-user's registered devices for compatibility, though, and only allows them to install the application
-if it's compatible with their device.</p>
-
-<p>You can use any combination of the available filters for your app. For example, you can set a
-<code>minSdkVersion</code> requirement of <code>"4"</code> and set <code>smallScreens="false"</code>
-in the app, then when uploading the app to Google Play you could target European countries (carriers)
-only. Google Play's filters will thus prevent the application from being available on any device
-that does not match all three of these requirements. </p>
-
-<p>All filtering restrictions are associated with an application's version and can
-change between versions. For example, if a user has installed your application and you publish an
-update that makes the app invisible to the user, the user will not see that an update is
-available.</p>
-
-
-<h2 id="manifest-filters">Filtering based on Manifest Elements</h2>
-
-<p>Most filters are triggered by elements within an application's
-manifest file, <a
-href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>
-(although not everything in the manifest file can trigger filtering).
-Table 1 lists the manifest elements that you should use to trigger
-filtering, and explains how the filtering for each element works.</p>
-
-<p id="table1" class="table-caption"><strong>Table 1.</strong> Manifest elements that
-trigger filtering on Google Play.</p>
-<table>
- <tr>
- <th>Manifest Element</th>
- <th>Filter Name</th>
- <th>How It Works</th>
- </tr>
- <tr>
- <td valign="top" style="white-space:nowrap;"><code><a href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><supports-screens></a></code>
- <!-- ##api level 4## --></td>
- <td valign="top">Screen Size</td>
- <td valign="top">
-
-<p>An application indicates the screen sizes that it is capable of supporting by
-setting attributes of the <code><supports-screens></code> element. When
-the application is published, Google Play uses those attributes to determine whether
-to show the application to users, based on the screen sizes of their
-devices. </p>
-
-<p>As a general rule, Google Play assumes that the platform on the device can adapt
-smaller layouts to larger screens, but cannot adapt larger layouts to smaller
-screens. Thus, if an application declares support for "normal" screen size only,
-Google Play makes the application available to both normal- and large-screen devices,
-but filters the application so that it is not available to small-screen
-devices.</p>
-
-<p>If an application does not declare attributes for
-<code><supports-screens></code>, Google Play uses the default values for those
-attributes, which vary by API Level. Specifically: </p>
-
-<ul>
-<li><p>For applications that set either the <code><a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">android:
-minSdkVersion</a></code> or <code><a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">android:
-targetSdkVersion</a></code> to 3 or lower, the <code><supports-screens></code> element itself
-is undefined and no attributes are available. In this case, Google Play assumes that
-the application is designed for normal-size screens and shows the application to
-devices that have normal or larger screens. </p>
-
-<li>When the either the <code><a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">android:
-minSdkVersion</a></code> or <code><a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">android:
-targetSdkVersion</a></code> is set to 4 or higher, the default for all attributes is
-<code>"true"</code>. In this way, the application is considered to support all screen sizes by
-default.</li>
-</ul>
-
- <p><strong>Example 1</strong><br />
- The manifest declares <code><uses-sdk android:minSdkVersion="3"></code>
- and does not include a <code><supports-screens></code> element.
- <strong>Result</strong>: Google Play will not show the app to a user of a
- small-screen device, but will show it to users of normal and large-screen
- devices, unless other filters apply. </p>
- <p><strong>Example 2<br />
- </strong>The manifest declares <code><uses-sdk android:minSdkVersion="3"
- android:targetSdkVersion="4"></code> and does not include a
- <code><supports-screens></code> element.
- <strong>Result</strong>: Google Play will show the app to users on all
- devices, unless other filters apply. </p>
- <p><strong>Example 3<br />
- </strong>The manifest declares <code><uses-sdk android:minSdkVersion="4"></code>
- and does not include a <code><supports-screens></code> element.
- <strong>Result</strong>: Google Play will show the app to all users,
- unless other filters apply. </p>
- <p>For more information on how to declare support for screen sizes in your
- application, see <code><a
- href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><supports-screens></a></code>
- and <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
- Screens</a>.</p>
-</td>
- </tr>
-
- <tr>
- <td valign="top" style="white-space:nowrap;"><code><a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><uses-configuration></a></code>
- <!-- ##api level 3## --></td>
- <td valign="top">Device
- Configuration: <br />
- keyboard, navigation, touch screen</td>
- <td valign="top"><p>An application can
- request certain hardware features, and Google Play will show the app only on devices that have the required hardware.</p>
- <p><strong>Example 1<br />
- </strong>The manifest includes <code><uses-configuration android:reqFiveWayNav="true" /></code>, and a user is searching for apps on a device that does not have a five-way navigational control. <strong>Result</strong>: Google Play will not show the app to the user. </p>
- <p><strong>Example 2<br />
- </strong>The manifest does not include a <code><uses-configuration></code> element. <strong>Result</strong>: Google Play will show the app to all users, unless other filters apply.</p>
-<p>For more details, see <a
-href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><code><uses-configuration></code></a>.</p></td>
- </tr>
-
- <tr>
- <td rowspan="2" valign="top" style="white-space:nowrap;"><code><a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature></a>
-</code>
- <!-- ##api level 4## --></td>
- <td valign="top">Device Features<br />
- (<code>name</code>)</td>
- <td valign="top"><p>An application can require certain device features to be
-present on the device. This functionality was introduced in Android 2.0 (API
-Level 5).</p>
- <p><strong>Example 1<br />
- </strong>The manifest includes <code><uses-feature
-android:name="android.hardware.sensor.light" /></code>, and a user
-is searching for apps on a device that does not have a light sensor.
-<strong>Result</strong>: Google Play will not show the app to the user. </p>
- <p><strong>Example 2<br />
- </strong>The manifest does not include a <code><uses-feature></code>
-element. <strong>Result</strong>: Google Play will show the app to all users,
-unless other filters apply.</p>
- <p>For complete information, see <code><a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature></a>
-</code>.</p>
- <p><em>Filtering based on implied features:</em> In some cases, Google
-Play interprets permissions requested through
-<code><uses-permission></code> elements as feature requirements equivalent
-to those declared in <code><uses-feature></code> elements. See <a
-href="#uses-permission-filtering"><code><uses-permission></code></a>,
-below.</p>
-</td>
- </tr>
-
- <tr>
- <td valign="top">OpenGL-ES
- Version<br />
-(<code>openGlEsVersion</code>)</td>
- <td valign="top"><p>An application can require that the device support a specific
- OpenGL-ES version using the <code><uses-feature
- android:openGlEsVersion="int"></code> attribute.</p>
- <p><strong>Example 1<br />
- </strong>An app
- requests multiple OpenGL-ES versions by specifying <code>openGlEsVersion</code> multiple times in the
- manifest. <strong>Result</strong>: Google Play assumes that the app requires the highest of the indicated versions.</p>
-<p><strong>Example 2<br />
-</strong>An app
- requests OpenGL-ES version 1.1, and a user is searching for apps on a device that supports OpenGL-ES version 2.0. <strong>Result</strong>: Google Play will show the app to the user, unless other filters apply. If a
- device reports that it supports OpenGL-ES version <em>X</em>, Google Play assumes that it
- also supports any version earlier than <em>X</em>.
-</p>
-<p><strong>Example 3<br />
-</strong>A user is searching for apps on a device that does not
- report an OpenGL-ES version (for example, a device running Android 1.5 or earlier). <strong>Result</strong>: Google Play assumes that the device
- supports only OpenGL-ES 1.0. Google Play will only show the user apps that do not specify <code>openGlEsVersion</code>, or apps that do not specify an OpenGL-ES version higher than 1.0. </p>
- <p><strong>Example 4<br />
- </strong>The manifest does not specify <code>openGlEsVersion</code>. <strong>Result</strong>: Google Play will show the app to all users, unless other filters apply. </p>
-<p>For more details, see <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></code></a>.</p></td>
- </tr>
-
- <tr>
- <td valign="top" style="white-space:nowrap;"><code><a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library></a></code></td>
- <td valign="top">Software Libraries</td>
- <td valign="top"><p>An application can require specific
- shared libraries to be present on the device. </p>
- <p><strong>Example 1<br />
- </strong>An app requires the <code>com.google.android.maps</code> library, and a user is searching for apps on a device that does not have the <code>com.google.android.maps</code> library. <strong>Result</strong>: Google Play will not show the app to the user. </p>
- <p><strong>Example 2</strong><br />
- The manifest does not include a <code><uses-library></code> element. <strong>Result</strong>: Google Play will show the app to all users, unless other filters apply.</p>
-<p>For more details, see <a
-href="{@docRoot}guide/topics/manifest/uses-library-element.html"><code><uses-library></code></a>.</p></td>
- </tr>
- <tr id="uses-permission-filtering">
- <td valign="top" style="white-space:nowrap;"><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code></td>
- <td valign="top"> </td>
- <td valign="top">Strictly, Google Play does not filter based on
-<code><uses-permission></code> elements. However, it does read the
-elements to determine whether the application has hardware feature requirements
-that may not have been properly declared in <code><uses-feature></code>
-elements. For example, if an application requests the <code>CAMERA</code>
-permission but does not declare a <code><uses-feature></code> element for
-<code>android.hardware.camera</code>, Google Play considers that the
-application requires a camera and should not be shown to users whose devices do
-not offer a camera.</p>
- <p>In general, if an application requests hardware-related permissions,
-Google Play assumes that the application requires the underlying hardware
-features, even though there might be no corresponding to
-<code><uses-feature></code> declarations. Google Play then sets up
-filtering based on the features implied by the <code><uses-feature></code>
-declarations.</p>
- <p>For a list of permissions that imply hardware features, see
-the documentation for the <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html#permissions-features"><code><uses-feature></code></a>
-element.</p>
-</td>
- </tr>
-
- <tr>
- <td rowspan="2" valign="top" style="white-space:nowrap;"><code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a></code></td>
- <td valign="top">Minimum Framework Version (<code>minSdkVersion</code>)</td>
- <td valign="top"><p>An application can require a minimum API level. </p>
- <p><strong>Example 1</strong><br />
- The manifest includes <code><uses-sdk
- android:minSdkVersion="3"></code>, and the app uses APIs that were introduced in API Level 3. A user is searching for apps on a device that has API Level 2. <strong>Result</strong>: Google Play will not show the app to the user. </p>
- <p><strong>Example 2</strong><br />
- The manifest does not include <code>minSdkVersion</code>, and the app uses APIs that were introduced in API Level 3. A user is searching for apps on a device that has API Level 2. <strong>Result</strong>: Google Play assumes that <code>minSdkVersion</code> is "1" and that the app is compatible with all versions of Android. Google Play shows the app to the user and allows the user to download the app. The app crashes at runtime. </p>
- <p>Because you want to avoid this second scenario, we recommend that you always declare a <code>minSdkVersion</code>. For details, see <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min"><code>android:minSdkVersion</code></a>.</p></td>
- </tr>
- <tr>
- <td valign="top">Maximum Framework Version (<code>maxSdkVersion</code>)</td>
- <td valign="top"><p><em>Deprecated.</em> Android
- 2.1 and later do not check or enforce the <code>maxSdkVersion</code> attribute, and
- the SDK will not compile if <code>maxSdkVersion</code> is set in an app's manifest. For devices already
- compiled with <code>maxSdkVersion</code>, Google Play will respect it and use it for
- filtering.</p>
-<p> Declaring <code>maxSdkVersion</code> is <em>not</em> recommended. For details, see <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#max"><code>android:maxSdkVersion</code></a>.</p></td>
- </tr>
-</table>
-
-
-
-<h3 id="advanced-filters">Advanced manifest filters</h3>
-
-<p>In addition to the manifest elements in <a href="#table1">table 1</a>, Google Play can also
-filter applications based on the advanced manifest elements in table 2.</p>
-
-<p>These manifest elements and the filtering they trigger are for exceptional use-cases
-only. These are designed for certain types of high-performance games and similar applications that
-require strict controls on application distribution. <strong>Most applications should never use
-these filters</strong>.</p>
-
-<p id="table2" class="table-caption"><strong>Table 2.</strong> Advanced manifest elements for
-Google Play filtering.</p>
-<table>
- <tr><th>Manifest Element</th><th>Summary</th></tr>
- <tr>
- <td><nobr><a href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
-<compatible-screens>}</a></nobr></td>
- <td>
- <p>Google Play filters the application if the device screen size and density does not match
-any of the screen configurations (declared by a {@code <screen>} element) in the {@code
-<compatible-screens>} element.</p>
- <p class="caution"><strong>Caution:</strong> Normally, <strong>you should not use
-this manifest element</strong>. Using this element can dramatically
-reduce the potential user base for your application, by excluding all combinations of screen size
-and density that you have not listed. You should instead use the <a
-href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
-<supports-screens>}</a> manifest element (described above in <a href="#table1">table
-1</a>) to enable screen compatibility mode for screen configurations you have not accounted for
-with alternative resources.</p>
- </td>
- </tr>
- <tr>
- <td><nobr><a href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html">{@code
-<supports-gl-texture>}</a></nobr></td>
- <td>
- <p>Google Play filters the application unless one or more of the GL texture compression
-formats supported by the application are also supported by the device. </p>
- </td>
- </tr>
-</table>
-
-
-
-<h2 id="other-filters">Other Filters</h2>
-
-<p>Google Play uses other application characteristics to determine whether to show or hide an application for a particular user on a given device, as described in the table below. </p>
-
-<p id="table3" class="table-caption"><strong>Table 3.</strong> Application and publishing
-characteristics that affect filtering on Google Play.</p>
-<table> <tr>
- <th>Filter Name</th> <th>How It Works</th> </tr>
-
- <tr>
- <td valign="top">Publishing Status</td> <td valign="top"><p>Only published applications will appear in
- searches and browsing within Google Play.</p> <p>Even if an app is unpublished, it can
- be installed if users can see it in their Downloads area among their purchased,
- installed, or recently uninstalled apps.</p> <p>If an application has been
- suspended, users will not be able to reinstall or update it, even if it appears in their Downloads.</p> </td></tr>
- <tr>
- <td valign="top">Priced
- Status</td> <td valign="top"><p>Not all users can see paid apps. To show paid apps, a device
-must have a SIM card and be running Android 1.1 or later, and it must be in a
-country (as determined by SIM carrier) in which paid apps are available.</p></td>
-</tr> <tr>
- <td valign="top">Country / Carrier Targeting</td> <td valign="top"> <p>When you upload your app to
- Google Play, you can select specific countries to target. The app will only
- be visible to the countries (carriers) that you select, as follows:</p>
- <ul><li><p>A device's country is determined based on the carrier, if a carrier is
- available. If no carrier can be determined, Google Play tries to
- determine the country based on IP.</p></li> <li><p>Carrier is determined based on
- the device's SIM (for GSM devices), not the current roaming carrier.</p></li></ul>
-</td> </tr> <tr>
- <td valign="top">Native Platform</td> <td valign="top"><p>An application that includes native
- libraries that target a specific platform (ARM EABI v7 or x86, for example) are
- visible only on devices that support that platform. For details about the NDK and using
- native libraries, see <a href="{@docRoot}sdk/ndk/index.html#overview">What is the
- Android NDK?</a></p> </tr> <tr>
- <td valign="top">Copy-Protected Applications</td> <td valign="top"><p>To
- copy protect an application, set copy protection to "On" when you configure publishing
-options for your application. Google Play will not show copy-protected applications on
-developer devices or unreleased devices.</p></td> </tr> </table>
-
-
-
-<h2 id="MultiApks">Publishing Multiple APKs with Different Filters</h2>
-
-<p>Some specific Google Play filters allow you to publish multiple APKs for the same
-application in order to provide a different APK to different device configurations. For example, if
-you're creating a video game that uses high-fidelity graphic assets, you might want to create
-two APKs that each support different texture compression formats. This way, you can reduce the
-size of the APK file by including only the textures that are required for each device
-configuration. Depending on each device's support for your texture compression formats, Google
-Play will deliver it the APK that you've declared to support that device.</p>
-
-<p>Currently, Google Play allows you to publish multiple APKs for the same application only
-when each APK provides different filters based on the following configurations:</p>
-<ul>
- <li>OpenGL texture compression formats
- <p>By using the <a
-href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html">{@code
-<supports-gl-texture>}</a> element.</p>
- </li>
- <li>Screen size (and, optionally, screen density)
- <p>By using the <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
-<supports-screens>}</a> or <a
-href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
-<compatible-screens>}</a> element.</p>
- </li>
- <li>API level
- <p>By using the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code
-<uses-sdk>}</a> element.</p>
- </li>
-</ul>
-
-<p>All other filters still work the same as usual, but these three are the only filters that can
-distinguish one APK from another within the same application listing on Google Play. For example,
-you <em>cannot</em> publish multiple APKs for the same application if the APKs differ only based on
-whether the device has a camera.</p>
-
-<p class="caution"><strong>Caution:</strong> Publishing multiple APKs for the same application is
-considered an advanced feature and <strong>most application should publish only one
-APK that supports a wide range of device configurations</strong>. Publishing multiple APKs
-requires that you follow specific rules within your filters and that you pay extra attention to the
-version codes for each APK to ensure proper update paths for each configuration.</p>
-
-<p>If you need more information about how to publish multiple APKs on Google Play, read <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html">Multiple APK Support</a>.</p>
diff --git a/docs/html/guide/appendix/media-formats.jd b/docs/html/guide/appendix/media-formats.jd
index 137f138..93e8136 100644
--- a/docs/html/guide/appendix/media-formats.jd
+++ b/docs/html/guide/appendix/media-formats.jd
@@ -268,9 +268,9 @@
<thead>
<tr>
<th> </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>
+ <th><acronym title="Standard definition">SD</a> (Low quality)</th>
+ <th><acronym title="Standard definition">SD</a> (High quality)</th>
+ <th><acronym title="High definition">HD</a> (Not available on all devices)</th>
</tr>
</thead>
<tbody>
diff --git a/docs/html/guide/basics/what-is-android.jd b/docs/html/guide/basics/what-is-android.jd
deleted file mode 100644
index 9393fab..0000000
--- a/docs/html/guide/basics/what-is-android.jd
+++ /dev/null
@@ -1,141 +0,0 @@
-page.title=What is Android?
-@jd:body
-
-<p>Android is a software stack for mobile devices that includes an operating
-system, middleware and key applications. The <a
-href="http://developer.android.com/sdk/index.html">Android SDK</a>
-provides the tools and APIs necessary to begin developing applications on the
-Android platform using the Java programming language.</p>
-
-<h2>Features</h2>
-
-<ul>
- <li><strong>Application framework</strong> enabling reuse and replacement
- of components</li>
- <li><strong>Dalvik virtual machine</strong> optimized for mobile
- devices</li>
- <li><strong>Integrated browser</strong> based on the open source <a
- href="http://webkit.org/">WebKit</a> engine </li>
- <li><strong>Optimized graphics</strong> powered by a custom 2D graphics library; 3D
- graphics based on the OpenGL ES 1.0 specification (hardware acceleration
- optional)</li>
- <li><strong>SQLite</strong> for structured data storage</li>
- <li><strong>Media support</strong> for common audio, video, and still
- image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG,
- GIF)</li>
- <li><strong>GSM Telephony</strong> (hardware dependent)</li>
- <li><strong>Bluetooth, EDGE, 3G, and WiFi</strong> (hardware dependent)</li>
- <li><strong>Camera, GPS, compass, and accelerometer</strong> (hardware dependent)</li>
- <li><strong>Rich development environment</strong> including a device
- emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE</li>
-</ul>
-
-<a name="os_architecture" id="os_architecture"></a>
-<h2>Android Architecture</h2>
-
-<p>The following diagram shows the major components of the Android operating
-system. Each section is described in more detail below.</p>
-
-<p><img src="{@docRoot}images/system-architecture.jpg" alt="Android System Architecture" width="713" height="512"></p>
-
-<a name="applications" id="applications"></a>
-<h2>Applications</h2>
-
-<p>Android will ship with a set of core applications including an email
-client, SMS program, calendar, maps, browser, contacts, and
-others. All applications are written using the Java programming language.</p>
-
-<a name="application_framework" id="application_framework"></a>
-<h2>Application Framework</h2>
-
-<p>By providing an open development platform, Android
-offers developers the ability to build extremely rich and innovative
-applications. Developers are free to take advantage of the
-device hardware, access location information, run background services, set alarms,
-add notifications to the status bar, and much, much more. </p>
-
-<p>Developers have full access to the same framework APIs used by the core
-applications. The application architecture is designed to simplify the reuse
-of components; any application can publish its capabilities and any other
-application may then make use of those capabilities (subject to security
-constraints enforced by the framework). This same mechanism allows components
-to be replaced by the user.</p>
-
-<p>Underlying all applications is a set of services and systems, including:
-<ul>
- <li>A rich and extensible set of <a
- href="{@docRoot}resources/tutorials/views/index.html">Views</a> that can be used to
- build an application, including lists, grids, text boxes, buttons, and even
- an embeddable web browser</li>
- <li><a href="{@docRoot}guide/topics/providers/content-providers.html">Content
- Providers</a> that enable applications to access data from other
- applications (such as Contacts), or to share their own data</li> <li>A <a
- href="{@docRoot}guide/topics/resources/resources-i18n.html">Resource
- Manager</a>, providing access to non-code resources such as localized
- strings, graphics, and layout files</li>
- <li>A {@link android.app.NotificationManager Notification Manager} that enables
- all applications to display custom alerts in the status bar</li>
- <li>An {@link android.app.Activity Activity Manager} that manages the
- lifecycle of applications and provides a common navigation backstack</li>
-</ul>
-
-<p>For more details and a walkthrough of an application, see the <a
-href="{@docRoot}resources/tutorials/notepad/index.html">Notepad Tutorial</a>.</p>
-
-<a name="libraries" id="libraries"></a>
-<h2>Libraries</h2>
-
-<p>Android includes a set of C/C++ libraries used by various components of the
-Android system. These capabilities are exposed to developers through the
-Android application framework. Some of the core libraries are listed below:</p>
-<ul>
- <li><strong>System C library</strong> - a BSD-derived implementation of
- the standard C system library (libc), tuned for embedded Linux-based
- devices</li>
- <li><strong>Media Libraries</strong> - based on PacketVideo's OpenCORE;
- the libraries support playback and recording of many popular audio and video
- formats, as well as static image files, including MPEG4, H.264, MP3, AAC,
- AMR, JPG, and PNG</li>
- <li><strong>Surface Manager</strong> - manages access to the display
- subsystem and seamlessly composites 2D and 3D graphic layers from multiple
- applications</li>
- <li><strong>LibWebCore</strong> - a modern web browser engine which
- powers both the Android browser and an embeddable web view</li>
- <li><strong>SGL</strong> - the underlying 2D graphics
- engine</li>
- <li><strong>3D libraries</strong> - an implementation based on
- OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration
- (where available) or the included, highly optimized 3D software
- rasterizer</li>
- <li><strong>FreeType</strong> - bitmap and vector font rendering</li>
- <li><strong>SQLite</strong> - a powerful and lightweight relational
- database engine available to all applications</li>
-</ul>
-
-<a name="runtime" id="runtime"></a>
-
-<h2>Android Runtime</h2>
-
-<p>Android includes a set of core libraries that provides most of
-the functionality available in the core libraries of the Java programming
-language.</p>
-
-<p>Every Android application runs in its own process, with its own instance of
-the Dalvik virtual machine. Dalvik has been written so that a device can run
-multiple VMs efficiently. The Dalvik VM executes files in the Dalvik
-Executable (.dex) format which is optimized for minimal memory
-footprint. The VM is register-based, and runs classes
-compiled by a Java language compiler that have been transformed into the .dex
-format by the included "dx" tool.</p>
-
-<p>The Dalvik VM relies on the Linux kernel for underlying functionality such
-as threading and low-level memory management.</p>
-
-<a name="kernel" id="kernel"></a>
-
-<h2>Linux Kernel</h2>
-
-<p>Android relies on Linux version 2.6 for core system services such as
-security, memory management, process management, network stack, and driver
-model. The kernel also acts as an abstraction layer between the hardware and
-the rest of the software stack.</p>
diff --git a/docs/html/guide/components/activities.jd b/docs/html/guide/components/activities.jd
new file mode 100644
index 0000000..36f651f
--- /dev/null
+++ b/docs/html/guide/components/activities.jd
@@ -0,0 +1,776 @@
+page.title=Activities
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>Quickview</h2>
+<ul>
+ <li>An activity provides a user interface for a single screen in your application</li>
+ <li>Activities can move into the background and then be resumed with their state restored</li>
+</ul>
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#Creating">Creating an Activity</a>
+ <ol>
+ <li><a href="#UI">Implementing a user interface</a></li>
+ <li><a href="#Declaring">Declaring the activity in the manifest</a></li>
+ </ol>
+ </li>
+ <li><a href="#StartingAnActivity">Starting an Activity</a>
+ <ol>
+ <li><a href="#StartingAnActivityForResult">Starting an activity for a result</a></li>
+ </ol>
+ </li>
+ <li><a href="#ShuttingDown">Shutting Down an Activity</a></li>
+ <li><a href="#Lifecycle">Managing the Activity Lifecycle</a>
+ <ol>
+ <li><a href="#ImplementingLifecycleCallbacks">Implementing the lifecycle callbacks</a></li>
+ <li><a href="#SavingActivityState">Saving activity state</a></li>
+ <li><a href="#ConfigurationChanges">Handling configuration changes</a></li>
+ <li><a href="#CoordinatingActivities">Coordinating activities</a></li>
+ </ol>
+ </li>
+</ol>
+
+<h2>Key classes</h2>
+<ol>
+ <li>{@link android.app.Activity}</li>
+</ol>
+
+<h2>See also</h2>
+<ol>
+ <li><a href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back
+Stack</a></li>
+</ol>
+
+</div>
+</div>
+
+
+
+<p>An {@link android.app.Activity} is an application component that provides a screen with which
+users can interact in order to do something, such as dial the phone, take a photo, send an email, or
+view a map. Each activity is given a window in which to draw its user interface. The window
+typically fills the screen, but may be smaller than the screen and float on top of other
+windows.</p>
+
+<p> An application usually consists of multiple activities that are loosely bound
+to each other. Typically, one activity in an application is specified as the "main" activity, which
+is presented to the user when launching the application for the first time. Each
+activity can then start another activity in order to perform different actions. Each time a new
+activity starts, the previous activity is stopped, but the system preserves the activity
+in a stack (the "back stack"). When a new activity starts, it is pushed onto the back stack and
+takes user focus. The back stack abides to the basic "last in, first out" stack mechanism,
+so, when the user is done with the current activity and presses the <em>Back</em> button, it
+is popped from the stack (and destroyed) and the previous activity resumes. (The back stack is
+discussed more in the <a href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks
+and Back Stack</a> document.)</p>
+
+<p>When an activity is stopped because a new activity starts, it is notified of this change in state
+through the activity's lifecycle callback methods.
+There are several callback methods that an activity might receive, due to a change in its
+state—whether the system is creating it, stopping it, resuming it, or destroying it—and
+each callback provides you the opportunity to perform specific work that's
+appropriate to that state change. For instance, when stopped, your activity should release any
+large objects, such as network or database connections. When the activity resumes, you can
+reacquire the necessary resources and resume actions that were interrupted. These state transitions
+are all part of the activity lifecycle.</p>
+
+<p>The rest of this document discusses the basics of how to build and use an activity,
+including a complete discussion of how the activity lifecycle works, so you can properly manage
+the transition between various activity states.</p>
+
+
+
+<h2 id="Creating">Creating an Activity</h2>
+
+<p>To create an activity, you must create a subclass of {@link android.app.Activity} (or
+an existing subclass of it). In your subclass, you need to implement callback methods that the
+system calls when the activity transitions between various states of its lifecycle, such as when
+the activity is being created, stopped, resumed, or destroyed. The two most important callback
+methods are:</p>
+
+<dl>
+ <dt>{@link android.app.Activity#onCreate onCreate()}</dt>
+ <dd>You must implement this method. The system calls this when creating your
+ activity. Within your implementation, you should initialize the essential components of your
+activity.
+ Most importantly, this is where you must call {@link android.app.Activity#setContentView
+ setContentView()} to define the layout for the activity's user interface.</dd>
+ <dt>{@link android.app.Activity#onPause onPause()}</dt>
+ <dd>The system calls this method as the first indication that the user is leaving your
+activity (though it does not always mean the activity is being destroyed). This is usually where you
+should commit any changes that should be persisted beyond the current user session (because
+the user might not come back).</dd>
+</dl>
+
+<p>There are several other lifecycle callback methods that you should use in order to provide a
+fluid user experience between activities and handle unexpected interuptions that cause your activity
+to be stopped and even destroyed. All of the lifecycle callback methods are discussed later, in
+the section about <a href="#Lifecycle">Managing the Activity Lifecycle</a>.</p>
+
+
+
+<h3 id="UI">Implementing a user interface</h3>
+
+<p> The user interface for an activity is provided by a hierarchy of views—objects derived
+from the {@link android.view.View} class. Each view controls a particular rectangular space
+within the activity's window and can respond to user interaction. For example, a view might be a
+button that initiates an action when the user touches it.</p>
+
+<p>Android provides a number of ready-made views that you can use to design and organize your
+layout. "Widgets" are views that provide a visual (and interactive) elements for the screen, such
+as a button, text field, checkbox, or just an image. "Layouts" are views derived from {@link
+android.view.ViewGroup} that provide a unique layout model for its child views, such as a linear
+layout, a grid layout, or relative layout. You can also subclass the {@link android.view.View} and
+{@link android.view.ViewGroup} classes (or existing subclasses) to create your own widgets and
+layouts and apply them to your activity layout.</p>
+
+<p>The most common way to define a layout using views is with an XML layout file saved in your
+application resources. This way, you can maintain the design of your user interface separately from
+the source code that defines the activity's behavior. You can set the layout as the UI for your
+activity with {@link android.app.Activity#setContentView(int) setContentView()}, passing the
+resource ID for the layout. However, you can also create new {@link android.view.View}s in your
+activity code and build a view hierarchy by inserting new {@link
+android.view.View}s into a {@link android.view.ViewGroup}, then use that layout by passing the root
+{@link android.view.ViewGroup} to {@link android.app.Activity#setContentView(View)
+setContentView()}.</p>
+
+<p>For information about creating a user interface, see the <a
+href="{@docRoot}guide/topics/ui/index.html">User Interface</a> documentation.</p>
+
+
+
+<h3 id="Declaring">Declaring the activity in the manifest</h3>
+
+<p>You must declare your activity in the manifest file in order for it to
+be accessible to the system. To declare your activity, open your manifest file and add an <a
+href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element
+as a child of the <a
+href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
+element. For example:</p>
+
+<pre>
+<manifest ... >
+ <application ... >
+ <activity android:name=".ExampleActivity" />
+ ...
+ </application ... >
+ ...
+</manifest >
+</pre>
+
+<p>There are several other attributes that you can include in this element, to define properties
+such as the label for the activity, an icon for the activity, or a theme to style the activity's
+UI. The <a href="{@docRoot}guide/topics/manifest/activity-element.html#nm">{@code android:name}</a>
+attribute is the only required attribute—it specifies the class name of the activity. Once
+you publish your application, you should not change this name, because if you do, you might break
+some functionality, such as application shortcuts (read the blog post, <a
+href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">Things
+That Cannot Change</a>).</p>
+
+<p>See the <a
+href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element
+reference for more information about declaring your activity in the manifest.</p>
+
+
+<h4>Using intent filters</h4>
+
+<p>An <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
+<activity>}</a> element can also specify various intent filters—using the <a
+href="{@docRoot}guide/topics/manifest/intent-filter-element.html">{@code
+<intent-filter>}</a> element—in order to declare how other application components may
+activate it.</p>
+
+<p>When you create a new application using the Android SDK tools, the stub activity
+that's created for you automatically includes an intent filter that declares the activity
+responds to the "main" action and should be placed in the "launcher" category. The intent filter
+looks like this:</p>
+
+<pre>
+<activity android:name=".ExampleActivity" android:icon="@drawable/app_icon">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+</activity>
+</pre>
+
+<p>The <a href="{@docRoot}guide/topics/manifest/action-element.html">{@code
+<action>}</a> element specifies that this is the "main" entry point to the application. The <a
+href="{@docRoot}guide/topics/manifest/category-element.html">{@code
+<category>}</a> element specifies that this activity should be listed in the
+system's application launcher (to allow users to launch this activity).</p>
+
+<p>If you intend for your application to be self-contained and not allow other applications to
+activate its activities, then you don't need any other intent filters. Only one activity should
+have the "main" action and "launcher" category, as in the previous example. Activities that
+you don't want to make available to other applications should have no intent filters and you can
+start them yourself using explicit intents (as discussed in the following section).</p>
+
+<p>However, if you want your activity to respond to implicit intents that are delivered from
+other applications (and your own), then you must define additional intent filters for your
+activity. For each type of intent to which you want to respond, you must include an <a
+href="{@docRoot}guide/topics/manifest/intent-filter-element.html">{@code
+<intent-filter>}</a> that includes an
+<a href="{@docRoot}guide/topics/manifest/action-element.html">{@code
+<action>}</a> element and, optionally, a <a
+href="{@docRoot}guide/topics/manifest/category-element.html">{@code
+<category>}</a> element and/or a <a
+href="{@docRoot}guide/topics/manifest/data-element.html">{@code
+<data>}</a> element. These elements specify the type of intent to which your activity can
+respond.</p>
+
+<p>For more information about how your activities can respond to intents, see the <a
+href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
+document.</p>
+
+
+
+<h2 id="StartingAnActivity">Starting an Activity</h2>
+
+<p>You can start another activity by calling {@link android.app.Activity#startActivity
+ startActivity()}, passing it an {@link android.content.Intent} that describes the activity you
+ want to start. The intent specifies either the exact activity you want to start or describes the
+ type of action you want to perform (and the system selects the appropriate activity for you,
+which
+ can even be from a different application). An intent can also carry small amounts of data to be
+ used by the activity that is started.</p>
+
+<p>When working within your own application, you'll often need to simply launch a known activity.
+ You can do so by creating an intent that explicitly defines the activity you want to start,
+using the class name. For example, here's how one activity starts another activity named {@code
+SignInActivity}:</p>
+
+<pre>
+Intent intent = new Intent(this, SignInActivity.class);
+startActivity(intent);
+</pre>
+
+<p>However, your application might also want to perform some action, such as send an email, text
+ message, or status update, using data from your activity. In this case, your application might
+ not have its own activities to perform such actions, so you can instead leverage the activities
+ provided by other applications on the device, which can perform the actions for you. This is where
+intents are really valuable—you can create an intent that describes an action you want to
+perform and the system
+ launches the appropriate activity from another application. If there are
+ multiple activities that can handle the intent, then the user can select which one to use. For
+ example, if you want to allow the user to send an email message, you can create the
+ following intent:</p>
+
+<pre>
+Intent intent = new Intent(Intent.ACTION_SEND);
+intent.putExtra(Intent.EXTRA_EMAIL, recipientArray);
+startActivity(intent);
+</pre>
+
+<p>The {@link android.content.Intent#EXTRA_EMAIL} extra added to the intent is a string array of
+ email addresses to which the email should be sent. When an email application responds to this
+ intent, it reads the string array provided in the extra and places them in the "to" field of the
+ email composition form. In this situation, the email application's activity starts and when the
+ user is done, your activity resumes.</p>
+
+
+
+
+<h3 id="StartingAnActivityForResult">Starting an activity for a result</h3>
+
+<p>Sometimes, you might want to receive a result from the activity that you start. In that case,
+ start the activity by calling {@link android.app.Activity#startActivityForResult
+ startActivityForResult()} (instead of {@link android.app.Activity#startActivity
+ startActivity()}). To then receive the result from the subsequent
+activity, implement the {@link android.app.Activity#onActivityResult onActivityResult()} callback
+ method. When the subsequent activity is done, it returns a result in an {@link
+android.content.Intent} to your {@link android.app.Activity#onActivityResult onActivityResult()}
+method.</p>
+
+<p>For example, perhaps you want the user to pick one of their contacts, so your activity can
+do something with the information in that contact. Here's how you can create such an intent and
+handle the result:</p>
+
+<pre>
+private void pickContact() {
+ // Create an intent to "pick" a contact, as defined by the content provider URI
+ Intent intent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI);
+ startActivityForResult(intent, PICK_CONTACT_REQUEST);
+}
+
+@Override
+protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ // If the request went well (OK) and the request was PICK_CONTACT_REQUEST
+ if (resultCode == Activity.RESULT_OK && requestCode == PICK_CONTACT_REQUEST) {
+ // Perform a query to the contact's content provider for the contact's name
+ Cursor cursor = getContentResolver().query(data.getData(),
+ new String[] {Contacts.DISPLAY_NAME}, null, null, null);
+ if (cursor.moveToFirst()) { // True if the cursor is not empty
+ int columnIndex = cursor.getColumnIndex(Contacts.DISPLAY_NAME);
+ String name = cursor.getString(columnIndex);
+ // Do something with the selected contact's name...
+ }
+ }
+}
+</pre>
+
+<p>This example shows the basic logic you should use in your {@link
+android.app.Activity#onActivityResult onActivityResult()} method in order to handle an
+activity result. The first condition checks whether the request was successful—if it was, then
+the {@code resultCode} will be {@link android.app.Activity#RESULT_OK}—and whether the request
+to which this result is responding is known—in this case, the {@code requestCode} matches the
+second parameter sent with {@link android.app.Activity#startActivityForResult
+startActivityForResult()}. From there, the code handles the activity result by querying the
+data returned in an {@link android.content.Intent} (the {@code data} parameter).</p>
+
+<p>What happens is, a {@link
+android.content.ContentResolver} performs a query against a content provider, which returns a
+{@link android.database.Cursor} that allows the queried data to be read. For more information, see
+the <a
+href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a> document.</p>
+
+<p>For more information about using intents, see the <a
+href="{@docRoot}guide/components/intents-filters.html">Intents and Intent
+Filters</a> document.</p>
+
+
+<h2 id="ShuttingDown">Shutting Down an Activity</h2>
+
+<p>You can shut down an activity by calling its {@link android.app.Activity#finish
+finish()} method. You can also shut down a separate activity that you previously started by calling
+{@link android.app.Activity#finishActivity finishActivity()}.</p>
+
+<p class="note"><strong>Note:</strong> In most cases, you should not explicitly finish an activity
+using these methods. As discussed in the following section about the activity lifecycle, the
+Android system manages the life of an activity for you, so you do not need to finish your own
+activities. Calling these methods could adversely affect the expected user
+experience and should only be used when you absolutely do not want the user to return to this
+instance of the activity.</p>
+
+
+<h2 id="Lifecycle">Managing the Activity Lifecycle</h2>
+
+<p>Managing the lifecycle of your activities by implementing callback methods is
+crucial to developing a strong
+and flexible application. The lifecycle of an activity is directly affected by its association with
+other activities, its task and back stack.</p>
+
+<p>An activity can exist in essentially three states:</p>
+
+<dl>
+ <dt><i>Resumed</i></dt>
+ <dd>The activity is in the foreground of the screen and has user focus. (This state is
+also sometimes referred to as "running".)</dd>
+
+ <dt><i>Paused</i></dt>
+ <dd>Another activity is in the foreground and has focus, but this one is still visible. That is,
+another activity is visible on top of this one and that activity is partially transparent or doesn't
+cover the entire screen. A paused activity is completely alive (the {@link android.app.Activity}
+object is retained in memory, it maintains all state and member information, and remains attached to
+the window manager), but can be killed by the system in extremely low memory situations.</dd>
+
+ <dt><i>Stopped</i></dt>
+ <dd>The activity is completely obscured by another activity (the activity is now in the
+"background"). A stopped activity is also still alive (the {@link android.app.Activity}
+object is retained in memory, it maintains all state and member information, but is <em>not</em>
+attached to the window manager). However, it is no longer visible to the user and it
+can be killed by the system when memory is needed elsewhere.</dd>
+</dl>
+
+<p>If an activity is paused or stopped, the system can drop it from memory either by asking it to
+finish (calling its {@link android.app.Activity#finish finish()} method), or simply killing its
+process. When the activity is opened again (after being finished or killed), it must be created all
+over.</p>
+
+
+
+<h3 id="ImplementingLifecycleCallbacks">Implementing the lifecycle callbacks</h3>
+
+<p>When an activity transitions into and out of the different states described above, it is notified
+through various callback methods. All of the callback methods are hooks that you
+can override to do appropriate work when the state of your activity changes. The following skeleton
+activity includes each of the fundamental lifecycle methods:</p>
+
+
+<pre>
+public class ExampleActivity extends Activity {
+ @Override
+ public void {@link android.app.Activity#onCreate onCreate}(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ // The activity is being created.
+ }
+ @Override
+ protected void {@link android.app.Activity#onStart onStart()} {
+ super.onStart();
+ // The activity is about to become visible.
+ }
+ @Override
+ protected void {@link android.app.Activity#onResume onResume()} {
+ super.onResume();
+ // The activity has become visible (it is now "resumed").
+ }
+ @Override
+ protected void {@link android.app.Activity#onPause onPause()} {
+ super.onPause();
+ // Another activity is taking focus (this activity is about to be "paused").
+ }
+ @Override
+ protected void {@link android.app.Activity#onStop onStop()} {
+ super.onStop();
+ // The activity is no longer visible (it is now "stopped")
+ }
+ @Override
+ protected void {@link android.app.Activity#onDestroy onDestroy()} {
+ super.onDestroy();
+ // The activity is about to be destroyed.
+ }
+}
+</pre>
+
+<p class="note"><strong>Note:</strong> Your implementation of these lifecycle methods must
+always call the superclass implementation before doing any work, as shown in the examples above.</p>
+
+<p>Taken together, these methods define the entire lifecycle of an activity. By implementing these
+methods, you can monitor three nested loops in the activity lifecycle: </p>
+
+<ul>
+<li>The <b>entire lifetime</b> of an activity happens between the call to {@link
+android.app.Activity#onCreate onCreate()} and the call to {@link
+android.app.Activity#onDestroy}. Your activity should perform setup of
+"global" state (such as defining layout) in {@link android.app.Activity#onCreate onCreate()}, and
+release all remaining resources in {@link android.app.Activity#onDestroy}. For example, if your
+activity has a thread running in the background to download data from the network, it might create
+that thread in {@link android.app.Activity#onCreate onCreate()} and then stop the thread in {@link
+android.app.Activity#onDestroy}.</li>
+
+<li><p>The <b>visible lifetime</b> of an activity happens between the call to {@link
+android.app.Activity#onStart onStart()} and the call to {@link
+android.app.Activity#onStop onStop()}. During this time, the user can see the activity
+on-screen and interact with it. For example, {@link android.app.Activity#onStop onStop()} is called
+when a new activity starts and this one is no longer visible. Between these two methods, you can
+maintain resources that are needed to show the activity to the user. For example, you can register a
+{@link android.content.BroadcastReceiver} in {@link
+android.app.Activity#onStart onStart()} to monitor changes that impact your UI, and unregister
+it in {@link android.app.Activity#onStop onStop()} when the user can no longer see what you are
+displaying. The system might call {@link android.app.Activity#onStart onStart()} and {@link
+android.app.Activity#onStop onStop()} multiple times during the entire lifetime of the activity, as
+the activity alternates between being visible and hidden to the user.</p></li>
+
+<li><p>The <b>foreground lifetime</b> of an activity happens between the call to {@link
+android.app.Activity#onResume onResume()} and the call to {@link android.app.Activity#onPause
+onPause()}. During this time, the activity is in front of all other activities on screen and has
+user input focus. An activity can frequently transition in and out of the foreground—for
+example, {@link android.app.Activity#onPause onPause()} is called when the device goes to sleep or
+when a dialog appears. Because this state can transition often, the code in these two methods should
+be fairly lightweight in order to avoid slow transitions that make the user wait.</p></li>
+</ul>
+
+<p>Figure 1 illustrates these loops and the paths an activity might take between states.
+The rectangles represent the callback methods you can implement to perform operations when
+the activity transitions between states. <p>
+
+<img src="{@docRoot}images/activity_lifecycle.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> The activity lifecycle.</p>
+
+<p>The same lifecycle callback methods are listed in table 1, which describes each of the callback
+methods in more detail and locates each one within the
+activity's overall lifecycle, including whether the system can kill the activity after the
+callback method completes.</p>
+
+<p class="table-caption"><strong>Table 1.</strong> A summary of the activity lifecycle's
+callback methods.</p>
+
+<table border="2" width="85%" frame="hsides" rules="rows">
+<colgroup align="left" span="3"></colgroup>
+<colgroup align="left"></colgroup>
+<colgroup align="center"></colgroup>
+<colgroup align="center"></colgroup>
+
+<thead>
+<tr><th colspan="3">Method</th> <th>Description</th> <th>Killable after?</th> <th>Next</th></tr>
+</thead>
+
+<tbody>
+<tr>
+ <td colspan="3" align="left"><code>{@link android.app.Activity#onCreate onCreate()}</code></td>
+ <td>Called when the activity is first created.
+ This is where you should do all of your normal static set up —
+ create views, bind data to lists, and so on. This method is passed
+ a Bundle object containing the activity's previous state, if that
+ state was captured (see <a href="#actstate">Saving Activity State</a>,
+ later).
+ <p>Always followed by {@code onStart()}.</p></td>
+ <td align="center">No</td>
+ <td align="center">{@code onStart()}</td>
+</tr>
+
+<tr>
+ <td rowspan="5" style="border-left: none; border-right: none;"> </td>
+ <td colspan="2" align="left"><code>{@link android.app.Activity#onRestart
+onRestart()}</code></td>
+ <td>Called after the activity has been stopped, just prior to it being
+ started again.
+ <p>Always followed by {@code onStart()}</p></td>
+ <td align="center">No</td>
+ <td align="center">{@code onStart()}</td>
+</tr>
+
+<tr>
+ <td colspan="2" align="left"><code>{@link android.app.Activity#onStart onStart()}</code></td>
+ <td>Called just before the activity becomes visible to the user.
+ <p>Followed by {@code onResume()} if the activity comes
+ to the foreground, or {@code onStop()} if it becomes hidden.</p></td>
+ <td align="center">No</td>
+ <td align="center">{@code onResume()} <br/>or<br/> {@code onStop()}</td>
+</tr>
+
+<tr>
+ <td rowspan="2" style="border-left: none;"> </td>
+ <td align="left"><code>{@link android.app.Activity#onResume onResume()}</code></td>
+ <td>Called just before the activity starts
+ interacting with the user. At this point the activity is at
+ the top of the activity stack, with user input going to it.
+ <p>Always followed by {@code onPause()}.</p></td>
+ <td align="center">No</td>
+ <td align="center">{@code onPause()}</td>
+</tr>
+
+<tr>
+ <td align="left"><code>{@link android.app.Activity#onPause onPause()}</code></td>
+ <td>Called when the system is about to start resuming another
+ activity. This method is typically used to commit unsaved changes to
+ persistent data, stop animations and other things that may be consuming
+ CPU, and so on. It should do whatever it does very quickly, because
+ the next activity will not be resumed until it returns.
+ <p>Followed either by {@code onResume()} if the activity
+ returns back to the front, or by {@code onStop()} if it becomes
+ invisible to the user.</td>
+ <td align="center"><strong style="color:#800000">Yes</strong></td>
+ <td align="center">{@code onResume()} <br/>or<br/> {@code onStop()}</td>
+</tr>
+
+<tr>
+ <td colspan="2" align="left"><code>{@link android.app.Activity#onStop onStop()}</code></td>
+ <td>Called when the activity is no longer visible to the user. This
+ may happen because it is being destroyed, or because another activity
+ (either an existing one or a new one) has been resumed and is covering it.
+ <p>Followed either by {@code onRestart()} if
+ the activity is coming back to interact with the user, or by
+ {@code onDestroy()} if this activity is going away.</p></td>
+ <td align="center"><strong style="color:#800000">Yes</strong></td>
+ <td align="center">{@code onRestart()} <br/>or<br/> {@code onDestroy()}</td>
+</tr>
+
+<tr>
+ <td colspan="3" align="left"><code>{@link android.app.Activity#onDestroy
+onDestroy()}</code></td>
+ <td>Called before the activity is destroyed. This is the final call
+ that the activity will receive. It could be called either because the
+ activity is finishing (someone called <code>{@link android.app.Activity#finish
+ finish()}</code> on it), or because the system is temporarily destroying this
+ instance of the activity to save space. You can distinguish
+ between these two scenarios with the <code>{@link
+ android.app.Activity#isFinishing isFinishing()}</code> method.</td>
+ <td align="center"><strong style="color:#800000">Yes</strong></td>
+ <td align="center"><em>nothing</em></td>
+</tr>
+</tbody>
+</table>
+
+<p>The column labeled "Killable after?" indicates whether or not the system can
+kill the process hosting the activity at any time <em>after the method returns</em>, without
+executing another line of the activity's code. Three methods are marked "yes": ({@link
+android.app.Activity#onPause
+onPause()}, {@link android.app.Activity#onStop onStop()}, and {@link android.app.Activity#onDestroy
+onDestroy()}). Because {@link android.app.Activity#onPause onPause()} is the first
+of the three, once the activity is created, {@link android.app.Activity#onPause onPause()} is the
+last method that's guaranteed to be called before the process <em>can</em> be killed—if
+the system must recover memory in an emergency, then {@link
+android.app.Activity#onStop onStop()} and {@link android.app.Activity#onDestroy onDestroy()} might
+not be called. Therefore, you should use {@link android.app.Activity#onPause onPause()} to write
+crucial persistent data (such as user edits) to storage. However, you should be selective about
+what information must be retained during {@link android.app.Activity#onPause onPause()}, because any
+blocking procedures in this method block the transition to the next activity and slow the user
+experience.</p>
+
+<p> Methods that are marked "No" in the <b>Killable</b> column protect the process hosting the
+activity from being killed from the moment they are called. Thus, an activity is killable
+from the time {@link android.app.Activity#onPause onPause()} returns to the time
+{@link android.app.Activity#onResume onResume()} is called. It will not again be killable until
+{@link android.app.Activity#onPause onPause()} is again called and returns. </p>
+
+<p class="note"><strong>Note:</strong> An activity that's not technically "killable" by this
+definition in table 1 might still be killed by the system—but that would happen only in
+extreme circumstances when there is no other recourse. When an activity might be killed is
+discussed more in the <a
+href="{@docRoot}guide/components/processes-and-threads.html">Processes and
+Threading</a> document.</p>
+
+
+<h3 id="SavingActivityState">Saving activity state</h3>
+
+<p>The introduction to <a href="#Lifecycle">Managing the Activity Lifecycle</a> briefly mentions
+that
+when an activity is paused or stopped, the state of the activity is retained. This is true because
+the {@link android.app.Activity} object is still held in memory when it is paused or
+stopped—all information about its members and current state is still alive. Thus, any changes
+the user made within the activity are retained so that when the activity returns to the
+foreground (when it "resumes"), those changes are still there.</p>
+
+<p>However, when the system destroys an activity in order to recover memory, the {@link
+android.app.Activity} object is destroyed, so the system cannot simply resume it with its state
+intact. Instead, the system must recreate the {@link android.app.Activity} object if the user
+navigates back to it. Yet, the user is unaware
+that the system destroyed the activity and recreated it and, thus, probably
+expects the activity to be exactly as it was. In this situation, you can ensure that
+important information about the activity state is preserved by implementing an additional
+callback method that allows you to save information about the state of your activity: {@link
+android.app.Activity#onSaveInstanceState onSaveInstanceState()}.</p>
+
+<p>The system calls {@link android.app.Activity#onSaveInstanceState onSaveInstanceState()}
+before making the activity vulnerable to destruction. The system passes this method
+a {@link android.os.Bundle} in which you can save
+state information about the activity as name-value pairs, using methods such as {@link
+android.os.Bundle#putString putString()} and {@link
+android.os.Bundle#putInt putInt()}. Then, if the system kills your application
+process and the user navigates back to your activity, the system recreates the activity and passes
+the {@link android.os.Bundle} to both {@link android.app.Activity#onCreate onCreate()} and {@link
+android.app.Activity#onRestoreInstanceState onRestoreInstanceState()}. Using either of these
+methods, you can extract your saved state from the {@link android.os.Bundle} and restore the
+activity state. If there is no state information to restore, then the {@link
+android.os.Bundle} passed to you is null (which is the case when the activity is created for
+the first time).</p>
+
+<img src="{@docRoot}images/fundamentals/restore_instance.png" alt="" />
+<p class="img-caption"><strong>Figure 2.</strong> The two ways in which an activity returns to user
+focus with its state intact: either the activity is destroyed, then recreated and the activity must restore
+the previously saved state, or the activity is stopped, then resumed and the activity state
+remains intact.</p>
+
+<p class="note"><strong>Note:</strong> There's no guarantee that {@link
+android.app.Activity#onSaveInstanceState onSaveInstanceState()} will be called before your
+activity is destroyed, because there are cases in which it won't be necessary to save the state
+(such as when the user leaves your activity using the <em>Back</em> button, because the user is
+explicitly
+closing the activity). If the system calls {@link android.app.Activity#onSaveInstanceState
+onSaveInstanceState()}, it does so before {@link
+android.app.Activity#onStop onStop()} and possibly before {@link android.app.Activity#onPause
+onPause()}.</p>
+
+<p>However, even if you do nothing and do not implement {@link
+android.app.Activity#onSaveInstanceState onSaveInstanceState()}, some of the activity state is
+restored by the {@link android.app.Activity} class's default implementation of {@link
+android.app.Activity#onSaveInstanceState onSaveInstanceState()}. Specifically, the default
+implementation calls the corresponding {@link
+android.view.View#onSaveInstanceState onSaveInstanceState()} method for every {@link
+android.view.View} in the layout, which allows each view to provide information about itself
+that should be saved. Almost every widget in the Android framework implements this method as
+appropriate, such that any visible changes to the UI are automatically saved and restored when your
+activity is recreated. For example, the {@link android.widget.EditText} widget saves any text
+entered by the user and the {@link android.widget.CheckBox} widget saves whether it's checked or
+not. The only work required by you is to provide a unique ID (with the <a
+href="{@docRoot}guide/topics/resources/layout-resource.html#idvalue">{@code android:id}</a>
+attribute) for each widget you want to save its state. If a widget does not have an ID, then the
+system cannot save its state.</p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<p>You can also explicitly stop a view in your layout from saving its state by setting the
+{@link android.R.attr#saveEnabled android:saveEnabled} attribute to {@code "false"} or by calling
+the {@link android.view.View#setSaveEnabled setSaveEnabled()} method. Usually, you should not
+disable this, but you might if you want to restore the state of the activity UI differently.</p>
+</div>
+</div>
+
+<p>Although the default implementation of {@link
+android.app.Activity#onSaveInstanceState onSaveInstanceState()} saves useful information about
+your activity's UI, you still might need to override it to save additional information.
+For example, you might need to save member values that changed during the activity's life (which
+might correlate to values restored in the UI, but the members that hold those UI values are not
+restored, by default).</p>
+
+<p>Because the default implementation of {@link
+android.app.Activity#onSaveInstanceState onSaveInstanceState()} helps save the state of the UI, if
+you override the method in order to save additional state information, you should always call the
+superclass implementation of {@link android.app.Activity#onSaveInstanceState onSaveInstanceState()}
+before doing any work. Likewise, you should also call the supercall implementation of {@link
+android.app.Activity#onRestoreInstanceState onRestoreInstanceState()} if you override it, so the
+default implementation can restore view states.</p>
+
+<p class="note"><strong>Note:</strong> Because {@link android.app.Activity#onSaveInstanceState
+onSaveInstanceState()} is not guaranteed
+to be called, you should use it only to record the transient state of the activity (the state of
+the UI)—you should never use it to store persistent data. Instead, you should use {@link
+android.app.Activity#onPause onPause()} to store persistent data (such as data that should be saved
+to a database) when the user leaves the activity.</p>
+
+<p>A good way to test your application's ability to restore its state is to simply rotate the
+device so that the screen orientation changes. When the screen orientation changes, the system
+destroys and recreates the activity in order to apply alternative resources that might be available
+for the new screen configuration. For this reason alone, it's very important that your activity
+completely restores its state when it is recreated, because users regularly rotate the screen while
+using applications.</p>
+
+
+<h3 id="ConfigurationChanges">Handling configuration changes</h3>
+
+<p>Some device configurations can change during runtime (such as screen orientation, keyboard
+availability, and language). When such a change occurs, Android recreates the running activity
+(the system calls {@link android.app.Activity#onDestroy}, then immediately calls {@link
+android.app.Activity#onCreate onCreate()}). This behavior is
+designed to help your application adapt to new configurations by automatically reloading your
+application with alternative resources that you've provided (such as different layouts for
+different screen orientations and sizes).</p>
+
+<p>If you properly design your activity to handle a restart due to a screen orientation change and
+restore the activity state as described above, your application will be more resilient to other
+unexpected events in the activity lifecycle.</p>
+
+<p>The best way to handle such a restart is
+ to save and restore the state of your activity using {@link
+ android.app.Activity#onSaveInstanceState onSaveInstanceState()} and {@link
+android.app.Activity#onRestoreInstanceState onRestoreInstanceState()} (or {@link
+android.app.Activity#onCreate onCreate()}), as discussed in the previous section.</p>
+
+<p>For more information about configuration changes that happen at runtime and how you can handle
+them, read the guide to <a href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling
+Runtime Changes</a>.</p>
+
+
+
+<h3 id="CoordinatingActivities">Coordinating activities</h3>
+
+ <p>When one activity starts another, they both experience lifecycle transitions. The first activity
+pauses and stops (though, it won't stop if it's still visible in the background), while the other
+activity is created. In case these activities share data saved to disc or elsewhere, it's important
+to understand that the first activity is not completely stopped before the second one is created.
+Rather, the process of starting the second one overlaps with the process of stopping the first
+one.</p>
+
+<p>The order of lifecycle callbacks is well defined, particularly when the two activities are in the
+same process and one is starting the other. Here's the order of operations that occur when Activity
+A starts Acivity B: </p>
+
+<ol>
+<li>Activity A's {@link android.app.Activity#onPause onPause()} method executes.</li>
+
+<li>Activity B's {@link android.app.Activity#onCreate onCreate()}, {@link
+android.app.Activity#onStart onStart()}, and {@link android.app.Activity#onResume onResume()}
+methods execute in sequence. (Activity B now has user focus.)</li>
+
+<li>Then, if Activity A is no longer visible on screen, its {@link
+android.app.Activity#onStop onStop()} method executes.</li>
+</ol>
+
+ <p>This predictable sequence of lifecycle callbacks allows you to manage the transition of
+information from one activity to another. For example, if you must write to a database when the
+first activity stops so that the following activity can read it, then you should write to the
+database during {@link android.app.Activity#onPause onPause()} instead of during {@link
+android.app.Activity#onStop onStop()}.</p>
+
+<!--
+<h2>Beginner's Path</h2>
+
+<p>For more information about how Android maintains a history of activities and
+enables user multitasking, continue with the <b><a
+href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back
+Stack</a></b> document.</p>
+-->
\ No newline at end of file
diff --git a/docs/html/guide/components/bound-services.jd b/docs/html/guide/components/bound-services.jd
new file mode 100644
index 0000000..b6a2512
--- /dev/null
+++ b/docs/html/guide/components/bound-services.jd
@@ -0,0 +1,675 @@
+page.title=Bound Services
+parent.title=Services
+parent.link=services.html
+@jd:body
+
+
+<div id="qv-wrapper">
+<ol id="qv">
+<h2>Quickview</h2>
+<ul>
+ <li>A bound service allows other components to bind to it, in order to interact with it and
+perform interprocess communication</li>
+ <li>A bound service is destroyed once all clients unbind, unless the service was also started</li>
+</ul>
+<h2>In this document</h2>
+<ol>
+ <li><a href="#Basics">The Basics</a></li>
+ <li><a href="#Creating">Creating a Bound Service</a>
+ <ol>
+ <li><a href="#Binder">Extending the Binder class</a></li>
+ <li><a href="#Messenger">Using a Messenger</a></li>
+ </ol>
+ </li>
+ <li><a href="#Binding">Binding to a Service</a></li>
+ <li><a href="#Lifecycle">Managing the Lifecycle of a Bound Service</a></li>
+</ol>
+
+<h2>Key classes</h2>
+<ol>
+ <li>{@link android.app.Service}</li>
+ <li>{@link android.content.ServiceConnection}</li>
+ <li>{@link android.os.IBinder}</li>
+</ol>
+
+<h2>Samples</h2>
+<ol>
+ <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.html">{@code
+ RemoteService}</a></li>
+ <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html">{@code
+ LocalService}</a></li>
+</ol>
+
+<h2>See also</h2>
+<ol>
+ <li><a href="{@docRoot}guide/components/services.html">Services</a></li>
+</ol>
+</div>
+
+
+<p>A bound service is the server in a client-server interface. A bound service allows components
+(such as activities) to bind to the service, send requests, receive responses, and even perform
+interprocess communication (IPC). A bound service typically lives only while it serves another
+application component and does not run in the background indefinitely.</p>
+
+<p>This document shows you how to create a bound service, including how to bind
+to the service from other application components. However, you should also refer to the <a
+href="{@docRoot}guide/components/services.html">Services</a> document for additional
+information about services in general, such as how to deliver notifications from a service, set
+the service to run in the foreground, and more.</p>
+
+
+<h2 id="Basics">The Basics</h2>
+
+<p>A bound service is an implementation of the {@link android.app.Service} class that allows
+other applications to bind to it and interact with it. To provide binding for a
+service, you must implement the {@link android.app.Service#onBind onBind()} callback method. This
+method returns an {@link android.os.IBinder} object that defines the programming interface that
+clients can use to interact with the service.</p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <h3>Binding to a Started Service</h3>
+
+<p>As discussed in the <a href="{@docRoot}guide/components/services.html">Services</a>
+document, you can create a service that is both started and bound. That is, the service can be
+started by calling {@link android.content.Context#startService startService()}, which allows the
+service to run indefinitely, and also allow a client to bind to the service by calling {@link
+android.content.Context#bindService bindService()}.
+ <p>If you do allow your service to be started and bound, then when the service has been
+started, the system does <em>not</em> destroy the service when all clients unbind. Instead, you must
+explicitly stop the service, by calling {@link android.app.Service#stopSelf stopSelf()} or {@link
+android.content.Context#stopService stopService()}.</p>
+
+<p>Although you should usually implement either {@link android.app.Service#onBind onBind()}
+<em>or</em> {@link android.app.Service#onStartCommand onStartCommand()}, it's sometimes necessary to
+implement both. For example, a music player might find it useful to allow its service to run
+indefinitely and also provide binding. This way, an activity can start the service to play some
+music and the music continues to play even if the user leaves the application. Then, when the user
+returns to the application, the activity can bind to the service to regain control of playback.</p>
+
+<p>Be sure to read the section about <a href="#Lifecycle">Managing the Lifecycle of a Bound
+Service</a>, for more information about the service lifecycle when adding binding to a
+started service.</p>
+</div>
+</div>
+
+<p>A client can bind to the service by calling {@link android.content.Context#bindService
+bindService()}. When it does, it must provide an implementation of {@link
+android.content.ServiceConnection}, which monitors the connection with the service. The {@link
+android.content.Context#bindService bindService()} method returns immediately without a value, but
+when the Android system creates the connection between the
+client and service, it calls {@link
+android.content.ServiceConnection#onServiceConnected onServiceConnected()} on the {@link
+android.content.ServiceConnection}, to deliver the {@link android.os.IBinder} that
+the client can use to communicate with the service.</p>
+
+<p>Multiple clients can connect to the service at once. However, the system calls your service's
+{@link android.app.Service#onBind onBind()} method to retrieve the {@link android.os.IBinder} only
+when the first client binds. The system then delivers the same {@link android.os.IBinder} to any
+additional clients that bind, without calling {@link android.app.Service#onBind onBind()} again.</p>
+
+<p>When the last client unbinds from the service, the system destroys the service (unless the
+service was also started by {@link android.content.Context#startService startService()}).</p>
+
+<p>When you implement your bound service, the most important part is defining the interface
+that your {@link android.app.Service#onBind onBind()} callback method returns. There are a few
+different ways you can define your service's {@link android.os.IBinder} interface and the following
+section discusses each technique.</p>
+
+
+
+<h2 id="Creating">Creating a Bound Service</h2>
+
+<p>When creating a service that provides binding, you must provide an {@link android.os.IBinder}
+that provides the programming interface that clients can use to interact with the service. There
+are three ways you can define the interface:</p>
+
+<dl>
+ <dt><a href="#Binder">Extending the Binder class</a></dt>
+ <dd>If your service is private to your own application and runs in the same process as the client
+(which is common), you should create your interface by extending the {@link android.os.Binder} class
+and returning an instance of it from
+{@link android.app.Service#onBind onBind()}. The client receives the {@link android.os.Binder} and
+can use it to directly access public methods available in either the {@link android.os.Binder}
+implementation or even the {@link android.app.Service}.
+ <p>This is the preferred technique when your service is merely a background worker for your own
+application. The only reason you would not create your interface this way is because
+your service is used by other applications or across separate processes.</dd>
+
+ <dt><a href="#Messenger">Using a Messenger</a></dt>
+ <dd>If you need your interface to work across different processes, you can create
+an interface for the service with a {@link android.os.Messenger}. In this manner, the service
+defines a {@link android.os.Handler} that responds to different types of {@link
+android.os.Message} objects. This {@link android.os.Handler}
+is the basis for a {@link android.os.Messenger} that can then share an {@link android.os.IBinder}
+with the client, allowing the client to send commands to the service using {@link
+android.os.Message} objects. Additionally, the client can define a {@link android.os.Messenger} of
+its own so the service can send messages back.
+ <p>This is the simplest way to perform interprocess communication (IPC), because the {@link
+android.os.Messenger} queues all requests into a single thread so that you don't have to design
+your service to be thread-safe.</p>
+ </dd>
+
+ <dt>Using AIDL</dt>
+ <dd>AIDL (Android Interface Definition Language) performs all the work to decompose objects into
+primitives that the operating system can understand and marshall them across processes to perform
+IPC. The previous technique, using a {@link android.os.Messenger}, is actually based on AIDL as
+its underlying structure. As mentioned above, the {@link android.os.Messenger} creates a queue of
+all the client requests in a single thread, so the service receives requests one at a time. If,
+however, you want your service to handle multiple requests simultaneously, then you can use AIDL
+directly. In this case, your service must be capable of multi-threading and be built thread-safe.
+ <p>To use AIDL directly, you must
+create an {@code .aidl} file that defines the programming interface. The Android SDK tools use
+this file to generate an abstract class that implements the interface and handles IPC, which you
+can then extend within your service.</p>
+ </dd>
+</dl>
+
+ <p class="note"><strong>Note:</strong> Most applications <strong>should not</strong> use AIDL to
+create a bound service, because it may require multithreading capabilities and
+can result in a more complicated implementation. As such, AIDL is not suitable for most applications
+and this document does not discuss how to use it for your service. If you're certain that you need
+to use AIDL directly, see the <a href="{@docRoot}tools/aidl.html">AIDL</a>
+document.</p>
+
+
+
+
+<h3 id="Binder">Extending the Binder class</h3>
+
+<p>If your service is used only by the local application and does not need to work across processes,
+then you can implement your own {@link android.os.Binder} class that provides your client direct
+access to public methods in the service.</p>
+
+<p class="note"><strong>Note:</strong> This works only if the client and service are in the same
+application and process, which is most common. For example, this would work well for a music
+application that needs to bind an activity to its own service that's playing music in the
+background.</p>
+
+<p>Here's how to set it up:</p>
+<ol>
+ <li>In your service, create an instance of {@link android.os.Binder} that either:
+ <ul>
+ <li>contains public methods that the client can call</li>
+ <li>returns the current {@link android.app.Service} instance, which has public methods the
+client can call</li>
+ <li>or, returns an instance of another class hosted by the service with public methods the
+client can call</li>
+ </ul>
+ <li>Return this instance of {@link android.os.Binder} from the {@link
+android.app.Service#onBind onBind()} callback method.</li>
+ <li>In the client, receive the {@link android.os.Binder} from the {@link
+android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback method and
+make calls to the bound service using the methods provided.</li>
+</ol>
+
+<p class="note"><strong>Note:</strong> The reason the service and client must be in the same
+application is so the client can cast the returned object and properly call its APIs. The service
+and client must also be in the same process, because this technique does not perform any
+marshalling across processes.</p>
+
+<p>For example, here's a service that provides clients access to methods in the service through
+a {@link android.os.Binder} implementation:</p>
+
+<pre>
+public class LocalService extends Service {
+ // Binder given to clients
+ private final IBinder mBinder = new LocalBinder();
+ // Random number generator
+ private final Random mGenerator = new Random();
+
+ /**
+ * Class used for the client Binder. Because we know this service always
+ * runs in the same process as its clients, we don't need to deal with IPC.
+ */
+ public class LocalBinder extends Binder {
+ LocalService getService() {
+ // Return this instance of LocalService so clients can call public methods
+ return LocalService.this;
+ }
+ }
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ return mBinder;
+ }
+
+ /** method for clients */
+ public int getRandomNumber() {
+ return mGenerator.nextInt(100);
+ }
+}
+</pre>
+
+<p>The {@code LocalBinder} provides the {@code getService()} method for clients to retrieve the
+current instance of {@code LocalService}. This allows clients to call public methods in the
+service. For example, clients can call {@code getRandomNumber()} from the service.</p>
+
+<p>Here's an activity that binds to {@code LocalService} and calls {@code getRandomNumber()}
+when a button is clicked:</p>
+
+<pre>
+public class BindingActivity extends Activity {
+ LocalService mService;
+ boolean mBound = false;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+ }
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ // Bind to LocalService
+ Intent intent = new Intent(this, LocalService.class);
+ bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
+ }
+
+ @Override
+ protected void onStop() {
+ super.onStop();
+ // Unbind from the service
+ if (mBound) {
+ unbindService(mConnection);
+ mBound = false;
+ }
+ }
+
+ /** Called when a button is clicked (the button in the layout file attaches to
+ * this method with the android:onClick attribute) */
+ public void onButtonClick(View v) {
+ if (mBound) {
+ // Call a method from the LocalService.
+ // However, if this call were something that might hang, then this request should
+ // occur in a separate thread to avoid slowing down the activity performance.
+ int num = mService.getRandomNumber();
+ Toast.makeText(this, "number: " + num, Toast.LENGTH_SHORT).show();
+ }
+ }
+
+ /** Defines callbacks for service binding, passed to bindService() */
+ private ServiceConnection mConnection = new ServiceConnection() {
+
+ @Override
+ public void onServiceConnected(ComponentName className,
+ IBinder service) {
+ // We've bound to LocalService, cast the IBinder and get LocalService instance
+ LocalBinder binder = (LocalBinder) service;
+ mService = binder.getService();
+ mBound = true;
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName arg0) {
+ mBound = false;
+ }
+ };
+}
+</pre>
+
+<p>The above sample shows how the client binds to the service using an implementation of
+{@link android.content.ServiceConnection} and the {@link
+android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback. The next
+section provides more information about this process of binding to the service.</p>
+
+<p class="note"><strong>Note:</strong> The example above doesn't explicitly unbind from the service,
+but all clients should unbind at an appropriate time (such as when the activity pauses).</p>
+
+<p>For more sample code, see the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html">{@code
+LocalService.java}</a> class and the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LocalServiceActivities.html">{@code
+LocalServiceActivities.java}</a> class in <a
+href="{@docRoot}resources/samples/ApiDemos/index.html">ApiDemos</a>.</p>
+
+
+
+
+
+<h3 id="Messenger">Using a Messenger</h3>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <h4>Compared to AIDL</h4>
+ <p>When you need to perform IPC, using a {@link android.os.Messenger} for your interface is
+simpler than implementing it with AIDL, because {@link android.os.Messenger} queues
+all calls to the service, whereas, a pure AIDL interface sends simultaneous requests to the
+service, which must then handle multi-threading.</p>
+ <p>For most applications, the service doesn't need to perform multi-threading, so using a {@link
+android.os.Messenger} allows the service to handle one call at a time. If it's important
+that your service be multi-threaded, then you should use <a
+href="{@docRoot}tools/aidl.html">AIDL</a> to define your interface.</p>
+</div>
+</div>
+
+<p>If you need your service to communicate with remote processes, then you can use a
+{@link android.os.Messenger} to provide the interface for your service. This technique allows
+you to perform interprocess communication (IPC) without the need to use AIDL.</p>
+
+<p>Here's a summary of how to use a {@link android.os.Messenger}:</p>
+
+<ul>
+ <li>The service implements a {@link android.os.Handler} that receives a callback for each
+call from a client.</li>
+ <li>The {@link android.os.Handler} is used to create a {@link android.os.Messenger} object
+(which is a reference to the {@link android.os.Handler}).</li>
+ <li>The {@link android.os.Messenger} creates an {@link android.os.IBinder} that the service
+returns to clients from {@link android.app.Service#onBind onBind()}.</li>
+ <li>Clients use the {@link android.os.IBinder} to instantiate the {@link android.os.Messenger}
+(that references the service's {@link android.os.Handler}), which the client uses to send
+{@link android.os.Message} objects to the service.</li>
+ <li>The service receives each {@link android.os.Message} in its {@link
+android.os.Handler}—specifically, in the {@link android.os.Handler#handleMessage
+handleMessage()} method.</li>
+</ul>
+
+
+<p>In this way, there are no "methods" for the client to call on the service. Instead, the
+client delivers "messages" ({@link android.os.Message} objects) that the service receives in
+its {@link android.os.Handler}.</p>
+
+<p>Here's a simple example service that uses a {@link android.os.Messenger} interface:</p>
+
+<pre>
+public class MessengerService extends Service {
+ /** Command to the service to display a message */
+ static final int MSG_SAY_HELLO = 1;
+
+ /**
+ * Handler of incoming messages from clients.
+ */
+ class IncomingHandler extends Handler {
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_SAY_HELLO:
+ Toast.makeText(getApplicationContext(), "hello!", Toast.LENGTH_SHORT).show();
+ break;
+ default:
+ super.handleMessage(msg);
+ }
+ }
+ }
+
+ /**
+ * Target we publish for clients to send messages to IncomingHandler.
+ */
+ final Messenger mMessenger = new Messenger(new IncomingHandler());
+
+ /**
+ * When binding to the service, we return an interface to our messenger
+ * for sending messages to the service.
+ */
+ @Override
+ public IBinder onBind(Intent intent) {
+ Toast.makeText(getApplicationContext(), "binding", Toast.LENGTH_SHORT).show();
+ return mMessenger.getBinder();
+ }
+}
+</pre>
+
+<p>Notice that the {@link android.os.Handler#handleMessage handleMessage()} method in the
+{@link android.os.Handler} is where the service receives the incoming {@link android.os.Message}
+and decides what to do, based on the {@link android.os.Message#what} member.</p>
+
+<p>All that a client needs to do is create a {@link android.os.Messenger} based on the {@link
+android.os.IBinder} returned by the service and send a message using {@link
+android.os.Messenger#send send()}. For example, here's a simple activity that binds to the
+service and delivers the {@code MSG_SAY_HELLO} message to the service:</p>
+
+<pre>
+public class ActivityMessenger extends Activity {
+ /** Messenger for communicating with the service. */
+ Messenger mService = null;
+
+ /** Flag indicating whether we have called bind on the service. */
+ boolean mBound;
+
+ /**
+ * Class for interacting with the main interface of the service.
+ */
+ private ServiceConnection mConnection = new ServiceConnection() {
+ public void onServiceConnected(ComponentName className, IBinder service) {
+ // This is called when the connection with the service has been
+ // established, giving us the object we can use to
+ // interact with the service. We are communicating with the
+ // service using a Messenger, so here we get a client-side
+ // representation of that from the raw IBinder object.
+ mService = new Messenger(service);
+ mBound = true;
+ }
+
+ public void onServiceDisconnected(ComponentName className) {
+ // This is called when the connection with the service has been
+ // unexpectedly disconnected -- that is, its process crashed.
+ mService = null;
+ mBound = false;
+ }
+ };
+
+ public void sayHello(View v) {
+ if (!mBound) return;
+ // Create and send a message to the service, using a supported 'what' value
+ Message msg = Message.obtain(null, MessengerService.MSG_SAY_HELLO, 0, 0);
+ try {
+ mService.send(msg);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+ }
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ // Bind to the service
+ bindService(new Intent(this, MessengerService.class), mConnection,
+ Context.BIND_AUTO_CREATE);
+ }
+
+ @Override
+ protected void onStop() {
+ super.onStop();
+ // Unbind from the service
+ if (mBound) {
+ unbindService(mConnection);
+ mBound = false;
+ }
+ }
+}
+</pre>
+
+<p>Notice that this example does not show how the service can respond to the client. If you want the
+service to respond, then you need to also create a {@link android.os.Messenger} in the client. Then
+when the client receives the {@link android.content.ServiceConnection#onServiceConnected
+onServiceConnected()} callback, it sends a {@link android.os.Message} to the service that includes
+the client's {@link android.os.Messenger} in the {@link android.os.Message#replyTo} parameter
+of the {@link android.os.Messenger#send send()} method.</p>
+
+<p>You can see an example of how to provide two-way messaging in the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/MessengerService.html">{@code
+MessengerService.java}</a> (service) and <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/MessengerServiceActivities.html">{@code
+MessengerServiceActivities.java}</a> (client) samples.</p>
+
+
+
+
+
+<h2 id="Binding">Binding to a Service</h2>
+
+<p>Application components (clients) can bind to a service by calling
+{@link android.content.Context#bindService bindService()}. The Android
+system then calls the service's {@link android.app.Service#onBind
+onBind()} method, which returns an {@link android.os.IBinder} for interacting with the service.</p>
+
+<p>The binding is asynchronous. {@link android.content.Context#bindService
+bindService()} returns immediately and does <em>not</em> return the {@link android.os.IBinder} to
+the client. To receive the {@link android.os.IBinder}, the client must create an instance of {@link
+android.content.ServiceConnection} and pass it to {@link android.content.Context#bindService
+bindService()}. The {@link android.content.ServiceConnection} includes a callback method that the
+system calls to deliver the {@link android.os.IBinder}.</p>
+
+<p class="note"><strong>Note:</strong> Only activities, services, and content providers can bind
+to a service—you <strong>cannot</strong> bind to a service from a broadcast receiver.</p>
+
+<p>So, to bind to a service from your client, you must: </p>
+<ol>
+ <li>Implement {@link android.content.ServiceConnection}.
+ <p>Your implementation must override two callback methods:</p>
+ <dl>
+ <dt>{@link android.content.ServiceConnection#onServiceConnected onServiceConnected()}</dt>
+ <dd>The system calls this to deliver the {@link android.os.IBinder} returned by
+the service's {@link android.app.Service#onBind onBind()} method.</dd>
+ <dt>{@link android.content.ServiceConnection#onServiceDisconnected
+onServiceDisconnected()}</dt>
+ <dd>The Android system calls this when the connection to the service is unexpectedly
+lost, such as when the service has crashed or has been killed. This is <em>not</em> called when the
+client unbinds.</dd>
+ </dl>
+ </li>
+ <li>Call {@link
+android.content.Context#bindService bindService()}, passing the {@link
+android.content.ServiceConnection} implementation. </li>
+ <li>When the system calls your {@link android.content.ServiceConnection#onServiceConnected
+onServiceConnected()} callback method, you can begin making calls to the service, using
+the methods defined by the interface.</li>
+ <li>To disconnect from the service, call {@link
+android.content.Context#unbindService unbindService()}.
+ <p>When your client is destroyed, it will unbind from the service, but you should always unbind
+when you're done interacting with the service or when your activity pauses so that the service can
+shutdown while its not being used. (Appropriate times to bind and unbind is discussed
+more below.)</p>
+ </li>
+</ol>
+
+<p>For example, the following snippet connects the client to the service created above by
+<a href="#Binder">extending the Binder class</a>, so all it must do is cast the returned
+{@link android.os.IBinder} to the {@code LocalService} class and request the {@code
+LocalService} instance:</p>
+
+<pre>
+LocalService mService;
+private ServiceConnection mConnection = new ServiceConnection() {
+ // Called when the connection with the service is established
+ public void onServiceConnected(ComponentName className, IBinder service) {
+ // Because we have bound to an explicit
+ // service that is running in our own process, we can
+ // cast its IBinder to a concrete class and directly access it.
+ LocalBinder binder = (LocalBinder) service;
+ mService = binder.getService();
+ mBound = true;
+ }
+
+ // Called when the connection with the service disconnects unexpectedly
+ public void onServiceDisconnected(ComponentName className) {
+ Log.e(TAG, "onServiceDisconnected");
+ mBound = false;
+ }
+};
+</pre>
+
+<p>With this {@link android.content.ServiceConnection}, the client can bind to a service by passing
+this it to {@link android.content.Context#bindService bindService()}. For example:</p>
+
+<pre>
+Intent intent = new Intent(this, LocalService.class);
+bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
+</pre>
+
+<ul>
+ <li>The first parameter of {@link android.content.Context#bindService bindService()} is an
+{@link android.content.Intent} that explicitly names the service to bind (thought the intent
+could be implicit).</li>
+<li>The second parameter is the {@link android.content.ServiceConnection} object.</li>
+<li>The third parameter is a flag indicating options for the binding. It should usually be {@link
+android.content.Context#BIND_AUTO_CREATE} in order to create the service if its not already alive.
+Other possible values are {@link android.content.Context#BIND_DEBUG_UNBIND}
+and {@link android.content.Context#BIND_NOT_FOREGROUND}, or {@code 0} for none.</li>
+</ul>
+
+
+<h3>Additional notes</h3>
+
+<p>Here are some important notes about binding to a service:</p>
+<ul>
+ <li>You should always trap {@link android.os.DeadObjectException} exceptions, which are thrown
+when the connection has broken. This is the only exception thrown by remote methods.</li>
+ <li>Objects are reference counted across processes. </li>
+ <li>You should usually pair the binding and unbinding during
+matching bring-up and tear-down moments of the client's lifecycle. For example:
+ <ul>
+ <li>If you only need to interact with the service while your activity is visible, you
+should bind during {@link android.app.Activity#onStart onStart()} and unbind during {@link
+android.app.Activity#onStop onStop()}.</li>
+ <li>If you want your activity to receive responses even while it is stopped in the
+background, then you can bind during {@link android.app.Activity#onCreate onCreate()} and unbind
+during {@link android.app.Activity#onDestroy onDestroy()}. Beware that this implies that your
+activity needs to use the service the entire time it's running (even in the background), so if
+the service is in another process, then you increase the weight of the process and it becomes
+more likely that the system will kill it.</li>
+ </ul>
+ <p class="note"><strong>Note:</strong> You should usually <strong>not</strong> bind and unbind
+during your activity's {@link android.app.Activity#onResume onResume()} and {@link
+android.app.Activity#onPause onPause()}, because these callbacks occur at every lifecycle transition
+and you should keep the processing that occurs at these transitions to a minimum. Also, if
+multiple activities in your application bind to the same service and there is a transition between
+two of those activities, the service may be destroyed and recreated as the current activity unbinds
+(during pause) before the next one binds (during resume). (This activity transition for how
+activities coordinate their lifecycles is described in the <a
+href="{@docRoot}guide/components/activities.html#CoordinatingActivities">Activities</a>
+document.)</p>
+</ul>
+
+<p>For more sample code, showing how to bind to a service, see the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.html">{@code
+RemoteService.java}</a> class in <a
+href="{@docRoot}resources/samples/ApiDemos/index.html">ApiDemos</a>.</p>
+
+
+
+
+
+<h2 id="Lifecycle">Managing the Lifecycle of a Bound Service</h2>
+
+<div class="figure" style="width:588px">
+<img src="{@docRoot}images/fundamentals/service_binding_tree_lifecycle.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> The lifecycle for a service that is started
+and also allows binding.</p>
+</div>
+
+<p>When a service is unbound from all clients, the Android system destroys it (unless it was also
+started with {@link android.app.Service#onStartCommand onStartCommand()}). As such, you don't have
+to manage the lifecycle of your service if it's purely a bound
+service—the Android system manages it for you based on whether it is bound to any clients.</p>
+
+<p>However, if you choose to implement the {@link android.app.Service#onStartCommand
+onStartCommand()} callback method, then you must explicitly stop the service, because the
+service is now considered to be <em>started</em>. In this case, the service runs until the service
+stops itself with {@link android.app.Service#stopSelf()} or another component calls {@link
+android.content.Context#stopService stopService()}, regardless of whether it is bound to any
+clients.</p>
+
+<p>Additionally, if your service is started and accepts binding, then when the system calls
+your {@link android.app.Service#onUnbind onUnbind()} method, you can optionally return
+{@code true} if you would like to receive a call to {@link android.app.Service#onRebind
+onRebind()} the next time a client binds to the service (instead of receiving a call to {@link
+android.app.Service#onBind onBind()}). {@link android.app.Service#onRebind
+onRebind()} returns void, but the client still receives the {@link android.os.IBinder} in its
+{@link android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback.
+Below, figure 1 illustrates the logic for this kind of lifecycle.</p>
+
+<p>For more information about the lifecycle of an started service, see the <a
+href="{@docRoot}guide/components/services.html#Lifecycle">Services</a> document.</p>
+
+
+
+
diff --git a/docs/html/guide/components/fragments.jd b/docs/html/guide/components/fragments.jd
new file mode 100644
index 0000000..938e0ab
--- /dev/null
+++ b/docs/html/guide/components/fragments.jd
@@ -0,0 +1,836 @@
+page.title=Fragments
+parent.title=Activities
+parent.link=activities.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Quickview</h2>
+ <ul>
+ <li>Fragments decompose application functionality and UI into reusable modules</li>
+ <li>Add multiple fragments to a screen to avoid switching activities</li>
+ <li>Fragments have their own lifecycle, state, and back stack</li>
+ <li>Fragments require API Level 11 or greater</li>
+ </ul>
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#Design">Design Philosophy</a></li>
+ <li><a href="#Creating">Creating a Fragment</a>
+ <ol>
+ <li><a href="#UI">Adding a user interface</a></li>
+ <li><a href="#Adding">Adding a fragment to an activity</a></li>
+ </ol>
+ </li>
+ <li><a href="#Managing">Managing Fragments</a></li>
+ <li><a href="#Transactions">Performing Fragment Transactions</a></li>
+ <li><a href="#CommunicatingWithActivity">Communicating with the Activity</a>
+ <ol>
+ <li><a href="#EventCallbacks">Creating event callbacks to the activity</a></li>
+ <li><a href="#ActionBar">Adding items to the Action Bar</a></li>
+ </ol>
+ </li>
+ <li><a href="#Lifecycle">Handling the Fragment Lifecycle</a>
+ <ol>
+ <li><a href="#CoordinatingWithActivity">Coordinating with the activity lifecycle</a></li>
+ </ol>
+ </li>
+ <li><a href="#Example">Example</a></li>
+ </ol>
+
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.app.Fragment}</li>
+ <li>{@link android.app.FragmentManager}</li>
+ <li>{@link android.app.FragmentTransaction}</li>
+ </ol>
+
+ <h2>Related samples</h2>
+ <ol>
+ <li><a
+href="{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a></li>
+ <li><a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#Fragment">ApiDemos</a></li>
+ </ol>
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets
+and Handsets</a></li>
+ </ol>
+</div>
+</div>
+
+<p>A {@link android.app.Fragment} represents a behavior or a portion of user interface in an
+{@link android.app.Activity}. You can combine multiple fragments in a single activity to build a
+multi-pane UI and reuse a fragment in multiple activities. You can think of a fragment as a
+modular section of an activity, which has its own lifecycle, receives its own input events, and
+which you can add or remove while the activity is running (sort of like a "sub activity" that
+you can reuse in different activities).</p>
+
+<p>A fragment must always be embedded in an activity and the fragment's lifecycle is directly
+affected by the host activity's lifecycle. For example, when the activity is paused, so are all
+fragments in it, and when the activity is destroyed, so are all fragments. However, while an
+activity is running (it is in the <em>resumed</em> <a
+href="{@docRoot}guide/components/activities.html#Lifecycle">lifecycle state</a>), you can
+manipulate each fragment independently, such as add or remove them. When you perform such a
+fragment transaction, you can also add it to a back stack that's managed by the
+activity—each back stack entry in the activity is a record of the fragment transaction that
+occurred. The back stack allows the user to reverse a fragment transaction (navigate backwards),
+by pressing the <em>Back</em> button.</p>
+
+<p>When you add a fragment as a part of your activity layout, it lives in a {@link
+android.view.ViewGroup} inside the activity's view hierarchy and the fragment defines its own view
+layout.
+You can insert a fragment into your activity layout by declaring the fragment in the activity's
+layout file, as a {@code <fragment>} element, or from your application code by adding it to an
+existing {@link android.view.ViewGroup}. However, a fragment is not required to be a part of the
+activity layout; you may also use a fragment without its own UI as an invisible worker for the
+activity.</p>
+
+<p>This document describes how to build your application to use fragments, including
+how fragments can maintain their state when added to the activity's back stack, share
+events with the activity and other fragments in the activity, contribute to the activity's action
+bar, and more.</p>
+
+
+<h2 id="Design">Design Philosophy</h2>
+
+<p>Android introduced fragments in Android 3.0 (API level 11), primarily to support more
+dynamic and flexible UI designs on large screens, such as tablets. Because a
+tablet's screen is much larger than that of a handset, there's more room to combine and
+interchange UI components. Fragments allow such designs without the need for you to manage complex
+changes to the view hierarchy. By dividing the layout of an activity into fragments, you become able
+to modify the activity's appearance at runtime and preserve those changes in a back stack
+that's managed by the activity.</p>
+
+<p>For example, a news application can use one fragment to show a list of articles on the
+left and another fragment to display an article on the right—both fragments appear in one
+activity, side by side, and each fragment has its own set of lifecycle callback methods and handle
+their own user input events. Thus, instead of using one activity to select an article and another
+activity to read the article, the user can select an article and read it all within the same
+activity, as illustrated in the tablet layout in figure 1.</p>
+
+<p>You should design each fragment as a modular and reusable activity component. That is, because
+each fragment defines its own layout and its own behavior with its own lifecycle callbacks, you can
+include one fragment in multiple activities, so you should design for reuse and avoid directly
+manipulating one fragment from another fragment. This is especially important because a modular
+fragment allows you to change your fragment combinations for different screen sizes. When designing
+your application to support both tablets and handsets, you can reuse your fragments in different
+layout configurations to optimize the user experience based on the available screen space. For
+example, on a handset, it might be necessary to separate fragments to provide a single-pane UI when
+more than one cannot fit within the same activity.</p>
+
+<img src="{@docRoot}images/fundamentals/fragments.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> An example of how two UI modules defined by
+fragments can be combined into one activity for a tablet design, but separated for a
+handset design.</p>
+
+<p>For example—to continue with the news application example—the application can embed
+two fragments in <em>Activity A</em>, when running on a tablet-sized device. However, on a
+handset-sized screen, there's not enough room for both fragments, so <em>Activity A</em> includes
+only the fragment for the list of articles, and when the user selects an article, it starts
+<em>Activity B</em>, which includes the second fragment to read the article. Thus, the application
+supports both tablets and handsets by reusing fragments in different combinations, as illustrated in
+figure 1.</p>
+
+<p>For more information about designing your application with different fragment combinations for
+different screen configurations, see the guide to <a
+href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets and Handsets</a>.</p>
+
+
+
+<h2 id="Creating">Creating a Fragment</h2>
+
+<div class="figure" style="width:327px">
+<img src="{@docRoot}images/fragment_lifecycle.png" alt="" />
+<p class="img-caption"><strong>Figure 2.</strong> The lifecycle of a fragment (while its
+activity is running).</p>
+</div>
+
+<p>To create a fragment, you must create a subclass of {@link android.app.Fragment} (or an existing
+subclass of it). The {@link android.app.Fragment} class has code that looks a lot like
+an {@link android.app.Activity}. It contains callback methods similar to an activity, such
+as {@link android.app.Fragment#onCreate onCreate()}, {@link android.app.Fragment#onStart onStart()},
+{@link android.app.Fragment#onPause onPause()}, and {@link android.app.Fragment#onStop onStop()}. In
+fact, if you're converting an existing Android application to use fragments, you might simply move
+code from your activity's callback methods into the respective callback methods of your
+fragment.</p>
+
+<p>Usually, you should implement at least the following lifecycle methods:</p>
+
+<dl>
+ <dt>{@link android.app.Fragment#onCreate onCreate()}</dt>
+ <dd>The system calls this when creating the fragment. Within your implementation, you should
+initialize essential components of the fragment that you want to retain when the fragment is
+paused or stopped, then resumed.</dd>
+ <dt>{@link android.app.Fragment#onCreateView onCreateView()}</dt>
+ <dd>The system calls this when it's time for the fragment to draw its user interface for the
+first time. To draw a UI for your fragment, you must return a {@link android.view.View} from this
+method that is the root of your fragment's layout. You can return null if the fragment does not
+provide a UI.</dd>
+ <dt>{@link android.app.Activity#onPause onPause()}</dt>
+ <dd>The system calls this method as the first indication that the user is leaving the
+fragment (though it does not always mean the fragment is being destroyed). This is usually where you
+should commit any changes that should be persisted beyond the current user session (because
+the user might not come back).</dd>
+</dl>
+
+<p>Most applications should implement at least these three methods for every fragment, but there are
+several other callback methods you should also use to handle various stages of the
+fragment lifecycle. All the lifecycle callback methods are discussed more later, in the section
+about <a href="#Lifecycle">Handling the Fragment Lifecycle</a>.</p>
+
+
+<p>There are also a few subclasses that you might want to extend, instead of the base {@link
+android.app.Fragment} class:</p>
+
+<dl>
+ <dt>{@link android.app.DialogFragment}</dt>
+ <dd>Displays a floating dialog. Using this class to create a dialog is a good alternative to using
+the dialog helper methods in the {@link android.app.Activity} class, because you can
+incorporate a fragment dialog into the back stack of fragments managed by the activity,
+allowing the user to return to a dismissed fragment.</dd>
+
+ <dt>{@link android.app.ListFragment}</dt>
+ <dd>Displays a list of items that are managed by an adapter (such as a {@link
+android.widget.SimpleCursorAdapter}), similar to {@link android.app.ListActivity}. It provides
+several methods for managing a list view, such as the {@link
+android.app.ListFragment#onListItemClick(ListView,View,int,long) onListItemClick()} callback to
+handle click events.</dd>
+
+ <dt>{@link android.preference.PreferenceFragment}</dt>
+ <dd>Displays a hierarchy of {@link android.preference.Preference} objects as a list, similar to
+{@link android.preference.PreferenceActivity}. This is useful when creating a "settings"
+activity for your application.</dd>
+</dl>
+
+
+<h3 id="UI">Adding a user interface</h3>
+
+<p>A fragment is usually used as part of an activity's user interface and contributes its own
+layout to the activity.</p>
+
+<p>To provide a layout for a fragment, you must implement the {@link
+android.app.Fragment#onCreateView onCreateView()} callback method, which the Android system calls
+when it's time for the fragment to draw its layout. Your implementation of this method must return a
+{@link android.view.View} that is the root of your fragment's layout.</p>
+
+<p class="note"><strong>Note:</strong> If your fragment is a subclass of {@link
+android.app.ListFragment}, the default implementation returns a {@link android.widget.ListView} from
+{@link android.app.Fragment#onCreateView onCreateView()}, so you don't need to implement it.</p>
+
+<p>To return a layout from {@link
+android.app.Fragment#onCreateView onCreateView()}, you can inflate it from a <a
+href="{@docRoot}guide/topics/resources/layout-resource.html">layout resource</a> defined in XML. To
+help you do so, {@link android.app.Fragment#onCreateView onCreateView()} provides a
+{@link android.view.LayoutInflater} object.</p>
+
+<p>For example, here's a subclass of {@link android.app.Fragment} that loads a layout from the
+{@code example_fragment.xml} file:</p>
+
+<pre>
+public static class ExampleFragment extends Fragment {
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.example_fragment, container, false);
+ }
+}
+</pre>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <h3>Creating a layout</h3>
+ <p>In the sample above, {@code R.layout.example_fragment} is a reference to a layout resource
+named {@code example_fragment.xml} saved in the application resources. For information about how to
+create a layout in XML, see the <a href="{@docRoot}guide/topics/ui/index.html">User Interface</a>
+documentation.</p>
+</div>
+</div>
+
+<p>The {@code container} parameter passed to {@link android.app.Fragment#onCreateView
+onCreateView()} is the parent {@link android.view.ViewGroup} (from the activity's layout) in which
+your fragment layout
+will be inserted. The {@code savedInstanceState} parameter is a {@link android.os.Bundle} that
+provides data about the previous instance of the fragment, if the fragment is being resumed
+(restoring state is discussed more in the section about <a href="#Lifecycle">Handling the
+Fragment Lifecycle</a>).</p>
+
+<p>The {@link android.view.LayoutInflater#inflate(int,ViewGroup,boolean) inflate()} method takes
+three arguments:</p>
+<ul>
+ <li>The resource ID of the layout you want to inflate.</li>
+ <li>The {@link android.view.ViewGroup} to be the parent of the inflated layout. Passing the {@code
+container} is important in order for the system to apply layout parameters to the root view of the
+inflated layout, specified by the parent view in which it's going.</li>
+ <li>A boolean indicating whether the inflated layout should be attached to the {@link
+android.view.ViewGroup} (the second parameter) during inflation. (In this case, this
+is false because the system is already inserting the inflated layout into the {@code
+container}—passing true would create a redundant view group in the final layout.)</li>
+</ul>
+
+<p>Now you've seen how to create a fragment that provides a layout. Next, you need to add
+the fragment to your activity.</p>
+
+
+
+<h3 id="Adding">Adding a fragment to an activity</h3>
+
+<p>Usually, a fragment contributes a portion of UI to the host activity, which is embedded as a part
+of the activity's overall view hierarchy. There are two ways you can add a fragment to the activity
+layout:</p>
+
+<ul>
+ <li><b>Declare the fragment inside the activity's layout file.</b>
+<p>In this case, you can
+specify layout properties for the fragment as if it were a view. For example, here's the layout
+file for an activity with two fragments:</p>
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <fragment android:name="com.example.news.ArticleListFragment"
+ android:id="@+id/list"
+ android:layout_weight="1"
+ android:layout_width="0dp"
+ android:layout_height="match_parent" />
+ <fragment android:name="com.example.news.ArticleReaderFragment"
+ android:id="@+id/viewer"
+ android:layout_weight="2"
+ android:layout_width="0dp"
+ android:layout_height="match_parent" />
+</LinearLayout>
+</pre>
+ <p>The {@code android:name} attribute in the {@code <fragment>} specifies the {@link
+android.app.Fragment} class to instantiate in the layout.</p>
+
+<p>When the system creates this activity layout, it instantiates each fragment specified in the
+layout and calls the {@link android.app.Fragment#onCreateView onCreateView()} method for each one,
+to retrieve each fragment's layout. The system inserts the {@link android.view.View} returned by the
+fragment directly in place of the {@code <fragment>} element.</p>
+
+<div class="note">
+ <p><strong>Note:</strong> Each fragment requires a unique identifier that
+the system can use to restore the fragment if the activity is restarted (and which you can use to
+capture the fragment to perform transactions, such as remove it). There are three ways to provide an
+ID for a fragment:</p>
+ <ul>
+ <li>Supply the {@code android:id} attribute with a unique ID.</li>
+ <li>Supply the {@code android:tag} attribute with a unique string.</li>
+ <li>If you provide neither of the previous two, the system uses the ID of the container
+view.</li>
+ </ul>
+</div>
+ </li>
+
+ <li><b>Or, programmatically add the fragment to an existing {@link android.view.ViewGroup}.</b>
+<p>At any time while your activity is running, you can add fragments to your activity layout. You
+simply need to specify a {@link
+android.view.ViewGroup} in which to place the fragment.</p>
+ <p>To make fragment transactions in your activity (such as add, remove, or replace a
+fragment), you must use APIs from {@link android.app.FragmentTransaction}. You can get an instance
+of {@link android.app.FragmentTransaction} from your {@link android.app.Activity} like this:</p>
+
+<pre>
+FragmentManager fragmentManager = {@link android.app.Activity#getFragmentManager()}
+FragmentTransaction fragmentTransaction = fragmentManager.{@link android.app.FragmentManager#beginTransaction()};
+</pre>
+
+<p>You can then add a fragment using the {@link
+android.app.FragmentTransaction#add(int,Fragment) add()} method, specifying the fragment to add and
+the view in which to insert it. For example:</p>
+
+<pre>
+ExampleFragment fragment = new ExampleFragment();
+fragmentTransaction.add(R.id.fragment_container, fragment);
+fragmentTransaction.commit();
+</pre>
+
+ <p>The first argument passed to {@link android.app.FragmentTransaction#add(int,Fragment) add()}
+is the {@link android.view.ViewGroup} in which the fragment should be placed, specified by
+resource ID, and the second parameter is the fragment to add.</p>
+ <p>Once you've made your changes with
+{@link android.app.FragmentTransaction}, you must
+call {@link android.app.FragmentTransaction#commit} for the changes to take effect.</p>
+ </li>
+</ul>
+
+
+<h4 id="AddingWithoutUI">Adding a fragment without a UI</h4>
+
+<p>The examples above show how to add a fragment to your activity in order to provide a UI. However,
+you can also use a fragment to provide a background behavior for the activity without presenting
+additional UI.</p>
+
+<p>To add a fragment without a UI, add the fragment from the activity using {@link
+android.app.FragmentTransaction#add(Fragment,String)} (supplying a unique string "tag" for the
+fragment, rather than a view ID). This adds the fragment, but, because it's not associated with a
+view in the activity layout, it does not receive a call to {@link
+android.app.Fragment#onCreateView onCreateView()}. So you don't need to implement that method.</p>
+
+<p>Supplying a string tag for the fragment isn't strictly for non-UI fragments—you can also
+supply string tags to fragments that do have a UI—but if the fragment does not have a
+UI, then the string tag is the only way to identify it. If you want to get the fragment from the
+activity later, you need to use {@link android.app.FragmentManager#findFragmentByTag
+findFragmentByTag()}.</p>
+
+<p>For an example activity that uses a fragment as a background worker, without a UI, see the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/FragmentRetainInstance.html">{@code
+FragmentRetainInstance.java}</a> sample.</p>
+
+
+
+<h2 id="Managing">Managing Fragments</h2>
+
+<p>To manage the fragments in your activity, you need to use {@link android.app.FragmentManager}. To
+get it, call {@link android.app.Activity#getFragmentManager()} from your activity.</p>
+
+<p>Some things that you can do with {@link android.app.FragmentManager} include:</p>
+
+<ul>
+ <li>Get fragments that exist in the activity, with {@link
+android.app.FragmentManager#findFragmentById findFragmentById()} (for fragments that provide a UI in
+the activity layout) or {@link android.app.FragmentManager#findFragmentByTag
+findFragmentByTag()} (for fragments that do or don't provide a UI).</li>
+ <li>Pop fragments off the back stack, with {@link
+android.app.FragmentManager#popBackStack()} (simulating a <em>Back</em> command by the user).</li>
+ <li>Register a listener for changes to the back stack, with {@link
+android.app.FragmentManager#addOnBackStackChangedListener addOnBackStackChangedListener()}.</li>
+</ul>
+
+<p>For more information about these methods and others, refer to the {@link
+android.app.FragmentManager} class documentation.</p>
+
+<p>As demonstrated in the previous section, you can also use {@link android.app.FragmentManager}
+to open a {@link android.app.FragmentTransaction}, which allows you to perform transactions, such as
+add and remove fragments.</p>
+
+
+<h2 id="Transactions">Performing Fragment Transactions</h2>
+
+<p>A great feature about using fragments in your activity is the ability to add, remove, replace,
+and perform other actions with them, in response to user interaction. Each set of changes that you
+commit to the activity is called a transaction and you can perform one using APIs in {@link
+android.app.FragmentTransaction}. You can also save each transaction to a back stack managed by the
+activity, allowing the user to navigate backward through the fragment changes (similar to navigating
+backward through activities).</p>
+
+<p>You can acquire an instance of {@link android.app.FragmentTransaction} from the {@link
+android.app.FragmentManager} like this:</p>
+
+<pre>
+FragmentManager fragmentManager = {@link android.app.Activity#getFragmentManager()};
+FragmentTransaction fragmentTransaction = fragmentManager.{@link android.app.FragmentManager#beginTransaction()};
+</pre>
+
+<p>Each transaction is a set of changes that you want to perform at the same time. You can set
+up all the changes you want to perform for a given transaction using methods such as {@link
+android.app.FragmentTransaction#add add()}, {@link android.app.FragmentTransaction#remove remove()},
+and {@link android.app.FragmentTransaction#replace replace()}. Then, to apply the transaction
+to the activity, you must call {@link android.app.FragmentTransaction#commit()}.</p>
+</dl>
+
+<p>Before you call {@link
+android.app.FragmentTransaction#commit()}, however, you might want to call {@link
+android.app.FragmentTransaction#addToBackStack addToBackStack()}, in order to add the transaction
+to a back stack of fragment transactions. This back stack is managed by the activity and allows
+the user to return to the previous fragment state, by pressing the <em>Back</em> button.</p>
+
+<p>For example, here's how you can replace one fragment with another, and preserve the previous
+state in the back stack:</p>
+
+<pre>
+// Create new fragment and transaction
+Fragment newFragment = new ExampleFragment();
+FragmentTransaction transaction = getFragmentManager().beginTransaction();
+
+// Replace whatever is in the fragment_container view with this fragment,
+// and add the transaction to the back stack
+transaction.replace(R.id.fragment_container, newFragment);
+transaction.addToBackStack(null);
+
+// Commit the transaction
+transaction.commit();
+</pre>
+
+<p>In this example, {@code newFragment} replaces whatever fragment (if any) is currently in the
+layout container identified by the {@code R.id.fragment_container} ID. By calling {@link
+android.app.FragmentTransaction#addToBackStack addToBackStack()}, the replace transaction is
+saved to the back stack so the user can reverse the transaction and bring back the
+previous fragment by pressing the <em>Back</em> button.</p>
+
+<p>If you add multiple changes to the transaction (such as another {@link
+android.app.FragmentTransaction#add add()} or {@link android.app.FragmentTransaction#remove
+remove()}) and call {@link
+android.app.FragmentTransaction#addToBackStack addToBackStack()}, then all changes applied
+before you call {@link android.app.FragmentTransaction#commit commit()} are added to the
+back stack as a single transaction and the <em>Back</em> button will reverse them all together.</p>
+
+<p>The order in which you add changes to a {@link android.app.FragmentTransaction} doesn't matter,
+except:</p>
+<ul>
+ <li>You must call {@link android.app.FragmentTransaction#commit()} last</li>
+ <li>If you're adding multiple fragments to the same container, then the order in which
+you add them determines the order they appear in the view hierarchy</li>
+</ul>
+
+<p>If you do not call {@link android.app.FragmentTransaction#addToBackStack(String)
+addToBackStack()} when you perform a transaction that removes a fragment, then that fragment is
+destroyed when the transaction is committed and the user cannot navigate back to it. Whereas, if you
+do call {@link android.app.FragmentTransaction#addToBackStack(String) addToBackStack()} when
+removing a fragment, then the fragment is <em>stopped</em> and will be resumed if the user navigates
+back.</p>
+
+<p class="note"><strong>Tip:</strong> For each fragment transaction, you can apply a transition
+animation, by calling {@link android.app.FragmentTransaction#setTransition setTransition()} before
+you commit.</p>
+
+<p>Calling {@link android.app.FragmentTransaction#commit()} does not perform the transaction
+immediately. Rather, it schedules it to run on the activity's UI thread (the "main" thread) as soon
+as the thread is able to do so. If necessary, however, you may call {@link
+android.app.FragmentManager#executePendingTransactions()} from your UI thread to immediately execute
+transactions submitted by {@link android.app.FragmentTransaction#commit()}. Doing so is
+usually not necessary unless the transaction is a dependency for jobs in other threads.</p>
+
+<p class="caution"><strong>Caution:</strong> You can commit a transaction using {@link
+android.app.FragmentTransaction#commit commit()} only prior to the activity <a
+href="{@docRoot}guide/components/activities.html#SavingActivityState">saving its
+state</a> (when the user leaves the activity). If you attempt to commit after that point, an
+exception will be thrown. This is because the state after the commit can be lost if the activity
+needs to be restored. For situations in which its okay that you lose the commit, use {@link
+android.app.FragmentTransaction#commitAllowingStateLoss()}.</p>
+
+
+
+
+<h2 id="CommunicatingWithActivity">Communicating with the Activity</h2>
+
+<p>Although a {@link android.app.Fragment} is implemented as an object that's independent from an
+{@link android.app.Activity} and can be used inside multiple activities, a given instance of
+a fragment is directly tied to the activity that contains it.</p>
+
+<p>Specifically, the fragment can access the {@link android.app.Activity} instance with {@link
+android.app.Fragment#getActivity()} and easily perform tasks such as find a view in the
+activity layout:</p>
+
+<pre>
+View listView = {@link android.app.Fragment#getActivity()}.{@link android.app.Activity#findViewById findViewById}(R.id.list);
+</pre>
+
+<p>Likewise, your activity can call methods in the fragment by acquiring a reference to the
+{@link android.app.Fragment} from {@link android.app.FragmentManager}, using {@link
+android.app.FragmentManager#findFragmentById findFragmentById()} or {@link
+android.app.FragmentManager#findFragmentByTag findFragmentByTag()}. For example:</p>
+
+<pre>
+ExampleFragment fragment = (ExampleFragment) getFragmentManager().findFragmentById(R.id.example_fragment);
+</pre>
+
+
+<h3 id="EventCallbacks">Creating event callbacks to the activity</h3>
+
+<p>In some cases, you might need a fragment to share events with the activity. A good way to do that
+is to define a callback interface inside the fragment and require that the host activity implement
+it. When the activity receives a callback through the interface, it can share the information with
+other fragments in the layout as necessary.</p>
+
+<p>For example, if a news application has two fragments in an activity—one to show a list of
+articles (fragment A) and another to display an article (fragment B)—then fragment A must tell
+the activity when a list item is selected so that it can tell fragment B to display the article. In
+this case, the {@code OnArticleSelectedListener} interface is declared inside fragment A:</p>
+
+<pre>
+public static class FragmentA extends ListFragment {
+ ...
+ // Container Activity must implement this interface
+ public interface OnArticleSelectedListener {
+ public void onArticleSelected(Uri articleUri);
+ }
+ ...
+}
+</pre>
+
+<p>Then the activity that hosts the fragment implements the {@code OnArticleSelectedListener}
+interface and
+overrides {@code onArticleSelected()} to notify fragment B of the event from fragment A. To ensure
+that the host activity implements this interface, fragment A's {@link
+android.app.Fragment#onAttach onAttach()} callback method (which the system calls when adding
+the fragment to the activity) instantiates an instance of {@code OnArticleSelectedListener} by
+casting the {@link android.app.Activity} that is passed into {@link android.app.Fragment#onAttach
+onAttach()}:</p>
+
+<pre>
+public static class FragmentA extends ListFragment {
+ OnArticleSelectedListener mListener;
+ ...
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+ try {
+ mListener = (OnArticleSelectedListener) activity;
+ } catch (ClassCastException e) {
+ throw new ClassCastException(activity.toString() + " must implement OnArticleSelectedListener");
+ }
+ }
+ ...
+}
+</pre>
+
+<p>If the activity has not implemented the interface, then the fragment throws a
+{@link java.lang.ClassCastException}.
+On success, the {@code mListener} member holds a reference to activity's implementation of
+{@code OnArticleSelectedListener}, so that fragment A can share events with the activity by calling
+methods defined by the {@code OnArticleSelectedListener} interface. For example, if fragment A is an
+extension of {@link android.app.ListFragment}, each time
+the user clicks a list item, the system calls {@link android.app.ListFragment#onListItemClick
+onListItemClick()} in the fragment, which then calls {@code onArticleSelected()} to share
+the event with the activity:</p>
+
+<pre>
+public static class FragmentA extends ListFragment {
+ OnArticleSelectedListener mListener;
+ ...
+ @Override
+ public void onListItemClick(ListView l, View v, int position, long id) {
+ // Append the clicked item's row ID with the content provider Uri
+ Uri noteUri = ContentUris.{@link android.content.ContentUris#withAppendedId withAppendedId}(ArticleColumns.CONTENT_URI, id);
+ // Send the event and Uri to the host activity
+ mListener.onArticleSelected(noteUri);
+ }
+ ...
+}
+</pre>
+
+<p>The {@code id} parameter passed to {@link
+android.app.ListFragment#onListItemClick onListItemClick()} is the row ID of the clicked item,
+which the activity (or other fragment) uses to fetch the article from the application's {@link
+android.content.ContentProvider}.</p>
+
+<p><!--To see a complete implementation of this kind of callback interface, see the <a
+href="{@docRoot}resources/samples/NotePad/index.html">NotePad sample</a>. -->More information about
+using a content provider is available in the <a
+href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a> document.</p>
+
+
+
+<h3 id="ActionBar">Adding items to the Action Bar</h3>
+
+<p>Your fragments can contribute menu items to the activity's <a
+href="{@docRoot}guide/topics/ui/menus.html#options-menu">Options Menu</a> (and, consequently, the <a
+href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a>) by implementing
+{@link android.app.Fragment#onCreateOptionsMenu(Menu,MenuInflater) onCreateOptionsMenu()}. In order
+for this method to receive calls, however, you must call {@link
+android.app.Fragment#setHasOptionsMenu(boolean) setHasOptionsMenu()} during {@link
+android.app.Fragment#onCreate(Bundle) onCreate()}, to indicate that the fragment
+would like to add items to the Options Menu (otherwise, the fragment will not receive a call to
+{@link android.app.Fragment#onCreateOptionsMenu onCreateOptionsMenu()}).</p>
+
+<p>Any items that you then add to the Options Menu from the fragment are appended to the existing
+menu items. The fragment also receives callbacks to {@link
+android.app.Fragment#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} when a menu item
+is selected.</p>
+
+<p>You can also register a view in your fragment layout to provide a context menu by calling {@link
+android.app.Fragment#registerForContextMenu(View) registerForContextMenu()}. When the user opens
+the context menu, the fragment receives a call to {@link
+android.app.Fragment#onCreateContextMenu(ContextMenu,View,ContextMenu.ContextMenuInfo)
+onCreateContextMenu()}. When the user selects an item, the fragment receives a call to {@link
+android.app.Fragment#onContextItemSelected(MenuItem) onContextItemSelected()}.</p>
+
+<p class="note"><strong>Note:</strong> Although your fragment receives an on-item-selected callback
+for each menu item it adds, the activity is first to receive the respective callback when the user
+selects a menu item. If the activity's implementation of the on-item-selected callback does not
+handle the selected item, then the event is passed to the fragment's callback. This is true for
+the Options Menu and context menus.</p>
+
+<p>For more information about menus, see the <a
+href="{@docRoot}guide/topics/ui/menus.html">Menus</a> and <a
+href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guides.</p>
+
+
+
+
+<h2 id="Lifecycle">Handling the Fragment Lifecycle</h2>
+
+<div class="figure" style="width:350px">
+<img src="{@docRoot}images/activity_fragment_lifecycle.png" alt=""/>
+<p class="img-caption"><strong>Figure 3.</strong> The effect of the activity lifecycle on the fragment
+lifecycle.</p>
+</div>
+
+<p>Managing the lifecycle of a fragment is a lot like managing the lifecycle of an activity. Like
+an activity, a fragment can exist in three states:</p>
+
+<dl>
+ <dt><i>Resumed</i></dt>
+ <dd>The fragment is visible in the running activity.</dd>
+
+ <dt><i>Paused</i></dt>
+ <dd>Another activity is in the foreground and has focus, but the activity in which this
+fragment lives is still visible (the foreground activity is partially transparent or doesn't
+cover the entire screen).</dd>
+
+ <dt><i>Stopped</i></dt>
+ <dd>The fragment is not visible. Either the host activity has been stopped or the
+fragment has been removed from the activity but added to the back stack. A stopped fragment is
+still alive (all state and member information is retained by the system). However, it is no longer
+visible to the user and will be killed if the activity is killed.</dd>
+</dl>
+
+<p>Also like an activity, you can retain the state of a fragment using a {@link
+android.os.Bundle}, in case the activity's process is killed and you need to restore the
+fragment state when the activity is recreated. You can save the state during the fragment's {@link
+android.app.Fragment#onSaveInstanceState onSaveInstanceState()} callback and restore it during
+either {@link android.app.Fragment#onCreate onCreate()}, {@link
+android.app.Fragment#onCreateView onCreateView()}, or {@link
+android.app.Fragment#onActivityCreated onActivityCreated()}. For more information about saving
+state, see the <a
+href="{@docRoot}guide/components/activities.html#SavingActivityState">Activities</a>
+document.</p>
+
+<p>The most significant difference in lifecycle between an activity and a fragment is how one is
+stored in its respective back stack. An activity is placed into a back stack of activities
+that's managed by the system when it's stopped, by default (so that the user can navigate back
+to it with the <em>Back</em> button, as discussed in <a
+href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a>).
+However, a fragment is placed into a back stack managed by the host activity only when you
+explicitly request that the instance be saved by calling {@link
+android.app.FragmentTransaction#addToBackStack(String) addToBackStack()} during a transaction that
+removes the fragment.</p>
+
+<p>Otherwise, managing the fragment lifecycle is very similar to managing the activity
+lifecycle. So, the same practices for <a
+href="{@docRoot}guide/components/activities.html#Lifecycle">managing the activity
+lifecycle</a> also apply to fragments. What you also need to understand, though, is how the life
+of the activity affects the life of the fragment.</p>
+
+
+<h3 id="CoordinatingWithActivity">Coordinating with the activity lifecycle</h3>
+
+<p>The lifecycle of the activity in which the fragment lives directly affects the lifecycle of the
+fragment, such that each lifecycle callback for the activity results in a similar callback for each
+fragment. For example, when the activity receives {@link android.app.Activity#onPause}, each
+fragment in the activity receives {@link android.app.Fragment#onPause}.</p>
+
+<p>Fragments have a few extra lifecycle callbacks, however, that handle unique interaction with the
+activity in order to perform actions such as build and destroy the fragment's UI. These additional
+callback methods are:</p>
+
+<dl>
+ <dt>{@link android.app.Fragment#onAttach onAttach()}</dt>
+ <dd>Called when the fragment has been associated with the activity (the {@link
+android.app.Activity} is passed in here).</dd>
+ <dt>{@link android.app.Fragment#onCreateView onCreateView()}</dt>
+ <dd>Called to create the view hierarchy associated with the fragment.</dd>
+ <dt>{@link android.app.Fragment#onActivityCreated onActivityCreated()}</dt>
+ <dd>Called when the activity's {@link android.app.Activity#onCreate
+onCreate()} method has returned.</dd>
+ <dt>{@link android.app.Fragment#onDestroyView onDestroyView()}</dt>
+ <dd>Called when the view hierarchy associated with the fragment is being removed.</dd>
+ <dt>{@link android.app.Fragment#onDetach onDetach()}</dt>
+ <dd>Called when the fragment is being disassociated from the activity.</dd>
+</dl>
+
+<p>The flow of a fragment's lifecycle, as it is affected by its host activity, is illustrated
+by figure 3. In this figure, you can see how each successive state of the activity determines which
+callback methods a fragment may receive. For example, when the activity has received its {@link
+android.app.Activity#onCreate onCreate()} callback, a fragment in the activity receives no more than
+the {@link android.app.Fragment#onActivityCreated onActivityCreated()} callback.</p>
+
+<p>Once the activity reaches the resumed state, you can freely add and remove fragments to the
+activity. Thus, only while the activity is in the resumed state can the lifecycle of a fragment
+change independently.</p>
+
+<p>However, when the activity leaves the resumed state, the fragment again is pushed through its
+lifecycle by the activity.</p>
+
+
+
+
+<h2 id="Example">Example</h2>
+
+<p>To bring everything discussed in this document together, here's an example of an activity
+using two fragments to create a two-pane layout. The activity below includes one fragment to
+show a list of Shakespeare play titles and another to show a summary of the play when selected
+from the list. It also demonstrates how to provide different configurations of the fragments,
+based on the screen configuration.</p>
+
+<p class="note"><strong>Note:</strong> The complete source code for this activity is available in
+<a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.html">{@code
+FragmentLayout.java}</a>.</p>
+
+<p>The main activity applies a layout in the usual way, during {@link
+android.app.Activity#onCreate onCreate()}:</p>
+
+{@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java main}
+
+<p>The layout applied is {@code fragment_layout.xml}:</p>
+
+{@sample development/samples/ApiDemos/res/layout-land/fragment_layout.xml layout}
+
+<p>Using this layout, the system instantiates the {@code TitlesFragment} (which lists the play
+titles) as soon as the activity loads the layout, while the {@link android.widget.FrameLayout}
+(where the fragment for showing the play summary will go) consumes space on the right side of the
+screen, but remains empty at first. As you'll see below, it's not until the user selects an item
+from the list that a fragment is placed into the {@link android.widget.FrameLayout}.</p>
+
+<p>However, not all screen configurations are wide enough to show both the list of
+plays and the summary, side by side. So, the layout above is used only for the landscape
+screen configuration, by saving it at {@code res/layout-land/fragment_layout.xml}.</p>
+
+<p>Thus, when the screen is in portrait orientation, the system applies the following layout, which
+is saved at {@code res/layout/fragment_layout.xml}:</p>
+
+{@sample development/samples/ApiDemos/res/layout/fragment_layout.xml layout}
+
+<p>This layout includes only {@code TitlesFragment}. This means that, when the device is in
+portrait orientation, only the list of play titles is visible. So, when the user clicks a list
+item in this configuration, the application will start a new activity to show the summary,
+instead of loading a second fragment.</p>
+
+<p>Next, you can see how this is accomplished in the fragment classes. First is {@code
+TitlesFragment}, which shows the list of Shakespeare play titles. This fragment extends {@link
+android.app.ListFragment} and relies on it to handle most of the list view work.</p>
+
+<p>As you inspect this code, notice that there are two possible behaviors when the user clicks a
+list item: depending on which of the two layouts is active, it can either create and display a new
+fragment to show the details in the same activity (adding the fragment to the {@link
+android.widget.FrameLayout}), or start a new activity (where the fragment can be shown).</p>
+
+{@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java titles}
+
+<p>The second fragment, {@code DetailsFragment} shows the play summary for the item selected from
+the list from {@code TitlesFragment}:</p>
+
+{@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java details}
+
+<p>Recall from the {@code TitlesFragment} class, that, if the user clicks a list item and the
+current layout does <em>not</em> include the {@code R.id.details} view (which is where the
+{@code DetailsFragment} belongs), then the application starts the {@code DetailsActivity}
+activity to display the content of the item.</p>
+
+<p>Here is the {@code DetailsActivity}, which simply embeds the {@code DetailsFragment} to display
+the selected play summary when the screen is in portrait orientation:</p>
+
+{@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java
+details_activity}
+
+<p>Notice that this activity finishes itself if the configuration is landscape, so that the main
+activity can take over and display the {@code DetailsFragment} alongside the {@code TitlesFragment}.
+This can happen if the user begins the {@code DetailsActivity} while in portrait orientation, but
+then rotates to landscape (which restarts the current activity).</p>
+
+
+<p>For more samples using fragments (and complete source files for this example),
+see the sample code available in <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#Fragment">
+ApiDemos</a> (available for download from the <a
+href="{@docRoot}resources/samples/get.html">Samples SDK component</a>).</p>
+
+
diff --git a/docs/html/guide/components/fundamentals.jd b/docs/html/guide/components/fundamentals.jd
new file mode 100644
index 0000000..1717782
--- /dev/null
+++ b/docs/html/guide/components/fundamentals.jd
@@ -0,0 +1,518 @@
+page.title=Application Fundamentals
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Quickview</h2>
+<ul>
+ <li>Android applications are composed of one or more application components (activities,
+services, content providers, and broadcast receivers)</li>
+ <li>Each component performs a different role in the overall application behavior, and each
+one can be activated individually (even by other applications)</li>
+ <li>The manifest file must declare all components in the application and should also declare
+all application requirements, such as the minimum version of Android required and any hardware
+configurations required</li>
+ <li>Non-code application resources (images, strings, layout files, etc.) should include
+alternatives for different device configurations (such as different strings for different
+languages and different layouts for different screen sizes)</li>
+</ul>
+
+
+<h2>In this document</h2>
+<ol>
+<li><a href="#Components">Application Components</a>
+ <ol>
+ <li><a href="#ActivatingComponents">Activating components</a></li>
+ </ol>
+</li>
+<li><a href="#Manifest">The Manifest File</a>
+ <ol>
+ <li><a href="#DeclaringComponents">Declaring components</a></li>
+ <li><a href="#DeclaringRequirements">Declaring application requirements</a></li>
+ </ol>
+</li>
+<li><a href="#Resources">Application Resources</a></li>
+</ol>
+</div>
+</div>
+
+<p>Android applications are written in the Java programming language. The Android SDK tools compile
+the code—along with any data and resource files—into an <i>Android package</i>, an
+archive file with an {@code .apk} suffix. All the code in a single {@code .apk} file is considered
+to be one application and is the file that Android-powered devices use to install the
+application.</p>
+
+<p>Once installed on a device, each Android application lives in its own security sandbox: </p>
+
+<ul>
+ <li>The Android operating system is a multi-user Linux system in which each application is a
+different user.</li>
+
+<li>By default, the system assigns each application a unique Linux user ID (the ID is used only by
+the system and is unknown to the application). The system sets permissions for all the files in an
+application so that only the user ID assigned to that application can access them. </li>
+
+<li>Each process has its own virtual machine (VM), so an application's code runs in isolation from
+other applications.</li>
+
+<li>By default, every application runs in its own Linux process. Android starts the process when any
+of the application's components need to be executed, then shuts down the process when it's no longer
+needed or when the system must recover memory for other applications.</li>
+</ul>
+
+<p>In this way, the Android system implements the <em>principle of least privilege</em>. That is,
+each application, by default, has access only to the components that it requires to do its work and
+no more. This creates a very secure environment in which an application cannot access parts of
+the system for which it is not given permission.</p>
+
+<p>However, there are ways for an application to share data with other applications and for an
+application to access system services:</p>
+
+<ul>
+ <li>It's possible to arrange for two applications to share the same Linux user ID, in which case
+they are able to access each other's files. To conserve system resources, applications with the
+same user ID can also arrange to run in the same Linux process and share the same VM (the
+applications must also be signed with the same certificate).</li>
+ <li>An application can request permission to access device data such as the user's
+contacts, SMS messages, the mountable storage (SD card), camera, Bluetooth, and more. All
+application permissions must be granted by the user at install time.</li>
+</ul>
+
+<p>That covers the basics regarding how an Android application exists within the system. The rest of
+this document introduces you to:</p>
+<ul>
+ <li>The core framework components that define your application.</li>
+ <li>The manifest file in which you declare components and required device features for your
+application.</li>
+ <li>Resources that are separate from the application code and allow your application to
+gracefully optimize its behavior for a variety of device configurations.</li>
+</ul>
+
+<!--
+<p class="note"><strong>Tip:</strong> If you're new to Android development, we suggest that you
+follow the Beginner's Path link at the bottom of this page. For each document in the Application
+Fundamentals, the Beginner's Path points you to the document we suggest you read next, in order
+to get up to speed on the core Android concepts.</p>
+-->
+
+
+<h2 id="Components">Application Components</h2>
+
+<p>Application components are the essential building blocks of an Android application. Each
+component is a different point through which the system can enter your application. Not all
+components are actual entry points for the user and some depend on each other, but each one exists
+as its own entity and plays a specific role—each one is a unique building block that
+helps define your application's overall behavior.</p>
+
+<p>There are four different types of application components. Each type serves a distinct purpose
+and has a distinct lifecycle that defines how the component is created and destroyed.</p>
+
+<p>Here are the four types of application components:</p>
+
+<dl>
+
+<dt><b>Activities</b></dt>
+
+<dd>An <i>activity</i> represents a single screen with a user interface. For example,
+an email application might have one activity that shows a list of new
+emails, another activity to compose an email, and another activity for reading emails. Although
+the activities work together to form a cohesive user experience in the email application, each one
+is independent of the others. As such, a different application can start any one of these
+activities (if the email application allows it). For example, a camera application can start the
+activity in the email application that composes new mail, in order for the user to share a picture.
+
+<p>An activity is implemented as a subclass of {@link android.app.Activity} and you can learn more
+about it in the <a href="{@docRoot}guide/components/activities.html">Activities</a>
+developer guide.</p>
+</dd>
+
+
+<dt><b>Services</b></dt>
+
+<dd>A <i>service</i> is a component that runs in the background to perform long-running
+operations or to perform work for remote processes. A service
+does not provide a user interface. For example, a service might play music in the background while
+the user is in a different application, or it might fetch data over the network without
+blocking user interaction with an activity. Another component, such as an activity, can start the
+service and let it run or bind to it in order to interact with it.
+
+<p>A service is implemented as a subclass of {@link android.app.Service} and you can learn more
+about it in the <a href="{@docRoot}guide/components/services.html">Services</a> developer
+guide.</p>
+</dd>
+
+
+<dt><b>Content providers</b></dt>
+
+<dd>A <i>content provider</i> manages a shared set of application data. You can store the data in
+the file system, an SQLite database, on the web, or any other persistent storage location your
+application can access. Through the content provider, other applications can query or even modify
+the data (if the content provider allows it). For example, the Android system provides a content
+provider that manages the user's contact information. As such, any application with the proper
+permissions can query part of the content provider (such as {@link
+android.provider.ContactsContract.Data}) to read and write information about a particular person.
+
+<p>Content providers are also useful for reading and writing data that is private to your
+application and not shared. For example, the <a
+href="{@docRoot}resources/samples/NotePad/index.html">Note Pad</a> sample application uses a
+content provider to save notes.</p>
+
+<p>A content provider is implemented as a subclass of {@link android.content.ContentProvider}
+and must implement a standard set of APIs that enable other applications to perform
+transactions. For more information, see the <a
+href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a> developer
+guide.</p>
+</dd>
+
+
+<dt><b>Broadcast receivers</b></dt>
+
+<dd>A <i>broadcast receiver</i> is a component that responds to system-wide broadcast
+announcements. Many broadcasts originate from the system—for example, a broadcast announcing
+that the screen has turned off, the battery is low, or a picture was captured.
+Applications can also initiate broadcasts—for example, to let other applications know that
+some data has been downloaded to the device and is available for them to use. Although broadcast
+receivers don't display a user interface, they may <a
+href="{@docRoot}guide/topics/ui/notifiers/notifications.html">create a status bar notification</a>
+to alert the user when a broadcast event occurs. More commonly, though, a broadcast receiver is
+just a "gateway" to other components and is intended to do a very minimal amount of work. For
+instance, it might initiate a service to perform some work based on the event.
+
+<p>A broadcast receiver is implemented as a subclass of {@link android.content.BroadcastReceiver}
+and each broadcast is delivered as an {@link android.content.Intent} object. For more information,
+see the {@link android.content.BroadcastReceiver} class.</p>
+</dd>
+
+</dl>
+
+
+
+<p>A unique aspect of the Android system design is that any application can start another
+application’s component. For example, if you want the user to capture a
+photo with the device camera, there's probably another application that does that and your
+application can use it, instead of developing an activity to capture a photo yourself. You don't
+need to incorporate or even link to the code from the camera application.
+Instead, you can simply start the activity in the camera application that captures a
+photo. When complete, the photo is even returned to your application so you can use it. To the user,
+it seems as if the camera is actually a part of your application.</p>
+
+<p>When the system starts a component, it starts the process for that application (if it's not
+already running) and instantiates the classes needed for the component. For example, if your
+application starts the activity in the camera application that captures a photo, that activity
+runs in the process that belongs to the camera application, not in your application's process.
+Therefore, unlike applications on most other systems, Android applications don't have a single entry
+point (there's no {@code main()} function, for example).</p>
+
+<p>Because the system runs each application in a separate process with file permissions that
+restrict access to other applications, your application cannot directly activate a component from
+another application. The Android system, however, can. So, to activate a component in
+another application, you must deliver a message to the system that specifies your <em>intent</em> to
+start a particular component. The system then activates the component for you.</p>
+
+
+<h3 id="ActivatingComponents">Activating Components</h3>
+
+<p>Three of the four component types—activities, services, and
+broadcast receivers—are activated by an asynchronous message called an <em>intent</em>.
+Intents bind individual components to each other at runtime (you can think of them
+as the messengers that request an action from other components), whether the component belongs
+to your application or another.</p>
+
+<p>An intent is created with an {@link android.content.Intent} object, which defines a message to
+activate either a specific component or a specific <em>type</em> of component—an intent
+can be either explicit or implicit, respectively.</p>
+
+<p>For activities and services, an intent defines the action to perform (for example, to "view" or
+"send" something) and may specify the URI of the data to act on (among other things that the
+component being started might need to know). For example, an intent might convey a request for an
+activity to show an image or to open a web page. In some cases, you can start an
+activity to receive a result, in which case, the activity also returns
+the result in an {@link android.content.Intent} (for example, you can issue an intent to let
+the user pick a personal contact and have it returned to you—the return intent includes a
+URI pointing to the chosen contact).</p>
+
+<p>For broadcast receivers, the intent simply defines the
+announcement being broadcast (for example, a broadcast to indicate the device battery is low
+includes only a known action string that indicates "battery is low").</p>
+
+<p>The other component type, content provider, is not activated by intents. Rather, it is
+activated when targeted by a request from a {@link android.content.ContentResolver}. The content
+resolver handles all direct transactions with the content provider so that the component that's
+performing transactions with the provider doesn't need to and instead calls methods on the {@link
+android.content.ContentResolver} object. This leaves a layer of abstraction between the content
+provider and the component requesting information (for security).</p>
+
+<p>There are separate methods for activating each type of component:</p>
+<ul>
+ <li>You can start an activity (or give it something new to do) by
+passing an {@link android.content.Intent} to {@link android.content.Context#startActivity
+startActivity()} or {@link android.app.Activity#startActivityForResult startActivityForResult()}
+(when you want the activity to return a result).</li>
+ <li>You can start a service (or give new instructions to an ongoing service) by
+passing an {@link android.content.Intent} to {@link android.content.Context#startService
+startService()}. Or you can bind to the service by passing an {@link android.content.Intent} to
+{@link android.content.Context#bindService bindService()}.</li>
+ <li>You can initiate a broadcast by passing an {@link android.content.Intent} to methods like
+{@link android.content.Context#sendBroadcast(Intent) sendBroadcast()}, {@link
+android.content.Context#sendOrderedBroadcast(Intent, String) sendOrderedBroadcast()}, or {@link
+android.content.Context#sendStickyBroadcast sendStickyBroadcast()}.</li>
+ <li>You can perform a query to a content provider by calling {@link
+android.content.ContentProvider#query query()} on a {@link android.content.ContentResolver}.</li>
+</ul>
+
+<p>For more information about using intents, see the <a
+href="{@docRoot}guide/components/intents-filters.html">Intents and
+Intent Filters</a> document. More information about activating specific components is also provided
+in the following documents: <a
+href="{@docRoot}guide/components/activities.html">Activities</a>, <a
+href="{@docRoot}guide/components/services.html">Services</a>, {@link
+android.content.BroadcastReceiver} and <a
+href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.</p>
+
+
+<h2 id="Manifest">The Manifest File</h2>
+
+<p>Before the Android system can start an application component, the system must know that the
+component exists by reading the application's {@code AndroidManifest.xml} file (the "manifest"
+file). Your application must declare all its components in this file, which must be at the root of
+the application project directory.</p>
+
+<p>The manifest does a number of things in addition to declaring the application's components,
+such as:</p>
+<ul>
+ <li>Identify any user permissions the application requires, such as Internet access or
+read-access to the user's contacts.</li>
+ <li>Declare the minimum <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Level</a>
+required by the application, based on which APIs the application uses.</li>
+ <li>Declare hardware and software features used or required by the application, such as a camera,
+bluetooth services, or a multitouch screen.</li>
+ <li>API libraries the application needs to be linked against (other than the Android framework
+APIs), such as the <a
+href="http://code.google.com/android/add-ons/google-apis/maps-overview.html">Google Maps
+library</a>.</li>
+ <li>And more</li>
+</ul>
+
+
+<h3 id="DeclaringComponents">Declaring components</h3>
+
+<p>The primary task of the manifest is to inform the system about the application's components. For
+example, a manifest file can declare an activity as follows: </p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<manifest ... >
+ <application android:icon="@drawable/app_icon.png" ... >
+ <activity android:name="com.example.project.ExampleActivity"
+ android:label="@string/example_label" ... >
+ </activity>
+ ...
+ </application>
+</manifest></pre>
+
+<p>In the <code><a
+href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code>
+element, the {@code android:icon} attribute points to resources for an icon that identifies the
+application.</p>
+
+<p>In the <code><a
+href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> element,
+the {@code android:name} attribute specifies the fully qualified class name of the {@link
+android.app.Activity} subclass and the {@code android:label} attributes specifies a string
+to use as the user-visible label for the activity.</p>
+
+<p>You must declare all application components this way:</p>
+<ul>
+ <li><code><a
+href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> elements
+for activities</li>
+ <li><code><a
+href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code> elements for
+services</li>
+ <li><code><a
+href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code> elements
+for broadcast receivers</li>
+ <li><code><a
+href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code> elements
+for content providers</li>
+</ul>
+
+<p>Activities, services, and content providers that you include in your source but do not declare
+in the manifest are not visible to the system and, consequently, can never run. However,
+broadcast
+receivers can be either declared in the manifest or created dynamically in code (as
+{@link android.content.BroadcastReceiver} objects) and registered with the system by calling
+{@link android.content.Context#registerReceiver registerReceiver()}.</p>
+
+<p>For more about how to structure the manifest file for your application, see the <a
+href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a>
+documentation. </p>
+
+
+
+<h3 id="DeclaringComponentCapabilities">Declaring component capabilities</h3>
+
+<p>As discussed above, in <a href="#ActivatingComponents">Activating Components</a>, you can use an
+{@link android.content.Intent} to start activities, services, and broadcast receivers. You can do so
+by explicitly naming the target component (using the component class name) in the intent. However,
+the real power of intents lies in the concept of intent actions. With intent actions, you simply
+describe the type of action you want to perform (and optionally, the data upon which you’d like to
+perform the action) and allow the system to find a component on the device that can perform the
+action and start it. If there are multiple components that can perform the action described by the
+intent, then the user selects which one to use.</p>
+
+<p>The way the system identifies the components that can respond to an intent is by comparing the
+intent received to the <i>intent filters</i> provided in the manifest file of other applications on
+the device.</p>
+
+<p>When you declare a component in your application's manifest, you can optionally include
+intent filters that declare the capabilities of the component so it can respond to intents
+from other applications. You can declare an intent filter for your component by
+adding an <a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">{@code
+<intent-filter>}</a> element as a child of the component's declaration element.</p>
+
+<p>For example, an email application with an activity for composing a new email might declare an
+intent filter in its manifest entry to respond to "send" intents (in order to send email). An
+activity in your application can then create an intent with the “send” action ({@link
+android.content.Intent#ACTION_SEND}), which the system matches to the email application’s “send”
+activity and launches it when you invoke the intent with {@link android.app.Activity#startActivity
+startActivity()}.</p>
+
+<p>For more about creating intent filters, see the <a
+href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a> document.
+</p>
+
+
+
+<h3 id="DeclaringRequirements">Declaring application requirements</h3>
+
+<p>There are a variety of devices powered by Android and not all of them provide the
+same features and capabilities. In order to prevent your application from being installed on devices
+that lack features needed by your application, it's important that you clearly define a profile for
+the types of devices your application supports by declaring device and software requirements in your
+manifest file. Most of these declarations are informational only and the system does not read
+them, but external services such as Google Play do read them in order to provide filtering
+for users when they search for applications from their device.</p>
+
+<p>For example, if your application requires a camera and uses APIs introduced in Android 2.1 (<a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Level</a> 7), you should declare these as
+requirements in your manifest file. That way, devices that do <em>not</em> have a camera and have an
+Android version <em>lower</em> than 2.1 cannot install your application from Google Play.</p>
+
+<p>However, you can also declare that your application uses the camera, but does not
+<em>require</em> it. In that case, your application must perform a check at runtime to determine
+if the device has a camera and disable any features that use the camera if one is not available.</p>
+
+<p>Here are some of the important device characteristics that you should consider as you design and
+develop your application:</p>
+
+<dl>
+ <dt>Screen size and density</dt>
+ <dd>In order to categorize devices by their screen type, Android defines two characteristics for
+each device: screen size (the physical dimensions of the screen) and screen density (the physical
+density of the pixels on the screen, or dpi—dots per inch). To simplify all the different
+types of screen configurations, the Android system generalizes them into select groups that make
+them easier to target.
+<p>The screen sizes are: small, normal, large, and extra large.<br/>
+The screen densities are: low density, medium density, high density, and extra high density.</p>
+
+<p>By default, your application is compatible with all screen sizes and densities,
+because the Android system makes the appropriate adjustments to your UI layout and image
+resources. However, you should create specialized layouts for certain screen sizes and provide
+specialized images for certain densities, using alternative layout resources, and by declaring in
+your manifest exactly which screen sizes your application supports with the <a
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
+<supports-screens>}</a> element.</p>
+<p>For more information, see the <a
+href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>
+document.</p></dd>
+
+ <dt>Input configurations</dt>
+ <dd>Many devices provide a different type of user input mechanism, such as a hardware keyboard, a
+trackball, or a five-way navigation pad. If your application requires a particular kind of input
+hardware, then you should declare it in your manifest with the <a
+href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">{@code
+<uses-configuration>}</a> element. However, it is rare that an application should require
+a certain input configuration.</dd>
+
+ <dt>Device features</dt>
+ <dd>There are many hardware and software features that may or may not exist on a given
+Android-powered device, such as a camera, a light sensor, bluetooth, a certain
+version of OpenGL, or the fidelity of the touchscreen. You should never assume that a certain
+feature is available on all Android-powered devices (other than the availability of the standard
+Android library), so you should declare any features used by your application with the <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
+element.</dd>
+
+ <dt>Platform Version</dt>
+ <dd>Different Android-powered devices often run different versions of the Android platform,
+such as Android 1.6 or Android 2.3. Each successive version often includes additional APIs not
+available in the previous version. In order to indicate which set of APIs are available, each
+platform version specifies an <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Level</a> (for example, Android 1.0 is API Level
+1 and Android 2.3 is API Level 9). If you use any APIs that were added to the platform after
+version 1.0, you should declare the minimum API Level in which those APIs were introduced using the
+<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a>
+element.</dd>
+</dl>
+
+<p>It's important that you declare all such requirements for your application, because, when you
+distribute your application on Google Play, the store uses these declarations to filter which
+applications are available on each device. As such, your application should be available only to
+devices that meet all your application requirements.</p>
+
+<p>For more information about how Google Play filters applications based on these (and other)
+requirements, see the <a href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a>
+document.</p>
+
+
+
+<h2 id="Resources">Application Resources</h2>
+
+<p>An Android application is composed of more than just code—it requires resources that are
+separate from the source code, such as images, audio files, and anything relating to the visual
+presentation of the application. For example, you should define animations, menus, styles, colors,
+and the layout of activity user interfaces with XML files. Using application resources makes it easy
+to update various characteristics of your application without modifying code and—by providing
+sets of alternative resources—enables you to optimize your application for a variety of
+device configurations (such as different languages and screen sizes).</p>
+
+<p>For every resource that you include in your Android project, the SDK build tools define a unique
+integer ID, which you can use to reference the resource from your application code or from
+other resources defined in XML. For example, if your application contains an image file named {@code
+logo.png} (saved in the {@code res/drawable/} directory), the SDK tools generate a resource ID
+named {@code R.drawable.logo}, which you can use to reference the image and insert it in your
+user interface.</p>
+
+<p>One of the most important aspects of providing resources separate from your source code
+is the ability for you to provide alternative resources for different device
+configurations. For example, by defining UI strings in XML, you can translate the strings into other
+languages and save those strings in separate files. Then, based on a language <em>qualifier</em>
+that you append to the resource directory's name (such as {@code res/values-fr/} for French string
+values) and the user's language setting, the Android system applies the appropriate language strings
+to your UI.</p>
+
+<p>Android supports many different <em>qualifiers</em> for your alternative resources. The
+qualifier is a short string that you include in the name of your resource directories in order to
+define the device configuration for which those resources should be used. As another
+example, you should often create different layouts for your activities, depending on the
+device's screen orientation and size. For example, when the device screen is in portrait
+orientation (tall), you might want a layout with buttons to be vertical, but when the screen is in
+landscape orientation (wide), the buttons should be aligned horizontally. To change the layout
+depending on the orientation, you can define two different layouts and apply the appropriate
+qualifier to each layout's directory name. Then, the system automatically applies the appropriate
+layout depending on the current device orientation.</p>
+
+<p>For more about the different kinds of resources you can include in your application and how
+to create alternative resources for various device configurations, see the <a
+href="{@docRoot}guide/topics/resources/index.html">Application Resources</a> developer guide.</p>
+
+
+<!--
+<h2>Beginner's Path</h2>
+
+<p>For a close look at implementing activities—the components your users use to
+interact with your application—continue with the <b><a
+href="{@docRoot}guide/components/activities.html">Activities</a></b> document.</p>
+-->
diff --git a/docs/html/guide/components/index.jd b/docs/html/guide/components/index.jd
new file mode 100644
index 0000000..87bae53
--- /dev/null
+++ b/docs/html/guide/components/index.jd
@@ -0,0 +1,56 @@
+page.title=App Components
+page.landing=true
+page.landing.intro=Android's application framework lets you create extremely rich and innovative apps using a set of reusable components. This section explains how Android apps work and how you use components to build them.
+page.landing.image=images/develop/app_components.png
+
+@jd:body
+
+<div class="landing-docs">
+
+ <div class="col-6">
+ <h3>Blog Articles</h3>
+
+ <a href="http://android-developers.blogspot.com/2012/05/using-dialogfragments.html">
+ <h4>Using DialogFragments</h4>
+ <p>In this post, I’ll show how to use DialogFragments with the v4 support library (for backward compatibility on pre-Honeycomb devices) to show a simple edit dialog and return a result to the calling Activity using an interface.</p>
+ </a>
+
+ <a href="http://android-developers.blogspot.com/2011/03/fragments-for-all.html">
+ <h4>Fragments For All</h4>
+ <p>Today we’ve released a static library that exposes the same Fragments API (as well as the new LoaderManager and a few other classes) so that applications compatible with Android 1.6 or later can use fragments to create tablet-compatible user interfaces. </p>
+ </a>
+
+ <a
+href="http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html">
+ <h4>Multithreading for Performance</h4>
+ <p>A good practice in creating responsive applications is to make sure your main UI thread
+does the minimum amount of work. Any potentially long task that may hang your application should be
+handled in a different thread.</p>
+ </a>
+ </div>
+
+ <div class="col-6">
+ <h3>Training</h3>
+
+ <a href="http://developer.android.com/training/basics/activity-lifecycle/index.html">
+ <h4>Managing the Activity Lifecycle</h4>
+ <p>This class explains important lifecycle callback methods that each Activity
+ instance receives and how you can use them so your activity does what the user expects and does not consume system
+ resources when your activity doesn't need them.</p>
+ </a>
+
+ <a href="http://developer.android.com/training/basics/fragments/index.html">
+ <h4>Building a Dynamic UI with Fragments</h4>
+ <p>This class shows you how to create a dynamic user experience with fragments and optimize
+your app's user experience for devices with different screen sizes, all while continuing to support
+devices running versions as old as Android 1.6.</p>
+ </a>
+
+ <a href="http://developer.android.com/training/sharing/index.html">
+ <h4>Sharing Content</h4>
+ <p>This class covers some common ways you can send and receive content between
+ applications using Intent APIs and the ActionProvider object.</p>
+ </a>
+ </div>
+
+</div>
diff --git a/docs/html/guide/topics/intents/intents-filters.jd b/docs/html/guide/components/intents-filters.jd
similarity index 100%
rename from docs/html/guide/topics/intents/intents-filters.jd
rename to docs/html/guide/components/intents-filters.jd
diff --git a/docs/html/guide/topics/fundamentals/loaders.jd b/docs/html/guide/components/loaders.jd
similarity index 100%
rename from docs/html/guide/topics/fundamentals/loaders.jd
rename to docs/html/guide/components/loaders.jd
diff --git a/docs/html/guide/components/processes-and-threads.jd b/docs/html/guide/components/processes-and-threads.jd
new file mode 100644
index 0000000..07a2667
--- /dev/null
+++ b/docs/html/guide/components/processes-and-threads.jd
@@ -0,0 +1,424 @@
+page.title=Processes and Threads
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>Quickview</h2>
+<ul>
+ <li>Every application runs in its own process and all components of the application run in that
+process, by default</li>
+ <li>Any slow, blocking operations in an activity should be done in a new thread, to avoid slowing
+down the user interface</li>
+</ul>
+
+<h2>In this document</h2>
+<ol>
+<li><a href="#Processes">Processes</a>
+ <ol>
+ <li><a href="#Lifecycle">Process lifecycle</a></li>
+ </ol>
+</li>
+<li><a href="#Threads">Threads</a>
+ <ol>
+ <li><a href="#WorkerThreads">Worker threads</a></li>
+ <li><a href="#ThreadSafe">Thread-safe methods</a></li>
+ </ol>
+</li>
+<li><a href="#IPC">Interprocess Communication</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>When an application component starts and the application does not have any other components
+running, the Android system starts a new Linux process for the application with a single thread of
+execution. By default, all components of the same application run in the same process and thread
+(called the "main" thread). If an application component starts and there already exists a process
+for that application (because another component from the application exists), then the component is
+started within that process and uses the same thread of execution. However, you can arrange for
+different components in your application to run in separate processes, and you can create additional
+threads for any process.</p>
+
+<p>This document discusses how processes and threads work in an Android application.</p>
+
+
+<h2 id="Processes">Processes</h2>
+
+<p>By default, all components of the same application run in the same process and most applications
+should not change this. However, if you find that you need to control which process a certain
+component belongs to, you can do so in the manifest file.</p>
+
+<p>The manifest entry for each type of component element—<a
+href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
+<activity>}</a>, <a href="{@docRoot}guide/topics/manifest/service-element.html">{@code
+<service>}</a>, <a href="{@docRoot}guide/topics/manifest/receiver-element.html">{@code
+<receiver>}</a>, and <a href="{@docRoot}guide/topics/manifest/provider-element.html">{@code
+<provider>}</a>—supports an {@code android:process} attribute that can specify a
+process in which that component should run. You can set this attribute so that each component runs
+in its own process or so that some components share a process while others do not. You can also set
+{@code android:process} so that components of different applications run in the same
+process—provided that the applications share the same Linux user ID and are signed with the
+same certificates.</p>
+
+<p>The <a href="{@docRoot}guide/topics/manifest/application-element.html">{@code
+<application>}</a> element also supports an {@code android:process} attribute, to set a
+default value that applies to all components.</p>
+
+<p>Android might decide to shut down a process at some point, when memory is low and required by
+other processes that are more immediately serving the user. Application
+components running in the process that's killed are consequently destroyed. A process is started
+again for those components when there's again work for them to do.</p>
+
+<p>When deciding which processes to kill, the Android system weighs their relative importance to
+the user. For example, it more readily shuts down a process hosting activities that are no longer
+visible on screen, compared to a process hosting visible activities. The decision whether to
+terminate a process, therefore, depends on the state of the components running in that process. The
+rules used to decide which processes to terminate is discussed below. </p>
+
+
+<h3 id="Lifecycle">Process lifecycle</h3>
+
+<p>The Android system tries to maintain an application process for as long as possible, but
+eventually needs to remove old processes to reclaim memory for new or more important processes. To
+determine which processes to keep
+and which to kill, the system places each process into an "importance hierarchy" based on the
+components running in the process and the state of those components. Processes with the lowest
+importance are eliminated first, then those with the next lowest importance, and so on, as necessary
+to recover system resources.</p>
+
+<p>There are five levels in the importance hierarchy. The following list presents the different
+types of processes in order of importance (the first process is <em>most important</em> and is
+<em>killed last</em>):</p>
+
+<ol>
+ <li><b>Foreground process</b>
+ <p>A process that is required for what the user is currently doing. A
+ process is considered to be in the foreground if any of the following conditions are true:</p>
+
+ <ul>
+ <li>It hosts an {@link android.app.Activity} that the user is interacting with (the {@link
+android.app.Activity}'s {@link android.app.Activity#onResume onResume()} method has been
+called).</li>
+
+ <li>It hosts a {@link android.app.Service} that's bound to the activity that the user is
+interacting with.</li>
+
+ <li>It hosts a {@link android.app.Service} that's running "in the foreground"—the
+service has called {@link android.app.Service#startForeground startForeground()}.
+
+ <li>It hosts a {@link android.app.Service} that's executing one of its lifecycle
+callbacks ({@link android.app.Service#onCreate onCreate()}, {@link android.app.Service#onStart
+onStart()}, or {@link android.app.Service#onDestroy onDestroy()}).</li>
+
+ <li>It hosts a {@link android.content.BroadcastReceiver} that's executing its {@link
+ android.content.BroadcastReceiver#onReceive onReceive()} method.</li>
+ </ul>
+
+ <p>Generally, only a few foreground processes exist at any given time. They are killed only as
+a last resort—if memory is so low that they cannot all continue to run. Generally, at that
+point, the device has reached a memory paging state, so killing some foreground processes is
+required to keep the user interface responsive.</p></li>
+
+ <li><b>Visible process</b>
+ <p>A process that doesn't have any foreground components, but still can
+ affect what the user sees on screen. A process is considered to be visible if either of the
+ following conditions are true:</p>
+
+ <ul>
+ <li>It hosts an {@link android.app.Activity} that is not in the foreground, but is still
+visible to the user (its {@link android.app.Activity#onPause onPause()} method has been called).
+This might occur, for example, if the foreground activity started a dialog, which allows the
+previous activity to be seen behind it.</li>
+
+ <li>It hosts a {@link android.app.Service} that's bound to a visible (or foreground)
+activity.</li>
+ </ul>
+
+ <p>A visible process is considered extremely important and will not be killed unless doing so
+is required to keep all foreground processes running. </p>
+ </li>
+
+ <li><b>Service process</b>
+ <p>A process that is running a service that has been started with the {@link
+android.content.Context#startService startService()} method and does not fall into either of the two
+higher categories. Although service processes are not directly tied to anything the user sees, they
+are generally doing things that the user cares about (such as playing music in the background or
+downloading data on the network), so the system keeps them running unless there's not enough memory
+to retain them along with all foreground and visible processes. </p>
+ </li>
+
+ <li><b>Background process</b>
+ <p>A process holding an activity that's not currently visible to the user (the activity's
+{@link android.app.Activity#onStop onStop()} method has been called). These processes have no direct
+impact on the user experience, and the system can kill them at any time to reclaim memory for a
+foreground,
+visible, or service process. Usually there are many background processes running, so they are kept
+in an LRU (least recently used) list to ensure that the process with the activity that was most
+recently seen by the user is the last to be killed. If an activity implements its lifecycle methods
+correctly, and saves its current state, killing its process will not have a visible effect on
+the user experience, because when the user navigates back to the activity, the activity restores
+all of its visible state. See the <a
+href="{@docRoot}guide/components/activities.html#SavingActivityState">Activities</a>
+document for information about saving and restoring state.</p>
+ </li>
+
+ <li><b>Empty process</b>
+ <p>A process that doesn't hold any active application components. The only reason to keep this
+kind of process alive is for caching purposes, to improve startup time the next time a component
+needs to run in it. The system often kills these processes in order to balance overall system
+resources between process caches and the underlying kernel caches.</p>
+ </li>
+</ol>
+
+
+ <p>Android ranks a process at the highest level it can, based upon the importance of the
+components currently active in the process. For example, if a process hosts a service and a visible
+activity, the process is ranked as a visible process, not a service process.</p>
+
+ <p>In addition, a process's ranking might be increased because other processes are dependent on
+it—a process that is serving another process can never be ranked lower than the process it is
+serving. For example, if a content provider in process A is serving a client in process B, or if a
+service in process A is bound to a component in process B, process A is always considered at least
+as important as process B.</p>
+
+ <p>Because a process running a service is ranked higher than a process with background activities,
+an activity that initiates a long-running operation might do well to start a <a
+href="{@docRoot}guide/components/services.html">service</a> for that operation, rather than
+simply create a worker thread—particularly if the operation will likely outlast the activity.
+For example, an activity that's uploading a picture to a web site should start a service to perform
+the upload so that the upload can continue in the background even if the user leaves the activity.
+Using a service guarantees that the operation will have at least "service process" priority,
+regardless of what happens to the activity. This is the same reason that broadcast receivers should
+employ services rather than simply put time-consuming operations in a thread.</p>
+
+
+
+
+<h2 id="Threads">Threads</h2>
+
+<p>When an application is launched, the system creates a thread of execution for the application,
+called "main." This thread is very important because it is in charge of dispatching events to
+the appropriate user interface widgets, including drawing events. It is also the thread in which
+your application interacts with components from the Android UI toolkit (components from the {@link
+android.widget} and {@link android.view} packages). As such, the main thread is also sometimes
+called the UI thread.</p>
+
+<p>The system does <em>not</em> create a separate thread for each instance of a component. All
+components that run in the same process are instantiated in the UI thread, and system calls to
+each component are dispatched from that thread. Consequently, methods that respond to system
+callbacks (such as {@link android.view.View#onKeyDown onKeyDown()} to report user actions
+or a lifecycle callback method) always run in the UI thread of the process.</p>
+
+<p>For instance, when the user touches a button on the screen, your app's UI thread dispatches the
+touch event to the widget, which in turn sets its pressed state and posts an invalidate request to
+the event queue. The UI thread dequeues the request and notifies the widget that it should redraw
+itself.</p>
+
+<p>When your app performs intensive work in response to user interaction, this single thread model
+can yield poor performance unless you implement your application properly. Specifically, if
+everything is happening in the UI thread, performing long operations such as network access or
+database queries will block the whole UI. When the thread is blocked, no events can be dispatched,
+including drawing events. From the user's perspective, the
+application appears to hang. Even worse, if the UI thread is blocked for more than a few seconds
+(about 5 seconds currently) the user is presented with the infamous "<a
+href="http://developer.android.com/guide/practices/responsiveness.html">application not
+responding</a>" (ANR) dialog. The user might then decide to quit your application and uninstall it
+if they are unhappy.</p>
+
+<p>Additionally, the Andoid UI toolkit is <em>not</em> thread-safe. So, you must not manipulate
+your UI from a worker thread—you must do all manipulation to your user interface from the UI
+thread. Thus, there are simply two rules to Android's single thread model:</p>
+
+<ol>
+<li>Do not block the UI thread
+<li>Do not access the Android UI toolkit from outside the UI thread
+</ol>
+
+<h3 id="WorkerThreads">Worker threads</h3>
+
+<p>Because of the single thread model described above, it's vital to the responsiveness of your
+application's UI that you do not block the UI thread. If you have operations to perform
+that are not instantaneous, you should make sure to do them in separate threads ("background" or
+"worker" threads).</p>
+
+<p>For example, below is some code for a click listener that downloads an image from a separate
+thread and displays it in an {@link android.widget.ImageView}:</p>
+
+<pre>
+public void onClick(View v) {
+ new Thread(new Runnable() {
+ public void run() {
+ Bitmap b = loadImageFromNetwork("http://example.com/image.png");
+ mImageView.setImageBitmap(b);
+ }
+ }).start();
+}
+</pre>
+
+<p>At first, this seems to work fine, because it creates a new thread to handle the network
+operation. However, it violates the second rule of the single-threaded model: <em>do not access the
+Android UI toolkit from outside the UI thread</em>—this sample modifies the {@link
+android.widget.ImageView} from the worker thread instead of the UI thread. This can result in
+undefined and unexpected behavior, which can be difficult and time-consuming to track down.</p>
+
+<p>To fix this problem, Android offers several ways to access the UI thread from other
+threads. Here is a list of methods that can help:</p>
+
+<ul>
+<li>{@link android.app.Activity#runOnUiThread(java.lang.Runnable)
+Activity.runOnUiThread(Runnable)}</li>
+<li>{@link android.view.View#post(java.lang.Runnable) View.post(Runnable)}</li>
+<li>{@link android.view.View#postDelayed(java.lang.Runnable, long) View.postDelayed(Runnable,
+long)}</li>
+</ul>
+
+<p>For example, you can fix the above code by using the {@link
+android.view.View#post(java.lang.Runnable) View.post(Runnable)} method:</p>
+
+<pre>
+public void onClick(View v) {
+ new Thread(new Runnable() {
+ public void run() {
+ final Bitmap bitmap = loadImageFromNetwork("http://example.com/image.png");
+ mImageView.post(new Runnable() {
+ public void run() {
+ mImageView.setImageBitmap(bitmap);
+ }
+ });
+ }
+ }).start();
+}
+</pre>
+
+<p>Now this implementation is thread-safe: the network operation is done from a separate thread
+while the {@link android.widget.ImageView} is manipulated from the UI thread.</p>
+
+<p>However, as the complexity of the operation grows, this kind of code can get complicated and
+difficult to maintain. To handle more complex interactions with a worker thread, you might consider
+using a {@link android.os.Handler} in your worker thread, to process messages delivered from the UI
+thread. Perhaps the best solution, though, is to extend the {@link android.os.AsyncTask} class,
+which simplifies the execution of worker thread tasks that need to interact with the UI.</p>
+
+
+<h4 id="AsyncTask">Using AsyncTask</h4>
+
+<p>{@link android.os.AsyncTask} allows you to perform asynchronous work on your user
+interface. It performs the blocking operations in a worker thread and then publishes the results on
+the UI thread, without requiring you to handle threads and/or handlers yourself.</p>
+
+<p>To use it, you must subclass {@link android.os.AsyncTask} and implement the {@link
+android.os.AsyncTask#doInBackground doInBackground()} callback method, which runs in a pool of
+background threads. To update your UI, you should implement {@link
+android.os.AsyncTask#onPostExecute onPostExecute()}, which delivers the result from {@link
+android.os.AsyncTask#doInBackground doInBackground()} and runs in the UI thread, so you can safely
+update your UI. You can then run the task by calling {@link android.os.AsyncTask#execute execute()}
+from the UI thread.</p>
+
+<p>For example, you can implement the previous example using {@link android.os.AsyncTask} this
+way:</p>
+
+<pre>
+public void onClick(View v) {
+ new DownloadImageTask().execute("http://example.com/image.png");
+}
+
+private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
+ /** The system calls this to perform work in a worker thread and
+ * delivers it the parameters given to AsyncTask.execute() */
+ protected Bitmap doInBackground(String... urls) {
+ return loadImageFromNetwork(urls[0]);
+ }
+
+ /** The system calls this to perform work in the UI thread and delivers
+ * the result from doInBackground() */
+ protected void onPostExecute(Bitmap result) {
+ mImageView.setImageBitmap(result);
+ }
+}
+</pre>
+
+<p>Now the UI is safe and the code is simpler, because it separates the work into the
+part that should be done on a worker thread and the part that should be done on the UI thread.</p>
+
+<p>You should read the {@link android.os.AsyncTask} reference for a full understanding on
+how to use this class, but here is a quick overview of how it works:</p>
+
+<ul>
+<li>You can specify the type of the parameters, the progress values, and the final
+value of the task, using generics</li>
+<li>The method {@link android.os.AsyncTask#doInBackground doInBackground()} executes automatically
+on a worker thread</li>
+<li>{@link android.os.AsyncTask#onPreExecute onPreExecute()}, {@link
+android.os.AsyncTask#onPostExecute onPostExecute()}, and {@link
+android.os.AsyncTask#onProgressUpdate onProgressUpdate()} are all invoked on the UI thread</li>
+<li>The value returned by {@link android.os.AsyncTask#doInBackground doInBackground()} is sent to
+{@link android.os.AsyncTask#onPostExecute onPostExecute()}</li>
+<li>You can call {@link android.os.AsyncTask#publishProgress publishProgress()} at anytime in {@link
+android.os.AsyncTask#doInBackground doInBackground()} to execute {@link
+android.os.AsyncTask#onProgressUpdate onProgressUpdate()} on the UI thread</li>
+<li>You can cancel the task at any time, from any thread</li>
+</ul>
+
+<p class="caution"><strong>Caution:</strong> Another problem you might encounter when using a worker
+thread is unexpected restarts in your activity due to a <a
+href="{@docRoot}guide/topics/resources/runtime-changes.html">runtime configuration change</a>
+(such as when the user changes the screen orientation), which may destroy your worker thread. To
+see how you can persist your task during one of these restarts and how to properly cancel the task
+when the activity is destroyed, see the source code for the <a
+href="http://code.google.com/p/shelves/">Shelves</a> sample application.</p>
+
+
+<h3 id="ThreadSafe">Thread-safe methods</h3>
+
+<p> In some situations, the methods you implement might be called from more than one thread, and
+therefore must be written to be thread-safe. </p>
+
+<p>This is primarily true for methods that can be called remotely—such as methods in a <a
+href="{@docRoot}guide/components/bound-services.html">bound service</a>. When a call on a
+method implemented in an {@link android.os.IBinder} originates in the same process in which the
+{@link android.os.IBinder IBinder} is running, the method is executed in the caller's thread.
+However, when the call originates in another process, the method is executed in a thread chosen from
+a pool of threads that the system maintains in the same process as the {@link android.os.IBinder
+IBinder} (it's not executed in the UI thread of the process). For example, whereas a service's
+{@link android.app.Service#onBind onBind()} method would be called from the UI thread of the
+service's process, methods implemented in the object that {@link android.app.Service#onBind
+onBind()} returns (for example, a subclass that implements RPC methods) would be called from threads
+in the pool. Because a service can have more than one client, more than one pool thread can engage
+the same {@link android.os.IBinder IBinder} method at the same time. {@link android.os.IBinder
+IBinder} methods must, therefore, be implemented to be thread-safe.</p>
+
+<p> Similarly, a content provider can receive data requests that originate in other processes.
+Although the {@link android.content.ContentResolver} and {@link android.content.ContentProvider}
+classes hide the details of how the interprocess communication is managed, {@link
+android.content.ContentProvider} methods that respond to those requests—the methods {@link
+android.content.ContentProvider#query query()}, {@link android.content.ContentProvider#insert
+insert()}, {@link android.content.ContentProvider#delete delete()}, {@link
+android.content.ContentProvider#update update()}, and {@link android.content.ContentProvider#getType
+getType()}—are called from a pool of threads in the content provider's process, not the UI
+thread for the process. Because these methods might be called from any number of threads at the
+same time, they too must be implemented to be thread-safe. </p>
+
+
+<h2 id="IPC">Interprocess Communication</h2>
+
+<p>Android offers a mechanism for interprocess communication (IPC) using remote procedure calls
+(RPCs), in which a method is called by an activity or other application component, but executed
+remotely (in another process), with any result returned back to the
+caller. This entails decomposing a method call and its data to a level the operating system can
+understand, transmitting it from the local process and address space to the remote process and
+address space, then reassembling and reenacting the call there. Return values are then
+transmitted in the opposite direction. Android provides all the code to perform these IPC
+transactions, so you can focus on defining and implementing the RPC programming interface. </p>
+
+<p>To perform IPC, your application must bind to a service, using {@link
+android.content.Context#bindService bindService()}. For more information, see the <a
+href="{@docRoot}guide/components/services.html">Services</a> developer guide.</p>
+
+
+<!--
+<h2>Beginner's Path</h2>
+
+<p>For information about how to perform work in the background for an indefinite period of time
+(without a user interface), continue with the <b><a
+href="{@docRoot}guide/components/services.html">Services</a></b> document.</p>
+-->
diff --git a/docs/html/guide/components/services.jd b/docs/html/guide/components/services.jd
new file mode 100644
index 0000000..ba5e1f0
--- /dev/null
+++ b/docs/html/guide/components/services.jd
@@ -0,0 +1,874 @@
+page.title=Services
+@jd:body
+
+<div id="qv-wrapper">
+<ol id="qv">
+<h2>Quickview</h2>
+<ul>
+ <li>A service can run in the background to perform work even while the user is in a different
+application</li>
+ <li>A service can allow other components to bind to it, in order to interact with it and
+perform interprocess communication</li>
+ <li>A service runs in the main thread of the application that hosts it, by default</li>
+</ul>
+<h2>In this document</h2>
+<ol>
+<li><a href="#Basics">The Basics</a></li>
+<ol>
+ <li><a href="#Declaring">Declaring a service in the manifest</a></li>
+</ol>
+<li><a href="#CreatingAService">Creating a Started Service</a>
+ <ol>
+ <li><a href="#ExtendingIntentService">Extending the IntentService class</a></li>
+ <li><a href="#ExtendingService">Extending the Service class</a></li>
+ <li><a href="#StartingAService">Starting a service</a></li>
+ <li><a href="#Stopping">Stopping a service</a></li>
+ </ol>
+</li>
+<li><a href="#CreatingBoundService">Creating a Bound Service</a></li>
+<li><a href="#Notifications">Sending Notifications to the User</a></li>
+<li><a href="#Foreground">Running a Service in the Foreground</a></li>
+<li><a href="#Lifecycle">Managing the Lifecycle of a Service</a>
+<ol>
+ <li><a href="#LifecycleCallbacks">Implementing the lifecycle callbacks</a></li>
+</ol>
+</li>
+</ol>
+
+<h2>Key classes</h2>
+<ol>
+ <li>{@link android.app.Service}</li>
+ <li>{@link android.app.IntentService}</li>
+</ol>
+
+<h2>Samples</h2>
+<ol>
+ <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/ServiceStartArguments.html">{@code
+ ServiceStartArguments}</a></li>
+ <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html">{@code
+ LocalService}</a></li>
+</ol>
+
+<h2>Articles</h2>
+<ol>
+ <li><a href="{@docRoot}resources/articles/multitasking-android-way.html">Multitasking the Android Way</a></li>
+ <li><a href="{@docRoot}resources/articles/service-api-changes-starting-with.html">Service API changes starting
+ with Android 2.0</a></li>
+</ol>
+
+<h2>See also</h2>
+<ol>
+<li><a href="{@docRoot}guide/components/bound-services.html">Bound Services</a></li>
+</ol>
+
+</div>
+
+
+<p>A {@link android.app.Service} is an application component that can perform
+long-running operations in the background and does not provide a user interface. Another
+application component can start a service and it will continue to run in the background even if the
+user switches to another application. Additionally, a component can bind to a service to
+interact with it and even perform interprocess communication (IPC). For example, a service might
+handle network transactions, play music, perform file I/O, or interact with a content provider, all
+from the background.</p>
+
+<p>A service can essentially take two forms:</p>
+
+<dl>
+ <dt>Started</dt>
+ <dd>A service is "started" when an application component (such as an activity) starts it by
+calling {@link android.content.Context#startService startService()}. Once started, a service
+can run in the background indefinitely, even if the component that started it is destroyed. Usually,
+a started service performs a single operation and does not return a result to the caller.
+For example, it might download or upload a file over the network. When the operation is done, the
+service should stop itself.</dd>
+ <dt>Bound</dt>
+ <dd>A service is "bound" when an application component binds to it by calling {@link
+android.content.Context#bindService bindService()}. A bound service offers a client-server
+interface that allows components to interact with the service, send requests, get results, and even
+do so across processes with interprocess communication (IPC). A bound service runs only as long as
+another application component is bound to it. Multiple components can bind to the service at once,
+but when all of them unbind, the service is destroyed.</dd>
+</dl>
+
+<p>Although this documentation generally discusses these two types of services separately, your
+service can work both ways—it can be started (to run indefinitely) and also allow binding.
+It's simply a matter of whether you implement a couple callback methods: {@link
+android.app.Service#onStartCommand onStartCommand()} to allow components to start it and {@link
+android.app.Service#onBind onBind()} to allow binding.</p>
+
+<p>Regardless of whether your application is started, bound, or both, any application component
+can use the service (even from a separate application), in the same way that any component can use
+an activity—by starting it with an {@link android.content.Intent}. However, you can declare
+the service as private, in the manifest file, and block access from other applications. This is
+discussed more in the section about <a href="#Declaring">Declaring the service in the
+manifest</a>.</p>
+
+<p class="caution"><strong>Caution:</strong> A service runs in the
+main thread of its hosting process—the service does <strong>not</strong> create its own thread
+and does <strong>not</strong> run in a separate process (unless you specify otherwise). This means
+that, if your service is going to do any CPU intensive work or blocking operations (such as MP3
+playback or networking), you should create a new thread within the service to do that work. By using
+a separate thread, you will reduce the risk of Application Not Responding (ANR) errors and the
+application's main thread can remain dedicated to user interaction with your activities.</p>
+
+
+<h2 id="Basics">The Basics</h2>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <h3>Should you use a service or a thread?</h3>
+ <p>A service is simply a component that can run in the background even when the user is not
+interacting with your application. Thus, you should create a service only if that is what you
+need.</p>
+ <p>If you need to perform work outside your main thread, but only while the user is interacting
+with your application, then you should probably instead create a new thread and not a service. For
+example, if you want to play some music, but only while your activity is running, you might create
+a thread in {@link android.app.Activity#onCreate onCreate()}, start running it in {@link
+android.app.Activity#onStart onStart()}, then stop it in {@link android.app.Activity#onStop
+onStop()}. Also consider using {@link android.os.AsyncTask} or {@link android.os.HandlerThread},
+instead of the traditional {@link java.lang.Thread} class. See the <a
+href="{@docRoot}guide/components/processes-and-threads.html#Threads">Processes and
+Threading</a> document for more information about threads.</p>
+ <p>Remember that if you do use a service, it still runs in your application's main thread by
+default, so you should still create a new thread within the service if it performs intensive or
+blocking operations.</p>
+</div>
+</div>
+
+<p>To create a service, you must create a subclass of {@link android.app.Service} (or one
+of its existing subclasses). In your implementation, you need to override some callback methods that
+handle key aspects of the service lifecycle and provide a mechanism for components to bind to
+the service, if appropriate. The most important callback methods you should override are:</p>
+
+<dl>
+ <dt>{@link android.app.Service#onStartCommand onStartCommand()}</dt>
+ <dd>The system calls this method when another component, such as an activity,
+requests that the service be started, by calling {@link android.content.Context#startService
+startService()}. Once this method executes, the service is started and can run in the
+background indefinitely. If you implement this, it is your responsibility to stop the service when
+its work is done, by calling {@link android.app.Service#stopSelf stopSelf()} or {@link
+android.content.Context#stopService stopService()}. (If you only want to provide binding, you don't
+need to implement this method.)</dd>
+ <dt>{@link android.app.Service#onBind onBind()}</dt>
+ <dd>The system calls this method when another component wants to bind with the
+service (such as to perform RPC), by calling {@link android.content.Context#bindService
+bindService()}. In your implementation of this method, you must provide an interface that clients
+use to communicate with the service, by returning an {@link android.os.IBinder}. You must always
+implement this method, but if you don't want to allow binding, then you should return null.</dd>
+ <dt>{@link android.app.Service#onCreate()}</dt>
+ <dd>The system calls this method when the service is first created, to perform one-time setup
+procedures (before it calls either {@link android.app.Service#onStartCommand onStartCommand()} or
+{@link android.app.Service#onBind onBind()}). If the service is already running, this method is not
+called.</dd>
+ <dt>{@link android.app.Service#onDestroy()}</dt>
+ <dd>The system calls this method when the service is no longer used and is being destroyed.
+Your service should implement this to clean up any resources such as threads, registered
+listeners, receivers, etc. This is the last call the service receives.</dd>
+</dl>
+
+<p>If a component starts the service by calling {@link
+android.content.Context#startService startService()} (which results in a call to {@link
+android.app.Service#onStartCommand onStartCommand()}), then the service
+remains running until it stops itself with {@link android.app.Service#stopSelf()} or another
+component stops it by calling {@link android.content.Context#stopService stopService()}.</p>
+
+<p>If a component calls
+{@link android.content.Context#bindService bindService()} to create the service (and {@link
+android.app.Service#onStartCommand onStartCommand()} is <em>not</em> called), then the service runs
+only as long as the component is bound to it. Once the service is unbound from all clients, the
+system destroys it.</p>
+
+<p>The Android system will force-stop a service only when memory is low and it must recover system
+resources for the activity that has user focus. If the service is bound to an activity that has user
+focus, then it's less likely to be killed, and if the service is declared to <a
+href="#Foreground">run in the foreground</a> (discussed later), then it will almost never be killed.
+Otherwise, if the service was started and is long-running, then the system will lower its position
+in the list of background tasks over time and the service will become highly susceptible to
+killing—if your service is started, then you must design it to gracefully handle restarts
+by the system. If the system kills your service, it restarts it as soon as resources become
+available again (though this also depends on the value you return from {@link
+android.app.Service#onStartCommand onStartCommand()}, as discussed later). For more information
+about when the system might destroy a service, see the <a
+href="{@docRoot}guide/components/processes-and-threads.html">Processes and Threading</a>
+document.</p>
+
+<p>In the following sections, you'll see how you can create each type of service and how to use
+it from other application components.</p>
+
+
+
+<h3 id="Declaring">Declaring a service in the manifest</h3>
+
+<p>Like activities (and other components), you must declare all services in your application's
+manifest file.</p>
+
+<p>To declare your service, add a <a
+href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element
+as a child of the <a
+href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
+element. For example:</p>
+
+<pre>
+<manifest ... >
+ ...
+ <application ... >
+ <service android:name=".ExampleService" />
+ ...
+ </application>
+</manifest>
+</pre>
+
+<p>There are other attributes you can include in the <a
+href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element to
+define properties such as permissions required to start the service and the process in
+which the service should run. The <a
+href="{@docRoot}guide/topics/manifest/service-element.html#nm">{@code android:name}</a>
+attribute is the only required attribute—it specifies the class name of the service. Once
+you publish your application, you should not change this name, because if you do, you might break
+some functionality where explicit intents are used to reference your service (read the blog post, <a
+href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">Things
+That Cannot Change</a>).
+
+<p>See the <a
+href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element
+reference for more information about declaring your service in the manifest.</p>
+
+<p>Just like an activity, a service can define intent filters that allow other components to
+invoke the service using implicit intents. By declaring intent filters, components
+from any application installed on the user's device can potentially start your service if your
+service declares an intent filter that matches the intent another application passes to {@link
+android.content.Context#startService startService()}.</p>
+
+<p>If you plan on using your service only locally (other applications do not use it), then you
+don't need to (and should not) supply any intent filters. Without any intent filters, you must
+start the service using an intent that explicitly names the service class. More information
+about <a href="#StartingAService">starting a service</a> is discussed below.</p>
+
+<p>Additionally, you can ensure that your service is private to your application only if
+you include the <a
+href="{@docRoot}guide/topics/manifest/service-element.html#exported">{@code android:exported}</a>
+attribute and set it to {@code "false"}. This is effective even if your service supplies intent
+filters.</p>
+
+<p>For more information about creating intent filters for your service, see the <a
+href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
+document.</p>
+
+
+
+<h2 id="CreatingStartedService">Creating a Started Service</h2>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <h2>Targeting Android 1.6 or lower</h2>
+ <p>If you're building an application for Android 1.6 or lower, you need
+to implement {@link android.app.Service#onStart onStart()}, instead of {@link
+android.app.Service#onStartCommand onStartCommand()} (in Android 2.0,
+{@link android.app.Service#onStart onStart()} was deprecated in favor of {@link
+android.app.Service#onStartCommand onStartCommand()}).</p>
+ <p>For more information about providing compatibility with versions of Android older than 2.0, see
+the {@link android.app.Service#onStartCommand onStartCommand()} documentation.</p>
+</div>
+</div>
+
+<p>A started service is one that another component starts by calling {@link
+android.content.Context#startService startService()}, resulting in a call to the service's
+{@link android.app.Service#onStartCommand onStartCommand()} method.</p>
+
+<p>When a service is started, it has a lifecycle that's independent of the
+component that started it and the service can run in the background indefinitely, even if
+the component that started it is destroyed. As such, the service should stop itself when its job
+is done by calling {@link android.app.Service#stopSelf stopSelf()}, or another component can stop it
+by calling {@link android.content.Context#stopService stopService()}.</p>
+
+<p>An application component such as an activity can start the service by calling {@link
+android.content.Context#startService startService()} and passing an {@link android.content.Intent}
+that specifies the service and includes any data for the service to use. The service receives
+this {@link android.content.Intent} in the {@link android.app.Service#onStartCommand
+onStartCommand()} method.</p>
+
+<p>For instance, suppose an activity needs to save some data to an online database. The activity can
+start a companion service and deliver it the data to save by passing an intent to {@link
+android.content.Context#startService startService()}. The service receives the intent in {@link
+android.app.Service#onStartCommand onStartCommand()}, connects to the Internet and performs the
+database transaction. When the transaction is done, the service stops itself and it is
+destroyed.</p>
+
+<p class="caution"><strong>Caution:</strong> A services runs in the same process as the application
+in which it is declared and in the main thread of that application, by default. So, if your service
+performs intensive or blocking operations while the user interacts with an activity from the same
+application, the service will slow down activity performance. To avoid impacting application
+performance, you should start a new thread inside the service.</p>
+
+<p>Traditionally, there are two classes you can extend to create a started service:</p>
+<dl>
+ <dt>{@link android.app.Service}</dt>
+ <dd>This is the base class for all services. When you extend this class, it's important that
+you create a new thread in which to do all the service's work, because the service uses your
+application's main thread, by default, which could slow the performance of any activity your
+application is running.</dd>
+ <dt>{@link android.app.IntentService}</dt>
+ <dd>This is a subclass of {@link android.app.Service} that uses a worker thread to handle all
+start requests, one at a time. This is the best option if you don't require that your service
+handle multiple requests simultaneously. All you need to do is implement {@link
+android.app.IntentService#onHandleIntent onHandleIntent()}, which receives the intent for each
+start request so you can do the background work.</dd>
+</dl>
+
+<p>The following sections describe how you can implement your service using either one for these
+classes.</p>
+
+
+<h3 id="ExtendingIntentService">Extending the IntentService class</h3>
+
+<p>Because most started services don't need to handle multiple requests simultaneously
+(which can actually be a dangerous multi-threading scenario), it's probably best if you
+implement your service using the {@link android.app.IntentService} class.</p>
+
+<p>The {@link android.app.IntentService} does the following:</p>
+
+<ul>
+ <li>Creates a default worker thread that executes all intents delivered to {@link
+android.app.Service#onStartCommand onStartCommand()} separate from your application's main
+thread.</li>
+ <li>Creates a work queue that passes one intent at a time to your {@link
+android.app.IntentService#onHandleIntent onHandleIntent()} implementation, so you never have to
+worry about multi-threading.</li>
+ <li>Stops the service after all start requests have been handled, so you never have to call
+{@link android.app.Service#stopSelf}.</li>
+ <li>Provides default implementation of {@link android.app.IntentService#onBind onBind()} that
+returns null.</li>
+ <li>Provides a default implementation of {@link android.app.IntentService#onStartCommand
+onStartCommand()} that sends the intent to the work queue and then to your {@link
+android.app.IntentService#onHandleIntent onHandleIntent()} implementation.</li>
+</ul>
+
+<p>All this adds up to the fact that all you need to do is implement {@link
+android.app.IntentService#onHandleIntent onHandleIntent()} to do the work provided by the
+client. (Though, you also need to provide a small constructor for the service.)</p>
+
+<p>Here's an example implementation of {@link android.app.IntentService}:</p>
+
+<pre>
+public class HelloIntentService extends IntentService {
+
+ /**
+ * A constructor is required, and must call the super {@link android.app.IntentService#IntentService}
+ * constructor with a name for the worker thread.
+ */
+ public HelloIntentService() {
+ super("HelloIntentService");
+ }
+
+ /**
+ * The IntentService calls this method from the default worker thread with
+ * the intent that started the service. When this method returns, IntentService
+ * stops the service, as appropriate.
+ */
+ @Override
+ protected void onHandleIntent(Intent intent) {
+ // Normally we would do some work here, like download a file.
+ // For our sample, we just sleep for 5 seconds.
+ long endTime = System.currentTimeMillis() + 5*1000;
+ while (System.currentTimeMillis() < endTime) {
+ synchronized (this) {
+ try {
+ wait(endTime - System.currentTimeMillis());
+ } catch (Exception e) {
+ }
+ }
+ }
+ }
+}
+</pre>
+
+<p>That's all you need: a constructor and an implementation of {@link
+android.app.IntentService#onHandleIntent onHandleIntent()}.</p>
+
+<p>If you decide to also override other callback methods, such as {@link
+android.app.IntentService#onCreate onCreate()}, {@link
+android.app.IntentService#onStartCommand onStartCommand()}, or {@link
+android.app.IntentService#onDestroy onDestroy()}, be sure to call the super implementation, so
+that the {@link android.app.IntentService} can properly handle the life of the worker thread.</p>
+
+<p>For example, {@link android.app.IntentService#onStartCommand onStartCommand()} must return
+the default implementation (which is how the intent gets delivered to {@link
+android.app.IntentService#onHandleIntent onHandleIntent()}):</p>
+
+<pre>
+@Override
+public int onStartCommand(Intent intent, int flags, int startId) {
+ Toast.makeText(this, "service starting", Toast.LENGTH_SHORT).show();
+ return super.onStartCommand(intent,flags,startId);
+}
+</pre>
+
+<p>Besides {@link android.app.IntentService#onHandleIntent onHandleIntent()}, the only method
+from which you don't need to call the super class is {@link android.app.IntentService#onBind
+onBind()} (but you only need to implement that if your service allows binding).</p>
+
+<p>In the next section, you'll see how the same kind of service is implemented when extending
+the base {@link android.app.Service} class, which is a lot more code, but which might be
+appropriate if you need to handle simultaneous start requests.</p>
+
+
+<h3 id="ExtendingService">Extending the Service class</h3>
+
+<p>As you saw in the previous section, using {@link android.app.IntentService} makes your
+implementation of a started service very simple. If, however, you require your service to
+perform multi-threading (instead of processing start requests through a work queue), then you
+can extend the {@link android.app.Service} class to handle each intent.</p>
+
+<p>For comparison, the following example code is an implementation of the {@link
+android.app.Service} class that performs the exact same work as the example above using {@link
+android.app.IntentService}. That is, for each start request, it uses a worker thread to perform the
+job and processes only one request at a time.</p>
+
+<pre>
+public class HelloService extends Service {
+ private Looper mServiceLooper;
+ private ServiceHandler mServiceHandler;
+
+ // Handler that receives messages from the thread
+ private final class ServiceHandler extends Handler {
+ public ServiceHandler(Looper looper) {
+ super(looper);
+ }
+ @Override
+ public void handleMessage(Message msg) {
+ // Normally we would do some work here, like download a file.
+ // For our sample, we just sleep for 5 seconds.
+ long endTime = System.currentTimeMillis() + 5*1000;
+ while (System.currentTimeMillis() < endTime) {
+ synchronized (this) {
+ try {
+ wait(endTime - System.currentTimeMillis());
+ } catch (Exception e) {
+ }
+ }
+ }
+ // Stop the service using the startId, so that we don't stop
+ // the service in the middle of handling another job
+ stopSelf(msg.arg1);
+ }
+ }
+
+ @Override
+ public void onCreate() {
+ // Start up the thread running the service. Note that we create a
+ // separate thread because the service normally runs in the process's
+ // main thread, which we don't want to block. We also make it
+ // background priority so CPU-intensive work will not disrupt our UI.
+ HandlerThread thread = new HandlerThread("ServiceStartArguments",
+ Process.THREAD_PRIORITY_BACKGROUND);
+ thread.start();
+
+ // Get the HandlerThread's Looper and use it for our Handler
+ mServiceLooper = thread.getLooper();
+ mServiceHandler = new ServiceHandler(mServiceLooper);
+ }
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ Toast.makeText(this, "service starting", Toast.LENGTH_SHORT).show();
+
+ // For each start request, send a message to start a job and deliver the
+ // start ID so we know which request we're stopping when we finish the job
+ Message msg = mServiceHandler.obtainMessage();
+ msg.arg1 = startId;
+ mServiceHandler.sendMessage(msg);
+
+ // If we get killed, after returning from here, restart
+ return START_STICKY;
+ }
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ // We don't provide binding, so return null
+ return null;
+ }
+
+ @Override
+ public void onDestroy() {
+ Toast.makeText(this, "service done", Toast.LENGTH_SHORT).show();
+ }
+}
+</pre>
+
+<p>As you can see, it's a lot more work than using {@link android.app.IntentService}.</p>
+
+<p>However, because you handle each call to {@link android.app.Service#onStartCommand
+onStartCommand()} yourself, you can perform multiple requests simultaneously. That's not what
+this example does, but if that's what you want, then you can create a new thread for each
+request and run them right away (instead of waiting for the previous request to finish).</p>
+
+<p>Notice that the {@link android.app.Service#onStartCommand onStartCommand()} method must return an
+integer. The integer is a value that describes how the system should continue the service in the
+event that the system kills it (as discussed above, the default implementation for {@link
+android.app.IntentService} handles this for you, though you are able to modify it). The return value
+from {@link android.app.Service#onStartCommand onStartCommand()} must be one of the following
+constants:</p>
+
+<dl>
+ <dt>{@link android.app.Service#START_NOT_STICKY}</dt>
+ <dd>If the system kills the service after {@link android.app.Service#onStartCommand
+onStartCommand()} returns, <em>do not</em> recreate the service, unless there are pending
+intents to deliver. This is the safest option to avoid running your service when not necessary
+and when your application can simply restart any unfinished jobs.</dd>
+ <dt>{@link android.app.Service#START_STICKY}</dt>
+ <dd>If the system kills the service after {@link android.app.Service#onStartCommand
+onStartCommand()} returns, recreate the service and call {@link
+android.app.Service#onStartCommand onStartCommand()}, but <em>do not</em> redeliver the last intent.
+Instead, the system calls {@link android.app.Service#onStartCommand onStartCommand()} with a
+null intent, unless there were pending intents to start the service, in which case,
+those intents are delivered. This is suitable for media players (or similar services) that are not
+executing commands, but running indefinitely and waiting for a job.</dd>
+ <dt>{@link android.app.Service#START_REDELIVER_INTENT}</dt>
+ <dd>If the system kills the service after {@link android.app.Service#onStartCommand
+onStartCommand()} returns, recreate the service and call {@link
+android.app.Service#onStartCommand onStartCommand()} with the last intent that was delivered to the
+service. Any pending intents are delivered in turn. This is suitable for services that are
+actively performing a job that should be immediately resumed, such as downloading a file.</dd>
+</dl>
+<p>For more details about these return values, see the linked reference documentation for each
+constant.</p>
+
+
+
+<h3 id="StartingAService">Starting a Service</h3>
+
+<p>You can start a service from an activity or other application component by passing an
+{@link android.content.Intent} (specifying the service to start) to {@link
+android.content.Context#startService startService()}. The Android system calls the service's {@link
+android.app.Service#onStartCommand onStartCommand()} method and passes it the {@link
+android.content.Intent}. (You should never call {@link android.app.Service#onStartCommand
+onStartCommand()} directly.)</p>
+
+<p>For example, an activity can start the example service in the previous section ({@code
+HelloSevice}) using an explicit intent with {@link android.content.Context#startService
+startService()}:</p>
+
+<pre>
+Intent intent = new Intent(this, HelloService.class);
+startService(intent);
+</pre>
+
+<p>The {@link android.content.Context#startService startService()} method returns immediately and
+the Android system calls the service's {@link android.app.Service#onStartCommand
+onStartCommand()} method. If the service is not already running, the system first calls {@link
+android.app.Service#onCreate onCreate()}, then calls {@link android.app.Service#onStartCommand
+onStartCommand()}.</p>
+
+<p>If the service does not also provide binding, the intent delivered with {@link
+android.content.Context#startService startService()} is the only mode of communication between the
+application component and the service. However, if you want the service to send a result back, then
+the client that starts the service can create a {@link android.app.PendingIntent} for a broadcast
+(with {@link android.app.PendingIntent#getBroadcast getBroadcast()}) and deliver it to the service
+in the {@link android.content.Intent} that starts the service. The service can then use the
+broadcast to deliver a result.</p>
+
+<p>Multiple requests to start the service result in multiple corresponding calls to the service's
+{@link android.app.Service#onStartCommand onStartCommand()}. However, only one request to stop
+the service (with {@link android.app.Service#stopSelf stopSelf()} or {@link
+android.content.Context#stopService stopService()}) is required to stop it.</p>
+
+
+<h3 id="Stopping">Stopping a service</h3>
+
+<p>A started service must manage its own lifecycle. That is, the system does not stop or
+destroy the service unless it must recover system memory and the service
+continues to run after {@link android.app.Service#onStartCommand onStartCommand()} returns. So,
+the service must stop itself by calling {@link android.app.Service#stopSelf stopSelf()} or another
+component can stop it by calling {@link android.content.Context#stopService stopService()}.</p>
+
+<p>Once requested to stop with {@link android.app.Service#stopSelf stopSelf()} or {@link
+android.content.Context#stopService stopService()}, the system destroys the service as soon as
+possible.</p>
+
+<p>However, if your service handles multiple requests to {@link
+android.app.Service#onStartCommand onStartCommand()} concurrently, then you shouldn't stop the
+service when you're done processing a start request, because you might have since received a new
+start request (stopping at the end of the first request would terminate the second one). To avoid
+this problem, you can use {@link android.app.Service#stopSelf(int)} to ensure that your request to
+stop the service is always based on the most recent start request. That is, when you call {@link
+android.app.Service#stopSelf(int)}, you pass the ID of the start request (the <code>startId</code>
+delivered to {@link android.app.Service#onStartCommand onStartCommand()}) to which your stop request
+corresponds. Then if the service received a new start request before you were able to call {@link
+android.app.Service#stopSelf(int)}, then the ID will not match and the service will not stop.</p>
+
+<p class="caution"><strong>Caution:</strong> It's important that your application stops its services
+when it's done working, to avoid wasting system resources and consuming battery power. If necessary,
+other components can stop the service by calling {@link
+android.content.Context#stopService stopService()}. Even if you enable binding for the service,
+you must always stop the service yourself if it ever received a call to {@link
+android.app.Service#onStartCommand onStartCommand()}.</p>
+
+<p>For more information about the lifecycle of a service, see the section below about <a
+href="#Lifecycle">Managing the Lifecycle of a Service</a>.</p>
+
+
+
+<h2 id="CreatingBoundService">Creating a Bound Service</h2>
+
+<p>A bound service is one that allows application components to bind to it by calling {@link
+android.content.Context#bindService bindService()} in order to create a long-standing connection
+(and generally does not allow components to <em>start</em> it by calling {@link
+android.content.Context#startService startService()}).</p>
+
+<p>You should create a bound service when you want to interact with the service from activities
+and other components in your application or to expose some of your application's functionality to
+other applications, through interprocess communication (IPC).</p>
+
+<p>To create a bound service, you must implement the {@link
+android.app.Service#onBind onBind()} callback method to return an {@link android.os.IBinder} that
+defines the interface for communication with the service. Other application components can then call
+{@link android.content.Context#bindService bindService()} to retrieve the interface and
+begin calling methods on the service. The service lives only to serve the application component that
+is bound to it, so when there are no components bound to the service, the system destroys it
+(you do <em>not</em> need to stop a bound service in the way you must when the service is started
+through {@link android.app.Service#onStartCommand onStartCommand()}).</p>
+
+<p>To create a bound service, the first thing you must do is define the interface that specifies
+how a client can communicate with the service. This interface between the service
+and a client must be an implementation of {@link android.os.IBinder} and is what your service must
+return from the {@link android.app.Service#onBind
+onBind()} callback method. Once the client receives the {@link android.os.IBinder}, it can begin
+interacting with the service through that interface.</p>
+
+<p>Multiple clients can bind to the service at once. When a client is done interacting with the
+service, it calls {@link android.content.Context#unbindService unbindService()} to unbind. Once
+there are no clients bound to the service, the system destroys the service.</p>
+
+<p>There are multiple ways to implement a bound service and the implementation is more
+complicated than a started service, so the bound service discussion appears in a separate
+document about <a
+href="{@docRoot}guide/components/bound-services.html">Bound Services</a>.</p>
+
+
+
+<h2 id="Notifications">Sending Notifications to the User</h2>
+
+<p>Once running, a service can notify the user of events using <a
+href="{@docRoot}guide/topics/ui/notifiers/toasts.html">Toast Notifications</a> or <a
+href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Status Bar Notifications</a>.</p>
+
+<p>A toast notification is a message that appears on the surface of the current window for a
+moment then disappears, while a status bar notification provides an icon in the status bar with a
+message, which the user can select in order to take an action (such as start an activity).</p>
+
+<p>Usually, a status bar notification is the best technique when some background work has completed
+(such as a file completed
+downloading) and the user can now act on it. When the user selects the notification from the
+expanded view, the notification can start an activity (such as to view the downloaded file).</p>
+
+<p>See the <a
+href="{@docRoot}guide/topics/ui/notifiers/toasts.html">Toast Notifications</a> or <a
+href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Status Bar Notifications</a>
+developer guides for more information.</p>
+
+
+
+<h2 id="Foreground">Running a Service in the Foreground</h2>
+
+<p>A foreground service is a service that's considered to be something the
+user is actively aware of and thus not a candidate for the system to kill when low on memory. A
+foreground service must provide a notification for the status bar, which is placed under the
+"Ongoing" heading, which means that the notification cannot be dismissed unless the service is
+either stopped or removed from the foreground.</p>
+
+<p>For example, a music player that plays music from a service should be set to run in the
+foreground, because the user is explicitly aware
+of its operation. The notification in the status bar might indicate the current song and allow
+the user to launch an activity to interact with the music player.</p>
+
+<p>To request that your service run in the foreground, call {@link
+android.app.Service#startForeground startForeground()}. This method takes two parameters: an integer
+that uniquely identifies the notification and the {@link
+android.app.Notification} for the status bar. For example:</p>
+
+<pre>
+Notification notification = new Notification(R.drawable.icon, getText(R.string.ticker_text),
+ System.currentTimeMillis());
+Intent notificationIntent = new Intent(this, ExampleActivity.class);
+PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
+notification.setLatestEventInfo(this, getText(R.string.notification_title),
+ getText(R.string.notification_message), pendingIntent);
+startForeground(ONGOING_NOTIFICATION, notification);
+</pre>
+
+
+<p>To remove the service from the foreground, call {@link
+android.app.Service#stopForeground stopForeground()}. This method takes a boolean, indicating
+whether to remove the status bar notification as well. This method does <em>not</em> stop the
+service. However, if you stop the service while it's still running in the foreground, then the
+notification is also removed.</p>
+
+<p class="note"><strong>Note:</strong> The methods {@link
+android.app.Service#startForeground startForeground()} and {@link
+android.app.Service#stopForeground stopForeground()} were introduced in Android 2.0 (API Level
+5). In order to run your service in the foreground on older versions of the platform, you must
+use the previous {@code setForeground()} method—see the {@link
+android.app.Service#startForeground startForeground()} documentation for information about how
+to provide backward compatibility.</p>
+
+<p>For more information about notifications, see <a
+href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Creating Status Bar
+Notifications</a>.</p>
+
+
+
+<h2 id="Lifecycle">Managing the Lifecycle of a Service</h2>
+
+<p>The lifecycle of a service is much simpler than that of an activity. However, it's even more important
+that you pay close attention to how your service is created and destroyed, because a service
+can run in the background without the user being aware.</p>
+
+<p>The service lifecycle—from when it's created to when it's destroyed—can follow two
+different paths:</p>
+
+<ul>
+<li>A started service
+ <p>The service is created when another component calls {@link
+android.content.Context#startService startService()}. The service then runs indefinitely and must
+stop itself by calling {@link
+android.app.Service#stopSelf() stopSelf()}. Another component can also stop the
+service by calling {@link android.content.Context#stopService
+stopService()}. When the service is stopped, the system destroys it..</p></li>
+
+<li>A bound service
+ <p>The service is created when another component (a client) calls {@link
+android.content.Context#bindService bindService()}. The client then communicates with the service
+through an {@link android.os.IBinder} interface. The client can close the connection by calling
+{@link android.content.Context#unbindService unbindService()}. Multiple clients can bind to
+the same service and when all of them unbind, the system destroys the service. (The service
+does <em>not</em> need to stop itself.)</p></li>
+</ul>
+
+<p>These two paths are not entirely separate. That is, you can bind to a service that was already
+started with {@link android.content.Context#startService startService()}. For example, a background
+music service could be started by calling {@link android.content.Context#startService
+startService()} with an {@link android.content.Intent} that identifies the music to play. Later,
+possibly when the user wants to exercise some control over the player or get information about the
+current song, an activity can bind to the service by calling {@link
+android.content.Context#bindService bindService()}. In cases like this, {@link
+android.content.Context#stopService stopService()} or {@link android.app.Service#stopSelf
+stopSelf()} does not actually stop the service until all clients unbind. </p>
+
+
+<h3 id="LifecycleCallbacks">Implementing the lifecycle callbacks</h3>
+
+<p>Like an activity, a service has lifecycle callback methods that you can implement to monitor
+changes in the service's state and perform work at the appropriate times. The following skeleton
+service demonstrates each of the lifecycle methods:</p>
+
+
+<div class="figure" style="width:432px">
+<img src="{@docRoot}images/service_lifecycle.png" alt="" />
+<p class="img-caption"><strong>Figure 2.</strong> The service lifecycle. The diagram on the left
+shows the lifecycle when the service is created with {@link android.content.Context#startService
+startService()} and the diagram on the right shows the lifecycle when the service is created
+with {@link android.content.Context#bindService bindService()}.</p>
+</div>
+
+<pre>
+public class ExampleService extends Service {
+ int mStartMode; // indicates how to behave if the service is killed
+ IBinder mBinder; // interface for clients that bind
+ boolean mAllowRebind; // indicates whether onRebind should be used
+
+ @Override
+ public void {@link android.app.Service#onCreate onCreate}() {
+ // The service is being created
+ }
+ @Override
+ public int {@link android.app.Service#onStartCommand onStartCommand}(Intent intent, int flags, int startId) {
+ // The service is starting, due to a call to {@link android.content.Context#startService startService()}
+ return <em>mStartMode</em>;
+ }
+ @Override
+ public IBinder {@link android.app.Service#onBind onBind}(Intent intent) {
+ // A client is binding to the service with {@link android.content.Context#bindService bindService()}
+ return <em>mBinder</em>;
+ }
+ @Override
+ public boolean {@link android.app.Service#onUnbind onUnbind}(Intent intent) {
+ // All clients have unbound with {@link android.content.Context#unbindService unbindService()}
+ return <em>mAllowRebind</em>;
+ }
+ @Override
+ public void {@link android.app.Service#onRebind onRebind}(Intent intent) {
+ // A client is binding to the service with {@link android.content.Context#bindService bindService()},
+ // after onUnbind() has already been called
+ }
+ @Override
+ public void {@link android.app.Service#onDestroy onDestroy}() {
+ // The service is no longer used and is being destroyed
+ }
+}
+</pre>
+
+<p class="note"><strong>Note:</strong> Unlike the activity lifecycle callback methods, you are
+<em>not</em> required to call the superclass implementation of these callback methods.</p>
+
+<p>By implementing these methods, you can monitor two nested loops of the service's lifecycle: </p>
+
+<ul>
+<li>The <strong>entire lifetime</strong> of a service happens between the time {@link
+android.app.Service#onCreate onCreate()} is called and the time {@link
+android.app.Service#onDestroy} returns. Like an activity, a service does its initial setup in
+{@link android.app.Service#onCreate onCreate()} and releases all remaining resources in {@link
+android.app.Service#onDestroy onDestroy()}. For example, a
+music playback service could create the thread where the music will be played in {@link
+android.app.Service#onCreate onCreate()}, then stop the thread in {@link
+android.app.Service#onDestroy onDestroy()}.
+
+<p>The {@link android.app.Service#onCreate onCreate()} and {@link android.app.Service#onDestroy
+onDestroy()} methods are called for all services, whether
+they're created by {@link android.content.Context#startService startService()} or {@link
+android.content.Context#bindService bindService()}.</p></li>
+
+<li>The <strong>active lifetime</strong> of a service begins with a call to either {@link
+android.app.Service#onStartCommand onStartCommand()} or {@link android.app.Service#onBind onBind()}.
+Each method is handed the {@link
+android.content.Intent} that was passed to either {@link android.content.Context#startService
+startService()} or {@link android.content.Context#bindService bindService()}, respectively.
+<p>If the service is started, the active lifetime ends the same time that the entire lifetime
+ends (the service is still active even after {@link android.app.Service#onStartCommand
+onStartCommand()} returns). If the service is bound, the active lifetime ends when {@link
+android.app.Service#onUnbind onUnbind()} returns.</p>
+</li>
+</ul>
+
+<p class="note"><strong>Note:</strong> Although a started service is stopped by a call to
+either {@link android.app.Service#stopSelf stopSelf()} or {@link
+android.content.Context#stopService stopService()}, there is not a respective callback for the
+service (there's no {@code onStop()} callback). So, unless the service is bound to a client,
+the system destroys it when the service is stopped—{@link
+android.app.Service#onDestroy onDestroy()} is the only callback received.</p>
+
+<p>Figure 2 illustrates the typical callback methods for a service. Although the figure separates
+services that are created by {@link android.content.Context#startService startService()} from those
+created by {@link android.content.Context#bindService bindService()}, keep
+in mind that any service, no matter how it's started, can potentially allow clients to bind to it.
+So, a service that was initially started with {@link android.app.Service#onStartCommand
+onStartCommand()} (by a client calling {@link android.content.Context#startService startService()})
+can still receive a call to {@link android.app.Service#onBind onBind()} (when a client calls
+{@link android.content.Context#bindService bindService()}).</p>
+
+<p>For more information about creating a service that provides binding, see the <a
+href="{@docRoot}guide/components/bound-services.html">Bound Services</a> document,
+which includes more information about the {@link android.app.Service#onRebind onRebind()}
+callback method in the section about <a
+href="{@docRoot}guide/components/bound-services.html#Lifecycle">Managing the Lifecycle of
+a Bound Service</a>.</p>
+
+
+<!--
+<h2>Beginner's Path</h2>
+
+<p>To learn how to query data from the system or other applications (such as contacts or media
+stored on the device), continue with the <b><a
+href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a></b>
+document.</p>
+-->
diff --git a/docs/html/guide/components/tasks-and-back-stack.jd b/docs/html/guide/components/tasks-and-back-stack.jd
new file mode 100644
index 0000000..8b7041c
--- /dev/null
+++ b/docs/html/guide/components/tasks-and-back-stack.jd
@@ -0,0 +1,595 @@
+page.title=Tasks and Back Stack
+parent.title=Activities
+parent.link=activities.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>Quickview</h2>
+<ul>
+ <li>All activities belong to a task</li>
+ <li>A task contains a collection of activities in the order in which the user interacts with
+them</li>
+ <li>Tasks can move to the background and retain the state of each activity in order for users
+to perform other tasks without losing their work</li>
+</ul>
+
+<h2>In this document</h2>
+<ol>
+<li><a href="#ActivityState">Saving Activity State</a></li></li>
+<li><a href="#ManagingTasks">Managing Tasks</a>
+ <ol>
+ <li><a href="#TaskLaunchModes">Defining launch modes</a></li>
+ <li><a href="#Affinities">Handling affinities</a></li>
+ <li><a href="#Clearing">Clearing the back stack</a></li>
+ <li><a href="#Starting">Starting a task</a></li>
+ </ol>
+</li>
+</ol>
+
+<h2>Articles</h2>
+<ol>
+ <li><a href="http://android-developers.blogspot.com/2010/04/multitasking-android-way.html">Multitasking the Android Way</a></li>
+</ol>
+
+<h2>See also</h2>
+<ol>
+ <li><a href="{@docRoot}design/patterns/navigation.html">Android Design:
+Navigation</a></li>
+ <li><a
+href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>} manifest
+element</a></li>
+</ol>
+</div>
+</div>
+
+
+<p>An application usually contains multiple <a
+href="{@docRoot}guide/components/activities.html">activities</a>. Each activity
+should be designed around a specific kind of action the user can perform and can start other
+activities. For example, an email application might have one activity to show a list of new email.
+When the user selects an email, a new activity opens to view that email.</p>
+
+<p>An activity can even start activities that exist in other applications on the device. For
+example, if your application wants to send an email, you can define an intent to perform a "send"
+action and include some data, such as an email address and a message. An activity from another
+application that declares itself to handle this kind of intent then opens. In this case, the intent
+is to send an email, so an email application's "compose" activity starts (if multiple activities
+support the same intent, then the system lets the user select which one to use). When the email is
+sent, your activity resumes and it seems as if the email activity was part of your application. Even
+though the activities may be from different applications, Android maintains this seamless user
+experience by keeping both activities in the same <em>task</em>.</p>
+
+<p>A task is a collection of activities that users interact with
+when performing a certain job. The activities are arranged in a stack (the "back stack"), in the
+order in which each activity is opened.</p>
+
+<!-- SAVE FOR WHEN THE FRAGMENT DOC IS ADDED
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h3>Adding fragments to a task's back stack</h3>
+
+<p>Your activity can also include {@link android.app.Fragment}s to the back stack. For example,
+suppose you have a two-pane layout using fragments, one of which is a list view (fragment A) and the
+other being a layout to display an item from the list (fragment B). When the user selects an item
+from the list, fragment B is replaced by a new fragment (fragment C). In this case, it might be
+desireable for the user to navigate back to reveal fragment B, using the <em>Back</em> button.</p>
+<p>In order to add fragment B to the back stack so that this is possible, you must call {@link
+android.app.FragmentTransaction#addToBackStack addToBackStack()} before you {@link
+android.app.FragmentTransaction#commit()} the transaction that replaces fragment B with fragment
+C.</p>
+<p>For more information about using fragments and adding them to the back stack, see the {@link
+android.app.Fragment} class documentation.</p>
+
+</div>
+</div>
+-->
+
+<p>The device Home screen is the starting place for most tasks. When the user touches an icon in the
+application
+launcher (or a shortcut on the Home screen), that application's task comes to the foreground. If no
+task exists for the application (the application has not been used recently), then a new task
+is created and the "main" activity for that application opens as the root activity in the stack.</p>
+
+<p>When the current activity starts another, the new activity is pushed on the top of the stack and
+takes focus. The previous activity remains in the stack, but is stopped. When an activity
+stops, the system retains the current state of its user interface. When the user presses the
+<em>Back</em>
+button, the current activity is popped from the top of the stack (the activity is destroyed) and the
+previous activity resumes (the previous state of its UI is restored). Activities in the stack are
+never rearranged, only pushed and popped from the stack—pushed onto the stack when started by
+the current activity and popped off when the user leaves it using the <em>Back</em> button. As such,
+the back
+stack operates as a "last in, first out" object structure. Figure 1 visualizes
+this behavior with a timeline showing the progress between activities along with the current back
+stack at each point in time.</p>
+
+<img src="{@docRoot}images/fundamentals/diagram_backstack.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> A representation of how each new activity in a
+task adds an item to the back stack. When the user presses the <em>Back</em> button, the current
+activity is
+destroyed and the previous activity resumes.</p>
+
+
+<p>If the user continues to press <em>Back</em>, then each activity in the stack is popped off to
+reveal the
+previous one, until the user returns to the Home screen (or to whichever activity was running when
+the task began). When all activities are removed from the stack, the task no longer exists.</p>
+
+<div class="figure" style="width:287px">
+<img src="{@docRoot}images/fundamentals/diagram_multitasking.png" alt="" /> <p
+class="img-caption"><strong>Figure 2.</strong> Two tasks: Task B receives user interaction
+in the foreground, while Task A is in the background, waiting to be resumed.</p>
+</div>
+<div class="figure" style="width:215px">
+ <img src="{@docRoot}images/fundamentals/diagram_multiple_instances.png" alt="" /> <p
+class="img-caption"><strong>Figure 3.</strong> A single activity is instantiated multiple times.</p>
+</div>
+
+<p>A task is a cohesive unit that can move to the "background" when users begin a new task or go
+to the Home screen, via the <em>Home</em> button. While in the background, all the activities in the
+task are
+stopped, but the back stack for the task remains intact—the task has simply lost focus while
+another task takes place, as shown in figure 2. A task can then return to the "foreground" so users
+can pick up where they left off. Suppose, for example, that the current task (Task A) has three
+activities in its stack—two under the current activity. The user presses the <em>Home</em>
+button, then
+starts a new application from the application launcher. When the Home screen appears, Task A goes
+into the background. When the new application starts, the system starts a task for that application
+(Task B) with its own stack of activities. After interacting with
+that application, the user returns Home again and selects the application that originally
+started Task A. Now, Task A comes to the
+foreground—all three activities in its stack are intact and the activity at the top of the
+stack resumes. At
+this point, the user can also switch back to Task B by going Home and selecting the application icon
+that started that task (or by touching and holding the <em>Home</em> button to reveal recent tasks
+and selecting
+one). This is an example of multitasking on Android.</p>
+
+<p class="note"><strong>Note:</strong> Multiple tasks can be held in the background at once.
+However, if the user is running many background tasks at the same time, the system might begin
+destroying background activities in order to recover memory, causing the activity states to be lost.
+See the following section about <a href="#ActivityState">Activity state</a>.</p>
+
+<p>Because the activities in the back stack are never rearranged, if your application allows
+users to start a particular activity from more than one activity, a new instance of
+that activity is created and pushed onto the stack (rather than bringing any previous instance of
+the activity to the top). As such, one activity in your application might be instantiated multiple
+times (even from different tasks), as shown in figure 3. As such, if the user navigates backward
+using the <em>Back</em> button, each instance of the activity is revealed in the order they were
+opened (each
+with their own UI state). However, you can modify this behavior if you do not want an activity to be
+instantiated more than once. How to do so is discussed in the later section about <a
+href="#ManagingTasks">Managing Tasks</a>.</p>
+
+
+<p>To summarize the default behavior for activities and tasks:</p>
+
+<ul>
+ <li>When Activity A starts Activity B, Activity A is stopped, but the system retains its state
+(such as scroll position and text entered into forms).
+If the user presses the <em>Back</em> button while in Activity B, Activity A resumes with its state
+restored.</li>
+ <li>When the user leaves a task by pressing the <em>Home</em> button, the current activity is
+stopped and
+its task goes into the background. The system retains the state of every activity in the task. If
+the user later resumes the task by selecting the launcher icon that began the task, the task comes
+to the foreground and resumes the activity at the top of the stack.</li>
+ <li>If the user presses the <em>Back</em> button, the current activity is popped from the stack
+and
+destroyed. The previous activity in the stack is resumed. When an activity is destroyed, the system
+<em>does not</em> retain the activity's state.</li>
+ <li>Activities can be instantiated multiple times, even from other tasks.</li>
+</ul>
+
+
+<div class="design-announce">
+<p><strong>Navigation Design</strong></p>
+ <p>For more about how app navigation works on Android, read Android Design's <a
+href="{@docRoot}design/patterns/navigation.html">Navigation</a> guide.</p>
+</div>
+
+
+<h2 id="ActivityState">Saving Activity State</h2>
+
+<p>As discussed above, the system's default behavior preserves the state of an activity when it is
+stopped. This way, when users navigate back to a previous activity, its user interface appears
+the way they left it. However, you can—and <strong>should</strong>—proactively retain
+the state of your activities using callback methods, in case the activity is destroyed and must
+be recreated.</p>
+
+<p>When the system stops one of your activities (such as when a new activity starts or the task
+moves to the background), the system might destroy that activity completely if it needs to recover
+system memory. When this happens, information about the activity state is lost. If this happens, the
+system still
+knows that the activity has a place in the back stack, but when the activity is brought to the
+top of the stack the system must recreate it (rather than resume it). In order to
+avoid losing the user's work, you should proactively retain it by implementing the {@link
+android.app.Activity#onSaveInstanceState onSaveInstanceState()} callback
+methods in your activity.</p>
+
+<p>For more information about how to save your activity state, see the <a
+href="{@docRoot}guide/components/activities.html#SavingActivityState">Activities</a>
+document.</p>
+
+
+
+<h2 id="ManagingTasks">Managing Tasks</h2>
+
+<p>The way Android manages tasks and the back stack, as described above—by placing all
+activities started in succession in the same task and in a "last in, first out" stack—works
+great for most applications and you shouldn't have to worry about how your activities are associated
+with tasks or how they exist in the back stack. However, you might decide that you want to interrupt
+the normal behavior. Perhaps you want an activity in your application to begin a new task when it is
+started (instead of being placed within the current task); or, when you start an activity, you want
+to bring forward an existing instance of it (instead of creating a new
+instance on top of the back stack); or, you want your back stack to be cleared of all
+activities except for the root activity when the user leaves the task.</p>
+
+<p>You can do these things and more, with attributes in the
+<a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
+<activity>}</a> manifest element and with flags in the intent that you pass to {@link
+android.app.Activity#startActivity startActivity()}.</p>
+
+<p>In this regard, the the principal <a
+href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a>
+attributes you can use are:</p>
+
+<ul class="nolist">
+ <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#aff">{@code
+taskAffinity}</a></li>
+ <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code
+launchMode}</a></li>
+ <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">{@code
+allowTaskReparenting}</a></li>
+ <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#clear">{@code
+clearTaskOnLaunch}</a></li>
+ <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#always">{@code
+alwaysRetainTaskState}</a></li>
+ <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#finish">{@code
+finishOnTaskLaunch}</a></li>
+</ul>
+
+<p>And the principal intent flags you can use are:</p>
+
+<ul class="nolist">
+ <li>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</li>
+ <li>{@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}</li>
+ <li>{@link android.content.Intent#FLAG_ACTIVITY_SINGLE_TOP}</li>
+</ul>
+
+<p>In the following sections, you'll see how you can use these manifest attributes and intent
+flags to define how activities are associated with tasks and how the behave in the back stack.</p>
+
+
+<p class="caution"><strong>Caution:</strong> Most applications should not interrupt the default
+behavior for activities and tasks. If you determine that it's necessary for your activity to modify
+the default behaviors, use caution and be sure to test the usability of the activity during
+launch and when navigating back to it from other activities and tasks with the <em>Back</em> button.
+Be sure
+to test for navigation behaviors that might conflict with the user's expected behavior.</p>
+
+
+<h3 id="TaskLaunchModes">Defining launch modes</h3>
+
+<p>Launch modes allow you to define how a new instance of an activity is associated with the
+current task. You can define different launch modes in two ways:</p>
+<ul class="nolist">
+ <li><a href="#ManifestForTasks">Using the manifest file</a>
+ <p>When you declare an activity in your manifest file, you can specify how the activity
+should associate with tasks when it starts.</li>
+ <li><a href="#IntentFlagsForTasks">Using Intent flags</a>
+ <p>When you call {@link android.app.Activity#startActivity startActivity()},
+you can include a flag in the {@link android.content.Intent} that declares how (or
+whether) the new activity should associate with the current task.</p></li>
+</ul>
+
+<p>As such, if Activity A starts Activity B, Activity B can define in its manifest how it
+should associate with the current task (if at all) and Activity A can also request how Activity
+B should associate with current task. If both activities define how Activity B
+should associate with a task, then Activity A's request (as defined in the intent) is honored
+over Activity B's request (as defined in its manifest).</p>
+
+<p class="note"><strong>Note:</strong> Some launch modes available for the manifest file
+are not available as flags for an intent and, likewise, some launch modes available as flags
+for an intent cannot be defined in the manifest.</p>
+
+
+<h4 id="ManifestForTasks">Using the manifest file</h4>
+
+<p>When declaring an activity in your manifest file, you can specify how the activity should
+associate with a task using the <a
+href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a>
+element's <a href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code
+launchMode}</a> attribute.</p>
+
+<p>The <a href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code
+launchMode}</a> attribute specifies an instruction on how the activity should be launched into a
+task. There are four different launch modes you can assign to the
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">launchMode</a></code>
+attribute:</p>
+
+<dl>
+<dt>{@code "standard"} (the default mode)</dt>
+ <dd>Default. The system creates a new instance of the activity in the task from
+which it was started and routes the intent to it. The activity can be instantiated multiple times,
+each instance can belong to different tasks, and one task can have multiple instances.</dd>
+<dt>{@code "singleTop"}</dt>
+ <dd>If an instance of the activity already exists at the top of the current task, the system
+routes the intent to that instance through a call to its {@link
+android.app.Activity#onNewIntent onNewIntent()} method, rather than creating a new instance of the
+activity. The activity can be instantiated multiple times, each instance can
+belong to different tasks, and one task can have multiple instances (but only if the the
+activity at the top of the back stack is <em>not</em> an existing instance of the activity).
+ <p>For example, suppose a task's back stack consists of root activity A with activities B, C,
+and D on top (the stack is A-B-C-D; D is on top). An intent arrives for an activity of type D.
+If D has the default {@code "standard"} launch mode, a new instance of the class is launched and the
+stack becomes A-B-C-D-D. However, if D's launch mode is {@code "singleTop"}, the existing instance
+of D receives the intent through {@link
+android.app.Activity#onNewIntent onNewIntent()}, because it's at the top of the stack—the
+stack remains A-B-C-D. However, if an intent arrives for an activity of type B, then a new
+instance of B is added to the stack, even if its launch mode is {@code "singleTop"}.</p>
+ <p class="note"><strong>Note:</strong> When a new instance of an activity is created,
+the user can press the <em>Back</em> button to return to the previous activity. But when an existing
+instance of
+an activity handles a new intent, the user cannot press the <em>Back</em> button to return to the
+state of
+the activity before the new intent arrived in {@link android.app.Activity#onNewIntent
+onNewIntent()}.</p>
+</dd>
+
+<dt>{@code "singleTask"}</dt>
+ <dd>The system creates a new task and instantiates the activity at the root of the new task.
+However, if an instance of the activity already exists in a separate task, the system routes the
+intent to the existing instance through a call to its {@link
+android.app.Activity#onNewIntent onNewIntent()} method, rather than creating a new instance. Only
+one instance of the activity can exist at a time.
+ <p class="note"><strong>Note:</strong> Although the activity starts in a new task, the
+<em>Back</em> button still returns the user to the previous activity.</p></dd>
+<dt>{@code "singleInstance"}.</dt>
+ <dd>Same as {@code "singleTask"}, except that the system doesn't launch any other activities into
+the task holding the instance. The activity is always the single and only member of its task;
+any activities started by this one open in a separate task.</dd>
+</dl>
+
+
+<p>As another example, the Android Browser application declares that the web browser activity should
+always open in its own task—by specifying the {@code singleTask} launch mode in the <a
+href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element.
+This means that if your application issues an
+intent to open the Android Browser, its activity is <em>not</em> placed in the same
+task as your application. Instead, either a new task starts for the Browser or, if the Browser
+already has a task running in the background, that task is brought forward to handle the new
+intent.</p>
+
+<p>Regardless of whether an activity starts in a new task or in the same task as the activity that
+started it, the <em>Back</em> button always takes the user to the previous activity. However, if you
+start an activity that specifies the {@code singleTask} launch mode, then if an instance of
+that activity exists in a background task, that whole task is brought to the foreground. At this
+point, the back stack now includes all activities from the task brought forward, at the top of the
+stack. Figure 4 illustrates this type of scenario.</p>
+
+<img src="{@docRoot}images/fundamentals/diagram_backstack_singletask_multiactivity.png" alt="" />
+<p class="img-caption"><strong>Figure 4.</strong> A representation of how an activity with
+launch mode "singleTask" is added to the back stack. If the activity is already a part of a
+background task with its own back stack, then the entire back stack also comes
+forward, on top of the current task.</p>
+
+<p>For more information about using launch modes in the manifest file, see the
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code>
+element documentation, where the {@code launchMode} attribute and the accepted values are
+discussed more.</p>
+
+<p class="note"><strong>Note:</strong> The behaviors that you specify for your activity with the <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code launchMode}</a> attribute
+can be overridden by flags included with the intent that start your activity, as discussed in the
+next section.</p>
+
+
+
+<h4 id="#IntentFlagsForTasks">Using Intent flags</h4>
+
+<p>When starting an activity, you can modify the default association of an activity to its task
+by including flags in the intent that you deliver to {@link
+android.app.Activity#startActivity startActivity()}. The flags you can use to modify the
+default behavior are:</p>
+
+<p>
+ <dt>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</dt>
+ <dd>Start the activity in a new task. If a task is already running for the activity you are now
+starting, that task is brought to the foreground with its last state restored and the activity
+receives the new intent in {@link android.app.Activity#onNewIntent onNewIntent()}.
+ <p>This produces the same behavior as the {@code "singleTask"} <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code launchMode}</a> value,
+discussed in the previous section.</p></dd>
+ <dt>{@link android.content.Intent#FLAG_ACTIVITY_SINGLE_TOP}</dt>
+ <dd>If the activity being started is the current activity (at the top of the back stack), then
+the existing instance receives a call to {@link android.app.Activity#onNewIntent onNewIntent()},
+instead of creating a new instance of the activity.
+ <p>This produces the same behavior as the {@code "singleTop"} <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code launchMode}</a> value,
+discussed in the previous section.</p></dd>
+ <dt>{@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}</dt>
+ <dd>If the activity being started is already running in the current task, then instead
+of launching a new instance of that activity, all of the other activities on top of it are
+destroyed and this intent is delivered to the resumed instance of the activity (now on top),
+through {@link android.app.Activity#onNewIntent onNewIntent()}).
+ <p>There is no value for the <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code launchMode}</a>
+attribute that produces this behavior.</p>
+ <p>{@code FLAG_ACTIVITY_CLEAR_TOP} is most often used in conjunction with {@code
+FLAG_ACTIVITY_NEW_TASK}. When used together, these flags are a way of locating an existing activity
+in another task and putting it in a position where it can respond to the intent. </p>
+ <p class="note"><strong>Note:</strong> If the launch mode of the designated activity is {@code
+"standard"}, it too is removed from the stack and a new instance is launched in its place to handle
+the incoming intent. That's because a new instance is always created for a new intent when the
+launch mode is {@code "standard"}. </p>
+</dd>
+</dl>
+
+
+
+
+
+<h3 id="Affinities">Handling affinities</h3>
+
+<p>The <em>affinity</em> indicates which task an activity prefers to belong to. By default, all the
+activities from the same application have an affinity for each other. So, by default, all
+activities in the same application prefer to be in the same task. However, you can modify
+the default affinity for an activity. Activities defined in
+different applications can share an affinity, or activities defined in the same application can be
+assigned different task affinities.</p>
+
+<p>You can modify the affinity for any given activity with the <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#aff">{@code taskAffinity}</a> attribute
+of the <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a>
+element.</p>
+
+<p>The <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#aff">{@code taskAffinity}</a>
+attribute takes a string value, which must be unique from the default package name
+declared in the <a href="{@docRoot}guide/topics/manifest/manifest-element.html">{@code
+<manifest>}</a> element, because the system uses that name to identify the default task
+affinity for the application.</p>
+
+<p>The affinity comes into play in two circumstances:</p>
+<ul>
+ <li>When the intent that launches an activity contains the {@link
+android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag.
+
+<p>A new activity is, by default, launched into the task of the activity
+that called {@link android.app.Activity#startActivity startActivity()}. It's pushed onto the same
+back stack as the caller. However, if the intent passed to {@link
+android.app.Activity#startActivity startActivity()} contains the {@link
+android.content.Intent#FLAG_ACTIVITY_NEW_TASK}
+flag, the system looks for a different task to house the new activity. Often, it's a new task.
+However, it doesn't have to be. If there's already an existing task with the same affinity as the
+new activity, the activity is launched into that task. If not, it begins a new task.</p>
+
+<p>If this flag causes an activity to begin a new task and the user presses the <em>Home</em> button
+to leave
+it, there must be some way for the user to navigate back to the task. Some entities (such as the
+notification manager) always start activities in an external task, never as part of their own, so
+they always put {@code FLAG_ACTIVITY_NEW_TASK} in the intents they pass to {@link
+android.app.Activity#startActivity startActivity()}. If you have an activity that can be invoked by
+an external entity that might use this flag, take care that the user has a independent way to get
+back to the task that's started, such as with a launcher icon (the root activity of the task
+has a {@link android.content.Intent#CATEGORY_LAUNCHER} intent filter; see the <a
+href="#Starting">Starting a task</a> section below).</p>
+</li>
+
+ <li>When an activity has its <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">{@code
+allowTaskReparenting}</a> attribute set to {@code "true"}.
+ <p>In this case, the activity can move from the task it starts to the task it has an affinity
+for, when that task comes to the foreground.</p>
+ <p>For example, suppose that an activity that reports weather conditions in selected cities is
+defined as part of a travel application. It has the same affinity as other activities in the same
+application (the default application affinity) and it allows re-parenting with this attribute.
+When one of your activities starts the weather reporter activity, it initially belongs to the same
+task as your activity. However, when the travel application's task comes to the foreground, the
+weather reporter activity is reassigned to that task and displayed within it.</p>
+</li>
+</ul>
+
+<p class="note"><strong>Tip:</strong> If an {@code .apk} file contains more than one "application"
+from the user's point of view, you probably want to use the <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#aff">{@code taskAffinity}</a>
+attribute to assign different affinities to the activities associated with each "application".</p>
+
+
+
+<h3 id="Clearing">Clearing the back stack</h3>
+
+<p>If the user leaves a task for a long time, the system clears the task of all activities except
+the root activity. When the user returns to the task again, only the root activity is restored.
+The system behaves this way, because, after an extended amount of time, users likely have abandoned
+what they were doing before and are returning to the task to begin something new. </p>
+
+<p>There are some activity attributes that you can use to modify this behavior: </p>
+
+<dl>
+<dt><code><a
+href="{@docRoot}guide/topics/manifest/activity-element.html#always">alwaysRetainTaskState</a></code>
+</dt>
+<dd>If this attribute is set to {@code "true"} in the root activity of a task,
+the default behavior just described does not happen.
+The task retains all activities in its stack even after a long period.</dd>
+
+<dt><code><a
+href="{@docRoot}guide/topics/manifest/activity-element.html#clear">clearTaskOnLaunch</a></code></dt>
+<dd>If this attribute is set to {@code "true"} in the root activity of a task,
+the stack is cleared down to the root activity whenever the user leaves the task
+and returns to it. In other words, it's the opposite of <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#always">{@code
+alwaysRetainTaskState}</a>. The user always returns to the task in its
+initial state, even after a leaving the task for only a moment.</dd>
+
+<dt><code><a
+href="{@docRoot}guide/topics/manifest/activity-element.html#finish">finishOnTaskLaunch</a></code>
+</dt>
+<dd>This attribute is like <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#clear">{@code clearTaskOnLaunch}</a>,
+but it operates on a
+single activity, not an entire task. It can also cause any activity to go
+away, including the root activity. When it's set to {@code "true"}, the
+activity remains part of the task only for the current session. If the user
+leaves and then returns to the task, it is no longer present.</dd>
+</dl>
+
+
+
+
+<h3 id="Starting">Starting a task</h3>
+
+<p>You can set up an activity as the entry point for a task by giving it an intent filter with
+{@code "android.intent.action.MAIN"} as the specified action and {@code
+"android.intent.category.LAUNCHER"} as the specified category. For example:</p>
+
+<pre>
+<activity ... >
+ <intent-filter ... >
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ ...
+</activity>
+</pre>
+
+<p>An intent filter of this kind causes an icon and label for the
+activity to be displayed in the application launcher, giving users a way to launch the activity and
+to return to the task that it creates any time after it has been launched.
+</p>
+
+<p>This second ability is important: Users must be able to leave a task and then come back to it
+later using this activity launcher. For this reason, the two <a href="#LaunchModes">launch
+modes</a> that mark activities as always initiating a task, {@code "singleTask"} and "{@code
+"singleInstance"}, should be used only when the activity has an {@link
+android.content.Intent#ACTION_MAIN}
+and a {@link android.content.Intent#CATEGORY_LAUNCHER}
+filter. Imagine, for example, what could happen if the filter is missing: An intent launches a
+{@code "singleTask"} activity, initiating a new task, and the user spends some time working in
+that task. The user then presses the <em>Home</em> button. The task is now sent to the background
+and is
+not visible. Now the user has no way to return to the task, because it is not represented in the
+application launcher.
+</p>
+
+<p>For those cases where you don't want the user to be able to return to an activity, set the
+ <code><a
+href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> element's
+<a href="{@docRoot}guide/topics/manifest/activity-element.html#finish">{@code
+finishOnTaskLaunch}</a> to {@code "true"} (see <a
+href="#Clearing">Clearing the stack</a>).</p>
+
+
+
+<!--
+<h2>Beginner's Path</h2>
+
+<p>For more information about how to use intents to
+activate other application components and publish the intents to which your components
+respond, continue with the <b><a
+href="{@docRoot}guide/components/intents-filters.html">Intents and Intent
+Filters</a></b> document.</p>
+-->
diff --git a/docs/html/guide/developing/building/building-cmdline.jd b/docs/html/guide/developing/building/building-cmdline.jd
deleted file mode 100644
index fd90b1a..0000000
--- a/docs/html/guide/developing/building/building-cmdline.jd
+++ /dev/null
@@ -1,371 +0,0 @@
-page.title=Building and Running from the Command Line
-parent.title=Building and Running
-parent.link=index.html
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#DebugMode">Building in Debug Mode</a></li>
- <li><a href="#ReleaseMode">Building in Release Mode</a>
- <ol>
- <li><a href="#ManualReleaseMode">Build unsigned</a></li>
- <li><a href="#AutoReleaseMode">Build signed and aligned</a></li>
- <li><a href="#OnceBuilt">Once built and signed in release mode</a></li>
- </ol>
- </li>
- <li><a href="#RunningOnEmulator">Running on the Emulator</a></li>
- <li><a href="#RunningOnDevice">Running on a Device</a></li>
- <li><a href="#Signing">Application Signing</a></li>
- <li><a href="#AntReference">Ant Command Reference</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/developing/devices/managing-avds-cmdline.html">Managing AVDs from
-the Command Line</a></li>
- <li><a href="{@docRoot}guide/developing/devices/emulator.html">Using the Android
-Emulator</a></li>
- <li><a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a></li>
- </ol>
- </div>
- </div>
-
- <p>There are two ways to build your application using the Ant build script: one for
- testing/debugging your application — <em>debug mode</em> — and one for building your
- final package for release — <em>release mode</em>. Regardless of which way you build your application,
- it must be signed before it can install on an emulator or device—with a debug key when building
- in debug mode and with your own private key when building in release mode.</p>
-
- <p>Whether you're building in debug mode or release mode, you need to use the Ant tool to compile
- and build your project. This will create the .apk file that you can install on an emulator or device.
- When you build in debug mode, the .apk file is automatically signed by the SDK tools with
- a debug key, so it's instantly ready for installation onto an emulator or attached
- development device. You cannot distribute an application that is signed with a debug key.
- When you build in release mode, the .apk file is <em>unsigned</em>, so you
- must manually sign it with your own private key, using Keytool and Jarsigner.</p>
-
- <p>It's important that you read and understand <a href=
- "{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a>, particularly once
- you're ready to release your application and share it with end-users. That document describes the
- procedure for generating a private key and then using it to sign your .apk file. If you're just
- getting started, however, you can quickly run your applications on an emulator or your own
- development device by building in debug mode.</p>
-
- <p>If you don't have Ant, you can obtain it from the <a href="http://ant.apache.org/">Apache Ant
- home page</a>. Install it and make sure it is in your executable PATH. Before calling Ant, you
- need to declare the JAVA_HOME environment variable to specify the path to where the JDK is
- installed.</p>
-
- <p class="note"><strong>Note:</strong> When installing JDK on Windows, the default is to install
- in the "Program Files" directory. This location will cause <code>ant</code> to fail, because of
- the space. To fix the problem, you can specify the JAVA_HOME variable like this:
- <pre>set JAVA_HOME=c:\Progra~1\Java\<jdkdir></pre>
-
- <p>The easiest solution, however, is to install JDK in a non-space directory, for example:</p>
-
- <pre>c:\java\jdk1.6.0_02</pre>
-
- <h2 id="DebugMode">Building in Debug Mode</h2>
-
- <p>For immediate application testing and debugging, you can build your application in debug mode
- and immediately install it on an emulator. In debug mode, the build tools automatically sign your
- application with a debug key and optimize the package with {@code zipalign}.</p>
-
- <p>To build in debug mode:</p>
-
- <ol>
- <li>Open a command-line and navigate to the root of your project directory.</li>
- <li>Use Ant to compile your project in debug mode:
- <pre>
-ant debug
-</pre>
-
- <p>This creates your debug <code>.apk</code> file inside the project <code>bin/</code> directory, named
- <code><your_project_name>-debug.apk</code>. The file is already signed with
- the debug key and has been aligned with
- <a href="{@docRoot}guide/developing/tools/zipalign.html"><code>zipalign</code></a>.
- </p>
- </li>
- </ol>
-
- <p>Each time you change a source file or resource, you must run Ant again in order to package up
- the latest version of the application.</p>
-
- <p>To install and run your application on an emulator, see the following section about <a href=
- "#RunningOnEmulator">Running on the Emulator</a>.</p>
-
- <h2 id="ReleaseMode">Building in Release Mode</h2>
-
- <p>When you're ready to release and distribute your application to end-users, you must build your
- application in release mode. Once you have built in release mode, it's a good idea to perform
- additional testing and debugging with the final .apk.</p>
-
- <p>Before you start building your application in release mode, be aware that you must sign the
- resulting application package with your private key, and should then align it using the {@code
- zipalign} tool. There are two approaches to building in release mode: build an unsigned package
- in release mode and then manually sign and align the package, or allow the build script to sign
- and align the package for you.</p>
-
- <h3 id="ManualReleaseMode">Build unsigned</h3>
-
- <p>If you build your application <em>unsigned</em>, then you will need to manually sign and align
- the package.</p>
-
- <p>To build an <em>unsigned</em> .apk in release mode:</p>
-
- <ol>
- <li>Open a command-line and navigate to the root of your project directory.</li>
-
- <li>Use Ant to compile your project in release mode:
- <pre>
-ant release
-</pre>
- </li>
- </ol>
-
- <p>This creates your Android application .apk file inside the project <code>bin/</code>
- directory, named <code><em><your_project_name></em>-unsigned.apk</code>.</p>
-
- <p class="note"><strong>Note:</strong> The .apk file is <em>unsigned</em> at this point and can't
- be installed until signed with your private key.</p>
-
- <p>Once you have created the unsigned .apk, your next step is to sign the .apk with your private
- key and then align it with {@code zipalign}. To complete this procedure, read <a href=
- "{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a>.</p>
-
- <p>When your <code>.apk</code> has been signed and aligned, it's ready to be distributed to end-users.
- You should test the final build on different devices or AVDs to ensure that it
- runs properly on different platforms.</p>
-
- <h3 id="AutoReleaseMode">Build signed and aligned</h3>
-
- <p>If you would like, you can configure the Android build script to automatically sign and align
- your application package. To do so, you must provide the path to your keystore and the name of
- your key alias in your project's {@code ant.properties} file. With this information provided,
- the build script will prompt you for your keystore and alias password when you build in release
- mode and produce your final application package, which will be ready for distribution.</p>
-
- <p class="caution"><strong>Caution:</strong> Due to the way Ant handles input, the password that
- you enter during the build process <strong>will be visible</strong>. If you are concerned about
- your keystore and alias password being visible on screen, then you may prefer to perform the
- application signing manually, via Jarsigner (or a similar tool). To instead perform the signing
- procedure manually, <a href="#ManualReleaseMode">build unsigned</a> and then continue with
- <a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a>.</p>
-
- <p>To specify your keystore and alias, open the project {@code ant.properties} file (found in
- the root of the project directory) and add entries for {@code key.store} and {@code key.alias}.
- For example:</p>
- <pre>
-key.store=path/to/my.keystore
-key.alias=mykeystore
-</pre>
-
- <p>Save your changes. Now you can build a <em>signed</em> .apk in release mode:</p>
-
- <ol>
- <li>Open a command-line and navigate to the root of your project directory.</li>
-
- <li>Use Ant to compile your project in release mode:
- <pre>
-ant release
-</pre>
- </li>
-
- <li>When prompted, enter you keystore and alias passwords.
-
- <p class="caution"><strong>Caution:</strong> As described above, your password will be
- visible on the screen.</p>
- </li>
- </ol>
-
- <p>This creates your Android application .apk file inside the project <code>bin/</code>
- directory, named <code><em><your_project_name></em>-release.apk</code>. This .apk file has
- been signed with the private key specified in {@code ant.properties} and aligned with {@code
- zipalign}. It's ready for installation and distribution.</p>
-
- <h3 id="OnceBuilt">Once built and signed in release mode</h3>
-
- <p>Once you have signed your application with a private key, you can install and run it on an
- <a href="#RunningOnEmulator">emulator</a> or <a href="#RunningOnDevice">device</a>. You can
- also try installing it onto a device from a web server. Simply upload the signed .apk to a web
- site, then load the .apk URL in your Android web browser to download the application and begin
- installation. (On your device, be sure you have enabled
- <em>Settings > Applications > Unknown sources</em>.)</p>
-
- <h2 id="RunningOnEmulator">Running on the Emulator</h2>
-
- <p>Before you can run your application on the Android Emulator, you must <a href=
- "{@docRoot}guide/developing/devices/managing-avds.html">create an AVD</a>.</p>
-
- <p>To run your application:</p>
-
- <ol>
- <li>
- <strong>Open the AVD Manager and launch a virtual device</strong>
-
- <p>From your SDK's <code>platform-tools/</code> directory, execute the {@code android} tool
-with the <code>avd</code> options:</p>
- <pre>
-android avd
-</pre>
-
- <p>In the <em>Virtual Devices</em> view, select an AVD and click <strong>Start</strong>.</p>
- </li>
-
- <li>
- <strong>Install your application</strong>
-
- <p>From your SDK's <code>tools/</code> directory, install the {@code .apk} on the
- emulator:</p>
- <pre>
-adb install <em><path_to_your_bin></em>.apk
-</pre>
-
- <p>Your .apk file (signed with either a release or debug key) is in your project {@code bin/}
- directory after you build your application.</p>
-
- <p>If there is more than one emulator running, you must specify the emulator upon which to
- install the application, by its serial number, with the <code>-s</code> option. For
- example:</p>
- <pre>
-adb -s emulator-5554 install <em>path/to/your/app</em>.apk
-</pre>
-
- <p>To see a list of available device serial numbers, execute {@code adb devices}.</p>
- </li>
- </ol>
-
- <p>If you don't see your application on the emulator, try closing the emulator and launching the
- virtual device again from the AVD Manager. Sometimes when you install an application for the
- first time, it won't show up in the application launcher or be accessible by other applications.
- This is because the package manager usually examines manifests completely only on emulator
- startup.</p>
-
- <p>Be certain to create multiple AVDs upon which to test your application. You should have one
- AVD for each platform and screen type with which your application is compatible. For instance, if
- your application compiles against the Android 1.5 (API Level 3) platform, you should create an
- AVD for each platform equal to and greater than 1.5 and an AVD for each <a href=
- "{@docRoot}guide/practices/screens_support.html">screen type</a> you support, then test your
- application on each one.</p>
-
- <p class="note"><strong>Tip:</strong> If you have <em>only one</em> emulator running, you can
- build your application and install it on the emulator in one simple step. Navigate to the root of
- your project directory and use Ant to compile the project with <em>install mode</em>: <code>ant
- install</code>. This will build your application, sign it with the debug key, and install it on
- the currently running emulator.</p>
-
- <h2 id="RunningOnDevice">Running on a Device</h2>
-
- <p>Before you can run your application on a device, you must perform some basic setup for your
- device:</p>
-
- <ul>
- <li>Enable USB Debugging on your device. You can find the setting on most Android devices by
- going to <strong>Settings > Applications > Development > USB debugging</strong>.</li>
-
- <li>Ensure that your development computer can detect your device when connected via USB</li>
- </ul>
-
- <p>Read <a href="{@docRoot}guide/developing/device.html#setting-up">Setting up a Device for
- Development</a> for more information.</p>
-
- <p>Once your device is set up and connected via USB, navigate to your SDK's <code>platform-tools/</code>
- directory and install the <code>.apk</code> on the device:</p>
- <pre>
-adb -d install <em>path/to/your/app</em>.apk
-</pre>
-
- <p>The {@code -d} flag specifies that you want to use the attached device (in case you also have
- an emulator running).</p>
-
- <p>For more information on the tools used above, please see the following documents:</p>
-
- <ul>
- <li><a href="{@docRoot}guide/developing/tools/android.html">android Tool</a></li>
-
- <li><a href="{@docRoot}guide/developing/devices/emulator.html">Android Emulator</a></li>
-
- <li><a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a> (ADB)</li>
- </ul>
-
- <h2 id="Signing">Application Signing</h2>
-
- <p>As you begin developing Android applications, understand that all Android applications must be
- digitally signed before the system will install them on an emulator or device. There are two ways
- to do this: with a <em>debug key</em> (for immediate testing on an emulator or development
- device) or with a <em>private key</em> (for application distribution).</p>
-
- <p>The Android build tools help you get started by automatically signing your .apk files with a
- debug key at build time. This means that you can compile your application and install it on the
- emulator without having to generate your own private key. However, please note that if you intend
- to publish your application, you <strong>must</strong> sign the application with your own private
- key, rather than the debug key generated by the SDK tools.</p>
-
- <p>The ADT plugin helps you get started quickly by signing your .apk files with a debug key,
- prior to installing them on an emulator or development device. This means that you can quickly
- run your application from Eclipse without having to generate your own private key. No specific
- action on your part is needed, provided ADT has access to Keytool. However, please note that if
- you intend to publish your application, you <strong>must</strong> sign the application with your
- own private key, rather than the debug key generated by the SDK tools.</p>
-
- <p>Please read <a href="{@docRoot}guide/publishing/app-signing.html">Signing Your
- Applications</a>, which provides a thorough guide to application signing on Android and what it
- means to you as an Android application developer. The document also includes a guide to exporting
- and signing your application with the ADT's Export Wizard.</p>
-
- <h2 id="AntReference">Ant Command Reference</h2>
- <dt><code>ant clean</code></dt>
- <dd>Cleans the project. If you include the <code>all</code> target before <code>clean</code>
-(<code>ant all clean</code>), other projects are also cleaned. For instance if you clean a
-test project, the tested project is also cleaned.</dd>
-
- <dt><code>ant debug</code></dt>
- <dd>Builds a debug package. Works on application, library, and test projects and compiles
- dependencies as needed.</dd>
-
- <dt id="emma"><code>ant emma debug</code></dt>
- <dd>Builds a test project while building the tested project with instrumentation turned on.
- This is used to run tests with code coverage enabled.</dd>
-
- <dt><code>ant release</code></dt>
- <dd>Builds a release package.</dd>
-
- <dt><code>ant instrument</code>
- </dt>
- <dd>Builds an instrumented debug package. This is generally called automatically when building a
- test project with code coverage enabled (with the <code>emma</code>
- target)</dd>
-
- <dt><code>ant <build_target> install</code></dt>
- <dd>Builds and installs a package. Using <code>install</code> by itself fails.</dd>
-
- <dt><code>ant installd</code></dt>
- <dd>Installs an already compiled debug package. This fails if the <code>.apk</code> is not
- already built.</dd>
-
- <dt><code>ant installr</code></dt>
- <dd>Installs an already compiled release package. This fails if the <code>.apk</code> is not
- already built.</dd>
-
- <dt><code>ant installt</code></dt>
- <dd>Installs an already compiled test package. Also installs the <code>.apk</code> of the
- tested application. This fails if the <code>.apk</code> is not already built.</dd>
-
- <dt><code>ant installi</code></dt>
- <dd>Installs an already compiled instrumented package. This is generally not used manually as
- it's called when installing a test package. This fails if the <code>.apk</code> is not already
- built.</dd>
-
- <dt><code>ant test</code></dt>
- <dd>Runs the tests (for test projects). The tested and test <code>.apk</code> files must be
- previously installed.</dd>
-
- <dt><code>ant debug installt test</code></dt>
- <dd>Builds a test project and the tested project, installs both <code>.apk</code> files, and
- runs the tests.</dd>
-
- <dt><code>ant emma debug install test</code></dt>
- <dd>Builds a test project and the tested project, installs both <code>.apk</code> files, and
- runs the tests with code coverage enabled.</dd>
-
diff --git a/docs/html/guide/developing/building/building-eclipse.jd b/docs/html/guide/developing/building/building-eclipse.jd
deleted file mode 100644
index 6ebc49e..0000000
--- a/docs/html/guide/developing/building/building-eclipse.jd
+++ /dev/null
@@ -1,165 +0,0 @@
-page.title=Building and Running from Eclipse with ADT
-parent.title=Building and Running
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#RunningOnEmulatorEclipse">Running on an Emulator</a></li>
-
- <li><a href="#RunningOnDeviceEclipse">Running on a Device</a></li>
-
- <li><a href="#RunConfig">Creating a Run Configuration</a></li>
- </ol>
- </div>
- </div>
-
- <p>Eclipse and ADT provide an environment where most of the details of the build process are
- hidden from you. By default, the build process constantly runs in the background as you make
- changes to your project.</p>
-
- <p>When Eclipse automatically builds your application, it enables debugging and signs the
- <code>.apk</code> with a debug key, by default. When you run the application,
- Eclipse invokes ADB and installs your application to a device or emulator, so you do not have to
- manually perform these tasks. Since most of the build process is taken care of by Eclipse, the
- following topics show you how to run an application, which will automatically build your
- application as well.</p>
-
- <p>To distribute your application, however, you must build your application in release mode and sign the
- <code>.apk</code> file with your own private key.</p>
-
- <p>This document shows you how to run your application on an emulator or a real device
- from Eclipse—all of which is done using the debug version of your application.
- For more information about how to sign your application with a private key for release, see <a href=
- "{@docRoot}guide/publishing/app-signing.html#ExportWizard">Signing Your Applications</a></p>
-
- <h2 id="RunningOnEmulatorEclipse">Running on the emulator</h2>
-
- <p>Before you can run your application on the Android Emulator, you must <a href=
- "{@docRoot}guide/developing/devices/managing-avds.html">create an AVD</a>.</p>
-
- <p>To run (or debug) your application, select <strong>Run</strong> > <strong>Run</strong> (or
- <strong>Run</strong> > <strong>Debug</strong>) from the Eclipse menu bar. The ADT plugin will
- automatically create a default run configuration for the project. Eclipse will then perform the
- following:</p>
-
- <ol>
- <li>Compile the project (if there have been changes since the last build).</li>
-
- <li>Create a default run configuration (if one does not already exist for the project).</li>
-
- <li>Install and start the application on an emulator (or device), based on the Deployment
- Target defined by the run configuration.
-
- <p>By default, Android run configurations use an "automatic target" mode for selecting a
- device target. For information on how automatic target mode selects a deployment target, see
- <a href="#AutoAndManualTargetModes">Automatic and manual target modes</a> below.</p>
- </li>
- </ol>
-
- <p>If you run the application with the Debug option, the application will start in the "Waiting For Debugger" mode. Once the debugger
- is attached, Eclipse opens the Debug perspective and starts the application's main activity. Otherwise, if you run the
- application with the normal Run option, Eclipse installs the application on the device and launches the main activity.</p>
-
- <p>To set or change the run configuration used for your project, use the run configuration
- manager. See the section below about <a href="#RunConfig">Creating a Run Configuration</a> for more information.</p>
-
- <p>Be certain to create multiple AVDs upon which to test your application. You should have one
- AVD for each platform and screen type with which your application is compatible. For instance, if
- your application compiles against the Android 1.5 (API Level 3) platform, you should create an
- AVD for each platform equal to and greater than 1.5 and an AVD for each <a href=
- "{@docRoot}guide/practices/screens_support.html">screen type</a> you support, then test your
- application on each one.</p>
-
- <h2 id="RunningOnDeviceEclipse">Running on a device</h2>
-
- <p>Before you can run your application on a device, you must perform some basic setup for your
- device:</p>
-
- <ul>
- <li>Ensure that your application is debuggable by setting the
- <code>android:debuggable</code> attribute of the <code><application></code>
- element to <code>true</code>. As of ADT 8.0, this is done by default when you build in debug mode.</li>
-
- <li>Enable USB Debugging on your device. You can find the setting on most Android devices by
- going to <strong>Settings > Applications > Development > USB debugging</strong>.</li>
-
- <li>Ensure that your development computer can detect your device when connected via USB</li>
- </ul>
-
- <p>Read <a href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a>
- for more information.</p>
-
- <p>Once set up and your device is connected via USB, install your application on the device by
- selecting <strong>Run</strong> > <strong>Run</strong> (or <strong>Run</strong> >
- <strong>Debug</strong>) from the Eclipse menu bar.</p>
-
- <h2 id="RunConfig">Creating a Run Configuration</h2>
-
- <p>The run configuration specifies the project to run, the Activity to start, the emulator or
- connected device to use, and so on. When you first run a project as an <em>Android
- Application</em>, ADT will automatically create a run configuration. The default run
- configuration will launch the default project Activity and use automatic target mode for device
- selection (with no preferred AVD). If the default settings don't suit your project, you can
- customize the run configuration or even create a new one.</p>
-
- <p>To create or modify a run configuration, refer to the Eclipse documentation on how to create Run configurations.
- The following steps highlight the important things you need to do for an Android project:</p>
-
- <ol>
- <li>Open the run configuration manager from the Run Menu.</li>
-
- <li>Expand the <strong>Android Application</strong> item and create a new configuration or open
- an existing one.
- </li>
-
- <li>With the Run Configuration selected, adjust your desired run configuration settings:
- <ul>
- <li>In the Android tab, specify the Project and Activity to launch.
- </li>
- <li><p>In the Target tab, consider whether you'd like to use Manual or Automatic mode when
- selecting an AVD to run your application. See the following section on <a href=
- "#AutoAndManualTargetModes">Automatic and manual target modes</a>).</p>
-
- <p>You can specify any emulator options to the Additional Emulator Command Line Options
- field. For example, you could add <code>-scale 96dpi</code> to scale the AVD's screen to an
- accurate size, based on the dpi of your computer monitor. For a full list of emulator
- options, see the <a href="{@docRoot}guide/developing/tools/emulator.html">Android
- Emulator</a> document.</p>
- </li>
- </ul>
- </li>
- </ol>
-
- <h4 id="AutoAndManualTargetModes">Automatic and manual target modes</h4>
-
- <p>By default, a run configuration uses the <strong>automatic</strong> target mode in order to
- select an AVD. In this mode, ADT will select an AVD for the application in the following
- manner:</p>
-
- <ol>
- <li>If there's a device or emulator already running and its AVD configuration meets the
- requirements of the application's build target, the application is installed and run upon
- it.</li>
-
- <li>If there's more than one device or emulator running, each of which meets the requirements
- of the build target, a "device chooser" is shown to let you select which device to use.</li>
-
- <li>If there are no devices or emulators running that meet the requirements of the build
- target, ADT looks at the available AVDs. If there is an AVD that matches the build target of the project,
- ADT chooses that AVD. If the AVD versions are newer than the build target of the project, ADT chooses
- the oldest possible version of an AVD that meets the project's build target requirement.</li>
-
- <li>If there are no suitable AVDs, the application is not installed a console error warning tells
- you that there is no existing AVD that meets the build target requirements.</li>
- </ol>
-
- <p>However, if a "preferred AVD" is selected in the run configuration, then the application will
- <em>always</em> be deployed to that AVD. If it's not already running, then a new emulator will be
- launched.</p>
-
- <p>If your run configuration uses <strong>manual</strong> mode, then the "device chooser" is
- presented every time that your application is run, so that you can select which AVD to use.</p>
\ No newline at end of file
diff --git a/docs/html/guide/developing/building/index.jd b/docs/html/guide/developing/building/index.jd
deleted file mode 100644
index 569cd28..0000000
--- a/docs/html/guide/developing/building/index.jd
+++ /dev/null
@@ -1,81 +0,0 @@
-page.title=Building and Running
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#detailed-build">A Detailed Look at the Build Process</a></li>
- </ol>
- </div>
- </div>
-
- <p>During the build process, your Android projects are compiled and packaged into an .apk file,
- the container for your application binary. It contains all of the information necessary to run
- your application on a device or emulator, such as compiled <code>.dex</code> files (<code>.class</code> files
- converted to Dalvik byte code), a binary version of the <code>AndroidManifest.xml</code> file, compiled
- resources (<code>resources.arsc</code>) and uncompiled resource files for your application.</p>
-
- <p>If you are developing in Eclipse, the ADT plugin incrementally builds your project as you
- make changes to the source code. Eclipse outputs an <code>.apk</code> file automatically to the bin folder of
- the project, so you do not have to do anything extra to generate the <code>.apk</code>.</p>
-
- <p>If you are developing in a non-Eclipse environment, you can build your project with the
- generated <code>build.xml</code> Ant file that is in the project directory. The Ant file calls targets that
- automatically call the build tools for you.</p>
-
- <p>To run an application on an emulator or device, the application must be signed using debug or
- release mode. You typically want to sign your application in debug mode when you develop and test
- your application, because the build tools use a debug key with a known password so you do not have
- to enter it every time you build. When you are ready to release the application to Google
- Play, you must sign the application in release mode, using your own private key.</p>
-
- <p>Fortunately, Eclipse or your Ant build script signs the application for you in debug mode
- when you build your application. You can also easily setup Eclipse or your Ant build to sign your
- application in release mode as well. For more information on signing applications, see <a href=
- "{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a>.</p>
-
- <p>The following diagram depicts the components involved in building and running an application:</p>
-
- <img src="{@docRoot}images/build-simplified.png" />
-
- <h2 id="detailed-build">A Detailed Look at the Build Process</h2>
-
- <p>The build process involves many tools and processes that generate intermediate files on the
- way to producing an <code>.apk</code>. If you are developing in Eclipse, the complete build process is
- automatically done periodically as you develop and save your code changes. If you are using other
- IDEs, this build process is done every time you run the generated Ant build script for your
- project. It is useful, however, to understand what is happening under the hood since much of the
- tools and processes are masked from you. The following diagram depicts the different tools and
- processes that are involved in a build:</p>
-
- <img src="{@docRoot}images/build.png" />
-
- <p>The general process for a typical build is outlined below:</p>
-
- <ul>
-
- <li>The Android Asset Packaging Tool (aapt) takes your application resource files, such as the
- <code>AndroidManifest.xml</code> file and the XML files for your Activities, and compiles them. An <code>R.java</code> is
- also produced so you can reference your resources from your Java code.</li>
-
- <li>The aidl tool converts any <code>.aidl</code> interfaces that you have into Java interfaces.</li>
-
- <li>All of your Java code, including the <code>R.java</code> and <code>.aidl</code> files, are compiled by the Java
- compiler and .class files are output.</li>
-
- <li>The dex tool converts the .class files to Dalvik byte code. Any 3rd party libraries and
- .class files that you have included in your project are also converted into <code>.dex</code> files so that
- they can be packaged into the final <code>.apk</code> file.</li>
-
- <li>All non-compiled resources (such as images), compiled resources, and the .dex files are
- sent to the apkbuilder tool to be packaged into an <code>.apk</code> file.</li>
-
- <li>Once the <code>.apk</code> is built, it must be signed with either a debug or release key before it can
- be installed to a device.</li>
-
- <li>Finally, if the application is being signed in release mode, you must align the <code>.apk</code> with
- the zipalign tool. Aligning the final <code>.apk</code> decreases memory usage when the application is
- running on a device.</li>
- </ul>
-
diff --git a/docs/html/guide/developing/debug-tasks.html b/docs/html/guide/developing/debug-tasks.html
deleted file mode 100644
index 4e73804..0000000
--- a/docs/html/guide/developing/debug-tasks.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/debugging/index.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should be redirected. Please <a
-href="http://developer.android.com/guide/developing/debugging/index.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/debugging/ddms.jd b/docs/html/guide/developing/debugging/ddms.jd
deleted file mode 100644
index 9892e49..0000000
--- a/docs/html/guide/developing/debugging/ddms.jd
+++ /dev/null
@@ -1,357 +0,0 @@
-page.title=Using DDMS
-parent.title=Debugging
-parent.link=index.html
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#running">Running DDMS</a></li>
- <li><a href="#how-ddms-works">How DDMS Interacts with a Debugger</a></li>
-
- <li><a href="#using-ddms">Using DDMS</a>
- <ol>
- <li><a href="#heap">Viewing heap usage for a process</a></li>
- <li><a href="#alloc">Tracking memory allocation of objects</a></li>
- <li><a href="#emulator">Working with an emulator or device's file system</a></li>
- <li><a href="#thread">Examining thread information</a></li>
- <li><a href="#profiling">Starting method profiling</a></li>
- <li><a href="#network">Using the Network Traffic tool</a></li>
- <li><a href="#logcat">Using LogCat</a></li>
- <li><a href="#ops-location">Emulating phone operations and location</a></li>
- </ol>
-
- </li>
- </ol>
- </div>
- </div>
-
- <p>Android ships with a debugging tool called the Dalvik Debug Monitor Server (DDMS), which
- provides port-forwarding services, screen capture on the device, thread and heap information on
- the device, logcat, process, and radio state information, incoming call and SMS spoofing,
- location data spoofing, and more. This page provides a modest discussion of DDMS features; it is
- not an exhaustive exploration of all the features and capabilities.</p>
-
- <h2 id="running">Running DDMS</h2>
- <p>DDMS is integrated into Eclipse and is also shipped in the <code>tools/</code> directory of the
- SDK. DDMS works with both the emulator and a connected device. If both are connected and running simultaneously,
- DDMS defaults to the emulator.</p>
-
- <ul>
- <li>From Eclipse: Click <strong>Window > Open Perspective > Other... > DDMS</strong>.</li>
- <li>From the command line: Type <code>ddms</code> (or <code>./ddms</code> on Mac/Linux) from the <code>tools/</code>
- directory. </li>
- </ul>
-
-
- <h2 id="how-ddms-works">How DDMS Interacts with a Debugger</h2>
-
- <p>On Android, every application runs in its own process, each of which runs in its own virtual machine
- (VM). Each VM exposes a unique port that a debugger can attach to.</p>
-
- <p>When DDMS starts, it connects to <a href="{@docRoot}guide/developing/tools/adb.html">adb</a>.
- When a device is connected, a VM monitoring service is created between
- <code>adb</code> and DDMS, which notifies DDMS when a VM on the device is started or terminated. Once a VM
- is running, DDMS retrieves the the VM's process ID (pid), via <code>adb</code>, and opens a connection to the
- VM's debugger, through the adb daemon (adbd) on the device. DDMS can now talk to the VM using a
- custom wire protocol.</p>
-
- <p>DDMS assigns a debugging port to each VM on the device. Typically,
- DDMS assigns port 8600 for the first debuggable VM, the next on 8601, and so on. When a debugger
- connects to one of these ports, all traffic is forwarded to the debugger from the associated
- VM. You can only attach a single debugger to a single port, but DDMS can handle multiple, attached
- debuggers.</p>
-
- <p>By default, DDMS also listens on another debugging port, the DDMS "base port" (8700, by default).
- The base port is a port forwarder, which can accept VM traffic from any debugging port and forward
- it to the debugger on port 8700. This allows you to attach one debugger to port 8700, and debug
- all the VMs on a device. The traffic that is forwarded is determined by the currently selected process
- in the DDMS Devices view.</p>
-
- <p>The following screenshot shows a typical DDMS screen in Eclipse. If you are starting DDMS from
- the command line, the screen is slightly different, but much of the functionality is identical.
- Notice that the highlighted process, <code>com.android.email</code>, that is running in the emulator
- has the debugging port 8700 assigned to it as well as 8606. This signifies that DDMS is currently
- forwarding port 8606 to the static debugging port of 8700.</p>
-
- <img src="{@docRoot}images/debug-ddms.png"
- width="1024" />
- <p class="img-caption"><strong>Figure 1.</strong>
- Screenshot of DDMS</p>
-
- <p>If you are not using Eclipse and ADT, read <a href=
- "{@docRoot}guide/developing/debugging/debugging-projects-cmdline.html#debuggingPort">Configuring
- your IDE to attach to the debugging port</a>, for more information on attaching your
- debugger.</p>
-
- <p class="note"><strong>Tip:</strong> You can set a number of DDMS preferences in
- <strong>File</strong> > <strong>Preferences</strong>. Preferences are saved to
- <code>$HOME/.android/ddms.cfg</code>.</p>
-
- <p class="warning"><strong>Known debugging issues with Dalvik</strong><br />
- Debugging an application in the Dalvik VM should work the same as it does in other VMs. However,
- when single-stepping out of synchronized code, the "current line" cursor may jump to the last
- line in the method for one step.</p>
-
- <h2 id="using-ddms">Using DDMS</h2>
- The following sections describe how to use DDMS and the various tabs and panes that are part of the
- DDMS GUI. The Eclipse version and the command line version have minor UI differences, but the
- same functionality. For information on running DDMS, see the previous section in this document,
- <a href="#running">Running DDMS</a>.
-
-
- <h3 id="heap">Viewing heap usage for a process</h3>
-
- <p>DDMS allows you to view how much heap memory a process is using. This information is useful in
- tracking heap usage at a certain point of time during the execution of your application.</p>
- <p>To view heap usage for a process:</p>
- <ol>
- <li>In the Devices tab, select the process that you want to see the heap information for.</li>
-
- <li>Click the <strong>Update Heap</strong> button to enable heap information for the
- process.</li>
-
- <li>In the Heap tab, click <strong>Cause GC</strong> to invoke garbage collection, which
- enables the collection of heap data. When the operation completes, you will see a group of
- object types and the memory that has been allocated for each type. You can click <strong>Cause
- GC</strong> again to refresh the data.</li>
-
- <li>Click on an object type in the list to see a bar graph that shows the number of objects
- allocated for a particular memory size in bytes.</li>
- </ol>
-
- <h3 id="alloc">Tracking memory allocation of objects</h3>
-
- <p>DDMS provides a feature to track objects that are being allocated to memory and to see which
- classes and threads are allocating the objects. This allows you to track, in real time, where
- objects are being allocated when you perform certain actions in your application. This
- information is valuable for assessing memory usage that can affect application performance.
- </p>
-
- <p>To track memory allocation of objects:</p>
- <ol>
- <li>In the Devices tab, select the process that you want to enable allocation tracking
- for.</li>
-
- <li>In the Allocation Tracker tab, click the <strong>Start Tracking</strong> button to begin
- allocation tracking. At this point, anything you do in your application will be tracked.</li>
-
- <li>Click <strong>Get Allocations</strong> to see a list of objects that have been allocated
- since you clicked on the <strong>Start Tracking</strong> button. You can click on <strong>Get
- Allocations</strong> again to append to the list new objects that that have been
- allocated.</li>
-
- <li>To stop tracking or to clear the data and start over, click the <strong>Stop Tracking
- button</strong>.</li>
-
- <li>Click on a specific row in the list to see more detailed information such as the method and
- line number of the code that allocated the object.</li>
- </ol>
-
- <h3 id="emulator">Working with an emulator or device's file system</h3>
-
- <p>DDMS provides a File Explorer tab that allows you to view, copy, and delete files on the
- device. This feature is useful in examining files that are created by your application or if you
- want to transfer files to and from the device.</p>
-
- <p>To work with an emulator or device's file system:</p>
- <ol>
- <li>In the Devices tab, select the emulator that you want to view the file system for.</li>
-
- <li>To copy a file from the device, locate the file in the File Explorer and click the
- <strong>Pull file</strong> button.</li>
-
- <li>To copy a file to the device, click the <strong>Push file</strong> button on the File
- Explorer tab.</li>
- </ol>
-
- <!-- Need to elaborate more on where things are stored in the file system,
- databases, apks, user info, files that are important to look at -->
-
- <h3 id="thread">Examining thread information</h3>
-
- <p>The Threads tab in DDMS shows you the currently running threads for a selected process.</p>
-
- <ol>
- <li>In the Devices tab, select the process that you want to examine the threads for.</li>
-
- <li>Click the <strong>Update Threads</strong> button.</li>
-
- <li>In the Threads tab, you can view the thread information for the selected process.</li>
- </ol>
-
- <h3 id="profiling">Starting method profiling</h3>
-
- <p>Method profiling is a means to track certain metrics about a method, such as number of calls,
- execution time, and time spent executing the method. If you want more granular control over
- where profiling data is collected, use the {@link android.os.Debug#startMethodTracing()} and
- {@link android.os.Debug#stopMethodTracing()} methods. For more information about generating trace logs, see
- <a href="debugging-tracing.html">Profiling and Debugging UIs</a>.</p>
-
- <p>Before you start method profiling in DDMS, be aware of the following restrictions:</p>
- <ul>
- <li>Android 1.5 devices are not supported.</li>
- <li>Android 2.1 and earlier devices must
- have an SD card present and your application must have permission to write to the SD card.
- <li>Android 2.2 and later devices do not need an SD card. The trace log files are
- streamed directly to your development machine.</li>
- </ul>
-
- <p>To start method profiling:</p>
- <ol>
- <li>On the Devices tab, select the process that you want to enable method profiling for.</li>
-
- <li>Click the <strong>Start Method Profiling</strong> button.</li>
-
- <li>Interact with your application to start the methods that you want to profile.</li>
-
- <li>Click the <strong>Stop Method Profiling</strong> button. DDMS stops profiling your
- application and opens <a href="{@docRoot}guide/developing/debugging/debugging-ui.html">Traceview</a>
- with the method profiling information that was collected
- between the time you clicked on <strong>Start Method Profiling</strong> and <strong>Stop Method
- Profiling</strong>.</li>
- </ol>
-
- <h3 id="network">Using the Network Traffic tool</h3>
-
- <p>In Android 4.0, the DDMS (Dalvik Debug Monitor Server) includes a Detailed
-Network Usage tab that makes it possible to track when your application is
-making network requests. Using this tool, you can monitor how and when your app
-transfers data and optimize the underlying code appropriately. You can also
-distinguish between different traffic types by applying a “tag” to network
-sockets before use.</p>
-
-<p>These tags are shown in a stack area chart in DDMS, as shown in figure 2:</p>
-
-<img src="{@docRoot}images/developing/ddms-network.png" />
-<p class="img-caption"><strong>Figure 2.</strong> Network Usage tab.</p>
-
-<p>By monitoring the frequency of your data transfers, and the amount of data
-transferred during each connection, you can identify areas of your application
-that can be made more battery-efficient. Generally, you should look for
-short spikes that can be delayed, or that should cause a later transfer to be
-pre-empted. </p>
-
-<p>To better identify the cause of transfer spikes, the
-{@link android.net.TrafficStats} API allows you
-to tag the data transfers occurring within a thread using {@link
-android.net.TrafficStats#setThreadStatsTag setThreadStatsTag()}, followed
-by manually tagging (and untagging) individual sockets using {@link
-android.net.TrafficStats#tagSocket tagSocket()} and {@link
-android.net.TrafficStats#untagSocket untagSocket()}. For example:</p>
-
-<pre>TrafficStats.setThreadStatsTag(0xF00D);
-TrafficStats.tagSocket(outputSocket);
-// Transfer data using socket
-TrafficStats.untagSocket(outputSocket);</pre>
-
-<p>Alternatively, the Apache {@link org.apache.http.client.HttpClient} and
-{@link java.net.URLConnection} APIs included in the platform
-automatically tag sockets internally based on the active tag (as
-identified by
-{@link android.net.TrafficStats#getThreadStatsTag getThreadStatsTag()}).
-These APIs correctly tag/untag sockets when recycled through
-keep-alive pools. In the following example,
-{@link android.net.TrafficStats#setThreadStatsTag setThreadStatsTag()}
-sets the active tag to be {@code 0xF00D}.
-There can only be one active tag per thread.
-That is the value that will
-be returned by {@link android.net.TrafficStats#getThreadStatsTag getThreadStatsTag()}
-and thus used by {@link org.apache.http.client.HttpClient}
- to tag sockets. The {@code finally} statement
-invokes
-{@link android.net.TrafficStats#clearThreadStatsTag clearThreadStatsTag()}
-to clear the tag.</p>
-
-<pre>TrafficStats.setThreadStatsTag(0xF00D);
- try {
- // Make network request using HttpClient.execute()
- } finally {
- TrafficStats.clearThreadStatsTag();
-}</pre>
-
-<p>Socket tagging is supported in Android 4.0, but real-time stats will only be
-displayed on devices running Android 4.0.3 or higher.</p>
-
- <h3 id="logcat">Using LogCat</h3>
-
- <p>LogCat is integrated into DDMS, and outputs the messages that you print out using the {@link android.util.Log}
- class along with other system messages such as stack traces when exceptions are thrown. View the
- <a href="{@docRoot}guide/developing/debugging/debugging-log.html">Reading and
- Writing Log Messages.</a> topic for more information on how to log messages to the LogCat.</p>
-
- <p>When you have set up your logging, you can use the LogCat feature of DDMS to filter certain
- messages with the following buttons:</p>
-
- <ul>
- <li>Verbose</li>
-
- <li>Debug</li>
-
- <li>Info</li>
-
- <li>Warn</li>
-
- <li>Error</li>
- </ul>
-
- <p>You can also setup your own custom filter to specify more details such as filtering messages
- with the log tags or with the process id that generated the log message. The add filter,
- edit filter, and delete filter buttons let you manage your custom filters.</p>
-
- <h3 id="ops-location">Emulating phone operations and location</h3>
- <p>The Emulator control tab lets you simulate a
- phone's voice and data network status. This is useful when you want to test your application's
- robustness in differing network environments.</p>
-
- <h4>Changing network state, speed, and latency</h4>
- <p>The Telephony Status section of the Emulator
- controls tab lets you change different aspects of the phone's networks status, speed and latency.
- The following options are available to you and are effective immediately after you set them:</p>
-
- <ul>
- <li>Voice - unregistered, home, roaming, searching, denied</li>
-
- <li>Data - unregistered, home, roaming, searching, denied</li>
-
- <li>Speed - Full, GSM, HSCSD, GPRS, EDGE, UMTS, HSDPA</li>
-
- <li>Latency - GPRS, EDGE, UMTS</li>
- </ul>
-
- <h4>Spoofing calls or SMS text messages</h4>
- <p>The Telephony Actions section of the Emulator
- controls tab lets you spoof calls and messages. This is useful when you want to to test your
- application's robustness in responding to incoming calls and messages that are sent to the phone.
- The following actions are available to you:</p>
-
- <ul>
- <li>Voice - Enter a number in the <strong>Incoming number</strong> field and click
- <strong>Call</strong> to send a simulated call to the emulator or phone. Click the
- <strong>Hang up</strong> button to terminate the call.</li>
-
- <li>SMS - Enter a number in the <strong>Incoming number</strong> field and a message in the
- <strong>Message:</strong> field and click the <strong>Send</strong> button to send the
- message.</li>
- </ul>
-
- <h4>Setting the location of the phone</h4>
- <p>If your application depends on the location of the phone, you can have DDMS send your
- device or AVD a mock location. This is useful if you
- want to test different aspects of your application's location specific features without
- physically moving. The following geolocation data types are available to you:</p>
-
- <ul>
- <li>Manual - set the location by manually specifying decimal or sexagesimal longitude and
- latitude values.</li>
-
- <li>GPX - GPS eXchange file</li>
-
- <li>KML - Keyhole Markup Language file</li>
- </ul>
-
- For more information about providing mock location data, see
- <a href="{@docRoot}guide/topics/location/obtaining-user-location.html#MockData">Obtaining User Location</a>.
-
diff --git a/docs/html/guide/developing/debugging/debugging-devtools.jd b/docs/html/guide/developing/debugging/debugging-devtools.jd
deleted file mode 100644
index 157d62e..0000000
--- a/docs/html/guide/developing/debugging/debugging-devtools.jd
+++ /dev/null
@@ -1,85 +0,0 @@
-page.title=Using the Dev Tools App
-parent.title=Debugging
-parent.link=index.html
-@jd:body
-
-<p>The Dev Tools application is installed by default on all system images included with the SDK,
- so you can use it with the Android Emulator. With the Dev Tools application, you can enable a
- number of settings on your device that will make it easier to test and debug your applications.</p>
-
- <p> If you'd like to install the Dev Tools application
- on a real development device, you can copy the application from your emulator and then install it
- on your device using ADB. To copy the application from a running emulator, execute:</p>
- <pre>
-adb -e pull /system/app/Development.apk ./Development.apk
-</pre>
-
- <p>This copies the .apk file into the current directory. Then install it on your connected device
- with:</p>
- <pre>
-adb -d install Development.apk
-</pre>
-
- <p>To get started, launch the Dev Tools application and select <strong>Development Settings</strong>. This will
- open the Development Settings page with the following options (among others):</p>
-
- <dl>
- <dt><strong>Debug app</strong></dt>
-
- <dd>
- Lets you select the application to debug. You do not need to set this to attach a debugger,
- but setting this value has two effects:
-
- <ul>
- <li>It will prevent Android from throwing an error if you pause on a breakpoint for a long
- time while debugging.</li>
-
- <li>It will enable you to select the <em>Wait for Debugger</em> option to pause application
- startup until your debugger attaches (described next).</li>
- </ul>
- </dd>
-
- <dt><strong>Wait for debugger</strong></dt>
-
- <dd>Blocks the selected application from loading until a debugger attaches. This way you can
- set a breakpoint in {@link android.app.Activity#onCreate onCreate()},
- which is important to debug the startup process of an Activity.
- When you change this option, any currently running instances of the selected application will
- be killed. In order to check this box, you must have selected a debug application as described
- in the previous option. You can do the same thing by adding {@link
- android.os.Debug#waitForDebugger()} to your code.</dd>
-
- <dt><strong>Show screen updates</strong></dt>
-
- <dd>Flashes a momentary pink rectangle on any screen sections that are being redrawn. This is
- very useful for discovering unnecessary screen drawing.</dd>
-
- <dt><strong>Immediately destroy activities</strong></dt>
-
- <dd>Tells the system to destroy an activity as soon as it is stopped (as if Android had to
- reclaim memory). This is very useful for testing the {@link
- android.app.Activity#onSaveInstanceState} / {@link
- android.app.Activity#onCreate(android.os.Bundle)} code path, which would otherwise be difficult
- to force. Choosing this option will probably reveal a number of problems in your application
- due to not saving state. For more information about saving an activity's state, see the
- <a href="{@docRoot}guide/topics/fundamentals/activities.html#SavingActivityState">Activities</a>
-document.</dd>
-
- <dt><strong>Show CPU usage</strong></dt>
-
- <dd>Displays CPU meters at the top of the screen, showing how much the CPU is being used. The
- top red bar shows overall CPU usage, and the green bar underneath it shows the CPU time spent
- in compositing the screen.
- <p class="note">Note: You cannot turn this feature off once it is on, without
- restarting the emulator.</p></dd>
-
- <dt><strong>Show background</strong></dt>
-
- <dd>Displays a background pattern when no activity screens are visible. This typically does not
- happen, but can happen during debugging.</dd>
- </dl>
-
- <p>These settings will be remembered across emulator restarts.</p>
-
-
-
diff --git a/docs/html/guide/developing/debugging/debugging-log.jd b/docs/html/guide/developing/debugging/debugging-log.jd
deleted file mode 100644
index b5b626e..0000000
--- a/docs/html/guide/developing/debugging/debugging-log.jd
+++ /dev/null
@@ -1,308 +0,0 @@
-page.title=Reading and Writing Logs
-parent.title=Debugging
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#logClass">The Log class</a></li>
-
- <li><a href="#startingLogcat">Starting LogCat</a></li>
-
- <li><a href="#filteringOutput">Filtering Log Output</a></li>
-
- <li><a href="#outputFormat">Controlling Log Output Format</a></li>
-
- <li><a href="#alternativeBuffers">Viewing Alternative Log Output Buffers</a></li>
-
- <li><a href="#viewingStd">Viewing stdout and stderr</a></li>
-
- <li><a href="#DebuggingWebPages">Debugging Web Pages</a></li>
- </ol>
- </div>
- </div>
-
- <p>The Android logging system provides a mechanism for collecting and viewing system debug
- output. Logcat dumps a log of system messages, which include things such as stack traces when the
- emulator throws an error and messages that you have written from your application by using the
- {@link android.util.Log} class. You can run LogCat through ADB or from DDMS, which allows you to
- read the messages in real time.</p>
-
- <h2 id="logClass">The <code>Log</code> class</h2>
-
- <p>{@link android.util.Log} is a logging class that you can utilize in your code to print out
- messages to the LogCat. Common logging methods include:</p>
-
- <ul>
- <li>{@link android.util.Log#v(String,String)} (verbose)</li>
-
- <li>{@link android.util.Log#d(String,String)} (debug)</li>
-
- <li>{@link android.util.Log#i(String,String)} (information)</li>
-
- <li>{@link android.util.Log#w(String,String)} (warning)</li>
-
- <li>{@link android.util.Log#e(String,String)} (error)</li>
- </ul>For example:
- <pre class="no-pretty-print">
-Log.i("MyActivity", "MyClass.getView() — get item number " + position);
-</pre>
-
- <p>The LogCat will then output something like:</p>
- <pre class="no-pretty-print">
-I/MyActivity( 1557): MyClass.getView() — get item number 1
-</pre>
-
- <h2 id="startingLogcat">Using LogCat</h2>
-
- <p>You can use LogCat from within DDMS or call it on an ADB shell. For more information on how to
- use LogCat within DDMS, see <a href="{@docRoot}guide/developing/debugging/ddms.html#logcat">Using
- DDMS</a>. To run LogCat, through the ADB shell, the general usage is:</p>
- <pre>
-[adb] logcat [<option>] ... [<filter-spec>] ...
-</pre>
-
- <p>You can use the <code>logcat</code> command from your development computer or from a remote
- adb shell in an emulator/device instance. To view log output in your development computer, you
- use</p>
- <pre>
-$ adb logcat
-</pre>
-
- <p>and from a remote adb shell you use</p>
- <pre>
-# logcat
-</pre>
-
- <p>The following table describes the <code>logcat</code> command line options:</p>
-
- <table>
- <tr>
- <td><code>-c</code></td>
-
- <td>Clears (flushes) the entire log and exits.</td>
- </tr>
-
- <tr>
- <td><code>-d</code></td>
-
- <td>Dumps the log to the screen and exits.</td>
- </tr>
-
- <tr>
- <td><code>-f <filename></code></td>
-
- <td>Writes log message output to <code><filename></code>. The default is
- <code>stdout</code>.</td>
- </tr>
-
- <tr>
- <td><code>-g</code></td>
- <td>Prints the size of the specified log buffer and exits.</td>
- </tr>
-
- <tr>
- <td><code>-n <count></code></td>
-
- <td>Sets the maximum number of rotated logs to <code><count></code>. The default value
- is 4. Requires the <code>-r</code> option.</td>
- </tr>
-
- <tr>
- <td><code>-r <kbytes></code></td>
-
- <td>Rotates the log file every <code><kbytes></code> of output. The default value is
- 16. Requires the <code>-f</code> option.</td>
- </tr>
-
- <tr>
- <td><code>-s</code></td>
-
- <td>Sets the default filter spec to silent.</td>
- </tr>
-
- <tr>
- <td><code>-v <format></code></td>
-
- <td>Sets the output format for log messages. The default is <code>brief</code> format. For a
- list of supported formats, see <a href="#outputFormat">Controlling Log Output
- Format</a>.</td>
- </tr>
- </table>
-
- <h3 id="filteringOutput">Filtering Log Output</h3>
-
- <p>Every Android log message has a <em>tag</em> and a <em>priority</em> associated with it.</p>
-
- <ul>
- <li>The tag of a log message is a short string indicating the system component from which the
- message originates (for example, "View" for the view system).</li>
-
- <li>The priority is one of the following character values, ordered from lowest to highest
- priority:</li>
-
- <li style="list-style: none; display: inline">
- <ul>
- <li><code>V</code> — Verbose (lowest priority)</li>
-
- <li><code>D</code> — Debug</li>
-
- <li><code>I</code> — Info</li>
-
- <li><code>W</code> — Warning</li>
-
- <li><code>E</code> — Error</li>
-
- <li><code>F</code> — Fatal</li>
-
- <li><code>S</code> — Silent (highest priority, on which nothing is ever printed)</li>
- </ul>
- </li>
- </ul>
-
- <p>You can obtain a list of tags used in the system, together with priorities, by running
- LogCat and observing the first two columns of each message, given as
- <code><priority>/<tag></code>.</p>
-
- <p>Here's an example of logcat output that shows that the message relates to priority level "I"
- and tag "ActivityManager":</p>
- <pre>
-I/ActivityManager( 585): Starting activity: Intent { action=android.intent.action...}
-</pre>
-
- <p>To reduce the log output to a manageable level, you can restrict log output using <em>filter
- expressions</em>. Filter expressions let you indicate to the system the tags-priority
- combinations that you are interested in — the system suppresses other messages for the
- specified tags.</p>
-
- <p>A filter expression follows this format <code>tag:priority ...</code>, where <code>tag</code>
- indicates the tag of interest and <code>priority</code> indicates the <em>minimum</em> level of
- priority to report for that tag. Messages for that tag at or above the specified priority are
- written to the log. You can supply any number of <code>tag:priority</code> specifications in a
- single filter expression. The series of specifications is whitespace-delimited.</p>
-
- <p>Here's an example of a filter expression that suppresses all log messages except those with
- the tag "ActivityManager", at priority "Info" or above, and all log messages with tag "MyApp",
- with priority "Debug" or above:</p>
- <pre>
-adb logcat ActivityManager:I MyApp:D *:S
-</pre>
-
- <p>The final element in the above expression, <code>*:S</code>, sets the priority level for all
- tags to "silent", thus ensuring only log messages with "View" and "MyApp" are displayed. Using
- <code>*:S</code> is an excellent way to ensure that log output is restricted to the filters that
- you have explicitly specified — it lets your filters serve as a "whitelist" for log
- output.</p>
-
- <p>The following filter expression displays all log messages with priority level "warning" and higher, on all tags:</p>
- <pre>
-adb logcat *:W
-</pre>
-
- <p>If you're running LogCat from your development computer (versus running it on a
- remote adb shell), you can also set a default filter expression by exporting a value for the
- environment variable <code>ANDROID_LOG_TAGS</code>:</p>
- <pre>
-export ANDROID_LOG_TAGS="ActivityManager:I MyApp:D *:S"
-</pre>
-
- <p>Note that <code>ANDROID_LOG_TAGS</code> filter is not exported to the emulator/device
- instance, if you are running LogCat from a remote shell or using <code>adb shell
- logcat</code>.</p>
-
- <h3 id="outputFormat">Controlling Log Output Format</h3>
-
- <p>Log messages contain a number of metadata fields, in addition to the tag and priority. You can
- modify the output format for messages so that they display a specific metadata field. To do so,
- you use the <code>-v</code> option and specify one of the supported output formats listed
- below.</p>
-
- <ul>
- <li><code>brief</code> — Display priority/tag and PID of the process issuing the
- message (the default format).</li>
-
- <li><code>process</code> — Display PID only.</li>
-
- <li><code>tag</code> — Display the priority/tag only.</li>
-
- <li><code>raw</code> — Display the raw log message, with no other metadata fields.</li>
-
- <li><code>time</code> — Display the date, invocation time, priority/tag, and PID of the
- process issuing the message.</li>
-
- <li><code>threadtime</code> — Display the date, invocation time, priority, tag, and
- the PID and TID of the thread issuing the message.</li>
-
- <li><code>long</code> — Display all metadata fields and separate messages with blank
- lines.</li>
- </ul>
-
- <p>When starting LogCat, you can specify the output format you want by using the
- <code>-v</code> option:</p>
- <pre>
-[adb] logcat [-v <format>]
-</pre>
-
- <p>Here's an example that shows how to generate messages in <code>thread</code> output
- format:</p>
- <pre>
-adb logcat -v thread
-</pre>
-
- <p>Note that you can only specify one output format with the <code>-v</code> option.</p>
-
- <h3 id="alternativeBuffers">Viewing Alternative Log Buffers</h3>
-
- <p>The Android logging system keeps multiple circular buffers for log messages, and not all of
- the log messages are sent to the default circular buffer. To see additional log messages, you can
- run the <code>logcat</code> command with the <code>-b</code> option, to request viewing of an alternate
- circular buffer. You can view any of these alternate buffers:</p>
-
- <ul>
- <li><code>radio</code> — View the buffer that contains radio/telephony related
- messages.</li>
-
- <li><code>events</code> — View the buffer containing events-related messages.</li>
-
- <li><code>main</code> — View the main log buffer (default)</li>
- </ul>
-
- <p>The usage of the <code>-b</code> option is:</p>
- <pre>
-[adb] logcat [-b <buffer>]
-</pre>
-
- <p>Here's an example of how to view a log buffer containing radio and telephony messages:</p>
- <pre>
-adb logcat -b radio
-</pre><a name="stdout"
- id="stdout"></a>
-
- <h2 id="viewingStd">Viewing stdout and stderr</h2>
-
- <p>By default, the Android system sends <code>stdout</code> and <code>stderr</code>
- (<code>System.out</code> and <code>System.err</code>) output to <code>/dev/null</code>. In
- processes that run the Dalvik VM, you can have the system write a copy of the output to the log
- file. In this case, the system writes the messages to the log using the log tags
- <code>stdout</code> and <code>stderr</code>, both with priority <code>I</code>.</p>
-
- <p>To route the output in this way, you stop a running emulator/device instance and then use the
- shell command <code>setprop</code> to enable the redirection of output. Here's how you do it:</p>
- <pre>
-$ adb shell stop
-$ adb shell setprop log.redirect-stdio true
-$ adb shell start
-</pre>
-
- <p>The system retains this setting until you terminate the emulator/device instance. To use the
- setting as a default on the emulator/device instance, you can add an entry to
- <code>/data/local.prop</code> on the device.</p>
-
- <h2 id="DebuggingWebPages">Debugging Web Apps</h2>
- <p>
- If you're developing a web application for Android, you can debug your JavaScript using the console JavaScript APIs,
- which output messages to LogCat. For more information, see
- <a href="{@docRoot}guide/webapps/debugging.html">Debugging Web Apps</a>.</p>
diff --git a/docs/html/guide/developing/debugging/debugging-projects-cmdline.jd b/docs/html/guide/developing/debugging/debugging-projects-cmdline.jd
deleted file mode 100644
index 3b5ceab..0000000
--- a/docs/html/guide/developing/debugging/debugging-projects-cmdline.jd
+++ /dev/null
@@ -1,78 +0,0 @@
-page.title=Debugging from Other IDEs
-parent.title=Debugging
-parent.link=index.html
-@jd:body
-
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#start-debugging">Starting a Debugging Environment</a>
- <ul>
- <li><a href="#debuggingPort">Configuring Your IDE to Attach to the Debugging Port</a></li>
- </ul>
- </li>
- </ol>
- </div>
- </div>
-
- <p>If you are not using Eclipse to develop, you can still take advantage of all the tools that
- the Android SDK provides for debugging. A basic debugging environment consists of:</p>
-
- <ul>
- <li><a href="{@docRoot}guide/developing/tools/adb.html">ADB</a></li>
-
- <li><a href="{@docRoot}guide/developing/debugging/ddms.html">DDMS</a></li>
-
- <li>Java Debugger</li>
- </ul>
-
- <p>You need to obtain a JDWP-compliant Java debugger to properly debug your application.
- Most Java IDEs will already have one included, or you can use a command line debugger,
- such as JDB, if you are using a simple text editor to develop applications.</p>
-
- <h2 id="start-debugging">Starting a debugging environment</h2>
- <p>A Java Debugger assists you in finding problems with
- your code by letting you set breakpoints, step through execution of your application, and examine
- variable values. Since you are not using Eclipse, you have to manually start up the debugging
- environment yourself by running a few tools that are provided in the Android SDK. To begin
- debugging your application, follow these general steps:</p>
-
- <ol>
- <li>Load an AVD with the Android emulator or connect a device to your computer.</li>
-
- <li>Start DDMS from the sdk <code>/tools</code> directory. This also starts ADB if it is
- not already started. You should see your device appear in DDMS.</li>
-
- <li>Install and run your <code>.apk</code> file on the device or emulator. In DDMS, you should see your
- application running under the device that you installed it to.</li>
-
- <li>Attach your debugger to the debugging port 8700, or to the specific port shown for the
- application in DDMS.</li>
- </ol>
-
- <h3 id="debuggingPort">Configuring Your IDE to Attach to the Debugging Port</h3>
-
- <p>DDMS assigns a specific debugging port to every virtual machine that it finds on the
- emulator. You must either attach your IDE to that port (listed on the Info tab for that VM), or
- you can use a default port 8700 to connect to whatever application is currently selected on the
- list of discovered virtual machines.</p>
-
- <p>Your IDE should attach to your application running on the emulator, showing you its threads
- and allowing you to suspend them, inspect their state, and set breakpoints. If you selected "Wait
- for debugger" in the Development settings panel the application will run when Eclipse connects,
- so you will need to set any breakpoints you want before connecting.</p>
-
- <p>Changing either the application being debugged or the "Wait for debugger" option causes the
- system to kill the selected application if it is currently running. You can use this to kill your
- application if it is in a bad state by simply going to the settings and toggling the
- checkbox.</p>
-
-
-
-
-
-
-
diff --git a/docs/html/guide/developing/debugging/debugging-tracing.jd b/docs/html/guide/developing/debugging/debugging-tracing.jd
deleted file mode 100644
index 72f6498..0000000
--- a/docs/html/guide/developing/debugging/debugging-tracing.jd
+++ /dev/null
@@ -1,402 +0,0 @@
-page.title=Profiling with Traceview and dmtracedump
-parent.title=Debugging
-parent.link=index.html
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li>
- <a href="#traceviewLayout">Traceview Layout</a>
-
- <ol>
- <li><a href="#timelinepanel">Timeline Panel</a></li>
-
- <li><a href="#profilepanel">Profile Panel</a></li>
- </ol>
- </li>
-
- <li>
- <a href="#format">Traceview File Format</a>
- <ol>
- <li><a href="#datafileformat">Data File Format</a></li>
-
- <li><a href="#keyfileformat">Key File Format</a></li>
- </ol>
- </li>
-
- <li><a href="#creatingtracefiles">Creating Trace Files</a></li>
-
- <li><a href="#copyingfiles">Copying Trace Files to a Host Machine</a></li>
-
- <li><a href="#runningtraceview">Viewing Trace Files in Traceview</a></li>
-
- <li><a href="#dmtracedump">Using dmtracedump</a></li>
-
- <li><a href="#knownissues">Traceview Known Issues</a></li>
- </ol>
- </div>
- </div>
-
- <p>Traceview is a graphical viewer for execution logs that you create by using the {@link
- android.os.Debug} class to log tracing information in your code. Traceview can help you debug
- your application and profile its performance.</p>
-
- <h2 id="traceviewLayout">Traceview Layout</h2>
-
- <p>When you have a trace log file (generated by adding tracing code to your application or by DDMS),
- you can have Traceview load the log files and display their data in a window visualizes your application
- in two panels:</p>
-
- <ul>
- <li>A <a href="#timelinepanel">timeline panel</a> -- describes when each thread and method
- started and stopped</li>
-
- <li>A <a href="#timelinepanel">profile panel</a> -- provides a summary of what happened inside
- a method</li>
- </ul>
-
- <p>The sections below provide addition information about the traceview output panes.</p>
-
- <h3 id="timelinepanel">Timeline Panel</h3>
-
- <p>The image below shows a close up of the timeline panel. Each thread’s execution is shown
- in its own row, with time increasing to the right. Each method is shown in another color (colors
- are reused in a round-robin fashion starting with the methods that have the most inclusive time).
- The thin lines underneath the first row show the extent (entry to exit) of all the calls to the
- selected method. The method in this case is <code>LoadListener.nativeFinished()</code> and it was selected in
- the profile view.</p>
-
- <img src="{@docRoot}images/traceview_timeline.png"
- alt="Traceview timeline panel"
- width="893"
- height="284" />
- <p class="img-caption"><strong>Figure 1.</strong> The Traceview Timeline Panel</p>
-
- <h3 id="profilepanel">Profile Panel</h3>
-
- <p>Figure 2 shows the profile pane, a summary of all the time spent
- in a method. The table shows both the inclusive and exclusive times (as well as the percentage of
- the total time). Exclusive time is the time spent in the method. Inclusive time is the time spent
- in the method plus the time spent in any called functions. We refer to calling methods as
- "parents" and called methods as "children." When a method is selected (by clicking on it), it
- expands to show the parents and children. Parents are shown with a purple background and children
- with a yellow background. The last column in the table shows the number of calls to this method
- plus the number of recursive calls. The last column shows the number of calls out of the total
- number of calls made to that method. In this view, we can see that there were 14 calls to
- <code>LoadListener.nativeFinished();</code> looking at the timeline panel shows that one of those calls took
- an unusually long time.</p>
-
- <img src="{@docRoot}images/traceview_profile.png"
- alt="Traceview profile panel."
- width="892"
- height="630" />
- <p class="img-caption"><strong>Figure 2.</strong> The Traceview Profile Panel</p>
-
- <h2 id="format">Traceview File Format</h2>
-
- <p>Tracing creates two distinct pieces of output: a <em>data</em> file, which holds the trace
- data, and a <em>key</em> file, which provides a mapping from binary identifiers to thread and
- method names. The files are concatenated when tracing completes, into a single <em>.trace</em>
- file.</p>
-
- <p class="note"><strong>Note:</strong> The previous version of Traceview did not concatenate
- these files for you. If you have old key and data files that you'd still like to trace, you can
- concatenate them yourself with <code>cat mytrace.key mytrace.data >
- mytrace.trace</code>.</p>
-
- <h3 id="datafileformat">Data File Format</h3>
-
- <p>The data file is binary, structured as follows (all values are stored in little-endian
- order):</p>
- <pre>
-* File format:
-* header
-* record 0
-* record 1
-* ...
-*
-* Header format:
-* u4 magic 0x574f4c53 ('SLOW')
-* u2 version
-* u2 offset to data
-* u8 start date/time in usec
-*
-* Record format:
-* u1 thread ID
-* u4 method ID | method action
-* u4 time delta since start, in usec
-</pre>
-
- <p>The application is expected to parse all of the header fields, then seek to "offset to data"
- from the start of the file. From there it just reads 9-byte records until EOF is reached.</p>
-
- <p><em>u8 start date/time in usec</em> is the output from <code>gettimeofday()</code>. It's mainly there so
- that you can tell if the output was generated yesterday or three months ago.</p>
-
- <p><em>method action</em> sits in the two least-significant bits of the <em>method</em> word. The
- currently defined meanings are:</p>
-
- <ul>
- <li>0 - method entry</li>
-
- <li>1 - method exit</li>
-
- <li>2 - method "exited" when unrolled by exception handling</li>
-
- <li>3 - (reserved)</li>
- </ul>
-
- <p>An unsigned 32-bit integer can hold about 70 minutes of time in microseconds.</p>
-
- <h3 id="keyfileformat">Key File Format</h3>
-
- <p>The key file is a plain text file divided into three sections. Each section starts with a
- keyword that begins with '*'. If you see a '*' at the start of a line, you have found the start
- of a new section.</p>
-
- <p>An example file might look like this:</p>
- <pre>
-*version
-1
-clock=global
-*threads
-1 main
-6 JDWP Handler
-5 Async GC
-4 Reference Handler
-3 Finalizer
-2 Signal Handler
-*methods
-0x080f23f8 java/io/PrintStream write ([BII)V
-0x080f25d4 java/io/PrintStream print (Ljava/lang/String;)V
-0x080f27f4 java/io/PrintStream println (Ljava/lang/String;)V
-0x080da620 java/lang/RuntimeException <init> ()V
-[...]
-0x080f630c android/os/Debug startMethodTracing ()V
-0x080f6350 android/os/Debug startMethodTracing (Ljava/lang/String;Ljava/lang/String;I)V
-*end
-</pre>
-<p>The following list describes the major sections of a key file:</p>
- <dl>
- <dt><em>version section</em></dt>
-
- <dd>The first line is the file version number, currently 1. The second line,
- <code>clock=global</code>, indicates that we use a common clock across all threads. A future
- version may use per-thread CPU time counters that are independent for every thread.</dd>
-
- <dt><em>threads section</em></dt>
-
- <dd>One line per thread. Each line consists of two parts: the thread ID, followed by a tab,
- followed by the thread name. There are few restrictions on what a valid thread name is, so
- include everything to the end of the line.</dd>
-
- <dt><em>methods section</em></dt>
-
- <dd>One line per method entry or exit. A line consists of four pieces, separated by tab marks:
- <em>method-ID</em> [TAB] <em>class-name</em> [TAB] <em>method-name</em> [TAB]
- <em>signature</em> . Only the methods that were actually entered or exited are included in the
- list. Note that all three identifiers are required to uniquely identify a method.</dd>
- </dl>
-
- <p>Neither the threads nor methods sections are sorted.</p>
-
- <h2 id="creatingtracefiles">Creating Trace Files</h2>
-
- <p>To use Traceview, you need to generate log files containing the trace information you want to
- analyze.</p>
-
- <p>There are two ways to generate trace logs:</p>
- <ul>
- <li>Include the {@link android.os.Debug} class in your code and call its
- methods to start and stop logging of trace information to disk. This method is very precise because
- you can specify in your code exactly where to start and stop logging trace data.</li>
- <li>Use the method profiling feature of DDMS to generate trace logs. This method is less
- precise since you do not modify code, but rather specify when to start and stop logging with
- a DDMS. Although you have less control on exactly where the data is logged, this method is useful
- if you don't have access to the application's code, or if you do not need the precision of the first method.
- </li>
- </ul>
-
- <p>Before you start generating trace logs, be aware of the following restrictions:</p>
- <ul>
- <li>If you are using the {@link android.os.Debug} class, your device or emulator must have an SD card
- and your application must have permission to write to the SD card. </li>
- <li>If you are using DDMS, Android 1.5 devices are not supported.</li>
- <li>If you are using DDMS, Android 2.1 and earlier devices must
- have an SD card present and your application must have permission to write to the SD card.
- <li>If you are using DDMS, Android 2.2 and later devices do not need an SD card. The trace log files are
- streamed directly to your development machine.</li>
- </ul>
-
- <p>This document focuses on using the {@link android.os.Debug} class to generate trace data. For more information on using DDMS
- to generate trace data, see <a href="ddms.html#profiling">Using the Dalvik Debug Monitor Server.</a>
- </p>
-
- <p>To create the trace files, include the {@link android.os.Debug} class and call one of the
- {@link android.os.Debug#startMethodTracing() startMethodTracing()} methods. In the call, you
- specify a base name for the trace files that the system generates. To stop tracing, call {@link
- android.os.Debug#stopMethodTracing() stopMethodTracing()}. These methods start and stop method
- tracing across the entire virtual machine. For example, you could call
- {@link android.os.Debug#startMethodTracing() startMethodTracing()} in
- your activity's {@link android.app.Activity#onCreate onCreate()} method, and call
- {@link android.os.Debug#stopMethodTracing() stopMethodTracing()} in that activity's
- {@link android.app.Activity#onDestroy()} method.</p>
- <pre>
- // start tracing to "/sdcard/calc.trace"
- Debug.startMethodTracing("calc");
- // ...
- // stop tracing
- Debug.stopMethodTracing();
-</pre>
-
- <p>When your application calls startMethodTracing(), the system creates a file called
- <code><trace-base-name>.trace</code>. This contains the binary method trace data and a
- mapping table with thread and method names.</p>
-
- <p>The system then begins buffering the generated trace data, until your application calls
- stopMethodTracing(), at which time it writes the buffered data to the output file. If the system
- reaches the maximum buffer size before stopMethodTracing() is called, the system stops tracing
- and sends a notification to the console.</p>
-
- <p>Interpreted code will run more slowly when profiling is enabled. Don't try to generate
- absolute timings from the profiler results (i.e. "function X takes 2.5 seconds to run"). The
- times are only useful in relation to other profile output, so you can see if changes have made
- the code faster or slower.</p>
-
- <p>When using the Android emulator, you must specify an SD card when you create your AVD because the trace files
- are written to the SD card. Your application must have permission to write to the SD card as well.
-
- <p>The format of the trace files is previously described <a href="#format">in this
- document</a>.</p>
-
- <h2 id="copyingfiles">Copying Trace Files to a Host Machine</h2>
-
- <p>After your application has run and the system has created your trace files
- <code><trace-base-name>.trace</code> on a device or emulator, you must copy those files to
- your development computer. You can use <code>adb pull</code> to copy the files. Here's an example
- that shows how to copy an example file, calc.trace, from the default location on the emulator to
- the /tmp directory on the emulator host machine:</p>
- <pre>
-adb pull /sdcard/calc.trace /tmp
-</pre>
-
- <h2 id="runningtraceview">Viewing Trace Files in Traceview</h2>
-
- <p>To run Traceview and view the trace files, enter <code>traceview
- <trace-base-name></code>. For example, to run Traceview on the example files copied in the
- previous section, use:</p>
- <pre>
-traceview /tmp/calc
-</pre>
-
- <p class="note"><strong>Note:</strong> If you are trying to view the trace logs of an application
- that is built with ProGuard enabled (release mode build), some method and member names might be obfuscated.
- You can use the Proguard <code>mapping.txt</code> file to figure out the original unobfuscated names. For more information
- on this file, see the <a href="{@docRoot}guide/developing/tools/proguard.html">Proguard</a> documentation.</p>
-
- <h2 id="dmtracedump">Using dmtracdedump</h2>
-
- <p><code>dmtracedump</code> is a tool that gives you an alternate way of generating
- graphical call-stack diagrams from trace log files. The tool uses the Graphviz Dot utility to
- create the graphical output, so you need to install Graphviz before running dmtracedump.</p>
-
- <p>The dmtracedump tool generates the call stack data as a tree diagram, with each call
- represented as a node. It shows call flow (from parent node to child nodes) using arrows. The
- diagram below shows an example of dmtracedump output.</p>
- <img src=
- "{@docRoot}images/tracedump.png"
- width="485"
- height="401" />
- <p class="image-caption"><strong>Figure 3.</strong> Screenshot of dmtracedump</p>
-
- <p>For each node, dmtracedump shows <code><ref>
- <em>callname</em> (<inc-ms>, <exc-ms>,<numcalls>)</code>, where</p>
-
- <ul>
- <li><code><ref></code> -- Call reference number, as used in trace logs</li>
-
- <li><code><inc-ms></code> -- Inclusive elapsed time (milliseconds spent in method,
- including all child methods)</li>
-
- <li><code><exc-ms></code> -- Exclusive elapsed time (milliseconds spent in method,
- not including any child methods)</li>
-
- <li><code><numcalls></code> -- Number of calls</li>
- </ul>
-
- <p>The usage for dmtracedump is:</p>
- <pre>
-dmtracedump [-ho] [-s sortable] [-d trace-base-name] [-g outfile] <trace-base-name>
-</pre>
-
- <p>The tool then loads trace log data from <code><trace-base-name>.data</code> and
- <code><trace-base-name>.key</code>. The table below lists the options for dmtracedump.</p>
-
- <table>
- <tr>
- <th>Option</th>
-
- <th>Description</th>
- </tr>
-
- <tr>
- <td><code>-d <trace-base-name></code></td>
-
- <td>Diff with this trace name</td>
- </tr>
-
- <tr>
- <td><code>-g <outfile></code></td>
-
- <td>Generate output to <outfile></td>
- </tr>
-
- <tr>
- <td><code>-h</code></td>
-
- <td>Turn on HTML output</td>
- </tr>
-
- <tr>
- <td><code>-o</code></td>
-
- <td>Dump the trace file instead of profiling</td>
- </tr>
-
- <tr>
- <td><code>-d <trace-base-name></code></td>
-
- <td>URL base to the location of the sortable javascript file</td>
- </tr>
-
- <tr>
- <td><code>-t <percent></code></td>
-
- <td>Minimum threshold for including child nodes in the graph (child's inclusive time as a
- percentage of parent inclusive time). If this option is not used, the default threshold
- is 20%.</td>
- </tr>
- </table>
-
-
-
- <h2 id="knownissues">Traceview Known Issues</h2>
-
- <dl>
- <dt>Threads</dt>
-
- <dd>
- Traceview logging does not handle threads well, resulting in these two problems:
-
- <ol>
- <li>If a thread exits during profiling, the thread name is not emitted;</li>
-
- <li>The VM reuses thread IDs. If a thread stops and another starts, they may get the same
- ID.</li>
- </ol>
- </dd>
-
- </dl>
\ No newline at end of file
diff --git a/docs/html/guide/developing/debugging/debugging-ui.jd b/docs/html/guide/developing/debugging/debugging-ui.jd
deleted file mode 100644
index 22748be..0000000
--- a/docs/html/guide/developing/debugging/debugging-ui.jd
+++ /dev/null
@@ -1,547 +0,0 @@
-page.title=Debugging and Profiling User Interfaces
-parent.title=Debugging
-parent.link=index.html
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li>
- <a href="#HierarchyViewer">
- Debugging and Optimizing User Interfaces with Hierarchy Viewer
- </a>
- <ol>
- <li><a href="#runhv">Running Hierarchy Viewer and choosing a window</a></li>
- <li><a href="#viewhierarchy">About the View Hierarchy window</a></li>
- <li><a href="#indiView">Working with an individual View in Tree View</a></li>
- <li><a href="#hvdebugging">Debugging with View Hierarchy</a></li>
- <li><a href="#hvoptimize">Optimizing with View Hierarchy</a></li>
- </ol>
- </li>
- <li>
- <a href="#pixelperfect">
- Examining and Designing User Interfaces with Pixel Perfect
- </a>
- <ol>
- <li><a href="#aboutpixelperfect">About the Pixel Perfect window</a></li>
- <li><a href="#overlays">Working with Pixel Perfect overlays</a></li>
- </ol>
- </li>
- <li><a href="#layoutopt">Optimizing Layouts with <code>layoutopt</code></a></li>
- </ol>
- <h2>Related videos</h2>
- <ol>
- <li>
-<iframe title="Hierarchyviewer"
- width="272" height="234"
- src="http://www.youtube.com/embed/PAgE7saQUUY?rel=0&hd=1"
- frameborder="0" allowfullscreen>
-</iframe>
- </li>
- <li>
-<iframe title="Pixel Perfect"
- width="272" height="234"
- src="http://www.youtube.com/embed/C45bMZGdN7Y?rel=0&hd=1"
- frameborder="0"
- allowfullscreen>
-</iframe>
- </li>
- </ol>
- </div>
- </div>
-
- <p>
-Sometimes your application's layout can slow down your application.
- To help debug issues in your layout, the Android SDK provides the Hierarchy Viewer and
- <code>layoutopt</code> tools.
- </p>
-
- <p>The Hierarchy Viewer application allows you to debug and optimize your user interface. It
- provides a visual representation of the layout's View hierarchy (the View Hierarchy window)
- and a magnified view of the display (the Pixel Perfect window).</p>
-
- <p><code>layoutopt</code> is a command-line tool that helps you optimize the layouts and layout
- hierarchies of your applications. You can run it against your layout files or resource
- directories to quickly check for inefficiencies or other types of problems that could be
- affecting the performance of your application.</p>
-
-<h2 id="HierarchyViewer">Debugging and Optimizing User Interfaces with Hierarchy Viewer</h2>
-
-<h3 id="runhv">Running Hierarchy Viewer and choosing a window</h3>
-<p>
- To run Hierarchy Viewer, follow these steps:</p>
-<ol>
- <li>
- Connect your device or launch an emulator.
- <p>
- To preserve security, Hierarchy Viewer can only connect to devices running a
- developer version of the Android system.
- </p>
- </li>
- <li>
- If you have not done so already, install the application you want to work with.
- </li>
- <li>
- Run the application, and ensure that its UI is visible.
- </li>
- <li>
- From a terminal, launch <code>hierarchyviewer</code> from the
- <code><sdk>/tools/</code>
- directory.
- </li>
- <li>
- The first window you see displays a list of devices and emulators. To expand the list
- of Activity objects for a device or emulator, click the arrow on the left. This displays a
- list of the Activity objects whose UI is currently visible on the device or emulator. The
- objects are listed by their Android component name. The list includes both your application
- Activity and system Activity objects. A screenshot of this window appears in
- figure 1.
- </li>
- <li>
- Select the name of your Activity from the list. You can now look at its view
- hierarchy using the View Hierarchy window, or look at a magnified image of the UI using
- the Pixel Perfect window.
- </li>
-</ol>
-<p>
- To learn how to use the View Hierarchy window, go to
- <a href="#viewhierarchy">About the View Hierarchy window</a>. To learn how to use the
- Pixel Perfect window, go to <a href="#pixelperfect">About the Pixel Perfect window</a>.
-</p>
-<img id="Fig1" src="{@docRoot}images/developing/hv_device_window.png" alt="" height="600"/>
-<p class="img-caption"><strong>Figure 1.</strong> Hierarchy Viewer device window</p>
-<h3 id="viewhierarchy">About the View Hierarchy window</h3>
-<p>
- The View Hierarchy window displays the View objects that form the UI of the
- Activity that is running on your device or emulator. You use it to look at individual
- View objects within the context of the entire View tree. For each View object, the View
- Hierarchy window also displays rendering performance data.
-</p>
-<p>
- To see the View Hierarchy window, run Hierarchy Viewer as described in
- the section <a href="#runhv">Running Hierarchy Viewer and choosing a window</a>. Next, click
- <strong>View Hierarchy</strong> at the top of the device window.
-</p>
-<p>
- You should see four panes:
-</p>
-<ul>
- <li>
- <strong>Tree View</strong>: The left-hand pane displays the Tree View,
- a diagram of the Activity object's hierarchy of views. Use Tree View to examine individual
- View objects and see the relationships between View objects in your UI.
- <p>
- To zoom in on the pane, use the slider at the bottom of the pane, or use your mouse
- scroll wheel. To move around in the pane or reveal View objects that are not currently
- visible, click and drag the pane.
- </p>
- <p>
- To highlight the nodes in the tree whose class or ID match a search string, enter the
- string in the <strong>Filter by class or id:</strong> edit box at the bottom of the
- window. The background of nodes that match the search string will change from gray to
- bright blue.
- </p>
- <p>
- To save a screenshot of Tree View to a PNG file, click <strong>Save As PNG</strong> at
- the top of the View Hierarchy window. This displays a dialog in which you can choose
- a directory and file name.
- </p>
- <p>
- To save a layered screenshot of your device or emulator to an Adobe Photoshop (PSD)
- file, click <strong>Capture Layers</strong> at the top of the View Hierarchy window.
- This displays a dialog in which you can choose a directory or file name.
- Each View in the UI is saved as a separate Photoshop layer.
- </p>
- <p>
- In Photoshop (or similar program that accepts .psd files), you can hide, show or edit a
- layer independently of others. When you save a layered screenshot, you can examine and
- modify the image of an individual View object. This helps you experiment with design
- changes.
- </p>
- </li>
- <li>
- The upper right-hand pane displays the <strong>Tree Overview</strong>, a smaller map
- representation of the entire Tree View window. Use Tree Overview to identify the part of the
- view tree that is being displayed in Tree View.
- <p>
- You can also use Tree Overview to move around in the Tree View pane. Click and drag
- the shaded rectangle over an area to reveal it in Tree View.
- </p>
- </li>
- <li>
- The middle right-hand pane displays the <strong>Properties View</strong>,
- a list of the properties for a selected View object. With Properties View, you can
- examine all the properties without having to look at your application source.
- <p>
- The properties are organized by category. To find an individual property, expand
- a category name by clicking the arrow on its left. This reveals all the properties
- in that category.
- </p>
- </li>
- <li>
- The lower right-hand pane displays the <strong>Layout View</strong>,
- a block representation of the UI. Layout View is another way to navigate through your UI.
- When you click on a View object in Tree View, its position in the UI is highlighted.
- Conversely, when you click in an area of Layout View, the View object for that area is
- highlighted in Tree View.
- <p>
- The outline colors of blocks in Layout View provide additional information:
- </p>
- <ul>
- <li>
- Bold red: The block represents the the View that is currently selected in
- Tree View.
- </li>
- <li>
- Light red: The block represents the parent of the block outlined in bold red.
- </li>
- <li>
- White: The block represents a visible View that is not a parent or child of the
- View that is currently selected in Tree View.
- </li>
- </ul>
- </li>
-</ul>
-<p>
- When the UI of the current Activity changes, the View Hierarchy window is not automatically
- updated. To update it, click <strong>Load View Hierarchy</strong> at the top of the window.
-</p>
-<p>
- Also, the window is not updated if you switch to a new Activity. To update it, start by
- clicking the window selection icon in the bottom left-hand corner of the window. This
- navigates back to the Window Selection window. From this window, click the Android
- component name of the new Activity and then click <strong>Load View Hierarchy</strong>
- at the top of the window.
-</p>
-<p>
- A screenshot of the View Hierarchy window appears in figure 2.
-</p>
-<img id="Fig2" src="{@docRoot}images/developing/hv_view_hierarchy_window.png" alt="" height="600"/>
-<p class="img-caption"><strong>Figure 2.</strong> The View Hierarchy window</p>
-<h3 id="indiView">Working with an individual View in Tree View</h3>
-<p>
- Each node in Tree View represents a single View. Some information is always visible. Starting
- at the top of the node, you see the following:
-</p>
-<ol>
- <li>
- View class: The View object's class.
- </li>
- <li>
- View object address: A pointer to View object.
- </li>
- <li>
- View object ID: The value of the
- <code><a href="{@docRoot}guide/topics/resources/layout-resource.html#idvalue">android:id</a>
- </code> attribute.
- </li>
- <li>
- Performance indicators: A set of three colored dots that indicate the rendering
- speed of this View relative to other View objects in the tree. The three dots
- represent (from left to right) the measure, layout, and draw times of the rendering.
- <p>
- The colors indicate the following relative performance:
- </p>
- <ul>
- <li>
- Green: For this part of the render time, this View is in the faster 50% of all
- the View objects in the tree. For example, a green dot for the measure time means
- that this View has a faster measure time than 50% of the View objects in the tree.
- </li>
- <li>
- Yellow: For this part of the render time, this View is in the slower 50% of all
- the View objects in the tree. For example, a yellow dot for the layout time means
- that this View has a slower layout time than 50% of the View objects in the tree.
- </li>
- <li>
- Red: For this part of the render time, this View is the slowest one in the tree.
- For example, a red dot for the draw time means that this View takes the most
- time to draw of all the View objects in the tree.
- </li>
- </ul>
- </li>
- <li>
- View index: The zero-based index of the View in its parent View. If it is the only child,
- this is 0.
- </li>
-</ol>
-<p>
- When you select a node, additional information for the View appears in a small window above
- the node. When you click one of the nodes, you see the following:
-</p>
-<ul>
- <li>
- Image: The actual image of the View, as it would appear in the emulator. If the View has
- children, these are also displayed.
- </li>
- <li>
- View count: The number of View objects represented by this node. This includes the View
- itself and a count of its children. For example, this value is 4 for a View that has 3
- children.
- </li>
- <li>
- Render times: The actual measure, layout, and draw times for the View rendering, in
- milliseconds. These represent the same values as the performance indicators mentioned in
- the preceding section.
- </li>
-</ul>
-<p>
- An annotated screenshot of an individual node in the Tree View window appears in figure 3.
-</p>
-<img id="Fig3" src="{@docRoot}images/developing/hv_treeview_screenshot.png" alt="" height="600"/>
-<p class="img-caption"><strong>Figure 3.</strong> An annotated node in Tree View</p>
-<h3 id="hvdebugging">Debugging with View Hierarchy</h3>
-<p>
- The View Hierarchy window helps you debug an application by providing a static display
- of the UI. The display starts with your application's opening screen. As you step through
- your application, the display remains unchanged until you redraw it by invalidating and
- then requesting layout for a View.
-</p>
-<p>
- To redraw a View in the display:
-</p>
- <ul>
- <li>
- Select a View in Tree View. As you move up towards the root of the tree (to the
- left in the Tree View), you see the highest-level View objects. Redrawing a high-level
- object usually forces the lower-level objects to redraw as well.
- </li>
- <li>
- Click <strong>Invalidate</strong> at the top of the window. This marks the View as
- invalid, and schedules it for a redraw at the next point that a layout is requested.
- </li>
- <li>
- Click <strong>Request Layout</strong> to request a layout. The View and its children
- are redrawn, as well as any other View objects that need to be redrawn.
- </li>
- </ul>
-<p>
- Manually redrawing a View allows you to watch the View object tree and examine the properties of
- individual View objects one step at a time as you go through breakpoints in your code.
-</p>
-<h3 id="hvoptimize">Optimizing with View Hierarchy</h3>
-<p>
- View Hierarchy also helps you identify slow render performance. You start by looking at the
- View nodes with red or yellow performance indicators to identify the slower View objects. As you
- step through your application, you can judge if a View is consistently slow or slow only in
- certain circumstances.
-</p>
-<p>
- Remember that slow performance is not necessarily evidence of a problem, especially for
- ViewGroup objects. View objects that have more children and more complex View objects render
- more slowly.
-</p>
-<p>
- The View Hierarchy window also helps you find performance issues. Just by looking at the
- performance indicators (the dots) for each View node, you can see which View objects are the
- slowest to measure, layout, and draw. From that, you can quickly identify the problems you
- should look at first.
-</p>
-<h2 id="pixelperfect">Examining and Designing User Interfaces with Pixel Perfect</h2>
-<p>
- Pixel Perfect is a tool for examining pixel properties and laying out UIs from a design drawing.
-</p>
-<h3 id="aboutpixelperfect">About the Pixel Perfect window</h3>
-<p>
- The Pixel Perfect window displays a magnified image of the screen that is currently
- visible on the emulator or device. In it, you can examine the properties
- of individual pixels in the screen image. You can also use the Pixel Perfect window
- to help you lay out your application UI based on a bitmap design.
-</p>
-<p>
- To see the Pixel Perfect window, run Hierarchy Viewer, as described in
- the section <a href="#runhv">Running Hierarchy Viewer and choosing a window</a>. Next, click
- <strong>Inspect Screenshot</strong> at the top of the device window. The Pixel Perfect window
- appears.
-</p>
-<p>
- In it, you see three panes:
-</p>
-<ul>
- <li>
- View Object pane: This is a hierarchical list of the View objects that are currently
- visible on the device or emulator screen, including both the ones in your application and
- the ones generated by the system. The objects are listed by their View class.
- To see the class names of a View object's children, expand the View by clicking the
- arrow to its left. When you click a View, its position is highlighted in the Pixel Perfect
- pane on the right.
- </li>
- <li>
- Pixel Perfect Loupe pane: This is the magnified screen image. It is overlaid by a grid in
- which each square represents one pixel. To look at the information for a pixel, click in its
- square. Its color and X,Y coordinates appear at the bottom of the pane.
- <p>
- The magenta crosshair in the pane corresponds to the positioning
- crosshair in the next pane. It only moves when you move the crosshair in the next pane.
- </p>
- <p>
- To zoom in or out on the image, use the <strong>Zoom</strong> slider at the bottom of
- the pane, or use your mouse's scroll wheel.
- </p>
- <p>
- When you select a pixel in the Loupe pane, you see the following information at the
- bottom of the pane:
- </p>
- <ul>
- <li>
- Pixel swatch: A rectangle filled with the same color as the pixel.
- </li>
- <li>
- HTML color code: The hexadecimal RGB code corresponding to the pixel color
- </li>
- <li>
- RGB color values: A list of the (R), green (G), and blue (B) color values of the
- pixel color. Each value is in the range 0-255.
- </li>
- <li>
- X and Y coordinates: The pixel's coordinates, in device-specific pixel units.
- The values are 0-based, with X=0 at the left of the screen and Y=0 at the top.
- </li>
- </ul>
- </li>
- <li>
- Pixel Perfect pane: This displays the currently visible screen as it would appear in the
- emulator.
- <p>
- You use the cyan crosshair to do coarse positioning. Drag the crosshair in the image,
- and the Loupe crosshair will move accordingly. You can also click on a point in the
- Pixel Perfect pane, and the crosshair will move to that point.
- </p>
- <p>
- The image corresponding to the View object selected in the View Object pane is
- outlined in a box that indicates the View object's position on the screen. For the
- selected object, the box is bold red. Sibling and parent View objects have a light
- red box. View objects that are neither parents nor siblings are in white.
- </p>
- <p>
- The layout box may have other rectangles either inside or outside it, each of which
- indicates part of the View. A purple or green rectangle indicates the View bounding box.
- A white or black box inside the layout box represents the <strong>padding</strong>, the
- defined distance between the View object's content and its bounding box. An outer white
- or black rectangle represents the <strong>margins</strong>, the distance between the
- View bounding box and adjacent View objects. The padding and margin boxes are white if
- the layout background is black, and vice versa.
- </p>
- <p>
- You can save the screen image being displayed in the Pixel Perfect pane as a PNG file.
- This produces a screenshot of the current screen. To do this, click
- <strong>Save as PNG</strong> at the top of the window. This displays a dialog,
- in which you can choose a directory and filename for the file.
- </p>
- </li>
-</ul>
-<p>
- The panes are not automatically refreshed when you change one of the View objects or go to
- another Activity. To refresh the Pixel Perfect pane and the Loupe pane, click
- <strong>Refresh Screenshot</strong> at the top of the window. This will change the panes
- to reflect the current screen image. You still may need to refresh the View Object pane;
- to do this, click <strong>Refresh Tree</strong> at the top of the window.
-</p>
-<p>
- To automatically refresh the panes while you are debugging, set
- <strong>Auto Refresh</strong> at the top of the window, and then set a refresh rate
- with the <strong>Refresh Rate</strong> slider at the bottom of the Loupe pane.
-</p>
-<h3 id="overlays">Working with Pixel Perfect overlays</h3>
-<p>
- You often construct a UI based on a design done as a bitmap image. The Pixel Perfect window
- helps you match up your View layout to a bitmap image by allowing you to load the bitmap as an
- <strong>overlay</strong> on the screen image.
-</p>
-<p>
- To use a bitmap image as an overlay:
-</p>
-<ul>
- <li>
- Start your application in a device or emulator and navigate to the Activity whose UI you
- want to work with.
- </li>
- <li>
- Start Hierarchy Viewer and navigate to the Pixel Perfect window.
- </li>
- <li>
- At the top of the window, click <strong>Load Overlay</strong>. A dialog opens, prompting
- for the image file to load. Load the image file.
- </li>
- <li>
- Pixel Perfect displays the overlay over the screen image in the Pixel Perfect pane. The
- lower left corner of the bitmap image (X=0, Y=<em>max value</em>) is anchored on the lower
- leftmost pixel (X=0, Y=<em>max screen</em>) of the screen.
- <p>
- By default, the overlay has a 50% transparency, which allows you to see the screen
- image underneath. You can adjust this with the <strong>Overlay:</strong> slider at the
- bottom of the Loupe pane.
- </p>
- <p>
- Also by default, the overlay is not displayed in the Loupe pane. To display it,
- set <strong>Show in Loupe</strong> at the top of the window.
- </p>
- </li>
-</ul>
-<p>
- The overlay is not saved as part of the screenshot when you save the screen image as a PNG
- file.
-</p>
-<p>
- A screenshot of the Pixel Perfect window appears in figure 4.
-</p>
-<img id="Fig4" src="{@docRoot}images/developing/hv_pixelperfect.png"
- alt=""
- height="600"/>
-<p class="img-caption"><strong>Figure 4.</strong> The Pixel Perfect window</p>
-<h2 id="layoutopt">Optimizing layouts with layoutopt</h2>
-<p>
- The <code>layoutopt</code> tool lets you analyze the XML files that define your
- application's UI to find inefficiencies in the view hierarchy.</p>
-
-<p>
- To run the tool, open a terminal and launch <code>layoutopt <xmlfiles></code>
- from your SDK <code>tools/</code> directory. The <xmlfiles> argument is a space-
- delimited list of resources you want to analyze, either uncompiled resource xml files or
- directories of such files.
-</p>
-<p>
- The tool loads the specified XML files and analyzes their definitions and
- hierarchies according to a set of predefined rules. For every issue it detects, it
- displays the following information:
-</p>
-<ul>
- <li>
- The filename in which the issue was detected.
- </li>
- <li>
- The line number for the issue.
- </li>
- <li>
- A description of the issue, and for some types of issues it also suggests a resolution.
- </li>
-</ul>
-<p>The following is a sample of the output from the tool:</p>
-<pre>
-$ layoutopt samples/
-samples/compound.xml
- 7:23 The root-level <FrameLayout/> can be replaced with <merge/>
- 11:21 This LinearLayout layout or its FrameLayout parent is useless
-samples/simple.xml
- 7:7 The root-level <FrameLayout/> can be replaced with <merge/>
-samples/too_deep.xml
- -1:-1 This layout has too many nested layouts: 13 levels, it should have <= 10!
- 20:81 This LinearLayout layout or its LinearLayout parent is useless
- 24:79 This LinearLayout layout or its LinearLayout parent is useless
- 28:77 This LinearLayout layout or its LinearLayout parent is useless
- 32:75 This LinearLayout layout or its LinearLayout parent is useless
- 36:73 This LinearLayout layout or its LinearLayout parent is useless
- 40:71 This LinearLayout layout or its LinearLayout parent is useless
- 44:69 This LinearLayout layout or its LinearLayout parent is useless
- 48:67 This LinearLayout layout or its LinearLayout parent is useless
- 52:65 This LinearLayout layout or its LinearLayout parent is useless
- 56:63 This LinearLayout layout or its LinearLayout parent is useless
-samples/too_many.xml
- 7:413 The root-level <FrameLayout/> can be replaced with <merge/>
- -1:-1 This layout has too many views: 81 views, it should have <= 80!
-samples/useless.xml
- 7:19 The root-level <FrameLayout/> can be replaced with <merge/>
- 11:17 This LinearLayout layout or its FrameLayout parent is useless
-</pre>
diff --git a/docs/html/guide/developing/debugging/index.jd b/docs/html/guide/developing/debugging/index.jd
deleted file mode 100644
index 0ad1a08..0000000
--- a/docs/html/guide/developing/debugging/index.jd
+++ /dev/null
@@ -1,188 +0,0 @@
-page.title=Debugging
-@jd:body
-
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#stack">Debugging Environment</a></li>
-
- <li><a href="#addltools">Additional Debugging Tools</a></li>
-
- <li><a href="#tips">Debugging Tips</a></li>
- </ol>
- </div>
- </div>
-
- <p>The Android SDK provides most of the tools that you need to debug your applications. You need
- a JDWP-compliant debugger if you want to be able to do things such as step through code,
- view variable values, and pause execution of an application. If you are using Eclipse, a
- JDWP-compliant debugger is already included and there is no setup required. If you are using
- another IDE, you can use the debugger that comes with it and attach the debugger to a special
- port so it can communicate with the application VMs on your devices. The main components that
- comprise a typical Android debugging environment are:</p>
-
- <dl>
- <dt><a href="{@docRoot}guide/developing/tools/adb.html"><strong>adb</strong></a></dt>
-
- <dd><code>adb</code> acts as a middleman between a device and your development system. It provides various
- device management capabilities, including moving and syncing files to the emulator, running a
- UNIX shell on the device or emulator, and providing a general means to communicate with
- connected emulators and devices.</dd>
-
- <dt><a href="{@docRoot}guide/developing/debugging/ddms.html"><strong>Dalvik Debug Monitor
- Server</strong></a></dt>
-
- <dd>DDMS is a graphical program that communicates with your devices through <code>adb</code>. DDMS can
- capture screenshots, gather thread and stack information, spoof incoming calls and SMS
- messages, and has many other features.</dd>
-
- <dt><strong><a href="{@docRoot}guide/developing/device.html">Device</a> or
- <a href="{@docRoot}guide/developing/devices/index.html">Android Virtual Device</a></strong></dt>
-
- <dd>Your application must run in a device or in an AVD so that it can be debugged. An <code>adb</code> device
- daemon runs on the device or emulator and provides a means for the <code>adb</code> host daemon to
- communicate with the device or emulator.</dd>
-
- <dt><strong>JDWP debugger</strong></dt>
-
- <dd>The Dalvik VM (Virtual Machine) supports the JDWP protocol to allow debuggers to attach to
- a VM. Each application runs in a VM and exposes a unique port that you can attach a debugger to
- via DDMS. If you want to debug multiple applications, attaching to each port might become
- tedious, so DDMS provides a port forwarding feature that can forward a specific VM's debugging
- port to port 8700. You can switch freely from application to application by highlighting it in the
- Devices tab of DDMS. DDMS forwards the appropriate port to port 8700. Most modern Java IDEs include a JDWP debugger,
- or you can use a command line debugger such as <a href="http://download.oracle.com/javase/6/docs/technotes/tools/">
- <code>jdb</code></a>.</dd>
- </dl>
-
- <h2>Debugging Environment</h2>
-
- <p>Figure 1 shows how the various debugging tools work together in a typical
- debugging environment.</p>
- <img src="{@docRoot}images/debugging.png"
- alt="Debugging workflow" />
- <p class="img-caption><strong>Figure 1. </strong> Debugging Workflow</p>
-
- <p>On your emulator or device, each application runs in its own instance of a Dalvik VM. The <code>adb</code>
- device daemon allows communication with the VMs from an outside party.</p>
-
- <p>On your development machine, the <code>adb</code> host daemon communicates with the <code>adb</code> device daemon and
- allows tools such as DDMS to communicate with the device or emulator. The <code>adb</code> host daemon also
- allows you to access shell commands on the device as well as providing capabilities such as
- application installation and file transferring.</p>
-
- <p>Each application VM on the device or emulator exposes a debugging port that you can attach to
- via DDMS. DDMS can forward any of these ports to a static debugging port (typically port 8700) by
- selecting the application that you want to debug in the DDMS user interface. A JDWP debugger can
- attach to this static debugging port and debug all the applications that are running on the
- device or emulator without having to attach to multiple ports.</p>
-
- <p>If you are using Eclipse, much of these interconnections are hidden from you. DDMS, <code>adb</code>, and a
- JDWP debugger are all setup for you and you can access them through the Debug and DDMS
- perspectives in Eclipse. If you are developing in a non-Eclipse environment, you have to invoke
- these tools manually.</p>
-
- <h2 id="addltools">Additional Debugging Tools</h2>
-
- <p>In addition to the main debugging tools, the Android SDK provides additional tools to help you
- debug and profile your applications:</p>
-
- <dl>
- <dt><strong><a href="{@docRoot}guide/developing/debugging/debugging-ui.html">Heirarchy Viewer
- and layoutopt</a></strong></dt>
-
- <dd>Graphical programs that let you debug and profile user interfaces.</dd>
-
- <dt><strong><a href=
- "{@docRoot}guide/developing/debugging/debugging-tracing.html">Traceview</a></strong></dt>
-
- <dd>A graphical viewer that displays trace file data for method calls and times saved by your
- application, which can help you profile the performance of your application.</dd>
-
- <dt><strong><a href="{@docRoot}guide/developing/debugging/debugging-devtools.html">Dev Tools
- Android application</a></strong></dt>
-
- <dd>The Dev Tools application included in the emulator system image exposes several settings
- that provide useful information such as CPU usage and frame rate. You can also transfer the
- application to a hardware device.</dd>
- </dl>
-
-
- <h2 id="tips">Debugging Tips</h2>
-
-<p>While debugging, keep these helpful tips in mind to help you figure out common problems with your
-applications:</p>
-
-<dl>
-<dt><strong>Dump the stack trace</strong></dt>
-<dd>To obtain a stack dump from emulator, you can log
-in with <code>adb shell</code>, use <code>ps</code> to find the process you
-want, and then <code>kill -3</code>. The stack trace appears in the log file.
-</dd>
-
-<dt><strong>Display useful info on the emulator screen</strong></dt>
-<dd>The device can display useful information such as CPU usage or highlights
-around redrawn areas. Turn these features on and off in the developer settings
-window as described in <a href="{@docRoot}guide/developing/debugging/debugging-devtools.html">
-Debugging with the Dev Tools App</a>.
-</dd>
-
-<dt><strong>Get application and system state information from the emulator</strong></dt>
-<dd>You can access dumpstate information from the <code>adb shell</code> commands. See
-<a href="{@docRoot}guide/developing/tools/adb.html#dumpsys">dumpsys and
-dumpstate</a> on the adb topic page.</dd>
-
-
-
-<dt><strong>Get wireless connectivity information</strong></dt>
-<dd>You can get information about wireless connectivity using DDMS.
-From the <strong>Device</strong> menu, select <strong>Dump
-radio state</strong>.</dd>
-
-<dt><strong>Log trace data</strong></dt>
-<dd>You can log method calls and other tracing data in an activity by calling
-{@link android.os.Debug#startMethodTracing(String) startMethodTracing()}. See <a
-href="{@docRoot}guide/developing/debugging/debugging-tracing.html">Profiling with Traceview and
-dmtracedump</a> for details. </dd>
-
-<dt><strong>Log radio data</strong></dt>
-<dd>By default, radio information is not logged to the system (it is a lot of
-data). However, you can enable radio logging using the following commands:
-
-<pre class="no-pretty-print">
-adb shell
-logcat -b radio
-</pre>
-</dd>
-
-<dt><strong>Capture screenshots</strong></dt>
-<dd>The Dalvik Debug Monitor Server (DDMS) can capture screenshots from the emulator. Select
-<strong>Device > Screen capture</strong>.</dd>
-
-<dt><strong>Use debugging helper classes</strong></dt>
-<dd>Android provides debug helper classes such as {@link android.util.Log
- util.Log} and {@link android.os.Debug} for your convenience. </dd>
-
-<dt><strong>Garbage collection</strong></dt>
-<dd>
-The debugger and garbage collector are currently loosely integrated. The VM guarantees that any
-object the debugger is aware of is not garbage collected until after the debugger disconnects.
-This can result in a buildup of objects over time while the debugger is connected. For example,
-if the debugger sees a running thread, the associated {@link java.lang.Thread} object is not
-garbage collected even after the thread terminates.
-</dd>
-
-</dl>
-
-<p>See the <a href="{@docRoot}resources/faq/troubleshooting.html">Troubleshooting</a> document
-for answers to some common developing and debugging issues.</p>
-
-
-
-
-
-
-
diff --git a/docs/html/guide/developing/device.jd b/docs/html/guide/developing/device.jd
deleted file mode 100644
index d91551a..0000000
--- a/docs/html/guide/developing/device.jd
+++ /dev/null
@@ -1,267 +0,0 @@
-page.title=Using Hardware Devices
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#setting-up">Setting up a Device for Development</a>
- <ol>
- <li><a href="#VendorIds">USB Vendor IDs</a></li>
- </ol>
- </li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a></li>
- <li><a href="{@docRoot}sdk/oem-usb.html">OEM USB Drivers</a></li>
- </ol>
-</div>
-</div>
-
-<p>When building a mobile application, it's important that you always test your application on a
-real device before releasing it to users. This page describes how to set up your development
-environment and Android-powered device for testing and debugging on the device.</p>
-
-<p>You can use any Android-powered device as an environment for running,
-debugging, and testing your applications. The tools included in the SDK make it easy to install and
-run your application on the device each time you compile. You can install your application on the
-device directly from Eclipse or from the command line with ADB. If
-you don't yet have a device, check with the service providers in your area to determine which
-Android-powered devices are available.</p>
-
-<p>If you want a SIM-unlocked phone, then you might consider the Google Nexus S. To find a place
-to purchase the Nexus S and other Android-powered devices, visit <a
-href="http://www.google.com/phone/detail/nexus-s">google.com/phone</a>.</p>
-
-<p class="note"><strong>Note:</strong> When developing on a device, keep in mind that you should
-still use the <a
-href="{@docRoot}guide/developing/devices/emulator.html">Android emulator</a> to test your
-application
-on configurations that are not equivalent to those of your real device. Although the emulator
-does not allow you to test every device feature (such as the accelerometer), it does
-allow you to verify that your application functions properly on different versions of the Android
-platform, in different screen sizes and orientations, and more.</p>
-
-
-<h2 id="setting-up">Setting up a Device for Development</h2>
-
-<p>With an Android-powered device, you can develop and debug your Android applications just as you
-would on the emulator. Before you can start, there are just a few things to do:</p>
-
-<ol>
- <li>Declare your application as "debuggable" in your Android Manifest.
- <p>When using Eclipse, you can skip this step, because running your app directly from
-the Eclipse IDE automatically enables debugging.</p>
- <p>In the <code>AndroidManifest.xml</code> file, add <code>android:debuggable="true"</code> to
-the <code><application></code> element.</p>
- <p class="note"><strong>Note:</strong> If you manually enable debugging in the manifest
- file, be sure to disable it before you build for release (your published application
-should usually <em>not</em> be debuggable).</p></li>
- <li>Turn on "USB Debugging" on your device.
- <p>On the device, go to <strong>Settings > Applications > Development</strong>
- and enable <strong>USB debugging</strong>
- (on an Android 4.0 device, the setting is
-located in <strong>Settings > Developer options</strong>).</p>
- </li>
- <li>Set up your system to detect your device.
- <ul>
- <li>If you're developing on Windows, you need to install a USB driver for adb. For an
-installation guide and links to OEM drivers, see the <a href="{@docRoot}sdk/oem-usb.html">OEM USB
-Drivers</a> document.</li>
- <li>If you're developing on Mac OS X, it just works. Skip this step.</li>
- <li>If you're developing on Ubuntu Linux, you need to add a
-<code>udev</code> rules file that contains a USB configuration for each type of device
-you want to use for development. In the rules file, each device manufacturer
-is identified by a unique vendor ID, as specified by the
-<code>ATTR{idVendor}</code> property. For a list of vendor IDs, see <a
-href="#VendorIds">USB Vendor IDs</a>, below. To set up device detection on
-Ubuntu Linux:
-
- <ol type="a">
- <li>Log in as root and create this file:
- <code>/etc/udev/rules.d/51-android.rules</code></span>.
- <p>Use this format to add each vendor to the file:<br/>
- <code>SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"</code>
- <br /><br />
-
- In this example, the vendor ID is for HTC. The <code>MODE</code>
-assignment specifies read/write permissions, and <code>GROUP</code> defines
-which Unix group owns the device node. </p>
-
- <p class="note"><strong>Note:</strong> The rule syntax
-may vary slightly depending on your environment. Consult the <code>udev</code>
-documentation for your system as needed. For an overview of rule syntax, see
-this guide to <a
-href="http://www.reactivated.net/writing_udev_rules.html">writing udev
-rules</a>.</p>
- </li>
- <li>Now execute:<br/>
- <code>chmod a+r /etc/udev/rules.d/51-android.rules</code>
- </li>
- </ol>
- </li>
- </ul>
- </li>
-</ol>
-
-<p>When plugged in over USB, can verify that your device is connected by executing <code>adb
-devices</code> from your SDK {@code platform-tools/} directory. If connected,
-you'll see the device name listed as a "device."</p>
-
-<p>If using Eclipse, run or debug your application as usual. You will be
-presented with a <b>Device Chooser</b> dialog that lists the available
-emulator(s) and connected device(s). Select the device upon which you want to
-install and run the application.</p>
-
-<p>If using the <a href="{@docRoot}guide/developing/tools/adb.html">Android
-Debug Bridge</a> (adb), you can issue commands with the <code>-d</code> flag to
-target your connected device.</p>
-
-<h3 id="VendorIds">USB Vendor IDs</h3>
-
-<p>This table provides a reference to the vendor IDs needed in order to add USB
-device support on Linux. The USB Vendor ID is the value given to the
-<code>ATTR{idVendor}</code> property in the rules file, as described
-above.</p>
-
-<table>
- <tr>
- <th>Company</th><th>USB Vendor ID</th></tr>
- <tr>
- <td>Acer</td>
- <td><code>0502</code></td>
- </tr>
- <tr>
- <td>ASUS</td>
- <td><code>0b05</code></td>
- </tr>
- <tr>
- <td>Dell</td>
- <td><code>413c</code></td>
- </tr>
- <tr>
- <td>Foxconn</td>
- <td><code>0489</code></td>
- </tr>
- <tr>
- <td>Fujitsu</td>
- <td><code>04c5</code></td>
- </tr>
- <tr>
- <td>Fujitsu Toshiba</td>
- <td><code>04c5</code></td>
- </tr>
- <tr>
- <td>Garmin-Asus</td>
- <td><code>091e</code></td>
- </tr>
- <tr>
- <td>Google</td>
- <td><code>18d1</code></td>
- </tr>
- <tr>
- <td>Hisense</td>
- <td><code>109b</code></td>
- </tr>
- <tr>
- <td>HTC</td>
- <td><code>0bb4</code></td>
- </tr>
- <tr>
- <td>Huawei</td>
- <td><code>12d1</code></td>
- </tr>
- <tr>
- <td>K-Touch</td>
- <td><code>24e3</code></td>
- </tr>
- <tr>
- <td>KT Tech</td>
- <td><code>2116</code></td>
- </tr>
- <tr>
- <td>Kyocera</td>
- <td><code>0482</code></td>
- </tr>
- <tr>
- <td>Lenovo</td>
- <td><code>17ef</code></td>
- </tr>
- <tr>
- <td>LG</td>
- <td><code>1004</code></td>
- </tr>
- <tr>
- <td>Motorola</td>
- <td><code>22b8</code></td>
- </tr>
- <tr>
- <td>NEC</td>
- <td><code>0409</code></td>
- </tr>
- <tr>
- <td>Nook</td>
- <td><code>2080</code></td>
- </tr>
- <tr>
- <td>Nvidia</td>
- <td><code>0955</code></td>
- </tr>
- <tr>
- <td>OTGV</td>
- <td><code>2257</code></td>
- </tr>
- <tr>
- <td>Pantech</td>
- <td><code>10a9</code></td>
- </tr>
- <tr>
- <td>Pegatron</td>
- <td><code>1d4d</code></td>
- </tr>
- <tr>
- <td>Philips</td>
- <td><code>0471</code></td>
- </tr>
- <tr>
- <td>PMC-Sierra</td>
- <td><code>04da</code></td>
- </tr>
- <tr>
- <td>Qualcomm</td>
- <td><code>05c6</code></td>
- </tr>
- <tr>
- <td>SK Telesys</td>
- <td><code>1f53</code></td>
- </tr>
- <tr>
- <td>Samsung</td>
- <td><code>04e8</code></td>
- </tr>
- <tr>
- <td>Sharp</td>
- <td><code>04dd</code></td>
- </tr>
- <tr>
- <td>Sony</td>
- <td><code>054c</code></td>
- </tr>
- <tr>
- <td>Sony Ericsson</td>
- <td><code>0fce</code></td>
- </tr>
- <tr>
- <td>Teleepoch</td>
- <td><code>2340</code></td>
- </tr>
- <tr>
- <td>Toshiba</td>
- <td><code>0930</code></td>
- </tr>
- <tr>
- <td>ZTE</td>
- <td><code>19d2</code></td>
- </tr>
-</table>
diff --git a/docs/html/guide/developing/devices/emulator.jd b/docs/html/guide/developing/devices/emulator.jd
deleted file mode 100644
index 5edd1f5..0000000
--- a/docs/html/guide/developing/devices/emulator.jd
+++ /dev/null
@@ -1,1571 +0,0 @@
-page.title=Using the Android Emulator
-parent.title=Managing Virtual Devices
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#overview">Overview</a></li>
- <li><a href="#avds">Android Virtual Devices and the Emulator</a></li>
- <li><a href="#starting">Starting and Stopping the Emulator</a></li>
- <li><a href="#apps">Installing Applications on the Emulator</a></li>
- <li><a href="#acceleration">Using Hardware Acceleration</a>
- <ol>
- <li><a href="#accel-graphics">Configuring Graphics Acceleration</a></li>
- <li><a href="#accel-vm">Configuring Virtual Machine Acceleration</a></li>
- </ol>
- </li>
- <li><a href="#sdcard">SD Card Emulation</a>
- <ol>
- <li><a href="#sdcard-creating">Creating an SD card image</a></li>
- <li><a href="#sdcard-files">Copying files to an SD card image</a></li>
- <li><a href="#sdcard-loading">Loading an SD card image</a></li>
- </ol>
- </li>
- <li><a href="#diskimages">Working with Emulator Disk Images</a>
- <ol>
- <li><a href="#defaultimages">Default image files</a></li>
- <li><a href="#runtimeimages">Runtime images: user data and SD card</a></li>
- <li><a href="#temporaryimages">Temporary images</a></li>
- </ol>
- </li>
- <li><a href="#emulatornetworking">Emulator Networking</a>
- <ol>
- <li><a href="#networkaddresses">Network Address Space</a></li>
- <li><a href="#networkinglimitations">Local Networking Limitations</a></li>
- <li><a href="#redirection">Using Network Redirection</a></li>
- <li><a href="#dns">Configuring the Emulator's DNS Settings</a></li>
- <li><a href="#proxy">Using the Emulator with a Proxy</a></li>
- <li><a href="#connecting">Interconnecting Emulator Instances</a></li>
- <li><a href="#calling">Sending a Voice Call or SMS to Another Emulator Instance</a></li>
- </ol>
- </li>
- <li><a href="#console">Using the Emulator Console</a>
- <ol>
- <li><a href="#portredirection">Port Redirection</a></li>
- <li><a href="#geo">Geo Location Provider Emulation</a></li>
- <li><a href="#events">Hardware Events Emulation</a></li>
- <li><a href="#power">Device Power Characteristics</a></li>
- <li><a href="#netstatus">Network Status</a></li>
- <li><a href="#netdelay">Network Delay Emulation</a></li>
- <li><a href="#netspeed">Network Speed Emulation</a></li>
- <li><a href="#telephony">Telephony Emulation</a></li>
- <li><a href="#sms">SMS Emulation</a></li>
- <li><a href="#vm">VM State</a></li>
- <li><a href="#window">Emulator Window</a></li>
- <li><a href="#terminating">Terminating an Emulator Instance</a></li>
- </ol>
- </li>
- <li><a href="#limitations">Emulator Limitations</a></li>
- <li><a href="#troubleshooting">Troubleshooting Emulator Problems</a></li>
- </ol>
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a></li>
- <li><a href="{@docRoot}guide/developing/devices/managing-avds.html">Managing AVDs with AVD Manager</a></li>
- </ol>
-</div>
-</div>
-
-<img src="{@docRoot}images/emulator-wvga800l.png" alt="Image of the Android Emulator"
-width="367" height="349" style="margin-left:2em;float:right;"/>
-<p>The Android SDK includes a virtual mobile device emulator
-that runs on your computer. The emulator lets you prototype, develop and test
-Android applications without using a physical device. </p>
-
-<p>The Android emulator mimics all of the hardware and software features
-of a typical mobile device, except that it cannot place actual phone
-calls. It provides a variety of navigation and control keys, which you can "press"
-using your mouse or keyboard to generate events for your application. It also
-provides a screen in which your application is displayed, together with any other
-active Android applications. </p>
-
-<p>To let you model and test your application more easily, the emulator utilizes
-Android Virtual Device (AVD) configurations. AVDs let you define certain hardware
-aspects of your emulated phone and allow you to create many configurations to test
-many Android platforms and hardware permutations. Once your application is running on
-the emulator, it can use the services of the Android platform to invoke other
-applications, access the network, play audio and video, store and retrieve data,
-notify the user, and render graphical transitions and themes. </p>
-
-<p>The emulator also includes a variety of debug capabilities, such as a console
-from which you can log kernel output, simulate application interrupts (such as
-arriving SMS messages or phone calls), and simulate latency effects and dropouts
-on the data network.</p>
-
-
-
-<h2 id="overview">Overview</h2>
-
-<p>The Android emulator is an application that provides a virtual
-mobile device on which you can run your Android applications. It runs a full
-Android system stack, down to the kernel level, that includes a set of
-preinstalled applications (such as the dialer) that you can access from your
-applications. You can choose what version of the Android system you want to
-run in the emulator by configuring AVDs, and you can also customize the
-mobile device skin and key mappings. When launching the emulator and at runtime,
-you can use a variety of commands and options to control its behavior.
-</p>
-
-<p>The Android system images available through the Android SDK Manager contain
-code for the Android Linux kernel, the native libraries, the Dalvik VM, and the
-various Android packages (such as the Android framework and preinstalled
-applications). The emulator provides dynamic binary translation of device
-machine code to the OS and processor architecture of your development
-machine.</p>
-
-<p>The Android emulator supports many hardware features likely to be found on
-mobile devices, including: </p>
-
-<ul>
- <li>An ARMv5 CPU and the corresponding memory-management unit (MMU)</li>
- <li>A 16-bit LCD display</li>
- <li>One or more keyboards (a Qwerty-based keyboard and associated Dpad/Phone
-buttons)</li>
- <li>A sound chip with output and input capabilities</li>
- <li>Flash memory partitions (emulated through disk image files on the
-development machine)</li>
- <li>A GSM modem, including a simulated SIM Card</li>
- <li>A camera, using a webcam connected to your development computer.</li>
- <li>Sensors like an accelerometer, using data from a USB-connected Android device.</li>
-</ul>
-
-<p>The following sections describe the emulator and its use for development of Android
-applications in more detail.</p>
-
-
-<h2 id="avds">Android Virtual Devices and the Emulator</h2>
-
-<p>To use the emulator, you first must create one or more AVD configurations. In each
-configuration, you specify an Android platform to run in the emulator and the set of hardware
-options and emulator skin you want to use. Then, when you launch the emulator, you specify
-the AVD configuration that you want to load. </p>
-
-<p>Each AVD functions as an independent device, with its own private storage for
-user data, SD card, and so on. When you launch the emulator with an AVD configuration,
-it automatically loads the user data and SD card data from the AVD directory. By default,
-the emulator stores the user data, SD card data, and cache in the AVD directory.</p>
-
-<p>To create and manage AVDs you use the AVD Manager UI or the <code>android</code> tool
-that is included in the SDK.
-For complete information about how to set up AVDs, see <a
-href="{@docRoot}guide/developing/devices/index.html">Managing Virtual Devices</a>.</p>
-
-
-<h2 id="starting">Starting and Stopping the Emulator</h2>
-
-<p>During development and testing of your application, you install and run your
-application in the Android emulator. You can launch the emulator as a standalone
-application from a command line, or you can run it from within your Eclipse
-development environment. In either case, you specify the AVD configuration to
-load and any startup options you want to use, as described in this document.
-</p>
-
-<p>You can run your application on a single instance of the emulator or,
-depending on your needs, you can start multiple emulator instances and run your
-application in more than one emulated device. You can use the emulator's
-built-in commands to simulate GSM phone calling or SMS between emulator
-instances, and you can set up network redirection that allows emulators to send
-data to one another. For more information, see <a href="#telephony">Telephony
-Emulation</a>, <a href="#sms">SMS Emulation</a>, and
-<a href="#emulatornetworking">Emulator Networking</a></p>
-
-<p>To start an instance of the emulator from the command line, navigate to the
-<code>tools/</code> folder of the SDK. Enter <code>emulator</code> command
-like this: </p>
-
-<pre>emulator -avd <avd_name> [<options>]</pre>
-
-<p>This initializes the emulator, loads an AVD configuration and displays the emulator
-window. For more information about command line options for the emulator, see the
-<a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a> tool reference.</p>
-
-<p class="note"><strong>Note:</strong> You can run multiple
-instances of the emulator concurrently, each with its own AVD configuration and
-storage area for user data, SD card, and so on.</p>
-
-<p>If you are working in Eclipse, the ADT plugin for Eclipse installs your
-application and starts the emulator automatically, when you run or debug
-the application. You can specify emulator startup options in the Run/Debug
-dialog, in the Target tab. When the emulator is running, you can issue
-console commands as described later in this document.</p>
-
-<p>If you are not working in Eclipse, see <a href="#apps">Installing Applications
-on the Emulator</a> for information about how to install your application.</p>
-
-<p>To stop an emulator instance, just close the emulator's window.</p>
-
-<p>For a reference of the emulator's startup commands and keyboard mapping, see
-the <a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a> tool
-reference.</p>
-
-
-<h2 id="apps">Installing Applications on the Emulator</h2>
-
-<p>If you don't have access to Eclipse or the ADT Plugin, you can install your application on the
-emulator using the <a href="{@docRoot}guide/developing/tools/adb.html#move">adb</a> utility. Before
-installing the application, you need to build and package it into an <code>.apk</code> as described
-in <a href="{@docRoot}guide/developing/building/index.html">Building and
-Running Apps</a>. Once the application is installed, you can start the emulator from the command
-line as described previously, using any startup options necessary.
-When the emulator is running, you can also connect to the emulator instance's
-<a href="#console">console</a> to issue commands as needed.</p>
-
-<p>As you update your code, you periodically package and install it on the emulator.
-The emulator preserves the application and its state data across restarts,
-in a user-data disk partition. To ensure that the application runs properly
-as you update it, you may need to delete the emulator's user-data partition.
-To do so, start the emulator with the <code>-wipe-data</code> option.
-For more information about the user-data partition and other emulator storage,
-see <a href="#diskimages">Working with Emulator Disk Images</a>.</p>
-
-
-<h2 id="acceleration">Using Hardware Acceleration</h2>
-
-<p>In order to make the Android emulator run faster and be more responsive, you can configure it to
-take advantage of hardware acceleration, using a combination of configuration options, specific
-Android system images and hardware drivers.</p>
-
-
-<h3 id="accel-graphics">Configuring Graphics Acceleration</h3>
-
-<p class="caution"><strong>Caution:</strong> As of SDK Tools Revision 17, the graphics
-acceleration feature for the emulator is experimental; be alert for incompatibilities and
-errors when using this feature. </p>
-
-<p>Graphics acceleration for the emulator takes advantage of your development computer's graphics
-hardware, specifically its graphics processing unit (GPU), to make screen drawing faster. To use
-the graphics acceleration feature, you must have the following versions of the Android development
-tools installed:</p>
-
-<ul>
- <li>Android SDK Tools, Revision 17 or higher</li>
- <li>Android SDK Platform API 15, Revision 3 or higher</li>
-</ul>
-
-<p>Use the <a href="{@docRoot}sdk/installing.html#AddingComponents">Android SDK
-Manager</a> to install these components:</p>
-
-<p class="note"><strong>Note:</strong> Not all applications are compatible with graphics hardware
-acceleration. In particular, the Browser application and applications using the {@link
-android.webkit.WebView} component are not compatible with graphics acceleration.</p>
-
-<p>To configure an AVD to use graphics acceleration:</p>
-
-<ol>
- <li>Make sure you have the required SDK components installed (listed above).</li>
- <li>Start the AVD Manager and create a new AVD with the <strong>Target</strong> value of
-<strong>Android 4.0.3 (API Level 15)</strong>, revision 3 or higher.</li>
- <li>If you want to have graphics acceleration enabled by default for this AVD, in the
-<strong>Hardware</strong> section, click <strong>New</strong>, select <strong>GPU emulation</strong>
-and set the value to <strong>Yes</strong>.
- <p class="note"><strong>Note:</strong> You can also enable graphics acceleration when you
-start an emulator using command line options as describe in the next section.</p>
- </li>
- <li>Name the AVD instance and select any other configuration options.
- <p class="caution"><strong>Caution:</strong> Do not select the <strong>Snapshot: Enabled</strong>
-option. Snapshots are not supported for emulators with graphics acceleration enabled.</p>
- </li>
- <li>Click <strong>Create AVD</strong> to save the emulator configuration.</li>
-</ol>
-
-<p>If you set <strong>GPU emulation</strong> to <strong>Yes</strong> for your AVD, then graphics
-acceleration is automatically enabled when you run it. If you did not enable <strong>GPU
-emulation</strong> when you created the AVD, you can still enable it at runtime.</p>
-
-<p>To enable graphics acceleration at runtime for an AVD:</p>
-
-<ul>
- <li>If you are running the emulator from the command line, just include the {@code -gpu on}
-option:
-<pre>emulator -avd <avd_name> -gpu on</pre>
- <p class="note"><strong>Note:</strong> You must specify an AVD configuration that uses
-Android 4.0.3 (API Level 15, revision 3) or higher system image target. Graphics acceleration is not
-available for earlier system images.</p>
- </li>
- <li>If you are running the emulator from Eclipse, run your Android application using an AVD with
-the {@code -gpu on} option enabled:
- <ol>
- <li>In Eclipse, click your Android project folder and then select <strong>Run > Run
-Configurations...</strong></li>
- <li>In the left panel of the <strong>Run Configurations</strong> dialog, select your Android
-project run configuration or create a new configuration.</li>
- <li>Click the <strong>Target</strong> tab.</li>
- <li>Select the AVD you created in the previous procedure.</li>
- <li>In the <strong>Additional Emulator Command Line Options</strong> field, enter:<br>
- {@code -gpu on}</li>
- <li>Run your Android project using this run configuration.</li>
- </ol>
- </li>
-</ul>
-
-
-<h3 id="accel-vm">Configuring Virtual Machine Acceleration</h2>
-
-<p class="caution"><strong>Caution:</strong> As of SDK Tools Revision 17, the virtual machine
-acceleration feature for the emulator is experimental; be alert for incompatibilities and errors
-when using this feature.</p>
-
-<p>Many modern CPUs provide extensions for running virtual machines (VMs) more efficiently. Taking
-advantage of these extensions with the Android emulator requires some additional configuration of
-your development system, but can significantly improve the execution speed. Before attempting to use
-this type of acceleration, you should first determine if your development system’s CPU supports one
-of the following virtualization extensions technologies:</p>
-
-<ul>
- <li>Intel Virtualization Technology (VT, VT-x, vmx) extensions</li>
- <li>AMD Virtualization (AMD-V, SVM) extensions (only supported for Linux)</li>
-</ul>
-
-<p>The specifications from the manufacturer of your CPU should indicate if it supports
-virtualization extensions. If your CPU does not support one of these virtualization technologies,
-then you cannot use virtual machine acceleration.</p>
-
-<p class="note"><strong>Note:</strong> Virtualization extensions are typically enabled through
-your computer's BIOS and are frequently turned off by default. Check the documentation for your
-system's motherboard to find out how to enable virtualization extensions.</p>
-
-<p>Once you have determined that your CPU supports virtualization extensions, make sure you can work
-within these additional requirements of running an emulator inside an accelerated virtual
-machine:</p>
-
-<ul>
- <li><strong>x86 AVD Only</strong> - You must use an AVD that is uses an x86 system image target.
-AVDs that use ARM-based system images cannot be accelerated using the emulator configurations
-described here.</li>
- <li><strong>Not Inside a VM</strong> - You cannot run a VM-accelerated emulator inside another
-virtual machine, such as a VirtualBox or VMWare-hosted virtual machine. You must run the emulator
-directly on your system hardware.</li>
- <li><strong>Other VM Drivers</strong> - If you are running another virtualization technology on
-your system such as VirtualBox or VMWare, you may need to unload the driver for that virtual machine
-hosting software before running an accelerated emulator.</li>
- <li><strong>OpenGL® Graphics</strong> - Emulation of OpenGL ES graphics may not perform at the
-same level as an actual device.</li>
-</ul>
-
-<p>To use virtual machine acceleration with the emulator, you need the following version of Android
-development tools. Use the <a href="{@docRoot}sdk/installing.html#AddingComponents">Android SDK
-Manager</a> to install these components:</p>
-
-<ul>
- <li>Android SDK Tools, Revision 17 or higher</li>
- <li>Android x86-based system image</li>
-</ul>
-
-<p>If your development environment meets all of the requirements for running a VM-accelerated
-emulator, you can use the AVD Manager to create an x86-based AVD configuration:</p>
-
-<ol>
- <li>In the Android SDK Manager, make sure you have an x86-based <strong>System Image</strong>
- installed for your target Android version. If you do not have an x86 <strong>System
- Image</strong> installed, select one in the Android SDK Manager and install it.
- <p class="note"><strong>Tip:</strong> System images are listed under each API Level in the SDK
- Manager. An x86 system image may not be available for all API levels.</p>
- </li>
- <li>Start the AVD Manager and create a new AVD with an x86 value for the
-<strong>CPU/ABI</strong> field. You may need to select a specific <strong>Target</strong> value, or
-select a <strong>Target</strong> value and then select a specific <strong>CPU/ABI</strong>
-option.</li>
- <li>Name the emulator instance and select any other configuration options.</li>
- <li>Click <strong>Create AVD</strong> to save the emulator configuration.</li>
-</ol>
-
-<h4 id="vm-windows">Configuring VM Acceleration on Windows</h4>
-
-<p>Virtual machine acceleration for Windows requires the installation of the Intel Hardware
-Accelerated Execution Manager (Intel HAXM). The software requires an Intel CPU with
-Virtualization Technology (VT) support and one of the following operating systems:</p>
-
-<ul>
- <li>Windows 7 (32/64-bit)</li>
- <li>Windows Vista (32/64-bit)</li>
- <li>Windows XP (32-bit only)</li>
-</ul>
-
-<p>To install the virtualization driver:</p>
-
-<ol>
- <li>Start the Android SDK Manager, select <strong>Extras</strong> and then select <strong>Intel
-Hardware Accelerated Execution Manager</strong>.</li>
- <li>After the download completes, execute {@code
-<sdk>/extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM.exe}.</li>
- <li>Follow the on-screen instructions to complete installation.</li>
- <li>After installation completes, confirm that the virtualization driver is operating correctly by
-opening a command prompt window and running the following command:
- <pre>sc query intelhaxm</pre>
- <p>You should see a status message including the following information:</p>
-<pre>
-SERVICE_NAME: intelhaxm
- ...
- STATE : 4 RUNNING
- ...
-</pre>
- </li>
-</ol>
-
-<p>To run an x86-based emulator with VM acceleration:</p>
-<ul>
- <li>If you are running the emulator from the command line, just specify an x86-based AVD:
-<pre>emulator -avd <avd_name></pre>
- <p class="note"><strong>Note:</strong> You must provide an x86-based AVD configuration
-name, otherwise VM acceleration will not be enabled.</p>
- </li>
- <li>If you are running the emulator from Eclipse, run your Android application with an x86-based
-AVD:
- <ol>
- <li>In Eclipse, click your Android project folder and then select <strong>Run > Run
-Configurations...</strong></li>
- <li>In the left panel of the <strong>Run Configurations</strong> dialog, select your Android
-project run configuration or create a new configuration.</li>
- <li>Click the <strong>Target</strong> tab.</li>
- <li>Select the x86-based AVD you created previously.</li>
- <li>Run your Android project using this run configuration.</li>
- </ol>
- </li>
-</ul>
-
-<p>You can adjust the amount of memory available to the Intel HAXM kernel extension by re-running
-its installer.</p>
-
-<p>You can stop using the virtualization driver by uninstalling it. Re-run the installer or use
-the Control Panel to remove the software.</p>
-
-
-<h4 id="vm-mac">Configuring VM Acceleration on Mac</h4>
-
-<p>Virtual machine acceleration on a Mac requires the installation of the Intel Hardware Accelerated
-Execution Manager (Intel HAXM) kernel extension to allow the Android emulator to make use of CPU
-virtualization extensions. The kernel extension is compatible with Mac OS X Snow Leopard (version
-10.6.0) and higher.</p>
-
-<p>To install the Intel HAXM kernel extension:</p>
-
-<ol>
- <li>Start the Android SDK Manager, select <strong>Extras</strong> and then select <strong>Intel
-Hardware Accelerated Execution Manager</strong>.
- <li>After the download completes, execute
- {@code <sdk>/extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM.dmg}.</li>
- <li>Double click the <strong>IntelHAXM.mpkg</strong> icon to begin installation.</li>
- <li>Follow the on-screen instructions to complete installation.</li>
- <li>After installation completes, confirm that the new kernel extension is operating correctly by
-opening a terminal window and running the following command:
- <pre>kextstat | grep intel</pre>
- <p>You should see a status message containing the following extension name, indicating that the
- kernel extension is loaded:</p>
- <pre>com.intel.kext.intelhaxm</pre>
- </li>
-</ol>
-
-<p>To run an x86-based emulator with VM acceleration:</p>
-<ul>
- <li>If you are running the emulator from the command line, just specify an x86-based AVD:
-<pre>emulator -avd <avd_name></pre>
- <p class="note"><strong>Note:</strong> You must provide an x86-based AVD configuration
-name, otherwise VM acceleration will not be enabled.</p>
- </li>
- <li>If you are running the emulator from Eclipse, run your Android application with an x86-based
-AVD:
- <ol>
- <li>In Eclipse, click your Android project folder and then select <strong>Run > Run
-Configurations...</strong></li>
- <li>In the left panel of the <strong>Run Configurations</strong> dialog, select your Android
-project run configuration or create a new configuration.</li>
- <li>Click the <strong>Target</strong> tab.</li>
- <li>Select the x86-based AVD you created previously.</li>
- <li>Run your Android project using this run configuration.</li>
- </ol>
- </li>
-</ul>
-
-<p>You can adjust the amount of memory available to the Intel HAXM kernel extension by re-running
-the installer.</p>
-
-<p>You can stop using the virtualization kernel driver by uninstalling it. Before removing it, shut
-down any running x86 emulators. To unload the virtualization kernel driver, run the following
-command in a terminal window:</p>
-
-<pre>sudo /System/Library/Extensions/intelhaxm.kext/Contents/Resources/uninstall.sh</pre>
-
-<h4 id="vm-linux">Configuring VM Acceleration on Linux</h4>
-
-<p>Linux-based systems support virtual machine acceleration through the KVM software package. Follow
-<a href="https://www.google.com/?q=kvm+installation">instructions for installing KVM</a> on your
-Linux system, and verify that KVM is enabled. In addition to following the installation
-instructions, be aware of these configuration requirements:</p>
-
-<ul>
- <li>Running KVM requires specific user permissions, make sure you have sufficient permissions
-according to the KVM installation instructions.</li>
- <li>If you use another virtualization technology in your Linux platform, unload its kernel driver
-before running the x86 emulator. For example, the VirtualBox driver program is {@code vboxdrv}.</li>
-</ul>
-
-<p>To run an x86-based emulator with VM acceleration:</p>
-
-<ul>
- <li>If you are running the emulator from the command line, start the emulator with an x86-based
-AVD and include the KVM options:
-<pre>emulator -avd <avd_name> -qemu -m 512 -enable-kvm</pre>
- <p class="note"><strong>Note:</strong> You must provide an x86-based AVD configuration
-name, otherwise VM acceleration will not be enabled.</p>
- </li>
- <li>If you are running the emulator from Eclipse, run your Android application with an x86-based
-AVD and include the KVM options:
- <ol>
- <li>In Eclipse, click your Android project folder and then select <strong>Run > Run
-Configurations...</strong></li>
- <li>In the left panel of the <strong>Run Configurations</strong> dialog, select your Android
-project run configuration or create a new configuration.</li>
- <li>Click the <strong>Target</strong> tab.</li>
- <li>Select the x86-based AVD you created previously.</li>
- <li>In the <strong>Additional Emulator Command Line Options</strong> field, enter:
- <pre>-qemu -m 512 -enable-kvm</pre>
- </li>
- <li>Run your Android project using this run configuration.</li>
- </ol>
- </li>
-</ul>
-
-<p class="note"><strong>Important:</strong> When using the {@code -qemu} command line option, make sure
-it is the last parameter in your command. All subsequent options are interpreted as qemu-specific
-parameters.</p>
-
-
-<h2 id="sdcard">SD Card Emulation</h2>
-
-<p>You can create a disk image and then load it to the emulator at startup, to
-simulate the presence of a user's SD card in the device. To do this, you can specify
-an SD card image when you create an AVD, or you can use the mksdcard utility included
-in the SDK.</p>
-
-<p>The following sections describe how to create an SD card disk image, how to copy
-files to it, and how to load it in the emulator at startup. </p>
-
-<p>Note that you can only load a disk image at emulator startup. Similarly, you
-can not remove a simulated SD card from a running emulator. However, you can
-browse, send files to, and copy/remove files from a simulated SD card either
-with adb or the emulator. </p>
-
-<p>The emulator supports emulated SDHC cards, so you can create an SD card image
-of any size up to 128 gigabytes.</p>
-
-
-<h3 id="sdcard-creating">Creating an SD card image</h3>
-
-<p>There are several ways of creating an SD card image. The easiest way is to use the
-<strong>AVD Manager</strong> to create a new SD card by specifying a size when you create an AVD.
-You can also use the {@code android} command line tool when creating an AVD. Just add the
-<code>-c</code> option to your command: </p>
-
-<pre>android create avd -n <avd_name> -t <targetID> -c <size>[K|M]</pre>
-
-<p>The <code>-c</code> option can also be used to to specify a path to an SD card
-image for the new AVD. For more information, see <a
-href="{@docRoot}guide/developing/devices/managing-avds-cmdline.html">Managing Virtual Devices
-from the Command Line</a>.
-</p>
-
-<p>You can also use the mksdcard tool, included in the SDK, to create a FAT32 disk
-image that you can load in the emulator at startup. You can access mksdcard in
-the tools/ directory of the SDK and create a disk image like this: </p>
-
-<pre>mksdcard <size> <file></pre>
-
-<p>For example:</p>
-
-<pre>mksdcard 1024M sdcard1.iso</pre>
-
-<p>For more information, see <a
-href="{@docRoot}guide/developing/tools/mksdcard.html"><code>mksdcard</code></a>.</p>
-
-
-<h3 id="sdcard-files">Copying files to an SD card image</h3>
-
-<p>Once you have created the disk image, you can copy files to it prior to
-loading it in the emulator. To copy files, you can mount the image as a loop
-device and then copy the files to it, or you can use a utility such as {@code mtools} to
-copy the files directly to the image. The {@code mtools} package is available for Linux,
-Mac, and Windows.</p>
-
-<p>Alternatively, you can use the {@code adb push} command to move files onto an SD card image
-while it is loaded in an emulator. For more information see the <a
-href="{@docRoot}guide/developing/tools/adb.html#copyfiles">{@code adb push}</a> documentation.</p>
-
-<h3 id="sdcard-loading">Loading an SD card image</h3>
-
-<p>By default, the emulator loads the SD card image that is stored with the active
-AVD (see the <code>-avd</code> startup option).</p>
-
-<p>Alternatively, you can start the emulator with the
-<code>-sdcard</code> flag and specify the name and path of your image (relative
-to the current working directory): </p>
-
-<pre>emulator -sdcard <filepath></pre>
-
-
-<h2 id="diskimages">Working with Emulator Disk Images</h2>
-
-<p>The emulator uses mountable disk images stored on your development machine to
-simulate flash (or similar) partitions on an actual device. For example, it uses a
-disk image containing an emulator-specific kernel, the Android system, a
-ramdisk image, and writeable images for user data and simulated SD card.</p>
-
-<p>To run properly, the emulator requires access to a specific set of disk image
-files. By default, the Emulator always looks for the disk images in the
-private storage area of the AVD in use. If no images exist there when
-the Emulator is launched, it creates the images in the AVD directory based on
-default versions stored in the SDK. </p>
-
-<p class="note"><strong>Note:</strong> The default storage location for
-AVDs is in <code>~/.android/avd</code> on OS X and Linux, <code>C:\Documents and
-Settings\<user>\.android\</code> on Windows XP, and
-<code>C:\Users\<user>\.android\</code>
-on Windows Vista.</p>
-
-<p>To let you use alternate or custom versions of the image files, the emulator
-provides startup options that override the default locations and filenames of
-the image files. When you use one of these options, the emulator searches for the image
-file under the image name or location that you specify; if it can not locate the
-image, it reverts to using the default names and location.</p>
-
-<p>The emulator uses three types of image files: default image files, runtime
-image files, and temporary image files. The sections below describe how to
-override the location/name of each type of file. </p>
-
-<h3 id="defaultimages">Default image files</h3>
-
-<p>When the emulator launches, but does not find an existing user data image in
-the active AVD's storage area, it creates a new one from a default version
-included in the SDK. The default user data image is read-only. The image
-files are read-only.</p>
-
-<p>The emulator provides the <code>-system <dir></code> startup option to
-let you override the location where the emulator looks for the default
-user data image. </p>
-
-<p>The emulator also provides a startup option that lets you override the name
-of the default user data image, as described in the following table. When you use the
-option, the emulator looks in the default directory, or in a custom location
-(if you specified <code>-system <dir></code>). </p>
-
-
-<table>
-<tr>
- <th width="10%" >Name</th>
- <th width="30%" >Description</th>
- <th width="40%" >Comments</th>
-</tr>
-
-<!--
-<tr>
- <td><code>kernel-qemu.img</code></td>
- <td>The emulator-specific Linux kernel image</td>
- <td>Override using <code>-kernel <file></code></td>
-</tr>
-
-<tr>
- <td><code>ramdisk.img</code></td>
- <td>The ramdisk image used to boot the system.</td>
- <td>Override using <code>-ramdisk <file></code></td>
-</tr>
-
-<tr>
- <td><code>system.img</code></td>
- <td>The <em>initial</em> Android system image.</td>
- <td>Override using <code>-image <file></code></td>
-</tr>
--->
-<tr>
- <td><code>userdata.img</code></td>
- <td>The <em>initial</em> user-data disk image</td>
- <td>Override using <code>-initdata <file></code>. Also see
-<code>-data <file></code>, below.</td>
-</tr>
-
-</table>
-
-<h3 id="runtimeimages">Runtime images: user data and SD card</h3>
-
-<p>At runtime, the emulator reads and writes data to two disk images: a
-user-data image and (optionally) an SD card image. These images emulate the user-data
-partition and removable storage media on actual device. </p>
-
-<p>The emulator provides a default user-data disk image. At startup, the emulator
-creates the default image as a copy of the system user-data image (user-data.img),
-described above. The emulator stores the new image with the files of the active AVD.</p>
-
-<!--
-<p>The emulator provides a startup option, <code>-datadir <dir></code>,
-that you can use to override the location under which the emulator looks for the runtime
-image files. </p>
--->
-
-<p>The emulator provides startup options to let you override the actual names and storage
-locations of the runtime images to load, as described in the following table. When you use one
-of these options, the emulator looks for the specified file(s) in the current working directory,
-in the AVD directory, or in a custom location (if you specified a path with the filename). </p>
-
-<table>
-<tr>
- <th width="10%" >Name</th>
- <th width="30%" >Description</th>
- <th width="40%" >Comments</th>
-</tr>
-<tr>
- <td><code>userdata-qemu.img</code></td>
- <td>An image to which the emulator writes runtime user-data for a unique user.</td>
- <td>Override using <code>-data <filepath></code>, where <code><filepath></code> is the
-path the image, relative to the current working directory. If you supply a filename only,
-the emulator looks for the file in the current working directory. If the file at <code><filepath></code> does
-not exist, the emulator creates an image from the default userdata.img, stores it under the name you
-specified, and persists user data to it at shutdown. </td>
-</tr>
-
-<tr>
- <td><code>sdcard.img</code></td>
- <td>An image representing an SD card inserted into the emulated device.</td>
- <td>Override using <code>-sdcard <filepath></code>, where <code><filepath></code> is the
-path the image, relative to the current working directory. If you supply a filename only,
-the emulator looks for the file in the current working directory. </td>
-</tr>
-
-</table>
-
-<h4>User-Data Image</h4>
-
-<p>Each emulator instance uses a writeable user-data image to store user- and
-session-specific data. For example, it uses the image to store a unique user's
-installed application data, settings, databases, and files. </p>
-
-<p>At startup, the emulator attempts to load a user-data image stored during
-a previous session. It looks for the file in the current working directory,
-in the AVD directory described in a previous section and at the custom location/name
-that you specified at startup. </p>
-
-<ul>
-<li>If it finds a user-data image, it mounts the image and makes it available
-to the system for reading and writing of user data. </li>
-<li>If it does not find one, it creates an image by copying the system user-data
-image (userdata.img), described above. At device power-off, the system persists
-the user data to the image, so that it will be available in the next session.
-Note that the emulator stores the new disk image at the location/name that you
-specify in <code>-data</code> startup option.</li>
-</ul>
-
-<p class="note"><strong>Note:</strong> Because of the AVD configurations used in the emulator,
-each emulator instance gets its own dedicated storage. There is no longer a need
-to use the <code>-d</code> option to specify an instance-specific storage area.</p>
-
-<h4>SD Card</h4>
-
-<P>Optionally, you can create a writeable disk image that the emulator can use
-to simulate removeable storage in an actual device. For information about how to create an
-emulated SD card and load it in the emulator, see <a href="#sdcard">SD Card Emulation</a></p>
-
-<p>You can also use the android tool to automatically create an SD Card image
-for you, when creating an AVD. For more information, see <a
-href="{@docRoot}guide/developing/devices/managing-avds.html">Managing Virtual Devices with AVD
-Manager</a>.
-
-
-<h3 id="temporaryimages">Temporary Images</h3>
-
-<p>The emulator creates two writeable images at startup that it deletes at
-device power-off. The images are: </p>
-
-<ul>
- <li>A writable copy of the Android system image</li>
- <li>The <code>/cache</code> partition image</li>
-</ul>
-
-<p>The emulator does not permit renaming the temporary system image or
-persisting it at device power-off. </p>
-
-<p>The <code>/cache</code> partition image is initially empty, and is used by
-the browser to cache downloaded web pages and images. The emulator provides an
-<code>-cache <file></code>, which specifies the name of the file in which
-to persist the <code>/cache</code> image at device power-off. If <code><file>
-</code> does not exist, the emulator creates it as an empty file. </p>
-
-<p>You can also disable the use of the cache partition by specifying the
-<code>-nocache</code> option at startup. </p>
-
-
-<h2 id="emulatornetworking">Emulator Networking</h2>
-
-<p>The emulator provides versatile networking capabilities that you can use to
-set up complex modeling and testing environments for your application. The
-sections below introduce the emulator's network architecture and capabilities.
-</p>
-
-<h3 id="networkaddresses">Network Address Space</h3>
-
-<p>Each instance of the emulator runs behind a virtual router/firewall service
-that isolates it from your development machine's network interfaces and settings
-and from the internet. An emulated device can not see your development machine
-or other emulator instances on the network. Instead, it sees only that it is
-connected through Ethernet to a router/firewall.</p>
-
-<p>The virtual router for each instance manages the 10.0.2/24 network address
-space — all addresses managed by the router are in the form of
-10.0.2.<xx>, where <xx> is a number. Addresses within this space are
-pre-allocated by the emulator/router as follows:</p>
-
-<table>
- <tr>
- <th>Network Address</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>10.0.2.1</td>
- <td>Router/gateway address </td>
- </tr>
- <tr>
- <td>10.0.2.2</td>
- <td>Special alias to your host loopback interface (i.e., 127.0.0.1 on your
-development machine)</td>
- </tr>
- <tr>
- <td>10.0.2.3</td>
- <td>First DNS server</td>
- </tr>
- <tr>
- <td>10.0.2.4 / 10.0.2.5 / 10.0.2.6</td>
- <td>Optional second, third and fourth DNS server (if any) </td>
- </tr>
- <tr>
- <td>10.0.2.15</td>
- <td>The emulated device's own network/ethernet interface</td>
- </tr>
- <tr>
- <td>127.0.0.1</td>
- <td>The emulated device's own loopback interface </td>
- </tr>
-</table>
-
-<p>Note that the same address assignments are used by all running emulator
-instances. That means that if you have two instances running concurrently on
-your machine, each will have its own router and, behind that, each will have an
-IP address of 10.0.2.15. The instances are isolated by a router and can
-<em>not</em> see each other on the same network. For information about how to
-let emulator instances communicate over TCP/UDP, see <a
-href="#connecting">Connecting Emulator Instances</a>.</p>
-
-<p>Also note that the address 127.0.0.1 on your development machine corresponds
-to the emulator's own loopback interface. If you want to access services running
-on your development machine's loopback interface (a.k.a. 127.0.0.1 on your
-machine), you should use the special address 10.0.2.2 instead.</p>
-
-<p>Finally, note that each emulated device's pre-allocated addresses are
-specific to the Android emulator and will probably be very different on real
-devices (which are also very likely to be NAT-ed, i.e., behind a
-router/firewall)</p>
-
-
-<h3 id="networkinglimitations">Local Networking Limitations</h3>
-
-<p>Android applications running in an emulator can connect to the network available on your
-workstation. However, they connect through the emulator, not directly to hardware, and the emulator
-acts like a normal application on your workstation. This means that the emulator, and thus your
-Android applications, are subject to some limitations:</p>
-
-<ul>
- <li>Communication with the emulated device may be blocked by a firewall
-program running on your machine.</li>
- <li>Communication with the emulated device may be blocked by another
-(physical) firewall/router to which your machine is connected.</li>
-</ul>
-
-<p>The emulator's virtual router should be able to handle all outbound TCP and
-UDP connections/messages on behalf of the emulated device, provided your
-development machine's network environment allows it to do so. There are no
-built-in limitations on port numbers or ranges except the one imposed by your
-host operating system and network.</p>
-
-<p>Depending on the environment, the emulator may not be able to support other
-protocols (such as ICMP, used for "ping") might not be supported. Currently, the
-emulator does not support IGMP or multicast. </p>
-
-<h3 id="redirection">Using Network Redirection</h3>
-
-<p>To communicate with an emulator instance behind its virtual router, you need
-to set up network redirection on the virtual router. Clients can then connect
-to a specified guest port on the router, while the router directs traffic
-to/from that port to the emulated device's host port. </p>
-
-<p>To set up the network redirection, you create a mapping of host and guest
-ports/addresses on the the emulator instance. There are two ways to set up
-network redirection: using emulator console commands and using the ADB tool, as
-described below. </p>
-
-
-<h4 id="consoleredir">Setting up Redirection through the Emulator Console</h4>
-
-<p>Each emulator instance provides a control console the you can connect to, to
-issue commands that are specific to that instance. You can use the
-<code>redir</code> console command to set up redirection as needed for an
-emulator instance. </p>
-
-<p>First, determine the console port number for the target emulator instance.
-For example, the console port number for the first emulator instance launched is
-5554. Next, connect to the console of the target emulator instance, specifying
-its console port number, as follows: </p>
-
-<pre><code>telnet localhost 5554</code></pre>
-
-<p>Once connected, use the <code>redir</code> command to work with redirection.
-To add a redirection, use:</p>
-
-<pre><code>add <protocol>:<host-port>:<guest-port></code>
-</pre>
-
-<p>where <code><protocol></code> is either <code>tcp</code> or <code>udp</code>,
-and <code><host-port></code> and <code><guest-port></code> sets the
-mapping between your own machine and the emulated system, respectively. </p>
-
-<p>For example, the following command sets up a redirection that handles all
-incoming TCP connections to your host (development) machine on 127.0.0.1:5000
-and will pass them through to the emulated system's 10.0.2.15:6000.:</p>
-
-<pre>redir add tcp:5000:6000</pre>
-
-<p>To delete a redirection, you can use the <code>redir del</code> command. To
-list all redirection for a specific instance, you can use <code>redir
-list</code>. For more information about these and other console commands, see
-<a href="#console">Using the Emulator Console</a>. </p>
-
-<p>Note that port numbers are restricted by your local environment. this typically
-means that you cannot use host port numbers under 1024 without special
-administrator privileges. Also, you won't be able to set up a redirection for a
-host port that is already in use by another process on your machine. In that
-case, <code>redir</code> generates an error message to that effect. </p>
-
-<h4 id="adbredir">Setting Up Redirection through ADB</h4>
-
-<p>The Android Debug Bridge (ADB) tool provides port forwarding, an alternate
-way for you to set up network redirection. For more information, see <a
-href="{@docRoot}guide/developing/tools/adb.html#forwardports">Forwarding Ports</a> in the ADB
-documentation.</p>
-
-<p>Note that ADB does not currently offer any way to remove a redirection,
-except by killing the ADB server.</p>
-
-
-<h3 id="dns">Configuring the Emulator's DNS Settings</h3>
-
-<p>At startup, the emulator reads the list of DNS servers that your system is
-currently using. It then stores the IP addresses of up to four servers on this
-list and sets up aliases to them on the emulated addresses 10.0.2.3, 10.0.2.4,
-10.0.2.5 and 10.0.2.6 as needed. </p>
-
-<p>On Linux and OS X, the emulator obtains the DNS server addresses by parsing
-the file <code>/etc/resolv.conf</code>. On Windows, the emulator obtains the
-addresses by calling the <code>GetNetworkParams()</code> API. Note that this
-usually means that the emulator ignores the content of your "hosts" file
-(<code>/etc/hosts</code> on Linux/OS X, <code>%WINDOWS%/system32/HOSTS</code>
- on Windows).</P>
-
-<p>When starting the emulator at the command line, you can also use the
-<code>-dns-server <serverList></code> option to manually specify the
-addresses of DNS servers to use, where <serverList> is a comma-separated
-list of server names or IP addresses. You might find this option useful if you
-encounter DNS resolution problems in the emulated network (for example, an
-"Unknown Host error" message that appears when using the web browser).</p>
-
-
-<h3 id="proxy">Using the Emulator with a Proxy</h3>
-
-<p>If your emulator must access the Internet through a proxy server, you can use
-the <code>-http-proxy <proxy></code> option when starting the emulator, to
-set up the appropriate redirection. In this case, you specify proxy information
-in <code><proxy></code> in one of these formats:</p>
-
-<pre>http://<machineName>:<port></pre>
-
-<p>or</p>
-
-<pre>http://<username>:<password>@<machineName>:<port></pre>
-
-<p>The <code>-http-proxy</code> option forces the emulator to use the specified
-HTTP/HTTPS proxy for all outgoing TCP connections. Redirection for UDP is not
-currently supported.</p>
-
-<p>Alternatively, you can define the environment variable
-<code>http_proxy</code> to the value you want to use for
-<code><proxy></code>. In this case, you do not need to specify a value for
-<code><proxy></code> in the <code>-http-proxy</code> command — the
-emulator checks the value of the <code>http_proxy</code> environment variable at
-startup and uses its value automatically, if defined. </p>
-
-<p>You can use the <code>-verbose-proxy</code> option to diagnose proxy
-connection problems.</p>
-
-
-<h3 id="connecting">Interconnecting Emulator Instances</h3>
-
-<p>To allow one emulator instance to communicate with another, you must set up
-the necessary network redirection as illustrated below. </p>
-
-<p>Assume that your environment is</p>
-
-<ul>
- <li>A is you development machine</li>
- <li>B is your first emulator instance, running on A</li>
- <li>C is your second emulator instance, also running on A</li>
-</ul>
-
-<p>and you want to run a server on B, to which C will connect, here is how you
-could set it up: </p>
-
-<ol>
- <li>Set up the server on B, listening to
-<code>10.0.2.15:<serverPort></code></li>
- <li>On B's console, set up a redirection from
-<code>A:localhost:<localPort></code> to <code>
-B:10.0.2.15:<serverPort></code></li>
- <li>On C, have the client connect to <code>10.0.2.2:<localPort></code></li>
-</ol>
-
-<p>For example, if you wanted to run an HTTP server, you can select
-<code><serverPort></code> as 80 and <code><localPort></code> as
-8080:</p>
-
-<ul>
- <li>B listens on 10.0.2.15:80</li>
- <li>On B's console, issue <code>redir add tcp:8080:80</code></li>
- <li>C connects to 10.0.2.2:8080</li>
-</ul>
-
-<h3 id="calling">Sending a Voice Call or SMS to Another Emulator Instance</h3>
-
-<p>The emulator automatically forwards simulated voice calls and SMS messages from one instance to
-another. To send a voice call or SMS, use the dialer application or SMS application, respectively,
-from one of the emulators.</p>
-
-<p>To initiate a simulated voice call to another emulator instance:</p>
-<ol>
-<li>Launch the dialer application on the originating emulator instance.</li>
-<li>As the number to dial, enter the console port number of the instance you'd like to call. You can determine
- the console port number of the target instance by checking its window title, where the
- console port number is reported as "Android Emulator (<port>). </li>
-<li>Press "Dial". A new inbound call appears in the target emulator instance. </li>
-</ol>
-
-<p>To send an SMS message to another emulator instance, launch the SMS application (if available). Specify the console port number of the target emulator instance as as the SMS address, enter the message text, and send the message. The message is delivered to the target emulator instance. </p>
-
-<p>You can also connect to an emulator instance's console to simulate an incoming voice call or SMS. For more information, see <a href="#telephony">Telephony Emulation</a> and <a href="#sms">SMS Emulation</a>.
-
-
-<h2 id="console">Using the Emulator Console</h2>
-
-<p>Each running emulator instance provides a console that lets you query and control the emulated
-device environment. For example, you can use the console to manage port redirection, network
-characteristics, and telephony events while your application is running on the emulator. To
-access the console and enter commands, use telnet to connect to the console's port number.</p>
-
-<p>To connect to the console of any running emulator instance at any time, use this command: </p>
-
-<pre>telnet localhost <console-port></pre>
-
-<p>An emulator instance occupies a pair of adjacent ports: a console port and an {@code adb} port.
-The port numbers differ by 1, with the {@code adb} port having the higher port number. The console
-of the first emulator instance running on a given machine uses console port 5554 and {@code adb}
-port 5555. Subsequent instances use port numbers increasing by two — for example, 5556/5557,
-5558/5559, and so on. Up to 16 concurrent emulator instances can run a console facility. </p>
-
-<p>To connect to the emulator console, you must specify a valid console port. If multiple emulator instances are running, you need to determine the console port of the emulator instance you want to connect to. You can find the instance's console port listed in the title of the instance window. For example, here's the window title for an instance whose console port is 5554:</p>
-
-<p><code>Android Emulator (5554)</code></p>
-
-<p>Alternatively, you can use the <code>adb devices</code> command, which prints a list of running emulator instances and their console port numbers. For more information, see <a href="{@docRoot}guide/developing/tools/adb.html#devicestatus">Querying for Emulator/Device Instances</a> in the adb documentation.</p>
-
-<p class="note">Note: The emulator listens for connections on ports 5554-5587 and accepts connections only from localhost.</p>
-
-<p>Once you are connected to the console, you can then enter <code>help [command]</code> to see a list of console commands and learn about specific commands. </p>
-
-<p>To exit the console session, use <code>quit</code> or <code>exit</code>.</p>
-
-<p>The following sections below describe the major functional areas of the console.</p>
-
-
-<h3 id="portredirection">Port Redirection</h3>
-
-<p>You can use the console to add and remove port redirection while the emulator is running. After
-you connect to the console, manage port redirection by entering the following command:</p>
-
-<pre>redir <list|add|del> </pre>
-
-<p>The <code>redir</code> command supports the subcommands listed in the table below. </p>
-
-<table>
-<tr>
- <th width="25%" >Subcommand
- <th width="30%" >Description</th>
- <th width="35%">Comments</th>
-</tr>
-
- <tr>
- <td><code>list</code></td>
- <td>List the current port redirection.</td>
- <td> </td>
- </tr>
-
-
-<tr>
- <td><code>add <protocol>:<host-port>:<guest-port></code></td>
- <td>Add a new port redirection.</td>
-<td><ul><li><protocol> must be either "tcp" or "udp"</li>
-<li><host-port> is the port number to open on the host</li>
-<li><guest-port> is the port number to route data to on the emulator/device</li>
-</ul></td>
-</tr>
-<tr>
- <td><code>del <protocol>:<host-port></code></td>
- <td>Delete a port redirection.</td>
-<td>The meanings of <protocol> and <host-port> are listed in the previous row.</td>
-</tr>
-</table>
-
-
-<h3 id="geo">Geo Location Provider Emulation</h3>
-
-<p>You can use the console to set the geographic location reported to the applications running
-inside an emulator. Use the <code>geo</code> command to send a simple GPS fix to the
-emulator, with or without NMEA 1083 formatting:</p>
-
-<pre>geo <fix|nmea></pre>
-
-<p>The <code>geo</code> command supports the subcommands listed in the table below.</p>
-
-<table>
-<tr>
- <th width="25%">Subcommand</th>
- <th width="30%">Description</th>
- <th width="35%">Comments</th>
-</tr>
-
- <tr>
- <td><code>fix <longitude> <latitude> [<altitude>]</code></td>
- <td>Send a simple GPS fix to the emulator instance.</td>
- <td>Specify longitude and latitude in decimal degrees. Specify altitude in meters.</td>
- </tr>
-<tr>
- <td><code>nmea <sentence></code></td>
- <td>Send an NMEA 0183 sentence to the emulated device, as if it were sent from an emulated GPS modem.</td>
-<td><code><sentence></code> must begin with '$GP'. Only '$GPGGA' and '$GPRCM' sentences are currently supported.</td>
-</tr>
-</table>
-
-<p>You can issue the <code>geo</code> command as soon as an emulator instance is running. The
-emulator sets the location you enter by creating a mock location provider. This provider responds to
-location listeners set by applications, and also supplies the location to the {@link
-android.location.LocationManager}. Any application can query the location manager to obtain the
-current GPS fix for the emulated device by calling:
-
-<pre>LocationManager.getLastKnownLocation("gps")</pre>
-
-<p>For more information about the Location Manager, see {@link android.location.LocationManager}.
-</p>
-
-<h3 id="events">Hardware Events Emulation</h3>
-
-<p>The {@code event} console commands sends hardware events to the emulator. The syntax for this
-command is as follows:</p>
-
-<pre>event <send|types|codes|text></pre>
-
-<p>The <code>event</code> command supports the subcommands listed in the table below. </p>
-
-<table>
-<tr>
- <th width="25%" >Subcommand
- <th width="30%" >Description</th>
- <th width="35%">Comments</th>
-</tr>
-
- <tr>
- <td><code>send <type>:<code>:<value> [...]</code></td>
- <td>Send one or more events to the Android kernel. </td>
- <td>You can use text names or integers for <code><type></code> and <code><value></code>.</td>
- </tr>
-<tr>
- <td><code>types</code></td>
- <td>List all <code><type></code> string aliases supported by the <code>event</code> subcommands.</td>
-<td> </td>
-</tr>
-<tr>
- <td><code>codes <type></code></td>
- <td>List all <code><codes></code> string aliases supported by the <code>event</code>
- subcommands for the specified <code><type></code>.</td>
-<td> </td>
-</tr>
-<tr>
- <td><code>event text <message></code></td>
- <td>Simulate keypresses to send the specified string of characters as a message,</td>
-<td>The message must be a UTF-8 string. Unicode posts will be reverse-mapped according to the current device keyboard. Unsupported characters will be discarded silently.</td>
-</tr>
-</table>
-
-
-<h3 id="power">Device Power Characteristics</h3>
-
-<p>The {@code power} command controls the power state reported by the emulator to applications. The
-syntax for this command is as follows: </p>
-
-<pre>power <display|ac|status|present|health|capacity></pre>
-
-<p>The <code>event</code> command supports the subcommands listed in the table below. </p>
-
-<table>
-<tr>
- <th width="25%" >Subcommand </th>
- <th width="30%" >Description</th>
- <th width="35%">Comments</th>
-</tr>
-
- <tr>
- <td><code>display</code></td>
- <td>Display battery and charger state.</td>
- <td> </td>
- </tr>
-<tr>
- <td><code>ac <on|off></code></td>
- <td>Set AC charging state to on or off. </td>
-<td> </td>
-</tr>
-<tr>
- <td><code>status <unknown|charging|discharging|not-charging|full></code></td>
- <td>Change battery status as specified.</td>
-<td> </td>
-</tr>
-
-<tr>
- <td><code>present <true|false></code></td>
- <td>Set battery presence state.</td>
-<td> </td>
-</tr>
-<tr>
- <td><code>health <unknown|good|overheat|dead|overvoltage|failure></code></td>
- <td>Set battery health state.</td>
-<td> </td>
-</tr>
-<tr>
- <td><code>power health <percent></code></td>
- <td>Set remaining battery capacity state (0-100).</td>
-<td> </td>
-</tr>
-</table>
-
-
-<h3 id="netstatus">Network Status</h3>
-
-<p>You can use the console to check the network status and current delay and speed characteristics. To do so, connect to the console and use the <code>netstatus</code> command. Here's an example of the command and its output. </p>
-
-<pre>network status
-</pre>
-
-
-<h3 id="netdelay">Network Delay Emulation</h3>
-
-<p>The emulator lets you simulate various network latency levels, so that you can test your
-application in an environment more typical of the actual conditions in which it will run. You can
-set a latency level or range at emulator startup or you can use the console to change the latency,
-while the application is running in the emulator. </p>
-
-<p>To set latency at emulator startup, use the <code>-netdelay</code> emulator option with a
-supported <code><delay></code> value, as listed in the table below. Here are some
-examples:</p>
-
-<pre>emulator -netdelay gprs
-emulator -netdelay 40 100</pre>
-
-<p>To make changes to network delay while the emulator is running, connect to the console and use
-the <code>netdelay</code> command with a supported <code><delay></code> value from the table
-below.</p>
-
-<pre>network delay gprs</pre>
-
-<p>The format of network <delay> is one of the following (numbers are milliseconds):</p>
-
-<table style="clear:right;width:100%;">
-<tr>
- <th width="30%" >Value</th>
- <th width="35%" >Description</th><th width="35%">Comments</th></tr>
-
- <tr><td><code>gprs</code></td><td>GPRS</td>
- <td>(min 150, max 550)</td>
- </tr>
-
-<tr><td><code>edge</code></td><td>EDGE/EGPRS</td>
-<td>(min 80, max 400)</td>
-</tr>
-<tr><td><code>umts</code></td><td>UMTS/3G</td>
-<td>(min 35, max 200)</td>
-</tr>
-<tr><td><code>none</code></td><td>No latency</td><td>(min 0, max 0)</td></tr>
-<tr><td><code><num></code></td>
-<td>Emulate an exact latency (milliseconds).</td>
-<td> </td></tr>
-<tr><td><code><min>:<max></code></td>
-<td>Emulate an specified latency range (min, max milliseconds).</td>
-<td> </td></tr>
-</table>
-
-
-<h3 id="netspeed">Network Speed Emulation</h3>
-
-<p>The emulator also lets you simulate various network transfer rates.
-You can set a transfer rate or range at emulator startup or you can use the console to change the
-rate, while the application is running in the emulator.</p>
-
-<p>To set the network speed at emulator startup, use the <code>-netspeed</code> emulator option with a supported
-<code><speed></code> value, as listed in the table below. Here are some examples:</p>
-
-<pre>emulator -netspeed gsm
-emulator -netspeed 14.4 80</pre>
-
-<p>To make changes to network speed while the emulator is running, connect to the console and use
-the <code>netspeed</code> command with a supported <code><speed></code> value from the table
-below.</p>
-
-<pre>network speed 14.4 80</pre>
-
-<p>The format of network <code><speed></code> is one of the following (numbers are
-kilobits/sec):</p>
-<table style="clear:right;width:100%;">
-<tbody>
-<tr>
- <th width="30%">Value</th>
- <th width="35%">Description</th><th width="35%">Comments</th></tr>
-
- <tr>
- <td><code>gsm</code></td>
- <td>GSM/CSD</td><td>(Up: 14.4, down: 14.4)</td></tr>
-<tr>
- <td><code>hscsd</code></td>
- <td>HSCSD</td><td>(Up: 14.4, down: 43.2)</td></tr>
-<tr>
- <td><code>gprs</code></td>
- <td>GPRS</td><td>(Up: 40.0, down: 80.0)</td></tr>
-<tr>
- <td><code>edge</code></td>
- <td>EDGE/EGPRS</td>
- <td>(Up: 118.4, down: 236.8)</td>
-</tr>
-<tr>
- <td><code>umts</code></td>
- <td>UMTS/3G</td><td>(Up: 128.0, down: 1920.0)</td></tr>
-<tr>
- <td><code>hsdpa</code></td>
- <td>HSDPA</td><td>(Up: 348.0, down: 14400.0)</td></tr>
-<tr>
- <td><code>full</code></td>
- <td>no limit</td><td>(Up: 0.0, down: 0.0)</td></tr>
-<tr>
- <td><code><num></code></td>
- <td>Set an exact rate used for both upload and download.</td><td></td></tr>
-<tr>
- <td><code><up>:<down></code></td>
- <td>Set exact rates for upload and download separately.</td><td></td></tr>
-</table>
-
-
-<h3 id="telephony">Telephony Emulation</h3>
-
-<p>The Android emulator includes its own GSM emulated modem that lets you simulate telephony
-functions in the emulator. For example, you can simulate inbound phone calls, establish data
-connections and terminate them. The Android system handles simulated calls exactly as it would
-actual calls. The emulator does not support call audio.</p>
-
-<p>You can use the {@code gsm} command to access the emulator's telephony functions after connecting
-to the console. The syntax for this command is as follows:</p>
-
-<pre>gsm <call|accept|busy|cancel|data|hold|list|voice|status> </pre>
-
-<p>The <code>gsm</code> command supports the subcommands listed in the table below. </p>
-<table>
- <tr>
- <th>Subcommand </th>
- <th width="25%">Description</th>
- <th>Comments</th>
- </tr>
- <tr>
- <td><code>call <phonenumber></code></td>
- <td>Simulate an inbound phone call from <phonenumber>.</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>accept <phonenumber></code></td>
- <td>Accept an inbound call from <phonenumber> and change the call's state "active".</td>
- <td>You can change a call's state to "active" only if its current state is "waiting" or "held".</td>
- </tr>
- <tr>
- <td><code>busy <phonenumber></code></td>
- <td>Close an outbound call to <phonenumber> and change the call's state to "busy".</td>
- <td>You can change a call's state to "busy" only if its current state is "waiting".</td>
- </tr>
- <tr>
- <td><code>cancel <phonenumber></code></td>
- <td>Terminate an inbound or outbound phone call to/from <phonenumber>.</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>data <state></code></td>
- <td>Change the state of the GPRS data connection to <state>.</td>
- <td>Supported <state> values are:<br />
- <ul>
- <li><code>unregistered</code> -- No network available</li>
- <li><code>home</code> -- On local network, non-roaming</li>
- <li><code>roaming</code> -- On roaming network</li>
- <li><code>searching</code> -- Searching networks</li>
- <li><code>denied</code> -- Emergency calls only</li>
- <li><code>off</code> -- Same as 'unregistered'</li>
- <li><code>on</code> -- same as 'home'</li>
- </ul>
- </td>
- </tr>
- <tr>
- <td><code>hold</code></td>
- <td>Change the state of a call to "held". </td>
- <td>You can change a call's state to "held" only if its current state is "active" or "waiting". </td>
- </tr>
- <tr>
- <td><code>list</code></td>
- <td>List all inbound and outbound calls and their states.</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>voice <state></code></td>
- <td>Change the state of the GPRS voice connection to <state>.</td>
- <td>Supported <state> values are:<br />
- <ul>
- <li><code>unregistered</code> -- No network available</li>
- <li><code>home</code> -- On local network, non-roaming</li>
- <li><code>roaming</code> -- On roaming network</li>
- <li><code>searching</code> -- Searching networks</li>
- <li><code>denied</code> -- Emergency calls only</li>
- <li><code>off</code> -- Same as 'unregistered'</li>
- <li><code>on</code> -- Same as 'home'</li>
- </ul>
- </td>
- </tr>
-
- <tr>
- <td><code>status</code></td>
- <td>Report the current GSM voice/data state.</td>
- <td>Values are those described for the <code>voice</code> and <code>data</code> commands.</td>
- </tr>
-</table>
-
-
-<h3 id="sms">SMS Emulation</h3>
-
-<p>The Android emulator console lets you generate an SMS message and direct it to an emulator
-instance. Once you connect to an emulator instance, you can generate an emulated incoming SMS using
-the following command:</p>
-
-<pre>sms send <senderPhoneNumber> <textmessage></pre>
-
-<p>where <code><senderPhoneNumber></code> contains an arbitrary numeric string. </p>
-
-<p>The console forwards the SMS message to the Android framework, which passes it through to an application that handles that message type. </p>
-
-
-<h3 id="vm">VM State</h3>
-
-<p>You can use the <code>vm</code> command to control the VM on an emulator instance. The syntax for
-this command is as follows: </p>
-
-<pre>vm <start|stop|status></pre>
-
-<p>The <code>vm</code> command supports the subcommands listed in the table below. </p>
-
-<table>
-<tr>
- <th width="25%">Subcommand</th>
- <th width="30%">Description</th>
- <th width="35%">Comments</th>
-</tr>
-<tr>
- <td><code>start</code></td>
- <td>Start the VM on the instance. </td>
- <td> </td>
-</tr>
-<tr>
- <td><code>stop</code></td>
- <td>Stop the VM on the instance. </td>
- <td> </td>
-</tr>
-<tr>
- <td><code>start</code></td>
- <td>Display the current status of the VM (running or stopped). </td>
- <td> </td>
-</tr>
-</table>
-
-
-<h3 id="window">Emulator Window</h3>
-
-<p>You can use the <code>window</code> command to manage the emulator window. The syntax for this
-command is as follows: </p>
-
-<pre>window <scale></pre>
-
-<p>The <code>vm</code> command supports the subcommands listed in the table below. </p>
-
-<table>
-<tr>
- <th width="25%">Subcommand</th>
- <th width="30%">Description</th>
- <th width="35%">Comments</th>
-</tr>
-<tr>
- <td><code>scale <scale></code></td>
- <td>Scale the emulator window.</td>
- <td>A number between 0.1 and 3 that sets the scaling factor. You can
- also specify scale as a DPI value if you add the suffix "dpi" to the scale value. A value of "auto"
- tells the emulator to select the best window size.</td>
-</tr>
-</table>
-
-
-<h3 id="terminating">Terminating an Emulator Instance</h3>
-
-<p>You can terminate an emulator instance through the console, using the <code>kill</code> command.</p>
-
-
-<h2 id="limitations">Emulator Limitations</h2>
-
-<p>The functional limitations of the emulator include: </p>
-<ul>
- <li>No support for placing or receiving actual phone calls. You can simulate phone calls (placed
- and received) through the emulator console, however. </li>
- <li>No support for USB connections</li>
- <li>No support for device-attached headphones</li>
- <li>No support for determining network connected state</li>
- <li>No support for determining battery charge level and AC charging state</li>
- <li>No support for determining SD card insert/eject</li>
- <li>No support for Bluetooth</li>
-</ul>
-
-
-<h2 id="troubleshooting">Troubleshooting Emulator Problems</h2>
-
-<p>The {@code adb} utility sees the emulator as an actual physical device. For this reason, you
-might have to use the {@code -d} flag with some common {@code adb} commands, such as
-<code>install</code>. The {@code -d} flag lets you specify which of several connected devices to use
-as the target of a command. If you don't specify {@code -d}, the emulator targets the first
-device in its list. For more information about {@code adb}, see <a
-href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a>.</p>
-
-<p>For emulators running on Mac OS X, if you see an error {@code Warning: No DNS servers found}
-when starting the emulator, check to see whether you have an <code>/etc/resolv.conf</code> file. If
-not, please run the following line in a command window:</p>
- <pre>ln -s /private/var/run/resolv.conf /etc/resolv.conf</pre>
-
-<p>See <a href="{@docRoot}resources/faq/index.html">Frequently Asked Questions</a> for more
-troubleshooting information. </p>
diff --git a/docs/html/guide/developing/devices/index.jd b/docs/html/guide/developing/devices/index.jd
deleted file mode 100644
index 64651a1..0000000
--- a/docs/html/guide/developing/devices/index.jd
+++ /dev/null
@@ -1,78 +0,0 @@
-page.title=Managing Virtual Devices
-@jd:body
-
-
- <p>An Android Virtual Device (AVD) is an emulator configuration that lets you model an actual
- device by defining hardware and software options to be emulated by the Android Emulator.</p>
-
- <p>The easiest way to create an AVD is to use the graphical <a href=
- "{@docRoot}guide/developing/devices/managing-avds.html">AVD Manager</a>, which you launch
- from Eclipse by clicking <strong>Window > AVD Manager</strong>. You can also start the AVD
-Manager from the command line by calling the <code>android</code> tool with the <code>avd</code>
-options, from the <strong><sdk>/tools/</strong> directory.</p>
-
- <p>You can also create AVDs on the command line by passing the <code>android</code> tool options.
- For more information on how to create AVDs in this manner, see <a href=
- "{@docRoot}guide/developing/devices/managing-avds-cmdline.html">Managing Virtual
- Devices from the Command Line</a>.</p>
-
- <p>An AVD consists of:</p>
-
- <ul>
- <li>A hardware profile: Defines the hardware features of the virtual
- device. For example, you can define whether the device has a camera, whether it uses a physical
- QWERTY keyboard or a dialing pad, how much memory it has, and so on.</li>
-
- <li>A mapping to a system image: You can define what version of the Android platform will run
- on the virtual device. You can choose a version of the standard Android platform or the system
- image packaged with an SDK add-on.</li>
-
- <li>Other options: You can specify the emulator skin you want to use with the AVD, which lets
- you control the screen dimensions, appearance, and so on. You can also specify the emulated SD
- card to use with the AVD.</li>
-
- <li>A dedicated storage area on your development machine: the device's user data (installed
- applications, settings, and so on) and emulated SD card are stored in this area.</li>
- </ul>
-
- <p>You can create as many AVDs as you need, based on the types of device you want to model.
- To thoroughly test your application, you should create an AVD for each general device configuration
- (for example, different screen sizes and platform versions) with which your application is compatible
- and test your application on each one.</p>
-
- <p>Keep these points in mind when you are selecting a system image target for your AVD:</p>
-
- <ul>
- <li>The API Level of the target is important, because your application will not be able to run
- on a system image whose API Level is less than that required by your application, as specified
- in the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">
- <code>minSdkVersion</code></a> attribute of the application's manifest file. For more
- information about the relationship between system API Level and application
- <code>minSdkVersion</code>, see <a href=
- "{@docRoot}guide/publishing/versioning.html">Specifying Minimum System API Version</a>.</li>
-
- <li>You should create at least one AVD that uses a target whose API Level is greater than that required
- by your application, because it allows you to test the
- forward-compatibility of your application. Forward-compatibility testing ensures that, when
- users who have downloaded your application receive a system update, your application will
- continue to function normally.</li>
-
- <li>If your application declares a
- <a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><code>uses-library</code></a>
- element in its manifest file, the application can only run on a system image in which that external
- library is present. If you want to run your application on an emulator, create an AVD that
- includes the required library. Usually, you must create such an AVD using an Add-on component for the
- AVD's platform (for example, the Google APIs Add-on contains the Google Maps library).</li>
- </ul>
-
- <p>To learn how to manage AVDs using a graphical tool, read <a href=
- "{@docRoot}guide/developing/devices/managing-avds.html">Managing AVDs with AVD Manager</a>. To
-learn how to manage AVDs on the command line, read
- <a href="{@docRoot}guide/developing/devices/managing-avds-cmdline.html">Managing AVDs
- from the Command Line</a>.</p>
-
-
-
-
-
-
diff --git a/docs/html/guide/developing/devices/managing-avds-cmdline.jd b/docs/html/guide/developing/devices/managing-avds-cmdline.jd
deleted file mode 100644
index 8674334..0000000
--- a/docs/html/guide/developing/devices/managing-avds-cmdline.jd
+++ /dev/null
@@ -1,369 +0,0 @@
-page.title=Managing AVDs from the Command Line
-parent.title=Managing Virtual Devices
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#listingtargets">Listing Targets</a></li>
- <li><a href="#AVDCmdLine">Creating AVDs</a>
- <ol>
- <li><a href="#CustomDensity">Customize the device resolution or density</a></li>
- <li><a href="#DefaultLocation">Default location of AVD files</a></li>
- <li><a href="#hardwareopts">Setting hardware emulation options</a></li>
- </ol>
- </li>
- <li><a href="#moving">Moving an AVD</a></li>
- <li><a href="#updating">Updating an AVD</a></li>
- <li><a href="#deleting">Deleting an AVD</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/developing/building/building-cmdline.html">Building and Running
-from the Command Line</a></li>
- <li><a href="{@docRoot}guide/developing/devices/emulator.html">Using the Android
-Emulator</a></li>
- </ol>
- </div>
-</div>
-
-
-<p>The <code>android</code> tool lets you manage AVDs on the command line. For a complete reference
-of the command line options that you can use, see the reference for the
-<a href="{@docRoot}guide/developing/tools/android.html"><code>android</code></a> tool.</p>
-
-
-
-<h2 id="listingtargets">Listing Targets</h2>
-
-<p>To generate a list of system image targets, use this command: </p>
-
-<pre>android list targets</pre>
-
-<p>The <code>android</code> tool scans the <code><sdk>/platforms/</code> and
-<code><sdk>/add-ons/</code> directories looking for valid system images and
-then generates the list of targets. Here's an example of the command output:
-</p>
-
-<pre>Available Android targets:
-id: 1 or "android-3"
- Name: Android 1.5
- Type: Platform
- API level: 3
- Revision: 4
- Skins: QVGA-L, HVGA-L, HVGA (default), HVGA-P, QVGA-P
-id: 2 or "android-4"
- Name: Android 1.6
- Type: Platform
- API level: 4
- Revision: 3
- Skins: QVGA, HVGA (default), WVGA800, WVGA854
-id: 3 or "android-7"
- Name: Android 2.1-update1
- Type: Platform
- API level: 7
- Revision: 2
- Skins: QVGA, WQVGA400, HVGA (default), WVGA854, WQVGA432, WVGA800
-id: 4 or "android-8"
- Name: Android 2.2
- Type: Platform
- API level: 8
- Revision: 2
- Skins: WQVGA400, QVGA, WVGA854, HVGA (default), WVGA800, WQVGA432
-id: 5 or "android-9"
- Name: Android 2.3
- Type: Platform
- API level: 9
- Revision: 1
- Skins: HVGA (default), WVGA800, WQVGA432, QVGA, WVGA854, WQVGA400
-</pre>
-
-
-
-<h2 id="AVDCmdLine">Creating AVDs</h2>
-
-<p>In addition to creating AVDs with the
-<a href="{@docRoot}guide/developing/devices/managing-avds-cmdline.html">AVD Manager user interface</a>,
-you can also create them by passing in command line arguments to the <code>android</code> tool.
-</p>
-
-<p>Open a terminal window and change to
-the <code><sdk>/tools/</code> directory, if needed.</p>
-
-<p>To create each AVD, you issue the command <code>android create avd</code>,
-with options that specify a name for the new AVD and the system image you want
-to run on the emulator when the AVD is invoked. You can specify other options on
-the command line also, such as the emulated SD card size, the emulator skin, or a custom
-location for the user data files.</p>
-
-<p>Here's the command-line usage for creating an AVD: </p>
-
-<pre>android create avd -n <name> -t <targetID> [-<option> <value>] ... </pre>
-
-<p>You can use any name you want for the AVD, but since you are likely to be
-creating multiple AVDs, you should choose a name that lets you recognize the
-general characteristics offered by the AVD. The target ID is an integer assigned by the
-<code>android</code> tool. The target ID is not derived from the system image name,
-version, or API Level, or other attribute, so you need to run the <code>android list targets</code>
-command to list the target ID of each system image. You should do this <em>before</em> you run
-the <code>android create avd</code> command. See the <a
-href="{@docRoot}guide/developing/tools/android.html">android</a>
-tool documentation for more information on the command line options.</p>
-
-
-<p>When you've selected the target you want to use and made a note of its ID,
-use the <code>android create avd</code> command to create the AVD, supplying the
-target ID as the <code>-t</code> argument. Here's an example that creates an
-AVD with name "my_android1.5" and target ID "2" (the standard Android 1.5
-system image in the list above): </p>
-
-<pre>android create avd -n my_android1.5 -t 2</pre>
-
-<p>If the target you selected was a standard Android system image ("Type:
-platform"), the <code>android</code> tool next asks you whether you want to
-create a custom hardware profile. </p>
-<pre>Android 1.5 is a basic Android platform.
-Do you wish to create a custom hardware profile [no]</pre>
-
-<p>If you want to set custom hardware emulation options for the AVD, enter
-"yes" and set values as needed. If you want to use the default hardware
-emulation options for the AVD, just press the return key (the default is "no").
-The <code>android</code> tool creates the AVD with name and system image mapping you
-requested, with the options you specified. For more information, see <a href="#hardwareopts">
-Setting Hardware Emulation Options</a>.
-
-<p class="note"><strong>Note:</strong> If you are creating an AVD whose target is an SDK add-on, the
-<code>android</code> tool does not allow you to set hardware emulation options.
-It assumes that the provider of the add-on has set emulation options
-appropriately for the device that the add-on is modeling, and so prevents you
-from resetting the options. </p>
-
-
-<h3 id="CustomDensity">Customize the device resolution or density</h3>
-
-<p>When testing your application, we recommend that you test your application in several different
-AVDs, using different screen configurations (different combinations of size and density). In
-addition, you should set up the AVDs to run at a physical size that closely matches an actual
-device.</p>
-
-<p>To set up your AVDs for a specific resolution or density, follow these steps:</p>
-
-<ol>
- <li>Use the <code>create avd</code> command to create a new AVD, specifying
-the <code>--skin</code> option with a value that references either a default
-skin name (such as "WVGA800") or a custom skin resolution (such as 240x432).
-Here's an example:
- <pre>android create avd -n <name> -t <targetID> --skin WVGA800</pre>
- </li>
- <li>To specify a custom density for the skin, answer "yes" when asked whether
-you want to create a custom hardware profile for the new AVD.</li>
- <li>Continue through the various profile settings until the tool asks you to
-specify "Abstracted LCD density" (<em>hw.lcd.density</em>). Enter an appropriate
-value, such as "120" for a low-density screen, "160" for a medium density screen,
-or "240" for a high-density screen.</li>
- <li>Set any other hardware options and complete the AVD creation.</li>
-</ol>
-
-<p>In the example above (WVGA medium density), the new AVD will emulate a 5.8"
-WVGA screen.</p>
-
-<p>As an alternative to adjusting the emulator skin configuration, you can use
-the emulator skin's default density and add the <code>-dpi-device</code> option
-to the <a href="{@docRoot}guide/developing/tools/emulator.html">emulator</a> command line when
-starting the AVD. For example:</p>
-
-<pre>emulator -avd WVGA800 -scale 96dpi -dpi-device 160</pre>
-
-
-
-<h3 id="DefaultLocation">Default location of AVD files</h3>
-
-<p>When you create an AVD, the <code>android</code> tool creates a dedicated directory for it
-on your development computer. The directory contains the AVD configuration file,
-the user data image and SD card image (if available), and any other files
-associated with the device. Note that the directory does not contain a system
-image — instead, the AVD configuration file contains a mapping to the
-system image, which it loads when the AVD is launched. </p>
-
-<p>The <code>android</code> tool also creates an <code><AVD_name>.ini</code> file for the AVD at the
-root of the <code>.android/avd/</code> directory on your computer. The file specifies the
-location of the AVD directory and always remains at the root the .android
-directory.</p>
-
-<p>By default, the <code>android</code> tool creates the AVD directory inside
-<code>~/.android/avd/</code> (on Linux/Mac), <code>C:\Documents and
-Settings\<user>\.android\</code> on Windows XP, and
-<code>C:\Users\<user>\.android\</code> on Windows 7 and Vista.
-If you want to use a custom location for the AVD directory, you
-can do so by using the <code>-p <path></code> option when
-you create the AVD: </p>
-
-<pre>android create avd -n my_android1.5 -t 2 -p path/to/my/avd</pre>
-
-<p>If the .android directory is hosted on a network drive, we recommend using
-the <code>-p</code> option to place the AVD directory in another location.
-The AVD's .ini file remains in the .android directory on the network
-drive, regardless of the location of the AVD directory.
-
-
-<h3 id="hardwareopts">Setting hardware emulation options</h3>
-
-<p>When you are creating a new AVD that uses a standard Android system image ("Type:
-platform"), the <code>android</code> tool lets you set hardware emulation
-options for virtual device. The table below lists the options available and the
-default values, as well as the names of properties that store the emulated
-hardware options in the AVD's configuration file (the config.ini file in the
-AVD's local directory). </p>
-
-<p class="table-caption"><strong>Table 1.</strong> Available hardware profile options for AVDs and
-the default values </p>
-
-<table>
-<tr>
-<th>Characteristic</th>
-<th>Description</th>
-<th>Property</th>
-</tr>
-
-<tr>
-<td>Device ram size</td>
-<td>The amount of physical RAM on the device, in megabytes. Default value is "96".
-<td>hw.ramSize</td>
-</tr>
-
-<tr>
-<td>Touch-screen support</td>
-<td>Whether there is a touch screen or not on the device. Default value is "yes".</td>
-<td>hw.touchScreen
-
-<tr>
-<td>Trackball support </td>
-<td>Whether there is a trackball on the device. Default value is "yes".</td>
-<td>hw.trackBall</td>
-</tr>
-
-<tr>
-<td>Keyboard support</td>
-<td>Whether the device has a QWERTY keyboard. Default value is "yes".</td>
-<td>hw.keyboard</td>
-</tr>
-
-<tr>
-<td>DPad support</td>
-<td>Whether the device has DPad keys. Default value is "yes".</td>
-<td>hw.dPad</td>
-</tr>
-
-<tr>
-<td>GSM modem support</td>
-<td>Whether there is a GSM modem in the device. Default value is "yes".</td>
-<td>hw.gsmModem</td>
-</tr>
-
-<tr>
-<td>Camera support</td>
-<td>Whether the device has a camera. Default value is "no".</td>
-<td>hw.camera</td>
-</tr>
-
-<tr>
-<td>Maximum horizontal camera pixels</td>
-<td>Default value is "640".</td>
-<td>hw.camera.maxHorizontalPixels</td>
-</tr>
-
-<tr>
-<td>Maximum vertical camera pixels</td>
-<td>Default value is "480".</td>
-<td>hw.camera.maxVerticalPixels</td>
-</tr>
-
-<tr>
-<td>GPS support</td>
-<td>Whether there is a GPS in the device. Default value is "yes".</td>
-<td>hw.gps</td>
-</tr>
-
-<tr>
-<td>Battery support</td>
-<td>Whether the device can run on a battery. Default value is "yes".</td>
-<td>hw.battery</td>
-</tr>
-
-<tr>
-<td>Accelerometer</td>
-<td>Whether there is an accelerometer in the device. Default value is "yes".</td>
-<td>hw.accelerometer</td>
-</tr>
-
-<tr>
-<td>Audio recording support</td>
-<td>Whether the device can record audio. Default value is "yes".</td>
-<td>hw.audioInput</td>
-</tr>
-
-<tr>
-<td>Audio playback support</td>
-<td>Whether the device can play audio. Default value is "yes".</td>
-<td>hw.audioOutput</td>
-</tr>
-
-<tr>
-<td>SD Card support</td>
-<td>Whether the device supports insertion/removal of virtual SD Cards. Default value is "yes".</td>
-<td>hw.sdCard</td>
-</tr>
-
-<tr>
-<td>Cache partition support</td>
-<td>Whether we use a /cache partition on the device. Default value is "yes".</td>
-<td>disk.cachePartition</td>
-</tr>
-
-<tr>
-<td>Cache partition size</td>
-<td>Default value is "66MB".</td>
-<td>disk.cachePartition.size </td>
-</tr>
-
-<tr>
-<td>Abstracted LCD density</td>
-<td>Sets the generalized density characteristic used by the AVD's screen. Default value is "160".</td>
-<td>hw.lcd.density </td>
-</tr>
-
-<tr>
-<td>Trackball support</td>
-<td>Whether there is a trackball present.</td>
-<td>hw.trackBall </td>
-</tr>
-</table>
-
-
-<h2 id="moving">Moving an AVD</h2>
-
-<p>If you want to move or rename an AVD, you can do so using this command:</p>
-
-<pre>android move avd -n <name> [-<option> <value>] ...</pre>
-
-<h2 id="updating">Updating an AVD</h2>
-
-<p>If, for any reason, the platform/add-on root folder has its name changed (maybe because the user has installed an update of the platform/add-on) then the AVD will not be able to load the system image that it is mapped to. In this case, the <code>android list targets</code> command will produce this output:
-
-<pre>The following Android Virtual Devices could not be loaded:
-Name: foo
-Path: <path>/.android/avd/foo.avd
-Error: Invalid value in image.sysdir. Run 'android update avd -n foo' </pre>
-
-<p>To fix this error, use the <code>android update avd</code> command to recompute the path to the system images.</p>
-
-<h2 id="deleting">Deleting an AVD</h2>
-
-<p>You can use the <code>android</code> tool to delete an AVD. Here is the command usage:</p>
-
-<pre>android delete avd -n <name> </pre>
-
-<p>When you issue the command, the <code>android</code> tool looks for an AVD matching the
-specified name deletes the AVD's directory and files. </p>
diff --git a/docs/html/guide/developing/eclipse-adt.html b/docs/html/guide/developing/eclipse-adt.html
deleted file mode 100644
index 879a356..0000000
--- a/docs/html/guide/developing/eclipse-adt.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/projects/projects-eclipse.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should be redirected. Please <a
-href="http://developer.android.com/guide/developing/projects/projects-eclipse.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/index.jd b/docs/html/guide/developing/index.jd
deleted file mode 100644
index 3af4a8c..0000000
--- a/docs/html/guide/developing/index.jd
+++ /dev/null
@@ -1,150 +0,0 @@
-page.title=Introduction
-@jd:body
-
-<p>Developing applications for Android devices is facilitated by a group of tools that are
- provided with the SDK. You can access these tools through an Eclipse plugin called ADT (Android
- Development Tools) or from the command line. Developing with Eclipse is the preferred method because
- it can directly invoke the tools that you need while developing applications.</p>
-
- <p>However, you may choose to develop with another IDE or a simple text editor and invoke the
- tools on the command line or with scripts. This is a less streamlined way to develop because you
- will sometimes have to call command line tools manually, but you will have access to the same
- number of features that you would have in Eclipse.</p>
-
-<div class="figure" style="width:461px">
- <img src="{@docRoot}images/developing/developing_overview.png"
- alt="Development process for Android applications"
- height="738" />
- <p class="img-caption">
- <strong>Figure 1.</strong> The development process for Android applications.
- </p>
-</div>
-
-<p>The basic steps for developing applications (with or without Eclipse) are shown in figure 1. The
-development steps encompass four development phases, which include:</p>
-
-<ul>
- <li><strong>Setup</strong>
- <p>During this phase you install and set up your development environment. You also create
- Android Virtual Devices (AVDs) and connect hardware devices on which you can install your
- applications.</p>
- <p>See <a href="{@docRoot}guide/developing/devices/index.html">Managing Virtual Devices</a>
- and <a href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a> for more
- information.
- </li>
- <li><strong>Development</strong>
- <p>During this phase you set up and develop your Android project, which contains all of the
- source code and resource files for your application. For more informations, see
- <a href="{@docRoot}guide/developing/projects/index.html">Create an Android project</a>.</p>
- </li>
- <li><strong>Debugging and Testing</strong>
- <p>During this phase you build your project into a debuggable <code>.apk</code> package that you
- can install and run on the emulator or an Android-powered device. If you are using Eclipse,
- builds are generated each time you project is saved. If you're using another IDE,
- you can build your project using Ant and install it on a device using
- <a href="{@docRoot}guide/developing/tools/adb.html">adb</a>. For more information, see
- <a href="{@docRoot}guide/developing/building/index.html">Build and run your application</a>.</p>
- <p>Next, you debug your application using a JDWP-compliant debugger along with the debugging
- and logging tools that are provided with the Android SDK. Eclipse already comes packaged with
- a compatible debugger. For more information see,
- <a href="{@docRoot}guide/developing/debugging/index.html">Debug your application with the
- SDK debugging and logging tools</a>.</p>
- <p>Last, you test your application using various Android SDK testing tools. For more
- information, see <a href="{@docRoot}guide/developing/testing/index.html">Test your application
- with the Testing and Instrumentation framework</a>.</p>
- </li>
- <li><strong>Publishing</strong>
- <p>During this phase you configure and build your application for release and distribute your
- application to users. For more information, see
- <a href="{@docRoot}guide/publishing/publishing_overview.html">Publishing Overview</a>.</p>
- </li>
-</ul>
-
-<h2 id="EssentialTools">Essential command line tools</h2>
-
- <p>When developing in IDEs or editors other than Eclipse, be familiar with
- all of the tools below, because you will have to run them from the command line.</p>
-
- <dl>
- <dt><a href="{@docRoot}guide/developing/tools/android.html">android</a></dt>
-
- <dd>Create and update Android projects and create, move, and delete AVDs.</dd>
-
- <dt><a href="{@docRoot}guide/developing/devices/emulator.html">Android Emulator</a></dt>
-
- <dd>Run your Android applications on an emulated Android platform.</dd>
-
- <dt><a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a></dt>
-
- <dd>Interface with your emulator or connected device (install apps, shell the device, issue
- commands, etc.).</dd>
- </dl>
-
- <p>In addition to the above tools that are included with the SDK, you need the following open
- source and third-party tools:</p>
-
- <dl>
- <dt>Ant</dt>
-
- <dd>To compile and build your Android project into an installable .apk file.</dd>
-
- <dt>Keytool</dt>
-
- <dd>To generate a keystore and private key, used to sign your .apk file. Keytool is part of the
- JDK.</dd>
-
- <dt>Jarsigner (or similar signing tool)</dt>
-
- <dd>To sign your .apk file with a private key generated by Keytool. Jarsigner is part of the
- JDK.</dd>
- </dl>
-
- <p>If you are using Eclipse and ADT, tools such as <code>adb</code> and <code>android</code>
- are automatically called by Eclipse and ADT so you don't have to manually invoke these tools.
- You need to be familiar with <code>adb</code>, however, because certain functions are not
-accessible from
- Eclipse, such as the <code>adb</code> shell commands. You might also need to call Keytool and
-Jarsigner to
- sign your applications, but you can set up Eclipse to do this automatically as well.</p>
-
-<p>For more information on the tools provided with the Android SDK, see the
- <a href="{@docRoot}guide/developing/tools/index.html">Tools</a> section of the documentation.</p>
-
-<h2 id="ThirdParty">Other Third-Party Development Tools</h2>
-<p>
- The tools described in this section are not developed by the Android SDK team. The Android Dev Guide
- does not provide documentation for these tools. Please refer to the linked documents in each
- section for documentation.
-</p>
-<h3 id="IntelliJ">Developing in IntelliJ IDEA</h3>
-<div style="float: right">
-<img alt="The IntelliJ graphical user interface" height="500px"
-src="{@docRoot}images/developing/intellijidea_android_ide.png"/>
-</div>
-<p>
- IntelliJ IDEA is a powerful Java IDE from JetBrains that provides
- full-cycle Android development support in both the free Community
- Edition and the Ultimate edition.
-</p>
-<p>
- The IDE ensures compatibility with the latest Android SDK and offers a
- smart code editor with completion, quick navigation between code and
- resources, a graphical debugger, unit testing support using Android
- Testing Framework, and the ability to run applications in either the
- emulator or a USB-connected device.
-</p>
-<p>
- <strong>Links:</strong>
-</p>
-<ul>
- <li>
- <a href="http://www.jetbrains.com/idea">IntelliJ IDEA official website</a>
-</li>
- <li>
- <a href="http://www.jetbrains.com/idea/features/google_android.html">Android support in IntelliJ IDEA</a>
-</li>
- <li>
- <a href="http://wiki.jetbrains.net/intellij/Android">IntelliJ IDEA Android Tutorials</a>
- </li>
-</ul>
-
diff --git a/docs/html/guide/developing/other-ide.html b/docs/html/guide/developing/other-ide.html
deleted file mode 100644
index 41dba05..0000000
--- a/docs/html/guide/developing/other-ide.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/projects/projects-cmdline.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should be redirected. Please <a
-href="http://developer.android.com/guide/developing/projects/projects-cmdline.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/projects/index.jd b/docs/html/guide/developing/projects/index.jd
deleted file mode 100644
index b16e466..0000000
--- a/docs/html/guide/developing/projects/index.jd
+++ /dev/null
@@ -1,446 +0,0 @@
-page.title=Managing Projects
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#ApplicationProjects">Android Projects</a></li>
-
- <li><a href="#LibraryProjects">Library Projects</a>
- <ol>
- <li><a href="#considerations">Development considerations</a></li>
- </ol>
- </li>
-
- <li><a href="#TestProjects">Test Projects</a></li>
-
- <li><a href="#testing">Testing a Library Project</a></li>
- </ol>
- </div>
- </div>
-
- <p>Projects act as containers for storing things such as code and resource files. The SDK tools
- expect your projects to follow a specific structure so it can compile and package your
- application correctly, so it is highly recommended that you create them with Eclipse and ADT or
- with the <code>android</code> tool on the command line. There are three types of projects, and
- they all share the same general structure but differ in function:</p>
-
- <dl>
- <dt><strong>Android Projects</strong></dt>
-
- <dd>An Android project is the container for your application's source code, resource files, and
- files such as the Ant build and Android Manifest file. An application project is the main type
- of project and the contents are eventually built into an <code>.apk</code> file that you install on a
- device.</dd>
-
- <dt><strong>Test Projects</strong></dt>
-
- <dd>These projects contain code to test your application projects and are built into
- applications that run on a device.</dd>
-
- <dt><strong>Library Projects</strong></dt>
-
- <dd>These projects contain shareable Android source code and resources that you can reference
- in Android projects. This is useful when you have common code that you want to reuse.
- Library projects cannot be installed onto a device, however, they are
- pulled into the <code>.apk</code> file at build time.</dd>
- </dl>
-
- <p>When you use the Android development tools to create a new project, the essential files and
- folders will be created for you. There are only a handful of files and folders generated for you,
- and some of them depend on whether you use the Eclipse plugin or the {@code android} tool to
- generate your project. As your application grows in complexity, you might require new kinds of
- resources, directories, and files.</p>
-
- <h2 id="ApplicationProjects">Android Projects</h2>
-
- <p>Android projects are the projects that eventually get built into an <code>.apk</code> file that you install
- onto a device. They contain things such as application source code and resource files.
- Some are generated for you by default, while others should be created if
- required. The following directories and files comprise an Android project:</p>
-
- <dl>
- <dt><code>src/</code></dt>
-
- <dd>Contains your stub Activity file, which is stored at
- <code>src<em>/your/package/namespace/ActivityName</em>.java</code>. All other source code
- files (such as <code>.java</code> or <code>.aidl</code> files) go here as well.</dd>
-
- <dt><code>bin</code></dt>
-
- <dd>Output directory of the build. This is where you can find the final <code>.apk</code> file and other
- compiled resources.</dd>
-
- <dt><code>jni</code></dt>
-
- <dd>Contains native code sources developed using the Android NDK. For more information, see the
- <a href="{@docRoot}sdk/ndk/index.html">Android NDK documentation</a>.</dd>
-
- <dt><code>gen/</code></dt>
-
- <dd>Contains the Java files generated by ADT, such as your <code>R.java</code> file and
- interfaces created from AIDL files.</dd>
-
- <dt><code>assets/</code></dt>
-
- <dd>This is empty. You can use it to store raw asset files. Files that you save here are
- compiled into an <code>.apk</code> file as-is, and the original filename is preserved. You can navigate this
- directory in the same way as a typical file system using URIs and read files as a stream of
- bytes using the the {@link android.content.res.AssetManager}. For example, this is a good
- location for textures and game data.</dd>
-
- <dt><code>res/</code></dt>
-
- <dd>
- Contains application resources, such as drawable files, layout files, and string values. See
- <a href="{@docRoot}guide/topics/resources/index.html">Application Resources</a> for more
- information.
-
- <dl>
- <dt><code>anim/</code></dt>
-
- <dd>For XML files that are compiled into animation objects. See the <a href=
- "{@docRoot}guide/topics/resources/animation-resource.html">Animation</a> resource
- type.</dd>
-
- <dt><code>color/</code></dt>
-
- <dd>For XML files that describe colors. See the <a href=
- "{@docRoot}guide/topics/resources/color-list-resource.html">Color Values</a> resource
- type.</dd>
-
- <dt><code>drawable/</code></dt>
-
- <dd>For bitmap files (PNG, JPEG, or GIF), 9-Patch image files, and XML files that describe
- Drawable shapes or a Drawable objects that contain multiple states (normal, pressed, or
- focused). See the <a href=
- "{@docRoot}guide/topics/resources/drawable-resource.html">Drawable</a> resource type.</dd>
-
- <dt><code>layout/</code></dt>
-
- <dd>XML files that are compiled into screen layouts (or part of a screen). See the <a href=
- "{@docRoot}guide/topics/resources/layout-resource.html">Layout</a> resource type.</dd>
-
- <dt><code>menu/</code></dt>
-
- <dd>For XML files that define application menus.
- See the <a href="{@docRoot}guide/topics/resources/menu-resource.html">Menus</a>
- resource type.</dd>
-
- <dt><code>raw/</code></dt>
-
- <dd>For arbitrary raw asset files. Saving asset files here instead of in the
- <code>assets/</code> directory only differs in the way that you access them. These files
- are processed by aapt and must be referenced from the application using a resource
- identifier in the {@code R} class. For example, this is a good place for media, such as MP3
- or Ogg files.</dd>
-
- <dt><code>values/</code></dt>
-
- <dd>For XML files that are compiled into many kinds of resource. Unlike other resources in
- the <code>res/</code> directory, resources written to XML files in this folder are not
- referenced by the file name. Instead, the XML element type controls how the resources is
- defined within them are placed into the {@code R} class.</dd>
-
- <dt><code>xml/</code></dt>
-
- <dd>For miscellaneous XML files that configure application components. For example, an XML
- file that defines a {@link android.preference.PreferenceScreen}, {@link
- android.appwidget.AppWidgetProviderInfo}, or <a href=
- "{@docRoot}reference/android/app/SearchManager.html#SearchabilityMetadata">Searchability
- Metadata</a>. See <a href="{@docRoot}guide/topics/resources/index.html">Application Resources</a>
- for more information about configuring these application components.</dd>
- </dl>
- </dd>
-
- <dt><code>libs/</code></dt>
-
- <dd>Contains private libraries.</dd>
-
- <dt><code>AndroidManifest.xml</code></dt>
-
- <dd>The control file that describes the nature of the application and each of its components.
- For instance, it describes: certain qualities about the activities, services, intent receivers,
- and content providers; what permissions are requested; what external libraries are needed; what
- device features are required, what API Levels are supported or required; and others. See the
- <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>
- documentation for more information</dd>
-
- <dt><code>project.properties</code></dt>
-
- <dd>This file contains project settings, such as the build target. This file is integral to
- the project, so maintain it in a source revision control system. To edit project
- properties in Eclipse, right-click the project folder and select
- <strong>Properties</strong>.</dd>
-
- <dt><code>local.properties</code></dt>
-
- <dd>Customizable computer-specific properties for the build system. If you use Ant to build
- the project, this contains the path to the SDK installation. Because the content of the file
- is specific to the local installation of the SDK, the <code>local.properties</code> should not
-be maintained in a source revision control system. If you use Eclipse, this file is not
-used.</dd>
-
- <dt><code>ant.properties</code></dt>
-
- <dd>Customizable properties for the build system. You can edit this file to override default
- build settings used by Ant and also provide the location of your keystore and key alias so that
- the build tools can sign your application when building in release mode. This file is integral
- to the project, so maintain it in a source revision control system. If you use Eclipse, this
- file is not used.</dd>
-
- <dt><code>build.xml</code></dt>
-
- <dd>The Ant build file for your project. This is only applicable for projects that
- you build with Ant.</dd>
-
- </dl>
-
- <h2 id="LibraryProjects">Library Projects</h2>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Library project example code</h2>
-
- <p>The SDK includes an example application called <code>TicTacToeMain</code> that shows how a dependent
- application can use code and resources from an Android Library project. The TicTacToeMain
- application uses code and resources from an example library project called TicTacToeLib.</p>
-
- <p>To download the sample applications and run them as projects in
- your environment, use the <em>Android SDK Manager</em> to download the "Samples for
- SDK API 8" (or later) package into your SDK.</p>
-
- <p>For more information and to browse the code of the samples, see
- the <a href="{@docRoot}resources/samples/TicTacToeMain/index.html">TicTacToeMain
- application</a>.</p>
- </div>
- </div>
-
- <p>An Android <em>library project</em> is a development project that holds shared Android
- source code and resources. Other Android application projects can reference the library project
- and, at build time, include its compiled sources in their <code>.apk</code> files. Multiple
- application projects can reference the same library project and any single application project
- can reference multiple library projects.</p>
-
- <p class="note"><strong>Note:</strong> You need SDK Tools r14 or newer to use the new library
- project feature that generates each library project into its own JAR file.
- You can download the tools and platforms using the
- <em>Android SDK Manager</em>, as described in
- <a href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a>.</p>
-
- <p>If you have source code and resources that are common to multiple Android projects, you
- can move them to a library project so that it is easier to maintain across applications and
- versions. Here are some common scenarios in which you could make use of library projects:</p>
-
- <ul>
- <li>If you are developing multiple related applications that use some of the same components,
- you move the redundant components out of their respective application projects and create a
- single, reuseable set of the same components in a library project.</li>
-
- <li>If you are creating an application that exists in both free and paid versions. You move
- the part of the application that is common to both versions into a library project. The two
- dependent projects, with their different package names, will reference the library project
- and provide only the difference between the two application versions.</li>
- </ul>
-
- <p>Structurally, a library project is similar to a standard Android application project. For
- example, it includes a manifest file at the project root, as well as <code>src/</code>,
- <code>res/</code> and similar directories. The project can contain the same types of source
- code and resources as a standard Android project, stored in the same way. For example, source
- code in the library project can access its own resources through its <code>R</code> class.</p>
-
- <p>However, a library project differs from an standard Android application project in that you
- cannot compile it directly to its own <code>.apk</code> and run it on an Android device.
- Similarly, you cannot export the library project to a self-contained JAR file, as you would do
- for a true library. Instead, you must compile the library indirectly, by referencing the
- library in the dependent application and building that application.</p>
-
- <p>When you build an application that depends on a library project, the SDK tools compile the
- library into a temporary JAR file and uses it in the main project, then uses the
- result to generate the <code>.apk</code>. In cases where a resource ID is defined in both the
- application and the library, the tools ensure that the resource declared in the application gets
- priority and that the resource in the library project is not compiled into the application
- <code>.apk</code>. This gives your application the flexibility to either use or redefine any
- resource behaviors or values that are defined in any library.</p>
-
- <p>To organize your code further, your application can add references to multiple library
- projects, then specify the relative priority of the resources in each library. This lets you
- build up the resources actually used in your application in a cumulative manner. When two
- libraries referenced from an application define the same resource ID, the tools select the
- resource from the library with higher priority and discard the other.</p>
-
- <p>Once you have added references to library projects to your Android project,
- you can set their relative priority. At build time, the
- libraries are merged with the application one at a time, starting from the lowest priority to
- the highest.</p>
-
- <p>Library projects can reference other library projects and can import an external library
- (JAR) in the normal way.</p>
-
- <h3 id="considerations">Development considerations</h3>
-
- <p>As you develop your library project and dependent applications, keep the points listed below
- in mind:</p>
-
- <ul>
- <li><p><strong>Resource conflicts</strong></p>
- <p>Since the tools merge the resources of a library project with those of a dependent application
- project, a given resource ID might be defined in both projects. In this case, the tools select
- the resource from the application, or the library with highest priority, and discard the other
- resource. As you develop your applications, be aware that common resource IDs are likely to be
- defined in more than one project and will be merged, with the resource from the application or
- highest-priority library taking precedence.</p>
- </li>
-
- <li><p><strong>Use prefixes to avoid resource conflicts</strong></p>
-
- <p>To avoid resource conflicts for common resource IDs, consider using a prefix or other
- consistent naming scheme that is unique to the project (or is unique across all projects).</p></li>
-
- <li><p><strong>You cannot export a library project to a JAR file</strong></p>
-
- <p>A library cannot be distributed as a binary file (such as a JAR file). This will
-be added in a future
- version of the SDK Tools.</p></li>
-
- <li><p><strong>A library project can include a JAR library</strong></p>
-
- <p>You can develop a library project that itself includes a JAR library, however you need to
- manually edit the dependent application project's build path and add a path to the JAR file.</p></li>
-
- <li><p><strong>A library project can depend on an external JAR library</strong></p>
-
- <p>You can develop a library project that depends on an external library (for example, the Maps
- external library). In this case, the dependent application must build against a target that
- includes the external library (for example, the Google APIs Add-On). Note also that both the
- library project and the dependent application must declare the external library in their manifest
- files, in a <a href=
- "{@docRoot}guide/topics/manifest/uses-library-element.html"><code><uses-library></code></a>
- element.</p></li>
-
- <li> <p><strong>Library projects cannot include raw assets</strong></p>
-
- <p>The tools do not support the use of raw asset files (saved in the <code>assets/</code> directory)
- in a library project. Any asset resources
- used by an application must be stored in the <code>assets/</code> directory of the application
- project itself. However, resource files saved in the
- <code>res/</code> directory are supported.</p></li>
-
- <li><p><strong>Platform version must be lower than or equal to the Android project</strong></p>
-
- <p>A library is compiled as part of the dependent application project, so the API used in the
- library project must be compatible with the version of the Android library used to compile the
- application project. In general, the library project should use an <a href=
- "{@docRoot}guide/appendix/api-levels.html">API level</a> that is the same as — or lower
- than — that used by the application. If the library project uses an API level that is
- higher than that of the application, the application project will not compile. It is
- perfectly acceptable to have a library that uses the Android 1.5 API (API level 3) and that is
- used in an Android 1.6 (API level 4) or Android 2.1 (API level 7) project, for instance.</p></li>
-
- <li> <p><strong>No restriction on library package names</strong></p>
-
- <p>There is no requirement for the package name of a library to be the same as that of
- applications that use it.</p></li>
-
- <li><p><strong>Each library project creates its own R class </strong></p>
-
- <p>When you build the dependent application project, library projects are compiled and
- merged with the application project. Each library has its own <code>R</code> class, named according
- to the library's package name. The <code>R</code> class generated from main
- project and the library project is created in all the packages that are needed including the main
- project's package and the libraries' packages.</p></li>
-
- <li><p><strong>Library project storage location</strong></p>
-
- <p>There are no specific requirements on where you should store a library project, relative to a
- dependent application project, as long as the application project can reference the library
- project by a relative link. What is important is that the main
- project can reference the library project through a relative link.</p></li>
- </ul>
-
- <h2 id="TestProjects">Test Projects</h2>
-
- <p>Test projects contain Android applications that you write using the
- <a href="{@docRoot}guide/topics/testing/index.html">Testing and
- Instrumentation framework</a>. The framework is an extension of the JUnit test framework and adds
- access to Android system objects. The file structure of a test project is the same as an
- Android project.</p>
-
- <dl>
- <dt><code>src/</code></dt>
-
- <dd>Includes your test source files. Test projects do not require an Activity <code>.java</code>
- file, but can include one.</dd>
-
- <dt><code>gen/</code></dt>
-
- <dd>This contains the Java files generated by ADT, such as your <code>R.java</code> file and
- interfaces created from AIDL files.</dd>
-
- <dt><code>assets/</code></dt>
-
- <dd>This is empty. You can use it to store raw asset files.</dd>
-
- <dt><code>res/</code></dt>
-
- <dd>A folder for your application resources, such as drawable files, layout files, string
- values, etc. See <a href="{@docRoot}guide/topics/resources/index.html">Application
- Resources</a>.</dd>
-
- <dt><code>AndroidManifest.xml</code></dt>
-
- <dd>The Android Manifest for your project. See <a href=
- "{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a>. Test
- Projects have a special <a href=
- "{@docRoot}guide/topics/manifest/instrumentation-element.html">
- <code><instrumentation></code></a>
- element that connects the test project with the application project.</dd>
-
- <dt><code>project.properties</code></dt>
-
- <dd>This file contains project settings, such as the build target and links to the project being
-tested. This file is integral to the project, so maintain it in a source
-revision control system. To edit project properties in Eclipse, right-click the project folder
-and select <strong>Properties</strong>.</dd>
-
- <dt><code>local.properties</code></dt>
-
- <dd>Customizable computer-specific properties for the build system. If you use Ant to build
- the project, this contains the path to the SDK installation. Because the content of the file
- is specific to the local installation of the SDK, it should not be maintained in a Source
- Revision Control system. If you use Eclipse, this file is not used.</dd>
-
- <dt><code>ant.properties</code></dt>
-
- <dd>Customizable properties for the build system. You can edit this file to override default
- build settings used by Ant and provide the location to your keystore and key alias, so that the
- build tools can sign your application when building in release mode. This file is integral to
- the project, so maintain it in a source revision control system.
- If you use Eclipse, this file is not used.</dd>
-
- <dt><code>build.xml</code></dt>
-
- <dd>The Ant build file for your project. This is only applicable for projects that
- you build with Ant.</dd>
- </dl>
-
- <p>For more information, see the <a href=
- "{@docRoot}guide/developing/testing/index.html">Testing</a> section.</p>
-
-
- <h2 id="testing">Testing a Library Project</h2>
-
- <p>There are two recommended ways of setting up testing on code and resources in a library
- project:</p>
-
- <ul>
- <li>You can set up a <a href="{@docRoot}guide/developing/testing/testing_otheride.html">test
- project</a> that instruments an application project that depends on the library project. You
- can then add tests to the project for library-specific features.</li>
-
- <li>You can set up a set up a standard application project that depends on the library and put
- the instrumentation in that project. This lets you create a self-contained project that
- contains both the tests/instrumentations and the code to test.</li>
- </ul>
\ No newline at end of file
diff --git a/docs/html/guide/developing/projects/projects-cmdline.jd b/docs/html/guide/developing/projects/projects-cmdline.jd
deleted file mode 100644
index b8db5f3..0000000
--- a/docs/html/guide/developing/projects/projects-cmdline.jd
+++ /dev/null
@@ -1,295 +0,0 @@
-page.title=Managing Projects from the Command Line
-parent.title=Managing Projects
-parent.link=index.html
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#CreatingAProject">Creating an Android Project</a></li>
- <li><a href="#UpdatingAProject">Updating a Project</a></li>
- <li><a href="#SettingUpLibraryProject">Setting up a Library Project</a>
- <ol>
- <li><a href="#CreatingManifestFile">Creating the manifest file</a></li>
- <li><a href="#UpdatingLibraryProject">Updating a library project</a></li>
- </ol>
- </li>
- <li><a href="#ReferencingLibraryProject">Referencing a Library Project</a>
- <ol>
- <li><a href="#DeclaringLibrary">Declaring library components in the manifest
-file</a></li>
- <li><a href="#depAppBuild">Building a dependent application</a></li>
- </ol>
- </li>
- </ol>
-
- <h2>See also</h2>
-
- <ol>
- <li><a href=
- "{@docRoot}guide/developing/testing/testing_otheride.html#CreateTestProjectCommand">Testing
- from Other IDEs</a></li>
- </ol>
- </div>
- </div>
-
- <p>The <code>android</code> tool provides you with commands to create all three types of
- projects. An Android project contains all of the files and resources that are needed to build a
- project into an .apk file for installation.
-
- <ul>
- <li>An Android project contains all of the files and resources that are needed to build a project into
- an .apk file for installation. You need to create an Android project for any application that you
- want to eventually install on a device.</li>
-
- <li>You can also designate an Android project as a library project, which allows it to be shared
- with other projects that depend on it. Once an Android project is designated as a library
- project, it cannot be installed onto a device.</li>
-
- <li>Test projects extend JUnit test functionality to include Android specific functionality. For
- more information on creating a test project, see <a href=
- "{@docRoot}guide/developing/testing/testing_otheride.html">Testing from other IDEs</a>.</li>
- </ul>
-
-
- <h2 id="CreatingAProject">Creating an Android Project</h2>
-
- <p>To create an Android project, you must use the <code>android</code> tool. When you create a
- new project with <code>android</code>, it will generate a project directory with some default
- application files, stub files, configuration files and a build file.</p>
-
- <p>To create a new Android project, open a command-line, navigate to the <code>tools/</code>
- directory of your SDK and run:</p>
- <pre>
-android create project \
---target <target_ID> \
---name <your_project_name> \
---path path/to/your/project \
---activity <your_activity_name> \
---package <your_package_namespace>
-</pre>
-
- <ul>
- <li><code>target</code> is the "build target" for your application. It corresponds to an
- Android platform library (including any add-ons, such as Google APIs) that you would like to
- build your project against. To see a list of available targets and their corresponding IDs,
- execute: <code>android list targets</code>.</li>
-
- <li><code>name</code> is the name for your project. This is optional. If provided, this name
- will be used for your .apk filename when you build your application.</li>
-
- <li><code>path</code> is the location of your project directory. If the directory does not
- exist, it will be created for you.</li>
-
- <li><code>activity</code> is the name for your default {@link android.app.Activity} class. This
- class file will be created for you inside
- <code><em><path_to_your_project></em>/src/<em><your_package_namespace_path></em>/</code>
- . This will also be used for your .apk filename unless you provide a <code>name</code>.</li>
-
- <li><code>package</code> is the package namespace for your project, following the same rules as
- for packages in the Java programming language.</li>
- </ul>
-
- <p>Here's an example:</p>
- <pre>
-android create project \
---target 1 \
---name MyAndroidApp \
---path ./MyAndroidAppProject \
---activity MyAndroidAppActivity \
---package com.example.myandroid
-</pre>
-
- <p>Once you've created your project, you're ready to begin development. You can move your project
- folder wherever you want for development, but keep in mind that you must use the <a href=
- "{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a> (adb) — located in the
- SDK <code>platform-tools/</code> directory — to send your application to the emulator (discussed
- later). So you need access between your project solution and the <code>platform-tools/</code> folder.</p>
-
- <p class="note"><strong>Tip:</strong> Add the <code>platform-tools/</code> as well as the <code>tools/</code> directory
- to your <code>PATH</code> environment variable.</p>
-
- <p class="caution"><strong>Caution:</strong> You should refrain from moving the location of the
- SDK directory, because this will break the SDK location property located in <code>local.properties</code>.
- If you need to update the SDK location, use the <code>android update project</code> command.
- See <a href="#UpdatingAProject">Updating a Project</a> for more information.</p>
-
- <h2 id="UpdatingAProject">Updating a Project</h2>
-
- <p>If you're upgrading a project from an older version of the Android SDK or want to create a new
- project from existing code, use the <code>android update project</code> command to update the
- project to the new development environment. You can also use this command to revise the build
- target of an existing project (with the <code>--target</code> option) and the project name (with
- the <code>--name</code> option). The <code>android</code> tool will generate any files and
- folders (listed in the previous section) that are either missing or need to be updated, as needed
- for the Android project.</p>
-
- <p>To update an existing Android project, open a command-line and navigate to the
- <code>tools/</code> directory of your SDK. Now run:</p>
- <pre>
-android update project --name <project_name> --target <target_ID>
---path <path_to_your_project>
-</pre>
-
- <ul>
- <li><code>target</code> is the "build target" for your application. It corresponds to an
- Android platform library (including any add-ons, such as Google APIs) that you would like to
- build your project against. To see a list of available targets and their corresponding IDs,
- execute: <code>android list targets</code>.</li>
-
- <li><code>path</code> is the location of your project directory.</li>
-
- <li><code>name</code> is the name for the project. This is optional—if you're not
- changing the project name, you don't need this.</li>
- </ul>
-
- <p>Here's an example:</p>
- <pre>
-android update project --name MyApp --target 2 --path ./MyAppProject
-</pre>
-
- <h2 id="SettingUpLibraryProject">Setting up a Library Project</h2>
-
- <p>A library project is a standard Android project, so you can create a new one in the same way
- as you would a new application project. Specifically, you can use the <code>android</code> tool
- to generate a new library project with all of the necessary files and folders.</p>
-
- <p>To create a new library project, navigate to the <code><sdk>/tools/</code> directory and
- use this command:</p>
- <pre class="no-pretty-print">
-android create lib-project --name <your_project_name> \
---target <target_ID> \
---path path/to/your/project \
---package <your_library_package_namespace>
-</pre>
-
- <p>The <code>create lib-project</code> command creates a standard project structure that includes
- preset property that indicates to the build system that the project is a library. It does this by
- adding this line to the project's <code>project.properties</code> file:</p>
- <pre class="no-pretty-print">
-android.library=true
-</pre>
-
- <p>Once the command completes, the library project is created and you can begin moving source
- code and resources into it, as described in the sections below.</p>
-
- <p>If you want to convert an existing application project to a library project, so that other
- applications can use it, you can do so by adding a the <code>android.library=true</code> property
- to the application's <code>project.properties</code> file.</p>
-
- <h3 id="CreatingManifestFile">Creating the manifest file</h3>
-
- <p>A library project's manifest file must declare all of the shared components that it includes,
- just as would a standard Android application. For more information, see the documentation for
- <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
-
- <p>For example, the <a href=
- "{@docRoot}resources/samples/TicTacToeLib/AndroidManifest.html">TicTacToeLib</a> example library
- project declares the Activity <code>GameActivity</code>:</p>
- <pre>
-<manifest>
- ...
- <application>
- ...
- <activity android:name="GameActivity" />
- ...
- </application>
-</manifest>
-</pre>
-
- <h3 id="UpdatingLibraryProject">Updating a library project</h3>
-
- <p>If you want to update the build properties (build target, location) of the library project,
- use this command:</p>
- <pre>
-android update lib-project \
---target <em><target_ID></em> \
---path <em>path/to/your/project</em>
-</pre>
-
- <h2 id="ReferencingLibraryProject">Referencing a Library Project</h2>
-
- <p>If you are developing an application and want to include the shared code or resources from a
- library project, you can do so easily by adding a reference to the library project in the
- application project's build properties.</p>
-
- <p>To add a reference to a library project, navigate to the <code><sdk>/tools/</code>
- directory and use this command:</p>
- <pre>
-android update project \
---target <em><target_ID></em> \
---path <em>path/to/your/project</em>
---library <em>path/to/library_projectA</em>
-</pre>
-
- <p>This command updates the application project's build properties to include a reference to the
- library project. Specifically, it adds an <code>android.library.reference.<em>n</em></code>
- property to the project's <code>project.properties</code> file. For example:</p>
- <pre class="no-pretty-print">
-android.library.reference.1=path/to/library_projectA
-</pre>
-
- <p>If you are adding references to multiple libraries, note that you can set their relative
- priority (and merge order) by manually editing the <code>project.properties</code> file and
- adjusting the each reference's <code>.<em>n</em></code> index as appropriate. For example, assume
- these references:</p>
- <pre class="no-pretty-print">
-android.library.reference.1=path/to/library_projectA
-android.library.reference.2=path/to/library_projectB
-android.library.reference.3=path/to/library_projectC
-</pre>
-
- <p>You can reorder the references to give highest priority to <code>library_projectC</code> in
- this way:</p>
- <pre class="no-pretty-print">
-android.library.reference.2=path/to/library_projectA
-android.library.reference.3=path/to/library_projectB
-android.library.reference.1=path/to/library_projectC
-</pre>
-
- <p>Note that the <code>.<em>n</em></code> index in the references must begin at "1" and increase
- uniformly without "holes". References appearing in the index after a hole are ignored.</p>
-
- <p>At build time, the libraries are merged with the application one at a time, starting from the
- lowest priority to the highest. Note that a library cannot itself reference another library and
- that, at build time, libraries are not merged with each other before being merged with the
- application.</p>
-
- <h3 id="DeclaringLibrary">Declaring library components in the manifest file</h3>
-
- <p>In the manifest file of the application project, you must add declarations of all components
- that the application will use that are imported from a library project. For example, you must
- declare any <code><activity></code>, <code><service></code>,
- <code><receiver></code>, <code><provider></code>, and so on, as well as
- <code><permission></code>, <code><uses-library></code>, and similar elements.</p>
-
- <p>Declarations should reference the library components by their fully-qualified package names,
- where appropriate.</p>
-
- <p>For example, the <a href=
- "{@docRoot}resources/samples/TicTacToeMain/AndroidManifest.html">TicTacToeMain</a> example
- application declares the library Activity <code>GameActivity</code> like this:</p>
- <pre>
-<manifest>
- ...
- <application>
- ...
- <activity android:name="com.example.android.tictactoe.library.GameActivity" />
- ...
- </application>
-</manifest>
-</pre>
-
- <p>For more information about the manifest file, see the documentation for
- <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
-
- <h3 id="depAppBuild">Building a dependent application</h3>
-
- <p>To build an application project that depends on one or more library projects, you can use the
- standard Ant build commands and compile modes, as described in <a href=
- "{@docRoot}guide/developing/building/index.html">Building and Running</a>. The tools
-compile and merge all libraries referenced by the application as part of
- compiling the dependent application project. No additional commands or steps are necessary.</p>
-
diff --git a/docs/html/guide/developing/projects/projects-eclipse.jd b/docs/html/guide/developing/projects/projects-eclipse.jd
deleted file mode 100644
index 90f7820..0000000
--- a/docs/html/guide/developing/projects/projects-eclipse.jd
+++ /dev/null
@@ -1,237 +0,0 @@
-page.title=Managing Projects from Eclipse with ADT
-parent.title=Managing Projects
-parent.link=index.html
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#CreatingAProject">Creating an Android Project</a></li>
-
- <li><a href="#SettingUpLibraryProject">Setting up a Library Project</a></li>
-
- <li><a href="#ReferencingLibraryProject">Referencing a Library Project</a></li>
- </ol>
-
- <h2>See also</h2>
-
- <ol>
- <li><a href=
- "{@docRoot}guide/developing/testing/testing_eclipse.html#CreateTestProjectEclipse">Testing
- from Eclipse with ADT</a></li>
- </ol>
- </div>
- </div>
-
- <p>Eclipse and the ADT plugin provide GUIs and wizards to create all three types of projects
- (Android project, Library project, and Test project):
-
- <ul>
- <li>An Android project contains all of the files and resources that are needed to build a project into
- an .apk file for installation. You need to create an Android project for any application that you
- want to eventually install on a device.</li>
-
- <li>You can also designate an Android project as a library project, which allows it to be shared
- with other projects that depend on it. Once an Android project is designated as a library
- project, it cannot be installed onto a device.</li>
-
- <li>Test projects extend JUnit test functionality to include Android specific functionality. For
- more information on creating a test project, see <a href=
- "{@docRoot}guide/developing/testing/testing_eclipse.html">Testing from Eclipse with ADT</a>.</li>
- </ul>
-
- <h2 id="CreatingAProject">Creating an Android Project</h2>
-
- <p>The ADT plugin provides a <em>New Project Wizard</em> that you can use to quickly create a new Android
- project (or a project from existing code). To create a new project:</p>
-
- <ol>
- <li>Select <strong>File</strong> > <strong>New</strong> > <strong>Project</strong>.</li>
-
- <li>Select <strong>Android</strong> > <strong>Android Project</strong>, and click
- <strong>Next</strong>.</li>
-
- <li>Select the contents for the project:
-
- <ul>
- <li>Enter a <em>Project Name</em>. This will be the name of the folder where your project
- is created.</li>
-
- <li>Under Contents, select <strong>Create new project in workspace</strong>. Select your
- project workspace location.</li>
-
- <li>Under Target, select an Android target to be used as the project's Build Target. The
- Build Target specifies which Android platform you'd like your application built against.
-
- <p>Select the lowest platform with which your application is compatible.</p>
-
- <p class="note"><strong>Note:</strong> You can change your the Build Target for your
- project at any time: Right-click the project in the Package Explorer, select
- <strong>Properties</strong>, select <strong>Android</strong> and then check the desired
- Project Target.</p>
- </li>
-
- <li>Under Properties, fill in all necessary fields.
-
- <ul>
- <li>Enter an <em>Application name</em>. This is the human-readable title for your
- application — the name that will appear on the Android device.</li>
-
- <li>Enter a <em>Package name</em>. This is the package namespace (following the same
- rules as for packages in the Java programming language) where all your source code will
- reside.</li>
-
- <li>Select <em>Create Activity</em> (optional, of course, but common) and enter a name
- for your main Activity class.</li>
-
- <li>Enter a <em>Min SDK Version</em>. This is an integer that indicates the minimum API
- Level required to properly run your application. Entering this here automatically sets
- the <code>minSdkVersion</code> attribute in the <a href=
- "{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a> of your
- Android Manifest file. If you're unsure of the appropriate <a href=
- "{@docRoot}guide/appendix/api-levels.html">API Level</a> to use, copy the API Level
- listed for the Build Target you selected in the Target tab.</li>
- </ul>
- </li>
- </ul>
- </li>
-
- <li>Click <strong>Finish</strong>.</li>
- </ol>
-
- <p class="note"><strong>Tip:</strong> You can also start the New Project Wizard from the
- <em>New</em> icon in the toolbar.</p>
-
- <h2 id="SettingUpLibraryProject">Setting up a Library Project</h2>
-
- <p>A library project is a standard Android project, so you can create a new one in the same way
- as you would a new application project.</p>
-
- <p>When you are creating the library project, you can select any application name, package, and
- set other fields as needed, as shown in figure 1.</p>
-
- <p>Next, set the project's properties to indicate that it is a library project:</p>
-
- <ol>
- <li>In the <strong>Package Explorer</strong>, right-click the library project and select
- <strong>Properties</strong>.</li>
-
- <li>In the <strong>Properties</strong> window, select the "Android" properties group at left
- and locate the <strong>Library</strong> properties at right.</li>
-
- <li>Select the "is Library" checkbox and click <strong>Apply</strong>.</li>
-
- <li>Click <strong>OK</strong> to close the <em>Properties</em> window.</li>
- </ol>
-
- <p>The new project is now marked as a library project. You can begin moving source code and
- resources into it, as described in the sections below.</p>
-
- <p>You can also convert an existing application project into a library. To do so, simply open the
- Properties for the project and select the "is Library" checkbox. Other application projects can
- now reference the existing project as a library project.</p>
-
- <img src= "{@docRoot}images/developing/adt-props-isLib.png">
-
- <p class="img-caption"><strong>Figure 1.</strong> Marking a project as an
- Android library project.</p>
-
- <h3>Creating the manifest file</h3>
-
- <p>A library project's manifest file must declare all of the shared components that it includes,
- just as would a standard Android application. For more information, see the documentation for
- <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
-
- <p>For example, the <a href=
- "{@docRoot}resources/samples/TicTacToeLib/AndroidManifest.html">TicTacToeLib</a> example library
- project declares the Activity <code>GameActivity</code>:</p>
- <pre>
-<manifest>
- ...
- <application>
- ...
- <activity android:name="GameActivity" />
- ...
- </application>
-</manifest>
-</pre>
-
- <h2 id="ReferencingLibraryProject">Referencing a library project</h2>
-
- <p>If you are developing an application and want to include the shared code or resources from a
- library project, you can do so easily by adding a reference to the library project in the
- application project's Properties.</p>
-
- <p>To add a reference to a library project, follow these steps:</p>
-
- <ol>
- <li>In the <strong>Package Explorer</strong>, right-click the dependent project and select
- <strong>Properties</strong>.</li>
-
- <li>In the <strong>Properties</strong> window, select the "Android" properties group at left
- and locate the <strong>Library</strong> properties at right.</li>
-
- <li>Click <strong>Add</strong> to open the <strong>Project Selection</strong> dialog.</li>
-
- <li>From the list of available library projects, select a project and click
- <strong>OK</strong>.</li>
-
- <li>When the dialog closes, click <strong>Apply</strong> in the <strong>Properties</strong>
- window.</li>
-
- <li>Click <strong>OK</strong> to close the <strong>Properties</strong> window.</li>
- </ol>
-
- <p>As soon as the Properties dialog closes, Eclipse rebuilds the project, including the contents
- of the library project.</p>
-
- <p>Figure 2 shows the Properties dialog that lets you add library references and move
- them up and down in priority.</p><img src="{@docRoot}images/developing/adt-props-libRef.png">
-
- <p class="img-caption"><strong>Figure 2.</strong> Adding a reference to a
- library project in the properties of an application project.</p>
-
- <p>If you are adding references to multiple libraries, note that you can set their relative
- priority (and merge order) by selecting a library and using the <strong>Up</strong> and
- <strong>Down</strong> controls. The tools merge the referenced libraries with your application
- starting from lowest priority (bottom of the list) to highest (top of the list). If more than one
- library defines the same resource ID, the tools select the resource from the library with higher
- priority. The application itself has highest priority and its resources are always used in
- preference to identical resource IDs defined in libraries.</p>
-
- <h3>Declaring library components in the manifest file</h3>
-
- <p>In the manifest file of the application project, you must add declarations of all components
- that the application will use that are imported from a library project. For example, you must
- declare any <code><activity></code>, <code><service></code>,
- <code><receiver></code>, <code><provider></code>, and so on, as well as
- <code><permission></code>, <code><uses-library></code>, and similar elements.</p>
-
- <p>Declarations should reference the library components by their fully-qualified package names,
- where appropriate.</p>
-
- <p>For example, the <a href=
- "{@docRoot}resources/samples/TicTacToeMain/AndroidManifest.html">TicTacToeMain</a> example
- application declares the library Activity <code>GameActivity</code> like this:</p>
- <pre>
-<manifest>
- ...
- <application>
- ...
- <activity android:name="com.example.android.tictactoe.library.GameActivity" />
- ...
- </application>
-</manifest>
-</pre>
-
- <p>For more information about the manifest file, see the documentation for <a href=
- "{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
-
-
-
-
-
-
-
diff --git a/docs/html/guide/developing/testing/index.jd b/docs/html/guide/developing/testing/index.jd
deleted file mode 100644
index 8a08959..0000000
--- a/docs/html/guide/developing/testing/index.jd
+++ /dev/null
@@ -1,36 +0,0 @@
-page.title=Testing
-@jd:body
-<p>
- Android includes powerful tools for setting up and running test applications.
- Whether you are working in Eclipse with ADT or working from the command line, these tools
- help you set up and run your tests within an emulator or the device you are targeting.
- The documents listed below explain how to work with the tools in your development environment.
-</p>
-<p>
- If you aren't yet familiar with the Android testing framework, please read the topic
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Fundamentals</a>
- before you get started.
- For a step-by-step introduction to Android testing, try the <a
- href="{@docRoot}resources/tutorials/testing/helloandroid_test.html">Hello, Testing</a>
- tutorial, which introduces basic testing concepts and procedures.
- For a more advanced tutorial, try <a
- href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity Testing</a>,
- which guides you through a more complex testing scenario.
-</p>
-<dl>
- <dt><a href="testing_eclipse.html">Testing from Eclipse, with ADT</a></dt>
- <dd>
- The ADT plugin lets you quickly set up and manage test projects directly in
- the Eclipse UI. Once you have written your tests, you can build and run them and
- then see the results in the Eclipse JUnit view. You can also use the SDK command-line
- tools to execute your tests if needed.
- </dd>
- <dt><a href="testing_otheride.html">Testing from Other IDEs</a></dt>
- <dd>
- The SDK command-line tools provide the same capabilities as the ADT plugin. You can
- use them to set up and manage test projects, build your test application,
- run your tests, and see the results. You use
- the <code>android</code> tool to create and manage test projects, the Ant build system
- to compile them, and the <code>adb</code> tool to install and run them.
- </dd>
-</dl>
diff --git a/docs/html/guide/developing/testing/testing_eclipse.jd b/docs/html/guide/developing/testing/testing_eclipse.jd
deleted file mode 100644
index 4e9ecca..0000000
--- a/docs/html/guide/developing/testing/testing_eclipse.jd
+++ /dev/null
@@ -1,535 +0,0 @@
-page.title=Testing from Eclipse with ADT
-parent.title=Testing
-parent.link=index.html
-@jd:body
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#CreateTestProjectEclipse">Creating a Test Project</a></li>
- <li><a href="#CreateTestAppEclipse">Creating a Test Package</a></li>
- <li><a href="#RunTestEclipse">Running Tests</a></li>
- </ol>
- </div>
-</div>
-<p>
- This topic explains how create and run tests of Android applications in Eclipse with ADT.
- Before you read this topic, you should read about how to create an Android application with the
- basic processes for creating and running applications with ADT, as described in
- <a href="{@docRoot}guide/developing/projects/projects-eclipse.html">Managing Projects from
-Eclipse</a>
- and <a href="{@docRoot}guide/developing/building/building-eclipse.html">Building and Running
-from Eclipse</a>.
- You may also want to read
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Fundamentals</a>,
- which provides an overview of the Android testing framework.
-</p>
-<p>
- ADT provides several features that help you set up and manage your testing environment
- effectively:
-</p>
- <ul>
- <li>
- It lets you quickly create a test project and link it to the application under test.
- When it creates the test project, it automatically inserts the necessary
- <code><instrumentation></code> element in the test package's manifest file.
- </li>
- <li>
- It lets you quickly import the classes of the application under test, so that your
- tests can inspect them.
- </li>
- <li>
- It lets you create run configurations for your test package and include in
- them flags that are passed to the Android testing framework.
- </li>
- <li>
- It lets you run your test package without leaving Eclipse. ADT builds both the
- application under test and the test package automatically, installs them if
- necessary to your device or emulator, runs the test package, and displays the
- results in a separate window in Eclipse.
- </li>
- </ul>
-<p>
- If you are not developing in Eclipse or you want to learn how to create and run tests from the
- command line, see
- <a href="{@docRoot}guide/developing/testing/testing_otheride.html">Testing from Other IDEs</a>.
-</p>
-<h2 id="CreateTestProjectEclipse">Creating a Test Project</h2>
-<p>
- To set up a test environment for your Android application, you must first create a separate
- project that holds the test code. The new project follows the directory structure
- used for any Android application. It includes the same types of content and files, such as
- source code, resources, a manifest file, and so forth. The test package you
- create is connected to the application under test by an
- <a href="{@docRoot}guide/topics/manifest/instrumentation-element.html">
- <code><instrumentation></code></a> element in its manifest file.
-</p>
-<p>
- The <em>New Android Test Project</em> dialog makes it easy for you to generate a
- new test project that has the proper structure, including the
- <code><instrumentation></code> element in the manifest file. You can use the New
- Android Test Project dialog to generate the test project at any time. The dialog appears
- just after you create a new Android main application project, but you can also run it to
- create a test project for a project that you created previously.
-</p>
-<p>
- To create a test project in Eclipse with ADT:
-</p>
-<ol>
- <li>
- In Eclipse, select <strong>File > New > Other</strong>. This opens the <em>Select a
- Wizard</em> dialog.
- </li>
- <li>
- In the dialog, in the <em>Wizards</em> drop-down list, find the entry for Android, then
- click the toggle to the left. Select <strong>Android Test Project</strong>, then at the
- bottom of the dialog click <strong>Next</strong>. The <em>New Android Test Project</em>
- wizard appears.
- </li>
- <li>
- Next to <em>Test Project Name</em>, enter a name for the project. You may use any name,
- but you may want to associate the name with the project name for the application under test.
- One way to do this is to take the application's project name, append the string "Test" to
- it, and then use this as the test package project name.
- <p>
- The name becomes part of the suggested project path, but you can change this in the
- next step.
- </p>
- </li>
- <li>
- In the <em>Content</em> panel, examine the suggested path to the project.
- If <em>Use default location</em> is set, then the wizard will suggest a path that is
- a concatenation of the workspace path and the project name you entered. For example,
- if your workspace path is <code>/usr/local/workspace</code> and your project name is
- <code>MyTestApp</code>, then the wizard will suggest
- <code>/usr/local/workspace/MyTestApp</code>. To enter your own
- choice for a path, unselect <em>Use default location</em>, then enter or browse to the
- path where you want your project.
- <p>
- To learn more about choosing the location of test projects, please read
- <a href="{@docRoot}guide/topics/testing/testing_android.html#TestProjectPaths">
- Testing Fundamentals</a>.
- </p>
- </li>
- <li>
- In the Test Target panel, set An Existing Android Project, click Browse, then select your
- Android application from the list. You now see that the wizard has completed the Test
- Target Package, Application Name, and Package Name fields for you (the latter two are in
- the Properties panel).
- </li>
- <li>
- In the Build Target panel, select the Android SDK platform that the application under test
- uses.
- </li>
- <li>
- Click Finish to complete the wizard. If Finish is disabled, look for error messages at the
- top of the wizard dialog, and then fix any problems.
- </li>
-</ol>
-<h2 id="CreateTestAppEclipse">Creating a Test Package</h2>
-<p>
- Once you have created a test project, you populate it with a test package. This package does not
- require an Activity, although you can define one if you wish. Although your test package can
- combine Activity classes, test case classes, or ordinary classes, your main test case
- should extend one of the Android test case classes or JUnit classes, because these provide the
- best testing features.
-</p>
-<p>
- Test packages do not need to have an Android GUI. When you run the package in
- Eclipse with ADT, its results appear in the JUnit view. Running tests and seeing the results is
- described in more detail in the section <a href="#RunTestEclipse">Running Tests</a>.
-</p>
-
-<p>
- To create a test package, start with one of Android's test case classes defined in
- {@link android.test android.test}. These extend the JUnit
- {@link junit.framework.TestCase TestCase} class. The Android test classes for Activity objects
- also provide instrumentation for testing an Activity. To learn more about test case
- classes, please read the topic <a href="{@docRoot}guide/topics/testing/testing_android.html">
- Testing Fundamentals</a>.
-</p>
-<p>
- Before you create your test package, you choose the Java package identifier you want to use
- for your test case classes and the Android package name you want to use. To learn more
- about this, please read
- <a href="{@docRoot}guide/topics/testing/testing_android.html#PackageNames">
- Testing Fundamentals</a>.
-</p>
-<p>
- To add a test case class to your project:
-</p>
-<ol>
- <li>
- In the <em>Project Explorer</em> tab, open your test project, then open the <em>src</em>
- folder.
- </li>
- <li>
- Find the Java package identifier set by the projection creation wizard. If you haven't
- added classes yet, this node won't have any children, and its icon will not be filled in.
- If you want to change the identifier value, right-click the identifier and select
- <strong>Refactor</strong> > <strong>Rename</strong>, then enter the new name.
- </li>
- <li>
- When you are ready, right-click the Java package identifier again and select
- <strong>New</strong> > <strong>Class</strong>. This displays the <em>New Java Class</em>
- dialog, with the <em>Source folder</em> and <em>Package</em> values already set.
- </li>
- <li>
- In the <em>Name</em> field, enter a name for the test case class. One way to choose a
- class name is to append the string "Test" to the class of the component you are testing.
- For example, if you are testing the class MyAppActivity, your test case class
- name would be MyAppActivityTest. Leave the modifiers set to <em>public</em>.
- </li>
- <li>
- In the <em>Superclass</em> field, enter the name of the Android test case class you
- are extending. You can also browse the available classes.
- </li>
- <li>
- In <em>Which method stubs would you like to create?</em>, unset all the options, then
- click <strong>Finish</strong>. You will set up the constructor manually.
- </li>
- <li>
- Your new class appears in a new Java editor pane.
- </li>
-</ol>
-<p>
- You now have to ensure that the constructor is set up correctly. Create a constructor for your
- class that has no arguments; this is required by JUnit. As the first statement in this
- constructor, add a call to the base class' constructor. Each base test case class has its
- own constructor signature. Refer to the class documentation in the documentation for
- {@link android.test} for more information.
-</p>
-<p>
- To control your test environment, you will want to override the <code>setUp()</code> and
- <code>tearDown()</code> methods:
-</p>
-<ul>
- <li>
- <code>setUp()</code>: This method is invoked before any of the test methods in the class.
- Use it to set up the environment for the test (the test fixture. You can use
- <code>setUp()</code> to instantiate a new Intent with the action <code>ACTION_MAIN</code>.
- You can then use this intent to start the Activity under test.
- </li>
- <li>
- <code>tearDown()</code>: This method is invoked after all the test methods in the class. Use
- it to do garbage collection and to reset the test fixture.
- </li>
-</ul>
-<p>
- Another useful convention is to add the method <code>testPreconditions()</code> to your test
- class. Use this method to test that the application under test is initialized correctly. If this
- test fails, you know that that the initial conditions were in error. When this happens, further
- test results are suspect, regardless of whether or not the tests succeeded.
-</p>
-<p>
- The Resources tab contains an
- <a href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity Testing</a>
- tutorial with more information about creating test classes and methods.
-</p>
-<h2 id="RunTestEclipse">Running Tests</h2>
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Running tests from the command line</h2>
- <p>
- If you've created your tests in Eclipse, you can still run your tests and test
- suites by using command-line tools included with the Android SDK. You may want
- to do this, for example, if you have a large number of tests to run, if you
- have a large test case, or if you want a fine level of control over which
- tests are run at a particular time.
- </p>
- <p>
- To run tests created in Eclipse with ADT with command-line tools, you must first
- install additional files into the test project using the <code>android</code>
- tool's "create test-project" option. To see how to do this, read
- <a href="{@docRoot}guide/developing/testing/testing_otheride.html#CreateProject">
- Testing in Other IDEs</a>.
- </p>
- </div>
- </div>
-<p>
- When you run a test package in Eclipse with ADT, the output appears in the Eclipse JUnit view.
- You can run the entire test package or one test case class. To do run tests, Eclipse runs the
- <code>adb</code> command for running a test package, and displays the output, so there is no
- difference between running tests inside Eclipse and running them from the command line.
-</p>
-<p>
- As with any other package, to run a test package in Eclipse with ADT you must either attach a
- device to your computer or use the Android emulator. If you use the emulator, you must have an
- Android Virtual Device (AVD) that uses the same target as the test package.
-</p>
-<p>
- To run a test in Eclipse, you have two choices:</p>
-<ul>
- <li>
- Run a test just as you run an application, by selecting
- <strong>Run As... > Android JUnit Test</strong> from the project's context menu or
- from the main menu's <strong>Run</strong> item.
- </li>
- <li>
- Create an Eclipse run configuration for your test project. This is useful if you want
- multiple test suites, each consisting of selected tests from the project. To run
- a test suite, you run the test configuration.
- <p>
- Creating and running test configurations is described in the next section.
- </p>
- </li>
-</ul>
-<p>
- To create and run a test suite using a run configuration:
-</p>
-<ol>
- <li>
- In the Package Explorer, select the test project, then from the main menu, select
- <strong>Run > Run Configurations...</strong>. The Run Configurations dialog appears.
- </li>
- <li>
- In the left-hand pane, find the Android JUnit Test entry. In the right-hand pane, click the
- Test tab. The Name: text box shows the name of your project. The Test class: dropdown box
- shows one of the test classes in your project.
- </li>
- <li>
- To run one test class, click Run a single test, then enter your project name in the
- Project: text box and the class name in the Test class: text box.
- <p>
- To run all the test classes, click Run all tests in the selected project or package,
- then enter the project or package name in the text box.
- </p>
- </li>
- <li>
- Now click the Target tab.
- <ul>
- <li>
- Optional: If you are using the emulator, click Automatic, then in the Android
- Virtual Device (AVD) selection table, select an existing AVD.
- </li>
- <li>
- In the Emulator Launch Parameters pane, set the Android emulator flags you want to
- use. These are documented in the topic
- <a href="{@docRoot}guide/developing/tools/emulator.html#startup-options">
- Android Emulator</a>.
- </li>
- </ul>
- </li>
- <li>
- Click the Common tab. In the Save As pane, click Local to save this run configuration
- locally, or click Shared to save it to another project.
- </li>
- <li>
- Optional: Add the configuration to the Run toolbar and the <strong>Favorites</strong>
- menu: in the Display in Favorites pane click the checkbox next to Run.
- </li>
- <li>
- Optional: To add this configuration to the <strong>Debug</strong> menu and toolbar, click
- the checkbox next to Debug.
- </li>
- <li>
- To save your settings, click Close.<br/>
- <p class="note"><strong>Note:</strong>
- Although you can run the test immediately by clicking Run, you should save the test
- first and then run it by selecting it from the Eclipse standard toolbar.
- </p>
- </li>
- <li>
- On the Eclipse standard toolbar, click the down arrow next to the green Run arrow. This
- displays a menu of saved Run and Debug configurations.
- </li>
- <li>
- Select the test run configuration you just created. The test starts.
- </li>
-</ol>
-<p>
- The progress of your test appears in the Console view as a series of messages. Each message is
- preceded by a timestamp and the <code>.apk</code> filename to which it applies. For example,
- this message appears when you run a test to the emulator, and the emulator is not yet started:
-</p>
-<div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Message Examples</h2>
- <p>
- The examples shown in this section come from the
- <a href="{@docRoot}resources/samples/SpinnerTest/index.html">SpinnerTest</a>
- sample test package, which tests the
- <a href="{@docRoot}resources/samples/Spinner/index.html">Spinner</a>
- sample application. This test package is also featured in the
- <a href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity Testing</a>
- tutorial.
- </p>
- </div>
-</div>
-<pre>
- [<em>yyyy-mm-dd hh:mm:ss</em> - <em>testfile</em>] Waiting for HOME ('android.process.acore') to be launched...
-</pre>
-<p>
- In the following description of these messages, <code><em>devicename</em></code> is the name of
- the device or emulator you are using to run the test, and <code><em>port</em></code> is the
- port number for the device. The name and port number are in the format used by the
- <code><a href="{@docRoot}guide/developing/tools/adb.html#devicestatus">adb devices</a></code>
- command. Also, <code><em>testfile</em></code> is the <code>.apk</code> filename of the test
- package you are running, and <em>appfile</em> is the filename of the application under test.
-</p>
-<ul>
- <li>
- If you are using an emulator and you have not yet started it, then Eclipse
- first starts the emulator. When this is complete, you see
- the message:
- <p>
- <code>HOME is up on device '<em>devicename</em>-<em>port</em>'</code>
- </p>
- </li>
- <li>
- If you have not already installed your test package, then you see
- the message:
- <p>
- <code>Uploading <em>testfile</em> onto device '<em>devicename</em>-<em>port</em>'
- </code>
- </p>
- <p>
- then the message <code>Installing <em>testfile</em></code>.
- </p>
- <p>
- and finally the message <code>Success!</code>
- </p>
- </li>
-</ul>
-<p>
- The following lines are an example of this message sequence:
-</p>
-<code>
-[2010-07-01 12:44:40 - MyTest] HOME is up on device 'emulator-5554'<br>
-[2010-07-01 12:44:40 - MyTest] Uploading MyTest.apk onto device 'emulator-5554'<br>
-[2010-07-01 12:44:40 - MyTest] Installing MyTest.apk...<br>
-[2010-07-01 12:44:49 - MyTest] Success!<br>
-</code>
-<br>
-<ul>
- <li>
- Next, if you have not yet installed the application under test to the device or
- emulator, you see the message
- <p>
- <code>Project dependency found, installing: <em>appfile</em></code>
- </p>
- <p>
- then the message <code>Uploading <em>appfile</em></code> onto device
- '<em>devicename</em>-<em>port</em>'
- </p>
- <p>
- then the message <code>Installing <em>appfile</em></code>
- </p>
- <p>
- and finally the message <code>Success!</code>
- </p>
- </li>
-</ul>
-<p>
- The following lines are an example of this message sequence:
-</p>
-<code>
-[2010-07-01 12:44:49 - MyTest] Project dependency found, installing: MyApp<br>
-[2010-07-01 12:44:49 - MyApp] Uploading MyApp.apk onto device 'emulator-5554'<br>
-[2010-07-01 12:44:49 - MyApp] Installing MyApp.apk...<br>
-[2010-07-01 12:44:54 - MyApp] Success!<br>
-</code>
-<br>
-<ul>
- <li>
- Next, you see the message
- <code>Launching instrumentation <em>instrumentation_class</em> on device
- <em>devicename</em>-<em>port</em></code>
- <p>
- <code>instrumentation_class</code> is the fully-qualified class name of the
- instrumentation test runner you have specified (usually
- {@link android.test.InstrumentationTestRunner}.
- </p>
- </li>
- <li>
- Next, as {@link android.test.InstrumentationTestRunner} builds a list of tests to run,
- you see the message
- <p>
- <code>Collecting test information</code>
- </p>
- <p>
- followed by
- </p>
- <p>
- <code>Sending test information to Eclipse</code>
- </p>
- </li>
- <li>
- Finally, you see the message <code>Running tests</code>, which indicates that your tests
- are running. At this point, you should start seeing the test results in the JUnit view.
- When the tests are finished, you see the console message <code>Test run complete</code>.
- This indicates that your tests are finished.
- </li>
-</ul>
-<p>
- The following lines are an example of this message sequence:
-</p>
-<code>
-[2010-01-01 12:45:02 - MyTest] Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5554<br>
-[2010-01-01 12:45:02 - MyTest] Collecting test information<br>
-[2010-01-01 12:45:02 - MyTest] Sending test information to Eclipse<br>
-[2010-01-01 12:45:02 - MyTest] Running tests...<br>
-[2010-01-01 12:45:22 - MyTest] Test run complete<br>
-</code>
-<br>
-<p>
- The test results appear in the JUnit view. This is divided into an upper summary pane,
- and a lower stack trace pane.
-</p>
-<p>
- The upper pane contains test information. In the pane's header, you see the following
- information:
-</p>
-<ul>
- <li>
- Total time elapsed for the test package (labeled Finished after <em>x</em> seconds).
- </li>
- <li>
- Number of runs (Runs:) - the number of tests in the entire test class.
- </li>
- <li>
- Number of errors (Errors:) - the number of program errors and exceptions encountered
- during the test run.
- </li>
- <li>
- Number of failures (Failures:) - the number of test failures encountered during the test
- run. This is the number of assertion failures. A test can fail even if the program does
- not encounter an error.
- </li>
- <li>
- A progress bar. The progress bar extends from left to right as the tests run. If all the
- tests succeed, the bar remains green. If a test fails, the bar turns from green to red.
- </li>
-</ul>
-<p>
- The body of the upper pane contains the details of the test run. For each test case class
- that was run, you see a line with the class name. To look at the results for the individual
- test methods in that class, you click the left arrow to expand the line. You now see a
- line for each test method in the class, and to its right the time it took to run.
- If you double-click the method name, Eclipse opens the test class source in an editor view
- pane and moves the focus to the first line of the test method.
-</p>
-<p>
- The results of a successful test are shown in figure 1.
-</p>
-<a href="{@docRoot}images/testing/eclipse_test_results.png">
- <img src="{@docRoot}images/testing/eclipse_test_results.png"
- alt="Messages for a successful test" height="327px" id="TestResults"/>
-</a>
-<p class="img-caption">
- <strong>Figure 1.</strong> Messages for a successful test.
-</p>
-<p>
- The lower pane is for stack traces. If you highlight a failed test in the upper pane, the
- lower pane contains a stack trace for the test. If a line corresponds to a point in your
- test code, you can double-click it to display the code in an editor view pane, with the
- line highlighted. For a successful test, the lower pane is empty.
-</p>
-<p>The results of a failed test are shown in figure 2.</p>
-<a href="{@docRoot}images/testing/eclipse_test_run_failure.png">
- <img src="{@docRoot}images/testing/eclipse_test_run_failure.png"
- alt="" height="372px" id="TestRun"/>
-</a>
-<p class="img-caption">
- <strong>Figure 2.</strong> Messages for a test failure.
-</p>
diff --git a/docs/html/guide/developing/testing/testing_otheride.jd b/docs/html/guide/developing/testing/testing_otheride.jd
deleted file mode 100644
index 7745ae7..0000000
--- a/docs/html/guide/developing/testing/testing_otheride.jd
+++ /dev/null
@@ -1,694 +0,0 @@
-page.title=Testing from Other IDEs
-parent.title=Testing
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li>
- <a href="#CreateTestProjectCommand">Working with Test Projects</a>
- <ol>
- <li>
- <a href="#CreateTestProject">Creating a test project</a>
- </li>
- <li>
- <a href="#UpdateTestProject">Updating a test project</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#CreateTestApp">Creating a Test Package</a>
- </li>
- <li>
- <a href="#RunTestsCommand">Running Tests</a>
- <ol>
- <li>
- <a href="#RunTestsAnt">Quick build and run with Ant</a>
- </li>
- <li>
- <a href="#RunTestsDevice">Running tests on a device or emulator</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#AMSyntax">Using the Instrument Command</a>
- <ol>
- <li>
- <a href="#AMOptionsSyntax">Instrument options</a>
- </li>
- <li>
- <a href="#RunTestExamples">Instrument examples</a>
- </li>
- </ol>
- </li>
- </ol>
- <h2>See Also</h2>
- <ol>
- <li>
- <a href="{@docRoot}guide/topics/testing/testing_android.html">
- Testing Fundamentals</a>
- </li>
- <li>
- <a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a>
- </li>
- </ol>
- </div>
-</div>
-<p>
- This document describes how to create and run tests directly from the command line.
- You can use the techniques described here if you are developing in an IDE other than Eclipse
- or if you prefer to work from the command line. This document assumes that you already know how
- to create a Android application in your programming environment. Before you start this
- document, you should read the topic
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Fundamentals</a>,
- which provides an overview of Android testing.
-</p>
-<p>
- If you are developing in Eclipse with ADT, you can set up and run your tests
- directly in Eclipse. For more information, please read
- <a href="{@docRoot}guide/developing/testing/testing_eclipse.html">
- Testing from Eclipse with ADT</a>.
-</p>
-<h2 id="CreateTestProjectCommand">Working with Test Projects</h2>
-<p>
- You use the <code>android</code> tool to create test projects.
- You also use <code>android</code> to convert existing test code into an Android test project,
- or to add the <code>run-tests</code> Ant target to an existing Android test project.
- These operations are described in more detail in the section <a href="#UpdateTestProject">
- Updating a test project</a>. The <code>run-tests</code> target is described in
- <a href="#RunTestsAnt">Quick build and run with Ant</a>.
-</p>
-<h3 id="CreateTestProject">Creating a test project</h3>
-<p>
- To create a test project with the <code>android</code> tool, enter:
-</p>
-<pre>
-android create test-project -m <main_path> -n <project_name> -p <test_path>
-</pre>
-<p>
- You must supply all the flags. The following table explains them in detail:
-</p>
-<table>
- <tr>
- <th>Flag</th>
- <th>Value</th>
- <th>Description</th>
- </tr>
- <tr>
- <td><code>-m, --main</code></td>
- <td>
- Path to the project of the application under test, relative to the test package
- directory.
- </td>
- <td>
- For example, if the application under test is in <code>source/HelloAndroid</code>, and
- you want to create the test project in <code>source/HelloAndroidTest</code>, then the
- value of <code>--main</code> should be <code>../HelloAndroid</code>.
- <p>
- To learn more about choosing the location of test projects, please read
- <a href="{@docRoot}guide/topics/testing/testing_android.html#TestProjects">
- Testing Fundamentals</a>.
- </p>
- </td>
- </tr>
- <tr>
- <td><code>-n, --name</code></td>
- <td>Name that you want to give the test project.</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>-p, --path</code></td>
- <td>Directory in which you want to create the new test project.</td>
- <td>
- The <code>android</code> tool creates the test project files and directory structure
- in this directory. If the directory does not exist, <code>android</code> creates it.
- </td>
- </tr>
-</table>
-<p>
- If the operation is successful, <code>android</code> lists to STDOUT the names of the files
- and directories it has created.
-</p>
-<p>
- This creates a new test project with the appropriate directories and build files. The directory
- structure and build file contents are identical to those in a regular Android application
- project. They are described in detail in the topic
- <a href="{@docRoot}guide/developing/projects/index.html">Managing Projects</a>.
-</p>
-<p>
- The operation also creates an <code>AndroidManifest.xml</code> file with instrumentation
- information. When you run the test, Android uses this information to load the application you
- are testing and control it with instrumentation.
-</p>
-<p>
- For example, suppose you create the <a href="{@docRoot}resources/tutorials/hello-world.html">
- Hello, World</a> tutorial application in the directory <code>~/source/HelloAndroid</code>.
- In the tutorial, this application uses the package name <code>com.example.helloandroid</code>
- and the activity name <code>HelloAndroid</code>. You can to create the test for this in
- <code>~/source/HelloAndroidTest</code>. To do so, you enter:
-</p>
-<pre>
-$ cd ~/source
-$ android create test-project -m ../HelloAndroid -n HelloAndroidTest -p HelloAndroidTest
-</pre>
-<p>
- This creates a directory called <code>~/src/HelloAndroidTest</code>. In the new directory you
- see the file <code>AndroidManifest.xml</code>. This file contains the following
- instrumentation-related elements and attributes:
-</p>
-<ul>
- <li>
- <code><application></code>: to contain the
- <code><uses-library></code> element.
- </li>
- <li>
- <code><uses-library android:name="android.test.runner"</code>:
- specifies this testing application uses the <code>android.test.runner</code> library.
- </li>
- <li>
- <code><instrumentation></code>: contains attributes that control Android
- instrumentation. The attributes are:
- <ul>
- <li>
- <code>android:name="android.test.InstrumentationTestRunner"</code>:
- {@link android.test.InstrumentationTestRunner} runs test cases. It extends both
- JUnit test case runner classes and Android instrumentation classes.
- </li>
- <li>
- <code>android:targetPackage="com.example.helloandroid"</code>: specifies
- that the tests in HelloAndroidTest should be run against the application with the
- <em>Android</em> package name <code>com.example.helloandroid</code>. This is the
- package name of the <a
- href="{@docRoot}resources/tutorials/hello-world.html">Hello, World</a>
- tutorial application.
- </li>
- <li>
- <code>android:label="Tests for .HelloAndroid"</code>: specifies a
- user-readable label for the instrumentation class. By default,
- the <code>android</code> tool gives it the value "Tests for " plus
- the name of the main Activity of the application under test.
- </li>
- </ul>
- </li>
-</ul>
-<h3 id="UpdateTestProject">Updating a test project</h3>
-<p>
- You use the <code>android</code> tool when you need to change the path to the
- project of the application under test. If you are changing an existing test project created in
- Eclipse with ADT so that you can also build and run it from the command line, you must use the
- "create" operation. See the section <a href="#CreateTestProject">Creating a test project</a>.
-</p>
-<p class="note">
- <strong>Note:</strong> If you change the Android package name of the application under test,
- you must <em>manually</em> change the value of the <code><android:targetPackage></code>
- attribute within the <code>AndroidManifest.xml</code> file of the test package.
- Running <code>android update test-project</code> does not do this.
-</p>
-<p>
- To update a test project with the <code>android</code> tool, enter:
-</p>
-<pre>android update test-project -m <main_path> -p <test_path></pre>
-
-<table>
- <tr>
- <th>Flag</th>
- <th>Value</th>
- <th>Description</th>
- </tr>
- <tr>
- <td><code>-m, --main</code></td>
- <td>The path to the project of the application under test, relative to the test project</td>
- <td>
- For example, if the application under test is in <code>source/HelloAndroid</code>, and
- the test project is in <code>source/HelloAndroidTest</code>, then the value for
- <code>--main</code> is <code>../HelloAndroid</code>.
- </td>
- </tr>
- <tr>
- <td><code>-p, --path</code></td>
- <td>The of the test project.</td>
- <td>
- For example, if the test project is in <code>source/HelloAndroidTest</code>, then the
- value for <code>--path</code> is <code>HelloAndroidTest</code>.
- </td>
- </tr>
-</table>
-<p>
- If the operation is successful, <code>android</code> lists to STDOUT the names of the files
- and directories it has created.
-</p>
-<h2 id="CreateTestApp">Creating a Test Package</h2>
-<p>
- Once you have created a test project, you populate it with a test package.
- The application does not require an {@link android.app.Activity Activity},
- although you can define one if you wish. Although your test package can
- combine Activities, Android test class extensions, JUnit extensions, or
- ordinary classes, you should extend one of the Android test classes or JUnit classes,
- because these provide the best testing features.
-</p>
-<p>
- If you run your tests with {@link android.test.InstrumentationTestRunner}
- (or a related test runner), then it will run all the methods in each class. You can modify
- this behavior by using the {@link junit.framework.TestSuite TestSuite} class.
-</p>
-
-<p>
- To create a test package, start with one of Android's test classes in the Java package
- {@link android.test android.test}. These extend the JUnit
- {@link junit.framework.TestCase TestCase} class. With a few exceptions, the Android test
- classes also provide instrumentation for testing.
-</p>
-<p>
- For test classes that extend {@link junit.framework.TestCase TestCase}, you probably want to
- override the <code>setUp()</code> and <code>tearDown()</code> methods:
-</p>
-<ul>
- <li>
- <code>setUp()</code>: This method is invoked before any of the test methods in the class.
- Use it to set up the environment for the test. You can use <code>setUp()</code>
- to instantiate a new <code>Intent</code> object with the action <code>ACTION_MAIN</code>.
- You can then use this intent to start the Activity under test.
- <p class="note">
- <strong>Note:</strong> If you override this method, call
- <code>super.setUp()</code> as the first statement in your code.
- </p>
- </li>
- <li>
- <code>tearDown()</code>: This method is invoked after all the test methods in the class. Use
- it to do garbage collection and re-setting before moving on to the next set of tests.
- <p class="note"><strong>Note:</strong> If you override this method, you must call
- <code>super.tearDown()</code> as the <em>last</em> statement in your code.</p>
- </li>
-</ul>
-<p>
- Another useful convention is to add the method <code>testPreConditions()</code> to your test
- class. Use this method to test that the application under test is initialized correctly. If this
- test fails, you know that that the initial conditions were in error. When this happens, further
- test results are suspect, regardless of whether or not the tests succeeded.
-</p>
-<p>
- To learn more about creating test packages, see the topic <a
- href="{@docRoot}guide/topics/testing/testing_android.html">Testing Fundamentals</a>,
- which provides an overview of Android testing. If you prefer to follow a tutorial,
- try the <a href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity Testing</a>
- tutorial, which leads you through the creation of tests for an actual Android application.
-</p>
-<h2 id="RunTestsCommand">Running Tests</h2>
-<p>
- You run tests from the command line, either with Ant or with an
- <a href="{@docRoot}guide/developing/tools/adb.html">
- Android Debug Bridge (adb)</a> shell.
-</p>
-<h3 id="RunTestsAnt">Quick build and run with Ant</h3>
-<p>
- You can use Ant to run all the tests in your test project, using the target
- <code>run-tests</code>, which is created automatically when you create a test project with
- the <code>android</code> tool.
-</p>
-<p>
- This target re-builds your main project and test project if necessary, installs the test
- application to the current AVD or device, and then runs all the test classes in the test
- application. The results are directed to <code>STDOUT</code>.
-</p>
-<p>
- You can update an existing test project to use this feature. To do this, use the
- <code>android</code> tool with the <code>update test-project</code> option. This is described
- in the section <a href="#UpdateTestProject">Updating a test project</a>.
-</p>
-<h3 id="RunTestsDevice">Running tests on a device or emulator</h3>
-<p>
- When you run tests from the command line with
- <a href="{@docRoot}guide/developing/tools/adb.html">
- Android Debug Bridge (adb)</a>, you get more options for choosing the tests
- to run than with any other method. You can select individual test methods, filter tests
- according to their annotation, or specify testing options. Since the test run is controlled
- entirely from a command line, you can customize your testing with shell scripts in various ways.
-</p>
-<p>
- To run a test from the command line, you run <code>adb shell</code> to start a command-line
- shell on your device or emulator, and then in the shell run the <code>am instrument</code>
- command. You control <code>am</code> and your tests with command-line flags.
-</p>
-<p>
- As a shortcut, you can start an <code>adb</code> shell, call <code>am instrument</code>, and
- specify command-line flags all on one input line. The shell opens on the device or emulator,
- runs your tests, produces output, and then returns to the command line on your computer.
-</p>
-<p>
- To run a test with <code>am instrument</code>:
-</p>
-<ol>
- <li>
- If necessary, rebuild your main application and test package.
- </li>
- <li>
- Install your test package and main application Android package files
- (<code>.apk</code> files) to your current Android device or emulator</li>
- <li>
- At the command line, enter:
-<pre>
-$ adb shell am instrument -w <test_package_name>/<runner_class>
-</pre>
- <p>
- where <code><test_package_name></code> is the Android package name of your test
- application, and <code><runner_class></code> is the name of the Android test
- runner class you are using. The Android package name is the value of the
- <code>package</code> attribute of the <code>manifest</code> element in the manifest file
- (<code>AndroidManifest.xml</code>) of your test package. The Android test runner
- class is usually {@link android.test.InstrumentationTestRunner}.
- </p>
- <p>
- Your test results appear in <code>STDOUT</code>.
- </p>
- </li>
-</ol>
-<p>
- This operation starts an <code>adb</code> shell, then runs <code>am instrument</code>
- with the specified parameters. This particular form of the command will run all of the tests
- in your test package. You can control this behavior with flags that you pass to
- <code>am instrument</code>. These flags are described in the next section.
-</p>
-<h2 id="AMSyntax">Using the am instrument Command</h2>
-<p>
- The general syntax of the <code>am instrument</code> command is:
-</p>
-<pre>
- am instrument [flags] <test_package>/<runner_class>
-</pre>
-<p>
- The main input parameters to <code>am instrument</code> are described in the following table:
-</p>
-<table>
- <tr>
- <th>
- Parameter
- </th>
- <th>
- Value
- </th>
- <th>
- Description
- </th>
- </tr>
- <tr>
- <td>
- <code><test_package></code>
- </td>
- <td>
- The Android package name of the test package.
- </td>
- <td>
- The value of the <code>package</code> attribute of the <code>manifest</code>
- element in the test package's manifest file.
- </td>
- </tr>
- <tr>
- <td>
- <code><runner_class></code>
- </td>
- <td>
- The class name of the instrumented test runner you are using.
- </td>
- <td>
- This is usually {@link android.test.InstrumentationTestRunner}.
- </td>
- </tr>
-</table>
-<p>
- The flags for <code>am instrument</code> are described in the following table:
-</p>
-<table>
- <tr>
- <th>
- Flag
- </th>
- <th>
- Value
- </th>
- <th>
- Description
- </th>
- </tr>
- <tr>
- <td>
- <code>-w</code>
- </td>
- <td>
- (none)
- </td>
- <td>
- Forces <code>am instrument</code> to wait until the instrumentation terminates
- before terminating itself. The net effect is to keep the shell open until the tests
- have finished. This flag is not required, but if you do not use it, you will not
- see the results of your tests.
- </td>
- </tr>
- <tr>
- <td>
- <code>-r</code>
- </td>
- <td>
- (none)
- </td>
- <td>
- Outputs results in raw format. Use this flag when you want to collect
- performance measurements, so that they are not formatted as test results. This flag is
- designed for use with the flag <code>-e perf true</code> (documented in the section
- <a href="#AMOptionsSyntax">Instrument options</a>).
- </td>
- </tr>
- <tr>
- <td>
- <code>-e</code>
- </td>
- <td>
- <test_options>
- </td>
- <td>
- Provides testing options as key-value pairs. The
- <code>am instrument</code> tool passes these to the specified instrumentation class
- via its <code>onCreate()</code> method. You can specify multiple occurrences of
- <code>-e <test_options></code>. The keys and values are described in the
- section <a href="#AMOptionsSyntax">am instrument options</a>.
- <p>
- The only instrumentation class that uses these key-value pairs is
- {@link android.test.InstrumentationTestRunner} (or a subclass). Using them with
- any other class has no effect.
- </p>
- </td>
- </tr>
-</table>
-
-<h3 id="AMOptionsSyntax">am instrument options</h3>
-<p>
- The <code>am instrument</code> tool passes testing options to
- <code>InstrumentationTestRunner</code> or a subclass in the form of key-value pairs,
- using the <code>-e</code> flag, with this syntax:
-</p>
-<pre>
- -e <key> <value>
-</pre>
-<p>
- Some keys accept multiple values. You specify multiple values in a comma-separated list.
- For example, this invocation of <code>InstrumentationTestRunner</code> provides multiple
- values for the <code>package</code> key:
-</p>
-<pre>
-$ adb shell am instrument -w -e package com.android.test.package1,com.android.test.package2 \
-> com.android.test/android.test.InstrumentationTestRunner
-</pre>
-<p>
- The following table describes the key-value pairs and their result. Please review the
- <strong>Usage Notes</strong> following the table.
-</p>
-<table>
- <tr>
- <th>Key</th>
- <th>Value</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>
- <code>package</code>
- </td>
- <td>
- <Java_package_name>
- </td>
- <td>
- The fully-qualified <em>Java</em> package name for one of the packages in the test
- application. Any test case class that uses this package name is executed. Notice that
- this is not an <em>Android</em> package name; a test package has a single
- Android package name but may have several Java packages within it.
- </td>
- </tr>
- <tr>
- <td rowspan="2"><code>class</code></td>
- <td><class_name></td>
- <td>
- The fully-qualified Java class name for one of the test case classes. Only this test
- case class is executed.
- </td>
- </tr>
- <tr>
- <td><class_name><strong>#</strong>method name</td>
- <td>
- A fully-qualified test case class name, and one of its methods. Only this method is
- executed. Note the hash mark (#) between the class name and the method name.
- </td>
- </tr>
- <tr>
- <td><code>func</code></td>
- <td><code>true</code></td>
- <td>
- Runs all test classes that extend {@link android.test.InstrumentationTestCase}.
- </td>
- </tr>
- <tr>
- <td><code>unit</code></td>
- <td><code>true</code></td>
- <td>
- Runs all test classes that do <em>not</em> extend either
- {@link android.test.InstrumentationTestCase} or
- {@link android.test.PerformanceTestCase}.
- </td>
- </tr>
- <tr>
- <td><code>size</code></td>
- <td>
- [<code>small</code> | <code>medium</code> | <code>large</code>]
- </td>
- <td>
- Runs a test method annotated by size. The annotations are <code>@SmallTest</code>,
- <code>@MediumTest</code>, and <code>@LargeTest</code>.
- </td>
- </tr>
- <tr>
- <td><code>perf</code></td>
- <td><code>true</code></td>
- <td>
- Runs all test classes that implement {@link android.test.PerformanceTestCase}.
- When you use this option, also specify the <code>-r</code> flag for
- <code>am instrument</code>, so that the output is kept in raw format and not
- re-formatted as test results.
- </td>
- </tr>
- <tr>
- <td><code>debug</code></td>
- <td><code>true</code></td>
- <td>
- Runs tests in debug mode.
- </td>
- </tr>
- <tr>
- <td><code>log</code></td>
- <td><code>true</code></td>
- <td>
- Loads and logs all specified tests, but does not run them. The test
- information appears in <code>STDOUT</code>. Use this to verify combinations of other
- filters and test specifications.
- </td>
- </tr>
- <tr>
- <td><code>emma</code></td>
- <td><code>true</code></td>
- <td>
- Runs an EMMA code coverage analysis and writes the output to
- <code>/data//coverage.ec</code> on the device. To override the file location, use the
- <code>coverageFile</code> key that is described in the following entry.
- <p class="note">
- <strong>Note:</strong> This option requires an EMMA-instrumented build of the test
- application, which you can generate with the <code>coverage</code> target.
- </p>
- </td>
- </tr>
- <tr>
- <td><code>coverageFile</code></td>
- <td><code><filename></code></td>
- <td>
- Overrides the default location of the EMMA coverage file on the device. Specify this
- value as a path and filename in UNIX format. The default filename is described in the
- entry for the <code>emma</code> key.
- </td>
- </tr>
-</table>
-<strong><code>-e</code> Flag Usage Notes</strong>
-<ul>
- <li>
- <code>am instrument</code> invokes
- {@link android.test.InstrumentationTestRunner#onCreate(Bundle)}
- with a {@link android.os.Bundle} containing the key-value pairs.
- </li>
- <li>
- The <code>package</code> key takes precedence over the <code>class</code> key. If you
- specifiy a package, and then separately specify a class within that package, Android
- will run all the tests in the package and ignore the <code>class</code> key.
- </li>
- <li>
- The <code>func</code> key and <code>unit</code> key are mutually exclusive.
- </li>
-</ul>
-<h3 id="RunTestExamples">Usage examples</h3>
-<p>
-The following sections provide examples of using <code>am instrument</code> to run tests.
-They are based on the following structure:</p>
-<ul>
- <li>
- The test package has the Android package name <code>com.android.demo.app.tests</code>
- </li>
- <li>
- There are three test classes:
- <ul>
- <li>
- <code>UnitTests</code>, which contains the methods
- <code>testPermissions</code> and <code>testSaveState</code>.
- </li>
- <li>
- <code>FunctionTests</code>, which contains the methods
- <code>testCamera</code>, <code>testXVGA</code>, and <code>testHardKeyboard</code>.
- </li>
- <li>
- <code>IntegrationTests</code>,
- which contains the method <code>testActivityProvider</code>.
- </li>
- </ul>
- </li>
- <li>
- The test runner is {@link android.test.InstrumentationTestRunner}.
- </li>
-</ul>
-<h4>Running the entire test package</h4>
-<p>
- To run all of the test classes in the test package, enter:
-</p>
-<pre>
-$ adb shell am instrument -w com.android.demo.app.tests/android.test.InstrumentationTestRunner
-</pre>
-<h4>Running all tests in a test case class</h4>
-<p>
- To run all of the tests in the class <code>UnitTests</code>, enter:
-</p>
-<pre>
-$ adb shell am instrument -w \
-> -e class com.android.demo.app.tests.UnitTests \
-> com.android.demo.app.tests/android.test.InstrumentationTestRunner
-</pre>
-<p>
- <code>am instrument</code> gets the value of the <code>-e</code> flag, detects the
- <code>class</code> keyword, and runs all the methods in the <code>UnitTests</code> class.
-</p>
-<h4>Selecting a subset of tests</h4>
-<p>
- To run all of the tests in <code>UnitTests</code>, and the <code>testCamera</code> method in
- <code>FunctionTests</code>, enter:
-</p>
-<pre>
-$ adb shell am instrument -w \
-> -e class com.android.demo.app.tests.UnitTests,com.android.demo.app.tests.FunctionTests#testCamera \
-> com.android.demo.app.tests/android.test.InstrumentationTestRunner
-</pre>
-<p>
- You can find more examples of the command in the documentation for
- {@link android.test.InstrumentationTestRunner}.
-</p>
diff --git a/docs/html/guide/developing/tools/MonkeyDevice.jd b/docs/html/guide/developing/tools/MonkeyDevice.jd
deleted file mode 100644
index abcf8fd..0000000
--- a/docs/html/guide/developing/tools/MonkeyDevice.jd
+++ /dev/null
@@ -1,1355 +0,0 @@
-page.title=MonkeyDevice
-parent.title=monkeyrunner
-parent.link=index.html
-@jd:body
-<style>
- h4.jd-details-title {background-color: #DEE8F1;}
-</style>
-<p>
- A monkeyrunner class that represents a device or emulator accessible by the workstation running
-<code><a href="{@docRoot}guide/developing/tools/monkeyrunner_concepts.html">monkeyrunner</a></code>.
-</p>
-<p>
- This class is used to control an Android device or emulator. The methods send UI events,
- retrieve information, install and remove applications, and run applications.
-</p>
-<p>
- You normally do not have to create an instance of <code>MonkeyDevice</code>. Instead, you
- use
-<code><a href="{@docRoot}guide/developing/tools/MonkeyRunner.html#waitForConnection">
-MonkeyRunner.waitForConnection()</a></code> to create a new object from a connection to a device or
-emulator. For example, instead of
-using:</p>
-<pre>
-newdevice = MonkeyDevice()
-</pre>
-<p>
- you would use:
-</p>
-<pre>
-newdevice = MonkeyRunner.waitForConnection()
-</pre>
-<h2>Summary</h2>
- <table id="constants" class="jd-sumtable" style="background-color: white;">
- <tr>
- <th colspan="12" style="background-color: #E2E2E2">Constants</th>
- </tr>
- <tr class="api" style="background-color: white;">
- <td class="jd-typecol"><em>string</em></td>
- <td class="jd-linkcol"><a href="#ACTION_DOWN">DOWN</a></td>
- <td class="jd-descrcol" width="100%">
- Use this with the <code>type</code> argument of
- <code><a href="#press">press()</a></code> or <code><a href="#touch">touch()</a>
- </code>
- to send a DOWN event.
- </td>
- </tr>
- <tr class="api" style="background-color: white;">
- <td class="jd-typecol"><em>string</em></td>
- <td class="jd-linkcol"><a href="#ACTION_UP">UP</a></td>
- <td class="jd-descrcol" width="100%">
- Use this with the <code>type</code> argument of
- <code><a href="#press">press()</a></code> or <code><a href="#touch">touch()</a>
- </code>
- to send an UP event.
- </td>
- </tr>
- <tr class="api" style="background-color: white;">
- <td class="jd-typecol"><em>string</em></td>
- <td class="jd-linkcol"><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></td>
- <td class="jd-descrcol" width="100%">
- Use this with the <code>type</code> argument of
- <code><a href="#press">press()</a></code> or <code><a href="#touch">touch()</a>
- </code>
- to send a DOWN event immediately followed by an UP event.
- </td>
- </tr>
- </table>
-<table id="pubmethods" class="jd-sumtable">
- <tr>
- <th colspan="12" style="background-color: #E2E2E2">Methods</th>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#broadcastIntent">broadcastIntent</a>
- </span>
- (<em>string</em> uri,
- <em>string</em> action,
- <em>string</em> data,
- <em>string</em> mimetype,
- <em>iterable</em> categories
- <em>dictionary</em> extras,
- <em>component</em> component,
- <em>iterable</em> flags)
- </nobr>
- <div class="jd-descrdiv">
- Broadcasts an Intent to this device, as if the Intent were coming from an
- application.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#drag">drag</a>
- </span>
- (<em>tuple</em> start,
- <em>tuple</em> end,
- <em>float</em> duration,
- <em>integer</em> steps)
- </nobr>
- <div class="jd-descrdiv">
- Simulates a drag gesture (touch, hold, and move) on this device's screen.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <em>object</em>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#getProperty">getProperty</a>
- </span>
- (<em>string</em> key)
- </nobr>
- <div class="jd-descrdiv">
- Given the name of a system environment variable, returns its value for this device.
- The available variable names are listed in the <a href="#getProperty">
- detailed description</a> of this method.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <em>object</em>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#getSystemProperty">getSystemProperty</a>
- </span>
- (<em>string</em> key)
- </nobr>
- <div class="jd-descrdiv">
-. The API equivalent of <code>adb shell getprop <key>. This is provided for use
- by platform developers.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#installPackage">installPackage</a>
- </span>
- (<em>string</em> path)
- </nobr>
- <div class="jd-descrdiv">
- Installs the Android application or test package contained in packageFile onto this
- device. If the application or test package is already installed, it is replaced.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <em>dictionary</em>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#instrument">instrument</a>
- </span>
- (<em>string</em> className,
- <em>dictionary</em> args)
- </nobr>
- <div class="jd-descrdiv">
- Runs the specified component under Android instrumentation, and returns the results
- in a dictionary whose exact format is dictated by the component being run. The
- component must already be present on this device.
- </div>
- </td>
- </tr>
- <tr class="api">
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#press">press</a>
- </span>
- (<em>string</em> name,
- <em>dictionary</em> type)
- </nobr>
- <div class="jd-descrdiv">
- Sends the key event specified by type to the key specified by
- keycode.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#reboot">reboot</a>
- </span>
- (<em>string</em> into)
- </nobr>
- <div class="jd-descrdiv">
- Reboots this device into the bootloader specified by bootloadType.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#removePackage">removePackage</a>
- </span>
- (<em>string</em> package)
- </nobr>
- <div class="jd-descrdiv">
- Deletes the specified package from this device, including its data and cache.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <em>object</em>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#shell">shell</a>
- </span>
- (<em>string</em> cmd)
- </nobr>
- <div class="jd-descrdiv">
- Executes an <code>adb</code> shell command and returns the result, if any.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#startActivity">startActivity</a>
- </span>
- (<em>string</em> uri,
- <em>string</em> action,
- <em>string</em> data,
- <em>string</em> mimetype,
- <em>iterable</em> categories
- <em>dictionary</em> extras,
- <em>component</em> component,
- <em>flags</em>)
- </nobr>
- <div class="jd-descrdiv">
- Starts an Activity on this device by sending an Intent constructed from the
- supplied arguments.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <code>
- <a href="{@docRoot}guide/developing/tools/MonkeyImage.html">
- MonkeyImage
- </a>
- </code>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#takeSnapshot">takeSnapshot</a>()
- </span>
- </nobr>
- <div class="jd-descrdiv">
- Captures the entire screen buffer of this device, yielding a
- <code>
- <a href="{@docRoot}guide/developing/tools/MonkeyImage.html">
- MonkeyImage
- </a>
- </code> object containing a screen capture of the current display.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#touch">touch</a>
- </span>
- (<em>integer</em> x,
- <em>integer</em> y,
- <em>integer</em> type)
- </nobr>
- <div class="jd-descrdiv">
- Sends a touch event specified by type to the screen location specified
- by x and y.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#touch">type</a>
- </span>
- (<em>string</em> message)
- </nobr>
- <div class="jd-descrdiv">
- Sends the characters contained in message to this device, as if they
- had been typed on the device's keyboard. This is equivalent to calling
- <code><a href="#press">press()</a></code> for each keycode in <code>message</code>
- using the key event type <code><a href="#ACTION_DOWN_AND_UP"></a>DOWN_AND_UP</code>.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#touch">wake</a>
- </span>
- ()
- </nobr>
- <div class="jd-descrdiv">
- Wakes the screen of this device.
- </div>
- </td>
- </tr>
-</table>
-<!-- ========= ENUM CONSTANTS DETAIL ======== -->
-<h2>Constants</h2>
-<A NAME="ACTION_DOWN"></a>
-<div class="jd-details api">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>string</em>
- </span>
- DOWN
- </h4>
- <div class="jd-details-descr">
- <div class="jd-tagdata jd-tagdescr">
- <p>
- <code><a href="#press">press()</a></code> or
- <code><a href="#press">touch()</a></code> value.
- Specifies that a DOWN event type should be sent to the device, corresponding to
- pressing down on a key or touching the screen.
- </p>
- </div>
- </div>
-</div>
-<A NAME="ACTION_UP"></A>
-<div class="jd-details api">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>string</em>
- </span>
- UP
- </h4>
- <div class="jd-details-descr">
- <div class="jd-tagdata jd-tagdescr">
- <p>
- <code><a href="#press">press()</a></code> or
- <code><a href="#press">touch()</a></code> value.
- Specifies that an UP event type should be sent to the device, corresponding to
- releasing a key or lifting up from the screen.
- </p>
- </div>
- </div>
-</div>
-<A NAME="ACTION_DOWN_AND_UP"></A>
-
-<div class="jd-details api">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>string</em>
- </span>
- DOWN_AND_UP
- </h4>
- <div class="jd-details-descr">
- <div class="jd-tagdata jd-tagdescr">
- <p>
- <code><a href="#press">press()</a></code>,
- <code><a href="#press">touch()</a></code> or
- <code><a href="#type">type()</a></code> value.
- Specifies that a DOWN event type followed by an UP event type should be sent to the
- device, corresponding to typing a key or clicking the screen.
- </p>
- </div>
- </div>
-</div>
-<!-- ========= METHOD DETAIL ======== -->
-<!-- Public methods -->
-<h2>Public Methods</h2>
-<A NAME="broadcastIntent"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">broadcastIntent</span>
- <span class="normal">
- (
- <em>string</em> uri,
- <em>string</em> action,
- <em>string</em> data,
- <em>string</em> mimetype,
- <em>iterable</em> categories
- <em>dictionary</em> extras,
- <em>component</em> component,
- <em>iterable</em> flags)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Broadcasts an Intent to this device, as if the Intent were coming from an
- application. See {@link android.content.Intent Intent} for more information about the
- arguments.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>uri</th>
- <td>
- The URI for the Intent.
- (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}).
- </td>
- </tr>
- <tr>
- <th>action</th>
- <td>
- The action for this Intent
- (see {@link android.content.Intent#setAction(java.lang.String) Intent.setAction()}).
- </td>
- </tr>
- <tr>
- <th>data</th>
- <td>
- The data URI for this Intent
- (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}).
- </td>
- </tr>
- <tr>
- <th>mimetype</th>
- <td>
- The MIME type for the Intent
- (see {@link android.content.Intent#setType(java.lang.String) Intent.setType()}).
- </td>
- </tr>
- <tr>
- <th>categories</th>
- <td>
- An iterable data structure containing strings that define categories for this
- Intent
- (see
- {@link android.content.Intent#addCategory(java.lang.String) Intent.addCategory()}).
- </td>
- </tr>
- <tr>
- <th>extras</th>
- <td>
- A dictionary of extra data for this Intent
- (see {@link android.content.Intent#putExtra(java.lang.String,java.lang.String)
- Intent.putExtra()}
- for an example).
- <p>
- The key for each dictionary item should be a <em>string</em>. The item's value
- can be any simple or structured data type.
- </p>
- </td>
- </tr>
- <tr>
- <th>component</th>
- <td>
- The component for this Intent (see {@link android.content.ComponentName}).
- Using this argument will direct the Intent to a specific class within a specific
- Android package.
- </td>
- </tr>
- <tr>
- <th>flags</th>
- <td>
- An iterable data structure containing flags that control how the Intent is handled
- (see {@link android.content.Intent#setFlags(int) Intent.setFlags()}).
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-<A NAME="drag"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">drag</span>
- <span class="normal">
- (
- <em>tuple</em> start,
- <em>tuple</em> end,
- <em>float</em> duration,
- <em>integer</em> steps)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Simulates a drag gesture (touch, hold, and move) on this device's screen.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>start</th>
- <td>
- The starting point of the drag gesture, in the form of a <em>tuple</em>
- (x,y) where x and y are <em>integers</em>.
- </td>
- </tr>
- <tr>
- <th>end</th>
- <td>
- The end point of the drag gesture, in the form of a <em>tuple</em> (x,y)
- where x and y are <em>integers</em>.
- </td>
- </tr>
- <tr>
- <th>duration</th>
- <td>The duration of the drag gesture in seconds. The default is 1.0 seconds.</td>
- </tr>
- <tr>
- <th>steps</th>
- <td>The number of steps to take when interpolating points. The default is 10.</td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-<A NAME="getProperty"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>object</em>
- </span>
- <span class="sympad">getProperty</span>
- <span class="normal">
- (<em>string</em> key)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Given the name of a system environment variable, returns its value for this device.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>key</th>
- <td>
- The name of the system environment variable. The available variable names are listed in
- <a href="#table1">Table 1. Property variable names</a> at the end of this topic.
- </td>
- </tr>
- </table>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- The value of the variable. The data format varies according to the variable requested.
- </li>
- </ul>
- </div>
- </div>
-</div>
-<A NAME="getSystemProperty"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>object</em>
- </span>
- <span class="sympad">getSystemProperty</span>
- <span class="normal">
- (<em>string</em> key)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Synonym for <code><a href="#getProperty">getProperty()</a></code>.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>key</th>
- <td>
- The name of the system environment variable. The available variable names are listed in
- <a href="#table1">Table 1. Property Variable Names</a>.
- </td>
- </tr>
- </table>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- The value of the variable. The data format varies according to the variable requested.
- </li>
- </ul>
- </div>
- </div>
-</div>
-<A NAME="installPackage"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">installPackage</span>
- <span class="normal">
- (<em>string</em> path)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Installs the Android application or test package contained in packageFile
- onto this device. If the application or test package is already installed, it is
- replaced.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>path</th>
- <td>
- The fully-qualified path and filename of the <code>.apk</code> file to install.
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-<A NAME="instrument"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>dictionary</em>
- </span>
- <span class="sympad">instrument</span>
- <span class="normal">
- (
- <em>string</em> className,
- <em>dictionary</em> args)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Runs the specified component with Android instrumentation, and returns the results
- in a dictionary whose exact format is dictated by the component being run. The
- component must already be present on this device.
- </p>
- <p>
- Use this method to start a test case that uses one of Android's test case classes.
- See <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing
- Fundamentals</a> to learn more about unit testing with the Android testing
- framework.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>className</th>
- <td>
- The name of an Android component that is already installed on this device, in the
- standard form packagename/classname, where packagename is the
- Android package name of a <code>.apk</code> file on this device, and
- classname is the class name of an Android component (Activity,
- ContentProvider, Service, or BroadcastReceiver) in that file. Both
- packagename and classname must be fully qualified. See
- {@link android.content.ComponentName} for more details.
- </td>
- </tr>
- <tr>
- <th>args</th>
- <td>
- A dictionary containing flags and their values. These are passed to the component as it
- is started. If the flag does not take a value, set its dictionary value to an empty
- string.
- </td>
- </tr>
- </table>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- <p>
- A dictionary containing the component's output. The contents of the dictionary
- are defined by the component itself.
- </p>
- <p>
- If you use {@link android.test.InstrumentationTestRunner} as the class name in
- the componentName argument, then the result dictionary contains
- the single key "stream". The value of "stream" is a <em>string</em> containing
- the test output, as if <code>InstrumentationTestRunner</code> was run from the
- command line. The format of this output is described in
- <a href="{@docRoot}guide/developing/testing/testing_otheride.html">
- Testing in Other IDEs</a>.
- </p>
- </li>
- </ul>
- </div>
- </div>
- </div>
-</div>
-<A NAME="press"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">press</span>
- <span class="normal">
- (<em>string</em> name,
- <em>integer</em> type)
- </span>
- </h4>
- <div class="jd-details-descr">
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Sends the key event specified by <code>type</code> to the key specified by
- <code>keycode</code>.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>name</th>
- <td>
- The name of the keycode to send. See {@link android.view.KeyEvent} for a list of
- keycode names. Use the keycode name, not its integer value.
- </td>
- </tr>
- <tr>
- <th>type</th>
- <td>
- The type of key event to send. The allowed values are <code><a href="#ACTION_DOWN">
- DOWN</a></code>, <code><a href="#ACTION_UP">UP</a></code>, and
- <code><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></code>.
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-<A NAME="reboot"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">reboot</span>
- <span class="normal">
- (<em>string</em> bootloadType)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Reboots this device into the bootloader specified by <code>bootloadType</code>.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>into</th>
- <td>
- The type of bootloader to reboot into. The allowed values are
- "bootloader", "recovery", or "None".
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-<A NAME="removePackage"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">removePackage</span>
- <span class="normal">
- (<em>string</em> package)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Deletes the specified package from this device, including its data and cache.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>package</th>
- <td>
- The Android package name of an <code>.apk</code> file on this device.
- </td>
- </table>
- </div>
- </div>
-</div>
-<A NAME="shell"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>object</em>
- </span>
- <span class="sympad">shell</span>
- <span class="normal">
- (<em>string</em> cmd)
- </span>
- </h4>
- <div class="jd-details-descr">
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Executes an <code>adb</code> shell command and returns the result, if any.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>cmd</th>
- <td>
- The command to execute in the <code>adb</code> shell. The form of these commands is
- described in the topic <a href="{@docRoot}guide/developing/tools/adb.html">Android
- Debug Bridge</a>.
- </td>
- </tr>
- </table>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- The results of the command, if any. The format of the results is determined by the
- command.
- </li>
- </ul>
- </div>
- </div>
-</div>
-<A NAME="startActivity"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">startActivity</span>
- <span class="normal">
- (
- <em>string</em> uri,
- <em>string</em> action,
- <em>string</em> data,
- <em>string</em> mimetype,
- <em>iterable</em> categories
- <em>dictionary</em> extras,
- <em>component</em> component,
- <em>iterable</em> flags)
- </span>
- </h4>
- <div class="jd-details-descr">
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Starts an Activity on this device by sending an Intent constructed from the
- supplied arguments.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>uri</th>
- <td>
- The URI for the Intent.
- (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}).
- </td>
- </tr>
- <tr>
- <th>action</th>
- <td>
- The action for the Intent
- (see {@link android.content.Intent#setAction(java.lang.String) Intent.setAction()}).
- </td>
- </tr>
- <tr>
- <th>data</th>
- <td>
- The data URI for the Intent
- (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}).
- </td>
- </tr>
- <tr>
- <th>mimetype</th>
- <td>
- The MIME type for the Intent
- (see {@link android.content.Intent#setType(java.lang.String) Intent.setType()}).
- </td>
- </tr>
- <tr>
- <th>categories</th>
- <td>
- An iterable data structure containing strings that define categories for the
- Intent
- (see
- {@link android.content.Intent#addCategory(java.lang.String) Intent.addCategory()}).
- </td>
- </tr>
- <tr>
- <th>extras</th>
- <td>
- A dictionary of extra data for the Intent
- (see
- {@link android.content.Intent#putExtra(java.lang.String,java.lang.String)
- Intent.putExtra()}
- for an example).
- <p>
- The key for each dictionary item should be a <em>string</em>. The item's value
- can be any simple or structured data type.
- </p>
- </td>
- </tr>
- <tr>
- <th>component</th>
- <td>
- The component for the Intent
- (see {@link android.content.ComponentName}). Using this argument will direct the
- Intent to a specific class within a specific Android package.
- </td>
- </tr>
- <tr>
- <th>flags</th>
- <td>
- An iterable data structure containing flags that control how the Intent is handled
- (see {@link android.content.Intent#setFlags(int) Intent.setFlags()}).
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-<A NAME="takeSnapshot"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <code>
- <a href="{@docRoot}guide/developing/tools/MonkeyImage.html">
- MonkeyImage
- </a>
- </code>
- </span>
- <span class="sympad">takeSnapshot</span>
- <span class="normal">
- ()
- </span>
- </h4>
- <div class="jd-details-descr">
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Captures the entire screen buffer of this device, yielding a
- screen capture of the current display.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- A <a href="{@docRoot}guide/developing/tools/MonkeyImage.html">
- MonkeyImage</a> object containing the image of the current display.
- </li>
- </ul>
- </div>
- </div>
-</div>
-<A NAME="touch"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">touch</span>
- <span class="normal">
- (
- <em>integer</em> x,
- <em>integer</em> y,
- <em>string</em> type)
- </span>
- </h4>
- <div class="jd-details-descr">
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Sends a touch event specified by type to the screen location specified
- by x and y.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>x</th>
- <td>
- The horizontal position of the touch in actual device pixels, starting from the left of
- the screen in its current orientation.
- </td>
- </tr>
- <tr>
- <th>y</th>
- <td>
- The vertical position of the touch in actual device pixels, starting from the top of
- the screen in its current orientation.
- </td>
- </tr>
- <tr>
- <th>type</th>
- <td>
- The type of key event to send. The allowed values are <code><a href="#ACTION_DOWN">
- DOWN</a></code>, <code><a href="#ACTION_UP">UP</a></code>, and
- <code><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></code>.
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-<A NAME="type"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">type</span>
- <span class="normal">
- (<em>string</em> message)
- </span>
- </h4>
- <div class="jd-details-descr">
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Sends the characters contained in message to this device, as if they
- had been typed on the device's keyboard. This is equivalent to calling
- <code><a href="#press">press()</a></code> for each keycode in <code>message</code>
- using the key event type <code><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></code>.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>message</th>
- <td>
- A string containing the characters to send.
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-<A NAME="wake"></A>
-<div class="jd-details api">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">wake</span>
- <span class="normal">
- ()
- </span>
- </h4>
- <div class="jd-details-descr">
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Wakes the screen of this device.
- </p>
- </div>
- </div>
-</div>
-<hr></hr>
-<h2>Appendix</h2>
- <p class="table-caption" id="table1">
- <strong>Table 1.</strong>Property variable names used with
- <span class="sympad"><a href="#getProperty">getProperty()</a></span> and
- <span class="sympad"><a href="#getSystemProperty">getSystemProperty()</a></span>.
- </p>
- <table>
- <tr>
- <th>
- Property Group
- </th>
- <th>
- Property
- </th>
- <th>
- Description
- </th>
- <th>
- Notes
- </th>
- </tr>
- <tr>
- <td rowspan="17"><code>build</code></td>
- <td><code>board</code></td>
- <td>Code name for the device's system board</td>
- <td rowspan="17">
- See {@link android.os.Build}
- </td>
- </tr>
- <tr>
- <td><code>brand</code></td>
- <td>The carrier or provider for which the OS is customized.</td>
- </tr>
- <tr>
- <td><code>device</code></td>
- <td>The device design name.</td>
- </tr>
- <tr>
- <td><code>fingerprint</code></td>
- <td>A unique identifier for the currently-running build.</td>
- </tr>
- <tr>
- <td><code>host</code></td>
- <td></td>
- </tr>
- <tr>
- <td><code>ID</code></td>
- <td>A changelist number or label.</td>
- </tr>
- <tr>
- <td><code>model</code></td>
- <td>The end-user-visible name for the device.</td>
- </tr>
- <tr>
- <td><code>product</code></td>
- <td>The overall product name.</td>
- </tr>
- <tr>
- <td><code>tags</code></td>
- <td>Comma-separated tags that describe the build, such as "unsigned" and "debug".</td>
- </tr>
- <tr>
- <td><code>type</code></td>
- <td>The build type, such as "user" or "eng".</td>
- </tr>
- <tr>
- <td><code>user</code></td>
- <td></td>
- </tr>
- <tr>
- <td><code>CPU_ABI</code></td>
- <td>
- The name of the native code instruction set, in the form CPU type plus
- ABI convention.
- </td>
- </tr>
- <tr>
- <td><code>manufacturer</code></td>
- <td>The product/hardware manufacturer.</td>
- </tr>
- <tr>
- <td><code>version.incremental</code></td>
- <td>
- The internal code used by the source control system to represent this version
- of the software.
- </td>
- </tr>
- <tr>
- <td><code>version.release</code></td>
- <td>The user-visible name of this version of the software.</td>
- </tr>
- <tr>
- <td><code>version.sdk</code></td>
- <td>The user-visible SDK version associated with this version of the OS.</td>
- </tr>
- <tr>
- <td><code>version.codename</code></td>
- <td>
- The current development codename, or "REL" if this version of the software has been
- released.
- </td>
- </tr>
- <tr>
- <td rowspan="3"><code>display</code></td>
- <td><code>width</code></td>
- <td>The device's display width in pixels.</td>
- <td rowspan="3">
- See
- {@link android.util.DisplayMetrics} for details.
- </td>
- </tr>
- <tr>
- <td><code>height</code></td>
- <td>The device's display height in pixels.</td>
- </tr>
- <tr>
- <td><code>density</code></td>
- <td>
- The logical density of the display. This is a factor that scales
- DIP (Density-Independent Pixel) units to the device's resolution. DIP is adjusted so
- that 1 DIP is equivalent to one pixel on a 160 pixel-per-inch display. For example,
- on a 160-dpi screen, density = 1.0, while on a 120-dpi screen, density = .75.
- <p>
- The value does not exactly follow the real screen size, but is adjusted to
- conform to large changes in the display DPI. See
- {@link android.util.DisplayMetrics#density} for more details.
- </p>
- </td>
- </tr>
- <tr>
- <td rowspan="6"><code>am.current</code></td>
- <td><code>package</code></td>
- <td>The Android package name of the currently running package.</td>
- <td rowspan="6">
- The <code>am.current</code> keys return information about the currently-running
- Activity.
- </td>
- </tr>
- <tr>
- <td><code>action</code></td>
- <td>
- The current activity's action. This has the same format as the <code>name</code>
- attribute of the <code>action</code> element in a package manifest.
- </td>
- </tr>
- <tr>
- <td><code>comp.class</code></td>
- <td>
- The class name of the component that started the current Activity. See
- <code><a href="#comppackage">comp.package</a></code> for more details.</td>
- </tr>
- <tr>
- <td><a name="comppackage"><code>comp.package</code></a></td>
- <td>
- The package name of the component that started the current Activity. A component
- is specified by a package name and the name of class that the package contains.
- </td>
- </tr>
- <tr>
- <td><code>data</code></td>
- <td>The data (if any) contained in the Intent that started the current Activity.</td>
- </tr>
- <tr>
- <td><code>categories</code></td>
- <td>The categories specified by the Intent that started the current Activity.</td>
- </tr>
- <tr>
- <td rowspan="3"><code>clock</code></td>
- <td><code>realtime</code></td>
- <td>
- The number of milliseconds since the device rebooted, including deep-sleep
- time.
- </td>
- <td rowspan="3">
- See {@link android.os.SystemClock} for more information.
- </td>
- </tr>
- <tr>
- <td><code>uptime</code></td>
- <td>
- The number of milliseconds since the device rebooted, <em>not</em> including
- deep-sleep time
- </td>
- </tr>
- <tr>
- <td><code>millis</code></td>
- <td>current time since the UNIX epoch, in milliseconds.</td>
- </tr>
- </table>
diff --git a/docs/html/guide/developing/tools/MonkeyImage.jd b/docs/html/guide/developing/tools/MonkeyImage.jd
deleted file mode 100644
index 2efc373..0000000
--- a/docs/html/guide/developing/tools/MonkeyImage.jd
+++ /dev/null
@@ -1,437 +0,0 @@
-page.title=MonkeyImage
-parent.title=monkeyrunner
-parent.link=index.html
-@jd:body
-<style>
- h4.jd-details-title {background-color: #DEE8F1;}
-</style>
-
-<p>
- A monkeyrunner class to hold an image of the device or emulator's screen. The image is
- copied from the screen buffer during a screenshot. This object's methods allow you to
- convert the image into various storage formats, write the image to a file, copy parts of
- the image, and compare this object to other <code>MonkeyImage</code> objects.
-</p>
-<p>
- You do not need to create new instances of <code>MonkeyImage</code>. Instead, use
-<code><a href="{@docRoot}guide/developing/tools/MonkeyDevice.html#takeSnapshot">
-MonkeyDevice.takeSnapshot()</a></code> to create a new instance from a screenshot. For example, use:
-</p>
-<pre>
-newimage = MonkeyDevice.takeSnapshot()
-</pre>
-<h2>Summary</h2>
-<table id="pubmethods" class="jd-sumtable">
- <tr>
- <th colspan="12" style="background-color: #E2E2E2">Methods</th>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <em>string</em>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#convertToBytes">convertToBytes</a>
- </span>
- (<em>string</em> format)
- </nobr>
- <div class="jd-descrdiv">
- Converts the current image to a particular format and returns it as a
- <em>string</em> that you can then access as an <em>iterable</em> of binary bytes.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <em>tuple</em>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#getRawPixel">getRawPixel</a>
- </span>
- (<em>integer</em> x,
- <em>integer</em> y)
- </nobr>
- <div class="jd-descrdiv">
- Returns the single pixel at the image location (x,y), as an
- a <em>tuple</em> of <em>integer</em>, in the form (a,r,g,b).
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <em>integer</em>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#getRawPixelInt">getRawPixelInt</a>
- </span>
- (<em>integer</em> x,
- <em>integer</em> y)
- </nobr>
- <div class="jd-descrdiv">
- Returns the single pixel at the image location (x,y), as
- a 32-bit <em>integer</em>.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <code>
- <a href="{@docRoot}guide/developing/tools/MonkeyImage.html">MonkeyImage</a>
- </code>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#getSubImage">getSubImage</a>
- </span>
- (<em>tuple</em> rect)
- </nobr>
- <div class="jd-descrdiv">
- Creates a new <code>MonkeyImage</code> object from a rectangular selection of the
- current image.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <em>boolean</em>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#sameAs">sameAs</a>
- </span>
- (<code><a href="{@docRoot}guide/developing/tools/MonkeyImage.html">MonkeyImage</a></code>
- other,
- <em>float</em> percent)
- </nobr>
- <div class="jd-descrdiv">
- Compares this <code>MonkeyImage</code> object to another and returns the result of
- the comparison. The <code>percent</code> argument specifies the percentage
- difference that is allowed for the two images to be "equal".
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <em>void</em>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#writeToFile">writeToFile</a>
- </span>
- (<em>string</em> path,
- <em>string</em> format)
- </nobr>
- <div class="jd-descrdiv">
- Writes the current image to the file specified by <code>filename</code>, in the
- format specified by <code>format</code>.
- </div>
- </td>
- </tr>
-</table>
-<!-- ========= METHOD DETAIL ======== -->
-<!-- Public methods -->
-<h2>Public Methods</h2>
-<A NAME="convertToBytes"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>string</em>
- </span>
- <span class="sympad">convertToBytes</span>
- <span class="normal">
- (
- <em>string</em> format)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Converts the current image to a particular format and returns it as a <em>string</em>
- that you can then access as an <em>iterable</em> of binary bytes.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>format</th>
- <td>
- The desired output format. All of the common raster output formats are supported.
- The default value is "png" (Portable Network Graphics).
- </td>
- </tr>
- </table>
- </div>
-</div>
-</div>
-<A NAME="getRawPixel"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>tuple</em>
- </span>
- <span class="sympad">getRawPixel</span>
- <span class="normal">
- (<em>integer</em> x,
- <em>integer</em> y)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Returns the single pixel at the image location (x,y), as an
- a <em>tuple</em> of <em>integer</em>, in the form (a,r,g,b).
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>x</th>
- <td>
- The horizontal position of the pixel, starting with 0 at the left of the screen in the
- orientation it had when the screenshot was taken.
- </td>
- </tr>
- <tr>
- <th>y</th>
- <td>
- The vertical position of the pixel, starting with 0 at the top of the screen in the
- orientation it had when the screenshot was taken.
- </td>
- </tr>
- </table>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- A tuple of integers representing the pixel, in the form (a,r,g,b) where
- a is the alpha channel value, and r, g, and b are the red, green, and blue values,
- respectively.
- </li>
- </ul>
- </div>
- </div>
-</div>
-<A NAME="getRawPixelInt"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>tuple</em>
- </span>
- <span class="sympad">getRawPixelInt</span>
- <span class="normal">
- (<em>integer</em> x,
- <em>integer</em> y)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Returns the single pixel at the image location (x,y), as an
- an <em>integer</em>. Use this method to economize on memory.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>x</th>
- <td>
- The horizontal position of the pixel, starting with 0 at the left of the screen in the
- orientation it had when the screenshot was taken.
- </td>
- </tr>
- <tr>
- <th>y</th>
- <td>
- The vertical position of the pixel, starting with 0 at the top of the screen in the
- orientation it had when the screenshot was taken.
- </td>
- </tr>
- </table>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- The a,r,g, and b values of the pixel as 8-bit values combined into a 32-bit
- integer, with a as the leftmost 8 bits, r the next rightmost, and so forth.
- </li>
- </ul>
- </div>
- </div>
-</div>
-<A NAME="getSubImage"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <code>
- <a href="{@docRoot}guide/developing/tools/MonkeyImage.html">MonkeyImage</a>
- </code>
- </span>
- <span class="sympad">getSubImage</span>
- <span class="normal">
- (<em>tuple</em> rect)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Creates a new <code>MonkeyImage</code> object from a rectangular selection of the
- current image.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>rect</th>
- <td>
- A tuple (x, y, w, h) specifying the selection. x and y specify the 0-based pixel
- position of the upper left-hand corner of the selection. w specifies the width of the
- region, and h specifies its height, both in units of pixels.
- <p>
- The image's orientation is the same as the screen orientation at the time the
- screenshot was made.
- </p>
- </td>
- </tr>
- </table>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- A new <code>MonkeyImage</code> object containing the selection.
- </li>
- </ul>
- </div>
- </div>
-</div>
-<A NAME="sameAs"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>boolean</em>
- </span>
- <span class="sympad">sameAs</span>
- <span class="normal">
- (
- <code>
- <a href="{@docRoot}guide/developing/tools/MonkeyImage.html">MonkeyImage</a>
- </code> otherImage,
- <em>float</em> percent
- )
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Compares this <code>MonkeyImage</code> object to another and returns the result of
- the comparison. The <code>percent</code> argument specifies the percentage
- difference that is allowed for the two images to be "equal".
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>other</th>
- <td>
- Another <code>MonkeyImage</code> object to compare to this one.
- </td>
- </tr>
- <tr>
- <th>
- percent
- </th>
- <td>
- A float in the range 0.0 to 1.0, inclusive, indicating
- the percentage of pixels that need to be the same for the method to return
- <code>true</code>. The default is 1.0, indicating that all the pixels
- must match.
- </td>
- </tr>
- </table>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- Boolean <code>true</code> if the images match, or boolean <code>false</code> otherwise.
- </li>
- </ul>
- </div>
- </div>
-</div>
-<A NAME="writeToFile"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">writeToFile</span>
- <span class="normal">
- (<em>string</em> filename,
- <em>string</em> format)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Writes the current image to the file specified by <code>filename</code>, in the
- format specified by <code>format</code>.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>path</th>
- <td>
- The fully-qualified filename and extension of the output file.
- </td>
- </tr>
- <tr>
- <th>
- format
- </th>
- <td>
- The output format to use for the file. If no format is provided, then the
- method tries to guess the format from the filename's extension. If no
- extension is provided and no format is specified, then the default format of
- "png" (Portable Network Graphics) is used.
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
diff --git a/docs/html/guide/developing/tools/MonkeyRunner.jd b/docs/html/guide/developing/tools/MonkeyRunner.jd
deleted file mode 100644
index ea8d69e..0000000
--- a/docs/html/guide/developing/tools/MonkeyRunner.jd
+++ /dev/null
@@ -1,448 +0,0 @@
-page.title=MonkeyRunner
-parent.title=monkeyrunner
-parent.link=index.html
-@jd:body
-
-<style>
- h4.jd-details-title {background-color: #DEE8F1;}
-</style>
-<p>
- A monkeyrunner class that contains static utility methods.
-</p>
-<h2>Summary</h2>
-<table id="pubmethods" class="jd-sumtable">
- <tr>
- <th colspan="12" style="background-color: #E2E2E2">Methods</th>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#alert">alert</a>
- </span>
- (<em>string</em> message,
- <em>string</em> title,
- <em>string</em> okTitle)
- </nobr>
- <div class="jd-descrdiv">
- Displays an alert dialog to the process running the current
- program.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <em>integer</em>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#choice">choice</a>
- </span>
- (<em>string</em> message,
- <em>iterable</em> choices,
- <em>string</em> title)
- </nobr>
- <div class="jd-descrdiv">
- Displays a dialog with a list of choices to the process running the current program.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#help">help</a>
- </span>
- (<em>string</em> format)
- </nobr>
- <div class="jd-descrdiv">
- Displays the monkeyrunner API reference in a style similar to that of Python's
- <code>pydoc</code> tool, using the specified format.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <em>string</em>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#input">input</a>
- </span>
- (<em>string</em> message,
- <em>string</em> initialValue,
- <em>string</em> title,
- <em>string</em> okTitle,
- <em>string</em> cancelTitle)
- </nobr>
- <div class="jd-descrdiv">
- Displays a dialog that accepts input.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- void
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#sleep">sleep</a>
- </span>
- (<em>float</em> seconds)
- </nobr>
- <div class="jd-descrdiv">
- Pauses the current program for the specified number of seconds.
- </div>
- </td>
- </tr>
- <tr class="api" >
- <td class="jd-typecol">
- <nobr>
- <code>
- <a href="{@docRoot}guide/developing/tools/MonkeyDevice.html">MonkeyDevice</a>
- </code>
- </nobr>
- </td>
- <td class="jd-linkcol" width="100%">
- <nobr>
- <span class="sympad">
- <a href="#waitForConnection">waitForConnection</a>
- </span>
- (<em>float</em> timeout,
- <em>string</em> deviceId)
- </nobr>
- <div class="jd-descrdiv">
- Tries to make a connection between the <code>monkeyrunner</code> backend and the
- specified device or emulator.
- </div>
- </td>
- </tr>
-</table>
-<!-- ========= METHOD DETAIL ======== -->
-<!-- Public methods -->
-<h2>Public Methods</h2>
-<A NAME="alert"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>string</em>
- </span>
- <span class="sympad">alert</span>
- <span class="normal">
- (
- <em>string</em> message,
- <em>string</em> title,
- <em>string</em> okTitle)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Displays an alert dialog to the process running the current
- program. The dialog is modal, so the program pauses until the user clicks the dialog's
- button.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>message</th>
- <td>
- The message to display in the dialog.
- </td>
- </tr>
- <tr>
- <th>title</th>
- <td>
- The dialog's title. The default value is "Alert".
- </td>
- </tr>
- <tr>
- <th>okTitle</th>
- <td>
- The text displayed in the dialog button. The default value is "OK".
- </td>
- </tr>
- </table>
- </div>
-</div>
-</div>
-<A NAME="choice"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>integer</em>
- </span>
- <span class="sympad">choice</span>
- <span class="normal">
- (<em>string</em> message,
- <em>iterable</em> choices,
- <em>string</em> title)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Displays a dialog with a list of choices to the process running the current program. The
- dialog is modal, so the program pauses until the user clicks one of the dialog's
- buttons.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>message</th>
- <td>
- The prompt message displayed in the dialog.
- </td>
- </tr>
- <tr>
- <th>choices</th>
- <td>
- A Python iterable containing one or more objects that are displayed as strings. The
- recommended form is an array of strings.
- </td>
- </tr>
- <tr>
- <th>
- title
- </th>
- <td>
- The dialog's title. The default is "Input".
- </td>
- </tr>
- </table>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- If the user makes a selection and clicks the "OK" button, the method returns
- the 0-based index of the selection within the iterable.
- If the user clicks the "Cancel" button, the method returns -1.
- </li>
- </ul>
- </div>
- </div>
-</div>
-<A NAME="help"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">help</span>
- <span class="normal">
- (<em>string</em> format)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Displays the monkeyrunner API reference in a style similar to that of Python's
- <code>pydoc</code> tool, using the specified format.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>format</th>
- <td>
- The markup format to use in the output. The possible values are "text" for plain text
- or "html" for HTML.
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-<A NAME="input"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <em>string</em>
- </span>
- <span class="sympad">input</span>
- <span class="normal">
- (<em>string</em> message
- <em>string</em> initialValue,
- <em>string</em> title,
- <em>string</em> okTitle,
- <em>string</em> cancelTitle)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Displays a dialog that accepts input and returns it to the program. The dialog is
- modal, so the program pauses until the user clicks one of the dialog's buttons.
- </p>
- <p>
- The dialog contains two buttons, one of which displays the okTitle value
- and the other the cancelTitle value. If the user clicks the okTitle button,
- the current value of the input box is returned. If the user clicks the cancelTitle
- button, an empty string is returned.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>message</th>
- <td>
- The prompt message displayed in the dialog.
- </td>
- </tr>
- <tr>
- <th>initialValue</th>
- <td>
- The initial value to display in the dialog. The default is an empty string.
- </td>
- </tr>
- <tr>
- <th>title</th>
- <td>
- The dialog's title. The default is "Input".
- </td>
- </tr>
- <tr>
- <th>okTitle</th>
- <td>
- The text displayed in the okTitle button. The default is "OK".
- </td>
- </tr>
- <tr>
- <th>cancelTitle</th>
- <td>
- The text displayed in the cancelTitle button. The default is "Cancel".
- </td>
- </tr>
- </table>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- If the user clicks the okTitle button, then the method returns the current value of
- the dialog's input box. If the user clicks the cancelTitle button, the method returns
- an empty string.
- </li>
- </ul>
- </div>
- </div>
-</div>
-<A NAME="sleep"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- void
- </span>
- <span class="sympad">sleep</span>
- <span class="normal">
- (
- <em>float</em> seconds
- )
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Pauses the current program for the specified number of seconds.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>seconds</th>
- <td>
- The number of seconds to pause.
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
-<A NAME="waitForConnection"></A>
-<div class="jd-details api ">
- <h4 class="jd-details-title">
- <span class="normal">
- <code>
- <a href="{@docRoot}guide/developing/tools/MonkeyDevice.html">MonkeyDevice</a>
- </code>
- </span>
- <span class="sympad">waitForConnection</span>
- <span class="normal">
- (<em>float</em> timeout,
- <em>string</em> deviceId)
- </span>
- </h4>
- <div class="jd-details-descr">
-
- <div class="jd-tagdata jd-tagdescr">
- <p>
- Tries to make a connection between the <code>monkeyrunner</code> backend and the
- specified device or emulator.
- </p>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Arguments</h5>
- <table class="jd-tagtable">
- <tr>
- <th>timeout</th>
- <td>
- The number of seconds to wait for a connection. The default is to wait forever.
- </td>
- </tr>
- <tr>
- <th>
- deviceId
- </th>
- <td>
- A regular expression that specifies the serial number of the device or emulator. See
- the topic
- <a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a>
- for a description of device and emulator serial numbers.
- </td>
- </tr>
- </table>
- </div>
- <div class="jd-tagdata">
- <h5 class="jd-tagtitle">Returns</h5>
- <ul class="nolist">
- <li>
- A <code><a href="{@docRoot}guide/developing/tools/MonkeyDevice.html">MonkeyDevice</a></code>
- instance for the device or emulator. Use this object to control and communicate with the
- device or emulator.
- </li>
- </ul>
- </div>
- </div>
-</div>
diff --git a/docs/html/guide/developing/tools/aapt.html b/docs/html/guide/developing/tools/aapt.html
deleted file mode 100644
index e66a201..0000000
--- a/docs/html/guide/developing/tools/aapt.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/building/index.html#detailed-build">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should be redirected. Please <a
-href="http://developer.android.com/guide/developing/building/index.html#detailed-build">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/adb.jd b/docs/html/guide/developing/tools/adb.jd
deleted file mode 100644
index 50c7236..0000000
--- a/docs/html/guide/developing/tools/adb.jd
+++ /dev/null
@@ -1,669 +0,0 @@
-page.title=Android Debug Bridge
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>ADB quickview</h2>
- <ul>
-<li>Manage the state of an emulator or device</li>
-<li>Run shell commands on a device</li>
-<li>Manage port forwarding on an emulator or device</li>
-<li>Copy files to/from an emulator or device</li>
- </ul>
-
- <h2>In this document</h2>
- <ol>
-<li><a href="#issuingcommands">Issuing ADB Commands</a></li>
-<li><a href="#devicestatus">Querying for Emulator/Device Instances</a></li>
-<li><a href="#directingcommands">Directing Commands to a Specific Emulator/Device Instance</a></li>
-<li><a href="#move">Installing an Application</a></li>
-<li><a href="#forwardports">Forwarding Ports</a></li>
-<li><a href="#copyfiles">Copying Files to or from an Emulator/Device Instance</a></li>
-<li><a href="#commandsummary">Listing of adb Commands </a></li>
-<li><a href="#shellcommands">Issuing Shell Commands</a></li>
-<li><a href="#logcat">Enabling logcat Logging</a></li>
-<li><a href="#stopping">Stopping the adb Server</a></li>
- </ol>
-
- <h2>See also</h2>
- <ol>
- <li><a href="emulator.html">Emulator</a></li>
- </ol>
-
-</div>
-</div>
-
-<p>Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an
-emulator instance or connected Android-powered device. It is a client-server program that includes
-three components: </p>
-
-<ul>
- <li>A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients. </li>
- <li>A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device. </li>
- <li>A daemon, which runs as a background process on each emulator or device instance. </li>
-</ul>
-
-<p>You can find the {@code adb} tool in {@code <sdk>/platform-tools/}.</p>
-
-<p>When you start an adb client, the client first checks whether there is an adb server process already running. If there isn't, it starts the server process. When the server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb clients use port 5037 to communicate with the adb server. </p>
-
-<p>The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example: </p>
-
-<p style="margin-left:2em">
-Emulator 1, console: 5554<br/>
-Emulator 1, adb: 5555<br>
-Emulator 2, console: 5556<br>
-Emulator 2, adb: 5557 ...
-</p>
-
-<p>As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554. </p>
-
-<p>Once the server has set up connections to all emulator instances, you can use adb commands to control and access those instances. Because the server manages connections to emulator/device instances and handles commands from multiple adb clients, you can control any emulator/device instance from any client (or from a script).</p>
-
-<p>The sections below describe the commands that you can use to access adb capabilities and manage the state of an emulator/device. Note that if you are developing Android applications in Eclipse and have installed the ADT plugin, you do not need to access adb from the command line. The ADT plugin provides a transparent integration of adb into the Eclipse IDE. However, you can still use adb directly as necessary, such as for debugging.</p>
-
-<a name="issuingcommands"></a>
-
-<h2>Issuing adb Commands</h2>
-
-<p>You can issue adb commands from a command line on your development machine or from a script. The usage is: </p>
-
- <pre>adb [-d|-e|-s <serialNumber>] <command> </pre>
-
-<p>When you issue a command, the program invokes an adb client. The client is not specifically associated with any emulator instance, so if multiple emulators/devices are running, you need to use the <code>-d</code> option to specify the target instance to which the command should be directed. For more information about using this option, see <a href="#directingcommands">Directing Commands to a Specific Emulator/Device Instance</a>. </p>
-
-<a name="devicestatus"></a>
-
-<h2>Querying for Emulator/Device Instances</h2>
-
-<p>Before issuing adb commands, it is helpful to know what emulator/device instances are connected to the adb server. You can generate a list of attached emulators/devices using the <code>devices</code> command: </p>
-
- <pre>adb devices</pre>
-
-<p>In response, adb prints this status information for each instance:</p>
-
-<ul>
- <li>Serial number — A string created by adb to uniquely identify an emulator/device instance by its
- console port number. The format of the serial number is <code><type>-<consolePort></code>.
- Here's an example serial number: <code>emulator-5554</code></li>
- <li>State — The connection state of the instance. Three states are supported:
- <ul>
- <li><code>offline</code> — the instance is not connected to adb or is not responding.</li>
- <li><code>device</code> — the instance is now connected to the adb server. Note that this state does not
- imply that the Android system is fully booted and operational, since the instance connects to adb
- while the system is still booting. However, after boot-up, this is the normal operational state of
- an emulator/device instance.</li>
- </ul>
- </li>
-</ul>
-
-<p>The output for each instance is formatted like this: </p>
-
- <pre>[serialNumber] [state]</pre>
-
-<p>Here's an example showing the <code>devices</code> command and its output:</p>
-
- <pre>$ adb devices
-List of devices attached
-emulator-5554 device
-emulator-5556 device
-emulator-5558 device</pre>
-
-<p>If there is no emulator/device running, adb returns <code>no device</code>.</p>
-
-
-<a name="directingcommands"></a>
-
-<h2>Directing Commands to a Specific Emulator/Device Instance</h2>
-
-<p>If multiple emulator/device instances are running, you need to specify a target instance when issuing adb commands. To so so, use the <code>-s</code> option in the commands. The usage for the <code>-s</code> option is:</p>
-
- <pre>adb -s <serialNumber> <command> </pre>
-
-<p>As shown, you specify the target instance for a command using its adb-assigned serial number. You can use the <code>devices</code> command to obtain the serial numbers of running emulator/device instances. </p>
-
-<p>Here is an example: </p>
-
- <pre>adb -s emulator-5556 install helloWorld.apk</pre>
-
-<p>Note that, if you issue a command without specifying a target emulator/device instance using <code>-s</code>, adb generates an error.
-
-<a name="move"></a>
-
-<h2>Installing an Application</h2>
-<p>You can use adb to copy an application from your development computer and install it on an emulator/device instance. To do so, use the <code>install</code> command. With the command, you must specify the path to the .apk file that you want to install:</p>
-
-<pre>adb install <path_to_apk></pre>
-
-<p>For more information about how to create an .apk file that you can install on an emulator/device
-instance, see <a href="{@docRoot}guide/developing/building/index.html">Building and Running</a></p>
-
-<p>Note that, if you are using the Eclipse IDE and have the ADT plugin installed, you do not need to use adb (or aapt) directly to install your application on the emulator/device. Instead, the ADT plugin handles the packaging and installation of the application for you. </p>
-
-
-<a name="forwardports"></a>
-
-<h2>Forwarding Ports</h2>
-
- <p>You can use the <code>forward</code> command to set up arbitrary port forwarding — forwarding of requests on a specific host port to a different port on an emulator/device instance. Here's how you would set up forwarding of host port 6100 to emulator/device port 7100:</p>
-<pre>adb forward tcp:6100 tcp:7100</pre>
- <p>You can also use adb to set up forwarding to named abstract UNIX domain sockets, as illustrated here:</p>
-<pre>adb forward tcp:6100 local:logd </pre>
-
-<a name="copyfiles"></a>
-
-<h2>Copying Files to or from an Emulator/Device Instance</h2>
-
-<p>You can use the adb commands <code>pull</code> and <code>push</code> to copy files to and from an emulator/device instance's data file. Unlike the <code>install</code> command, which only copies an .apk file to a specific location, the <code>pull</code> and <code>push</code> commands let you copy arbitrary directories and files to any location in an emulator/device instance. </p>
-
-<p>To copy a file or directory (recursively) <em>from</em> the emulator or device, use</p>
-<pre>adb pull <remote> <local></pre>
-
-<p>To copy a file or directory (recursively) <em>to</em> the emulator or device, use</p>
- <pre>adb push <local> <remote></pre>
-
-<p>In the commands, <code><local></code> and <code><remote></code> refer to the paths to the target files/directory on your development machine (local) and on the emulator/device instance (remote).</p>
-
-<p>Here's an example: </p>
-<pre>adb push foo.txt /sdcard/foo.txt</pre>
-
-<a name="commandsummary"></a>
-
-<h2>Listing of adb Commands</h2>
-
-<p>The table below lists all of the supported adb commands and explains their meaning and usage. </p>
-
-
-<table>
-<tr>
- <th>Category</th>
- <th>Command</th>
- <th>Description</th>
- <th>Comments</th>
-</tr>
-
-<tr>
-<td rowspan="3">Options</td>
-<td><code>-d</code></td>
-<td>Direct an adb command to the only attached USB device.</td>
-<td>Returns an error if more than one USB device is attached.</td>
-</tr>
-
-<tr>
-<td><code>-e</code></td>
-<td>Direct an adb command to the only running emulator instance.</td>
-<td>Returns an error if more than one emulator instance is running. </td>
-</tr>
-
-<tr>
-<td><code>-s <serialNumber></code></td>
-<td>Direct an adb command a specific emulator/device instance, referred to by its adb-assigned serial number (such as "emulator-5556").</td>
-<td>If not specified, adb generates an error.</td>
-</tr>
-
-<tr>
-<td rowspan="3">General</td>
-<td><code>devices</code></td>
-<td>Prints a list of all attached emulator/device instances.</td>
-<td>See <a href="#devicestatus">Querying for Emulator/Device Instances</a> for more information.</td>
-</tr>
-
-<tr>
-<td><code>help</code></td>
-<td>Prints a list of supported adb commands.</td>
-<td> </td>
-</tr>
-
-<tr>
-<td><code>version</code></td>
-<td>Prints the adb version number. </td>
-<td> </td>
-</tr>
-
-<tr>
-<td rowspan="3">Debug</td>
-<td ><code>logcat [<option>] [<filter-specs>]</code></td>
-<td>Prints log data to the screen. </td>
-<td> </td>
-</tr>
-
-<tr>
-<td><code>bugreport</code></td>
-<td>Prints <code>dumpsys</code>, <code>dumpstate</code>, and <code>logcat</code> data to the screen, for the purposes of bug reporting. </td>
-<td> </td>
-</tr>
-
-<tr>
-<td><code>jdwp</code></td>
-<td>Prints a list of available JDWP processes on a given device. </td>
-<td>You can use the <code>forward jdwp:<pid></code> port-forwarding specification to connect to a specific JDWP process. For example: <br>
- <code>adb forward tcp:8000 jdwp:472</code><br>
- <code>jdb -attach localhost:8000</code></p>
- </td>
-</tr>
-
-<tr>
-<td rowspan=3">Data</td>
-<td><code>install <path-to-apk></code></td>
-<td>Pushes an Android application (specified as a full path to an .apk file) to the data file of an emulator/device. </td>
-<td> </td>
-</tr>
-
-<tr>
-<td><code>pull <remote> <local></code></td>
-<td>Copies a specified file from an emulator/device instance to your development computer. </td>
-<td> </td>
-</tr>
-
-<tr>
-<td><code>push <local> <remote></code></td>
-<td>Copies a specified file from your development computer to an emulator/device instance. </td>
-<td> </td>
-</tr>
-
-<tr>
-<td rowspan="2">Ports and Networking</td>
-<td><code>forward <local> <remote></code></td>
-<td>Forwards socket connections from a specified local port to a specified remote port on the emulator/device instance. </td>
-<td>Port specifications can use these schemes:
-<ul><li><code>tcp:<portnum></code></li>
-<li><code>local:<UNIX domain socket name></code></li>
-<li><code>dev:<character device name></code></li>
-<li><code>jdwp:<pid></code></li></ul>
-</td>
-</tr>
-
-<tr>
-<td><code>ppp <tty> [parm]...</code></td>
-<td>Run PPP over USB.
-<ul>
-<li><code><tty></code> — the tty for PPP stream. For example <code>dev:/dev/omap_csmi_ttyl</code>. </li>
-<li><code>[parm]... </code> — zero or more PPP/PPPD options, such as <code>defaultroute</code>, <code>local</code>, <code>notty</code>, etc.</li></ul>
-
-<p>Note that you should not automatically start a PPP connection. </p></td>
-<td></td>
-</tr>
-
-<tr>
-<td rowspan="3">Scripting</td>
-<td><code>get-serialno</code></td>
-<td>Prints the adb instance serial number string.</td>
-<td rowspan="2">See <a href="#devicestatus">Querying for Emulator/Device Instances</a> for more information. </td>
-</tr>
-
-<tr>
-<td><code>get-state</code></td>
-<td>Prints the adb state of an emulator/device instance.</td>
-</td>
-</tr>
-
-<tr>
-<td><code>wait-for-device</code></td>
-<td>Blocks execution until the device is online — that is, until the instance state is <code>device</code>.</td>
-<td>You can prepend this command to other adb commands, in which case adb will wait until the emulator/device instance is connected before issuing the other commands. Here's an example:
-<pre>adb wait-for-device shell getprop</pre>
-
-Note that this command does <em>not</em> cause adb to wait until the entire system is fully booted. For that reason, you should not prepend it to other commands that require a fully booted system. As an example, the <code>install</code> requires the Android package manager, which is available only after the system is fully booted. A command such as
-
-<pre>adb wait-for-device install <app>.apk</pre>
-
-would issue the <code>install</code> command as soon as the emulator or device instance connected to the adb server, but before the Android system was fully booted, so it would result in an error. </td>
-</tr>
-
-
-
-<tr>
-<td rowspan="2">Server</td>
-<td><code>start-server</code></td>
-<td>Checks whether the adb server process is running and starts it, if not.</td>
-<td> </td>
-</tr>
-
-<tr>
-<td><code>kill-server</code></td>
-<td>Terminates the adb server process.</td>
-<td> </td>
-</tr>
-
-
-
-<tr>
-<td rowspan="2">Shell</td>
-<td><code>shell</code></td>
-<td>Starts a remote shell in the target emulator/device instance.</td>
-<td rowspan="2">See <a href="#shellcommands">Issuing Shell Commands</a> for more information. </td>
-</tr>
-
-<tr>
-<td><code>shell [<shellCommand>]</code></td>
-<td>Issues a shell command in the target emulator/device instance and then exits the remote shell.</td>
-</tr>
-
-</table>
-
-
-<a name="shellcommands"></a>
-
-<h2>Issuing Shell Commands</h2>
-
-<p>Adb provides an ash shell that you can use to run a variety of commands on an emulator
-or device. The command binaries are stored in the file system of the emulator or device,
-in this location: </p>
-
-<pre>/system/bin/...</pre>
-
-<p>You can use the <code>shell</code> command to issue commands, with or without entering the adb remote shell on the emulator/device. </p>
-
-<p>To issue a single command without entering a remote shell, use the <code>shell</code> command like this: </p>
-
- <pre>adb [-d|-e|-s {<serialNumber>}] shell <shellCommand></pre>
-
-<p>To drop into a remote shell on a emulator/device instance, use the <code>shell</code> command like this:</p>
-
- <pre>adb [-d|-e|-s {<serialNumber>}] shell</pre>
-
-<p>When you are ready to exit the remote shell, use <code>CTRL+D</code> or <code>exit</code> to end the shell session. </p>
-
-<p>The sections below provide more information about shell commands that you can use.</p>
-
-<a name="sqlite" id="sqlite"></a>
-
-<h3>Examining sqlite3 Databases from a Remote Shell</h3>
-
-<p>From an adb remote shell, you can use the
-<a href="http://www.sqlite.org/sqlite.html">sqlite3</a> command-line program to
-manage SQLite databases created by Android applications. The
-<code>sqlite3</code> tool includes many useful commands, such as
-<code>.dump</code> to print out the contents of a table and
-<code>.schema</code> to print the SQL CREATE statement for an existing table.
-The tool also gives you the ability to execute SQLite commands on the fly.</p>
-
-<p>To use <code>sqlite3</code>, enter a remote shell on the emulator instance, as described above, then invoke the tool using the <code>sqlite3</code> command. Optionally, when invoking <code>sqlite3</code> you can specify the full path to the database you want to explore. Emulator/device instances store SQLite3 databases in the folder <code><span chatdir="1"><span chatindex="259474B4B070F261">/data/data/<em><package_name></em>/databases</span></span>/</code>. </p>
-
-<p>Here's an example: </p>
-
-<pre>$ adb -s emulator-5554 shell
-# sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db
-SQLite version 3.3.12
-Enter ".help" for instructions
-<em>.... enter commands, then quit...</em>
-sqlite> .exit </pre>
-
-<p>Once you've invoked <code>sqlite3</code>, you can issue <code>sqlite3</code> commands in the shell. To exit and return to the adb remote shell, use <code>exit</code> or <code>CTRL+D</code>.
-
-
-<a name="monkey"></a>
-
-<h3>UI/Application Exerciser Monkey</h3>
-
-<p>The Monkey is a program that runs on your emulator or device and generates pseudo-random
-streams of user events such as clicks, touches, or gestures, as well as a number of system-level
-events. You can use the Monkey to stress-test applications that you are developing,
-in a random yet repeatable manner.</p>
-
-<p>The simplest way to use the monkey is with the following command, which will launch your
-application and send 500 pseudo-random events to it.</p>
-
-<pre>$ adb shell monkey -v -p your.package.name 500</pre>
-
-<p>For more information about command options for Monkey, see the complete
-<a href="{@docRoot}guide/developing/tools/monkey.html" title="monkey">UI/Application Exerciser Monkey</a> documentation page.</p>
-
-
-<a name="othershellcommands"></a>
-
-<h3>Other Shell Commands</h3>
-
-<p>The table below lists several of the adb shell commands available. For a complete list of commands and programs, start an emulator instance and use the <code>adb -help</code> command. </p>
-
-<pre>adb shell ls /system/bin</pre>
-
-<p>Help is available for most of the commands. </p>
-
-<table>
-<tr>
- <th>Shell Command</th>
- <th>Description</th>
- <th>Comments</th>
-</tr>
-
-<tr>
-<td><code>dumpsys</code></td>
-<td>Dumps system data to the screen.</td>
-<td rowspan=4">The <a href="{@docRoot}guide/developing/debugging/ddms.html">Dalvik Debug Monitor Server</a>
-(DDMS) tool offers integrated debug environment that you may find easier to use.</td>
-</tr>
-
-<tr>
-<td><code>dumpstate</code></td>
-<td>Dumps state to a file.</td>
-</tr>
-
-<tr>
-<td><code>logcat [<option>]... [<filter-spec>]...</code></td>
-<td>Enables radio logging and prints output to the screen. </td>
-</tr>
-
-<tr>
-<td><code>dmesg</code></td>
-<td>Prints kernel debugging messages to the screen. </td>
-</tr>
-
-<tr>
-<td><code>start</code></td>
-<td>Starts (restarts) an emulator/device instance.</td>
-<td> </td>
-</tr>
-
-<tr>
-<td><code>stop</code></td>
-<td>Stops execution of an emulator/device instance.</td>
-<td> </td>
-</tr>
-
-</table>
-
-<a name="logcat"></a>
-
-<h2>Enabling logcat Logging</h2>
-
-<p>The Android logging system provides a mechanism for collecting and viewing system debug output. Logs from various applications and portions of the system are collected in a series of circular buffers, which then can be viewed and filtered by the <code>logcat</code> command.</p>
-
-<a name="usinglogcat"></a>
-
-<h3>Using logcat Commands</h3>
-
-<p>You can use the <code>logcat</code> command to view and follow the contents of the system's log buffers. The general usage is:</p>
-
-<pre>[adb] logcat [<option>] ... [<filter-spec>] ...</pre>
-
-<p>The sections below explain filter specifications and the command options. See <a href="#logcatoptions">Listing of logcat Command Options</a> for a summary of options. </p>
-
-<p>You can use the <code>logcat</code> command from your development computer or from a remote adb shell in an emulator/device instance. To view log output in your development computer, you use</p>
-
-<pre>$ adb logcat</pre>
-
-<p>and from a remote adb shell you use</p>
-
-<pre># logcat</pre>
-
-<a name="filteringoutput"></a>
-
-<h3>Filtering Log Output</h3>
-
-<p>Every Android log message has a <em>tag</em> and a <em>priority</em> associated with it. </p>
-
-<ul>
-<li>The tag of a log message is a short string indicating the system component from which the message originates (for example, "View" for the view system). </li>
-
-<li>The priority is one of the following character values, ordered from lowest to highest priority:</li>
-
-<ul>
- <li><code>V</code> — Verbose (lowest priority)</li>
- <li><code>D</code> — Debug</li>
- <li><code>I</code> — Info (default priority)</li>
- <li><code>W</code> — Warning</li>
- <li><code>E</code> — Error</li>
- <li><code>F</code> — Fatal</li>
- <li><code>S</code> — Silent (highest priority, on which nothing is ever printed)</li>
-</ul>
-</ul>
-
-<p>You can obtain a list of tags used in the system, together with priorities, by running <code>logcat</code> and observing the first two columns
-of each message, given as <code><priority>/<tag></code>. </p>
-
-<p>Here's an example of logcat output that shows that the message relates to priority level "I" and tag "ActivityManager":</p>
-
-<pre>I/ActivityManager( 585): Starting activity: Intent { action=android.intent.action...}</pre>
-
-<p>To reduce the log output to a manageable level, you can restrict log output using <em>filter expressions</em>. Filter expressions let you indicate to the system the tags-priority combinations that you are interested in — the system suppresses other messages for the specified tags. </p>
-
-<p>A filter expression follows this format <code>tag:priority ...</code>, where <code>tag</code> indicates the tag of interest and <code>priority</code> indicates the <em>minimum</em> level of priority to report for that tag. Messages for that tag at or above the specified priority are written to the log. You can supply any number of <code>tag:priority</code> specifications in a single filter expression. The series of specifications is whitespace-delimited. The default output is to show all log messages with the Info priority (*:I).</p>
-
-<p>Here's an example of a filter expression that suppresses all log messages except those with the tag "ActivityManager", at priority "Info" or above, and all log messages with tag "MyApp", with priority "Debug" or above:</p>
-
-<pre>adb logcat ActivityManager:I MyApp:D *:S</pre>
-
-<p>The final element in the above expression, <code>*:S</code>, sets the priority level for all tags to "silent", thus ensuring only log messages with "View" and "MyApp" are displayed. Using <code>*:S</code> is an excellent way to ensure that log output is restricted to the filters that you have explicitly specified — it lets your filters serve as a "whitelist" for log output.</p>
-
-<p>The following filter expression displays all log messages with priority level "warning" and higher, on all tags:</p>
-
-<pre>adb logcat *:W</pre>
-
-<p>If you're running <code>logcat</code> from your development computer (versus running it on a remote adb shell), you can also set a default filter expression by exporting a value for the environment variable <code>ANDROID_LOG_TAGS</code>:</p>
-
-<pre>export ANDROID_LOG_TAGS="ActivityManager:I MyApp:D *:S"</pre>
-
-<p>Note that <code>ANDROID_LOG_TAGS</code> filter is not exported to the emulator/device instance, if you are running <code>logcat</code> from a remote shell or using <code>adb shell logcat</code>.</p>
-
-
-<a name="outputformat"></a>
-
-<h3>Controlling Log Output Format</h3>
-
-<p>Log messages contain a number of metadata fields, in addition to the tag and priority. You can modify the output format for messages so that they display a specific metadata field. To do so, you use the <code>-v</code> option and specify one of the supported output formats listed below. </p>
-
-<ul>
- <li><code>brief</code> — Display priority/tag and the PID of process issuing the message (the default format).</li>
- <li><code>process</code> — Display PID only.</li>
- <li><code>tag</code> — Display the priority/tag only. </li>
- <li><code>raw</code> — Display the raw log message, with no other metadata fields.</li>
- <li><code>time</code> — Display the date, invocation time, priority/tag, and PID of the process issuing the message.</li>
- <li><code>threadtime</code> — Display the date, invocation time, priority, tag, and the PID and TID of the thread issuing the message.</li>
- <li><code>long</code> — Display all metadata fields and separate messages with a blank lines.</li>
-</ul>
-
-<p>When starting <code>logcat</code>, you can specify the output format you want by using the <code>-v</code> option:</p>
-
-<pre>[adb] logcat [-v <format>]</pre>
-
-<p>Here's an example that shows how to generate messages in <code>thread</code> output format: </p>
-
-<pre>adb logcat -v thread</pre>
-
-<p>Note that you can only specify one output format with the <code>-v</code> option. </p>
-
-<a name="alternativebuffers"></a>
-
-<h3>Viewing Alternative Log Buffers </h3>
-
-<p>The Android logging system keeps multiple circular buffers for log messages, and not all of the log messages are sent to the default circular buffer. To see additional log messages, you can start <code>logcat</code> with the <code>-b</code> option, to request viewing of an alternate circular buffer. You can view any of these alternate buffers: </p>
-
-<ul>
-<li><code>radio</code> — View the buffer that contains radio/telephony related messages.</li>
-<li><code>events</code> — View the buffer containing events-related messages.</li>
-<li><code>main</code> — View the main log buffer (default)</li>
-</ul>
-
-<p>The usage of the <code>-b</code> option is:</p>
-
-<pre>[adb] logcat [-b <buffer>]</pre>
-
-<p>Here's an example of how to view a log buffer containing radio and telephony messages: </p>
-
-<pre>adb logcat -b radio</b></pre>
-
-<a name="stdout"></a>
-
-<h3>Viewing stdout and stderr</h3>
-
-<p>By default, the Android system sends <code>stdout</code> and <code>stderr</code> (<code>System.out</code> and <code>System.err</code>) output to <code>/dev/null</code>. In
-processes that run the Dalvik VM, you can have the system write a copy of the output to the log file. In this case, the system writes the messages to the log using the log tags <code>stdout</code> and <code>stderr</code>, both with priority <code>I</code>. </p>
-
-<p>To route the output in this way, you stop a running emulator/device instance and then use the shell command <code>setprop</code> to enable the redirection of output. Here's how you do it: </p>
-
-<pre>$ adb shell stop
-$ adb shell setprop log.redirect-stdio true
-$ adb shell start</pre>
-
-<p>The system retains this setting until you terminate the emulator/device instance. To use the setting as a default on the emulator/device instance, you can add an entry to <code>/data/local.prop</code>
-on the device.</p>
-
-<a name="logcatoptions"></a>
-
-<h3>Listing of logcat Command Options</h3>
-
-<table>
-<tr>
- <th>Option</th>
- <th>Description</th>
-</tr>
-
-<tr>
-<td><code>-b <buffer></code></td>
-<td>Loads an alternate log buffer for viewing, such as <code>event</code> or <code>radio</code>. The <code>main</code> buffer is used by default. See <a href="#alternativebuffers">Viewing Alternative Log Buffers</a>.</td>
-</tr>
-
-<tr>
-<td><code>-c</code></td>
-<td>Clears (flushes) the entire log and exits. </td>
-</tr>
-
-<tr>
-<td><code>-d</code></td>
-<td>Dumps the log to the screen and exits.</td>
-</tr>
-
-<tr>
-<td><code>-f <filename></code></td>
-<td>Writes log message output to <code><filename></code>. The default is <code>stdout</code>.</td>
-</tr>
-
-<tr>
-<td><code>-g</code></td>
-<td>Prints the size of the specified log buffer and exits. </td>
-</tr>
-
-<tr>
-<td><code>-n <count></code></td>
-<td>Sets the maximum number of rotated logs to <code><count></code>. The default value is 4. Requires the <code>-r</code> option. </td>
-</tr>
-
-<tr>
-<td><code>-r <kbytes></code></td>
-<td>Rotates the log file every <code><kbytes></code> of output. The default value is 16. Requires the <code>-f</code> option. </td>
-</tr>
-
-<tr>
-<td><code>-s</code></td>
-<td>Sets the default filter spec to silent. </td>
-</tr>
-
-<tr>
-<td><code>-v <format></code></td>
-<td>Sets the output format for log messages. The default is <code>brief</code> format. For a list of supported formats, see <a href="#outputformat">Controlling Log Output Format</a>.</td>
-</tr>
-
-</table>
-
-<a name="stopping"></a>
-
-<h2>Stopping the adb Server</h2>
-
-<p>In some cases, you might need to terminate the adb server process and then restart it. For example, if adb does not respond to a command, you can terminate the server and restart it and that may resolve the problem. </p>
-
-<p>To stop the adb server, use the <code>kill-server</code>. You can then restart the server by issuing any adb command. </p>
-
-
diff --git a/docs/html/guide/developing/tools/adt.jd b/docs/html/guide/developing/tools/adt.jd
deleted file mode 100644
index d473e85..0000000
--- a/docs/html/guide/developing/tools/adt.jd
+++ /dev/null
@@ -1,527 +0,0 @@
-page.title=Android Developer Tools
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#tools">SDK Tools Integration</a></li>
-
- <li><a href="#editors">Code Editors</a>
- <ol>
- <li><a href="#resource-linking">Resource linking enhancements</a></li>
- </ol>
- </li>
-
- <li><a href="#graphical-editor">Graphical Layout Editor</a>
- <ol>
- <li><a href="#canvas">Canvas and outline view</a></li>
- <li><a href="#palette">Palette</a></li>
- <li><a href="#config-chooser">Configuration chooser</a></li>
- </ol>
- </li>
-
- <li><a href="#refactoring">Layout Factoring Support</a></li>
-
- </ol>
-
- <h2>Related videos</h2>
-
- <ol>
- <li><a href="{@docRoot}videos/index.html#v=Oq05KqjXTvs">Android Developer Tools
- Google I/O Session</a>
- </li>
- </ol>
-
- <h2>See also</h2>
-
- <ol>
- <li><a href="http://tools.android.com/recent">Android Tools change blog</a></li>
- </ol>
- </div>
- </div>
-
- <p>ADT (Android Developer Tools) is a plugin for Eclipse that provides a suite of
- tools that are integrated with the Eclipse IDE. It offers you access to many features that help
- you develop Android applications quickly. ADT
- provides GUI access to many of the command line SDK tools as well as a UI design tool for rapid
- prototyping, designing, and building of your application's user interface.</p>
-
- <p>Because ADT is a plugin for Eclipse, you get the functionality of a well-established IDE,
- along with Android-specific features that are bundled with ADT. The following
- describes important features of Eclipse and ADT:</p>
-
- <dl>
- <dt><strong>Integrated Android project creation, building, packaging, installation, and
- debugging</strong></dt>
-
- <dd>ADT integrates many development workflow tasks into Eclipse, making it easy for you to
- rapidly develop and test your Android applications.</dd>
-
- <dt><strong>SDK Tools integration</strong></dt>
-
- <dd>Many of the <a href="#tools">SDK tools</a> are integrated into Eclipse's menus,
- perspectives, or as a part of background processes ran by ADT.</dd>
-
- <dt><strong>Java programming language and XML editors</strong></dt>
-
- <dd>The Java programming language editor contains common IDE features such as compile time
- syntax checking, auto-completion, and integrated documentation for the Android framework APIs.
- ADT also provides custom XML editors that let you
- edit Android-specific XML files in a form-based UI. A graphical layout editor lets you design
- user interfaces with a drag and drop interface.</dd>
-
- <dt><strong>Integrated documentation for Android framework APIs</strong></dt>
- <dd>You can access documentation by hovering over classes, methods, or variables.</dd>
- </dl>
-
- <p>You can find the most up-to-date and more detailed information about changes and new features
-on the <a href="http://tools.android.com/recent">Recent Changes</a> page at the Android Tools
-Project site.</p>
-
- <h2 id="tools">SDK Tools Integration</h2>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Need help designing icons?</h2>
- <p>The <a href="http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html">Android
- Asset Studio</a> is a web-based tool that lets you generate icons from existing images,
- clipart, or text. It also generates the icons with different DPIs for different screen sizes and
- types.</p>
-
- </div>
- </div>
-
- <p>Many of the tools that you can start or run from the command line are integrated into ADT.
- They include:</p>
-
- <ul>
- <li><a href="{@docRoot}guide/developing/debugging/debugging-tracing.html">Traceview</a>:
- Allows you to profile your program's execution
- (<strong>Window > Open Perspective > Traceview</strong>). </li>
-
- <li><a href="{@docRoot}guide/developing/tools/android.html">android</a>: Provides access to
- the Android SDK Manager and AVD Manager. Other <code>android</code> features such as creating or
- updating projects (application and library) are integrated throughout the Eclipse IDE. </li>
-
- <li><a href="{@docRoot}guide/developing/debugging/debugging-ui.html#HierarchyViewer">Hierarchy
- Viewer</a>: Allows you to visualize your application's view hierarchy to find inefficiencies
- (<strong>Window > Open Perspective > Hierarchy Viewer</strong>).</li>
-
- <li><a href="{@docRoot}guide/developing/debugging/debugging-ui.html#pixelperfect">Pixel
- Perfect</a>: Allows you to closely examine your UI to help with designing and building.
- (<strong>Window > Open Perspective > Pixel Perfect</strong>).</li>
-
- <li><a href="{@docRoot}guide/developing/debugging/ddms.html">DDMS</a>: Provides
- debugging features including: screen capturing, thread and heap information, and logcat
- (<strong>Window > Open Perspective > DDMS</strong>).</li>
-
- <li><a href="{@docRoot}guide/developing/tools/adb.html">adb</a>: Provides access to
- a device from your development system. Some features of
- <code>adb</code> are integrated into ADT such as project installation (Eclipse run menu),
- file transfer, device enumeration, and logcat (DDMS). You must access the more advanced
- features of <code>adb</code>, such as shell commands, from the command line.</li>
-
- <li><a href="{@docRoot}guide/developing/tools/proguard.html">ProGuard</a>: Allows code obfuscation,
- shrinking, and optimization. ADT integrates ProGuard as part of the build, if you <a href=
- "{@docRoot}guide/developing/tools/proguard.html#enabling">enable it</a>.</li>
- </ul>
-
-<h2 id="editors">Code Editors</h2>
-
- <p>In addition to Eclipse's standard editor features, ADT provides custom XML editors to help
- you create and edit Android manifests, resources, menus, and layouts in a form-based or graphical
- mode. Double-clicking on an XML file in Eclipse's package explorer opens the
- appropriate XML editor.
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Google I/O Session Video</h2>
- <p>View the segment on the <a href=
- "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=30m50s">XML editors</a> for more
- information.</p>
- </div>
- </div>
-
- <p class="note"><strong>Note:</strong> You can edit Android-specific XML files (such as a layout
-or manifest) in both a graphical mode and also an XML markup mode. You can switch between
-these modes with the pair of tabs at the bottom of each custom XML editor.</p>
-
- <p>In addition, some special file types that don't have custom editors, such as drawables, animations,
- and color files offer editing enhancements such as XML tag completion.</p>
-
-<p>ADT provides the following custom, form-based XML editors:</p>
-
- <dl>
-
- <dt><strong>Graphical Layout Editor</strong></dt>
-
- <dd>Edit and design your XML layout files with a drag and drop interface. The layout editor
- renders your interface as well, offering you a preview as you design your layouts. This editor
- is invoked when you open an XML file with a view declared (usually declared in
- <code>res/layout</code>. For more information, see <a href="#graphical-editor">Graphical Layout
- Editor</a>.</dd>
-
- <dt><strong>Android Manifest Editor</strong></dt>
-
- <dd>Edit Android manifests with a simple graphical interface. This editor is invoked
- when you open an <code>AndroidManifest.xml</code> file.</dd>
-
- <dt><strong>Menu Editor</strong></dt>
-
- <dd>Edit menu groups and items with a simple graphical interface. This editor is
- invoked when you open an XML file with a <code><menu></code> declared (usually located in
- the <code>res/menu</code> folder).</dd>
-
- <dt><strong>Resources Editor</strong></dt>
-
- <dd>Edit resources with a simple graphical interface. This editor is invoked when
- you open an XML file with a <code><resources></code> tag declared.</dd>
-
- <dt><strong>XML Resources Editor</strong></dt>
-
- <dd>Edit XML resources with a simple graphical interface. This editor is invoked
- when you open an XML file.</dd>
- </dl>
-
-
- <h3 id="resource-linking">Resource linking enhancements</h3>
- <p>In addition to the normal code editing features of Eclipse, ADT provides enhancements to the Android
- development experience that allow you to quickly jump to declarations of various types of resources such
- as strings or layout files. You can access these enhancements by holding down the control key and
- clicking on the following items:
-
- <ul>
-
- <li>A resource identifier, such as <code>R.id.button1</code>, jumps
- to the XML definition of the view.</li>
-
- <li>A declaration in the <code>R.java</code> file, such as <code>public
- static final int Button01=0x7f050000"</code>, jumps to the corresponding XML definition.</li>
-
- <li>An activity or service definition in your manifest, such as
- <code><activity android:name=".TestActivity"></code>, jumps to the corresponding Java class. You can
- jump from an activity definition (or service definition) into the corresponding Java class.</li>
-
- <li>You can jump to any value definition (e.g. <code>@string:foo</code>), regardless of
-which XML file
- "foo" is defined in.</li>
-
- <li>Any file-based declaration, such as <code>@layout/bar</code>, opens the file.</li>
-
- <li>Non-XML resources, such as <code>@drawable/icon</code>, launches
- Eclipse's default application for the given file type, which in this case is an
- image.</li>
-
- <li><code>@android</code> namespace resources opens the resources found in
- the SDK install area.</li>
-
- <li>Custom views in XML layouts, such as <code><foo.bar.MyView></foo.bar.MyView></code>,
- or <code><view class="foo.bar.MyView"></code>) jump to the corresponding custom view classes.</li>
-
- <li>An XML attribute such as <code>@android:string/ok</code> or <code>android.R.string.id</code> in Java code
- opens the file that declares the strings. The XML tab opens when doing this, not
- the form-based editor.</li>
-
- </ul>
-
- <h2 id="graphical-editor">Graphical Layout Editor</h2>
-
- <p>ADT provides many features to allow you to design and build your application's user interface.
- Many of these features are in the graphical layout editor, which you can access by opening one of
- your application's XML layout files in Eclipse.
- </p>
-
- <p>The graphical layout editor is the main screen that you use to visually design and build your
- UI. It is split up into the following parts:</p>
-
- <dl>
- <dt><strong>Canvas</strong></dt>
-
- <dd>In the middle of the editor is the canvas. It provides the rendered view of your
- layout and supports dragging and dropping of UI widgets
- directly from the palette. You can select the platform version used to render the items in
- the canvas. Each platform version has its own look and feel, which might be the similar to or
- radically different from another platform version. The canvas renders the appropriate look
- and feel for the currently selected platform version.
- This platform version does not need to be the same as the version that your
- application targets.
-
- <p>The canvas also provides
- context-sensitive actions in the layout actions bar, such as adjusting layout margins and
-orientation.
- The layout actions bar displays available actions depending on the selected UI element in the
- canvas.</p>
- </dd>
-
- <dt><strong>Outline</strong></dt>
-
- <dd>On the right side of the editor is the outline view. It displays a hierarchical
- view of your layout where you can do things such as reorder of views. The outline
- view exposes similar functionality as the canvas but displays your layout in an ordered
- list instead of a rendered preview.</dd>
-
- <dt><strong>Palette</strong></dt>
-
- <dd>On the left side of the editor is the palette. It provides a set of widgets that
- you can drag onto the canvas. The palette shows rendered previews of the
- widgets for easy lookup of desired UI widgets.</dd>
-
- <dt><strong>Configuration Chooser</strong></dt>
-
- <dd>At the top of the editor is the configuration chooser.
- It provides options to change a layout's rendering mode or screen type.</dd>
- </dl>
-
- <img src="{@docRoot}images/layout_editor.png" alt="graphical layout editor screenshot"
- height="500" id="layout-editor" name="layout-editor">
-
- <p class="img-caption"><strong>Figure 1.</strong> Graphical layout editor</p>
-
- <h3 id="canvas">Canvas and outline view</h3>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Google I/O Session Video</h2>
-
- <p>View the segment on the <a href=
- "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=7m16s">canvas and outline view</a> and the
- <a href="http://www.youtube.com/watch?v=Oq05KqjXTvs#t=11m43s">layout actions bar</a>
- for more information.
- </p>
- </div>
- </div>
-
- <p>The canvas is the area where you can drag and drop UI widgets from the palette to design your
- layout. The canvas offers a rendered preview of your layout depending on factors such as the
- selected platform version, screen orientation, and currently selected theme that you specify in
- the <a href="#configuration-chooser">configuration chooser</a>. You can also drag and drop
- items into the outline view, which displays your layout in a hierarchical list. The outline view
- exposes much of the same functionality as the canvas but offers another method of organization
- that is beneficial for ordering and quickly selecting items. When you right-click a specific item
- in the canvas or outline view, you can access a context-sensitive menu that lets you modify the
- following attributes of the layout or view:</p>
-
- <dl>
- <dt><strong>View and layout properties</strong></dt>
-
- <dd>
- When you right-click a view or layout in the canvas or outline view, it brings up a
- context-sensitive menu that lets you set things such as:
-
- <ul>
- <li>ID of the view or layout</li>
-
- <li>Text of the view</li>
-
- <li>Layout width</li>
-
- <li>Layout height</li>
-
- <li>Properties such as alpha or clickable</li>
- </ul>
- </dd>
-
- <dt><strong>Animation preview and creation</strong></dt>
-
- <dd>
- If your layout or view is animated, you can preview the animation directly in the canvas
- (when you select Android 3.0 or later as the platform version in the configuration chooser).
- Right-click an item in the canvas and select <strong>Play Animation</strong>. If
- animation is not associated with item, an option is available in the menu to create one.
-
- <p>View the segment on the <a href=
- "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=28m30s">animation features</a> for more
- information.</p>
- </dd>
-
- <dt><strong>Extract as Include</strong></dt>
-
- <dd>You can extract parts of a current layout into its own layout file,
- which you can then include in any layout with a single line of XML. See <a href=
- "#extract-as-include">Layout Refactoring Support</a> for more information.</dd>
- </dl>
-
- <h4>Other canvas features</h4>
-
- <p>The canvas has additional features not available in the outline view:</p>
-
- <ul>
-
- <li>Edit views with the layout actions bar: The context-sensitive layout actions bar allows you to
- edit how a view is laid out in your UI. The available actions depend on the currently
- selected view and its parent layout. Some common actions include
- toggling the fill mode of the view and specifying margins. For instance, if you select a
- {@link android.widget.Button}
- in a {@link android.widget.LinearLayout}, you see actions related to the {@link
-android.widget.LinearLayout}, such as a toggle to switch
- between horizontal and vertical layout, and a toggle to control whether its children are
- aligned along their text baseline. You will also see toolbar actions to control the individual
- layout attributes of the child, such as whether the child should stretch out to match its
- parent's width and height, a dropdown action to set the child's layout gravity, a button to open
- a margin editor, and a layout weight editor.</li>
-
- <li>Edit a nested layout in its current context: If you are editing a layout
- that includes another layout, you can edit the included layout in the layout that included
- it.</li>
-
- <li>Preview drag and drop location: When you drag and drop a UI widget onto the canvas, ruler
- markers appear showing you the approximate location of the UI widget depending on the
- type of layout, such as {@link android.widget.RelativeLayout} or {@link
- android.widget.LinearLayout}.</li>
-
- <li>Preview animations: You can preview view and layout animations when you select Android 2.1
- or later for the platform version in the configuration bar.</li>
-
- <li>Render layouts in real-time: Layouts are rendered as accurately as possible according to
- the platform version, including the appropriate system and action bars.</li>
-
- <li>Support for fragments: Fragments can be rendered in the same screen as the layout that
- includes the fragments.</li>
-
- </ul>
-
- <img src="{@docRoot}images/canvas.png" alt="screenshot of the canvas" height="553">
-
- <p class="img-caption"><strong>Figure 2.</strong> Canvas portion of the layout editor showing
- a rendered preview of an application</p>
-
- <img src=
- "{@docRoot}images/layout_outline.png" alt="screenshot of the outline view" height="185">
-
- <p class="img-caption"><strong>Figure 3.</strong> Outline view showing current layout's structure</p>
-
- <h3 id="palette">Palette</h3>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Google I/O Session Video</h2>
-
- <p>View the segment on the <a href=
- "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=7m53s">palette</a> for more information.</p>
- </div>
- </div>
-
- <p>The palette contains the UI widgets that you can drag and drop onto the canvas and add to your
- layout. The pallete categorizes the widgets and shows rendered previews
- for easier lookup. The main features of the palette include:</p>
-
- <ul>
- <li>Different modes of rendered previews include: icons only, icons and text, tiny previews,
- small previews, and previews (rendered in real size). Previews are only available for layouts
- rendered with the latest revisions of Android 2.1 (API Level 7) or later.</li>
-
- <li>Custom views in your project or library projects are added under custom views
- category.</li>
-
- <li>Arrange UI widgets alphabetically or by category.</li>
- </ul>
- <img src="{@docRoot}images/palette.png" alt="palette screenshot" height="566">
-
- <p class="img-caption"><strong>Figure 4.</strong> Palette showing available UI widgets</p>
-
- <h3 id="config-chooser">Configuration chooser</h3>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Google I/O Session Video</h2>
-
- <p>View the segment on the <a href=
- "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=12m51s">configuration chooser</a> for more
- information.</p>
- </div>
- </div>
-
-
- <p>The configuration chooser allows you to create and configure different configurations of
- a layout for different situations, such as one for landscape and one for portrait mode. You can
- set the following options for each configuration of a layout:
- </p>
- <ul>
- <li>Screen type combo box: Predefined screen settings for common device configurations. You
- can also create your own by selecting <strong>Custom...</strong>.</li>
-
- <li>Screen orientation combo box: Portrait or Landscape screen orientation.</li>
-
- <li>Theme combo box: Predefined themes or a custom theme that you have created.</li>
-
- <li>Platform combo box: Platform version used to render the canvas and palette as well as
- displaying appropriate themes.</li>
-
- <li>Custom layout combo boxes: The locale, dock, and time of day combo boxes let you select
- different versions of the same layout depending on the device's current state. You can
- create a new version of a layout with the <strong>Create</strong> button.</li>
- </ul>
-
- <img src="{@docRoot}images/layout_bar.png" alt=
- "configuration chooser screenshot" height="50" id="configuration-chooser" name="configuration chooser">
-
- <p class="img-caption"><strong>Figure 5.</strong> Configuration chooser</p>
-
- <h2 id="refactoring">Layout Refactoring Support</h2>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Google I/O Session Video</h2>
-
- <p>View the segment on <a href=
- "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=18m00s">refactoring features</a> for a rundown
-of the more important refactoring features.</p>
-
- </div>
- </div>
-
- <p>In both the graphical and XML layout editor, there are many features that help you quickly
- refactor your layouts. The following list describes the major refactoring support:</p>
-
- <dl>
-
- <dt><strong>Change layout</strong></dt>
- <dd>This lets you change the layout on the fly and re-renders the canvas for you.
- You can apply this refactoring to any layout and the layout is converted to the new type if
- possible. In many cases, the opening and closing tags of the layout's XML element are changed
- along with things such as ID attributes and their references. However, for some supported
- types, ADT attempts to preserve the layout, such as changing a {@link
- android.widget.LinearLayout} to a {@link android.widget.RelativeLayout}.</dd>
-
- <dt><strong>Change widget</strong></dt>
- <dd>This lets you select one or more widgets and converts them to a new widget type. In
- addition to changing the element name, it also removes any
- attributes that are not supported by the new widget type and adds in any mandatory attributes
- required by the new widget type. If the current ID of a widget includes the
- current widget type in its ID (such as a <code><Button></code> widget named
- <code>"button1"</code>), then the ID is changed to match the new widget type and all
- references are updated.</dd>
-
- <dt id="extract-as-include"><strong>Extract as include</strong></dt>
- <dd>This lets you extract views inside of an existing layout into their own separate layout
- file. An <code>include</code> tag that points to the newly created layout file is inserted
- into the existing layout file. Right-click the view or layout and select <strong>Extract as
- Include...</strong>.</dd>
-
- <dt><strong>Extract string</strong></dt>
- <dd>Extract strings from either XML or Java files into their own separate resource file.</dd>
-
- <dt><strong>Extract style</strong></dt>
- <dd>Extract style-related attributes from a layout and define them in a new
- <code>styles.xml</code> file. You can select multiple views and this refactoring extracts all
- of the same styles into one style and assigns that style to all the views that use it.</dd>
-
- <dt><strong>Wrap-in container</strong></dt>
- <dd>This lets you select one or more sibling elements and wrap them in a new container. This
- can be applied to the root element as well, in which case the namespace declaration attributes
- will be transferred to the new root. This refactoring also transfers <code>layout_</code>
- attribute references to the new root, For example, suppose you have a {@link android.widget.RelativeLayout}.
- If other widgets have layout constraints pointing to your widget, wrapping the widget causes
- these constraints to point to the parent instead.</dd>
-
- <dt><strong>Quick Assistant</strong></dt>
- <dd>Provides refactoring suggestions depending on the current context. Press
- <strong>Ctrl-1</strong> (or <strong>Cmd-1</strong> on
- Mac) in an editor, and Eclipse provides a list of possible refactorings depending on the
- context. The Quick Assistant provides fast access to all of the above refactorings, where applicable.
- For example, if you are editing an XML value and decide you want to extract it out
- as a string, place the text cursor in the string and press Ctrl-1 to see the refactoring context
- menu.</dd>
- </dl>
diff --git a/docs/html/guide/developing/tools/aidl.jd b/docs/html/guide/developing/tools/aidl.jd
deleted file mode 100644
index 731aef7..0000000
--- a/docs/html/guide/developing/tools/aidl.jd
+++ /dev/null
@@ -1,465 +0,0 @@
-page.title=Android Interface Definition Language (AIDL)
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
-<h2>In this document</h2>
-<ol>
- <li><a href="#Defining">Defining an AIDL Interface</a>
- <ol>
- <li><a href="#Create">Create the .aidl file</a></li>
- <li><a href="#Implement">Implement the interface</a></li>
- <li><a href="#Expose">Expose the interface to clients</a></li>
- </ol>
- </li>
- <li><a href="#PassingObjects">Passing Objects over IPC</a></li>
- <li><a href="#Calling">Calling an IPC Method</a></li>
-</ol>
-
-<h2>See also</h2>
-<ol>
- <li><a href="{@docRoot}guide/topics/fundamentals/bound-services.html">Bound Services</a></li>
-</ol>
-
-</div>
-</div>
-
-
-<p>AIDL (Android Interface Definition Language) is similar to other IDLs you might have
-worked with. It allows you to define the programming interface that both
-the client and service agree upon in order to communicate with each other using
-interprocess communication (IPC). On Android, one process cannot normally access the
-memory of another process. So to talk, they need to decompose their objects into primitives that the
-operating system can understand, and marshall the objects across that boundary for you. The code to
-do that marshalling is tedious to write, so Android handles it for you with AIDL.</p>
-
-<p class="note"><strong>Note:</strong> Using AIDL is necessary only if you allow clients from
-different applications to access your service for IPC and want to handle multithreading in your
-service. If you do not need to perform concurrent IPC across
-different applications, you should create your interface by <a
-href="{@docRoot}guide/topics/fundamentals/bound-services.html#Binder">implementing a
-Binder</a> or, if you want to perform IPC, but do <em>not</em> need to handle multithreading,
-implement your interface <a
-href="{@docRoot}guide/topics/fundamentals/bound-services.html#Messenger">using a Messenger</a>.
-Regardless, be sure that you understand <a
-href="{@docRoot}guide/topics/fundamentals/bound-services.html">Bound Services</a> before
-implementing an AIDL.</p>
-
-<p>Before you begin designing your AIDL interface, be aware that calls to an AIDL interface are
-direct function calls. You should not make assumptions about the thread in which the call
-occurs. What happens is different depending on whether the call is from a thread in the
-local process or a remote process. Specifically:</p>
-
-<ul>
-<li>Calls made from the local process are executed in the same thread that is making the call. If
-this is your main UI thread, that thread continues to execute in the AIDL interface. If it is
-another thread, that is the one that executes your code in the service. Thus, if only local
-threads are accessing the service, you can completely control which threads are executing in it (but
-if that is the case, then you shouldn't be using AIDL at all, but should instead create the
-interface by <a href="{@docRoot}guide/topics/fundamentals/bound-services.html#Binder">implementing a
-Binder</a>).</li>
-
-<li>Calls from a remote process are dispatched from a thread pool the platform maintains inside of
-your own process. You must be prepared for incoming calls from unknown threads, with multiple calls
-happening at the same time. In other words, an implementation of an AIDL interface must be
-completely thread-safe.</li>
-
-<li>The {@code oneway} keyword modifies the behavior of remote calls. When used, a remote call does
-not block; it simply sends the transaction data and immediately returns.
-The implementation of the interface eventually receives this as a regular call from the {@link
-android.os.Binder} thread pool as a normal remote call. If {@code oneway} is used with a local call,
-there is no impact and the call is still synchronous.</li>
-</ul>
-
-
-<h2 id="Defining">Defining an AIDL Interface</h2>
-
-<p>You must define your AIDL interface in an {@code .aidl} file using the Java
-programming language syntax, then save it in the source code (in the {@code src/} directory) of both
-the application hosting the service and any other application that binds to the service.</p>
-
-<p>When you build each application that contains the {@code .aidl} file, the Android SDK tools
-generate an {@link android.os.IBinder} interface based on the {@code .aidl} file and save it in
-the project's {@code gen/} directory. The service must implement the {@link android.os.IBinder}
-interface as appropriate. The client applications can then bind to the service and call methods from
-the {@link android.os.IBinder} to perform IPC.</p>
-
-<p>To create a bounded service using AIDL, follow these steps:</p>
-<ol>
- <li><a href="#CreateAidl">Create the .aidl file</a>
- <p>This file defines the programming interface with method signatures.</p>
- </li>
- <li><a href="#ImplementTheInterface">Implement the interface</a>
- <p>The Android SDK tools generate an interface in the Java programming language, based on your
-{@code .aidl} file. This interface has an inner abstract class named {@code Stub} that extends
-{@link android.os.Binder} and implements methods from your AIDL interface. You must extend the
-{@code Stub} class and implement the methods.</p>
- </li>
- <li><a href="#ExposeTheInterface">Expose the interface to clients</a>
- <p>Implement a {@link android.app.Service Service} and override {@link
-android.app.Service#onBind onBind()} to return your implementation of the {@code Stub}
-class.</p>
- </li>
-</ol>
-
-<p class="caution"><strong>Caution:</strong> Any changes that you make to your AIDL interface after
-your first release must remain backward compatible in order to avoid breaking other applications
-that use your service. That is, because your {@code .aidl} file must be copied to other applications
-in order for them to access your service's interface, you must maintain support for the original
-interface.</p>
-
-
-<h3 id="Create">1. Create the .aidl file</h3>
-
-<p>AIDL uses a simple syntax that lets you declare an interface with one or more methods that can
-take parameters and return values. The parameters and return values can be of any type, even other
-AIDL-generated interfaces.</p>
-
-<p>You must construct the {@code .aidl} file using the Java programming language. Each {@code .aidl}
-file must define a single interface and requires only the interface declaration and method
-signatures.</p>
-
-<p>By default, AIDL supports the following data types:</p>
-
-<ul>
- <li>All primitive types in the Java programming language (such as {@code int}, {@code long},
-{@code char}, {@code boolean}, and so on)</li>
- <li>{@link java.lang.String}</li>
- <li>{@link java.lang.CharSequence}</li>
- <li>{@link java.util.List}
- <p>All elements in the {@link java.util.List} must be one of the supported data types in this
-list or one of the other AIDL-generated interfaces or parcelables you've declared. A {@link
-java.util.List} may optionally be used as a "generic" class (for example,
-<code>List<String></code>).
-The actual concrete class that the other side receives is always an {@link
-java.util.ArrayList}, although the method is generated to use the {@link
-java.util.List} interface.</p>
- </li>
- <li>{@link java.util.Map}
- <p>All elements in the {@link java.util.Map} must be one of the supported data types in this
-list or one of the other AIDL-generated interfaces or parcelables you've declared. Generic maps,
-(such as those of the form
-{@code Map<String,Integer>} are not supported. The actual concrete class that the other side
-receives is always a {@link java.util.HashMap}, although the method is generated to
-use the {@link java.util.Map} interface.</p>
- </li>
-</ul>
-
-<p>You must include an {@code import} statement for each additional type not listed above, even if
-they are defined in the same package as your interface.</p>
-
-<p>When defining your service interface, be aware that:</p>
-<ul>
- <li>Methods can take zero or more parameters, and return a value or void.</li>
- <li>All non-primitive parameters require a directional tag indicating which way the data goes.
-Either <code>in</code>, <code>out</code>, or <code>inout</code> (see the example below).
- <p>Primitives are <code>in</code> by default, and cannot be otherwise.</p>
- <p class="caution"><strong>Caution:</strong> You should limit the direction to what is truly
-needed, because marshalling parameters is expensive.</p></li>
- <li>All code comments included in the {@code .aidl} file are included in the generated {@link
-android.os.IBinder} interface (except for comments before the import and package
-statements).</li>
- <li>Only methods are supported; you cannot expose static fields in AIDL.</li>
-</ul>
-
-<p>Here is an example {@code .aidl} file:</p>
-
-<pre>
-// IRemoteService.aidl
-package com.example.android;
-
-// Declare any non-default types here with import statements
-
-/** Example service interface */
-interface IRemoteService {
- /** Request the process ID of this service, to do evil things with it. */
- int getPid();
-
- /** Demonstrates some basic types that you can use as parameters
- * and return values in AIDL.
- */
- void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
- double aDouble, String aString);
-}
-</pre>
-
-<p>Simply save your {@code .aidl} file in your project's {@code src/} directory and when you
-build your application, the SDK tools generate the {@link android.os.IBinder} interface file in your
-project's {@code gen/} directory. The generated file name matches the {@code .aidl} file name, but
-with a {@code .java} extension (for example, {@code IRemoteService.aidl} results in {@code
-IRemoteService.java}).</p>
-
-<p>If you use Eclipse, the incremental build generates the binder class almost immediately. If you
-do not use Eclipse, then the Ant tool generates the binder class next time you build your
-application—you should build your project with <code>ant debug</code> (or <code>ant
-release</code>) as soon as you're finished writing the {@code .aidl} file, so that your code can
-link against the generated class.</p>
-
-
-<h3 id="Implement">2. Implement the interface</h3>
-
-<p>When you build your application, the Android SDK tools generate a {@code .java} interface file
-named after your {@code .aidl} file. The generated interface includes a subclass named {@code Stub}
-that is an abstract implementation of its parent interface (for example, {@code
-YourInterface.Stub}) and declares all the methods from the {@code .aidl} file.</p>
-
-<p class="note"><strong>Note:</strong> {@code Stub} also
-defines a few helper methods, most notably {@code asInterface()}, which takes an {@link
-android.os.IBinder} (usually the one passed to a client's {@link
-android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback method) and
-returns an instance of the stub interface. See the section <a href="#calling">Calling an IPC
-Method</a> for more details on how to make this cast.</p>
-
-<p>To implement the interface generated from the {@code .aidl}, extend the generated {@link
-android.os.Binder} interface (for example, {@code YourInterface.Stub}) and implement the methods
-inherited from the {@code .aidl} file.</p>
-
-<p>Here is an example implementation of an interface called {@code IRemoteService} (defined by the
-{@code IRemoteService.aidl} example, above) using an anonymous instance:</p>
-
-<pre>
-private final IRemoteService.Stub mBinder = new IRemoteService.Stub() {
- public int getPid(){
- return Process.myPid();
- }
- public void basicTypes(int anInt, long aLong, boolean aBoolean,
- float aFloat, double aDouble, String aString) {
- // Does nothing
- }
-};
-</pre>
-
-<p>Now the {@code mBinder} is an instance of the {@code Stub} class (a {@link android.os.Binder}),
-which defines the RPC interface for the service. In the next step, this instance is exposed to
-clients so they can interact with the service.</p>
-
-<p>There are a few rules you should be aware of when implementing your AIDL interface: </p>
-<ul>
- <li>Incoming calls are not guaranteed to be executed on the main thread, so you need to think
-about multithreading from the start and properly build your service to be thread-safe.</li>
- <li>By default, RPC calls are synchronous. If you know that the service takes more than a few
-milliseconds to complete a request, you should not call it from the activity's main thread, because
-it might hang the application (Android might display an "Application is Not Responding"
-dialog)—you should usually call them from a separate thread in the client. </li>
- <li>No exceptions that you throw are sent back to the caller.</li>
-</ul>
-
-
-<h3 id="Expose">3. Expose the interface to clients</h3>
-
-<p>Once you've implemented the interface for your service, you need to expose it to
-clients so they can bind to it. To expose the interface
-for your service, extend {@link android.app.Service Service} and implement {@link
-android.app.Service#onBind onBind()} to return an instance of your class that implements
-the generated {@code Stub} (as discussed in the previous section). Here's an example
-service that exposes the {@code IRemoteService} example interface to clients. </p>
-
-<pre>
-public class RemoteService extends Service {
- @Override
- public void onCreate() {
- super.onCreate();
- }
-
- @Override
- public IBinder onBind(Intent intent) {
- // Return the interface
- return mBinder;
- }
-
- private final IRemoteService.Stub mBinder = new IRemoteService.Stub() {
- public int getPid(){
- return Process.myPid();
- }
- public void basicTypes(int anInt, long aLong, boolean aBoolean,
- float aFloat, double aDouble, String aString) {
- // Does nothing
- }
- };
-}
-</pre>
-
-<p>Now, when a client (such as an activity) calls {@link android.content.Context#bindService
-bindService()} to connect to this service, the client's {@link
-android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback receives the
-{@code mBinder} instance returned by the service's {@link android.app.Service#onBind onBind()}
-method.</p>
-
-<p>The client must also have access to the interface class, so if the client and service are in
-separate applications, then the client's application must have a copy of the {@code .aidl} file
-in its {@code src/} directory (which generates the {@code android.os.Binder}
-interface—providing the client access to the AIDL methods).</p>
-
-<p>When the client receives the {@link android.os.IBinder} in the {@link
-android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback, it must call
-<code><em>YourServiceInterface</em>.Stub.asInterface(service)</code> to cast the returned
-parameter to <code><em>YourServiceInterface</em></code> type. For example:</p>
-
-<pre>
-IRemoteService mIRemoteService;
-private ServiceConnection mConnection = new ServiceConnection() {
- // Called when the connection with the service is established
- public void onServiceConnected(ComponentName className, IBinder service) {
- // Following the example above for an AIDL interface,
- // this gets an instance of the IRemoteInterface, which we can use to call on the service
- mIRemoteService = IRemoteService.Stub.asInterface(service);
- }
-
- // Called when the connection with the service disconnects unexpectedly
- public void onServiceDisconnected(ComponentName className) {
- Log.e(TAG, "Service has unexpectedly disconnected");
- mIRemoteService = null;
- }
-};
-</pre>
-
-<p>For more sample code, see the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.html">{@code
-RemoteService.java}</a> class in <a
-href="{@docRoot}resources/samples/ApiDemos/index.html">ApiDemos</a>.</p>
-
-
-
-
-
-
-
-
-<h2 id="PassingObjects">Passing Objects over IPC</h2>
-
-<p>If you have a class that you would like to send from one process to another through
-an IPC interface, you can do that. However, you must ensure that the code for your class is
-available to the other side of the IPC channel and your class must support the {@link
-android.os.Parcelable} interface. Supporting the {@link android.os.Parcelable} interface is
-important because it allows the Android system to decompose objects into primitives that can be
-marshalled across processes.</p>
-
-<p>To create a class that supports the {@link android.os.Parcelable} protocol, you must do the
-following:</b>
-<ol>
-<li>Make your class implement the {@link android.os.Parcelable} interface.</li>
-<li>Implement {@link android.os.Parcelable#writeToParcel writeToParcel}, which takes the
-current state of the object and writes it to a {@link android.os.Parcel}.</li>
-<li>Add a static field called <code>CREATOR</code> to your class which is an object implementing
-the {@link android.os.Parcelable.Creator Parcelable.Creator} interface.</li>
-<li>Finally, create an {@code .aidl} file that declares your parcelable class (as shown for the
-{@code Rect.aidl} file, below).
- <p>If you are using a custom build process, do <em>not</em> add the {@code .aidl} file to your
-build. Similar to a header file in the C language, this {@code .aidl} file isn't compiled.</p></li>
-</ol>
-
-<p>AIDL uses these methods and fields in the code it generates to marshall and unmarshall
-your objects.</p>
-
-<p>For example, here is a {@code Rect.aidl} file to create a {@code Rect} class that's
-parcelable:</p>
-
-<pre>
-package android.graphics;
-
-// Declare Rect so AIDL can find it and knows that it implements
-// the parcelable protocol.
-parcelable Rect;
-</pre>
-
-<p>And here is an example of how the {@link android.graphics.Rect} class implements the
-{@link android.os.Parcelable} protocol.</p>
-
-<pre>
-import android.os.Parcel;
-import android.os.Parcelable;
-
-public final class Rect implements Parcelable {
- public int left;
- public int top;
- public int right;
- public int bottom;
-
- public static final Parcelable.Creator<Rect> CREATOR = new
-Parcelable.Creator<Rect>() {
- public Rect createFromParcel(Parcel in) {
- return new Rect(in);
- }
-
- public Rect[] newArray(int size) {
- return new Rect[size];
- }
- };
-
- public Rect() {
- }
-
- private Rect(Parcel in) {
- readFromParcel(in);
- }
-
- public void writeToParcel(Parcel out) {
- out.writeInt(left);
- out.writeInt(top);
- out.writeInt(right);
- out.writeInt(bottom);
- }
-
- public void readFromParcel(Parcel in) {
- left = in.readInt();
- top = in.readInt();
- right = in.readInt();
- bottom = in.readInt();
- }
-}
-</pre>
-
-<p>The marshalling in the {@code Rect} class is pretty simple. Take a look at the other
-methods on {@link android.os.Parcel} to see the other kinds of values you can write
-to a Parcel.</p>
-
-<p class="warning"><strong>Warning:</strong> Don't forget the security implications of receiving
-data from other processes. In this case, the {@code Rect} reads four numbers from the {@link
-android.os.Parcel}, but it is up to you to ensure that these are within the acceptable range of
-values for whatever the caller is trying to do. See <a
-href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a> for more
-information about how to keep your application secure from malware.</p>
-
-
-
-<h2 id="Calling">Calling an IPC Method</h2>
-
-<p>Here are the steps a calling class must take to call a remote interface defined with AIDL: </p>
-<ol>
- <li>Include the {@code .aidl} file in the project {@code src/} directory.</li>
- <li>Declare an instance of the {@link android.os.IBinder} interface (generated based on the
-AIDL). </li>
- <li>Implement {@link android.content.ServiceConnection ServiceConnection}. </li>
- <li>Call {@link
-android.content.Context#bindService(android.content.Intent,android.content.ServiceConnection,int)
- Context.bindService()}, passing in your {@link
-android.content.ServiceConnection} implementation. </li>
- <li>In your implementation of {@link
-android.content.ServiceConnection#onServiceConnected onServiceConnected()},
-you will receive an {@link android.os.IBinder} instance (called <code>service</code>). Call
-<code><em>YourInterfaceName</em>.Stub.asInterface((IBinder)<em>service</em>)</code> to
- cast the returned parameter to <em>YourInterface</em> type.</li>
- <li>Call the methods that you defined on your interface. You should always trap
- {@link android.os.DeadObjectException} exceptions, which are thrown when
- the connection has broken; this will be the only exception thrown by remote
- methods.</li>
- <li>To disconnect, call {@link
-android.content.Context#unbindService(android.content.ServiceConnection)
- Context.unbindService()} with the instance of your interface. </li>
-</ol>
-<p>A few comments on calling an IPC service:</p>
-<ul>
- <li>Objects are reference counted across processes. </li>
- <li>You can send anonymous objects
- as method arguments. </li>
-</ul>
-
-<p>For more information about binding to a service, read the <a
-href="{@docRoot}guide/topics/fundamentals/bound-services.html#Binding">Bound Services</a>
-document.</p>
-
-<p>Here is some sample code demonstrating calling an AIDL-created service, taken
- from the Remote Service sample in the ApiDemos project.</p>
-<p>{@sample development/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.java
- calling_a_service}</p>
diff --git a/docs/html/guide/developing/tools/android.jd b/docs/html/guide/developing/tools/android.jd
deleted file mode 100644
index 295a720..0000000
--- a/docs/html/guide/developing/tools/android.jd
+++ /dev/null
@@ -1,393 +0,0 @@
-page.title=android
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
-<p>{@code android} is an important development tool that lets you:</p>
-
- <ul>
- <li>Create, delete, and view Android Virtual Devices (AVDs). See <a href=
- "{@docRoot}guide/developing/devices/managing-avds-cmdline.html">Managing AVDs from the Command
-Line</a>.</li>
-
- <li>Create and update Android projects. See <a href=
- "{@docRoot}guide/developing/projects/projects-cmdline.html">Managing Projects from
- the Command Line</a>.</li>
-
- <li>Update your Android SDK with new platforms, add-ons, and documentation. See <a href=
- "{@docRoot}sdk/adding-components.html">Adding SDK Packages</a>.</li>
- </ul>If you are using Eclipse, the <code>android</code> tool's features are integrated
- into ADT, so you should not need to use this tool directly.
-
- <p class="note"><strong>Note:</strong> The documentation of options below is not exhaustive
-and may be out of date. For the most current list of options, execute <code>android
---help</code>.</p>
-
-
-
-
- <h2>Syntax</h2>
- <pre>android [global options] action [action options]</pre>
-
- <h3>Global Options</h3>
-
- <dl>
- <dt><code>-s</code></dt>
-
- <dd>Silent mode: only errors are printed out</dd>
-
- <dt><code>-h</code></dt>
-
- <dd>Usage help</dd>
-
- <dt><code>-v</code></dt>
-
- <dd>Verbose mode: errors, warnings and informational messages are printed.</dd>
- </dl>
-
- <h3>AVD actions and options</h3>
-
- <table>
- <tr>
- <th width="15%">Action</th>
-
- <th width="20%">Option</th>
-
- <th width="30%">Description</th>
-
- <th>Comments</th>
- </tr>
-
- <tr>
- <td rowspan="6"><code>avd</code></td>
-
- <td>None</td>
-
- <td>Launch the AVD Manager</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td rowspan="6"><code>sdk</code></td>
-
- <td>None</td>
-
- <td>Launch the Android SDK Manager</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td rowspan="6"><code>create avd</code></td>
-
- <td><code>-n <name></code></td>
-
- <td>The name for the AVD.</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-t <targetID></code></td>
-
- <td>Target ID of the system image to use with the new AVD. To obtain a list of available
- targets, use <code>android list targets</code></td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-c <path>|<size>[K|M]</code></td>
-
- <td>The path to the SD card image to use with this AVD or the size of a new SD card image to
- create for this AVD. For example, <code>-c path/to/sdcard</code> or <code>-c
- 1000M</code>.</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td><code>-f</code></td>
-
- <td>Force creation of the AVD</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td><code>-p <path></code></td>
-
- <td>Path to the location at which to create the directory for this AVD's files.</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td><code>-s <name>|<width>-<height></code></td>
-
- <td>The skin to use for this AVD, identified by name or dimensions. The <code>android</code>
- tool scans for a matching skin by name or dimension in the <code>skins/</code> directory of
- the target referenced in the <code>-t <targetID></code> argument. For example, <code>-s
- HVGA-L</code></td>
-
- <td></td>
- </tr>
-
- <tr>
- <td><code>delete avd</code></td>
-
- <td><code>-n <name></code></td>
-
- <td>The name of the AVD to delete</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td rowspan="3"><code>move avd</code></td>
-
- <td><code>-n <name></code></td>
-
- <td>The name of the AVD to move</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-p <path></code></td>
-
- <td>Path to the location at which to create the directory for this AVD's files.</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td><code>-r <new-name></code></td>
-
- <td>New name of the AVD if you want to rename it</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td><code>update avd</code></td>
-
- <td><code>-n <name></code></td>
-
- <td>The name of the AVD to move</td>
-
- <td>Required</td>
- </tr>
- </table>
-
- <h3>Project actions and options</h3>
-
- <table>
- <tr>
- <th width="15%">Action</th>
-
- <th width="20%">Option</th>
-
- <th width="30%">Description</th>
-
- <th>Comments</th>
- </tr>
-
- <tr>
- <td rowspan="5"><code>create project</code></td>
-
- <td><code>-n <name></code></td>
-
- <td>The name for the project</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-t <targetID></code></td>
-
- <td>Target ID of the system image to use with the new AVD. To obtain a list of available
- targets, use <code>android list targets</code></td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-k <path>|<size>[K|M]</code></td>
-
- <td>Package namespace</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-a</code></td>
-
- <td>Name for the default Activity class</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-p <path></code></td>
-
- <td>Location of your project directory</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td rowspan="5"><code>update project</code></td>
-
- <td><code>-n <name></code></td>
-
- <td>The name of the project to update</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td><code>-p <path></code></td>
-
- <td>Location path of the project</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-l <library path></code></td>
-
- <td>Location path of an Android Library to add, relative to the main project</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td><code>-s <subprojects></code></td>
-
- <td>Update any projects in subfolders such as test projects</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td><code>-t <targetID></code></td>
-
- <td>Target id to set for the project</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td rowspan="3"><code>create-test-project</code></td>
-
- <td><code>-n <name></code></td>
-
- <td>The name of the project</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td><code>-p <path></code></td>
-
- <td>Location path of the project</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-m <main></code></td>
-
- <td>The name of the project</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td rowspan="2"><code>update-test-project</code></td>
-
- <td><code>-p <path></code></td>
-
- <td>Location path of the project to test, relative to the new project</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-m <main></code></td>
-
- <td>The main class of the project to test</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td rowspan="4"><code>create-lib-project</code></td>
-
- <td><code>-k <packageName></code></td>
-
- <td>(Required) Package name of the library project</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-p <path></code></td>
-
- <td>Location path of the project</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-t <targetID></code></td>
-
- <td>Target ID of the library project</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-n <name></code></td>
-
- <td>The name of the project</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td rowspan="3"><code>update-lib-project</code></td>
-
- <td><code>-p <path></code></td>
-
- <td>Location path of the project</td>
-
- <td>Required</td>
- </tr>
-
- <tr>
- <td><code>-l <libraryPath></code></td>
-
- <td>Location path of an Android Library to add, relative to the main project</td>
-
- <td></td>
- </tr>
-
- <tr>
- <td><code>-t <name></code></td>
-
- <td>Target ID of the library project</td>
-
- <td></td>
- </tr>
- </table>
-
- <h3>Update actions</h3>
- <dl>
- <dt><code>update adb</code></dt>
- <dd>Updates adb to support the USB devices declared in the SDK add-ons.</dd>
-
- <dt><code>update sdk</code></dt>
- <dd>Updates the SDK by suggesting new platforms to install if available.</dd>
diff --git a/docs/html/guide/developing/tools/avd.html b/docs/html/guide/developing/tools/avd.html
deleted file mode 100644
index c8455db..0000000
--- a/docs/html/guide/developing/tools/avd.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/devices/index.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should be redirected. Please <a
-href="http://developer.android.com/guide/developing/devices/index.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/bmgr.jd b/docs/html/guide/developing/tools/bmgr.jd
deleted file mode 100644
index d63dcf2..0000000
--- a/docs/html/guide/developing/tools/bmgr.jd
+++ /dev/null
@@ -1,193 +0,0 @@
-page.title=bmgr
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
-<!-- quickview box content here -->
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>bmgr quickview</h2>
-<p><code>bmgr</code> lets you control the backup/restore system on an Android device.
-
- <h2>In this document</h2>
- <ol>
-<li><a href="#backup">Forcing a Backup Operation</a></li>
-<li><a href="#restore">Forcing a Restore Operation</a></li>
-<li><a href="#other">Other Commands</a></li>
- </ol>
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/topics/data/backup.html">Data Backup</a></li>
- </ol>
-
-</div>
-</div>
-
-<!-- normal page content here -->
-
-<p><code>bmgr</code> is a shell tool you can use to interact with the Backup Manager
-on Android devices supporting API Level 8 or greater. It provides commands to induce backup
-and restore operations so that you don't need to repeatedly wipe data or take similar
-intrusive steps in order to test your application's backup agent. These commands are
-accessed via the <a href="{@docRoot}guide/developing/tools/adb.html">adb</a> shell.
-
-<p>For information about adding support for backup in your application, read <a
-href="{@docRoot}guide/topics/data/backup.html">Data Backup</a>, which includes a guide to testing
-your application using {@code bmgr}.</p>
-
-
-<h2 id="backup">Forcing a Backup Operation</h2>
-
-<p>Normally, your application must notify the Backup Manager when its data has changed, via {@link
-android.app.backup.BackupManager#dataChanged()}. The Backup Manager will then invoke your
-backup agent's {@link
-android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor,BackupDataOutput,ParcelFileDescriptor)
-onBackup()} implementation at some time in the future. However, instead of calling {@link
-android.app.backup.BackupManager#dataChanged()}, you can invoke a backup request from the command
-line by running the <code>bmgr backup</code> command:
-
- <pre class="no-pretty-print">adb shell bmgr backup <em><package></em></pre>
-
-<p><code><em><package></em></code> is the formal package name of the application you wish to
-schedule for
-backup. When you execute this backup command, your application's backup agent will be invoked to
-perform a backup operation at some time in the future (via your {@link
-android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor,BackupDataOutput,ParcelFileDescriptor)
-onBackup()} method), though there is no guarantee when it will occur. However, you can force all
-pending backup operations to run immediately by using the <code>bmgr run</code> command:
-
- <pre class="no-pretty-print">adb shell bmgr run</pre>
-
-<p>This causes a backup pass to execute immediately, invoking the backup agents of all applications
-that had previously called {@link android.app.backup.BackupManager#dataChanged()} since the
-last backup operation, plus any applications which had been manually scheduled for
-backup via <code>bmgr backup</code>.
-
-
-
-<h2 id="restore">Forcing a Restore Operation</h2>
-
-<p>Unlike backup operations, which are batched together and run on an occasional basis, restore
-operations execute immediately. The Backup Manager currently provides two kinds of restore
-operations. The first kind restores an entire device with the data that has been backed up. This
-is typically performed only when a device is first provisioned (to replicate settings and other
-saved state from the user's previous device) and is an operation that only the system can
-perform. The second kind of restore operation restores
-a single application to its "active" data set; that is, the application will abandon its current
-data and revert to the last-known-good data that is held in the current backup image. You can
-invoke this second restore operation with the {@link
-android.app.backup.BackupManager#requestRestore(RestoreObserver) requestRestore()} method. The
-Backup Manager will then invoke your backup agent's {@link
-android.app.backup.BackupAgent#onRestore(BackupDataInput,int,ParcelFileDescriptor)
-onRestore()} implementation.
-
-<p>While testing your application, you can immediately invoke the restore operation (bypassing the
-{@link android.app.backup.BackupManager#requestRestore(RestoreObserver) requestRestore()} method)
-for your application by using the <code>bmgr restore</code> command:
-
- <pre class="no-pretty-print">adb shell bmgr restore <em><package></em></pre>
-
-<p><code><em><package></em></code> is the formal Java-style package name of the application
-participating in the backup/restore mechanism, which you would like to restore. The Backup
-Manager will immediately instantiate the application's backup agent and invoke it for restore. This
-will happen even if your application is not currently running.
-
-
-
-
-
-<h2 id="other">Other Commands</h2>
-
-<h3>Wiping data</h3>
-
-<p>The data for a single application can be erased from the active data set on demand. This is
-very useful while you're developing a backup agent, in case bugs lead you to write corrupt data
-or saved state information. You can wipe an application's data with the <code>bmgr wipe</code>
-command:
-
- <pre class="no-pretty-print">adb shell bmgr wipe <em><package></em></pre>
-
-<p><code><em><package></em></code> is the formal package name of the application whose data
-you wish to
-erase. The next backup operation that the application's agent processes will look as
-though the application had never backed anything up before.
-
-
-<h3>Enabling and disabling backup</h3>
-
-<p>You can see whether the Backup Manager is operational at all with the <code>bmgr
-enabled</code> command:
-
- <pre class="no-pretty-print">adb shell bmgr enabled</pre>
-
-<p>This might be useful if your application's backup agent is never being invoked for backup, to
-verify whether the operating system thinks it should be performing such operations at all.</p>
-
-<p>You can also directly disable or enable the Backup Manager with this command:
-
- <pre class="no-pretty-print">adb shell bmgr enable <em><boolean></em></pre>
-
-<p><code><em><boolean></em></code> is either <code>true</code> or <code>false</code>.
-This is equivalent to disabling or enabling backup in the device's main Settings UI.</p>
-
-<p class="warning"><strong>Warning!</strong> When backup is disabled, the current backup transport
-will explicitly wipe
-the entire active data set from its backend storage. This is so that when a user says
-they do <em>not</em> want their data backed up, the Backup Manager respects that wish. No further
-data will be saved from the device, and no restore operations will be possible, unless the Backup
-Manager is re-enabled (either through Settings or through the above <code>bmgr</code> command).
-
-
-
-
-<!-- The following is not useful to applications, but may be some useful information some day...
-
-
-<h2 id="transports">Applying a Backup Transport</h2>
-
-<p>A "backup transport" is the code module responsible for moving backup and restore data
-to and from some storage location. A device can have multipe transports installed, though only
-one is active at any given time. Transports are identified by name. You can see what
-transports are available on your device or emulator by running the
-<code>bmgr list transports</code> command:
-
- <pre class="no-pretty-print">adb shell bmgr list transports</pre>
-
-<p>The output of this command is a list of the transports available on the device. The currently
-active transport is flagged with a <code>*</code> character. Transport names may look like
-component names (for example, <code>android/com.android.internal.backup.LocalTransport</code>),
-but they need not be, and the strings are never used as direct class references. The use of
-a component-like naming scheme is simply for purposes of preventing name collisions.
-
-<p>You can change which transport is currently active from the command line as well:
-
- <pre class="no-pretty-print">adb shell bmgr transport <em><name></em></pre>
-
-<p><code><em><name></em></code> is one of the names as printed by the <code>bmgr list
-transports</code>
-command. From this point forward, backup and restore operations will be directed through the
-newly-selected transport. Backup state tracking is managed separately for each transport, so
-switching back and forth between them will not corrupt the saved state.
-
-
-
-
-<h2 id="restoresets">Viewing Restore Sets</h2>
-
-<p>All of the application data that a device has written to its backup transport is tracked
-as a group that is collectively called a "restore set," because each data set is
-most often manipulated during a restore operation. When a device is provisioned for the first
-time, a new restore set is established. You can get a listing of all the restore sets available to
-the current transport by running the <code>bmgr list sets</code> command:
-
- <pre class="no-pretty-print">adb shell bmgr list sets</pre>
-
-<p>The output is a listing of available restore sets, one per line. The first item on each line is
-a token (a hexadecimal value that identifies the restore set to the transport). Following
-the token is a string that briefly identifies the restore set.
-Only the token is used within the backup and restore mechanism.
-
-
--->
diff --git a/docs/html/guide/developing/tools/ddms.html b/docs/html/guide/developing/tools/ddms.html
deleted file mode 100644
index 052ccc9..0000000
--- a/docs/html/guide/developing/tools/ddms.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/debugging/ddms.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should be redirected. Please <a
-href="http://developer.android.com/guide/developing/debugging/ddms.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/dmtracedump.jd b/docs/html/guide/developing/tools/dmtracedump.jd
deleted file mode 100644
index cb9ad26..0000000
--- a/docs/html/guide/developing/tools/dmtracedump.jd
+++ /dev/null
@@ -1,66 +0,0 @@
-page.title=dmtracedump
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
-
- <p><code>dmtracedump</code> is a tool that gives you an alternate way of generating
- graphical call-stack diagrams from trace log files (instead of using Traceview).</p>
-
- <p>This document is a reference to the available command line options. For more information on generating trace
- logs, see <a href="{@docRoot}guide/developing/debugging/debugging-tracing.html">Profiling with
- Traceview and dmtracedump</a>.</p>
-
- <p>The usage for <code>dmtracedump</code> is:</p>
- <pre>
-dmtracedump [-ho] [-s sortable] [-d trace-base-name] [-g outfile] <trace-base-name>
-</pre>
-
- <p>The tool then loads trace log data from <code><trace-base-name>.data</code> and
- <trace-base-name>.key. The table below lists the options for dmtracedump.</p>
-
- <table>
- <tr>
- <th>Option</th>
-
- <th>Description</th>
- </tr>
-
- <tr>
- <td><nobr><code>-d <em><trace-base-name></em></code></nobr></td>
-
- <td>Diff with this trace name</td>
- </tr>
-
- <tr>
- <td><code>-g <em><outfile></em></code></td>
-
- <td>Generate output to <outfile></td>
- </tr>
-
- <tr>
- <td><code>-h</code></td>
-
- <td>Turn on HTML output</td>
- </tr>
-
- <tr>
- <td><code>-o</code></td>
-
- <td>Dump the trace file instead of profiling</td>
- </tr>
-
- <tr>
- <td><code>-d <em><trace-base-name></em></code></td>
-
- <td>URL base to the location of the sortable javascript file</td>
- </tr>
-
- <tr>
- <td><code>-t <percent></code></td>
-
- <td>Minimum threshold for including child nodes in the graph (child's inclusive time as a
- percentage of parent inclusive time). If this option is not used, the default threshold is
- 20%.</td>
- </tr>
- </table>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/emulator.jd b/docs/html/guide/developing/tools/emulator.jd
deleted file mode 100644
index 21d4263..0000000
--- a/docs/html/guide/developing/tools/emulator.jd
+++ /dev/null
@@ -1,581 +0,0 @@
-page.title=Android Emulator
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#KeyMapping">Keyboard Commands</a></li>
- <li><a href="#startup-options">Command Line Parameters</a></li>
- </ol>
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/developing/devices/emulator.html">Using the Android Emulator</a></li>
- <li><a href="{@docRoot}guide/developing/devices/index.html">Managing Virtual Devices</a></li>
- </ol>
-
-</div>
-</div>
-
-
-<p>The Android SDK includes a mobile device emulator — a virtual mobile device
-that runs on your computer. The emulator lets you develop and test
-Android applications without using a physical device.</p>
-
-<p>This document is a reference to the available command line options and the keyboard mapping to
-device keys.
-For a complete guide to using the Android Emulator, see
-<a href="{@docRoot}guide/developing/devices/emulator.html">Using the Android Emulator</a>.
-
-
-<h2 id="KeyMapping">Keyboard Commands</h2>
-
-<p>Table 1 summarizes the mappings between the emulator keys and the keys of your keyboard.</p>
-
-<p class="table-caption"><strong>Table 1.</strong> Emulator keyboard mapping</p>
-<table border="0" style="clear:left;">
- <tr>
- <th>Emulated Device Key </th>
- <th>Keyboard Key </th>
- </tr>
- <tr>
- <td>Home</td>
- <td>HOME</td>
- </tr>
- <tr>
- <td>Menu (left softkey)</td>
- <td>F2 <em>or</em> Page-up button</td>
- </tr>
- <tr>
- <td>Star (right softkey)</td>
- <td>Shift-F2 <em>or </em>Page Down</td>
- </tr>
- <tr>
- <td>Back</td>
- <td>ESC</td>
- </tr>
- <tr>
- <td>Call/dial button </td>
- <td>F3</td>
- </tr>
- <tr>
- <td>Hangup/end call button</td>
- <td>F4</td>
- </tr>
- <tr>
- <td>Search</td>
- <td>F5 </td>
- </tr>
- <tr>
- <td>Power button</td>
- <td>F7 </td>
- </tr>
- <tr>
- <td>Audio volume up button</td>
- <td>KEYPAD_PLUS, Ctrl-F5</td>
- </tr>
-
- <tr>
- <td>Audio volume down button</td>
- <td>KEYPAD_MINUS, Ctrl-F6</td>
- </tr>
- <tr>
- <td>Camera button</td>
- <td>Ctrl-KEYPAD_5, Ctrl-F3</td>
- </tr>
- <tr>
- <td>Switch to previous layout orientation (for example, portrait, landscape)</td>
- <td>KEYPAD_7, Ctrl-F11</td>
- </tr>
- <tr>
- <td>Switch to next layout orientation (for example, portrait, landscape)</td>
- <td>KEYPAD_9, Ctrl-F12</td>
- </tr>
- <tr>
- <td>Toggle cell networking on/off</td>
- <td>F8</td>
- </tr>
- <tr>
- <td>Toggle code profiling</td>
- <td>F9 (only with <code>-trace</code> startup option)</td>
- </tr>
- <tr>
- <td>Toggle fullscreen mode</td>
- <td>Alt-Enter</td>
- </tr>
- <tr>
- <td>Toggle trackball mode</td>
- <td>F6</td>
- </tr>
- <tr>
- <td>Enter trackball mode temporarily (while key is pressed)</td>
- <td>Delete</td>
- </tr>
- <tr>
- <td>DPad left/up/right/down</td>
- <td>KEYPAD_4/8/6/2</td>
- </tr>
- <tr>
- <td>DPad center click</td>
- <td>KEYPAD_5</td>
- </tr>
- <tr>
- <td>Onion alpha increase/decrease</td>
- <td>KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/)</td>
- </tr>
-</table>
-
-
-<h2 id="startup-options">Command Line Parameters</h2>
-
-<p>The emulator supports a variety of options that you can specify
-when launching the emulator, to control its appearance or behavior.
-Here's the command-line syntax of the options available to the {@code emulator} program:</p>
-
-<pre>emulator -avd <avd_name> [-<option> [<value>]] ... [-<qemu args>]</pre>
-
-<p class="table-caption"><strong>Table 2.</strong> Emulator command line parameters</p>
-<table>
-<tr>
- <th width="10%" >Category</th>
- <th width="20%" >Option</th>
- <th width="30%" >Description</th>
- <th width="40%" >Comments</th>
-</tr>
-
-<tr>
- <td>AVD</td>
- <td><code>-avd <avd_name></code> or <br>
- <code>@<avd_name></code></td>
- <td><strong>Required</strong>. Specifies the AVD to load for this emulator
- instance.</td>
- <td>You must create an AVD configuration before launching the emulator. For
- information, see <a href="{@docRoot}guide/developing/devices/managing-avds.html">Managing
- AVDs with AVD Manager</a>.</td>
-<tr>
- <td rowspan="7">Disk Images</td>
- <td><code>-cache <filepath></code></td>
- <td>Use <filepath> as the working cache partition image. </td>
- <td>An absolute or relative path to the current working directory.
- If no cache file is specified, the emulator's default behavior is to use a temporary file instead.
- <p>For more information on disk images, use <code>-help-disk-images</code>.</p>
-</td></tr>
-<tr>
- <td><code>-data <filepath></code></td>
- <td>Use {@code <filepath>} as the working user-data disk image. </td>
- <td>Optionally, you can specify a path relative to the current working directory.
- If <code>-data</code> is not used, the emulator looks for a file named {@code userdata-qemu.img}
- in the storage area of the AVD being used (see <code>-avd</code>).
-</td></tr>
-<!--
-<tr>
- <td><code>-datadir <dir></code></td>
- <td>Search for the user-data disk image specified in <code>-data</code> in <dir></td>
- <td><code><dir></code> is a path relative to the current working directory.
-
-<p>If you do not specify <code>-datadir</code>, the emulator looks for the user-data image
-in the storage area of the AVD being used (see <code>-avd</code>)</p><p>For more information
-on disk images, use <code>-help-disk-images</code>.</p>
-</td></tr>
--->
-<!--
-<tr>
- <td><code>-image <filepath></code></td>
- <td>Use <filepath> as the system image.</td>
- <td>Optionally, you can specify a path relative to the current working directory.
- Default is <system>/system.img.</td>
-</tr>
--->
-<tr>
- <td><code>-initdata <filepath></code></td>
- <td>When resetting the user-data image (through <code>-wipe-data</code>), copy the contents
- of this file to the new user-data disk image. By default, the emulator copies the <code><system>/userdata.img</code>.</td>
- <td>Optionally, you can specify a path relative to the current working directory. See also <code>-wipe-data</code>.
- <p>For more information on disk images, use <code>-help-disk-images</code>.</p></td>
-</tr>
-<tr>
- <td><code>-nocache</code></td>
- <td>Start the emulator without a cache partition.</td>
- <td>See also <code>-cache <file></code>.</td>
-</tr>
-<tr>
- <td><code>-ramdisk <filepath></code></td>
- <td>Use <filepath> as the ramdisk image.</td>
- <td>Default value is <code><system>/ramdisk.img</code>.
- <p>Optionally, you can specify a path relative to the current working directory.
- For more information on disk images, use <code>-help-disk-images</code>.</p>
-</td>
-</tr>
-<tr>
- <td><code>-sdcard <filepath></code></td>
- <td>Use <file> as the SD card image.</td>
- <td>Default value is <code><system>/sdcard.img</code>.
- <p>Optionally, you can specify a path relative to the current working directory. For more information on disk images, use <code>-help-disk-images</code>.</p>
-</td>
-</tr>
-<!--
-<tr>
- <td><code>-system <dirpath></code></td>
- <td>Search for system, ramdisk and user data images in <dir>.</td>
- <td><code><dir></code> is a directory path relative to the current
- working directory.</td>
-</tr>
--->
-<tr>
- <td><code>-wipe-data</code></td>
- <td>Reset the current user-data disk image (that is, the file specified by <code>-datadir</code> and
- <code>-data</code>, or the default file). The emulator deletes all data from the user data image file,
- then copies the contents of the file at <code>-inidata</code> data to the image file before starting.
- </td>
- <td>See also <code>-initdata</code>.
- <p>For more information on disk images, use <code>-help-disk-images</code>.</p>
-</td>
-</tr>
-<tr>
- <td rowspan="9">Debug</td>
- <td><code>-debug <tags></code></td>
- <td>Enable/disable debug messages for the specified debug tags.</td>
- <td><code><tags></code> is a space/comma/column-separated list of debug component names.
- Use <code>-help-debug-tags</code> to print a list of debug component names that you can use. </td>
-</tr>
-<tr>
- <td><code>-debug-<tag></code></td>
- <td>Enable/disable debug messages for the specified debug tag.</td>
- <td rowspan="2">Use <code>-help-debug-tags</code> to print a list of debug component names that you can use in <code><tag></code>. </td>
-</tr>
-<tr>
- <td><code>-debug-no-<tag></code></td>
- <td>Disable debug messages for the specified debug tag.</td>
-</tr>
-<tr>
- <td><code>-logcat <logtags></code></td>
- <td>Enable logcat output with given tags.</td>
- <td>If the environment variable ANDROID_LOG_TAGS is defined and not
- empty, its value will be used to enable logcat output by default.</td>
-</tr>
-<tr>
- <td><code>-shell</code></td>
- <td>Create a root shell console on the current terminal.</td>
- <td>You can use this command even if the adb daemon in the emulated system is broken.
- Pressing Ctrl-c from the shell stops the emulator instead of the shell.</td>
-</tr>
-<tr>
- <td><code>-shell-serial <device></code></td>
- <td>Enable the root shell (as in <code>-shell</code> and specify the QEMU character
- device to use for communication with the shell.</td>
- <td><device> must be a QEMU device type. See the documentation for '-serial <em>dev</em>' at
- <a href="http://wiki.qemu.org/download/qemu-doc.html">http://wiki.qemu.org/download/qemu-doc.html</a>
- for a list of device types.
-
-<p>Here are some examples: </p>
-<ul>
- <li><code>-shell-serial stdio</code> is identical to <code>-shell</code></li>
- <li><code>-shell-serial tcp::4444,server,nowait</code> lets you communicate with the shell over TCP port 4444</li>
- <li><code>-shell-serial fdpair:3:6</code> lets a parent process communicate with the shell using fds 3 (in) and 6 (out)</li>
- <li><code>-shell-serial fdpair:0:1</code> uses the normal stdin and stdout fds, except that QEMU won't tty-cook the data.</li>
- </ul>
-</td>
-</tr>
-<tr>
- <td><code>-show-kernel <name></code></td>
- <td>Display kernel messages.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-trace <name></code></td>
- <td>Enable code profiling (press F9 to start), written to a specified file.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-verbose</code></td>
- <td>Enable verbose output.</td>
- <td>Equivalent to <code>-debug-init</code>.
-<p>You can define the default verbose output options used by emulator instances in the Android environment variable
-ANDROID_VERBOSE. Define the options you want to use in a comma-delimited list, specifying only the stem of each option:
-<code>-debug-<tags>.</code> </p>
-<p>Here's an example showing ANDROID_VERBOSE defined with the <code>-debug-init</code> and <code>-debug-modem</code> options:
-<p><code>ANDROID_VERBOSE=init,modem</code></p>
-<p>For more information about debug tags, use <code><-help-debug-tags></code>.</p>
-</td>
-</tr>
-<tr>
- <td rowspan="6">Media</td>
- <td><code>-audio <backend></code></td>
- <td>Use the specified audio backend.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-audio-in <backend></code></td>
- <td>Use the specified audio-input backend.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-audio-out <backend></code></td>
- <td>Use the specified audio-output backend.</td>
- <td> </td>
-</tr>
-<!--<tr>
- <td><code>-mic <device or file></code></td>
- <td>Use device or WAV file for audio input.</td>
- <td> </td>
-</tr>
--->
-<tr>
- <td><code>-noaudio</code></td>
- <td>Disable audio support in the current emulator instance.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-radio <device></code></td>
- <td>Redirect radio modem interface to a host character device.</td>
- <td> </td></tr>
-<tr>
- <td><code>-useaudio</code></td>
- <td>Enable audio support in the current emulator instance.</td>
- <td>Enabled by default. </td>
-</tr>
-
-<tr>
- <td rowspan="7">Network</td>
- <td><code>-dns-server <servers></code></td>
- <td>Use the specified DNS server(s). </td>
- <td>The value of <code><servers></code> must be a comma-separated list of up to 4 DNS server names or
- IP addresses.</td>
-</tr>
-<tr>
- <td><code>-http-proxy <proxy></code></td>
- <td>Make all TCP connections through a specified HTTP/HTTPS proxy</td>
- <td>The value of <code><proxy></code> can be one of the following:<br>
- <code>http://<server>:<port></code><br>
- <code>http://<username>:<password>@<server>:<port></code>
- <p>The <code>http://</code> prefix can be omitted. If the <code>-http-proxy <proxy></code> command is not supplied,
- the emulator looks up the <code>http_proxy</code> environment variable and automatically uses any value matching
- the <code><proxy></code> format described above.</p></td>
-</tr>
-<tr>
- <td><code>-netdelay <delay></code></td>
- <td>Set network latency emulation to <delay>.</td>
- <td>Default value is <code>none</code>. See the table in
- <a href="{@docRoot}guide/developing/devices/emulator.html#netdelay">Network Delay Emulation</a>
- for supported <code><delay></code> values. </td>
-</tr>
-<tr>
- <td><code>-netfast</code></td>
- <td>Shortcut for <code>-netspeed full -netdelay none</code></td>
- <td> </td></tr>
-<tr>
- <td><code>-netspeed <speed></code></td>
- <td>Set network speed emulation to <speed>.</td>
- <td>Default value is <code>full</code>. See the table in
- <a href="{@docRoot}guide/developing/devices/emulator.html#netspeed">Network Speed Emulation</a> for
- supported <code><speed></code> values. </td>
-</tr>
-<tr>
- <td><code>-port <port></code></td>
- <td>Set the console port number for this emulator instance to <code><port></code>.</td>
- <td>The console port number must be an even integer between 5554 and 5584, inclusive. <code><port></code>+1
- must also be free and will be reserved for ADB.</td>
-</tr>
-<tr>
- <td><code>-report-console <socket></code></td>
- <td>Report the assigned console port for this emulator instance to a remote third party
- before starting the emulation. </td>
- <td><code><socket></code> must use one of these formats:
-
-<p><code>tcp:<port>[,server][,max=<seconds>]</code></br>
-<code>unix:<port>[,server][,max=<seconds>]</code></p>
-
-<p>Use <code>-help-report-console</code></p> to view more information about this topic. </td>
-</tr>
-<tr>
- <td rowspan="10">System</td>
- <td><code>-cpu-delay <delay></code></td>
- <td>Slow down emulated CPU speed by <delay> </td>
- <td>Supported values for <delay> are integers between 0 and 1000.
-
-<p>Note that the <delay> does not correlate to clock speed or other absolute metrics
-— it simply represents an abstract, relative delay factor applied non-deterministically
-in the emulator. Effective performance does not always
-scale in direct relationship with <delay> values.</p>
-</td>
-</tr>
-<tr>
- <td><code>-gps <device></code></td>
- <td>Redirect NMEA GPS to character device.</td>
- <td>Use this command to emulate an NMEA-compatible GPS unit connected to
- an external character device or socket. The format of <code><device></code> must be QEMU-specific
- serial device specification. See the documentation for 'serial -dev' at
- <a href="http://wiki.qemu.org/download/qemu-doc.html">http://wiki.qemu.org/download/qemu-doc.html</a>.
-</td>
-</tr>
-<tr>
- <td><code>-nojni</code></td>
- <td>Disable JNI checks in the Dalvik runtime.</td><td> </td></tr>
-<tr>
- <td><code>-qemu</code></td>
- <td>Pass arguments to the qemu emulator software.</td>
- <td><p class="caution"><strong>Important:</strong> When using this option, make sure it is the
- <em>last option</em> specified, since all options after it are interpretted as qemu-specific
- options.</p></td></tr>
-<tr>
- <td><code>-qemu -enable-kvm</code></td>
- <td>Enable KVM acceleration of the emulator virtual machine.</td>
- <td>This option is only effective when your system is set up to use
- <a href="{@docRoot}guide/developing/devices/emulator.html#vm-linux">KVM-based VM acceleration</a>.
- You can optionally specify a memory size ({@code -m <size>}) for the VM, which should match
- your emulator's memory size:</p>
- {@code -qemu -m 512 -enable-kvm}<br>
- {@code -qemu -m 1024 -enable-kvm}
- </td></tr>
-<tr>
- <td><code>-qemu -h</code></td>
- <td>Display qemu help.</td>
- <td></td></tr>
-<tr>
- <td><code>-gpu on</code></td>
- <td>Turn on graphics acceleration for the emulator.</td>
- <td>This option is only available for emulators using a system image with API Level 15, revision 3
- and higher. For more information, see
- <a href="{@docRoot}guide/developing/devices/emulator.html#accel-graphics">Using the Android
- Emulator</a>.</td></tr>
-<tr>
- <td><code>-radio <device></code></td>
- <td>Redirect radio mode to the specified character device.</td>
- <td>The format of <code><device></code> must be QEMU-specific
- serial device specification. See the documentation for 'serial -dev' at
-<a href="http://wiki.qemu.org/download/qemu-doc.html">http://wiki.qemu.org/download/qemu-doc.html</a>.
-</td>
-</tr>
-<tr>
- <td><code>-timezone <timezone></code></td>
- <td>Set the timezone for the emulated device to <timezone>, instead of the host's timezone.</td>
- <td><code><timezone></code> must be specified in zoneinfo format. For example:
-<p>"America/Los_Angeles"<br>
-"Europe/Paris"</p>
-</td>
-</tr>
-<tr>
- <td><code>-version</code></td>
- <td>Display the emulator's version number.</td>
- <td> </td>
-</tr>
-<tr>
- <td rowspan="12">UI</td>
- <td><code>-dpi-device <dpi></code></td>
- <td>Scale the resolution of the emulator to match the screen size
- of a physical device.</td>
- <td>The default value is 165. See also <code>-scale</code>.</td>
-</tr>
-<tr>
- <td><code>-no-boot-anim</code></td>
- <td>Disable the boot animation during emulator startup.</td>
- <td>Disabling the boot animation can speed the startup time for the emulator.</td>
-</tr>
-<tr>
- <td><code>-no-window</code></td>
- <td>Disable the emulator's graphical window display.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-scale <scale></code></td>
- <td>Scale the emulator window. </td>
- <td><code><scale></code> is a number between 0.1 and 3 that represents the desired scaling factor. You can
- also specify scale as a DPI value if you add the suffix "dpi" to the scale value. A value of "auto"
- tells the emulator to select the best window size.</td>
-</tr>
-<tr>
- <td><code>-raw-keys</code></td>
- <td>Disable Unicode keyboard reverse-mapping.</td>
- <td> </td></tr>
-<tr>
- <td><code>-noskin</code></td>
- <td>Don't use any emulator skin.</td>
- <td> </td></tr>
-<tr>
- <td><code>-keyset <file></code></td>
- <td>Use the specified keyset file instead of the default.</td>
- <td>The keyset file defines the list of key bindings between the emulator and the host keyboard.
- For more information, use <code>-help-keyset</code> to print information about this topic.
-</td>
-</tr>
-<tr>
- <td><code>-onion <image></code></td>
- <td>Use overlay image over screen.</td>
- <td>No support for JPEG. Only PNG is supported.</td></tr>
-<tr>
- <td><code>-onion-alpha <percent></code></td>
- <td>Specify onion skin translucency value (as percent).
- <td>Default is 50.</td>
-</tr>
-<tr>
- <td><code>-onion-rotation <position></code></td>
- <td>Specify onion skin rotation.
- <td><code><position></code> must be one of the values 0, 1, 2, 3.</td>
-</tr>
-<tr>
- <td><code>-skin <skinID></code></td>
- <td>This emulator option is deprecated. </td>
- <td>Please set skin options using AVDs, rather than by using this emulator
-option. Using this option may yield unexpected and in some cases misleading
-results, since the density with which to render the skin may not be defined.
-AVDs let you associate each skin with a default density and override the default
-as needed. For more information, see <a
-href="{@docRoot}guide/developing/devices/managing-avds.html">Managing Virtual Devices
-with AVD Manager</a>.
-</td>
-</tr>
-<tr>
- <td><code>-skindir <dir></code></td>
- <td>This emulator option is deprecated. </td>
- <td>See comments for <code>-skin</code>, above.</td>
-</tr>
-<tr>
- <td rowspan="9">Help</td>
- <td><code>-help</code></td>
- <td>Print a list of all emulator options.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-help-all</code></td>
- <td>Print help for all startup options.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-help-<option></code></td>
- <td>Print help for a specific startup option.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-help-debug-tags</code></td>
- <td>Print a list of all tags for <code>-debug <tags></code>.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-help-disk-images</code></td>
- <td>Print help for using emulator disk images.</td>
- <td> </td>
- </tr>
-<tr>
- <td><code>-help-environment</code></td>
- <td>Print help for emulator environment variables.</td>
- <td> </td>s
-</tr><tr>
- <td><code>-help-keys</code></td>
- <td>Print the current mapping of keys.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-help-keyset-file</code></td>
- <td>Print help for defining a custom key mappings file.</td>
- <td> </td>
-</tr>
-<tr>
- <td><code>-help-virtual-device</code></td>
- <td>Print help for Android Virtual Device usage.</td>
- <td> </td>
-</tr>
-</table>
diff --git a/docs/html/guide/developing/tools/hierarchy-viewer.jd b/docs/html/guide/developing/tools/hierarchy-viewer.jd
deleted file mode 100644
index 3d3191b..0000000
--- a/docs/html/guide/developing/tools/hierarchy-viewer.jd
+++ /dev/null
@@ -1,18 +0,0 @@
-page.title=Hierarchy Viewer
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
-<p>Hierarchy Viewer allows you to debug and optimize your user
-interface. It provides a visual representation of the layout's View hierarchy
-(the Layout View) and a magnified inspector of the display (the Pixel Perfect View).
-</p>
-
-<p>To start Hierarchy Viewer, enter the following command from the SDK <code>tools/</code> directory:</p>
- <pre>hierarchyviewer</pre>
-</ol>
-
-<p>For more information on how to use Hierarchy Viewer, see
-<a href="{@docRoot}guide/developing/debugging/debugging-ui.html">Debugging and Profiling UIs</a>
-</p>
-
diff --git a/docs/html/guide/developing/tools/index.jd b/docs/html/guide/developing/tools/index.jd
deleted file mode 100644
index 5e9f686..0000000
--- a/docs/html/guide/developing/tools/index.jd
+++ /dev/null
@@ -1,85 +0,0 @@
-page.title=Tools
-@jd:body
-
-<img src="{@docRoot}assets/images/android_wrench.png" alt="" align="right">
-
-<p>The Android SDK includes a variety of tools that help you develop mobile
-applications for the Android platform. The tools are classified into two groups: SDK tools
-and platform tools. SDK tools are platform independent and are required no matter which
-Android platform you are developing on. Platform tools are customized to support the features of the
-latest Android platform.</p>
-
-<h2 id="tools-sdk">SDK Tools</h2>
-<p>The SDK tools are installed with the SDK starter package and are periodically updated.
-The SDK tools are required if you are developing Android applications. The most important SDK tools
-include the Android SDK Manager (<code>android sdk</code>), the AVD Manager (<code>android
-avd</code>) the emulator (<code>emulator</code>), and the Dalvik Debug Monitor Server
-(<code>ddms</code>). A short summary of some frequently-used SDK tools is provided below.</p>
-
-<dl>
- <dt><a href="android.html">android</a></dt>
- <dd>Lets you manage AVDs, projects, and the installed components of the SDK.</dd>
- <dt><a href="{@docRoot}guide/developing/debugging/ddms.html">Dalvik Debug Monitor
-Server (ddms)</a></dt>
- <dd>Lets you debug Android applications.</dd>
- <dt><a href="dmtracedump.html">dmtracedump</a></dt>
- <dd>Generates graphical call-stack diagrams from trace log files. The tool uses the
-Graphviz Dot utility to create the graphical output, so you need to install Graphviz before
-running <code>dmtracedump</code>. For more information on using <code>dmtracedump</code>, see <a
-href="{@docRoot}guide/developing/debugging/debugging-tracing.html#dmtracedump">Profiling
-with Traceview and dmtracedump</a></dd>
- <dt><a href="draw9patch.html">Draw 9-patch</a></dt>
- <dd>Allows you to easily create a {@link android.graphics.NinePatch} graphic using a
-WYSIWYG editor. It also previews stretched versions of the image, and highlights the area in which
-content is allowed.</dd>
- <dt><a href="emulator.html">Android Emulator (emulator)</a></dt>
- <dd>A QEMU-based device-emulation tool that you can use to design, debug, and test
-your applications in an actual Android run-time environment.</dd>
- <dt><a href="hierarchy-viewer.html">Hierarchy Viewer (hierarchyviewer)</a></dt>
- <dd>Lets you debug and optimize an Android application's user interface.</dd>
- <dt><a href="hprof-conv.html">hprof-conv</a></dt>
- <dd>Converts the HPROF file that is generated by the Android SDK tools to a standard format so
-you can view the file in a profiling tool of your choice.</dd>
- <dt><a href="layoutopt.html">layoutopt</a></dt>
- <dd>Lets you quickly analyze your application's layouts in order to optimize them for
-efficiency.</dd>
- <dt><a href="mksdcard.html">mksdcard</a></dt>
- <dd>Helps you create a disk image that you can use with the emulator, to simulate the presence
-of an external storage card (such as an SD card).</dd>
- <dt><a href="monkey.html">Monkey</a></dt>
- <dd>Runs on your emulator or device and generates pseudo-random streams of user events such
-as clicks, touches, or gestures, as well as a number of system-level events. You can use the Monkey
-to stress-test applications that you are developing, in a random yet repeatable manner.</dd>
- <dt><a href="monkeyrunner_concepts.html">monkeyrunner</a></dt>
- <dd>Provides an API for writing programs that control an Android device or emulator from
-outside of Android code.</dd>
- <dt><a href="proguard.html">ProGuard</a></dt>
- <dd>Shrinks, optimizes, and obfuscates your code by removing unused code and renaming
-classes, fields, and methods with semantically obscure names.</dd>
- <dt><a href="sqlite3.html">sqlite3</a></dt>
- <dd>Lets you access the SQLite data files created and used by Android applications.</dd>
- <dt><a href="traceview.html">traceview</a></dt>
- <dd>Provides a graphical viewer for execution logs saved by your application.</dd>
- <dt><a href="zipalign.html">zipalign</a></dt>
- <dd>Optimizes <code>.apk</code> files by ensuring that all uncompressed data starts with a
-particular alignment relative to the start of the file. This should always be used to align .apk
-files after they have been signed.</dd>
- </dl>
-
-<h2 id="tools-platform">Platform Tools</h2>
-
-<p>The platform tools are typically updated every time you install a new SDK platform. Each update
-of the platform tools is backward compatible with older platforms. Usually, you directly use only
-one of the platform tools—the <a href="adb.html">Android Debug Bridge (<code>adb</code>)</a>.
-Android Debug Bridge is a versatile tool that lets you manage the state of an emulator instance or
-Android-powered device. You can also use it to install an Android application (.apk) file on a
-device.</p>
-
-<p>The other platform tools, such as <a href="{@docRoot}guide/developing/tools/aidl.html">aidl</a>,
-<code>aapt</code>, <code>dexdump</code>, and <code>dx</code>, are typically called by the Android
-build tools or Android Development Tools (ADT), so you rarely need to invoke these tools directly.
-As a general rule, you should rely on the build tools or the ADT plugin to call them as needed.</p>
-
-<p class="note"><strong>Note:</strong> The Android SDK provides additional shell tools that can
-be accessed through <code>adb</code>, such as <a href="bmgr.html">bmgr</a> and
-<a href="logcat.html">logcat</a>.</p>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/layoutopt.jd b/docs/html/guide/developing/tools/layoutopt.jd
deleted file mode 100644
index cb0b505..0000000
--- a/docs/html/guide/developing/tools/layoutopt.jd
+++ /dev/null
@@ -1,24 +0,0 @@
-page.title=layoutopt
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
-<p><code>layoutopt</code> is a command-line tool that helps you optimize the
-layouts and layout hierarchies of your applications.<p>
-
-<p>This document is a reference to the available command line options. For more information and sample
-output of the tool, see <a
-href="{@docRoot}guide/developing/debugging/debugging-ui.html#layoutopt">Optimizing layouts with
-layoutopt</a>.</p>
-
-<h3>Usage</h3>
-
-<p>To run <code>layoutopt</code> against a given list of layout resources:</p>
-
-<pre>layoutopt <file_or_directory> ...</pre>
-
-<p>For example:</p>
-
-<pre>$ layoutopt res/layout-land</pre>
-<pre>$ layoutopt res/layout/main.xml res/layout-land/main.xml</pre>
-
diff --git a/docs/html/guide/developing/tools/logcat.jd b/docs/html/guide/developing/tools/logcat.jd
deleted file mode 100644
index 546e3ea..0000000
--- a/docs/html/guide/developing/tools/logcat.jd
+++ /dev/null
@@ -1,106 +0,0 @@
-page.title=logcat
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
- <p>The Android logging system provides a mechanism for collecting and viewing system debug
- output. Logs from various applications and portions of the system are collected in a series of
- circular buffers, which then can be viewed and filtered by the <code>logcat</code> command. You can use
- <code>logcat</code> from an ADB shell to view the log messages.</p>
-
- <p>This document is a reference to the available command line options. For more information on <code>logcat</code>, see
- <a href="{@docRoot}guide/developing/debugging/debugging-log.html">Reading and Writing Logs</a>.
-For more
- information on accessing <code>logcat</code> from DDMS, instead of the command line, see the documentation for the
- <a href="{@docRoot}guide/developing/debugging/ddms.html">Dalvik Debug Monitor Server</a>.
- </p>
-
- <h3>Syntax</h3>
- <pre>
-[adb] logcat [<option>] ... [<filter-spec>] ...
-</pre>
-
- <p>You can run <code>logcat</code> as an adb command or directly in a shell prompt
- of your emulator or connected device. To view log output using adb, navigate to your SDK
- <code>platform-tools/</code> directory and execute:</p>
- <pre>
-$ adb logcat
-</pre>
-
- <p>You can create a shell connection to a device and execute:</p>
- <pre>
-$ adb shell
-# logcat
-</pre>
-
- <h3>Options</h3>
- <p>The following table describes the command line options of <code>logcat</code>.</p>
-
- <table>
- <tr>
- <th>Option</th>
-
- <th>Description</th>
- </tr>
-
- <tr>
- <td><code>-b <buffer></code></td>
-
- <td>Loads an alternate log buffer for viewing, such as <code>event</code> or
- <code>radio</code>. The <code>main</code> buffer is used by default. See <a href=
- "#alternativebuffers">Viewing Alternative Log Buffers</a>.</td>
- </tr>
-
- <tr>
- <td><code>-c</code></td>
-
- <td>Clears (flushes) the entire log and exits.</td>
- </tr>
-
- <tr>
- <td><code>-d</code></td>
-
- <td>Dumps the log to the screen and exits.</td>
- </tr>
-
- <tr>
- <td><code>-f <filename></code></td>
-
- <td>Writes log message output to <code><filename></code>. The default is
- <code>stdout</code>.</td>
- </tr>
-
- <tr>
- <td><code>-g</code></td>
-
- <td>Prints the size of the specified log buffer and exits.</td>
- </tr>
-
- <tr>
- <td><code>-n <count></code></td>
-
- <td>Sets the maximum number of rotated logs to <code><count></code>. The default value
- is 4. Requires the <code>-r</code> option.</td>
- </tr>
-
- <tr>
- <td><code>-r <kbytes></code></td>
-
- <td>Rotates the log file every <code><kbytes></code> of output. The default value is
- 16. Requires the <code>-f</code> option.</td>
- </tr>
-
- <tr>
- <td><code>-s</code></td>
-
- <td>Sets the default filter spec to silent.</td>
- </tr>
-
- <tr>
- <td><code>-v <format></code></td>
-
- <td>Sets the output format for log messages. The default is <code>brief</code> format. For a
- list of supported formats, see <a href="#outputformat">Controlling Log Output
- Format</a>.</td>
- </tr>
- </table>
diff --git a/docs/html/guide/developing/tools/mksdcard.jd b/docs/html/guide/developing/tools/mksdcard.jd
deleted file mode 100644
index 0a80454..0000000
--- a/docs/html/guide/developing/tools/mksdcard.jd
+++ /dev/null
@@ -1,55 +0,0 @@
-page.title=mksdcard
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
- <p>The <code>mksdcard</code> tool lets you quickly create a FAT32 disk image that you can load in the
- emulator, to simulate the presence of an SD card in the device. Because you can specify an SD
- card while creating an AVD in the AVD Manager, you usually use that feature to create an SD card.
- This tool creates an SD card that is not bundled with an AVD, so it is useful for situations
- where you need to share a virtual SD card between multiple emulators.</p>
-
- <h3>Usage</h3>
- <pre>
-mksdcard -l <label> <size> <file>
-</pre>
-
- <h3>Options</h3>
- <p>The following table describes the command-line options of <code>mksdcard</code></p>
- <table>
- <tr>
- <th>Option</th>
-
- <th>Description</th>
- </tr>
-
- <tr>
- <td><code>-l</code></td>
-
- <td>A volume label for the disk image to create.</td>
- </tr>
-
- <tr>
- <td><code>size</code></td>
-
- <td>An integer that specifies the size (in bytes) of disk image to create. You can also
- specify size in kilobytes or megabytes, by appending a "K" or "M" to <size>. For
- example, <code>1048576K</code>, <code>1024M</code>.</td>
- </tr>
-
- <tr>
- <td><code>file</code></td>
-
- <td>The path/filename of the disk image to create.</td>
- </tr>
- </table>
-
- <p>Once you have created the disk image file, you can load it in the emulator at startup using
- the emulator's <code>-sdcard</code> option. For more information, see <a href=
- "{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a>.</p>
-
- <p>The usage for the <code>-sdcard</code> option is as follows:</p>
- <pre>emulator -sdcard <file></pre>
-
-<h3>Example</h3>
-<pre>mksdcard -l mySdCard 1024M mySdCardFile.img</pre>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/monkey.jd b/docs/html/guide/developing/tools/monkey.jd
deleted file mode 100644
index a7e539c..0000000
--- a/docs/html/guide/developing/tools/monkey.jd
+++ /dev/null
@@ -1,242 +0,0 @@
-page.title=UI/Application Exerciser Monkey
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
-<p>The Monkey is a program that runs on your
-<a href="{@docRoot}guide/developing/tools/emulator.html">emulator</a> or device and generates pseudo-random
-streams of user events such as clicks, touches, or gestures, as well as a number of system-level
-events. You can use the Monkey to stress-test applications that you are developing, in a random
-yet repeatable manner.</p>
-
-<a name="overview"></a>
-<h2>Overview</h2>
-
-<p>The Monkey is a command-line tool that that you can run on any emulator
-instance or on a device. It sends a pseudo-random stream of
-user events into the system, which acts as a stress test on the application software you are
-developing.</p>
-
-<p>The Monkey includes a number of options, but they break down into four primary
-categories:</p>
-
-<ul>
- <li>Basic configuration options, such as setting the number of events to attempt.</li>
- <li>Operational constraints, such as restricting the test to a single package.</li>
- <li>Event types and frequencies.</li>
- <li>Debugging options.</li>
-</ul>
-
-<p>When the Monkey runs, it generates events and sends them to the system. It also <i>watches</i>
-the system under test and looks for three conditions, which it treats specially:</p>
-
-<ul>
- <li>If you have constrained the Monkey to run in one or more specific packages, it
- watches for attempts to navigate to any other packages, and blocks them.</li>
- <li>If your application crashes or receives any sort of unhandled exception, the Monkey
- will stop and report the error.</li>
- <li>If your application generates an <i>application not responding</i> error, the Monkey
- will stop and report the error.</li>
-</ul>
-
-<p>Depending on the verbosity level you have selected, you will also see reports on the progress
-of the Monkey and the events being generated.</p>
-
-<a name="basics"></a>
-<h2>Basic Use of the Monkey</h2>
-
-<p>You can launch the Monkey using a command line on your development machine or from a script.
-Because the Monkey runs in the emulator/device environment, you must launch it from a shell in
-that environment. You can do this by prefacing <code>adb shell</code> to each command,
-or by entering the shell and entering Monkey commands directly.</p>
-<p>The basic syntax is: </p>
-
-<pre>$ adb shell monkey [options] <event-count></pre>
-
-<p>With no options specified, the Monkey will launch in a quiet (non-verbose) mode, and will send
-events to any (and all) packages installed on your target. Here is a more typical command line,
-which will launch your application and send 500 pseudo-random events to it:</p>
-
-<pre>$ adb shell monkey -p your.package.name -v 500</pre>
-
-<a name="reference"></a>
-<h2>Command Options Reference</h2>
-
-<p>The table below lists all options you can include on the Monkey command line.</p>
-
-<table>
-<tr>
- <th>Category</th>
- <th>Option</th>
- <th>Description</th>
-</tr>
-
-<tr>
-<td rowspan="2">General</td>
-<td><code>--help</code></td>
-<td>Prints a simple usage guide.</td>
-</tr>
-
-<tr>
-<td><code>-v</code></td>
-<td>Each -v on the command line will increment the verbosity level.
-Level 0 (the default) provides little information beyond startup notification, test completion, and
-final results.
-Level 1 provides more details about the test as it runs, such as individual events being sent to
-your activities.
-Level 2 provides more detailed setup information such as activities selected or not selected for
-testing.</td>
-</tr>
-
-<tr>
-<td rowspan="10">Events</td>
-<td><code>-s <seed></code></td>
-<td>Seed value for pseudo-random number generator. If you re-run the Monkey with the same seed
-value, it will generate the same sequence of events.</td>
-</tr>
-
-<tr>
-<td><code>--throttle <milliseconds></code></td>
-<td>Inserts a fixed delay between events. You can use this option to slow down the Monkey.
-If not specified, there is no delay and the events are generated as rapidly as possible.</td>
-</tr>
-
-<tr>
-<td><code>--pct-touch <percent></code></td>
-<td>Adjust percentage of touch events.
-(Touch events are a down-up event in a single place on the screen.)</td>
-</tr>
-
-<tr>
-<td><code>--pct-motion <percent></code></td>
-<td>Adjust percentage of motion events.
-(Motion events consist of a down event somewhere on the screen, a series of pseudo-random
-movements, and an up event.)</td>
-</tr>
-
-<tr>
-<td><code>--pct-trackball <percent></code></td>
-<td>Adjust percentage of trackball events.
-(Trackball events consist of one or more random movements, sometimes followed by a click.)</td>
-</tr>
-
-<tr>
-<td><code>--pct-nav <percent></code></td>
-<td>Adjust percentage of "basic" navigation events.
-(Navigation events consist of up/down/left/right, as input from a directional input device.)</td>
-</tr>
-
-<tr>
-<td><code>--pct-majornav <percent></code></td>
-<td>Adjust percentage of "major" navigation events.
-(These are navigation events that will typically cause actions within your UI, such as
-the center button in a 5-way pad, the back key, or the menu key.)</td>
-</tr>
-
-<tr>
-<td><code>--pct-syskeys <percent></code></td>
-<td>Adjust percentage of "system" key events.
-(These are keys that are generally reserved for use by the system, such as Home, Back, Start Call,
-End Call, or Volume controls.)</td>
-</tr>
-
-<tr>
-<td><code>--pct-appswitch <percent></code></td>
-<td>Adjust percentage of activity launches. At random intervals, the Monkey will issue a startActivity() call, as a way of maximizing
-coverage of all activities within your package.</td>
-</tr>
-
-<tr>
-<td><code>--pct-anyevent <percent></code></td>
-<td>Adjust percentage of other types of events. This is a catch-all for all other types of events such as keypresses, other less-used
-buttons on the device, and so forth.</td>
-</tr>
-
-<tr>
-<td rowspan="2">Constraints</td>
-<td><code>-p <allowed-package-name></code></td>
-<td>If you specify one or more packages this way, the Monkey will <i>only</i> allow the system
-to visit activities within those packages. If your application requires access to activities in
-other packages (e.g. to select a contact) you'll need to specify those packages as well.
-If you don't specify any packages, the Monkey will allow the system to launch activities
-in all packages. To specify multiple packages, use the -p option multiple times — one -p
-option per package.</td>
-</tr>
-
-<tr>
-<td><code>-c <main-category></code></td>
-<td>If you specify one or more categories this way, the Monkey will <i>only</i> allow the
-system to visit activities that are listed with one of the specified categories.
-If you don't specify any categories, the Monkey will select activities listed with the category
-Intent.CATEGORY_LAUNCHER or Intent.CATEGORY_MONKEY. To specify multiple categories, use the -c
-option multiple times — one -c option per category.</td>
-</tr>
-
-<tr>
-<td rowspan="8">Debugging</td>
-<td><code>--dbg-no-events</code></td>
-<td>When specified, the Monkey will perform the initial launch into a test activity, but
-will not generate any further events.
-For best results, combine with -v, one or more package constraints, and a non-zero throttle to keep the Monkey
-running for 30 seconds or more. This provides an environment in which you can monitor package
-transitions invoked by your application.</td>
-</tr>
-
-<tr>
-<td><code>--hprof</code></td>
-<td>If set, this option will generate profiling reports immediately before and after
-the Monkey event sequence.
-This will generate large (~5Mb) files in data/misc, so use with care. See
-<a href="{@docRoot}guide/developing/debugging/debugging-tracing.html" title="traceview">Traceview</a> for more information
-on trace files.</td>
-</tr>
-
-<tr>
-<td><code>--ignore-crashes</code></td>
-<td>Normally, the Monkey will stop when the application crashes or experiences any type of
-unhandled exception. If you specify this option, the Monkey will continue to send events to
-the system, until the count is completed.</td>
-</tr>
-
-<tr>
-<td><code>--ignore-timeouts</code></td>
-<td>Normally, the Monkey will stop when the application experiences any type of timeout error such
-as a "Application Not Responding" dialog. If you specify this option, the Monkey will continue to
-send events to the system, until the count is completed.</td>
-</tr>
-
-<tr>
-<td><code>--ignore-security-exceptions</code></td>
-<td>Normally, the Monkey will stop when the application experiences any type of permissions error,
-for example if it attempts to launch an activity that requires certain permissions. If you specify
-this option, the Monkey will continue to send events to the system, until the count is
-completed.</td>
-</tr>
-
-<tr>
-<td><code>--kill-process-after-error</code></td>
-<td>Normally, when the Monkey stops due to an error, the application that failed will be left
-running. When this option is set, it will signal the system to stop the process in which the error
-occurred.
-Note, under a normal (successful) completion, the launched process(es) are not stopped, and
-the device is simply left in the last state after the final event.</td>
-</tr>
-
-<tr>
-<td><code>--monitor-native-crashes</code></td>
-<td>Watches for and reports crashes occurring in the Android system native code. If --kill-process-after-error is set, the system will stop.</td>
-</tr>
-
-<tr>
-<td><code>--wait-dbg</code></td>
-<td>Stops the Monkey from executing until a debugger is attached to it.</td>
-</tr>
-
-</table>
-
-<!-- TODO: add a section called "debugging" that covers ways to use it,
-need to clear data, use of the seed, etc. -->
-
-<!-- TODO: add a section that lays down a contract for Monkey output so it can be
-scripted safely. -->
-
diff --git a/docs/html/guide/developing/tools/monkeyrunner_concepts.jd b/docs/html/guide/developing/tools/monkeyrunner_concepts.jd
deleted file mode 100644
index 346a0c6..0000000
--- a/docs/html/guide/developing/tools/monkeyrunner_concepts.jd
+++ /dev/null
@@ -1,319 +0,0 @@
-page.title=monkeyrunner
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li>
- <a href="#SampleProgram">A Simple monkeyrunner Program</a>
- </li>
- <li>
- <a href="#APIClasses">The monkeyrunner API</a>
- </li>
- <li>
- <a href="#RunningMonkeyRunner">Running monkeyrunner</a>
- </li>
- <li>
- <a href="#Help">monkeyrunner Built-in Help</a>
- </li>
- <li>
- <a href="#Plugins">Extending monkeyrunner with Plugins</a>
- </li>
- </ol>
- <h2>See Also</h2>
- <ol>
- <li>
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Fundamentals</a>
- </li>
- </ol>
- </div>
-</div>
-<p>
- The monkeyrunner tool provides an API for writing programs that control an Android device
- or emulator from outside of Android code. With monkeyrunner, you can write a Python program
- that installs an Android application or test package, runs it, sends keystrokes to it,
- takes screenshots of its user interface, and stores screenshots on the workstation. The
- monkeyrunner tool is primarily designed to test applications and devices at the
- functional/framework level and for running unit test suites, but you are free to use it for
- other purposes.
-</p>
-<p>
- The monkeyrunner tool is not related to the
- <a href="{@docRoot}guide/developing/tools/monkey.html">UI/Application Exerciser Monkey</a>,
- also known as the <code>monkey</code> tool. The <code>monkey</code> tool runs in an
- <code><a href="{@docRoot}guide/developing/tools/adb.html">adb</a></code> shell directly on the
- device or emulator and generates pseudo-random streams of user and system events. In comparison,
- the monkeyrunner tool controls devices and emulators from a workstation by sending specific
- commands and events from an API.
-</p>
-<p>
- The monkeyrunner tool provides these unique features for Android testing:
-</p>
-<ul>
- <li>
- Multiple device control: The monkeyrunner API can apply one or more
- test suites across multiple devices or emulators. You can physically attach all the devices
- or start up all the emulators (or both) at once, connect to each one in turn
- programmatically, and then run one or more tests. You can also start up an emulator
- configuration programmatically, run one or more tests, and then shut down the emulator.
- </li>
- <li>
- Functional testing: monkeyrunner can run an automated start-to-finish test of an Android
- application. You provide input values with keystrokes or touch events, and view the results
- as screenshots.
- </li>
- <li>
- Regression testing - monkeyrunner can test application stability by running an application
- and comparing its output screenshots to a set of screenshots that are known to be correct.
- </li>
- <li>
- Extensible automation - Since monkeyrunner is an API toolkit, you can develop an entire
- system of Python-based modules and programs for controlling Android devices. Besides using
- the monkeyrunner API itself, you can use the standard Python
- <code><a href="http://docs.python.org/library/os.html">os</a></code> and
- <code><a href="http://docs.python.org/library/subprocess.html">subprocess</a></code>
- modules to call Android tools such as
- <a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a>.
- <p>
- You can also add your own classes to the monkeyrunner API. This is described
- in more detail in the section
- <a href="#Plugins">Extending monkeyrunner with plugins</a>.
- </p>
- </li>
-</ul>
-<p>
- The monkeyrunner tool uses <a href="http://www.jython.org/">Jython</a>, a
- implementation of Python that uses the Java programming language. Jython allows the
- monkeyrunner API to interact easily with the Android framework. With Jython you can
- use Python syntax to access the constants, classes, and methods of the API.
-</p>
-
-<h2 id="SampleProgram">A Simple monkeyrunner Program</h2>
-<p>
- Here is a simple monkeyrunner program that connects to a device, creating a
- <code><a href="{@docRoot}guide/developing/tools/MonkeyDevice.html">MonkeyDevice</a></code>
- object. Using the <code>MonkeyDevice</code> object, the program installs an Android application
- package, runs one of its activities, and sends key events to the activity.
- The program then takes a screenshot of the result, creating a
- <code><a href="{@docRoot}guide/developing/tools/MonkeyImage.html">MonkeyImage</a></code> object.
- From this object, the program writes out a <code>.png</code> file containing the screenshot.
-</p>
-<pre>
-# Imports the monkeyrunner modules used by this program
-from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
-
-# Connects to the current device, returning a MonkeyDevice object
-device = MonkeyRunner.waitForConnection()
-
-# Installs the Android package. Notice that this method returns a boolean, so you can test
-# to see if the installation worked.
-device.installPackage('myproject/bin/MyApplication.apk')
-
-# sets a variable with the package's internal name
-package = 'com.example.android.myapplication'
-
-# sets a variable with the name of an Activity in the package
-activity = 'com.example.android.myapplication.MainActivity'
-
-# sets the name of the component to start
-runComponent = package + '/' + activity
-
-# Runs the component
-device.startActivity(component=runComponent)
-
-# Presses the Menu button
-device.press('KEYCODE_MENU', MonkeyDevice.DOWN_AND_UP)
-
-# Takes a screenshot
-result = device.takeSnapshot()
-
-# Writes the screenshot to a file
-result.writeToFile('myproject/shot1.png','png')
-</pre>
-
-<h2 id="APIClasses">The monkeyrunner API</h2>
-<p>
- The monkeyrunner API is contained in three modules in the package
- <code>com.android.monkeyrunner</code>:
-</p>
-<ul>
- <li>
- <code><a href="{@docRoot}guide/developing/tools/MonkeyRunner.html">MonkeyRunner</a></code>:
- A class of utility methods for monkeyrunner programs. This class provides a method for
- connecting monkeyrunner to a device or emulator. It also provides methods for
- creating UIs for a monkeyrunner program and for displaying the built-in help.
- </li>
- <li>
- <code><a href="{@docRoot}guide/developing/tools/MonkeyDevice.html">MonkeyDevice</a></code>:
- Represents a device or emulator. This class provides methods for installing and
- uninstalling packages, starting an Activity, and sending keyboard or touch events to an
- application. You also use this class to run test packages.
- </li>
- <li>
- <code><a href="{@docRoot}guide/developing/tools/MonkeyImage.html">MonkeyImage</a></code>:
- Represents a screen capture image. This class provides methods for capturing screens,
- converting bitmap images to various formats, comparing two MonkeyImage objects, and
- writing an image to a file.
- </li>
-</ul>
-<p>
- In a Python program, you access each class as a Python module. The monkeyrunner tool
- does not import these modules automatically. To import a module, use the
- Python <code>from</code> statement:
-</p>
-<pre>
-from com.android.monkeyrunner import <module>
-</pre>
-<p>
- where <code><module></code> is the class name you want to import. You can import more
- than one module in the same <code>from</code> statement by separating the module names with
- commas.
-</p>
-<h2 id="RunningMonkeyRunner">Running monkeyrunner</h2>
-<p>
- You can either run monkeyrunner programs from a file, or enter monkeyrunner statements in
- an interactive session. You do both by invoking the <code>monkeyrunner</code> command
- which is found in the <code>tools/</code> subdirectory of your SDK directory.
- If you provide a filename as an argument, the <code>monkeyrunner</code> command
- runs the file's contents as a Python program; otherwise, it starts an interactive session.
-</p>
-<p>
- The syntax of the <code>monkeyrunner</code> command is
-</p>
-<pre>
-monkeyrunner -plugin <plugin_jar> <program_filename> <program_options>
-</pre>
-<p>
-Table 1 explains the flags and arguments.
-</p>
-<p class="table-caption" id="table1">
- <strong>Table 1.</strong> <code>monkeyrunner</code> flags and arguments.</p>
-
-<table>
- <tr>
- <th>Argument</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>
- <nobr>
- <code>-plugin <plugin_jar></code>
- </nobr>
- </td>
- <td>
- (Optional) Specifies a <code>.jar</code> file containing a plugin for monkeyrunner.
- To learn more about monkeyrunner plugins, see
- <a href="#Plugins">Extending monkeyrunner with plugins</a>. To specify more than one
- file, include the argument multiple times.
- </td>
- </tr>
- <tr>
- <td>
- <nobr>
- <code><program_filename></code>
- </nobr>
- </td>
- <td>
- If you provide this argument, the <code>monkeyrunner</code> command runs the contents
- of the file as a Python program. If the argument is not provided, the command starts an
- interactive session.
- </td>
- </tr>
- <tr>
- <td>
- <code><program_options></code>
- </td>
- <td>
- (Optional) Flags and arguments for the program in <program_file>.
- </td>
- </tr>
-</table>
-<h2 id="Help">monkeyrunner Built-in Help</h2>
-<p>
- You can generate an API reference for monkeyrunner by running:
-</p>
-<pre>
-monkeyrunner help.py <format> <outfile>
-</pre>
-<p>
-The arguments are:
-</p>
- <ul>
- <li>
- <code><format></code> is either <code>text</code> for plain text output
- or <code>html</code> for HTML output.
- </li>
- <li>
- <code><outfile></code> is a path-qualified name for the output file.
- </li>
- </ul>
-<h2 id="Plugins">Extending monkeyrunner with Plugins</h2>
-<p>
- You can extend the monkeyrunner API with classes you write in the Java programming language
- and build into one or more <code>.jar</code> files. You can use this feature to extend the
- monkeyrunner API with your own classes or to extend the existing classes. You can also use this
- feature to initialize the monkeyrunner environment.
-</p>
-<p>
- To provide a plugin to monkeyrunner, invoke the <code>monkeyrunner</code> command with the
- <code>-plugin <plugin_jar></code> argument described in
- <a href="#table1">table 1</a>.
-</p>
-<p>
- In your plugin code, you can import and extend the the main monkeyrunner classes
- <code>MonkeyDevice</code>, <code>MonkeyImage</code>, and <code>MonkeyRunner</code> in
- <code>com.android.monkeyrunner</code> (see <a href="#APIClasses">The monkeyrunner API</a>).
-</p>
-<p>
- Note that plugins do not give you access to the Android SDK. You can't import packages
- such as <code>com.android.app</code>. This is because monkeyrunner interacts with the
- device or emulator below the level of the framework APIs.
-</p>
-<h3>The plugin startup class</h3>
-<p>
- The <code>.jar</code> file for a plugin can specify a class that is instantiated before
- script processing starts. To specify this class, add the key
- <code>MonkeyRunnerStartupRunner</code> to the <code>.jar</code> file's
- manifest. The value should be the name of the class to run at startup. The following
- snippet shows how you would do this within an <code>ant</code> build script:
-</p>
-<pre>
-<jar jarfile="myplugin" basedir="${build.dir}">
-<manifest>
-<attribute name="MonkeyRunnerStartupRunner" value="com.myapp.myplugin"/>
-</manifest>
-</jar>
-
-
-</pre>
-<p>
- To get access to monkeyrunner's runtime environment, the startup class can implement
- <code>com.google.common.base.Predicate<PythonInterpreter></code>. For example, this
- class sets up some variables in the default namespace:
-</p>
-<pre>
-package com.android.example;
-
-import com.google.common.base.Predicate;
-import org.python.util.PythonInterpreter;
-
-public class Main implements Predicate<PythonInterpreter> {
- @Override
- public boolean apply(PythonInterpreter anInterpreter) {
-
- /*
- * Examples of creating and initializing variables in the monkeyrunner environment's
- * namespace. During execution, the monkeyrunner program can refer to the variables "newtest"
- * and "use_emulator"
- *
- */
- anInterpreter.set("newtest", "enabled");
- anInterpreter.set("use_emulator", 1);
-
- return true;
- }
-}
-</pre>
diff --git a/docs/html/guide/developing/tools/othertools.html b/docs/html/guide/developing/tools/othertools.html
deleted file mode 100644
index a074f33..0000000
--- a/docs/html/guide/developing/tools/othertools.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/guide/developing/tools/index.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should be redirected. Please <a
-href="http://developer.android.com/guide/developing/tools/index.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/proguard.jd b/docs/html/guide/developing/tools/proguard.jd
deleted file mode 100644
index ea8a1ea..0000000
--- a/docs/html/guide/developing/tools/proguard.jd
+++ /dev/null
@@ -1,189 +0,0 @@
-page.title=ProGuard
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#enabling">Enabling ProGuard</a></li>
-
- <li><a href="#configuring">Configuring ProGuard</a></li>
-
- <li>
- <a href="#decoding">Decoding Obfuscated Stack Traces</a>
-
- <ol>
- <li><a href="#considerations">Debugging considerations for published
- applications</a></li>
- </ol>
- </li>
- </ol>
-
- <h2>See also</h2>
-
- <ol>
- <li><a href="http://proguard.sourceforge.net/manual/introduction.html">ProGuard
- Manual »</a></li>
-
- <li><a href="http://proguard.sourceforge.net/manual/retrace/introduction.html">ProGuard
- ReTrace Manual »</a></li>
- </ol>
- </div>
- </div>
-
- <p>The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and
- renaming classes, fields, and methods with semantically obscure names. The result is a smaller
- sized <code>.apk</code> file that is more difficult to reverse engineer. Because ProGuard makes your
- application harder to reverse engineer, it is important that you use it
- when your application utilizes features that are sensitive to security like when you are
- <a href="{@docRoot}guide/market/licensing/index.html">Licensing Your Applications</a>.</p>
-
- <p>ProGuard is integrated into the Android build system, so you do not have to invoke it
- manually. ProGuard runs only when you build your application in release mode, so you do not
- have to deal with obfuscated code when you build your application in debug mode.
- Having ProGuard run is completely optional, but highly recommended.</p>
-
- <p>This document describes how to enable and configure ProGuard as well as use the
- <code>retrace</code> tool to decode obfuscated stack traces.</p>
-
- <h2 id="enabling">Enabling ProGuard</h2>
-
- <p>When you create an Android project, a <code>proguard.cfg</code> file is automatically
- generated in the root directory of the project. This file defines how ProGuard optimizes and
- obfuscates your code, so it is very important that you understand how to customize it for your
- needs. The default configuration file only covers general cases, so you most likely have to edit
- it for your own needs. See the following section about <a href="#configuring">Configuring ProGuard</a> for information on
- customizing the ProGuard configuration file.</p>
-
- <p>To enable ProGuard so that it runs as part of an Ant or Eclipse build, set the
- <code>proguard.config</code> property in the <code><project_root>/project.properties</code>
- file. The path can be an absolute path or a path relative to the project's root.</p>
-<p>If you left the <code>proguard.cfg</code> file in its default location (the project's root directory),
-you can specify its location like this:</p>
-<pre class="no-pretty-print">
-proguard.config=proguard.cfg
-</pre>
-<p>
-You can also move the the file to anywhere you want, and specify the absolute path to it:
-</p>
-<pre class="no-pretty-print">
-proguard.config=/path/to/proguard.cfg
-</pre>
-
-
- <p>When you build your application in release mode, either by running <code>ant release</code> or
- by using the <em>Export Wizard</em> in Eclipse, the build system automatically checks to see if
- the <code>proguard.config</code> property is set. If it is, ProGuard automatically processes
- the application's bytecode before packaging everything into an <code>.apk</code> file. Building in debug mode
- does not invoke ProGuard, because it makes debugging more cumbersome.</p>
-
- <p>ProGuard outputs the following files after it runs:</p>
-
- <dl>
- <dt><code>dump.txt</code></dt>
- <dd>Describes the internal structure of all the class files in the <code>.apk</code> file</dd>
-
- <dt><code>mapping.txt</code></dt>
- <dd>Lists the mapping between the original and obfuscated class, method, and field names.
- This file is important when you receive a bug report from a release build, because it
- translates the obfuscated stack trace back to the original class, method, and member names.
- See <a href="#decoding">Decoding Obfuscated Stack Traces</a> for more information.</dd>
-
- <dt><code>seeds.txt</code></dt>
- <dd>Lists the classes and members that are not obfuscated</dd>
-
- <dt><code>usage.txt</code></dt>
- <dd>Lists the code that was stripped from the <code>.apk</code></dd>
- </ul>
-
- <p>These files are located in the following directories:</p>
-
- <ul>
- <li><code><project_root>/bin/proguard</code> if you are using Ant.</li>
-
- <li><code><project_root>/proguard</code> if you are using Eclipse.</li>
- </ul>
-
-
- <p class="caution"><strong>Caution:</strong> Every time you run a build in release mode, these files are
- overwritten with the latest files generated by ProGuard. Save a copy of them each time you release your
- application in order to de-obfuscate bug reports from your release builds.
- For more information on why saving these files is important, see
- <a href="#considerations">Debugging considerations for published applications</a>.
- </p>
-
- <h2 id="configuring">Configuring ProGuard</h2>
-
- <p>For some situations, the default configurations in the <code>proguard.cfg</code> file will
- suffice. However, many situations are hard for ProGuard to analyze correctly and it might remove code
- that it thinks is not used, but your application actually needs. Some examples include:</p>
-
- <ul>
- <li>a class that is referenced only in the <code>AndroidManifest.xml</code> file</li>
-
- <li>a method called from JNI</li>
-
- <li>dynamically referenced fields and methods</li>
- </ul>
-
- <p>The default <code>proguard.cfg</code> file tries to cover general cases, but you might
- encounter exceptions such as <code>ClassNotFoundException</code>, which happens when ProGuard
- strips away an entire class that your application calls.</p>
-
- <p>You can fix errors when ProGuard strips away your code by adding a <code>-keep</code> line in
- the <code>proguard.cfg</code> file. For example:</p>
- <pre>
--keep public class <MyClass>
-</pre>
-
- <p>There are many options and considerations when using the <code>-keep</code> option, so it is
- highly recommended that you read the <a href="http://proguard.sourceforge.net/manual/introduction.html">ProGuard
- Manual</a> for more information about customizing your configuration file. The <a href=
- "http://proguard.sourceforge.net/manual/usage.html#keepoverview">Overview of Keep options</a> and
- <a href="http://proguard.sourceforge.net/index.html#/manual/examples.html">Examples section</a>
- are particularly helpful. The <a href=
- "http://proguard.sourceforge.net/manual/troubleshooting.html">Troubleshooting</a> section of the
- ProGuard Manual outlines other common problems you might encounter when your code gets stripped
- away.</p>
-
- <h2 id="decoding">Decoding Obfuscated Stack Traces</h2>
-
- <p>When your obfuscated code outputs a stack trace, the method names are obfuscated, which makes
- debugging hard, if not impossible. Fortunately, whenever ProGuard runs, it outputs a
- <code><project_root>/bin/proguard/mapping.txt</code> file, which shows you the original
- class, method, and field names mapped to their obfuscated names.</p>
-
- <p>The <code>retrace.bat</code> script on Windows or the <code>retrace.sh</code> script on Linux
- or Mac OS X can convert an obfuscated stack trace to a readable one. It is located in the
- <code><sdk_root>/tools/proguard/</code> directory. The syntax for executing the
- <code>retrace</code> tool is:</p>
- <pre>retrace.bat|retrace.sh [-verbose] mapping.txt [<stacktrace_file>]</pre>
- <p>For example:</p>
-
- <pre>retrace.bat -verbose mapping.txt obfuscated_trace.txt</pre>
-
- <p>If you do not specify a value for <em><stacktrace_file></em>, the <code>retrace</code> tool reads
- from standard input.</p>
-
- <h3 id="considerations">Debugging considerations for published applications</h3>
-
- <p>Save the <code>mapping.txt</code> file for every release that you publish to your users.
- By retaining a copy of the <code>mapping.txt</code> file for each release build,
- you ensure that you can debug a problem if a user encounters a bug and submits an obfuscated stack trace.
- A project's <code>mapping.txt</code> file is overwritten every time you do a release build, so you must be
- careful about saving the versions that you need.</p>
-
- <p>For example, say you publish an application and continue developing new features of
- the application for a new version. You then do a release build using ProGuard soon after. The
- build overwrites the previous <code>mapping.txt</code> file. A user submits a bug report
- containing a stack trace from the application that is currently published. You no longer have a way
- of debugging the user's stack trace, because the <code>mapping.txt</code> file associated with the version
- on the user's device is gone. There are other situations where your <code>mapping.txt</code> file can be overwritten, so
- ensure that you save a copy for every release that you anticipate you have to debug.</p>
-
- <p>How you save the <code>mapping.txt</code> file is your decision. For example, you can rename them to
- include a version or build number, or you can version control them along with your source
- code.</p>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/traceview.jd b/docs/html/guide/developing/tools/traceview.jd
deleted file mode 100644
index aa37481..0000000
--- a/docs/html/guide/developing/tools/traceview.jd
+++ /dev/null
@@ -1,16 +0,0 @@
-page.title=Traceview
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
-<p>Traceview is a graphical viewer for execution logs saved by your application.
-Traceview can help you debug your application and profile its performance.</p>
-
-<p>To start Traceview, enter the following command from the SDK <code>tools/</code> directory:</p>
- <pre>traceview</pre>
-</ol>
-
-<p>For more information on how to use Traceview, see
-<a href="{@docRoot}guide/developing/debugging/debugging-tracing.html">Profiling with Traceview and dmtracedump</a>
-</p>
-
diff --git a/docs/html/guide/developing/tools/zipalign.jd b/docs/html/guide/developing/tools/zipalign.jd
deleted file mode 100644
index 3216080..0000000
--- a/docs/html/guide/developing/tools/zipalign.jd
+++ /dev/null
@@ -1,67 +0,0 @@
-page.title=zipalign
-parent.title=Tools
-parent.link=index.html
-@jd:body
-
-<p>zipalign is an archive alignment tool that provides important
-optimization to Android application (.apk) files.
-The purpose is to ensure that all uncompressed data starts
-with a particular alignment relative to the start of the file. Specifically,
-it causes all uncompressed data within the .apk, such as images or raw files,
-to be aligned on 4-byte boundaries. This
-allows all portions to be accessed directly with {@code mmap()} even if they
-contain binary data with alignment restrictions.
-The benefit is a reduction in the amount of RAM consumed
-when running the application.</p>
-
-<p>This tool should always be used to align your .apk file before
-distributing it to end-users. The Android build tools can handle
-this for you. When using Eclipse with the ADT plugin, the Export Wizard
-will automatically zipalign your .apk after it signs it with your private key.
-The build scripts used
-when compiling your application with Ant will also zipalign your .apk,
-as long as you have provided the path to your keystore and the key alias in
-your project {@code ant.properties} file, so that the build tools
-can sign the package first.</p>
-
-<p class="caution"><strong>Caution:</strong> zipalign must only be performed
-<strong>after</strong> the .apk file has been signed with your private key.
-If you perform zipalign before signing, then the signing procedure will undo
-the alignment. Also, do not make alterations to the aligned package.
-Alterations to the archive, such as renaming or deleting entries, will
-potentially disrupt the alignment of the modified entry and all later
-entries. And any files added to an "aligned" archive will not be aligned.</p>
-
-<p>The adjustment is made by altering the size of
-the "extra" field in the zip Local File Header sections. Existing data
-in the "extra" fields may be altered by this process.</p>
-
-<p>For more information about how to use zipalign when building your
-application, please read <a href="{@docRoot}guide/publishing/app-signing.html">Signing
-Your Application</a>.</p>
-
-
-<h3>Usage</h3>
-
-<p>To align {@code infile.apk} and save it as {@code outfile.apk}:</p>
-
-<pre>zipalign [-f] [-v] <alignment> infile.apk outfile.apk</pre>
-
-<p>To confirm the alignment of {@code existing.apk}:</p>
-
-<pre>zipalign -c -v <alignment> existing.apk</pre>
-
-<p>The {@code <alignment>} is an integer that defines the byte-alignment boundaries.
-This must always be 4 (which provides 32-bit alignment) or else it effectively
-does nothing.</p>
-
-<p>Flags:</p>
-
-<ul>
- <li>{@code -f} : overwrite existing outfile.zip</li>
- <li>{@code -v} : verbose output</li>
- <li>{@code -c} : confirm the alignment of the given file</li>
-</ul>
-
-
-
diff --git a/docs/html/guide/google/index.jd b/docs/html/guide/google/index.jd
new file mode 100644
index 0000000..95c2816
--- /dev/null
+++ b/docs/html/guide/google/index.jd
@@ -0,0 +1,97 @@
+page.title=Google Services
+footer.hide=1
+@jd:body
+
+
+ <p>Google offers a variety of services that help you build new revenue streams, enhance your app's capabilities, manage distribution and payloads, and track usage and installs. Many of the services use static libraries that you download through the Android SDK Manager and build into your app. Others are configurable directly from Google Play Android Developer Console.</p>
+
+ <p>The sections below highlight some of the Google Services and link you to more information about how to use them in your Android app. </p>
+
+
+<h2 id="monetization">Monetize Your App</h2>
+
+<div class="vspace size-1"> </div>
+<div class="layout-content-row">
+
+ <div class="layout-content-col span-4">
+ <h4>In-App Billing</h4>
+ <p>Keep your users engaged by offering in-app purchases and subscriptions directly in your app.
+ </p>
+ <a href="{@docRoot}guide/google/play/billing/index.html">Learn more »</a>
+ </div>
+
+ <div class="layout-content-col span-4">
+ <h4>Google AdMob Ads</h4>
+ <p>Generate more revenue from your app by
+ displaying ads from multiple ad networks.</p>
+ <a href="https://developers.google.com/mobile-ads-sdk/docs/android/fundamentals">Learn more »</a>
+ </div>
+
+ <div class="layout-content-col span-4">
+ <h4>Application Licensing</h4>
+ <p>Protect your revenue streams and integrate policies for usage into your app.</p>
+ <a href="{@docRoot}guide/google/play/licensing/index.html">Learn more »</a>
+ </div>
+
+</div>
+
+<h2 id="integration">Manage App Distribution</h2>
+
+<div class="vspace size-1"> </div>
+
+<div class="layout-content-row">
+
+<div class="layout-content-col span-4">
+
+<h4>Google Play Filters</h4>
+<p>Make sure your app gets to the right users by
+declaring the hardware and software features needed by your app.</p>
+<a href="{@docRoot}guide/google/play/filters.html">Learn more »</a>
+</div>
+
+ <div class="layout-content-col span-4">
+<h4>Multiple APK Support</h4>
+<p>Distribute different APKs based on a variety of properties such as platform version, screen size, and GLES texture compression support.</p>
+<a href="{@docRoot}guide/google/play/publishing/multiple-apks.html">Learn more »</a>
+</div>
+
+ <div class="layout-content-col span-4">
+
+<h4>APK Expansion files</h4>
+<p>Take load off of your servers and utilize APK expansion files
+to deliver up to 4 GB of assets for your Android app, free.</p>
+
+<a href="{@docRoot}guide/google/play/expansion-files.html">Learn more »</a>
+</div>
+
+</div>
+
+<h2 id="integration">Enhance Your App's Capabilities</h2>
+
+<div class="vspace size-1"> </div>
+
+<div class="layout-content-row">
+
+<div class="layout-content-col span-4">
+ <h4>Android Cloud-to-Device Messaging </h4>
+ <p>Notify your apps of events with push messages that are lightweight
+ and battery-saving.</p>
+ <a href="https://developers.google.com/android/c2dm/">Learn more »</a>
+</div>
+
+<div class="layout-content-col span-4">
+ <h4>Google Maps</h4>
+ <p> The Google Maps library for Android lets you add powerful mapping and geo-location capabilities to your app.</p>
+ <a href="https://developers.google.com/maps/documentation/android/">Learn more »</a>
+</div>
+</div>
+
+
+<h2 id="integration">Track Performance with Analytics</h2>
+<p>Google Analytics gives you powerful insights into how users find your apps
+ and how they use them. <br />Start integrating analytics to measure
+ your app's success.</p>
+
+
+<div style="margin-bottom:1.5em;"><a href="https://developers.google.com/analytics/devguides/collection/android/">Learn more »</a></div>
+
\ No newline at end of file
diff --git a/docs/html/guide/google/play/billing/billing_about.html b/docs/html/guide/google/play/billing/billing_about.html
new file mode 100644
index 0000000..9f41fa62
--- /dev/null
+++ b/docs/html/guide/google/play/billing/billing_about.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+<meta http-equiv="refresh"
+content="0;url=http://developer.android.com/guide/google/play/billing/index.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/guide/google/play/billing/index.html">click
+here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/guide/google/play/billing/billing_admin.jd b/docs/html/guide/google/play/billing/billing_admin.jd
new file mode 100755
index 0000000..cb288a5
--- /dev/null
+++ b/docs/html/guide/google/play/billing/billing_admin.jd
@@ -0,0 +1,530 @@
+page.title=Administering In-app Billing
+parent.title=In-app Billing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#billing-list-setup">Creating a Product List</a></li>
+ <li><a href="#billing-purchase-type">Choosing a Purchase Type</a></li>
+ <li><a href="#billing-testing-setup">Setting up Test Accounts</a></li>
+ <li><a href="#billing-refunds">Handling Refunds</a></li>
+ <li><a href="#billing-support">Where to Get Support</a></li>
+ </ol>
+ <h2>Downloads</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">Sample
+ Application</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_overview.html">Overview of In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html">Implementing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and
+ Design</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_testing.html">Testing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_reference.html">In-app Billing
+ Reference</a></li>
+ </ol>
+</div>
+</div>
+
+<p>In-app billing frees you from processing financial transactions, but you still need to perform a
+few administrative tasks, including setting up and maintaining your product list on the publisher
+site, registering test accounts, and handling refunds when necessary.</p>
+
+<p>You must have a Google Play publisher account to register test accounts. And you must have a
+Google Wallet merchant account to create a product list and issue refunds to your users. If you
+already have a publisher account on Google Play, you can use your existing account. You do not
+need to register for a new account to support in-app billing. If you do not have a publisher
+account, you can register as a Google Play developer and set up a publisher account at the
+Google Play <a href="http://play.google.com/apps/publish">publisher site</a>. If you do not have a
+Google Wallet merchant account, you can register for one at the <a
+href="http://checkout.google.com">Google Wallet site</a>.</p>
+
+<h2 id="billing-list-setup">Creating a Product List</h2>
+
+<p>The Google Play publisher site provides a product list for each of your published
+applications. You can sell an item using Google Play's in-app billing feature only if the item is
+listed on an application's product list. Each application has its own product list; you cannot sell
+items that are listed in another application's product list.</p>
+
+<p>You can access an application's product list by clicking the <strong>In-App Products</strong>
+link that appears under each of the applications that are listed for your publisher account (see
+figure 1). The <strong>In-App Products</strong> link appears only if you have a Google Wallet
+merchant account and an application's manifest includes the <code>com.android.vending.BILLING</code>
+permission.</p>
+
+<img src="{@docRoot}images/billing_product_list_entry.png" height="548" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> You can access an application's product list by clicking the
+ <strong>In-App Products</strong> link.
+</p>
+
+<p>A product list specifies items you are selling in an application — in-app products,
+subscriptions, or a combination of both. For each item, the product list contains information such as a product id,
+product description, and price (see figure 2). The product list stores only metadata about the items
+you are selling in your application. It does not store any digital content. You are responsible for
+storing and delivering the digital content that you sell in your applications.</p>
+
+<img src="{@docRoot}images/billing_product_list.png" height="658" id="figure2" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> An application's product list.
+</p>
+
+<p>You can create a product list for any published application or any draft application that's been
+uploaded and saved to the Google Play site. However, you must have a Google Wallet merchant
+account and the application's manifest must include the <code>com.android.vending.BILLING</code>
+permission. If an application's manifest does not include this permission, you will be able to edit
+existing items in the product list but you will not be able to add new items to the list. For more
+information about this permission, see
+<a href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-permission">Updating Your
+Application's Manifest</a>.</p>
+
+<p>In addition, an application package can have only one product list. If you create a product
+list for an application, and you use the <a
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html">multiple APK feature</a> to distribute
+more than one APK for that application, the product list applies to all APK versions that are
+associated with the application listing. You cannot create individual product lists for each APK if
+you are using the multiple APK feature.</p>
+
+<p>You can add items to a product list two ways: you can add items one at a time by using the In-app
+Products UI (see figure 3), or you can add a batch of items by importing the items from a
+comma-separated values (CSV) file (see figure 2). Adding items one at a time is useful if your
+application has only a few in-app items or you are adding only a few items to a
+product list for testing purposes. The CSV file method is useful if your application has a large
+number of in-app items.</p>
+
+<p class="note"><strong>Note:</strong> Batch upload of product lists containing subscriptions is not yet supported.</p>
+
+<h3 id="billing-form-add">Adding items one at a time to a product list</h3>
+
+<p>To add an item to a product list using the In-app Products UI, follow these steps:</p>
+
+<ol>
+ <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
+ <li>In the <strong>All Google Play listings</strong> panel, under the application name, click
+ <strong>In-app Products</strong>.</li>
+ <li>On the In-app Products List page, click <strong>Add in-app product</strong>.</li>
+ <li>On the Create New In-app Product page (see figure 3), provide details about the item you are
+ selling and then click <strong>Save</strong> or <strong>Publish</strong>.</li>
+</ol>
+
+<img src="{@docRoot}images/billing_list_form.png" height="840" id="figure3" />
+<p class="img-caption">
+ <strong>Figure 3.</strong> The Create New In-app Product page lets you add items to an
+ application's product list.
+</p>
+
+<p>You must enter the following information for each item in a product list:</p>
+<ul>
+ <li><strong>In-app Product ID</strong>
+ <p>Product IDs are unique across an application's namespace. A product ID must start with a
+ lowercase letter or a number, and must be composed using only lowercase letters (a-z), numbers
+ (0-9), underlines (_), and dots (.). The product ID "android.test" is reserved, as are all
+ product IDs that start with "android.test."</p>
+ <p>In addition, you cannot modify an item's product ID after it is created, and you cannot reuse
+ a product ID.</p>
+ </li>
+ <li><strong>Purchase Type</strong>
+ <p>The purchase type can be <strong>Managed per user account</strong>, <strong>Unmanaged</strong>,
+ or <strong>Subscription</strong>. You can never change an item's purchase type after you set it. For more
+ information, see <a href="#billing-purchase-type">Choosing a purchase type</a> later in this
+ document.</p>
+ </li>
+ <li><strong>Publishing State</strong>
+ <p>An item's publishing state can be <strong>Published</strong> or <strong>Unpublished
+ </strong>. To be visible to a user during checkout, an item's publishing state must be set to
+ <strong>Published</strong> and the item's application must be published on Google Play.</p>
+ <p class="note"><strong>Note:</strong> This is not true for test accounts. An item is visible to
+ a test account if the application is not published and the item is published. See <a
+ href="{@docRoot}guide/google/play/billing/billing_testing.html#billing-testing-real">Testing In-app
+ Billing</a> for more information.</p>
+ </li>
+ <li><strong>Language</strong>
+ <p>The language setting determines which languages are used to display the item title and
+ item description during checkout. A product list inherits its default language from the
+ parent application. You can add more languages by clicking <strong>add language</strong>. You
+ can also choose to have the title and description automatically translated from the default
+ language by selecting the <strong>Fill fields with auto translation</strong> checkbox (see
+ figure 4). If you do not use the auto translation feature, you must provide the translated
+ versions of the title and description.</p>
+ </li>
+ <li><strong>Title</strong>
+ <p>The title is a short descriptor for the item. For example, "Sleeping potion." Titles must be
+ unique across an application's namespace. Every item must have a title. The title is visible to
+ users during checkout. For optimum appearance, titles should be no longer than 25 characters;
+ however, titles can be up to 55 characters in length.</p>
+ </li>
+ <li><strong>Description</strong>
+ <p>The description is a long descriptor for the item. For example, "Instantly puts creatures to
+ sleep. Does not work on angry elves." Every item must have a description. The description is
+ visible to users during checkout. Descriptions can be up to 80 characters in length.</p>
+ </li>
+ <li><strong>Price</strong>
+ <p>You must provide a default price in your home currency. You can also provide prices in other
+ currencies, but you can do this only if a currency's corresponding country is listed as a
+ target country for your application. You can specify target countries on the Edit Application
+ page in the Google Play developer console.</p>
+ <p>To specify prices in other currencies, you can manually enter the price for each
+ currency or you can click <strong>Auto Fill</strong> and let Google Play do a one-time
+ conversion from your home currency to the currencies you are targeting (see figure 4).</p>
+ <p>For subscription items, note that you can not change the item's price once you have published it. </p>
+ </li>
+</ul>
+<img src="{@docRoot}images/billing_list_form_2.png" height="1226" id="figure4" />
+<p class="img-caption">
+ <strong>Figure 4.</strong> Specifying additional currencies and additional languages for the
+ item title and description.
+</p>
+
+<p>For more information about product IDs and product lists, see <a
+href="http://market.android.com/support/bin/answer.py?answer=1072599">Creating In-App Product
+IDs</a>. For more information about pricing, see <a
+href="http://market.android.com/support/bin/answer.py?answer=1153485">In-App Billing
+Pricing</a>.</p>
+
+<p class="note"><strong>Note</strong>: Be sure to plan your product ID namespace. You cannot reuse
+or modify product IDs after you save them.</p>
+
+<h3 id="billing-bulk-add">Adding a batch of items to a product list</h3>
+
+<p>To add a batch of items to a product list using a CSV file, you first need to create your CSV
+file. The data values that you specify in the CSV file represent the same data values you specify
+manually through the In-app Products UI (see <a href="#billing-form-add">Adding items one at a time
+to a product list</a>).
+
+<p>If you are importing and exporting CSV files with in-app products, please
+keep tax-inclusive pricing in mind. If you use auto-fill, you can provide a
+tax-exclusive default price and tax-inclusive prices will be auto-filled. If you
+do not use auto-fill, prices you provide must include tax.</p>
+
+<p class="note"><strong>Note:</strong> Batch upload of product lists containing subscriptions is not yet supported.</p>
+
+The CSV file uses commas (,) and semi-colons (;) to separate data values.
+Commas are used to separate primary data values, and semi-colons are used to separate subvalues. For
+example, the syntax for the CSV file is as follows:</p>
+
+<p>"<em>product_id</em>","<em>publish_state</em>","<em>purchase_type</em>","<em>autotranslate</em>
+","<em>locale</em>; <em>title</em>; <em>description</em>","<em>autofill</em>","<em>country</em>;
+<em>price</em>"
+</p>
+
+<p>Descriptions and usage details are provided below.</p>
+
+<ul>
+ <li><em>product_id</em>
+ <p>This is equivalent to the In-app Product ID setting in the In-app Products UI. If you specify
+ a <em>product_id</em> that already exists in a product list, and you choose to overwrite
+ the product list while importing the CSV file, the data for the existing item is overwritten with
+ the values specified in the CSV file. The overwrite feature does not delete items that are on a
+ product list but not present in the CSV file.</p>
+ </li>
+ <li><em>publish_state</em>
+ <p>This is equivalent to the Publishing State setting in the In-app Products UI. Can be <code>
+ published</code> or <code>unpublished</code>.</p>
+ </li>
+ <li><em>purchase_type</em>
+ <p>This is equivalent to the Purchase Type setting in the In-app Products UI. Can be <code>
+ managed_by_android</code>, which is equivalent to <strong>Managed per user account
+ </strong> in the In-app Products UI, or <code>managed_by_publisher</code>, which is equivalent
+ to <strong>Unmanaged</strong> in the In-app Products UI.</p>
+ </li>
+ <li><em>autotranslate</em>
+ <p>This is equivalent to selecting the <strong>Fill fields with auto translation</strong>
+ checkbox in the In-app Products UI. Can be <code>true</code> or <code>false</code>.</p>
+ </li>
+ <li><em>locale</em>
+ <p>This is equivalent to the Language setting in the In-app Products UI. You must have an entry
+ for the default locale. The default locale must be the first entry in the list of
+ locales, and it must include a <em>title</em> and <em>description</em>. If you want to provide
+ translated versions of the <em>title</em> and <em>description</em> in addition to the default,
+ you must use the following syntax rules:</p>
+ <p>If <em>autotranslate</em> is <code>true</code>, you must specify the default locale,
+ default title, default description, and other locales using the following format:</p>
+ <p>"true,"<em>default_locale</em>; <em>default_locale_title</em>;
+ <em>default_locale_description</em>; <em>locale_2</em>; <em>locale_3</em>, ..."</p>
+ <p>If <em>autotranslate</em> is <code>false</code>, you must specify the default locale,
+ default title, and default description as well as the translated titles and descriptions using
+ the following format:</p>
+ <p>"false,"<em>default_locale</em>; <em>default_locale_title</em>;
+ <em>default_locale_description</em>; <em>locale_2</em>; <em>locale_2_title</em>;
+ <em>local_2_description</em>; <em>locale_3</em>; <em>locale_3_title</em>;
+ <em>locale_3_description</em>; ..."</p>
+ <p>See table 1 for a list of the language codes you can use with the <em>locale</em> field.</p>
+ </li>
+ <li><em>title</em>
+ <p>This is equivalent to the Title setting in the In-app Products UI. If the <em>title</em>
+ contains a semicolon, it must be escaped with a backslash (for example, "\;"). A backslash
+ should also be escaped with a backslash (for example, "\\">.</p>
+ </li>
+ <li><em>description</em>
+ <p>This is equivalent to the Description in the In-app Products UI. If the <em>description</em>
+ contains a semicolon, it must be escaped with a backslash (for example, "\;"). A backslash
+ should also be escaped with a backslash (for example, "\\">.</p>
+ </li>
+ <li><em>autofill</em>
+ <p>This is equivalent to clicking <strong>Auto Fill</strong> in the In-app Products UI. Can be
+ <code>true</code> or <code>false</code>. The syntax for specifying the <em>country</em>
+ and <em>price</em> varies depending on which <em>autofill</em> setting you use.</p>
+ <p>If <em>autofill</em> is set to <code>true</code>, you need to specify only the default
+ price in your home currency and you must use this syntax:</p>
+ <p>"true","<em>default_price_in_home_currency</em>"
+ <p>If <em>autofill</em> is set to <code>false</code>, you need to specify a <em>country</em>
+ and a <em>price</em> for each currency and you must use the following syntax:</p>
+ <p>"false", "<em>home_country</em>; <em>default_price_in_home_currency</em>; <em>country_2</em>;
+ <em>country_2_price</em>; <em>country_3</em>; <em>country_3_price</em>; ..."</p>
+ </li>
+ <li><em>country</em>
+ <p>The country for which you are specifying a price. You can only list countries that your
+ application is targeting. The country codes are two-letter uppercase
+ ISO country codes (such as "US") as defined by
+ <a href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-2</a>.</p>
+ </li>
+ <li><em>price</em>
+ <p>This is equivalent to the Price in the In-app Products UI. The price must be specified in
+ micro-units. To convert a currency value to micro-units, you multiply the real value by 1,000,000.
+ For example, if you want to sell an in-app item for $1.99 you specify 1990000 in the
+ <em>price</em> field.</p>
+ </li>
+</ul>
+
+<p class="table-caption" id="language-table"><strong>Table 1.</strong> Language codes you can use
+with the <em>locale</em> field.</p>
+
+<table>
+
+<tr>
+<th>Language</th>
+<th>Code</th>
+<th>Language</th>
+<th>Code</th>
+</tr>
+<tr>
+<td>Chinese</td>
+<td>zh_TW</td>
+<td>Italian</td>
+<td>it_IT</td>
+</tr>
+<tr>
+<td>Czech</td>
+<td>cs_CZ</td>
+<td>Japanese</td>
+<td>ja_JP</td>
+</tr>
+<tr>
+<td>Danish</td>
+<td>da_DK</td>
+<td>Korean</td>
+<td>ko_KR</td>
+</tr>
+<tr>
+<td>Dutch</td>
+<td>nl_NL</td>
+<td>Norwegian</td>
+<td>no_NO</td>
+</tr>
+<tr>
+<td>English</td>
+<td>en_US</td>
+<td>Polish</td>
+<td>pl_PL</td>
+</tr>
+<tr>
+<td>French</td>
+<td>fr_FR</td>
+<td>Portuguese</td>
+<td>pt_PT</td>
+</tr>
+<tr>
+<td>Finnish</td>
+<td>fi_FI</td>
+<td>Russian</td>
+<td>ru_RU</td>
+</tr>
+<tr>
+<td>German</td>
+<td>de_DE</td>
+<td>Spanish</td>
+<td>es_ES</td>
+</tr>
+<tr>
+<td>Hebrew</td>
+<td>iw_IL</td>
+<td>Swedish</td>
+<td>sv_SE</td>
+</tr>
+<tr>
+<td>Hindi</td>
+<td>hi_IN</td>
+<td>--</td>
+<td>--</td>
+</tr>
+</table>
+
+<p>To import the items that are specified in your CSV file, do the following:</p>
+
+<ol>
+ <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
+ <li>In the <strong>All Google Play listings</strong> panel, under the application name, click
+ <strong>In-app Products</strong>.</li>
+ <li>On the In-app Products List page, click <strong>Choose File</strong> and select your CSV
+file.
+ <p>The CSV file must be on your local computer or on a local disk that is connected to your
+ computer.</p>
+ </li>
+ <li>Select the <strong>Overwrite</strong> checkbox if you want to overwrite existing items in
+ your product list.
+ <p>This option overwrites values of existing items only if the value of the <em>product_id</em>
+ in the CSV file matches the In-app Product ID for an existing item in the product list.
+ Overwriting does not delete items that are on a product list but not present in the CSV
+ file.</p>
+ </li>
+ <li>On the In-app Products List page, click <strong>Import from CSV</strong>.</li>
+</ol>
+
+<p>You can also export an existing product list to a CSV file by clicking <strong>Export to CSV
+</strong> on the In-app Product List page. This is useful if you have manually added items to
+a product list and you want to start managing the product list through a CSV file.</p>
+
+<h3 id="billing-purchase-type">Choosing a Purchase Type</h3>
+
+<p>An item's purchase type controls how Google Play manages the purchase of the item. There are
+two purchase types: "managed per user account" and "unmanaged."</p>
+
+<p>Items that are managed per user account can be purchased only once per user account. When an item
+is managed per user account, Google Play permanently stores the transaction information for each
+item on a per-user basis. This enables you to query Google Play with the
+<code>RESTORE_TRANSACTIONS</code> request and restore the state of the items a specific user has
+purchased.</p>
+
+<p>If a user attempts to purchase a managed item that has already been purchased, Google Play
+displays an "Item already purchased" error. This occurs during checkout, when Google Play
+displays the price and description information on the checkout page. When the user dismisses the
+error message, the checkout page disappears and the user returns to your user interface. As a best
+practice, your application should prevent the user from seeing this error. The sample application
+demonstrates how you can do this by keeping track of items that are managed and already purchased
+and not allowing users to select those items from the list. Your application should do something
+similar—either graying out the item or hiding it so that it cannot be selected.</p>
+
+<p>The "manage by user account" purchase type is useful if you are selling items such as game levels
+or application features. These items are not transient and usually need to be restored whenever a
+user reinstalls your application, wipes the data on their device, or installs your application on a
+new device.</p>
+
+<p>Items that are unmanaged do not have their transaction information stored on Google Play,
+which means you cannot query Google Play to retrieve transaction information for items whose
+purchase type is listed as unmanaged. You are responsible for managing the transaction information
+of unmanaged items. Also, unmanaged items can be purchased multiple times as far as Google Play
+is concerned, so it's also up to you to control how many times an unmanaged item can be
+purchased.</p>
+
+<p>The "unmanaged" purchase type is useful if you are selling consumable items, such as fuel or
+magic spells. These items are consumed within your application and are usually purchased multiple
+times.</p>
+
+<h2 id="billing-refunds">Handling Refunds</h2>
+
+<p>In-app billing does not allow users to send a refund request to Google Play. Refunds for
+in-app purchases must be directed to you (the application developer). You can then process the
+refund through your Google Wallet merchant account. When you do this, Google Play receives a
+refund notification from Google Wallet, and Google Play sends a refund message to your
+application. For more information, see <a
+href="{@docRoot}guide/google/play/billing/billing_overview.html#billing-action-notify">Handling
+IN_APP_NOTIFY messages</a> and <a
+href="http://www.google.com/support/androidmarket/bin/answer.py?answer=1153485">In-app Billing
+Pricing</a>.</p>
+
+<p class="caution"><strong>Important:</strong> You cannot use the Google Wallet API to issue
+refunds or cancel in-app billing transactions. You must do this manually through your Google
+Wallet merchant account. However, you can use the Google Wallet API to retrieve order
+information.</p>
+
+<h2 id="billing-testing-setup">Setting Up Test Accounts</h2>
+
+<p>The Google Play publisher site lets you set up one or more test accounts. A test account is a
+regular Google account that you register on the publisher site as a test account. Test accounts are
+authorized to make in-app purchases from applications that you have uploaded to the Google Play
+site but have not yet published.</p>
+
+<p>You can use any Google account as a test account. Test accounts are useful if you want to let
+multiple people test in-app billing on applications without giving them access to your publisher
+account's sign-in credentials. If you want to own and control the test accounts, you can create the
+accounts yourself and distribute the credentials to your developers or testers.</p>
+
+<p>Test accounts have three limitations:</p>
+
+<ul>
+ <li>Test account users can make purchase requests only within applications that are already
+ uploaded to your publisher account (although the application doesn't need to be published).</li>
+ <li>Test accounts can only be used to purchase items that are listed (and published) in an
+ application's product list.</li>
+ <li>Test account users do not have access to your publisher account and cannot upload applications
+ to your publisher account.</li>
+</ul>
+
+<p>To add test accounts to your publisher account, follow these steps:</p>
+
+<ol>
+ <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
+ <li>On the upper left part of the page, under your name, click <strong>Edit profile</strong>.</li>
+ <li>On the Edit Profile page, scroll down to the Licensing & In-app Billing panel (see figure
+ 5).</li>
+ <li>In Test Accounts, add the email addresses for the test accounts you want to register,
+ separating each account with a comma.</li>
+ <li>Click <strong>Save</strong> to save your profile changes.</li>
+</ol>
+
+<img src="{@docRoot}images/billing_public_key.png" height="510" id="figure5" />
+<p class="img-caption">
+ <strong>Figure 5.</strong> The Licensing and In-app Billing panel of your account's Edit Profile
+ page lets you register test accounts.
+</p>
+
+<h2 id="billing-support">Where to Get Support</h2>
+
+<p>If you have questions or encounter problems while implementing in-app billing, contact the
+support resources listed in the following table (see table 2). By directing your queries to the
+correct forum, you can get the support you need more quickly.</p>
+
+<p class="table-caption" id="support-table"><strong>Table 2.</strong> Developer support resources
+for Google Play in-app billing.</p>
+
+<table>
+
+<tr>
+<th>Support Type</th>
+<th>Resource</th>
+<th>Range of Topics</th>
+</tr>
+<tr>
+<td rowspan="2">Development and testing issues</td>
+<td>Google Groups: <a
+href="http://groups.google.com/group/android-developers">android-developers</a> </td>
+<td rowspan="2">In-app billing integration questions, user experience ideas, handling of responses,
+obfuscating code, IPC, test environment setup.</td>
+</tr>
+<tr>
+<td>Stack Overflow: <a
+href="http://stackoverflow.com/questions/tagged/android">http://stackoverflow.com/questions/tagged/
+android</a></td>
+</tr>
+<tr>
+<td>Billing issue tracker</td>
+<td><a href="http://code.google.com/p/marketbilling/issues/">Billing
+project issue tracker</a></td>
+<td>Bug and issue reports related specifically to in-app billing sample code.</td>
+</tr>
+</table>
+
+<p>For general information about how to post to the groups listed above, see <a
+href="{@docRoot}resources/community-groups.html">Developer Forums</a> document in the Resources
+tab.</p>
+
+
+
diff --git a/docs/html/guide/google/play/billing/billing_best_practices.jd b/docs/html/guide/google/play/billing/billing_best_practices.jd
new file mode 100755
index 0000000..49d2a29
--- /dev/null
+++ b/docs/html/guide/google/play/billing/billing_best_practices.jd
@@ -0,0 +1,111 @@
+page.title=Security and Design
+parent.title=In-app Billing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#billing-security">Security Best Practices</a></li>
+ </ol>
+ <h2>Downloads</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">Sample
+ Application</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_overview.html">Overview of In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html">Implementing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_testing.html">Testing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_admin.html">Administering In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_reference.html">In-app Billing
+ Reference</a></li>
+ </ol>
+</div>
+</div>
+
+<p>As you design your in-app billing implementation, be sure to follow the security and design
+guidelines that are discussed in this document. These guidelines are recommended best practices for
+anyone who is using Google Play's in-app billing service.</p>
+
+<h2>Security Best Practices</h2>
+
+<h4>Perform signature verification tasks on a server</h4>
+<p>If practical, you should perform signature verification on a remote server and not on a device.
+Implementing the verification process on a server makes it difficult for attackers to break the
+verification process by reverse engineering your .apk file. If you do offload security processing to
+a remote server, be sure that the device-server handshake is secure.</p>
+
+<h4>Protect your unlocked content</h4>
+<p>To prevent malicious users from redistributing your unlocked content, do not bundle it in your
+.apk file. Instead, do one of the following:</p>
+ <ul>
+ <li>Use a real-time service to deliver your content, such as a content feed. Delivering content
+ through a real-time service allows you to keep your content fresh.</li>
+ <li>Use a remote server to deliver your content.</li>
+ </ul>
+<p>When you deliver content from a remote server or a real-time service, you can store the unlocked
+content in device memory or store it on the device's SD card. If you store content on an SD card, be
+sure to encrypt the content and use a device-specific encryption key.</p>
+
+<h4>Obfuscate your code</h4>
+<p>You should obfuscate your in-app billing code so it is difficult for an attacker to reverse
+engineer security protocols and other application components. At a minimum, we recommend that you
+run an obfuscation tool like <a
+href="http://developer.android.com/tools/proguard.html">Proguard</a> on your
+code.</p>
+<p>In addition to running an obfuscation program, we recommend that you use the following techniques
+to obfuscate your in-app billing code.</p>
+<ul>
+ <li>Inline methods into other methods.</li>
+ <li>Construct strings on the fly instead of defining them as constants.</li>
+ <li>Use Java reflection to call methods.</li>
+</ul>
+<p>Using these techniques can help reduce the attack surface of your application and help minimize
+attacks that can compromise your in-app billing implementation.</p>
+<div class="note">
+ <p><strong>Note:</strong> If you use Proguard to obfuscate your code, you must add the following
+ line to your Proguard configuration file:</p>
+ <p><code>-keep class com.android.vending.billing.**</code></p>
+</div>
+
+<h4>Modify all sample application code</h4>
+<p>The in-app billing sample application is publicly distributed and can be downloaded by anyone,
+which means it is relatively easy for an attacker to reverse engineer your application if you use
+the sample code exactly as it is published. The sample application is intended to be used only as an
+example. If you use any part of the sample application, you must modify it before you publish it or
+release it as part of a production application.</p>
+<p>In particular, attackers look for known entry points and exit points in an application, so it is
+important that you modify these parts of your code that are identical to the sample application.</p>
+
+<h4>Use secure random nonces</h4>
+<p>Nonces must not be predictable or reused. Always use a cryptographically secure random number
+generator (like {@link java.security.SecureRandom}) when you generate nonces. This can help reduce
+replay attacks.</p>
+<p>Also, if you are performing nonce verification on a server, make sure that you generate the
+nonces on the server.</p>
+
+<h4>Take action against trademark and copyright infringement</h4>
+<p>If you see your content being redistributed on Google Play, act quickly and decisively. File a
+<a href="http://market.android.com/support/bin/answer.py?hl=en&answer=141511">trademark notice
+of infringement</a> or a <a href="http://www.google.com/android_dmca.html">copyright notice of
+infringement</a>.</p>
+
+<h4>Implement a revocability scheme for unlocked content</h4>
+<p>If you are using a remote server to deliver or manage content, have your application verify the
+purchase state of the unlocked content whenever a user accesses the content. This allows you to
+revoke use when necessary and minimize piracy.</p>
+
+<h4>Protect your Google Play public key</h4>
+<p>To keep your public key safe from malicious users and hackers, do not embed it in any code as a
+literal string. Instead, construct the string at runtime from pieces or use bit manipulation (for
+example, XOR with some other string) to hide the actual key. The key itself is not secret
+information, but you do not want to make it easy for a hacker or malicious user to replace the
+public key with another key.</p>
+
diff --git a/docs/html/guide/google/play/billing/billing_integrate.jd b/docs/html/guide/google/play/billing/billing_integrate.jd
new file mode 100755
index 0000000..2d1582e
--- /dev/null
+++ b/docs/html/guide/google/play/billing/billing_integrate.jd
@@ -0,0 +1,1100 @@
+page.title=Implementing In-app Billing
+parent.title=In-app Billing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#billing-download">Downloading the Sample Application</a></li>
+ <li><a href="#billing-add-aidl">Adding the AIDL file to your project</a></li>
+ <li><a href="#billing-permission">Updating Your Application's Manifest</a></li>
+ <li><a href="#billing-service">Creating a Service</a></li>
+ <li><a href="#billing-broadcast-receiver">Creating a BroadcastReceiver</a></li>
+ <li><a href="#billing-signatures">Creating a security processing component</a></li>
+ <li><a href="#billing-implement">Modifying Your Application Code</a></li>
+ </ol>
+ <h2>Downloads</h2>
+ <ol>
+ <li><a href="#billing-download">Sample Application</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_overview.html">Overview of In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and
+ Design</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_testing.html">Testing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_admin.html">Administering In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_reference.html">In-app Billing
+ Reference</a></li>
+ </ol>
+</div>
+</div>
+
+<p>In-app Billing on Google Play provides a straightforward, simple interface for sending in-app
+billing requests and managing in-app billing transactions using Google Play. This document helps
+you implement in-app billing by stepping through the primary implementation tasks, using the in-app
+billing sample application as an example.</p>
+
+<p>Before you implement in-app billing in your own application, be sure that you read <a
+href="{@docRoot}guide/google/play/billing/billing_overview.html">Overview of In-app Billing</a> and <a
+href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and Design</a>. These
+documents provide background information that will make it easier for you to implement in-app
+billing.</p>
+
+<p>To implement in-app billing in your application, you need to do the following:</p>
+<ol>
+ <li><a href="#billing-download">Download the in-app billing sample application</a>.</li>
+ <li><a href="#billing-add-aidl">Add the IMarketBillingService.aidl file</a> to your project.</li>
+ <li><a href="#billing-permission">Update your AndroidManifest.xml file</a>.</li>
+ <li><a href="#billing-service">Create a Service</a> and bind it to the
+ <code>MarketBillingService</code> so your application can send billing requests and receive
+ billing responses from Google Play.</li>
+ <li><a href="#billing-broadcast-receiver">Create a BroadcastReceiver</a> to handle broadcast
+ intents from Google Play.</li>
+ <li><a href="#billing-signatures">Create a security processing component</a> to verify the
+ integrity of the transaction messages that are sent by Google Play.</li>
+ <li><a href="#billing-implement">Modify your application code</a> to support in-app billing.</li>
+</ol>
+
+<h2 id="billing-download">Downloading the Sample Application</h2>
+
+<p>The in-app billing sample application shows you how to perform several tasks that are common to
+all in-app billing implementations, including:</p>
+
+<ul>
+ <li>Sending in-app billing requests to Google Play.</li>
+ <li>Handling synchronous responses from Google Play.</li>
+ <li>Handling broadcast intents (asynchronous responses) from Google Play.</li>
+ <li>Using in-app billing security mechanisms to verify the integrity of billing responses.</li>
+ <li>Creating a user interface that lets users select items for purchase.</li>
+</ul>
+
+<p>The sample application includes an application file (<code>Dungeons.java</code>), the AIDL file
+for the <code>MarketBillingService</code> (<code>IMarketBillingService.aidl</code>), and several
+classes that demonstrate in-app billing messaging. It also includes a class that demonstrates basic
+security tasks, such as signature verification.</p>
+
+<p>Table 1 lists the source files that are included with the sample application.</p>
+<p class="table-caption" id="source-files-table"><strong>Table 1.</strong> In-app billing sample
+application source files.</p>
+
+<table>
+<tr>
+<th>File</th>
+<th>Description</th>
+</tr>
+
+<tr>
+<td>IMarketBillingService.aidl</td>
+<td>Android Interface Definition Library (AIDL) file that defines the IPC interface to Google
+Play's in-app billing service (<code>MarketBillingService</code>).</td>
+</tr>
+
+<tr>
+<td>Dungeons.java</td>
+<td>Sample application file that provides a UI for making purchases and displaying purchase
+history.</td>
+</tr>
+
+<tr>
+<td>PurchaseDatabase.java</td>
+<td>A local database for storing purchase information.</td>
+</tr>
+
+<tr>
+ <td>BillingReceiver.java</td>
+ <td>A {@link android.content.BroadcastReceiver} that receives asynchronous response messages
+ (broadcast intents) from Google Play. Forwards all messages to the
+ <code>BillingService</code>.</td>
+</tr>
+<tr>
+ <td>BillingService.java</td>
+ <td>A {@link android.app.Service} that sends messages to Google Play on behalf of the
+ application by connecting (binding) to the <code>MarketBillingService</code>.</td>
+</tr>
+
+<tr>
+ <td>ResponseHandler.java</td>
+ <td>A {@link android.os.Handler} that contains methods for updating the purchases database and the
+ UI.</td>
+</tr>
+
+<tr>
+ <td>PurchaseObserver.java</td>
+ <td>An abstract class for observing changes related to purchases.</td>
+</tr>
+
+<tr>
+<td>Security.java</td>
+<td>Provides various security-related methods.</td>
+</tr>
+
+<tr>
+<td>Consts.java</td>
+<td>Defines various Google Play constants and sample application constants. All constants that
+are defined by Google Play must be defined the same way in your application.</td>
+</tr>
+
+<tr>
+<td>Base64.java and Base64DecoderException.java</td>
+<td>Provides conversion services from binary to Base64 encoding. The <code>Security</code> class
+relies on these utility classes.</td>
+</tr>
+
+</table>
+
+<p>The in-app billing sample application is available as a downloadable component of the Android
+SDK. To download the sample application component, launch the Android SDK Manager and then
+select the <strong>Google Market Billing package</strong> component (see figure 1), and click <strong>Install
+Selected</strong> to begin the download.</p>
+
+
+<img src="{@docRoot}images/billing_package.png" height="325" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> The Google Market Billing package contains the sample application and
+ the AIDL file.
+</p>
+
+<p>When the download is complete, the Android SDK Manager saves the component into the
+following directory:</p>
+
+<p><code><sdk>/extras/google/market_billing/</code></p>
+
+<p>If you want to see an end-to-end demonstration of in-app billing before you integrate in-app
+billing into your own application, you can build and run the sample application. Building and
+running the sample application involves three tasks:</p>
+
+<ul>
+ <li>Configuring and building the sample application.</li>
+ <li>Uploading the sample application to Google Play.</li>
+ <li>Setting up test accounts and running the sample application.</li>
+</ul>
+
+<p class="note"><strong>Note:</strong> Building and running the sample application is necessary only
+if you want to see a demonstration of in-app billing. If you do not want to run the sample
+application, you can skip to the next section, <a href="#billing-add-aidl">Adding the AIDL file to
+your project</a>.</p>
+
+<h3>Configuring and building the sample application</h3>
+
+<p>Before you can run the sample application, you need to configure it and build it by doing the
+following:</p>
+
+<ol>
+ <li><strong>Add your Google Play public key to the sample application code.</strong>
+ <p>This enables the application to verify the signature of the transaction information that is
+ returned from Google Play. To add your public key to the sample application code, do the
+ following:</p>
+ <ol>
+ <li>Log in to your Google Play <a href="http://play.google.com/apps/publish">publisher
+ account</a>.</li>
+ <li>On the upper left part of the page, under your name, click <strong>Edit
+ Profile</strong>.</li>
+ <li>On the Edit Profile page, scroll down to the <strong>Licensing & In-app
+ Billing</strong> panel.</li>
+ <li>Copy your public key.</li>
+ <li>Open <code>src/com/example/dungeons/Security.java</code> in the editor of your choice.
+ <p>You can find this file in the sample application's project folder.</p>
+ </li>
+ <li>Add your public key to the following line of code:
+ <p><code>String base64EncodedPublicKey = "your public key here";</code></p>
+ </li>
+ <li>Save the file.</li>
+ </ol>
+ </li>
+ <li><strong>Change the package name of the sample application.</strong>
+ <p>The current package name is <code>com.example.dungeons</code>. Google Play does not let
+ you upload applications with package names that contain <code>com.example</code>, so you must
+ change the package name to something else.</p>
+ </li>
+ <li><strong>Build the sample application in release mode and sign it.</strong>
+ <p>To learn how to build and sign applications, see <a
+ href="{@docRoot}tools/building/index.html">Building and Running</a>.</p>
+ </li>
+</ol>
+
+<h3>Uploading the sample application</h3>
+
+<p>After you build a release version of the sample application and sign it, you need to upload it as
+a draft to the Google Play publisher site. You also need to create a product list for the in-app
+items that are available for purchase in the sample application. The following instructions show you
+how to do this.</p>
+<ol>
+ <li><strong>Upload the release version of the sample application to Google Play.</strong>
+ <p>Do not publish the sample application; leave it as an unpublished draft application. The
+ sample application is for demonstration purposes only and should not be made publicly available
+ on Google Play. To learn how to upload an application to Google Play, see <a
+ href="http://market.android.com/support/bin/answer.py?answer=113469">Uploading
+ applications</a>.</p>
+ </li>
+ <li><strong>Create a product list for the sample application.</strong>
+ <p>The sample application lets you purchase two items: a two-handed sword
+ (<code>sword_001</code>) and a potion (<code>potion_001</code>). We recommend that you set up
+ your product list so that <code>sword_001</code> has a purchase type of "Managed per user
+ account" and <code>potion_001</code> has a purchase type of "Unmanaged" so you can see how these
+ two purchase types behave. To learn how to set up a product list, see <a
+ href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-list-setup">Creating a Product
+ List</a>.</p>
+ <p class="note"><strong>Note:</strong> You must publish the items in your product
+ list (<code>sword_001</code> and <code>potion_001</code>) even though you are not publishing the
+ sample application. Also, you must have a Google Wallet Merchant account to add items to the
+ sample application's product list.</p>
+ </li>
+</ol>
+
+<h3>Running the sample application</h3>
+
+<p>You cannot run the sample application in the emulator. You must install the sample application
+onto a device to run it. To run the sample application, do the following:</p>
+
+<ol>
+ <li><strong>Make sure you have at least one test account registered under your Google Play
+ publisher account.</strong>
+ <p>You cannot purchase items from yourself (Google Wallet prohibits this), so you need to
+ create at least one test account that you can use to purchase items in the sample application.
+ To learn how to set up a test account, see <a
+ href="{@docRoot}guide/google/play/billing/billing_testing.html#billing-testing-setup">Setting up Test
+ Accounts</a>.</p>
+ </li>
+ <li><strong>Verify that your device is running a supported version of the Google Play
+ application or the MyApps application.</strong>
+ <p>If your device is running Android 3.0, in-app billing requires version 5.0.12 (or higher) of
+ the MyApps application. If your device is running any other version of Android, in-app billing
+ requires version 2.3.4 (or higher) of the Google Play application. To learn how to check the
+ version of the Google Play application, see <a
+ href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google
+ Play</a>.</p>
+ </li>
+ <li><strong>Install the application onto your device.</strong>
+ <p>Even though you uploaded the application to Google Play, the application is not published,
+ so you cannot download it from Google Play to a device. Instead, you must install the
+ application onto your device. To learn how to install an application onto a device, see <a
+ href="{@docRoot}tools/building/building-cmdline.html#RunningOnDevice">Running on a
+ device</a>.</p>
+ </li>
+ <li><strong>Make one of your test accounts the primary account on your device.</strong>
+ <p>The primary account on your device must be one of the <a
+ href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-testing-setup">test accounts</a>
+ that you registered on the Google Play publisher site. If the primary account on your device is not a
+ test account, you must do a factory reset of the device and then sign in with one of your test
+ accounts. To perform a factory reset, do the following:</p>
+ <ol>
+ <li>Open Settings on your device.</li>
+ <li>Touch <strong>Privacy</strong>.</li>
+ <li>Touch <strong>Factory data reset</strong>.</li>
+ <li>Touch <strong>Reset phone</strong>.</li>
+ <li>After the phone resets, be sure to sign in with one of your test accounts during the
+ device setup process.</li>
+ </ol>
+ </li>
+ <li><strong>Run the application and purchase the sword or the potion.</strong>
+ <p>When you use a test account to purchase items, the test account is billed through Google
+ Wallet and your Google Wallet Merchant account receives a payout for the purchase.
+ Therefore, you may want to refund purchases that are made with test accounts, otherwise the
+ purchases will show up as actual payouts to your merchant account.</p>
+</ol>
+
+<p class="note"><strong>Note</strong>: Debug log messages are turned off by default in the
+sample application. You can turn them on by setting the variable <code>DEBUG</code>
+to <code>true</code> in the <code>Consts.java</code> file.</p>
+
+<h2 id="billing-add-aidl">Adding the AIDL file to your project</h2>
+
+<p>The sample application contains an Android Interface Definition Language (AIDL) file, which
+defines the interface to Google Play's in-app billing service
+(<code>MarketBillingService</code>). When you add this file to your project, the Android build
+environment creates an interface file (<code>IMarketBillingService.java</code>). You can then use
+this interface to make billing requests by invoking IPC method calls.</p>
+
+<p>If you are using the ADT plug-in with Eclipse, you can just add this file to your
+<code>/src</code> directory. Eclipse will automatically generate the interface file when you build
+your project (which should happen immediately). If you are not using the ADT plug-in, you can put
+the AIDL file into your project and use the Ant tool to build your project so that the
+<code>IMarketBillingService.java</code> file gets generated.</p>
+
+<p>To add the <code>IMarketBillingService.aidl</code> file to your project, do the following:</p>
+
+<ol>
+ <li>Create the following directory in your application's <code>/src</code> directory:
+ <p><code>com/android/vending/billing/</code></p>
+ </li>
+ <li>Copy the <code>IMarketBillingService.aidl</code> file into the
+ <code>sample/src/com/android/vending/billing/</code> directory.</li>
+ <li>Build your application.</li>
+</ol>
+
+<p>You should now find a generated interface file named <code>IMarketBillingService.java</code> in
+the <code>gen</code> folder of your project.</p>
+
+<h2 id="billing-permission">Updating Your Application's Manifest</h2>
+
+<p>In-app billing relies on the Google Play application, which handles all communication between
+your application and the Google Play server. To use the Google Play application, your
+application must request the proper permission. You can do this by adding the
+<code>com.android.vending.BILLING</code> permission to your AndroidManifest.xml file. If your
+application does not declare the in-app billing permission, but attempts to send billing requests,
+Google Play will refuse the requests and respond with a <code>RESULT_DEVELOPER_ERROR</code>
+response code.</p>
+
+<p>In addition to the billing permission, you need to declare the {@link
+android.content.BroadcastReceiver} that you will use to receive asynchronous response messages
+(broadcast intents) from Google Play, and you need to declare the {@link android.app.Service}
+that you will use to bind with the <code>IMarketBillingService</code> and send messages to Google
+Play. You must also declare <a
+href="{@docRoot}guide/topics/manifest/intent-filter-element.html">intent filters</a> for the {@link
+android.content.BroadcastReceiver} so that the Android system knows how to handle the broadcast
+intents that are sent from the Google Play application.</p>
+
+<p>For example, here is how the in-app billing sample application declares the billing permission,
+the {@link android.content.BroadcastReceiver}, the {@link android.app.Service}, and the intent
+filters. In the sample application, <code>BillingReceiver</code> is the {@link
+android.content.BroadcastReceiver} that handles broadcast intents from the Google Play
+application and <code>BillingService</code> is the {@link android.app.Service} that sends requests
+to the Google Play application.</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.dungeons"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-permission android:name="com.android.vending.BILLING" />
+
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <activity android:name=".Dungeons" android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <service android:name="BillingService" />
+
+ <receiver android:name="BillingReceiver">
+ <intent-filter>
+ <action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
+ <action android:name="com.android.vending.billing.RESPONSE_CODE" />
+ <action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
+ </intent-filter>
+ </receiver>
+
+ </application>
+</manifest>
+</pre>
+
+<h2 id="billing-service">Creating a Local Service</h2>
+
+<p>Your application must have a local {@link android.app.Service} to facilitate messaging between
+your application and Google Play. At a minimum, this service must do the following:</p>
+
+<ul>
+ <li>Bind to the <code>MarketBillingService</code>.
+ <li>Send billing requests (as IPC method calls) to the Google Play application. The five types
+ of billing requests include:
+ <ul>
+ <li><code>CHECK_BILLING_SUPPORTED</code> requests</li>
+ <li><code>REQUEST_PURCHASE</code> requests</li>
+ <li><code>GET_PURCHASE_INFORMATION</code> requests</li>
+ <li><code>CONFIRM_NOTIFICATIONS</code> requests</li>
+ <li><code>RESTORE_TRANSACTIONS</code> requests</li>
+ </ul>
+ </li>
+ <li>Handle the synchronous response messages that are returned with each billing request.</li>
+</ul>
+
+<h3>Binding to the MarketBillingService</h3>
+
+<p>Binding to the <code>MarketBillingService</code> is relatively easy if you've already added the
+<code>IMarketBillingService.aidl</code> file to your project. The following code sample shows how to
+use the {@link android.content.Context#bindService bindService()} method to bind a service to the
+<code>MarketBillingService</code>. You could put this code in your service's {@link
+android.app.Activity#onCreate onCreate()} method.</p>
+
+<pre>
+try {
+ boolean bindResult = mContext.bindService(
+ new Intent("com.android.vending.billing.MarketBillingService.BIND"), this,
+ Context.BIND_AUTO_CREATE);
+ if (bindResult) {
+ Log.i(TAG, "Service bind successful.");
+ } else {
+ Log.e(TAG, "Could not bind to the MarketBillingService.");
+ }
+} catch (SecurityException e) {
+ Log.e(TAG, "Security exception: " + e);
+}
+</pre>
+
+<p>After you bind to the service, you need to create a reference to the
+<code>IMarketBillingService</code> interface so you can make billing requests via IPC method calls.
+The following code shows you how to do this using the {@link
+android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback method.</p>
+
+<pre>
+/**
+ * The Android system calls this when we are connected to the MarketBillingService.
+ */
+ public void onServiceConnected(ComponentName name, IBinder service) {
+ Log.i(TAG, "MarketBillingService connected.");
+ mService = IMarketBillingService.Stub.asInterface(service);
+ }
+</pre>
+
+<p>You can now use the <code>mService</code> reference to invoke the
+<code>sendBillingRequest()</code> method.</p>
+
+<p>For a complete implementation of a service that binds to the <code>MarketBillingService</code>,
+see the <code>BillingService</code> class in the sample application.</p>
+
+<h3>Sending billing requests to the MarketBillingService</h3>
+
+<p>Now that your {@link android.app.Service} has a reference to the
+<code>IMarketBillingService</code> interface, you can use that reference to send billing requests
+(via IPC method calls) to the <code>MarketBillingService</code>. The
+<code>MarketBillingService</code> IPC interface exposes a single public method
+(<code>sendBillingRequest()</code>), which takes a single {@link android.os.Bundle} parameter. The
+Bundle that you deliver with this method specifies the type of request you want to perform, using
+various key-value pairs. For instance, one key indicates the type of request you are making, another
+indicates the item being purchased, and another identifies your application. The
+<code>sendBillingRequest()</code> method immediately returns a Bundle containing an initial response
+code. However, this is not the complete purchase response; the complete response is delivered with
+an asynchronous broadcast intent. For more information about the various Bundle keys that are
+supported by the <code>MarketBillingService</code>, see <a
+href="{@docRoot}guide/google/play/billing/billing_reference.html#billing-interface">In-app Billing
+Service Interface</a>.</p>
+
+<p>You can use the <code>sendBillingRequest()</code> method to send five types of billing requests.
+The five request types are specified using the <code>BILLING_REQUEST</code> Bundle key. This Bundle
+key can have the following five values:</p>
+
+<ul>
+ <li><code>CHECK_BILLING_SUPPORTED</code>—verifies that the Google Play application
+ supports in-app billing and the version of the In-app Billing API available.</li>
+ <li><code>REQUEST_PURCHASE</code>—sends a purchase request for an in-app item.</li>
+ <li><code>GET_PURCHASE_INFORMATION</code>—retrieves transaction information for a purchase
+ or refund.</li>
+ <li><code>CONFIRM_NOTIFICATIONS</code>—acknowledges that you received the transaction
+ information for a purchase or refund.</li>
+ <li><code>RESTORE_TRANSACTIONS</code>—retrieves a user's transaction history for <a
+ href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-purchase-type">managed
+ purchases</a>.</li>
+</ul>
+
+<p>To make any of these billing requests, you first need to build an initial {@link
+android.os.Bundle} that contains the three keys that are required for all requests:
+<code>BILLING_REQUEST</code>, <code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The following
+code sample shows you how to create a helper method named <code>makeRequestBundle()</code> that does
+this.</p>
+
+<pre>
+protected Bundle makeRequestBundle(String method) {
+ Bundle request = new Bundle();
+ request.putString(BILLING_REQUEST, method);
+ request.putInt(API_VERSION, 1);
+ request.putString(PACKAGE_NAME, getPackageName());
+ return request;
+</pre>
+
+<p>To use this helper method, you pass in a <code>String</code> that corresponds to one of the five
+types of billing requests. The method returns a Bundle that has the three required keys defined. The
+following sections show you how to use this helper method when you send a billing request.</p>
+
+<p class="caution"><strong>Important</strong>: You must make all in-app billing requests from your
+application's main thread.</p>
+
+<h4>Verifying that in-app billing is supported (CHECK_BILLING_SUPPPORTED)</h4>
+
+<p>The following code sample shows how to verify whether the Google Play application supports
+in-app billing and confirm what version of the API it supports. In the sample, <code>mService</code>
+is an instance of the <code>MarketBillingService</code> interface.</p>
+
+<pre>
+/**
+* Request type is CHECK_BILLING_SUPPORTED
+*/
+ Bundle request = makeRequestBundle("CHECK_BILLING_SUPPORTED");
+ Bundle response = mService.sendBillingRequest(request);
+ // Do something with this response.
+}
+</pre>
+
+<p>The <code>makeRequestBundle()</code> method constructs an initial Bundle, which contains the
+three keys that are required for all requests: <code>BILLING_REQUEST</code>,
+<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. If you are offering subscriptions in
+your app, set the API_VERSION key to a value of "2", to confirm that In-app Billing v2 is
+available. For an examnple, see
+<a href="{@docRoot}guide/google/play/billing/billing_subscriptions.html#version">Subscriptions</a>.</p>
+
+<p>The <code>CHECK_BILLING_SUPPORTED</code> request returns a synchronous {@link
+android.os.Bundle} response, which contains only a single key: <code>RESPONSE_CODE</code>. The
+<code>RESPONSE_CODE</code> key can have the following values:</p>
+<ul>
+ <li><code>RESULT_OK</code>—the spedified version of in-app billing is supported.</li>
+ <li><code>RESULT_BILLING_UNAVAILABLE</code>—in-app billing is not available because the API
+ version you specified is not recognized or the user is not eligible to make in-app purchases (for
+ example, the user resides in a country that prohibits in-app purchases).</li>
+ <li><code>RESULT_ERROR</code>—there was an error connecting with the Google Play
+ application.</li>
+ <li><code>RESULT_DEVELOPER_ERROR</code>—the application is trying to make an in-app billing
+ request but the application has not declared the <code>com.android.vending.BILLING</code>
+ permission in its manifest. Can also indicate that an application is not properly signed, or that
+ you sent a malformed request.</li>
+</ul>
+
+<p>The <code>CHECK_BILLING_SUPPORTED</code> request does not trigger any asynchronous responses
+(broadcast intents).</p>
+
+<p>We recommend that you invoke the <code>CHECK_BILLING_SUPPORTED</code> request within a
+<code>RemoteException</code> block. When your code throws a <code>RemoteException</code> it
+indicates that the remote method call failed, which means that the Google Play application is out
+of date and needs to be updated. In this case, you can provide users with an error message that
+contains a link to the <a
+href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google Play</a>
+Help topic.</p>
+
+<p>The sample application demonstrates how you can handle this error condition (see
+<code>DIALOG_CANNOT_CONNECT_ID</code> in <code>Dungeons.java</code>).</p>
+
+<h4>Making a purchase request (REQUEST_PURCHASE)</h4>
+
+<p>To make a purchase request you must do the following:</p>
+
+<ul>
+ <li>Send the <code>REQUEST_PURCHASE</code> request.</li>
+ <li>Launch the {@link android.app.PendingIntent} that is returned from the Google Play
+ application.</li>
+ <li>Handle the broadcast intents that are sent by the Google Play application.</li>
+</ul>
+
+<h5>Making the request</h5>
+
+<p>You must specify four keys in the request {@link android.os.Bundle}. The following code sample
+shows how to set these keys and make a purchase request for a single in-app item. In the sample,
+<code>mProductId</code> is the Google Play product ID of an in-app item (which is listed in the
+application's <a href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-list-setup">product
+list</a>), and <code>mService</code> is an instance of the <code>MarketBillingService</code>
+interface.</p>
+
+<pre>
+/**
+* Request type is REQUEST_PURCHASE
+*/
+ Bundle request = makeRequestBundle("REQUEST_PURCHASE");
+ request.putString(ITEM_ID, mProductId);
+ // Request is for a standard in-app product
+ request.putString(ITEM_TYPE, "inapp");
+ // Note that the developer payload is optional.
+ if (mDeveloperPayload != null) {
+ request.putString(DEVELOPER_PAYLOAD, mDeveloperPayload);
+ }
+ Bundle response = mService.sendBillingRequest(request);
+ // Do something with this response.
+</pre>
+<p>The <code>makeRequestBundle()</code> method constructs an initial Bundle, which contains the
+three keys that are required for all requests: <code>BILLING_REQUEST</code>,
+<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The <code>ITEM_ID</code> key is then added
+to the Bundle prior to invoking the <code>sendBillingRequest()</code> method.</p>
+
+<p>The request returns a synchronous {@link android.os.Bundle} response, which contains three keys:
+<code>RESPONSE_CODE</code>, <code>PURCHASE_INTENT</code>, and <code>REQUEST_ID</code>. The
+<code>RESPONSE_CODE</code> key provides you with the status of the request and the
+<code>REQUEST_ID</code> key provides you with a unique request identifier for the request. The
+<code>PURCHASE_INTENT</code> key provides you with a {@link android.app.PendingIntent}, which you
+can use to launch the checkout UI.</p>
+
+<h5>Using the pending intent</h5>
+
+<p>How you use the pending intent depends on which version of Android a device is running. On
+Android 1.6, you must use the pending intent to launch the checkout UI in its own separate task
+instead of your application's activity stack. On Android 2.0 and higher, you can use the pending
+intent to launch the checkout UI on your application's activity stack. The following code shows you
+how to do this. You can find this code in the <code>PurchaseObserver.java</code> file in the sample
+application.</p>
+
+<pre>
+void startBuyPageActivity(PendingIntent pendingIntent, Intent intent) {
+ if (mStartIntentSender != null) {
+ // This is on Android 2.0 and beyond. The in-app checkout page activity
+ // will be on the activity stack of the application.
+ try {
+ // This implements the method call:
+ // mActivity.startIntentSender(pendingIntent.getIntentSender(),
+ // intent, 0, 0, 0);
+ mStartIntentSenderArgs[0] = pendingIntent.getIntentSender();
+ mStartIntentSenderArgs[1] = intent;
+ mStartIntentSenderArgs[2] = Integer.valueOf(0);
+ mStartIntentSenderArgs[3] = Integer.valueOf(0);
+ mStartIntentSenderArgs[4] = Integer.valueOf(0);
+ mStartIntentSender.invoke(mActivity, mStartIntentSenderArgs);
+ } catch (Exception e) {
+ Log.e(TAG, "error starting activity", e);
+ }
+ } else {
+ // This is on Android 1.6. The in-app checkout page activity will be on its
+ // own separate activity stack instead of on the activity stack of
+ // the application.
+ try {
+ pendingIntent.send(mActivity, 0 /* code */, intent);
+ } catch (CanceledException e) {
+ Log.e(TAG, "error starting activity", e);
+ }
+ }
+}
+</pre>
+
+<p class="caution"><strong>Important:</strong> You must launch the pending intent from an activity
+context and not an application context. Also, you cannot use the <code>singleTop</code> <a
+href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">launch mode</a> to launch the
+pending intent. If you do either of these, the Android system will not attach the pending intent to
+your application process. Instead, it will bring Google Play to the foreground, disrupting your
+application.</p>
+
+<h5>Handling broadcast intents</h5>
+
+<p>A <code>REQUEST_PURCHASE</code> request also triggers two asynchronous responses (broadcast
+intents). First, the Google Play application sends a <code>RESPONSE_CODE</code> broadcast intent,
+which provides error information about the request. If the request does not generate an
+error, the <code>RESPONSE_CODE</code> broadcast intent returns <code>RESULT_OK</code>, which
+indicates that the request was successfully sent. (To be clear, a <code>RESULT_OK</code> response
+does not indicate that the requested purchase was successful; it indicates that the request was sent
+successfully to Google Play.)</p>
+
+<p>Next, when the requested transaction changes state (for example, the purchase is successfully
+charged to a credit card or the user cancels the purchase), the Google Play application sends an
+<code>IN_APP_NOTIFY</code> broadcast intent. This message contains a notification ID, which you can
+use to retrieve the transaction details for the <code>REQUEST_PURCHASE</code> request.</p>
+
+<p class="note"><strong>Note:</strong> The Google Play application also sends
+an <code>IN_APP_NOTIFY</code> for refunds. For more information, see <a
+href="{@docRoot}guide/google/play/billing/billing_overview.html#billing-action-notify">Handling
+IN_APP_NOTIFY messages</a>.</p>
+
+<p>Because the purchase process is not instantaneous and can take several seconds (or more), you
+must assume that a purchase request is pending from the time you receive a <code>RESULT_OK</code>
+message until you receive an <code>IN_APP_NOTIFY</code> message for the transaction. While the
+transaction is pending, the Google Play checkout UI displays an "Authorizing purchase..."
+notification; however, this notification is dismissed after 60 seconds and you should not rely on
+this notification as your primary means of conveying transaction status to users. Instead, we
+recommend that you do the following:</p>
+
+<ul>
+ <li>Add an {@link android.app.Activity} to your application that shows users the status of pending
+and completed in-app purchases.</li>
+ <li>Use a <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">status
+bar notification</a> to keep users informed about the progress of a purchase.</li>
+</ul>
+
+<p>To use these two UI elements, you could invoke a status bar notification with a ticker-text
+message that says "Purchase pending" when your application receives a <code>RESULT_OK</code>
+message. Then, when your application receives an <code>IN_APP_NOTIFY</code> message, you could
+update the notification with a new message that says "Purchase succeeded" or "Purchase failed." When
+a user touches the expanded status bar notification, you could launch the activity that shows the
+status of pending and completed in-app purchases.</p>
+
+<p>If you use some other UI technique to inform users about the state of a pending transaction,
+be sure that your pending status UI does not block your application. For example, you should avoid
+using a hovering progress wheel to convey the status of a pending transaction because a pending
+transaction could last a long time, particularly if a device loses network connectivity and cannot
+receive transaction updates from Google Play.</p>
+
+<p class="caution"><strong>Important:</strong> If a user purchases a managed item, you must prevent
+the user from purchasing the item again while the original transaction is pending. If a user
+attempts to purchase a managed item twice, and the first transaction is still pending, Google
+Play will display an error to the user; however, Google Play will not send an error to your
+application notifying you that the second purchase request was canceled. This might cause your
+application to get stuck in a pending state while it waits for an <code>IN_APP_NOTIFY</code> message
+for the second purchase request.</p>
+
+<h4>Retrieving transaction information for a purchase or refund (GET_PURCHASE_INFORMATION)</h4>
+
+<p>You retrieve transaction information in response to an <code>IN_APP_NOTIFY</code> broadcast
+intent. The <code>IN_APP_NOTIFY</code> message contains a notification ID, which you can use to
+retrieve transaction information.</p>
+
+<p>To retrieve transaction information for a purchase or refund you must specify five keys in the
+request {@link android.os.Bundle}. The following code sample shows how to set these keys and make
+the request. In the sample, <code>mService</code> is an instance of the
+<code>MarketBillingService</code> interface.</p>
+
+<pre>
+/**
+* Request type is GET_PURCHASE_INFORMATION
+*/
+ Bundle request = makeRequestBundle("GET_PURCHASE_INFORMATION");
+ request.putLong(REQUEST_NONCE, mNonce);
+ request.putStringArray(NOTIFY_IDS, mNotifyIds);
+ Bundle response = mService.sendBillingRequest(request);
+ // Do something with this response.
+}
+</pre>
+<p>The <code>makeRequestBundle()</code> method constructs an initial Bundle, which contains the
+three keys that are required for all requests: <code>BILLING_REQUEST</code>,
+<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The additional keys are then added to the
+bundle prior to invoking the <code>sendBillingRequest()</code> method. The
+<code>REQUEST_NONCE</code> key contains a cryptographically secure nonce (number used once) that you
+must generate. The Google Play application returns this nonce with the
+<code>PURCHASE_STATE_CHANGED</code> broadcast intent so you can verify the integrity of the
+transaction information. The <code>NOTIFY_IDS</code> key contains an array of notification IDs,
+which you received in the <code>IN_APP_NOTIFY</code> broadcast intent.</p>
+
+<p>The request returns a synchronous {@link android.os.Bundle} response, which contains two keys:
+<code>RESPONSE_CODE</code> and <code>REQUEST_ID</code>. The <code>RESPONSE_CODE</code> key provides
+you with the status of the request and the <code>REQUEST_ID</code> key provides you with a unique
+request identifier for the request.</p>
+
+<p>A <code>GET_PURCHASE_INFORMATION</code> request also triggers two asynchronous responses
+(broadcast intents). First, the Google Play application sends a <code>RESPONSE_CODE</code>
+broadcast intent, which provides status and error information about the request. Next, if the
+request was successful, the Google Play application sends a <code>PURCHASE_STATE_CHANGED</code>
+broadcast intent. This message contains detailed transaction information. The transaction
+information is contained in a signed JSON string (unencrypted). The message includes the signature
+so you can verify the integrity of the signed string.</p>
+
+<h4>Acknowledging transaction information (CONFIRM_NOTIFICATIONS)</h4>
+
+<p>To acknowledge that you received transaction information you send a
+<code>CONFIRM_NOTIFICATIONS</code> request. You must specify four keys in the request {@link
+android.os.Bundle}. The following code sample shows how to set these keys and make the request. In
+the sample, <code>mService</code> is an instance of the <code>MarketBillingService</code>
+interface.</p>
+
+<pre>
+/**
+* Request type is CONFIRM_NOTIFICATIONS
+*/
+ Bundle request = makeRequestBundle("CONFIRM_NOTIFICATIONS");
+ request.putStringArray(NOTIFY_IDS, mNotifyIds);
+ Bundle response = mService.sendBillingRequest(request);
+ // Do something with this response.
+}
+</pre>
+<p>The <code>makeRequestBundle()</code> method constructs an initial Bundle, which contains the
+three keys that are required for all requests: <code>BILLING_REQUEST</code>,
+<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The additional <code>NOTIFY_IDS</code> key
+is then added to the bundle prior to invoking the <code>sendBillingRequest()</code> method. The
+<code>NOTIFY_IDS</code> key contains an array of notification IDs, which you received in an
+<code>IN_APP_NOTIFY</code> broadcast intent and also used in a <code>GET_PURCHASE_INFORMATION</code>
+request.</p>
+
+<p>The request returns a synchronous {@link android.os.Bundle} response, which contains two keys:
+<code>RESPONSE_CODE</code> and <code>REQUEST_ID</code>. The <code>RESPONSE_CODE</code> key provides
+you with the status of the request and the <code>REQUEST_ID</code> key provides you with a unique
+request identifier for the request.</p>
+
+<p>A <code>CONFIRM_NOTIFICATIONS</code> request triggers a single asynchronous response—a
+<code>RESPONSE_CODE</code> broadcast intent. This broadcast intent provides status and error
+information about the request.</p>
+
+<p>You must send a confirmation when you receive transaction information from Google Play. If you
+don't send a confirmation message, Google Play will continue sending
+<code>IN_APP_NOTIFY</code> messages for the transactions you have not confirmed. Also,
+your application must be able to handle <code>IN_APP_NOTIFY</code> messages that contain multiple
+orders.</p>
+
+<p>In addition, as a best practice, you should not send a <code>CONFIRM_NOTIFICATIONS</code> request
+for a purchased item until you have delivered the item to the user. This way, if your application
+crashes or something else prevents your application from delivering the product, your application
+will still receive an <code>IN_APP_NOTIFY</code> broadcast intent from Google Play indicating
+that you need to deliver the product.</p>
+
+<h4>Restoring transaction information (RESTORE_TRANSACTIONS)</h4>
+
+<p>To restore a user's transaction information, you send a <code>RESTORE_TRANSACTIONS</code>
+request. You must specify four keys in the request {@link android.os.Bundle}. The following code
+sample shows how to set these keys and make the request. In the sample, <code>mService</code> is an
+instance of the <code>MarketBillingService</code> interface.</p>
+
+<pre>
+/**
+* Request type is RESTORE_TRANSACTIONS
+*/
+ Bundle request = makeRequestBundle("RESTORE_TRANSACTIONS");
+ request.putLong(REQUEST_NONCE, mNonce);
+ Bundle response = mService.sendBillingRequest(request);
+ // Do something with this response.
+}
+</pre>
+<p>The <code>makeRequestBundle()</code> method constructs an initial Bundle, which contains the
+three keys that are required for all requests: <code>BILLING_REQUEST</code>,
+<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The additional <code>REQUEST_NONCE</code>
+key is then added to the bundle prior to invoking the <code>sendBillingRequest()</code> method. The
+<code>REQUEST_NONCE</code> key contains a cryptographically secure nonce (number used once) that you
+must generate. The Google Play application returns this nonce with the transactions information
+contained in the <code>PURCHASE_STATE_CHANGED</code> broadcast intent so you can verify the
+integrity of the transaction information.</p>
+
+<p>The request returns a synchronous {@link android.os.Bundle} response, which contains two keys:
+<code>RESPONSE_CODE</code> and <code>REQUEST_ID</code>. The <code>RESPONSE_CODE</code> key provides
+you with the status of the request and the <code>REQUEST_ID</code> key provides you with a unique
+request identifier for the request.</p>
+
+<p>A <code>RESTORE_TRANSACTIONS</code> request also triggers two asynchronous responses (broadcast
+intents). First, the Google Play application sends a <code>RESPONSE_CODE</code> broadcast intent,
+which provides status and error information about the request. Next, if the request was successful,
+the Google Play application sends a <code>PURCHASE_STATE_CHANGED</code> broadcast intent. This
+message contains the detailed transaction information. The transaction information is contained in a
+signed JSON string (unencrypted). The message includes the signature so you can verify the integrity
+of the signed string.</p>
+
+<p class="note"><strong>Note:</strong> You should use the <code>RESTORE_TRANSACTIONS</code>
+request type only when your application is installed for the first time on a device or when your
+application has been removed from a device and reinstalled.</p>
+
+<h3>Other service tasks</h3>
+
+<p>You may also want your {@link android.app.Service} to receive intent messages from your {@link
+android.content.BroadcastReceiver}. You can use these intent messages to convey the information that
+was sent asynchronously from the Google Play application to your {@link
+android.content.BroadcastReceiver}. To see an example of how you can send and receive these intent
+messages, see the <code>BillingReceiver.java</code> and <code>BillingService.java</code> files in
+the sample application. You can use these samples as a basis for your own implementation. However,
+if you use any of the code from the sample application, be sure you follow the guidelines in <a
+href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and Design</a>.</p>
+
+<h2 id="billing-broadcast-receiver">Creating a BroadcastReceiver</h2>
+
+<p>The Google Play application uses broadcast intents to send asynchronous billing responses to
+your application. To receive these intent messages, you need to create a {@link
+android.content.BroadcastReceiver} that can handle the following intents:</p>
+
+<ul>
+ <li>com.android.vending.billing.RESPONSE_CODE
+ <p>This broadcast intent contains a Google Play response code, and is sent after you make an
+ in-app billing request. For more information about the response codes that are sent with this
+ response, see <a
+ href="{@docRoot}guide/google/play/billing/billing_reference.html#billing-codes">Google Play Response
+ Codes for In-app Billing</a>.</p>
+ </li>
+ <li>com.android.vending.billing.IN_APP_NOTIFY
+ <p>This response indicates that a purchase has changed state, which means a purchase succeeded,
+ was canceled, or was refunded. For more information about notification messages, see <a
+ href="{@docRoot}guide/google/play/billing/billing_reference.html#billing-intents">In-app Billing
+ Broadcast Intents</a></p>
+ </li>
+ <li>com.android.vending.billing.PURCHASE_STATE_CHANGED
+ <p>This broadcast intent contains detailed information about one or more transactions. For more
+ information about purchase state messages, see <a
+ href="{@docRoot}guide/google/play/billing/billing_reference.html#billing-intents">In-app Billing
+ Broadcast Intents</a></p>
+ </li>
+</ul>
+
+<p>Each of these broadcast intents provide intent extras, which your {@link
+android.content.BroadcastReceiver} must handle. The intent extras are listed in the following table
+(see table 1).</p>
+
+<p class="table-caption"><strong>Table 1.</strong> Description of broadcast intent extras that are
+sent in response to billing requests.</p>
+
+<table>
+
+<tr>
+<th>Intent</th>
+<th>Extra</th>
+<th>Description</th>
+</tr>
+<tr>
+ <td><code>com.android.vending.billing.RESPONSE_CODE</code></td>
+ <td><code>request_id</code></td>
+ <td>A <code>long</code> representing a request ID. A request ID identifies a specific billing
+ request and is returned by Google Play at the time a request is made.</td>
+</tr>
+<tr>
+ <td><code>com.android.vending.billing.RESPONSE_CODE</code></td>
+ <td><code>response_code</code></td>
+ <td>An <code>int</code> representing the actual Google Play server response code.</td>
+</tr>
+<tr>
+ <td><code>com.android.vending.billing.IN_APP_NOTIFY</code></td>
+ <td><code>notification_id</code></td>
+ <td>A <code>String</code> representing the notification ID for a given purchase state change.
+ Google Play notifies you when there is a purchase state change and the notification includes a
+ unique notification ID. To get the details of the purchase state change, you send the notification
+ ID with the <code>GET_PURCHASE_INFORMATION</code> request.</td>
+</tr>
+<tr>
+ <td><code>com.android.vending.billing.PURCHASE_STATE_CHANGED</code></td>
+ <td><code>inapp_signed_data</code></td>
+ <td>A <code>String</code> representing the signed JSON string. The JSON string contains
+ information about the billing transaction, such as order number, amount, and the item that was
+ purchased or refunded.</td>
+</tr>
+<tr>
+ <td><code>com.android.vending.billing.PURCHASE_STATE_CHANGED</code></td>
+ <td><code>inapp_signature</code></td>
+ <td>A <code>String</code> representing the signature of the JSON string.</td>
+</tr>
+</table>
+
+<p>The following code sample shows how to handle these broadcast intents and intent extras within a
+{@link android.content.BroadcastReceiver}. The BroadcastReceiver in this case is named
+<code>BillingReceiver</code>, just as it is in the sample application.</p>
+
+<pre>
+public class BillingReceiver extends BroadcastReceiver {
+
+ private static final String TAG = "BillingReceiver";
+
+ // Intent actions that we receive in the BillingReceiver from Google Play.
+ // These are defined by Google Play and cannot be changed.
+ // The sample application defines these in the Consts.java file.
+ public static final String ACTION_NOTIFY = "com.android.vending.billing.IN_APP_NOTIFY";
+ public static final String ACTION_RESPONSE_CODE = "com.android.vending.billing.RESPONSE_CODE";
+ public static final String ACTION_PURCHASE_STATE_CHANGED =
+ "com.android.vending.billing.PURCHASE_STATE_CHANGED";
+
+ // The intent extras that are passed in an intent from Google Play.
+ // These are defined by Google Play and cannot be changed.
+ // The sample application defines these in the Consts.java file.
+ public static final String NOTIFICATION_ID = "notification_id";
+ public static final String INAPP_SIGNED_DATA = "inapp_signed_data";
+ public static final String INAPP_SIGNATURE = "inapp_signature";
+ public static final String INAPP_REQUEST_ID = "request_id";
+ public static final String INAPP_RESPONSE_CODE = "response_code";
+
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ if (ACTION_PURCHASE_STATE_CHANGED.equals(action)) {
+ String signedData = intent.getStringExtra(INAPP_SIGNED_DATA);
+ String signature = intent.getStringExtra(INAPP_SIGNATURE);
+ // Do something with the signedData and the signature.
+ } else if (ACTION_NOTIFY.equals(action)) {
+ String notifyId = intent.getStringExtra(NOTIFICATION_ID);
+ // Do something with the notifyId.
+ } else if (ACTION_RESPONSE_CODE.equals(action)) {
+ long requestId = intent.getLongExtra(INAPP_REQUEST_ID, -1);
+ int responseCodeIndex = intent.getIntExtra(INAPP_RESPONSE_CODE,
+ ResponseCode.RESULT_ERROR.ordinal());
+ // Do something with the requestId and the responseCodeIndex.
+ } else {
+ Log.w(TAG, "unexpected action: " + action);
+ }
+ }
+ // Perform other processing here, such as forwarding intent messages to your local service.
+}
+</pre>
+
+<p>In addition to receiving broadcast intents from the Google Play application, your {@link
+android.content.BroadcastReceiver} must handle the information it received in the broadcast intents.
+Usually, your {@link android.content.BroadcastReceiver} does this by sending the information to a
+local service (discussed in the next section). The <code>BillingReceiver.java</code> file in the
+sample application shows you how to do this. You can use this sample as a basis for your own {@link
+android.content.BroadcastReceiver}. However, if you use any of the code from the sample application,
+be sure you follow the guidelines that are discussed in <a
+href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and Design </a>.</p>
+
+<h2 id="billing-signatures">Verifying Signatures and Nonces</h2>
+
+<p>Google Play's in-app billing service uses two mechanisms to help verify the integrity of the
+transaction information you receive from Google Play: nonces and signatures. A nonce (number used
+once) is a cryptographically secure number that your application generates and sends with every
+<code>GET_PURCHASE_INFORMATION</code> and <code>RESTORE_TRANSACTIONS</code> request. The nonce is
+returned with the <code>PURCHASE_STATE_CHANGED</code> broadcast intent, enabling you to verify that
+any given <code>PURCHASE_STATE_CHANGED</code> response corresponds to an actual request that you
+made. Every <code>PURCHASE_STATE_CHANGED</code> broadcast intent also includes a signed JSON string
+and a signature, which you can use to verify the integrity of the response.</p>
+
+<p>Your application must provide a way to generate, manage, and verify nonces. The following sample
+code shows some simple methods you can use to do this.</p>
+
+<pre>
+ private static final SecureRandom RANDOM = new SecureRandom();
+ private static HashSet<Long> sKnownNonces = new HashSet<Long>();
+
+ public static long generateNonce() {
+ long nonce = RANDOM.nextLong();
+ sKnownNonces.add(nonce);
+ return nonce;
+ }
+
+ public static void removeNonce(long nonce) {
+ sKnownNonces.remove(nonce);
+ }
+
+ public static boolean isNonceKnown(long nonce) {
+ return sKnownNonces.contains(nonce);
+ }
+</pre>
+
+<p>Your application must also provide a way to verify the signatures that accompany every
+<code>PURCHASE_STATE_CHANGED</code> broadcast intent. The <code>Security.java</code> file in the
+sample application shows you how to do this. If you use this file as a basis for your own security
+implementation, be sure to follow the guidelines in <a
+href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and Design</a> and
+obfuscate your code.</p>
+
+<p>You will need to use your Google Play public key to perform the signature verification. The
+following procedure shows you how to retrieve Base64-encoded public key from the Google Play
+publisher site.</p>
+
+<ol>
+ <li>Log in to your <a href="http://play.google.com/apps/publish">publisher account</a>.</li>
+ <li>On the upper left part of the page, under your name, click <strong>Edit profile</strong>.</li>
+ <li>On the Edit Profile page, scroll down to the Licensing & In-app Billing panel (see figure
+ 2).</li>
+ <li>Copy your public key.</li>
+</ol>
+
+<p class="caution"><strong>Important</strong>: To keep your public key safe from malicious users and
+hackers, do not embed your public key as an entire literal string. Instead, construct the string at
+runtime from pieces or use bit manipulation (for example, XOR with some other string) to hide the
+actual key. The key itself is not secret information, but you do not want to make it easy for a
+hacker or malicious user to replace the public key with another key.</p>
+
+<img src="{@docRoot}images/billing_public_key.png" height="510" id="figure2" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> The Licensing and In-app Billing panel of your account's Edit Profile
+ page lets you see your public key.
+</p>
+
+<h2 id="billing-implement">Modifying Your Application Code</h2>
+
+<p>After you finish adding in-app billing components to your project, you are ready to modify your
+application's code. For a typical implementation, like the one that is demonstrated in the sample
+application, this means you need to write code to do the following: </p>
+
+<ul>
+ <li>Create a storage mechanism for storing users' purchase information.</li>
+ <li>Create a user interface that lets users select items for purchase.</li>
+</ul>
+
+<p>The sample code in <code>Dungeons.java</code> shows you how to do both of these tasks.</p>
+
+<h3>Creating a storage mechanism for storing purchase information</h3>
+
+<p>You must set up a database or some other mechanism for storing users' purchase information. The
+sample application provides an example database (PurchaseDatabase.java); however, the example
+database has been simplified for clarity and does not exhibit the security best practices that we
+recommend. If you have a remote server, we recommend that you store purchase information on your
+server instead of in a local database on a device. For more information about security best
+practices, see <a href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and
+Design</a>.</p>
+
+<p class="note"><strong>Note</strong>: If you store any purchase information on a device, be sure to
+encrypt the data and use a device-specific encryption key. Also, if the purchase type for any of
+your items is "unmanaged," we recommend that you back up the purchase information for these items to
+a remote server or use Android's <a href="{@docRoot}guide/topics/data/backup.html">data
+backup</a> framework to back up the purchase information. Backing up purchase information for
+unmanaged items is important because unmanaged items cannot be restored by using the
+<code>RESTORE_TRANSACTIONS</code> request type.</p>
+
+<h3>Creating a user interface for selecting items</h3>
+
+<p>You must provide users with a means for selecting items that they want to purchase. Google
+Play provides the checkout user interface (which is where the user provides a form of payment and
+approves the purchase), but your application must provide a control (widget) that invokes the
+<code>sendBillingRequest()</code> method when a user selects an item for purchase.</p>
+
+<p>You can render the control and trigger the <code>sendBillingRequest()</code> method any way you
+want. The sample application uses a spinner widget and a button to present items to a user and
+trigger a billing request (see <code>Dungeons.java</code>). The user interface also shows a list of
+recently purchased items.</p>
+
diff --git a/docs/html/guide/google/play/billing/billing_overview.jd b/docs/html/guide/google/play/billing/billing_overview.jd
new file mode 100755
index 0000000..280b3cf
--- /dev/null
+++ b/docs/html/guide/google/play/billing/billing_overview.jd
@@ -0,0 +1,507 @@
+page.title=In-app Billing Overview
+parent.title=In-app Billing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#billing-types">Product and Purchase Types</a></li>
+ <li><a href="#billing-arch">In-app Billing Architecture</a></li>
+ <li><a href="#billing-msgs">In-app Billing Messages</a></li>
+ <ol>
+ <li><a href="#billing-request">Request messages</a></li>
+ <li><a href="#billing-response">Broadcast intents</a></li>
+ <li><a href="#billing-message-sequence">Messaging sequence</a></li>
+ <li><a href="#billing-action-notify">Handling IN_APP_NOTIFY messages</a></li>
+ </ol>
+ <li><a href="#billing-security">Security Controls</a></li>
+ <li><a href="#billing-limitations">Requirements and Limitations</a></li>
+ </ol>
+ <h2>Downloads</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">Sample
+ Application</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html">Implementing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and
+ Design</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_testing.html">Testing In-app Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_admin.html">Administering In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_reference.html">In-app Billing
+ Reference</a></li>
+ </ol>
+</div>
+</div>
+
+<p>In-app Billing is a Google Play service that provides checkout processing for
+in-app purchases. To use the service, your application sends a billing request for a specific in-app
+product. The service then handles all of the checkout details for the transaction, including
+requesting and validating the form of payment and processing the financial transaction. When the
+checkout process is complete, the service sends your application the purchase details, such as the
+order number, the order date and time, and the price paid. At no point does your application have to
+handle any financial transactions; that role is provided by Google Play's in-app billing
+service.</p>
+
+<h2 id="billing-types">Product and Purchase Types</h2>
+
+<p>In-app Billing supports different product types and purchase types to give you flexibility in how you monetize your app. In all cases, you define your products using the Google Play Developer Console, including product type, purchase type, SKU, price, description, and so on. For more information, see <a href="billing_admin.html">Administering In-app Billing</a>.</p>
+
+<h3 id="producttypes">Product Types</h3>
+
+<p>With In-app Billing, you can sell two types of products — <em>in-app products</em> and <em>subscriptions</em>. The billing characteristics of the two types are very different, but the In-app Billing API lets you handle the two product types in your app using the same communication model, data structures, and user interactions, as described later in this document.</p>
+
+<ul>
+<li><em>In-app products</em> — Items that a user would purchase one-at-a-time. For example, typical in-app products would let users purchase digital content, unlock functionality in an app, pay for one-time charges, or add almost anything to the application experience. Unlike with priced applications, once the user has purchased an in-app product there is no refund window. Users desiring refunds must contact the developer directly.
+
+<p>In-app products can be sold using either the "managed per user account" or "unmanaged" purchase type. In-app products are always explicitly associated with one and only one app. That is, one app cannot purchase an in-app product published for another app, even if they are from the same developer. In-app products are supported in all versions of In-app Billing.</p></li>
+
+<li><em>Subscriptions</em> — Items that are sold with a developer-specified, recurring billing interval. When a user purchases a subscription, Google Play and its payment processor automatically bill the user's account at the specified interval and price, charging the amount to the original payment method. Once the user purchases a subscription, Google Play continues billing the account indefinitely, without requiring approval or action from the user. The user can cancel the subscription at any time.
+
+<p>Subscriptions can only be sold using the "managed per user account" purchase type. As with in-app products, once the user has purchased an in-app product there is no refund window. Users desiring refunds must contact the developer directly. For more information about subscriptions and how to sell them in your apps, see the <a href="billing-subscriptions.html">Subscriptions</a> document.</p></li>
+</ul>
+
+<h3 id="purchasetypes">Purchase Types</h3>
+
+<p>In-app Billing offers two purchase types that you can use when selling in-app products, "managed per user account" and "unmanaged". The purchase type controls how Google Play handles and tracks purchases for the products. </p>
+
+<ul>
+<li><em>Managed per user account</em> — Items that can be purchased only once per user account on Google Play. When a user purchases an item that uses the "managed per user account" purchase type, Google Play permanently stores the transaction information for each item on a per-user basis. This enables you to later query Google Play to restore the state of the items a specific user has purchased. If a user attempts to purchase a managed item that has already been purchased, Google Play prevents the user from purchasing the item again and displays an "Item already purchased" error.
+
+<p>The "managed per user account" purchase type is useful if you are selling items such as game levels or application features. These items are not transient and usually need to be restored whenever a user reinstalls your application, wipes the data on their device, or installs your application on a new device.</p>
+
+<li><em>Unmanaged</em> — Items that do not have their transaction information stored on Google Play. This means that you cannot later query Google Play to retrieve transaction information for those items. For "unmanaged" purchases, you are responsible for managing the transaction information. Also, Google Play does not attempt to prevent the user from purchasing an item multiple times if it uses the "unmanaged" purchase type. It's up to you to control how many times an unmanaged item can be purchased.</p>
+
+<p>The "unmanaged" purchase type is useful if you are selling consumable items, such as fuel or magic spells. These items are consumed within your application and are usually purchased multiple times.</p></li>
+</ul>
+
+<h2 id="billing-arch">In-app Billing Architecture</h2>
+
+<p>Your app accesses the In-app Billing service using an API that is exposed by
+the Google Play app installed on the device. The Google Play app then uses an
+asynchronous message loop to convey billing requests and responses between your
+application and the Google Play server. In practice, your application never
+directly communicates with the Google Play server (see figure 1). Instead, your
+application sends billing requests to the Google Play application over
+interprocess communication (IPC) and receives purchase responses from the Google
+Play application in the form of asynchronous broadcast intents. Your application
+does not manage any network connections between itself and the Google Play
+server or use any special APIs from the Android platform.</p>
+
+<div class="figure" style="width:440px">
+<img src="{@docRoot}images/billing_arch.png" alt="" height="582" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Your application sends and receives billing messages through the
+ Google Play application, which handles all communication with the Google Play server.</p>
+</div>
+
+<p>Some in-app billing implementations may also use a private remote server to deliver content or
+validate transactions, but a remote server is not required to implement in-app billing. A remote
+server can be useful if you are selling digital content that needs to be delivered to a user's
+device, such as media files or photos. You might also use a remote server to store users'
+transaction history or perform various in-app billing security tasks, such as signature
+verification. Although you can handle all security-related tasks in your application, performing
+those tasks on a remote server is recommended because it helps make your application less vulnerable
+to security attacks.</p>
+
+<p>A typical in-app billing implementation relies on three components:</p>
+<ul>
+ <li>A {@link android.app.Service} (named <code>BillingService</code> in the sample application),
+ which processes purchase messages from the application and sends billing requests to the Google
+ Play in-app billing service.</li>
+ <li>A {@link android.content.BroadcastReceiver} (named <code>BillingReceiver</code> in the sample
+ application), which receives all asynchronous billing responses from the Google Play
+ application.</li>
+ <li>A security component (named <code>Security</code> in the sample application), which performs
+ security-related tasks, such as signature verification and nonce generation. For more information
+ about in-app billing security, see <a href="#billing-security">Security controls</a> later in this
+ document.</li>
+</ul>
+
+<p>You may also want to incorporate two other components to support in-app billing:</p>
+<ul>
+ <li>A response {@link android.os.Handler} (named <code>ResponseHandler</code> in the sample
+ application), which provides application-specific processing of purchase notifications, errors,
+ and other status messages.</li>
+ <li>An observer (named <code>PurchaseObserver</code> in the sample application), which is
+ responsible for sending callbacks to your application so you can update your user interface with
+ purchase information and status.</li>
+</ul>
+
+<p>In addition to these components, your application must provide a way to store information about
+users' purchases and some sort of user interface that lets users select items to purchase. You do
+not need to provide a checkout user interface. When a user initiates an in-app purchase, the Google
+Play application presents the checkout user interface to your user. When the user completes the
+checkout process, your application resumes.</p>
+
+<h2 id="billing-msgs">In-app Billing Messages</h2>
+
+<p>When the user initiates a purchase, your application sends billing messages to Google Play's
+in-app billing service (named <code>MarketBillingService</code>) using simple IPC method calls. The
+Google Play application responds to all billing requests synchronously, providing your
+application with status notifications and other information. The Google Play application also
+responds to some billing requests asynchronously, providing your application with error messages and
+detailed transaction information. The following section describes the basic request-response
+messaging that takes place between your application and the Google Play application.</p>
+
+<h3 id="billing-request">In-app billing requests</h3>
+
+<p>Your application sends in-app billing requests by invoking a single IPC method
+(<code>sendBillingRequest()</code>), which is exposed by the <code>MarketBillingService</code>
+interface. This interface is defined in an <a
+href="{@docRoot}tools/aidl.html">Android Interface Definition Language</a> file
+(<code>IMarketBillingService.aidl</code>). You can <a
+href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">download</a> this AIDL
+file with the in-app billing sample application.</p>
+
+<p>The <code>sendBillingRequest()</code> method has a single {@link android.os.Bundle} parameter.
+The Bundle that you deliver must include several key-value pairs that specify various parameters for
+the request, such as the type of billing request you are making, the item that is being purchased and
+its type, and the application that is making the request. For more information about the Bundle keys
+that are sent with a request, see <a
+href="{@docRoot}guide/google/play/billing/billing_reference.html#billing-interface">In-app Billing
+Service Interface</a>.
+
+<p>One of the most important keys that every request Bundle must have is the
+<code>BILLING_REQUEST</code> key. This key lets you specify the type of billing request you are
+making. Google Play's in-app billing service supports the following five types of billing
+requests:</p>
+
+<ul>
+ <li><code>CHECK_BILLING_SUPPORTED</code>
+ <p>This request verifies that the Google Play application supports in-app billing. You
+ usually send this request when your application first starts up. This request is useful if you
+ want to enable or disable certain UI features that are relevant only to in-app billing.</p>
+ </li>
+ <li><code>REQUEST_PURCHASE</code>
+ <p>This request sends a purchase message to the Google Play application and is the foundation
+ of in-app billing. You send this request when a user indicates that he or she wants to purchase
+ an item in your application. Google Play then handles the financial transaction by displaying
+ the checkout user interface.</p>
+ </li>
+ <li><code>GET_PURCHASE_INFORMATION</code>
+ <p>This request retrieves the details of a purchase state change. A purchase changes state when
+ a requested purchase is billed successfully or when a user cancels a transaction during
+ checkout. It can also occur when a previous purchase is refunded. Google Play notifies your
+ application when a purchase changes state, so you only need to send this request when there is
+ transaction information to retrieve.</p>
+ </li>
+ <li><code>CONFIRM_NOTIFICATIONS</code>
+ <p>This request acknowledges that your application received the details of a purchase state
+ change. Google Play sends purchase state change notifications to your application until you
+ confirm that you received them.</p>
+ </li>
+ <li><code>RESTORE_TRANSACTIONS</code>
+ <p>This request retrieves a user's transaction status for <a
+ href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-purchase-type">managed
+ purchases</a> and <a
+ href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-purchase-type">subscriptions</a>.
+ You should send this request only when you need to retrieve a user's transaction
+ status, which is usually only when your application is reinstalled or installed for the first
+ time on a device.</p>
+ </li>
+</ul>
+
+<h3 id="billing-response">In-app Billing Responses</h3>
+
+<p>The Google Play application responds to in-app billing requests with both synchronous and
+asynchronous responses. The synchronous response is a {@link android.os.Bundle} with the following
+three keys:</p>
+
+<ul>
+ <li><code>RESPONSE_CODE</code>
+ <p>This key provides status information and error information about a request.</p>
+ </li>
+ <li><code>PURCHASE_INTENT</code>
+ <p>This key provides a {@link android.app.PendingIntent}, which you use to launch the checkout
+ activity.</p>
+ </li>
+ <li><code>REQUEST_ID</code>
+ <p>This key provides you with a request identifier, which you can use to match asynchronous
+ responses with requests.</p>
+ </li>
+</ul>
+<p>Some of these keys are not relevant to every request. For more information, see <a
+href="#billing-message-sequence">Messaging sequence</a> later in this document.</p>
+
+<p>The asynchronous response messages are sent in the form of individual broadcast intents and
+include the following:</p>
+
+<ul>
+ <li><code>com.android.vending.billing.RESPONSE_CODE</code>
+ <p>This response contains a Google Play server response code, and is sent after you make an
+ in-app billing request. A server response code can indicate that a billing request was
+ successfully sent to Google Play or it can indicate that some error occurred during a billing
+ request. This response is <em>not</em> used to report any purchase state changes (such as refund
+ or purchase information). For more information about the response codes that are sent with this
+ response, see <a
+ href="{@docRoot}guide/google/play/billing/billing_reference.html#billing-codes">Server Response Codes
+ for In-app Billing</a>.</p>
+ </li>
+ <li><code>com.android.vending.billing.IN_APP_NOTIFY</code>
+ <p>This response indicates that a purchase has changed state, which means a purchase succeeded,
+ was canceled, or was refunded. This response contains one or more notification IDs. Each
+ notification ID corresponds to a specific server-side message, and each messages contains
+ information about one or more transactions. After your application receives an
+ <code>IN_APP_NOTIFY</code> broadcast intent, you send a <code>GET_PURCHASE_INFORMATION</code>
+ request with the notification IDs to retrieve message details.</p>
+ </li>
+ <li><code>com.android.vending.billing.PURCHASE_STATE_CHANGED</code>
+ <p>This response contains detailed information about one or more transactions. The transaction
+ information is contained in a JSON string. The JSON string is signed and the signature is sent
+ to your application along with the JSON string (unencrypted). To help ensure the security of
+ your in-app billing messages, your application can verify the signature of this JSON string.</p>
+ </li>
+</ul>
+
+<p>The JSON string that is returned with the <code>PURCHASE_STATE_CHANGED</code> intent provides
+your application with the details of one or more billing transactions. An example of this JSON
+string for a subscription item is shown below:</p>
+<pre class="no-pretty-print" style="color:black">{ "nonce" : 1836535032137741465,
+ "orders" :
+ [{ "notificationId" : "android.test.purchased",
+ "orderId" : "transactionId.android.test.purchased",
+ "packageName" : "com.example.dungeons",
+ "productId" : "android.test.purchased",
+ "developerPayload" : "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ",
+ "purchaseTime" : 1290114783411,
+ "purchaseState" : 0,
+ "purchaseToken" : "rojeslcdyyiapnqcynkjyyjh" }]
+}
+</pre>
+
+<p>For more information about the fields in this JSON string, see <a
+href="{@docRoot}guide/google/play/billing/billing_reference.html#billing-intents">In-app Billing
+Broadcast Intents</a>.</p>
+
+<h3 id="billing-message-sequence">Messaging sequence</h3>
+
+<p>The messaging sequence for a typical purchase request is shown in figure 2. Request types for
+each <code>sendBillingRequest()</code> method are shown in <strong>bold</strong>, broadcast intents
+are shown in <em>italic</em>. For clarity, figure 2 does not show the <code>RESPONSE_CODE</code>
+broadcast intents that are sent for every request.</p>
+
+<p>The basic message sequence for an in-app purchase request is as follows:</p>
+
+<ol>
+ <li>Your application sends a purchase request (<code>REQUEST_PURCHASE</code> type), specifying a
+ product ID and other parameters.</li>
+ <li>The Google Play application sends your application a Bundle with the following keys:
+ <code>RESPONSE_CODE</code>, <code>PURCHASE_INTENT</code>, and <code>REQUEST_ID</code>. The
+ <code>PURCHASE_INTENT</code> key provides a {@link android.app.PendingIntent}, which your
+ application uses to start the checkout UI for the given product ID.</li>
+ <li>Your application launches the pending intent, which launches the checkout UI.
+ <p class="note"><strong>Note:</strong> You must launch the pending intent from an activity
+ context and not an application context.</p>
+ </li>
+ <li>When the checkout flow finishes (that is, the user successfully purchases the item or cancels
+ the purchase), Google Play sends your application a notification message (an
+ <code>IN_APP_NOTIFY</code> broadcast intent). The notification message includes a notification ID,
+ which references the transaction.</li>
+ <li>Your application requests the transaction information by sending a
+ <code>GET_PURCHASE_STATE_CHANGED</code> request, specifying the notification ID for the
+ transaction.</li>
+ <li>The Google Play application sends a Bundle with a <code>RESPONSE_CODE</code> key and a
+ <code>REQUEST_ID</code> key.
+ <li>Google Play sends the transaction information to your application in a
+ <code>PURCHASE_STATE_CHANGED</code> broadcast intent.</li>
+ <li>Your application confirms that you received the transaction information for the given
+ notification ID by sending a confirmation message (<code>CONFIRM_NOTIFICATIONS</code> type),
+ specifying the notification ID for which you received transaction information.</li>
+ <li>The Google Play application sends your application a Bundle with a
+ <code>RESPONSE_CODE</code> key and a <code>REQUEST_ID</code> key.</li>
+</ol>
+
+<img src="{@docRoot}images/billing_request_purchase.png" height="231" id="figure2" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> Message sequence for a purchase request.
+</p>
+
+<p>Keep in mind, you must send a confirmation when you receive transaction information from Google
+Play (step 8 in figure 2). If you don't send a confirmation message, Google Play will
+continue sending <code>IN_APP_NOTIFY</code> messages for the transactions you have not
+confirmed. As a best practice, you should not send a <code>CONFIRM_NOTIFICATIONS</code> request for
+a purchased item until you have delivered the item to the user. This way, if your application
+crashes or something else prevents your application from delivering the product, your application
+will still receive an <code>IN_APP_NOTIFY</code> broadcast intent from Google Play indicating
+that you need to deliver the product. Also, as a best practice, your application must be able to
+handle <code>IN_APP_NOTIFY</code> messages that contain multiple orders.</p>
+
+<p>The messaging sequence for a restore transaction request is shown in figure 3. Request types for
+each <code>sendBillingRequest()</code> method are shown in <strong>bold</strong>, broadcast intents
+are shown in <em>italic</em>. For clarity, figure 3 does not show the <code>RESPONSE_CODE</code>
+broadcast intents that are sent for every request.</p>
+
+<div class="figure" style="width:490px">
+<img src="{@docRoot}images/billing_restore_transactions.png" alt="" height="168" />
+<p class="img-caption">
+ <strong>Figure 3.</strong> Message sequence for a restore transactions request.
+</p>
+</div>
+
+<p>The request triggers three responses. The first is a {@link android.os.Bundle} with a
+<code>RESPONSE_CODE</code> key and a <code>REQUEST_ID</code> key. Next, the Google Play
+application sends a <code>RESPONSE_CODE</code> broadcast intent, which provides status information
+or error information about the request. As always, the <code>RESPONSE_CODE</code> message references
+a specific request ID, so you can determine which request a <code>RESPONSE_CODE</code> message
+pertains to.</p>
+
+<p>The <code>RESTORE_TRANSACTIONS</code> request type also triggers a
+<code>PURCHASE_STATE_CHANGED</code> broadcast intent, which contains the same type of transaction
+information that is sent during a purchase request, although you do not need to respond to this
+intent with a <code>CONFIRM_NOTIFICATIONS</code> message.</p>
+
+<p class="note"><strong>Note:</strong> You should use the <code>RESTORE_TRANSACTIONS</code> request
+type only when your application is installed for the first time on a device or when your
+application has been removed from a device and reinstalled.</p>
+
+<p>The messaging sequence for checking whether in-app billing is supported is shown in figure 4. The
+request type for the <code>sendBillingRequest()</code> method is shown in <strong>bold</strong>.</p>
+
+<div class="figure" style="width:454px">
+<img src="{@docRoot}images/billing_check_supported.png" alt="" height="168" />
+<p class="img-caption">
+ <strong>Figure 4.</strong> Message sequence for checking whether in-app billing is supported.
+</p>
+</div>
+
+<p>The synchronous response for a <code>CHECK_BILLING_SUPPORTED</code> request provides a Bundle
+with a server response code. A <code>RESULT_OK</code> response code indicates that in-app billing
+is supported; a <code>RESULT_BILLING_UNAVAILABLE</code> response code indicates that in-app billing
+is unavailable because the API version you specified is unrecognized or the user is not eligible to
+make in-app purchases (for example, the user resides in a country that does not allow in-app
+billing). A <code>SERVER_ERROR</code> can also be returned, indicating that there was a problem with
+the Google Play server.</p>
+
+<h3 id="billing-action-notify">Handling IN_APP_NOTIFY messages</h3>
+
+<p>Usually, your application receives an <code>IN_APP_NOTIFY</code> broadcast intent from Google
+Play in response to a <code>REQUEST_PURCHASE</code> message (see figure 2). The
+<code>IN_APP_NOTIFY</code> broadcast intent informs your application that the state of a requested
+purchase has changed. To retrieve the details of that purchase, your application sends a
+<code>GET_PURCHASE_INFORMATION</code> request. Google Play responds with a
+<code>PURCHASE_STATE_CHANGED</code> broadcast intent, which contains the details of the purchase
+state change. Your application then sends a <code>CONFIRM_NOTIFICATIONS</code> message, informing
+Google Play that you have received the purchase state change information.</p>
+
+<p>In some special cases, you may receive multiple <code>IN_APP_NOTIFY</code> messages even though
+you have confirmed receipt of the purchase information, or you may receive
+<code>IN_APP_NOTIFY</code> messages for a purchase change even though you never initiated the
+purchase. Your application must handle both of these special cases.</p>
+
+<h4>Handling multiple IN_APP_NOTIFY messages</h4>
+
+<p>When Google Play receives a <code>CONFIRM_NOTIFICATIONS</code> message for a given
+<code>PURCHASE_STATE_CHANGED</code> message, it usually stops sending <code>IN_APP_NOTIFY</code>
+intents for that <code>PURCHASE_STATE_CHANGED</code> message. Sometimes, however, Google
+Play may send repeated <code>IN_APP_NOTIFY</code> intents for a
+<code>PURCHASE_STATE_CHANGED</code> message even though your application has sent a
+<code>CONFIRM_NOTIFICATIONS</code> message. This can occur if a device loses network connectivity
+while you are sending the <code>CONFIRM_NOTIFICATIONS</code> message. In this case, Google Play
+might not receive your <code>CONFIRM_NOTIFICATIONS</code> message and it could send multiple
+<code>IN_APP_NOTIFY</code> messages until it receives acknowledgement that you received the
+transaction message. Therefore, your application must be able to recognize that the subsequent
+<code>IN_APP_NOTIFY</code> messages are for a previously processed transaction. You can do this by
+checking the <code>orderID</code> that's contained in the JSON string because every transaction has
+a unique <code>orderId</code>.</p>
+
+<h4>Handling refunds and other unsolicited IN_APP_NOTIFY messages</h4>
+
+<p>There are two cases where your application may receive <code>IN_APP_NOTIFY</code> broadcast
+intents even though your application has not sent a <code>REQUEST_PURCHASE</code> message. Figure 5
+shows the messaging sequence for both of these cases. Request types for each
+<code>sendBillingRequest()</code> method are shown in <strong>bold</strong>, broadcast intents are
+shown in <em>italic</em>. For clarity, figure 5 does not show the <code>RESPONSE_CODE</code>
+broadcast intents that are sent for every request.</p>
+
+<div class="figure" style="width:481px">
+<img src="{@docRoot}images/billing_refund.png" alt="" height="189" />
+<p class="img-caption">
+ <strong>Figure 5.</strong> Message sequence for refunds and other unsolicited
+IN_APP_NOTIFY messages.</p>
+</div>
+
+<p>In the first case, your application may receive an <code>IN_APP_NOTIFY</code> broadcast intent
+when a user has your application installed on two (or more) devices and the user makes an in-app
+purchase from one of the devices. In this case, Google Play sends an <code>IN_APP_NOTIFY</code>
+message to the second device, informing the application that there is a purchase state change. Your
+application can handle this message the same way it handles the response from an
+application-initiated <code>REQUEST_PURCHASE</code> message, so that ultimately your application
+receives a <code>PURCHASE_STATE_CHANGED</code> broadcast intent message that includes information
+about the item that has been purchased. This applies only to items that have their <a
+href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-purchase-type">purchase type</a> set
+to "managed per user account."</p>
+
+<p>In the second case, your application can receive an <code>IN_APP_NOTIFY</code> broadcast intent
+when Google Play receives a refund notification from Google Wallet. In this case, Google
+Play sends an <code>IN_APP_NOTIFY</code> message to your application. Your application can handle
+this message the same way it handles responses from an application-initiated
+<code>REQUEST_PURCHASE</code> message so that ultimately your application receives a
+<code>PURCHASE_STATE_CHANGED</code> message that includes information about the item that has been
+refunded. The refund information is included in the JSON string that accompanies the
+<code>PURCHASE_STATE_CHANGED</code> broadcast intent. Also, the <code>purchaseState</code> field in
+the JSON string is set to 2.</p>
+
+<p class="caution"><strong>Important:</strong> You cannot use the Google Wallet API to
+issue refunds or cancel in-app billing transactions. You must do this manually through your
+Google Wallet merchant account. However, you can use the Google Wallet API to retrieve order
+information.</p>
+
+<h2 id="billing-security">Security Controls</h2>
+
+<p>To help ensure the integrity of the transaction information that is sent to your application,
+Google Play signs the JSON string that is contained in the <code>PURCHASE_STATE_CHANGED</code>
+broadcast intent. Google Play uses the private key that is associated with your publisher account
+to create this signature. The publisher site generates an RSA key pair for each publisher account.
+You can find the public key portion of this key pair on your account's profile page. It is the same
+public key that is used with Google Play licensing.</p>
+
+<p>When Google Play signs a billing response, it includes the signed JSON string (unencrypted)
+and the signature. When your application receives this signed response you can use the public key
+portion of your RSA key pair to verify the signature. By performing signature verification you can
+help detect responses that have been tampered with or that have been spoofed. You can perform this
+signature verification step in your application; however, if your application connects to a secure
+remote server then we recommend that you perform the signature verification on that server.</p>
+
+<p>In-app billing also uses nonces (a random number used once) to help verify the integrity of the
+purchase information that's returned from Google Play. Your application must generate a nonce and
+send it with a <code>GET_PURCHASE_INFORMATION</code> request and a <code>RESTORE_TRANSACTIONS</code>
+request. When Google Play receives the request, it adds the nonce to the JSON string that
+contains the transaction information. The JSON string is then signed and returned to your
+application. When your application receives the JSON string, you need to verify the nonce as well as
+the signature of the JSON string.</p>
+
+<p>For more information about best practices for security and design, see <a
+href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and Design</a>.</p>
+
+<h2 id="billing-limitations">In-app Billing Requirements and Limitations</h2>
+
+<p>Before you get started with in-app billing, be sure to review the following requirements and
+limitations.</p>
+
+<ul>
+ <li>In-app billing can be implemented only in applications that you publish through Google
+ Play.</li>
+ <li>You must have a Google Wallet Merchant account to use Google Play In-app Billing.</li>
+ <li>In-app billing requires version 2.3.4 (or higher) of the Android Market application.
+ To support subscriptions, version 3.5 or higher of the Google Play app is required. On devices
+ running Android 3.0, version 5.0.12 (or higher) of the MyApps application is required.</li>
+ <li>An application can use in-app billing only if the device is running Android 1.6 (API level 4)
+ or higher.</li>
+ <li>You can use in-app billing to sell only digital content. You cannot use in-app billing to sell
+ physical goods, personal services, or anything that requires physical delivery.</li>
+ <li>Google Play does not provide any form of content delivery. You are responsible for
+ delivering the digital content that you sell in your applications.</li>
+ <li>You cannot implement in-app billing on a device that never connects to the network. To
+ complete in-app purchase requests, a device must be able to access the Google Play server over
+ the network. </li>
+</ul>
+
+<p>For more information about in-app billing requirements, see <a
+href="https://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1153481">In-App
+Billing Availability and Policies</a>.</p>
diff --git a/docs/html/guide/google/play/billing/billing_reference.jd b/docs/html/guide/google/play/billing/billing_reference.jd
new file mode 100755
index 0000000..f8c6967
--- /dev/null
+++ b/docs/html/guide/google/play/billing/billing_reference.jd
@@ -0,0 +1,491 @@
+page.title=In-app Billing Reference
+parent.title=In-app Billing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#billing-codes">Server Response Codes for In-app Billing</a></li>
+ <li><a href="#billing-interface">In-app Billing Service Interface</a></li>
+ <li><a href="#billing-intents">In-app Billing Broadcast Intents</a></li>
+ <li><a href="#other-intents">Other Broadcast Intents</a></li>
+ <li><a href="#billing-versions">In-app Billing API Versions</a></li>
+ </ol>
+ <h2>Downloads</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">Sample
+ Application</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_overview.html">Overview of In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html">Implementing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and
+ Design</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_testing.html">Testing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_admin.html">Administering In-app
+ Billing</a></li>
+ </ol>
+</div>
+</div>
+
+<p>The following document provides technical reference information for the following:</p>
+
+<ul>
+ <li><a href="#billing-codes">Google Play Server Response Codes for In-app Billing</a></li>
+ <li><a href="#billing-interface">In-app Billing Interface Parameters</a></li>
+ <li><a href="#billing-intents">In-app Billing Broadcast Intents</a></li>
+ <li><a href="#other-intents">Other Intents</a></li>
+ <li><a href="#billing-versions">In-app Billing API Versions</a></li>
+</ul>
+
+<h2 id="billing-codes">Server Response Codes for In-app Billing</h2>
+
+<p>The following table lists all of the server response codes that are sent from Google Play to
+your application. Google Play sends these response codes asynchronously as
+<code>response_code</code> extras in the <code>com.android.vending.billing.RESPONSE_CODE</code>
+broadcast intent. Your application must handle all of these response codes.</p>
+
+<p class="table-caption" id="response-codes-table"><strong>Table 1.</strong> Summary of response
+codes returned by Google Play.</p>
+
+<table>
+
+<tr>
+<th>Response Code</th>
+<th>Value</th>
+<th>Description</th>
+</tr>
+<tr>
+ <td><code>RESULT_OK</code></td>
+ <td>0</td>
+ <td>Indicates that the request was sent to the server successfully. When this code is returned in
+ response to a <code>CHECK_BILLING_SUPPORTED</code> request, indicates that billing is
+ supported.</td>
+</tr>
+<tr>
+ <td><code>RESULT_USER_CANCELED</code></td>
+ <td>1</td>
+ <td>Indicates that the user pressed the back button on the checkout page instead of buying the
+ item.</td>
+</tr>
+<tr>
+ <td><code>RESULT_SERVICE_UNAVAILABLE</code></td>
+ <td>2</td>
+ <td>Indicates that the network connection is down.</td>
+</tr>
+<tr>
+ <td><code>RESULT_BILLING_UNAVAILABLE</code></td>
+ <td>3</td>
+ <td>Indicates that in-app billing is not available because the <code>API_VERSION</code> that you
+ specified is not recognized by the Google Play application or the user is ineligible for in-app
+ billing (for example, the user resides in a country that prohibits in-app purchases).</td>
+</tr>
+<tr>
+ <td><code>RESULT_ITEM_UNAVAILABLE</code></td>
+ <td>4</td>
+ <td>Indicates that Google Play cannot find the requested item in the application's product
+ list. This can happen if the product ID is misspelled in your <code>REQUEST_PURCHASE</code>
+ request or if an item is unpublished in the application's product list.</td>
+</tr>
+<tr>
+ <td><code>RESULT_DEVELOPER_ERROR</code></td>
+ <td>5</td>
+ <td>Indicates that an application is trying to make an in-app billing request but the application
+ has not declared the com.android.vending.BILLING permission in its manifest. Can also indicate
+ that an application is not properly signed, or that you sent a malformed request, such as a
+ request with missing Bundle keys or a request that uses an unrecognized request type.</td>
+</tr>
+<tr>
+ <td><code>RESULT_ERROR</code></td>
+ <td>6</td>
+ <td>Indicates an unexpected server error. For example, this error is triggered if you try to
+purchase an item from yourself, which is not allowed by Google Wallet.</td>
+</tr>
+</table>
+
+<h2 id="billing-interface">In-app Billing Service Interface</h2>
+
+<p>The following section describes the interface for Google Play's in-app billing service. The
+interface is defined in the <code>IMarketBillingService.aidl</code> file, which is included with the
+in-app billing <a
+href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">sample
+application</a>.</p>
+<p>The interface consists of a single request method <code>sendBillingRequest()</code>. This method
+takes a single {@link android.os.Bundle} parameter. The Bundle parameter includes several key-value
+pairs, which are summarized in table 2.</p>
+
+<p class="table-caption"><strong>Table 2.</strong> Description of Bundle keys passed in a
+<code>sendBillingRequest()</code> request.</p>
+
+<table>
+
+<tr>
+<th>Key</th>
+<th>Type</th>
+<th>Possible Values</th>
+<th>Required?</th>
+<th>Description</th>
+</tr>
+<tr>
+ <td><code>BILLING_REQUEST</code></td>
+ <td><code>String</code></td>
+ <td><code>CHECK_BILLING_SUPPORTED</code>, <code>REQUEST_PURCHASE</code>,
+ <code>GET_PURCHASE_INFORMATION</code>, <code>CONFIRM_NOTIFICATIONS</code>, or
+ <code>RESTORE_TRANSACTIONS</code></td>
+ <td>Yes</td>
+ <td>The type of billing request you are making with the <code>sendBillingRequest()</code> request.
+ The possible values are discussed more below this table.</td>
+</tr>
+<tr>
+ <td><code>API_VERSION</code></td>
+ <td><code>int</code></td>
+ <td> <ul>
+ <li><code>"2"</code> [<a href="#version_2">details</a>]</li>
+ <li><code>"1"</code> [<a href="#version_1">details</a>]</li>
+ </ul></td>
+ <td>Yes</td>
+ <td>The version of Google Play's in-app billing service you want to use. The current version is
+ 2.</td>
+</tr>
+<tr>
+ <td><code>PACKAGE_NAME</code></td>
+ <td><code>String</code></td>
+ <td>A valid package name.</td>
+ <td>Yes</td>
+ <td>The name of the application that is making the request.</td>
+</tr>
+<tr>
+ <td><code>ITEM_ID</code></td>
+ <td><code>String</code></td>
+ <td>Any valid product identifier.</td>
+ <td>Required for <code>REQUEST_PURCHASE</code> requests.</td>
+ <td>The product ID of the item you are making a billing request for. Every in-app item that you
+ sell using Google Play's in-app billing service must have a unique product ID, which you
+ specify on the Google Play publisher site.</td>
+</tr>
+<tr>
+ <td><code>NONCE</code></td>
+ <td><code>long</code></td>
+ <td>Any valid <code>long</code> value.</td>
+ <td>Required for <code>GET_PURCHASE_INFORMATION</code> and <code>RESTORE_TRANSACTIONS</code>
+ requests.</td>
+ <td>A number used once. Your application must generate and send a nonce with each
+ <code>GET_PURCHASE_INFORMATION</code> and <code>RESTORE_TRANSACTIONS</code> request. The nonce is
+ returned with the <code>PURCHASE_STATE_CHANGED</code> broadcast intent, so you can use this value
+ to verify the integrity of transaction responses form Google Play.</td>
+</tr>
+<tr>
+ <td><code>NOTIFY_IDS</code></td>
+ <td>Array of <code>long</code> values</td>
+ <td>Any valid array of <code>long</code> values</td>
+ <td>Required for <code>GET_PURCHASE_INFORMATION</code> and <code>CONFIRM_NOTIFICATIONS</code>
+ requests.</td>
+ <td>An array of notification identifiers. A notification ID is sent to your application in an
+ <code>IN_APP_NOTIFY</code> broadcast intent every time a purchase changes state. You use the
+ notification to retrieve the details of the purchase state change.</td>
+</tr>
+<tr>
+ <td><code>DEVELOPER_PAYLOAD</code></td>
+ <td><code>String</code></td>
+ <td>Any valid <code>String</code> less than 256 characters long.</td>
+ <td>No</td>
+ <td>A developer-specified string that can be specified when you make a
+ <code>REQUEST_PURCHASE</code> request. This field is returned in the JSON string that contains
+ transaction information for an order. You can use this key to send supplemental information with
+ an order. For example, you can use this key to send index keys with an order, which is useful if
+ you are using a database to store purchase information. We recommend that you do not use this key
+ to send data or content.</td>
+</tr>
+</table>
+
+<p>The <code>BILLING_REQUEST</code> key can have the following values:</p>
+
+<ul>
+ <li><code>CHECK_BILLING_SUPPORTED</code>
+ <p>This request verifies that the Google Play application supports in-app billing. You
+ usually send this request when your application first starts up. This request is useful if you
+ want to enable or disable certain UI features that are relevant only to in-app billing.</p>
+ </li>
+ <li><code>REQUEST_PURCHASE</code>
+ <p>This request sends a purchase message to the Google Play application and is the foundation
+ of in-app billing. You send this request when a user indicates that he or she wants to purchase
+ an item in your application. Google Play then handles the financial transaction by displaying
+ the checkout user interface.</p>
+ </li>
+ <li><code>GET_PURCHASE_INFORMATION</code>
+ <p>This request retrieves the details of a purchase state change. A purchase state change can
+ occur when a purchase request is billed successfully or when a user cancels a transaction during
+ checkout. It can also occur when a previous purchase is refunded. Google Play notifies your
+ application when a purchase changes state, so you only need to send this request when there is
+ transaction information to retrieve.</p>
+ </li>
+ <li><code>CONFIRM_NOTIFICATIONS</code>
+ <p>This request acknowledges that your application received the details of a purchase state
+ change. That is, this message confirms that you sent a <code>GET_PURCHASE_INFORMATION</code>
+ request for a given notification and that you received the purchase information for the
+ notification.</p>
+ </li>
+ <li><code>RESTORE_TRANSACTIONS</code>
+ <p>This request retrieves a user's transaction status for managed purchases (see <a
+ href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-purchase-type">Choosing a
+ Purchase Type</a> for more information). You should send this message only when you need to
+ retrieve a user's transaction status, which is usually only when your application is reinstalled
+ or installed for the first time on a device.</p>
+ </li>
+</ul>
+
+<p>Every in-app billing request generates a synchronous response. The response is a {@link
+android.os.Bundle} and can include one or more of the following keys:</p>
+
+<ul>
+ <li><code>RESPONSE_CODE</code>
+ <p>This key provides status information and error information about a request.</p>
+ </li>
+ <li><code>PURCHASE_INTENT</code>
+ <p>This key provides a {@link android.app.PendingIntent}, which you use to launch the checkout
+ activity.</p>
+ </li>
+ <li><code>REQUEST_ID</code>
+ <p>This key provides you with a request identifier, which you can use to match asynchronous
+ responses with requests.</p>
+ </li>
+</ul>
+
+<p>Some of these keys are not relevant to certain types of requests. Table 3 shows which keys are
+returned for each request type.</p>
+
+<p class="table-caption"><strong>Table 3.</strong> Description of Bundle keys that are returned with
+each in-app billing request type.</p>
+
+<table>
+
+<tr>
+<th>Request Type</th>
+<th>Keys Returned</th>
+<th>Possible Response Codes</th>
+</tr>
+<tr>
+ <td><code>CHECK_BILLING_SUPPORTED</code></td>
+ <td><code>RESPONSE_CODE</code></td>
+ <td><code>RESULT_OK</code>, <code>RESULT_BILLING_UNAVAILABLE</code>, <code>RESULT_ERROR</code>,
+ <code>RESULT_DEVELOPER_ERROR</code></td>
+</tr>
+<tr>
+ <td><code>REQUEST_PURCHASE</code></td>
+ <td><code>RESPONSE_CODE</code>, <code>PURCHASE_INTENT</code>, <code>REQUEST_ID</code></td>
+ <td><code>RESULT_OK</code>, <code>RESULT_ERROR</code>, <code>RESULT_DEVELOPER_ERROR</code></td>
+</tr>
+<tr>
+ <td><code>GET_PURCHASE_INFORMATION</code></td>
+ <td><code>RESPONSE_CODE</code>, <code>REQUEST_ID</code></td>
+ <td><code>RESULT_OK</code>, <code>RESULT_ERROR</code>, <code>RESULT_DEVELOPER_ERROR</code></td>
+</tr>
+<tr>
+ <td><code>CONFIRM_NOTIFICATIONS</code></td>
+ <td><code>RESPONSE_CODE</code>, <code>REQUEST_ID</code></td>
+ <td><code>RESULT_OK</code>, <code>RESULT_ERROR</code>, <code>RESULT_DEVELOPER_ERROR</code></td>
+</tr>
+<tr>
+ <td><code>RESTORE_TRANSACTIONS</code></td>
+ <td><code>RESPONSE_CODE</code>, <code>REQUEST_ID</code></td>
+ <td><code>RESULT_OK</code>, <code>RESULT_ERROR</code>, <code>RESULT_DEVELOPER_ERROR</code></td>
+</tr>
+</table>
+
+<h2 id="billing-intents">In-app Billing Broadcast Intents</h2>
+
+<p>The following section describes the in-app billing broadcast intents that are sent by the Google
+Play application. These broadcast intents inform your application about in-app billing actions
+that have occurred. Your application must implement a {@link android.content.BroadcastReceiver} to
+receive these broadcast intents, such as the <code>BillingReceiver</code> that's shown in the in-app
+billing <a href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">sample
+application</a>.</p>
+
+<h4>com.android.vending.billing.RESPONSE_CODE</h4>
+
+<p>This broadcast intent contains a Google Play response code, and is sent after you make an
+in-app billing request. A server response code can indicate that a billing request was successfully
+sent to Google Play or it can indicate that some error occurred during a billing request. This
+intent is not used to report any purchase state changes (such as refund or purchase information).
+For more information about the response codes that are sent with this response, see <a
+href="#billing-codes">Google Play Response Codes for In-app Billing</a>. The sample application
+assigns this broadcast intent to a constant named <code>ACTION_RESPONSE_CODE</code>.</p>
+
+<h5>Extras</h5>
+
+<ul type="none">
+ <li><code>request_id</code>—a <code>long</code> representing a request ID. A request ID
+ identifies a specific billing request and is returned by Google Play at the time a request is
+ made.</li>
+ <li><code>response_code</code>—an <code>int</code> representing the Google Play server
+ response code.</li>
+</ul>
+
+<h4>com.android.vending.billing.IN_APP_NOTIFY</h4>
+
+<p>This response indicates that a purchase has changed state, which means a purchase succeeded, was
+canceled, or was refunded. This response contains one or more notification IDs. Each notification ID
+corresponds to a specific server-side message, and each messages contains information about one or
+more transactions. After your application receives an <code>IN_APP_NOTIFY</code> broadcast intent,
+you send a <code>GET_PURCHASE_INFORMATION</code> request with the notification IDs to retrieve the
+message details. The sample application assigns this broadcast intent to a constant named
+<code>ACTION_NOTIFY</code>.</p>
+
+<h5>Extras</h5>
+
+<ul type="none">
+ <li><code>notification_id</code>—a <code>String</code> representing the notification ID for
+ a given purchase state change. Google Play notifies you when there is a purchase state change
+ and the notification includes a unique notification ID. To get the details of the purchase state
+ change, you send the notification ID with the <code>GET_PURCHASE_INFORMATION</code> request.</li>
+</ul>
+
+<h4>com.android.vending.billing.PURCHASE_STATE_CHANGED</h4>
+
+<p>This broadcast intent contains detailed information about one or more transactions. The
+transaction information is contained in a JSON string. The JSON string is signed and the signature
+is sent to your application along with the JSON string (unencrypted). To help ensure the security of
+your in-app billing messages, your application can verify the signature of this JSON string. The
+sample application assigns this broadcast intent to a constant named
+<code>ACTION_PURCHASE_STATE_CHANGED</code>.</p>
+
+<h5>Extras</h5>
+
+<ul type="none">
+ <li><code>inapp_signed_data</code>—a <code>String</code> representing the signed JSON
+ string.</li>
+ <li><code>inapp_signature</code>—a <code>String</code> representing the signature.</li>
+</ul>
+
+<p class="note"><strong>Note:</strong> Your application should map the broadcast intents and extras
+to constants that are unique to your application. See the <code>Consts.java</code> file in the
+sample application to see how this is done.</p>
+
+<p>The fields in the JSON string are described in the following table (see table 4):</p>
+
+<p class="table-caption"><strong>Table 4.</strong> Description of JSON fields that are returned with
+a <code>PURCHASE_STATE_CHANGED</code> intent.</p>
+
+<table>
+
+<tr>
+<th>Field</th>
+<th>Description</th>
+</tr>
+<tr>
+ <td>nonce</td>
+ <td>A number used once. Your application generates the nonce and sends it with the
+ <code>GET_PURCHASE_INFORMATION</code> request. Google Play sends the nonce back as part of the
+ JSON string so you can verify the integrity of the message.</td>
+</tr>
+<tr>
+ <td>notificationId</td>
+ <td>A unique identifier that is sent with an <code>IN_APP_NOTIFY</code> broadcast intent. Each
+ <code>notificationId</code> corresponds to a specify message that is waiting to be retrieved on
+ the Google Play server. Your application sends back the <code>notificationId</code> with the
+ <code>GET_PURCHASE_INFORMATION</code> message so Google Play can determine which messages you
+ are retrieving.</td>
+</tr>
+<tr>
+ <td>orderId</td>
+ <td>A unique order identifier for the transaction. This corresponds to the Google Wallet Order
+ ID.</td>
+</tr>
+<tr>
+ <td>packageName</td>
+ <td>The application package from which the purchase originated.</td>
+</tr>
+<tr>
+ <td>productId</td>
+ <td>The item's product identifier. Every item has a product ID, which you must specify in the
+ application's product list on the Google Play publisher site.</td>
+</tr>
+<tr>
+ <td>purchaseTime</td>
+ <td>The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970).</td>
+</tr>
+
+<tr>
+ <td>purchaseState</td>
+ <td>The purchase state of the order. Possible values are 0 (purchased), 1 (canceled), 2
+ (refunded), or 3 (expired, for subscription purchases only).</td>
+</tr>
+<tr>
+ <td>purchaseToken</td>
+ <td>A token that uniquely identifies a subscription purchase for a given item and user pair.
+ You can use the token to specify the subscription when querying for subscription validity.
+
+ <p><br><em>Supported only in In-app Billing API version 2 and higher.</em></p></td>
+</tr>
+<tr>
+ <td>developerPayload</td>
+ <td>A developer-specified string that contains supplemental information about an order. You can
+ specify a value for this field when you make a <code>REQUEST_PURCHASE</code> request.</td>
+</tr>
+</table>
+
+<!--<h2 id="other-intents">Other Intents</h2>
+
+<p>The following Intents related to In-app Billing may be useful in your
+implemention. </p> -->
+
+<h2 id="http-api">HTTP API for verification and cancelation</h2>
+
+<p>Google Play offers an HTTP-based API that you can use to remotely query the
+validity of a specific subscription at any time or cancel a subscription. The
+API is designed to be used from your backend servers as a way of securely
+managing subscriptions, as well as extending and integrating subscriptions with
+other services. See <a
+href="{@docRoot}guide/google/play/billing/billing_subscriptions.html#play-dev-api">
+Google Play Android Developer API</a> for more information.</p>
+
+<h2 id="billing-versions">In-app Billing API Versions</h2>
+
+<p>The In-app Billing API is versioned, with each version offering
+additional features to your app. At run time, your app can query the Google Play app to determine
+what version of the API it supports and what features are available. Typically, the Google Play app
+will be updated and will support the latest version of the API. For a summary of versions see
+<a href="{@docRoot}guide/google/play/billing/billing_reference.html#billing-versions">In-app Billing
+API Versions</a>.</p>
+
+<p>The sections below list the supported versions of the In-app Billing API.
+Versions are specified in the <code>API_VERSION</code> key of the Bundle object
+passed in the <code>sendBillingRequest()</code>, which is defined in the defined
+in the <code>IMarketBillingService.aidl</code> file, which is included with the
+in-app billing <a
+href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">
+sample application</a>. For more information, see <a
+href="#billing-interface">In-app Billing Service Interface</a>.</p>
+<h3 id="version_2">In-app Billing version 2</h3>
+
+<p><em>May 2012</em></p>
+
+<ul>
+<li>Adds support for subscriptions.
+ <ul>
+ <li>Adds a new supported string value, "2", for the <code>API_VERSION</code> key
+ of the Bundle object passed in the <code>sendBillingRequest()</code>.</li>
+ <li>Adds a new JSON field, <code>purchaseToken</code>, to the
+ <code>orders</code> list returned in a <code>PURCHASE_STATE_CHANGED</code>
+ intent. </li>
+ <li>Adds a new <code>purchaseState</code> value, <code>3</code> (expired), to the
+ <code>orders</code> list returned in a <code>PURCHASE_STATE_CHANGED</code>
+ intent. The value indicates that a subscription has expired and is no longer valid.</li>
+<li>Requires Google Play (Play Store) version 3.5 or higher.</li>
+</ul>
+
+<h3 id="version_1">In-app Billing version 1</h3>
+
+<p><em>March 2011</em></p>
+
+<ul>
+<li>Initial release.</li>
+<li>Requires Google Play/Android Market 2.3.4 or higher.</li>
+</ul>
+
diff --git a/docs/html/guide/google/play/billing/billing_subscriptions.jd b/docs/html/guide/google/play/billing/billing_subscriptions.jd
new file mode 100755
index 0000000..3cf9777
--- /dev/null
+++ b/docs/html/guide/google/play/billing/billing_subscriptions.jd
@@ -0,0 +1,859 @@
+page.title=Subscriptions
+parent.title=In-app Billing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#overview">Overview of Subscriptions</a>
+ <!--<ol>
+ <li><a href="#publishing">Subscription publishing and unpublishing</a></li>
+ <li><a href="#pricing">Subscription pricing</a></li>
+ <li><a href="#user-billing">User billing</a></li>
+ <li><a href="#cancellation">Subscription cancellation</a></li>
+ <li><a href="#uninstallation">App uninstallation</a></li>
+ <li><a href="#refunds">Refunds</a></li>
+ <li><a href="#payment">Payment processing and policies</a></li>
+ <li><a href="#requirements">System requirements for subscriptions</a></li>
+ <li><a href="#compatibility">Compatibility considerations</a></li>
+ </ol> -->
+ </li>
+ <li><a href="#implementing">Implementing Subscriptions</a>
+ <!-- <ol>
+ <li><a href="#sample">Sample application</a></li>
+ <li><a href="#model">Application model</a></li>
+ <li><a href="#token">Purchase token</a></li>
+ <li><a href="#version">Checking the In-app Billing API version</a></li>
+ <li><a href="purchase">Requesting purchase of a subscription</a></li>
+ <li><a href="#restore">Restoring transactions</a></li>
+ <li><a href="#validity">Checking subscription validity</a></li>
+ <li><a href="#viewstatus">Launching your product page to let the user cancel or view status</a></li>
+ <li><a href="#purchase-state-changes">Recurring billing and changes in purchase state</a></li>
+ <li><a href="modifying">Modifying your app for subscriptions</a></li>
+ </ol> -->
+ </li>
+ <li><a href="#administering">Administering Subscriptions</a></li>
+
+ <li><a href="#play-dev-api">Google Play Android Developer API</a>
+ <!-- <ol>
+ <li><a href="#using">Using the API</a></li>
+ <li><a href="#quota">Quota</a></li>
+ <li><a href="#auth">Authorization</a></li>
+ <li><a href="#practices">Using the API efficiently</a></li>
+ </ol> -->
+ </li>
+</ol>
+ <h2>Downloads</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">Sample Application</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_overview.html">Overview of In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and
+ Design</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_testing.html">Testing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_admin.html">Administering In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_reference.html">In-app Billing
+ Reference</a></li>
+ </ol>
+</div>
+</div>
+
+<p>Subscriptions let you sell content, services, or features in your app with
+automated, recurring billing. Adding support for subscriptions is
+straightforward and you can easily adapt an existing In-app Billing
+implementation to sell subscriptions. </p>
+
+<p>If you have already implemented In-app Billing for one-time purchase
+products, you will find that you can add support for subscriptions with minimal
+impact on your code. If you are new to In-app Billing, you can implement
+subscriptions using the standard communication model, data structures, and user
+interactions as for other in-app products.subscriptions. Because the
+implementation of subscriptions follows the same path as for other in-app
+products, details are provided outside of this document, starting with the <a
+href="{@docRoot}guide/google/play/billing/billing_overview.html">In-app Billing
+Overview</a>. </p>
+
+<p>This document is focused on highlighting implementation details that are
+specific to subscriptions, along with some strategies for the associated billing
+and business models.</p>
+
+<h2 id="overview">Overview of Subscriptions</h2>
+
+<p>A <em>subscription</em> is a new product type offered in In-app Billing that lets you
+sell content, services, or features to users from inside your app with recurring
+monthly or annual billing. You can sell subscriptions to almost any type of
+digital content, from any type of app or game.</p>
+
+<p>As with other in-app products, you configure and publish subscriptions using
+the Developer Console and then sell them from inside apps installed on an
+Android-powered devices. In the Developer console, you create subscription
+products and add them to a product list, setting a price for each, choosing a
+billing interval of monthly or annually, and then publishing. In your apps, it’s
+straightforward to add support for subscription purchases. The implementation
+extends the standard In-app Billing API to support a new product type but uses
+the same communication model, data structures, and user interactions as for
+other in-app products.</p>
+
+<p>When users purchase subscriptions in your apps, Google Play handles all
+checkout details so your apps never have to directly process any financial
+transactions. Google Play processes all payments for subscriptions through
+Google Wallet, just as it does for standard in-app products and app purchases.
+This ensures a consistent and familiar purchase flow for your users.</p>
+
+<img src="{@docRoot}images/billing_subscription_flow.png" style="border:4px solid ddd;">
+
+
+<p>After users have purchase subscriptions, they can view the subscriptions and
+cancel them, if necessary, from the My Apps screen in the Play Store app or
+from the app's product details page in the Play Store app.</p>
+
+<!--<img src="{@docRoot}images/billing_subscription_cancel.png" style="border:4px solid ddd;">-->
+
+<p>Once users have purchased a subscription through In-app Billing, you can
+easily give them extended access to additional content on your web site (or
+other service) through the use of a server-side API provided for In-app Billing.
+The server-side API lets you validate the status of a subscription when users
+sign into your other services. For more information about the API, see <a
+href="#play-dev-api">Google Play Android Developer API</a>, below. </p>
+
+<p>You can also build on your existing external subscriber base from inside your
+Android apps. If you sell subscriptions on a web site, for example, you can add
+your own business logic to your Android app to determine whether the user has
+already purchased a subscription elsewhere, then allow access to your content if
+so or offer a subscription purchase from Google Play if not.</p>
+
+<p>With the flexibility of In-app Billing, you can even implement your own
+solution for sharing subscriptions across as many different apps or products as
+you want. For example, you could sell a subscription that gives a subscriber
+access to an entire collection of apps, games, or other content for a monthly or
+annual fee. To implement this solution, you could add your own business logic to
+your app to determine whether the user has already purchased a given
+subscription and if so, allow access to your content. </p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <h2>Subscriptions at a glance</h2>
+ <ul>
+ <li>Subscriptions let you sell products with automated, recurring billing</li>
+ <li>You can set up subscriptions with either monthly or annual billing</li>
+ <li>You can sell multiple subscription items in an app with various billing
+ intervals or prices, such as for promotions</li>
+ <li>Users purchase your subscriptions from inside your apps, rather than
+ directly from Google Play</li>
+ <li>Users manage their purchased subscriptions from the My Apps screen in
+ the Play Store app</li>
+ <li>Google Play uses the original form of payment for recurring billing</li>
+ <li>If a user cancels a subscription, Google Play considers the subscription valid
+ until the end of the current billing cycle. The user continues to enjoy the content
+ for the rest of the cycle and is not granted a refund.</li>
+ </ul>
+</div>
+</div>
+
+<p>In general the same basic policies and terms apply to subscriptions as to
+standard in-app products, however there are some differences. For complete
+information about the current policies and terms, please read the <a
+href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en
+&answer=140504">policies document</a>.</p>
+
+
+<h3 id="publishing">Subscription publishing and unpublishing</h3>
+
+<p>To sell a subscription in an app, you use the tools in the Developer Console
+to set up a product list for the app and then create and configure a new
+subscription. In the subscription, you set the price and billing interval and
+define a subscription ID, title, and description. When you are ready, you can
+then publish the subscription in the app product list.</p>
+
+<p>In the product list, you can add subscriptions, in-app products, or both. You
+can add multiple subscriptions that give access to different content or
+services, or you can add multiple subscriptions that give access to the same
+content but for different intervals or different prices, such as for a
+promotion. For example, a news outlet might decide to offer both monthly and
+annual subscriptions to the same content, with annual having a discount. You can
+also offer in-app purchase equivalents for subscription products, to ensure that
+your content is available to users of older devices that do not support
+subscriptions.</p>
+
+<p>After you add a subscription or in-app product to the product list, you must
+publish the product before Google Play can make it available for purchase. Note
+that you must also publish the app itself before Google Play will make the
+products available for purchase inside the app. </p>
+
+<p class="caution"><strong>Important:</strong> At this time, the capability to
+unpublish a subscription is not available. Support for unpublishing a
+subscription is coming to the Developer Console in the weeks ahead, so this is a
+temporary limitation. In the short term, instead of unpublishing,
+you can remove the subscription product from the product list offered in your
+app to prevent users from seeing or purchasing it.</p>
+
+<h3 id="pricing">Subscription pricing</h3>
+
+<p>When you create a subscription in the Developer Console, you can set a price
+for it in any available currencies. Each subscription must have a non-zero
+price. You can price multiple subscriptions for the same content differently
+— for example you could offer a discount on an annual subscription
+relative to the monthly equivalent. </p>
+
+<p class="caution"><strong>Important:</strong> At this time, once you publish a
+subscription product, you cannot change its price in any currency. Support for
+changing the price of published subscriptions is coming to the Developer Console
+in the weeks ahead. In the short term, you can work around this limitation by
+publishing a new subscription product ID at a new price, then offer it in your
+app instead of the original product. Users who have already purchased will
+continue to be charged at the original price, but new users will be charged at
+the new price.</p>
+
+<h3 id="user-billing">User billing</h3>
+
+<p>You can sell subscription products with automated recurring billing at
+either of two intervals:</p>
+
+<ul>
+ <li>Monthly — Google Play bills the customer’s Google Wallet account at
+ the time of purchase and monthly subsequent to the purchase date (exact billing
+ intervals can vary slightly over time)</li>
+ <li>Annually — Google Play bills the customer's Google Wallet account at
+ the time of purchase and again on the same date in subsequent years.</li>
+</ul>
+
+<p>Billing continues indefinitely at the interval and price specified for the
+subscription. At each subscription renewal, Google Play charges the user account
+automatically, then notifies the user of the charges afterward by email. Billing
+cycles will always match subscription cycles, based on the purchase date.</p>
+
+<p>Over the life of a subscription, the form of payment billed remains the same
+— Google Play always bills the same form of payment (such as credit card,
+Direct Carrier Billing) that was originally used to purchase the
+subscription.</p>
+
+<p>When the subscription payment is approved by Google Wallet, Google Play
+provides a purchase token back to the purchasing app through the In-app Billing
+API. For details, see <a href="#token">Purchase token</a>, below. Your apps can
+store the token locally or pass it to your backend servers, which can then use
+it to validate or cancel the subscription remotely using the <a
+href="#play-dev-api">Google Play Android Developer API</a>.</p>
+
+<p>In the case of billing errors, such as could happen if the customer’s credit
+card becomes invalid, Google Play notifies your app of the change in purchase
+state.</p>
+
+<p>As a best practice, we recommend that your app includes business logic to
+notify your backend servers of subscription purchases, tokens, and any billing
+errors that may occur. Your backend servers can use the server-side API to query
+and update your records and follow up with customers directly, if needed.</p>
+
+<h3 id="cancellation">Subscription cancellation</h3>
+
+<p>Users can view the status of all of their subscriptions and cancel them if
+necessary from the My Apps screen in the Play Store app. Currently, the In-app
+Billing API does not provide support for canceling subscriptions direct from
+inside the purchasing app, although your app can broadcast an Intent to launch
+the Play Store app directly to the My Apps screen.</p>
+
+<p>When the user cancels a subscription, Google Play does not offer a refund for
+the current billing cycle. Instead, it allows the user to have access to the
+cancelled subscription until the end of the current billing cycle, at which time
+it terminates the subscription. For example, if a user purchases a monthly
+subscription and cancels it on the 15th day of the cycle, Google Play will
+consider the subscription valid until the end of the 30th day (or other day,
+depending on the month).</p>
+
+<p>In some cases, the user may contact you directly to request cancellation of a
+subscription. In this and similar cases, you can use the server-side API to
+query and directly cancel the user’s subscription from your servers.
+
+<p class="caution"><strong>Important:</strong> In all cases, you must continue
+to offer the content that your subscribers have purchased through their
+subscriptions, for as long any users are able to access it. That is, you must
+not remove any subscriber’s content while any user still has an active
+subscription to it, even if that subscription will terminate at the end of the
+current billing cycle. Removing content that a subscriber is entitled to access
+will result in penalties. Please see the <a
+href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=140504">policies document</a> for more information. </p>
+
+<h3 id="uninstall">App uninstallation</h3>
+
+<p>When the user uninstalls an app that includes purchased subscriptions, the Play Store app will notify the user that there are active subscriptions. If the user chooses to continue with the uninstalltion, the app is removed and the subscriptions remain active and recurring billing continues. The user can return to cancel the associated subscriptions at any time in the My Apps screen of the Play Store app. If the user chooses to cancel the uninstallation, the app and subscriptions remain as they were.</p>
+
+<h3 id="refunds">Refunds</h3>
+
+<p>As with other in-app products, Google Play does not provide a refund window
+for subscription purchases. For example, users who purchase an app can ask for a
+refund from Google Play within a 15-minute window. With subscriptions, Google
+Play does not provide a refund window, so users will need to contact you
+directly to request a refund.
+
+<p>If you receive requests for refunds, you can use the server-side API to
+cancel the subscription or verify that it is already cancelled. However, keep in
+mind that Google Play considers cancelled subscriptions valid until the end of
+their current billing cycles, so even if you grant a refund and cancel the
+subscription, the user will still have access to the content.
+
+<p class="note"><strong>Note:</strong> Partial refunds for canceled
+subscriptions are not available at this time.</p>
+
+<h3 id="payment">Payment processing and policies</h3>
+
+<p>In general, the terms of Google Play allow you to sell in-app subscriptions
+only through the standard payment processor, Google Wallet. For purchases of any
+subscription products, just as for other in-app products and apps, the
+transaction fee for subscriptions, just as for other in-app purchases, is the
+same as the transaction fee for application purchases (30%).</p>
+
+<p>Apps published on Google Play that are selling subscriptions must use In-app
+Billing to handle the transaction and may not provide links to a purchase flow
+outside of the app and Google Play (such as to a web site).</p>
+
+<p>For complete details about terms and policies, see the <a
+href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=140504">policies
+document</a>.</p>
+
+<h3 id="requirements">System requirements for subscriptions</h3>
+
+<p>In-app purchases of subscriptions are supported only on devices that meet
+these minimum requirements:</p>
+
+<ul>
+ <li>Must run Android 2.2 or higher</li>
+ <li>Google Play Store app, version 3.5 or higher, must be installed</li>
+</ul>
+
+<p>Google Play 3.5 and later versions include support for the In-app Billing
+v2 API or higher, which is needed to support handling of subscription
+products.</p>
+
+<h3 id="compatibility">Compatibility considerations</h3>
+
+<p>As noted in the previous section, support for subscriptions is available only
+on devices that meet the system requirements. Not all devices will receive or
+install Google Play 3.5, so not all users who install your apps will have access
+to the In-app Billing API and subscriptions.</p>
+
+<p>If you are targeting older devices that run Android 2.1 or earlier, we
+recommend that you offer those users an alternative way buy the content that is
+available through subscriptions. For example, you could create standard in-app
+products (one-time purchases) that give access to similar content as your
+subscriptions, possibly for a longer interval such as a year. </p>
+
+
+<h2 id="implementing">Implementing Subscriptions</h2>
+
+<p>Subscriptions are a standard In-app Billing product type. If you have already
+implemented In-app Billing for one-time purchase products, you will find that
+adding support for subscriptions is straightforward, with minimal impact on your
+code. If you are new to In-app Billing, you can implement subscriptions using
+the standard communication model, data structures, and user interactions as for
+other in-app products.subscriptions. </p>
+
+<p>The full implementation details for In-app Billing are provided outside of
+this document, starting with the <a
+href="{@docRoot}guide/google/play/billing/billing_overview.html">In-app Billing
+Overview</a>. This document is focused on highlighting implementation details
+that are specific to subscriptions, along with some strategies for the
+associated billing and business models.</p>
+
+
+<h3 id="sample">Sample application</h3>
+
+<p>To help you get started with your In-app Billing implementation and
+subscriptions, an updated version of the In-app Billing sample app is available.
+You can download the sample app from the Android SDK repository using the
+Android SDK Manager. For details, see <a
+href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">
+Downloading the Sample Application</a>.</p>
+
+<h3 id="model">Application model</h3>
+
+<p>With subscriptions, your app uses the standard In-app Billing application
+model, sending billing requests to the Play Store application over interprocess
+communication (IPC) and receiving purchase responses from the Play Store app in
+the form of asynchronous broadcast intents. Your application does not manage any
+network connections between itself and the Google Play server or use any special
+APIs from the Android platform.</p>
+
+<p>Your app also uses the standard In-app Billing components — a billing
+Service for sending requests, a BroadcastReceiver for receiving the responses,
+and a security component for verifying that the response was sent by Google
+Play. Also recommended are a response Handler for processing notifications,
+errors, and status messages, and an observer for sending callbacks to your
+application as needed. All of these components and their interactions are
+described in full in the <a
+href="{@docRoot}guide/google/play/billing/billing_overview.html">In-app Billing
+Overview</a> and related documents.</p>
+
+<p>To initiate different types of billing communication with Google Play, your
+app will use the standard set of in-app billing requests and receive the same
+responses. Inside the requests and responses are two new fields described below.
+</p>
+
+<h3 id="token">Purchase token</h3>
+
+<p>Central to the end-to-end architecture for subscriptions is the purchase
+token, a string value that uniquely identifies (and associates) a user ID and a
+subscription ID. Google Play generates the purchase token when the user
+completes the purchase of a subscription product (and payment is approved by
+Google Wallet) and then sends it to the purchasing app on the device through the
+In-app Billing API. </p>
+
+<p>At the conclusion of a <code>PURCHASE_REQUEST</code> message flow, your app
+can retrieve the purchase token and other transaction details by initiating a
+<code>GET_PURCHASE_INFORMATION</code> request. The Bundle returned by the call
+contains an JSON array of order objects. In the order corresponding to the
+subscription purchase, the token is available in the <code>purchaseToken</code>
+field. </p>
+
+<p>An example of a JSON order object that includes a subscription purchase token
+is shown below. </p>
+
+<pre class="no-pretty-print" style="color:black">{ "nonce" : 1836535032137741465,
+ "orders" :
+ [{ "notificationId" : "android.test.purchased",
+ "orderId" : "transactionId.android.test.purchased",
+ "packageName" : "com.example.dungeons",
+ "productId" : "android.test.purchased",
+ "developerPayload" : "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ",
+ "purchaseTime" : 1290114783411,
+ "purchaseState" : 0,
+ "purchaseToken" : "rojeslcdyyiapnqcynkjyyjh" }]
+}
+</pre>
+
+<p>After receiving a purchase token, your apps can store the token locally or
+pass it to your backend servers, which can then use it to query the billing
+status or cancel the subscription remotely. If your app will store the token
+locally, please read the <a
+href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and
+Design</a> document for best practices for maintaining the security of your
+data.</p>
+
+<h3 id="version">Checking the In-app Billing API version</h3>
+
+<p>Subscriptions support is available only in versions of Google Play that
+support the In-app Billing v2 API (Google Play 3.5 and higher). For your app,
+an essential first step at launch is to check whether the version of Google Play
+installed on the device supports the In-app Billing v2 API and
+subscriptions.</p>
+
+<p>To do this, create a CHECK_BILLING_SUPPORTED request Bundle that includes the
+required key-value pairs, together with</p>
+
+<ul>
+ <li>The <code>API_VERSION</code> key, assigning a value of 2.</li>
+ <li>The <code>BILLING_REQUEST_ITEM_TYPE</code> key, assigning a value of “subs”</li>
+</ul>
+
+<p>Send the request using <code>sendBillingRequest(Bundle)</code> and receive
+the response Bundle. You can extract the response from the
+<code>BILLING_RESPONSE_RESPONSE_CODE</code> key of the response. RESULT_OK
+indicates that subscriptions are supported.</p>
+
+<p>The sample app declares constants for the accepted
+<code>BILLING_REQUEST_ITEM_TYPE</code> values (from Consts.java):</p>
+
+<pre class="pretty-print"> // These are the types supported in the IAB v2
+ public static final String ITEM_TYPE_INAPP = "inapp";
+ public static final String ITEM_TYPE_SUBSCRIPTION = "subs";
+</pre>
+
+<p>It sets up a convenience method for building the request bundle (from BillingService.java):</p>
+
+<pre class="pretty-print"> protected Bundle makeRequestBundle(String method) {
+ Bundle request = new Bundle();
+ request.putString(Consts.BILLING_REQUEST_METHOD, method);
+ request.putInt(Consts.BILLING_REQUEST_<code>API_VERSION</code>, 2);
+ request.putString(Consts.BILLING_REQUEST_PACKAGE_NAME, getPackageName());
+ return request;
+ }
+</pre>
+
+<p>Here’s an example of how to test support for In-App Billing v2 and subscriptions
+(from BillingService.java):</p>
+
+<pre class="pretty-print"> /**
+ * Wrapper class that checks if in-app billing is supported.
+ */
+ class CheckBillingSupported extends BillingRequest {
+ public String mProductType = null;
+ public CheckBillingSupported() {
+ // This object is never created as a side effect of starting this
+ // service so we pass -1 as the startId to indicate that we should
+ // not stop this service after executing this request.
+ super(-1);
+ }
+
+ public CheckBillingSupported(String type) {
+ super(-1);
+ mProductType = type;
+ }
+
+ @Override
+ protected long run() throws RemoteException {
+ Bundle request = makeRequestBundle("CHECK_BILLING_SUPPORTED");
+ if (mProductType != null) {
+ request.putString(Consts.<code>BILLING_REQUEST_ITEM_TYPE</code>, mProductType);
+ }
+ Bundle response = mService.sendBillingRequest(request);
+ int responseCode = response.getInt(Consts.<code>BILLING_RESPONSE_RESPONSE_CODE</code>);
+ if (Consts.DEBUG) {
+ Log.i(TAG, "CheckBillingSupported response code: " +
+ ResponseCode.valueOf(responseCode));
+ }
+ boolean billingSupported = (responseCode == ResponseCode.RESULT_OK.ordinal());
+ ResponseHandler.checkBillingSupportedResponse(billingSupported, mProductType);
+ return Consts.BILLING_RESPONSE_INVALID_REQUEST_ID;
+ }
+ }
+</pre>
+
+<h3 id="purchase">Requesting a subscription purchase</h3>
+
+<p>Once you’ve checked the API version as described above and determined that
+subscriptions are supported, you can present subscription products to the user
+for purchase. When the user has selected a subscription product and initiated a
+purchase, your app handles the purchase just as it would for other in-app
+products — by sending a REQUEST_PURCHASE request. You can then launch
+Google Play to display the checkout user interface and handle the financial
+transaction..
+
+<p>The REQUEST_PURCHASE includes a Bundle containing the item details, as
+described in the <a
+href="{@docRoot}guide/google/play/billing/billing_overview.html">In-app Billing
+Overview</a>. For a subscription, the Bundle must also specify:</p>
+
+<ul>
+ <li>The <code>ITEM_ID</code> key, with a value that specifies a valid, published
+ subscription product.</li>
+ <li>The <code>ITEM_TYPE</code> key, with a value of “subs”
+ (<code>ITEM_TYPE_SUBSCRIPTION</code> in the sample app). If the request does not
+ specify the subscription's <code>ITEM_TYPE</code>, Google Play attempts to
+ handle the request as a standard in-app purchase (one-time purchase).</li>
+</ul>
+
+<p>Google Play synchronously returns a response bundle that includes
+<code>RESPONSE_CODE</code>, <code>PURCHASE_INTENT</code>, and
+<code>REQUEST_ID</code>. Your app uses the <code>PURCHASE_INTENT</code> to
+launch the checkout UI and the message flow proceeds exactly as described in <a
+href="{@docRoot}guide/google/play/billing/billing_overview.html#billing-message-
+sequence">Messaging sequence</a>.</p>
+
+<p>Here’s how the sample app initiates a purchase for a subscription, where
+<code>mProductType</code> is <code>ITEM_TYPE_SUBSCRIPTION</code> (from
+BillingService.java).</p>
+
+<pre class="pretty-print"> /**
+ * Wrapper class that requests a purchase.
+ */
+ class RequestPurchase extends BillingRequest {
+ public final String mProductId;
+ public final String mDeveloperPayload;
+ public final String mProductType;
+
+. . .
+
+ @Override
+ protected long run() throws RemoteException {
+ Bundle request = makeRequestBundle("REQUEST_PURCHASE");
+ request.putString(Consts.BILLING_REQUEST_ITEM_ID, mProductId);
+ request.putString(Consts.<code>BILLING_REQUEST_ITEM_TYPE</code>, mProductType);
+ // Note that the developer payload is optional.
+ if (mDeveloperPayload != null) {
+ request.putString(Consts.BILLING_REQUEST_DEVELOPER_PAYLOAD, mDeveloperPayload);
+ }
+ Bundle response = mService.sendBillingRequest(request);
+ PendingIntent pendingIntent
+ = response.getParcelable(Consts.BILLING_RESPONSE_PURCHASE_INTENT);
+ if (pendingIntent == null) {
+ Log.e(TAG, "Error with requestPurchase");
+ return Consts.BILLING_RESPONSE_INVALID_REQUEST_ID;
+ }
+
+ Intent intent = new Intent();
+ ResponseHandler.buyPageIntentResponse(pendingIntent, intent);
+ return response.getLong(Consts.BILLING_RESPONSE_REQUEST_ID,
+ Consts.BILLING_RESPONSE_INVALID_REQUEST_ID);
+ }
+
+ @Override
+ protected void responseCodeReceived(ResponseCode responseCode) {
+ ResponseHandler.responseCodeReceived(BillingService.this, this, responseCode);
+ }
+ }
+</pre>
+
+<h3 id="restoring">Restoring transactions</h3>
+
+<p>Subscriptions always use the <em>managed by user account</em> purchase type,
+so that you can restore a record of subscription transactions on the device when
+needed. When a user installs your app onto a new device, or when the user
+uninstalls/reinstalls the app on the original device, your app should restore
+the subscriptions that the user has purchased.</p>
+
+<p>The process for restoring subscriptions transactions is the same as described
+in <a
+href="{@docRoot}guide/google/play/billing/billing_overview.html#billing-message-
+sequence">Messaging sequence</a>. Your app sends a
+<code>RESTORE_TRANSACTIONS</code> request to Google Play. Google Play sends two
+broadcast intents as asynchronous responses — a <code>RESPONSE_CODE</code>
+intent and a <code>PURCHASE_STATE_CHANGED</code> intent.</p>
+
+<p>The <code>PURCHASE_STATE_CHANGED</code> intent contains a notification ID
+that your app can use to retrieve the purchase details, including the purchase
+token, by sending a standard <code>GET_PURCHASE_INFORMATION</code> request. The
+<code>Bundle</code> returned in the call includes an JSON array of order objects
+corresponding to subscription (and in-app product) purchases that you can
+restore locally.</p>
+
+<p>Your app can store the restored purchase state and other transaction details
+in the way that best meets your needs. Your app can use it later to check the
+subscription validity, although please read the <a
+href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and
+Design</a> document for best practices for maintaining the security of your
+data.</p>
+
+<h3 id="validity">Checking subscription validity</h3>
+
+<p>Subscriptions are time-bound purchases that require successful billing
+recurrences over time to remain valid. Your app should check the validity of
+purchased subscriptions at launch or prior to granting access to subscriber
+content.</p>
+
+<p>With In-app Billing, you validate a subscription by keeping track of its
+purchase state, such as purchased or cancelled, and then checking the state
+whenever needed. Google Play provides two ways to let you know when the purchase
+state of a subscription changes:</p>
+
+<ul>
+ <li><em>In-app Billing Notifications</em>. Google Play pushes a notification
+ to your app whenever the purchase state of a subscription changes. Your app can
+ store the most recent purchase state for a given purchase token and then check
+ that state at run time, as needed.</li>
+ <li><em>Google Play Android Developer API</em>. You can use this HTTP-based
+ API to poll Google Play for the current purchase state of a subscription. You
+ can store the purchased state for each <code>purchaseToken</code> on your
+ backend servers. For more information, see <a href="#play-dev-api">Google Play
+ Android Developer API</a>, below.</li>
+</ul>
+
+<p>For most use-cases, especially those where backend servers are already keeping
+track of subscribed users, implementing a combination of both methods is the
+recommended approach. A typical implementation might work like this:</p>
+
+<ul>
+ <li>When the user successfully purchases a new subscription, your app notifies a
+ backend server, which stores the purchase token, user name, and other
+ information in a secure location.</li>
+ <li>Since your app cannot know the expiration date, your server can poll Google
+ Play to get the expiration and store it with the purchase token and other
+ data.</li>
+ <li>Because your server now knows the expiration date, it does not need to poll
+ Google Play again until after the expiration date, at which time it can confirm
+ that the subscription was not cancelled.</li>
+ <li>On the client side, your app can continue to update the server whenever the
+ purchase state changes, storing the state locally.</li>
+</ul>
+
+<p>If you are using both notifications and the Google Play Android Developer API to validate subscriptions, we recommend the following:</p>
+
+<ul>
+ <li>If your app wants to check validity but you can’t reach your server (or
+you don’t have a server), use the latest purchase state received by
+notification.</li>
+ <li>If you have a server and it’s reachable, always give preference to the
+purchase state obtained from your server over the state received in
+notifications.</li>
+</ul>
+
+<p>If necessary, you can also use a <code>RESTORE_TRANSACTIONS</code> request to retrieve a record of all managed and in-app products purchased by the user, which you can then store locally. However, using <code>RESTORE_TRANSACTIONS</code> on a regular basis is not recommended because of performance impacts.</p>
+
+<p>Regardless of the approach you choose, your app should check subscriptions
+and validity at launch, such as prior to accessing subscriber content, game
+levels, and so on.</p>
+
+<p class="table-caption"><strong>Table 1.</strong> Summary of purchaseState
+values for subscription purchases, as received with a
+<code>PURCHASE_STATE_CHANGED</code> intent.</p>
+
+<table>
+<tr>
+<th>State</th><th>purchaseState Value</th><th>Comments</th>
+</tr>
+<tr>
+<td>Purchased successfully</td><td><code>0</code></td><td>Sent at original purchase only (not at recurring billing cycles).</td></tr>
+<td>Cancelled</td><td><code>1</code></td><td>Sent at original purchase only if the purchase has failed for some reason. </td></tr>
+<td>Refunded</td><td><code>2</code></td><td>The purchase was refunded.</code></td></tr>
+<td>Subscription expired</td><td><code>3</code></td><td>Sent if a subscription expires because of non-payment or user cancelation.</td></tr>
+</table>
+
+
+<h3 id="viewstatus">Launching your product page to let the user cancel or view subscriptions</h3>
+
+<p>In-app Billing does not currently provide an API to let users directly view or cancel
+subscriptions from within the purchasing app. Instead, users can launch the Play
+Store app on their devices and go to the My Apps screen to manage subscriptions. In My Apps,
+users can see a list of their subscriptions organized by application. Tapping one of the
+subscriptions loads the app's product page, from which users can see active subscriptions
+and billing status and cancel subscriptions as needed.</p>
+
+<p>To make it easier for users to find and manage their subscriptions from inside your app,
+we recommend that you offer a "View My Subscriptions" or "Manage Subscriptions" option in
+your UI that directly loads your app's product page in the Play Store app.</p>
+
+<p>To do this, create an intent with the <a
+href="{@docRoot}reference/android/content/Intent.html#ACTION_VIEW">ACTION_VIEW</a>
+action and include the <code>market://</code> URI (rather than the <code>http://</code>
+URI) of your app's details page. Here’s an example:</p>
+
+<pre style="pretty-print">Intent intent = new Intent(Intent.ACTION_VIEW);
+intent.setData(Uri.parse("market://details?id=com.example.app"));
+startActivity(intent);</pre>
+
+<p>For more information, see
+ <a href="{@docRoot}distribute/googleplay/promote/linking.html">Linking to Your Products</a>.</p>
+
+<h3 id="purchase-state-changes">Recurring billing and changes in purchase state</h3>
+
+<p>Google Play notifies your app when the user completes the purchase of a
+subscription, but the purchase state does not change over time, provided that
+recurring billing takes place successfully. Google Play does not notify your app
+of a purchase state change <em>until the subscription expires because of
+non-payment or user cancellation</em>. </p>
+
+<p>Over the life of a subscription, your app does not need to initiate any
+recurring billing events — those are all handled by Google Play and they
+are transparent to your application if billing is successful.</p>
+
+<h3 id="modifying">Modifying your app for subscriptions</h3>
+
+<p>For subscriptions, you make the same types of modifications to your app as
+are described in <a
+href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-implement">
+Modifying your Application Code</a>.</p>
+
+<p>Note that, in your UI that lets users view and select subscriptions for
+purchase, you should add logic to check for purchased subscriptions and validate
+them. Your UI should not present subscriptions if the user has already purchased
+them.</p>
+
+<h2 id="administering">Administering Subscriptions</h2>
+
+<p>To create and manage subscriptions, you use the tools in the Developer
+Console, just as for other in-app products.</p>
+
+<p>At the Developer Console, you can configure these attributes for each
+subscription product:</p>
+
+<ul>
+<li>Purchase Type: always set to “subscription”</li>
+<li>Subscription ID: An identifier for the subscription</li>
+<li>Publishing State: Unpublished/Published</li>
+<li>Language: The default language for displaying the subscription</li>
+<li>Title: The title of the subscription product</li>
+<li>Description: Details that tell the user about the subscription</li>
+<li>Price: USD price of subscription per recurrence</li>
+<li>Recurrence: monthly or yearly</li>
+<li>Additional currency pricing (can be auto-filled)</li>
+</ul>
+
+<p>For details, please see <a href="{@docRoot}guide/google/play/billing/billing_admin.html">Administering
+In-app Billing</a>.</p>
+
+
+<h2 id="play-dev-api">Google Play Android Developer API</h2>
+
+<p>Google Play offers an HTTP-based API that you can use to remotely query the
+validity of a specific subscription at any time or cancel a subscription. The
+API is designed to be used from your backend servers as a way of securely
+managing subscriptions, as well as extending and integrating subscriptions with
+other services.</p>
+
+<h3 id="using">Using the API</h3>
+
+<p>To use the API, you must first register a project at the <a
+href="https://code.google.com/apis/console">Google APIs Console</a> and receive
+a Client ID and shared secret that your app will present when calling the
+Google Play Android Developer API. All calls to the API are authenticated with
+OAuth 2.0.</p>
+
+<p>Once your app is registered, you can access the API directly, using standard
+HTTP methods to retrieve and manipulate resources, or you can use the Google
+APIs Client Libraries, which are extended to support the API.</p>
+
+<p>The Google Play Android Developer API is built on a RESTful design that uses
+HTTP and JSON, so any standard web stack can send requests and parse the
+responses. However, if you don’t want to send HTTP requests and parse responses
+manually, you can access the API using the client libraries, which provide
+better language integration, improved security, and support for making calls
+that require user authorization.</p>
+
+<p>For more information about the API and how to access it through the Google
+APIs Client Libraries, see the documentation at:</p>
+
+<p style="margin-left:1.5em;"><a
+href="https://developers.google.com/android-publisher/v1/">https://developers.
+google.com/android-publisher/v1/</a></p>
+
+<h3 id="quota">Quota</h3>
+
+<p>Applications using the Google Play Android Developer API are limited to an
+initial courtesy usage quota of <strong>15000 requests per day</strong> (per
+application). This should provide enough access for normal
+subscription-validation needs, assuming that you follow the recommendation in
+this section.</p>
+
+<p>If you need to request a higher limit for your application, please use the
+“Request more” link in the <a
+href="https://code.google.com/apis/console/#:quotas">Google APIs Console</a>.
+Also, please read the section below on design best practices for minimizing your
+use of the API.</p>
+
+<h3 id="auth">Authorization</h3>
+
+<p>Calls to the Google Play Android Developer API require authorization. Google
+uses the OAuth 2.0 protocol to allow authorized applications to access user
+data. To learn more, see <a
+href="https://developers.google.com/android-publisher/authorization">Authorization</a>
+in the Google Play Android Developer API documentation.</p>
+
+<h3 id="practices">Using the API efficiently</h3>
+
+<p>Access to the Google Play Android Developer API is regulated to help ensure a
+high-performance environment for all applications that use it. While you can
+request a higher daily quota for your application, we highly recommend that you
+minimize your access using the technique(s) below. </p>
+
+<ul>
+ <li><em>Store subscription expiry on your servers</em> — your servers
+ should use the Google Play Android Developer API to query the expiration date
+ for new subscription tokens, then store the expiration date locally. This allows
+ you to check the status of subscriptions only at or after the expiration (see
+ below). </li>
+ <li><em>Cache expiration and purchaseState</em> — If your app contacts
+ your backend servers at runtime to verify subscription validity, your server
+ should cache the expiration and purchaseState to ensure the fastest possible
+ response (and best experience) for the user.</li>
+ <li><em>Query for subscription status only at expiration</em> — Once your
+ server has retrieved the expiration date of subscription tokens, it should not
+ query the Google Play servers for the subscription status again until the
+ subscription is reaching or has passed the expiration date. Typically, your
+ servers would run a batch query each day to check the status of
+ <em>expiring</em> subscriptions, then update the database. Note that:
+ <ul>
+ <li>Your servers should not query all subscriptions every day</li>
+ <li>Your servers should never query subscription status dynamically, based on
+ individual requests from your Android application. </li>
+ </ul>
+ </li>
+</ul>
+
+<p>By following those general guidelines, your implementation will offer the
+best possible performance for users and minimize use of the Google Play Android
+Developer API.</p>
+
diff --git a/docs/html/guide/google/play/billing/billing_testing.jd b/docs/html/guide/google/play/billing/billing_testing.jd
new file mode 100755
index 0000000..e2d4a01
--- /dev/null
+++ b/docs/html/guide/google/play/billing/billing_testing.jd
@@ -0,0 +1,293 @@
+page.title=Testing In-app Billing
+parent.title=In-app Billing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#billing-testing-static">Testing in-app purchases with static responses</a></li>
+ <li><a href="#billing-testing-real">Testing in-app purchases using your own product IDs</a></li>
+
+ </ol>
+ <h2>Downloads</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">Sample
+ Application</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_overview.html">Overview of In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html">Implementing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and
+ Design</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_admin.html">Administering In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_reference.html">In-app Billing
+ Reference</a></li>
+ </ol>
+</div>
+</div>
+
+<p>The Google Play publisher site provides several tools that help you test your in-app billing
+implementation before it is published. You can use these tools to create test accounts and purchase
+special reserved items that send static billing responses to your application.</p>
+
+<p>To test in-app billing in an application you must install the application on an Android-powered
+device. You cannot use the Android emulator to test in-app billing. The device you use for testing
+must run a standard version of the Android 1.6 or later platform (API level 4 or higher), and have
+the most current version of the Google Play application installed. If a device is not running the
+most current Google Play application, your application won't be able to send in-app billing
+requests to Google Play. For general information about how to set up a device for use in
+developing Android applications, see <a href="{@docRoot}tools/device.html">Using Hardware
+Devices</a>.</p>
+
+<p>The following section shows you how to set up and use the in-app billing test tools.</p>
+
+<h2 id="billing-testing-static">Testing in-app purchases with static responses</h2>
+
+<p>We recommend that you first test your in-app billing implementation using static responses from
+Google Play. This enables you to verify that your application is handling the primary Google
+Play responses correctly and that your application is able to verify signatures correctly.</p>
+
+<p>To test your implementation with static responses, you make an in-app billing request using a
+special item that has a reserved product ID. Each reserved product ID returns a specific static
+response from Google Play. No money is transferred when you make in-app billing requests with the
+reserved product IDs. Also, you cannot specify the form of payment when you make a billing request
+with a reserved product ID. Figure 1 shows the checkout flow for the reserved item that has the
+product ID android.test.purchased.</p>
+
+<img src="{@docRoot}images/billing_test_flow.png" height="381" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Wallet flow for the special reserved item android.test.purchased.
+</p>
+
+<p>You do not need to list the reserved products in your application's product list. Google Play
+already knows about the reserved product IDs. Also, you do not need to upload your application to
+the publisher site to perform static response tests with the reserved product IDs. You can simply
+install your application on a device, log into the device, and make billing requests using the
+reserved product IDs.</p>
+
+<p>There are four reserved product IDs for testing static in-app billing responses:</p>
+
+<ul>
+ <li><strong>android.test.purchased</strong>
+ <p>When you make an in-app billing request with this product ID, Google Play responds as
+ though you successfully purchased an item. The response includes a JSON string, which contains
+ fake purchase information (for example, a fake order ID). In some cases, the JSON string is
+ signed and the response includes the signature so you can test your signature verification
+ implementation using these responses.</p>
+ </li>
+ <li><strong>android.test.canceled</strong>
+ <p>When you make an in-app billing request with this product ID Google Play responds as
+ though the purchase was canceled. This can occur when an error is encountered in the order
+ process, such as an invalid credit card, or when you cancel a user's order before it is
+ charged.</p>
+ </li>
+ <li><strong>android.test.refunded</strong>
+ <p>When you make an in-app billing request with this product ID, Google Play responds as
+ though the purchase was refunded. Refunds cannot be initiated through Google Play's in-app
+ billing service. Refunds must be initiated by you (the merchant). After you process a refund
+ request through your Google Wallet account, a refund message is sent to your application by
+ Google Play. This occurs only when Google Play gets notification from Google Wallet that
+ a refund has been made. For more information about refunds, see <a
+ href="{@docRoot}guide/google/play/billing/billing_overview.html#billing-action-notify">Handling
+ IN_APP_NOTIFY messages</a> and <a
+ href="http://www.google.com/support/androidmarket/bin/answer.py?answer=1153485">In-app Billing
+ Pricing</a>.</p>
+ </li>
+ <li><strong>android.test.item_unavailable</strong>
+ <p>When you make an in-app billing request with this product ID, Google Play responds as
+ though the item being purchased was not listed in your application's product list.</p>
+ </li>
+</ul>
+
+<p>In some cases, the reserved items may return signed static responses, which lets you test
+signature verification in your application. To test signature verification with the special reserved
+product IDs, you may need to set up <a
+href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-testing-setup">test accounts</a> or
+upload your application as a unpublished draft application. Table 1 shows you the conditions under
+which static responses are signed.</p>
+
+<p class="table-caption" id="static-responses-table"><strong>Table 1.</strong>
+Conditions under which static responses are signed.</p>
+
+<table>
+<tr>
+<th>Application ever been published?</th>
+<th>Draft application uploaded and unpublished?</th>
+<th>User who is running the application</th>
+<th>Static response signature</th>
+</tr>
+
+<tr>
+<td>No</td>
+<td>No</td>
+<td>Any</td>
+<td>Unsigned</td>
+</tr>
+
+<tr>
+<td>No</td>
+<td>No</td>
+<td>Developer</td>
+<td>Signed</td>
+</tr>
+
+<tr>
+<td>Yes</td>
+<td>No</td>
+<td>Any</td>
+<td>Unsigned</td>
+</tr>
+
+<tr>
+<td>Yes</td>
+<td>No</td>
+<td>Developer</td>
+<td>Signed</td>
+</tr>
+
+<tr>
+<td>Yes</td>
+<td>No</td>
+<td>Test account</td>
+<td>Signed</td>
+</tr>
+
+<tr>
+<td>Yes</td>
+<td>Yes</td>
+<td>Any</td>
+<td>Signed</td>
+</tr>
+
+</table>
+
+<p>To make an in-app billing request with a reserved product ID, you simply construct a normal
+<code>REQUEST_PURCHASE</code> request, but instead of using a real product ID from your
+application's product list you use one of the reserved product IDs.</p>
+
+<p>To test your application using the reserved product IDs, follow these steps:</p>
+
+<ol>
+ <li><strong>Install your application on an Android-powered device.</strong>
+ <p>You cannot use the emulator to test in-app billing; you must install your application on a
+ device to test in-app billing.</p>
+ <p>To learn how to install an application on a device, see <a
+ href="{@docRoot}tools/building/building-cmdline.html#RunningOnDevice">Running on a
+ device</a>.</p>
+ </li>
+ <li><strong>Sign in to your device with your developer account.</strong>
+ <p>You do not need to use a test account if you are testing only with the reserved product
+ IDs.</p>
+ </li>
+ <li><strong>Verify that your device is running a supported version of the Google Play
+ application or the MyApps application.</strong>
+ <p>If your device is running Android 3.0, in-app billing requires version 5.0.12 (or higher) of
+ the MyApps application. If your device is running any other version of Android, in-app billing
+ requires version 2.3.4 (or higher) of the Google Play application. To learn how to check the
+ version of the Google Play application, see <a
+ href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google
+ Play</a>.</p>
+ </li>
+ <li><strong>Run your application and purchase the reserved product IDs.</strong></li>
+</ol>
+
+<p class="note"><strong>Note</strong>: Making in-app billing requests with the reserved product IDs
+overrides the usual Google Play production system. When you send an in-app billing request for a
+reserved product ID, the quality of service will not be comparable to the production
+environment.</p>
+
+<h2 id="billing-testing-real">Testing In-app Purchases Using Your Own Product IDs</h2>
+
+<p>After you finish your static response testing, and you verify that signature verification is
+working in your application, you can test your in-app billing implementation by making actual in-app
+purchases. Testing real in-app purchases enables you to test the end-to-end in-app billing
+experience, including the actual responses from Google Play and the actual checkout flow that
+users will experience in your application.</p>
+
+<p class="note"><strong>Note</strong>: You do not need to publish your application to do end-to-end
+testing. You only need to upload your application as a draft application to perform end-to-end
+testing.</p>
+
+<p>To test your in-app billing implementation with actual in-app purchases, you will need to
+register at least one test account on the Google Play publisher site. You cannot use your
+developer account to test the complete in-app purchase process because Google Wallet does not let
+you buy items from yourself. If you have not set up test accounts before, see <a
+href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-testing-setup">Setting up test
+accounts</a>.</p>
+
+<p>Also, a test account can purchase an item in your product list only if the item is published. The
+application does not need to be published, but the item does need to be published.</p>
+
+<p>When you use a test account to purchase items, the test account is billed through Google Wallet
+and your Google Wallet Merchant account receives a payout for the purchase. Therefore, you may
+want to refund purchases that are made with test accounts, otherwise the purchases will show up as
+actual payouts to your merchant account.</p>
+
+<p>To test your in-app billing implementation with actual purchases, follow these steps:</p>
+
+<ol>
+ <li><strong>Upload your application as a draft application to the publisher site.</strong>
+ <p>You do not need to publish your application to perform end-to-end testing with real product
+ IDs; you only need to upload your application as a draft application. However, you must sign
+ your application with your release key before you upload it as a draft application. Also, the
+ version number of the uploaded application must match the version number of the application you
+ load to your device for testing. To learn how to upload an application to Google Play, see
+ <a href="http://market.android.com/support/bin/answer.py?answer=113469">Uploading
+ applications</a>.</p>
+ </li>
+ <li><strong>Add items to the application's product list.</strong>
+ <p>Make sure that you publish the items (the application can remain unpublished). See <a
+ href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-catalog">Creating a product
+ list</a> to learn how to do this.</p>
+ </li>
+ <li><strong>Install your application on an Android-powered device.</strong>
+ <p>You cannot use the emulator to test in-app billing; you must install your application on a
+ device to test in-app billing.</p>
+ <p>To learn how to install an application on a device, see <a
+ href="{@docRoot}tools/building/building-cmdline.html#RunningOnDevice">Running on a
+ device</a>.</p>
+ </li>
+ <li><strong>Make one of your test accounts the primary account on your device.</strong>
+ <p>To perform end-to-end testing of in-app billing, the primary account on your device must be
+ one of the <a
+ href="{@docRoot}guide/google/play/billing/billing_admin.html#billing-testing-setup">test accounts</a>
+ that you registered on the Google Play site. If the primary account on your device is not a
+ test account, you must do a factory reset of the device and then sign in with one of your test
+ accounts. To perform a factory reset, do the following:</p>
+ <ol>
+ <li>Open Settings on your device.</li>
+ <li>Touch <strong>Privacy</strong>.</li>
+ <li>Touch <strong>Factory data reset</strong>.</li>
+ <li>Touch <strong>Reset phone</strong>.</li>
+ <li>After the phone resets, be sure to sign in with one of your test accounts during the
+ device setup process.</li>
+ </ol>
+ </li>
+ <li><strong>Verify that your device is running a supported version of the Google Play
+ application or the MyApps application.</strong>
+ <p>If your device is running Android 3.0, in-app billing requires version 5.0.12 (or higher) of
+ the MyApps application. If your device is running any other version of Android, in-app billing
+ requires version 2.3.4 (or higher) of the Google Play application. To learn how to check the
+ version of the Google Play application, see <a
+ href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google
+ Play</a>.</p>
+ </li>
+ <li><strong>Make in-app purchases in your application.</strong></li>
+</ol>
+
+<p class="note"><strong>Note:</strong> The only way to change the primary account on a device is to
+do a factory reset, making sure you log on with your primary account first.</p>
+
+<p>When you are finished testing your in-app billing implementation, you are ready to
+publish your application on Google Play. You can follow the normal steps for <a
+href="{@docRoot}tools/publishing/preparing.html">preparing</a>, <a
+href="{@docRoot}tools/publishing/app-signing.html">signing</a>, and <a
+href="{@docRoot}distribute/googleplay/publish/preparing.html">publishing on Google Play</a>.
+</p>
+
diff --git a/docs/html/guide/google/play/billing/index.jd b/docs/html/guide/google/play/billing/index.jd
new file mode 100755
index 0000000..a33b199
--- /dev/null
+++ b/docs/html/guide/google/play/billing/index.jd
@@ -0,0 +1,116 @@
+page.title=In-app Billing
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Topics</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_overview.html">Overview of In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html">Implementing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_subscriptions.html">Subscriptions</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and
+ Design</a></li> <li><a href="{@docRoot}guide/google/play/billing/billing_testing.html">Testing In-app
+ Billing</a></li>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_admin.html">Administering In-app
+ Billing</a></li>
+ </ol>
+ <h2>Reference</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_reference.html">In-app Billing
+ Reference</a></li>
+ </ol>
+ <h2>Downloads</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">Sample
+ Application</a></li>
+ </ol>
+</div>
+</div>
+
+<p>In-app Billing is a Google Play service that lets you sell digital content from inside
+your applications. You can use the service to sell a wide range of content, including downloadable
+content such as media files or photos, virtual content such as game levels or potions, premium services
+and features, and more. You can use In-app Billing to sell products as</p>
+
+<ul>
+<li>Standard in-app products (one-time billing), or</li>
+<li>Subscriptions, (recurring, automated billing)</li>
+</ul>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <h2>Support for subscriptions <span class="new">New!</span></h2>
+ <p>In-app Billing now lets you sell subscriptions in your apps, as well as standard in-app products.
+ For details on how to sell subscriptions to content, services, and features, see the
+ <a href="{@docRoot}guide/google/play/billing/billing_subscriptions.html">Subscriptions</a> documentation.</p>
+</div>
+</div>
+
+<p>When you use the in-app billing service to sell an item,
+whether it's an in-app product or a subscription, Google Play
+handles all checkout details so your application never has to directly process
+any financial transactions. Google Play uses the same checkout backend service as
+is used for application purchases, so your users experience a consistent and
+familiar purchase flow (see figure 1). Also, the transaction fee for in-app
+purchases is the same as the transaction fee for application purchases
+(30%).</p>
+
+<p>Any application that you publish through Google Play can implement In-app Billing. No special
+account or registration is required other than an Android Market publisher account and a Google
+Wallet Merchant account. Also, because the service uses no dedicated framework APIs, you can add
+in-app billing to any application that uses a minimum API level of 4 or higher.</p>
+
+<p>To help you integrate in-app billing into your application, the Android SDK
+provides a sample application that demonstrates how to sell standard in-app
+products and subscriptions from inside an app. The sample contains examples of
+billing-related classes you can use to implement in-app billing in your
+application. It also contains examples of the database, user interface, and
+business logic you might use to implement in-app billing.</p>
+
+<p class="caution"><strong>Important</strong>: Although the sample application is a working example
+of how you can implement in-app billing, we <em>strongly recommend</em> that you modify and
+obfuscate the sample code before you use it in a production application. For more information, see
+<a href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security and Design</a>.</p>
+
+<img src="{@docRoot}images/billing_checkout_flow.png" height="382" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Applications initiate in-app billing requests through their own UI
+ (first screen). Google Play responds to the request by providing the checkout user interface
+ (middle screen). When checkout is complete, the application resumes.
+</p>
+
+<p>To learn more about Google Play's in-app billing service and start integrating it into your
+applications, read the following documents:</p>
+
+<dl>
+ <dt><strong><a href="{@docRoot}guide/google/play/billing/billing_overview.html">Overview of In-app
+ Billing</a></strong></dt>
+ <dd>Learn how the service works and what a typical in-app billing implementation looks
+ like.</dd>
+ <dt><strong><a href="{@docRoot}guide/google/play/billing/billing_integrate.html">Implementing
+ In-app Billing</a></strong></dt>
+ <dd>Use this step-by-step guide to start incorporating in-app billing into your
+ application. The instructions apply to both one-time and subscription purchases.</dd>
+
+ <dt><strong><a href="{@docRoot}guide/google/play/billing/billing_subscriptions.html">Subscriptions</a></strong></dt>
+ <dd>Learn how subscriptions work and how to implement support for them in your app.</dd>
+ <dt><strong><a href="{@docRoot}guide/google/play/billing/billing_best_practices.html">Security
+ and Design</a></strong></dt>
+ <dd>Review these best practices to help ensure that your in-app billing implementation is
+ secure and well designed.</dd>
+ <dt><strong><a href="{@docRoot}guide/google/play/billing/billing_testing.html">Testing In-app
+ Billing</a></strong></dt>
+ <dd>Understand how the in-app billing test tools work and learn how to test your in-app billing
+ implementation.</dd>
+ <dt><strong><a href="{@docRoot}guide/google/play/billing/billing_admin.html">Administering
+ In-app Billing</a></strong></dt>
+ <dd>Learn how to set up your product list, register test accounts, and handle refunds.</dd>
+ <dt><strong><a href="{@docRoot}guide/google/play/billing/billing_reference.html">In-app Billing
+ Reference</a></strong></dt>
+ <dd>Get detailed information about Google Play response codes and the in-app billing
+ interface.</dd>
+</dl>
+
diff --git a/docs/html/guide/google/play/expansion-files.jd b/docs/html/guide/google/play/expansion-files.jd
new file mode 100644
index 0000000..62ca1e2
--- /dev/null
+++ b/docs/html/guide/google/play/expansion-files.jd
@@ -0,0 +1,1270 @@
+page.title=APK Expansion Files
+@jd:body
+
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>Quickview</h2>
+<ul>
+ <li>Recommended for most apps that exceed the 50MB APK limit</li>
+ <li>You can provide up to 4GB of additional data for each APK</li>
+ <li>Google Play hosts and serves the expansion files at no charge</li>
+ <li>The files can be any file type you want and are saved to the device's shared storage</li>
+</ul>
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#Overview">Overview</a>
+ <ol>
+ <li><a href="#Filename">File name format</a></li>
+ <li><a href="#StorageLocation">Storage location</a></li>
+ <li><a href="#DownloadProcess">Download process</a></li>
+ <li><a href="#Checklist">Development checklist</a></li>
+ </ol>
+ </li>
+ <li><a href="#Rules">Rules and Limitations</a></li>
+ <li><a href="#Downloading">Downloading the Expansion Files</a>
+ <ol>
+ <li><a href="#AboutLibraries">About the Downloader Library</a></li>
+ <li><a href="#Preparing">Preparing to use the Downloader Library</a></li>
+ <li><a href="#Permissions">Declaring user permissions</a></li>
+ <li><a href="#DownloaderService">Implementing the downloader service</a></li>
+ <li><a href="#AlarmReceiver">Implementing the alarm receiver</a></li>
+ <li><a href="#Download">Starting the download</a></li>
+ <li><a href="#Progress">Receiving download progress</a></li>
+ </ol>
+ </li>
+ <li><a href="#ExpansionPolicy">Using APKExpansionPolicy</a></li>
+ <li><a href="#ReadingTheFile">Reading the Expansion File</a>
+ <ol>
+ <li><a href="#GettingFilenames">Getting the file names</a></li>
+ <li><a href="#ZipLib">Using the APK Expansion Zip Library</a></li>
+ </ol>
+ </li>
+ <li><a href="#Testing">Testing Your Expansion Files</a>
+ <ol>
+ <li><a href="#TestingReading">Testing file reads</a></li>
+ <li><a href="#TestingReading">Testing file downloads</a></li>
+ </ol>
+ </li>
+ <li><a href="#Updating">Updating Your Application</a></li>
+</ol>
+
+<h2>See also</h2>
+<ol>
+ <li><a href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a></li>
+ <li><a href="{@docRoot}guide/google/play/publishing/multiple-apks.html">Multiple
+APK Support</a></li>
+</ol>
+</div>
+</div>
+
+
+
+<p>Google Play currently requires that your APK file be no more than 50MB. For most
+applications, this is plenty of space for all the application's code and assets.
+However, some apps need more space for high-fidelity graphics, media files, or other large assets.
+Previously, if your app exceeded 50MB, you had to host and download the additional resources
+yourself when the user opens the app. Hosting and serving the extra files can be costly, and the
+user experience is often less than ideal. To make this process easier for you and more pleasant
+for users, Google Play allows you to attach two large expansion files that supplement your
+APK.</p>
+
+<p>Google Play hosts the expansion files for your application and serves them to the device at
+no cost to you. The expansion files are saved to the device's shared storage location (the
+SD card or USB-mountable partition; also known as the "external" storage) where your app can access
+them. On most devices, Google Play downloads the expansion file(s) at the same time it
+downloads the APK, so your application has everything it needs when the user opens it for the
+first time. In some cases, however, your application must download the files from Google Play
+when your application starts.</p>
+
+
+
+<h2 id="Overview">Overview</h2>
+
+<p>Each time you upload an APK using the Google Play Android Developer Console, you have the option to
+add one or two expansion files to the APK. Each file can be up to 2GB and it can be any format you
+choose, but we recommend you use a compressed file to conserve bandwidth during the download.
+Conceptually, each expansion file plays a different role:</p>
+
+<ul>
+ <li>The <strong>main</strong> expansion file is the
+primary expansion file for additional resources required by your application.</li>
+ <li>The <strong>patch</strong> expansion file is optional and intended for small updates to the
+main expansion file.</li>
+</ul>
+
+<p>While you can use the two expansion files any way you wish, we recommend that the main
+expansion file deliver the primary assets and should rarely if ever updated; the patch expansion
+file should be smaller and serve as a “patch carrier,” getting updated with each major
+release or as necessary.</p>
+
+<p>However, even if your application update requires only a new patch expansion file, you still must
+upload a new APK with an updated <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code
+versionCode}</a> in the manifest. (The
+Developer Console does not allow you to upload an expansion file to an existing APK.)</p>
+
+<p class="note"><strong>Note:</strong> The patch expansion file is semantically the same as the
+main expansion file—you can use each file any way you want. The system does
+not use the patch expansion file to perform patching for your app. You must perform patching
+yourself or be able to distinguish between the two files.</p>
+
+
+
+<h3 id="Filename">File name format</h3>
+
+<p>Each expansion file you upload can be any format you choose (ZIP, PDF, MP4, etc.). Regardless of
+the file type, Google Play considers them opaque binary blobs and renames the files
+using the following scheme:</p>
+
+<pre class="classic no-pretty-print">
+[main|patch].<expansion-version>.<package-name>.obb
+</pre>
+
+<p>There are three components to this scheme:</p>
+
+<dl>
+ <dt>{@code main} or {@code patch}</dt>
+ <dd>Specifies whether the file is the main or patch expansion file. There can be
+only one main file and one patch file for each APK.</dd>
+ <dt>{@code <expansion-version>}</dt>
+ <dd>This is an integer that matches the version code of the APK with which the expansion is
+<em>first</em> associated (it matches the application's <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code android:versionCode}</a>
+value).
+ <p>"First" is emphasized because although the Developer Console allows you to
+re-use an uploaded expansion file with a new APK, the expansion file's name does not change—it
+retains the version applied to it when you first uploaded the file.</p></dd>
+ <dt>{@code <package-name>}</dt>
+ <dd>Your application's Java-style package name.</dd>
+</dl>
+
+<p>For example, suppose your APK version is 314159 and your package name is com.example.app. If you
+upload a main expansion file, the file is renamed to:</p>
+<pre class="classic no-pretty-print">main.314159.com.example.app.obb</pre>
+
+
+<h3 id="StorageLocation">Storage location</h3>
+
+<p>When Google Play downloads your expansion files to a device, it saves them to the system's
+shared storage location. To ensure proper behavior, you must not delete, move, or rename the
+expansion files. In the event that your application must perform the download from Google Play
+itself, you must save the files to the exact same location.</p>
+
+<p>The specific location for your expansion files is:</p>
+
+<pre class="classic no-pretty-print">
+<shared-storage>/Android/obb/<package-name>/
+</pre>
+
+<ul>
+ <li>{@code <shared-storage>} is the path to the shared storage space, available from
+{@link android.os.Environment#getExternalStorageDirectory()}.</li>
+ <li>{@code <package-name>} is your application's Java-style package name, available
+from {@link android.content.Context#getPackageName()}.</li>
+</ul>
+
+<p>For each application, there are never more than two expansion files in this directory.
+One is the main expansion file and the other is the patch expansion file (if necessary). Previous
+versions are overwritten when you update your application with new expansion files.</p>
+
+<p>If you must unpack the contents of your expansion files, <strong>do not</strong> delete the
+{@code .obb} expansion files afterwards and <strong>do not</strong> save the unpacked data
+in the same directory. You should save your unpacked files in the directory
+specified by {@link android.content.Context#getExternalFilesDir getExternalFilesDir()}. However,
+if possible, it's best if you use an expansion file format that allows you to read directly from
+the file instead of requiring you to unpack the data. For example, we've provided a library
+project called the <a href="#ZipLib">APK Expansion Zip Library</a> that reads your data directly
+from the ZIP file.</p>
+
+<p class="note"><strong>Note:</strong> Unlike APK files, any files saved on the shared storage can
+be read by the user and other applications.</p>
+
+<p class="note"><strong>Tip:</strong> If you're packaging media files into a ZIP, you can use media
+playback calls on the files with offset and length controls (such as {@link
+android.media.MediaPlayer#setDataSource(FileDescriptor,long,long) MediaPlayer.setDataSource()} and
+{@link android.media.SoundPool#load(FileDescriptor,long,long,int) SoundPool.load()}) without the
+need to unpack your ZIP. In order for this to work, you must not perform additional compression on
+the media files when creating the ZIP packages. For example, when using the <code>zip</code> tool,
+you should use the <code>-n</code> option to specify the file suffixes that should not be
+compressed: <br/>
+<code>zip -n .mp4;.ogg main_expansion media_files</code></p>
+
+
+<h3 id="DownloadProcess">Download process</h3>
+
+<p>Most of the time, Google Play downloads and saves your expansion files at the same time it
+downloads the APK to the device. However, in some cases Google Play
+cannot download the expansion files or the user might have deleted previously downloaded expansion
+files. To handle these situations, your app must be able to download the files
+itself when the main activity starts, using a URL provided by Google Play.</p>
+
+<p>The download process from a high level looks like this:</p>
+
+<ol>
+ <li>User selects to install your app from Google Play.</li>
+ <li>If Google Play is able to download the expansion files (which is the case for most
+devices), it downloads them along with the APK.
+ <p>If Google Play is unable to download the expansion files, it downloads the
+APK only.</p>
+ </li>
+ <li>When the user launches your application, your app must check whether the expansion files are
+already saved on the device.
+ <ol>
+ <li>If yes, your app is ready to go.</li>
+ <li>If no, your app must download the expansion files over HTTP from Google Play. Your app
+must send a request to the Google Play client using the Google Play's <a
+href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a> service, which
+responds with the name, file size, and URL for each expansion file. With this information, you then
+download the files and save them to the proper <a href="#StorageLocation">storage location</a>.</li>
+ </ol>
+ </li>
+</ol>
+
+<p class="caution"><strong>Caution:</strong> It is critical that you include the necessary code to
+download the expansion files from Google Play in the event that the files are not already on the
+device when your application starts. As discussed in the following section about <a
+href="#Downloading">Downloading the Expansion Files</a>, we've made a library available to you that
+greatly simplifies this process and performs the download from a service with a minimal amount of
+code from you.</p>
+
+
+
+
+<h3 id="Checklist">Development checklist</h3>
+
+<p>Here's a summary of the tasks you should perform to use expansion files with your
+application:</p>
+
+<ol>
+ <li>First determine whether your application absolutely requires more than 50MB per installation.
+Space is precious and you should keep your total application size as small as possible. If your app
+uses more than 50MB in order to provide multiple versions of your graphic assets for multiple screen
+densities, consider instead publishing <a
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html">multiple APKs</a> in which each APK
+contains only the assets required for the screens that it targets.</li>
+ <li>Determine which application resources to separate from your APK and package them in a
+file to use as the main expansion file.
+ <p>Normally, you should only use the second patch expansion file when performing updates to
+the main expansion file. However, if your resources exceed the 2GB limit for the main
+expansion file, you can use the patch file for the rest of your assets.</p>
+ </li>
+ <li>Develop your application such that it uses the resources from your expansion files in the
+device's <a href="#StorageLocation">shared storage location</a>.
+ <p>Remember that you must not delete, move, or rename the expansion files.</p>
+ <p>If your application doesn't demand a specific format, we suggest you create ZIP files for
+your expansion files, then read them using the <a href="#ZipLib">APK Expansion Zip
+Library</a>.</p>
+ </li>
+ <li>Add logic to your application's main activity that checks whether the expansion files
+are on the device upon start-up. If the files are not on the device, use Google Play's <a
+href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a> service to request URLs
+for the expansion files, then download and save them.
+ <p>To greatly reduce the amount of code you must write and ensure a good user experience
+during the download, we recommend you use the <a href="AboutLibraries">Downloader
+Library</a> to implement your download behavior.</p>
+ <p>If you build your own download service instead of using the library, be aware that you
+must not change the name of the expansion files and must save them to the proper
+<a href="#StorageLocation">storage location</a>.</p></li>
+</ol>
+
+<p>Once you've finished your application development, follow the guide to <a href="#Testing">Testing
+Your Expansion Files</a>.</p>
+
+
+
+
+
+
+<h2 id="Rules">Rules and Limitations</h2>
+
+<p>Adding APK expansion files is a feature available when you upload your application using the
+Developer Console. When uploading your application for the first time or updating an
+application that uses expansion files, you must be aware of the following rules and limitations:</p>
+
+<ol type="I">
+ <li>Each expansion file can be no more than 2GB.</li>
+ <li>In order to download your expansion files from Google Play, <strong>the user must have
+acquired your application from Google Play</strong>. Google Play will not
+provide the URLs for your expansion files if the application was installed by other means.</li>
+ <li>When performing the download from within your application, the URL that Google Play
+provides for each file is unique for every download and each one expires shortly after it is given
+to your application.</li>
+ <li>If you update your application with a new APK or upload <a
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html">multiple APKs</a> for the same
+application, you can select expansion files that you've uploaded for a previous APK. <strong>The
+expansion file's name does not change</strong>—it retains the version received by the APK to
+which the file was originally associated.</li>
+ <li>If you use expansion files in combination with <a
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html">multiple APKs</a> in order to
+provide different expansion files for different devices, you still must upload separate APKs
+for each device in order to provide a unique <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code versionCode}</a>
+value and declare different <a href="{@docRoot}guide/google/play/filters.html">filters</a> for
+each APK.</li>
+ <li>You cannot issue an update to your application by changing the expansion files
+alone—<strong>you must upload a new APK</strong> to update your app. If your changes only
+concern the assets in your expansion files, you can update your APK simply by changing the <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code versionCode}</a> (and
+perhaps also the <a href="{@docRoot}guide/topics/manifest/manifest-element.html#vname">{@code
+versionName}</a>).</p></li>
+ <li><strong>Do not save other data into your <code>obb/</code>
+directory</strong>. If you must unpack some data, save it into the location specified by {@link
+android.content.Context#getExternalFilesDir getExternalFilesDir()}.</li>
+ <li><strong>Do not delete or rename the {@code .obb} expansion file</strong> (unless you're
+performing an update). Doing so will cause Google Play (or your app itself) to repeatedly
+download the expansion file.</li>
+ <li>When updating an expansion file manually, you must delete the previous expansion file.</li>
+</ol>
+
+
+
+
+
+
+
+
+
+<h2 id="Downloading">Downloading the Expansion Files</h2>
+
+<p>In most cases, Google Play downloads and saves your expansion files to the device at the same
+time it installs or updates the APK. This way, the expansion files are available when your
+application launches for the first time. However, in some cases your app must download the
+expansion files itself by requesting them from a URL provided to you in a response
+from Google Play's <a
+href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a> service.</p>
+
+<p>The basic logic you need to download your expansion files is the following:</p>
+
+<ol>
+ <li>When your application starts, look for the expansion files on the <a
+href="#StorageLocation">shared storage location</a> (in the
+<code>Android/obb/<package-name>/</code> directory).
+ <ol type="a">
+ <li>If the expansion files are there, you're all set and your application can continue.</li>
+ <li>If the expansion files are <em>not</em> there:
+ <ol>
+ <li>Perform a request using Google Play's <a
+href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a> to get your
+app's expansion file names, sizes, and URLs.</li>
+ <li>Use the URLs provided by Google Play to download the expansion files and save
+the expansion files. You <strong>must</strong> save the files to the <a
+href="#StorageLocation">shared storage location</a>
+(<code>Android/obb/<package-name>/</code>) and use the exact file name provided
+by Google Play's response.
+ <p class="note"><strong>Note:</strong> The URL that Google Play provides for your
+expansion files is unique for every download and each one expires shortly after it is given to
+your application.</p>
+ </li>
+ </ol>
+ </li>
+ </ol>
+ </li>
+</ol>
+
+
+<p>If your application is free (not a paid app), then you probably haven't used the <a
+href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a> service. It's primarily
+designed for you to enforce
+licensing policies for your application and ensure that the user has the right to
+use your app (he or she rightfully paid for it on Google Play). In order to facilitate the
+expansion file functionality, the licensing service has been enhanced to provide a response
+to your application that includes the URL of your application's expansion files that are hosted
+on Google Play. So, even if your application is free for users, you need to include the
+License Verification Library (LVL) to use APK expansion files. Of course, if your application
+is free, you don't need to enforce license verification—you simply need the
+library to perform the request that returns the URL of your expansion files.</p>
+
+<p class="note"><strong>Note:</strong> Whether your application is free or not, Google Play
+returns the expansion file URLs only if the user acquired your application from Google Play.</p>
+
+<p>In addition to the LVL, you need a set of code that downloads the expansion files
+over an HTTP connection and saves them to the proper location on the device's shared storage.
+As you build this procedure into your application, there are several issues you should take into
+consideration:</p>
+
+<ul>
+ <li>The device might not have enough space for the expansion files, so you should check
+before beginning the download and warn the user if there's not enough space.</li>
+ <li>File downloads should occur in a background service in order to avoid blocking the user
+interaction and allow the user to leave your app while the download completes.</li>
+ <li>A variety of errors might occur during the request and download that you must
+gracefully handle.</li>
+ <li>Network connectivity can change during the download, so you should handle such changes and
+if interrupted, resume the download when possible.</li>
+ <li>While the download occurs in the background, you should provide a notification that
+indicates the download progress, notifies the user when it's done, and takes the user back to
+your application when selected.</li>
+</ul>
+
+
+<p>To simplify this work for you, we've built the <a href="#AboutLibraries">Downloader Library</a>,
+which requests the expansion file URLs through the licensing service, downloads the expansion files,
+performs all of the tasks listed above, and even allows your activity to pause and resume the
+download. By adding the Downloader Library and a few code hooks to your application, almost all the
+work to download the expansion files is already coded for you. As such, in order to provide the best
+user experience with minimal effort on your behalf, we recommend you use the Downloader Library to
+download your expansion files. The information in the following sections explain how to integrate
+the library into your application.</p>
+
+<p>If you'd rather develop your own solution to download the expansion files using the Google
+Play URLs, you must follow the <a href="{@docRoot}guide/google/play/licensing/index.html">Application
+Licensing</a> documentation to perform a license request, then retrieve the expansion file names,
+sizes, and URLs from the response extras. You should use the <a href="#ExpansionPolicy">{@code
+APKExpansionPolicy}</a> class (included in the License Verification Library) as your licensing
+policy, which captures the expansion file names, sizes, and URLs from the licensing service..</p>
+
+
+
+<h3 id="AboutLibraries">About the Downloader Library</h3>
+
+<p>To use APK expansion files with your application and provide the best user experience with
+minimal effort on your behalf, we recommend you use the Downloader Library that's included in the
+Google Market Apk Expansion package. This library downloads your expansion files in a
+background service, shows a user notification with the download status, handles network
+connectivity loss, resumes the download when possible, and more.</p>
+
+<p>To implement expansion file downloads using the Downloader Library, all you need to do is:</p>
+
+<ul>
+ <li>Extend a special {@link android.app.Service} subclass and {@link
+android.content.BroadcastReceiver} subclass that each require just a few
+lines of code from you.</li>
+ <li>Add some logic to your main activity that checks whether the expansion files have
+already been downloaded and, if not, invokes the download process and displays a
+progress UI.</li>
+ <li>Implement a callback interface with a few methods in your main activity that
+receives updates about the download progress.</li>
+</ul>
+
+<p>The following sections explain how to set up your app using the Downloader Library.</p>
+
+
+<h3 id="Preparing">Preparing to use the Downloader Library</h3>
+
+<p>To use the Downloader Library, you need to
+download two packages from the SDK Manager and add the appropriate libraries to your
+application.</p>
+
+<p>First, open the <a href="{@docRoot}sdk/exploring.html">Android SDK Manager</a>, expand
+<em>Extras</em> and download:</p>
+<ul>
+ <li><em>Google Market Licensing package</em></li>
+ <li><em>Google Market Apk Expansion package</em></li>
+</ul>
+
+<p>If you're using Eclipse, create a project for each library and add it to your app:</p>
+<ol>
+ <li>Create a new Library Project for the License Verification Library and Downloader
+Library. For each library:
+ <ol>
+ <li>Begin a new Android project.</li>
+ <li>Select <strong>Create project from existing
+source</strong> and choose the library from the {@code <sdk>/extras/google/} directory
+({@code market_licensing/} for the License Verification Library or {@code
+market_apk_expansion/downloader_library/} for the Downloader Library).</li>
+ <li>Specify a <em>Project Name</em> such as "Google Play License Library" and "Google Play
+Downloader
+Library"</li>
+ <li>Click <strong>Finish</strong>.</li>
+ </ol>
+<p class="note"><strong>Note:</strong> The Downloader Library depends on the License
+Verification Library. Be sure to add the License
+Verification Library to the Downloader Library's project properties (same process as
+steps 2 and 3 below).</p>
+ </li>
+ <li>Right-click the Android project in which you want to use APK expansion files and
+select <strong>Properties</strong>.</li>
+ <li>In the <em>Library</em> panel, click <strong>Add</strong> to select and add each of the
+libraries to your application.</li>
+</ol>
+
+<p>Or, from a command line, update your project to include the libraries:</p>
+<ol>
+ <li>Change directories to the <code><sdk>/tools/</code> directory.</li>
+ <li>Execute <code>android update project</code> with the {@code --library} option to add both the
+LVL and the Downloader Library to your project. For example:
+<pre class="no-pretty-print">
+android update project --path ~/Android/MyApp \
+--library ~/android_sdk/extras/google/market_licensing \
+--library ~/android_sdk/extras/google/market_apk_expansion/downloader_library
+</pre>
+ </li>
+</ol>
+
+<p>With both the License Verification Library and Downloader Library added to your
+application, you'll be able to quickly integrate the ability to download expansion files from
+Google Play. The format that you choose for the expansion files and how you read them
+from the shared storage is a separate implementation that you should consider based on your
+application needs.</p>
+
+<p class="note"><strong>Tip:</strong> The Apk Expansion package includes a sample
+application
+that shows how to use the Downloader Library in an app. The sample uses a third library
+available in the Apk Expansion package called the APK Expansion Zip Library. If
+you plan on
+using ZIP files for your expansion files, we suggest you also add the APK Expansion Zip Library to
+your application. For more information, see the section below
+about <a href="#ZipLib">Using the APK Expansion Zip Library</a>.</p>
+
+
+
+<h3 id="Permissions">Declaring user permissions</h3>
+
+<p>In order to download the expansion files, the Downloader Library
+requires several permissions that you must declare in your application's manifest file. They
+are:</p>
+
+<pre>
+<manifest ...>
+ <!-- Required to access Google Play Licensing -->
+ <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
+
+ <!-- Required to download files from Google Play -->
+ <uses-permission android:name="android.permission.INTERNET" />
+
+ <!-- Required to keep CPU alive while downloading files (NOT to keep screen awake) -->
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
+
+ <!-- Required to poll the state of the network connection and respond to changes -->
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+
+ <!-- Required to check whether Wi-Fi is enabled -->
+ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
+
+ <!-- Required to read and write the expansion files on shared storage -->
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ ...
+</manifest>
+</pre>
+
+<p class="note"><strong>Note:</strong> By default, the Downloader Library requires API
+level 4, but the APK Expansion Zip Library requires API level 5.</p>
+
+
+<h3 id="DownloaderService">Implementing the downloader service</h3>
+
+<p>In order to perform downloads in the background, the Downloader Library provides its
+own {@link android.app.Service} subclass called {@code DownloaderService} that you should extend. In
+addition to downloading the expansion files for you, the {@code DownloaderService} also:</p>
+
+<ul>
+ <li>Registers a {@link android.content.BroadcastReceiver} that listens for changes to the
+device's network connectivity (the {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION}
+broadcast) in order to pause the download when necessary (such as due to connectivity loss) and
+resume the download when possible (connectivity is acquired).</li>
+ <li>Schedules an {@link android.app.AlarmManager#RTC_WAKEUP} alarm to retry the download for
+cases in which the service gets killed.</li>
+ <li>Builds a custom {@link android.app.Notification} that displays the download progress and
+any errors or state changes.</li>
+ <li>Allows your application to manually pause and resume the download.</li>
+ <li>Verifies that the shared storage is mounted and available, that the files don't already exist,
+and that there is enough space, all before downloading the expansion files. Then notifies the user
+if any of these are not true.</li>
+</ul>
+
+<p>All you need to do is create a class in your application that extends the {@code
+DownloaderService} class and override three methods to provide specific application details:</p>
+
+<dl>
+ <dt>{@code getPublicKey()}</dt>
+ <dd>This must return a string that is the Base64-encoded RSA public key for your publisher
+account, available from the profile page on the Developer Console (see <a
+href="{@docRoot}guide/google/play/licensing/setting-up.html">Setting Up for Licensing</a>).</dd>
+ <dt>{@code getSALT()}</dt>
+ <dd>This must return an array of random bytes that the licensing {@code Policy} uses to
+create an <a
+href="{@docRoot}guide/google/play/licensing/adding-licensing.html#impl-Obfuscator">{@code
+Obfuscator}</a>. The salt ensures that your obfuscated {@link android.content.SharedPreferences}
+file in which your licensing data is saved will be unique and non-discoverable.</dd>
+ <dt>{@code getAlarmReceiverClassName()}</dt>
+ <dd>This must return the class name of the {@link android.content.BroadcastReceiver} in
+your application that should receive the alarm indicating that the download should be
+restarted (which might happen if the downloader service unexpectedly stops).</dd>
+</dl>
+
+<p>For example, here's a complete implementation of {@code DownloaderService}:</p>
+
+<pre>
+public class SampleDownloaderService extends DownloaderService {
+ // You must use the public key belonging to your publisher account
+ public static final String BASE64_PUBLIC_KEY = "YourLVLKey";
+ // You should also modify this salt
+ public static final byte[] SALT = new byte[] { 1, 42, -12, -1, 54, 98,
+ -100, -12, 43, 2, -8, -4, 9, 5, -106, -107, -33, 45, -1, 84
+ };
+
+ @Override
+ public String getPublicKey() {
+ return BASE64_PUBLIC_KEY;
+ }
+
+ @Override
+ public byte[] getSALT() {
+ return SALT;
+ }
+
+ @Override
+ public String getAlarmReceiverClassName() {
+ return SampleAlarmReceiver.class.getName();
+ }
+}
+</pre>
+
+<p class="caution"><strong>Notice:</strong> You must update the {@code BASE64_PUBLIC_KEY} value
+to be the public key belonging to your publisher account. You can find the key in the Developer
+Console under your profile information. This is necessary even when testing
+your downloads.</p>
+
+<p>Remember to declare the service in your manifest file:</p>
+<pre>
+<application ...>
+ <service android:name=".SampleDownloaderService" />
+ ...
+</application>
+</pre>
+
+
+
+<h3 id="AlarmReceiver">Implementing the alarm receiver</h3>
+
+<p>In order to monitor the progress of the file downloads and restart the download if necessary, the
+{@code DownloaderService} schedules an {@link android.app.AlarmManager#RTC_WAKEUP} alarm that
+delivers an {@link android.content.Intent} to a {@link android.content.BroadcastReceiver} in your
+application. You must define the {@link android.content.BroadcastReceiver} to call an API
+from the Downloader Library that checks the status of the download and restarts
+it if necessary.</p>
+
+<p>You simply need to override the {@link android.content.BroadcastReceiver#onReceive
+onReceive()} method to call {@code
+DownloaderClientMarshaller.startDownloadServiceIfRequired()}.</p>
+
+<p>For example:</p>
+
+<pre>
+public class SampleAlarmReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ try {
+ DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent,
+ SampleDownloaderService.class);
+ } catch (NameNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+}
+</pre>
+
+<p>Notice that this is the class for which you must return the name
+in your service's {@code getAlarmReceiverClassName()} method (see the previous section).</p>
+
+<p>Remember to declare the receiver in your manifest file:</p>
+<pre>
+<application ...>
+ <receiver android:name=".SampleAlarmReceiver" />
+ ...
+</application>
+</pre>
+
+
+
+<h3 id="Download">Starting the download</h3>
+
+<p>The main activity in your application (the one started by your launcher icon) is
+responsible for verifying whether the expansion files are already on the device and initiating
+the download if they are not.</p>
+
+<p>Starting the download using the Downloader Library requires the following
+procedures:</p>
+
+<ol>
+ <li>Check whether the files have been downloaded.
+ <p>The Downloader Library includes some APIs in the {@code Helper} class to
+help with this process:</p>
+ <ul>
+ <li>{@code getExtendedAPKFileName(Context, c, boolean mainFile, int
+versionCode)}</li>
+ <li>{@code doesFileExist(Context c, String fileName, long fileSize)}</li>
+ </ul>
+ <p>For example, the sample app provided in the Apk Expansion package calls the
+following method in the activity's {@link android.app.Activity#onCreate onCreate()} method to check
+whether the expansion files already exist on the device:</p>
+<pre>
+boolean expansionFilesDelivered() {
+ for (XAPKFile xf : xAPKS) {
+ String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsBase, xf.mFileVersion);
+ if (!Helpers.doesFileExist(this, fileName, xf.mFileSize, false))
+ return false;
+ }
+ return true;
+}
+</pre>
+ <p>In this case, each {@code XAPKFile} object holds the version number and file size of a known
+expansion file and a boolean as to whether it's the main expansion file. (See the sample
+application's {@code SampleDownloaderActivity} class for details.)</p>
+ <p>If this method returns false, then the application must begin the download.</p>
+ </li>
+ <li>Start the download by calling the static method {@code
+DownloaderClientMarshaller.startDownloadServiceIfRequired(Context c, PendingIntent
+notificationClient, Class<?> serviceClass)}.
+ <p>The method takes the following parameters:</p>
+ <ul>
+ <li><code>context</code>: Your application's {@link android.content.Context}.</li>
+ <li><code>notificationClient</code>: A {@link android.app.PendingIntent} to start your main
+activity. This is used in the {@link android.app.Notification} that the {@code DownloaderService}
+creates to show the download progress. When the user selects the notification, the system
+invokes the {@link android.app.PendingIntent} you supply here and should open the activity
+that shows the download progress (usually the same activity that started the download).</li>
+ <li><code>serviceClass</code>: The {@link java.lang.Class} object for your implementation of
+{@code DownloaderService}, required to start the service and begin the download if necessary.</li>
+ </ul>
+ <p>The method returns an integer that indicates
+whether or not the download is required. Possible values are:</p>
+ <ul>
+ <li>{@code NO_DOWNLOAD_REQUIRED}: Returned if the files already
+exist or a download is already in progress.</li>
+ <li>{@code LVL_CHECK_REQUIRED}: Returned if a license verification is
+required in order to acquire the expansion file URLs.</li>
+ <li>{@code DOWNLOAD_REQUIRED}: Returned if the expansion file URLs are already known,
+but have not been downloaded.</li>
+ </ul>
+ <p>The behavior for {@code LVL_CHECK_REQUIRED} and {@code DOWNLOAD_REQUIRED} are essentially the
+same and you normally don't need to be concerned about them. In your main activity that calls {@code
+startDownloadServiceIfRequired()}, you can simply check whether or not the response is {@code
+NO_DOWNLOAD_REQUIRED}. If the response is anything <em>other than</em> {@code NO_DOWNLOAD_REQUIRED},
+the Downloader Library begins the download and you should update your activity UI to
+display the download progress (see the next step). If the response <em>is</em> {@code
+NO_DOWNLOAD_REQUIRED}, then the files are available and your application can start.</p>
+ <p>For example:</p>
+<pre>
+@Override
+public void onCreate(Bundle savedInstanceState) {
+ // Check if expansion files are available before going any further
+ if (!expansionFilesDelivered()) {
+ // Build an Intent to start this activity from the Notification
+ Intent notifierIntent = new Intent(this, MainActivity.getClass());
+ notifierIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
+ Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ ...
+ PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
+ notifierIntent, PendingIntent.FLAG_UPDATE_CURRENT);
+
+ // Start the download service (if required)
+ int startResult = DownloaderClientMarshaller.startDownloadServiceIfRequired(this,
+ pendingIntent, SampleDownloaderService.class);
+ // If download has started, initialize this activity to show download progress
+ if (startResult != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) {
+ // This is where you do set up to display the download progress (next step)
+ ...
+ return;
+ } // If the download wasn't necessary, fall through to start the app
+ }
+ startApp(); // Expansion files are available, start the app
+}
+</pre>
+ </li>
+ <li>When the {@code startDownloadServiceIfRequired()} method returns anything <em>other
+than</em> {@code NO_DOWNLOAD_REQUIRED}, create an instance of {@code IStub} by
+calling {@code DownloaderClientMarshaller.CreateStub(IDownloaderClient client, Class<?>
+downloaderService)}. The {@code IStub} provides a binding between your activity to the downloader
+service such that your activity receives callbacks about the download progress.
+ <p>In order to instantiate your {@code IStub} by calling {@code CreateStub()}, you must pass it
+an implementation of the {@code IDownloaderClient} interface and your {@code DownloaderService}
+implementation. The next section about <a href="#Progress">Receiving download progress</a> discusses
+the {@code IDownloaderClient} interface, which you should usually implement in your {@link
+android.app.Activity} class so you can update the activity UI when the download state changes.</p>
+ <p>We recommend that you call {@code
+CreateStub()} to instantiate your {@code IStub} during your activity's {@link
+android.app.Activity#onCreate onCreate()} method, after {@code startDownloadServiceIfRequired()}
+starts the download. </p>
+ <p>For example, in the previous code sample for {@link android.app.Activity#onCreate
+onCreate()}, you can respond to the {@code startDownloadServiceIfRequired()} result like this:</p>
+<pre>
+ // Start the download service (if required)
+ int startResult = DownloaderClientMarshaller.startDownloadServiceIfRequired(this,
+ pendingIntent, SampleDownloaderService.class);
+ // If download has started, initialize activity to show progress
+ if (startResult != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) {
+ // Instantiate a member instance of IStub
+ mDownloaderClientStub = DownloaderClientMarshaller.CreateStub(this,
+ SampleDownloaderService.class);
+ // Inflate layout that shows download progress
+ setContentView(R.layout.downloader_ui);
+ return;
+ }
+</pre>
+
+ <p>After the {@link android.app.Activity#onCreate onCreate()} method returns, your activity
+receives a call to {@link android.app.Activity#onResume onResume()}, which is where you should then
+call {@code connect()} on the {@code IStub}, passing it your application's {@link
+android.content.Context}. Conversely, you should call
+{@code disconnect()} in your activity's {@link android.app.Activity#onStop onStop()} callback.</p>
+<pre>
+@Override
+protected void onResume() {
+ if (null != mDownloaderClientStub) {
+ mDownloaderClientStub.connect(this);
+ }
+ super.onResume();
+}
+
+@Override
+protected void onStop() {
+ if (null != mDownloaderClientStub) {
+ mDownloaderClientStub.disconnect(this);
+ }
+ super.onStop();
+}
+</pre>
+ <p>Calling {@code connect()} on the {@code IStub} binds your activity to the {@code
+DownloaderService} such that your activity receives callbacks regarding changes to the download
+state through the {@code IDownloaderClient} interface.</p>
+ </li>
+</ol>
+
+
+
+<h3 id="Progress">Receiving download progress</h3>
+
+<p>To receive updates regarding the download progress and to interact with the {@code
+DownloaderService}, you must implement the Downloader Library's {@code IDownloaderClient} interface.
+Usually, the activity you use to start the download should implement this interface in order to
+display the download progress and send requests to the service.</p>
+
+<p>The required interface methods for {@code IDownloaderClient} are:</p>
+
+<dl>
+ <dt>{@code onServiceConnected(Messenger m)}</dt>
+ <dd>After you instantiate the {@code IStub} in your activity, you'll receive a call to this
+method, which passes a {@link android.os.Messenger} object that's connected with your instance
+of {@code DownloaderService}. To send requests to the service, such as to pause and resume
+downloads, you must call {@code DownloaderServiceMarshaller.CreateProxy()} to receive the {@code
+IDownloaderService} interface connected to the service.
+ <p>A recommended implementation looks like this:</p>
+<pre>
+private IDownloaderService mRemoteService;
+...
+
+@Override
+public void onServiceConnected(Messenger m) {
+ mRemoteService = DownloaderServiceMarshaller.CreateProxy(m);
+ mRemoteService.onClientUpdated(mDownloaderClientStub.getMessenger());
+}
+</pre>
+ <p>With the {@code IDownloaderService} object initialized, you can send commands to the
+downloader service, such as to pause and resume the download ({@code requestPauseDownload()}
+and {@code requestContinueDownload()}).</p>
+</dd>
+ <dt>{@code onDownloadStateChanged(int newState)}</dt>
+ <dd>The download service calls this when a change in download state occurs, such as the
+download begins or completes.
+ <p>The <code>newState</code> value will be one of several possible values specified in
+by one of the {@code IDownloaderClient} class's {@code STATE_*} constants.</p>
+ <p>To provide a useful message to your users, you can request a corresponding string
+for each state by calling {@code Helpers.getDownloaderStringResourceIDFromState()}. This
+returns the resource ID for one of the strings bundled with the Downloader
+Library. For example, the string "Download paused because you are roaming" corresponds to {@code
+STATE_PAUSED_ROAMING}.</p></dd>
+ <dt>{@code onDownloadProgress(DownloadProgressInfo progress)}</dt>
+ <dd>The download service calls this to deliver a {@code DownloadProgressInfo} object,
+which describes various information about the download progress, including estimated time remaining,
+current speed, overall progress, and total so you can update the download progress UI.</dd>
+</dl>
+<p class="note"><strong>Tip:</strong> For examples of these callbacks that update the download
+progress UI, see the {@code SampleDownloaderActivity} in the sample app provided with the
+Apk Expansion package.</p>
+
+<p>Some public methods for the {@code IDownloaderService} interface you might find useful are:</p>
+
+<dl>
+ <dt>{@code requestPauseDownload()}</dt>
+ <dd>Pauses the download.</dd>
+ <dt>{@code requestContinueDownload()}</dt>
+ <dd>Resumes a paused download.</dd>
+ <dt>{@code setDownloadFlags(int flags)}</dt>
+ <dd>Sets user preferences for network types on which its OK to download the files. The
+current implementation supports one flag, {@code FLAGS_DOWNLOAD_OVER_CELLULAR}, but you can add
+others. By default, this flag is <em>not</em> enabled, so the user must be on Wi-Fi to download
+expansion files. You might want to provide a user preference to enable downloads over
+the cellular network. In which case, you can call:
+<pre>
+mRemoteService.setDownloadFlags(IDownloaderService.FLAGS_DOWNLOAD_OVER_CELLULAR);
+</pre>
+</dd>
+</dl>
+
+
+
+
+<h2 id="ExpansionPolicy">Using APKExpansionPolicy</h2>
+
+<p>If you decide to build your own downloader service instead of using the Google Play
+<a href="#AboutLibraries">Downloader Library</a>, you should still use the {@code
+APKExpansionPolicy} that's provided in the License Verification Library. The {@code
+APKExpansionPolicy} class is nearly identical to {@code ServerManagedPolicy} (available in the
+Google Play License Verification Library) but includes additional handling for the APK expansion
+file response extras.</p>
+
+<p class="note"><strong>Note:</strong> If you <em>do use</em> the <a
+href="#AboutLibraries">Downloader Library</a> as discussed in the previous section, the
+library performs all interaction with the {@code APKExpansionPolicy} so you don't have to use
+this class directly.</p>
+
+<p>The class includes methods to help you get the necessary information about the available
+expansion files:</p>
+
+<ul>
+ <li>{@code getExpansionURLCount()}</li>
+ <li>{@code getExpansionURL(int index)}</li>
+ <li>{@code getExpansionFileName(int index)}</li>
+ <li>{@code getExpansionFileSize(int index)}</li>
+</ul>
+
+<p>For more information about how to use the {@code APKExpansionPolicy} when you're <em>not</em>
+using the <a
+href="#AboutLibraries">Downloader Library</a>, see the documentation for <a
+href="{@docRoot}guide/google/play/licensing/adding-licensing.html">Adding Licensing to Your App</a>,
+which explains how to implement a license policy such as this one.</p>
+
+
+
+
+
+
+
+<h2 id="ReadingTheFile">Reading the Expansion File</h2>
+
+<p>Once your APK expansion files are saved on the device, how you read your files
+depends on the type of file you've used. As discussed in the <a href="#Overview">overview</a>, your
+expansion files can be any kind of file you
+want, but are renamed using a particular <a href="#Filename">file name format</a> and are saved to
+{@code <shared-storage>/Android/obb/<package-name>/}.</p>
+
+<p>Regardless of how you read your files, you should always first check that the external
+storage is available for reading. There's a chance that the user has the storage mounted to a
+computer over USB or has actually removed the SD card.</p>
+
+<p class="note"><strong>Note:</strong> When your application starts, you should always check whether
+the external storage space is available and readable by calling {@link
+android.os.Environment#getExternalStorageState()}. This returns one of several possible strings
+that represent the state of the external storage. In order for it to be readable by your
+application, the return value must be {@link android.os.Environment#MEDIA_MOUNTED}.</p>
+
+
+<h3 id="GettingFilenames">Getting the file names</h3>
+
+<p>As described in the <a href="#Overview">overview</a>, your APK expansion files are saved
+using a specific file name format:</p>
+
+<pre class="classic no-pretty-print">
+[main|patch].<expansion-version>.<package-name>.obb
+</pre>
+
+<p>To get the location and names of your expansion files, you should use the
+{@link android.os.Environment#getExternalStorageDirectory()} and {@link
+android.content.Context#getPackageName()} methods to construct the path to your files.</p>
+
+<p>Here's a method you can use in your application to get an array containing the complete path
+to both your expansion files:</p>
+
+<pre>
+// The shared path to all app expansion files
+private final static String EXP_PATH = "/Android/obb/";
+
+static String[] getAPKExpansionFiles(Context ctx, int mainVersion, int patchVersion) {
+ String packageName = ctx.getPackageName();
+ Vector<String> ret = new Vector<String>();
+ if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+ // Build the full path to the app's expansion files
+ File root = Environment.getExternalStorageDirectory();
+ File expPath = new File(root.toString() + EXP_PATH + packageName);
+
+ // Check that expansion file path exists
+ if (expPath.exists()) {
+ if ( mainVersion > 0 ) {
+ String strMainPath = expPath + File.separator + "main." +
+ mainVersion + "." + packageName + ".obb";
+ File main = new File(strMainPath);
+ if ( main.isFile() ) {
+ ret.add(strMainPath);
+ }
+ }
+ if ( patchVersion > 0 ) {
+ String strPatchPath = expPath + File.separator + "patch." +
+ mainVersion + "." + packageName + ".obb";
+ File main = new File(strPatchPath);
+ if ( main.isFile() ) {
+ ret.add(strPatchPath);
+ }
+ }
+ }
+ }
+ String[] retArray = new String[ret.size()];
+ ret.toArray(retArray);
+ return retArray;
+}
+</pre>
+
+<p>You can call this method by passing it your application {@link android.content.Context}
+and the desired expansion file's version.</p>
+
+<p>There are many ways you could determine the expansion file version number. One simple way is to
+save the version in a {@link android.content.SharedPreferences} file when the download begins, by
+querying the expansion file name with the {@code APKExpansionPolicy} class's {@code
+getExpansionFileName(int index)} method. You can then get the version code by reading the {@link
+android.content.SharedPreferences} file when you want to access the expansion
+file.</p>
+
+<p>For more information about reading from the shared storage, see the <a
+href="{@docRoot}guide/topics/data/data-storage.html#filesExternal">Data Storage</a>
+documentation.</p>
+
+
+
+<h3 id="ZipLib">Using the APK Expansion Zip Library</h3>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <h3>Reading media files from a ZIP</h3>
+ <p>If you're using your expansion files to store media files, a ZIP file still allows you to
+use Android media playback calls that provide offset and length controls (such as {@link
+android.media.MediaPlayer#setDataSource(FileDescriptor,long,long) MediaPlayer.setDataSource()} and
+{@link android.media.SoundPool#load(FileDescriptor,long,long,int) SoundPool.load()}). In order for
+this to work, you must not perform additional compression on the media files when creating the ZIP
+packages. For example, when using the <code>zip</code> tool, you should use the <code>-n</code>
+option to specify the file suffixes that should not be compressed:</p>
+<p><code>zip -n .mp4;.ogg main_expansion media_files</code></p>
+</div>
+</div>
+
+<p>The Google Market Apk Expansion package includes a library called the APK
+Expansion Zip Library (located in {@code
+<sdk>/extras/google/google_market_apk_expansion/zip_file/}). This is an optional library that
+helps you read your expansion
+files when they're saved as ZIP files. Using this library allows you to easily read resources from
+your ZIP expansion files as a virtual file system.</p>
+
+<p>The APK Expansion Zip Library includes the following classes and APIs:</p>
+
+<dl>
+ <dt>{@code APKExpansionSupport}</dt>
+ <dd>Provides some methods to access expansion file names and ZIP files:
+
+ <dl style="margin-top:1em">
+ <dt>{@code getAPKExpansionFiles()}</dt>
+ <dd>The same method shown above that returns the complete file path to both expansion
+files.</dd>
+ <dt>{@code getAPKExpansionZipFile(Context ctx, int mainVersion, int
+patchVersion)}</dt>
+ <dd>Returns a {@code ZipResourceFile} representing the sum of both the main file and
+patch file. That is, if you specify both the <code>mainVersion</code> and the
+<code>patchVersion</code>, this returns a {@code ZipResourceFile} that provides read access to
+all the data, with the patch file's data merged on top of the main file.</dd>
+ </dl>
+ </dd>
+
+ <dt>{@code ZipResourceFile}</dt>
+ <dd>Represents a ZIP file on the shared storage and performs all the work to provide a virtual
+file system based on your ZIP files. You can get an instance using {@code
+APKExpansionSupport.getAPKExpansionZipFile()} or with the {@code ZipResourceFile} by passing it the
+path to your expansion file. This class includes a variety of useful methods, but you generally
+don't need to access most of them. A couple of important methods are:
+
+ <dl style="margin-top:1em">
+ <dt>{@code getInputStream(String assetPath)}</dt>
+ <dd>Provides an {@link java.io.InputStream} to read a file within the ZIP file. The
+<code>assetPath</code> must be the path to the desired file, relative to
+the root of the ZIP file contents.</dd>
+ <dt>{@code getAssetFileDescriptor(String assetPath)}</dt>
+ <dd>Provides an {@link android.content.res.AssetFileDescriptor} for a file within the
+ZIP file. The <code>assetPath</code> must be the path to the desired file, relative to
+the root of the ZIP file contents. This is useful for certain Android APIs that require an {@link
+android.content.res.AssetFileDescriptor}, such as some {@link android.media.MediaPlayer} APIs.</dd>
+ </dl>
+ </dd>
+
+ <dt>{@code APEZProvider}</dt>
+ <dd>Most applications don't need to use this class. This class defines a {@link
+android.content.ContentProvider} that marshals the data from the ZIP files through a content
+provider {@link android.net.Uri} in order to provide file access for certain Android APIs that
+expect {@link android.net.Uri} access to media files. For example, this is useful if you want to
+play a video with {@link android.widget.VideoView#setVideoURI VideoView.setVideoURI()}.</p></dd>
+</dl>
+
+<h4>Reading from a ZIP file</h4>
+
+<p>When using the APK Expansion Zip Library, reading a file from your ZIP usually requires the
+following:</p>
+
+<pre>
+// Get a ZipResourceFile representing a merger of both the main and patch files
+ZipResourceFile expansionFile = APKExpansionSupport.getAPKExpansionZipFile(appContext,
+ mainVersion, patchVersion);
+
+// Get an input stream for a known file inside the expansion file ZIPs
+InputStream fileStream = expansionFile.getInputStream(pathToFileInsideZip);
+</pre>
+
+<p>The above code provides access to any file that exists in either your main expansion file or
+patch expansion file, by reading from a merged map of all the files from both files. All you
+need to provide the {@code getAPKExpansionFile()} method is your application {@code
+android.content.Context} and the version number for both the main expansion file and patch
+expansion file.</p>
+
+<p>If you'd rather read from a specific expansion file, you can use the {@code
+ZipResourceFile} constructor with the path to the desired expansion file:</p>
+
+<pre>
+// Get a ZipResourceFile representing a specific expansion file
+ZipResourceFile expansionFile = new ZipResourceFile(filePathToMyZip);
+
+// Get an input stream for a known file inside the expansion file ZIPs
+InputStream fileStream = expansionFile.getInputStream(pathToFileInsideZip);
+</pre>
+
+<p>For more information about using this library for your expansion files, look at
+the sample application's {@code SampleDownloaderActivity} class, which includes additional code to
+verify the downloaded files using CRC. Beware that if you use this sample as the basis for
+your own implementation, it requires that you <strong>declare the byte size of your expansion
+files</strong> in the {@code xAPKS} array.</p>
+
+
+
+
+<h2 id="Testing">Testing Your Expansion Files</h2>
+
+<p>Before publishing your application, there are two things you should test: Reading the
+expansion files and downloading the files.</p>
+
+
+<h3 id="TestingReading">Testing file reads</h3>
+
+<p>Before you upload your application to Google Play, you
+should test your application's ability to read the files from the shared storage. All you need to do
+is add the files to the appropriate location on the device shared storage and launch your
+application:</p>
+
+<ol>
+ <li>On your device, create the appropriate directory on the shared storage where Google
+Play will save your files.
+ <p>For example, if your package name is {@code com.example.android}, you need to create
+the directory {@code Android/obb/com.example.android/} on the shared storage space. (Plug in
+your test device to your computer to mount the shared storage and manually create this
+directory.)</p>
+ </li>
+ <li>Manually add the expansion files to that directory. Be sure that you rename your files to
+match the <a href="#Filename">file name format</a> that Google Play will use.
+ <p>For example, regardless of the file type, the main expansion file for the {@code
+com.example.android} application should be {@code main.0300110.com.example.android.obb}.
+The version code can be whatever value you want. Just remember:</p>
+ <ul>
+ <li>The main expansion file always starts with {@code main} and the patch file starts with
+{@code patch}.</li>
+ <li>The package name always matches that of the APK to which the file is attached on
+Google Play.
+ </ul>
+ </li>
+ <li>Now that the expansion file(s) are on the device, you can install and run your application to
+test your expansion file(s).</li>
+</ol>
+
+<p>Here are some reminders about handling the expansion files:</p>
+<ul>
+ <li><strong>Do not delete or rename</strong> the {@code .obb} expansion files (even if you unpack
+the data to a different location). Doing so will cause Google Play (or your app itself) to
+repeatedly download the expansion file.</li>
+ <li><strong>Do not save other data into your <code>obb/</code>
+directory</strong>. If you must unpack some data, save it into the location specified by {@link
+android.content.Context#getExternalFilesDir getExternalFilesDir()}.</li>
+</ul>
+
+
+
+<h3 id="TestingReading">Testing file downloads</h3>
+
+<p>Because your application must sometimes manually download the expansion files when it first
+opens, it's important that you test this process to be sure your application can successfully query
+for the URLs, download the files, and save them to the device.</p>
+
+<p>To test your application's implementation of the manual download procedure, you must upload
+your application to Google Play as a "draft" to make your expansion files available for
+download:</p>
+
+<ol>
+ <li>Upload your APK and corresponding expansion files using the Google Play Developer
+Console.</li>
+ <li>Fill in the necessary application details (title, screenshots, etc.). You can come back and
+finalize these details before publishing your application.
+ <p>Click the <strong>Save</strong> button. <em>Do not click Publish.</em> This saves
+the application as a draft, such that your application is not published for Google Play users,
+but the expansion files are available for you to test the download process.</p></li>
+ <li>Install the application on your test device using the Eclipse tools or <a
+href="{@docRoot}tools/help/adb.html">{@code adb}</a>.</li>
+ <li>Launch the app.</li>
+</ol>
+
+<p>If everything works as expected, your application should begin downloading the expansion
+files as soon as the main activity starts.</p>
+
+
+
+
+<h2 id="Updating">Updating Your Application</h2>
+
+<p>One of the great benefits to using expansion files on Google Play is the ability to
+update your application without re-downloading all of the original assets. Because Google Play
+allows you to provide two expansion files with each APK, you can use the second file as a "patch"
+that provides updates and new assets. Doing so avoids the
+need to re-download the main expansion file which could be large and expensive for users.</p>
+
+<p>The patch expansion file is technically the same as the main expansion file and neither
+the Android system nor Google Play perform actual patching between your main and patch expansion
+files. Your application code must perform any necessary patches itself.</p>
+
+<p>If you use ZIP files as your expansion files, the <a href="#ZipLib">APK Expansion Zip
+Library</a> that's included with the Apk Expansion package includes the ability to merge
+your
+patch file with the main expansion file.</p>
+
+<p class="note"><strong>Note:</strong> Even if you only need to make changes to the patch
+expansion file, you must still update the APK in order for Google Play to perform an update.
+If you don't require code changes in the application, you should simply update the <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code versionCode}</a> in the
+manifest.</p>
+
+<p>As long as you don't change the main expansion file that's associated with the APK
+in the Developer Console, users who previously installed your application will not
+download the main expansion file. Existing users receive only the updated APK and the new patch
+expansion file (retaining the previous main expansion file).</p>
+
+<p>Here are a few issues to keep in mind regarding updates to expansion files:</p>
+
+<ul>
+ <li>There can be only two expansion files for your application at a time. One main expansion
+file and one patch expansion file. During an update to a file, Google Play deletes the
+previous version (and so must your application when performing manual updates).</li>
+ <li>When adding a patch expansion file, the Android system does not actually patch your
+application or main expansion file. You must design your application to support the patch data.
+However, the Apk Expansion package includes a library for using ZIP files
+as expansion files, which merges the data from the patch file into the main expansion file so
+you can easily read all the expansion file data.</li>
+</ul>
+
+
+
+<!-- Tools are not ready.
+
+<h3>Using OBB tool and APIs</h3>
+
+<pre>
+$ mkobb.sh -d /data/myfiles -k my_secret_key -o /data/data.obb
+$ obbtool a -n com.example.myapp -v 1 -s seed_from_mkobb /data/data.obb
+</pre>
+
+<pre>
+storage = (StorageManager) getSystemService( STORAGE_SERVICE );
+storage.mountObb( obbFilepath, "my_secret_key", myListener );
+obbContentPath = storage.getMountedObbPath( obbFilepath );
+</pre>
+-->
diff --git a/docs/html/guide/google/play/filters.jd b/docs/html/guide/google/play/filters.jd
new file mode 100644
index 0000000..3db9cb6
--- /dev/null
+++ b/docs/html/guide/google/play/filters.jd
@@ -0,0 +1,454 @@
+page.title=Filters on Google Play
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Quickview</h2>
+<ul>
+<li>Google Play applies filters that control which Android-powered devices can access your
+application when the user is visiting the store.</li>
+<li>Filtering is determined by comparing device configurations that you declare in you app's
+manifest file to the configurations defined by the device, as well as other factors.</li> </ul>
+
+<h2>In this document</h2>
+
+<ol>
+ <li><a href="#how-filters-work">How Filters Work on Google Play</a></li>
+ <li><a href="#manifest-filters">Filtering based on Manifest Elements</a>
+ <ol>
+ <li><a href="#advanced-filters">Advanced manifest filters</a></li>
+ </ol>
+ </li>
+ <li><a href="#other-filters">Other Filters</a></li>
+ <li><a href="#MultiApks">Publishing Multiple APKs with Different Filters</a></li>
+</ol>
+
+<h2>See also</h2>
+ <ol>
+<li><a
+href="{@docRoot}guide/practices/compatibility.html">Android Compatibility</a></li>
+<li><code><a
+href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html"><supports-gl-texture></a></code></li>
+<li><code><a
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><supports-screens></a></code></li>
+<li><code><a
+href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><uses-configuration></a></code></li>
+<li><code><a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature></a></code></li>
+<li><code><a
+href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library></a></code></li>
+<li><code><a
+href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code></li>
+<li><code><a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></code></a></li>
+</ol>
+
+<div id="qv-extra">
+ <img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
+ <div id="qv-sub-rule">
+ <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0 5px;">
+ <h2 style="color:#669999;padding-top:1em;">Interested in publishing your app on Google Play?</h2>
+ <p><a id="publish-link"
+href="http://play.google.com/apps/publish">Go to Google Play</a> to create a publisher
+account and upload your app.</p></div>
+</div>
+
+</div>
+</div>
+
+
+<p>When a user searches or browses on Google Play on an Android device, the results are filtered
+based on which applications are compatible with that device. For example, if an application
+requires a camera (as specified in the application manifest file), then Google Play will not show
+the app on any device that does not have a camera.</p>
+
+<p>Declarations in the manifest file that are compared to the device's configuration is not the
+only part of how applications are filtered. Filtering might also occur due to the user's country and
+carrier, the presence or absence of a SIM card, and other factors. </p>
+
+<p>Changes to the Google Play filters are independent of changes to the Android platform itself.
+This document is updated periodically to reflect any changes that affect the way Google Play
+filters applications.</p>
+
+
+<h2 id="how-filters-work">How Filters Work on Google Play</h2>
+
+<p>Google Play uses the filter restrictions described below to determine
+whether to show your application to a user who is browsing or searching for
+applications from the Google Play app. When determining whether to display your app,
+Google Play checks the device's hardware and software configuration, as well as it's
+carrier, location, and other characteristics. It then compares those against the
+restrictions and dependencies expressed by the application's
+manifest file and publishing details. If the application is
+compatible with the device according to the filter rules, Google Play displays the
+application to the user. Otherwise, Google Play hides your application from search
+results and category browsing, even if a user specifically requests
+the app by clicking a deep link that points directly to the app's ID within Google Play..</p>
+
+<p class="note"><strong>Note:</strong> When users browse the <a
+href="http://play.google.com/apps">Google Play web site</a>, they can see all published
+applications. The Google Play web site compares the application requirements to each of the
+user's registered devices for compatibility, though, and only allows them to install the application
+if it's compatible with their device.</p>
+
+<p>You can use any combination of the available filters for your app. For example, you can set a
+<code>minSdkVersion</code> requirement of <code>"4"</code> and set <code>smallScreens="false"</code>
+in the app, then when uploading the app to Google Play you could target European countries (carriers)
+only. Google Play's filters will thus prevent the application from being available on any device
+that does not match all three of these requirements. </p>
+
+<p>All filtering restrictions are associated with an application's version and can
+change between versions. For example, if a user has installed your application and you publish an
+update that makes the app invisible to the user, the user will not see that an update is
+available.</p>
+
+
+<h2 id="manifest-filters">Filtering based on Manifest Elements</h2>
+
+<p>Most filters are triggered by elements within an application's
+manifest file, <a
+href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>
+(although not everything in the manifest file can trigger filtering).
+Table 1 lists the manifest elements that you should use to trigger
+filtering, and explains how the filtering for each element works.</p>
+
+<p id="table1" class="table-caption"><strong>Table 1.</strong> Manifest elements that
+trigger filtering on Google Play.</p>
+<table>
+ <tr>
+ <th>Manifest Element</th>
+ <th>Filter Name</th>
+ <th>How It Works</th>
+ </tr>
+ <tr>
+ <td valign="top" style="white-space:nowrap;"><code><a href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><supports-screens></a></code>
+ <!-- ##api level 4## --></td>
+ <td valign="top">Screen Size</td>
+ <td valign="top">
+
+<p>An application indicates the screen sizes that it is capable of supporting by
+setting attributes of the <code><supports-screens></code> element. When
+the application is published, Google Play uses those attributes to determine whether
+to show the application to users, based on the screen sizes of their
+devices. </p>
+
+<p>As a general rule, Google Play assumes that the platform on the device can adapt
+smaller layouts to larger screens, but cannot adapt larger layouts to smaller
+screens. Thus, if an application declares support for "normal" screen size only,
+Google Play makes the application available to both normal- and large-screen devices,
+but filters the application so that it is not available to small-screen
+devices.</p>
+
+<p>If an application does not declare attributes for
+<code><supports-screens></code>, Google Play uses the default values for those
+attributes, which vary by API Level. Specifically: </p>
+
+<ul>
+<li><p>For applications that set either the <code><a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">android:
+minSdkVersion</a></code> or <code><a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">android:
+targetSdkVersion</a></code> to 3 or lower, the <code><supports-screens></code> element itself
+is undefined and no attributes are available. In this case, Google Play assumes that
+the application is designed for normal-size screens and shows the application to
+devices that have normal or larger screens. </p>
+
+<li>When the either the <code><a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">android:
+minSdkVersion</a></code> or <code><a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">android:
+targetSdkVersion</a></code> is set to 4 or higher, the default for all attributes is
+<code>"true"</code>. In this way, the application is considered to support all screen sizes by
+default.</li>
+</ul>
+
+ <p><strong>Example 1</strong><br />
+ The manifest declares <code><uses-sdk android:minSdkVersion="3"></code>
+ and does not include a <code><supports-screens></code> element.
+ <strong>Result</strong>: Google Play will not show the app to a user of a
+ small-screen device, but will show it to users of normal and large-screen
+ devices, unless other filters apply. </p>
+ <p><strong>Example 2<br />
+ </strong>The manifest declares <code><uses-sdk android:minSdkVersion="3"
+ android:targetSdkVersion="4"></code> and does not include a
+ <code><supports-screens></code> element.
+ <strong>Result</strong>: Google Play will show the app to users on all
+ devices, unless other filters apply. </p>
+ <p><strong>Example 3<br />
+ </strong>The manifest declares <code><uses-sdk android:minSdkVersion="4"></code>
+ and does not include a <code><supports-screens></code> element.
+ <strong>Result</strong>: Google Play will show the app to all users,
+ unless other filters apply. </p>
+ <p>For more information on how to declare support for screen sizes in your
+ application, see <code><a
+ href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><supports-screens></a></code>
+ and <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
+ Screens</a>.</p>
+</td>
+ </tr>
+
+ <tr>
+ <td valign="top" style="white-space:nowrap;"><code><a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><uses-configuration></a></code>
+ <!-- ##api level 3## --></td>
+ <td valign="top">Device
+ Configuration: <br />
+ keyboard, navigation, touch screen</td>
+ <td valign="top"><p>An application can
+ request certain hardware features, and Google Play will show the app only on devices that have the required hardware.</p>
+ <p><strong>Example 1<br />
+ </strong>The manifest includes <code><uses-configuration android:reqFiveWayNav="true" /></code>, and a user is searching for apps on a device that does not have a five-way navigational control. <strong>Result</strong>: Google Play will not show the app to the user. </p>
+ <p><strong>Example 2<br />
+ </strong>The manifest does not include a <code><uses-configuration></code> element. <strong>Result</strong>: Google Play will show the app to all users, unless other filters apply.</p>
+<p>For more details, see <a
+href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><code><uses-configuration></code></a>.</p></td>
+ </tr>
+
+ <tr>
+ <td rowspan="2" valign="top" style="white-space:nowrap;"><code><a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature></a>
+</code>
+ <!-- ##api level 4## --></td>
+ <td valign="top">Device Features<br />
+ (<code>name</code>)</td>
+ <td valign="top"><p>An application can require certain device features to be
+present on the device. This functionality was introduced in Android 2.0 (API
+Level 5).</p>
+ <p><strong>Example 1<br />
+ </strong>The manifest includes <code><uses-feature
+android:name="android.hardware.sensor.light" /></code>, and a user
+is searching for apps on a device that does not have a light sensor.
+<strong>Result</strong>: Google Play will not show the app to the user. </p>
+ <p><strong>Example 2<br />
+ </strong>The manifest does not include a <code><uses-feature></code>
+element. <strong>Result</strong>: Google Play will show the app to all users,
+unless other filters apply.</p>
+ <p>For complete information, see <code><a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature></a>
+</code>.</p>
+ <p><em>Filtering based on implied features:</em> In some cases, Google
+Play interprets permissions requested through
+<code><uses-permission></code> elements as feature requirements equivalent
+to those declared in <code><uses-feature></code> elements. See <a
+href="#uses-permission-filtering"><code><uses-permission></code></a>,
+below.</p>
+</td>
+ </tr>
+
+ <tr>
+ <td valign="top">OpenGL-ES
+ Version<br />
+(<code>openGlEsVersion</code>)</td>
+ <td valign="top"><p>An application can require that the device support a specific
+ OpenGL-ES version using the <code><uses-feature
+ android:openGlEsVersion="int"></code> attribute.</p>
+ <p><strong>Example 1<br />
+ </strong>An app
+ requests multiple OpenGL-ES versions by specifying <code>openGlEsVersion</code> multiple times in the
+ manifest. <strong>Result</strong>: Google Play assumes that the app requires the highest of the indicated versions.</p>
+<p><strong>Example 2<br />
+</strong>An app
+ requests OpenGL-ES version 1.1, and a user is searching for apps on a device that supports OpenGL-ES version 2.0. <strong>Result</strong>: Google Play will show the app to the user, unless other filters apply. If a
+ device reports that it supports OpenGL-ES version <em>X</em>, Google Play assumes that it
+ also supports any version earlier than <em>X</em>.
+</p>
+<p><strong>Example 3<br />
+</strong>A user is searching for apps on a device that does not
+ report an OpenGL-ES version (for example, a device running Android 1.5 or earlier). <strong>Result</strong>: Google Play assumes that the device
+ supports only OpenGL-ES 1.0. Google Play will only show the user apps that do not specify <code>openGlEsVersion</code>, or apps that do not specify an OpenGL-ES version higher than 1.0. </p>
+ <p><strong>Example 4<br />
+ </strong>The manifest does not specify <code>openGlEsVersion</code>. <strong>Result</strong>: Google Play will show the app to all users, unless other filters apply. </p>
+<p>For more details, see <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></code></a>.</p></td>
+ </tr>
+
+ <tr>
+ <td valign="top" style="white-space:nowrap;"><code><a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library></a></code></td>
+ <td valign="top">Software Libraries</td>
+ <td valign="top"><p>An application can require specific
+ shared libraries to be present on the device. </p>
+ <p><strong>Example 1<br />
+ </strong>An app requires the <code>com.google.android.maps</code> library, and a user is searching for apps on a device that does not have the <code>com.google.android.maps</code> library. <strong>Result</strong>: Google Play will not show the app to the user. </p>
+ <p><strong>Example 2</strong><br />
+ The manifest does not include a <code><uses-library></code> element. <strong>Result</strong>: Google Play will show the app to all users, unless other filters apply.</p>
+<p>For more details, see <a
+href="{@docRoot}guide/topics/manifest/uses-library-element.html"><code><uses-library></code></a>.</p></td>
+ </tr>
+ <tr id="uses-permission-filtering">
+ <td valign="top" style="white-space:nowrap;"><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code></td>
+ <td valign="top"> </td>
+ <td valign="top">Strictly, Google Play does not filter based on
+<code><uses-permission></code> elements. However, it does read the
+elements to determine whether the application has hardware feature requirements
+that may not have been properly declared in <code><uses-feature></code>
+elements. For example, if an application requests the <code>CAMERA</code>
+permission but does not declare a <code><uses-feature></code> element for
+<code>android.hardware.camera</code>, Google Play considers that the
+application requires a camera and should not be shown to users whose devices do
+not offer a camera.</p>
+ <p>In general, if an application requests hardware-related permissions,
+Google Play assumes that the application requires the underlying hardware
+features, even though there might be no corresponding to
+<code><uses-feature></code> declarations. Google Play then sets up
+filtering based on the features implied by the <code><uses-feature></code>
+declarations.</p>
+ <p>For a list of permissions that imply hardware features, see
+the documentation for the <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html#permissions-features"><code><uses-feature></code></a>
+element.</p>
+</td>
+ </tr>
+
+ <tr>
+ <td rowspan="2" valign="top" style="white-space:nowrap;"><code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a></code></td>
+ <td valign="top">Minimum Framework Version (<code>minSdkVersion</code>)</td>
+ <td valign="top"><p>An application can require a minimum API level. </p>
+ <p><strong>Example 1</strong><br />
+ The manifest includes <code><uses-sdk
+ android:minSdkVersion="3"></code>, and the app uses APIs that were introduced in API Level 3. A user is searching for apps on a device that has API Level 2. <strong>Result</strong>: Google Play will not show the app to the user. </p>
+ <p><strong>Example 2</strong><br />
+ The manifest does not include <code>minSdkVersion</code>, and the app uses APIs that were introduced in API Level 3. A user is searching for apps on a device that has API Level 2. <strong>Result</strong>: Google Play assumes that <code>minSdkVersion</code> is "1" and that the app is compatible with all versions of Android. Google Play shows the app to the user and allows the user to download the app. The app crashes at runtime. </p>
+ <p>Because you want to avoid this second scenario, we recommend that you always declare a <code>minSdkVersion</code>. For details, see <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min"><code>android:minSdkVersion</code></a>.</p></td>
+ </tr>
+ <tr>
+ <td valign="top">Maximum Framework Version (<code>maxSdkVersion</code>)</td>
+ <td valign="top"><p><em>Deprecated.</em> Android
+ 2.1 and later do not check or enforce the <code>maxSdkVersion</code> attribute, and
+ the SDK will not compile if <code>maxSdkVersion</code> is set in an app's manifest. For devices already
+ compiled with <code>maxSdkVersion</code>, Google Play will respect it and use it for
+ filtering.</p>
+<p> Declaring <code>maxSdkVersion</code> is <em>not</em> recommended. For details, see <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#max"><code>android:maxSdkVersion</code></a>.</p></td>
+ </tr>
+</table>
+
+
+
+<h3 id="advanced-filters">Advanced manifest filters</h3>
+
+<p>In addition to the manifest elements in <a href="#table1">table 1</a>, Google Play can also
+filter applications based on the advanced manifest elements in table 2.</p>
+
+<p>These manifest elements and the filtering they trigger are for exceptional use-cases
+only. These are designed for certain types of high-performance games and similar applications that
+require strict controls on application distribution. <strong>Most applications should never use
+these filters</strong>.</p>
+
+<p id="table2" class="table-caption"><strong>Table 2.</strong> Advanced manifest elements for
+Google Play filtering.</p>
+<table>
+ <tr><th>Manifest Element</th><th>Summary</th></tr>
+ <tr>
+ <td><nobr><a href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
+<compatible-screens>}</a></nobr></td>
+ <td>
+ <p>Google Play filters the application if the device screen size and density does not match
+any of the screen configurations (declared by a {@code <screen>} element) in the {@code
+<compatible-screens>} element.</p>
+ <p class="caution"><strong>Caution:</strong> Normally, <strong>you should not use
+this manifest element</strong>. Using this element can dramatically
+reduce the potential user base for your application, by excluding all combinations of screen size
+and density that you have not listed. You should instead use the <a
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
+<supports-screens>}</a> manifest element (described above in <a href="#table1">table
+1</a>) to enable screen compatibility mode for screen configurations you have not accounted for
+with alternative resources.</p>
+ </td>
+ </tr>
+ <tr>
+ <td><nobr><a href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html">{@code
+<supports-gl-texture>}</a></nobr></td>
+ <td>
+ <p>Google Play filters the application unless one or more of the GL texture compression
+formats supported by the application are also supported by the device. </p>
+ </td>
+ </tr>
+</table>
+
+
+
+<h2 id="other-filters">Other Filters</h2>
+
+<p>Google Play uses other application characteristics to determine whether to show or hide an application for a particular user on a given device, as described in the table below. </p>
+
+<p id="table3" class="table-caption"><strong>Table 3.</strong> Application and publishing
+characteristics that affect filtering on Google Play.</p>
+<table> <tr>
+ <th>Filter Name</th> <th>How It Works</th> </tr>
+
+ <tr>
+ <td valign="top">Publishing Status</td> <td valign="top"><p>Only published applications will appear in
+ searches and browsing within Google Play.</p> <p>Even if an app is unpublished, it can
+ be installed if users can see it in their Downloads area among their purchased,
+ installed, or recently uninstalled apps.</p> <p>If an application has been
+ suspended, users will not be able to reinstall or update it, even if it appears in their Downloads.</p> </td></tr>
+ <tr>
+ <td valign="top">Priced
+ Status</td> <td valign="top"><p>Not all users can see paid apps. To show paid apps, a device
+must have a SIM card and be running Android 1.1 or later, and it must be in a
+country (as determined by SIM carrier) in which paid apps are available.</p></td>
+</tr> <tr>
+ <td valign="top">Country / Carrier Targeting</td> <td valign="top"> <p>When you upload your app to
+ Google Play, you can select specific countries to target. The app will only
+ be visible to the countries (carriers) that you select, as follows:</p>
+ <ul><li><p>A device's country is determined based on the carrier, if a carrier is
+ available. If no carrier can be determined, Google Play tries to
+ determine the country based on IP.</p></li> <li><p>Carrier is determined based on
+ the device's SIM (for GSM devices), not the current roaming carrier.</p></li></ul>
+</td> </tr> <tr>
+ <td valign="top">Native Platform</td> <td valign="top"><p>An application that includes native
+ libraries that target a specific platform (ARM EABI v7 or x86, for example) are
+ visible only on devices that support that platform. For details about the NDK and using
+ native libraries, see <a href="{@docRoot}tools/sdk/ndk/index.html#overview">What is the
+ Android NDK?</a></p> </tr> <tr>
+ <td valign="top">Copy-Protected Applications</td> <td valign="top"><p>To
+ copy protect an application, set copy protection to "On" when you configure publishing
+options for your application. Google Play will not show copy-protected applications on
+developer devices or unreleased devices.</p></td> </tr> </table>
+
+
+
+<h2 id="MultiApks">Publishing Multiple APKs with Different Filters</h2>
+
+<p>Some specific Google Play filters allow you to publish multiple APKs for the same
+application in order to provide a different APK to different device configurations. For example, if
+you're creating a video game that uses high-fidelity graphic assets, you might want to create
+two APKs that each support different texture compression formats. This way, you can reduce the
+size of the APK file by including only the textures that are required for each device
+configuration. Depending on each device's support for your texture compression formats, Google
+Play will deliver it the APK that you've declared to support that device.</p>
+
+<p>Currently, Google Play allows you to publish multiple APKs for the same application only
+when each APK provides different filters based on the following configurations:</p>
+<ul>
+ <li>OpenGL texture compression formats
+ <p>By using the <a
+href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html">{@code
+<supports-gl-texture>}</a> element.</p>
+ </li>
+ <li>Screen size (and, optionally, screen density)
+ <p>By using the <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
+<supports-screens>}</a> or <a
+href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
+<compatible-screens>}</a> element.</p>
+ </li>
+ <li>API level
+ <p>By using the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code
+<uses-sdk>}</a> element.</p>
+ </li>
+</ul>
+
+<p>All other filters still work the same as usual, but these three are the only filters that can
+distinguish one APK from another within the same application listing on Google Play. For example,
+you <em>cannot</em> publish multiple APKs for the same application if the APKs differ only based on
+whether the device has a camera.</p>
+
+<p class="caution"><strong>Caution:</strong> Publishing multiple APKs for the same application is
+considered an advanced feature and <strong>most application should publish only one
+APK that supports a wide range of device configurations</strong>. Publishing multiple APKs
+requires that you follow specific rules within your filters and that you pay extra attention to the
+version codes for each APK to ensure proper update paths for each configuration.</p>
+
+<p>If you need more information about how to publish multiple APKs on Google Play, read <a
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html">Multiple APK Support</a>.</p>
diff --git a/docs/html/guide/google/play/index.jd b/docs/html/guide/google/play/index.jd
new file mode 100644
index 0000000..b11bcdc
--- /dev/null
+++ b/docs/html/guide/google/play/index.jd
@@ -0,0 +1,16 @@
+page.title=Google Play APIs
+page.landing=1
+page.landing.intro=When you ditribute your Android app using Google Play you have the opportunity to enhance your app's capabilities with services such as in-app billing and control your app distribution with advanced device filtering.
+@jd:body
+
+
+<div class="distribute-features col-13">
+ <ul>
+ <li><h5>Monetize with in-app billing</h5>Lorem ipsum dolor sit amet, soldum
+consectetur adipiscing elit. <a href="#">Learn more »</a></li>
+ <li><h5>Control your app distribution</h5>Lorem ipsum dolor sit amet, soldum consectetur
+adipiscing elit. <a href="#">Learn more »</a></li>
+ <li class="last"><h5>Protect from piracy</h5>Lorem ipsum dolor sit amet, soldum
+consectetur adipiscing elit. <a href="#">Learn more »</a></li>
+ </ul>
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/google/play/licensing/adding-licensing.jd b/docs/html/guide/google/play/licensing/adding-licensing.jd
new file mode 100644
index 0000000..49375c2
--- /dev/null
+++ b/docs/html/guide/google/play/licensing/adding-licensing.jd
@@ -0,0 +1,1071 @@
+page.title=Adding Licensing to Your App
+parent.title=Application Licensing
+parent.link=index.html
+@jd:body
+
+
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#manifest-permission">Adding the Licensing Permission</a></li>
+ <li><a href="#impl-Policy">Implementing a Policy</a>
+ <ol>
+ <li><a href="#custom-policies">Guidelines for custom policies</a></li>
+ <li><a href="#ServerManagedPolicy">ServerManagedPolicy</a></li>
+ <li><a href="#StrictPolicy">StrictPolicy</a></li>
+ </ol>
+ </li>
+ <li><a href="#impl-Obfuscator">Implementing an Obfuscator</a>
+ <ol>
+ <li><a href="#AESObfuscator">AESObfuscator</a></li>
+ </ol>
+ </li>
+ <li><a href="#impl-lc">Checking the License from an Activity</a>
+ <ol>
+ <li><a href="#lc-overview">Overview of license check and response</a></li>
+ <li><a href="#imports">Add imports</a></li>
+ <li><a href="#lc-impl">Implement LicenseCheckerCallback as a private inner class</a></li>
+ <li><a href="#thread-handler">Create a Handler for posting from LicenseCheckerCallback
+to the UI thread</a></li>
+ <li><a href="#lc-lcc">Instantiate LicenseChecker and LicenseCheckerCallback</a></li>
+ <li><a href="#check-access">Call checkAccess() to initiate the license check</a></li>
+ <li><a href="#account-key">Embed your public key for licensing</a></li>
+ <li><a href="#handler-cleanup">Call your LicenseChecker's onDestroy() method
+to close IPC connections</a></li>
+ </ol>
+ </li>
+ <li><a href="#impl-DeviceLimiter">Implementing a DeviceLimiter</a></li>
+ <li><a href="#app-obfuscation">Obfuscating Your Code</a></li>
+ <li><a href="#app-publishing">Publishing a Licensed Application</a>
+ <ol>
+ <li><a href="#">Removing Copy Protection</a></li>
+ </ol>
+ </li>
+ <li><a href="#support">Where to Get Support</a></li>
+</ol>
+
+</div>
+</div>
+
+
+
+<p>After you've set up a publisher account and development environment (see <a
+href="setting-up.html">Setting Up for Licensing</a>), you are ready to add license verification to
+your app with the License Verification Library (LVL).</p>
+
+<p>Adding license verification with the LVL involves these tasks:</p>
+
+<ol>
+<li><a href="#manifest-permission">Adding the licensing permission</a> your application's manifest.</li>
+<li><a href="#impl-Policy">Implementing a Policy</a> — you can choose one of the full implementations provided in the LVL or create your own.</li>
+<li><a href="#impl-Obfuscator">Implementing an Obfuscator</a>, if your {@code Policy} will cache any
+license response data. </li>
+<li><a href="#impl-lc">Adding code to check the license</a> in your application's main
+Activity.</li>
+<li><a href="#impl-DeviceLimiter">Implementing a DeviceLimiter</a> (optional and not recommended for
+most applications).</li>
+</ol>
+
+<p>The sections below describe these tasks. When you are done with the
+integration, you should be able to compile your application successfully and you
+can begin testing, as described in <a
+href="{@docRoot}guide/google/play/licensing/setting-up.html#test-env">Setting Up the Test
+Environment</a>.</p>
+
+<p>For an overview of the full set of source files included in the LVL, see <a
+href="{@docRoot}guide/google/play/licensing/licensing-reference.html#lvl-summary">Summary of LVL Classes
+and Interfaces</a>.</p>
+
+
+<h2 id="manifest-permission">Adding the Licensing Permission</h2>
+
+<p>To use the Google Play application for sending a license check to the
+server, your application must request the proper permission,
+<code>com.android.vending.CHECK_LICENSE</code>. If your application does
+not declare the licensing permission but attempts to initiate a license check,
+the LVL throws a security exception.</p>
+
+<p>To request the licensing permission in your application, declare a <a
+href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><code><uses-permission></code></a>
+element as a child of <code><manifest></code>, as follows: </p>
+
+<p style="margin-left:2em;"><code><uses-permission
+android:name="com.android.vending.CHECK_LICENSE"></code></p>
+
+<p>For example, here's how the LVL sample application declares the permission:
+</p>
+
+<pre><?xml version="1.0" encoding="utf-8"?>
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" ...">
+ <!-- Devices >= 3 have version of Google Play that supports licensing. -->
+ <uses-sdk android:minSdkVersion="3" />
+ <!-- Required permission to check licensing. -->
+ <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
+ ...
+</manifest>
+</pre>
+
+<p class="note"><strong>Note:</strong> Currently, you cannot declare the
+<code>CHECK_LICENSE</code> permission in the LVL library project's manifest,
+because the SDK Tools will not merge it into the manifests of dependent
+applications. Instead, you must declare the permission in each dependent
+application's manifest. </p>
+
+
+<h2 id="impl-Policy">Implementing a Policy</h2>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>ServerManagedPolicy</h2>
+
+<p>The LVL includes a complete {@code Policy} implementation called ServerManagedPolicy
+that makes use of license-management settings provided by the Google Play
+server. </p>
+
+<p style="margin-top:.5em;">Use of ServerManagedPolicy as the basis for your
+Policy is strongly recommended. For more information, see <a
+href="#ServerManagedPolicy">ServerManagedPolicy</a> section, below.</p>
+
+</div>
+</div>
+
+<p>Google Play licensing service does not itself determine whether a
+given user with a given license should be granted access to your application.
+Rather, that responsibility is left to a {@code Policy} implementation that you provide
+in your application.</p>
+
+<p>Policy is an interface declared by the LVL that is designed to hold your
+application's logic for allowing or disallowing user access, based on the result
+of a license check. To use the LVL, your application <em>must</em> provide an
+implementation of {@code Policy}. </p>
+
+<p>The {@code Policy} interface declares two methods, <code>allowAccess()</code> and
+<code>processServerResponse()</code>, which are called by a {@code LicenseChecker}
+instance when processing a response from the license server. It also declares an
+enum called <code>LicenseResponse</code>, which specifies the license response
+value passed in calls to <code>processServerResponse()</code>. </p>
+
+<ul>
+<li><code>processServerResponse()</code> lets you preprocess the raw response
+data received from the licensing server, prior to determining whether to grant
+access.
+
+<p>A typical implementation would extract some or all fields from the license
+response and store the data locally to a persistent store, such as through
+{@link android.content.SharedPreferences} storage, to ensure that the data is
+accessible across application invocations and device power cycles. For example,
+a {@code Policy} would maintain the timestamp of the last successful license check, the
+retry count, the license validity period, and similar information in a
+persistent store, rather than resetting the values each time the application is
+launched.</p>
+
+<p>When storing response data locally, the {@code Policy} must ensure that the data is
+obfuscated (see <a href="#impl-Obfuscator">Implementing an Obfuscator</a>,
+below).</p></li>
+
+<li><code>allowAccess()</code> determines whether to grant the user access to
+your application, based on any available license response data (from the
+licensing server or from cache) or other application-specific information. For
+example, your implementation of <code>allowAccess()</code> could take into
+account additional criteria, such as usage or other data retrieved from a
+backend server. In all cases, an implementation of <code>allowAccess()</code>
+should only return <code>true</code> if the user is licensed to use the
+application, as determined by the licensing server, or if there is a transient
+network or system problem that prevents the license check from completing. In
+such cases, your implementation can maintain a count of retry responses and
+provisionally allow access until the next license check is complete.</li>
+
+</ul>
+
+<p>To simplify the process of adding licensing to your application and to
+provide an illustration of how a {@code Policy} should be designed, the LVL includes
+two full {@code Policy} implementations that you can use without modification or
+adapt to your needs:</p>
+
+<ul>
+<li><a href="#ServerManagedPolicy">ServerManagedPolicy</a>, a flexible {@code Policy}
+that uses server-provided settings and cached responses to manage access across
+varied network conditions, and</li>
+<li><a href="#StrictPolicy">StrictPolicy</a>, which does not cache any response
+data and allows access <em>only</em> if the server returns a licensed
+response.</li>
+</ul>
+
+<p>For most applications, the use of ServerManagedPolicy is highly
+recommended. ServerManagedPolicy is the LVL default and is integrated with
+the LVL sample application.</p>
+
+
+<h3 id="custom-policies">Guidelines for custom policies</h3>
+
+<p>In your licensing implementation, you can use one of the complete policies
+provided in the LVL (ServerManagedPolicy or StrictPolicy) or you can create a
+custom policy. For any type of custom policy, there are several important design
+points to understand and account for in your implementation.</p>
+
+<p>The licensing server applies general request limits to guard against overuse
+of resources that could result in denial of service. When an application exceeds
+the request limit, the licensing server returns a 503 response, which gets
+passed through to your application as a general server error. This means that no
+license response will be available to the user until the limit is reset, which
+can affect the user for an indefinite period.</p>
+
+<p>If you are designing a custom policy, we recommend that the {@code Policy}:
+<ol>
+<!-- <li>Limits the number of points at which your app calls for a license check
+to the minimum. </li> -->
+<li>Caches (and properly obfuscates) the most recent successful license response
+in local persistent storage.</li>
+<li>Returns the cached response for all license checks, for as long as the
+cached response is valid, rather than making a request to the licensing server.
+Setting the response validity according to the server-provided <code>VT</code>
+extra is highly recommended. See <a
+href="{@docRoot}guide/google/play/licensing/licensing-reference.html#extras">Server Response Extras</a>
+for more information.</li>
+<li>Uses an exponential backoff period, if retrying any requests the result in
+errors. Note that the Google Play client automatically retries failed
+requests, so in most cases there is no need for your {@code Policy} to retry them.</li>
+<li>Provides for a "grace period" that allows the user to access your
+application for a limited time or number of uses, while a license check is being
+retried. The grace period benefits the user by allowing access until the next
+license check can be completed successfully and it benefits you by placing a
+hard limit on access to your application when there is no valid license response
+available.</li>
+</ol>
+
+<p>Designing your {@code Policy} according to the guidelines listed above is critical,
+because it ensures the best possible experience for users while giving you
+effective control over your application even in error conditions. </p>
+
+<p>Note that any {@code Policy} can use settings provided by the licensing server to
+help manage validity and caching, retry grace period, and more. Extracting the
+server-provided settings is straightforward and making use of them is highly
+recommended. See the ServerManagedPolicy implementation for an example of how to
+extract and use the extras. For a list of server settings and information about
+how to use them, see <a
+href="{@docRoot}guide/google/play/licensing/licensing-reference.html#extras">Server Response
+Extras</a>.</p>
+
+<h3 id="ServerManagedPolicy">ServerManagedPolicy</h3>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>Server Response Extras</h2>
+
+<p>For certain types of licensing responses, the licensing server appends extra
+settings to the responses, to help the application manage licensing effectively.
+</p>
+
+<p style="margin-top:.5em;">See <a
+href="{@docRoot}guide/google/play/licensing/licensing-reference.html#extras">Server Response Extras</a>
+for
+a list of settings and <code>ServerManagedPolicy.java</code> for information
+about how a {@code Policy} can use the extras.</p>
+
+</div>
+</div>
+
+<p>The LVL includes a full and recommended implementation of the {@code Policy}
+interface called ServerManagedPolicy. The implementation is integrated with the
+LVL classes and serves as the default {@code Policy} in the library. </p>
+
+<p>ServerManagedPolicy provides all of the handling for license and retry
+responses. It caches all of the response data locally in a
+{@link android.content.SharedPreferences} file, obfuscating it with the
+application's {@code Obfuscator} implementation. This ensures that the license response
+data is secure and persists across device power cycles. ServerManagedPolicy
+provides concrete implementations of the interface methods
+<code>processServerResponse()</code> and <code>allowAccess()</code> and also
+includes a set of supporting methods and types for managing license
+responses.</p>
+
+<p>Importantly, a key feature of ServerMangedPolicy is its use of
+server-provided settings as the basis for managing licensing across an
+application's refund period and through varying network and error conditions.
+When an application contacts the Google Play server for a license check, the
+server appends several settings as key-value pairs in the extras field of certain
+license response types. For example, the server provides recommended values for the
+application's license validity period, retry grace period, and maximum allowable
+retry count, among others. ServerManagedPolicy extracts the values from the
+license response in its <code>processServerResponse()</code> method and checks
+them in its <code>allowAccess()</code> method. For a list of the server-provided
+settings used by ServerManagedPolicy, see <a
+href="{@docRoot}guide/google/play/licensing/licensing-reference.html#extras">Server Response
+Extras</a>.</p>
+
+<p>For convenience, best performance, and the benefit of using license settings
+from the Google Play server, <strong>using ServerManagedPolicy as your
+licensing {@code Policy} is strongly recommended</strong>. </p>
+
+<p>If you are concerned about the security of license response data that is
+stored locally in {@link android.content.SharedPreferences}, you can use a stronger obfuscation
+algorithm or design a stricter {@code Policy} that does not store license data. The LVL
+includes an example of such a {@code Policy} — see <a
+href="#StrictPolicy">StrictPolicy</a> for more information.</p>
+
+<p>To use ServerManagedPolicy, simply import it to your Activity, create an
+instance, and pass a reference to the instance when constructing your
+{@code LicenseChecker}. See <a href="#lc-lcc">Instantiate LicenseChecker and
+LicenseCheckerCallback</a> for more information. </p>
+
+<h3 id="StrictPolicy">StrictPolicy</h3>
+
+<p>The LVL includes an alternative full implementation of the {@code Policy} interface
+called StrictPolicy. The StrictPolicy implementation provides a more restrictive
+Policy than ServerManagedPolicy, in that it does not allow the user to access
+the application unless a license response is received from the server at the
+time of access that indicates that the user is licensed.</p>
+
+<p>The principal feature of StrictPolicy is that it does not store <em>any</em>
+license response data locally, in a persistent store. Because no data is stored,
+retry requests are not tracked and cached responses can not be used to fulfill
+license checks. The {@code Policy} allows access only if:</p>
+
+<ul>
+<li>The license response is received from the licensing server, and </li>
+<li>The license response indicates that the user is licensed to access the
+application. </li>
+</ul>
+
+<p>Using StrictPolicy is appropriate if your primary concern is to ensure that,
+in all possible cases, no user will be allowed to access the application unless
+the user is confirmed to be licensed at the time of use. Additionally, the
+Policy offers slightly more security than ServerManagedPolicy — since
+there is no data cached locally, there is no way a malicious user could tamper
+with the cached data and obtain access to the application.</p>
+
+<p>At the same time, this {@code Policy} presents a challenge for normal users, since it
+means that they won't be able to access the application when there is no network
+(cell or Wi-Fi) connection available. Another side-effect is that your
+application will send more license check requests to the server, since using a
+cached response is not possible.</p>
+
+<p>Overall, this policy represents a tradeoff of some degree of user convenience
+for absolute security and control over access. Consider the tradeoff carefully
+before using this {@code Policy}.</p>
+
+<p>To use StrictPolicy, simply import it to your Activity, create an instance,
+and pass a reference to it when constructing your {@code LicenseChecker}. See
+<a href="#lc-lcc">Instantiate LicenseChecker and LicenseCheckerCallback</a>
+for more information. </p>
+
+<h2 id="impl-Obfuscator">Implementing an Obfuscator</h2>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>AESObfuscator</h2>
+
+<p>The LVL includes a full {@code Obfuscator} implementation in the
+<code>AESObfuscator.java</code> file. The {@code Obfuscator} uses AES encryption to
+obfuscate/unobfuscate data. If you are using a {@code Policy} (such as
+ServerManagedPolicy) that caches license response data, using AESObfuscator as
+basis for your {@code Obfuscator} implementation is highly recommended. </p>
+
+</div>
+</div>
+
+<p>A typical {@code Policy} implementation needs to save the license response data for
+an application to a persistent store, so that it is accessible across
+application invocations and device power cycles. For example, a {@code Policy} would
+maintain the timestamp of the last successful license check, the retry count,
+the license validity period, and similar information in a persistent store,
+rather than resetting the values each time the application is launched. The
+default {@code Policy} included in the LVL, ServerManagedPolicy, stores license response
+data in a {@link android.content.SharedPreferences} instance, to ensure that the
+data is persistent. </p>
+
+<p>Because the {@code Policy} will use stored license response data to determine whether
+to allow or disallow access to the application, it <em>must</em> ensure that any
+stored data is secure and cannot be reused or manipulated by a root user on a
+device. Specifically, the {@code Policy} must always obfuscate the data before storing
+it, using a key that is unique for the application and device. Obfuscating using
+a key that is both application-specific and device-specific is critical, because
+it prevents the obfuscated data from being shared among applications and
+devices.</p>
+
+<p>The LVL assists the application with storing its license response data in a
+secure, persistent manner. First, it provides an {@code Obfuscator}
+interface that lets your application supply the obfuscation algorithm of its
+choice for stored data. Building on that, the LVL provides the helper class
+PreferenceObfuscator, which handles most of the work of calling the
+application's {@code Obfuscator} class and reading and writing the obfuscated data in a
+{@link android.content.SharedPreferences} instance. </p>
+
+<p>The LVL provides a full {@code Obfuscator} implementation called
+AESObfuscator that uses AES encryption to obfuscate data. You can
+use AESObfuscator in your application without modification or you
+can adapt it to your needs. For more information, see the next section.</p>
+
+
+<h3 id="AESObfuscator">AESObfuscator</h3>
+
+<p>The LVL includes a full and recommended implementation of the {@code Obfuscator}
+interface called AESObfuscator. The implementation is integrated with the
+LVL sample application and serves as the default {@code Obfuscator} in the library. </p>
+
+<p>AESObfuscator provides secure obfuscation of data by using AES to
+encrypt and decrypt the data as it is written to or read from storage.
+The {@code Obfuscator} seeds the encryption using three data fields provided
+by the application: </p>
+
+<ol>
+<li>A salt — an array of random bytes to use for each (un)obfuscation. </li>
+<li>An application identifier string, typically the package name of the application.</li>
+<li>A device identifier string, derived from as many device-specific sources
+as possible, so as to make it as unique.</li>
+</ol>
+
+<p>To use AESObfuscator, first import it to your Activity. Declare a private
+static final array to hold the salt bytes and initialize it to 20 randomly
+generated bytes.</p>
+
+<pre> ...
+ // Generate 20 random bytes, and put them here.
+ private static final byte[] SALT = new byte[] {
+ -46, 65, 30, -128, -103, -57, 74, -64, 51, 88, -95,
+ -45, 77, -117, -36, -113, -11, 32, -64, 89
+ };
+ ...
+</pre>
+
+<p>Next, declare a variable to hold a device identifier and generate a value for
+it in any way needed. For example, the sample application included in the LVL
+queries the system settings for the
+<code>android.Settings.Secure.ANDROID_ID</code>, which is unique to each device.
+</p>
+
+<p>Note that, depending on the APIs you use, your application might need to
+request additional permissions in order to acquire device-specific information.
+For example, to query the {@link android.telephony.TelephonyManager} to obtain
+the device IMEI or related data, the application will also need to request the
+<code>android.permission.READ_PHONE_STATE</code> permission in its manifest.</p>
+
+<p>Before requesting new permissions for the <em>sole purpose</em> of acquiring
+device-specific information for use in your {@code Obfuscator}, consider
+how doing so might affect your application or its filtering on Google Play
+(since some permissions can cause the SDK build tools to add
+the associated <code><uses-feature></code>).</p>
+
+<p>Finally, construct an instance of AESObfuscator, passing the salt,
+application identifier, and device identifier. You can construct the instance
+directly, while constructing your {@code Policy} and {@code LicenseChecker}. For example:</p>
+
+<pre> ...
+ // Construct the LicenseChecker with a Policy.
+ mChecker = new LicenseChecker(
+ this, new ServerManagedPolicy(this,
+ new AESObfuscator(SALT, getPackageName(), deviceId)),
+ BASE64_PUBLIC_KEY // Your public licensing key.
+ );
+ ...
+</pre>
+
+<p>For a complete example, see MainActivity in the LVL sample application.</p>
+
+
+<h2 id="impl-lc">Checking the License from an Activity</h2>
+
+<p>Once you've implemented a {@code Policy} for managing access to your application, the
+next step is to add a license check to your application, which initiates a query
+to the licensing server if needed and manages access to the application based on
+the license response. All of the work of adding the license check and handling
+the response takes place in your main {@link android.app.Activity} source file.
+</p>
+
+<p>To add the license check and handle the response, you must:</p>
+
+<ol>
+ <li><a href="#imports">Add imports</a></li>
+ <li><a href="#lc-impl">Implement LicenseCheckerCallback</a> as a private inner class</li>
+ <li><a href="#thread-handler">Create a Handler</a> for posting from LicenseCheckerCallback to the UI thread</li>
+ <li><a href="#lc-lcc">Instantiate LicenseChecker</a> and LicenseCheckerCallback</li>
+ <li><a href="#check-access">Call checkAccess()</a> to initiate the license check</li>
+ <li><a href="#account-key">Embed your public key</a> for licensing</li>
+ <li><a href="#handler-cleanup">Call your LicenseChecker's onDestroy() method</a> to close IPC connections.</li>
+</ol>
+
+<p>The sections below describe these tasks. </p>
+
+<h3 id="lc-overview">Overview of license check and response</h3>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>Example: MainActivity</h2>
+
+<p>The sample application included with the LVL provides a full example of how
+to initiate a license check and handle the result, in the
+<code>MainActivity.java</code> file.</p>
+
+</div>
+</div>
+
+<p>In most cases, you should add the license check to your application's main
+{@link android.app.Activity}, in the {@link android.app.Activity#onCreate onCreate()} method. This
+ensures that when the user launches your application directly, the license check
+will be invoked immediately. In some cases, you can add license checks in other
+locations as well. For example, if your application includes multiple Activity
+components that other applications can start by {@link android.content.Intent},
+you could add license checks in those Activities.</p>
+
+<p>A license check consists of two main actions: </p>
+
+<ul>
+<li>A call to a method to initiate the license check — in the LVL, this is
+a call to the <code>checkAccess()</code> method of a {@code LicenseChecker} object that
+you construct.</li>
+<li>A callback that returns the result of the license check. In the LVL, this is
+a <code>LicenseCheckerCallback</code> interface that you implement. The
+interface declares two methods, <code>allow()</code> and
+<code>dontAllow()</code>, which are invoked by the library based on to the
+result of the license check. You implement these two methods with whatever logic
+you need, to allow or disallow the user access to your application. Note that
+these methods do not determine <em>whether</em> to allow access — that
+determination is the responsibility of your {@code Policy} implementation. Rather, these
+methods simply provide the application behaviors for <em>how</em> to allow and
+disallow access (and handle application errors).
+ <p>The <code>allow()</code> and <code>dontAllow()</code> methods do provide a "reason"
+for their response, which can be one of the {@code Policy} values, {@code LICENSED},
+{@code NOT_LICENSED}, or {@code RETRY}. In particular, you should handle the case in which
+the method receives the {@code RETRY} response for {@code dontAllow()} and provide the user with an
+"Retry" button, which might have happened because the service was unavailable during the
+request.</p></li>
+</ul>
+
+<div style="margin-bottom:2em;">
+
+<img src="{@docRoot}images/licensing_flow.png" style="text-align:left;margin-bottom:0;margin-left:3em;" />
+<div style="margin:.5em 0 1.5em 2em;padding:0"><strong>Figure 6.</strong> Overview of a
+typical license check interaction.</div>
+</div>
+
+<p>The diagram above illustrates how a typical license check takes place: </p>
+
+<ol>
+<li>Code in the application's main Activity instantiates {@code LicenseCheckerCallback}
+and {@code LicenseChecker} objects. When constructing {@code LicenseChecker}, the code passes in
+{@link android.content.Context}, a {@code Policy} implementation to use, and the
+publisher account's public key for licensing as parameters. </li>
+<li>The code then calls the <code>checkAccess()</code> method on the
+{@code LicenseChecker} object. The method implementation calls the {@code Policy} to determine
+whether there is a valid license response cached locally, in
+{@link android.content.SharedPreferences}.
+ <ul>
+ <li>If so, the <code>checkAccess()</code> implementation calls
+ <code>allow()</code>.</li>
+ <li>Otherwise, the {@code LicenseChecker} initiates a license check request that is sent
+ to the licensing server.</li>
+ </ul>
+
+<p class="note"><strong>Note:</strong> The licensing server always returns
+<code>LICENSED</code> when you perform a license check of a draft application.</p>
+</li>
+<li>When a response is received, {@code LicenseChecker} creates a LicenseValidator that
+verifies the signed license data and extracts the fields of the response, then
+passes them to your {@code Policy} for further evaluation.
+ <ul>
+ <li>If the license is valid, the {@code Policy} caches the response in
+{@link android.content.SharedPreferences} and notifies the validator, which then calls the
+<code>allow()</code> method on the {@code LicenseCheckerCallback} object. </li>
+ <li>If the license not valid, the {@code Policy} notifies the validator, which calls
+the <code>dontAllow()</code> method on {@code LicenseCheckerCallback}. </li>
+ </ul>
+</li>
+<li>In case of a recoverable local or server error, such as when the network is
+not available to send the request, {@code LicenseChecker} passes a {@code RETRY} response to
+your {@code Policy} object's <code>processServerResponse()</code> method.
+ <p>Also, both the {@code allow()} and {@code dontAllow()} callback methods receive a
+<code>reason</code> argument. The {@code allow()} method's reason is usually {@code
+Policy.LICENSED} or {@code Policy.RETRY} and the {@code dontAllow()} reason is usually {@code
+Policy.NOT_LICENSED} or {@code Policy.RETRY}. These response values are useful so you can show
+an appropriate response for the user, such as by providing a "Retry" button when {@code
+dontAllow()} responds with {@code Policy.RETRY}, which might have been because the service was
+unavailable.</p></li>
+<li>In case of a application error, such as when the application attempts to
+check the license of an invalid package name, {@code LicenseChecker} passes an error
+response to the LicenseCheckerCallback's <code>applicationError()</code>
+method. </li>
+</ol>
+
+<p>Note that, in addition to initiating the license check and handling the
+result, which are described in the sections below, your application also needs
+to provide a <a href="#impl-Policy">Policy implementation</a> and, if the {@code Policy}
+stores response data (such as ServerManagedPolicy), an <a
+href="#impl-Obfuscator">Obfuscator</a> implementation. </p>
+
+
+<h3 id="imports">Add imports</h3>
+
+<p>First, open the class file of the application's main Activity and import
+{@code LicenseChecker} and {@code LicenseCheckerCallback} from the LVL package.</p>
+
+<pre> import com.android.vending.licensing.LicenseChecker;
+ import com.android.vending.licensing.LicenseCheckerCallback;</pre>
+
+<p>If you are using the default {@code Policy} implementation provided with the LVL,
+ServerManagedPolicy, import it also, together with the AESObfuscator. If you are
+using a custom {@code Policy} or {@code Obfuscator}, import those instead. </p>
+
+<pre> import com.android.vending.licensing.ServerManagedPolicy;
+ import com.android.vending.licensing.AESObfuscator;</pre>
+
+<h3 id="lc-impl">Implement LicenseCheckerCallback as a private inner class</h3>
+
+<p>{@code LicenseCheckerCallback} is an interface provided by the LVL for handling
+result of a license check. To support licensing using the LVL, you must
+implement {@code LicenseCheckerCallback} and
+its methods to allow or disallow access to the application.</p>
+
+<p>The result of a license check is always a call to one of the
+{@code LicenseCheckerCallback} methods, made based on the validation of the response
+payload, the server response code itself, and any additional processing provided
+by your {@code Policy}. Your application can implement the methods in any way needed. In
+general, it's best to keep the methods simple, limiting them to managing UI
+state and application access. If you want to add further processing of license
+responses, such as by contacting a backend server or applying custom constraints,
+you should consider incorporating that code into your {@code Policy}, rather than
+putting it in the {@code LicenseCheckerCallback} methods. </p>
+
+<p>In most cases, you should declare your implementation of
+{@code LicenseCheckerCallback} as a private class inside your application's main
+Activity class. </p>
+
+<p>Implement the <code>allow()</code> and <code>dontAllow()</code> methods as
+needed. To start with, you can use simple result-handling behaviors in the
+methods, such as displaying the license result in a dialog. This helps you get
+your application running sooner and can assist with debugging. Later, after you
+have determined the exact behaviors you want, you can add more complex handling.
+</p>
+
+<p>Some suggestions for handling unlicensed responses in
+<code>dontAllow()</code> include: </p>
+
+<ul>
+<li>Display a "Try again" dialog to the user, including a button to initiate a
+new license check if the <code>reason</code> supplied is {@code Policy.RETRY}. </li>
+<li>Display a "Purchase this application" dialog, including a button that
+deep-links the user to the application's details page on Google Play, from which the
+use can purchase the application. For more information on how to set up such
+links, see <a
+href="{@docRoot}distribute/googleplay/promote/linking.html">Linking to Your Products</a>. </li>
+<li>Display a Toast notification that indicates that the features of the
+application are limited because it is not licensed. </li>
+</ul>
+
+<p>The example below shows how the LVL sample application implements
+{@code LicenseCheckerCallback}, with methods that display the license check result in a
+dialog. </p>
+
+<pre>
+private class MyLicenseCheckerCallback implements LicenseCheckerCallback {
+ public void allow(int reason) {
+ if (isFinishing()) {
+ // Don't update UI if Activity is finishing.
+ return;
+ }
+ // Should allow user access.
+ displayResult(getString(R.string.allow));
+ }
+
+ public void dontAllow(int reason) {
+ if (isFinishing()) {
+ // Don't update UI if Activity is finishing.
+ return;
+ }
+ displayResult(getString(R.string.dont_allow));
+
+ if (reason == Policy.RETRY) {
+ // If the reason received from the policy is RETRY, it was probably
+ // due to a loss of connection with the service, so we should give the
+ // user a chance to retry. So show a dialog to retry.
+ showDialog(DIALOG_RETRY);
+ } else {
+ // Otherwise, the user is not licensed to use this app.
+ // Your response should always inform the user that the application
+ // is not licensed, but your behavior at that point can vary. You might
+ // provide the user a limited access version of your app or you can
+ // take them to Google Play to purchase the app.
+ showDialog(DIALOG_GOTOMARKET);
+ }
+ }
+}
+</pre>
+
+<p>Additionally, you should implement the <code>applicationError()</code>
+method, which the LVL calls to let your application handle errors that are not
+retryable. For a list of such errors, see <a
+href="{@docRoot}guide/google/play/licensing/licensing-reference.html#server-response-codes">Server
+Response Codes</a> in the <a
+href="guide/google/play/licensing/licensing-reference.html">Licensing Reference</a>. You can implement
+the method in any way needed. In most cases, the
+method should log the error code and call <code>dontAllow()</code>.</p>
+
+<h3 id="thread-handler">Create a Handler for posting from LicenseCheckerCallback
+to the UI thread</h3>
+
+<p>During a license check, the LVL passes the request to the Google Play
+application, which handles communication with the licensing server. The LVL
+passes the request over asynchronous IPC (using {@link android.os.Binder}) so
+the actual processing and network communication do not take place on a thread
+managed by your application. Similarly, when the Google Play application
+receives the result, it invokes a callback method over IPC, which in turn
+executes in an IPC thread pool in your application's process.</p>
+
+<p>The {@code LicenseChecker} class manages your application's IPC communication with
+the Google Play application, including the call that sends the request and
+the callback that receives the response. {@code LicenseChecker} also tracks open license
+requests and manages their timeouts. </p>
+
+<p>So that it can handle timeouts properly and also process incoming responses
+without affecting your application's UI thread, {@code LicenseChecker} spawns a
+background thread at instantiation. In the thread it does all processing of
+license check results, whether the result is a response received from the server
+or a timeout error. At the conclusion of processing, the LVL calls your
+{@code LicenseCheckerCallback} methods from the background thread. </p>
+
+<p>To your application, this means that:</p>
+
+<ol>
+<li>Your {@code LicenseCheckerCallback} methods will be invoked, in many cases, from a
+background thread.</li>
+<li>Those methods won't be able to update state or invoke any processing in the
+UI thread, unless you create a Handler in the UI thread and have your callback
+methods post to the Handler.</li>
+</ol>
+
+<p>If you want your {@code LicenseCheckerCallback} methods to update the UI thread,
+instantiate a {@link android.os.Handler} in the main Activity's
+{@link android.app.Activity#onCreate(android.os.Bundle) onCreate()} method,
+as shown below. In this example, the LVL sample application's
+{@code LicenseCheckerCallback} methods (see above) call <code>displayResult()</code> to
+update the UI thread through the Handler's
+{@link android.os.Handler#post(java.lang.Runnable) post()} method.</p>
+
+<pre>private Handler mHandler;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ ...
+ mHandler = new Handler();
+ }
+</pre>
+
+<p>Then, in your {@code LicenseCheckerCallback} methods, you can use Handler methods to
+post Runnable or Message objects to the Handler. Here's how the sample
+application included in the LVL posts a Runnable to a Handler in the UI thread
+to display the license status.</p>
+
+<pre> private void displayResult(final String result) {
+ mHandler.post(new Runnable() {
+ public void run() {
+ mStatusText.setText(result);
+ setProgressBarIndeterminateVisibility(false);
+ mCheckLicenseButton.setEnabled(true);
+ }
+ });
+ }
+</pre>
+
+<h3 id="lc-lcc">Instantiate LicenseChecker and LicenseCheckerCallback</h3>
+
+<p>In the main Activity's
+{@link android.app.Activity#onCreate(android.os.Bundle) onCreate()} method,
+create private instances of LicenseCheckerCallback and {@code LicenseChecker}. You must
+instantiate {@code LicenseCheckerCallback} first, because you need to pass a reference
+to that instance when you call the constructor for {@code LicenseChecker}. </p>
+
+<p>When you instantiate {@code LicenseChecker}, you need to pass in these parameters:</p>
+
+<ul>
+<li>The application {@link android.content.Context}</li>
+<li>A reference to the {@code Policy} implementation to use for the license check. In
+most cases, you would use the default {@code Policy} implementation provided by the LVL,
+ServerManagedPolicy. </li>
+<li>The String variable holding your publisher account's public key for
+licensing. </li>
+</ul>
+
+<p>If you are using ServerManagedPolicy, you won't need to access the class
+directly, so you can instantiate it in the {@code LicenseChecker} constructor,
+as shown in the example below. Note that you need to pass a reference to a new
+Obfuscator instance when you construct ServerManagedPolicy.</p>
+
+<p>The example below shows the instantiation of {@code LicenseChecker} and
+{@code LicenseCheckerCallback} from the <code>onCreate()</code> method of an Activity
+class. </p>
+
+<pre>public class MainActivity extends Activity {
+ ...
+ private LicenseCheckerCallback mLicenseCheckerCallback;
+ private LicenseChecker mChecker;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ ...
+ // Construct the LicenseCheckerCallback. The library calls this when done.
+ mLicenseCheckerCallback = new MyLicenseCheckerCallback();
+
+ // Construct the LicenseChecker with a Policy.
+ mChecker = new LicenseChecker(
+ this, new ServerManagedPolicy(this,
+ new AESObfuscator(SALT, getPackageName(), deviceId)),
+ BASE64_PUBLIC_KEY // Your public licensing key.
+ );
+ ...
+ }
+}
+</pre>
+
+
+<p>Note that {@code LicenseChecker} calls the {@code LicenseCheckerCallback} methods from the UI
+thread <em>only</em> if there is valid license response cached locally. If the
+license check is sent to the server, the callbacks always originate from the
+background thread, even for network errors. </p>
+
+
+<h3 id="check-access">Call checkAccess() to initiate the license check</h3>
+
+<p>In your main Activity, add a call to the <code>checkAccess()</code> method of the
+{@code LicenseChecker} instance. In the call, pass a reference to your
+{@code LicenseCheckerCallback} instance as a parameter. If you need to handle any
+special UI effects or state management before the call, you might find it useful
+to call <code>checkAccess()</code> from a wrapper method. For example, the LVL
+sample application calls <code>checkAccess()</code> from a
+<code>doCheck()</code> wrapper method:</p>
+
+<pre> @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ ...
+ // Call a wrapper method that initiates the license check
+ doCheck();
+ ...
+ }
+ ...
+ private void doCheck() {
+ mCheckLicenseButton.setEnabled(false);
+ setProgressBarIndeterminateVisibility(true);
+ mStatusText.setText(R.string.checking_license);
+ mChecker.checkAccess(mLicenseCheckerCallback);
+ }
+</pre>
+
+
+<h3 id="account-key">Embed your public key for licensing</h3>
+
+<p>For each publisher account, the Google Play service automatically
+generates a 2048-bit RSA public/private key pair that is used exclusively for
+licensing. The key pair is uniquely associated with the publisher account and is
+shared across all applications that are published through the account. Although
+associated with a publisher account, the key pair is <em>not</em> the same as
+the key that you use to sign your applications (or derived from it).</p>
+
+<p>The Google Play publisher site exposes the public key for licensing to any
+developer signed in to the publisher account, but it keeps the private key
+hidden from all users in a secure location. When an application requests a
+license check for an application published in your account, the licensing server
+signs the license response using the private key of your account's key pair.
+When the LVL receives the response, it uses the public key provided by the
+application to verify the signature of the license response. </p>
+
+<p>To add licensing to an application, you must obtain your publisher account's
+public key for licensing and copy it into your application. Here's how to find
+your account's public key for licensing:</p>
+
+<ol>
+<li>Go to the Google Play <a
+href="http://play.google.com/apps/publish">publisher site</a> and sign in.
+Make sure that you sign in to the account from which the application you are
+licensing is published (or will be published). </li>
+<li>In the account home page, locate the "Edit profile" link and click it. </li>
+<li>In the Edit Profile page, locate the "Licensing" pane, shown below. Your
+public key for licensing is given in the "Public key" text box. </li>
+</ol>
+
+<p>To add the public key to your application, simply copy/paste the key string
+from the text box into your application as the value of the String variable
+<code>BASE64_PUBLIC_KEY</code>. When you are copying, make sure that you have
+selected the entire key string, without omitting any characters. </p>
+
+<p>Here's an example from the LVL sample application:</p>
+
+<pre> public class MainActivity extends Activity {
+ private static final String BASE64_PUBLIC_KEY = "MIIBIjANBgkqhkiG ... "; //truncated for this example
+ ...
+ }
+</pre>
+
+<h3 id="handler-cleanup">Call your LicenseChecker's onDestroy() method
+to close IPC connections</h3>
+
+<p>Finally, to let the LVL clean up before your application
+{@link android.content.Context} changes, add a call to the {@code LicenseChecker}'s
+<code>onDestroy()</code> method from your Activity's
+{@link android.app.Activity#onDestroy()} implementation. The call causes the
+{@code LicenseChecker} to properly close any open IPC connection to the Google Play
+application's ILicensingService and removes any local references to the service
+and handler.</p>
+
+<p>Failing to call the {@code LicenseChecker}'s <code>onDestroy()</code> method
+can lead to problems over the lifecycle of your application. For example, if the
+user changes screen orientation while a license check is active, the application
+{@link android.content.Context} is destroyed. If your application does not
+properly close the {@code LicenseChecker}'s IPC connection, your application will crash
+when the response is received. Similarly, if the user exits your application
+while a license check is in progress, your application will crash when the
+response is received, unless it has properly called the
+{@code LicenseChecker}'s <code>onDestroy()</code> method to disconnect from the service.
+</p>
+
+<p>Here's an example from the sample application included in the LVL, where
+<code>mChecker</code> is the {@code LicenseChecker} instance:</p>
+
+<pre> @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ mChecker.onDestroy();
+ ...
+ }
+</pre>
+
+<p>If you are extending or modifying {@code LicenseChecker}, you might also need to call
+the {@code LicenseChecker}'s <code>finishCheck()</code> method, to clean up any open IPC
+connections.</p>
+
+<h2 id="impl-DeviceLimiter">Implementing a DeviceLimiter</h2>
+
+<p>In some cases, you might want your {@code Policy} to limit the number of actual
+devices that are permitted to use a single license. This would prevent a user
+from moving a licensed application onto a number of devices and using the
+application on those devices under the same account ID. It would also prevent a
+user from "sharing" the application by providing the account information
+associated with the license to other individuals, who could then sign in to that
+account on their devices and access the license to the application. </p>
+
+<p>The LVL supports per-device licensing by providing a
+<code>DeviceLimiter</code> interface, which declares a single method,
+<code>allowDeviceAccess()</code>. When a LicenseValidator is handling a response
+from the licensing server, it calls <code>allowDeviceAccess()</code>, passing a
+user ID string extracted from the response.</p>
+
+<p>If you do not want to support device limitation, <strong>no work is
+required</strong> — the {@code LicenseChecker} class automatically uses a default
+implementation called NullDeviceLimiter. As the name suggests, NullDeviceLimiter
+is a "no-op" class whose <code>allowDeviceAccess()</code> method simply returns
+a <code>LICENSED</code> response for all users and devices. </p>
+
+<div style="border-left:4px solid #FFCF00;margin:1em;padding: 0 0 0 .5em">
+<p><strong>Caution:</strong> Per-device licensing is <em>not recommended for
+most applications</em> because:</p>
+<ul>
+<li>It requires that you provide a backend server to manage a users and devices
+mapping, and </li>
+<li>It could inadvertently result in a user being denied access to an
+application that they have legitimately purchased on another device.</li>
+</ul>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+<h2 id="app-obfuscation">Obfuscating Your Code</h2>
+
+<p>To ensure the security of your application, particularly for a paid
+application that uses licensing and/or custom constraints and protections, it's
+very important to obfuscate your application code. Properly obfuscating your
+code makes it more difficult for a malicious user to decompile the application's
+bytecode, modify it — such as by removing the license check —
+and then recompile it.</p>
+
+<p>Several obfuscator programs are available for Android applications, including
+<a href="http://proguard.sourceforge.net/">ProGuard</a>, which also offers
+code-optimization features. The use of ProGuard or a similar program to obfuscate
+your code is <em>strongly recommended</em> for all applications that use Google
+Play Licensing. </p>
+
+<h2 id="app-publishing">Publishing a Licensed Application</h2>
+
+<p>When you are finished testing your license implementation, you are ready to
+publish the application on Google Play. Follow the normal steps to <a
+href="{@docRoot}tools/publishing/preparing.html">prepare</a>, <a
+href="{@docRoot}tools/publishing/app-signing.html">sign</a>, and then <a
+href="{@docRoot}distribute/googleplay/publish/preparing.html">publish the application</a>.
+</p>
+
+<h3>Removing Copy Protection</h3>
+
+<p>After uploading your licensed application, remember to remove copy protection
+from the application, if it is currently used. To check and remove copy
+protection, sign in to the publisher site and go the application's upload
+details page. In the Publishing options section, make sure that the Copy
+Protection radio button selection is "Off".</p>
+
+
+<h2 id="support">Where to Get Support</h2>
+
+<p>If you have questions or encounter problems while implementing or deploying
+publishing in your applications, please use the support resources listed in the
+table below. By directing your queries to the correct forum, you can get the
+support you need more quickly. </p>
+
+<p class="table-caption"><strong>Table 2.</strong> Developer support resources
+for Google Play Licensing Service.</p>
+
+<table>
+
+<tr>
+<th>Support Type</th>
+<th>Resource</th>
+<th>Range of Topics</th>
+</tr>
+<tr>
+<td rowspan="2">Development and testing issues</td>
+<td>Google Groups: <a
+href="http://groups.google.com/group/android-developers">android-developers</a>
+</td>
+<td rowspan="2">LVL download and integration, library projects, {@code Policy}
+questions, user experience ideas, handling of responses, {@code Obfuscator}, IPC, test
+environment setup</td>
+</tr>
+<tr>
+<td>Stack Overflow: <a
+href="http://stackoverflow.com/questions/tagged/android">http://stackoverflow.com/questions/tagged/android</a></td>
+</tr>
+<tr>
+<td rowspan="2">Accounts, publishing, and deployment issues</td>
+<td><a href="http://www.google.com/support/forum/p/Android+Market">Google Play
+Help Forum</a></td>
+<td rowspan="2">Publisher accounts, licensing key pair, test accounts, server
+responses, test responses, application deployment and results</td>
+</tr>
+<tr>
+<td><a
+href="http://market.android.com/support/bin/answer.py?answer=186113">Market
+Licensing Support FAQ</a></td>
+</tr>
+<tr>
+<td>LVL issue tracker</td>
+<td><a href="http://code.google.com/p/marketlicensing/issues/">Marketlicensing
+project issue tracker</a></td>
+<td>Bug and issue reports related specifically to the LVL source code classes
+and interface implementations</td>
+</tr>
+
+</table>
+
+<p>For general information about how to post to the groups listed above, see <a
+href="{@docRoot}resources/community-groups.html">Developer Forums</a> document
+in the Resources tab.</p>
+
+
diff --git a/docs/html/guide/google/play/licensing/index.jd b/docs/html/guide/google/play/licensing/index.jd
new file mode 100644
index 0000000..d393738
--- /dev/null
+++ b/docs/html/guide/google/play/licensing/index.jd
@@ -0,0 +1,61 @@
+page.title=Application Licensing
+@jd:body
+
+
+<p>Google Play offers a licensing service that lets you enforce licensing policies for
+applications that you publish on Google Play. With Google Play Licensing, your application can
+query Google Play at run time to obtain the licensing status for the current user, then allow or
+disallow further use as appropriate. </p>
+
+<p>Using the service, you can apply a flexible licensing policy on an application-by-application
+basis—each application can enforce licensing in the way most appropriate for it. If necessary,
+an application can apply custom constraints based on the licensing status obtained from Google Play.
+For example, an application can check the licensing status and then apply custom constraints
+that allow the user to run it unlicensed for a specific validity period. An application can also
+restrict use of the application to a specific device, in addition to any other constraints. </p>
+
+<p>The licensing service is a secure means of controlling access to your applications. When an
+application checks the licensing status, the Google Play server signs the licensing status
+response using a key pair that is uniquely associated with the publisher account. Your application
+stores the public key in its compiled <code>.apk</code> file and uses it to verify the licensing
+status response.</p>
+
+<p>Any application that you publish through Google Play can use the Google Play Licensing
+service. No special account or registration is needed. Additionally, because the service uses no
+dedicated framework APIs, you can add licensing to any application that uses a minimum API level of
+3 or higher.</p>
+
+<p class="note"><strong>Note:</strong> The Google Play Licensing service is primarily intended
+for paid applications that wish to verify that the current user did in fact pay for the application
+on Google Play. However, any application (including free apps) may use the licensing service
+to initiate the download of an APK expansion file. In which case, the request that your application
+sends to the licensing service is not to check whether the user paid for the app, but to request the
+URL of the expansion files. For information about downloading expansion files for your application,
+read the guide to <a href="{@docRoot}guide/google/play/expansion-files.html">APK Expansion Files</a>.</p>
+
+
+<p>To learn more about Google Play's application licensing service and start integrating it into
+your applications, read the following documents:</p>
+
+<dl>
+ <dt><strong><a href="{@docRoot}guide/google/play/licensing/overview.html">Licensing
+Overview</a></strong></dt>
+ <dd>Describes how the service works and what a typical licensing implementation looks
+like.</dd>
+ <dt><strong><a href="{@docRoot}guide/google/play/licensing/setting-up.html">Setting Up for
+Licensing</a></strong></dt>
+ <dd>Explains how to set up your Google Play account, development environment, and
+testing environment in order to add licensing to your app.</dd>
+ <dt><strong><a href="{@docRoot}guide/google/play/licensing/adding-licensing.html">Adding
+Licensing to Your App</a></strong></dt>
+ <dd>Provides a step-by-step guide to add licensing verification to your application.</dd>
+ <dt><strong><a href="{@docRoot}guide/google/play/licensing/licensing-reference.html">Licensing
+Reference</a></strong></dt>
+ <dd>Provides detailed information about the licensing library's classes and the service response
+codes.</dd>
+</dl>
+
+
+
+
+
diff --git a/docs/html/guide/google/play/licensing/licensing-reference.jd b/docs/html/guide/google/play/licensing/licensing-reference.jd
new file mode 100644
index 0000000..d3d5224
--- /dev/null
+++ b/docs/html/guide/google/play/licensing/licensing-reference.jd
@@ -0,0 +1,439 @@
+page.title=Licensing Reference
+parent.title=Application Licensing
+parent.link=index.html
+@jd:body
+
+
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#lvl-summary">LVL Classes and Interfaces</a></li>
+ <li><a href="#server-response-codes">Server Response Codes</a></li>
+ <li><a href="#extras">Server Response Extras</a></li>
+ </ol>
+
+</div>
+</div>
+
+
+<h2 id="lvl-summary">LVL Classes and Interfaces</h2>
+
+<p>Table 1 lists all of the source files in the License Verification
+Library (LVL) available through the Android SDK. All of the files are part of
+the <code>com.android.vending.licensing</code> package.</p>
+
+<p class="table-caption"><strong>Table 1.</strong> Summary of LVL library
+classes and interfaces.</p>
+
+<div style="width:99%">
+<table width="100%">
+
+<tr>
+<th width="15%">Category</th>
+<th width="20%">Name</th>
+<th width="100%">Description</th>
+</tr>
+
+<tr>
+<td rowspan="2">License check and result</td>
+<td>LicenseChecker</td>
+<td>Class that you instantiate (or subclass) to initiate a license check.</td>
+</tr>
+<tr>
+<td><em>LicenseCheckerCallback</em></td>
+<td>Interface that you implement to handle result of the license check.</td>
+</tr>
+
+<tr>
+<td rowspan="3" width="15%">Policy</td>
+<td width="20%"><em>Policy</em></td>
+<td width="100%">Interface that you implement to determine whether to allow
+access to the application, based on the license response. </td>
+</tr>
+<tr>
+<td>ServerManagedPolicy</td>
+<td width="100%">Default {@code Policy} implementation. Uses settings provided by the
+licensing server to manage local storage of license data, license validity,
+retry.</td>
+</tr>
+<tr>
+<td>StrictPolicy</td>
+<td>Alternative {@code Policy} implementation. Enforces licensing based on a direct
+license response from the server only. No caching or request retry.</td>
+</tr>
+
+<tr>
+<td rowspan="2" width="15%">Data obfuscation <br><em>(optional)</em></td>
+<td width="20%"><em>Obfuscator</em></td>
+<td width="100%">Interface that you implement if you are using a {@code Policy} (such as
+ServerManagedPolicy) that caches license response data in a persistent store.
+Applies an obfuscation algorithm to encode and decode data being written or
+read.</td>
+</tr>
+<tr>
+<td>AESObfuscator</td>
+<td>Default Obfuscator implementation that uses AES encryption/decryption
+algorithm to obfuscate/unobfuscate data.</td>
+</tr>
+
+<tr>
+<td rowspan="2" width="15%">Device limitation<br><em>(optional)</em></td>
+<td width="20%"><em>DeviceLimiter</em></td>
+<td width="100%">Interface that you implement if you want to restrict use of an
+application to a specific device. Called from LicenseValidator. Implementing
+DeviceLimiter is not recommended for most applications because it requires a
+backend server and may cause the user to lose access to licensed applications,
+unless designed with care.</td>
+</tr>
+<tr>
+<td>NullDeviceLimiter</td>
+<td>Default DeviceLimiter implementation that is a no-op (allows access to all
+devices).</td>
+</tr>
+
+<tr>
+<td rowspan="6" width="15%">Library core, no integration needed</td>
+<td width="20%">ResponseData</td>
+<td width="100%">Class that holds the fields of a license response.</td>
+</tr>
+<tr>
+<td>LicenseValidator</td>
+<td>Class that decrypts and verifies a response received from the licensing
+server.</td>
+</tr>
+<tr>
+<td>ValidationException</td>
+<td>Class that indicates errors that occur when validating the integrity of data
+managed by an Obfuscator.</td>
+</tr>
+<tr>
+<td>PreferenceObfuscator</td>
+<td>Utility class that writes/reads obfuscated data to the system's
+{@link android.content.SharedPreferences} store.</td>
+</tr>
+<tr>
+<td><em>ILicensingService</em></td>
+<td>One-way IPC interface over which a license check request is passed to the
+Google Play client.</td>
+</tr>
+<tr>
+<td><em>ILicenseResultListener</em></td>
+<td>One-way IPC callback implementation over which the application receives an
+asynchronous response from the licensing server.</td>
+</tr>
+
+</table>
+</div>
+
+
+<h2 id="server-response-codes">Server Response Codes</h2>
+
+<p>Table 2 lists all of the license response codes supported by the
+licensing server. In general, an application should handle all of these response
+codes. By default, the LicenseValidator class in the LVL provides all of the
+necessary handling of these response codes for you. </p>
+
+<p class="table-caption"><strong>Table 2.</strong> Summary of response codes
+returned by the Google Play server in a license response.</p>
+
+<table>
+
+<tr>
+<th>Response Code</th>
+<th>Description</th>
+<th>Signed?</th>
+<th>Extras</th>
+<th>Comments</th>
+</tr>
+<tr>
+<td>{@code LICENSED}</td>
+<td>The application is licensed to the user. The user has purchased the
+application or the application only exists as a draft.</td>
+<td>Yes</td>
+<td><code>VT</code>, <code>GT</code>, <code>GR</code></td>
+<td><em>Allow access according to {@code Policy} constraints.</em></td>
+</tr>
+<tr>
+<td>{@code LICENSED_OLD_KEY}</td>
+<td>The application is licensed to the user, but there is an updated application
+version available that is signed with a different key. </td>
+<td>Yes </td>
+<td><code>VT</code>, <code>GT</code>, <code>GR</code>, <code>UT</code></td>
+<td><em>Optionally allow access according to {@code Policy} constraints.</em>
+<p style="margin-top:.5em;">Can indicate that the key pair used by the installed
+application version is invalid or compromised. The application can allow access
+if needed or inform the user that an upgrade is available and limit further use
+until upgrade.</p>
+</td>
+</tr>
+<tr>
+<td>{@code NOT_LICENSED}</td>
+<td>The application is not licensed to the user.</td>
+<td>No</td>
+<td></td>
+<td><em>Do not allow access.</em></td>
+</tr>
+<tr>
+<td>{@code ERROR_CONTACTING_SERVER}</td>
+<td>Local error — the Google Play application was not able to reach the
+licensing server, possibly because of network availability problems. </td>
+<td>No</td>
+<td></td>
+<td><em>Retry the license check according to {@code Policy} retry limits.</em></td>
+</tr>
+<tr>
+<td>{@code ERROR_SERVER_FAILURE}</td>
+<td>Server error — the server could not load the publisher account's key
+pair for licensing.</td>
+<td>No</td>
+<td></td>
+<td><em>Retry the license check according to {@code Policy} retry limits.</em>
+</td>
+</tr>
+<tr>
+<td>{@code ERROR_INVALID_PACKAGE_NAME}</td>
+<td>Local error — the application requested a license check for a package
+that is not installed on the device. </td>
+<td>No </td>
+<td></td>
+<td><em>Do not retry the license check.</em>
+<p style="margin-top:.5em;">Typically caused by a development error.</p>
+</td>
+</tr>
+<tr>
+<td>{@code ERROR_NON_MATCHING_UID}</td>
+<td>Local error — the application requested a license check for a package
+whose UID (package, user ID pair) does not match that of the requesting
+application. </td>
+<td>No </td>
+<td></td>
+<td><em>Do not retry the license check.</em>
+<p style="margin-top:.5em;">Typically caused by a development error.</p>
+</td>
+</tr>
+<tr>
+<td>{@code ERROR_NOT_MARKET_MANAGED}</td>
+<td>Server error — the application (package name) was not recognized by
+Google Play. </td>
+<td>No</td>
+<td></td>
+<td><em>Do not retry the license check.</em>
+<p style="margin-top:.5em;">Can indicate that the application was not published
+through Google Play or that there is an development error in the licensing
+implementation.</p>
+</td>
+</tr>
+
+</table>
+
+<p class="note"><strong>Note:</strong> As documented in <a
+href="{@docRoot}guide/google/play/licensing/setting-up.html#test-env">
+Setting Up The Testing Environment</a>, the response code can be manually
+overridden for the application developer and any registered test users via the
+Google Play publisher site.
+<br/><br/>
+Additionally, as noted above, applications that are in draft mode (in other
+words, applications that have been uploaded but have <em>never</em> been
+published) will return {@code LICENSED} for all users, even if not listed as a test
+user. Since the application has never been offered for download, it is assumed
+that any users running it must have obtained it from an authorized channel for
+testing purposes.</p>
+
+
+
+
+<h2 id="extras">Server Response Extras</h2>
+
+<p>To assist your application in managing access to the application across the application refund
+period and provide other information, The licensing server includes several pieces of
+information in the license responses. Specifically, the service provides recommended values for the
+application's license validity period, retry grace period, maximum allowable retry count, and other
+settings. If your application uses <a href="{@docRoot}guide/google/play/expansion-files.html">APK
+expansion files</a>, the response also includes the file names, sizes, and URLs. The server appends
+the settings as key-value pairs in the license response "extras" field. </p>
+
+<p>Any {@code Policy} implementation can extract the extras settings from the license
+response and use them as needed. The LVL default {@code Policy} implementation, <a
+href="{@docRoot}guide/google/play/licensing/adding-licensing.html#ServerManagedPolicy">{@code
+ServerManagedPolicy}</a>, serves as a working
+implementation and an illustration of how to obtain, store, and use the
+settings. </p>
+
+<p class="table-caption"><strong>Table 3.</strong> Summary of
+license-management settings supplied by the Google Play server in a license
+response.</p>
+
+<table>
+<tr>
+<th>Extra</th><th>Description</th>
+</tr>
+
+<tr>
+ <td>{@code VT}</td>
+ <td>License validity timestamp. Specifies the date/time at which the current
+(cached) license response expires and must be rechecked on the licensing server. See the section
+below about <a href="#VT">License validity period</a>.
+ </td>
+</tr>
+<tr>
+ <td>{@code GT}</td>
+ <td>Grace period timestamp. Specifies the end of the period during which a
+Policy may allow access to the application, even though the response status is
+{@code RETRY}. <p>The value is managed by the server, however a typical value would be 5
+or more days. See the section
+below about <a href="#GTGR">Retry period and maximum retry count</a>.</p></td>
+</tr>
+<tr>
+ <td>{@code GR}</td>
+ <td>Maximum retries count. Specifies how many consecutive {@code RETRY} license checks
+the {@code Policy} should allow, before denying the user access to the application.
+<p>The value is managed by the server, however a typical value would be "10" or
+higher. See the section
+below about <a href="#GTGR">Retry period and maximum retry count</a>.</p></td>
+</tr>
+<tr>
+ <td>{@code UT}</td>
+ <td>Update timestamp. Specifies the day/time when the most recent update to
+this application was uploaded and published. <p>The server returns this extra
+only for {@code LICENSED_OLD_KEYS} responses, to allow the {@code Policy} to determine how much
+time has elapsed since an update was published with new licensing keys before
+denying the user access to the application. </p></td>
+</tr>
+
+
+<!-- APK EXPANSION FILE RESPONSES -->
+
+<tr>
+ <td>{@code FILE_URL1} or {@code FILE_URL2}</td>
+ <td>The URL for an expansion file (1 is for the main file, 2 is the patch file). Use this to
+download the file over HTTP.</td>
+</tr>
+<tr>
+ <td>{@code FILE_NAME1} or {@code FILE_NAME2}</td>
+ <td>The expansion file's name (1 is for the main file, 2 is the patch file). You must use this
+name when saving the file on the device.</td>
+</tr>
+<tr>
+ <td>{@code FILE_SIZE1} or {@code FILE_SIZE2}</td>
+ <td>The size of the file in bytes (1 is for the main file, 2 is the patch file). Use this to
+assist with downloading and to ensure that enough space is available on the device's shared
+storage location before downloading.</td>
+</tr>
+
+</table>
+
+
+
+<h4 id="VT">License validity period</h4>
+
+<p>The Google Play licensing server sets a license validity period for all
+downloaded applications. The period expresses the interval of time over which an
+application's license status should be considered as unchanging and cacheable by
+a licensing {@code Policy} in the application. The licensing server includes the
+validity period in its response to all license checks, appending an
+end-of-validity timestamp to the response as an extra under the key {@code VT}. A
+{@code Policy} can extract the VT key value and use it to conditionally allow access to
+the application without rechecking the license, until the validity period
+expires. </p>
+
+<p>The license validity signals to a licensing {@code Policy} when it must recheck the
+licensing status with the licensing server. It is <em>not</em> intended to imply
+whether an application is actually licensed for use. That is, when an
+application's license validity period expires, this does not mean that the
+application is no longer licensed for use — rather, it indicates only that
+the {@code Policy} must recheck the licensing status with the server. It follows that,
+as long as the license validity period has not expired, it is acceptable for the
+{@code Policy} to cache the initial license status locally and return the cached license
+status instead of sending a new license check to the server.</p>
+
+<p>The licensing server manages the validity period as a means of helping the
+application properly enforce licensing across the refund period offered by
+Google Play for paid applications. It sets the validity period based on
+whether the application was purchased and, if so, how long ago. Specifically,
+the server sets a validity period as follows:</p>
+
+<ul>
+<li>For a paid application, the server sets the initial license validity period
+so that the license response remains valid for as long as the application is
+refundable. A licensing {@code Policy} in the application may cache the
+result of the initial license check and does not need to recheck the license
+until the validity period has expired.</li>
+<li>When an application is no longer refundable, the server
+sets a longer validity period — typically a number of days. </li>
+
+<!-- TODO: Verify the following behavior is still true w/ OBB: -->
+<li>For a free application, the server sets the validity period to a very high
+value (<code>long.MAX_VALUE</code>). This ensures that, provided the {@code Policy} has
+cached the validity timestamp locally, it will not need to recheck the
+license status of the application in the future.</li>
+</ul>
+
+<p>The {@code ServerManagedPolicy} implementation uses the extracted timestamp
+(<code>mValidityTimestamp</code>) as a primary condition for determining whether
+to recheck the license status with the server before allowing the user access to
+the application. </p>
+
+
+<h4 id="GTGR">Retry period and maximum retry count</h4>
+
+<p>In some cases, system or network conditions can prevent an application's
+license check from reaching the licensing server, or prevent the server's
+response from reaching the Google Play client application. For example, the
+user might launch an application when there is no cell network or data
+connection available—such as when on an airplane—or when the
+network connection is unstable or the cell signal is weak. </p>
+
+<p>When network problems prevent or interrupt a license check, the Google
+Play client notifies the application by returning a {@code RETRY} response code to
+the {@code Policy}'s <code>processServerResponse()</code> method. In the case of system
+problems, such as when the application is unable to bind with Google Play's
+{@code ILicensingService} implementation, the {@code LicenseChecker} library itself calls the
+Policy <code>processServerResonse()</code> method with a {@code RETRY} response code.
+</p>
+
+<p>In general, the {@code RETRY} response code is a signal to the application that an
+error has occurred that has prevented a license check from completing.
+
+<p>The Google Play server helps an application to manage licensing under
+error conditions by setting a retry "grace period" and a recommended maximum
+retries count. The server includes these values in all license check responses,
+appending them as extras under the keys {@code GT} and {@code GR}. </p>
+
+<p>The application {@code Policy} can extract the {@code GT} and {@code GR} extras and use them to
+conditionally allow access to the application, as follows:</p>
+
+<ul>
+<li>For a license check that results in a {@code RETRY} response, the {@code Policy} should
+cache the {@code RETRY} response code and increment a count of {@code RETRY} responses.</li>
+<li>The {@code Policy} should allow the user to access the application, provided that
+either the retry grace period is still active or the maximum retries count has
+not been reached.</li>
+</ul>
+
+<p>The {@code ServerManagedPolicy} uses the server-supplied {@code GT} and {@code GR} values as
+described above. The example below shows the conditional handling of the retry
+responses in the <code>allow()</code> method. The count of {@code RETRY} responses is
+maintained in the <code>processServerResponse()</code> method, not shown. </p>
+
+
+<pre>
+public boolean allowAccess() {
+ long ts = System.currentTimeMillis();
+ if (mLastResponse == LicenseResponse.LICENSED) {
+ // Check if the LICENSED response occurred within the validity timeout.
+ if (ts <= mValidityTimestamp) {
+ // Cached LICENSED response is still valid.
+ return true;
+ }
+ } else if (mLastResponse == LicenseResponse.RETRY &&
+ ts < mLastResponseTime + MILLIS_PER_MINUTE) {
+ // Only allow access if we are within the retry period or we haven't used up our
+ // max retries.
+ return (ts <= mRetryUntil || mRetryCount <= mMaxRetries);
+ }
+ return false;
+}</pre>
+
diff --git a/docs/html/guide/google/play/licensing/overview.jd b/docs/html/guide/google/play/licensing/overview.jd
new file mode 100644
index 0000000..467a3a2
--- /dev/null
+++ b/docs/html/guide/google/play/licensing/overview.jd
@@ -0,0 +1,246 @@
+page.title=Licensing Overview
+parent.title=Application Licensing
+parent.link=index.html
+@jd:body
+
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Quickview</h2>
+ <ul>
+ <li>Licensing allows you to verify your app was purchased from Google Play</li>
+ <li>Your app maintains control of how it enforces its licensing status</li>
+ <li>The service is free for all developers who publish on Google Play</li>
+ </ul>
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#Secure">License Responses are Secure</a></li>
+ <li><a href="#LVL">Licensing Verification Library</a></li>
+ <li><a href="#Reqs">Requirements and Limitations</a></li>
+ <li><a href="#CopyProtection">Replacement for Copy Protection</a></li>
+</ol>
+
+</div>
+</div>
+
+
+<p>Google Play Licensing is a network-based service that lets an application query a trusted
+Google Play licensing server to determine whether the application is licensed to the current
+device user. The licensing service is based on the capability of the Google Play licensing server
+to determine whether a given user is licensed to use a given application. Google Play considers a
+user to be licensed if the user is a recorded purchaser of the application.</p>
+
+<p>The request starts when your application makes a request to a service hosted by
+the Google Play client application. The Google Play application then sends a request to
+the licensing server and receives the result. The Google Play application sends
+the result to your application, which can allow or disallow further use of the
+application as needed.</p>
+
+<p class="note"><strong>Note:</strong> If a paid application has been uploaded to Google Play but
+saved only as a draft application (the app is unpublished), the licensing server considers all users
+to be licensed users of the application (because it's not even possible to purchase the app).
+This exception is necessary in order for you to perform testing of your licensing
+implementation.</p>
+
+
+<div class="figure" style="width:469px">
+<img src="{@docRoot}images/licensing_arch.png" alt=""/>
+<p class="img-caption"><strong>Figure 1.</strong> Your application initiates a
+license check through the License Verification Library and the Google Play
+client, which handles communication with the Google Play server.</p>
+</div>
+
+
+<p>To properly identify the user and determine the license status, the licensing server requires
+information about the application and user—your application and the Google Play client work
+together to assemble the information and the Google Play client passes it to the server. </p>
+
+<p>To help you add licensing to your application, the Android SDK provides a downloadable set of
+library sources that you can include in your application project: the Google Market
+Licensing package. The License Verification Library (LVL) is a library you can add to your
+application that
+handles all of the licensing-related communication with the Google Play licensing service. With
+the LVL added to your application, your application can determine its licensing status for the
+current user by simply calling a method and implementing a callback that receives the status
+response.</p>
+
+<p>Your application does not query the licensing server
+directly, but instead calls the Google Play client over remote IPC to
+initiate a license request. In the license request:</p>
+
+<ul>
+<li>Your application provides: its package name, a nonce that is later used to
+validate any response from the server, and a callback over which the
+response can be returned asynchronously.</li>
+<li>The Google Play client collects the necessary information about the user and the device,
+such as the device's primary Google account username, IMSI, and other
+information. It then sends the license check request to the server on behalf of
+your application.</li>
+<li>The Google Play server evaluates the request using all available information, attempting
+to establish the user's identity to a sufficient level of confidence. The server
+then checks the user identity against purchase records for your application and
+returns a license response, which the Google Play client returns to your
+application over the IPC callback.</li>
+</ul>
+
+<p>You can choose when, and how often, you want your application to check its
+license and you have full control over how it handles the response, verifies the
+signed response data, and enforces access controls.</p>
+
+<p>Notice that during a license check, your application does not manage any
+network connections or use any licensing related APIs in the Android platform.</p>
+
+
+
+
+<h2 id="Secure">License Responses are Secure</h2>
+
+<p>To ensure the integrity of each license query, the server signs the license
+response data using an RSA key pair that is shared exclusively between the Google Play
+server and you.</p>
+
+<p>The licensing service generates a single licensing key pair for each
+publisher account and exposes the public key in your account's profile page. You must copy the
+public key from the web site and embed it in your application source code. The server retains the
+private key internally and uses it to sign license responses for the applications you
+publish with that account.</p>
+
+<p>When your application receives a signed response, it uses the embedded public
+key to verify the data. The use of public key cryptography in the licensing
+service makes it possible for the application to detect responses that have been
+tampered with or that are spoofed.</p>
+
+
+
+
+<h2 id="LVL">Licensing Verification Library</h2>
+
+<p>The Android SDK provides a downloadable package called the Google Market Licensing package,
+which includes the License Verification Library (LVL). The LVL greatly simplifies the process of
+adding licensing to your application and helps ensure a more secure, robust implementation for your
+application. The LVL provides internal classes that handle most of the standard operations of a
+license query, such as contacting the Google Play client to initiate a license request and
+verifying and validating the responses. It also exposes interfaces that let you easily plug in your
+custom code for defining licensing policy and managing access as needed by your application. The key
+LVL interfaces are: </p>
+
+<dl>
+<dt>{@code Policy}</dt>
+ <dd>Your implementation determines whether to allow access to the
+application, based on the license response received from the server and any
+other data available (such as from a backend server associated with your
+application). The implementation can evaluate the various fields of the license
+response and apply other constraints, if needed. The implementation also lets
+you manage the handling of license checks that result in errors, such as network
+errors.</dd>
+
+<dt>{@code LicenseCheckerCallback}</dt>
+ <dd>Your implementation manages access to the
+application, based on the result of the {@code Policy} object's handling of the license
+response. Your implementation can manage access in any way needed, including
+displaying the license result in the UI or directing the user to purchase the
+application (if not currently licensed).</dd>
+</dl>
+
+
+<p>To help you get started with a {@code Policy}, the LVL provides two fully complete
+{@code Policy} implementations that you can use without modification or adapt to your
+needs:</p>
+
+<dl>
+<dt><a href="adding-licensing.html#ServerManagedPolicy">{@code ServerManagedPolicy}</a></dt>
+ <dd>A flexible {@code Policy}
+that uses settings provided by the licensing server to manage response caching
+and access to the application while the device is offline (such as when the
+user is on an airplane). For most applications, the use of
+{@code ServerManagedPolicy} is highly recommended.</dd>
+
+<dt><a href="adding-licensing.html#StrictPolicy">{@code StrictPolicy}</a></dt>
+ <dd>A restrictive {@code Policy} that
+does not cache any response data and allows the application access <em>only</em>
+when the server returns a licensed response.</dd>
+</dl>
+
+<p>The LVL is available as a downloadable package of the Android SDK. The
+package includes both the LVL itself and an example application that shows how
+the library should be integrated with your application and how your application
+should manage response data, UI interaction, and error conditions. </p>
+
+<p>The LVL sources are provided as an Android <em>library project</em>, which
+means that you can maintain a single set of library sources and share them
+across multiple applications. A full test environment is also available through
+the SDK, so you can develop and test the licensing implementation in your
+applications before publishing them, even if you don't have access to a
+physical device.</p>
+
+
+
+
+<h2 id="Reqs">Requirements and Limitations</h2>
+
+<p>Google Play Licensing is designed to let you apply license controls to
+applications that you publish through Google Play. The service is not
+designed to let you control access to applications that are not published
+through Google Play or that are run on devices that do not offer the Google
+Play client. </p>
+
+<p>Here are some points to keep in mind as you implement licensing in your
+application: </p>
+
+<ul>
+<li>An application can use the service only if the Google Play client is
+installed on its host device and the device is running Android 1.5 (API level 3)
+or higher.</li>
+<li>To complete a license check, the licensing server must be accessible over
+the network. You can implement license caching behaviors to manage access to your application when
+there is no network connectivity. </li>
+<li>The security of your application's licensing controls ultimately relies on
+the design of your implementation itself. The service provides the building
+blocks that let you securely check licensing, but the actual enforcement and
+handling of the license are factors are up to you. By following the best
+practices in the following documents, you can help ensure that your implementation will be
+secure.</li>
+<li>Adding licensing to an application does not affect the way the application
+functions when run on a device that does not offer Google Play.</li>
+<li>You can implement licensing controls for a free app, but only if you're using the service to
+provide <a
+href="{@docRoot}guide/google/play/expansion-files.html">APK expansion files</a>.</li>
+</ul>
+
+
+
+<h2 id="CopyProtection">Replacement for Copy Protection</h2>
+
+<p>Google Play Licensing is a flexible, secure mechanism for controlling
+access to your applications. It effectively replaces the Copy Protection
+mechanism offered on Google Play and gives you wider distribution
+potential for your applications. </p>
+
+<ul>
+<li>A limitation of the legacy Copy Protection mechanism on Google Play is
+that applications using it can be installed only on compatible devices that
+provide a secure internal storage environment. For example, a copy-protected
+application cannot be downloaded from Google Play to a device that provides root
+access, and the application cannot be installed to a device's SD card. </li>
+<li>With Google Play licensing, you can move to a license-based model in
+which access is not bound to the characteristics of the host device, but to your
+publisher account on Google Play and the licensing policy that you define.
+Your application can be installed and controlled on any compatible device on
+any storage, including SD card.</li>
+</ul>
+
+<p>Although no license mechanism can completely prevent all unauthorized use,
+the licensing service lets you control access for most types of normal usage,
+across all compatible devices, locked or unlocked, that run Android 1.5 or
+higher version of the platform.</p>
+
+<p>To begin adding application licensing to your application, continue to <a
+href="{@docRoot}guide/google/play/licensing/setting-up.html">Setting Up for Licensing</a>.</p>
+
+
+
+
+
+
diff --git a/docs/html/guide/google/play/licensing/setting-up.jd b/docs/html/guide/google/play/licensing/setting-up.jd
new file mode 100644
index 0000000..80a4419
--- /dev/null
+++ b/docs/html/guide/google/play/licensing/setting-up.jd
@@ -0,0 +1,701 @@
+page.title=Setting Up for Licensing
+parent.title=Application Licensing
+parent.link=index.html
+@jd:body
+
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#account">Setting Up a Publisher Account</a></li>
+ <li><a href="#dev-setup">Setting Up the Development Environment</a>
+ <ol>
+ <li><a href="#runtime-setup">Setting up the runtime environment</a></li>
+ <li><a href="#download-lvl">Downloading the LVL</a></li>
+ <li><a href="#lvl-setup">Setting Up the Licensing Verification Library</a></li>
+ <li><a href="#add-library">Including the LVL library project sources in your
+application</a></li>
+ </ol>
+ </li>
+ <li><a href="#test-env">Setting Up the Testing Environment</a>
+ <ol>
+ <li><a href="#test-response">Setting test responses for license checks</a></li>
+ <li><a href="#test-acct-setup">Setting up test accounts</a></li>
+ <li><a href="#acct-signin">Signing in to an authorized account in the runtime
+environment</a></li>
+ </ol>
+ </li>
+</ol>
+</div>
+</div>
+
+<p>Before you start adding license verification to your application, you need to set up your Google
+Play publishing account, your development environment, and test accounts required to verify
+your implementation.</p>
+
+
+<h2 id="account">Setting Up a Publisher Account</h2>
+
+<p>If you don't already have a publisher account for Google Play, you need to register for one
+using your Google account and agree to the terms of service on the Google Play publisher site:</p>
+
+<p style="margin-left:2em;"><a
+href="http://play.google.com/apps/publish">http://play.google.com/apps/publish</a>
+</p>
+
+<p>For more information, see <a
+href="{@docRoot}distribute/googleplay/publish/register.html">Get Started with Publishing</a>.</p>
+
+<p>If you already have a publisher account on Google Play, use your existing
+account to set up licensing.</p>
+
+<p>Using your publisher account on Google Play, you can:</p>
+
+<ul>
+<li>Obtain a public key for licensing</li>
+<li>Debug and test an application's licensing implementation, prior to
+publishing the application</li>
+<li>Publish the applications to which you have added licensing support</li>
+</ul>
+
+<h4>Administrative settings for licensing</h4>
+
+<p>You can manage several
+administrative controls for Google Play licensing on the publisher site. The controls are available
+in the Edit Profile page, in the "Licensing" panel, shown in figure 1. The controls
+let you: </p>
+
+<ul>
+<li>Set up multiple "test accounts," identified by email address. The licensing
+server allows users signed in to test accounts on a device or emulator to send
+license checks and receive static test responses.</li>
+<li>Obtain the account's public key for licensing. When you are implementing
+licensing in an application, you must copy the public key string into the
+application.</li>
+<li>Configure static test responses that the server sends, when it receives a
+license check for an application uploaded to the publisher account, from a user
+signed in to the publisher account or a test account.</li>
+</ul>
+
+
+<img src="{@docRoot}images/licensing_public_key.png" alt=""/>
+<p class="img-caption"><strong>Figure 1.</strong> The Licensing
+panel of your account's Edit Profile page lets you manage administrative
+settings for licensing.</p>
+
+<p>For more information about how to work with test accounts and static test
+responses, see <a href="#test-env">Setting Up a Testing Environment</a>, below.
+
+
+
+<h2 id="dev-setup">Setting Up the Development Environment</h2>
+
+<p>Setting up your environment for licensing involves these tasks:</p>
+
+<ol>
+<li><a href="#runtime-setup">Setting up the runtime environment</a> for development</li>
+<li><a href="#download-lvl">Downloading the LVL</a> into your SDK </li>
+<li><a href="#lvl-setup">Setting up the Licensing Verification Library</a></li>
+<li><a href="#add-library">Including the LVL library project in your application</a></li>
+</ol>
+
+<p>The sections below describe these tasks. When you are done with setup,
+you can begin <a href="{@docRoot}guide/google/play/licensing/adding-licensing.html">Adding
+Licensing to Your App</a>.</p>
+
+<p>To get started, you need to set up a proper runtime environment on which
+you can run, debug, and test your application's implementation of license
+checking and enforcement. </p>
+
+
+<h3 id="runtime-setup">Setting up the runtime environment</h3>
+
+<p>As described earlier, applications check licensing status not by contacting
+the licensing server directly, but by binding to a service provided by the
+Google Play application and initiating a license check request. The Google
+Play service then handles the direct communication with the licensing server
+and finally routes the response back to your application. To debug and test
+licensing in your application, you need to set up a runtime environment that
+includes the necessary Google Play service, so that your application is able
+to send license check requests to the licensing server. </p>
+
+<p>There are two types of runtime environment that you can use: </p>
+
+<ul>
+<li>An Android-powered device that includes the Google Play application, or</li>
+<li>An Android emulator running the Google APIs Add-on, API level 8 (release 2)
+or higher</li>
+</ul>
+
+<h4 id="runtime-device">Running on a device</h4>
+
+<p>To use an Android-powered device for
+debugging and testing licensing, the device must:</p>
+
+<ul>
+<li>Run a compatible version of Android 1.5 or later (API level
+3 or higher) platform, <em>and</em> </li>
+<li>Run a system image on which the Google Play client application
+is preinstalled. </li>
+</ul>
+
+<p>If Google Play is not preinstalled in the system image, your application won't
+be able to communicate with the Google Play licensing server. </p>
+
+<p>For general information about how to set up a device for use in developing
+Android applications, see <a
+href="{@docRoot}tools/device.html">Using Hardware Devices</a>.</p>
+
+<h4 id="runtime-emulator">Running on an Android emulator</h4>
+
+<p>If you don't have a device available, you can use an Android emulator for debugging and testing
+licensing.</p>
+
+<p>Because the Android platforms provided in the Android SDK <em>do
+not</em> include Google Play, you need to download the Google APIs Add-On
+platform, API level 8 (or higher), from the SDK repository. After downloading
+the add-on, you need to create an AVD configuration that uses that system image.
+</p>
+
+<p>The Google APIs Add-On does not include the full Google Play client.
+However, it does provide: </p>
+
+<ul>
+<li>An Google Play background service that implements the
+<code>ILicensingService</code> remote interface, so that your application can
+send license checks over the network to the licensing server. </li>
+<li>A set of underlying account services that let you add an a Google account on
+the AVD and sign in using your publisher account or test account credentials.
+<p>Signing in using your publisher or test account enables you to debug and test
+your application without having publish it. For more information see <a
+href="#acct-signin">Signing in to an authorized account</a>, below.</p></li>
+</ul>
+
+<p>Several versions of the Google APIs add-on are available through the SDK Manager, but only
+the version for Android 2.2 and higher includes the necessary Google
+Play services.</p>
+
+<p>To set up an emulator for adding licensing to an application, follow
+these steps: </p>
+
+<ol>
+ <li>Launch the Android SDK Manager (available under the Eclipse <strong>Window</strong>
+menu or by executing {@code <sdk>/tools/android sdk}).</li>
+ <li>Select and download <strong>Google APIs</strong> for the Android version you'd like to target
+(must be Android 2.2 or higher).</li>
+ <li>When the download is complete, open the AVD Manager (available under the Eclipse
+<strong>Window</strong>
+menu or by executing {@code <sdk>/tools/android avd}).</li>
+ <li>Click
+<strong>New</strong> and set the configuration details for the new AVD. </li>
+ <li>In the dialog that appears, assign a descriptive name to the AVD and then
+use the Target menu to choose the <strong>Google APIs</strong> as
+the system image to run on the new AVD. Set the other configuration details as
+needed and then click <strong>Create AVD</strong> to finish. The SDK tools
+create the new AVD configuration, which then appears in the list of available
+Android Virtual Devices.</li>
+</ol>
+
+<p>If you are not familiar with AVDs or how to use them, see <a
+href="{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>.</p>
+
+<h4 id="project-update">Updating your project configuration</h4>
+
+<p>After you set up a runtime environment that meets the requirements described
+above — either on an actual device or on an emulator — make sure to
+update your application project or build scripts as needed, so that your compiled
+<code>.apk</code> files that use licensing are deployed into that environment.
+In particular, if you are developing in Eclipse, make sure that you set up a
+Run/Debug Configuration that targets the appropriate device or AVD. </p>
+
+<p>You do not need to make any changes to your application's
+build configuration, provided that the project is already configured to compile
+against a standard Android 1.5 (API level 3) or higher library. For example:
+
+<ul>
+<li>If you have an existing application that is compiled against
+the Android 1.5 library, you do not need to make any changes to your
+build configuration to support licensing. The build target meets the minimum
+requirements for licensing, so you would continue building
+against the same version of the Android platform.</li>
+
+<li>Similarly, if you are building against Android 1.5 (API level 3) but
+are using an emulator running the Google APIs Add-On API 8 as the application's
+runtime environment, there is no need to change your application's build
+configuration. </li>
+</ul>
+
+<p>In general, adding licensing to an application should have no impact
+whatsoever on the application's build configuration.</p>
+
+
+<h3 id="download-lvl">Downloading the LVL</h3>
+
+<p>The License Verification Library (LVL) is a collection of helper classes that
+greatly simplify the work that you need to do to add licensing to your
+application. In all cases, we recommend that you download the LVL and use it as
+the basis for the licensing implementation in your application.</p>
+
+<p>The LVL is available as a downloadable package of the Android SDK. The
+package includes: </p>
+
+<ul>
+<li>The LVL sources, stored inside an Android library project. </li>
+<li>An example application called "sample" that depends on the LVL library
+project. The example illustrates how an application uses the library helper
+classes to check and enforce licensing.</li>
+</ul>
+
+<p>To download the LVL package into your development environment, use the
+Android SDK Manager. Launch the Android SDK Manager and then
+select the <strong>Google Market Licensing</strong> package, as shown in figure 2.
+Accept the terms and click <strong>Install Selected</strong> to begin the download. </p>
+
+<img src="{@docRoot}images/licensing_package.png" alt=""/>
+<p class="img-caption"><strong>Figure 2.</strong> The Licensing package contains the LVL and
+the LVL sample application.</p>
+
+<p>When the download is complete, the Android SDK Manager installs both
+the LVL library project and the example application into these directories: </p>
+
+<p style="margin-left:2em"><code><<em>sdk</em>>/extras/google/market_licensing/library/</code>
+ (the LVL library project)<br />
+<code><<em>sdk</em>>/extras/google/market_licensing/sample/</code> (the example
+application)</p>
+
+<p>If you aren't familiar with how to download packess into your SDK, see the
+<a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>
+document. </p>
+
+
+<h3 id="lvl-setup">Setting Up the Licensing Verification Library</h3>
+
+<p>After downloading the LVL to your computer, you need to set it up in your
+development environment, either as an Android library project or by
+copying (or importing) the library sources directly into your existing
+application package. In general, using the LVL as a library project is recommended,
+since it lets you reuse your licensing code across multiple applications and
+maintain it more easily over time. Note that the LVL is not designed to be
+compiled separately and added to an application as a static .jar file. </p>
+
+<h4>Moving the library sources to a new location</h4>
+
+<p>Because you will be customizing the LVL sources to some extent, you should
+make sure to <em>move or copy</em> the library sources (the entire
+directory at <code><<em>sdk</em>>/market_licensing/library/</code>)
+to a working directory outside of the SDK. You should then use the relocated
+sources as your working set. If you are using a source-code management
+system, add and track the sources that are in the working location rather
+than those in default location in the SDK. </p>
+
+<p>Moving the library sources is important is because, when you later update the
+Licensing package, the SDK installs the new files to the same location as
+the older files. Moving your working library files to a safe location ensures
+that your work won't be inadvertently overwritten should you download a new
+version of the LVL.</p>
+
+<h4>Creating the LVL as a library project</h4>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>Working with library projects</h2>
+
+<p>The LVL is provided as an Android library project, which means that you can
+share its code and resources across multiple applications. </p>
+
+<p style="margin-top:.5em;">If you aren't familiar with library projects or how
+to use them, see <a href="{@docRoot}tools/projects/index.html#LibraryProjects">
+Managing Projects</a>.
+</p>
+</div>
+</div>
+
+<p>The recommended way of using the LVL is setting it up as a new Android
+<em>library project</em>. A library project is a type of development project
+that holds shared Android source code and resources. Other Android application
+projects can reference the library project and, at build time, include its
+compiled sources in their <code>.apk</code> files. In the context of licensing,
+this means that you can do most of your licensing development once, in a library
+project, then include the library sources in your various application projects.
+In this way, you can easily maintain a uniform implementation of licensing
+across all of your projects and maintain it centrally. </p>
+
+<p>The LVL is provided as a configured library project — once you have
+downloaded it, you can start using it right away. </p>
+
+<p>If you are working in Eclipse with ADT, you need to add the LVL to your
+workspace as a new development project, in the same way as you would a new
+application project. </p>
+
+<ol>
+<li>Use the New Project Wizard to create a new
+project from existing sources. Select the LVL's <code>library</code> directory
+(the directory containing the library's AndroidManifest.xml file) as the project
+root.</li>
+<li>When you are creating the library project, you can select any application
+name, package, and set other fields as needed. </li>
+<li>For the library's build target, select Android 1.5 (API level 3) or higher.</li>
+</ol>
+
+<p> When created, the project is
+predefined as a library project in its <code>project.properties</code> file, so
+no further configuration is needed. </p>
+
+<p>For more information about how to create an application project or work with
+library projects in Eclipse, see <a
+href="{@docRoot}tools/projects/projects-eclipse.html">Managing Projects from
+Eclipse with ADT</a>.</p>
+
+
+<h4>Copying the LVL sources to your application</h4>
+
+<p>As an alternative to adding the LVL as a library project, you can copy the
+library sources directly into your application. To do so, copy (or import) the
+LVL's <code>library/src/com</code> directory into your application's
+<code>src/</code> directory.</p>
+
+<p>If you add the LVL sources directly to your application, you can skip the
+next section and start working with the library, as described in <a
+href="{@docRoot}guide/google/play/licensing/adding-licensing.html">Adding
+Licensing to Your App</a>.</p>
+
+
+<h3 id="add-library">Including the LVL library project sources in your
+application</h3>
+
+<p>If you want to use the LVL sources as a library project, you need to add a
+reference to the LVL library project in your application project properties. This tells
+build tools to include the LVL library project sources in your application at
+compile time. The process for adding a reference to a library project depends
+on your development environment, as described below.</p>
+
+<p> If you are developing in Eclipse with ADT, you should already have added the
+library project to your workspace, as described in the previous section. If you
+haven't done that already, do it now before continuing. </p>
+
+<p>Next, open the application's project properties window, as shown below.
+Select the "Android" properties group and click <strong>Add</strong>, then
+choose the LVL library project (com_android_vending_licensing) and click
+<strong>OK</strong>. For more information, see
+<a href="{@docRoot}tools/projects/projects-eclipse.html#SettingUpLibraryProject">
+Managing Projects from Eclipse with ADT</a></p>.
+
+
+<img src="{@docRoot}images/licensing_add_library.png" alt=""/>
+<p class="img-caption"><strong>Figure 3.</strong> If you are
+working in Eclipse with ADT, you can add the LVL library project to your
+application from the application's project properties.</p>
+
+
+<p>If you are developing using the SDK command-line tools, navigate to the
+directory containing your application project and open the
+<code>project.properties</code> file. Add a line to the file that specifies the
+<code>android.library.reference.<n></code> key and the path to the
+library. For example: </p>
+
+<pre>android.library.reference.1=path/to/library_project</pre>
+
+<p>Alternatively, you can use this command to update the project
+properties, including the reference to the library project:</p>
+
+<pre class="no-pretty-print" style="color:black">android update lib-project
+--target <em><target_ID></em> \
+--path <em>path/to/my/app_project</em> \
+--library <em>path/to/my/library_project</em>
+</pre>
+
+<p>For more information about working with library projects,
+see <a href="{@docRoot}tools/projects/projects-cmdline.html#SettingUpLibraryProject">
+Setting up a Library Project</a>.</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h2 id="test-env">Setting Up the Testing Environment</h2>
+
+<p>The Google Play publisher site provides configuration tools that let you
+and others test licensing on your application before it is published. As you are
+implementing licensing, you can make use of the publisher site tools to test
+your application's Policy and handling of different licensing responses and
+error conditions.</p>
+
+<p>The main components of the test environment for licensing include: </p>
+
+<ul>
+<li>A "Test response" configuration in your publisher account that lets you
+set the static licensing response returned, when the server processes a
+license check for an application uploaded to the publisher account, from a user
+signed in to the publisher account or a test account.</li>
+<li>An optional set of test accounts that will receive the static test
+response when they check the license of an application that you have uploaded
+(regardless whether the application is published or not).</li>
+<li>A runtime environment for the application that includes the Google Play
+application or Google APIs Add-On, on which the user is signed in to the
+publisher account or one of the test accounts.</li>
+</ul>
+
+<p>Setting up the test environment properly involves:</p>
+
+<ol>
+<li><a href="#test-response">Setting static test responses</a> that are returned by the licensing server.</li>
+<li><a href="#test-acct-setup">Setting up test accounts</a> as needed.</li>
+<li><a href="#acct-signin">Signing in</a> properly to an emulator or device, before initiating a license check test.</li>
+</ol>
+
+<p>The sections below provide more information.</p>
+
+
+<h3 id="test-response">Setting test responses for license checks</h3>
+
+<p>Google Play provides a configuration setting in your publisher account
+that lets you override the normal processing of a license check and return a
+specified static response code. The setting is for testing only and applies
+<em>only</em> to license checks for applications that you have uploaded, made by
+any user signed in to an emulator or device using the credentials of the
+publisher account or a registered test account. For other users, the server
+always processes license checks according to normal rules. </p>
+
+<p>To set a test response for your account, sign in to your publisher account
+and click "Edit Profile". In the Edit Profile page, locate the Test Response
+menu in the Licensing panel, shown below. You can select from the full set of
+valid server response codes to control the response or condition you want to
+test in your application.</p>
+
+<p>In general, you should make sure to test your application's licensing
+implementation with every response code available in the Test Response menu.
+For a description of the codes, see <a
+href="{@docRoot}guide/google/play/licensing/licensing-reference.html#server-response-codes">Server
+Response Codes</a> in the <a
+href="{@docRoot}guide/google/play/licensing/licensing-reference.html">Licensing Reference</a>.</p>
+
+<img src="{@docRoot}images/licensing_test_response.png" alt=""/>
+<p class="img-caption"><strong>Figure 4.</strong> The Licensing
+panel of your account's Edit Profile page, showing the Test Accounts field and the
+Test Response menu.</p>
+
+<p>Note that the test response that you configure applies account-wide —
+that is, it applies not to a single application, but to <em>all</em>
+applications associated with the publisher account. If you are testing multiple
+applications at once, changing the test response will affect all of those
+applications on their next license check (if the user is signed in to
+the emulator or device using the publisher account or a test account).</p>
+
+<p>Before you can successfully receive a test response for a license check,
+you must sign in to the device or emulator on which the application
+is installed, and from which it is querying the server. Specifically, you must
+sign using either your publisher account or one of the test accounts that you
+have set up. For more information about test accounts, see the next section.</p>
+
+<p>See <a
+href="{@docRoot}guide/google/play/licensing/licensing-reference.html#server-response-codes">Server
+Response Codes</a> for a list of
+test responses available and their meanings. </p>
+
+
+<h3 id="test-acct-setup">Setting up test accounts</h3>
+
+<p>In some cases, you might want to let multiple teams of developers test
+licensing on applications that will ultimately be published through your
+publisher account, but without giving them access to your publisher account's
+sign-in credentials. To meet that need, the Google Play publisher site lets
+you set up one or more optional <em>test accounts</em> — accounts that are
+authorized to query the licensing server and receive static test responses from
+your publisher account.</p>
+
+<p>Test accounts are standard Google accounts that you register on your
+publisher account, such that they will receive the test response for
+applications that you have uploaded. Developers can then sign in to their
+devices or emulators using the test account credentials and initiate license
+checks from installed applications. When the licensing server receives a license
+check from a user of a test account, it returns the static test response
+configured for the publisher account. </p>
+
+<p>Necessarily, there are limitations on the access and permissions given to
+users signed in through test accounts, including:</p>
+
+<ul>
+<li>Test account users can query the licensing server only for applications that
+are already uploaded to the publisher account. </li>
+<li>Test account users do not have permission to upload applications to your
+publisher account.</li>
+<li>Test account users do not have permission to set the publisher account's
+static test response.</li>
+</ul>
+
+<p>The table below summarizes the differences in capabilities, between the
+publisher account, a test account, and any other account.</p>
+
+<p class="table-caption" id="acct-types-table"><strong>Table 1.</strong>
+Differences in account types for testing licensing.</p>
+
+<table>
+<tr>
+<th>Account Type</th>
+<th>Can check license before upload?</th>
+<th>Can receive test response?</th>
+<th>Can set test response?</th>
+</tr>
+
+<tr>
+<td>Publisher account</td>
+<td>Yes</td>
+<td>Yes</td>
+<td>Yes</td>
+</tr>
+
+<tr>
+<td>Test account</td>
+<td>No</td>
+<td>Yes</td>
+<td>No</td>
+</tr>
+
+<tr>
+<td>Other</td>
+<td>No</td>
+<td>No</td>
+<td>No</td>
+</tr>
+</table>
+
+<h4 id="reg-test-acct">Registering test accounts on the publisher account</h4>
+
+<p>To get started, you need to register each test account in your publisher
+account. As shown in Figure 4, you
+register test accounts in the Licensing panel of your publisher account's Edit
+Profile page. Simply enter the accounts as a comma-delimited list and click
+<strong>Save</strong> to save your profile changes.</p>
+
+<p>You can use any Google account as a test account. If you want to own and
+control the test accounts, you can create the accounts yourself and distribute
+the credentials to your developers or testers.</p>
+
+<h4 id="test-app-upload">Handling application upload and distribution for test
+account users</h4>
+
+<p>As mentioned above, users of test accounts can only receive static test
+responses for applications that are uploaded to the publisher account. Since
+those users do not have permission to upload applications, as the publisher you
+will need to work with those users to collect apps for upload and distribute
+uploaded apps for testing. You can handle collection and distribution in any way
+that is convenient. </p>
+
+<p>Once an application is uploaded and becomes known to the licensing server,
+developers and testers can continue modify the application in their local
+development environment, without having to upload new versions. You only need to
+upload a new version if the local application increments the
+<code>versionCode</code> attribute in the manifest file. </p>
+
+<h4 id="test-key">Distributing your public key to test account users</h4>
+
+<p>The licensing server handles static test responses in the normal way,
+including signing the license response data, adding extras parameters, and so
+on. To support developers who are implementing licensing using test accounts,
+rather than the publisher account, you will need to distribute
+your public key to them. Developers without access to the publisher site do not
+have access to your public key, and without the key they won't be able to
+verify license responses. </p>
+
+<p>Note that if you decide to generate a new licensing key pair for your account
+for some reason, you need to notify all users of test accounts. For
+testers, you can embed the new key in the application package and distribute it
+to users. For developers, you will need to distribute the new key to them
+directly. </p>
+
+
+<h3 id="acct-signin">Signing in to an authorized account in the runtime
+environment</h3>
+
+<p>The licensing service is designed to determine whether a given user is
+licensed to use a given application — during a license check, the Google
+Play application gathers the user ID from the primary account on the system
+and sends it to the server, together with the package name of the application
+and other information. However, if there is no user information available, the
+license check cannot succeed, so the Google Play application terminates the
+request and returns an error to the application. </p>
+
+<p>During testing, to ensure that your application can successfully query the
+licensing server, you must make sure that you sign in to an account <em>on the
+device or emulator</em> using:</p>
+
+<ul>
+<li>The credentials of a publisher account, or</li>
+<li>The credentials of a test account that is registered with a publisher
+account</li>
+</ul>
+
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>Signing in to a Google account on an emulator</h2>
+
+<p>If you are testing licensing on an emulator, you need to sign in to a Google
+account on the emulator. If you do not see an option to create a new Google
+account, the problem might be that your AVD is running a standard Android system
+image, rather than the Google APIs Add-On, API 8 (release 2) or higher. </p>
+
+<p style="margin-top:.5em;">For more information, see <a
+href="#runtime-setup">Setting up the runtime environment</a>, above.</p>
+
+</div>
+</div>
+
+<p>Signing in using a publisher account offers the advantage of letting your
+applications receive static test responses even before the applications are
+uploaded to the publisher site.</p>
+
+<p>If you are part of a larger organization or are working with external groups
+on applications that will be published through your site, you will more likely
+want to distribute test accounts instead, then use those to sign in during
+testing. </p>
+
+<p>To sign in on a device or emulator, follow the steps below. The preferred
+approach is to sign in as the primary account — however, if there are
+other accounts already in use on the device or emulator, you can create an
+additional account and sign in to it using the publisher or test account
+credentials. </p>
+
+<ol>
+<li>Open Settings > Accounts & sync</li>
+<li>Select <strong>Add Account</strong> and choose to add a Google account.
+</li>
+<li>Select <strong>Next</strong> and then <strong>Sign in</strong>.</li>
+<li>Enter the username and password of either the publisher account or a test
+account that is registered in the publisher account.</li>
+<li>Select <strong>Sign in</strong>. The system signs you in to the new
+account.</li>
+</ol>
+
+<p>Once you are signed in, you can begin testing licensing in your application
+(if you have completed the LVL integration steps above). When your application
+initiates a license check, it will receive a response containing the static test
+response configured on the publisher account. </p>
+
+<p>Note that, if you are using an emulator, you will need to sign in to the
+publisher account or test account each time you wipe data when restarting the
+emulator.</p>
+
+<p>Once you've completed the setup procedures, continue to <a
+href="{@docRoot}guide/google/play/licensing/adding-licensing.html">Adding Licensing to Your App</a>.</p>
+
+
+
diff --git a/docs/html/guide/google/play/publishing/multiple-apks.jd b/docs/html/guide/google/play/publishing/multiple-apks.jd
new file mode 100644
index 0000000..e41817e
--- /dev/null
+++ b/docs/html/guide/google/play/publishing/multiple-apks.jd
@@ -0,0 +1,643 @@
+page.title=Multiple APK Support
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Quickview</h2>
+ <ul>
+ <li>Simultaneously publish different APKs for different
+device configurations</li>
+ <li>Different APKs are distributed to different devices based on filters declared in the
+manifest file</li>
+ <li>You should publish multiple APKs only when it's not possible or reasonable to
+support all desired devices with a single APK</li>
+ </ul>
+
+ <h2>In this document</h2>
+<ol>
+ <li><a href="#Concepts">Publishing Concepts</a>
+ <ol>
+ <li><a href="#Active">Active APKs</a></li>
+ <li><a href="#SimpleAndAdvanced">Simple mode and advanced mode</a></li>
+ </ol>
+ </li>
+ <li><a href="#HowItWorks">How Multiple APKs Work</a>
+ <ol>
+ <li><a href="#SupportedFilters">Supported filters</a></li>
+ <li><a href="#Rules">Rules for multiple APKs</a></li>
+ </ol>
+ </li>
+ <li><a href="#CreatingApks">Creating Multiple APKs</a>
+ <ol>
+ <li><a href="#VersionCodes">Assigning version codes</a></li>
+ </ol>
+ </li>
+ <li><a href="#SingleAPK">Using a Single APK Instead</a>
+ <ol>
+ <li><a href="#TextureOptions">Supporting multiple GL textures</a></li>
+ <li><a href="#ScreenOptions">Supporting multiple screens</a></li>
+ <li><a href="#ApiLevelOptions">Supporting multiple API levels</a></li>
+ </ol>
+ </li>
+</ol>
+
+ <h2>See also</h2>
+<ol>
+ <li><a href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a></li>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></li>
+ <li><a href="{@docRoot}tools/extras/support-library.html">Compatibility
+Package</a></li>
+ <li><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">Android API Levels</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>Multiple APK support is a feature on Google Play that allows you to publish different APKs
+for your application that are each targeted to different device configurations. Each APK is a
+complete and independent version of your application, but they share the same application listing on
+Google Play and must share the same package name and be signed with the same release key. This
+feature is useful for cases in which your application cannot reach all desired devices with a single
+APK.</p>
+
+<p>Android-powered devices may differ in several ways and it's important
+to the success of your application that you make it available to as many devices as possible.
+Android applications usually run on most compatible devices with a single APK, by supplying
+alternative resources for different configurations (for example, different layouts for different
+screen sizes) and the Android system selects the appropriate resources for the device at runtime. In
+a few cases, however, a single APK is unable to support all device configurations, because
+alternative resources make the APK file too big (greater than 50MB) or other technical challenges
+prevent a single APK from working on all devices.</p>
+
+<p>Although <strong>we encourage you to develop and publish a single APK</strong> that supports as
+many device configurations as possible, doing so is sometimes not possible. To help
+you publish your application for as many devices as possible, Google Play allows you to
+publish multiple APKs under the same application listing. Google Play then supplies each APK to
+the appropriate devices based on configuration support you've declared in the manifest file of each
+APK.</p>
+
+<p>By publishing your application with multiple APKs, you can:</p>
+
+<ul>
+ <li>Support different OpenGL texture compression formats with each APK.</li>
+ <li>Support different screen configurations with each APK.</li>
+ <li>Support different platform versions with each APK.</li>
+</ul>
+
+<p>Currently, these are the only device characteristics that Google Play supports for publishing
+multiple APKs as the same application.</p>
+
+<p class="note"><strong>Note:</strong> You should generally use multiple APKs to support
+different device configurations <strong>only when your APK is too large</strong> (greater than
+50MB). Using a single APK to support different configurations is always the best practice,
+because it makes the path for application updates simple and clear for users (and also makes
+your life simpler by avoiding development and publishing complexity). Read the section below about
+<a href="#SingleAPK">Using a Single APK Instead</a> to
+consider your options before publishing multiple APKs.</p>
+
+
+<h2 id="Concepts">Publishing Concepts</h2>
+
+<p>Before you start publishing multiple APKs on Google Play, you must understand a few
+concepts regarding how the Google Play publisher site works.</p>
+
+<h3 id="Active">Active APKs</h3>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <h4>The difference between "Publish" and "Save"</h4>
+ <p>When editing your application, there are two buttons on the top-right side of the page. The
+first button is either <strong>Publish</strong> or <strong>Unpublish</strong> and the second
+button is always <strong>Save</strong> (but its behavior changes).</p>
+ <p>When your application is new or you have unpublished it from Google Play, the first
+button says <strong>Publish</strong>. Clicking it will publish any APKs listed as
+Active, making them available on Google Play. Also while your application is new
+or unpublished, clicking <strong>Save</strong> will save any changes you've made, such
+as information added to the Product details and APKs you've uploaded, but nothing is made visible on
+Google Play—this allows you to save your changes and sign out of the publisher site before
+deciding to publish.</p>
+ <p>Once you've published your application, the first button changes to
+<strong>Unpublish</strong>. Clicking it in this state unpublishes your application so that none
+of the APKs are available on Google Play. Also while published, the behavior of the
+<strong>Save</strong> button is different. In this state, clicking <strong>Save</strong> not
+only saves all your changes, but also publishes them to Google Play. For example, if you've
+already published your application and then make changes to your product details or activate new
+APKs, clicking <strong>Save</strong> makes all those changes live on Google Play.</p>
+</div>
+</div>
+
+
+<p>Before you can publish your application (whether publishing one or multiple APKs), you
+must "activate" your APK(s) from the <strong>APK files</strong> tab. When you activate an APK, it
+moves into the list of <em>Active</em> APKs. This list allows you to preview which APK(s)
+you're about to publish.</p>
+
+<p>If there are no errors, any "active" APK will be published to
+Google Play when you click the <strong>Publish</strong> button (if the application is
+unpublished) or when you click the <strong>Save</strong> button (if the application is
+already published).</p>
+
+
+<h3 id="SimpleAndAdvanced">Simple mode and advanced mode</h3>
+
+<p>The Google Play publisher site provides two modes for managing the APKs associated with
+your application: <em>simple mode</em> and <em>advanced mode</em>. You can switch between these by
+clicking the
+link at the top-right corner of the <strong>APK files</strong> tab.</p>
+
+<p>Simple mode is the traditional way to publish an application, using one APK at a time. In
+simple mode, only one APK can be activated at a time. If you upload a new APK to update
+the application, clicking "Activate" on the new APK deactivates the currently
+active APK (you must then click <strong>Save</strong> to publish the new APK).</p>
+
+<p>Advanced mode allows you to activate and publish multiple APKs that are each designed for a
+specific set of device configurations. However, there are several rules based on the manifest
+declarations in each APK that determine whether you're allowed to activate each APK along with
+others. When you activate an APK and it violates one of the rules, you will receive an error or
+warning message. If it's an error, you cannot publish until you resolve the problem; if it's a
+warning, you can publish the activated APKs, but there might be unintended consequences as to
+whether your application is available for different devices. These rules are discussed more
+below.</p>
+
+
+<h2 id="HowItWorks">How Multiple APKs Work</h2>
+
+<p>The concept for using multiple APKs on Google Play is that you have just one entry in
+Google Play for your application, but different devices might download a different APK. This
+means that:</p>
+
+<ul>
+ <li>You maintain only one set of product details (app description, icons, screenshots, etc.).
+This also means you <em>cannot</em> charge a different price for different APKs.</li>
+ <li>All users see only one version of your application on Google Play, so they are not
+confused by different versions you may have published that are "for tablets" or
+"for phones."</li>
+ <li>All user reviews are applied to the same application listing, even though users on different
+devices may have different APKs.</li>
+ <li>If you publish different APKs for different versions of Android (for different API levels),
+then when a user's device receives a system update that qualifies them for a different APK you've
+published, Google Play updates the user's application to the APK designed for the higher version
+of Android. Any system data associated with the application is retained (the same as with normal
+application updates when using a single APK).</li>
+</ul>
+
+<p>To publish multiple APKs for the same application, you must enable <strong>Advanced mode</strong>
+in your application's <strong>APK files</strong> tab (as discussed in the previous section). Once
+in advanced mode, you can upload, activate, then publish multiple APKs for the same application. The
+following sections describe more about how it works.</p>
+
+
+<h3 id="SupportedFilters">Supported filters</h3>
+
+<p>Which devices receive each APK is determined by <a
+href="{@docRoot}guide/google/play/filters.html">Google Play filters</a> that are specified by
+elements in the manifest file of each APK. However, Google Play allows you to publish multiple
+APKs only when each APK uses filters to support a variation of the following
+device characteristics:</p>
+
+<ul>
+ <li><strong>OpenGL texture compression formats</strong>
+ <p>This is based on your manifest file's <a
+href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html">{@code
+<supports-gl-texture>}</a> element(s).</p>
+ <p>For example, when developing a game that uses OpenGL ES, you can provide one APK for
+devices that support ATI texture compression and a separate APK for devices
+that support PowerVR compression (among many others).</p>
+ <br/>
+ </li>
+
+ <li><strong>Screen size (and, optionally, screen density)</strong>
+ <p>This is based on your manifest file's <a
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
+<supports-screens>}</a> <em>or</em> <a
+href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
+<compatible-screens>}</a> element. You should never use both elements and you should use only
+<a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
+<supports-screens>}</a> when possible.</p>
+ <p>For example, you can provide one APK that supports small and normal size screens and another
+APK that supports large and xlarge screens.</p>
+
+ <p class="note"><strong>Note:</strong> The Android system provides strong support for
+applications to support all screen configurations with a single APK. You should avoid creating
+multiple APKs to support different screens unless absolutely necessary and instead follow the guide
+to <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
+Screens</a> so that your application is flexible and can adapt to all screen configurations
+with a single APK.</p>
+ <p class="caution"><strong>Caution:</strong> By default, all screen size attributes in the <a
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
+<supports-screens>}</a> element are "true" if you do not declare them otherwise. However,
+because the {@code android:xlargeScreens} attribute was added in Android 2.3 (API level
+9), Google Play will assume that it is "false" if your application does not set either <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+android:minSdkVersion}</a> or <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+android:targetSdkVersion}</a> to "9" or higher.</p>
+ <p class="caution"><strong>Caution:</strong> You should not combine both <a
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
+<supports-screens>}</a> and <a
+href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
+<compatible-screens>}</a> elements in your manifest file. Using both increases the chances
+that you'll introduce an error due to conflicts between them. For help deciding which to use, read
+<a href="{@docRoot}guide/practices/screens-distribution.html">Distributing to Specific Screens</a>.
+If you can't avoid using both, be aware that for any conflicts in agreement between a given size,
+"false" will win.</p>
+ <br/>
+ </li>
+
+ <li><strong>API level</strong>
+ <p>This is based on your manifest file's <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element.
+You
+can use both the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+android:minSdkVersion}</a> and <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#max">{@code android:maxSdkVersion}</a>
+attributes to specify support for different API levels.</p>
+ <p>For example, you can publish your application with one APK that supports API levels 4 - 7
+(Android 1.6 - 2.1)—using only APIs available since API level 4 or lower—and another
+APK that supports API levels 8 and above (Android 2.2+)—using APIs available since API level 8
+or lower.</p>
+ <div class="note">
+ <p><strong>Note:</strong></p>
+ <ul>
+ <li>If you use this characteristic as the factor to distinguish multiple APKs, then the APK
+with a higher <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+android:minSdkVersion}</a> value must have a higher <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code android:versionCode}</a>
+value. This is also true if two APKs overlap their device support based on a different supported
+filter. This ensures that when a device receives a system update, Google Play can offer the user
+an update for your application (because updates are based on an increase in the app version code).
+This requirement is described further in the section below about <a href="#Rules">Rules for
+multiple APKs</a>.</li>
+ <li>You should avoid using <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#max">{@code
+android:maxSdkVersion}</a> in general, because as long as you've properly developed your
+application with public APIs, it is always compatible with future versions of Android. If you want
+to publish a different APK for higher API levels, you still do not need to specify the
+maximum version, because if the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+android:minSdkVersion}</a> is {@code "4"} in one APK and {@code "8"} in another, devices that
+support API level 8 or higher will always receive the second APK (because it's version code is
+higher, as per the previous note).</li>
+ </ul>
+ </div>
+ </li>
+</ul>
+
+<p>Other manifest elements that enable <a
+href="{@docRoot}guide/google/play/filters.html">Google Play filters</a>—but are not
+listed above—are still applied for each APK as usual. However, Google Play does not allow
+you to publish multiple APKs based on variations of them. Thus, you cannot publish
+multiple APKs if the above listed filters are the same for each APK (but the APKs differ based on
+other characteristics in the manifest file). For
+example, you cannot provide different APKs that differ purely on the <a
+href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">{@code
+<uses-configuration>}</a> characteristics.</p>
+
+
+
+<h3 id="Rules">Rules for multiple APKs</h3>
+
+<p>Before you enable advanced mode to publish multiple APKs for your application, you need to
+understand the following rules that define how publishing multiple APKs works:</p>
+
+<ul>
+ <li>All APKs you publish for the same application <strong>must have the same package
+name and be signed with the same certificate key</strong>.</li>
+
+ <li>Each APK <strong>must have a different version code</strong>, specified by the
+<a href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code
+android:versionCode}</a> attribute.</li>
+
+ <li>Each APK <strong>must not exactly match the configuration support of another APK</strong>.
+ <p>That is, each APK must declare slightly different support for at least one of
+the <a href="#SupportedFilters">supported Google Play filters</a> (listed above).</p>
+ <p>Usually, you will differentiate your APKs based on a specific characteristic (such as the
+supported texture compression formats), and thus, each APK will declare support for different
+devices. However, it's OK to publish multiple APKs that overlap their support slightly. When two
+APKs do overlap (they support some of the same device configurations), a device that falls within
+that overlap range will receive the APK with a higher version code (defined by <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code
+android:versionCode}</a>).</p></li>
+
+ <li>You cannot activate a new APK that has a version code lower than that of the APK it's
+replacing. For example, say you have an active APK for screen sizes small - normal with version code
+0400, then try to replace it with an APK for the same screen sizes with version code 0300. This
+raises an error, because it means users of the previous APK will not be able to update the
+application.</li>
+
+ <li>An APK that requires a <strong>higher API level</strong> must have a <strong>higher
+version code</strong>.
+ <p>This is true only when either: the APKs differ based <em>only</em> on the
+supported API levels (no other <a href="#SupportedFilters">supported filters</a>
+distinguish the APKs from each other) <em>or</em> when the APKs do use another supported filter, but
+there is an overlap between the APKs within that filter.</p>
+ <p>This is important because a user's device receives an application update from
+Google Play only if the version code for the APK on Google Play is higher than the version
+code of the APK currently on the device. This ensures that if a device receives a system update that
+then qualifies it to install the APK for higher API levels, the device receives an application
+update because the version code increases.</p>
+<p class="note"><strong>Note:</strong> The size of the version code increase is irrelevant; it
+simply needs to be larger in the version that supports higher API levels.</p>
+ <p>Here are some examples:</p>
+ <ul>
+ <li>If an APK you've uploaded for API levels 4 and above (Android 1.6+) has a version code of
+{@code 0400}, then an APK for API levels 8 and above (Android 2.2+) must be {@code 0401} or
+greater. In this case, the API level is the only supported filter used, so the version codes
+<strong>must increase</strong> in correlation with the API level support for each APK, so that users
+get an update when they receive a system update.</li>
+ <li>If you have one APK that's for API level 4 (and above) <em>and</em> small -
+large screens, and another APK for API level 8 (and above) <em>and</em> large - xlarge screens, then
+the version codes <strong>must increase</strong>. In this case, the API level filter is used to
+distinguish each APK, but so is the screen size. Because the screen sizes overlap (both APKs
+support large screens), the version codes must still be in order. This ensures that a large screen
+device that receives a system update to API level 8 will receive an update for the second
+APK.</li>
+ <li>If you have one APK that's for API level 4 (and above) <em>and</em> small -
+normal screens, and another APK for API level 8 (and above) <em>and</em> large - xlarge
+screens, then the version codes <strong>do not need to increase</strong> in correlation with the API
+levels. Because there is no overlap within the screen size filter, there are no devices that
+could potentially move between these two APKs, so there's no need for the version codes to
+increase from the lower API level to the higher API level.</li>
+ </ul>
+ </li>
+
+</ul>
+
+<p>Failure to abide by the above rules results in an error on the Google Play publisher site
+when you activate your APKs—you will be unable to publish your application until you
+resolve the error.</p>
+
+<p>There are other conflicts that might occur when you activate your APKs, but which will result
+in warnings rather than errors. Warnings can be caused by the following:</p>
+
+<ul>
+ <li>When you modify an APK to "shrink" the support for a device's characteristics and no other
+APKs support the devices that then fall outside the supported range. For example, if an APK
+currently supports small and normal size screens and you change it to support only small screens,
+then you have shrunk the pool of supported devices and some devices will no longer see your
+application on Google Play. You can resolve this by adding another APK that supports normal size
+screens so that all previously-supported devices are still supported.</li>
+
+ <li>When there are "overlaps" between two or more APKs. For example, if an APK supports screen
+sizes small, normal, and large, while another APK supports sizes large and xlarge, there is an
+overlap, because both APKs support large screens. If you do not resolve this, then devices that
+qualify for both APKs (large screen devices in the example) will receive whichever APK has the
+highest version code.</li>
+</ul>
+
+<p>When such conflicts occur, you will see a warning message, but you can still publish your
+application.</p>
+
+
+
+<h2 id="CreatingApks">Creating Multiple APKs</h2>
+
+<p>Once you decide to publish multiple APKs, you probably need to create separate
+Android projects for each APK you intend to publish so that you can appropriately develop them
+separately. You can do this by simply duplicating your existing project and give it a new name.
+(Alternatively, you might use a build system that can output different resources—such
+as textures—based on the build configuration.)</p>
+
+<p class="note"><strong>Tip:</strong> One way to avoid duplicating large portions of your
+application code is to use a <a
+href="{@docRoot}tools/projects/index.html#LibraryProjects">library project</a>. A library
+project holds shared code and resources, which you can include in your actual application
+projects.</p>
+
+<p>When creating multiple projects for the same application, it's a good practice to identify each
+one with a name that indicates the device restrictions to be placed on the APK, so you can
+easily identify them. For example, "HelloWorld_8" might be a good name for an
+application designed for API level 8 and above.</p>
+
+<p class="note"><strong>Note:</strong> All APKs you publish for the same application
+<strong>must have the same package name and be signed with the same certificate key</strong>. Be
+sure you also understand each of the <a href="#Rules">Rules for multiple APKs</a>.</p>
+
+
+<h3 id="VersionCodes">Assigning version codes</h3>
+
+<p>Each APK for the same application <strong>must have a unique version code</strong>, specified by
+the <a href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code
+android:versionCode}</a> attribute. You must be careful about assigning version codes when
+publishing multiple APKs, because they must each be different, but in some
+cases, must or should be defined in a specific order, based on the configurations that each APK
+supports.</p>
+
+<h4>Ordering version codes</h4>
+
+<p>An APK that requires a higher API level must usually have a higher version code. For example, if
+you create two APKs to support different API levels, the APK for the higher API levels must have the
+higher version code. This ensures that if a device receives a system update that then qualifies it
+to install the APK for higher API levels, the user receives a notification to update the app. For
+more information about how this requirement applies, see the section above about <a
+href="#Rules">Rules for multiple APKs</a>.</p>
+
+<p>You should also consider how the order of version codes might affect which APK your users
+receive either due to overlap between coverage of different APKs or future changes you might make to
+your APKs.</p>
+
+<p>For example, if you have different APKs based on screen size, such as one for small - normal and
+one for large - xlarge, but foresee a time when you will change the APKs to be one for small and one
+for normal - xlarge, then you should make the version code for the large - xlarge APK be higher.
+That way, a normal size device will receive the appropriate update when you make the change, because
+the version code increases from the existing APK to the new APK that now supports the device. </p>
+
+<p>Also, when creating multiple APKs that differ based on support for different OpenGL texture
+compression formats, be aware that many devices support multiple formats. Because a device
+receives the APK with the highest version code when there is an overlap in coverage between two
+APKs, you should order the version codes among your APKs so that the APK with the
+preferred compression format has the highest version code. For example, you might want to perform
+separate builds for your app using PVRTC, ATITC, and ETC1 compression formats. If you prefer these
+formats in this exact order, then the APK that uses PVRTC should have the highest version code, the
+APK that uses ATITC has a lower version code, and the version with ETC1 has the lowest. Thus, if a
+device supports both PVRTC and ETC1, it receives the APK with PVRTC, because it has the highest
+version code.</p>
+
+
+<h4>Using a version code scheme</h4>
+
+<p>In order to allow different APKs to update their version codes independent of others (for
+example, when you fix a bug in only one APK, so don't need to update all APKs), you should use a
+scheme for your version codes that
+provides sufficient room between each APK so that you can increase the code in one without requiring
+an increase in others. You should also include your actual version name in the code (that is, the
+user visible version assigned to <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#vname">{@code android:versionName}</a>),
+so that it's easy for you to associate the version code and version name.</p>
+
+<p class="note"><strong>Note:</strong> When you increase the version code for an APK, Google
+Play will prompt users of the previous version to update the application. Thus, to avoid
+unnecessary updates, you should not increase the version code for APKs that do not actually
+include changes.</p>
+
+<p>We suggest using a version code with at least 7 digits: integers that represent
+the supported configurations are in the higher order bits, and the version name (from <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#vname">{@code
+android:versionName}</a>) is in the lower order bits. For example, when the application version
+name is 3.1.0, version codes for an API level 4
+APK and an API level 11 APK would be something like 0400310 and 1100310, respectively. The first
+two digits are reserved for the API Level (4 and 11, respectively), the middle two digits are for
+either screen sizes or GL texture formats (not used in these examples), and the last three digits
+are for the application's version name (3.1.0). Figure 1 shows two examples that split based on both
+the platform version (API Level) and screen size.</p>
+
+<img src="{@docRoot}images/market/version-codes.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> A suggested scheme for your version codes,
+using the first two digits for the API Level, the second and third digits for the minimum and
+maximum screen size (1 - 4 indicating each of the four sizes) or to denote the texture formats
+and the last three digits for the app version.</p>
+
+<p>This scheme for version codes is just a suggestion for how you should establish a
+pattern that is scalable as your application evolves. In particular, this scheme doesn't
+demonstrate a solution for identifying different texture compression formats. One option might be
+to define your own table that specifies a different integer to each of the different
+compression formats your application supports (for example, 1 might correspond to ETC1 and 2 is
+ATITC, and so on).</p>
+
+<p>You can use any scheme you want, but you should carefully consider how future versions of your
+application will need to increase their version codes and how devices can receive updates when
+either the device configuration changes (for example, due to a system update) or when you modify the
+configuration support for one or several of the APKs.</p>
+
+
+
+
+<h2 id="SingleAPK">Using a Single APK Instead</h2>
+
+<p><strong>Creating multiple APKs for your application is not the normal procedure</strong> for
+publishing an application on Google Play. In most cases, you should be able to publish your
+application to most users with a single APK and we encourage that you do so. When you encounter
+a situation in which using a single APK becomes difficult, you should carefully consider all your
+options before deciding to publish multiple APKs.</p>
+
+<p>First of all, there are a few key benefits to developing a single APK that supports all
+devices:</p>
+
+<ul>
+ <li><strong>Publishing and managing your application is easier.</strong>
+ <p>With only one APK to worry about at any given time, you're less likely to become confused by
+which APK is what. You also don't have to keep track of multiple version codes for each
+APK—by using only one APK, you can simply increase the version code with each release and
+be done.</p> </li>
+ <li><strong>You need to manage only a single code base.</strong>
+ <p>Although you can use a <a
+href="{@docRoot}tools/projects/index.html#LibraryProjects">library project</a>
+to share code between multiple Android projects, it's still likely that you'll reproduce some code
+across each project and this could become difficult to manage, especially when resolving
+bugs.</p></li>
+ <li><strong>Your application can adapt to device configuration changes.</strong>
+ <p>By creating a single APK that contains all the resources for each device configuration, your
+application can adapt to configuration changes that occur at runtime. For example, if the user docks
+or otherwise connects a handset device to a larger screen, there's a chance that this will invoke a
+system configuration change to support the larger screen. If you include all resources for different
+screen configurations in the same APK, then your application will load alternative resources and
+optimize the user experience for the new interface.</p>
+ </li>
+ <li><strong>App restore across devices just works.</strong>
+ <p>If a user has enabled data backup on his or her current device and then buys a new device
+that has a different configuration, then when the user's apps are automatically restored during
+setup, the user receives your application and it runs using the resources optimized for that device.
+For example, on a new tablet, the user receives your application and it runs with your
+tablet-optimized resources. This restore
+process does not work across different APKs, because each APK can potentially have different
+permissions that the user has not agreed to, so Google Play may not restore the application at
+all. (If you use multiple APKs, the user receives either the exact same APK if it's compatible or
+nothing at all and must manually download your application to get the APK designed for the new
+device.)</p></li>
+</ul>
+
+<p>The following sections describe some of the other options you should use to support multiple
+device configurations before deciding to publish multiple APKs.</p>
+
+
+
+<h3 id="TextureOptions">Supporting multiple GL textures</h3>
+
+<p>To support multiple types of GL textures with a single APK, your application should query the GL
+texture formats supported on the device and then use the appropriate resources or download
+them from a web server. For example, in order to keep the size of your APK small, you can query the
+device's support for different GL texture formats when the application starts for the first time and
+then download only the textures you need for that device.</p>
+
+<p>For maximum performance and compatibility, your application should use ETC1 textures wherever it
+doesn't impact the visual quality. However, because ETC1 cannot deal with images that have drastic
+chroma changes, such as line art and (most) text, and doesn't support alpha, it may not the best
+format for all textures.</p>
+
+<p>With a single APK, you should try to use ETC1 textures and uncompressed textures whenever
+reasonable, and consider the use of PVRTC, ATITC, or DXTC as a last resort when ETC1 does not
+suffice.</p>
+
+<p>Here's an example query for supported texture compression formats from inside a
+{@link android.opengl.GLSurfaceView.Renderer GLSurfaceView.Renderer}:</p>
+
+<pre>
+public void onSurfaceChanged(GL10 gl, int w, int h) {
+ String extensions = gl.glGetString(GL10.GL_EXTENSIONS);
+ Log.d("ExampleActivity", extensions);
+}
+</pre>
+
+<p>This returns a string that lists each of the supported compression formats.</p>
+
+
+
+<h3 id="ScreenOptions">Supporting multiple screens</h3>
+
+<p>Unless your APK file exceeds the Google Play size limit of 50MB, supporting multiple screens
+should always be done with a single APK. Since Android 1.6, the Android system manages most of the
+work required for your application to run successfully on a variety of screen sizes and
+densities.</p>
+
+<p>To further optimize your application for different screen sizes and densities, you should provide
+<a href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">alternative
+resources</a> such as bitmap drawables at different resolutions and different layout designs for
+different screen sizes.</p>
+
+<p>For more information about how to support multiple screens with a single APK, read <a
+href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
+
+<p>Additionally, you should consider using a support library from the <a
+href="{@docRoot}tools/extras/support-library.html">Compatibility Package</a> so that you can add <a
+href="{@docRoot}guide/components/fragments.html">Fragments</a> to your activity designs
+when running on larger screens such as tablets.</p>
+
+
+
+<h3 id="ApiLevelOptions">Supporting multiple API levels</h3>
+
+<p>If you want to support as many versions of the Android platform as possible, you should use
+only APIs available in the lowest reasonable version. For example, your application may not require
+APIs newer than Android 2.1 (API Level 7), which makes an application available to
+over 95% of Android-powered devices (as indicated by the <a
+href="{@docRoot}about/dashboards/index.html">Platform Versions</a> dashboard).</p>
+
+<p>By using a support library from the <a
+href="{@docRoot}tools/extras/support-library.html">Compatibility Package</a>, you can also use APIs
+from some of the latest versions (such as Android 3.0) while
+still supporting versions as low as Android 1.6. The support library includes APIs for <a
+href="{@docRoot}guide/components/fragments.html">Fragments</a>, <a
+href="{@docRoot}guide/components/loaders.html">Loaders</a>, and more. Using the fragment
+APIs is particularly valuable so that you can optimize your user interface for large devices such as
+tablets.</p>
+
+<p>Alternatively, if you want to use some APIs that are available only in newer versions of Android
+(which your application can still function without), then you should consider using reflection. By
+using reflection, you can check whether the current device supports certain APIs. If the APIs are
+not available, your application can gracefully disable and hide the feature.</p>
+
+<p>Another way to use new APIs only when running on a version that supports them is to check the
+API level of the current device. That is, you can query the value of {@link
+android.os.Build.VERSION#SDK_INT} and create different code paths depending on the API level
+supported by the device. For example:</p>
+
+<pre>
+if (android.os.Build.VERSION.SDK_INT >= 11) {
+ // Use APIs supported by API level 11 (Android 3.0) and up
+} else {
+ // Do something different to support older versions
+}
+</pre>
+
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index 62d18ae..44b977e 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -5,236 +5,80 @@
Below are template spans for adding localized doc titles. Please ensure that
localized titles are added in the language order specified below.
?>
-<ul>
-
- <li>
- <span class="heading">
- <span class="en">Android Basics</span>
- <span class="de" style="display:none">Einführung in Android</span>
- <span class="es" style="display:none">Información básica sobre Android</span>
- <span class="fr" style="display:none">Présentation d'Android</span>
- <span class="it" style="display:none">Nozioni di base su Android</span>
- <span class="ja" style="display:none">Android の基本</span>
- <span class="zh-CN" style="display:none">Android 基础知识</span>
- <span class="zh-TW" style="display:none">Android 簡介</span>
- </span>
+<ul id="nav">
+ <!-- Walkthrough for Developers -- quick overview of what it's like to develop on Android -->
+ <!--<li style="color:red">Overview</li> -->
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/components/index.html">
+ <span class="en">App Components</span>
+ </a></div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/basics/what-is-android.html">
- <span class="en">What Is Android?</span>
- <span class="de" style="display:none">Was ist Android?</span>
- <span class="es" style="display:none">¿Qué es Android?</span>
- <span class="fr" style="display:none">Qu'est-ce qu'Android ?</span>
- <span class="it" style="display:none">Che cos'è Android?</span>
- <span class="ja" style="display:none">Android とは</span>
- <span class="zh-CN" style="display:none">Android 是什么?</span>
- <span class="zh-TW" style="display:none">什麼是 Android?</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/fundamentals.html">
- <span class="en">Application Fundamentals</span>
- <span class="de" style="display:none">Anwendungsgrundlagen</span>
- <span class="es" style="display:none">Fundamentos de las aplicaciones</span>
- <span class="fr" style="display:none">Principes de base des applications</span>
- <span class="it" style="display:none">Concetti fondamentali sulle applicazioni</span>
- <span class="ja" style="display:none">開発の基礎</span>
- <span class="zh-CN" style="display:none">应用程序基础</span>
- <span class="zh-TW" style="display:none">應用程式基本原理</span>
- </a></li>
-
- <!-- <li><a style="color:gray;">The Android SDK</a></li> -->
- <!-- <li><a style="color:gray;">Walkthrough for Developers</a></li> -->
- <!-- quick overview of what it's like to develop on Android -->
- </ul>
- </li>
-
- <li>
- <span class="heading">
- <span class="en">Framework Topics</span>
- <span class="de" style="display:none">Framework-Themen</span>
- <span class="es" style="display:none">Temas sobre el framework</span>
- <span class="fr" style="display:none">Thèmes relatifs au framework</span>
- <span class="it" style="display:none">Argomenti relativi al framework</span>
- <span class="ja" style="display:none">フレームワーク トピック</span>
- <span class="zh-CN" style="display:none">框架主题</span>
- <span class="zh-TW" style="display:none">架構主題</span>
- </span>
- <ul>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/fundamentals/activities.html">
- <span class="en">Activities</span>
- </a></div>
+ <li><a href="<?cs var:toroot ?>guide/components/fundamentals.html">
+ <span class="en">App Fundamentals</span></a>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/components/activities.html">
+ <span class="en">Activities</span>
+ </a></div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/topics/fundamentals/fragments.html">
- <span class="en">Fragments</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/fundamentals/loaders.html">
- <span class="en">Loaders</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/fundamentals/tasks-and-back-stack.html">
- <span class="en">Tasks and Back Stack</span></a></li>
+ <li><a href="<?cs var:toroot ?>guide/components/fragments.html">
+ <span class="en">Fragments</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/components/loaders.html">
+ <span class="en">Loaders</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/components/tasks-and-back-stack.html">
+ <span class="en">Tasks and Back Stack</span>
+ </a></li>
</ul>
</li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/fundamentals/services.html">
- <span class="en">Services</span>
- </a></div>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/components/services.html">
+ <span class="en">Services</span>
+ </a></div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/topics/fundamentals/bound-services.html">
- <span class="en">Bound Services</span>
- </a></li>
+ <li><a href="<?cs var:toroot ?>guide/components/bound-services.html">
+ <span class="en">Bound Services</span>
+ </a></li>
</ul>
</li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/providers/content-providers.html">
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/providers/content-providers.html">
<span class="en">Content Providers</span>
</a></div>
- <ul>
- <li>
- <a href="<?cs var:toroot ?>guide/topics/providers/content-provider-basics.html">
- <span class="en">Content Provider Basics<span
-class="new"> new!</span></span>
- </a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/topics/providers/content-provider-creating.html">
- <span class="en">Creating a Content Provider<span
-class="new"> new!</span></span>
- </a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/topics/providers/calendar-provider.html">
- <span class="en">Calendar Provider<span class="new"> new!</span></span>
- </a>
- </li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot ?>guide/topics/intents/intents-filters.html">
- <span class="en">Intents and Intent Filters</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/fundamentals/processes-and-threads.html">
- <span class="en">Processes and Threads</span>
- </a></li>
- </ul>
-
-
- <ul>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/ui/index.html">
- <span class="en">User Interface</span>
- </a></div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/declaring-layout.html">
- <span class="en">XML Layouts</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/ui-events.html">
- <span class="en">Input Events</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/menus.html">
- <span class="en">Menus<span class="new"> new!</span></span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/actionbar.html">
- <span class="en">Action Bar</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/dialogs.html">
- <span class="en">Dialogs</span>
- </a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/ui/notifiers/index.html">
- <span class="en">Notifications</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/notifiers/toasts.html">
- <span class="en">Toast Notifications</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/notifiers/notifications.html">
- <span class="en">Status Bar Notifications</span>
- </a></li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/drag-drop.html">
- <span class="en">Drag and Drop</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/themes.html">
- <span class="en">Styles and Themes</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/custom-components.html">
- <span class="en">Custom Components</span>
- </a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/ui/accessibility/index.html">
- <span class="en">Accessibility<span class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/accessibility/apps.html">
- <span class="en">Making Applications Accessible</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/accessibility/services.html">
- <span class="en">Building Accessibility Services</span>
- </a></li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/binding.html">
- <span class="en">Binding to Data with AdapterView</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/layout-objects.html">
- <span class="en">Common Layout Objects</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/ui/how-android-draws.html">
- <span class="en">How Android Draws Views</span>
- </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/providers/content-provider-basics.html">
+ <span class="en">Content Provider Basics</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/providers/content-provider-creating.html">
+ <span class="en">Creating a Content Provider</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/providers/calendar-provider.html">
+ <span class="en">Calendar Provider</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/providers/contacts-provider.html">
+ <span class="en">Contacts Provider</span>
+ </a></li>
</ul>
- </li><!-- end of User Interface -->
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/resources/index.html">
- <span class="en">Application Resources</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/providing-resources.html">
- <span class="en">Providing Resources</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/accessing-resources.html">
- <span class="en">Accessing Resources</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/runtime-changes.html">
- <span class="en">Handling Runtime Changes</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/localization.html">
- <span class="en">Localization</span>
- </a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/resources/available-resources.html">
- <span class="en">Resource Types</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/animation-resource.html">Animation</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/color-list-resource.html">Color State List</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/drawable-resource.html">Drawable</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/layout-resource.html">Layout</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/menu-resource.html">Menu</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/string-resource.html">String</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/style-resource.html">Style</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/more-resources.html">More Types</a></li>
- </ul>
- </li><!-- end of resource types -->
- </ul>
- </li><!-- end of app resources -->
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/data/data-storage.html">
- <span class="en">Data Storage</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/topics/data/backup.html">
- <span class="en">Data Backup</span>
- </a>
- </li>
- </ul>
</li>
- <li><a href="<?cs var:toroot ?>guide/topics/security/security.html">
- <span class="en">Security and Permissions</span>
+ <li><a href="<?cs var:toroot ?>guide/components/intents-filters.html">
+ <span class="en">Intents and Intent Filters</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/components/processes-and-threads.html">
+ <span class="en">Processes and Threads</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/topics/security/permissions.html">
+ <span class="en">Permissions</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/topics/appwidgets/index.html">
+ <span class="en">App Widgets</span>
</a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/manifest/manifest-intro.html">
- <span class="en">The AndroidManifest.xml File</span>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/manifest/manifest-intro.html">
+ <span class="en">Android Manifest</span>
</a></div>
<ul>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/action-element.html"><action></a></li>
@@ -264,86 +108,260 @@
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-permission-element.html"><uses-permission></a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a></li>
</ul>
- </li><!-- end of the manifest file -->
- </ul>
+ </li><!-- end of the manifest file -->
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/ui/index.html">
+ <span class="en">User Interface</span>
+ </a></div>
<ul>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/graphics/index.html">
- <span class="en">Graphics</span>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/overview.html">
+ <span class="en">Overview</span>
+ </a></li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/ui/declaring-layout.html">
+ <span class="en">Layouts</span>
</a></div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/topics/graphics/2d-graphics.html">
- <span class="en">Canvas and Drawables</span></a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/graphics/hardware-accel.html">
- <span class="en">Hardware Acceleration</span></a>
- </li>
- <li><a href="<?cs var:toroot ?>guide/topics/graphics/opengl.html">
- <span class="en">OpenGL</span>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/layout/linear.html">
+ <span class="en">Linear Layout</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/layout/relative.html">
+ <span class="en">Relative Layout</span>
+ </a></li>
+ <!--
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/layout/grid.html">
+ <span class="en">Grid Layout</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/layout/tabs.html">
+ <span class="en">Tab Layout</span>
+ </a></li>
+ -->
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/layout/listview.html">
+ <span class="en">List View</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/layout/gridview.html">
+ <span class="en">Grid View</span>
</a></li>
</ul>
</li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/graphics/animation.html">
- <span class="en">Animation</span>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/ui/controls.html">
+ <span class="en">Input Controls</span>
</a></div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/topics/graphics/prop-animation.html">
- <span class="en">Property Animation</span></a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/graphics/view-animation.html">
- <span class="en">View Animation</span></a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/graphics/drawable-animation.html">
- <span class="en">Drawable Animation</span></a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/controls/button.html">
+ <span class="en">Buttons</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/controls/text.html">
+ <span class="en">Text Fields</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/controls/checkbox.html">
+ <span class="en">Checkboxes</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/controls/radiobutton.html">
+ <span class="en">Radio Buttons</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/controls/togglebutton.html">
+ <span class="en">Toggle Buttons</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/controls/spinner.html">
+ <span class="en">Spinners</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/controls/pickers.html">
+ <span class="en">Pickers</span>
+ </a></li>
+<!--
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/controls/progress.html">
+ <span class="en">Seek and Progress Bars</span>
+ </a></li>
+-->
</ul>
</li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/renderscript/index.html">
- <span class="en">Renderscript</span></a>
- </div>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/ui-events.html">
+ <span class="en">Input Events</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/menus.html">
+ <span class="en">Menus</span></span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/dialogs.html">
+ <span class="en">Dialogs</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/actionbar.html">
+ <span class="en">Action Bar</span>
+ </a></li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/ui/notifiers/index.html">
+ <span class="en">Notifications</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/notifiers/toasts.html">
+ <span class="en">Toast Notifications</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/notifiers/notifications.html">
+ <span class="en">Status Notifications</span>
+ </a></li>
+ </ul>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/search/index.html">
+ <span class="en">Search</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/search/search-dialog.html">Creating a Search Interface</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/search/adding-recent-query-suggestions.html">Adding Recent Query Suggestions</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/search/adding-custom-suggestions.html">Adding Custom Suggestions</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/search/searchable-config.html">Searchable Configuration</a></li>
+ </ul>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/drag-drop.html">
+ <span class="en">Drag and Drop</span>
+ </a></li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/ui/accessibility/index.html">
+ <span class="en">Accessibility</span>
+ </a></div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/topics/renderscript/graphics.html">
- <span class="en">Graphics</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>guide/topics/renderscript/compute.html">
- <span class="en">Compute</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>guide/topics/renderscript/reference.html">
- <span class="en">Runtime API Reference</span>
- </a>
- </li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/accessibility/apps.html">
+ <span class="en">Making Applications Accessible</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/accessibility/services.html">
+ <span class="en">Building Accessibility Services</span>
+ </a></li>
</ul>
</li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/themes.html">
+ <span class="en">Styles and Themes</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/ui/custom-components.html">
+ <span class="en">Custom Components</span>
+ </a></li>
+ </ul>
+ </li><!-- end of User Interface -->
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/media/index.html">
- <span class="en">Multimedia and Camera</span>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/resources/index.html">
+ <span class="en">App Resources</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/overview.html">
+ <span class="en">Overview</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/providing-resources.html">
+ <span class="en">Providing Resources</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/accessing-resources.html">
+ <span class="en">Accessing Resources</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/runtime-changes.html">
+ <span class="en">Handling Runtime Changes</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/localization.html">
+ <span class="en">Localization</span>
+ </a></li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/resources/available-resources.html">
+ <span class="en">Resource Types</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/animation-resource.html">Animation</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/color-list-resource.html">Color State List</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/drawable-resource.html">Drawable</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/layout-resource.html">Layout</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/menu-resource.html">Menu</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/string-resource.html">String</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/style-resource.html">Style</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/more-resources.html">More Types</a></li>
+ </ul>
+ </li><!-- end of resource types -->
+ </ul>
+ </li><!-- end of app resources -->
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/graphics/index.html">
+ <span class="en">Animation and Graphics</span>
+ </a></div>
+ <ul>
+ <li class="nav-section">
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/overview.html">
+ <span class="en">Overview</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/prop-animation.html">
+ <span class="en">Property Animation</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/view-animation.html">
+ <span class="en">View Animation</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/drawable-animation.html">
+ <span class="en">Drawable Animation</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/2d-graphics.html">
+ <span class="en">Canvas and Drawables</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/opengl.html">
+ <span class="en">OpenGL</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/hardware-accel.html">
+ <span class="en">Hardware Acceleration</span>
+ </a></li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/graphics/renderscript/index.html">
+ <span class="en">Renderscript</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/renderscript/graphics.html">
+ <span class="en">Graphics</span></a>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/renderscript/compute.html">
+ <span class="en">Compute</span></a>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/renderscript/reference.html">
+ <span class="en">Runtime API Reference</span></a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li><!-- end of graphics and animation-->
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/media/index.html">
+ <span class="en">Media and Camera</span>
</a></div>
<ul>
<li><a href="<?cs var:toroot ?>guide/topics/media/mediaplayer.html">
<span class="en">Media Playback</span></a>
</li>
+ <li><a href="<?cs var:toroot ?>guide/appendix/media-formats.html">
+ <span class="en">Supported Media Formats</span></a>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/topics/media/audio-capture.html">
+ <span class="en">Audio Capture</span></a>
+ </li>
<li><a href="<?cs var:toroot ?>guide/topics/media/jetplayer.html">
<span class="en">JetPlayer</span></a>
</li>
<li><a href="<?cs var:toroot ?>guide/topics/media/camera.html">
<span class="en">Camera</span></a>
</li>
- <li><a href="<?cs var:toroot ?>guide/topics/media/audio-capture.html">
- <span class="en">Audio Capture</span></a>
- </li>
</ul>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/topics/clipboard/copy-paste.html">
- <span class="en">Copy and Paste</span>
- </a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/sensors/index.html">
- <span class="en">Sensors</span>
+ </li><!-- end of media and camera -->
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/sensors/index.html">
+ <span class="en">Location and Sensors</span>
</a></div>
<ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/location/index.html">
+ <span class="en">Location and Maps</span>
+ </a>
+ <li><a href="<?cs var:toroot ?>guide/topics/location/strategies.html">
+ <span class="en">Location Strategies</span>
+ </a></li>
<li><a href="<?cs var:toroot ?>guide/topics/sensors/sensors_overview.html">
<span class="en">Sensors Overview</span>
</a></li>
@@ -357,415 +375,127 @@
<span class="en">Environment Sensors</span>
</a></li>
</ul>
- </li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/topics/location/index.html">
- <span class="en">Location and Maps</span>
+ </li><!-- end of location and sensors -->
+
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/connectivity/index.html">
+ <span class="en">Connectivity</span>
</a></div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/topics/location/obtaining-user-location.html">
- <span class="en">Obtaining User Location</span>
- </a></li>
- </ul>
- </li>
- <!--<li class="toggle-list">
- <div><a style="color:gray;">Wireless Controls</a></div>
- <ul>
- <li><a style="color:gray;">Wi-Fi</a></li>
- </ul>
- </li> -->
- <!--<li><a style="color:gray;">Localization</a></li> -->
- <li><a href="<?cs var:toroot ?>guide/topics/appwidgets/index.html">
- <span class="en">App Widgets</span></a>
+ <li><a href="<?cs var:toroot?>guide/topics/connectivity/bluetooth.html">
+ <span class="en">Bluetooth</span>
+ </a>
</li>
- <li><a href="<?cs var:toroot?>guide/topics/wireless/bluetooth.html">
- <span class="en">Bluetooth</span></a>
- </li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot?>guide/topics/nfc/index.html">
- <span class="en">Near Field Communication</span></a>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot?>guide/topics/connectivity/nfc/index.html">
+ <span class="en">NFC</span></a>
</div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/topics/nfc/nfc.html">NFC Basics</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/nfc/advanced-nfc.html">Advanced NFC</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/connectivity/nfc/nfc.html">NFC Basics</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/connectivity/nfc/advanced-nfc.html">Advanced NFC</a></li>
</ul>
</li>
- <li><a href="<?cs var:toroot?>guide/topics/wireless/wifip2p.html">
+ <li><a href="<?cs var:toroot?>guide/topics/connectivity/wifip2p.html">
<span class="en">Wi-Fi Direct</span></a>
</li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot?>guide/topics/usb/index.html">
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot?>guide/topics/connectivity/usb/index.html">
<span class="en">USB</span></a>
</div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/topics/usb/accessory.html">Accessory</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/usb/host.html">Host</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/usb/adk.html">Open Accessory Dev Kit</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/connectivity/usb/accessory.html">Accessory</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/connectivity/usb/host.html">Host</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/connectivity/usb/adk.html">Open Accessory Dev Kit</a></li>
</ul>
- </li>
-
- <li><a href="<?cs var:toroot?>guide/topics/network/sip.html">
- <span class="en">Session Initiation Protocol</span>
+ </li>
+ <li><a href="<?cs var:toroot?>guide/topics/connectivity/sip.html">
+ <span class="en">SIP</span>
+ </a>
+ </li>
+
+ </ul>
+ </li><!-- end of connectivity -->
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/text/index.html">
+ <span class="en">Text and Input</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/text/copy-paste.html">
+ <span class="en">Copy and Paste</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/text/creating-input-method.html">
+ <span class="en">Creating an IME</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/text/spell-checker-framework.html">
+ <span class="en">Spelling Checker</span>
+ </a></li>
+ </ul>
+ </li><!-- end of text and input -->
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/data/index.html">
+ <span class="en">Data Storage</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/data/data-storage.html">
+ <span class="en">Storage Options</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/data/backup.html">
+ <span class="en">Data Backup</span>
</a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot?>guide/topics/search/index.html">
- <span class="en">Search</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot?>guide/topics/search/search-dialog.html">Creating a Search Interface</a></li>
- <li><a href="<?cs var:toroot?>guide/topics/search/adding-recent-query-suggestions.html">Adding Recent Query Suggestions</a></li>
- <li><a href="<?cs var:toroot?>guide/topics/search/adding-custom-suggestions.html">Adding Custom Suggestions</a></li>
- <li><a href="<?cs var:toroot?>guide/topics/search/searchable-config.html">Searchable Configuration</a></li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot?>guide/topics/admin/device-admin.html">
- <span class="en">Device Administration</span></a>
- </li>
- <li class="toggle-list">
- <div>
- <a href="<?cs var:toroot?>guide/topics/testing/index.html">
- <span class="en">Testing</span>
- </a>
- </div>
+ <li><a href="<?cs var:toroot ?>guide/topics/data/install-location.html">
+ <span class="en">App Install Location</span>
+ </a></li>
+ </ul>
+ </li><!-- end of data storage -->
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot?>guide/topics/admin/index.html">
+ <span class="en">Administration</span>
+ </a></div>
<ul>
<li>
- <a href="<?cs var:toroot?>guide/topics/testing/testing_android.html">
- <span class="en">Testing Fundamentals</span></a>
+ <a href="<?cs var:toroot?>guide/topics/admin/device-admin.html">
+ <span class="en">Device Policies</span></a>
</li>
+ <!--
<li>
- <a href="<?cs var:toroot?>guide/topics/testing/activity_testing.html">
- <span class="en">Activity Testing</span></a>
+ <a href="<?cs var:toroot?>guide/topics/admin/keychain.html">
+ <span class="en">Certificate Store</span></a>
</li>
- <li>
- <a href="<?cs var:toroot?>guide/topics/testing/contentprovider_testing.html">
- <span class="en">Content Provider Testing</span></a>
- </li>
- <li>
- <a href="<?cs var:toroot?>guide/topics/testing/service_testing.html">
- <span class="en">Service Testing</span></a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/topics/testing/what_to_test.html">
- <span class="en">What To Test</span></a>
- </li>
+ -->
</ul>
- </li>
- </ul>
- </li>
-
- <li>
- <h2>
- <span class="en">Google Play Topics</span>
- </h2>
+ </li><!-- end of administration -->
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/webapps/index.html">
+ <span class="en">Web Apps</span>
+ </a></div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/publishing/publishing.html">
- <span class="en">Publishing on Google Play</span>
+ <li><a href="<?cs var:toroot ?>guide/webapps/overview.html">
+ <span class="en">Overview</span>
</a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/market/licensing/index.html">
- <span class="en">Application Licensing</span></a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot?>guide/market/licensing/overview.html">
- <span class="en">Licensing Overview</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/market/licensing/setting-up.html">
- <span class="en">Setting Up for Licensing</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/market/licensing/adding-licensing.html">
- <span class="en">Adding Licensing to Your App</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/market/licensing/licensing-reference.html">
- <span class="en">Licensing Reference</span></a>
- </li>
- </ul>
- </li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot?>guide/market/billing/index.html">
- <span class="en">In-app Billing</span></a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot?>guide/market/billing/billing_overview.html">
- <span class="en">In-app Billing Overview</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/market/billing/billing_integrate.html">
- <span class="en">Implementing In-app Billing</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/market/billing/billing_best_practices.html">
- <span class="en">Security and Design</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/market/billing/billing_testing.html">
- <span class="en">Testing In-app Billing</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/market/billing/billing_admin.html">
- <span class="en">Administering In-app Billing</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/market/billing/billing_reference.html">
- <span class="en">In-app Billing Reference</span></a>
- </li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot ?>guide/appendix/market-filters.html">
- <span class="en">Filters on Google Play</span></a>
- </li>
- <li><a href="<?cs var:toroot ?>guide/market/publishing/multiple-apks.html">
- <span class="en">Multiple APK Support</span></a>
- </li>
- <li><a href="<?cs var:toroot ?>guide/market/expansion-files.html">
- <span class="en">APK Expansion Files<span class="new"> new!</span></span></a>
- </li>
- </ul>
- </li>
-
-
- <li>
- <span class="heading">
- <span class="en">Developing</span>
- <span class="de" style="display:none">Entwicklung</span>
- <span class="es" style="display:none">Desarrollo</span>
- <span class="fr" style="display:none">Développement</span>
- <span class="it" style="display:none">Sviluppo</span>
- <span class="ja" style="display:none">開発</span>
- <span class="zh-CN" style="display:none">开发</span>
- <span class="zh-TW" style="display:none">開發</span>
- </span>
- <ul>
- <!--<li><a href="">Developing for Android</a></li>
- signing, upgrading, selecting a package name, select device profile, touch, trackball, dpad available, etc. -->
- <li>
- <a href="<?cs var:toroot ?>guide/developing/index.html">
- <span class="en">Introduction</span></a>
- </li>
-
- <li class="toggle-list">
- <div>
- <a href="<?cs var:toroot ?>guide/developing/devices/index.html">
- <span class="en">Managing Virtual Devices</span>
- </a>
- </div>
- <ul>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/devices/managing-avds.html">
- <span class="en">With AVD Manager</span>
- </a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/devices/managing-avds-cmdline.html">
- <span class="en">From the Command Line</span>
- </a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/devices/emulator.html">
- <span class="en">Using the Android Emulator</span>
- </a>
- </li>
- </ul>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/device.html">
- <span class="en">Using Hardware Devices</span>
- </a>
- </li>
-
- <li class="toggle-list">
- <div>
- <a href="<?cs var:toroot ?>guide/developing/projects/index.html">
- <span class="en">Managing Projects</span>
- </a>
- </div>
- <ul>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/projects/projects-eclipse.html">
- <span class="en">From Eclipse with ADT</span>
- </a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/projects/projects-cmdline.html">
- <span class="en">From the Command Line</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div>
- <a href="<?cs var:toroot ?>guide/developing/building/index.html">
- <span class="en">Building and Running</span>
- </a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/developing/building/building-eclipse.html">
- <span class="en">From Eclipse with ADT</span>
+ <li><a href="<?cs var:toroot ?>guide/webapps/targeting.html">
+ <span class="en">Targeting Screens from Web Apps</span>
</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/building/building-cmdline.html">
- <span class="en">From the Command Line</span></a></li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div>
- <a href="<?cs var:toroot ?>guide/developing/debugging/index.html">
- <span class="en">Debugging</span>
- </a>
- </div>
- <ul>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/debugging/debugging-projects.html">
- <span class="en">From Eclipse with ADT</span>
- </a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/debugging/debugging-projects-cmdline.html">
- <span class="en">From Other IDEs</span>
- </a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/debugging/ddms.html">
- <span class="en">Using DDMS</span>
- </a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/debugging/debugging-log.html">
- <span class="en">Reading and Writing Logs</span>
- </a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/debugging/debugging-ui.html">
- <span class="en">Debugging and Profiling UIs</span>
- </a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/debugging/debugging-tracing.html">
- <span class="en">Profiling with Traceview and dmtracedump</span>
- </a>
- </li>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/debugging/debugging-devtools.html">
- <span class="en">Using the Dev Tools App</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div>
- <a href="<?cs var:toroot ?>guide/developing/testing/index.html">
- <span class="en">Testing</span>
- </a>
- </div>
- <ul>
- <li>
- <a href="<?cs var:toroot ?>guide/developing/testing/testing_eclipse.html">
- <span class="en">From Eclipse with ADT</span>
- </a>
- </li>
-
- <li>
- <a href="<?cs var:toroot ?>guide/developing/testing/testing_otheride.html">
- <span class="en">From Other IDEs</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/developing/tools/index.html">
- <span class="en">Tools</span>
- </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></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>
- <li><a href="<?cs var:toroot?>guide/developing/tools/draw9patch.html">Draw
- 9-Patch</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/emulator.html">Emulator</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/etc1tool.html">etc1tool</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/hprof-conv.html">hprof-conv</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/layoutopt.html">layoutopt</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/logcat.html">logcat</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/mksdcard.html">mksdcard</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/monkey.html">Monkey</a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/developing/tools/monkeyrunner_concepts.html">
- <span class="en">monkeyrunner</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/MonkeyDevice.html">
- <span class="en">MonkeyDevice</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/MonkeyImage.html">
- <span class="en">MonkeyImage</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/MonkeyRunner.html">
- <span class="en">MonkeyRunner</span>
- </a></li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/proguard.html">ProGuard</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/adb.html#sqlite">sqlite3</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/traceview.html">Traceview</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/zipalign.html">zipalign</a></li>
- </ul>
- </li>
- </ul>
- </li>
-
- <li>
- <span class="heading">
- <span class="en">Publishing</span>
- <span class="de" style="display:none">Veröffentlichung</span>
- <span class="es" style="display:none">Publicación</span>
- <span class="fr" style="display:none">Publication</span>
- <span class="it" style="display:none">Pubblicazione</span>
- <span class="ja" style="display:none">公開</span>
- <span class="zh-CN" style="display:none">发布</span>
- <span class="zh-TW" style="display:none">發佈</span>
- </span>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/publishing/publishing_overview.html">
- <span class="en">Publishing Overview</span>
+ <li><a href="<?cs var:toroot ?>guide/webapps/webview.html">
+ <span class="en">Building Web Apps in WebView</span>
</a></li>
- <li><a href="<?cs var:toroot ?>guide/publishing/preparing.html">
- <span class="en">Preparing for Release</span>
- <span class="de" style="display:none">Vorbereitung auf die Veröffentlichung</span>
- <span class="es" style="display:none">Publicación de aplicaciones</span>
- <span class="fr" style="display:none">Préparation à la publication</span>
- <span class="it" style="display:none">Preparativi per la pubblicazione</span>
- <span class="ja" style="display:none">公開の準備</span>
- <span class="zh-CN" style="display:none">准备发布</span>
- <span class="zh-TW" style="display:none">準備發佈</span>
+ <li><a href="<?cs var:toroot ?>guide/webapps/debugging.html">
+ <span class="en">Debugging Web Apps</span>
</a></li>
- <li><a href="<?cs var:toroot ?>guide/publishing/app-signing.html">
- <span class="en">Signing Your Applications</span>
- <span class="de" style="display:none">Signieren Ihrer Anwendungen</span>
- <span class="es" style="display:none">Firma de aplicaciones</span>
- <span class="fr" style="display:none">Attribution de votre signature <br />à vos
-applications</span>
- <span class="it" style="display:none">Firma delle applicazioni</span>
- <span class="ja" style="display:none">アプリケーションへの署名</span>
- <span class="zh-CN" style="display:none">应用程序签名</span>
- <span class="zh-TW" style="display:none">簽署應用程式</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/publishing/versioning.html">
- <span class="en">Versioning Your Applications</span>
- <span class="de" style="display:none">Versionsverwaltung für Ihre <br
-/>Anwendungen</span>
- <span class="es" style="display:none">Versiones de las aplicaciones</span>
- <span class="fr" style="display:none">Attribution d'une version à vos
-applications</span>
- <span class="it" style="display:none">Controllo versioni delle applicazioni</span>
- <span class="ja" style="display:none">アプリケーションのバージョニング</span>
- <span class="zh-CN" style="display:none">应用程序版本控制</span>
- <span class="zh-TW" style="display:none">應用程式版本設定</span>
+ <li><a href="<?cs var:toroot ?>guide/webapps/best-practices.html">
+ <span class="en">Best Practices for Web Apps</span>
</a></li>
</ul>
- </li>
-
- <li>
- <span class="heading">
+ </li><!-- end of web apps -->
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/index.html">
<span class="en">Best Practices</span>
<span class="de" style="display:none">Bewährte Verfahren</span>
<span class="es" style="display:none">Prácticas recomendadas</span>
@@ -774,13 +504,13 @@
<span class="ja" style="display:none">ベスト プラクティス</span>
<span class="zh-CN" style="display:none">最佳实践</span>
<span class="zh-TW" style="display:none">最佳實務</span>
- </span>
+ </div></a>
<ul>
<li><a href="<?cs var:toroot ?>guide/practices/compatibility.html">
<span class="en">Compatibility</span>
</a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/practices/screens_support.html">
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/screens_support.html">
<span class="en">Supporting Multiple Screens</span>
</a></div>
<ul>
@@ -790,21 +520,114 @@
<li><a href="<?cs var:toroot ?>guide/practices/screen-compat-mode.html">
<span class="en">Screen Compatibility Mode</span>
</a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/screens-support-1.5.html">
+ <!--<li><a href="<?cs var:toroot ?>guide/practices/screens-support-1.5.html">
<span class="en">Strategies for Android 1.5</span>
- </a></li>
+ </a></li> -->
</ul>
</li>
<li><a href="<?cs var:toroot ?>guide/practices/tablets-and-handsets.html">
<span class="en">Supporting Tablets and Handsets</span>
</a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/index.html">
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/performance.html">
+ <span class="en">Designing for Performance</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/practices/jni.html">
+ <span class="en">JNI Tips</span>
+ </a></li>
+ </ul>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/practices/responsiveness.html">
+ <span class="en">Designing for Responsiveness</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/practices/seamlessness.html">
+ <span class="en">Designing for Seamlessness</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>guide/practices/security.html">
+ <span class="en">Designing for Security</span>
+ </a></li>
+
+ </ul>
+ </li>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/google/index.html">
+ <span class="en">Google Services</span>
+ </a></div>
+ <ul>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot?>guide/google/play/billing/index.html">
+ <span class="en">In-app Billing</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_overview.html">
+ <span class="en">In-app Billing Overview</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_integrate.html">
+ <span class="en">Implementing In-app Billing</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_subscriptions.html">
+ <span class="en">Subscriptions</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_best_practices.html">
+ <span class="en">Security and Design</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_testing.html">
+ <span class="en">Testing In-app Billing</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_admin.html">
+ <span class="en">Administering In-app Billing</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_reference.html">
+ <span class="en">In-app Billing Reference</span></a>
+ </li>
+ </ul>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/google/play/licensing/index.html">
+ <span class="en">Application Licensing</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot?>guide/google/play/licensing/overview.html">
+ <span class="en">Licensing Overview</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>guide/google/play/licensing/setting-up.html">
+ <span class="en">Setting Up for Licensing</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>guide/google/play/licensing/adding-licensing.html">
+ <span class="en">Adding Licensing to Your App</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>guide/google/play/licensing/licensing-reference.html">
+ <span class="en">Licensing Reference</span></a>
+ </li>
+ </ul>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/google/play/filters.html">
+ <span class="en">Filters on Google Play</span></a>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/google/play/publishing/multiple-apks.html">
+ <span class="en">Multiple APK Support</span></a>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/google/play/expansion-files.html">
+ <span class="en">APK Expansion Files</span></a>
+ </li>
+
+ </ul>
+ </li><!-- end Google Play -->
+
+
+
+ <!-- this needs to move
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/index.html">
<span class="en">UI Guidelines</span>
</a></div>
<ul>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design.html">
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/icon_design.html">
<span class="en">Icon Design</span>
</a></div>
<ul>
@@ -831,94 +654,47 @@
</a></li>
</ul>
</li>
- <li><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/widget_design.html">
+ <li><div><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/widget_design.html">
<span class="en">App Widget Design</span>
- </a></li>
+ </a></div>
+ </li>
</ul>
- </li>
- </ul>
- <ul>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>guide/practices/design/performance.html">
- <span class="en">Designing for Performance</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/practices/design/jni.html">
- <span class="en">JNI Tips</span>
- </a></li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot ?>guide/practices/design/responsiveness.html">
- <span class="en">Designing for Responsiveness</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/design/seamlessness.html">
- <span class="en">Designing for Seamlessness</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/security.html">
- <span class="en">Designing for Security</span></a>
- </li>
- </ul>
- </li>
-
- <li>
- <span class="heading">
- <span class="en">Web Applications</span>
- </span>
+ </li>
+ </ul> -->
+
+<!-- Remove
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/appendix/index.html">
+ <span class="en">Appendix</span>
+ <span class="de" style="display:none">Anhang</span>
+ <span class="es" style="display:none">Apéndice</span>
+ <span class="fr" style="display:none">Annexes</span>
+ <span class="it" style="display:none">Appendice</span>
+ <span class="ja" style="display:none">付録</span>
+ <span class="zh-CN" style="display:none">附录</span>
+ <span class="zh-TW" style="display:none">附錄</span>
+ </a></div>
<ul>
- <li><a href="<?cs var:toroot ?>guide/webapps/index.html">
- <span class="en">Web Apps Overview</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/webapps/targeting.html">
- <span class="en">Targeting Screens from Web Apps</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/webapps/webview.html">
- <span class="en">Building Web Apps in WebView</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/webapps/debugging.html">
- <span class="en">Debugging Web Apps</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/webapps/best-practices.html">
- <span class="en">Best Practices for Web Apps</span>
- </a></li>
- </ul>
- </li>
-
- <li>
- <span class="heading">
- <span class="en">Appendix</span>
- <span class="de" style="display:none">Anhang</span>
- <span class="es" style="display:none">Apéndice</span>
- <span class="fr" style="display:none">Annexes</span>
- <span class="it" style="display:none">Appendice</span>
- <span class="ja" style="display:none">付録</span>
- <span class="zh-CN" style="display:none">附录</span>
- <span class="zh-TW" style="display:none">附錄</span>
- </span>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/appendix/api-levels.html">
- <span class="en">Android API Levels</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/appendix/install-location.html">
- <span class="en">App Install Location</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/appendix/media-formats.html">
- <span class="en">Supported Media Formats</span>
- </a></li>
<li><a href="<?cs var:toroot ?>guide/appendix/g-app-intents.html">
<span class="en">Intents List: Google Apps</span>
</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/aidl.html">AIDL</a></li>
+
+
<li><a href="<?cs var:toroot ?>guide/appendix/glossary.html">
<span class="en">Glossary</span>
</a></li>
</ul>
</li>
+</li>
+-->
</ul>
+
<script type="text/javascript">
<!--
buildToggleLists();
changeNavLang(getLangPref());
//-->
</script>
+
diff --git a/docs/html/guide/index.jd b/docs/html/guide/index.jd
index 8378472..fea7027 100644
--- a/docs/html/guide/index.jd
+++ b/docs/html/guide/index.jd
@@ -1,88 +1,56 @@
-page.title=The Developer's Guide
+page.title=App Components
+page.landing=true
+page.landing.intro=Android's application framework lets you create extremely rich and innovative apps using a set of reusable components. This section explains how Android apps work and how you use components to build them.
+page.landing.image=images/ui/ui_index.png
+
@jd:body
-<p>
-Welcome to the <i>Android Dev Guide</i>! The Dev Guide provides
-a practical introduction to developing applications for Android and documentation about major
-platform features. It explores the concepts behind Android, the framework for
-constructing an application, and the tools for developing,
-testing, and publishing software for the platform.
-</p>
+<div class="landing-docs">
-<p>
-The Dev Guide holds most of the documentation for the Android
-platform, except for reference material on the framework API.
-For API specifications, go to the
-<a href="{@docRoot}reference/packages.html">Reference</a>.
-</p>
+ <div class="col-6">
+ <h3>Blog Articles</h3>
+
+ <a href="http://android-developers.blogspot.com/2012/05/using-dialogfragments.html">
+ <h4>Using DialogFragments</h4>
+ <p>In this post, I’ll show how to use DialogFragments with the v4 support library (for backward compatibility on pre-Honeycomb devices) to show a simple edit dialog and return a result to the calling Activity using an interface.</p>
+ </a>
-<p>
-As you can see in the panel on the left, the Dev Guide is
-divided into several sections:
-<p>
+ <a href="http://android-developers.blogspot.com/2011/03/fragments-for-all.html">
+ <h4>Fragments For All</h4>
+ <p>Today we’ve released a static library that exposes the same Fragments API (as well as the new LoaderManager and a few other classes) so that applications compatible with Android 1.6 or later can use fragments to create tablet-compatible user interfaces. </p>
+ </a>
+
+ <a
+href="http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html">
+ <h4>Multithreading for Performance</h4>
+ <p>A good practice in creating responsive applications is to make sure your main UI thread
+does the minimum amount of work. Any potentially long task that may hang your application should be
+handled in a different thread.</p>
+ </a>
+ </div>
-<dl>
-<dt><b>Android Basics</b></dt>
-<dd>An initial orientation to Android — what it is,
-what it offers, and how your application fits in.</dd>
+ <div class="col-6">
+ <h3>Training</h3>
+
+ <a href="http://developer.android.com/training/basics/activity-lifecycle/index.html">
+ <h4>Managing the Activity Lifecycle</h4>
+ <p>This class explains important lifecycle callback methods that each Activity
+ instance receives and how you can use them so your activity does what the user expects and does not consume system
+ resources when your activity doesn't need them.</p>
+ </a>
-<dt><b>Framework Topics</b></dt>
-<dd>Discussions of particular parts of the Android framework
-and API. For an introduction to the framework, begin with
-<a href="{@docRoot}guide/topics/fundamentals.html">Application
-Fundamentals</a>. Then explore other topics — from
-designing a user interface and setting up resources to storing
-data and using permissions — as needed.</dd>
+ <a href="http://developer.android.com/training/basics/fragments/index.html">
+ <h4>Building a Dynamic UI with Fragments</h4>
+ <p>This class shows you how to create a dynamic user experience with fragments and optimize
+your app's user experience for devices with different screen sizes, all while continuing to support
+devices running versions as old as Android 1.6.</p>
+ </a>
-<dt><b>Google Play Topics</b></dt>
-<dd>Documentation for topics that concern publishing and monetizing applications on Google Play,
-such as how to enforce licensing policies and implement in-app billing.</dd>
+ <a href="http://developer.android.com/training/sharing/index.html">
+ <h4>Sharing Content</h4>
+ <p>This class covers some common ways you can send and receive content between
+ applications using Intent APIs and the ActionProvider object.</p>
+ </a>
+ </div>
-<dt><b>Developing</b></dt>
-<dd>Directions for using Android's development and debugging tools,
-and for testing the results.</dd>
-
-<dt><b>Publishing</b></dt>
-<dd>Instructions on how to prepare your application for deployment
-and how to publish it when it's ready.</dd>
-
-<dt><b>Best Practices</b></dt>
-<dd>Recommendations on preferred techniques for writing
-applications that perform efficiently and work well for the
-user.</dd>
-
-<dt><b>Web Applications</b></dt>
-<dd>Documentation about how to create web applications that work seamlessly on Android-powered
-devices and create Android applications that embed web-based content.</dd>
-
-<dt><b>Appendix</b></dt>
-<dd>Reference information and specifications, as well as FAQs,
-a glossary of terms, and other information.</dd>
-</dl>
-
-<p>
-The first step in programming for Android is downloading the SDK
-(software development kit). For instructions and information, visit the <a
-href="{@docRoot}sdk/index.html">SDK</a> tab.
-</p>
-
-<p>
-After you have the SDK, begin by looking through the Dev Guide.
-If you want to start by getting a quick look at some code, the
-<a href="{@docRoot}resources/tutorials/hello-world.html">Hello World</a>
-tutorial walks you through a standard "Hello, World" application to introduce some basics of an
-Android application. The
-<a href="{@docRoot}guide/topics/fundamentals.html">Application
-Fundamentals</a> document is a good place to start learning the basics about the application
-framework.
-</p>
-
-
-<p>
-For additional help, consider joining one or more of the Android
-discussion groups. Go to the
-<a href="{@docRoot}resources/community-groups.html">Developer Forums</a> page
-for more information.
-</p>
-
-<p>To return to this page later, just click the "Dev Guide" tab while any Dev Guide page is loaded. </p>
\ No newline at end of file
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/market/billing/billing_about.html b/docs/html/guide/market/billing/billing_about.html
deleted file mode 100644
index d8395df..0000000
--- a/docs/html/guide/market/billing/billing_about.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh"
-content="0;url=http://developer.android.com/guide/market/billing/index.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should be redirected. Please <a
-href="http://developer.android.com/guide/market/billing/index.html">click
-here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/market/billing/billing_admin.jd b/docs/html/guide/market/billing/billing_admin.jd
deleted file mode 100755
index 0f869ab..0000000
--- a/docs/html/guide/market/billing/billing_admin.jd
+++ /dev/null
@@ -1,517 +0,0 @@
-page.title=Administering In-app Billing
-parent.title=In-app Billing
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#billing-list-setup">Creating a Product List</a></li>
- <li><a href="#billing-purchase-type">Choosing a Purchase Type</a></li>
- <li><a href="#billing-testing-setup">Setting up Test Accounts</a></li>
- <li><a href="#billing-refunds">Handling Refunds</a></li>
- <li><a href="#billing-support">Where to Get Support</a></li>
- </ol>
- <h2>Downloads</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">Sample
- Application</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_overview.html">Overview of In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html">Implementing In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and
- Design</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_testing.html">Testing In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_reference.html">In-app Billing
- Reference</a></li>
- </ol>
-</div>
-</div>
-
-<p>In-app billing frees you from processing financial transactions, but you still need to perform a
-few administrative tasks, including setting up and maintaining your product list on the publisher
-site, registering test accounts, and handling refunds when necessary.</p>
-
-<p>You must have a Google Play publisher account to register test accounts. And you must have a
-Google Checkout merchant account to create a product list and issue refunds to your users. If you
-already have a publisher account on Google Play, you can use your existing account. You do not
-need to register for a new account to support in-app billing. If you do not have a publisher
-account, you can register as a Google Play developer and set up a publisher account at the
-Google Play <a href="http://play.google.com/apps/publish">publisher site</a>. If you do not have a
-Google Checkout merchant account, you can register for one at the <a
-href="http://checkout.google.com">Google Checkout site</a>.</p>
-
-<h2 id="billing-list-setup">Creating a Product List</h2>
-
-<p>The Google Play publisher site provides a product list for each of your published
-applications. You can sell an item using Google Play's in-app billing feature only if the item is
-listed on an application's product list. Each application has its own product list; you cannot sell
-items that are listed in another application's product list.</p>
-
-<p>You can access an application's product list by clicking the <strong>In-App Products</strong>
-link that appears under each of the applications that are listed for your publisher account (see
-figure 1). The <strong>In-App Products</strong> link appears only if you have a Google Checkout
-merchant account and an application's manifest includes the <code>com.android.vending.BILLING</code>
-permission.</p>
-
-<img src="{@docRoot}images/billing_product_list_entry.png" height="548" id="figure1" />
-<p class="img-caption">
- <strong>Figure 1.</strong> You can access an application's product list by clicking the
- <strong>In-App Products</strong> link.
-</p>
-
-<p>A product list contains information about the items you are selling, such as a product id,
-product description, and price (see figure 2). The product list stores only metadata about the items
-you are selling in your application. It does not store any digital content. You are responsible for
-storing and delivering the digital content that you sell in your applications.</p>
-
-<img src="{@docRoot}images/billing_product_list.png" height="658" id="figure2" />
-<p class="img-caption">
- <strong>Figure 2.</strong> An application's product list.
-</p>
-
-<p>You can create a product list for any published application or any draft application that's been
-uploaded and saved to the Google Play site. However, you must have a Google Checkout merchant
-account and the application's manifest must include the <code>com.android.vending.BILLING</code>
-permission. If an application's manifest does not include this permission, you will be able to edit
-existing items in the product list but you will not be able to add new items to the list. For more
-information about this permission, see
-<a href="{@docRoot}guide/market/billing/billing_integrate.html#billing-permission">Updating Your
-Application's Manifest</a>.</p>
-
-<p>In addition, an application package can have only one product list. If you create a product
-list for an application, and you use the <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html">multiple APK feature</a> to distribute
-more than one APK for that application, the product list applies to all APK versions that are
-associated with the application listing. You cannot create individual product lists for each APK if
-you are using the multiple APK feature.</p>
-
-<p>You can add items to a product list two ways: you can add items one at a time by using the In-app
-Products UI (see figure 3), or you can add a batch of items by importing the items from a
-comma-separated values (CSV) file (see figure 2). Adding items one at a time is useful if your
-application has only a few in-app items or you are adding only a few items to a
-product list for testing purposes. The CSV file method is useful if your application has a large
-number of in-app items.</p>
-
-<h3 id="billing-form-add">Adding items one at a time to a product list</h3>
-
-<p>To add an item to a product list using the In-app Products UI, follow these steps:</p>
-
-<ol>
- <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
- <li>In the <strong>All Google Play listings</strong> panel, under the application name, click
- <strong>In-app Products</strong>.</li>
- <li>On the In-app Products List page, click <strong>Add in-app product</strong>.</li>
- <li>On the Create New In-app Product page (see figure 3), provide details about the item you are
- selling and then click <strong>Save</strong> or <strong>Publish</strong>.</li>
-</ol>
-
-<img src="{@docRoot}images/billing_list_form.png" height="840" id="figure3" />
-<p class="img-caption">
- <strong>Figure 3.</strong> The Create New In-app Product page lets you add items to an
- application's product list.
-</p>
-
-<p>You must enter the following information for each item in a product list:</p>
-<ul>
- <li><strong>In-app Product ID</strong>
- <p>Product IDs are unique across an application's namespace. A product ID must start with a
- lowercase letter or a number, and must be composed using only lowercase letters (a-z), numbers
- (0-9), underlines (_), and dots (.). The product ID "android.test" is reserved, as are all
- product IDs that start with "android.test."</p>
- <p>In addition, you cannot modify an item's product ID after it is created, and you cannot reuse
- a product ID.</p>
- </li>
- <li><strong>Purchase Type</strong>
- <p>The purchase type can be <strong>Managed per user account</strong> or <strong>
- Unmanaged</strong>. You can never change an item's purchase type after you set it. For more
- information, see <a href="#billing-purchase-type">Choosing a purchase type</a> later in this
- document.</p>
- </li>
- <li><strong>Publishing State</strong>
- <p>An item's publishing state can be <strong>Published</strong> or <strong>Unpublished
- </strong>. To be visible to a user during checkout, an item's publishing state must be set to
- <strong>Published</strong> and the item's application must be published on Google Play.</p>
- <p class="note"><strong>Note:</strong> This is not true for test accounts. An item is visible to
- a test account if the application is not published and the item is published. See <a
- href="{@docRoot}guide/market/billing/billing_testing.html#billing-testing-real">Testing In-app
- Billing</a> for more information.</p>
- </li>
- <li><strong>Language</strong>
- <p>The language setting determines which languages are used to display the item title and
- item description during checkout. A product list inherits its default language from the
- parent application. You can add more languages by clicking <strong>add language</strong>. You
- can also choose to have the title and description automatically translated from the default
- language by selecting the <strong>Fill fields with auto translation</strong> checkbox (see
- figure 4). If you do not use the auto translation feature, you must provide the translated
- versions of the title and description.</p>
- </li>
- <li><strong>Title</strong>
- <p>The title is a short descriptor for the item. For example, "Sleeping potion." Titles must be
- unique across an application's namespace. Every item must have a title. The title is visible to
- users during checkout. For optimum appearance, titles should be no longer than 25 characters;
- however, titles can be up to 55 characters in length.</p>
- </li>
- <li><strong>Description</strong>
- <p>The description is a long descriptor for the item. For example, "Instantly puts creatures to
- sleep. Does not work on angry elves." Every item must have a description. The description is
- visible to users during checkout. Descriptions can be up to 80 characters in length.</p>
- </li>
- <li><strong>Price</strong>
- <p>You must provide a default price in your home currency. You can also provide prices in other
- currencies, but you can do this only if a currency's corresponding country is listed as a
- target country for your application. You can specify target countries on the Edit Application
- page in the Google Play developer console.</p>
- <p>To specify prices in other currencies, you can manually enter the price for each
- currency or you can click <strong>Auto Fill</strong> and let Google Play do a one-time
- conversion from your home currency to the currencies you are targeting (see figure 4).</p>
- </li>
-</ul>
-<img src="{@docRoot}images/billing_list_form_2.png" height="1226" id="figure4" />
-<p class="img-caption">
- <strong>Figure 4.</strong> Specifying additional currencies and additional languages for the
- item title and description.
-</p>
-
-<p>For more information about product IDs and product lists, see <a
-href="http://market.android.com/support/bin/answer.py?answer=1072599">Creating In-App Product
-IDs</a>. For more information about pricing, see <a
-href="http://market.android.com/support/bin/answer.py?answer=1153485">In-App Billing
-Pricing</a>.</p>
-
-<p class="note"><strong>Note</strong>: Be sure to plan your product ID namespace. You cannot reuse
-or modify product IDs after you save them.</p>
-
-<h3 id="billing-bulk-add">Adding a batch of items to a product list</h3>
-
-<p>To add a batch of items to a product list using a CSV file, you first need to create your CSV
-file. The data values that you specify in the CSV file represent the same data values you specify
-manually through the In-app Products UI (see <a href="#billing-form-add">Adding items one at a time
-to a product list</a>). The CSV file uses commas (,) and semi-colons (;) to separate data values.
-Commas are used to separate primary data values, and semi-colons are used to separate subvalues. For
-example, the syntax for the CSV file is as follows:</p>
-
-<p>"<em>product_id</em>","<em>publish_state</em>","<em>purchase_type</em>","<em>autotranslate</em>
-","<em>locale</em>; <em>title</em>; <em>description</em>","<em>autofill</em>","<em>country</em>;
-<em>price</em>"
-</p>
-
-<p>Descriptions and usage details are provided below.</p>
-
-<ul>
- <li><em>product_id</em>
- <p>This is equivalent to the In-app Product ID setting in the In-app Products UI. If you specify
- a <em>product_id</em> that already exists in a product list, and you choose to overwrite
- the product list while importing the CSV file, the data for the existing item is overwritten with
- the values specified in the CSV file. The overwrite feature does not delete items that are on a
- product list but not present in the CSV file.</p>
- </li>
- <li><em>publish_state</em>
- <p>This is equivalent to the Publishing State setting in the In-app Products UI. Can be <code>
- published</code> or <code>unpublished</code>.</p>
- </li>
- <li><em>purchase_type</em>
- <p>This is equivalent to the Purchase Type setting in the In-app Products UI. Can be <code>
- managed_by_android</code>, which is equivalent to <strong>Managed per user account
- </strong> in the In-app Products UI, or <code>managed_by_publisher</code>, which is equivalent
- to <strong>Unmanaged</strong> in the In-app Products UI.</p>
- </li>
- <li><em>autotranslate</em>
- <p>This is equivalent to selecting the <strong>Fill fields with auto translation</strong>
- checkbox in the In-app Products UI. Can be <code>true</code> or <code>false</code>.</p>
- </li>
- <li><em>locale</em>
- <p>This is equivalent to the Language setting in the In-app Products UI. You must have an entry
- for the default locale. The default locale must be the first entry in the list of
- locales, and it must include a <em>title</em> and <em>description</em>. If you want to provide
- translated versions of the <em>title</em> and <em>description</em> in addition to the default,
- you must use the following syntax rules:</p>
- <p>If <em>autotranslate</em> is <code>true</code>, you must specify the default locale,
- default title, default description, and other locales using the following format:</p>
- <p>"true,"<em>default_locale</em>; <em>default_locale_title</em>;
- <em>default_locale_description</em>; <em>locale_2</em>; <em>locale_3</em>, ..."</p>
- <p>If <em>autotranslate</em> is <code>false</code>, you must specify the default locale,
- default title, and default description as well as the translated titles and descriptions using
- the following format:</p>
- <p>"false,"<em>default_locale</em>; <em>default_locale_title</em>;
- <em>default_locale_description</em>; <em>locale_2</em>; <em>locale_2_title</em>;
- <em>local_2_description</em>; <em>locale_3</em>; <em>locale_3_title</em>;
- <em>locale_3_description</em>; ..."</p>
- <p>See table 1 for a list of the language codes you can use with the <em>locale</em> field.</p>
- </li>
- <li><em>title</em>
- <p>This is equivalent to the Title setting in the In-app Products UI. If the <em>title</em>
- contains a semicolon, it must be escaped with a backslash (for example, "\;"). A backslash
- should also be escaped with a backslash (for example, "\\">.</p>
- </li>
- <li><em>description</em>
- <p>This is equivalent to the Description in the In-app Products UI. If the <em>description</em>
- contains a semicolon, it must be escaped with a backslash (for example, "\;"). A backslash
- should also be escaped with a backslash (for example, "\\">.</p>
- </li>
- <li><em>autofill</em>
- <p>This is equivalent to clicking <strong>Auto Fill</strong> in the In-app Products UI. Can be
- <code>true</code> or <code>false</code>. The syntax for specifying the <em>country</em>
- and <em>price</em> varies depending on which <em>autofill</em> setting you use.</p>
- <p>If <em>autofill</em> is set to <code>true</code>, you need to specify only the default
- price in your home currency and you must use this syntax:</p>
- <p>"true","<em>default_price_in_home_currency</em>"
- <p>If <em>autofill</em> is set to <code>false</code>, you need to specify a <em>country</em>
- and a <em>price</em> for each currency and you must use the following syntax:</p>
- <p>"false", "<em>home_country</em>; <em>default_price_in_home_currency</em>; <em>country_2</em>;
- <em>country_2_price</em>; <em>country_3</em>; <em>country_3_price</em>; ..."</p>
- </li>
- <li><em>country</em>
- <p>The country for which you are specifying a price. You can only list countries that your
- application is targeting. The country codes are two-letter uppercase
- ISO country codes (such as "US") as defined by
- <a href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-2</a>.</p>
- </li>
- <li><em>price</em>
- <p>This is equivalent to the Price in the In-app Products UI. The price must be specified in
- micro-units. To convert a currency value to micro-units, you multiply the real value by 1,000,000.
- For example, if you want to sell an in-app item for $1.99 you specify 1990000 in the
- <em>price</em> field.</p>
- </li>
-</ul>
-
-<p class="table-caption" id="language-table"><strong>Table 1.</strong> Language codes you can use
-with the <em>locale</em> field.</p>
-
-<table>
-
-<tr>
-<th>Language</th>
-<th>Code</th>
-<th>Language</th>
-<th>Code</th>
-</tr>
-<tr>
-<td>Chinese</td>
-<td>zh_TW</td>
-<td>Italian</td>
-<td>it_IT</td>
-</tr>
-<tr>
-<td>Czech</td>
-<td>cs_CZ</td>
-<td>Japanese</td>
-<td>ja_JP</td>
-</tr>
-<tr>
-<td>Danish</td>
-<td>da_DK</td>
-<td>Korean</td>
-<td>ko_KR</td>
-</tr>
-<tr>
-<td>Dutch</td>
-<td>nl_NL</td>
-<td>Norwegian</td>
-<td>no_NO</td>
-</tr>
-<tr>
-<td>English</td>
-<td>en_US</td>
-<td>Polish</td>
-<td>pl_PL</td>
-</tr>
-<tr>
-<td>French</td>
-<td>fr_FR</td>
-<td>Portuguese</td>
-<td>pt_PT</td>
-</tr>
-<tr>
-<td>Finnish</td>
-<td>fi_FI</td>
-<td>Russian</td>
-<td>ru_RU</td>
-</tr>
-<tr>
-<td>German</td>
-<td>de_DE</td>
-<td>Spanish</td>
-<td>es_ES</td>
-</tr>
-<tr>
-<td>Hebrew</td>
-<td>iw_IL</td>
-<td>Swedish</td>
-<td>sv_SE</td>
-</tr>
-<tr>
-<td>Hindi</td>
-<td>hi_IN</td>
-<td>--</td>
-<td>--</td>
-</tr>
-</table>
-
-<p>To import the items that are specified in your CSV file, do the following:</p>
-
-<ol>
- <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
- <li>In the <strong>All Google Play listings</strong> panel, under the application name, click
- <strong>In-app Products</strong>.</li>
- <li>On the In-app Products List page, click <strong>Choose File</strong> and select your CSV
-file.
- <p>The CSV file must be on your local computer or on a local disk that is connected to your
- computer.</p>
- </li>
- <li>Select the <strong>Overwrite</strong> checkbox if you want to overwrite existing items in
- your product list.
- <p>This option overwrites values of existing items only if the value of the <em>product_id</em>
- in the CSV file matches the In-app Product ID for an existing item in the product list.
- Overwriting does not delete items that are on a product list but not present in the CSV
- file.</p>
- </li>
- <li>On the In-app Products List page, click <strong>Import from CSV</strong>.</li>
-</ol>
-
-<p>You can also export an existing product list to a CSV file by clicking <strong>Export to CSV
-</strong> on the In-app Product List page. This is useful if you have manually added items to
-a product list and you want to start managing the product list through a CSV file.</p>
-
-<h3 id="billing-purchase-type">Choosing a Purchase Type</h3>
-
-<p>An item's purchase type controls how Google Play manages the purchase of the item. There are
-two purchase types: "managed per user account" and "unmanaged."</p>
-
-<p>Items that are managed per user account can be purchased only once per user account. When an item
-is managed per user account, Google Play permanently stores the transaction information for each
-item on a per-user basis. This enables you to query Google Play with the
-<code>RESTORE_TRANSACTIONS</code> request and restore the state of the items a specific user has
-purchased.</p>
-
-<p>If a user attempts to purchase a managed item that has already been purchased, Google Play
-displays an "Item already purchased" error. This occurs during checkout, when Google Play
-displays the price and description information on the checkout page. When the user dismisses the
-error message, the checkout page disappears and the user returns to your user interface. As a best
-practice, your application should prevent the user from seeing this error. The sample application
-demonstrates how you can do this by keeping track of items that are managed and already purchased
-and not allowing users to select those items from the list. Your application should do something
-similar—either graying out the item or hiding it so that it cannot be selected.</p>
-
-<p>The "manage by user account" purchase type is useful if you are selling items such as game levels
-or application features. These items are not transient and usually need to be restored whenever a
-user reinstalls your application, wipes the data on their device, or installs your application on a
-new device.</p>
-
-<p>Items that are unmanaged do not have their transaction information stored on Google Play,
-which means you cannot query Google Play to retrieve transaction information for items whose
-purchase type is listed as unmanaged. You are responsible for managing the transaction information
-of unmanaged items. Also, unmanaged items can be purchased multiple times as far as Google Play
-is concerned, so it's also up to you to control how many times an unmanaged item can be
-purchased.</p>
-
-<p>The "unmanaged" purchase type is useful if you are selling consumable items, such as fuel or
-magic spells. These items are consumed within your application and are usually purchased multiple
-times.</p>
-
-<h2 id="billing-refunds">Handling Refunds</h2>
-
-<p>In-app billing does not allow users to send a refund request to Google Play. Refunds for
-in-app purchases must be directed to you (the application developer). You can then process the
-refund through your Google Checkout merchant account. When you do this, Google Play receives a
-refund notification from Google Checkout, and Google Play sends a refund message to your
-application. For more information, see <a
-href="{@docRoot}guide/market/billing/billing_overview.html#billing-action-notify">Handling
-IN_APP_NOTIFY messages</a> and <a
-href="http://www.google.com/support/androidmarket/bin/answer.py?answer=1153485">In-app Billing
-Pricing</a>.</p>
-
-<p class="caution"><strong>Important:</strong> You cannot use the Google Checkout API to issue
-refunds or cancel in-app billing transactions. You must do this manually through your Google
-Checkout merchant account. However, you can use the Google Checkout API to retrieve order
-information.</p>
-
-<h2 id="billing-testing-setup">Setting Up Test Accounts</h2>
-
-<p>The Google Play publisher site lets you set up one or more test accounts. A test account is a
-regular Google account that you register on the publisher site as a test account. Test accounts are
-authorized to make in-app purchases from applications that you have uploaded to the Google Play
-site but have not yet published.</p>
-
-<p>You can use any Google account as a test account. Test accounts are useful if you want to let
-multiple people test in-app billing on applications without giving them access to your publisher
-account's sign-in credentials. If you want to own and control the test accounts, you can create the
-accounts yourself and distribute the credentials to your developers or testers.</p>
-
-<p>Test accounts have three limitations:</p>
-
-<ul>
- <li>Test account users can make purchase requests only within applications that are already
- uploaded to your publisher account (although the application doesn't need to be published).</li>
- <li>Test accounts can only be used to purchase items that are listed (and published) in an
- application's product list.</li>
- <li>Test account users do not have access to your publisher account and cannot upload applications
- to your publisher account.</li>
-</ul>
-
-<p>To add test accounts to your publisher account, follow these steps:</p>
-
-<ol>
- <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
- <li>On the upper left part of the page, under your name, click <strong>Edit profile</strong>.</li>
- <li>On the Edit Profile page, scroll down to the Licensing & In-app Billing panel (see figure
- 5).</li>
- <li>In Test Accounts, add the email addresses for the test accounts you want to register,
- separating each account with a comma.</li>
- <li>Click <strong>Save</strong> to save your profile changes.</li>
-</ol>
-
-<img src="{@docRoot}images/billing_public_key.png" height="510" id="figure5" />
-<p class="img-caption">
- <strong>Figure 5.</strong> The Licensing and In-app Billing panel of your account's Edit Profile
- page lets you register test accounts.
-</p>
-
-<h2 id="billing-support">Where to Get Support</h2>
-
-<p>If you have questions or encounter problems while implementing in-app billing, contact the
-support resources listed in the following table (see table 2). By directing your queries to the
-correct forum, you can get the support you need more quickly.</p>
-
-<p class="table-caption" id="support-table"><strong>Table 2.</strong> Developer support resources
-for Google Play in-app billing.</p>
-
-<table>
-
-<tr>
-<th>Support Type</th>
-<th>Resource</th>
-<th>Range of Topics</th>
-</tr>
-<tr>
-<td rowspan="2">Development and testing issues</td>
-<td>Google Groups: <a
-href="http://groups.google.com/group/android-developers">android-developers</a> </td>
-<td rowspan="2">In-app billing integration questions, user experience ideas, handling of responses,
-obfuscating code, IPC, test environment setup.</td>
-</tr>
-<tr>
-<td>Stack Overflow: <a
-href="http://stackoverflow.com/questions/tagged/android">http://stackoverflow.com/questions/tagged/
-android</a></td>
-</tr>
-<tr>
-<td>Billing issue tracker</td>
-<td><a href="http://code.google.com/p/marketbilling/issues/">Billing
-project issue tracker</a></td>
-<td>Bug and issue reports related specifically to in-app billing sample code.</td>
-</tr>
-</table>
-
-<p>For general information about how to post to the groups listed above, see <a
-href="{@docRoot}resources/community-groups.html">Developer Forums</a> document in the Resources
-tab.</p>
-
-
-
diff --git a/docs/html/guide/market/billing/billing_best_practices.jd b/docs/html/guide/market/billing/billing_best_practices.jd
deleted file mode 100755
index e100ce5..0000000
--- a/docs/html/guide/market/billing/billing_best_practices.jd
+++ /dev/null
@@ -1,111 +0,0 @@
-page.title=Security and Design
-parent.title=In-app Billing
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#billing-security">Security Best Practices</a></li>
- </ol>
- <h2>Downloads</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">Sample
- Application</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_overview.html">Overview of In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html">Implementing In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_testing.html">Testing In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_admin.html">Administering In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_reference.html">In-app Billing
- Reference</a></li>
- </ol>
-</div>
-</div>
-
-<p>As you design your in-app billing implementation, be sure to follow the security and design
-guidelines that are discussed in this document. These guidelines are recommended best practices for
-anyone who is using Google Play's in-app billing service.</p>
-
-<h2>Security Best Practices</h2>
-
-<h4>Perform signature verification tasks on a server</h4>
-<p>If practical, you should perform signature verification on a remote server and not on a device.
-Implementing the verification process on a server makes it difficult for attackers to break the
-verification process by reverse engineering your .apk file. If you do offload security processing to
-a remote server, be sure that the device-server handshake is secure.</p>
-
-<h4>Protect your unlocked content</h4>
-<p>To prevent malicious users from redistributing your unlocked content, do not bundle it in your
-.apk file. Instead, do one of the following:</p>
- <ul>
- <li>Use a real-time service to deliver your content, such as a content feed. Delivering content
- through a real-time service allows you to keep your content fresh.</li>
- <li>Use a remote server to deliver your content.</li>
- </ul>
-<p>When you deliver content from a remote server or a real-time service, you can store the unlocked
-content in device memory or store it on the device's SD card. If you store content on an SD card, be
-sure to encrypt the content and use a device-specific encryption key.</p>
-
-<h4>Obfuscate your code</h4>
-<p>You should obfuscate your in-app billing code so it is difficult for an attacker to reverse
-engineer security protocols and other application components. At a minimum, we recommend that you
-run an obfuscation tool like <a
-href="http://developer.android.com/guide/developing/tools/proguard.html">Proguard</a> on your
-code.</p>
-<p>In addition to running an obfuscation program, we recommend that you use the following techniques
-to obfuscate your in-app billing code.</p>
-<ul>
- <li>Inline methods into other methods.</li>
- <li>Construct strings on the fly instead of defining them as constants.</li>
- <li>Use Java reflection to call methods.</li>
-</ul>
-<p>Using these techniques can help reduce the attack surface of your application and help minimize
-attacks that can compromise your in-app billing implementation.</p>
-<div class="note">
- <p><strong>Note:</strong> If you use Proguard to obfuscate your code, you must add the following
- line to your Proguard configuration file:</p>
- <p><code>-keep class com.android.vending.billing.**</code></p>
-</div>
-
-<h4>Modify all sample application code</h4>
-<p>The in-app billing sample application is publicly distributed and can be downloaded by anyone,
-which means it is relatively easy for an attacker to reverse engineer your application if you use
-the sample code exactly as it is published. The sample application is intended to be used only as an
-example. If you use any part of the sample application, you must modify it before you publish it or
-release it as part of a production application.</p>
-<p>In particular, attackers look for known entry points and exit points in an application, so it is
-important that you modify these parts of your code that are identical to the sample application.</p>
-
-<h4>Use secure random nonces</h4>
-<p>Nonces must not be predictable or reused. Always use a cryptographically secure random number
-generator (like {@link java.security.SecureRandom}) when you generate nonces. This can help reduce
-replay attacks.</p>
-<p>Also, if you are performing nonce verification on a server, make sure that you generate the
-nonces on the server.</p>
-
-<h4>Take action against trademark and copyright infringement</h4>
-<p>If you see your content being redistributed on Google Play, act quickly and decisively. File a
-<a href="http://market.android.com/support/bin/answer.py?hl=en&answer=141511">trademark notice
-of infringement</a> or a <a href="http://www.google.com/android_dmca.html">copyright notice of
-infringement</a>.</p>
-
-<h4>Implement a revocability scheme for unlocked content</h4>
-<p>If you are using a remote server to deliver or manage content, have your application verify the
-purchase state of the unlocked content whenever a user accesses the content. This allows you to
-revoke use when necessary and minimize piracy.</p>
-
-<h4>Protect your Google Play public key</h4>
-<p>To keep your public key safe from malicious users and hackers, do not embed it in any code as a
-literal string. Instead, construct the string at runtime from pieces or use bit manipulation (for
-example, XOR with some other string) to hide the actual key. The key itself is not secret
-information, but you do not want to make it easy for a hacker or malicious user to replace the
-public key with another key.</p>
-
diff --git a/docs/html/guide/market/billing/billing_integrate.jd b/docs/html/guide/market/billing/billing_integrate.jd
deleted file mode 100755
index 4b3650f..0000000
--- a/docs/html/guide/market/billing/billing_integrate.jd
+++ /dev/null
@@ -1,1092 +0,0 @@
-page.title=Implementing In-app Billing
-parent.title=In-app Billing
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#billing-download">Downloading the Sample Application</a></li>
- <li><a href="#billing-add-aidl">Adding the AIDL file to your project</a></li>
- <li><a href="#billing-permission">Updating Your Application's Manifest</a></li>
- <li><a href="#billing-service">Creating a Service</a></li>
- <li><a href="#billing-broadcast-receiver">Creating a BroadcastReceiver</a></li>
- <li><a href="#billing-signatures">Creating a security processing component</a></li>
- <li><a href="#billing-implement">Modifying Your Application Code</a></li>
- </ol>
- <h2>Downloads</h2>
- <ol>
- <li><a href="#billing-download">Sample Application</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_overview.html">Overview of In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and
- Design</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_testing.html">Testing In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_admin.html">Administering In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_reference.html">In-app Billing
- Reference</a></li>
- </ol>
-</div>
-</div>
-
-<p>In-app Billing on Google Play provides a straightforward, simple interface for sending in-app
-billing requests and managing in-app billing transactions using Google Play. This document helps
-you implement in-app billing by stepping through the primary implementation tasks, using the in-app
-billing sample application as an example.</p>
-
-<p>Before you implement in-app billing in your own application, be sure that you read <a
-href="{@docRoot}guide/market/billing/billing_overview.html">Overview of In-app Billing</a> and <a
-href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and Design</a>. These
-documents provide background information that will make it easier for you to implement in-app
-billing.</p>
-
-<p>To implement in-app billing in your application, you need to do the following:</p>
-<ol>
- <li><a href="#billing-download">Download the in-app billing sample application</a>.</li>
- <li><a href="#billing-add-aidl">Add the IMarketBillingService.aidl file</a> to your project.</li>
- <li><a href="#billing-permission">Update your AndroidManifest.xml file</a>.</li>
- <li><a href="#billing-service">Create a Service</a> and bind it to the
- <code>MarketBillingService</code> so your application can send billing requests and receive
- billing responses from Google Play.</li>
- <li><a href="#billing-broadcast-receiver">Create a BroadcastReceiver</a> to handle broadcast
- intents from Google Play.</li>
- <li><a href="#billing-signatures">Create a security processing component</a> to verify the
- integrity of the transaction messages that are sent by Google Play.</li>
- <li><a href="#billing-implement">Modify your application code</a> to support in-app billing.</li>
-</ol>
-
-<h2 id="billing-download">Downloading the Sample Application</h2>
-
-<p>The in-app billing sample application shows you how to perform several tasks that are common to
-all in-app billing implementations, including:</p>
-
-<ul>
- <li>Sending in-app billing requests to Google Play.</li>
- <li>Handling synchronous responses from Google Play.</li>
- <li>Handling broadcast intents (asynchronous responses) from Google Play.</li>
- <li>Using in-app billing security mechanisms to verify the integrity of billing responses.</li>
- <li>Creating a user interface that lets users select items for purchase.</li>
-</ul>
-
-<p>The sample application includes an application file (<code>Dungeons.java</code>), the AIDL file
-for the <code>MarketBillingService</code> (<code>IMarketBillingService.aidl</code>), and several
-classes that demonstrate in-app billing messaging. It also includes a class that demonstrates basic
-security tasks, such as signature verification.</p>
-
-<p>Table 1 lists the source files that are included with the sample application.</p>
-<p class="table-caption" id="source-files-table"><strong>Table 1.</strong> In-app billing sample
-application source files.</p>
-
-<table>
-<tr>
-<th>File</th>
-<th>Description</th>
-</tr>
-
-<tr>
-<td>IMarketBillingService.aidl</td>
-<td>Android Interface Definition Library (AIDL) file that defines the IPC interface to Google
-Play's in-app billing service (<code>MarketBillingService</code>).</td>
-</tr>
-
-<tr>
-<td>Dungeons.java</td>
-<td>Sample application file that provides a UI for making purchases and displaying purchase
-history.</td>
-</tr>
-
-<tr>
-<td>PurchaseDatabase.java</td>
-<td>A local database for storing purchase information.</td>
-</tr>
-
-<tr>
- <td>BillingReceiver.java</td>
- <td>A {@link android.content.BroadcastReceiver} that receives asynchronous response messages
- (broadcast intents) from Google Play. Forwards all messages to the
- <code>BillingService</code>.</td>
-</tr>
-<tr>
- <td>BillingService.java</td>
- <td>A {@link android.app.Service} that sends messages to Google Play on behalf of the
- application by connecting (binding) to the <code>MarketBillingService</code>.</td>
-</tr>
-
-<tr>
- <td>ResponseHandler.java</td>
- <td>A {@link android.os.Handler} that contains methods for updating the purchases database and the
- UI.</td>
-</tr>
-
-<tr>
- <td>PurchaseObserver.java</td>
- <td>An abstract class for observing changes related to purchases.</td>
-</tr>
-
-<tr>
-<td>Security.java</td>
-<td>Provides various security-related methods.</td>
-</tr>
-
-<tr>
-<td>Consts.java</td>
-<td>Defines various Google Play constants and sample application constants. All constants that
-are defined by Google Play must be defined the same way in your application.</td>
-</tr>
-
-<tr>
-<td>Base64.java and Base64DecoderException.java</td>
-<td>Provides conversion services from binary to Base64 encoding. The <code>Security</code> class
-relies on these utility classes.</td>
-</tr>
-
-</table>
-
-<p>The in-app billing sample application is available as a downloadable component of the Android
-SDK. To download the sample application component, launch the Android SDK Manager and then
-select the <strong>Google Market Billing package</strong> component (see figure 1), and click <strong>Install
-Selected</strong> to begin the download.</p>
-
-
-<img src="{@docRoot}images/billing_package.png" height="325" id="figure1" />
-<p class="img-caption">
- <strong>Figure 1.</strong> The Google Market Billing package contains the sample application and
- the AIDL file.
-</p>
-
-<p>When the download is complete, the Android SDK Manager saves the component into the
-following directory:</p>
-
-<p><code><sdk>/extras/google/market_billing/</code></p>
-
-<p>If you want to see an end-to-end demonstration of in-app billing before you integrate in-app
-billing into your own application, you can build and run the sample application. Building and
-running the sample application involves three tasks:</p>
-
-<ul>
- <li>Configuring and building the sample application.</li>
- <li>Uploading the sample application to Google Play.</li>
- <li>Setting up test accounts and running the sample application.</li>
-</ul>
-
-<p class="note"><strong>Note:</strong> Building and running the sample application is necessary only
-if you want to see a demonstration of in-app billing. If you do not want to run the sample
-application, you can skip to the next section, <a href="#billing-add-aidl">Adding the AIDL file to
-your project</a>.</p>
-
-<h3>Configuring and building the sample application</h3>
-
-<p>Before you can run the sample application, you need to configure it and build it by doing the
-following:</p>
-
-<ol>
- <li><strong>Add your Google Play public key to the sample application code.</strong>
- <p>This enables the application to verify the signature of the transaction information that is
- returned from Google Play. To add your public key to the sample application code, do the
- following:</p>
- <ol>
- <li>Log in to your Google Play <a href="http://play.google.com/apps/publish">publisher
- account</a>.</li>
- <li>On the upper left part of the page, under your name, click <strong>Edit
- Profile</strong>.</li>
- <li>On the Edit Profile page, scroll down to the <strong>Licensing & In-app
- Billing</strong> panel.</li>
- <li>Copy your public key.</li>
- <li>Open <code>src/com/example/dungeons/Security.java</code> in the editor of your choice.
- <p>You can find this file in the sample application's project folder.</p>
- </li>
- <li>Add your public key to the following line of code:
- <p><code>String base64EncodedPublicKey = "your public key here";</code></p>
- </li>
- <li>Save the file.</li>
- </ol>
- </li>
- <li><strong>Change the package name of the sample application.</strong>
- <p>The current package name is <code>com.example.dungeons</code>. Google Play does not let
- you upload applications with package names that contain <code>com.example</code>, so you must
- change the package name to something else.</p>
- </li>
- <li><strong>Build the sample application in release mode and sign it.</strong>
- <p>To learn how to build and sign applications, see <a
- href="{@docRoot}guide/developing/building/index.html">Building and Running</a>.</p>
- </li>
-</ol>
-
-<h3>Uploading the sample application</h3>
-
-<p>After you build a release version of the sample application and sign it, you need to upload it as
-a draft to the Google Play publisher site. You also need to create a product list for the in-app
-items that are available for purchase in the sample application. The following instructions show you
-how to do this.</p>
-<ol>
- <li><strong>Upload the release version of the sample application to Google Play.</strong>
- <p>Do not publish the sample application; leave it as an unpublished draft application. The
- sample application is for demonstration purposes only and should not be made publicly available
- on Google Play. To learn how to upload an application to Google Play, see <a
- href="http://market.android.com/support/bin/answer.py?answer=113469">Uploading
- applications</a>.</p>
- </li>
- <li><strong>Create a product list for the sample application.</strong>
- <p>The sample application lets you purchase two items: a two-handed sword
- (<code>sword_001</code>) and a potion (<code>potion_001</code>). We recommend that you set up
- your product list so that <code>sword_001</code> has a purchase type of "Managed per user
- account" and <code>potion_001</code> has a purchase type of "Unmanaged" so you can see how these
- two purchase types behave. To learn how to set up a product list, see <a
- href="{@docRoot}guide/market/billing/billing_admin.html#billing-list-setup">Creating a Product
- List</a>.</p>
- <p class="note"><strong>Note:</strong> You must publish the items in your product
- list (<code>sword_001</code> and <code>potion_001</code>) even though you are not publishing the
- sample application. Also, you must have a Google Checkout Merchant account to add items to the
- sample application's product list.</p>
- </li>
-</ol>
-
-<h3>Running the sample application</h3>
-
-<p>You cannot run the sample application in the emulator. You must install the sample application
-onto a device to run it. To run the sample application, do the following:</p>
-
-<ol>
- <li><strong>Make sure you have at least one test account registered under your Google Play
- publisher account.</strong>
- <p>You cannot purchase items from yourself (Google Checkout prohibits this), so you need to
- create at least one test account that you can use to purchase items in the sample application.
- To learn how to set up a test account, see <a
- href="{@docRoot}guide/market/billing/billing_testing.html#billing-testing-setup">Setting up Test
- Accounts</a>.</p>
- </li>
- <li><strong>Verify that your device is running a supported version of the Google Play
- application or the MyApps application.</strong>
- <p>If your device is running Android 3.0, in-app billing requires version 5.0.12 (or higher) of
- the MyApps application. If your device is running any other version of Android, in-app billing
- requires version 2.3.4 (or higher) of the Google Play application. To learn how to check the
- version of the Google Play application, see <a
- href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google
- Play</a>.</p>
- </li>
- <li><strong>Install the application onto your device.</strong>
- <p>Even though you uploaded the application to Google Play, the application is not published,
- so you cannot download it from Google Play to a device. Instead, you must install the
- application onto your device. To learn how to install an application onto a device, see <a
- href="{@docRoot}guide/developing/building/building-cmdline.html#RunningOnDevice">Running on a
- device</a>.</p>
- </li>
- <li><strong>Make one of your test accounts the primary account on your device.</strong>
- <p>The primary account on your device must be one of the <a
- href="{@docRoot}guide/market/billing/billing_admin.html#billing-testing-setup">test accounts</a>
- that you registered on the Google Play publisher site. If the primary account on your device is not a
- test account, you must do a factory reset of the device and then sign in with one of your test
- accounts. To perform a factory reset, do the following:</p>
- <ol>
- <li>Open Settings on your device.</li>
- <li>Touch <strong>Privacy</strong>.</li>
- <li>Touch <strong>Factory data reset</strong>.</li>
- <li>Touch <strong>Reset phone</strong>.</li>
- <li>After the phone resets, be sure to sign in with one of your test accounts during the
- device setup process.</li>
- </ol>
- </li>
- <li><strong>Run the application and purchase the sword or the potion.</strong>
- <p>When you use a test account to purchase items, the test account is billed through Google
- Checkout and your Google Checkout Merchant account receives a payout for the purchase.
- Therefore, you may want to refund purchases that are made with test accounts, otherwise the
- purchases will show up as actual payouts to your merchant account.</p>
-</ol>
-
-<p class="note"><strong>Note</strong>: Debug log messages are turned off by default in the
-sample application. You can turn them on by setting the variable <code>DEBUG</code>
-to <code>true</code> in the <code>Consts.java</code> file.</p>
-
-<h2 id="billing-add-aidl">Adding the AIDL file to your project</h2>
-
-<p>The sample application contains an Android Interface Definition Language (AIDL) file, which
-defines the interface to Google Play's in-app billing service
-(<code>MarketBillingService</code>). When you add this file to your project, the Android build
-environment creates an interface file (<code>IMarketBillingService.java</code>). You can then use
-this interface to make billing requests by invoking IPC method calls.</p>
-
-<p>If you are using the ADT plug-in with Eclipse, you can just add this file to your
-<code>/src</code> directory. Eclipse will automatically generate the interface file when you build
-your project (which should happen immediately). If you are not using the ADT plug-in, you can put
-the AIDL file into your project and use the Ant tool to build your project so that the
-<code>IMarketBillingService.java</code> file gets generated.</p>
-
-<p>To add the <code>IMarketBillingService.aidl</code> file to your project, do the following:</p>
-
-<ol>
- <li>Create the following directory in your application's <code>/src</code> directory:
- <p><code>com/android/vending/billing/</code></p>
- </li>
- <li>Copy the <code>IMarketBillingService.aidl</code> file into the
- <code>sample/src/com/android/vending/billing/</code> directory.</li>
- <li>Build your application.</li>
-</ol>
-
-<p>You should now find a generated interface file named <code>IMarketBillingService.java</code> in
-the <code>gen</code> folder of your project.</p>
-
-<h2 id="billing-permission">Updating Your Application's Manifest</h2>
-
-<p>In-app billing relies on the Google Play application, which handles all communication between
-your application and the Google Play server. To use the Google Play application, your
-application must request the proper permission. You can do this by adding the
-<code>com.android.vending.BILLING</code> permission to your AndroidManifest.xml file. If your
-application does not declare the in-app billing permission, but attempts to send billing requests,
-Google Play will refuse the requests and respond with a <code>RESULT_DEVELOPER_ERROR</code>
-response code.</p>
-
-<p>In addition to the billing permission, you need to declare the {@link
-android.content.BroadcastReceiver} that you will use to receive asynchronous response messages
-(broadcast intents) from Google Play, and you need to declare the {@link android.app.Service}
-that you will use to bind with the <code>IMarketBillingService</code> and send messages to Google
-Play. You must also declare <a
-href="{@docRoot}guide/topics/manifest/intent-filter-element.html">intent filters</a> for the {@link
-android.content.BroadcastReceiver} so that the Android system knows how to handle the broadcast
-intents that are sent from the Google Play application.</p>
-
-<p>For example, here is how the in-app billing sample application declares the billing permission,
-the {@link android.content.BroadcastReceiver}, the {@link android.app.Service}, and the intent
-filters. In the sample application, <code>BillingReceiver</code> is the {@link
-android.content.BroadcastReceiver} that handles broadcast intents from the Google Play
-application and <code>BillingService</code> is the {@link android.app.Service} that sends requests
-to the Google Play application.</p>
-
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.dungeons"
- android:versionCode="1"
- android:versionName="1.0">
-
- <uses-permission android:name="com.android.vending.BILLING" />
-
- <application android:icon="@drawable/icon" android:label="@string/app_name">
- <activity android:name=".Dungeons" android:label="@string/app_name">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
-
- <service android:name="BillingService" />
-
- <receiver android:name="BillingReceiver">
- <intent-filter>
- <action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
- <action android:name="com.android.vending.billing.RESPONSE_CODE" />
- <action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
- </intent-filter>
- </receiver>
-
- </application>
-</manifest>
-</pre>
-
-<h2 id="billing-service">Creating a Local Service</h2>
-
-<p>Your application must have a local {@link android.app.Service} to facilitate messaging between
-your application and Google Play. At a minimum, this service must do the following:</p>
-
-<ul>
- <li>Bind to the <code>MarketBillingService</code>.
- <li>Send billing requests (as IPC method calls) to the Google Play application. The five types
- of billing requests include:
- <ul>
- <li><code>CHECK_BILLING_SUPPORTED</code> requests</li>
- <li><code>REQUEST_PURCHASE</code> requests</li>
- <li><code>GET_PURCHASE_INFORMATION</code> requests</li>
- <li><code>CONFIRM_NOTIFICATIONS</code> requests</li>
- <li><code>RESTORE_TRANSACTIONS</code> requests</li>
- </ul>
- </li>
- <li>Handle the synchronous response messages that are returned with each billing request.</li>
-</ul>
-
-<h3>Binding to the MarketBillingService</h3>
-
-<p>Binding to the <code>MarketBillingService</code> is relatively easy if you've already added the
-<code>IMarketBillingService.aidl</code> file to your project. The following code sample shows how to
-use the {@link android.content.Context#bindService bindService()} method to bind a service to the
-<code>MarketBillingService</code>. You could put this code in your service's {@link
-android.app.Activity#onCreate onCreate()} method.</p>
-
-<pre>
-try {
- boolean bindResult = mContext.bindService(
- new Intent("com.android.vending.billing.MarketBillingService.BIND"), this,
- Context.BIND_AUTO_CREATE);
- if (bindResult) {
- Log.i(TAG, "Service bind successful.");
- } else {
- Log.e(TAG, "Could not bind to the MarketBillingService.");
- }
-} catch (SecurityException e) {
- Log.e(TAG, "Security exception: " + e);
-}
-</pre>
-
-<p>After you bind to the service, you need to create a reference to the
-<code>IMarketBillingService</code> interface so you can make billing requests via IPC method calls.
-The following code shows you how to do this using the {@link
-android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback method.</p>
-
-<pre>
-/**
- * The Android system calls this when we are connected to the MarketBillingService.
- */
- public void onServiceConnected(ComponentName name, IBinder service) {
- Log.i(TAG, "MarketBillingService connected.");
- mService = IMarketBillingService.Stub.asInterface(service);
- }
-</pre>
-
-<p>You can now use the <code>mService</code> reference to invoke the
-<code>sendBillingRequest()</code> method.</p>
-
-<p>For a complete implementation of a service that binds to the <code>MarketBillingService</code>,
-see the <code>BillingService</code> class in the sample application.</p>
-
-<h3>Sending billing requests to the MarketBillingService</h3>
-
-<p>Now that your {@link android.app.Service} has a reference to the
-<code>IMarketBillingService</code> interface, you can use that reference to send billing requests
-(via IPC method calls) to the <code>MarketBillingService</code>. The
-<code>MarketBillingService</code> IPC interface exposes a single public method
-(<code>sendBillingRequest()</code>), which takes a single {@link android.os.Bundle} parameter. The
-Bundle that you deliver with this method specifies the type of request you want to perform, using
-various key-value pairs. For instance, one key indicates the type of request you are making, another
-indicates the item being purchased, and another identifies your application. The
-<code>sendBillingRequest()</code> method immediately returns a Bundle containing an initial response
-code. However, this is not the complete purchase response; the complete response is delivered with
-an asynchronous broadcast intent. For more information about the various Bundle keys that are
-supported by the <code>MarketBillingService</code>, see <a
-href="{@docRoot}guide/market/billing/billing_reference.html#billing-interface">In-app Billing
-Service Interface</a>.</p>
-
-<p>You can use the <code>sendBillingRequest()</code> method to send five types of billing requests.
-The five request types are specified using the <code>BILLING_REQUEST</code> Bundle key. This Bundle
-key can have the following five values:</p>
-
-<ul>
- <li><code>CHECK_BILLING_SUPPORTED</code>—verifies that the Google Play application
- supports in-app billing.</li>
- <li><code>REQUEST_PURCHASE</code>—sends a purchase request for an in-app item.</li>
- <li><code>GET_PURCHASE_INFORMATION</code>—retrieves transaction information for a purchase
- or refund.</li>
- <li><code>CONFIRM_NOTIFICATIONS</code>—acknowledges that you received the transaction
- information for a purchase or refund.</li>
- <li><code>RESTORE_TRANSACTIONS</code>—retrieves a user's transaction history for <a
- href="{@docRoot}guide/market/billing/billing_admin.html#billing-purchase-type">managed
- purchases</a>.</li>
-</ul>
-
-<p>To make any of these billing requests, you first need to build an initial {@link
-android.os.Bundle} that contains the three keys that are required for all requests:
-<code>BILLING_REQUEST</code>, <code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The following
-code sample shows you how to create a helper method named <code>makeRequestBundle()</code> that does
-this.</p>
-
-<pre>
-protected Bundle makeRequestBundle(String method) {
- Bundle request = new Bundle();
- request.putString(BILLING_REQUEST, method);
- request.putInt(API_VERSION, 1);
- request.putString(PACKAGE_NAME, getPackageName());
- return request;
-</pre>
-
-<p>To use this helper method, you pass in a <code>String</code> that corresponds to one of the five
-types of billing requests. The method returns a Bundle that has the three required keys defined. The
-following sections show you how to use this helper method when you send a billing request.</p>
-
-<p class="caution"><strong>Important</strong>: You must make all in-app billing requests from your
-application's main thread.</p>
-
-<h4>Verifying that in-app billing is supported (CHECK_BILLING_SUPPPORTED)</h4>
-
-<p>The following code sample shows how to verify whether the Google Play application supports
-in-app billing. In the sample, <code>mService</code> is an instance of the
-<code>MarketBillingService</code> interface.</p>
-
-<pre>
-/**
-* Request type is CHECK_BILLING_SUPPORTED
-*/
- Bundle request = makeRequestBundle("CHECK_BILLING_SUPPORTED");
- Bundle response = mService.sendBillingRequest(request);
- // Do something with this response.
-}
-</pre>
-<p>The <code>makeRequestBundle()</code> method constructs an initial Bundle, which contains the
-three keys that are required for all requests: <code>BILLING_REQUEST</code>,
-<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The request returns a synchronous {@link
-android.os.Bundle} response, which contains only a single key: <code>RESPONSE_CODE</code>. The
-<code>RESPONSE_CODE</code> key can have the following values:</p>
-<ul>
- <li><code>RESULT_OK</code>—in-app billing is supported.</li>
- <li><code>RESULT_BILLING_UNAVAILABLE</code>—in-app billing is not available because the API
- version you specified is not recognized or the user is not eligible to make in-app purchases (for
- example, the user resides in a country that prohibits in-app purchases).</li>
- <li><code>RESULT_ERROR</code>—there was an error connecting with the Google Play
- application.</li>
- <li><code>RESULT_DEVELOPER_ERROR</code>—the application is trying to make an in-app billing
- request but the application has not declared the <code>com.android.vending.BILLING</code>
- permission in its manifest. Can also indicate that an application is not properly signed, or that
- you sent a malformed request.</li>
-</ul>
-
-<p>The <code>CHECK_BILLING_SUPPORTED</code> request does not trigger any asynchronous responses
-(broadcast intents).</p>
-
-<p>We recommend that you invoke the <code>CHECK_BILLING_SUPPORTED</code> request within a
-<code>RemoteException</code> block. When your code throws a <code>RemoteException</code> it
-indicates that the remote method call failed, which means that the Google Play application is out
-of date and needs to be updated. In this case, you can provide users with an error message that
-contains a link to the <a
-href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google Play</a>
-Help topic.</p>
-
-<p>The sample application demonstrates how you can handle this error condition (see
-<code>DIALOG_CANNOT_CONNECT_ID</code> in <code>Dungeons.java</code>).</p>
-
-<h4>Making a purchase request (REQUEST_PURCHASE)</h4>
-
-<p>To make a purchase request you must do the following:</p>
-
-<ul>
- <li>Send the <code>REQUEST_PURCHASE</code> request.</li>
- <li>Launch the {@link android.app.PendingIntent} that is returned from the Google Play
- application.</li>
- <li>Handle the broadcast intents that are sent by the Google Play application.</li>
-</ul>
-
-<h5>Making the request</h5>
-
-<p>You must specify four keys in the request {@link android.os.Bundle}. The following code sample
-shows how to set these keys and make a purchase request for a single in-app item. In the sample,
-<code>mProductId</code> is the Google Play product ID of an in-app item (which is listed in the
-application's <a href="{@docRoot}guide/market/billing/billing_admin.html#billing-list-setup">product
-list</a>), and <code>mService</code> is an instance of the <code>MarketBillingService</code>
-interface.</p>
-
-<pre>
-/**
-* Request type is REQUEST_PURCHASE
-*/
- Bundle request = makeRequestBundle("REQUEST_PURCHASE");
- request.putString(ITEM_ID, mProductId);
- // Note that the developer payload is optional.
- if (mDeveloperPayload != null) {
- request.putString(DEVELOPER_PAYLOAD, mDeveloperPayload);
- }
- Bundle response = mService.sendBillingRequest(request);
- // Do something with this response.
-</pre>
-<p>The <code>makeRequestBundle()</code> method constructs an initial Bundle, which contains the
-three keys that are required for all requests: <code>BILLING_REQUEST</code>,
-<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The <code>ITEM_ID</code> key is then added
-to the Bundle prior to invoking the <code>sendBillingRequest()</code> method.</p>
-
-<p>The request returns a synchronous {@link android.os.Bundle} response, which contains three keys:
-<code>RESPONSE_CODE</code>, <code>PURCHASE_INTENT</code>, and <code>REQUEST_ID</code>. The
-<code>RESPONSE_CODE</code> key provides you with the status of the request and the
-<code>REQUEST_ID</code> key provides you with a unique request identifier for the request. The
-<code>PURCHASE_INTENT</code> key provides you with a {@link android.app.PendingIntent}, which you
-can use to launch the checkout UI.</p>
-
-<h5>Using the pending intent</h5>
-
-<p>How you use the pending intent depends on which version of Android a device is running. On
-Android 1.6, you must use the pending intent to launch the checkout UI in its own separate task
-instead of your application's activity stack. On Android 2.0 and higher, you can use the pending
-intent to launch the checkout UI on your application's activity stack. The following code shows you
-how to do this. You can find this code in the <code>PurchaseObserver.java</code> file in the sample
-application.</p>
-
-<pre>
-void startBuyPageActivity(PendingIntent pendingIntent, Intent intent) {
- if (mStartIntentSender != null) {
- // This is on Android 2.0 and beyond. The in-app checkout page activity
- // will be on the activity stack of the application.
- try {
- // This implements the method call:
- // mActivity.startIntentSender(pendingIntent.getIntentSender(),
- // intent, 0, 0, 0);
- mStartIntentSenderArgs[0] = pendingIntent.getIntentSender();
- mStartIntentSenderArgs[1] = intent;
- mStartIntentSenderArgs[2] = Integer.valueOf(0);
- mStartIntentSenderArgs[3] = Integer.valueOf(0);
- mStartIntentSenderArgs[4] = Integer.valueOf(0);
- mStartIntentSender.invoke(mActivity, mStartIntentSenderArgs);
- } catch (Exception e) {
- Log.e(TAG, "error starting activity", e);
- }
- } else {
- // This is on Android 1.6. The in-app checkout page activity will be on its
- // own separate activity stack instead of on the activity stack of
- // the application.
- try {
- pendingIntent.send(mActivity, 0 /* code */, intent);
- } catch (CanceledException e) {
- Log.e(TAG, "error starting activity", e);
- }
- }
-}
-</pre>
-
-<p class="caution"><strong>Important:</strong> You must launch the pending intent from an activity
-context and not an application context. Also, you cannot use the <code>singleTop</code> <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">launch mode</a> to launch the
-pending intent. If you do either of these, the Android system will not attach the pending intent to
-your application process. Instead, it will bring Google Play to the foreground, disrupting your
-application.</p>
-
-<h5>Handling broadcast intents</h5>
-
-<p>A <code>REQUEST_PURCHASE</code> request also triggers two asynchronous responses (broadcast
-intents). First, the Google Play application sends a <code>RESPONSE_CODE</code> broadcast intent,
-which provides error information about the request. If the request does not generate an
-error, the <code>RESPONSE_CODE</code> broadcast intent returns <code>RESULT_OK</code>, which
-indicates that the request was successfully sent. (To be clear, a <code>RESULT_OK</code> response
-does not indicate that the requested purchase was successful; it indicates that the request was sent
-successfully to Google Play.)</p>
-
-<p>Next, when the requested transaction changes state (for example, the purchase is successfully
-charged to a credit card or the user cancels the purchase), the Google Play application sends an
-<code>IN_APP_NOTIFY</code> broadcast intent. This message contains a notification ID, which you can
-use to retrieve the transaction details for the <code>REQUEST_PURCHASE</code> request.</p>
-
-<p class="note"><strong>Note:</strong> The Google Play application also sends
-an <code>IN_APP_NOTIFY</code> for refunds. For more information, see <a
-href="{@docRoot}guide/market/billing/billing_overview.html#billing-action-notify">Handling
-IN_APP_NOTIFY messages</a>.</p>
-
-<p>Because the purchase process is not instantaneous and can take several seconds (or more), you
-must assume that a purchase request is pending from the time you receive a <code>RESULT_OK</code>
-message until you receive an <code>IN_APP_NOTIFY</code> message for the transaction. While the
-transaction is pending, the Google Play checkout UI displays an "Authorizing purchase..."
-notification; however, this notification is dismissed after 60 seconds and you should not rely on
-this notification as your primary means of conveying transaction status to users. Instead, we
-recommend that you do the following:</p>
-
-<ul>
- <li>Add an {@link android.app.Activity} to your application that shows users the status of pending
-and completed in-app purchases.</li>
- <li>Use a <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">status
-bar notification</a> to keep users informed about the progress of a purchase.</li>
-</ul>
-
-<p>To use these two UI elements, you could invoke a status bar notification with a ticker-text
-message that says "Purchase pending" when your application receives a <code>RESULT_OK</code>
-message. Then, when your application receives an <code>IN_APP_NOTIFY</code> message, you could
-update the notification with a new message that says "Purchase succeeded" or "Purchase failed." When
-a user touches the expanded status bar notification, you could launch the activity that shows the
-status of pending and completed in-app purchases.</p>
-
-<p>If you use some other UI technique to inform users about the state of a pending transaction,
-be sure that your pending status UI does not block your application. For example, you should avoid
-using a hovering progress wheel to convey the status of a pending transaction because a pending
-transaction could last a long time, particularly if a device loses network connectivity and cannot
-receive transaction updates from Google Play.</p>
-
-<p class="caution"><strong>Important:</strong> If a user purchases a managed item, you must prevent
-the user from purchasing the item again while the original transaction is pending. If a user
-attempts to purchase a managed item twice, and the first transaction is still pending, Google
-Play will display an error to the user; however, Google Play will not send an error to your
-application notifying you that the second purchase request was canceled. This might cause your
-application to get stuck in a pending state while it waits for an <code>IN_APP_NOTIFY</code> message
-for the second purchase request.</p>
-
-<h4>Retrieving transaction information for a purchase or refund (GET_PURCHASE_INFORMATION)</h4>
-
-<p>You retrieve transaction information in response to an <code>IN_APP_NOTIFY</code> broadcast
-intent. The <code>IN_APP_NOTIFY</code> message contains a notification ID, which you can use to
-retrieve transaction information.</p>
-
-<p>To retrieve transaction information for a purchase or refund you must specify five keys in the
-request {@link android.os.Bundle}. The following code sample shows how to set these keys and make
-the request. In the sample, <code>mService</code> is an instance of the
-<code>MarketBillingService</code> interface.</p>
-
-<pre>
-/**
-* Request type is GET_PURCHASE_INFORMATION
-*/
- Bundle request = makeRequestBundle("GET_PURCHASE_INFORMATION");
- request.putLong(REQUEST_NONCE, mNonce);
- request.putStringArray(NOTIFY_IDS, mNotifyIds);
- Bundle response = mService.sendBillingRequest(request);
- // Do something with this response.
-}
-</pre>
-<p>The <code>makeRequestBundle()</code> method constructs an initial Bundle, which contains the
-three keys that are required for all requests: <code>BILLING_REQUEST</code>,
-<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The additional keys are then added to the
-bundle prior to invoking the <code>sendBillingRequest()</code> method. The
-<code>REQUEST_NONCE</code> key contains a cryptographically secure nonce (number used once) that you
-must generate. The Google Play application returns this nonce with the
-<code>PURCHASE_STATE_CHANGED</code> broadcast intent so you can verify the integrity of the
-transaction information. The <code>NOTIFY_IDS</code> key contains an array of notification IDs,
-which you received in the <code>IN_APP_NOTIFY</code> broadcast intent.</p>
-
-<p>The request returns a synchronous {@link android.os.Bundle} response, which contains two keys:
-<code>RESPONSE_CODE</code> and <code>REQUEST_ID</code>. The <code>RESPONSE_CODE</code> key provides
-you with the status of the request and the <code>REQUEST_ID</code> key provides you with a unique
-request identifier for the request.</p>
-
-<p>A <code>GET_PURCHASE_INFORMATION</code> request also triggers two asynchronous responses
-(broadcast intents). First, the Google Play application sends a <code>RESPONSE_CODE</code>
-broadcast intent, which provides status and error information about the request. Next, if the
-request was successful, the Google Play application sends a <code>PURCHASE_STATE_CHANGED</code>
-broadcast intent. This message contains detailed transaction information. The transaction
-information is contained in a signed JSON string (unencrypted). The message includes the signature
-so you can verify the integrity of the signed string.</p>
-
-<h4>Acknowledging transaction information (CONFIRM_NOTIFICATIONS)</h4>
-
-<p>To acknowledge that you received transaction information you send a
-<code>CONFIRM_NOTIFICATIONS</code> request. You must specify four keys in the request {@link
-android.os.Bundle}. The following code sample shows how to set these keys and make the request. In
-the sample, <code>mService</code> is an instance of the <code>MarketBillingService</code>
-interface.</p>
-
-<pre>
-/**
-* Request type is CONFIRM_NOTIFICATIONS
-*/
- Bundle request = makeRequestBundle("CONFIRM_NOTIFICATIONS");
- request.putStringArray(NOTIFY_IDS, mNotifyIds);
- Bundle response = mService.sendBillingRequest(request);
- // Do something with this response.
-}
-</pre>
-<p>The <code>makeRequestBundle()</code> method constructs an initial Bundle, which contains the
-three keys that are required for all requests: <code>BILLING_REQUEST</code>,
-<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The additional <code>NOTIFY_IDS</code> key
-is then added to the bundle prior to invoking the <code>sendBillingRequest()</code> method. The
-<code>NOTIFY_IDS</code> key contains an array of notification IDs, which you received in an
-<code>IN_APP_NOTIFY</code> broadcast intent and also used in a <code>GET_PURCHASE_INFORMATION</code>
-request.</p>
-
-<p>The request returns a synchronous {@link android.os.Bundle} response, which contains two keys:
-<code>RESPONSE_CODE</code> and <code>REQUEST_ID</code>. The <code>RESPONSE_CODE</code> key provides
-you with the status of the request and the <code>REQUEST_ID</code> key provides you with a unique
-request identifier for the request.</p>
-
-<p>A <code>CONFIRM_NOTIFICATIONS</code> request triggers a single asynchronous response—a
-<code>RESPONSE_CODE</code> broadcast intent. This broadcast intent provides status and error
-information about the request.</p>
-
-<p>You must send a confirmation when you receive transaction information from Google Play. If you
-don't send a confirmation message, Google Play will continue sending
-<code>IN_APP_NOTIFY</code> messages for the transactions you have not confirmed. Also,
-your application must be able to handle <code>IN_APP_NOTIFY</code> messages that contain multiple
-orders.</p>
-
-<p>In addition, as a best practice, you should not send a <code>CONFIRM_NOTIFICATIONS</code> request
-for a purchased item until you have delivered the item to the user. This way, if your application
-crashes or something else prevents your application from delivering the product, your application
-will still receive an <code>IN_APP_NOTIFY</code> broadcast intent from Google Play indicating
-that you need to deliver the product.</p>
-
-<h4>Restoring transaction information (RESTORE_TRANSACTIONS)</h4>
-
-<p>To restore a user's transaction information, you send a <code>RESTORE_TRANSACTIONS</code>
-request. You must specify four keys in the request {@link android.os.Bundle}. The following code
-sample shows how to set these keys and make the request. In the sample, <code>mService</code> is an
-instance of the <code>MarketBillingService</code> interface.</p>
-
-<pre>
-/**
-* Request type is RESTORE_TRANSACTIONS
-*/
- Bundle request = makeRequestBundle("RESTORE_TRANSACTIONS");
- request.putLong(REQUEST_NONCE, mNonce);
- Bundle response = mService.sendBillingRequest(request);
- // Do something with this response.
-}
-</pre>
-<p>The <code>makeRequestBundle()</code> method constructs an initial Bundle, which contains the
-three keys that are required for all requests: <code>BILLING_REQUEST</code>,
-<code>API_VERSION</code>, and <code>PACKAGE_NAME</code>. The additional <code>REQUEST_NONCE</code>
-key is then added to the bundle prior to invoking the <code>sendBillingRequest()</code> method. The
-<code>REQUEST_NONCE</code> key contains a cryptographically secure nonce (number used once) that you
-must generate. The Google Play application returns this nonce with the transactions information
-contained in the <code>PURCHASE_STATE_CHANGED</code> broadcast intent so you can verify the
-integrity of the transaction information.</p>
-
-<p>The request returns a synchronous {@link android.os.Bundle} response, which contains two keys:
-<code>RESPONSE_CODE</code> and <code>REQUEST_ID</code>. The <code>RESPONSE_CODE</code> key provides
-you with the status of the request and the <code>REQUEST_ID</code> key provides you with a unique
-request identifier for the request.</p>
-
-<p>A <code>RESTORE_TRANSACTIONS</code> request also triggers two asynchronous responses (broadcast
-intents). First, the Google Play application sends a <code>RESPONSE_CODE</code> broadcast intent,
-which provides status and error information about the request. Next, if the request was successful,
-the Google Play application sends a <code>PURCHASE_STATE_CHANGED</code> broadcast intent. This
-message contains the detailed transaction information. The transaction information is contained in a
-signed JSON string (unencrypted). The message includes the signature so you can verify the integrity
-of the signed string.</p>
-
-<p class="note"><strong>Note:</strong> You should use the <code>RESTORE_TRANSACTIONS</code>
-request type only when your application is installed for the first time on a device or when your
-application has been removed from a device and reinstalled.</p>
-
-<h3>Other service tasks</h3>
-
-<p>You may also want your {@link android.app.Service} to receive intent messages from your {@link
-android.content.BroadcastReceiver}. You can use these intent messages to convey the information that
-was sent asynchronously from the Google Play application to your {@link
-android.content.BroadcastReceiver}. To see an example of how you can send and receive these intent
-messages, see the <code>BillingReceiver.java</code> and <code>BillingService.java</code> files in
-the sample application. You can use these samples as a basis for your own implementation. However,
-if you use any of the code from the sample application, be sure you follow the guidelines in <a
-href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and Design</a>.</p>
-
-<h2 id="billing-broadcast-receiver">Creating a BroadcastReceiver</h2>
-
-<p>The Google Play application uses broadcast intents to send asynchronous billing responses to
-your application. To receive these intent messages, you need to create a {@link
-android.content.BroadcastReceiver} that can handle the following intents:</p>
-
-<ul>
- <li>com.android.vending.billing.RESPONSE_CODE
- <p>This broadcast intent contains a Google Play response code, and is sent after you make an
- in-app billing request. For more information about the response codes that are sent with this
- response, see <a
- href="{@docRoot}guide/market/billing/billing_reference.html#billing-codes">Google Play Response
- Codes for In-app Billing</a>.</p>
- </li>
- <li>com.android.vending.billing.IN_APP_NOTIFY
- <p>This response indicates that a purchase has changed state, which means a purchase succeeded,
- was canceled, or was refunded. For more information about notification messages, see <a
- href="{@docRoot}guide/market/billing/billing_reference.html#billing-intents">In-app Billing
- Broadcast Intents</a></p>
- </li>
- <li>com.android.vending.billing.PURCHASE_STATE_CHANGED
- <p>This broadcast intent contains detailed information about one or more transactions. For more
- information about purchase state messages, see <a
- href="{@docRoot}guide/market/billing/billing_reference.html#billing-intents">In-app Billing
- Broadcast Intents</a></p>
- </li>
-</ul>
-
-<p>Each of these broadcast intents provide intent extras, which your {@link
-android.content.BroadcastReceiver} must handle. The intent extras are listed in the following table
-(see table 1).</p>
-
-<p class="table-caption"><strong>Table 1.</strong> Description of broadcast intent extras that are
-sent in response to billing requests.</p>
-
-<table>
-
-<tr>
-<th>Intent</th>
-<th>Extra</th>
-<th>Description</th>
-</tr>
-<tr>
- <td><code>com.android.vending.billing.RESPONSE_CODE</code></td>
- <td><code>request_id</code></td>
- <td>A <code>long</code> representing a request ID. A request ID identifies a specific billing
- request and is returned by Google Play at the time a request is made.</td>
-</tr>
-<tr>
- <td><code>com.android.vending.billing.RESPONSE_CODE</code></td>
- <td><code>response_code</code></td>
- <td>An <code>int</code> representing the actual Google Play server response code.</td>
-</tr>
-<tr>
- <td><code>com.android.vending.billing.IN_APP_NOTIFY</code></td>
- <td><code>notification_id</code></td>
- <td>A <code>String</code> representing the notification ID for a given purchase state change.
- Google Play notifies you when there is a purchase state change and the notification includes a
- unique notification ID. To get the details of the purchase state change, you send the notification
- ID with the <code>GET_PURCHASE_INFORMATION</code> request.</td>
-</tr>
-<tr>
- <td><code>com.android.vending.billing.PURCHASE_STATE_CHANGED</code></td>
- <td><code>inapp_signed_data</code></td>
- <td>A <code>String</code> representing the signed JSON string. The JSON string contains
- information about the billing transaction, such as order number, amount, and the item that was
- purchased or refunded.</td>
-</tr>
-<tr>
- <td><code>com.android.vending.billing.PURCHASE_STATE_CHANGED</code></td>
- <td><code>inapp_signature</code></td>
- <td>A <code>String</code> representing the signature of the JSON string.</td>
-</tr>
-</table>
-
-<p>The following code sample shows how to handle these broadcast intents and intent extras within a
-{@link android.content.BroadcastReceiver}. The BroadcastReceiver in this case is named
-<code>BillingReceiver</code>, just as it is in the sample application.</p>
-
-<pre>
-public class BillingReceiver extends BroadcastReceiver {
-
- private static final String TAG = "BillingReceiver";
-
- // Intent actions that we receive in the BillingReceiver from Google Play.
- // These are defined by Google Play and cannot be changed.
- // The sample application defines these in the Consts.java file.
- public static final String ACTION_NOTIFY = "com.android.vending.billing.IN_APP_NOTIFY";
- public static final String ACTION_RESPONSE_CODE = "com.android.vending.billing.RESPONSE_CODE";
- public static final String ACTION_PURCHASE_STATE_CHANGED =
- "com.android.vending.billing.PURCHASE_STATE_CHANGED";
-
- // The intent extras that are passed in an intent from Google Play.
- // These are defined by Google Play and cannot be changed.
- // The sample application defines these in the Consts.java file.
- public static final String NOTIFICATION_ID = "notification_id";
- public static final String INAPP_SIGNED_DATA = "inapp_signed_data";
- public static final String INAPP_SIGNATURE = "inapp_signature";
- public static final String INAPP_REQUEST_ID = "request_id";
- public static final String INAPP_RESPONSE_CODE = "response_code";
-
-
- @Override
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
- if (ACTION_PURCHASE_STATE_CHANGED.equals(action)) {
- String signedData = intent.getStringExtra(INAPP_SIGNED_DATA);
- String signature = intent.getStringExtra(INAPP_SIGNATURE);
- // Do something with the signedData and the signature.
- } else if (ACTION_NOTIFY.equals(action)) {
- String notifyId = intent.getStringExtra(NOTIFICATION_ID);
- // Do something with the notifyId.
- } else if (ACTION_RESPONSE_CODE.equals(action)) {
- long requestId = intent.getLongExtra(INAPP_REQUEST_ID, -1);
- int responseCodeIndex = intent.getIntExtra(INAPP_RESPONSE_CODE,
- ResponseCode.RESULT_ERROR.ordinal());
- // Do something with the requestId and the responseCodeIndex.
- } else {
- Log.w(TAG, "unexpected action: " + action);
- }
- }
- // Perform other processing here, such as forwarding intent messages to your local service.
-}
-</pre>
-
-<p>In addition to receiving broadcast intents from the Google Play application, your {@link
-android.content.BroadcastReceiver} must handle the information it received in the broadcast intents.
-Usually, your {@link android.content.BroadcastReceiver} does this by sending the information to a
-local service (discussed in the next section). The <code>BillingReceiver.java</code> file in the
-sample application shows you how to do this. You can use this sample as a basis for your own {@link
-android.content.BroadcastReceiver}. However, if you use any of the code from the sample application,
-be sure you follow the guidelines that are discussed in <a
-href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and Design </a>.</p>
-
-<h2 id="billing-signatures">Verifying Signatures and Nonces</h2>
-
-<p>Google Play's in-app billing service uses two mechanisms to help verify the integrity of the
-transaction information you receive from Google Play: nonces and signatures. A nonce (number used
-once) is a cryptographically secure number that your application generates and sends with every
-<code>GET_PURCHASE_INFORMATION</code> and <code>RESTORE_TRANSACTIONS</code> request. The nonce is
-returned with the <code>PURCHASE_STATE_CHANGED</code> broadcast intent, enabling you to verify that
-any given <code>PURCHASE_STATE_CHANGED</code> response corresponds to an actual request that you
-made. Every <code>PURCHASE_STATE_CHANGED</code> broadcast intent also includes a signed JSON string
-and a signature, which you can use to verify the integrity of the response.</p>
-
-<p>Your application must provide a way to generate, manage, and verify nonces. The following sample
-code shows some simple methods you can use to do this.</p>
-
-<pre>
- private static final SecureRandom RANDOM = new SecureRandom();
- private static HashSet<Long> sKnownNonces = new HashSet<Long>();
-
- public static long generateNonce() {
- long nonce = RANDOM.nextLong();
- sKnownNonces.add(nonce);
- return nonce;
- }
-
- public static void removeNonce(long nonce) {
- sKnownNonces.remove(nonce);
- }
-
- public static boolean isNonceKnown(long nonce) {
- return sKnownNonces.contains(nonce);
- }
-</pre>
-
-<p>Your application must also provide a way to verify the signatures that accompany every
-<code>PURCHASE_STATE_CHANGED</code> broadcast intent. The <code>Security.java</code> file in the
-sample application shows you how to do this. If you use this file as a basis for your own security
-implementation, be sure to follow the guidelines in <a
-href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and Design</a> and
-obfuscate your code.</p>
-
-<p>You will need to use your Google Play public key to perform the signature verification. The
-following procedure shows you how to retrieve Base64-encoded public key from the Google Play
-publisher site.</p>
-
-<ol>
- <li>Log in to your <a href="http://play.google.com/apps/publish">publisher account</a>.</li>
- <li>On the upper left part of the page, under your name, click <strong>Edit profile</strong>.</li>
- <li>On the Edit Profile page, scroll down to the Licensing & In-app Billing panel (see figure
- 2).</li>
- <li>Copy your public key.</li>
-</ol>
-
-<p class="caution"><strong>Important</strong>: To keep your public key safe from malicious users and
-hackers, do not embed your public key as an entire literal string. Instead, construct the string at
-runtime from pieces or use bit manipulation (for example, XOR with some other string) to hide the
-actual key. The key itself is not secret information, but you do not want to make it easy for a
-hacker or malicious user to replace the public key with another key.</p>
-
-<img src="{@docRoot}images/billing_public_key.png" height="510" id="figure2" />
-<p class="img-caption">
- <strong>Figure 2.</strong> The Licensing and In-app Billing panel of your account's Edit Profile
- page lets you see your public key.
-</p>
-
-<h2 id="billing-implement">Modifying Your Application Code</h2>
-
-<p>After you finish adding in-app billing components to your project, you are ready to modify your
-application's code. For a typical implementation, like the one that is demonstrated in the sample
-application, this means you need to write code to do the following: </p>
-
-<ul>
- <li>Create a storage mechanism for storing users' purchase information.</li>
- <li>Create a user interface that lets users select items for purchase.</li>
-</ul>
-
-<p>The sample code in <code>Dungeons.java</code> shows you how to do both of these tasks.</p>
-
-<h3>Creating a storage mechanism for storing purchase information</h3>
-
-<p>You must set up a database or some other mechanism for storing users' purchase information. The
-sample application provides an example database (PurchaseDatabase.java); however, the example
-database has been simplified for clarity and does not exhibit the security best practices that we
-recommend. If you have a remote server, we recommend that you store purchase information on your
-server instead of in a local database on a device. For more information about security best
-practices, see <a href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and
-Design</a>.</p>
-
-<p class="note"><strong>Note</strong>: If you store any purchase information on a device, be sure to
-encrypt the data and use a device-specific encryption key. Also, if the purchase type for any of
-your items is "unmanaged," we recommend that you back up the purchase information for these items to
-a remote server or use Android's <a href="{@docRoot}guide/topics/data/backup.html">data
-backup</a> framework to back up the purchase information. Backing up purchase information for
-unmanaged items is important because unmanaged items cannot be restored by using the
-<code>RESTORE_TRANSACTIONS</code> request type.</p>
-
-<h3>Creating a user interface for selecting items</h3>
-
-<p>You must provide users with a means for selecting items that they want to purchase. Google
-Play provides the checkout user interface (which is where the user provides a form of payment and
-approves the purchase), but your application must provide a control (widget) that invokes the
-<code>sendBillingRequest()</code> method when a user selects an item for purchase.</p>
-
-<p>You can render the control and trigger the <code>sendBillingRequest()</code> method any way you
-want. The sample application uses a spinner widget and a button to present items to a user and
-trigger a billing request (see <code>Dungeons.java</code>). The user interface also shows a list of
-recently purchased items.</p>
-
diff --git a/docs/html/guide/market/billing/billing_overview.jd b/docs/html/guide/market/billing/billing_overview.jd
deleted file mode 100755
index b593811..0000000
--- a/docs/html/guide/market/billing/billing_overview.jd
+++ /dev/null
@@ -1,469 +0,0 @@
-page.title=In-app Billing Overview
-parent.title=In-app Billing
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#billing-arch">In-app Billing Architecture</a></li>
- <li><a href="#billing-msgs">In-app Billing Messages</a></li>
- <ol>
- <li><a href="#billing-request">Request messages</a></li>
- <li><a href="#billing-response">Broadcast intents</a></li>
- <li><a href="#billing-message-sequence">Messaging sequence</a></li>
- <li><a href="#billing-action-notify">Handling IN_APP_NOTIFY messages</a></li>
- </ol>
- <li><a href="#billing-security">Security Controls</a></li>
- <li><a href="#billing-limitations">Requirements and Limitations</a></li>
- </ol>
- <h2>Downloads</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">Sample
- Application</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html">Implementing In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and
- Design</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_testing.html">Testing In-app Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_admin.html">Administering In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_reference.html">In-app Billing
- Reference</a></li>
- </ol>
-</div>
-</div>
-
-<p>In-app Billing is a Google Play service that provides checkout processing for
-in-app purchases. To use the service, your application sends a billing request for a specific in-app
-product. The service then handles all of the checkout details for the transaction, including
-requesting and validating the form of payment and processing the financial transaction. When the
-checkout process is complete, the service sends your application the purchase details, such as the
-order number, the order date and time, and the price paid. At no point does your application have to
-handle any financial transactions; that role is provided by Google Play's in-app billing
-service.</p>
-
-<h2 id="billing-arch">In-app Billing Architecture</h2>
-
-<p>In-app billing uses an asynchronous message loop to convey billing requests and billing responses
-between your application and the Google Play server. In practice, your application never directly
-communicates with the Google Play server (see figure 1). Instead, your application sends billing
-requests to the Google Play application over interprocess communication (IPC) and receives
-purchase responses from the Google Play application in the form of asynchronous broadcast
-intents. Your application does not manage any network connections between itself and the Google
-Play server or use any special APIs from the Android platform.</p>
-
-<p>Some in-app billing implementations may also use a private remote server to deliver content or
-validate transactions, but a remote server is not required to implement in-app billing. A remote
-server can be useful if you are selling digital content that needs to be delivered to a user's
-device, such as media files or photos. You might also use a remote server to store users'
-transaction history or perform various in-app billing security tasks, such as signature
-verification. Although you can handle all security-related tasks in your application, performing
-those tasks on a remote server is recommended because it helps make your application less vulnerable
-to security attacks.</p>
-
-<div class="figure" style="width:440px">
-<img src="{@docRoot}images/billing_arch.png" alt="" height="582" />
-<p class="img-caption">
- <strong>Figure 1.</strong> Your application sends and receives billing messages through the
- Google Play application, which handles all communication with the Google Play server.</p>
-</div>
-
-<p>A typical in-app billing implementation relies on three components:</p>
-<ul>
- <li>A {@link android.app.Service} (named <code>BillingService</code> in the sample application),
- which processes purchase messages from the application and sends billing requests to the Google
- Play in-app billing service.</li>
- <li>A {@link android.content.BroadcastReceiver} (named <code>BillingReceiver</code> in the sample
- application), which receives all asynchronous billing responses from the Google Play
- application.</li>
- <li>A security component (named <code>Security</code> in the sample application), which performs
- security-related tasks, such as signature verification and nonce generation. For more information
- about in-app billing security, see <a href="#billing-security">Security controls</a> later in this
- document.</li>
-</ul>
-
-<p>You may also want to incorporate two other components to support in-app billing:</p>
-<ul>
- <li>A response {@link android.os.Handler} (named <code>ResponseHandler</code> in the sample
- application), which provides application-specific processing of purchase notifications, errors,
- and other status messages.</li>
- <li>An observer (named <code>PurchaseObserver</code> in the sample application), which is
- responsible for sending callbacks to your application so you can update your user interface with
- purchase information and status.</li>
-</ul>
-
-<p>In addition to these components, your application must provide a way to store information about
-users' purchases and some sort of user interface that lets users select items to purchase. You do
-not need to provide a checkout user interface. When a user initiates an in-app purchase, the Google
-Play application presents the checkout user interface to your user. When the user completes the
-checkout process, your application resumes.</p>
-
-<h2 id="billing-msgs">In-app Billing Messages</h2>
-
-<p>When the user initiates a purchase, your application sends billing messages to Google Play's
-in-app billing service (named <code>MarketBillingService</code>) using simple IPC method calls. The
-Google Play application responds to all billing requests synchronously, providing your
-application with status notifications and other information. The Google Play application also
-responds to some billing requests asynchronously, providing your application with error messages and
-detailed transaction information. The following section describes the basic request-response
-messaging that takes place between your application and the Google Play application.</p>
-
-<h3 id="billing-request">In-app billing requests</h3>
-
-<p>Your application sends in-app billing requests by invoking a single IPC method
-(<code>sendBillingRequest()</code>), which is exposed by the <code>MarketBillingService</code>
-interface. This interface is defined in an <a
-href="{@docRoot}guide/developing/tools/aidl.html">Android Interface Definition Language</a> file
-(<code>IMarketBillingService.aidl</code>). You can <a
-href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">download</a> this AIDL
-file with the in-app billing sample application.</p>
-
-<p>The <code>sendBillingRequest()</code> method has a single {@link android.os.Bundle} parameter.
-The Bundle that you deliver must include several key-value pairs that specify various parameters for
-the request, such as the type of billing request you are making, the item that is being purchased,
-and the application that is making the request. For more information about the Bundle keys that are
-sent with a request, see <a
-href="{@docRoot}guide/market/billing/billing_reference.html#billing-interface">In-app Billing
-Service Interface</a>.
-
-<p>One of the most important keys that every request Bundle must have is the
-<code>BILLING_REQUEST</code> key. This key lets you specify the type of billing request you are
-making. Google Play's in-app billing service supports the following five types of billing
-requests:</p>
-
-<ul>
- <li><code>CHECK_BILLING_SUPPORTED</code>
- <p>This request verifies that the Google Play application supports in-app billing. You
- usually send this request when your application first starts up. This request is useful if you
- want to enable or disable certain UI features that are relevant only to in-app billing.</p>
- </li>
- <li><code>REQUEST_PURCHASE</code>
- <p>This request sends a purchase message to the Google Play application and is the foundation
- of in-app billing. You send this request when a user indicates that he or she wants to purchase
- an item in your application. Google Play then handles the financial transaction by displaying
- the checkout user interface.</p>
- </li>
- <li><code>GET_PURCHASE_INFORMATION</code>
- <p>This request retrieves the details of a purchase state change. A purchase changes state when
- a requested purchase is billed successfully or when a user cancels a transaction during
- checkout. It can also occur when a previous purchase is refunded. Google Play notifies your
- application when a purchase changes state, so you only need to send this request when there is
- transaction information to retrieve.</p>
- </li>
- <li><code>CONFIRM_NOTIFICATIONS</code>
- <p>This request acknowledges that your application received the details of a purchase state
- change. Google Play sends purchase state change notifications to your application until you
- confirm that you received them.</p>
- </li>
- <li><code>RESTORE_TRANSACTIONS</code>
- <p>This request retrieves a user's transaction status for <a
- href="{@docRoot}guide/market/billing/billing_admin.html#billing-purchase-type">managed
- purchases</a>. You should send this request only when you need to retrieve a user's transaction
- status, which is usually only when your application is reinstalled or installed for the first
- time on a device.</p>
- </li>
-</ul>
-
-<h3 id="billing-response">In-app Billing Responses</h3>
-
-<p>The Google Play application responds to in-app billing requests with both synchronous and
-asynchronous responses. The synchronous response is a {@link android.os.Bundle} with the following
-three keys:</p>
-
-<ul>
- <li><code>RESPONSE_CODE</code>
- <p>This key provides status information and error information about a request.</p>
- </li>
- <li><code>PURCHASE_INTENT</code>
- <p>This key provides a {@link android.app.PendingIntent}, which you use to launch the checkout
- activity.</p>
- </li>
- <li><code>REQUEST_ID</code>
- <p>This key provides you with a request identifier, which you can use to match asynchronous
- responses with requests.</p>
- </li>
-</ul>
-<p>Some of these keys are not relevant to every request. For more information, see <a
-href="#billing-message-sequence">Messaging sequence</a> later in this document.</p>
-
-<p>The asynchronous response messages are sent in the form of individual broadcast intents and
-include the following:</p>
-
-<ul>
- <li><code>com.android.vending.billing.RESPONSE_CODE</code>
- <p>This response contains a Google Play server response code, and is sent after you make an
- in-app billing request. A server response code can indicate that a billing request was
- successfully sent to Google Play or it can indicate that some error occurred during a billing
- request. This response is <em>not</em> used to report any purchase state changes (such as refund
- or purchase information). For more information about the response codes that are sent with this
- response, see <a
- href="{@docRoot}guide/market/billing/billing_reference.html#billing-codes">Server Response Codes
- for In-app Billing</a>.</p>
- </li>
- <li><code>com.android.vending.billing.IN_APP_NOTIFY</code>
- <p>This response indicates that a purchase has changed state, which means a purchase succeeded,
- was canceled, or was refunded. This response contains one or more notification IDs. Each
- notification ID corresponds to a specific server-side message, and each messages contains
- information about one or more transactions. After your application receives an
- <code>IN_APP_NOTIFY</code> broadcast intent, you send a <code>GET_PURCHASE_INFORMATION</code>
- request with the notification IDs to retrieve message details.</p>
- </li>
- <li><code>com.android.vending.billing.PURCHASE_STATE_CHANGED</code>
- <p>This response contains detailed information about one or more transactions. The transaction
- information is contained in a JSON string. The JSON string is signed and the signature is sent
- to your application along with the JSON string (unencrypted). To help ensure the security of
- your in-app billing messages, your application can verify the signature of this JSON string.</p>
- </li>
-</ul>
-
-<p>The JSON string that is returned with the <code>PURCHASE_STATE_CHANGED</code> intent provides
-your application with the details of one or more billing transactions. An example of this JSON
-string is shown below:</p>
-<pre class="no-pretty-print" style="color:black">
-{ "nonce" : 1836535032137741465,
- "orders" :
- { "notificationId" : "android.test.purchased",
- "orderId" : "transactionId.android.test.purchased",
- "packageName" : "com.example.dungeons",
- "productId" : "android.test.purchased",
- "developerPayload" : "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ",
- "purchaseTime" : 1290114783411,
- "purchaseState" : 0 }
-}
-</pre>
-
-<p>For more information about the fields in this JSON string, see <a
-href="{@docRoot}guide/market/billing/billing_reference.html#billing-intents">In-app Billing
-Broadcast Intents</a>.</p>
-
-<h3 id="billing-message-sequence">Messaging sequence</h3>
-
-<p>The messaging sequence for a typical purchase request is shown in figure 2. Request types for
-each <code>sendBillingRequest()</code> method are shown in <strong>bold</strong>, broadcast intents
-are shown in <em>italic</em>. For clarity, figure 2 does not show the <code>RESPONSE_CODE</code>
-broadcast intents that are sent for every request.</p>
-
-<p>The basic message sequence for an in-app purchase request is as follows:</p>
-
-<ol>
- <li>Your application sends a purchase request (<code>REQUEST_PURCHASE</code> type), specifying a
- product ID and other parameters.</li>
- <li>The Google Play application sends your application a Bundle with the following keys:
- <code>RESPONSE_CODE</code>, <code>PURCHASE_INTENT</code>, and <code>REQUEST_ID</code>. The
- <code>PURCHASE_INTENT</code> key provides a {@link android.app.PendingIntent}, which your
- application uses to start the checkout UI for the given product ID.</li>
- <li>Your application launches the pending intent, which launches the checkout UI.
- <p class="note"><strong>Note:</strong> You must launch the pending intent from an activity
- context and not an application context.</p>
- </li>
- <li>When the checkout flow finishes (that is, the user successfully purchases the item or cancels
- the purchase), Google Play sends your application a notification message (an
- <code>IN_APP_NOTIFY</code> broadcast intent). The notification message includes a notification ID,
- which references the transaction.</li>
- <li>Your application requests the transaction information by sending a
- <code>GET_PURCHASE_STATE_CHANGED</code> request, specifying the notification ID for the
- transaction.</li>
- <li>The Google Play application sends a Bundle with a <code>RESPONSE_CODE</code> key and a
- <code>REQUEST_ID</code> key.
- <li>Google Play sends the transaction information to your application in a
- <code>PURCHASE_STATE_CHANGED</code> broadcast intent.</li>
- <li>Your application confirms that you received the transaction information for the given
- notification ID by sending a confirmation message (<code>CONFIRM_NOTIFICATIONS</code> type),
- specifying the notification ID for which you received transaction information.</li>
- <li>The Google Play application sends your application a Bundle with a
- <code>RESPONSE_CODE</code> key and a <code>REQUEST_ID</code> key.</li>
-</ol>
-
-<img src="{@docRoot}images/billing_request_purchase.png" height="231" id="figure2" />
-<p class="img-caption">
- <strong>Figure 2.</strong> Message sequence for a purchase request.
-</p>
-
-<p>Keep in mind, you must send a confirmation when you receive transaction information from Google
-Play (step 8 in figure 2). If you don't send a confirmation message, Google Play will
-continue sending <code>IN_APP_NOTIFY</code> messages for the transactions you have not
-confirmed. As a best practice, you should not send a <code>CONFIRM_NOTIFICATIONS</code> request for
-a purchased item until you have delivered the item to the user. This way, if your application
-crashes or something else prevents your application from delivering the product, your application
-will still receive an <code>IN_APP_NOTIFY</code> broadcast intent from Google Play indicating
-that you need to deliver the product. Also, as a best practice, your application must be able to
-handle <code>IN_APP_NOTIFY</code> messages that contain multiple orders.</p>
-
-<p>The messaging sequence for a restore transaction request is shown in figure 3. Request types for
-each <code>sendBillingRequest()</code> method are shown in <strong>bold</strong>, broadcast intents
-are shown in <em>italic</em>. For clarity, figure 3 does not show the <code>RESPONSE_CODE</code>
-broadcast intents that are sent for every request.</p>
-
-<div class="figure" style="width:490px">
-<img src="{@docRoot}images/billing_restore_transactions.png" alt="" height="168" />
-<p class="img-caption">
- <strong>Figure 3.</strong> Message sequence for a restore transactions request.
-</p>
-</div>
-
-<p>The request triggers three responses. The first is a {@link android.os.Bundle} with a
-<code>RESPONSE_CODE</code> key and a <code>REQUEST_ID</code> key. Next, the Google Play
-application sends a <code>RESPONSE_CODE</code> broadcast intent, which provides status information
-or error information about the request. As always, the <code>RESPONSE_CODE</code> message references
-a specific request ID, so you can determine which request a <code>RESPONSE_CODE</code> message
-pertains to.</p>
-
-<p>The <code>RESTORE_TRANSACTIONS</code> request type also triggers a
-<code>PURCHASE_STATE_CHANGED</code> broadcast intent, which contains the same type of transaction
-information that is sent during a purchase request, although you do not need to respond to this
-intent with a <code>CONFIRM_NOTIFICATIONS</code> message.</p>
-
-<p class="note"><strong>Note:</strong> You should use the <code>RESTORE_TRANSACTIONS</code> request
-type only when your application is installed for the first time on a device or when your
-application has been removed from a device and reinstalled.</p>
-
-<p>The messaging sequence for checking whether in-app billing is supported is shown in figure 4. The
-request type for the <code>sendBillingRequest()</code> method is shown in <strong>bold</strong>.</p>
-
-<div class="figure" style="width:454px">
-<img src="{@docRoot}images/billing_check_supported.png" alt="" height="168" />
-<p class="img-caption">
- <strong>Figure 4.</strong> Message sequence for checking whether in-app billing is supported.
-</p>
-</div>
-
-<p>The synchronous response for a <code>CHECK_BILLING_SUPPORTED</code> request provides a Bundle
-with a server response code. A <code>RESULT_OK</code> response code indicates that in-app billing
-is supported; a <code>RESULT_BILLING_UNAVAILABLE</code> response code indicates that in-app billing
-is unavailable because the API version you specified is unrecognized or the user is not eligible to
-make in-app purchases (for example, the user resides in a country that does not allow in-app
-billing). A <code>SERVER_ERROR</code> can also be returned, indicating that there was a problem with
-the Google Play server.</p>
-
-<h3 id="billing-action-notify">Handling IN_APP_NOTIFY messages</h3>
-
-<p>Usually, your application receives an <code>IN_APP_NOTIFY</code> broadcast intent from Google
-Play in response to a <code>REQUEST_PURCHASE</code> message (see figure 2). The
-<code>IN_APP_NOTIFY</code> broadcast intent informs your application that the state of a requested
-purchase has changed. To retrieve the details of that purchase, your application sends a
-<code>GET_PURCHASE_INFORMATION</code> request. Google Play responds with a
-<code>PURCHASE_STATE_CHANGED</code> broadcast intent, which contains the details of the purchase
-state change. Your application then sends a <code>CONFIRM_NOTIFICATIONS</code> message, informing
-Google Play that you have received the purchase state change information.</p>
-
-<p>In some special cases, you may receive multiple <code>IN_APP_NOTIFY</code> messages even though
-you have confirmed receipt of the purchase information, or you may receive
-<code>IN_APP_NOTIFY</code> messages for a purchase change even though you never initiated the
-purchase. Your application must handle both of these special cases.</p>
-
-<h4>Handling multiple IN_APP_NOTIFY messages</h4>
-
-<p>When Google Play receives a <code>CONFIRM_NOTIFICATIONS</code> message for a given
-<code>PURCHASE_STATE_CHANGED</code> message, it usually stops sending <code>IN_APP_NOTIFY</code>
-intents for that <code>PURCHASE_STATE_CHANGED</code> message. Sometimes, however, Google
-Play may send repeated <code>IN_APP_NOTIFY</code> intents for a
-<code>PURCHASE_STATE_CHANGED</code> message even though your application has sent a
-<code>CONFIRM_NOTIFICATIONS</code> message. This can occur if a device loses network connectivity
-while you are sending the <code>CONFIRM_NOTIFICATIONS</code> message. In this case, Google Play
-might not receive your <code>CONFIRM_NOTIFICATIONS</code> message and it could send multiple
-<code>IN_APP_NOTIFY</code> messages until it receives acknowledgement that you received the
-transaction message. Therefore, your application must be able to recognize that the subsequent
-<code>IN_APP_NOTIFY</code> messages are for a previously processed transaction. You can do this by
-checking the <code>orderID</code> that's contained in the JSON string because every transaction has
-a unique <code>orderId</code>.</p>
-
-<h4>Handling refunds and other unsolicited IN_APP_NOTIFY messages</h4>
-
-<p>There are two cases where your application may receive <code>IN_APP_NOTIFY</code> broadcast
-intents even though your application has not sent a <code>REQUEST_PURCHASE</code> message. Figure 5
-shows the messaging sequence for both of these cases. Request types for each
-<code>sendBillingRequest()</code> method are shown in <strong>bold</strong>, broadcast intents are
-shown in <em>italic</em>. For clarity, figure 5 does not show the <code>RESPONSE_CODE</code>
-broadcast intents that are sent for every request.</p>
-
-<div class="figure" style="width:481px">
-<img src="{@docRoot}images/billing_refund.png" alt="" height="189" />
-<p class="img-caption">
- <strong>Figure 5.</strong> Message sequence for refunds and other unsolicited
-IN_APP_NOTIFY messages.</p>
-</div>
-
-<p>In the first case, your application may receive an <code>IN_APP_NOTIFY</code> broadcast intent
-when a user has your application installed on two (or more) devices and the user makes an in-app
-purchase from one of the devices. In this case, Google Play sends an <code>IN_APP_NOTIFY</code>
-message to the second device, informing the application that there is a purchase state change. Your
-application can handle this message the same way it handles the response from an
-application-initiated <code>REQUEST_PURCHASE</code> message, so that ultimately your application
-receives a <code>PURCHASE_STATE_CHANGED</code> broadcast intent message that includes information
-about the item that has been purchased. This applies only to items that have their <a
-href="{@docRoot}guide/market/billing/billing_admin.html#billing-purchase-type">purchase type</a> set
-to "managed per user account."</p>
-
-<p>In the second case, your application can receive an <code>IN_APP_NOTIFY</code> broadcast intent
-when Google Play receives a refund notification from Google Checkout. In this case, Google
-Play sends an <code>IN_APP_NOTIFY</code> message to your application. Your application can handle
-this message the same way it handles responses from an application-initiated
-<code>REQUEST_PURCHASE</code> message so that ultimately your application receives a
-<code>PURCHASE_STATE_CHANGED</code> message that includes information about the item that has been
-refunded. The refund information is included in the JSON string that accompanies the
-<code>PURCHASE_STATE_CHANGED</code> broadcast intent. Also, the <code>purchaseState</code> field in
-the JSON string is set to 2.</p>
-
-<p class="caution"><strong>Important:</strong> You cannot use the Google Checkout API to
-issue refunds or cancel in-app billing transactions. You must do this manually through your
-Google Checkout merchant account. However, you can use the Google Checkout API to retrieve order
-information.</p>
-
-<h2 id="billing-security">Security Controls</h2>
-
-<p>To help ensure the integrity of the transaction information that is sent to your application,
-Google Play signs the JSON string that is contained in the <code>PURCHASE_STATE_CHANGED</code>
-broadcast intent. Google Play uses the private key that is associated with your publisher account
-to create this signature. The publisher site generates an RSA key pair for each publisher account.
-You can find the public key portion of this key pair on your account's profile page. It is the same
-public key that is used with Google Play licensing.</p>
-
-<p>When Google Play signs a billing response, it includes the signed JSON string (unencrypted)
-and the signature. When your application receives this signed response you can use the public key
-portion of your RSA key pair to verify the signature. By performing signature verification you can
-help detect responses that have been tampered with or that have been spoofed. You can perform this
-signature verification step in your application; however, if your application connects to a secure
-remote server then we recommend that you perform the signature verification on that server.</p>
-
-<p>In-app billing also uses nonces (a random number used once) to help verify the integrity of the
-purchase information that's returned from Google Play. Your application must generate a nonce and
-send it with a <code>GET_PURCHASE_INFORMATION</code> request and a <code>RESTORE_TRANSACTIONS</code>
-request. When Google Play receives the request, it adds the nonce to the JSON string that
-contains the transaction information. The JSON string is then signed and returned to your
-application. When your application receives the JSON string, you need to verify the nonce as well as
-the signature of the JSON string.</p>
-
-<p>For more information about best practices for security and design, see <a
-href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and Design</a>.</p>
-
-<h2 id="billing-limitations">In-app Billing Requirements and Limitations</h2>
-
-<p>Before you get started with in-app billing, be sure to review the following requirements and
-limitations.</p>
-
-<ul>
- <li>In-app billing can be implemented only in applications that you publish through Google
- Play.</li>
- <li>You must have a Google Checkout Merchant account to use Google Play In-app Billing.</li>
- <li>If your device is running Android 3.0, in-app billing requires version 5.0.12 (or higher) of
- the MyApps application. If your device is running any other version of Android, in-app billing
- requires version 2.3.4 (or higher) of the Google Play application.</li>
- <li>An application can use in-app billing only if the device is running Android 1.6 (API level 4)
- or higher.</li>
- <li>You can use in-app billing to sell only digital content. You cannot use in-app billing to sell
- physical goods, personal services, or anything that requires physical delivery.</li>
- <li>Google Play does not provide any form of content delivery. You are responsible for
- delivering the digital content that you sell in your applications.</li>
- <li>You cannot implement in-app billing on a device that never connects to the network. To
- complete in-app purchase requests, a device must be able to access the Google Play server over
- the network. </li>
-</ul>
-
-<p>For more information about in-app billing requirements, see <a
-href="http://market.android.com/support/bin/answer.py?answer=1153481">In-App Billing Availability
-and Policies</a>.</p>
diff --git a/docs/html/guide/market/billing/billing_reference.jd b/docs/html/guide/market/billing/billing_reference.jd
deleted file mode 100755
index e8cf2ee..0000000
--- a/docs/html/guide/market/billing/billing_reference.jd
+++ /dev/null
@@ -1,418 +0,0 @@
-page.title=In-app Billing Reference
-parent.title=In-app Billing
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#billing-codes">Server Response Codes for In-app Billing</a></li>
- <li><a href="#billing-interface">In-app Billing Service Interface</a></li>
- <li><a href="#billing-intents">In-app Billing Broadcast Intents</a></li>
-
- </ol>
- <h2>Downloads</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">Sample
- Application</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_overview.html">Overview of In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html">Implementing In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and
- Design</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_testing.html">Testing In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_admin.html">Administering In-app
- Billing</a></li>
- </ol>
-</div>
-</div>
-
-<p>The following document provides technical reference information for the following:</p>
-
-<ul>
- <li><a href="#billing-codes">Google Play Server Response Codes for In-app Billing</a></li>
- <li><a href="#billing-interface">In-app Billing Interface Parameters</a></li>
- <li><a href="#billing-intents">In-app Billing Broadcast Intents</a></li>
-</ul>
-
-<h2 id="billing-codes">Google Play Server Response Codes for In-app Billing</h2>
-
-<p>The following table lists all of the server response codes that are sent from Google Play to
-your application. Google Play sends these response codes asynchronously as
-<code>response_code</code> extras in the <code>com.android.vending.billing.RESPONSE_CODE</code>
-broadcast intent. Your application must handle all of these response codes.</p>
-
-<p class="table-caption" id="response-codes-table"><strong>Table 1.</strong> Summary of response
-codes returned by Google Play.</p>
-
-<table>
-
-<tr>
-<th>Response Code</th>
-<th>Value</th>
-<th>Description</th>
-</tr>
-<tr>
- <td><code>RESULT_OK</code></td>
- <td>0</td>
- <td>Indicates that the request was sent to the server successfully. When this code is returned in
- response to a <code>CHECK_BILLING_SUPPORTED</code> request, indicates that billing is
- supported.</td>
-</tr>
-<tr>
- <td><code>RESULT_USER_CANCELED</code></td>
- <td>1</td>
- <td>Indicates that the user pressed the back button on the checkout page instead of buying the
- item.</td>
-</tr>
-<tr>
- <td><code>RESULT_SERVICE_UNAVAILABLE</code></td>
- <td>2</td>
- <td>Indicates that the network connection is down.</td>
-</tr>
-<tr>
- <td><code>RESULT_BILLING_UNAVAILABLE</code></td>
- <td>3</td>
- <td>Indicates that in-app billing is not available because the <code>API_VERSION</code> that you
- specified is not recognized by the Google Play application or the user is ineligible for in-app
- billing (for example, the user resides in a country that prohibits in-app purchases).</td>
-</tr>
-<tr>
- <td><code>RESULT_ITEM_UNAVAILABLE</code></td>
- <td>4</td>
- <td>Indicates that Google Play cannot find the requested item in the application's product
- list. This can happen if the product ID is misspelled in your <code>REQUEST_PURCHASE</code>
- request or if an item is unpublished in the application's product list.</td>
-</tr>
-<tr>
- <td><code>RESULT_DEVELOPER_ERROR</code></td>
- <td>5</td>
- <td>Indicates that an application is trying to make an in-app billing request but the application
- has not declared the com.android.vending.BILLING permission in its manifest. Can also indicate
- that an application is not properly signed, or that you sent a malformed request, such as a
- request with missing Bundle keys or a request that uses an unrecognized request type.</td>
-</tr>
-<tr>
- <td><code>RESULT_ERROR</code></td>
- <td>6</td>
- <td>Indicates an unexpected server error. For example, this error is triggered if you try to
-purchase an item from yourself, which is not allowed by Google Checkout.</td>
-</tr>
-</table>
-
-<h2 id="billing-interface">In-app Billing Service Interface</h2>
-
-<p>The following section describes the interface for Google Play's in-app billing service. The
-interface is defined in the <code>IMarketBillingService.aidl</code> file, which is included with the
-in-app billing <a
-href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">sample
-application</a>.</p>
-<p>The interface consists of a single request method <code>sendBillingRequest()</code>. This method
-takes a single {@link android.os.Bundle} parameter. The Bundle parameter includes several key-value
-pairs, which are summarized in table 2.</p>
-
-<p class="table-caption"><strong>Table 2.</strong> Description of Bundle keys passed in a
-<code>sendBillingRequest()</code> request.</p>
-
-<table>
-
-<tr>
-<th>Key</th>
-<th>Type</th>
-<th>Possible Values</th>
-<th>Required?</th>
-<th>Description</th>
-</tr>
-<tr>
- <td><code>BILLING_REQUEST</code></td>
- <td><code>String</code></td>
- <td><code>CHECK_BILLING_SUPPORTED</code>, <code>REQUEST_PURCHASE</code>,
- <code>GET_PURCHASE_INFORMATION</code>, <code>CONFIRM_NOTIFICATIONS</code>, or
- <code>RESTORE_TRANSACTIONS</code></td>
- <td>Yes</td>
- <td>The type of billing request you are making with the <code>sendBillingRequest()</code> request.
- The possible values are discussed more below this table.</td>
-</tr>
-<tr>
- <td><code>API_VERSION</code></td>
- <td><code>int</code></td>
- <td>1</td>
- <td>Yes</td>
- <td>The version of Google Play's in-app billing service you are using. The current version is
- 1.</td>
-</tr>
-<tr>
- <td><code>PACKAGE_NAME</code></td>
- <td><code>String</code></td>
- <td>A valid package name.</td>
- <td>Yes</td>
- <td>The name of the application that is making the request.</td>
-</tr>
-<tr>
- <td><code>ITEM_ID</code></td>
- <td><code>String</code></td>
- <td>Any valid product identifier.</td>
- <td>Required for <code>REQUEST_PURCHASE</code> requests.</td>
- <td>The product ID of the item you are making a billing request for. Every in-app item that you
- sell using Google Play's in-app billing service must have a unique product ID, which you
- specify on the Google Play publisher site.</td>
-</tr>
-<tr>
- <td><code>NONCE</code></td>
- <td><code>long</code></td>
- <td>Any valid <code>long</code> value.</td>
- <td>Required for <code>GET_PURCHASE_INFORMATION</code> and <code>RESTORE_TRANSACTIONS</code>
- requests.</td>
- <td>A number used once. Your application must generate and send a nonce with each
- <code>GET_PURCHASE_INFORMATION</code> and <code>RESTORE_TRANSACTIONS</code> request. The nonce is
- returned with the <code>PURCHASE_STATE_CHANGED</code> broadcast intent, so you can use this value
- to verify the integrity of transaction responses form Google Play.</td>
-</tr>
-<tr>
- <td><code>NOTIFY_IDS</code></td>
- <td>Array of <code>long</code> values</td>
- <td>Any valid array of <code>long</code> values</td>
- <td>Required for <code>GET_PURCHASE_INFORMATION</code> and <code>CONFIRM_NOTIFICATIONS</code>
- requests.</td>
- <td>An array of notification identifiers. A notification ID is sent to your application in an
- <code>IN_APP_NOTIFY</code> broadcast intent every time a purchase changes state. You use the
- notification to retrieve the details of the purchase state change.</td>
-</tr>
-<tr>
- <td><code>DEVELOPER_PAYLOAD</code></td>
- <td><code>String</code></td>
- <td>Any valid <code>String</code> less than 256 characters long.</td>
- <td>No</td>
- <td>A developer-specified string that can be specified when you make a
- <code>REQUEST_PURCHASE</code> request. This field is returned in the JSON string that contains
- transaction information for an order. You can use this key to send supplemental information with
- an order. For example, you can use this key to send index keys with an order, which is useful if
- you are using a database to store purchase information. We recommend that you do not use this key
- to send data or content.</td>
-</tr>
-</table>
-
-<p>The <code>BILLING_REQUEST</code> key can have the following values:</p>
-
-<ul>
- <li><code>CHECK_BILLING_SUPPORTED</code>
- <p>This request verifies that the Google Play application supports in-app billing. You
- usually send this request when your application first starts up. This request is useful if you
- want to enable or disable certain UI features that are relevant only to in-app billing.</p>
- </li>
- <li><code>REQUEST_PURCHASE</code>
- <p>This request sends a purchase message to the Google Play application and is the foundation
- of in-app billing. You send this request when a user indicates that he or she wants to purchase
- an item in your application. Google Play then handles the financial transaction by displaying
- the checkout user interface.</p>
- </li>
- <li><code>GET_PURCHASE_INFORMATION</code>
- <p>This request retrieves the details of a purchase state change. A purchase state change can
- occur when a purchase request is billed successfully or when a user cancels a transaction during
- checkout. It can also occur when a previous purchase is refunded. Google Play notifies your
- application when a purchase changes state, so you only need to send this request when there is
- transaction information to retrieve.</p>
- </li>
- <li><code>CONFIRM_NOTIFICATIONS</code>
- <p>This request acknowledges that your application received the details of a purchase state
- change. That is, this message confirms that you sent a <code>GET_PURCHASE_INFORMATION</code>
- request for a given notification and that you received the purchase information for the
- notification.</p>
- </li>
- <li><code>RESTORE_TRANSACTIONS</code>
- <p>This request retrieves a user's transaction status for managed purchases (see <a
- href="{@docRoot}guide/market/billing/billing_admin.html#billing-purchase-type">Choosing a
- Purchase Type</a> for more information). You should send this message only when you need to
- retrieve a user's transaction status, which is usually only when your application is reinstalled
- or installed for the first time on a device.</p>
- </li>
-</ul>
-
-<p>Every in-app billing request generates a synchronous response. The response is a {@link
-android.os.Bundle} and can include one or more of the following keys:</p>
-
-<ul>
- <li><code>RESPONSE_CODE</code>
- <p>This key provides status information and error information about a request.</p>
- </li>
- <li><code>PURCHASE_INTENT</code>
- <p>This key provides a {@link android.app.PendingIntent}, which you use to launch the checkout
- activity.</p>
- </li>
- <li><code>REQUEST_ID</code>
- <p>This key provides you with a request identifier, which you can use to match asynchronous
- responses with requests.</p>
- </li>
-</ul>
-
-<p>Some of these keys are not relevant to certain types of requests. Table 3 shows which keys are
-returned for each request type.</p>
-
-<p class="table-caption"><strong>Table 3.</strong> Description of Bundle keys that are returned with
-each in-app billing request type.</p>
-
-<table>
-
-<tr>
-<th>Request Type</th>
-<th>Keys Returned</th>
-<th>Possible Response Codes</th>
-</tr>
-<tr>
- <td><code>CHECK_BILLING_SUPPORTED</code></td>
- <td><code>RESPONSE_CODE</code></td>
- <td><code>RESULT_OK</code>, <code>RESULT_BILLING_UNAVAILABLE</code>, <code>RESULT_ERROR</code>,
- <code>RESULT_DEVELOPER_ERROR</code></td>
-</tr>
-<tr>
- <td><code>REQUEST_PURCHASE</code></td>
- <td><code>RESPONSE_CODE</code>, <code>PURCHASE_INTENT</code>, <code>REQUEST_ID</code></td>
- <td><code>RESULT_OK</code>, <code>RESULT_ERROR</code>, <code>RESULT_DEVELOPER_ERROR</code></td>
-</tr>
-<tr>
- <td><code>GET_PURCHASE_INFORMATION</code></td>
- <td><code>RESPONSE_CODE</code>, <code>REQUEST_ID</code></td>
- <td><code>RESULT_OK</code>, <code>RESULT_ERROR</code>, <code>RESULT_DEVELOPER_ERROR</code></td>
-</tr>
-<tr>
- <td><code>CONFIRM_NOTIFICATIONS</code></td>
- <td><code>RESPONSE_CODE</code>, <code>REQUEST_ID</code></td>
- <td><code>RESULT_OK</code>, <code>RESULT_ERROR</code>, <code>RESULT_DEVELOPER_ERROR</code></td>
-</tr>
-<tr>
- <td><code>RESTORE_TRANSACTIONS</code></td>
- <td><code>RESPONSE_CODE</code>, <code>REQUEST_ID</code></td>
- <td><code>RESULT_OK</code>, <code>RESULT_ERROR</code>, <code>RESULT_DEVELOPER_ERROR</code></td>
-</tr>
-</table>
-
-<h2 id="billing-intents">In-app Billing Broadcast Intents</h2>
-
-<p>The following section describes the in-app billing broadcast intents that are sent by the Google
-Play application. These broadcast intents inform your application about in-app billing actions
-that have occurred. Your application must implement a {@link android.content.BroadcastReceiver} to
-receive these broadcast intents, such as the <code>BillingReceiver</code> that's shown in the in-app
-billing <a href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">sample
-application</a>.</p>
-
-<h4>com.android.vending.billing.RESPONSE_CODE</h4>
-
-<p>This broadcast intent contains a Google Play response code, and is sent after you make an
-in-app billing request. A server response code can indicate that a billing request was successfully
-sent to Google Play or it can indicate that some error occurred during a billing request. This
-intent is not used to report any purchase state changes (such as refund or purchase information).
-For more information about the response codes that are sent with this response, see <a
-href="#billing-codes">Google Play Response Codes for In-app Billing</a>. The sample application
-assigns this broadcast intent to a constant named <code>ACTION_RESPONSE_CODE</code>.</p>
-
-<h5>Extras</h5>
-
-<ul type="none">
- <li><code>request_id</code>—a <code>long</code> representing a request ID. A request ID
- identifies a specific billing request and is returned by Google Play at the time a request is
- made.</li>
- <li><code>response_code</code>—an <code>int</code> representing the Google Play server
- response code.</li>
-</ul>
-
-<h4>com.android.vending.billing.IN_APP_NOTIFY</h4>
-
-<p>This response indicates that a purchase has changed state, which means a purchase succeeded, was
-canceled, or was refunded. This response contains one or more notification IDs. Each notification ID
-corresponds to a specific server-side message, and each messages contains information about one or
-more transactions. After your application receives an <code>IN_APP_NOTIFY</code> broadcast intent,
-you send a <code>GET_PURCHASE_INFORMATION</code> request with the notification IDs to retrieve the
-message details. The sample application assigns this broadcast intent to a constant named
-<code>ACTION_NOTIFY</code>.</p>
-
-<h5>Extras</h5>
-
-<ul type="none">
- <li><code>notification_id</code>—a <code>String</code> representing the notification ID for
- a given purchase state change. Google Play notifies you when there is a purchase state change
- and the notification includes a unique notification ID. To get the details of the purchase state
- change, you send the notification ID with the <code>GET_PURCHASE_INFORMATION</code> request.</li>
-</ul>
-
-<h4>com.android.vending.billing.PURCHASE_STATE_CHANGED</h4>
-
-<p>This broadcast intent contains detailed information about one or more transactions. The
-transaction information is contained in a JSON string. The JSON string is signed and the signature
-is sent to your application along with the JSON string (unencrypted). To help ensure the security of
-your in-app billing messages, your application can verify the signature of this JSON string. The
-sample application assigns this broadcast intent to a constant named
-<code>ACTION_PURCHASE_STATE_CHANGED</code>.</p>
-
-<h5>Extras</h5>
-
-<ul type="none">
- <li><code>inapp_signed_data</code>—a <code>String</code> representing the signed JSON
- string.</li>
- <li><code>inapp_signature</code>—a <code>String</code> representing the signature.</li>
-</ul>
-
-<p class="note"><strong>Note:</strong> Your application should map the broadcast intents and extras
-to constants that are unique to your application. See the <code>Consts.java</code> file in the
-sample application to see how this is done.</p>
-
-<p>The fields in the JSON string are described in the following table (see table 4):</p>
-
-<p class="table-caption"><strong>Table 4.</strong> Description of JSON fields that are returned with
-a <code>PURCHASE_STATE_CHANGED</code> intent.</p>
-
-<table>
-
-<tr>
-<th>Field</th>
-<th>Description</th>
-</tr>
-<tr>
- <td>nonce</td>
- <td>A number used once. Your application generates the nonce and sends it with the
- <code>GET_PURCHASE_INFORMATION</code> request. Google Play sends the nonce back as part of the
- JSON string so you can verify the integrity of the message.</td>
-</tr>
-<tr>
- <td>notificationId</td>
- <td>A unique identifier that is sent with an <code>IN_APP_NOTIFY</code> broadcast intent. Each
- <code>notificationId</code> corresponds to a specify message that is waiting to be retrieved on
- the Google Play server. Your application sends back the <code>notificationId</code> with the
- <code>GET_PURCHASE_INFORMATION</code> message so Google Play can determine which messages you
- are retrieving.</td>
-</tr>
-<tr>
- <td>orderId</td>
- <td>A unique order identifier for the transaction. This corresponds to the Google Checkout Order
- ID.</td>
-</tr>
-<tr>
- <td>packageName</td>
- <td>The application package from which the purchase originated.</td>
-</tr>
-<tr>
- <td>productId</td>
- <td>The item's product identifier. Every item has a product ID, which you must specify in the
- application's product list on the Google Play publisher site.</td>
-</tr>
-<tr>
- <td>purchaseTime</td>
- <td>The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970).</td>
-</tr>
-
-<tr>
- <td>purchaseState</td>
- <td>The purchase state of the order. Possible values are 0 (purchased), 1 (canceled), or 2
- (refunded).</td>
-</tr>
-<tr>
- <td>developerPayload</td>
- <td>A developer-specified string that contains supplemental information about an order. You can
- specify a value for this field when you make a <code>REQUEST_PURCHASE</code> request.</td>
-</tr>
-</table>
diff --git a/docs/html/guide/market/billing/billing_testing.jd b/docs/html/guide/market/billing/billing_testing.jd
deleted file mode 100755
index 77aa3ed..0000000
--- a/docs/html/guide/market/billing/billing_testing.jd
+++ /dev/null
@@ -1,293 +0,0 @@
-page.title=Testing In-app Billing
-parent.title=In-app Billing
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#billing-testing-static">Testing in-app purchases with static responses</a></li>
- <li><a href="#billing-testing-real">Testing in-app purchases using your own product IDs</a></li>
-
- </ol>
- <h2>Downloads</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">Sample
- Application</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_overview.html">Overview of In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html">Implementing In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and
- Design</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_admin.html">Administering In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_reference.html">In-app Billing
- Reference</a></li>
- </ol>
-</div>
-</div>
-
-<p>The Google Play publisher site provides several tools that help you test your in-app billing
-implementation before it is published. You can use these tools to create test accounts and purchase
-special reserved items that send static billing responses to your application.</p>
-
-<p>To test in-app billing in an application you must install the application on an Android-powered
-device. You cannot use the Android emulator to test in-app billing. The device you use for testing
-must run a standard version of the Android 1.6 or later platform (API level 4 or higher), and have
-the most current version of the Google Play application installed. If a device is not running the
-most current Google Play application, your application won't be able to send in-app billing
-requests to Google Play. For general information about how to set up a device for use in
-developing Android applications, see <a href="{@docRoot}guide/developing/device.html">Using Hardware
-Devices</a>.</p>
-
-<p>The following section shows you how to set up and use the in-app billing test tools.</p>
-
-<h2 id="billing-testing-static">Testing in-app purchases with static responses</h2>
-
-<p>We recommend that you first test your in-app billing implementation using static responses from
-Google Play. This enables you to verify that your application is handling the primary Google
-Play responses correctly and that your application is able to verify signatures correctly.</p>
-
-<p>To test your implementation with static responses, you make an in-app billing request using a
-special item that has a reserved product ID. Each reserved product ID returns a specific static
-response from Google Play. No money is transferred when you make in-app billing requests with the
-reserved product IDs. Also, you cannot specify the form of payment when you make a billing request
-with a reserved product ID. Figure 1 shows the checkout flow for the reserved item that has the
-product ID android.test.purchased.</p>
-
-<img src="{@docRoot}images/billing_test_flow.png" height="381" id="figure1" />
-<p class="img-caption">
- <strong>Figure 1.</strong> Checkout flow for the special reserved item android.test.purchased.
-</p>
-
-<p>You do not need to list the reserved products in your application's product list. Google Play
-already knows about the reserved product IDs. Also, you do not need to upload your application to
-the publisher site to perform static response tests with the reserved product IDs. You can simply
-install your application on a device, log into the device, and make billing requests using the
-reserved product IDs.</p>
-
-<p>There are four reserved product IDs for testing static in-app billing responses:</p>
-
-<ul>
- <li><strong>android.test.purchased</strong>
- <p>When you make an in-app billing request with this product ID, Google Play responds as
- though you successfully purchased an item. The response includes a JSON string, which contains
- fake purchase information (for example, a fake order ID). In some cases, the JSON string is
- signed and the response includes the signature so you can test your signature verification
- implementation using these responses.</p>
- </li>
- <li><strong>android.test.canceled</strong>
- <p>When you make an in-app billing request with this product ID Google Play responds as
- though the purchase was canceled. This can occur when an error is encountered in the order
- process, such as an invalid credit card, or when you cancel a user's order before it is
- charged.</p>
- </li>
- <li><strong>android.test.refunded</strong>
- <p>When you make an in-app billing request with this product ID, Google Play responds as
- though the purchase was refunded. Refunds cannot be initiated through Google Play's in-app
- billing service. Refunds must be initiated by you (the merchant). After you process a refund
- request through your Google Checkout account, a refund message is sent to your application by
- Google Play. This occurs only when Google Play gets notification from Google Checkout that
- a refund has been made. For more information about refunds, see <a
- href="{@docRoot}guide/market/billing/billing_overview.html#billing-action-notify">Handling
- IN_APP_NOTIFY messages</a> and <a
- href="http://www.google.com/support/androidmarket/bin/answer.py?answer=1153485">In-app Billing
- Pricing</a>.</p>
- </li>
- <li><strong>android.test.item_unavailable</strong>
- <p>When you make an in-app billing request with this product ID, Google Play responds as
- though the item being purchased was not listed in your application's product list.</p>
- </li>
-</ul>
-
-<p>In some cases, the reserved items may return signed static responses, which lets you test
-signature verification in your application. To test signature verification with the special reserved
-product IDs, you may need to set up <a
-href="{@docRoot}guide/market/billing/billing_admin.html#billing-testing-setup">test accounts</a> or
-upload your application as a unpublished draft application. Table 1 shows you the conditions under
-which static responses are signed.</p>
-
-<p class="table-caption" id="static-responses-table"><strong>Table 1.</strong>
-Conditions under which static responses are signed.</p>
-
-<table>
-<tr>
-<th>Application ever been published?</th>
-<th>Draft application uploaded and unpublished?</th>
-<th>User who is running the application</th>
-<th>Static response signature</th>
-</tr>
-
-<tr>
-<td>No</td>
-<td>No</td>
-<td>Any</td>
-<td>Unsigned</td>
-</tr>
-
-<tr>
-<td>No</td>
-<td>No</td>
-<td>Developer</td>
-<td>Signed</td>
-</tr>
-
-<tr>
-<td>Yes</td>
-<td>No</td>
-<td>Any</td>
-<td>Unsigned</td>
-</tr>
-
-<tr>
-<td>Yes</td>
-<td>No</td>
-<td>Developer</td>
-<td>Signed</td>
-</tr>
-
-<tr>
-<td>Yes</td>
-<td>No</td>
-<td>Test account</td>
-<td>Signed</td>
-</tr>
-
-<tr>
-<td>Yes</td>
-<td>Yes</td>
-<td>Any</td>
-<td>Signed</td>
-</tr>
-
-</table>
-
-<p>To make an in-app billing request with a reserved product ID, you simply construct a normal
-<code>REQUEST_PURCHASE</code> request, but instead of using a real product ID from your
-application's product list you use one of the reserved product IDs.</p>
-
-<p>To test your application using the reserved product IDs, follow these steps:</p>
-
-<ol>
- <li><strong>Install your application on an Android-powered device.</strong>
- <p>You cannot use the emulator to test in-app billing; you must install your application on a
- device to test in-app billing.</p>
- <p>To learn how to install an application on a device, see <a
- href="{@docRoot}guide/developing/building/building-cmdline.html#RunningOnDevice">Running on a
- device</a>.</p>
- </li>
- <li><strong>Sign in to your device with your developer account.</strong>
- <p>You do not need to use a test account if you are testing only with the reserved product
- IDs.</p>
- </li>
- <li><strong>Verify that your device is running a supported version of the Google Play
- application or the MyApps application.</strong>
- <p>If your device is running Android 3.0, in-app billing requires version 5.0.12 (or higher) of
- the MyApps application. If your device is running any other version of Android, in-app billing
- requires version 2.3.4 (or higher) of the Google Play application. To learn how to check the
- version of the Google Play application, see <a
- href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google
- Play</a>.</p>
- </li>
- <li><strong>Run your application and purchase the reserved product IDs.</strong></li>
-</ol>
-
-<p class="note"><strong>Note</strong>: Making in-app billing requests with the reserved product IDs
-overrides the usual Google Play production system. When you send an in-app billing request for a
-reserved product ID, the quality of service will not be comparable to the production
-environment.</p>
-
-<h2 id="billing-testing-real">Testing In-app Purchases Using Your Own Product IDs</h2>
-
-<p>After you finish your static response testing, and you verify that signature verification is
-working in your application, you can test your in-app billing implementation by making actual in-app
-purchases. Testing real in-app purchases enables you to test the end-to-end in-app billing
-experience, including the actual responses from Google Play and the actual checkout flow that
-users will experience in your application.</p>
-
-<p class="note"><strong>Note</strong>: You do not need to publish your application to do end-to-end
-testing. You only need to upload your application as a draft application to perform end-to-end
-testing.</p>
-
-<p>To test your in-app billing implementation with actual in-app purchases, you will need to
-register at least one test account on the Google Play publisher site. You cannot use your
-developer account to test the complete in-app purchase process because Google Checkout does not let
-you buy items from yourself. If you have not set up test accounts before, see <a
-href="{@docRoot}guide/market/billing/billing_admin.html#billing-testing-setup">Setting up test
-accounts</a>.</p>
-
-<p>Also, a test account can purchase an item in your product list only if the item is published. The
-application does not need to be published, but the item does need to be published.</p>
-
-<p>When you use a test account to purchase items, the test account is billed through Google Checkout
-and your Google Checkout Merchant account receives a payout for the purchase. Therefore, you may
-want to refund purchases that are made with test accounts, otherwise the purchases will show up as
-actual payouts to your merchant account.</p>
-
-<p>To test your in-app billing implementation with actual purchases, follow these steps:</p>
-
-<ol>
- <li><strong>Upload your application as a draft application to the publisher site.</strong>
- <p>You do not need to publish your application to perform end-to-end testing with real product
- IDs; you only need to upload your application as a draft application. However, you must sign
- your application with your release key before you upload it as a draft application. Also, the
- version number of the uploaded application must match the version number of the application you
- load to your device for testing. To learn how to upload an application to Google Play, see
- <a href="http://market.android.com/support/bin/answer.py?answer=113469">Uploading
- applications</a>.</p>
- </li>
- <li><strong>Add items to the application's product list.</strong>
- <p>Make sure that you publish the items (the application can remain unpublished). See <a
- href="{@docRoot}guide/market/billing/billing_admin.html#billing-catalog">Creating a product
- list</a> to learn how to do this.</p>
- </li>
- <li><strong>Install your application on an Android-powered device.</strong>
- <p>You cannot use the emulator to test in-app billing; you must install your application on a
- device to test in-app billing.</p>
- <p>To learn how to install an application on a device, see <a
- href="{@docRoot}guide/developing/building/building-cmdline.html#RunningOnDevice">Running on a
- device</a>.</p>
- </li>
- <li><strong>Make one of your test accounts the primary account on your device.</strong>
- <p>To perform end-to-end testing of in-app billing, the primary account on your device must be
- one of the <a
- href="{@docRoot}guide/market/billing/billing_admin.html#billing-testing-setup">test accounts</a>
- that you registered on the Google Play site. If the primary account on your device is not a
- test account, you must do a factory reset of the device and then sign in with one of your test
- accounts. To perform a factory reset, do the following:</p>
- <ol>
- <li>Open Settings on your device.</li>
- <li>Touch <strong>Privacy</strong>.</li>
- <li>Touch <strong>Factory data reset</strong>.</li>
- <li>Touch <strong>Reset phone</strong>.</li>
- <li>After the phone resets, be sure to sign in with one of your test accounts during the
- device setup process.</li>
- </ol>
- </li>
- <li><strong>Verify that your device is running a supported version of the Google Play
- application or the MyApps application.</strong>
- <p>If your device is running Android 3.0, in-app billing requires version 5.0.12 (or higher) of
- the MyApps application. If your device is running any other version of Android, in-app billing
- requires version 2.3.4 (or higher) of the Google Play application. To learn how to check the
- version of the Google Play application, see <a
- href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google
- Play</a>.</p>
- </li>
- <li><strong>Make in-app purchases in your application.</strong></li>
-</ol>
-
-<p class="note"><strong>Note:</strong> The only way to change the primary account on a device is to
-do a factory reset, making sure you log on with your primary account first.</p>
-
-<p>When you are finished testing your in-app billing implementation, you are ready to
-publish your application on Google Play. You can follow the normal steps for <a
-href="{@docRoot}guide/publishing/preparing.html">preparing</a>, <a
-href="{@docRoot}guide/publishing/app-signing.html">signing</a>, and <a
-href="{@docRoot}guide/publishing/publishing.html">publishing your application</a>.
-</p>
-
diff --git a/docs/html/guide/market/billing/index.jd b/docs/html/guide/market/billing/index.jd
deleted file mode 100755
index 036761f..0000000
--- a/docs/html/guide/market/billing/index.jd
+++ /dev/null
@@ -1,94 +0,0 @@
-page.title=In-app Billing
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>Topics</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_overview.html">Overview of In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html">Implementing In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and
- Design</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_testing.html">Testing In-app
- Billing</a></li>
- <li><a href="{@docRoot}guide/market/billing/billing_admin.html">Administering In-app
- Billing</a></li>
- </ol>
- <h2>Reference</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_reference.html">In-app Billing
- Reference</a></li>
- </ol>
- <h2>Downloads</h2>
- <ol>
- <li><a href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">Sample
- Application</a></li>
- </ol>
-</div>
-</div>
-
-<p>Google Play In-app Billing is a Google Play service that lets you sell digital content in
-your applications. You can use the service to sell a wide range of content, including downloadable
-content such as media files or photos, and virtual content such as game levels or potions.</p>
-
-<p>When you use Google Play's in-app billing service to sell an item, Google Play handles all
-checkout details so your application never has to directly process any financial transactions.
-Google Play uses the same checkout service that is used for application purchases, so your users
-experience a consistent and familiar purchase flow (see figure 1). Also, the transaction fee for
-in-app purchases is the same as the transaction fee for application purchases (30%).</p>
-
-<p>Any application that you publish through Google Play can implement in-app billing. No special
-account or registration is required other than a Google Play app publisher account and a Google
-Checkout Merchant account. Also, because the service uses no dedicated framework APIs, you can add
-in-app billing to any application that uses a minimum API level of 4 or higher.</p>
-
-<p>To help you integrate in-app billing into your application, the Android SDK provides a sample
-application that demonstrates a simple implementation of in-app billing. The sample application
-contains examples of billing-related classes you can use to implement in-app billing in your
-application. It also contains examples of the database, user interface, and business logic you might
-use to implement in-app billing.</p>
-
-<p class="caution"><strong>Important</strong>: Although the sample application is a working example
-of how you can implement in-app billing, we <em>strongly recommend</em> that you modify and
-obfuscate the sample code before you use it in a production application. For more information, see
-<a href="{@docRoot}guide/market/billing/billing_best_practices.html">Security and Design</a>.</p>
-
-<img src="{@docRoot}images/billing_checkout_flow.png" height="382" id="figure1" />
-<p class="img-caption">
- <strong>Figure 1.</strong> Applications initiate in-app billing requests through their own UI
- (first screen). Google Play responds to the request by providing the checkout user interface
- (middle screen). When checkout is complete, the application resumes.
-</p>
-
-<p>To learn more about Google Play's in-app billing service and start integrating it into your
-applications, read the following documents:</p>
-
-<dl>
- <dt><strong><a href="{@docRoot}guide/market/billing/billing_overview.html">Overview of In-app
- Billing</a></strong></dt>
- <dd>Learn how the service works and what a typical in-app billing implementation looks
- like.</dd>
- <dt><strong><a href="{@docRoot}guide/market/billing/billing_integrate.html">Implementing
- In-app Billing</a></strong></dt>
- <dd>Use this step-by-step guide to start incorporating in-app billing into your
- application.</dd>
- <dt><strong><a href="{@docRoot}guide/market/billing/billing_best_practices.html">Security
- and Design</a></strong></dt>
- <dd>Review these best practices to help ensure that your in-app billing implementation is
- secure and well designed.</dd>
- <dt><strong><a href="{@docRoot}guide/market/billing/billing_testing.html">Testing In-app
- Billing</a></strong></dt>
- <dd>Understand how the in-app billing test tools work and learn how to test your in-app billing
- implementation.</dd>
- <dt><strong><a href="{@docRoot}guide/market/billing/billing_admin.html">Administering
- In-app Billing</a></strong></dt>
- <dd>Learn how to set up your product list, register test accounts, and handle refunds.</dd>
- <dt><strong><a href="{@docRoot}guide/market/billing/billing_reference.html">In-app Billing
- Reference</a></strong></dt>
- <dd>Get detailed information about Google Play response codes and the in-app billing
- interface.</dd>
-</dl>
-
diff --git a/docs/html/guide/market/expansion-files.jd b/docs/html/guide/market/expansion-files.jd
deleted file mode 100644
index 36b8f9c..0000000
--- a/docs/html/guide/market/expansion-files.jd
+++ /dev/null
@@ -1,1270 +0,0 @@
-page.title=APK Expansion Files
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
-<h2>Quickview</h2>
-<ul>
- <li>Recommended for most apps that exceed the 50MB APK limit</li>
- <li>You can provide up to 4GB of additional data for each APK</li>
- <li>Google Play hosts and serves the expansion files at no charge</li>
- <li>The files can be any file type you want and are saved to the device's shared storage</li>
-</ul>
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#Overview">Overview</a>
- <ol>
- <li><a href="#Filename">File name format</a></li>
- <li><a href="#StorageLocation">Storage location</a></li>
- <li><a href="#DownloadProcess">Download process</a></li>
- <li><a href="#Checklist">Development checklist</a></li>
- </ol>
- </li>
- <li><a href="#Rules">Rules and Limitations</a></li>
- <li><a href="#Downloading">Downloading the Expansion Files</a>
- <ol>
- <li><a href="#AboutLibraries">About the Downloader Library</a></li>
- <li><a href="#Preparing">Preparing to use the Downloader Library</a></li>
- <li><a href="#Permissions">Declaring user permissions</a></li>
- <li><a href="#DownloaderService">Implementing the downloader service</a></li>
- <li><a href="#AlarmReceiver">Implementing the alarm receiver</a></li>
- <li><a href="#Download">Starting the download</a></li>
- <li><a href="#Progress">Receiving download progress</a></li>
- </ol>
- </li>
- <li><a href="#ExpansionPolicy">Using APKExpansionPolicy</a></li>
- <li><a href="#ReadingTheFile">Reading the Expansion File</a>
- <ol>
- <li><a href="#GettingFilenames">Getting the file names</a></li>
- <li><a href="#ZipLib">Using the APK Expansion Zip Library</a></li>
- </ol>
- </li>
- <li><a href="#Testing">Testing Your Expansion Files</a>
- <ol>
- <li><a href="#TestingReading">Testing file reads</a></li>
- <li><a href="#TestingReading">Testing file downloads</a></li>
- </ol>
- </li>
- <li><a href="#Updating">Updating Your Application</a></li>
-</ol>
-
-<h2>See also</h2>
-<ol>
- <li><a href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a></li>
- <li><a href="{@docRoot}guide/market/publishing/multiple-apks.html">Multiple
-APK Support</a></li>
-</ol>
-</div>
-</div>
-
-
-
-<p>Google Play currently requires that your APK file be no more than 50MB. For most
-applications, this is plenty of space for all the application's code and assets.
-However, some apps need more space for high-fidelity graphics, media files, or other large assets.
-Previously, if your app exceeded 50MB, you had to host and download the additional resources
-yourself when the user opens the app. Hosting and serving the extra files can be costly, and the
-user experience is often less than ideal. To make this process easier for you and more pleasant
-for users, Google Play allows you to attach two large expansion files that supplement your
-APK.</p>
-
-<p>Google Play hosts the expansion files for your application and serves them to the device at
-no cost to you. The expansion files are saved to the device's shared storage location (the
-SD card or USB-mountable partition; also known as the "external" storage) where your app can access
-them. On most devices, Google Play downloads the expansion file(s) at the same time it
-downloads the APK, so your application has everything it needs when the user opens it for the
-first time. In some cases, however, your application must download the files from Google Play
-when your application starts.</p>
-
-
-
-<h2 id="Overview">Overview</h2>
-
-<p>Each time you upload an APK using the Google Play Android Developer Console, you have the option to
-add one or two expansion files to the APK. Each file can be up to 2GB and it can be any format you
-choose, but we recommend you use a compressed file to conserve bandwidth during the download.
-Conceptually, each expansion file plays a different role:</p>
-
-<ul>
- <li>The <strong>main</strong> expansion file is the
-primary expansion file for additional resources required by your application.</li>
- <li>The <strong>patch</strong> expansion file is optional and intended for small updates to the
-main expansion file.</li>
-</ul>
-
-<p>While you can use the two expansion files any way you wish, we recommend that the main
-expansion file deliver the primary assets and should rarely if ever updated; the patch expansion
-file should be smaller and serve as a “patch carrier,” getting updated with each major
-release or as necessary.</p>
-
-<p>However, even if your application update requires only a new patch expansion file, you still must
-upload a new APK with an updated <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code
-versionCode}</a> in the manifest. (The
-Developer Console does not allow you to upload an expansion file to an existing APK.)</p>
-
-<p class="note"><strong>Note:</strong> The patch expansion file is semantically the same as the
-main expansion file—you can use each file any way you want. The system does
-not use the patch expansion file to perform patching for your app. You must perform patching
-yourself or be able to distinguish between the two files.</p>
-
-
-
-<h3 id="Filename">File name format</h3>
-
-<p>Each expansion file you upload can be any format you choose (ZIP, PDF, MP4, etc.). Regardless of
-the file type, Google Play considers them opaque binary blobs and renames the files
-using the following scheme:</p>
-
-<pre class="classic no-pretty-print">
-[main|patch].<expansion-version>.<package-name>.obb
-</pre>
-
-<p>There are three components to this scheme:</p>
-
-<dl>
- <dt>{@code main} or {@code patch}</dt>
- <dd>Specifies whether the file is the main or patch expansion file. There can be
-only one main file and one patch file for each APK.</dd>
- <dt>{@code <expansion-version>}</dt>
- <dd>This is an integer that matches the version code of the APK with which the expansion is
-<em>first</em> associated (it matches the application's <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code android:versionCode}</a>
-value).
- <p>"First" is emphasized because although the Developer Console allows you to
-re-use an uploaded expansion file with a new APK, the expansion file's name does not change—it
-retains the version applied to it when you first uploaded the file.</p></dd>
- <dt>{@code <package-name>}</dt>
- <dd>Your application's Java-style package name.</dd>
-</dl>
-
-<p>For example, suppose your APK version is 314159 and your package name is com.example.app. If you
-upload a main expansion file, the file is renamed to:</p>
-<pre class="classic no-pretty-print">main.314159.com.example.app.obb</pre>
-
-
-<h3 id="StorageLocation">Storage location</h3>
-
-<p>When Google Play downloads your expansion files to a device, it saves them to the system's
-shared storage location. To ensure proper behavior, you must not delete, move, or rename the
-expansion files. In the event that your application must perform the download from Google Play
-itself, you must save the files to the exact same location.</p>
-
-<p>The specific location for your expansion files is:</p>
-
-<pre class="classic no-pretty-print">
-<shared-storage>/Android/obb/<package-name>/
-</pre>
-
-<ul>
- <li>{@code <shared-storage>} is the path to the shared storage space, available from
-{@link android.os.Environment#getExternalStorageDirectory()}.</li>
- <li>{@code <package-name>} is your application's Java-style package name, available
-from {@link android.content.Context#getPackageName()}.</li>
-</ul>
-
-<p>For each application, there are never more than two expansion files in this directory.
-One is the main expansion file and the other is the patch expansion file (if necessary). Previous
-versions are overwritten when you update your application with new expansion files.</p>
-
-<p>If you must unpack the contents of your expansion files, <strong>do not</strong> delete the
-{@code .obb} expansion files afterwards and <strong>do not</strong> save the unpacked data
-in the same directory. You should save your unpacked files in the directory
-specified by {@link android.content.Context#getExternalFilesDir getExternalFilesDir()}. However,
-if possible, it's best if you use an expansion file format that allows you to read directly from
-the file instead of requiring you to unpack the data. For example, we've provided a library
-project called the <a href="#ZipLib">APK Expansion Zip Library</a> that reads your data directly
-from the ZIP file.</p>
-
-<p class="note"><strong>Note:</strong> Unlike APK files, any files saved on the shared storage can
-be read by the user and other applications.</p>
-
-<p class="note"><strong>Tip:</strong> If you're packaging media files into a ZIP, you can use media
-playback calls on the files with offset and length controls (such as {@link
-android.media.MediaPlayer#setDataSource(FileDescriptor,long,long) MediaPlayer.setDataSource()} and
-{@link android.media.SoundPool#load(FileDescriptor,long,long,int) SoundPool.load()}) without the
-need to unpack your ZIP. In order for this to work, you must not perform additional compression on
-the media files when creating the ZIP packages. For example, when using the <code>zip</code> tool,
-you should use the <code>-n</code> option to specify the file suffixes that should not be
-compressed: <br/>
-<code>zip -n .mp4;.ogg main_expansion media_files</code></p>
-
-
-<h3 id="DownloadProcess">Download process</h3>
-
-<p>Most of the time, Google Play downloads and saves your expansion files at the same time it
-downloads the APK to the device. However, in some cases Google Play
-cannot download the expansion files or the user might have deleted previously downloaded expansion
-files. To handle these situations, your app must be able to download the files
-itself when the main activity starts, using a URL provided by Google Play.</p>
-
-<p>The download process from a high level looks like this:</p>
-
-<ol>
- <li>User selects to install your app from Google Play.</li>
- <li>If Google Play is able to download the expansion files (which is the case for most
-devices), it downloads them along with the APK.
- <p>If Google Play is unable to download the expansion files, it downloads the
-APK only.</p>
- </li>
- <li>When the user launches your application, your app must check whether the expansion files are
-already saved on the device.
- <ol>
- <li>If yes, your app is ready to go.</li>
- <li>If no, your app must download the expansion files over HTTP from Google Play. Your app
-must send a request to the Google Play client using the Google Play's <a
-href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> service, which
-responds with the name, file size, and URL for each expansion file. With this information, you then
-download the files and save them to the proper <a href="#StorageLocation">storage location</a>.</li>
- </ol>
- </li>
-</ol>
-
-<p class="caution"><strong>Caution:</strong> It is critical that you include the necessary code to
-download the expansion files from Google Play in the event that the files are not already on the
-device when your application starts. As discussed in the following section about <a
-href="#Downloading">Downloading the Expansion Files</a>, we've made a library available to you that
-greatly simplifies this process and performs the download from a service with a minimal amount of
-code from you.</p>
-
-
-
-
-<h3 id="Checklist">Development checklist</h3>
-
-<p>Here's a summary of the tasks you should perform to use expansion files with your
-application:</p>
-
-<ol>
- <li>First determine whether your application absolutely requires more than 50MB per installation.
-Space is precious and you should keep your total application size as small as possible. If your app
-uses more than 50MB in order to provide multiple versions of your graphic assets for multiple screen
-densities, consider instead publishing <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html">multiple APKs</a> in which each APK
-contains only the assets required for the screens that it targets.</li>
- <li>Determine which application resources to separate from your APK and package them in a
-file to use as the main expansion file.
- <p>Normally, you should only use the second patch expansion file when performing updates to
-the main expansion file. However, if your resources exceed the 2GB limit for the main
-expansion file, you can use the patch file for the rest of your assets.</p>
- </li>
- <li>Develop your application such that it uses the resources from your expansion files in the
-device's <a href="#StorageLocation">shared storage location</a>.
- <p>Remember that you must not delete, move, or rename the expansion files.</p>
- <p>If your application doesn't demand a specific format, we suggest you create ZIP files for
-your expansion files, then read them using the <a href="#ZipLib">APK Expansion Zip
-Library</a>.</p>
- </li>
- <li>Add logic to your application's main activity that checks whether the expansion files
-are on the device upon start-up. If the files are not on the device, use Google Play's <a
-href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> service to request URLs
-for the expansion files, then download and save them.
- <p>To greatly reduce the amount of code you must write and ensure a good user experience
-during the download, we recommend you use the <a href="AboutLibraries">Downloader
-Library</a> to implement your download behavior.</p>
- <p>If you build your own download service instead of using the library, be aware that you
-must not change the name of the expansion files and must save them to the proper
-<a href="#StorageLocation">storage location</a>.</p></li>
-</ol>
-
-<p>Once you've finished your application development, follow the guide to <a href="#Testing">Testing
-Your Expansion Files</a>.</p>
-
-
-
-
-
-
-<h2 id="Rules">Rules and Limitations</h2>
-
-<p>Adding APK expansion files is a feature available when you upload your application using the
-Developer Console. When uploading your application for the first time or updating an
-application that uses expansion files, you must be aware of the following rules and limitations:</p>
-
-<ol type="I">
- <li>Each expansion file can be no more than 2GB.</li>
- <li>In order to download your expansion files from Google Play, <strong>the user must have
-acquired your application from Google Play</strong>. Google Play will not
-provide the URLs for your expansion files if the application was installed by other means.</li>
- <li>When performing the download from within your application, the URL that Google Play
-provides for each file is unique for every download and each one expires shortly after it is given
-to your application.</li>
- <li>If you update your application with a new APK or upload <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html">multiple APKs</a> for the same
-application, you can select expansion files that you've uploaded for a previous APK. <strong>The
-expansion file's name does not change</strong>—it retains the version received by the APK to
-which the file was originally associated.</li>
- <li>If you use expansion files in combination with <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html">multiple APKs</a> in order to
-provide different expansion files for different devices, you still must upload separate APKs
-for each device in order to provide a unique <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code versionCode}</a>
-value and declare different <a href="{@docRoot}guide/appendix/market-filters.html">filters</a> for
-each APK.</li>
- <li>You cannot issue an update to your application by changing the expansion files
-alone—<strong>you must upload a new APK</strong> to update your app. If your changes only
-concern the assets in your expansion files, you can update your APK simply by changing the <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code versionCode}</a> (and
-perhaps also the <a href="{@docRoot}guide/topics/manifest/manifest-element.html#vname">{@code
-versionName}</a>).</p></li>
- <li><strong>Do not save other data into your <code>obb/</code>
-directory</strong>. If you must unpack some data, save it into the location specified by {@link
-android.content.Context#getExternalFilesDir getExternalFilesDir()}.</li>
- <li><strong>Do not delete or rename the {@code .obb} expansion file</strong> (unless you're
-performing an update). Doing so will cause Google Play (or your app itself) to repeatedly
-download the expansion file.</li>
- <li>When updating an expansion file manually, you must delete the previous expansion file.</li>
-</ol>
-
-
-
-
-
-
-
-
-
-<h2 id="Downloading">Downloading the Expansion Files</h2>
-
-<p>In most cases, Google Play downloads and saves your expansion files to the device at the same
-time it installs or updates the APK. This way, the expansion files are available when your
-application launches for the first time. However, in some cases your app must download the
-expansion files itself by requesting them from a URL provided to you in a response
-from Google Play's <a
-href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> service.</p>
-
-<p>The basic logic you need to download your expansion files is the following:</p>
-
-<ol>
- <li>When your application starts, look for the expansion files on the <a
-href="#StorageLocation">shared storage location</a> (in the
-<code>Android/obb/<package-name>/</code> directory).
- <ol type="a">
- <li>If the expansion files are there, you're all set and your application can continue.</li>
- <li>If the expansion files are <em>not</em> there:
- <ol>
- <li>Perform a request using Google Play's <a
-href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> to get your
-app's expansion file names, sizes, and URLs.</li>
- <li>Use the URLs provided by Google Play to download the expansion files and save
-the expansion files. You <strong>must</strong> save the files to the <a
-href="#StorageLocation">shared storage location</a>
-(<code>Android/obb/<package-name>/</code>) and use the exact file name provided
-by Google Play's response.
- <p class="note"><strong>Note:</strong> The URL that Google Play provides for your
-expansion files is unique for every download and each one expires shortly after it is given to
-your application.</p>
- </li>
- </ol>
- </li>
- </ol>
- </li>
-</ol>
-
-
-<p>If your application is free (not a paid app), then you probably haven't used the <a
-href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a> service. It's primarily
-designed for you to enforce
-licensing policies for your application and ensure that the user has the right to
-use your app (he or she rightfully paid for it on Google Play). In order to facilitate the
-expansion file functionality, the licensing service has been enhanced to provide a response
-to your application that includes the URL of your application's expansion files that are hosted
-on Google Play. So, even if your application is free for users, you need to include the
-License Verification Library (LVL) to use APK expansion files. Of course, if your application
-is free, you don't need to enforce license verification—you simply need the
-library to perform the request that returns the URL of your expansion files.</p>
-
-<p class="note"><strong>Note:</strong> Whether your application is free or not, Google Play
-returns the expansion file URLs only if the user acquired your application from Google Play.</p>
-
-<p>In addition to the LVL, you need a set of code that downloads the expansion files
-over an HTTP connection and saves them to the proper location on the device's shared storage.
-As you build this procedure into your application, there are several issues you should take into
-consideration:</p>
-
-<ul>
- <li>The device might not have enough space for the expansion files, so you should check
-before beginning the download and warn the user if there's not enough space.</li>
- <li>File downloads should occur in a background service in order to avoid blocking the user
-interaction and allow the user to leave your app while the download completes.</li>
- <li>A variety of errors might occur during the request and download that you must
-gracefully handle.</li>
- <li>Network connectivity can change during the download, so you should handle such changes and
-if interrupted, resume the download when possible.</li>
- <li>While the download occurs in the background, you should provide a notification that
-indicates the download progress, notifies the user when it's done, and takes the user back to
-your application when selected.</li>
-</ul>
-
-
-<p>To simplify this work for you, we've built the <a href="#AboutLibraries">Downloader Library</a>,
-which requests the expansion file URLs through the licensing service, downloads the expansion files,
-performs all of the tasks listed above, and even allows your activity to pause and resume the
-download. By adding the Downloader Library and a few code hooks to your application, almost all the
-work to download the expansion files is already coded for you. As such, in order to provide the best
-user experience with minimal effort on your behalf, we recommend you use the Downloader Library to
-download your expansion files. The information in the following sections explain how to integrate
-the library into your application.</p>
-
-<p>If you'd rather develop your own solution to download the expansion files using the Google
-Play URLs, you must follow the <a href="{@docRoot}guide/market/licensing/index.html">Application
-Licensing</a> documentation to perform a license request, then retrieve the expansion file names,
-sizes, and URLs from the response extras. You should use the <a href="#ExpansionPolicy">{@code
-APKExpansionPolicy}</a> class (included in the License Verification Library) as your licensing
-policy, which captures the expansion file names, sizes, and URLs from the licensing service..</p>
-
-
-
-<h3 id="AboutLibraries">About the Downloader Library</h3>
-
-<p>To use APK expansion files with your application and provide the best user experience with
-minimal effort on your behalf, we recommend you use the Downloader Library that's included in the
-Google Market Apk Expansion package. This library downloads your expansion files in a
-background service, shows a user notification with the download status, handles network
-connectivity loss, resumes the download when possible, and more.</p>
-
-<p>To implement expansion file downloads using the Downloader Library, all you need to do is:</p>
-
-<ul>
- <li>Extend a special {@link android.app.Service} subclass and {@link
-android.content.BroadcastReceiver} subclass that each require just a few
-lines of code from you.</li>
- <li>Add some logic to your main activity that checks whether the expansion files have
-already been downloaded and, if not, invokes the download process and displays a
-progress UI.</li>
- <li>Implement a callback interface with a few methods in your main activity that
-receives updates about the download progress.</li>
-</ul>
-
-<p>The following sections explain how to set up your app using the Downloader Library.</p>
-
-
-<h3 id="Preparing">Preparing to use the Downloader Library</h3>
-
-<p>To use the Downloader Library, you need to
-download two packages from the SDK Manager and add the appropriate libraries to your
-application.</p>
-
-<p>First, open the <a href="{@docRoot}sdk/adding-components.html">Android SDK Manager</a>, expand
-<em>Extras</em> and download:</p>
-<ul>
- <li><em>Google Market Licensing package</em></li>
- <li><em>Google Market Apk Expansion package</em></li>
-</ul>
-
-<p>If you're using Eclipse, create a project for each library and add it to your app:</p>
-<ol>
- <li>Create a new Library Project for the License Verification Library and Downloader
-Library. For each library:
- <ol>
- <li>Begin a new Android project.</li>
- <li>Select <strong>Create project from existing
-source</strong> and choose the library from the {@code <sdk>/extras/google/} directory
-({@code market_licensing/} for the License Verification Library or {@code
-market_apk_expansion/downloader_library/} for the Downloader Library).</li>
- <li>Specify a <em>Project Name</em> such as "Google Play License Library" and "Google Play
-Downloader
-Library"</li>
- <li>Click <strong>Finish</strong>.</li>
- </ol>
-<p class="note"><strong>Note:</strong> The Downloader Library depends on the License
-Verification Library. Be sure to add the License
-Verification Library to the Downloader Library's project properties (same process as
-steps 2 and 3 below).</p>
- </li>
- <li>Right-click the Android project in which you want to use APK expansion files and
-select <strong>Properties</strong>.</li>
- <li>In the <em>Library</em> panel, click <strong>Add</strong> to select and add each of the
-libraries to your application.</li>
-</ol>
-
-<p>Or, from a command line, update your project to include the libraries:</p>
-<ol>
- <li>Change directories to the <code><sdk>/tools/</code> directory.</li>
- <li>Execute <code>android update project</code> with the {@code --library} option to add both the
-LVL and the Downloader Library to your project. For example:
-<pre class="no-pretty-print">
-android update project --path ~/Android/MyApp \
---library ~/android_sdk/extras/google/market_licensing \
---library ~/android_sdk/extras/google/market_apk_expansion/downloader_library
-</pre>
- </li>
-</ol>
-
-<p>With both the License Verification Library and Downloader Library added to your
-application, you'll be able to quickly integrate the ability to download expansion files from
-Google Play. The format that you choose for the expansion files and how you read them
-from the shared storage is a separate implementation that you should consider based on your
-application needs.</p>
-
-<p class="note"><strong>Tip:</strong> The Apk Expansion package includes a sample
-application
-that shows how to use the Downloader Library in an app. The sample uses a third library
-available in the Apk Expansion package called the APK Expansion Zip Library. If
-you plan on
-using ZIP files for your expansion files, we suggest you also add the APK Expansion Zip Library to
-your application. For more information, see the section below
-about <a href="#ZipLib">Using the APK Expansion Zip Library</a>.</p>
-
-
-
-<h3 id="Permissions">Declaring user permissions</h3>
-
-<p>In order to download the expansion files, the Downloader Library
-requires several permissions that you must declare in your application's manifest file. They
-are:</p>
-
-<pre>
-<manifest ...>
- <!-- Required to access Google Play Licensing -->
- <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
-
- <!-- Required to download files from Google Play -->
- <uses-permission android:name="android.permission.INTERNET" />
-
- <!-- Required to keep CPU alive while downloading files (NOT to keep screen awake) -->
- <uses-permission android:name="android.permission.WAKE_LOCK" />
-
- <!-- Required to poll the state of the network connection and respond to changes -->
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-
- <!-- Required to check whether Wi-Fi is enabled -->
- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
-
- <!-- Required to read and write the expansion files on shared storage -->
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- ...
-</manifest>
-</pre>
-
-<p class="note"><strong>Note:</strong> By default, the Downloader Library requires API
-level 4, but the APK Expansion Zip Library requires API level 5.</p>
-
-
-<h3 id="DownloaderService">Implementing the downloader service</h3>
-
-<p>In order to perform downloads in the background, the Downloader Library provides its
-own {@link android.app.Service} subclass called {@code DownloaderService} that you should extend. In
-addition to downloading the expansion files for you, the {@code DownloaderService} also:</p>
-
-<ul>
- <li>Registers a {@link android.content.BroadcastReceiver} that listens for changes to the
-device's network connectivity (the {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION}
-broadcast) in order to pause the download when necessary (such as due to connectivity loss) and
-resume the download when possible (connectivity is acquired).</li>
- <li>Schedules an {@link android.app.AlarmManager#RTC_WAKEUP} alarm to retry the download for
-cases in which the service gets killed.</li>
- <li>Builds a custom {@link android.app.Notification} that displays the download progress and
-any errors or state changes.</li>
- <li>Allows your application to manually pause and resume the download.</li>
- <li>Verifies that the shared storage is mounted and available, that the files don't already exist,
-and that there is enough space, all before downloading the expansion files. Then notifies the user
-if any of these are not true.</li>
-</ul>
-
-<p>All you need to do is create a class in your application that extends the {@code
-DownloaderService} class and override three methods to provide specific application details:</p>
-
-<dl>
- <dt>{@code getPublicKey()}</dt>
- <dd>This must return a string that is the Base64-encoded RSA public key for your publisher
-account, available from the profile page on the Developer Console (see <a
-href="{@docRoot}guide/market/licensing/setting-up.html">Setting Up for Licensing</a>).</dd>
- <dt>{@code getSALT()}</dt>
- <dd>This must return an array of random bytes that the licensing {@code Policy} uses to
-create an <a
-href="{@docRoot}guide/market/licensing/adding-licensing.html#impl-Obfuscator">{@code
-Obfuscator}</a>. The salt ensures that your obfuscated {@link android.content.SharedPreferences}
-file in which your licensing data is saved will be unique and non-discoverable.</dd>
- <dt>{@code getAlarmReceiverClassName()}</dt>
- <dd>This must return the class name of the {@link android.content.BroadcastReceiver} in
-your application that should receive the alarm indicating that the download should be
-restarted (which might happen if the downloader service unexpectedly stops).</dd>
-</dl>
-
-<p>For example, here's a complete implementation of {@code DownloaderService}:</p>
-
-<pre>
-public class SampleDownloaderService extends DownloaderService {
- // You must use the public key belonging to your publisher account
- public static final String BASE64_PUBLIC_KEY = "YourLVLKey";
- // You should also modify this salt
- public static final byte[] SALT = new byte[] { 1, 42, -12, -1, 54, 98,
- -100, -12, 43, 2, -8, -4, 9, 5, -106, -107, -33, 45, -1, 84
- };
-
- @Override
- public String getPublicKey() {
- return BASE64_PUBLIC_KEY;
- }
-
- @Override
- public byte[] getSALT() {
- return SALT;
- }
-
- @Override
- public String getAlarmReceiverClassName() {
- return SampleAlarmReceiver.class.getName();
- }
-}
-</pre>
-
-<p class="caution"><strong>Notice:</strong> You must update the {@code BASE64_PUBLIC_KEY} value
-to be the public key belonging to your publisher account. You can find the key in the Developer
-Console under your profile information. This is necessary even when testing
-your downloads.</p>
-
-<p>Remember to declare the service in your manifest file:</p>
-<pre>
-<application ...>
- <service android:name=".SampleDownloaderService" />
- ...
-</application>
-</pre>
-
-
-
-<h3 id="AlarmReceiver">Implementing the alarm receiver</h3>
-
-<p>In order to monitor the progress of the file downloads and restart the download if necessary, the
-{@code DownloaderService} schedules an {@link android.app.AlarmManager#RTC_WAKEUP} alarm that
-delivers an {@link android.content.Intent} to a {@link android.content.BroadcastReceiver} in your
-application. You must define the {@link android.content.BroadcastReceiver} to call an API
-from the Downloader Library that checks the status of the download and restarts
-it if necessary.</p>
-
-<p>You simply need to override the {@link android.content.BroadcastReceiver#onReceive
-onReceive()} method to call {@code
-DownloaderClientMarshaller.startDownloadServiceIfRequired()}.</p>
-
-<p>For example:</p>
-
-<pre>
-public class SampleAlarmReceiver extends BroadcastReceiver {
- @Override
- public void onReceive(Context context, Intent intent) {
- try {
- DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent,
- SampleDownloaderService.class);
- } catch (NameNotFoundException e) {
- e.printStackTrace();
- }
- }
-}
-</pre>
-
-<p>Notice that this is the class for which you must return the name
-in your service's {@code getAlarmReceiverClassName()} method (see the previous section).</p>
-
-<p>Remember to declare the receiver in your manifest file:</p>
-<pre>
-<application ...>
- <receiver android:name=".SampleAlarmReceiver" />
- ...
-</application>
-</pre>
-
-
-
-<h3 id="Download">Starting the download</h3>
-
-<p>The main activity in your application (the one started by your launcher icon) is
-responsible for verifying whether the expansion files are already on the device and initiating
-the download if they are not.</p>
-
-<p>Starting the download using the Downloader Library requires the following
-procedures:</p>
-
-<ol>
- <li>Check whether the files have been downloaded.
- <p>The Downloader Library includes some APIs in the {@code Helper} class to
-help with this process:</p>
- <ul>
- <li>{@code getExtendedAPKFileName(Context, c, boolean mainFile, int
-versionCode)}</li>
- <li>{@code doesFileExist(Context c, String fileName, long fileSize)}</li>
- </ul>
- <p>For example, the sample app provided in the Apk Expansion package calls the
-following method in the activity's {@link android.app.Activity#onCreate onCreate()} method to check
-whether the expansion files already exist on the device:</p>
-<pre>
-boolean expansionFilesDelivered() {
- for (XAPKFile xf : xAPKS) {
- String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsBase, xf.mFileVersion);
- if (!Helpers.doesFileExist(this, fileName, xf.mFileSize, false))
- return false;
- }
- return true;
-}
-</pre>
- <p>In this case, each {@code XAPKFile} object holds the version number and file size of a known
-expansion file and a boolean as to whether it's the main expansion file. (See the sample
-application's {@code SampleDownloaderActivity} class for details.)</p>
- <p>If this method returns false, then the application must begin the download.</p>
- </li>
- <li>Start the download by calling the static method {@code
-DownloaderClientMarshaller.startDownloadServiceIfRequired(Context c, PendingIntent
-notificationClient, Class<?> serviceClass)}.
- <p>The method takes the following parameters:</p>
- <ul>
- <li><code>context</code>: Your application's {@link android.content.Context}.</li>
- <li><code>notificationClient</code>: A {@link android.app.PendingIntent} to start your main
-activity. This is used in the {@link android.app.Notification} that the {@code DownloaderService}
-creates to show the download progress. When the user selects the notification, the system
-invokes the {@link android.app.PendingIntent} you supply here and should open the activity
-that shows the download progress (usually the same activity that started the download).</li>
- <li><code>serviceClass</code>: The {@link java.lang.Class} object for your implementation of
-{@code DownloaderService}, required to start the service and begin the download if necessary.</li>
- </ul>
- <p>The method returns an integer that indicates
-whether or not the download is required. Possible values are:</p>
- <ul>
- <li>{@code NO_DOWNLOAD_REQUIRED}: Returned if the files already
-exist or a download is already in progress.</li>
- <li>{@code LVL_CHECK_REQUIRED}: Returned if a license verification is
-required in order to acquire the expansion file URLs.</li>
- <li>{@code DOWNLOAD_REQUIRED}: Returned if the expansion file URLs are already known,
-but have not been downloaded.</li>
- </ul>
- <p>The behavior for {@code LVL_CHECK_REQUIRED} and {@code DOWNLOAD_REQUIRED} are essentially the
-same and you normally don't need to be concerned about them. In your main activity that calls {@code
-startDownloadServiceIfRequired()}, you can simply check whether or not the response is {@code
-NO_DOWNLOAD_REQUIRED}. If the response is anything <em>other than</em> {@code NO_DOWNLOAD_REQUIRED},
-the Downloader Library begins the download and you should update your activity UI to
-display the download progress (see the next step). If the response <em>is</em> {@code
-NO_DOWNLOAD_REQUIRED}, then the files are available and your application can start.</p>
- <p>For example:</p>
-<pre>
-@Override
-public void onCreate(Bundle savedInstanceState) {
- // Check if expansion files are available before going any further
- if (!expansionFilesDelivered()) {
- // Build an Intent to start this activity from the Notification
- Intent notifierIntent = new Intent(this, MainActivity.getClass());
- notifierIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
- Intent.FLAG_ACTIVITY_CLEAR_TOP);
- ...
- PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
- notifierIntent, PendingIntent.FLAG_UPDATE_CURRENT);
-
- // Start the download service (if required)
- int startResult = DownloaderClientMarshaller.startDownloadServiceIfRequired(this,
- pendingIntent, SampleDownloaderService.class);
- // If download has started, initialize this activity to show download progress
- if (startResult != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) {
- // This is where you do set up to display the download progress (next step)
- ...
- return;
- } // If the download wasn't necessary, fall through to start the app
- }
- startApp(); // Expansion files are available, start the app
-}
-</pre>
- </li>
- <li>When the {@code startDownloadServiceIfRequired()} method returns anything <em>other
-than</em> {@code NO_DOWNLOAD_REQUIRED}, create an instance of {@code IStub} by
-calling {@code DownloaderClientMarshaller.CreateStub(IDownloaderClient client, Class<?>
-downloaderService)}. The {@code IStub} provides a binding between your activity to the downloader
-service such that your activity receives callbacks about the download progress.
- <p>In order to instantiate your {@code IStub} by calling {@code CreateStub()}, you must pass it
-an implementation of the {@code IDownloaderClient} interface and your {@code DownloaderService}
-implementation. The next section about <a href="#Progress">Receiving download progress</a> discusses
-the {@code IDownloaderClient} interface, which you should usually implement in your {@link
-android.app.Activity} class so you can update the activity UI when the download state changes.</p>
- <p>We recommend that you call {@code
-CreateStub()} to instantiate your {@code IStub} during your activity's {@link
-android.app.Activity#onCreate onCreate()} method, after {@code startDownloadServiceIfRequired()}
-starts the download. </p>
- <p>For example, in the previous code sample for {@link android.app.Activity#onCreate
-onCreate()}, you can respond to the {@code startDownloadServiceIfRequired()} result like this:</p>
-<pre>
- // Start the download service (if required)
- int startResult = DownloaderClientMarshaller.startDownloadServiceIfRequired(this,
- pendingIntent, SampleDownloaderService.class);
- // If download has started, initialize activity to show progress
- if (startResult != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) {
- // Instantiate a member instance of IStub
- mDownloaderClientStub = DownloaderClientMarshaller.CreateStub(this,
- SampleDownloaderService.class);
- // Inflate layout that shows download progress
- setContentView(R.layout.downloader_ui);
- return;
- }
-</pre>
-
- <p>After the {@link android.app.Activity#onCreate onCreate()} method returns, your activity
-receives a call to {@link android.app.Activity#onResume onResume()}, which is where you should then
-call {@code connect()} on the {@code IStub}, passing it your application's {@link
-android.content.Context}. Conversely, you should call
-{@code disconnect()} in your activity's {@link android.app.Activity#onStop onStop()} callback.</p>
-<pre>
-@Override
-protected void onResume() {
- if (null != mDownloaderClientStub) {
- mDownloaderClientStub.connect(this);
- }
- super.onResume();
-}
-
-@Override
-protected void onStop() {
- if (null != mDownloaderClientStub) {
- mDownloaderClientStub.disconnect(this);
- }
- super.onStop();
-}
-</pre>
- <p>Calling {@code connect()} on the {@code IStub} binds your activity to the {@code
-DownloaderService} such that your activity receives callbacks regarding changes to the download
-state through the {@code IDownloaderClient} interface.</p>
- </li>
-</ol>
-
-
-
-<h3 id="Progress">Receiving download progress</h3>
-
-<p>To receive updates regarding the download progress and to interact with the {@code
-DownloaderService}, you must implement the Downloader Library's {@code IDownloaderClient} interface.
-Usually, the activity you use to start the download should implement this interface in order to
-display the download progress and send requests to the service.</p>
-
-<p>The required interface methods for {@code IDownloaderClient} are:</p>
-
-<dl>
- <dt>{@code onServiceConnected(Messenger m)}</dt>
- <dd>After you instantiate the {@code IStub} in your activity, you'll receive a call to this
-method, which passes a {@link android.os.Messenger} object that's connected with your instance
-of {@code DownloaderService}. To send requests to the service, such as to pause and resume
-downloads, you must call {@code DownloaderServiceMarshaller.CreateProxy()} to receive the {@code
-IDownloaderService} interface connected to the service.
- <p>A recommended implementation looks like this:</p>
-<pre>
-private IDownloaderService mRemoteService;
-...
-
-@Override
-public void onServiceConnected(Messenger m) {
- mRemoteService = DownloaderServiceMarshaller.CreateProxy(m);
- mRemoteService.onClientUpdated(mDownloaderClientStub.getMessenger());
-}
-</pre>
- <p>With the {@code IDownloaderService} object initialized, you can send commands to the
-downloader service, such as to pause and resume the download ({@code requestPauseDownload()}
-and {@code requestContinueDownload()}).</p>
-</dd>
- <dt>{@code onDownloadStateChanged(int newState)}</dt>
- <dd>The download service calls this when a change in download state occurs, such as the
-download begins or completes.
- <p>The <code>newState</code> value will be one of several possible values specified in
-by one of the {@code IDownloaderClient} class's {@code STATE_*} constants.</p>
- <p>To provide a useful message to your users, you can request a corresponding string
-for each state by calling {@code Helpers.getDownloaderStringResourceIDFromState()}. This
-returns the resource ID for one of the strings bundled with the Downloader
-Library. For example, the string "Download paused because you are roaming" corresponds to {@code
-STATE_PAUSED_ROAMING}.</p></dd>
- <dt>{@code onDownloadProgress(DownloadProgressInfo progress)}</dt>
- <dd>The download service calls this to deliver a {@code DownloadProgressInfo} object,
-which describes various information about the download progress, including estimated time remaining,
-current speed, overall progress, and total so you can update the download progress UI.</dd>
-</dl>
-<p class="note"><strong>Tip:</strong> For examples of these callbacks that update the download
-progress UI, see the {@code SampleDownloaderActivity} in the sample app provided with the
-Apk Expansion package.</p>
-
-<p>Some public methods for the {@code IDownloaderService} interface you might find useful are:</p>
-
-<dl>
- <dt>{@code requestPauseDownload()}</dt>
- <dd>Pauses the download.</dd>
- <dt>{@code requestContinueDownload()}</dt>
- <dd>Resumes a paused download.</dd>
- <dt>{@code setDownloadFlags(int flags)}</dt>
- <dd>Sets user preferences for network types on which its OK to download the files. The
-current implementation supports one flag, {@code FLAGS_DOWNLOAD_OVER_CELLULAR}, but you can add
-others. By default, this flag is <em>not</em> enabled, so the user must be on Wi-Fi to download
-expansion files. You might want to provide a user preference to enable downloads over
-the cellular network. In which case, you can call:
-<pre>
-mRemoteService.setDownloadFlags(IDownloaderService.FLAGS_DOWNLOAD_OVER_CELLULAR);
-</pre>
-</dd>
-</dl>
-
-
-
-
-<h2 id="ExpansionPolicy">Using APKExpansionPolicy</h2>
-
-<p>If you decide to build your own downloader service instead of using the Google Play
-<a href="#AboutLibraries">Downloader Library</a>, you should still use the {@code
-APKExpansionPolicy} that's provided in the License Verification Library. The {@code
-APKExpansionPolicy} class is nearly identical to {@code ServerManagedPolicy} (available in the
-Google Play License Verification Library) but includes additional handling for the APK expansion
-file response extras.</p>
-
-<p class="note"><strong>Note:</strong> If you <em>do use</em> the <a
-href="#AboutLibraries">Downloader Library</a> as discussed in the previous section, the
-library performs all interaction with the {@code APKExpansionPolicy} so you don't have to use
-this class directly.</p>
-
-<p>The class includes methods to help you get the necessary information about the available
-expansion files:</p>
-
-<ul>
- <li>{@code getExpansionURLCount()}</li>
- <li>{@code getExpansionURL(int index)}</li>
- <li>{@code getExpansionFileName(int index)}</li>
- <li>{@code getExpansionFileSize(int index)}</li>
-</ul>
-
-<p>For more information about how to use the {@code APKExpansionPolicy} when you're <em>not</em>
-using the <a
-href="#AboutLibraries">Downloader Library</a>, see the documentation for <a
-href="{@docRoot}guide/market/licensing/adding-licensing.html">Adding Licensing to Your App</a>,
-which explains how to implement a license policy such as this one.</p>
-
-
-
-
-
-
-
-<h2 id="ReadingTheFile">Reading the Expansion File</h2>
-
-<p>Once your APK expansion files are saved on the device, how you read your files
-depends on the type of file you've used. As discussed in the <a href="#Overview">overview</a>, your
-expansion files can be any kind of file you
-want, but are renamed using a particular <a href="#Filename">file name format</a> and are saved to
-{@code <shared-storage>/Android/obb/<package-name>/}.</p>
-
-<p>Regardless of how you read your files, you should always first check that the external
-storage is available for reading. There's a chance that the user has the storage mounted to a
-computer over USB or has actually removed the SD card.</p>
-
-<p class="note"><strong>Note:</strong> When your application starts, you should always check whether
-the external storage space is available and readable by calling {@link
-android.os.Environment#getExternalStorageState()}. This returns one of several possible strings
-that represent the state of the external storage. In order for it to be readable by your
-application, the return value must be {@link android.os.Environment#MEDIA_MOUNTED}.</p>
-
-
-<h3 id="GettingFilenames">Getting the file names</h3>
-
-<p>As described in the <a href="#Overview">overview</a>, your APK expansion files are saved
-using a specific file name format:</p>
-
-<pre class="classic no-pretty-print">
-[main|patch].<expansion-version>.<package-name>.obb
-</pre>
-
-<p>To get the location and names of your expansion files, you should use the
-{@link android.os.Environment#getExternalStorageDirectory()} and {@link
-android.content.Context#getPackageName()} methods to construct the path to your files.</p>
-
-<p>Here's a method you can use in your application to get an array containing the complete path
-to both your expansion files:</p>
-
-<pre>
-// The shared path to all app expansion files
-private final static String EXP_PATH = "/Android/obb/";
-
-static String[] getAPKExpansionFiles(Context ctx, int mainVersion, int patchVersion) {
- String packageName = ctx.getPackageName();
- Vector<String> ret = new Vector<String>();
- if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
- // Build the full path to the app's expansion files
- File root = Environment.getExternalStorageDirectory();
- File expPath = new File(root.toString() + EXP_PATH + packageName);
-
- // Check that expansion file path exists
- if (expPath.exists()) {
- if ( mainVersion > 0 ) {
- String strMainPath = expPath + File.separator + "main." +
- mainVersion + "." + packageName + ".obb";
- File main = new File(strMainPath);
- if ( main.isFile() ) {
- ret.add(strMainPath);
- }
- }
- if ( patchVersion > 0 ) {
- String strPatchPath = expPath + File.separator + "patch." +
- mainVersion + "." + packageName + ".obb";
- File main = new File(strPatchPath);
- if ( main.isFile() ) {
- ret.add(strPatchPath);
- }
- }
- }
- }
- String[] retArray = new String[ret.size()];
- ret.toArray(retArray);
- return retArray;
-}
-</pre>
-
-<p>You can call this method by passing it your application {@link android.content.Context}
-and the desired expansion file's version.</p>
-
-<p>There are many ways you could determine the expansion file version number. One simple way is to
-save the version in a {@link android.content.SharedPreferences} file when the download begins, by
-querying the expansion file name with the {@code APKExpansionPolicy} class's {@code
-getExpansionFileName(int index)} method. You can then get the version code by reading the {@link
-android.content.SharedPreferences} file when you want to access the expansion
-file.</p>
-
-<p>For more information about reading from the shared storage, see the <a
-href="{@docRoot}guide/topics/data/data-storage.html#filesExternal">Data Storage</a>
-documentation.</p>
-
-
-
-<h3 id="ZipLib">Using the APK Expansion Zip Library</h3>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h3>Reading media files from a ZIP</h3>
- <p>If you're using your expansion files to store media files, a ZIP file still allows you to
-use Android media playback calls that provide offset and length controls (such as {@link
-android.media.MediaPlayer#setDataSource(FileDescriptor,long,long) MediaPlayer.setDataSource()} and
-{@link android.media.SoundPool#load(FileDescriptor,long,long,int) SoundPool.load()}). In order for
-this to work, you must not perform additional compression on the media files when creating the ZIP
-packages. For example, when using the <code>zip</code> tool, you should use the <code>-n</code>
-option to specify the file suffixes that should not be compressed:</p>
-<p><code>zip -n .mp4;.ogg main_expansion media_files</code></p>
-</div>
-</div>
-
-<p>The Google Market Apk Expansion package includes a library called the APK
-Expansion Zip Library (located in {@code
-<sdk>/extras/google/google_market_apk_expansion/zip_file/}). This is an optional library that
-helps you read your expansion
-files when they're saved as ZIP files. Using this library allows you to easily read resources from
-your ZIP expansion files as a virtual file system.</p>
-
-<p>The APK Expansion Zip Library includes the following classes and APIs:</p>
-
-<dl>
- <dt>{@code APKExpansionSupport}</dt>
- <dd>Provides some methods to access expansion file names and ZIP files:
-
- <dl style="margin-top:1em">
- <dt>{@code getAPKExpansionFiles()}</dt>
- <dd>The same method shown above that returns the complete file path to both expansion
-files.</dd>
- <dt>{@code getAPKExpansionZipFile(Context ctx, int mainVersion, int
-patchVersion)}</dt>
- <dd>Returns a {@code ZipResourceFile} representing the sum of both the main file and
-patch file. That is, if you specify both the <code>mainVersion</code> and the
-<code>patchVersion</code>, this returns a {@code ZipResourceFile} that provides read access to
-all the data, with the patch file's data merged on top of the main file.</dd>
- </dl>
- </dd>
-
- <dt>{@code ZipResourceFile}</dt>
- <dd>Represents a ZIP file on the shared storage and performs all the work to provide a virtual
-file system based on your ZIP files. You can get an instance using {@code
-APKExpansionSupport.getAPKExpansionZipFile()} or with the {@code ZipResourceFile} by passing it the
-path to your expansion file. This class includes a variety of useful methods, but you generally
-don't need to access most of them. A couple of important methods are:
-
- <dl style="margin-top:1em">
- <dt>{@code getInputStream(String assetPath)}</dt>
- <dd>Provides an {@link java.io.InputStream} to read a file within the ZIP file. The
-<code>assetPath</code> must be the path to the desired file, relative to
-the root of the ZIP file contents.</dd>
- <dt>{@code getAssetFileDescriptor(String assetPath)}</dt>
- <dd>Provides an {@link android.content.res.AssetFileDescriptor} for a file within the
-ZIP file. The <code>assetPath</code> must be the path to the desired file, relative to
-the root of the ZIP file contents. This is useful for certain Android APIs that require an {@link
-android.content.res.AssetFileDescriptor}, such as some {@link android.media.MediaPlayer} APIs.</dd>
- </dl>
- </dd>
-
- <dt>{@code APEZProvider}</dt>
- <dd>Most applications don't need to use this class. This class defines a {@link
-android.content.ContentProvider} that marshals the data from the ZIP files through a content
-provider {@link android.net.Uri} in order to provide file access for certain Android APIs that
-expect {@link android.net.Uri} access to media files. For example, this is useful if you want to
-play a video with {@link android.widget.VideoView#setVideoURI VideoView.setVideoURI()}.</p></dd>
-</dl>
-
-<h4>Reading from a ZIP file</h4>
-
-<p>When using the APK Expansion Zip Library, reading a file from your ZIP usually requires the
-following:</p>
-
-<pre>
-// Get a ZipResourceFile representing a merger of both the main and patch files
-ZipResourceFile expansionFile = APKExpansionSupport.getAPKExpansionZipFile(appContext,
- mainVersion, patchVersion);
-
-// Get an input stream for a known file inside the expansion file ZIPs
-InputStream fileStream = expansionFile.getInputStream(pathToFileInsideZip);
-</pre>
-
-<p>The above code provides access to any file that exists in either your main expansion file or
-patch expansion file, by reading from a merged map of all the files from both files. All you
-need to provide the {@code getAPKExpansionFile()} method is your application {@code
-android.content.Context} and the version number for both the main expansion file and patch
-expansion file.</p>
-
-<p>If you'd rather read from a specific expansion file, you can use the {@code
-ZipResourceFile} constructor with the path to the desired expansion file:</p>
-
-<pre>
-// Get a ZipResourceFile representing a specific expansion file
-ZipResourceFile expansionFile = new ZipResourceFile(filePathToMyZip);
-
-// Get an input stream for a known file inside the expansion file ZIPs
-InputStream fileStream = expansionFile.getInputStream(pathToFileInsideZip);
-</pre>
-
-<p>For more information about using this library for your expansion files, look at
-the sample application's {@code SampleDownloaderActivity} class, which includes additional code to
-verify the downloaded files using CRC. Beware that if you use this sample as the basis for
-your own implementation, it requires that you <strong>declare the byte size of your expansion
-files</strong> in the {@code xAPKS} array.</p>
-
-
-
-
-<h2 id="Testing">Testing Your Expansion Files</h2>
-
-<p>Before publishing your application, there are two things you should test: Reading the
-expansion files and downloading the files.</p>
-
-
-<h3 id="TestingReading">Testing file reads</h3>
-
-<p>Before you upload your application to Google Play, you
-should test your application's ability to read the files from the shared storage. All you need to do
-is add the files to the appropriate location on the device shared storage and launch your
-application:</p>
-
-<ol>
- <li>On your device, create the appropriate directory on the shared storage where Google
-Play will save your files.
- <p>For example, if your package name is {@code com.example.android}, you need to create
-the directory {@code Android/obb/com.example.android/} on the shared storage space. (Plug in
-your test device to your computer to mount the shared storage and manually create this
-directory.)</p>
- </li>
- <li>Manually add the expansion files to that directory. Be sure that you rename your files to
-match the <a href="#Filename">file name format</a> that Google Play will use.
- <p>For example, regardless of the file type, the main expansion file for the {@code
-com.example.android} application should be {@code main.0300110.com.example.android.obb}.
-The version code can be whatever value you want. Just remember:</p>
- <ul>
- <li>The main expansion file always starts with {@code main} and the patch file starts with
-{@code patch}.</li>
- <li>The package name always matches that of the APK to which the file is attached on
-Google Play.
- </ul>
- </li>
- <li>Now that the expansion file(s) are on the device, you can install and run your application to
-test your expansion file(s).</li>
-</ol>
-
-<p>Here are some reminders about handling the expansion files:</p>
-<ul>
- <li><strong>Do not delete or rename</strong> the {@code .obb} expansion files (even if you unpack
-the data to a different location). Doing so will cause Google Play (or your app itself) to
-repeatedly download the expansion file.</li>
- <li><strong>Do not save other data into your <code>obb/</code>
-directory</strong>. If you must unpack some data, save it into the location specified by {@link
-android.content.Context#getExternalFilesDir getExternalFilesDir()}.</li>
-</ul>
-
-
-
-<h3 id="TestingReading">Testing file downloads</h3>
-
-<p>Because your application must sometimes manually download the expansion files when it first
-opens, it's important that you test this process to be sure your application can successfully query
-for the URLs, download the files, and save them to the device.</p>
-
-<p>To test your application's implementation of the manual download procedure, you must upload
-your application to Google Play as a "draft" to make your expansion files available for
-download:</p>
-
-<ol>
- <li>Upload your APK and corresponding expansion files using the Google Play Developer
-Console.</li>
- <li>Fill in the necessary application details (title, screenshots, etc.). You can come back and
-finalize these details before publishing your application.
- <p>Click the <strong>Save</strong> button. <em>Do not click Publish.</em> This saves
-the application as a draft, such that your application is not published for Google Play users,
-but the expansion files are available for you to test the download process.</p></li>
- <li>Install the application on your test device using the Eclipse tools or <a
-href="{@docRoot}guide/developing/tools/adb.html">{@code adb}</a>.</li>
- <li>Launch the app.</li>
-</ol>
-
-<p>If everything works as expected, your application should begin downloading the expansion
-files as soon as the main activity starts.</p>
-
-
-
-
-<h2 id="Updating">Updating Your Application</h2>
-
-<p>One of the great benefits to using expansion files on Google Play is the ability to
-update your application without re-downloading all of the original assets. Because Google Play
-allows you to provide two expansion files with each APK, you can use the second file as a "patch"
-that provides updates and new assets. Doing so avoids the
-need to re-download the main expansion file which could be large and expensive for users.</p>
-
-<p>The patch expansion file is technically the same as the main expansion file and neither
-the Android system nor Google Play perform actual patching between your main and patch expansion
-files. Your application code must perform any necessary patches itself.</p>
-
-<p>If you use ZIP files as your expansion files, the <a href="#ZipLib">APK Expansion Zip
-Library</a> that's included with the Apk Expansion package includes the ability to merge
-your
-patch file with the main expansion file.</p>
-
-<p class="note"><strong>Note:</strong> Even if you only need to make changes to the patch
-expansion file, you must still update the APK in order for Google Play to perform an update.
-If you don't require code changes in the application, you should simply update the <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code versionCode}</a> in the
-manifest.</p>
-
-<p>As long as you don't change the main expansion file that's associated with the APK
-in the Developer Console, users who previously installed your application will not
-download the main expansion file. Existing users receive only the updated APK and the new patch
-expansion file (retaining the previous main expansion file).</p>
-
-<p>Here are a few issues to keep in mind regarding updates to expansion files:</p>
-
-<ul>
- <li>There can be only two expansion files for your application at a time. One main expansion
-file and one patch expansion file. During an update to a file, Google Play deletes the
-previous version (and so must your application when performing manual updates).</li>
- <li>When adding a patch expansion file, the Android system does not actually patch your
-application or main expansion file. You must design your application to support the patch data.
-However, the Apk Expansion package includes a library for using ZIP files
-as expansion files, which merges the data from the patch file into the main expansion file so
-you can easily read all the expansion file data.</li>
-</ul>
-
-
-
-<!-- Tools are not ready.
-
-<h3>Using OBB tool and APIs</h3>
-
-<pre>
-$ mkobb.sh -d /data/myfiles -k my_secret_key -o /data/data.obb
-$ obbtool a -n com.example.myapp -v 1 -s seed_from_mkobb /data/data.obb
-</pre>
-
-<pre>
-storage = (StorageManager) getSystemService( STORAGE_SERVICE );
-storage.mountObb( obbFilepath, "my_secret_key", myListener );
-obbContentPath = storage.getMountedObbPath( obbFilepath );
-</pre>
--->
diff --git a/docs/html/guide/market/licensing/adding-licensing.jd b/docs/html/guide/market/licensing/adding-licensing.jd
deleted file mode 100644
index d4dd008..0000000
--- a/docs/html/guide/market/licensing/adding-licensing.jd
+++ /dev/null
@@ -1,1072 +0,0 @@
-page.title=Adding Licensing to Your App
-parent.title=Application Licensing
-parent.link=index.html
-@jd:body
-
-
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#manifest-permission">Adding the Licensing Permission</a></li>
- <li><a href="#impl-Policy">Implementing a Policy</a>
- <ol>
- <li><a href="#custom-policies">Guidelines for custom policies</a></li>
- <li><a href="#ServerManagedPolicy">ServerManagedPolicy</a></li>
- <li><a href="#StrictPolicy">StrictPolicy</a></li>
- </ol>
- </li>
- <li><a href="#impl-Obfuscator">Implementing an Obfuscator</a>
- <ol>
- <li><a href="#AESObfuscator">AESObfuscator</a></li>
- </ol>
- </li>
- <li><a href="#impl-lc">Checking the License from an Activity</a>
- <ol>
- <li><a href="#lc-overview">Overview of license check and response</a></li>
- <li><a href="#imports">Add imports</a></li>
- <li><a href="#lc-impl">Implement LicenseCheckerCallback as a private inner class</a></li>
- <li><a href="#thread-handler">Create a Handler for posting from LicenseCheckerCallback
-to the UI thread</a></li>
- <li><a href="#lc-lcc">Instantiate LicenseChecker and LicenseCheckerCallback</a></li>
- <li><a href="#check-access">Call checkAccess() to initiate the license check</a></li>
- <li><a href="#account-key">Embed your public key for licensing</a></li>
- <li><a href="#handler-cleanup">Call your LicenseChecker's onDestroy() method
-to close IPC connections</a></li>
- </ol>
- </li>
- <li><a href="#impl-DeviceLimiter">Implementing a DeviceLimiter</a></li>
- <li><a href="#app-obfuscation">Obfuscating Your Code</a></li>
- <li><a href="#app-publishing">Publishing a Licensed Application</a>
- <ol>
- <li><a href="#">Removing Copy Protection</a></li>
- </ol>
- </li>
- <li><a href="#support">Where to Get Support</a></li>
-</ol>
-
-</div>
-</div>
-
-
-
-<p>After you've set up a publisher account and development environment (see <a
-href="setting-up.html">Setting Up for Licensing</a>), you are ready to add license verification to
-your app with the License Verification Library (LVL).</p>
-
-<p>Adding license verification with the LVL involves these tasks:</p>
-
-<ol>
-<li><a href="#manifest-permission">Adding the licensing permission</a> your application's manifest.</li>
-<li><a href="#impl-Policy">Implementing a Policy</a> — you can choose one of the full implementations provided in the LVL or create your own.</li>
-<li><a href="#impl-Obfuscator">Implementing an Obfuscator</a>, if your {@code Policy} will cache any
-license response data. </li>
-<li><a href="#impl-lc">Adding code to check the license</a> in your application's main
-Activity.</li>
-<li><a href="#impl-DeviceLimiter">Implementing a DeviceLimiter</a> (optional and not recommended for
-most applications).</li>
-</ol>
-
-<p>The sections below describe these tasks. When you are done with the
-integration, you should be able to compile your application successfully and you
-can begin testing, as described in <a
-href="{@docRoot}guide/market/licensing/setting-up.html#test-env">Setting Up the Test
-Environment</a>.</p>
-
-<p>For an overview of the full set of source files included in the LVL, see <a
-href="{@docRoot}guide/market/licensing/licensing-reference.html#lvl-summary">Summary of LVL Classes
-and Interfaces</a>.</p>
-
-
-<h2 id="manifest-permission">Adding the Licensing Permission</h2>
-
-<p>To use the Google Play application for sending a license check to the
-server, your application must request the proper permission,
-<code>com.android.vending.CHECK_LICENSE</code>. If your application does
-not declare the licensing permission but attempts to initiate a license check,
-the LVL throws a security exception.</p>
-
-<p>To request the licensing permission in your application, declare a <a
-href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><code><uses-permission></code></a>
-element as a child of <code><manifest></code>, as follows: </p>
-
-<p style="margin-left:2em;"><code><uses-permission
-android:name="com.android.vending.CHECK_LICENSE"></code></p>
-
-<p>For example, here's how the LVL sample application declares the permission:
-</p>
-
-<pre><?xml version="1.0" encoding="utf-8"?>
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" ...">
- <!-- Devices >= 3 have version of Google Play that supports licensing. -->
- <uses-sdk android:minSdkVersion="3" />
- <!-- Required permission to check licensing. -->
- <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
- ...
-</manifest>
-</pre>
-
-<p class="note"><strong>Note:</strong> Currently, you cannot declare the
-<code>CHECK_LICENSE</code> permission in the LVL library project's manifest,
-because the SDK Tools will not merge it into the manifests of dependent
-applications. Instead, you must declare the permission in each dependent
-application's manifest. </p>
-
-
-<h2 id="impl-Policy">Implementing a Policy</h2>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>ServerManagedPolicy</h2>
-
-<p>The LVL includes a complete {@code Policy} implementation called ServerManagedPolicy
-that makes use of license-management settings provided by the Google Play
-server. </p>
-
-<p style="margin-top:.5em;">Use of ServerManagedPolicy as the basis for your
-Policy is strongly recommended. For more information, see <a
-href="#ServerManagedPolicy">ServerManagedPolicy</a> section, below.</p>
-
-</div>
-</div>
-
-<p>Google Play licensing service does not itself determine whether a
-given user with a given license should be granted access to your application.
-Rather, that responsibility is left to a {@code Policy} implementation that you provide
-in your application.</p>
-
-<p>Policy is an interface declared by the LVL that is designed to hold your
-application's logic for allowing or disallowing user access, based on the result
-of a license check. To use the LVL, your application <em>must</em> provide an
-implementation of {@code Policy}. </p>
-
-<p>The {@code Policy} interface declares two methods, <code>allowAccess()</code> and
-<code>processServerResponse()</code>, which are called by a {@code LicenseChecker}
-instance when processing a response from the license server. It also declares an
-enum called <code>LicenseResponse</code>, which specifies the license response
-value passed in calls to <code>processServerResponse()</code>. </p>
-
-<ul>
-<li><code>processServerResponse()</code> lets you preprocess the raw response
-data received from the licensing server, prior to determining whether to grant
-access.
-
-<p>A typical implementation would extract some or all fields from the license
-response and store the data locally to a persistent store, such as through
-{@link android.content.SharedPreferences} storage, to ensure that the data is
-accessible across application invocations and device power cycles. For example,
-a {@code Policy} would maintain the timestamp of the last successful license check, the
-retry count, the license validity period, and similar information in a
-persistent store, rather than resetting the values each time the application is
-launched.</p>
-
-<p>When storing response data locally, the {@code Policy} must ensure that the data is
-obfuscated (see <a href="#impl-Obfuscator">Implementing an Obfuscator</a>,
-below).</p></li>
-
-<li><code>allowAccess()</code> determines whether to grant the user access to
-your application, based on any available license response data (from the
-licensing server or from cache) or other application-specific information. For
-example, your implementation of <code>allowAccess()</code> could take into
-account additional criteria, such as usage or other data retrieved from a
-backend server. In all cases, an implementation of <code>allowAccess()</code>
-should only return <code>true</code> if the user is licensed to use the
-application, as determined by the licensing server, or if there is a transient
-network or system problem that prevents the license check from completing. In
-such cases, your implementation can maintain a count of retry responses and
-provisionally allow access until the next license check is complete.</li>
-
-</ul>
-
-<p>To simplify the process of adding licensing to your application and to
-provide an illustration of how a {@code Policy} should be designed, the LVL includes
-two full {@code Policy} implementations that you can use without modification or
-adapt to your needs:</p>
-
-<ul>
-<li><a href="#ServerManagedPolicy">ServerManagedPolicy</a>, a flexible {@code Policy}
-that uses server-provided settings and cached responses to manage access across
-varied network conditions, and</li>
-<li><a href="#StrictPolicy">StrictPolicy</a>, which does not cache any response
-data and allows access <em>only</em> if the server returns a licensed
-response.</li>
-</ul>
-
-<p>For most applications, the use of ServerManagedPolicy is highly
-recommended. ServerManagedPolicy is the LVL default and is integrated with
-the LVL sample application.</p>
-
-
-<h3 id="custom-policies">Guidelines for custom policies</h3>
-
-<p>In your licensing implementation, you can use one of the complete policies
-provided in the LVL (ServerManagedPolicy or StrictPolicy) or you can create a
-custom policy. For any type of custom policy, there are several important design
-points to understand and account for in your implementation.</p>
-
-<p>The licensing server applies general request limits to guard against overuse
-of resources that could result in denial of service. When an application exceeds
-the request limit, the licensing server returns a 503 response, which gets
-passed through to your application as a general server error. This means that no
-license response will be available to the user until the limit is reset, which
-can affect the user for an indefinite period.</p>
-
-<p>If you are designing a custom policy, we recommend that the {@code Policy}:
-<ol>
-<!-- <li>Limits the number of points at which your app calls for a license check
-to the minimum. </li> -->
-<li>Caches (and properly obfuscates) the most recent successful license response
-in local persistent storage.</li>
-<li>Returns the cached response for all license checks, for as long as the
-cached response is valid, rather than making a request to the licensing server.
-Setting the response validity according to the server-provided <code>VT</code>
-extra is highly recommended. See <a
-href="{@docRoot}guide/market/licensing/licensing-reference.html#extras">Server Response Extras</a>
-for more information.</li>
-<li>Uses an exponential backoff period, if retrying any requests the result in
-errors. Note that the Google Play client automatically retries failed
-requests, so in most cases there is no need for your {@code Policy} to retry them.</li>
-<li>Provides for a "grace period" that allows the user to access your
-application for a limited time or number of uses, while a license check is being
-retried. The grace period benefits the user by allowing access until the next
-license check can be completed successfully and it benefits you by placing a
-hard limit on access to your application when there is no valid license response
-available.</li>
-</ol>
-
-<p>Designing your {@code Policy} according to the guidelines listed above is critical,
-because it ensures the best possible experience for users while giving you
-effective control over your application even in error conditions. </p>
-
-<p>Note that any {@code Policy} can use settings provided by the licensing server to
-help manage validity and caching, retry grace period, and more. Extracting the
-server-provided settings is straightforward and making use of them is highly
-recommended. See the ServerManagedPolicy implementation for an example of how to
-extract and use the extras. For a list of server settings and information about
-how to use them, see <a
-href="{@docRoot}guide/market/licensing/licensing-reference.html#extras">Server Response
-Extras</a>.</p>
-
-<h3 id="ServerManagedPolicy">ServerManagedPolicy</h3>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>Server Response Extras</h2>
-
-<p>For certain types of licensing responses, the licensing server appends extra
-settings to the responses, to help the application manage licensing effectively.
-</p>
-
-<p style="margin-top:.5em;">See <a
-href="{@docRoot}guide/market/licensing/licensing-reference.html#extras">Server Response Extras</a>
-for
-a list of settings and <code>ServerManagedPolicy.java</code> for information
-about how a {@code Policy} can use the extras.</p>
-
-</div>
-</div>
-
-<p>The LVL includes a full and recommended implementation of the {@code Policy}
-interface called ServerManagedPolicy. The implementation is integrated with the
-LVL classes and serves as the default {@code Policy} in the library. </p>
-
-<p>ServerManagedPolicy provides all of the handling for license and retry
-responses. It caches all of the response data locally in a
-{@link android.content.SharedPreferences} file, obfuscating it with the
-application's {@code Obfuscator} implementation. This ensures that the license response
-data is secure and persists across device power cycles. ServerManagedPolicy
-provides concrete implementations of the interface methods
-<code>processServerResponse()</code> and <code>allowAccess()</code> and also
-includes a set of supporting methods and types for managing license
-responses.</p>
-
-<p>Importantly, a key feature of ServerMangedPolicy is its use of
-server-provided settings as the basis for managing licensing across an
-application's refund period and through varying network and error conditions.
-When an application contacts the Google Play server for a license check, the
-server appends several settings as key-value pairs in the extras field of certain
-license response types. For example, the server provides recommended values for the
-application's license validity period, retry grace period, and maximum allowable
-retry count, among others. ServerManagedPolicy extracts the values from the
-license response in its <code>processServerResponse()</code> method and checks
-them in its <code>allowAccess()</code> method. For a list of the server-provided
-settings used by ServerManagedPolicy, see <a
-href="{@docRoot}guide/market/licensing/licensing-reference.html#extras">Server Response
-Extras</a>.</p>
-
-<p>For convenience, best performance, and the benefit of using license settings
-from the Google Play server, <strong>using ServerManagedPolicy as your
-licensing {@code Policy} is strongly recommended</strong>. </p>
-
-<p>If you are concerned about the security of license response data that is
-stored locally in {@link android.content.SharedPreferences}, you can use a stronger obfuscation
-algorithm or design a stricter {@code Policy} that does not store license data. The LVL
-includes an example of such a {@code Policy} — see <a
-href="#StrictPolicy">StrictPolicy</a> for more information.</p>
-
-<p>To use ServerManagedPolicy, simply import it to your Activity, create an
-instance, and pass a reference to the instance when constructing your
-{@code LicenseChecker}. See <a href="#lc-lcc">Instantiate LicenseChecker and
-LicenseCheckerCallback</a> for more information. </p>
-
-<h3 id="StrictPolicy">StrictPolicy</h3>
-
-<p>The LVL includes an alternative full implementation of the {@code Policy} interface
-called StrictPolicy. The StrictPolicy implementation provides a more restrictive
-Policy than ServerManagedPolicy, in that it does not allow the user to access
-the application unless a license response is received from the server at the
-time of access that indicates that the user is licensed.</p>
-
-<p>The principal feature of StrictPolicy is that it does not store <em>any</em>
-license response data locally, in a persistent store. Because no data is stored,
-retry requests are not tracked and cached responses can not be used to fulfill
-license checks. The {@code Policy} allows access only if:</p>
-
-<ul>
-<li>The license response is received from the licensing server, and </li>
-<li>The license response indicates that the user is licensed to access the
-application. </li>
-</ul>
-
-<p>Using StrictPolicy is appropriate if your primary concern is to ensure that,
-in all possible cases, no user will be allowed to access the application unless
-the user is confirmed to be licensed at the time of use. Additionally, the
-Policy offers slightly more security than ServerManagedPolicy — since
-there is no data cached locally, there is no way a malicious user could tamper
-with the cached data and obtain access to the application.</p>
-
-<p>At the same time, this {@code Policy} presents a challenge for normal users, since it
-means that they won't be able to access the application when there is no network
-(cell or Wi-Fi) connection available. Another side-effect is that your
-application will send more license check requests to the server, since using a
-cached response is not possible.</p>
-
-<p>Overall, this policy represents a tradeoff of some degree of user convenience
-for absolute security and control over access. Consider the tradeoff carefully
-before using this {@code Policy}.</p>
-
-<p>To use StrictPolicy, simply import it to your Activity, create an instance,
-and pass a reference to it when constructing your {@code LicenseChecker}. See
-<a href="#lc-lcc">Instantiate LicenseChecker and LicenseCheckerCallback</a>
-for more information. </p>
-
-<h2 id="impl-Obfuscator">Implementing an Obfuscator</h2>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>AESObfuscator</h2>
-
-<p>The LVL includes a full {@code Obfuscator} implementation in the
-<code>AESObfuscator.java</code> file. The {@code Obfuscator} uses AES encryption to
-obfuscate/unobfuscate data. If you are using a {@code Policy} (such as
-ServerManagedPolicy) that caches license response data, using AESObfuscator as
-basis for your {@code Obfuscator} implementation is highly recommended. </p>
-
-</div>
-</div>
-
-<p>A typical {@code Policy} implementation needs to save the license response data for
-an application to a persistent store, so that it is accessible across
-application invocations and device power cycles. For example, a {@code Policy} would
-maintain the timestamp of the last successful license check, the retry count,
-the license validity period, and similar information in a persistent store,
-rather than resetting the values each time the application is launched. The
-default {@code Policy} included in the LVL, ServerManagedPolicy, stores license response
-data in a {@link android.content.SharedPreferences} instance, to ensure that the
-data is persistent. </p>
-
-<p>Because the {@code Policy} will use stored license response data to determine whether
-to allow or disallow access to the application, it <em>must</em> ensure that any
-stored data is secure and cannot be reused or manipulated by a root user on a
-device. Specifically, the {@code Policy} must always obfuscate the data before storing
-it, using a key that is unique for the application and device. Obfuscating using
-a key that is both application-specific and device-specific is critical, because
-it prevents the obfuscated data from being shared among applications and
-devices.</p>
-
-<p>The LVL assists the application with storing its license response data in a
-secure, persistent manner. First, it provides an {@code Obfuscator}
-interface that lets your application supply the obfuscation algorithm of its
-choice for stored data. Building on that, the LVL provides the helper class
-PreferenceObfuscator, which handles most of the work of calling the
-application's {@code Obfuscator} class and reading and writing the obfuscated data in a
-{@link android.content.SharedPreferences} instance. </p>
-
-<p>The LVL provides a full {@code Obfuscator} implementation called
-AESObfuscator that uses AES encryption to obfuscate data. You can
-use AESObfuscator in your application without modification or you
-can adapt it to your needs. For more information, see the next section.</p>
-
-
-<h3 id="AESObfuscator">AESObfuscator</h3>
-
-<p>The LVL includes a full and recommended implementation of the {@code Obfuscator}
-interface called AESObfuscator. The implementation is integrated with the
-LVL sample application and serves as the default {@code Obfuscator} in the library. </p>
-
-<p>AESObfuscator provides secure obfuscation of data by using AES to
-encrypt and decrypt the data as it is written to or read from storage.
-The {@code Obfuscator} seeds the encryption using three data fields provided
-by the application: </p>
-
-<ol>
-<li>A salt — an array of random bytes to use for each (un)obfuscation. </li>
-<li>An application identifier string, typically the package name of the application.</li>
-<li>A device identifier string, derived from as many device-specific sources
-as possible, so as to make it as unique.</li>
-</ol>
-
-<p>To use AESObfuscator, first import it to your Activity. Declare a private
-static final array to hold the salt bytes and initialize it to 20 randomly
-generated bytes.</p>
-
-<pre> ...
- // Generate 20 random bytes, and put them here.
- private static final byte[] SALT = new byte[] {
- -46, 65, 30, -128, -103, -57, 74, -64, 51, 88, -95,
- -45, 77, -117, -36, -113, -11, 32, -64, 89
- };
- ...
-</pre>
-
-<p>Next, declare a variable to hold a device identifier and generate a value for
-it in any way needed. For example, the sample application included in the LVL
-queries the system settings for the
-<code>android.Settings.Secure.ANDROID_ID</code>, which is unique to each device.
-</p>
-
-<p>Note that, depending on the APIs you use, your application might need to
-request additional permissions in order to acquire device-specific information.
-For example, to query the {@link android.telephony.TelephonyManager} to obtain
-the device IMEI or related data, the application will also need to request the
-<code>android.permission.READ_PHONE_STATE</code> permission in its manifest.</p>
-
-<p>Before requesting new permissions for the <em>sole purpose</em> of acquiring
-device-specific information for use in your {@code Obfuscator}, consider
-how doing so might affect your application or its filtering on Google Play
-(since some permissions can cause the SDK build tools to add
-the associated <code><uses-feature></code>).</p>
-
-<p>Finally, construct an instance of AESObfuscator, passing the salt,
-application identifier, and device identifier. You can construct the instance
-directly, while constructing your {@code Policy} and {@code LicenseChecker}. For example:</p>
-
-<pre> ...
- // Construct the LicenseChecker with a Policy.
- mChecker = new LicenseChecker(
- this, new ServerManagedPolicy(this,
- new AESObfuscator(SALT, getPackageName(), deviceId)),
- BASE64_PUBLIC_KEY // Your public licensing key.
- );
- ...
-</pre>
-
-<p>For a complete example, see MainActivity in the LVL sample application.</p>
-
-
-<h2 id="impl-lc">Checking the License from an Activity</h2>
-
-<p>Once you've implemented a {@code Policy} for managing access to your application, the
-next step is to add a license check to your application, which initiates a query
-to the licensing server if needed and manages access to the application based on
-the license response. All of the work of adding the license check and handling
-the response takes place in your main {@link android.app.Activity} source file.
-</p>
-
-<p>To add the license check and handle the response, you must:</p>
-
-<ol>
- <li><a href="#imports">Add imports</a></li>
- <li><a href="#lc-impl">Implement LicenseCheckerCallback</a> as a private inner class</li>
- <li><a href="#thread-handler">Create a Handler</a> for posting from LicenseCheckerCallback to the UI thread</li>
- <li><a href="#lc-lcc">Instantiate LicenseChecker</a> and LicenseCheckerCallback</li>
- <li><a href="#check-access">Call checkAccess()</a> to initiate the license check</li>
- <li><a href="#account-key">Embed your public key</a> for licensing</li>
- <li><a href="#handler-cleanup">Call your LicenseChecker's onDestroy() method</a> to close IPC connections.</li>
-</ol>
-
-<p>The sections below describe these tasks. </p>
-
-<h3 id="lc-overview">Overview of license check and response</h3>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>Example: MainActivity</h2>
-
-<p>The sample application included with the LVL provides a full example of how
-to initiate a license check and handle the result, in the
-<code>MainActivity.java</code> file.</p>
-
-</div>
-</div>
-
-<p>In most cases, you should add the license check to your application's main
-{@link android.app.Activity}, in the {@link android.app.Activity#onCreate onCreate()} method. This
-ensures that when the user launches your application directly, the license check
-will be invoked immediately. In some cases, you can add license checks in other
-locations as well. For example, if your application includes multiple Activity
-components that other applications can start by {@link android.content.Intent},
-you could add license checks in those Activities.</p>
-
-<p>A license check consists of two main actions: </p>
-
-<ul>
-<li>A call to a method to initiate the license check — in the LVL, this is
-a call to the <code>checkAccess()</code> method of a {@code LicenseChecker} object that
-you construct.</li>
-<li>A callback that returns the result of the license check. In the LVL, this is
-a <code>LicenseCheckerCallback</code> interface that you implement. The
-interface declares two methods, <code>allow()</code> and
-<code>dontAllow()</code>, which are invoked by the library based on to the
-result of the license check. You implement these two methods with whatever logic
-you need, to allow or disallow the user access to your application. Note that
-these methods do not determine <em>whether</em> to allow access — that
-determination is the responsibility of your {@code Policy} implementation. Rather, these
-methods simply provide the application behaviors for <em>how</em> to allow and
-disallow access (and handle application errors).
- <p>The <code>allow()</code> and <code>dontAllow()</code> methods do provide a "reason"
-for their response, which can be one of the {@code Policy} values, {@code LICENSED},
-{@code NOT_LICENSED}, or {@code RETRY}. In particular, you should handle the case in which
-the method receives the {@code RETRY} response for {@code dontAllow()} and provide the user with an
-"Retry" button, which might have happened because the service was unavailable during the
-request.</p></li>
-</ul>
-
-<div style="margin-bottom:2em;">
-
-<img src="{@docRoot}images/licensing_flow.png" style="text-align:left;margin-bottom:0;margin-left:3em;" />
-<div style="margin:.5em 0 1.5em 2em;padding:0"><strong>Figure 6.</strong> Overview of a
-typical license check interaction.</div>
-</div>
-
-<p>The diagram above illustrates how a typical license check takes place: </p>
-
-<ol>
-<li>Code in the application's main Activity instantiates {@code LicenseCheckerCallback}
-and {@code LicenseChecker} objects. When constructing {@code LicenseChecker}, the code passes in
-{@link android.content.Context}, a {@code Policy} implementation to use, and the
-publisher account's public key for licensing as parameters. </li>
-<li>The code then calls the <code>checkAccess()</code> method on the
-{@code LicenseChecker} object. The method implementation calls the {@code Policy} to determine
-whether there is a valid license response cached locally, in
-{@link android.content.SharedPreferences}.
- <ul>
- <li>If so, the <code>checkAccess()</code> implementation calls
- <code>allow()</code>.</li>
- <li>Otherwise, the {@code LicenseChecker} initiates a license check request that is sent
- to the licensing server.</li>
- </ul>
-
-<p class="note"><strong>Note:</strong> The licensing server always returns
-<code>LICENSED</code> when you perform a license check of a draft application.</p>
-</li>
-<li>When a response is received, {@code LicenseChecker} creates a LicenseValidator that
-verifies the signed license data and extracts the fields of the response, then
-passes them to your {@code Policy} for further evaluation.
- <ul>
- <li>If the license is valid, the {@code Policy} caches the response in
-{@link android.content.SharedPreferences} and notifies the validator, which then calls the
-<code>allow()</code> method on the {@code LicenseCheckerCallback} object. </li>
- <li>If the license not valid, the {@code Policy} notifies the validator, which calls
-the <code>dontAllow()</code> method on {@code LicenseCheckerCallback}. </li>
- </ul>
-</li>
-<li>In case of a recoverable local or server error, such as when the network is
-not available to send the request, {@code LicenseChecker} passes a {@code RETRY} response to
-your {@code Policy} object's <code>processServerResponse()</code> method.
- <p>Also, both the {@code allow()} and {@code dontAllow()} callback methods receive a
-<code>reason</code> argument. The {@code allow()} method's reason is usually {@code
-Policy.LICENSED} or {@code Policy.RETRY} and the {@code dontAllow()} reason is usually {@code
-Policy.NOT_LICENSED} or {@code Policy.RETRY}. These response values are useful so you can show
-an appropriate response for the user, such as by providing a "Retry" button when {@code
-dontAllow()} responds with {@code Policy.RETRY}, which might have been because the service was
-unavailable.</p></li>
-<li>In case of a application error, such as when the application attempts to
-check the license of an invalid package name, {@code LicenseChecker} passes an error
-response to the LicenseCheckerCallback's <code>applicationError()</code>
-method. </li>
-</ol>
-
-<p>Note that, in addition to initiating the license check and handling the
-result, which are described in the sections below, your application also needs
-to provide a <a href="#impl-Policy">Policy implementation</a> and, if the {@code Policy}
-stores response data (such as ServerManagedPolicy), an <a
-href="#impl-Obfuscator">Obfuscator</a> implementation. </p>
-
-
-<h3 id="imports">Add imports</h3>
-
-<p>First, open the class file of the application's main Activity and import
-{@code LicenseChecker} and {@code LicenseCheckerCallback} from the LVL package.</p>
-
-<pre> import com.android.vending.licensing.LicenseChecker;
- import com.android.vending.licensing.LicenseCheckerCallback;</pre>
-
-<p>If you are using the default {@code Policy} implementation provided with the LVL,
-ServerManagedPolicy, import it also, together with the AESObfuscator. If you are
-using a custom {@code Policy} or {@code Obfuscator}, import those instead. </p>
-
-<pre> import com.android.vending.licensing.ServerManagedPolicy;
- import com.android.vending.licensing.AESObfuscator;</pre>
-
-<h3 id="lc-impl">Implement LicenseCheckerCallback as a private inner class</h3>
-
-<p>{@code LicenseCheckerCallback} is an interface provided by the LVL for handling
-result of a license check. To support licensing using the LVL, you must
-implement {@code LicenseCheckerCallback} and
-its methods to allow or disallow access to the application.</p>
-
-<p>The result of a license check is always a call to one of the
-{@code LicenseCheckerCallback} methods, made based on the validation of the response
-payload, the server response code itself, and any additional processing provided
-by your {@code Policy}. Your application can implement the methods in any way needed. In
-general, it's best to keep the methods simple, limiting them to managing UI
-state and application access. If you want to add further processing of license
-responses, such as by contacting a backend server or applying custom constraints,
-you should consider incorporating that code into your {@code Policy}, rather than
-putting it in the {@code LicenseCheckerCallback} methods. </p>
-
-<p>In most cases, you should declare your implementation of
-{@code LicenseCheckerCallback} as a private class inside your application's main
-Activity class. </p>
-
-<p>Implement the <code>allow()</code> and <code>dontAllow()</code> methods as
-needed. To start with, you can use simple result-handling behaviors in the
-methods, such as displaying the license result in a dialog. This helps you get
-your application running sooner and can assist with debugging. Later, after you
-have determined the exact behaviors you want, you can add more complex handling.
-</p>
-
-<p>Some suggestions for handling unlicensed responses in
-<code>dontAllow()</code> include: </p>
-
-<ul>
-<li>Display a "Try again" dialog to the user, including a button to initiate a
-new license check if the <code>reason</code> supplied is {@code Policy.RETRY}. </li>
-<li>Display a "Purchase this application" dialog, including a button that
-deep-links the user to the application's details page on Google Play, from which the
-use can purchase the application. For more information on how to set up such
-links, see <a
-href="{@docRoot}guide/publishing/publishing.html#marketintent">Linking to your apps
-on Google Play</a>. </li>
-<li>Display a Toast notification that indicates that the features of the
-application are limited because it is not licensed. </li>
-</ul>
-
-<p>The example below shows how the LVL sample application implements
-{@code LicenseCheckerCallback}, with methods that display the license check result in a
-dialog. </p>
-
-<pre>
-private class MyLicenseCheckerCallback implements LicenseCheckerCallback {
- public void allow(int reason) {
- if (isFinishing()) {
- // Don't update UI if Activity is finishing.
- return;
- }
- // Should allow user access.
- displayResult(getString(R.string.allow));
- }
-
- public void dontAllow(int reason) {
- if (isFinishing()) {
- // Don't update UI if Activity is finishing.
- return;
- }
- displayResult(getString(R.string.dont_allow));
-
- if (reason == Policy.RETRY) {
- // If the reason received from the policy is RETRY, it was probably
- // due to a loss of connection with the service, so we should give the
- // user a chance to retry. So show a dialog to retry.
- showDialog(DIALOG_RETRY);
- } else {
- // Otherwise, the user is not licensed to use this app.
- // Your response should always inform the user that the application
- // is not licensed, but your behavior at that point can vary. You might
- // provide the user a limited access version of your app or you can
- // take them to Google Play to purchase the app.
- showDialog(DIALOG_GOTOMARKET);
- }
- }
-}
-</pre>
-
-<p>Additionally, you should implement the <code>applicationError()</code>
-method, which the LVL calls to let your application handle errors that are not
-retryable. For a list of such errors, see <a
-href="{@docRoot}guide/market/licensing/licensing-reference.html#server-response-codes">Server
-Response Codes</a> in the <a
-href="guide/market/licensing/licensing-reference.html">Licensing Reference</a>. You can implement
-the method in any way needed. In most cases, the
-method should log the error code and call <code>dontAllow()</code>.</p>
-
-<h3 id="thread-handler">Create a Handler for posting from LicenseCheckerCallback
-to the UI thread</h3>
-
-<p>During a license check, the LVL passes the request to the Google Play
-application, which handles communication with the licensing server. The LVL
-passes the request over asynchronous IPC (using {@link android.os.Binder}) so
-the actual processing and network communication do not take place on a thread
-managed by your application. Similarly, when the Google Play application
-receives the result, it invokes a callback method over IPC, which in turn
-executes in an IPC thread pool in your application's process.</p>
-
-<p>The {@code LicenseChecker} class manages your application's IPC communication with
-the Google Play application, including the call that sends the request and
-the callback that receives the response. {@code LicenseChecker} also tracks open license
-requests and manages their timeouts. </p>
-
-<p>So that it can handle timeouts properly and also process incoming responses
-without affecting your application's UI thread, {@code LicenseChecker} spawns a
-background thread at instantiation. In the thread it does all processing of
-license check results, whether the result is a response received from the server
-or a timeout error. At the conclusion of processing, the LVL calls your
-{@code LicenseCheckerCallback} methods from the background thread. </p>
-
-<p>To your application, this means that:</p>
-
-<ol>
-<li>Your {@code LicenseCheckerCallback} methods will be invoked, in many cases, from a
-background thread.</li>
-<li>Those methods won't be able to update state or invoke any processing in the
-UI thread, unless you create a Handler in the UI thread and have your callback
-methods post to the Handler.</li>
-</ol>
-
-<p>If you want your {@code LicenseCheckerCallback} methods to update the UI thread,
-instantiate a {@link android.os.Handler} in the main Activity's
-{@link android.app.Activity#onCreate(android.os.Bundle) onCreate()} method,
-as shown below. In this example, the LVL sample application's
-{@code LicenseCheckerCallback} methods (see above) call <code>displayResult()</code> to
-update the UI thread through the Handler's
-{@link android.os.Handler#post(java.lang.Runnable) post()} method.</p>
-
-<pre>private Handler mHandler;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- ...
- mHandler = new Handler();
- }
-</pre>
-
-<p>Then, in your {@code LicenseCheckerCallback} methods, you can use Handler methods to
-post Runnable or Message objects to the Handler. Here's how the sample
-application included in the LVL posts a Runnable to a Handler in the UI thread
-to display the license status.</p>
-
-<pre> private void displayResult(final String result) {
- mHandler.post(new Runnable() {
- public void run() {
- mStatusText.setText(result);
- setProgressBarIndeterminateVisibility(false);
- mCheckLicenseButton.setEnabled(true);
- }
- });
- }
-</pre>
-
-<h3 id="lc-lcc">Instantiate LicenseChecker and LicenseCheckerCallback</h3>
-
-<p>In the main Activity's
-{@link android.app.Activity#onCreate(android.os.Bundle) onCreate()} method,
-create private instances of LicenseCheckerCallback and {@code LicenseChecker}. You must
-instantiate {@code LicenseCheckerCallback} first, because you need to pass a reference
-to that instance when you call the constructor for {@code LicenseChecker}. </p>
-
-<p>When you instantiate {@code LicenseChecker}, you need to pass in these parameters:</p>
-
-<ul>
-<li>The application {@link android.content.Context}</li>
-<li>A reference to the {@code Policy} implementation to use for the license check. In
-most cases, you would use the default {@code Policy} implementation provided by the LVL,
-ServerManagedPolicy. </li>
-<li>The String variable holding your publisher account's public key for
-licensing. </li>
-</ul>
-
-<p>If you are using ServerManagedPolicy, you won't need to access the class
-directly, so you can instantiate it in the {@code LicenseChecker} constructor,
-as shown in the example below. Note that you need to pass a reference to a new
-Obfuscator instance when you construct ServerManagedPolicy.</p>
-
-<p>The example below shows the instantiation of {@code LicenseChecker} and
-{@code LicenseCheckerCallback} from the <code>onCreate()</code> method of an Activity
-class. </p>
-
-<pre>public class MainActivity extends Activity {
- ...
- private LicenseCheckerCallback mLicenseCheckerCallback;
- private LicenseChecker mChecker;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- ...
- // Construct the LicenseCheckerCallback. The library calls this when done.
- mLicenseCheckerCallback = new MyLicenseCheckerCallback();
-
- // Construct the LicenseChecker with a Policy.
- mChecker = new LicenseChecker(
- this, new ServerManagedPolicy(this,
- new AESObfuscator(SALT, getPackageName(), deviceId)),
- BASE64_PUBLIC_KEY // Your public licensing key.
- );
- ...
- }
-}
-</pre>
-
-
-<p>Note that {@code LicenseChecker} calls the {@code LicenseCheckerCallback} methods from the UI
-thread <em>only</em> if there is valid license response cached locally. If the
-license check is sent to the server, the callbacks always originate from the
-background thread, even for network errors. </p>
-
-
-<h3 id="check-access">Call checkAccess() to initiate the license check</h3>
-
-<p>In your main Activity, add a call to the <code>checkAccess()</code> method of the
-{@code LicenseChecker} instance. In the call, pass a reference to your
-{@code LicenseCheckerCallback} instance as a parameter. If you need to handle any
-special UI effects or state management before the call, you might find it useful
-to call <code>checkAccess()</code> from a wrapper method. For example, the LVL
-sample application calls <code>checkAccess()</code> from a
-<code>doCheck()</code> wrapper method:</p>
-
-<pre> @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- ...
- // Call a wrapper method that initiates the license check
- doCheck();
- ...
- }
- ...
- private void doCheck() {
- mCheckLicenseButton.setEnabled(false);
- setProgressBarIndeterminateVisibility(true);
- mStatusText.setText(R.string.checking_license);
- mChecker.checkAccess(mLicenseCheckerCallback);
- }
-</pre>
-
-
-<h3 id="account-key">Embed your public key for licensing</h3>
-
-<p>For each publisher account, the Google Play service automatically
-generates a 2048-bit RSA public/private key pair that is used exclusively for
-licensing. The key pair is uniquely associated with the publisher account and is
-shared across all applications that are published through the account. Although
-associated with a publisher account, the key pair is <em>not</em> the same as
-the key that you use to sign your applications (or derived from it).</p>
-
-<p>The Google Play publisher site exposes the public key for licensing to any
-developer signed in to the publisher account, but it keeps the private key
-hidden from all users in a secure location. When an application requests a
-license check for an application published in your account, the licensing server
-signs the license response using the private key of your account's key pair.
-When the LVL receives the response, it uses the public key provided by the
-application to verify the signature of the license response. </p>
-
-<p>To add licensing to an application, you must obtain your publisher account's
-public key for licensing and copy it into your application. Here's how to find
-your account's public key for licensing:</p>
-
-<ol>
-<li>Go to the Google Play <a
-href="http://play.google.com/apps/publish">publisher site</a> and sign in.
-Make sure that you sign in to the account from which the application you are
-licensing is published (or will be published). </li>
-<li>In the account home page, locate the "Edit profile" link and click it. </li>
-<li>In the Edit Profile page, locate the "Licensing" pane, shown below. Your
-public key for licensing is given in the "Public key" text box. </li>
-</ol>
-
-<p>To add the public key to your application, simply copy/paste the key string
-from the text box into your application as the value of the String variable
-<code>BASE64_PUBLIC_KEY</code>. When you are copying, make sure that you have
-selected the entire key string, without omitting any characters. </p>
-
-<p>Here's an example from the LVL sample application:</p>
-
-<pre> public class MainActivity extends Activity {
- private static final String BASE64_PUBLIC_KEY = "MIIBIjANBgkqhkiG ... "; //truncated for this example
- ...
- }
-</pre>
-
-<h3 id="handler-cleanup">Call your LicenseChecker's onDestroy() method
-to close IPC connections</h3>
-
-<p>Finally, to let the LVL clean up before your application
-{@link android.content.Context} changes, add a call to the {@code LicenseChecker}'s
-<code>onDestroy()</code> method from your Activity's
-{@link android.app.Activity#onDestroy()} implementation. The call causes the
-{@code LicenseChecker} to properly close any open IPC connection to the Google Play
-application's ILicensingService and removes any local references to the service
-and handler.</p>
-
-<p>Failing to call the {@code LicenseChecker}'s <code>onDestroy()</code> method
-can lead to problems over the lifecycle of your application. For example, if the
-user changes screen orientation while a license check is active, the application
-{@link android.content.Context} is destroyed. If your application does not
-properly close the {@code LicenseChecker}'s IPC connection, your application will crash
-when the response is received. Similarly, if the user exits your application
-while a license check is in progress, your application will crash when the
-response is received, unless it has properly called the
-{@code LicenseChecker}'s <code>onDestroy()</code> method to disconnect from the service.
-</p>
-
-<p>Here's an example from the sample application included in the LVL, where
-<code>mChecker</code> is the {@code LicenseChecker} instance:</p>
-
-<pre> @Override
- protected void onDestroy() {
- super.onDestroy();
- mChecker.onDestroy();
- ...
- }
-</pre>
-
-<p>If you are extending or modifying {@code LicenseChecker}, you might also need to call
-the {@code LicenseChecker}'s <code>finishCheck()</code> method, to clean up any open IPC
-connections.</p>
-
-<h2 id="impl-DeviceLimiter">Implementing a DeviceLimiter</h2>
-
-<p>In some cases, you might want your {@code Policy} to limit the number of actual
-devices that are permitted to use a single license. This would prevent a user
-from moving a licensed application onto a number of devices and using the
-application on those devices under the same account ID. It would also prevent a
-user from "sharing" the application by providing the account information
-associated with the license to other individuals, who could then sign in to that
-account on their devices and access the license to the application. </p>
-
-<p>The LVL supports per-device licensing by providing a
-<code>DeviceLimiter</code> interface, which declares a single method,
-<code>allowDeviceAccess()</code>. When a LicenseValidator is handling a response
-from the licensing server, it calls <code>allowDeviceAccess()</code>, passing a
-user ID string extracted from the response.</p>
-
-<p>If you do not want to support device limitation, <strong>no work is
-required</strong> — the {@code LicenseChecker} class automatically uses a default
-implementation called NullDeviceLimiter. As the name suggests, NullDeviceLimiter
-is a "no-op" class whose <code>allowDeviceAccess()</code> method simply returns
-a <code>LICENSED</code> response for all users and devices. </p>
-
-<div style="border-left:4px solid #FFCF00;margin:1em;padding: 0 0 0 .5em">
-<p><strong>Caution:</strong> Per-device licensing is <em>not recommended for
-most applications</em> because:</p>
-<ul>
-<li>It requires that you provide a backend server to manage a users and devices
-mapping, and </li>
-<li>It could inadvertently result in a user being denied access to an
-application that they have legitimately purchased on another device.</li>
-</ul>
-</div>
-
-
-
-
-
-
-
-
-
-
-
-<h2 id="app-obfuscation">Obfuscating Your Code</h2>
-
-<p>To ensure the security of your application, particularly for a paid
-application that uses licensing and/or custom constraints and protections, it's
-very important to obfuscate your application code. Properly obfuscating your
-code makes it more difficult for a malicious user to decompile the application's
-bytecode, modify it — such as by removing the license check —
-and then recompile it.</p>
-
-<p>Several obfuscator programs are available for Android applications, including
-<a href="http://proguard.sourceforge.net/">ProGuard</a>, which also offers
-code-optimization features. The use of ProGuard or a similar program to obfuscate
-your code is <em>strongly recommended</em> for all applications that use Google
-Play Licensing. </p>
-
-<h2 id="app-publishing">Publishing a Licensed Application</h2>
-
-<p>When you are finished testing your license implementation, you are ready to
-publish the application on Google Play. Follow the normal steps to <a
-href="{@docRoot}guide/publishing/preparing.html">prepare</a>, <a
-href="{@docRoot}guide/publishing/app-signing.html">sign</a>, and then <a
-href="{@docRoot}guide/publishing/publishing.html">publish the application</a>.
-</p>
-
-<h3>Removing Copy Protection</h3>
-
-<p>After uploading your licensed application, remember to remove copy protection
-from the application, if it is currently used. To check and remove copy
-protection, sign in to the publisher site and go the application's upload
-details page. In the Publishing options section, make sure that the Copy
-Protection radio button selection is "Off".</p>
-
-
-<h2 id="support">Where to Get Support</h2>
-
-<p>If you have questions or encounter problems while implementing or deploying
-publishing in your applications, please use the support resources listed in the
-table below. By directing your queries to the correct forum, you can get the
-support you need more quickly. </p>
-
-<p class="table-caption"><strong>Table 2.</strong> Developer support resources
-for Google Play Licensing Service.</p>
-
-<table>
-
-<tr>
-<th>Support Type</th>
-<th>Resource</th>
-<th>Range of Topics</th>
-</tr>
-<tr>
-<td rowspan="2">Development and testing issues</td>
-<td>Google Groups: <a
-href="http://groups.google.com/group/android-developers">android-developers</a>
-</td>
-<td rowspan="2">LVL download and integration, library projects, {@code Policy}
-questions, user experience ideas, handling of responses, {@code Obfuscator}, IPC, test
-environment setup</td>
-</tr>
-<tr>
-<td>Stack Overflow: <a
-href="http://stackoverflow.com/questions/tagged/android">http://stackoverflow.com/questions/tagged/android</a></td>
-</tr>
-<tr>
-<td rowspan="2">Accounts, publishing, and deployment issues</td>
-<td><a href="http://www.google.com/support/forum/p/Android+Market">Google Play
-Help Forum</a></td>
-<td rowspan="2">Publisher accounts, licensing key pair, test accounts, server
-responses, test responses, application deployment and results</td>
-</tr>
-<tr>
-<td><a
-href="http://market.android.com/support/bin/answer.py?answer=186113">Market
-Licensing Support FAQ</a></td>
-</tr>
-<tr>
-<td>LVL issue tracker</td>
-<td><a href="http://code.google.com/p/marketlicensing/issues/">Marketlicensing
-project issue tracker</a></td>
-<td>Bug and issue reports related specifically to the LVL source code classes
-and interface implementations</td>
-</tr>
-
-</table>
-
-<p>For general information about how to post to the groups listed above, see <a
-href="{@docRoot}resources/community-groups.html">Developer Forums</a> document
-in the Resources tab.</p>
-
-
diff --git a/docs/html/guide/market/licensing/index.jd b/docs/html/guide/market/licensing/index.jd
deleted file mode 100644
index 1f15303..0000000
--- a/docs/html/guide/market/licensing/index.jd
+++ /dev/null
@@ -1,61 +0,0 @@
-page.title=Application Licensing
-@jd:body
-
-
-<p>Google Play offers a licensing service that lets you enforce licensing policies for
-applications that you publish on Google Play. With Google Play Licensing, your application can
-query Google Play at run time to obtain the licensing status for the current user, then allow or
-disallow further use as appropriate. </p>
-
-<p>Using the service, you can apply a flexible licensing policy on an application-by-application
-basis—each application can enforce licensing in the way most appropriate for it. If necessary,
-an application can apply custom constraints based on the licensing status obtained from Google Play.
-For example, an application can check the licensing status and then apply custom constraints
-that allow the user to run it unlicensed for a specific validity period. An application can also
-restrict use of the application to a specific device, in addition to any other constraints. </p>
-
-<p>The licensing service is a secure means of controlling access to your applications. When an
-application checks the licensing status, the Google Play server signs the licensing status
-response using a key pair that is uniquely associated with the publisher account. Your application
-stores the public key in its compiled <code>.apk</code> file and uses it to verify the licensing
-status response.</p>
-
-<p>Any application that you publish through Google Play can use the Google Play Licensing
-service. No special account or registration is needed. Additionally, because the service uses no
-dedicated framework APIs, you can add licensing to any application that uses a minimum API level of
-3 or higher.</p>
-
-<p class="note"><strong>Note:</strong> The Google Play Licensing service is primarily intended
-for paid applications that wish to verify that the current user did in fact pay for the application
-on Google Play. However, any application (including free apps) may use the licensing service
-to initiate the download of an APK expansion file. In which case, the request that your application
-sends to the licensing service is not to check whether the user paid for the app, but to request the
-URL of the expansion files. For information about downloading expansion files for your application,
-read the guide to <a href="{@docRoot}guide/market/expansion-files.html">APK Expansion Files</a>.</p>
-
-
-<p>To learn more about Google Play's application licensing service and start integrating it into
-your applications, read the following documents:</p>
-
-<dl>
- <dt><strong><a href="{@docRoot}guide/market/licensing/overview.html">Licensing
-Overview</a></strong></dt>
- <dd>Describes how the service works and what a typical licensing implementation looks
-like.</dd>
- <dt><strong><a href="{@docRoot}guide/market/licensing/setting-up.html">Setting Up for
-Licensing</a></strong></dt>
- <dd>Explains how to set up your Google Play account, development environment, and
-testing environment in order to add licensing to your app.</dd>
- <dt><strong><a href="{@docRoot}guide/market/licensing/adding-licensing.html">Adding
-Licensing to Your App</a></strong></dt>
- <dd>Provides a step-by-step guide to add licensing verification to your application.</dd>
- <dt><strong><a href="{@docRoot}guide/market/licensing/licensing-reference.html">Licensing
-Reference</a></strong></dt>
- <dd>Provides detailed information about the licensing library's classes and the service response
-codes.</dd>
-</dl>
-
-
-
-
-
diff --git a/docs/html/guide/market/licensing/licensing-reference.jd b/docs/html/guide/market/licensing/licensing-reference.jd
deleted file mode 100644
index 0a7e033..0000000
--- a/docs/html/guide/market/licensing/licensing-reference.jd
+++ /dev/null
@@ -1,439 +0,0 @@
-page.title=Licensing Reference
-parent.title=Application Licensing
-parent.link=index.html
-@jd:body
-
-
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#lvl-summary">LVL Classes and Interfaces</a></li>
- <li><a href="#server-response-codes">Server Response Codes</a></li>
- <li><a href="#extras">Server Response Extras</a></li>
- </ol>
-
-</div>
-</div>
-
-
-<h2 id="lvl-summary">LVL Classes and Interfaces</h2>
-
-<p>Table 1 lists all of the source files in the License Verification
-Library (LVL) available through the Android SDK. All of the files are part of
-the <code>com.android.vending.licensing</code> package.</p>
-
-<p class="table-caption"><strong>Table 1.</strong> Summary of LVL library
-classes and interfaces.</p>
-
-<div style="width:99%">
-<table width="100%">
-
-<tr>
-<th width="15%">Category</th>
-<th width="20%">Name</th>
-<th width="100%">Description</th>
-</tr>
-
-<tr>
-<td rowspan="2">License check and result</td>
-<td>LicenseChecker</td>
-<td>Class that you instantiate (or subclass) to initiate a license check.</td>
-</tr>
-<tr>
-<td><em>LicenseCheckerCallback</em></td>
-<td>Interface that you implement to handle result of the license check.</td>
-</tr>
-
-<tr>
-<td rowspan="3" width="15%">Policy</td>
-<td width="20%"><em>Policy</em></td>
-<td width="100%">Interface that you implement to determine whether to allow
-access to the application, based on the license response. </td>
-</tr>
-<tr>
-<td>ServerManagedPolicy</td>
-<td width="100%">Default {@code Policy} implementation. Uses settings provided by the
-licensing server to manage local storage of license data, license validity,
-retry.</td>
-</tr>
-<tr>
-<td>StrictPolicy</td>
-<td>Alternative {@code Policy} implementation. Enforces licensing based on a direct
-license response from the server only. No caching or request retry.</td>
-</tr>
-
-<tr>
-<td rowspan="2" width="15%">Data obfuscation <br><em>(optional)</em></td>
-<td width="20%"><em>Obfuscator</em></td>
-<td width="100%">Interface that you implement if you are using a {@code Policy} (such as
-ServerManagedPolicy) that caches license response data in a persistent store.
-Applies an obfuscation algorithm to encode and decode data being written or
-read.</td>
-</tr>
-<tr>
-<td>AESObfuscator</td>
-<td>Default Obfuscator implementation that uses AES encryption/decryption
-algorithm to obfuscate/unobfuscate data.</td>
-</tr>
-
-<tr>
-<td rowspan="2" width="15%">Device limitation<br><em>(optional)</em></td>
-<td width="20%"><em>DeviceLimiter</em></td>
-<td width="100%">Interface that you implement if you want to restrict use of an
-application to a specific device. Called from LicenseValidator. Implementing
-DeviceLimiter is not recommended for most applications because it requires a
-backend server and may cause the user to lose access to licensed applications,
-unless designed with care.</td>
-</tr>
-<tr>
-<td>NullDeviceLimiter</td>
-<td>Default DeviceLimiter implementation that is a no-op (allows access to all
-devices).</td>
-</tr>
-
-<tr>
-<td rowspan="6" width="15%">Library core, no integration needed</td>
-<td width="20%">ResponseData</td>
-<td width="100%">Class that holds the fields of a license response.</td>
-</tr>
-<tr>
-<td>LicenseValidator</td>
-<td>Class that decrypts and verifies a response received from the licensing
-server.</td>
-</tr>
-<tr>
-<td>ValidationException</td>
-<td>Class that indicates errors that occur when validating the integrity of data
-managed by an Obfuscator.</td>
-</tr>
-<tr>
-<td>PreferenceObfuscator</td>
-<td>Utility class that writes/reads obfuscated data to the system's
-{@link android.content.SharedPreferences} store.</td>
-</tr>
-<tr>
-<td><em>ILicensingService</em></td>
-<td>One-way IPC interface over which a license check request is passed to the
-Google Play client.</td>
-</tr>
-<tr>
-<td><em>ILicenseResultListener</em></td>
-<td>One-way IPC callback implementation over which the application receives an
-asynchronous response from the licensing server.</td>
-</tr>
-
-</table>
-</div>
-
-
-<h2 id="server-response-codes">Server Response Codes</h2>
-
-<p>Table 2 lists all of the license response codes supported by the
-licensing server. In general, an application should handle all of these response
-codes. By default, the LicenseValidator class in the LVL provides all of the
-necessary handling of these response codes for you. </p>
-
-<p class="table-caption"><strong>Table 2.</strong> Summary of response codes
-returned by the Google Play server in a license response.</p>
-
-<table>
-
-<tr>
-<th>Response Code</th>
-<th>Description</th>
-<th>Signed?</th>
-<th>Extras</th>
-<th>Comments</th>
-</tr>
-<tr>
-<td>{@code LICENSED}</td>
-<td>The application is licensed to the user. The user has purchased the
-application or the application only exists as a draft.</td>
-<td>Yes</td>
-<td><code>VT</code>, <code>GT</code>, <code>GR</code></td>
-<td><em>Allow access according to {@code Policy} constraints.</em></td>
-</tr>
-<tr>
-<td>{@code LICENSED_OLD_KEY}</td>
-<td>The application is licensed to the user, but there is an updated application
-version available that is signed with a different key. </td>
-<td>Yes </td>
-<td><code>VT</code>, <code>GT</code>, <code>GR</code>, <code>UT</code></td>
-<td><em>Optionally allow access according to {@code Policy} constraints.</em>
-<p style="margin-top:.5em;">Can indicate that the key pair used by the installed
-application version is invalid or compromised. The application can allow access
-if needed or inform the user that an upgrade is available and limit further use
-until upgrade.</p>
-</td>
-</tr>
-<tr>
-<td>{@code NOT_LICENSED}</td>
-<td>The application is not licensed to the user.</td>
-<td>No</td>
-<td></td>
-<td><em>Do not allow access.</em></td>
-</tr>
-<tr>
-<td>{@code ERROR_CONTACTING_SERVER}</td>
-<td>Local error — the Google Play application was not able to reach the
-licensing server, possibly because of network availability problems. </td>
-<td>No</td>
-<td></td>
-<td><em>Retry the license check according to {@code Policy} retry limits.</em></td>
-</tr>
-<tr>
-<td>{@code ERROR_SERVER_FAILURE}</td>
-<td>Server error — the server could not load the publisher account's key
-pair for licensing.</td>
-<td>No</td>
-<td></td>
-<td><em>Retry the license check according to {@code Policy} retry limits.</em>
-</td>
-</tr>
-<tr>
-<td>{@code ERROR_INVALID_PACKAGE_NAME}</td>
-<td>Local error — the application requested a license check for a package
-that is not installed on the device. </td>
-<td>No </td>
-<td></td>
-<td><em>Do not retry the license check.</em>
-<p style="margin-top:.5em;">Typically caused by a development error.</p>
-</td>
-</tr>
-<tr>
-<td>{@code ERROR_NON_MATCHING_UID}</td>
-<td>Local error — the application requested a license check for a package
-whose UID (package, user ID pair) does not match that of the requesting
-application. </td>
-<td>No </td>
-<td></td>
-<td><em>Do not retry the license check.</em>
-<p style="margin-top:.5em;">Typically caused by a development error.</p>
-</td>
-</tr>
-<tr>
-<td>{@code ERROR_NOT_MARKET_MANAGED}</td>
-<td>Server error — the application (package name) was not recognized by
-Google Play. </td>
-<td>No</td>
-<td></td>
-<td><em>Do not retry the license check.</em>
-<p style="margin-top:.5em;">Can indicate that the application was not published
-through Google Play or that there is an development error in the licensing
-implementation.</p>
-</td>
-</tr>
-
-</table>
-
-<p class="note"><strong>Note:</strong> As documented in <a
-href="{@docRoot}guide/market/licensing/setting-up.html#test-env">
-Setting Up The Testing Environment</a>, the response code can be manually
-overridden for the application developer and any registered test users via the
-Google Play publisher site.
-<br/><br/>
-Additionally, as noted above, applications that are in draft mode (in other
-words, applications that have been uploaded but have <em>never</em> been
-published) will return {@code LICENSED} for all users, even if not listed as a test
-user. Since the application has never been offered for download, it is assumed
-that any users running it must have obtained it from an authorized channel for
-testing purposes.</p>
-
-
-
-
-<h2 id="extras">Server Response Extras</h2>
-
-<p>To assist your application in managing access to the application across the application refund
-period and provide other information, The licensing server includes several pieces of
-information in the license responses. Specifically, the service provides recommended values for the
-application's license validity period, retry grace period, maximum allowable retry count, and other
-settings. If your application uses <a href="{@docRoot}guide/market/expansion-files.html">APK
-expansion files</a>, the response also includes the file names, sizes, and URLs. The server appends
-the settings as key-value pairs in the license response "extras" field. </p>
-
-<p>Any {@code Policy} implementation can extract the extras settings from the license
-response and use them as needed. The LVL default {@code Policy} implementation, <a
-href="{@docRoot}guide/market/licensing/adding-licensing.html#ServerManagedPolicy">{@code
-ServerManagedPolicy}</a>, serves as a working
-implementation and an illustration of how to obtain, store, and use the
-settings. </p>
-
-<p class="table-caption"><strong>Table 3.</strong> Summary of
-license-management settings supplied by the Google Play server in a license
-response.</p>
-
-<table>
-<tr>
-<th>Extra</th><th>Description</th>
-</tr>
-
-<tr>
- <td>{@code VT}</td>
- <td>License validity timestamp. Specifies the date/time at which the current
-(cached) license response expires and must be rechecked on the licensing server. See the section
-below about <a href="#VT">License validity period</a>.
- </td>
-</tr>
-<tr>
- <td>{@code GT}</td>
- <td>Grace period timestamp. Specifies the end of the period during which a
-Policy may allow access to the application, even though the response status is
-{@code RETRY}. <p>The value is managed by the server, however a typical value would be 5
-or more days. See the section
-below about <a href="#GTGR">Retry period and maximum retry count</a>.</p></td>
-</tr>
-<tr>
- <td>{@code GR}</td>
- <td>Maximum retries count. Specifies how many consecutive {@code RETRY} license checks
-the {@code Policy} should allow, before denying the user access to the application.
-<p>The value is managed by the server, however a typical value would be "10" or
-higher. See the section
-below about <a href="#GTGR">Retry period and maximum retry count</a>.</p></td>
-</tr>
-<tr>
- <td>{@code UT}</td>
- <td>Update timestamp. Specifies the day/time when the most recent update to
-this application was uploaded and published. <p>The server returns this extra
-only for {@code LICENSED_OLD_KEYS} responses, to allow the {@code Policy} to determine how much
-time has elapsed since an update was published with new licensing keys before
-denying the user access to the application. </p></td>
-</tr>
-
-
-<!-- APK EXPANSION FILE RESPONSES -->
-
-<tr>
- <td>{@code FILE_URL1} or {@code FILE_URL2}</td>
- <td>The URL for an expansion file (1 is for the main file, 2 is the patch file). Use this to
-download the file over HTTP.</td>
-</tr>
-<tr>
- <td>{@code FILE_NAME1} or {@code FILE_NAME2}</td>
- <td>The expansion file's name (1 is for the main file, 2 is the patch file). You must use this
-name when saving the file on the device.</td>
-</tr>
-<tr>
- <td>{@code FILE_SIZE1} or {@code FILE_SIZE2}</td>
- <td>The size of the file in bytes (1 is for the main file, 2 is the patch file). Use this to
-assist with downloading and to ensure that enough space is available on the device's shared
-storage location before downloading.</td>
-</tr>
-
-</table>
-
-
-
-<h4 id="VT">License validity period</h4>
-
-<p>The Google Play licensing server sets a license validity period for all
-downloaded applications. The period expresses the interval of time over which an
-application's license status should be considered as unchanging and cacheable by
-a licensing {@code Policy} in the application. The licensing server includes the
-validity period in its response to all license checks, appending an
-end-of-validity timestamp to the response as an extra under the key {@code VT}. A
-{@code Policy} can extract the VT key value and use it to conditionally allow access to
-the application without rechecking the license, until the validity period
-expires. </p>
-
-<p>The license validity signals to a licensing {@code Policy} when it must recheck the
-licensing status with the licensing server. It is <em>not</em> intended to imply
-whether an application is actually licensed for use. That is, when an
-application's license validity period expires, this does not mean that the
-application is no longer licensed for use — rather, it indicates only that
-the {@code Policy} must recheck the licensing status with the server. It follows that,
-as long as the license validity period has not expired, it is acceptable for the
-{@code Policy} to cache the initial license status locally and return the cached license
-status instead of sending a new license check to the server.</p>
-
-<p>The licensing server manages the validity period as a means of helping the
-application properly enforce licensing across the refund period offered by
-Google Play for paid applications. It sets the validity period based on
-whether the application was purchased and, if so, how long ago. Specifically,
-the server sets a validity period as follows:</p>
-
-<ul>
-<li>For a paid application, the server sets the initial license validity period
-so that the license response remains valid for as long as the application is
-refundable. A licensing {@code Policy} in the application may cache the
-result of the initial license check and does not need to recheck the license
-until the validity period has expired.</li>
-<li>When an application is no longer refundable, the server
-sets a longer validity period — typically a number of days. </li>
-
-<!-- TODO: Verify the following behavior is still true w/ OBB: -->
-<li>For a free application, the server sets the validity period to a very high
-value (<code>long.MAX_VALUE</code>). This ensures that, provided the {@code Policy} has
-cached the validity timestamp locally, it will not need to recheck the
-license status of the application in the future.</li>
-</ul>
-
-<p>The {@code ServerManagedPolicy} implementation uses the extracted timestamp
-(<code>mValidityTimestamp</code>) as a primary condition for determining whether
-to recheck the license status with the server before allowing the user access to
-the application. </p>
-
-
-<h4 id="GTGR">Retry period and maximum retry count</h4>
-
-<p>In some cases, system or network conditions can prevent an application's
-license check from reaching the licensing server, or prevent the server's
-response from reaching the Google Play client application. For example, the
-user might launch an application when there is no cell network or data
-connection available—such as when on an airplane—or when the
-network connection is unstable or the cell signal is weak. </p>
-
-<p>When network problems prevent or interrupt a license check, the Google
-Play client notifies the application by returning a {@code RETRY} response code to
-the {@code Policy}'s <code>processServerResponse()</code> method. In the case of system
-problems, such as when the application is unable to bind with Google Play's
-{@code ILicensingService} implementation, the {@code LicenseChecker} library itself calls the
-Policy <code>processServerResonse()</code> method with a {@code RETRY} response code.
-</p>
-
-<p>In general, the {@code RETRY} response code is a signal to the application that an
-error has occurred that has prevented a license check from completing.
-
-<p>The Google Play server helps an application to manage licensing under
-error conditions by setting a retry "grace period" and a recommended maximum
-retries count. The server includes these values in all license check responses,
-appending them as extras under the keys {@code GT} and {@code GR}. </p>
-
-<p>The application {@code Policy} can extract the {@code GT} and {@code GR} extras and use them to
-conditionally allow access to the application, as follows:</p>
-
-<ul>
-<li>For a license check that results in a {@code RETRY} response, the {@code Policy} should
-cache the {@code RETRY} response code and increment a count of {@code RETRY} responses.</li>
-<li>The {@code Policy} should allow the user to access the application, provided that
-either the retry grace period is still active or the maximum retries count has
-not been reached.</li>
-</ul>
-
-<p>The {@code ServerManagedPolicy} uses the server-supplied {@code GT} and {@code GR} values as
-described above. The example below shows the conditional handling of the retry
-responses in the <code>allow()</code> method. The count of {@code RETRY} responses is
-maintained in the <code>processServerResponse()</code> method, not shown. </p>
-
-
-<pre>
-public boolean allowAccess() {
- long ts = System.currentTimeMillis();
- if (mLastResponse == LicenseResponse.LICENSED) {
- // Check if the LICENSED response occurred within the validity timeout.
- if (ts <= mValidityTimestamp) {
- // Cached LICENSED response is still valid.
- return true;
- }
- } else if (mLastResponse == LicenseResponse.RETRY &&
- ts < mLastResponseTime + MILLIS_PER_MINUTE) {
- // Only allow access if we are within the retry period or we haven't used up our
- // max retries.
- return (ts <= mRetryUntil || mRetryCount <= mMaxRetries);
- }
- return false;
-}</pre>
-
diff --git a/docs/html/guide/market/licensing/overview.jd b/docs/html/guide/market/licensing/overview.jd
deleted file mode 100644
index e7e23f8..0000000
--- a/docs/html/guide/market/licensing/overview.jd
+++ /dev/null
@@ -1,246 +0,0 @@
-page.title=Licensing Overview
-parent.title=Application Licensing
-parent.link=index.html
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>Quickview</h2>
- <ul>
- <li>Licensing allows you to verify your app was purchased from Google Play</li>
- <li>Your app maintains control of how it enforces its licensing status</li>
- <li>The service is free for all developers who publish on Google Play</li>
- </ul>
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#Secure">License Responses are Secure</a></li>
- <li><a href="#LVL">Licensing Verification Library</a></li>
- <li><a href="#Reqs">Requirements and Limitations</a></li>
- <li><a href="#CopyProtection">Replacement for Copy Protection</a></li>
-</ol>
-
-</div>
-</div>
-
-
-<p>Google Play Licensing is a network-based service that lets an application query a trusted
-Google Play licensing server to determine whether the application is licensed to the current
-device user. The licensing service is based on the capability of the Google Play licensing server
-to determine whether a given user is licensed to use a given application. Google Play considers a
-user to be licensed if the user is a recorded purchaser of the application.</p>
-
-<p>The request starts when your application makes a request to a service hosted by
-the Google Play client application. The Google Play application then sends a request to
-the licensing server and receives the result. The Google Play application sends
-the result to your application, which can allow or disallow further use of the
-application as needed.</p>
-
-<p class="note"><strong>Note:</strong> If a paid application has been uploaded to Google Play but
-saved only as a draft application (the app is unpublished), the licensing server considers all users
-to be licensed users of the application (because it's not even possible to purchase the app).
-This exception is necessary in order for you to perform testing of your licensing
-implementation.</p>
-
-
-<div class="figure" style="width:469px">
-<img src="{@docRoot}images/licensing_arch.png" alt=""/>
-<p class="img-caption"><strong>Figure 1.</strong> Your application initiates a
-license check through the License Verification Library and the Google Play
-client, which handles communication with the Google Play server.</p>
-</div>
-
-
-<p>To properly identify the user and determine the license status, the licensing server requires
-information about the application and user—your application and the Google Play client work
-together to assemble the information and the Google Play client passes it to the server. </p>
-
-<p>To help you add licensing to your application, the Android SDK provides a downloadable set of
-library sources that you can include in your application project: the Google Market
-Licensing package. The License Verification Library (LVL) is a library you can add to your
-application that
-handles all of the licensing-related communication with the Google Play licensing service. With
-the LVL added to your application, your application can determine its licensing status for the
-current user by simply calling a method and implementing a callback that receives the status
-response.</p>
-
-<p>Your application does not query the licensing server
-directly, but instead calls the Google Play client over remote IPC to
-initiate a license request. In the license request:</p>
-
-<ul>
-<li>Your application provides: its package name, a nonce that is later used to
-validate any response from the server, and a callback over which the
-response can be returned asynchronously.</li>
-<li>The Google Play client collects the necessary information about the user and the device,
-such as the device's primary Google account username, IMSI, and other
-information. It then sends the license check request to the server on behalf of
-your application.</li>
-<li>The Google Play server evaluates the request using all available information, attempting
-to establish the user's identity to a sufficient level of confidence. The server
-then checks the user identity against purchase records for your application and
-returns a license response, which the Google Play client returns to your
-application over the IPC callback.</li>
-</ul>
-
-<p>You can choose when, and how often, you want your application to check its
-license and you have full control over how it handles the response, verifies the
-signed response data, and enforces access controls.</p>
-
-<p>Notice that during a license check, your application does not manage any
-network connections or use any licensing related APIs in the Android platform.</p>
-
-
-
-
-<h2 id="Secure">License Responses are Secure</h2>
-
-<p>To ensure the integrity of each license query, the server signs the license
-response data using an RSA key pair that is shared exclusively between the Google Play
-server and you.</p>
-
-<p>The licensing service generates a single licensing key pair for each
-publisher account and exposes the public key in your account's profile page. You must copy the
-public key from the web site and embed it in your application source code. The server retains the
-private key internally and uses it to sign license responses for the applications you
-publish with that account.</p>
-
-<p>When your application receives a signed response, it uses the embedded public
-key to verify the data. The use of public key cryptography in the licensing
-service makes it possible for the application to detect responses that have been
-tampered with or that are spoofed.</p>
-
-
-
-
-<h2 id="LVL">Licensing Verification Library</h2>
-
-<p>The Android SDK provides a downloadable package called the Google Market Licensing package,
-which includes the License Verification Library (LVL). The LVL greatly simplifies the process of
-adding licensing to your application and helps ensure a more secure, robust implementation for your
-application. The LVL provides internal classes that handle most of the standard operations of a
-license query, such as contacting the Google Play client to initiate a license request and
-verifying and validating the responses. It also exposes interfaces that let you easily plug in your
-custom code for defining licensing policy and managing access as needed by your application. The key
-LVL interfaces are: </p>
-
-<dl>
-<dt>{@code Policy}</dt>
- <dd>Your implementation determines whether to allow access to the
-application, based on the license response received from the server and any
-other data available (such as from a backend server associated with your
-application). The implementation can evaluate the various fields of the license
-response and apply other constraints, if needed. The implementation also lets
-you manage the handling of license checks that result in errors, such as network
-errors.</dd>
-
-<dt>{@code LicenseCheckerCallback}</dt>
- <dd>Your implementation manages access to the
-application, based on the result of the {@code Policy} object's handling of the license
-response. Your implementation can manage access in any way needed, including
-displaying the license result in the UI or directing the user to purchase the
-application (if not currently licensed).</dd>
-</dl>
-
-
-<p>To help you get started with a {@code Policy}, the LVL provides two fully complete
-{@code Policy} implementations that you can use without modification or adapt to your
-needs:</p>
-
-<dl>
-<dt><a href="adding-licensing.html#ServerManagedPolicy">{@code ServerManagedPolicy}</a></dt>
- <dd>A flexible {@code Policy}
-that uses settings provided by the licensing server to manage response caching
-and access to the application while the device is offline (such as when the
-user is on an airplane). For most applications, the use of
-{@code ServerManagedPolicy} is highly recommended.</dd>
-
-<dt><a href="adding-licensing.html#StrictPolicy">{@code StrictPolicy}</a></dt>
- <dd>A restrictive {@code Policy} that
-does not cache any response data and allows the application access <em>only</em>
-when the server returns a licensed response.</dd>
-</dl>
-
-<p>The LVL is available as a downloadable package of the Android SDK. The
-package includes both the LVL itself and an example application that shows how
-the library should be integrated with your application and how your application
-should manage response data, UI interaction, and error conditions. </p>
-
-<p>The LVL sources are provided as an Android <em>library project</em>, which
-means that you can maintain a single set of library sources and share them
-across multiple applications. A full test environment is also available through
-the SDK, so you can develop and test the licensing implementation in your
-applications before publishing them, even if you don't have access to a
-physical device.</p>
-
-
-
-
-<h2 id="Reqs">Requirements and Limitations</h2>
-
-<p>Google Play Licensing is designed to let you apply license controls to
-applications that you publish through Google Play. The service is not
-designed to let you control access to applications that are not published
-through Google Play or that are run on devices that do not offer the Google
-Play client. </p>
-
-<p>Here are some points to keep in mind as you implement licensing in your
-application: </p>
-
-<ul>
-<li>An application can use the service only if the Google Play client is
-installed on its host device and the device is running Android 1.5 (API level 3)
-or higher.</li>
-<li>To complete a license check, the licensing server must be accessible over
-the network. You can implement license caching behaviors to manage access to your application when
-there is no network connectivity. </li>
-<li>The security of your application's licensing controls ultimately relies on
-the design of your implementation itself. The service provides the building
-blocks that let you securely check licensing, but the actual enforcement and
-handling of the license are factors are up to you. By following the best
-practices in the following documents, you can help ensure that your implementation will be
-secure.</li>
-<li>Adding licensing to an application does not affect the way the application
-functions when run on a device that does not offer Google Play.</li>
-<li>You can implement licensing controls for a free app, but only if you're using the service to
-provide <a
-href="{@docRoot}guide/market/expansion-files.html">APK expansion files</a>.</li>
-</ul>
-
-
-
-<h2 id="CopyProtection">Replacement for Copy Protection</h2>
-
-<p>Google Play Licensing is a flexible, secure mechanism for controlling
-access to your applications. It effectively replaces the Copy Protection
-mechanism offered on Google Play and gives you wider distribution
-potential for your applications. </p>
-
-<ul>
-<li>A limitation of the legacy Copy Protection mechanism on Google Play is
-that applications using it can be installed only on compatible devices that
-provide a secure internal storage environment. For example, a copy-protected
-application cannot be downloaded from Google Play to a device that provides root
-access, and the application cannot be installed to a device's SD card. </li>
-<li>With Google Play licensing, you can move to a license-based model in
-which access is not bound to the characteristics of the host device, but to your
-publisher account on Google Play and the licensing policy that you define.
-Your application can be installed and controlled on any compatible device on
-any storage, including SD card.</li>
-</ul>
-
-<p>Although no license mechanism can completely prevent all unauthorized use,
-the licensing service lets you control access for most types of normal usage,
-across all compatible devices, locked or unlocked, that run Android 1.5 or
-higher version of the platform.</p>
-
-<p>To begin adding application licensing to your application, continue to <a
-href="{@docRoot}guide/market/licensing/setting-up.html">Setting Up for Licensing</a>.</p>
-
-
-
-
-
-
diff --git a/docs/html/guide/market/licensing/setting-up.jd b/docs/html/guide/market/licensing/setting-up.jd
deleted file mode 100644
index 0de7819..0000000
--- a/docs/html/guide/market/licensing/setting-up.jd
+++ /dev/null
@@ -1,701 +0,0 @@
-page.title=Setting Up for Licensing
-parent.title=Application Licensing
-parent.link=index.html
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#account">Setting Up a Publisher Account</a></li>
- <li><a href="#dev-setup">Setting Up the Development Environment</a>
- <ol>
- <li><a href="#runtime-setup">Setting up the runtime environment</a></li>
- <li><a href="#download-lvl">Downloading the LVL</a></li>
- <li><a href="#lvl-setup">Setting Up the Licensing Verification Library</a></li>
- <li><a href="#add-library">Including the LVL library project sources in your
-application</a></li>
- </ol>
- </li>
- <li><a href="#test-env">Setting Up the Testing Environment</a>
- <ol>
- <li><a href="#test-response">Setting test responses for license checks</a></li>
- <li><a href="#test-acct-setup">Setting up test accounts</a></li>
- <li><a href="#acct-signin">Signing in to an authorized account in the runtime
-environment</a></li>
- </ol>
- </li>
-</ol>
-</div>
-</div>
-
-<p>Before you start adding license verification to your application, you need to set up your Google
-Play publishing account, your development environment, and test accounts required to verify
-your implementation.</p>
-
-
-<h2 id="account">Setting Up a Publisher Account</h2>
-
-<p>If you don't already have a publisher account for Google Play, you need to register for one
-using your Google account and agree to the terms of service on the Google Play publisher site:</p>
-
-<p style="margin-left:2em;"><a
-href="http://play.google.com/apps/publish">http://play.google.com/apps/publish</a>
-</p>
-
-<p>For more information, see <a
-href="{@docRoot}guide/publishing/publishing.html">Publishing on Google Play</a>.</p>
-
-<p>If you already have a publisher account on Google Play, use your existing
-account to set up licensing.</p>
-
-<p>Using your publisher account on Google Play, you can:</p>
-
-<ul>
-<li>Obtain a public key for licensing</li>
-<li>Debug and test an application's licensing implementation, prior to
-publishing the application</li>
-<li>Publish the applications to which you have added licensing support</li>
-</ul>
-
-<h4>Administrative settings for licensing</h4>
-
-<p>You can manage several
-administrative controls for Google Play licensing on the publisher site. The controls are available
-in the Edit Profile page, in the "Licensing" panel, shown in figure 1. The controls
-let you: </p>
-
-<ul>
-<li>Set up multiple "test accounts," identified by email address. The licensing
-server allows users signed in to test accounts on a device or emulator to send
-license checks and receive static test responses.</li>
-<li>Obtain the account's public key for licensing. When you are implementing
-licensing in an application, you must copy the public key string into the
-application.</li>
-<li>Configure static test responses that the server sends, when it receives a
-license check for an application uploaded to the publisher account, from a user
-signed in to the publisher account or a test account.</li>
-</ul>
-
-
-<img src="{@docRoot}images/licensing_public_key.png" alt=""/>
-<p class="img-caption"><strong>Figure 1.</strong> The Licensing
-panel of your account's Edit Profile page lets you manage administrative
-settings for licensing.</p>
-
-<p>For more information about how to work with test accounts and static test
-responses, see <a href="#test-env">Setting Up a Testing Environment</a>, below.
-
-
-
-<h2 id="dev-setup">Setting Up the Development Environment</h2>
-
-<p>Setting up your environment for licensing involves these tasks:</p>
-
-<ol>
-<li><a href="#runtime-setup">Setting up the runtime environment</a> for development</li>
-<li><a href="#download-lvl">Downloading the LVL</a> into your SDK </li>
-<li><a href="#lvl-setup">Setting up the Licensing Verification Library</a></li>
-<li><a href="#add-library">Including the LVL library project in your application</a></li>
-</ol>
-
-<p>The sections below describe these tasks. When you are done with setup,
-you can begin <a href="{@docRoot}guide/market/licensing/adding-licensing.html">Adding
-Licensing to Your App</a>.</p>
-
-<p>To get started, you need to set up a proper runtime environment on which
-you can run, debug, and test your application's implementation of license
-checking and enforcement. </p>
-
-
-<h3 id="runtime-setup">Setting up the runtime environment</h3>
-
-<p>As described earlier, applications check licensing status not by contacting
-the licensing server directly, but by binding to a service provided by the
-Google Play application and initiating a license check request. The Google
-Play service then handles the direct communication with the licensing server
-and finally routes the response back to your application. To debug and test
-licensing in your application, you need to set up a runtime environment that
-includes the necessary Google Play service, so that your application is able
-to send license check requests to the licensing server. </p>
-
-<p>There are two types of runtime environment that you can use: </p>
-
-<ul>
-<li>An Android-powered device that includes the Google Play application, or</li>
-<li>An Android emulator running the Google APIs Add-on, API level 8 (release 2)
-or higher</li>
-</ul>
-
-<h4 id="runtime-device">Running on a device</h4>
-
-<p>To use an Android-powered device for
-debugging and testing licensing, the device must:</p>
-
-<ul>
-<li>Run a compatible version of Android 1.5 or later (API level
-3 or higher) platform, <em>and</em> </li>
-<li>Run a system image on which the Google Play client application
-is preinstalled. </li>
-</ul>
-
-<p>If Google Play is not preinstalled in the system image, your application won't
-be able to communicate with the Google Play licensing server. </p>
-
-<p>For general information about how to set up a device for use in developing
-Android applications, see <a
-href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a>.</p>
-
-<h4 id="runtime-emulator">Running on an Android emulator</h4>
-
-<p>If you don't have a device available, you can use an Android emulator for debugging and testing
-licensing.</p>
-
-<p>Because the Android platforms provided in the Android SDK <em>do
-not</em> include Google Play, you need to download the Google APIs Add-On
-platform, API level 8 (or higher), from the SDK repository. After downloading
-the add-on, you need to create an AVD configuration that uses that system image.
-</p>
-
-<p>The Google APIs Add-On does not include the full Google Play client.
-However, it does provide: </p>
-
-<ul>
-<li>An Google Play background service that implements the
-<code>ILicensingService</code> remote interface, so that your application can
-send license checks over the network to the licensing server. </li>
-<li>A set of underlying account services that let you add an a Google account on
-the AVD and sign in using your publisher account or test account credentials.
-<p>Signing in using your publisher or test account enables you to debug and test
-your application without having publish it. For more information see <a
-href="#acct-signin">Signing in to an authorized account</a>, below.</p></li>
-</ul>
-
-<p>Several versions of the Google APIs add-on are available through the SDK Manager, but only
-the version for Android 2.2 and higher includes the necessary Google
-Play services.</p>
-
-<p>To set up an emulator for adding licensing to an application, follow
-these steps: </p>
-
-<ol>
- <li>Launch the Android SDK Manager (available under the Eclipse <strong>Window</strong>
-menu or by executing {@code <sdk>/tools/android sdk}).</li>
- <li>Select and download <strong>Google APIs</strong> for the Android version you'd like to target
-(must be Android 2.2 or higher).</li>
- <li>When the download is complete, open the AVD Manager (available under the Eclipse
-<strong>Window</strong>
-menu or by executing {@code <sdk>/tools/android avd}).</li>
- <li>Click
-<strong>New</strong> and set the configuration details for the new AVD. </li>
- <li>In the dialog that appears, assign a descriptive name to the AVD and then
-use the Target menu to choose the <strong>Google APIs</strong> as
-the system image to run on the new AVD. Set the other configuration details as
-needed and then click <strong>Create AVD</strong> to finish. The SDK tools
-create the new AVD configuration, which then appears in the list of available
-Android Virtual Devices.</li>
-</ol>
-
-<p>If you are not familiar with AVDs or how to use them, see <a
-href="{@docRoot}guide/developing/devices/index.html">Managing Virtual Devices</a>.</p>
-
-<h4 id="project-update">Updating your project configuration</h4>
-
-<p>After you set up a runtime environment that meets the requirements described
-above — either on an actual device or on an emulator — make sure to
-update your application project or build scripts as needed, so that your compiled
-<code>.apk</code> files that use licensing are deployed into that environment.
-In particular, if you are developing in Eclipse, make sure that you set up a
-Run/Debug Configuration that targets the appropriate device or AVD. </p>
-
-<p>You do not need to make any changes to your application's
-build configuration, provided that the project is already configured to compile
-against a standard Android 1.5 (API level 3) or higher library. For example:
-
-<ul>
-<li>If you have an existing application that is compiled against
-the Android 1.5 library, you do not need to make any changes to your
-build configuration to support licensing. The build target meets the minimum
-requirements for licensing, so you would continue building
-against the same version of the Android platform.</li>
-
-<li>Similarly, if you are building against Android 1.5 (API level 3) but
-are using an emulator running the Google APIs Add-On API 8 as the application's
-runtime environment, there is no need to change your application's build
-configuration. </li>
-</ul>
-
-<p>In general, adding licensing to an application should have no impact
-whatsoever on the application's build configuration.</p>
-
-
-<h3 id="download-lvl">Downloading the LVL</h3>
-
-<p>The License Verification Library (LVL) is a collection of helper classes that
-greatly simplify the work that you need to do to add licensing to your
-application. In all cases, we recommend that you download the LVL and use it as
-the basis for the licensing implementation in your application.</p>
-
-<p>The LVL is available as a downloadable package of the Android SDK. The
-package includes: </p>
-
-<ul>
-<li>The LVL sources, stored inside an Android library project. </li>
-<li>An example application called "sample" that depends on the LVL library
-project. The example illustrates how an application uses the library helper
-classes to check and enforce licensing.</li>
-</ul>
-
-<p>To download the LVL package into your development environment, use the
-Android SDK Manager. Launch the Android SDK Manager and then
-select the <strong>Google Market Licensing</strong> package, as shown in figure 2.
-Accept the terms and click <strong>Install Selected</strong> to begin the download. </p>
-
-<img src="{@docRoot}images/licensing_package.png" alt=""/>
-<p class="img-caption"><strong>Figure 2.</strong> The Licensing package contains the LVL and
-the LVL sample application.</p>
-
-<p>When the download is complete, the Android SDK Manager installs both
-the LVL library project and the example application into these directories: </p>
-
-<p style="margin-left:2em"><code><<em>sdk</em>>/extras/google/market_licensing/library/</code>
- (the LVL library project)<br />
-<code><<em>sdk</em>>/extras/google/market_licensing/sample/</code> (the example
-application)</p>
-
-<p>If you aren't familiar with how to download packess into your SDK, see the
-<a href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a>
-document. </p>
-
-
-<h3 id="lvl-setup">Setting Up the Licensing Verification Library</h3>
-
-<p>After downloading the LVL to your computer, you need to set it up in your
-development environment, either as an Android library project or by
-copying (or importing) the library sources directly into your existing
-application package. In general, using the LVL as a library project is recommended,
-since it lets you reuse your licensing code across multiple applications and
-maintain it more easily over time. Note that the LVL is not designed to be
-compiled separately and added to an application as a static .jar file. </p>
-
-<h4>Moving the library sources to a new location</h4>
-
-<p>Because you will be customizing the LVL sources to some extent, you should
-make sure to <em>move or copy</em> the library sources (the entire
-directory at <code><<em>sdk</em>>/market_licensing/library/</code>)
-to a working directory outside of the SDK. You should then use the relocated
-sources as your working set. If you are using a source-code management
-system, add and track the sources that are in the working location rather
-than those in default location in the SDK. </p>
-
-<p>Moving the library sources is important is because, when you later update the
-Licensing package, the SDK installs the new files to the same location as
-the older files. Moving your working library files to a safe location ensures
-that your work won't be inadvertently overwritten should you download a new
-version of the LVL.</p>
-
-<h4>Creating the LVL as a library project</h4>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>Working with library projects</h2>
-
-<p>The LVL is provided as an Android library project, which means that you can
-share its code and resources across multiple applications. </p>
-
-<p style="margin-top:.5em;">If you aren't familiar with library projects or how
-to use them, see <a href="{@docRoot}guide/developing/projects/index.html#LibraryProjects">
-Managing Projects</a>.
-</p>
-</div>
-</div>
-
-<p>The recommended way of using the LVL is setting it up as a new Android
-<em>library project</em>. A library project is a type of development project
-that holds shared Android source code and resources. Other Android application
-projects can reference the library project and, at build time, include its
-compiled sources in their <code>.apk</code> files. In the context of licensing,
-this means that you can do most of your licensing development once, in a library
-project, then include the library sources in your various application projects.
-In this way, you can easily maintain a uniform implementation of licensing
-across all of your projects and maintain it centrally. </p>
-
-<p>The LVL is provided as a configured library project — once you have
-downloaded it, you can start using it right away. </p>
-
-<p>If you are working in Eclipse with ADT, you need to add the LVL to your
-workspace as a new development project, in the same way as you would a new
-application project. </p>
-
-<ol>
-<li>Use the New Project Wizard to create a new
-project from existing sources. Select the LVL's <code>library</code> directory
-(the directory containing the library's AndroidManifest.xml file) as the project
-root.</li>
-<li>When you are creating the library project, you can select any application
-name, package, and set other fields as needed. </li>
-<li>For the library's build target, select Android 1.5 (API level 3) or higher.</li>
-</ol>
-
-<p> When created, the project is
-predefined as a library project in its <code>project.properties</code> file, so
-no further configuration is needed. </p>
-
-<p>For more information about how to create an application project or work with
-library projects in Eclipse, see <a
-href="{@docRoot}guide/developing/projects/projects-eclipse.html">Managing Projects from
-Eclipse with ADT</a>.</p>
-
-
-<h4>Copying the LVL sources to your application</h4>
-
-<p>As an alternative to adding the LVL as a library project, you can copy the
-library sources directly into your application. To do so, copy (or import) the
-LVL's <code>library/src/com</code> directory into your application's
-<code>src/</code> directory.</p>
-
-<p>If you add the LVL sources directly to your application, you can skip the
-next section and start working with the library, as described in <a
-href="{@docRoot}guide/market/licensing/adding-licensing.html">Adding
-Licensing to Your App</a>.</p>
-
-
-<h3 id="add-library">Including the LVL library project sources in your
-application</h3>
-
-<p>If you want to use the LVL sources as a library project, you need to add a
-reference to the LVL library project in your application project properties. This tells
-build tools to include the LVL library project sources in your application at
-compile time. The process for adding a reference to a library project depends
-on your development environment, as described below.</p>
-
-<p> If you are developing in Eclipse with ADT, you should already have added the
-library project to your workspace, as described in the previous section. If you
-haven't done that already, do it now before continuing. </p>
-
-<p>Next, open the application's project properties window, as shown below.
-Select the "Android" properties group and click <strong>Add</strong>, then
-choose the LVL library project (com_android_vending_licensing) and click
-<strong>OK</strong>. For more information, see
-<a href="{@docRoot}guide/developing/projects/projects-eclipse.html#SettingUpLibraryProject">
-Managing Projects from Eclipse with ADT</a></p>.
-
-
-<img src="{@docRoot}images/licensing_add_library.png" alt=""/>
-<p class="img-caption"><strong>Figure 3.</strong> If you are
-working in Eclipse with ADT, you can add the LVL library project to your
-application from the application's project properties.</p>
-
-
-<p>If you are developing using the SDK command-line tools, navigate to the
-directory containing your application project and open the
-<code>project.properties</code> file. Add a line to the file that specifies the
-<code>android.library.reference.<n></code> key and the path to the
-library. For example: </p>
-
-<pre>android.library.reference.1=path/to/library_project</pre>
-
-<p>Alternatively, you can use this command to update the project
-properties, including the reference to the library project:</p>
-
-<pre class="no-pretty-print" style="color:black">android update lib-project
---target <em><target_ID></em> \
---path <em>path/to/my/app_project</em> \
---library <em>path/to/my/library_project</em>
-</pre>
-
-<p>For more information about working with library projects,
-see <a href="{@docRoot}guide/developing/projects/projects-cmdline.html#SettingUpLibraryProject">
-Setting up a Library Project</a>.</p>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h2 id="test-env">Setting Up the Testing Environment</h2>
-
-<p>The Google Play publisher site provides configuration tools that let you
-and others test licensing on your application before it is published. As you are
-implementing licensing, you can make use of the publisher site tools to test
-your application's Policy and handling of different licensing responses and
-error conditions.</p>
-
-<p>The main components of the test environment for licensing include: </p>
-
-<ul>
-<li>A "Test response" configuration in your publisher account that lets you
-set the static licensing response returned, when the server processes a
-license check for an application uploaded to the publisher account, from a user
-signed in to the publisher account or a test account.</li>
-<li>An optional set of test accounts that will receive the static test
-response when they check the license of an application that you have uploaded
-(regardless whether the application is published or not).</li>
-<li>A runtime environment for the application that includes the Google Play
-application or Google APIs Add-On, on which the user is signed in to the
-publisher account or one of the test accounts.</li>
-</ul>
-
-<p>Setting up the test environment properly involves:</p>
-
-<ol>
-<li><a href="#test-response">Setting static test responses</a> that are returned by the licensing server.</li>
-<li><a href="#test-acct-setup">Setting up test accounts</a> as needed.</li>
-<li><a href="#acct-signin">Signing in</a> properly to an emulator or device, before initiating a license check test.</li>
-</ol>
-
-<p>The sections below provide more information.</p>
-
-
-<h3 id="test-response">Setting test responses for license checks</h3>
-
-<p>Google Play provides a configuration setting in your publisher account
-that lets you override the normal processing of a license check and return a
-specified static response code. The setting is for testing only and applies
-<em>only</em> to license checks for applications that you have uploaded, made by
-any user signed in to an emulator or device using the credentials of the
-publisher account or a registered test account. For other users, the server
-always processes license checks according to normal rules. </p>
-
-<p>To set a test response for your account, sign in to your publisher account
-and click "Edit Profile". In the Edit Profile page, locate the Test Response
-menu in the Licensing panel, shown below. You can select from the full set of
-valid server response codes to control the response or condition you want to
-test in your application.</p>
-
-<p>In general, you should make sure to test your application's licensing
-implementation with every response code available in the Test Response menu.
-For a description of the codes, see <a
-href="{@docRoot}guide/market/licensing/licensing-reference.html#server-response-codes">Server
-Response Codes</a> in the <a
-href="{@docRoot}guide/market/licensing/licensing-reference.html">Licensing Reference</a>.</p>
-
-<img src="{@docRoot}images/licensing_test_response.png" alt=""/>
-<p class="img-caption"><strong>Figure 4.</strong> The Licensing
-panel of your account's Edit Profile page, showing the Test Accounts field and the
-Test Response menu.</p>
-
-<p>Note that the test response that you configure applies account-wide —
-that is, it applies not to a single application, but to <em>all</em>
-applications associated with the publisher account. If you are testing multiple
-applications at once, changing the test response will affect all of those
-applications on their next license check (if the user is signed in to
-the emulator or device using the publisher account or a test account).</p>
-
-<p>Before you can successfully receive a test response for a license check,
-you must sign in to the device or emulator on which the application
-is installed, and from which it is querying the server. Specifically, you must
-sign using either your publisher account or one of the test accounts that you
-have set up. For more information about test accounts, see the next section.</p>
-
-<p>See <a
-href="{@docRoot}guide/market/licensing/licensing-reference.html#server-response-codes">Server
-Response Codes</a> for a list of
-test responses available and their meanings. </p>
-
-
-<h3 id="test-acct-setup">Setting up test accounts</h3>
-
-<p>In some cases, you might want to let multiple teams of developers test
-licensing on applications that will ultimately be published through your
-publisher account, but without giving them access to your publisher account's
-sign-in credentials. To meet that need, the Google Play publisher site lets
-you set up one or more optional <em>test accounts</em> — accounts that are
-authorized to query the licensing server and receive static test responses from
-your publisher account.</p>
-
-<p>Test accounts are standard Google accounts that you register on your
-publisher account, such that they will receive the test response for
-applications that you have uploaded. Developers can then sign in to their
-devices or emulators using the test account credentials and initiate license
-checks from installed applications. When the licensing server receives a license
-check from a user of a test account, it returns the static test response
-configured for the publisher account. </p>
-
-<p>Necessarily, there are limitations on the access and permissions given to
-users signed in through test accounts, including:</p>
-
-<ul>
-<li>Test account users can query the licensing server only for applications that
-are already uploaded to the publisher account. </li>
-<li>Test account users do not have permission to upload applications to your
-publisher account.</li>
-<li>Test account users do not have permission to set the publisher account's
-static test response.</li>
-</ul>
-
-<p>The table below summarizes the differences in capabilities, between the
-publisher account, a test account, and any other account.</p>
-
-<p class="table-caption" id="acct-types-table"><strong>Table 1.</strong>
-Differences in account types for testing licensing.</p>
-
-<table>
-<tr>
-<th>Account Type</th>
-<th>Can check license before upload?</th>
-<th>Can receive test response?</th>
-<th>Can set test response?</th>
-</tr>
-
-<tr>
-<td>Publisher account</td>
-<td>Yes</td>
-<td>Yes</td>
-<td>Yes</td>
-</tr>
-
-<tr>
-<td>Test account</td>
-<td>No</td>
-<td>Yes</td>
-<td>No</td>
-</tr>
-
-<tr>
-<td>Other</td>
-<td>No</td>
-<td>No</td>
-<td>No</td>
-</tr>
-</table>
-
-<h4 id="reg-test-acct">Registering test accounts on the publisher account</h4>
-
-<p>To get started, you need to register each test account in your publisher
-account. As shown in Figure 4, you
-register test accounts in the Licensing panel of your publisher account's Edit
-Profile page. Simply enter the accounts as a comma-delimited list and click
-<strong>Save</strong> to save your profile changes.</p>
-
-<p>You can use any Google account as a test account. If you want to own and
-control the test accounts, you can create the accounts yourself and distribute
-the credentials to your developers or testers.</p>
-
-<h4 id="test-app-upload">Handling application upload and distribution for test
-account users</h4>
-
-<p>As mentioned above, users of test accounts can only receive static test
-responses for applications that are uploaded to the publisher account. Since
-those users do not have permission to upload applications, as the publisher you
-will need to work with those users to collect apps for upload and distribute
-uploaded apps for testing. You can handle collection and distribution in any way
-that is convenient. </p>
-
-<p>Once an application is uploaded and becomes known to the licensing server,
-developers and testers can continue modify the application in their local
-development environment, without having to upload new versions. You only need to
-upload a new version if the local application increments the
-<code>versionCode</code> attribute in the manifest file. </p>
-
-<h4 id="test-key">Distributing your public key to test account users</h4>
-
-<p>The licensing server handles static test responses in the normal way,
-including signing the license response data, adding extras parameters, and so
-on. To support developers who are implementing licensing using test accounts,
-rather than the publisher account, you will need to distribute
-your public key to them. Developers without access to the publisher site do not
-have access to your public key, and without the key they won't be able to
-verify license responses. </p>
-
-<p>Note that if you decide to generate a new licensing key pair for your account
-for some reason, you need to notify all users of test accounts. For
-testers, you can embed the new key in the application package and distribute it
-to users. For developers, you will need to distribute the new key to them
-directly. </p>
-
-
-<h3 id="acct-signin">Signing in to an authorized account in the runtime
-environment</h3>
-
-<p>The licensing service is designed to determine whether a given user is
-licensed to use a given application — during a license check, the Google
-Play application gathers the user ID from the primary account on the system
-and sends it to the server, together with the package name of the application
-and other information. However, if there is no user information available, the
-license check cannot succeed, so the Google Play application terminates the
-request and returns an error to the application. </p>
-
-<p>During testing, to ensure that your application can successfully query the
-licensing server, you must make sure that you sign in to an account <em>on the
-device or emulator</em> using:</p>
-
-<ul>
-<li>The credentials of a publisher account, or</li>
-<li>The credentials of a test account that is registered with a publisher
-account</li>
-</ul>
-
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>Signing in to a Google account on an emulator</h2>
-
-<p>If you are testing licensing on an emulator, you need to sign in to a Google
-account on the emulator. If you do not see an option to create a new Google
-account, the problem might be that your AVD is running a standard Android system
-image, rather than the Google APIs Add-On, API 8 (release 2) or higher. </p>
-
-<p style="margin-top:.5em;">For more information, see <a
-href="#runtime-setup">Setting up the runtime environment</a>, above.</p>
-
-</div>
-</div>
-
-<p>Signing in using a publisher account offers the advantage of letting your
-applications receive static test responses even before the applications are
-uploaded to the publisher site.</p>
-
-<p>If you are part of a larger organization or are working with external groups
-on applications that will be published through your site, you will more likely
-want to distribute test accounts instead, then use those to sign in during
-testing. </p>
-
-<p>To sign in on a device or emulator, follow the steps below. The preferred
-approach is to sign in as the primary account — however, if there are
-other accounts already in use on the device or emulator, you can create an
-additional account and sign in to it using the publisher or test account
-credentials. </p>
-
-<ol>
-<li>Open Settings > Accounts & sync</li>
-<li>Select <strong>Add Account</strong> and choose to add a Google account.
-</li>
-<li>Select <strong>Next</strong> and then <strong>Sign in</strong>.</li>
-<li>Enter the username and password of either the publisher account or a test
-account that is registered in the publisher account.</li>
-<li>Select <strong>Sign in</strong>. The system signs you in to the new
-account.</li>
-</ol>
-
-<p>Once you are signed in, you can begin testing licensing in your application
-(if you have completed the LVL integration steps above). When your application
-initiates a license check, it will receive a response containing the static test
-response configured on the publisher account. </p>
-
-<p>Note that, if you are using an emulator, you will need to sign in to the
-publisher account or test account each time you wipe data when restarting the
-emulator.</p>
-
-<p>Once you've completed the setup procedures, continue to <a
-href="{@docRoot}guide/market/licensing/adding-licensing.html">Adding Licensing to Your App</a>.</p>
-
-
-
diff --git a/docs/html/guide/market/publishing/multiple-apks.jd b/docs/html/guide/market/publishing/multiple-apks.jd
deleted file mode 100644
index e7cfa33..0000000
--- a/docs/html/guide/market/publishing/multiple-apks.jd
+++ /dev/null
@@ -1,643 +0,0 @@
-page.title=Multiple APK Support
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>Quickview</h2>
- <ul>
- <li>Simultaneously publish different APKs for different
-device configurations</li>
- <li>Different APKs are distributed to different devices based on filters declared in the
-manifest file</li>
- <li>You should publish multiple APKs only when it's not possible or reasonable to
-support all desired devices with a single APK</li>
- </ul>
-
- <h2>In this document</h2>
-<ol>
- <li><a href="#Concepts">Publishing Concepts</a>
- <ol>
- <li><a href="#Active">Active APKs</a></li>
- <li><a href="#SimpleAndAdvanced">Simple mode and advanced mode</a></li>
- </ol>
- </li>
- <li><a href="#HowItWorks">How Multiple APKs Work</a>
- <ol>
- <li><a href="#SupportedFilters">Supported filters</a></li>
- <li><a href="#Rules">Rules for multiple APKs</a></li>
- </ol>
- </li>
- <li><a href="#CreatingApks">Creating Multiple APKs</a>
- <ol>
- <li><a href="#VersionCodes">Assigning version codes</a></li>
- </ol>
- </li>
- <li><a href="#SingleAPK">Using a Single APK Instead</a>
- <ol>
- <li><a href="#TextureOptions">Supporting multiple GL textures</a></li>
- <li><a href="#ScreenOptions">Supporting multiple screens</a></li>
- <li><a href="#ApiLevelOptions">Supporting multiple API levels</a></li>
- </ol>
- </li>
-</ol>
-
- <h2>See also</h2>
-<ol>
- <li><a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a></li>
- <li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></li>
- <li><a href="{@docRoot}sdk/compatibility-library.html">Compatibility
-Package</a></li>
- <li><a href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>Multiple APK support is a feature on Google Play that allows you to publish different APKs
-for your application that are each targeted to different device configurations. Each APK is a
-complete and independent version of your application, but they share the same application listing on
-Google Play and must share the same package name and be signed with the same release key. This
-feature is useful for cases in which your application cannot reach all desired devices with a single
-APK.</p>
-
-<p>Android-powered devices may differ in several ways and it's important
-to the success of your application that you make it available to as many devices as possible.
-Android applications usually run on most compatible devices with a single APK, by supplying
-alternative resources for different configurations (for example, different layouts for different
-screen sizes) and the Android system selects the appropriate resources for the device at runtime. In
-a few cases, however, a single APK is unable to support all device configurations, because
-alternative resources make the APK file too big (greater than 50MB) or other technical challenges
-prevent a single APK from working on all devices.</p>
-
-<p>Although <strong>we encourage you to develop and publish a single APK</strong> that supports as
-many device configurations as possible, doing so is sometimes not possible. To help
-you publish your application for as many devices as possible, Google Play allows you to
-publish multiple APKs under the same application listing. Google Play then supplies each APK to
-the appropriate devices based on configuration support you've declared in the manifest file of each
-APK.</p>
-
-<p>By publishing your application with multiple APKs, you can:</p>
-
-<ul>
- <li>Support different OpenGL texture compression formats with each APK.</li>
- <li>Support different screen configurations with each APK.</li>
- <li>Support different platform versions with each APK.</li>
-</ul>
-
-<p>Currently, these are the only device characteristics that Google Play supports for publishing
-multiple APKs as the same application.</p>
-
-<p class="note"><strong>Note:</strong> You should generally use multiple APKs to support
-different device configurations <strong>only when your APK is too large</strong> (greater than
-50MB). Using a single APK to support different configurations is always the best practice,
-because it makes the path for application updates simple and clear for users (and also makes
-your life simpler by avoiding development and publishing complexity). Read the section below about
-<a href="#SingleAPK">Using a Single APK Instead</a> to
-consider your options before publishing multiple APKs.</p>
-
-
-<h2 id="Concepts">Publishing Concepts</h2>
-
-<p>Before you start publishing multiple APKs on Google Play, you must understand a few
-concepts regarding how the Google Play publisher site works.</p>
-
-<h3 id="Active">Active APKs</h3>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h4>The difference between "Publish" and "Save"</h4>
- <p>When editing your application, there are two buttons on the top-right side of the page. The
-first button is either <strong>Publish</strong> or <strong>Unpublish</strong> and the second
-button is always <strong>Save</strong> (but its behavior changes).</p>
- <p>When your application is new or you have unpublished it from Google Play, the first
-button says <strong>Publish</strong>. Clicking it will publish any APKs listed as
-Active, making them available on Google Play. Also while your application is new
-or unpublished, clicking <strong>Save</strong> will save any changes you've made, such
-as information added to the Product details and APKs you've uploaded, but nothing is made visible on
-Google Play—this allows you to save your changes and sign out of the publisher site before
-deciding to publish.</p>
- <p>Once you've published your application, the first button changes to
-<strong>Unpublish</strong>. Clicking it in this state unpublishes your application so that none
-of the APKs are available on Google Play. Also while published, the behavior of the
-<strong>Save</strong> button is different. In this state, clicking <strong>Save</strong> not
-only saves all your changes, but also publishes them to Google Play. For example, if you've
-already published your application and then make changes to your product details or activate new
-APKs, clicking <strong>Save</strong> makes all those changes live on Google Play.</p>
-</div>
-</div>
-
-
-<p>Before you can publish your application (whether publishing one or multiple APKs), you
-must "activate" your APK(s) from the <strong>APK files</strong> tab. When you activate an APK, it
-moves into the list of <em>Active</em> APKs. This list allows you to preview which APK(s)
-you're about to publish.</p>
-
-<p>If there are no errors, any "active" APK will be published to
-Google Play when you click the <strong>Publish</strong> button (if the application is
-unpublished) or when you click the <strong>Save</strong> button (if the application is
-already published).</p>
-
-
-<h3 id="SimpleAndAdvanced">Simple mode and advanced mode</h3>
-
-<p>The Google Play publisher site provides two modes for managing the APKs associated with
-your application: <em>simple mode</em> and <em>advanced mode</em>. You can switch between these by
-clicking the
-link at the top-right corner of the <strong>APK files</strong> tab.</p>
-
-<p>Simple mode is the traditional way to publish an application, using one APK at a time. In
-simple mode, only one APK can be activated at a time. If you upload a new APK to update
-the application, clicking "Activate" on the new APK deactivates the currently
-active APK (you must then click <strong>Save</strong> to publish the new APK).</p>
-
-<p>Advanced mode allows you to activate and publish multiple APKs that are each designed for a
-specific set of device configurations. However, there are several rules based on the manifest
-declarations in each APK that determine whether you're allowed to activate each APK along with
-others. When you activate an APK and it violates one of the rules, you will receive an error or
-warning message. If it's an error, you cannot publish until you resolve the problem; if it's a
-warning, you can publish the activated APKs, but there might be unintended consequences as to
-whether your application is available for different devices. These rules are discussed more
-below.</p>
-
-
-<h2 id="HowItWorks">How Multiple APKs Work</h2>
-
-<p>The concept for using multiple APKs on Google Play is that you have just one entry in
-Google Play for your application, but different devices might download a different APK. This
-means that:</p>
-
-<ul>
- <li>You maintain only one set of product details (app description, icons, screenshots, etc.).
-This also means you <em>cannot</em> charge a different price for different APKs.</li>
- <li>All users see only one version of your application on Google Play, so they are not
-confused by different versions you may have published that are "for tablets" or
-"for phones."</li>
- <li>All user reviews are applied to the same application listing, even though users on different
-devices may have different APKs.</li>
- <li>If you publish different APKs for different versions of Android (for different API levels),
-then when a user's device receives a system update that qualifies them for a different APK you've
-published, Google Play updates the user's application to the APK designed for the higher version
-of Android. Any system data associated with the application is retained (the same as with normal
-application updates when using a single APK).</li>
-</ul>
-
-<p>To publish multiple APKs for the same application, you must enable <strong>Advanced mode</strong>
-in your application's <strong>APK files</strong> tab (as discussed in the previous section). Once
-in advanced mode, you can upload, activate, then publish multiple APKs for the same application. The
-following sections describe more about how it works.</p>
-
-
-<h3 id="SupportedFilters">Supported filters</h3>
-
-<p>Which devices receive each APK is determined by <a
-href="{@docRoot}guide/appendix/market-filters.html">Google Play filters</a> that are specified by
-elements in the manifest file of each APK. However, Google Play allows you to publish multiple
-APKs only when each APK uses filters to support a variation of the following
-device characteristics:</p>
-
-<ul>
- <li><strong>OpenGL texture compression formats</strong>
- <p>This is based on your manifest file's <a
-href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html">{@code
-<supports-gl-texture>}</a> element(s).</p>
- <p>For example, when developing a game that uses OpenGL ES, you can provide one APK for
-devices that support ATI texture compression and a separate APK for devices
-that support PowerVR compression (among many others).</p>
- <br/>
- </li>
-
- <li><strong>Screen size (and, optionally, screen density)</strong>
- <p>This is based on your manifest file's <a
-href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
-<supports-screens>}</a> <em>or</em> <a
-href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
-<compatible-screens>}</a> element. You should never use both elements and you should use only
-<a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
-<supports-screens>}</a> when possible.</p>
- <p>For example, you can provide one APK that supports small and normal size screens and another
-APK that supports large and xlarge screens.</p>
-
- <p class="note"><strong>Note:</strong> The Android system provides strong support for
-applications to support all screen configurations with a single APK. You should avoid creating
-multiple APKs to support different screens unless absolutely necessary and instead follow the guide
-to <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a> so that your application is flexible and can adapt to all screen configurations
-with a single APK.</p>
- <p class="caution"><strong>Caution:</strong> By default, all screen size attributes in the <a
-href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
-<supports-screens>}</a> element are "true" if you do not declare them otherwise. However,
-because the {@code android:xlargeScreens} attribute was added in Android 2.3 (API level
-9), Google Play will assume that it is "false" if your application does not set either <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
-android:minSdkVersion}</a> or <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
-android:targetSdkVersion}</a> to "9" or higher.</p>
- <p class="caution"><strong>Caution:</strong> You should not combine both <a
-href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
-<supports-screens>}</a> and <a
-href="{@docRoot}guide/topics/manifest/compatible-screens-element.html">{@code
-<compatible-screens>}</a> elements in your manifest file. Using both increases the chances
-that you'll introduce an error due to conflicts between them. For help deciding which to use, read
-<a href="{@docRoot}guide/practices/screens-distribution.html">Distributing to Specific Screens</a>.
-If you can't avoid using both, be aware that for any conflicts in agreement between a given size,
-"false" will win.</p>
- <br/>
- </li>
-
- <li><strong>API level</strong>
- <p>This is based on your manifest file's <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element.
-You
-can use both the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
-android:minSdkVersion}</a> and <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#max">{@code android:maxSdkVersion}</a>
-attributes to specify support for different API levels.</p>
- <p>For example, you can publish your application with one APK that supports API levels 4 - 7
-(Android 1.6 - 2.1)—using only APIs available since API level 4 or lower—and another
-APK that supports API levels 8 and above (Android 2.2+)—using APIs available since API level 8
-or lower.</p>
- <div class="note">
- <p><strong>Note:</strong></p>
- <ul>
- <li>If you use this characteristic as the factor to distinguish multiple APKs, then the APK
-with a higher <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
-android:minSdkVersion}</a> value must have a higher <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code android:versionCode}</a>
-value. This is also true if two APKs overlap their device support based on a different supported
-filter. This ensures that when a device receives a system update, Google Play can offer the user
-an update for your application (because updates are based on an increase in the app version code).
-This requirement is described further in the section below about <a href="#Rules">Rules for
-multiple APKs</a>.</li>
- <li>You should avoid using <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#max">{@code
-android:maxSdkVersion}</a> in general, because as long as you've properly developed your
-application with public APIs, it is always compatible with future versions of Android. If you want
-to publish a different APK for higher API levels, you still do not need to specify the
-maximum version, because if the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
-android:minSdkVersion}</a> is {@code "4"} in one APK and {@code "8"} in another, devices that
-support API level 8 or higher will always receive the second APK (because it's version code is
-higher, as per the previous note).</li>
- </ul>
- </div>
- </li>
-</ul>
-
-<p>Other manifest elements that enable <a
-href="{@docRoot}guide/appendix/market-filters.html">Google Play filters</a>—but are not
-listed above—are still applied for each APK as usual. However, Google Play does not allow
-you to publish multiple APKs based on variations of them. Thus, you cannot publish
-multiple APKs if the above listed filters are the same for each APK (but the APKs differ based on
-other characteristics in the manifest file). For
-example, you cannot provide different APKs that differ purely on the <a
-href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">{@code
-<uses-configuration>}</a> characteristics.</p>
-
-
-
-<h3 id="Rules">Rules for multiple APKs</h3>
-
-<p>Before you enable advanced mode to publish multiple APKs for your application, you need to
-understand the following rules that define how publishing multiple APKs works:</p>
-
-<ul>
- <li>All APKs you publish for the same application <strong>must have the same package
-name and be signed with the same certificate key</strong>.</li>
-
- <li>Each APK <strong>must have a different version code</strong>, specified by the
-<a href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code
-android:versionCode}</a> attribute.</li>
-
- <li>Each APK <strong>must not exactly match the configuration support of another APK</strong>.
- <p>That is, each APK must declare slightly different support for at least one of
-the <a href="#SupportedFilters">supported Google Play filters</a> (listed above).</p>
- <p>Usually, you will differentiate your APKs based on a specific characteristic (such as the
-supported texture compression formats), and thus, each APK will declare support for different
-devices. However, it's OK to publish multiple APKs that overlap their support slightly. When two
-APKs do overlap (they support some of the same device configurations), a device that falls within
-that overlap range will receive the APK with a higher version code (defined by <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code
-android:versionCode}</a>).</p></li>
-
- <li>You cannot activate a new APK that has a version code lower than that of the APK it's
-replacing. For example, say you have an active APK for screen sizes small - normal with version code
-0400, then try to replace it with an APK for the same screen sizes with version code 0300. This
-raises an error, because it means users of the previous APK will not be able to update the
-application.</li>
-
- <li>An APK that requires a <strong>higher API level</strong> must have a <strong>higher
-version code</strong>.
- <p>This is true only when either: the APKs differ based <em>only</em> on the
-supported API levels (no other <a href="#SupportedFilters">supported filters</a>
-distinguish the APKs from each other) <em>or</em> when the APKs do use another supported filter, but
-there is an overlap between the APKs within that filter.</p>
- <p>This is important because a user's device receives an application update from
-Google Play only if the version code for the APK on Google Play is higher than the version
-code of the APK currently on the device. This ensures that if a device receives a system update that
-then qualifies it to install the APK for higher API levels, the device receives an application
-update because the version code increases.</p>
-<p class="note"><strong>Note:</strong> The size of the version code increase is irrelevant; it
-simply needs to be larger in the version that supports higher API levels.</p>
- <p>Here are some examples:</p>
- <ul>
- <li>If an APK you've uploaded for API levels 4 and above (Android 1.6+) has a version code of
-{@code 0400}, then an APK for API levels 8 and above (Android 2.2+) must be {@code 0401} or
-greater. In this case, the API level is the only supported filter used, so the version codes
-<strong>must increase</strong> in correlation with the API level support for each APK, so that users
-get an update when they receive a system update.</li>
- <li>If you have one APK that's for API level 4 (and above) <em>and</em> small -
-large screens, and another APK for API level 8 (and above) <em>and</em> large - xlarge screens, then
-the version codes <strong>must increase</strong>. In this case, the API level filter is used to
-distinguish each APK, but so is the screen size. Because the screen sizes overlap (both APKs
-support large screens), the version codes must still be in order. This ensures that a large screen
-device that receives a system update to API level 8 will receive an update for the second
-APK.</li>
- <li>If you have one APK that's for API level 4 (and above) <em>and</em> small -
-normal screens, and another APK for API level 8 (and above) <em>and</em> large - xlarge
-screens, then the version codes <strong>do not need to increase</strong> in correlation with the API
-levels. Because there is no overlap within the screen size filter, there are no devices that
-could potentially move between these two APKs, so there's no need for the version codes to
-increase from the lower API level to the higher API level.</li>
- </ul>
- </li>
-
-</ul>
-
-<p>Failure to abide by the above rules results in an error on the Google Play publisher site
-when you activate your APKs—you will be unable to publish your application until you
-resolve the error.</p>
-
-<p>There are other conflicts that might occur when you activate your APKs, but which will result
-in warnings rather than errors. Warnings can be caused by the following:</p>
-
-<ul>
- <li>When you modify an APK to "shrink" the support for a device's characteristics and no other
-APKs support the devices that then fall outside the supported range. For example, if an APK
-currently supports small and normal size screens and you change it to support only small screens,
-then you have shrunk the pool of supported devices and some devices will no longer see your
-application on Google Play. You can resolve this by adding another APK that supports normal size
-screens so that all previously-supported devices are still supported.</li>
-
- <li>When there are "overlaps" between two or more APKs. For example, if an APK supports screen
-sizes small, normal, and large, while another APK supports sizes large and xlarge, there is an
-overlap, because both APKs support large screens. If you do not resolve this, then devices that
-qualify for both APKs (large screen devices in the example) will receive whichever APK has the
-highest version code.</li>
-</ul>
-
-<p>When such conflicts occur, you will see a warning message, but you can still publish your
-application.</p>
-
-
-
-<h2 id="CreatingApks">Creating Multiple APKs</h2>
-
-<p>Once you decide to publish multiple APKs, you probably need to create separate
-Android projects for each APK you intend to publish so that you can appropriately develop them
-separately. You can do this by simply duplicating your existing project and give it a new name.
-(Alternatively, you might use a build system that can output different resources—such
-as textures—based on the build configuration.)</p>
-
-<p class="note"><strong>Tip:</strong> One way to avoid duplicating large portions of your
-application code is to use a <a
-href="{@docRoot}guide/developing/projects/index.html#LibraryProjects">library project</a>. A library
-project holds shared code and resources, which you can include in your actual application
-projects.</p>
-
-<p>When creating multiple projects for the same application, it's a good practice to identify each
-one with a name that indicates the device restrictions to be placed on the APK, so you can
-easily identify them. For example, "HelloWorld_8" might be a good name for an
-application designed for API level 8 and above.</p>
-
-<p class="note"><strong>Note:</strong> All APKs you publish for the same application
-<strong>must have the same package name and be signed with the same certificate key</strong>. Be
-sure you also understand each of the <a href="#Rules">Rules for multiple APKs</a>.</p>
-
-
-<h3 id="VersionCodes">Assigning version codes</h3>
-
-<p>Each APK for the same application <strong>must have a unique version code</strong>, specified by
-the <a href="{@docRoot}guide/topics/manifest/manifest-element.html#vcode">{@code
-android:versionCode}</a> attribute. You must be careful about assigning version codes when
-publishing multiple APKs, because they must each be different, but in some
-cases, must or should be defined in a specific order, based on the configurations that each APK
-supports.</p>
-
-<h4>Ordering version codes</h4>
-
-<p>An APK that requires a higher API level must usually have a higher version code. For example, if
-you create two APKs to support different API levels, the APK for the higher API levels must have the
-higher version code. This ensures that if a device receives a system update that then qualifies it
-to install the APK for higher API levels, the user receives a notification to update the app. For
-more information about how this requirement applies, see the section above about <a
-href="#Rules">Rules for multiple APKs</a>.</p>
-
-<p>You should also consider how the order of version codes might affect which APK your users
-receive either due to overlap between coverage of different APKs or future changes you might make to
-your APKs.</p>
-
-<p>For example, if you have different APKs based on screen size, such as one for small - normal and
-one for large - xlarge, but foresee a time when you will change the APKs to be one for small and one
-for normal - xlarge, then you should make the version code for the large - xlarge APK be higher.
-That way, a normal size device will receive the appropriate update when you make the change, because
-the version code increases from the existing APK to the new APK that now supports the device. </p>
-
-<p>Also, when creating multiple APKs that differ based on support for different OpenGL texture
-compression formats, be aware that many devices support multiple formats. Because a device
-receives the APK with the highest version code when there is an overlap in coverage between two
-APKs, you should order the version codes among your APKs so that the APK with the
-preferred compression format has the highest version code. For example, you might want to perform
-separate builds for your app using PVRTC, ATITC, and ETC1 compression formats. If you prefer these
-formats in this exact order, then the APK that uses PVRTC should have the highest version code, the
-APK that uses ATITC has a lower version code, and the version with ETC1 has the lowest. Thus, if a
-device supports both PVRTC and ETC1, it receives the APK with PVRTC, because it has the highest
-version code.</p>
-
-
-<h4>Using a version code scheme</h4>
-
-<p>In order to allow different APKs to update their version codes independent of others (for
-example, when you fix a bug in only one APK, so don't need to update all APKs), you should use a
-scheme for your version codes that
-provides sufficient room between each APK so that you can increase the code in one without requiring
-an increase in others. You should also include your actual version name in the code (that is, the
-user visible version assigned to <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#vname">{@code android:versionName}</a>),
-so that it's easy for you to associate the version code and version name.</p>
-
-<p class="note"><strong>Note:</strong> When you increase the version code for an APK, Google
-Play will prompt users of the previous version to update the application. Thus, to avoid
-unnecessary updates, you should not increase the version code for APKs that do not actually
-include changes.</p>
-
-<p>We suggest using a version code with at least 7 digits: integers that represent
-the supported configurations are in the higher order bits, and the version name (from <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#vname">{@code
-android:versionName}</a>) is in the lower order bits. For example, when the application version
-name is 3.1.0, version codes for an API level 4
-APK and an API level 11 APK would be something like 0400310 and 1100310, respectively. The first
-two digits are reserved for the API Level (4 and 11, respectively), the middle two digits are for
-either screen sizes or GL texture formats (not used in these examples), and the last three digits
-are for the application's version name (3.1.0). Figure 1 shows two examples that split based on both
-the platform version (API Level) and screen size.</p>
-
-<img src="{@docRoot}images/market/version-codes.png" alt="" />
-<p class="img-caption"><strong>Figure 1.</strong> A suggested scheme for your version codes,
-using the first two digits for the API Level, the second and third digits for the minimum and
-maximum screen size (1 - 4 indicating each of the four sizes) or to denote the texture formats
-and the last three digits for the app version.</p>
-
-<p>This scheme for version codes is just a suggestion for how you should establish a
-pattern that is scalable as your application evolves. In particular, this scheme doesn't
-demonstrate a solution for identifying different texture compression formats. One option might be
-to define your own table that specifies a different integer to each of the different
-compression formats your application supports (for example, 1 might correspond to ETC1 and 2 is
-ATITC, and so on).</p>
-
-<p>You can use any scheme you want, but you should carefully consider how future versions of your
-application will need to increase their version codes and how devices can receive updates when
-either the device configuration changes (for example, due to a system update) or when you modify the
-configuration support for one or several of the APKs.</p>
-
-
-
-
-<h2 id="SingleAPK">Using a Single APK Instead</h2>
-
-<p><strong>Creating multiple APKs for your application is not the normal procedure</strong> for
-publishing an application on Google Play. In most cases, you should be able to publish your
-application to most users with a single APK and we encourage that you do so. When you encounter
-a situation in which using a single APK becomes difficult, you should carefully consider all your
-options before deciding to publish multiple APKs.</p>
-
-<p>First of all, there are a few key benefits to developing a single APK that supports all
-devices:</p>
-
-<ul>
- <li><strong>Publishing and managing your application is easier.</strong>
- <p>With only one APK to worry about at any given time, you're less likely to become confused by
-which APK is what. You also don't have to keep track of multiple version codes for each
-APK—by using only one APK, you can simply increase the version code with each release and
-be done.</p> </li>
- <li><strong>You need to manage only a single code base.</strong>
- <p>Although you can use a <a
-href="{@docRoot}guide/developing/projects/index.html#LibraryProjects">library project</a>
-to share code between multiple Android projects, it's still likely that you'll reproduce some code
-across each project and this could become difficult to manage, especially when resolving
-bugs.</p></li>
- <li><strong>Your application can adapt to device configuration changes.</strong>
- <p>By creating a single APK that contains all the resources for each device configuration, your
-application can adapt to configuration changes that occur at runtime. For example, if the user docks
-or otherwise connects a handset device to a larger screen, there's a chance that this will invoke a
-system configuration change to support the larger screen. If you include all resources for different
-screen configurations in the same APK, then your application will load alternative resources and
-optimize the user experience for the new interface.</p>
- </li>
- <li><strong>App restore across devices just works.</strong>
- <p>If a user has enabled data backup on his or her current device and then buys a new device
-that has a different configuration, then when the user's apps are automatically restored during
-setup, the user receives your application and it runs using the resources optimized for that device.
-For example, on a new tablet, the user receives your application and it runs with your
-tablet-optimized resources. This restore
-process does not work across different APKs, because each APK can potentially have different
-permissions that the user has not agreed to, so Google Play may not restore the application at
-all. (If you use multiple APKs, the user receives either the exact same APK if it's compatible or
-nothing at all and must manually download your application to get the APK designed for the new
-device.)</p></li>
-</ul>
-
-<p>The following sections describe some of the other options you should use to support multiple
-device configurations before deciding to publish multiple APKs.</p>
-
-
-
-<h3 id="TextureOptions">Supporting multiple GL textures</h3>
-
-<p>To support multiple types of GL textures with a single APK, your application should query the GL
-texture formats supported on the device and then use the appropriate resources or download
-them from a web server. For example, in order to keep the size of your APK small, you can query the
-device's support for different GL texture formats when the application starts for the first time and
-then download only the textures you need for that device.</p>
-
-<p>For maximum performance and compatibility, your application should use ETC1 textures wherever it
-doesn't impact the visual quality. However, because ETC1 cannot deal with images that have drastic
-chroma changes, such as line art and (most) text, and doesn't support alpha, it may not the best
-format for all textures.</p>
-
-<p>With a single APK, you should try to use ETC1 textures and uncompressed textures whenever
-reasonable, and consider the use of PVRTC, ATITC, or DXTC as a last resort when ETC1 does not
-suffice.</p>
-
-<p>Here's an example query for supported texture compression formats from inside a
-{@link android.opengl.GLSurfaceView.Renderer GLSurfaceView.Renderer}:</p>
-
-<pre>
-public void onSurfaceChanged(GL10 gl, int w, int h) {
- String extensions = gl.glGetString(GL10.GL_EXTENSIONS);
- Log.d("ExampleActivity", extensions);
-}
-</pre>
-
-<p>This returns a string that lists each of the supported compression formats.</p>
-
-
-
-<h3 id="ScreenOptions">Supporting multiple screens</h3>
-
-<p>Unless your APK file exceeds the Google Play size limit of 50MB, supporting multiple screens
-should always be done with a single APK. Since Android 1.6, the Android system manages most of the
-work required for your application to run successfully on a variety of screen sizes and
-densities.</p>
-
-<p>To further optimize your application for different screen sizes and densities, you should provide
-<a href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">alternative
-resources</a> such as bitmap drawables at different resolutions and different layout designs for
-different screen sizes.</p>
-
-<p>For more information about how to support multiple screens with a single APK, read <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
-
-<p>Additionally, you should consider using a support library from the <a
-href="{@docRoot}sdk/compatibility-library.html">Compatibility Package</a> so that you can add <a
-href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a> to your activity designs
-when running on larger screens such as tablets.</p>
-
-
-
-<h3 id="ApiLevelOptions">Supporting multiple API levels</h3>
-
-<p>If you want to support as many versions of the Android platform as possible, you should use
-only APIs available in the lowest reasonable version. For example, your application may not require
-APIs newer than Android 2.1 (API Level 7), which makes an application available to
-over 95% of Android-powered devices (as indicated by the <a
-href="{@docRoot}resources/dashboard/platform-versions.html">Platform Versions</a> dashboard).</p>
-
-<p>By using a support library from the <a
-href="{@docRoot}sdk/compatibility-library.html">Compatibility Package</a>, you can also use APIs
-from some of the latest versions (such as Android 3.0) while
-still supporting versions as low as Android 1.6. The support library includes APIs for <a
-href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a>, <a
-href="{@docRoot}guide/topics/fundamentals/loaders.html">Loaders</a>, and more. Using the fragment
-APIs is particularly valuable so that you can optimize your user interface for large devices such as
-tablets.</p>
-
-<p>Alternatively, if you want to use some APIs that are available only in newer versions of Android
-(which your application can still function without), then you should consider using reflection. By
-using reflection, you can check whether the current device supports certain APIs. If the APIs are
-not available, your application can gracefully disable and hide the feature.</p>
-
-<p>Another way to use new APIs only when running on a version that supports them is to check the
-API level of the current device. That is, you can query the value of {@link
-android.os.Build.VERSION#SDK_INT} and create different code paths depending on the API level
-supported by the device. For example:</p>
-
-<pre>
-if (android.os.Build.VERSION.SDK_INT >= 11) {
- // Use APIs supported by API level 11 (Android 3.0) and up
-} else {
- // Do something different to support older versions
-}
-</pre>
-
diff --git a/docs/html/guide/practices/design/accessibility.html b/docs/html/guide/practices/app-design/accessibility.html
similarity index 100%
rename from docs/html/guide/practices/design/accessibility.html
rename to docs/html/guide/practices/app-design/accessibility.html
diff --git a/docs/html/guide/practices/design/index.jd b/docs/html/guide/practices/app-design/index.jd
similarity index 100%
rename from docs/html/guide/practices/design/index.jd
rename to docs/html/guide/practices/app-design/index.jd
diff --git a/docs/html/guide/practices/design/jni.jd b/docs/html/guide/practices/app-design/jni.jd
similarity index 100%
rename from docs/html/guide/practices/design/jni.jd
rename to docs/html/guide/practices/app-design/jni.jd
diff --git a/docs/html/guide/practices/app-design/performance.jd b/docs/html/guide/practices/app-design/performance.jd
new file mode 100644
index 0000000..078999b
--- /dev/null
+++ b/docs/html/guide/practices/app-design/performance.jd
@@ -0,0 +1,410 @@
+page.title=Designing for Performance
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#intro">Introduction</a></li>
+ <li><a href="#optimize_judiciously">Optimize Judiciously</a></li>
+ <li><a href="#object_creation">Avoid Creating Unnecessary Objects</a></li>
+ <li><a href="#myths">Performance Myths</a></li>
+ <li><a href="#prefer_static">Prefer Static Over Virtual</a></li>
+ <li><a href="#internal_get_set">Avoid Internal Getters/Setters</a></li>
+ <li><a href="#use_final">Use Static Final For Constants</a></li>
+ <li><a href="#foreach">Use Enhanced For Loop Syntax</a></li>
+ <li><a href="#package_inner">Consider Package Instead of Private Access with Inner Classes</a></li>
+ <li><a href="#avoidfloat">Use Floating-Point Judiciously</a> </li>
+ <li><a href="#library">Know And Use The Libraries</a></li>
+ <li><a href="#native_methods">Use Native Methods Judiciously</a></li>
+ <li><a href="#closing_notes">Closing Notes</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>An Android application will run on a mobile device with limited computing
+power and storage, and constrained battery life. Because of
+this, it should be <em>efficient</em>. Battery life is one reason you might
+want to optimize your app even if it already seems to run "fast enough".
+Battery life is important to users, and Android's battery usage breakdown
+means users will know if your app is responsible draining their battery.</p>
+
+<p>Note that although this document primarily covers micro-optimizations,
+these will almost never make or break your software. Choosing the right
+algorithms and data structures should always be your priority, but is
+outside the scope of this document.</p>
+
+<a name="intro" id="intro"></a>
+<h2>Introduction</h2>
+
+<p>There are two basic rules for writing efficient code:</p>
+<ul>
+ <li>Don't do work that you don't need to do.</li>
+ <li>Don't allocate memory if you can avoid it.</li>
+</ul>
+
+<h2 id="optimize_judiciously">Optimize Judiciously</h2>
+
+<p>This document is about Android-specific micro-optimization, so it assumes
+that you've already used profiling to work out exactly what code needs to be
+optimized, and that you already have a way to measure the effect (good or bad)
+of any changes you make. You only have so much engineering time to invest, so
+it's important to know you're spending it wisely.
+
+<p>(See <a href="#closing_notes">Closing Notes</a> for more on profiling and
+writing effective benchmarks.)
+
+<p>This document also assumes that you made the best decisions about data
+structures and algorithms, and that you've also considered the future
+performance consequences of your API decisions. Using the right data
+structures and algorithms will make more difference than any of the advice
+here, and considering the performance consequences of your API decisions will
+make it easier to switch to better implementations later (this is more
+important for library code than for application code).
+
+<p>(If you need that kind of advice, see Josh Bloch's <em>Effective Java</em>,
+item 47.)</p>
+
+<p>One of the trickiest problems you'll face when micro-optimizing an Android
+app is that your app is pretty much guaranteed to be running on multiple
+hardware platforms. Different versions of the VM running on different
+processors running at different speeds. It's not even generally the case
+that you can simply say "device X is a factor F faster/slower than device Y",
+and scale your results from one device to others. In particular, measurement
+on the emulator tells you very little about performance on any device. There
+are also huge differences between devices with and without a JIT: the "best"
+code for a device with a JIT is not always the best code for a device
+without.</p>
+
+<p>If you want to know how your app performs on a given device, you need to
+test on that device.</p>
+
+<a name="object_creation"></a>
+<h2>Avoid Creating Unnecessary Objects</h2>
+
+<p>Object creation is never free. A generational GC with per-thread allocation
+pools for temporary objects can make allocation cheaper, but allocating memory
+is always more expensive than not allocating memory.</p>
+
+<p>If you allocate objects in a user interface loop, you will force a periodic
+garbage collection, creating little "hiccups" in the user experience. The
+concurrent collector introduced in Gingerbread helps, but unnecessary work
+should always be avoided.</p>
+
+<p>Thus, you should avoid creating object instances you don't need to. Some
+examples of things that can help:</p>
+
+<ul>
+ <li>If you have a method returning a string, and you know that its result
+ will always be appended to a StringBuffer anyway, change your signature
+ and implementation so that the function does the append directly,
+ instead of creating a short-lived temporary object.</li>
+ <li>When extracting strings from a set of input data, try
+ to return a substring of the original data, instead of creating a copy.
+ You will create a new String object, but it will share the char[]
+ with the data. (The trade-off being that if you're only using a small
+ part of the original input, you'll be keeping it all around in memory
+ anyway if you go this route.)</li>
+</ul>
+
+<p>A somewhat more radical idea is to slice up multidimensional arrays into
+parallel single one-dimension arrays:</p>
+
+<ul>
+ <li>An array of ints is a much better than an array of Integers,
+ but this also generalizes to the fact that two parallel arrays of ints
+ are also a <strong>lot</strong> more efficient than an array of (int,int)
+ objects. The same goes for any combination of primitive types.</li>
+ <li>If you need to implement a container that stores tuples of (Foo,Bar)
+ objects, try to remember that two parallel Foo[] and Bar[] arrays are
+ generally much better than a single array of custom (Foo,Bar) objects.
+ (The exception to this, of course, is when you're designing an API for
+ other code to access; in those cases, it's usually better to trade
+ good API design for a small hit in speed. But in your own internal
+ code, you should try and be as efficient as possible.)</li>
+</ul>
+
+<p>Generally speaking, avoid creating short-term temporary objects if you
+can. Fewer objects created mean less-frequent garbage collection, which has
+a direct impact on user experience.</p>
+
+<a name="avoid_enums" id="avoid_enums"></a>
+<a name="myths" id="myths"></a>
+<h2>Performance Myths</h2>
+
+<p>Previous versions of this document made various misleading claims. We
+address some of them here.</p>
+
+<p>On devices without a JIT, it is true that invoking methods via a
+variable with an exact type rather than an interface is slightly more
+efficient. (So, for example, it was cheaper to invoke methods on a
+<code>HashMap map</code> than a <code>Map map</code>, even though in both
+cases the map was a <code>HashMap</code>.) It was not the case that this
+was 2x slower; the actual difference was more like 6% slower. Furthermore,
+the JIT makes the two effectively indistinguishable.</p>
+
+<p>On devices without a JIT, caching field accesses is about 20% faster than
+repeatedly accesssing the field. With a JIT, field access costs about the same
+as local access, so this isn't a worthwhile optimization unless you feel it
+makes your code easier to read. (This is true of final, static, and static
+final fields too.)
+
+<a name="prefer_static" id="prefer_static"></a>
+<h2>Prefer Static Over Virtual</h2>
+
+<p>If you don't need to access an object's fields, make your method static.
+Invocations will be about 15%-20% faster.
+It's also good practice, because you can tell from the method
+signature that calling the method can't alter the object's state.</p>
+
+<a name="internal_get_set" id="internal_get_set"></a>
+<h2>Avoid Internal Getters/Setters</h2>
+
+<p>In native languages like C++ it's common practice to use getters (e.g.
+<code>i = getCount()</code>) instead of accessing the field directly (<code>i
+= mCount</code>). This is an excellent habit for C++, because the compiler can
+usually inline the access, and if you need to restrict or debug field access
+you can add the code at any time.</p>
+
+<p>On Android, this is a bad idea. Virtual method calls are expensive,
+much more so than instance field lookups. It's reasonable to follow
+common object-oriented programming practices and have getters and setters
+in the public interface, but within a class you should always access
+fields directly.</p>
+
+<p>Without a JIT, direct field access is about 3x faster than invoking a
+trivial getter. With the JIT (where direct field access is as cheap as
+accessing a local), direct field access is about 7x faster than invoking a
+trivial getter. This is true in Froyo, but will improve in the future when
+the JIT inlines getter methods.</p>
+
+<p>Note that if you're using ProGuard, you can have the best
+of both worlds because ProGuard can inline accessors for you.</p>
+
+<a name="use_final" id="use_final"></a>
+<h2>Use Static Final For Constants</h2>
+
+<p>Consider the following declaration at the top of a class:</p>
+
+<pre>static int intVal = 42;
+static String strVal = "Hello, world!";</pre>
+
+<p>The compiler generates a class initializer method, called
+<code><clinit></code>, that is executed when the class is first used.
+The method stores the value 42 into <code>intVal</code>, and extracts a
+reference from the classfile string constant table for <code>strVal</code>.
+When these values are referenced later on, they are accessed with field
+lookups.</p>
+
+<p>We can improve matters with the "final" keyword:</p>
+
+<pre>static final int intVal = 42;
+static final String strVal = "Hello, world!";</pre>
+
+<p>The class no longer requires a <code><clinit></code> method,
+because the constants go into static field initializers in the dex file.
+Code that refers to <code>intVal</code> will use
+the integer value 42 directly, and accesses to <code>strVal</code> will
+use a relatively inexpensive "string constant" instruction instead of a
+field lookup. (Note that this optimization only applies to primitive types and
+<code>String</code> constants, not arbitrary reference types. Still, it's good
+practice to declare constants <code>static final</code> whenever possible.)</p>
+
+<a name="foreach" id="foreach"></a>
+<h2>Use Enhanced For Loop Syntax</h2>
+
+<p>The enhanced for loop (also sometimes known as "for-each" loop) can be used
+for collections that implement the Iterable interface and for arrays.
+With collections, an iterator is allocated to make interface calls
+to hasNext() and next(). With an ArrayList, a hand-written counted loop is
+about 3x faster (with or without JIT), but for other collections the enhanced
+for loop syntax will be exactly equivalent to explicit iterator usage.</p>
+
+<p>There are several alternatives for iterating through an array:</p>
+
+<pre> static class Foo {
+ int mSplat;
+ }
+ Foo[] mArray = ...
+
+ public void zero() {
+ int sum = 0;
+ for (int i = 0; i < mArray.length; ++i) {
+ sum += mArray[i].mSplat;
+ }
+ }
+
+ public void one() {
+ int sum = 0;
+ Foo[] localArray = mArray;
+ int len = localArray.length;
+
+ for (int i = 0; i < len; ++i) {
+ sum += localArray[i].mSplat;
+ }
+ }
+
+ public void two() {
+ int sum = 0;
+ for (Foo a : mArray) {
+ sum += a.mSplat;
+ }
+ }
+</pre>
+
+<p><strong>zero()</strong> is slowest, because the JIT can't yet optimize away
+the cost of getting the array length once for every iteration through the
+loop.</p>
+
+<p><strong>one()</strong> is faster. It pulls everything out into local
+variables, avoiding the lookups. Only the array length offers a performance
+benefit.</p>
+
+<p><strong>two()</strong> is fastest for devices without a JIT, and
+indistinguishable from <strong>one()</strong> for devices with a JIT.
+It uses the enhanced for loop syntax introduced in version 1.5 of the Java
+programming language.</p>
+
+<p>To summarize: use the enhanced for loop by default, but consider a
+hand-written counted loop for performance-critical ArrayList iteration.</p>
+
+<p>(See also <em>Effective Java</em> item 46.)</p>
+
+<a name="package_inner" id="package_inner"></a>
+<h2>Consider Package Instead of Private Access with Private Inner Classes</h2>
+
+<p>Consider the following class definition:</p>
+
+<pre>public class Foo {
+ private class Inner {
+ void stuff() {
+ Foo.this.doStuff(Foo.this.mValue);
+ }
+ }
+
+ private int mValue;
+
+ public void run() {
+ Inner in = new Inner();
+ mValue = 27;
+ in.stuff();
+ }
+
+ private void doStuff(int value) {
+ System.out.println("Value is " + value);
+ }
+}</pre>
+
+<p>The key things to note here are that we define a private inner class
+(<code>Foo$Inner</code>) that directly accesses a private method and a private
+instance field in the outer class. This is legal, and the code prints "Value is
+27" as expected.</p>
+
+<p>The problem is that the VM considers direct access to <code>Foo</code>'s
+private members from <code>Foo$Inner</code> to be illegal because
+<code>Foo</code> and <code>Foo$Inner</code> are different classes, even though
+the Java language allows an inner class to access an outer class' private
+members. To bridge the gap, the compiler generates a couple of synthetic
+methods:</p>
+
+<pre>/*package*/ static int Foo.access$100(Foo foo) {
+ return foo.mValue;
+}
+/*package*/ static void Foo.access$200(Foo foo, int value) {
+ foo.doStuff(value);
+}</pre>
+
+<p>The inner class code calls these static methods whenever it needs to
+access the <code>mValue</code> field or invoke the <code>doStuff</code> method
+in the outer class. What this means is that the code above really boils down to
+a case where you're accessing member fields through accessor methods.
+Earlier we talked about how accessors are slower than direct field
+accesses, so this is an example of a certain language idiom resulting in an
+"invisible" performance hit.</p>
+
+<p>If you're using code like this in a performance hotspot, you can avoid the
+overhead by declaring fields and methods accessed by inner classes to have
+package access, rather than private access. Unfortunately this means the fields
+can be accessed directly by other classes in the same package, so you shouldn't
+use this in public API.</p>
+
+<a name="avoidfloat" id="avoidfloat"></a>
+<h2>Use Floating-Point Judiciously</h2>
+
+<p>As a rule of thumb, floating-point is about 2x slower than integer on
+Android devices. This is true on a FPU-less, JIT-less G1 and a Nexus One with
+an FPU and the JIT. (Of course, absolute speed difference between those two
+devices is about 10x for arithmetic operations.)</p>
+
+<p>In speed terms, there's no difference between <code>float</code> and
+<code>double</code> on the more modern hardware. Space-wise, <code>double</code>
+is 2x larger. As with desktop machines, assuming space isn't an issue, you
+should prefer <code>double</code> to <code>float</code>.</p>
+
+<p>Also, even for integers, some chips have hardware multiply but lack
+hardware divide. In such cases, integer division and modulus operations are
+performed in software — something to think about if you're designing a
+hash table or doing lots of math.</p>
+
+<a name="library" id="library"></a>
+<h2>Know And Use The Libraries</h2>
+
+<p>In addition to all the usual reasons to prefer library code over rolling
+your own, bear in mind that the system is at liberty to replace calls
+to library methods with hand-coded assembler, which may be better than the
+best code the JIT can produce for the equivalent Java. The typical example
+here is <code>String.indexOf</code> and friends, which Dalvik replaces with
+an inlined intrinsic. Similarly, the <code>System.arraycopy</code> method
+is about 9x faster than a hand-coded loop on a Nexus One with the JIT.</p>
+
+<p>(See also <em>Effective Java</em> item 47.)</p>
+
+<a name="native_methods" id="native_methods"></a>
+<h2>Use Native Methods Judiciously</h2>
+
+<p>Native code isn't necessarily more efficient than Java. For one thing,
+there's a cost associated with the Java-native transition, and the JIT can't
+optimize across these boundaries. If you're allocating native resources (memory
+on the native heap, file descriptors, or whatever), it can be significantly
+more difficult to arrange timely collection of these resources. You also
+need to compile your code for each architecture you wish to run on (rather
+than rely on it having a JIT). You may even have to compile multiple versions
+for what you consider the same architecture: native code compiled for the ARM
+processor in the G1 can't take full advantage of the ARM in the Nexus One, and
+code compiled for the ARM in the Nexus One won't run on the ARM in the G1.</p>
+
+<p>Native code is primarily useful when you have an existing native codebase
+that you want to port to Android, not for "speeding up" parts of a Java app.</p>
+
+<p>If you do need to use native code, you should read our
+<a href="{@docRoot}guide/practices/jni.html">JNI Tips</a>.</p>
+
+<p>(See also <em>Effective Java</em> item 54.)</p>
+
+<a name="closing_notes" id="closing_notes"></a>
+<h2>Closing Notes</h2>
+
+<p>One last thing: always measure. Before you start optimizing, make sure you
+have a problem. Make sure you can accurately measure your existing performance,
+or you won't be able to measure the benefit of the alternatives you try.</p>
+
+<p>Every claim made in this document is backed up by a benchmark. The source
+to these benchmarks can be found in the <a href="http://code.google.com/p/dalvik/source/browse/#svn/trunk/benchmarks">code.google.com "dalvik" project</a>.</p>
+
+<p>The benchmarks are built with the
+<a href="http://code.google.com/p/caliper/">Caliper</a> microbenchmarking
+framework for Java. Microbenchmarks are hard to get right, so Caliper goes out
+of its way to do the hard work for you, and even detect some cases where you're
+not measuring what you think you're measuring (because, say, the VM has
+managed to optimize all your code away). We highly recommend you use Caliper
+to run your own microbenchmarks.</p>
+
+<p>You may also find
+<a href="{@docRoot}tools/debugging/debugging-tracing.html">Traceview</a> useful
+for profiling, but it's important to realize that it currently disables the JIT,
+which may cause it to misattribute time to code that the JIT may be able to win
+back. It's especially important after making changes suggested by Traceview
+data to ensure that the resulting code actually runs faster when run without
+Traceview.
diff --git a/docs/html/guide/practices/design/responsiveness.jd b/docs/html/guide/practices/app-design/responsiveness.jd
similarity index 100%
rename from docs/html/guide/practices/design/responsiveness.jd
rename to docs/html/guide/practices/app-design/responsiveness.jd
diff --git a/docs/html/guide/practices/app-design/seamlessness.jd b/docs/html/guide/practices/app-design/seamlessness.jd
new file mode 100644
index 0000000..ec6b7fd
--- /dev/null
+++ b/docs/html/guide/practices/app-design/seamlessness.jd
@@ -0,0 +1,249 @@
+page.title=Designing for Seamlessness
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#drop">Don't Drop Data</a></li>
+ <li><a href="#expose">Don't Expose Raw Data</a></li>
+ <li><a href="#interrupt">Don't Interrupt the User</a></li>
+ <li><a href="#threads">Got a Lot to Do? Do it in a Thread</a></li>
+ <li><a href="#multiple-activities">Don't Overload a Single Activity Screen</a></li>
+ <li><a href="#themes">Extend System Themes</a></li>
+ <li><a href="#flexui">Design Your UI to Work with Multiple Screen Resolutions</a></li>
+ <li><a href="#network">Assume the Network is Slow</a></li>
+ <li><a href="#keyboard">Don't Assume Touchscreen or Keyboard</a></li>
+ <li><a href="#battery">Do Conserve the Device Battery</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>Even if your application is fast and responsive, certain design decisions can
+still cause problems for users — because of unplanned interactions with
+other applications or dialogs, inadvertent loss of data, unintended blocking,
+and so on. To avoid these problems, it helps to understand the context in which
+your applications run and the system interactions that can affect your
+application. In short, you should strive to develop an application that
+interacts seamlessly with the system and with other applications. </p>
+
+<p>A common seamlessness problem is when an application's background process
+— for example, a service or broadcast receiver — pops up a dialog in
+response to some event. This may seem like harmless behavior, especially when
+you are building and testing your application in isolation, on the emulator.
+However, when your application is run on an actual device, your application may
+not have user focus at the time your background process displays the dialog. So
+it could end up that your application would display it's dialog behind the
+active application, or it could take focus from the current application and
+display the dialog in front of whatever the user was doing (such as dialing a
+phone call, for example). That behavior would not work for your application or
+for the user. </p>
+
+<p>To avoid these problems, your application should use the proper system
+facility for notifying the user — the
+{@link android.app.Notification Notification} classes. Using
+notifications, your application can signal the user that an event has
+taken place, by displaying an icon in the status bar rather than taking
+focus and interrupting the user.</p>
+
+<p>Another example of a seamlessness problem is when an activity inadvertently
+loses state or user data because it doesn't correctly implement the onPause()
+and other lifecycle methods. Or, if your application exposes data intended to be
+used by other applications, you should expose it via a ContentProvider, rather
+than (for example) doing so through a world-readable raw file or database.</p>
+
+<p>What those examples have in common is that they involve cooperating nicely
+with the system and other applications. The Android system is designed to treat
+applications as a sort of federation of loosely-coupled components, rather than
+chunks of black-box code. This allows you as the developer to view the entire
+system as just an even-larger federation of these components. This benefits you
+by allowing you to integrate cleanly and seamlessly with other applications, and
+so you should design your own code to return the favor.</p>
+
+<p>This document discusses common seamlessness problems and how to avoid them.</p>
+
+<h2 id="drop">Don't Drop Data</h2>
+
+<p>Always keep in mind that Android is a mobile platform. It may seem obvious to
+say it, but it's important to remember that another Activity (such as the
+"Incoming Phone Call" app) can pop up over your own Activity at any moment.
+This will fire the onSaveInstanceState() and onPause() methods, and will likely result in
+your application being killed.</p>
+
+<p>If the user was editing data in your application when the other Activity
+appeared, your application will likely lose that data when your application is
+killed. Unless, of course, you save the work in progress first. The "Android
+Way" is to do just that: Android applications that accept or edit input should
+override the onSaveInstanceState() method and save their state in some appropriate
+fashion. When the user revisits the application, she should be able to
+retrieve her data.</p>
+
+<p>A classic example of a good use of this behavior is a mail application. If the
+user was composing an email when another Activity started up, the application
+should save the in-process email as a draft.</p>
+
+<h2 id="expose">Don't Expose Raw Data</h2>
+
+<p>If you wouldn't walk down the street in your underwear, neither should your
+data. While it's possible to expose certain kinds of application to the world
+to read, this is usually not the best idea. Exposing raw data requires other
+applications to understand your data format; if you change that format, you'll
+break any other applications that aren't similarly updated.</p>
+
+<p>The "Android Way" is to create a ContentProvider to expose your data to other
+applications via a clean, well-thought-out, and maintainable API. Using a
+ContentProvider is much like inserting a Java language interface to split up and
+componentize two tightly-coupled pieces of code. This means you'll be able to
+modify the internal format of your data without changing the interface exposed
+by the ContentProvider, and this without affecting other applications.</p>
+
+<h2 id="interrupt">Don't Interrupt the User</h2>
+
+<p>If the user is running an application (such as the Phone application during a
+call) it's a pretty safe bet he did it on purpose. That's why you should avoid
+spawning activities except in direct response to user input from the current
+Activity.</p>
+
+<p>That is, don't call startActivity() from BroadcastReceivers or Services running in
+the background. Doing so will interrupt whatever application is currently
+running, and result in an annoyed user. Perhaps even worse, your Activity may
+become a "keystroke bandit" and receive some of the input the user was in the
+middle of providing to the previous Activity. Depending on what your
+application does, this could be bad news.</p>
+
+<p>Instead of spawning Activity UIs directly from the background, you should
+instead use the NotificationManager to set Notifications. These will appear in
+the status bar, and the user can then click on them at his leisure, to see
+what your application has to show him.</p>
+
+<p>(Note that all this doesn't apply to cases where your own Activity is already
+in the foreground: in that case, the user expects to see your next Activity in
+response to input.)</p>
+
+<h2 id="threads">Got a Lot to Do? Do it in a Thread</h2>
+
+<p>If your application needs to perform some expensive or long-running
+computation, you should probably move it to a thread. This will prevent the
+dreaded "Application Not Responding" dialog from being displayed to the user,
+with the ultimate result being the fiery demise of your application.</p>
+
+<p>By default, all code in an Activity as well as all its Views run in the same
+thread. This is the same thread that also handles UI events. For example, when
+the user presses a key, a key-down event is added to the Activity's main
+thread's queue. The event handler system needs to dequeue and handle that
+event quickly; if it doesn't, the system concludes after a few seconds that
+the application is hung and offers to kill it for the user.</p>
+
+<p>If you have long-running code, running it inline in your Activity will run it
+on the event handler thread, effectively blocking the event handler. This will
+delay input processing, and result in the ANR dialogs. To avoid this, move
+your computations to a thread. This <a
+href="responsiveness.html">Design for Responsiveness</a> document
+discusses how to do that..</p>
+
+<h2 id="multiple-activities">Don't Overload a Single Activity Screen</h2>
+
+<p>Any application worth using will probably have several different screens.
+When designing the screens of your UI, be sure to make use of multiple Activity
+object instances.</p>
+
+<p>Depending on your development background, you may interpret an Activity as
+similar to something like a Java Applet, in that it is the entry point for
+your application. However, that's not quite accurate: where an Applet subclass
+is the single entry point for a Java Applet, an Activity should be thought of
+as one of potentially several entry points to your application. The only
+difference between your "main" Activity and any others you might have is that
+the "main" one just happens to be the only one that expressed an interest in
+the "android.intent.action.MAIN" action in your AndroidManifest..xml file.</p>
+
+<p>So, when designing your application, think of your application as a federation
+of Activity objects. This will make your code a lot more maintainable in the long
+run, and as a nice side effect also plays nicely with Android's application
+history and "backstack" model.</p>
+
+<h2 id="themes">Extend System Themes</h2>
+
+<p>When it comes to the look-and-feel of the user interface, it's important to
+blend in nicely. Users are jarred by applications which contrast with the user
+interface they've come to expect. When designing your UIs, you should try and
+avoid rolling your own as much as possible. Instead, use a Theme. You
+can override or extend those parts of the theme that you need to, but at least
+you're starting from the same UI base as all the other applications. For all
+the details, read <a href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a>.</p>
+
+<h2 id="flexui">Design Your UI to Work with Multiple Screen Resolutions</h2>
+
+<p>Different Android-powered devices will support different screen resolutions.
+Some will even be able to change resolutions on the fly, such as by switching
+to landscape mode. It's important to make sure your layouts and drawables
+are flexible enough to display properly on a variety of device screens.</p>
+
+<p>Fortunately, this is very easy to do. In brief, what you must do is
+provide different versions of your artwork (if you use any) for the key
+resolutions, and then design your layout to accommodate various dimensions.
+(For example, avoid using hard-coded positions and instead use relative
+layouts.) If you do that much, the system handles the rest, and your
+application looks great on any device.</p>
+
+<h2 id="network">Assume the Network is Slow</h2>
+
+<p>Android devices will come with a variety of network-connectivity options. All
+will have some data-access provision, though some will be faster than others.
+The lowest common denominator, however, is GPRS, the non-3G data service for
+GSM networks. Even 3G-capable devices will spend lots of time on non-3G
+networks, so slow networks will remain a reality for quite a long time to
+come.</p>
+
+<p>That's why you should always code your applications to minimize network
+accesses and bandwidth. You can't assume the network is fast, so you should
+always plan for it to be slow. If your users happen to be on faster networks,
+then that's great — their experience will only improve. You want to avoid the
+inverse case though: applications that are usable some of the time, but
+frustratingly slow the rest based on where the user is at any given moment are
+likely to be unpopular.</p>
+
+<p>One potential gotcha here is that it's very easy to fall into this trap if
+you're using the emulator, since the emulator uses your desktop computer's
+network connection. That's almost guaranteed to be much faster than a cell
+network, so you'll want to change the settings on the emulator that simulate
+slower network speeds. You can do this in Eclipse, in the "Emulator Settings"
+tab of your launch configuration or via a <a
+href="{@docRoot}tools/help/emulator.html#netspeed">command-line
+option</a> when starting the emulator.</p>
+
+<h2 id="keyboard">Don't Assume Touchscreen or Keyboard</h2>
+
+<p>
+Android will support a variety of handset form-factors. That's a fancy way of
+saying that some Android devices will have full "QWERTY" keyboards, while
+others will have 40-key, 12-key, or even other key configurations. Similarly,
+some devices will have touch-screens, but many won't.
+</p><p>
+When building your applications, keep that in mind. Don't make assumptions
+about specific keyboard layouts -- unless, of course, you're really interested
+in restricting your application so that it can only be used on those devices.
+</p>
+
+<h2 id="battery">Do Conserve the Device Battery</h2>
+<p>
+A mobile device isn't very mobile if it's constantly plugged into the
+wall. Mobile devices are battery-powered, and the longer we can make that
+battery last on a charge, the happier everyone is — especially the user.
+Two of the biggest consumers of battery power are the processor, and the
+radio; that's why it's important to write your applications to do as little
+work as possible, and use the network as infrequently as possible.
+</p><p>
+Minimizing the amount of processor time your application uses really comes
+down to <a href="performance.html">writing efficient
+code</a>. To minimize the power drain from using the radio, be sure to handle
+error conditions gracefully, and only fetch what you need. For example, don't
+constantly retry a network operation if one failed. If it failed once, it's
+likely because the user has no reception, so it's probably going to fail again
+if you try right away; all you'll do is waste battery power.
+</p><p>
+Users are pretty smart: if your program is power-hungry, you can count on
+them noticing. The only thing you can be sure of at that point is that your
+program won't stay installed very long.
+</p>
diff --git a/docs/html/guide/practices/compatibility.jd b/docs/html/guide/practices/compatibility.jd
index 5e514c4..a2284bd 100644
--- a/docs/html/guide/practices/compatibility.jd
+++ b/docs/html/guide/practices/compatibility.jd
@@ -7,7 +7,7 @@
<h2>See also</h2>
<ol>
<li><a
-href="{@docRoot}guide/appendix/market-filters.html">Filtering on Google Play</a></li>
+href="{@docRoot}guide/google/play/filters.html">Filtering on Google Play</a></li>
<li><a
href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">Providing Alternative Resources</a></li>
<li><a
@@ -54,7 +54,7 @@
ability to install and correctly run an Android <code>.apk</code> file.</p>
<p>There is exactly one Android API for each <a
-href="{@docRoot}guide/appendix/api-levels.html">API level</a>, and it’s the same
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level</a>, and it’s the same
API no matter what kind of device it’s installed on. No parts of the API are
optional, and you never have to worry about parts of the API missing on some
devices. Every compatible Android device your app will land on will include
@@ -119,7 +119,7 @@
<p style="margin-top:1em;">For information about other filters that you can
use to control the availability of your apps, see the
-<a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>
+<a href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a>
document.</p>
</div>
</div>
diff --git a/docs/html/guide/practices/design/performance.jd b/docs/html/guide/practices/design/performance.jd
deleted file mode 100644
index dd9b554..0000000
--- a/docs/html/guide/practices/design/performance.jd
+++ /dev/null
@@ -1,410 +0,0 @@
-page.title=Designing for Performance
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#intro">Introduction</a></li>
- <li><a href="#optimize_judiciously">Optimize Judiciously</a></li>
- <li><a href="#object_creation">Avoid Creating Unnecessary Objects</a></li>
- <li><a href="#myths">Performance Myths</a></li>
- <li><a href="#prefer_static">Prefer Static Over Virtual</a></li>
- <li><a href="#internal_get_set">Avoid Internal Getters/Setters</a></li>
- <li><a href="#use_final">Use Static Final For Constants</a></li>
- <li><a href="#foreach">Use Enhanced For Loop Syntax</a></li>
- <li><a href="#package_inner">Consider Package Instead of Private Access with Inner Classes</a></li>
- <li><a href="#avoidfloat">Use Floating-Point Judiciously</a> </li>
- <li><a href="#library">Know And Use The Libraries</a></li>
- <li><a href="#native_methods">Use Native Methods Judiciously</a></li>
- <li><a href="#closing_notes">Closing Notes</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>An Android application will run on a mobile device with limited computing
-power and storage, and constrained battery life. Because of
-this, it should be <em>efficient</em>. Battery life is one reason you might
-want to optimize your app even if it already seems to run "fast enough".
-Battery life is important to users, and Android's battery usage breakdown
-means users will know if your app is responsible draining their battery.</p>
-
-<p>Note that although this document primarily covers micro-optimizations,
-these will almost never make or break your software. Choosing the right
-algorithms and data structures should always be your priority, but is
-outside the scope of this document.</p>
-
-<a name="intro" id="intro"></a>
-<h2>Introduction</h2>
-
-<p>There are two basic rules for writing efficient code:</p>
-<ul>
- <li>Don't do work that you don't need to do.</li>
- <li>Don't allocate memory if you can avoid it.</li>
-</ul>
-
-<h2 id="optimize_judiciously">Optimize Judiciously</h2>
-
-<p>This document is about Android-specific micro-optimization, so it assumes
-that you've already used profiling to work out exactly what code needs to be
-optimized, and that you already have a way to measure the effect (good or bad)
-of any changes you make. You only have so much engineering time to invest, so
-it's important to know you're spending it wisely.
-
-<p>(See <a href="#closing_notes">Closing Notes</a> for more on profiling and
-writing effective benchmarks.)
-
-<p>This document also assumes that you made the best decisions about data
-structures and algorithms, and that you've also considered the future
-performance consequences of your API decisions. Using the right data
-structures and algorithms will make more difference than any of the advice
-here, and considering the performance consequences of your API decisions will
-make it easier to switch to better implementations later (this is more
-important for library code than for application code).
-
-<p>(If you need that kind of advice, see Josh Bloch's <em>Effective Java</em>,
-item 47.)</p>
-
-<p>One of the trickiest problems you'll face when micro-optimizing an Android
-app is that your app is pretty much guaranteed to be running on multiple
-hardware platforms. Different versions of the VM running on different
-processors running at different speeds. It's not even generally the case
-that you can simply say "device X is a factor F faster/slower than device Y",
-and scale your results from one device to others. In particular, measurement
-on the emulator tells you very little about performance on any device. There
-are also huge differences between devices with and without a JIT: the "best"
-code for a device with a JIT is not always the best code for a device
-without.</p>
-
-<p>If you want to know how your app performs on a given device, you need to
-test on that device.</p>
-
-<a name="object_creation"></a>
-<h2>Avoid Creating Unnecessary Objects</h2>
-
-<p>Object creation is never free. A generational GC with per-thread allocation
-pools for temporary objects can make allocation cheaper, but allocating memory
-is always more expensive than not allocating memory.</p>
-
-<p>If you allocate objects in a user interface loop, you will force a periodic
-garbage collection, creating little "hiccups" in the user experience. The
-concurrent collector introduced in Gingerbread helps, but unnecessary work
-should always be avoided.</p>
-
-<p>Thus, you should avoid creating object instances you don't need to. Some
-examples of things that can help:</p>
-
-<ul>
- <li>If you have a method returning a string, and you know that its result
- will always be appended to a StringBuffer anyway, change your signature
- and implementation so that the function does the append directly,
- instead of creating a short-lived temporary object.</li>
- <li>When extracting strings from a set of input data, try
- to return a substring of the original data, instead of creating a copy.
- You will create a new String object, but it will share the char[]
- with the data. (The trade-off being that if you're only using a small
- part of the original input, you'll be keeping it all around in memory
- anyway if you go this route.)</li>
-</ul>
-
-<p>A somewhat more radical idea is to slice up multidimensional arrays into
-parallel single one-dimension arrays:</p>
-
-<ul>
- <li>An array of ints is a much better than an array of Integers,
- but this also generalizes to the fact that two parallel arrays of ints
- are also a <strong>lot</strong> more efficient than an array of (int,int)
- objects. The same goes for any combination of primitive types.</li>
- <li>If you need to implement a container that stores tuples of (Foo,Bar)
- objects, try to remember that two parallel Foo[] and Bar[] arrays are
- generally much better than a single array of custom (Foo,Bar) objects.
- (The exception to this, of course, is when you're designing an API for
- other code to access; in those cases, it's usually better to trade
- good API design for a small hit in speed. But in your own internal
- code, you should try and be as efficient as possible.)</li>
-</ul>
-
-<p>Generally speaking, avoid creating short-term temporary objects if you
-can. Fewer objects created mean less-frequent garbage collection, which has
-a direct impact on user experience.</p>
-
-<a name="avoid_enums" id="avoid_enums"></a>
-<a name="myths" id="myths"></a>
-<h2>Performance Myths</h2>
-
-<p>Previous versions of this document made various misleading claims. We
-address some of them here.</p>
-
-<p>On devices without a JIT, it is true that invoking methods via a
-variable with an exact type rather than an interface is slightly more
-efficient. (So, for example, it was cheaper to invoke methods on a
-<code>HashMap map</code> than a <code>Map map</code>, even though in both
-cases the map was a <code>HashMap</code>.) It was not the case that this
-was 2x slower; the actual difference was more like 6% slower. Furthermore,
-the JIT makes the two effectively indistinguishable.</p>
-
-<p>On devices without a JIT, caching field accesses is about 20% faster than
-repeatedly accesssing the field. With a JIT, field access costs about the same
-as local access, so this isn't a worthwhile optimization unless you feel it
-makes your code easier to read. (This is true of final, static, and static
-final fields too.)
-
-<a name="prefer_static" id="prefer_static"></a>
-<h2>Prefer Static Over Virtual</h2>
-
-<p>If you don't need to access an object's fields, make your method static.
-Invocations will be about 15%-20% faster.
-It's also good practice, because you can tell from the method
-signature that calling the method can't alter the object's state.</p>
-
-<a name="internal_get_set" id="internal_get_set"></a>
-<h2>Avoid Internal Getters/Setters</h2>
-
-<p>In native languages like C++ it's common practice to use getters (e.g.
-<code>i = getCount()</code>) instead of accessing the field directly (<code>i
-= mCount</code>). This is an excellent habit for C++, because the compiler can
-usually inline the access, and if you need to restrict or debug field access
-you can add the code at any time.</p>
-
-<p>On Android, this is a bad idea. Virtual method calls are expensive,
-much more so than instance field lookups. It's reasonable to follow
-common object-oriented programming practices and have getters and setters
-in the public interface, but within a class you should always access
-fields directly.</p>
-
-<p>Without a JIT, direct field access is about 3x faster than invoking a
-trivial getter. With the JIT (where direct field access is as cheap as
-accessing a local), direct field access is about 7x faster than invoking a
-trivial getter. This is true in Froyo, but will improve in the future when
-the JIT inlines getter methods.</p>
-
-<p>Note that if you're using ProGuard, you can have the best
-of both worlds because ProGuard can inline accessors for you.</p>
-
-<a name="use_final" id="use_final"></a>
-<h2>Use Static Final For Constants</h2>
-
-<p>Consider the following declaration at the top of a class:</p>
-
-<pre>static int intVal = 42;
-static String strVal = "Hello, world!";</pre>
-
-<p>The compiler generates a class initializer method, called
-<code><clinit></code>, that is executed when the class is first used.
-The method stores the value 42 into <code>intVal</code>, and extracts a
-reference from the classfile string constant table for <code>strVal</code>.
-When these values are referenced later on, they are accessed with field
-lookups.</p>
-
-<p>We can improve matters with the "final" keyword:</p>
-
-<pre>static final int intVal = 42;
-static final String strVal = "Hello, world!";</pre>
-
-<p>The class no longer requires a <code><clinit></code> method,
-because the constants go into static field initializers in the dex file.
-Code that refers to <code>intVal</code> will use
-the integer value 42 directly, and accesses to <code>strVal</code> will
-use a relatively inexpensive "string constant" instruction instead of a
-field lookup. (Note that this optimization only applies to primitive types and
-<code>String</code> constants, not arbitrary reference types. Still, it's good
-practice to declare constants <code>static final</code> whenever possible.)</p>
-
-<a name="foreach" id="foreach"></a>
-<h2>Use Enhanced For Loop Syntax</h2>
-
-<p>The enhanced for loop (also sometimes known as "for-each" loop) can be used
-for collections that implement the Iterable interface and for arrays.
-With collections, an iterator is allocated to make interface calls
-to hasNext() and next(). With an ArrayList, a hand-written counted loop is
-about 3x faster (with or without JIT), but for other collections the enhanced
-for loop syntax will be exactly equivalent to explicit iterator usage.</p>
-
-<p>There are several alternatives for iterating through an array:</p>
-
-<pre> static class Foo {
- int mSplat;
- }
- Foo[] mArray = ...
-
- public void zero() {
- int sum = 0;
- for (int i = 0; i < mArray.length; ++i) {
- sum += mArray[i].mSplat;
- }
- }
-
- public void one() {
- int sum = 0;
- Foo[] localArray = mArray;
- int len = localArray.length;
-
- for (int i = 0; i < len; ++i) {
- sum += localArray[i].mSplat;
- }
- }
-
- public void two() {
- int sum = 0;
- for (Foo a : mArray) {
- sum += a.mSplat;
- }
- }
-</pre>
-
-<p><strong>zero()</strong> is slowest, because the JIT can't yet optimize away
-the cost of getting the array length once for every iteration through the
-loop.</p>
-
-<p><strong>one()</strong> is faster. It pulls everything out into local
-variables, avoiding the lookups. Only the array length offers a performance
-benefit.</p>
-
-<p><strong>two()</strong> is fastest for devices without a JIT, and
-indistinguishable from <strong>one()</strong> for devices with a JIT.
-It uses the enhanced for loop syntax introduced in version 1.5 of the Java
-programming language.</p>
-
-<p>To summarize: use the enhanced for loop by default, but consider a
-hand-written counted loop for performance-critical ArrayList iteration.</p>
-
-<p>(See also <em>Effective Java</em> item 46.)</p>
-
-<a name="package_inner" id="package_inner"></a>
-<h2>Consider Package Instead of Private Access with Private Inner Classes</h2>
-
-<p>Consider the following class definition:</p>
-
-<pre>public class Foo {
- private class Inner {
- void stuff() {
- Foo.this.doStuff(Foo.this.mValue);
- }
- }
-
- private int mValue;
-
- public void run() {
- Inner in = new Inner();
- mValue = 27;
- in.stuff();
- }
-
- private void doStuff(int value) {
- System.out.println("Value is " + value);
- }
-}</pre>
-
-<p>The key things to note here are that we define a private inner class
-(<code>Foo$Inner</code>) that directly accesses a private method and a private
-instance field in the outer class. This is legal, and the code prints "Value is
-27" as expected.</p>
-
-<p>The problem is that the VM considers direct access to <code>Foo</code>'s
-private members from <code>Foo$Inner</code> to be illegal because
-<code>Foo</code> and <code>Foo$Inner</code> are different classes, even though
-the Java language allows an inner class to access an outer class' private
-members. To bridge the gap, the compiler generates a couple of synthetic
-methods:</p>
-
-<pre>/*package*/ static int Foo.access$100(Foo foo) {
- return foo.mValue;
-}
-/*package*/ static void Foo.access$200(Foo foo, int value) {
- foo.doStuff(value);
-}</pre>
-
-<p>The inner class code calls these static methods whenever it needs to
-access the <code>mValue</code> field or invoke the <code>doStuff</code> method
-in the outer class. What this means is that the code above really boils down to
-a case where you're accessing member fields through accessor methods.
-Earlier we talked about how accessors are slower than direct field
-accesses, so this is an example of a certain language idiom resulting in an
-"invisible" performance hit.</p>
-
-<p>If you're using code like this in a performance hotspot, you can avoid the
-overhead by declaring fields and methods accessed by inner classes to have
-package access, rather than private access. Unfortunately this means the fields
-can be accessed directly by other classes in the same package, so you shouldn't
-use this in public API.</p>
-
-<a name="avoidfloat" id="avoidfloat"></a>
-<h2>Use Floating-Point Judiciously</h2>
-
-<p>As a rule of thumb, floating-point is about 2x slower than integer on
-Android devices. This is true on a FPU-less, JIT-less G1 and a Nexus One with
-an FPU and the JIT. (Of course, absolute speed difference between those two
-devices is about 10x for arithmetic operations.)</p>
-
-<p>In speed terms, there's no difference between <code>float</code> and
-<code>double</code> on the more modern hardware. Space-wise, <code>double</code>
-is 2x larger. As with desktop machines, assuming space isn't an issue, you
-should prefer <code>double</code> to <code>float</code>.</p>
-
-<p>Also, even for integers, some chips have hardware multiply but lack
-hardware divide. In such cases, integer division and modulus operations are
-performed in software — something to think about if you're designing a
-hash table or doing lots of math.</p>
-
-<a name="library" id="library"></a>
-<h2>Know And Use The Libraries</h2>
-
-<p>In addition to all the usual reasons to prefer library code over rolling
-your own, bear in mind that the system is at liberty to replace calls
-to library methods with hand-coded assembler, which may be better than the
-best code the JIT can produce for the equivalent Java. The typical example
-here is <code>String.indexOf</code> and friends, which Dalvik replaces with
-an inlined intrinsic. Similarly, the <code>System.arraycopy</code> method
-is about 9x faster than a hand-coded loop on a Nexus One with the JIT.</p>
-
-<p>(See also <em>Effective Java</em> item 47.)</p>
-
-<a name="native_methods" id="native_methods"></a>
-<h2>Use Native Methods Judiciously</h2>
-
-<p>Native code isn't necessarily more efficient than Java. For one thing,
-there's a cost associated with the Java-native transition, and the JIT can't
-optimize across these boundaries. If you're allocating native resources (memory
-on the native heap, file descriptors, or whatever), it can be significantly
-more difficult to arrange timely collection of these resources. You also
-need to compile your code for each architecture you wish to run on (rather
-than rely on it having a JIT). You may even have to compile multiple versions
-for what you consider the same architecture: native code compiled for the ARM
-processor in the G1 can't take full advantage of the ARM in the Nexus One, and
-code compiled for the ARM in the Nexus One won't run on the ARM in the G1.</p>
-
-<p>Native code is primarily useful when you have an existing native codebase
-that you want to port to Android, not for "speeding up" parts of a Java app.</p>
-
-<p>If you do need to use native code, you should read our
-<a href="{@docRoot}guide/practices/design/jni.html">JNI Tips</a>.</p>
-
-<p>(See also <em>Effective Java</em> item 54.)</p>
-
-<a name="closing_notes" id="closing_notes"></a>
-<h2>Closing Notes</h2>
-
-<p>One last thing: always measure. Before you start optimizing, make sure you
-have a problem. Make sure you can accurately measure your existing performance,
-or you won't be able to measure the benefit of the alternatives you try.</p>
-
-<p>Every claim made in this document is backed up by a benchmark. The source
-to these benchmarks can be found in the <a href="http://code.google.com/p/dalvik/source/browse/#svn/trunk/benchmarks">code.google.com "dalvik" project</a>.</p>
-
-<p>The benchmarks are built with the
-<a href="http://code.google.com/p/caliper/">Caliper</a> microbenchmarking
-framework for Java. Microbenchmarks are hard to get right, so Caliper goes out
-of its way to do the hard work for you, and even detect some cases where you're
-not measuring what you think you're measuring (because, say, the VM has
-managed to optimize all your code away). We highly recommend you use Caliper
-to run your own microbenchmarks.</p>
-
-<p>You may also find
-<a href="{@docRoot}guide/developing/debugging/debugging-tracing.html">Traceview</a> useful
-for profiling, but it's important to realize that it currently disables the JIT,
-which may cause it to misattribute time to code that the JIT may be able to win
-back. It's especially important after making changes suggested by Traceview
-data to ensure that the resulting code actually runs faster when run without
-Traceview.
diff --git a/docs/html/guide/practices/design/seamlessness.jd b/docs/html/guide/practices/design/seamlessness.jd
deleted file mode 100644
index 6c73426..0000000
--- a/docs/html/guide/practices/design/seamlessness.jd
+++ /dev/null
@@ -1,249 +0,0 @@
-page.title=Designing for Seamlessness
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#drop">Don't Drop Data</a></li>
- <li><a href="#expose">Don't Expose Raw Data</a></li>
- <li><a href="#interrupt">Don't Interrupt the User</a></li>
- <li><a href="#threads">Got a Lot to Do? Do it in a Thread</a></li>
- <li><a href="#multiple-activities">Don't Overload a Single Activity Screen</a></li>
- <li><a href="#themes">Extend System Themes</a></li>
- <li><a href="#flexui">Design Your UI to Work with Multiple Screen Resolutions</a></li>
- <li><a href="#network">Assume the Network is Slow</a></li>
- <li><a href="#keyboard">Don't Assume Touchscreen or Keyboard</a></li>
- <li><a href="#battery">Do Conserve the Device Battery</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>Even if your application is fast and responsive, certain design decisions can
-still cause problems for users — because of unplanned interactions with
-other applications or dialogs, inadvertent loss of data, unintended blocking,
-and so on. To avoid these problems, it helps to understand the context in which
-your applications run and the system interactions that can affect your
-application. In short, you should strive to develop an application that
-interacts seamlessly with the system and with other applications. </p>
-
-<p>A common seamlessness problem is when an application's background process
-— for example, a service or broadcast receiver — pops up a dialog in
-response to some event. This may seem like harmless behavior, especially when
-you are building and testing your application in isolation, on the emulator.
-However, when your application is run on an actual device, your application may
-not have user focus at the time your background process displays the dialog. So
-it could end up that your application would display it's dialog behind the
-active application, or it could take focus from the current application and
-display the dialog in front of whatever the user was doing (such as dialing a
-phone call, for example). That behavior would not work for your application or
-for the user. </p>
-
-<p>To avoid these problems, your application should use the proper system
-facility for notifying the user — the
-{@link android.app.Notification Notification} classes. Using
-notifications, your application can signal the user that an event has
-taken place, by displaying an icon in the status bar rather than taking
-focus and interrupting the user.</p>
-
-<p>Another example of a seamlessness problem is when an activity inadvertently
-loses state or user data because it doesn't correctly implement the onPause()
-and other lifecycle methods. Or, if your application exposes data intended to be
-used by other applications, you should expose it via a ContentProvider, rather
-than (for example) doing so through a world-readable raw file or database.</p>
-
-<p>What those examples have in common is that they involve cooperating nicely
-with the system and other applications. The Android system is designed to treat
-applications as a sort of federation of loosely-coupled components, rather than
-chunks of black-box code. This allows you as the developer to view the entire
-system as just an even-larger federation of these components. This benefits you
-by allowing you to integrate cleanly and seamlessly with other applications, and
-so you should design your own code to return the favor.</p>
-
-<p>This document discusses common seamlessness problems and how to avoid them.</p>
-
-<h2 id="drop">Don't Drop Data</h2>
-
-<p>Always keep in mind that Android is a mobile platform. It may seem obvious to
-say it, but it's important to remember that another Activity (such as the
-"Incoming Phone Call" app) can pop up over your own Activity at any moment.
-This will fire the onSaveInstanceState() and onPause() methods, and will likely result in
-your application being killed.</p>
-
-<p>If the user was editing data in your application when the other Activity
-appeared, your application will likely lose that data when your application is
-killed. Unless, of course, you save the work in progress first. The "Android
-Way" is to do just that: Android applications that accept or edit input should
-override the onSaveInstanceState() method and save their state in some appropriate
-fashion. When the user revisits the application, she should be able to
-retrieve her data.</p>
-
-<p>A classic example of a good use of this behavior is a mail application. If the
-user was composing an email when another Activity started up, the application
-should save the in-process email as a draft.</p>
-
-<h2 id="expose">Don't Expose Raw Data</h2>
-
-<p>If you wouldn't walk down the street in your underwear, neither should your
-data. While it's possible to expose certain kinds of application to the world
-to read, this is usually not the best idea. Exposing raw data requires other
-applications to understand your data format; if you change that format, you'll
-break any other applications that aren't similarly updated.</p>
-
-<p>The "Android Way" is to create a ContentProvider to expose your data to other
-applications via a clean, well-thought-out, and maintainable API. Using a
-ContentProvider is much like inserting a Java language interface to split up and
-componentize two tightly-coupled pieces of code. This means you'll be able to
-modify the internal format of your data without changing the interface exposed
-by the ContentProvider, and this without affecting other applications.</p>
-
-<h2 id="interrupt">Don't Interrupt the User</h2>
-
-<p>If the user is running an application (such as the Phone application during a
-call) it's a pretty safe bet he did it on purpose. That's why you should avoid
-spawning activities except in direct response to user input from the current
-Activity.</p>
-
-<p>That is, don't call startActivity() from BroadcastReceivers or Services running in
-the background. Doing so will interrupt whatever application is currently
-running, and result in an annoyed user. Perhaps even worse, your Activity may
-become a "keystroke bandit" and receive some of the input the user was in the
-middle of providing to the previous Activity. Depending on what your
-application does, this could be bad news.</p>
-
-<p>Instead of spawning Activity UIs directly from the background, you should
-instead use the NotificationManager to set Notifications. These will appear in
-the status bar, and the user can then click on them at his leisure, to see
-what your application has to show him.</p>
-
-<p>(Note that all this doesn't apply to cases where your own Activity is already
-in the foreground: in that case, the user expects to see your next Activity in
-response to input.)</p>
-
-<h2 id="threads">Got a Lot to Do? Do it in a Thread</h2>
-
-<p>If your application needs to perform some expensive or long-running
-computation, you should probably move it to a thread. This will prevent the
-dreaded "Application Not Responding" dialog from being displayed to the user,
-with the ultimate result being the fiery demise of your application.</p>
-
-<p>By default, all code in an Activity as well as all its Views run in the same
-thread. This is the same thread that also handles UI events. For example, when
-the user presses a key, a key-down event is added to the Activity's main
-thread's queue. The event handler system needs to dequeue and handle that
-event quickly; if it doesn't, the system concludes after a few seconds that
-the application is hung and offers to kill it for the user.</p>
-
-<p>If you have long-running code, running it inline in your Activity will run it
-on the event handler thread, effectively blocking the event handler. This will
-delay input processing, and result in the ANR dialogs. To avoid this, move
-your computations to a thread. This <a
-href="responsiveness.html">Design for Responsiveness</a> document
-discusses how to do that..</p>
-
-<h2 id="multiple-activities">Don't Overload a Single Activity Screen</h2>
-
-<p>Any application worth using will probably have several different screens.
-When designing the screens of your UI, be sure to make use of multiple Activity
-object instances.</p>
-
-<p>Depending on your development background, you may interpret an Activity as
-similar to something like a Java Applet, in that it is the entry point for
-your application. However, that's not quite accurate: where an Applet subclass
-is the single entry point for a Java Applet, an Activity should be thought of
-as one of potentially several entry points to your application. The only
-difference between your "main" Activity and any others you might have is that
-the "main" one just happens to be the only one that expressed an interest in
-the "android.intent.action.MAIN" action in your AndroidManifest..xml file.</p>
-
-<p>So, when designing your application, think of your application as a federation
-of Activity objects. This will make your code a lot more maintainable in the long
-run, and as a nice side effect also plays nicely with Android's application
-history and "backstack" model.</p>
-
-<h2 id="themes">Extend System Themes</h2>
-
-<p>When it comes to the look-and-feel of the user interface, it's important to
-blend in nicely. Users are jarred by applications which contrast with the user
-interface they've come to expect. When designing your UIs, you should try and
-avoid rolling your own as much as possible. Instead, use a Theme. You
-can override or extend those parts of the theme that you need to, but at least
-you're starting from the same UI base as all the other applications. For all
-the details, read <a href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a>.</p>
-
-<h2 id="flexui">Design Your UI to Work with Multiple Screen Resolutions</h2>
-
-<p>Different Android-powered devices will support different screen resolutions.
-Some will even be able to change resolutions on the fly, such as by switching
-to landscape mode. It's important to make sure your layouts and drawables
-are flexible enough to display properly on a variety of device screens.</p>
-
-<p>Fortunately, this is very easy to do. In brief, what you must do is
-provide different versions of your artwork (if you use any) for the key
-resolutions, and then design your layout to accommodate various dimensions.
-(For example, avoid using hard-coded positions and instead use relative
-layouts.) If you do that much, the system handles the rest, and your
-application looks great on any device.</p>
-
-<h2 id="network">Assume the Network is Slow</h2>
-
-<p>Android devices will come with a variety of network-connectivity options. All
-will have some data-access provision, though some will be faster than others.
-The lowest common denominator, however, is GPRS, the non-3G data service for
-GSM networks. Even 3G-capable devices will spend lots of time on non-3G
-networks, so slow networks will remain a reality for quite a long time to
-come.</p>
-
-<p>That's why you should always code your applications to minimize network
-accesses and bandwidth. You can't assume the network is fast, so you should
-always plan for it to be slow. If your users happen to be on faster networks,
-then that's great — their experience will only improve. You want to avoid the
-inverse case though: applications that are usable some of the time, but
-frustratingly slow the rest based on where the user is at any given moment are
-likely to be unpopular.</p>
-
-<p>One potential gotcha here is that it's very easy to fall into this trap if
-you're using the emulator, since the emulator uses your desktop computer's
-network connection. That's almost guaranteed to be much faster than a cell
-network, so you'll want to change the settings on the emulator that simulate
-slower network speeds. You can do this in Eclipse, in the "Emulator Settings"
-tab of your launch configuration or via a <a
-href="{@docRoot}guide/developing/tools/emulator.html#netspeed">command-line
-option</a> when starting the emulator.</p>
-
-<h2 id="keyboard">Don't Assume Touchscreen or Keyboard</h2>
-
-<p>
-Android will support a variety of handset form-factors. That's a fancy way of
-saying that some Android devices will have full "QWERTY" keyboards, while
-others will have 40-key, 12-key, or even other key configurations. Similarly,
-some devices will have touch-screens, but many won't.
-</p><p>
-When building your applications, keep that in mind. Don't make assumptions
-about specific keyboard layouts -- unless, of course, you're really interested
-in restricting your application so that it can only be used on those devices.
-</p>
-
-<h2 id="battery">Do Conserve the Device Battery</h2>
-<p>
-A mobile device isn't very mobile if it's constantly plugged into the
-wall. Mobile devices are battery-powered, and the longer we can make that
-battery last on a charge, the happier everyone is — especially the user.
-Two of the biggest consumers of battery power are the processor, and the
-radio; that's why it's important to write your applications to do as little
-work as possible, and use the network as infrequently as possible.
-</p><p>
-Minimizing the amount of processor time your application uses really comes
-down to <a href="performance.html">writing efficient
-code</a>. To minimize the power drain from using the radio, be sure to handle
-error conditions gracefully, and only fetch what you need. For example, don't
-constantly retry a network operation if one failed. If it failed once, it's
-likely because the user has no reception, so it's probably going to fail again
-if you try right away; all you'll do is waste battery power.
-</p><p>
-Users are pretty smart: if your program is power-hungry, you can count on
-them noticing. The only thing you can be sure of at that point is that your
-program won't stay installed very long.
-</p>
diff --git a/docs/html/guide/practices/index.html b/docs/html/guide/practices/index.html
deleted file mode 100644
index 4881acf..0000000
--- a/docs/html/guide/practices/index.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=../index.html">
-</head>
-<body>
-<a href="../index.html">click here</a> if you are not redirected.
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/practices/index.jd b/docs/html/guide/practices/index.jd
new file mode 100644
index 0000000..e218b50
--- /dev/null
+++ b/docs/html/guide/practices/index.jd
@@ -0,0 +1,52 @@
+page.title=Best Practices
+page.landing=true
+page.landing.intro=Design and build apps the right way. Learn how to create apps that look great and perform well on as many devices as possible, from phones to tablets and more.
+page.landing.image=
+
+@jd:body
+
+<div class="landing-docs">
+
+ <div class="col-12">
+ <h3>Blog Articles</h3>
+
+ <a href="android-developers.blogspot.com/2010/10/improving-app-quality.html">
+ <h4>Improving App Quality</h4>
+ <p>One way of improving your app’s visibility in the ecosystem is by deploying well-targeted
+mobile advertising campaigns and cross-app promotions. However, there’s another time-tested method
+of fueling the impression-install-ranking cycle: improve the product!</p>
+ </a>
+
+ <a href="http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html">
+ <h4>Say Goodbye to the Menu Button</h4>
+ <p>As Ice Cream Sandwich rolls out to more devices, it?s important that you begin to migrate
+your designs to the action bar in order to promote a consistent Android user experience.</p>
+ </a>
+
+ <a href="android-developers.blogspot.com/2011/07/new-tools-for-managing-screen-sizes.html">
+ <h4>New Tools For Managing Screen Sizes</h4>
+ <p>Android 3.2 includes new tools for supporting devices with a wide range of screen sizes.
+One important result is better support for a new size of screen; what is typically called a “7-inch”
+tablet. This release also offers several new APIs to simplify developers’ work in adjusting to
+different screen sizes.</p>
+ </a>
+
+ <a href="android-developers.blogspot.com/2011/03/identifying-app-installations.html">
+ <h4>Identifying App Installations</h4>
+ <p>It is very common, and perfectly reasonable, for a developer to want to track individual
+installations of their apps. It sounds plausible just to call TelephonyManager.getDeviceId() and use
+that value to identify the installation. There are problems with this</p>
+ </a>
+
+ <a
+href="http://android-developers.blogspot.com/2011/11/making-android-games-that-play-nice.html">
+ <h4>Making Android Games that Play Nice</h4>
+ <p>Making a game on Android is easy. Making a <em>great</em> game for a mobile, multitasking,
+often multi-core, multi-purpose system like Android is trickier. Even the best developers frequently
+make mistakes in the way they interact with the Android system and with other applications</p>
+ </a>
+
+ </div>
+
+
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/practices/design/jni.jd b/docs/html/guide/practices/jni.jd
similarity index 100%
copy from docs/html/guide/practices/design/jni.jd
copy to docs/html/guide/practices/jni.jd
diff --git a/docs/html/guide/practices/optimizing-for-3.0.jd b/docs/html/guide/practices/optimizing-for-3.0.jd
index d6c621e..65c5674 100644
--- a/docs/html/guide/practices/optimizing-for-3.0.jd
+++ b/docs/html/guide/practices/optimizing-for-3.0.jd
@@ -53,7 +53,7 @@
<li><a href="tablets-and-handsets.html">Supporting Tablets
and Handsets</a></li>
<li><a
-href="{@docRoot}sdk/compatibility-library.html">Compatibility Library</a></li>
+href="{@docRoot}tools/extras/support-library.html">Compatibility Library</a></li>
<li><a href="http://code.google.com/p/iosched/">Google I/O App source code</a></li>
</ol>
@@ -108,7 +108,7 @@
SDK starter package now</a>.)</p>
<ol>
- <li><a href="{@docRoot}sdk/adding-components.html#launching">Launch the Android SDK
+ <li><a href="{@docRoot}sdk/exploring.html#launching">Launch the Android SDK
Manager</a> and install the following:
<ul>
<li>SDK Platform Android 3.0</li>
@@ -280,15 +280,15 @@
to help you add features from Android 3.0 without requiring you to change your <a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code android:minSdkVersion}</a>
or build target, we're providing a static library called the <a
-href="{@docRoot}sdk/compatibility-library.html">Compatibility Library</a>
+href="{@docRoot}tools/extras/support-library.html">Compatibility Library</a>
(downloadable from the Android SDK Manager).</p>
<p>This library includes APIs for <a
-href="{@docRoot}guide/topics/fundamentals/fragments.html">fragments</a>, <a
-href="{@docRoot}guide/topics/fundamentals/loaders.html">loaders</a>, and some updated classes. By
+href="{@docRoot}guide/components/fragments.html">fragments</a>, <a
+href="{@docRoot}guide/components/loaders.html">loaders</a>, and some updated classes. By
simply adding this library to your Android project, you can use these APIs in your application and
remain compatible with Android 1.6. For information about how to get the library and start
using it in your application, see the <a
-href="{@docRoot}sdk/compatibility-library.html">Compatibility Library</a> document.</p>
+href="{@docRoot}tools/extras/support-library.html">Compatibility Library</a> document.</p>
</div>
</div>
@@ -357,7 +357,7 @@
read the article, the user can select an article and read it all within the same activity.</p>
<p>For more information, read the <a
-href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a> document.</p>
+href="{@docRoot}guide/components/fragments.html">Fragments</a> document.</p>
<h3>Use new animation APIs for transitions</h3>
@@ -374,7 +374,7 @@
position, orientation, transparency and more.</p>
<p>For more information, read the <a
-href="{@docRoot}guide/topics/graphics/animation.html">Property Animation</a> document.</p>
+href="{@docRoot}guide/topics/graphics/prop-animation.html">Property Animation</a> document.</p>
<h3>Enable hardware acceleration</h3>
@@ -412,15 +412,15 @@
new graphics engine called Renderscript, and more.</p>
<p>To learn more about the APIs mentioned above and more, see the <a
-href="{@docRoot}sdk/android-3.0.html">Android 3.0 Platform</a> document.</p>
+href="{@docRoot}about/versions/android-3.0.html">Android 3.0 Platform</a> document.</p>
<h3>Look at some samples</h3>
<p>Many of the new features and APIs that are described above and in the <a
-href="{@docRoot}sdk/android-3.0.html#api">Android 3.0 Platform</a> document also have accompanying
+href="{@docRoot}about/versions/android-3.0.html#api">Android 3.0 Platform</a> document also have accompanying
samples that allow you to preview the effects and can help you understand how to use them. To get
-the samples, download them from the SDK repository <a href="{@docRoot}sdk/adding-components.html"
+the samples, download them from the SDK repository <a href="{@docRoot}sdk/exploring.html"
>using the Android SDK Manager</a>. After downloading the samples ("Samples for SDK API
11"), you can find them in <code><sdk_root>/samples/android-11/</code>. The following list
provides links to the browsable source code for some of the samples:</p>
@@ -474,7 +474,7 @@
application's layout and assets to fit the current device screen, whether the device screen is
smaller or larger than the one for which you originally designed your application. As such, you
should always test your application on real or <a
-href="{@docRoot}guide/developing/devices/index.html">virtual devices</a> with various screen sizes
+href="{@docRoot}tools/devices/index.html">virtual devices</a> with various screen sizes
and densities.</p>
<p>Although we recommend that you design your application to function properly on multiple
@@ -641,7 +641,7 @@
onCreate()}) in immediate succession. You should design your activity to account for these changes
in the lifecycle, so the activity can save and restore its state. You can learn about the
necessary lifecycle callback methods and how to save and restore the activity state in the <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">Activities</a>
+href="{@docRoot}guide/components/activities.html#Lifecycle">Activities</a>
document. If your activity state is more complex and cannot retain it using the normal
lifecycle callback methods, you can use alternative techniques described in <a
href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime Changes</a>.</p>
diff --git a/docs/html/guide/practices/performance.jd b/docs/html/guide/practices/performance.jd
new file mode 100644
index 0000000..078999b
--- /dev/null
+++ b/docs/html/guide/practices/performance.jd
@@ -0,0 +1,410 @@
+page.title=Designing for Performance
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#intro">Introduction</a></li>
+ <li><a href="#optimize_judiciously">Optimize Judiciously</a></li>
+ <li><a href="#object_creation">Avoid Creating Unnecessary Objects</a></li>
+ <li><a href="#myths">Performance Myths</a></li>
+ <li><a href="#prefer_static">Prefer Static Over Virtual</a></li>
+ <li><a href="#internal_get_set">Avoid Internal Getters/Setters</a></li>
+ <li><a href="#use_final">Use Static Final For Constants</a></li>
+ <li><a href="#foreach">Use Enhanced For Loop Syntax</a></li>
+ <li><a href="#package_inner">Consider Package Instead of Private Access with Inner Classes</a></li>
+ <li><a href="#avoidfloat">Use Floating-Point Judiciously</a> </li>
+ <li><a href="#library">Know And Use The Libraries</a></li>
+ <li><a href="#native_methods">Use Native Methods Judiciously</a></li>
+ <li><a href="#closing_notes">Closing Notes</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>An Android application will run on a mobile device with limited computing
+power and storage, and constrained battery life. Because of
+this, it should be <em>efficient</em>. Battery life is one reason you might
+want to optimize your app even if it already seems to run "fast enough".
+Battery life is important to users, and Android's battery usage breakdown
+means users will know if your app is responsible draining their battery.</p>
+
+<p>Note that although this document primarily covers micro-optimizations,
+these will almost never make or break your software. Choosing the right
+algorithms and data structures should always be your priority, but is
+outside the scope of this document.</p>
+
+<a name="intro" id="intro"></a>
+<h2>Introduction</h2>
+
+<p>There are two basic rules for writing efficient code:</p>
+<ul>
+ <li>Don't do work that you don't need to do.</li>
+ <li>Don't allocate memory if you can avoid it.</li>
+</ul>
+
+<h2 id="optimize_judiciously">Optimize Judiciously</h2>
+
+<p>This document is about Android-specific micro-optimization, so it assumes
+that you've already used profiling to work out exactly what code needs to be
+optimized, and that you already have a way to measure the effect (good or bad)
+of any changes you make. You only have so much engineering time to invest, so
+it's important to know you're spending it wisely.
+
+<p>(See <a href="#closing_notes">Closing Notes</a> for more on profiling and
+writing effective benchmarks.)
+
+<p>This document also assumes that you made the best decisions about data
+structures and algorithms, and that you've also considered the future
+performance consequences of your API decisions. Using the right data
+structures and algorithms will make more difference than any of the advice
+here, and considering the performance consequences of your API decisions will
+make it easier to switch to better implementations later (this is more
+important for library code than for application code).
+
+<p>(If you need that kind of advice, see Josh Bloch's <em>Effective Java</em>,
+item 47.)</p>
+
+<p>One of the trickiest problems you'll face when micro-optimizing an Android
+app is that your app is pretty much guaranteed to be running on multiple
+hardware platforms. Different versions of the VM running on different
+processors running at different speeds. It's not even generally the case
+that you can simply say "device X is a factor F faster/slower than device Y",
+and scale your results from one device to others. In particular, measurement
+on the emulator tells you very little about performance on any device. There
+are also huge differences between devices with and without a JIT: the "best"
+code for a device with a JIT is not always the best code for a device
+without.</p>
+
+<p>If you want to know how your app performs on a given device, you need to
+test on that device.</p>
+
+<a name="object_creation"></a>
+<h2>Avoid Creating Unnecessary Objects</h2>
+
+<p>Object creation is never free. A generational GC with per-thread allocation
+pools for temporary objects can make allocation cheaper, but allocating memory
+is always more expensive than not allocating memory.</p>
+
+<p>If you allocate objects in a user interface loop, you will force a periodic
+garbage collection, creating little "hiccups" in the user experience. The
+concurrent collector introduced in Gingerbread helps, but unnecessary work
+should always be avoided.</p>
+
+<p>Thus, you should avoid creating object instances you don't need to. Some
+examples of things that can help:</p>
+
+<ul>
+ <li>If you have a method returning a string, and you know that its result
+ will always be appended to a StringBuffer anyway, change your signature
+ and implementation so that the function does the append directly,
+ instead of creating a short-lived temporary object.</li>
+ <li>When extracting strings from a set of input data, try
+ to return a substring of the original data, instead of creating a copy.
+ You will create a new String object, but it will share the char[]
+ with the data. (The trade-off being that if you're only using a small
+ part of the original input, you'll be keeping it all around in memory
+ anyway if you go this route.)</li>
+</ul>
+
+<p>A somewhat more radical idea is to slice up multidimensional arrays into
+parallel single one-dimension arrays:</p>
+
+<ul>
+ <li>An array of ints is a much better than an array of Integers,
+ but this also generalizes to the fact that two parallel arrays of ints
+ are also a <strong>lot</strong> more efficient than an array of (int,int)
+ objects. The same goes for any combination of primitive types.</li>
+ <li>If you need to implement a container that stores tuples of (Foo,Bar)
+ objects, try to remember that two parallel Foo[] and Bar[] arrays are
+ generally much better than a single array of custom (Foo,Bar) objects.
+ (The exception to this, of course, is when you're designing an API for
+ other code to access; in those cases, it's usually better to trade
+ good API design for a small hit in speed. But in your own internal
+ code, you should try and be as efficient as possible.)</li>
+</ul>
+
+<p>Generally speaking, avoid creating short-term temporary objects if you
+can. Fewer objects created mean less-frequent garbage collection, which has
+a direct impact on user experience.</p>
+
+<a name="avoid_enums" id="avoid_enums"></a>
+<a name="myths" id="myths"></a>
+<h2>Performance Myths</h2>
+
+<p>Previous versions of this document made various misleading claims. We
+address some of them here.</p>
+
+<p>On devices without a JIT, it is true that invoking methods via a
+variable with an exact type rather than an interface is slightly more
+efficient. (So, for example, it was cheaper to invoke methods on a
+<code>HashMap map</code> than a <code>Map map</code>, even though in both
+cases the map was a <code>HashMap</code>.) It was not the case that this
+was 2x slower; the actual difference was more like 6% slower. Furthermore,
+the JIT makes the two effectively indistinguishable.</p>
+
+<p>On devices without a JIT, caching field accesses is about 20% faster than
+repeatedly accesssing the field. With a JIT, field access costs about the same
+as local access, so this isn't a worthwhile optimization unless you feel it
+makes your code easier to read. (This is true of final, static, and static
+final fields too.)
+
+<a name="prefer_static" id="prefer_static"></a>
+<h2>Prefer Static Over Virtual</h2>
+
+<p>If you don't need to access an object's fields, make your method static.
+Invocations will be about 15%-20% faster.
+It's also good practice, because you can tell from the method
+signature that calling the method can't alter the object's state.</p>
+
+<a name="internal_get_set" id="internal_get_set"></a>
+<h2>Avoid Internal Getters/Setters</h2>
+
+<p>In native languages like C++ it's common practice to use getters (e.g.
+<code>i = getCount()</code>) instead of accessing the field directly (<code>i
+= mCount</code>). This is an excellent habit for C++, because the compiler can
+usually inline the access, and if you need to restrict or debug field access
+you can add the code at any time.</p>
+
+<p>On Android, this is a bad idea. Virtual method calls are expensive,
+much more so than instance field lookups. It's reasonable to follow
+common object-oriented programming practices and have getters and setters
+in the public interface, but within a class you should always access
+fields directly.</p>
+
+<p>Without a JIT, direct field access is about 3x faster than invoking a
+trivial getter. With the JIT (where direct field access is as cheap as
+accessing a local), direct field access is about 7x faster than invoking a
+trivial getter. This is true in Froyo, but will improve in the future when
+the JIT inlines getter methods.</p>
+
+<p>Note that if you're using ProGuard, you can have the best
+of both worlds because ProGuard can inline accessors for you.</p>
+
+<a name="use_final" id="use_final"></a>
+<h2>Use Static Final For Constants</h2>
+
+<p>Consider the following declaration at the top of a class:</p>
+
+<pre>static int intVal = 42;
+static String strVal = "Hello, world!";</pre>
+
+<p>The compiler generates a class initializer method, called
+<code><clinit></code>, that is executed when the class is first used.
+The method stores the value 42 into <code>intVal</code>, and extracts a
+reference from the classfile string constant table for <code>strVal</code>.
+When these values are referenced later on, they are accessed with field
+lookups.</p>
+
+<p>We can improve matters with the "final" keyword:</p>
+
+<pre>static final int intVal = 42;
+static final String strVal = "Hello, world!";</pre>
+
+<p>The class no longer requires a <code><clinit></code> method,
+because the constants go into static field initializers in the dex file.
+Code that refers to <code>intVal</code> will use
+the integer value 42 directly, and accesses to <code>strVal</code> will
+use a relatively inexpensive "string constant" instruction instead of a
+field lookup. (Note that this optimization only applies to primitive types and
+<code>String</code> constants, not arbitrary reference types. Still, it's good
+practice to declare constants <code>static final</code> whenever possible.)</p>
+
+<a name="foreach" id="foreach"></a>
+<h2>Use Enhanced For Loop Syntax</h2>
+
+<p>The enhanced for loop (also sometimes known as "for-each" loop) can be used
+for collections that implement the Iterable interface and for arrays.
+With collections, an iterator is allocated to make interface calls
+to hasNext() and next(). With an ArrayList, a hand-written counted loop is
+about 3x faster (with or without JIT), but for other collections the enhanced
+for loop syntax will be exactly equivalent to explicit iterator usage.</p>
+
+<p>There are several alternatives for iterating through an array:</p>
+
+<pre> static class Foo {
+ int mSplat;
+ }
+ Foo[] mArray = ...
+
+ public void zero() {
+ int sum = 0;
+ for (int i = 0; i < mArray.length; ++i) {
+ sum += mArray[i].mSplat;
+ }
+ }
+
+ public void one() {
+ int sum = 0;
+ Foo[] localArray = mArray;
+ int len = localArray.length;
+
+ for (int i = 0; i < len; ++i) {
+ sum += localArray[i].mSplat;
+ }
+ }
+
+ public void two() {
+ int sum = 0;
+ for (Foo a : mArray) {
+ sum += a.mSplat;
+ }
+ }
+</pre>
+
+<p><strong>zero()</strong> is slowest, because the JIT can't yet optimize away
+the cost of getting the array length once for every iteration through the
+loop.</p>
+
+<p><strong>one()</strong> is faster. It pulls everything out into local
+variables, avoiding the lookups. Only the array length offers a performance
+benefit.</p>
+
+<p><strong>two()</strong> is fastest for devices without a JIT, and
+indistinguishable from <strong>one()</strong> for devices with a JIT.
+It uses the enhanced for loop syntax introduced in version 1.5 of the Java
+programming language.</p>
+
+<p>To summarize: use the enhanced for loop by default, but consider a
+hand-written counted loop for performance-critical ArrayList iteration.</p>
+
+<p>(See also <em>Effective Java</em> item 46.)</p>
+
+<a name="package_inner" id="package_inner"></a>
+<h2>Consider Package Instead of Private Access with Private Inner Classes</h2>
+
+<p>Consider the following class definition:</p>
+
+<pre>public class Foo {
+ private class Inner {
+ void stuff() {
+ Foo.this.doStuff(Foo.this.mValue);
+ }
+ }
+
+ private int mValue;
+
+ public void run() {
+ Inner in = new Inner();
+ mValue = 27;
+ in.stuff();
+ }
+
+ private void doStuff(int value) {
+ System.out.println("Value is " + value);
+ }
+}</pre>
+
+<p>The key things to note here are that we define a private inner class
+(<code>Foo$Inner</code>) that directly accesses a private method and a private
+instance field in the outer class. This is legal, and the code prints "Value is
+27" as expected.</p>
+
+<p>The problem is that the VM considers direct access to <code>Foo</code>'s
+private members from <code>Foo$Inner</code> to be illegal because
+<code>Foo</code> and <code>Foo$Inner</code> are different classes, even though
+the Java language allows an inner class to access an outer class' private
+members. To bridge the gap, the compiler generates a couple of synthetic
+methods:</p>
+
+<pre>/*package*/ static int Foo.access$100(Foo foo) {
+ return foo.mValue;
+}
+/*package*/ static void Foo.access$200(Foo foo, int value) {
+ foo.doStuff(value);
+}</pre>
+
+<p>The inner class code calls these static methods whenever it needs to
+access the <code>mValue</code> field or invoke the <code>doStuff</code> method
+in the outer class. What this means is that the code above really boils down to
+a case where you're accessing member fields through accessor methods.
+Earlier we talked about how accessors are slower than direct field
+accesses, so this is an example of a certain language idiom resulting in an
+"invisible" performance hit.</p>
+
+<p>If you're using code like this in a performance hotspot, you can avoid the
+overhead by declaring fields and methods accessed by inner classes to have
+package access, rather than private access. Unfortunately this means the fields
+can be accessed directly by other classes in the same package, so you shouldn't
+use this in public API.</p>
+
+<a name="avoidfloat" id="avoidfloat"></a>
+<h2>Use Floating-Point Judiciously</h2>
+
+<p>As a rule of thumb, floating-point is about 2x slower than integer on
+Android devices. This is true on a FPU-less, JIT-less G1 and a Nexus One with
+an FPU and the JIT. (Of course, absolute speed difference between those two
+devices is about 10x for arithmetic operations.)</p>
+
+<p>In speed terms, there's no difference between <code>float</code> and
+<code>double</code> on the more modern hardware. Space-wise, <code>double</code>
+is 2x larger. As with desktop machines, assuming space isn't an issue, you
+should prefer <code>double</code> to <code>float</code>.</p>
+
+<p>Also, even for integers, some chips have hardware multiply but lack
+hardware divide. In such cases, integer division and modulus operations are
+performed in software — something to think about if you're designing a
+hash table or doing lots of math.</p>
+
+<a name="library" id="library"></a>
+<h2>Know And Use The Libraries</h2>
+
+<p>In addition to all the usual reasons to prefer library code over rolling
+your own, bear in mind that the system is at liberty to replace calls
+to library methods with hand-coded assembler, which may be better than the
+best code the JIT can produce for the equivalent Java. The typical example
+here is <code>String.indexOf</code> and friends, which Dalvik replaces with
+an inlined intrinsic. Similarly, the <code>System.arraycopy</code> method
+is about 9x faster than a hand-coded loop on a Nexus One with the JIT.</p>
+
+<p>(See also <em>Effective Java</em> item 47.)</p>
+
+<a name="native_methods" id="native_methods"></a>
+<h2>Use Native Methods Judiciously</h2>
+
+<p>Native code isn't necessarily more efficient than Java. For one thing,
+there's a cost associated with the Java-native transition, and the JIT can't
+optimize across these boundaries. If you're allocating native resources (memory
+on the native heap, file descriptors, or whatever), it can be significantly
+more difficult to arrange timely collection of these resources. You also
+need to compile your code for each architecture you wish to run on (rather
+than rely on it having a JIT). You may even have to compile multiple versions
+for what you consider the same architecture: native code compiled for the ARM
+processor in the G1 can't take full advantage of the ARM in the Nexus One, and
+code compiled for the ARM in the Nexus One won't run on the ARM in the G1.</p>
+
+<p>Native code is primarily useful when you have an existing native codebase
+that you want to port to Android, not for "speeding up" parts of a Java app.</p>
+
+<p>If you do need to use native code, you should read our
+<a href="{@docRoot}guide/practices/jni.html">JNI Tips</a>.</p>
+
+<p>(See also <em>Effective Java</em> item 54.)</p>
+
+<a name="closing_notes" id="closing_notes"></a>
+<h2>Closing Notes</h2>
+
+<p>One last thing: always measure. Before you start optimizing, make sure you
+have a problem. Make sure you can accurately measure your existing performance,
+or you won't be able to measure the benefit of the alternatives you try.</p>
+
+<p>Every claim made in this document is backed up by a benchmark. The source
+to these benchmarks can be found in the <a href="http://code.google.com/p/dalvik/source/browse/#svn/trunk/benchmarks">code.google.com "dalvik" project</a>.</p>
+
+<p>The benchmarks are built with the
+<a href="http://code.google.com/p/caliper/">Caliper</a> microbenchmarking
+framework for Java. Microbenchmarks are hard to get right, so Caliper goes out
+of its way to do the hard work for you, and even detect some cases where you're
+not measuring what you think you're measuring (because, say, the VM has
+managed to optimize all your code away). We highly recommend you use Caliper
+to run your own microbenchmarks.</p>
+
+<p>You may also find
+<a href="{@docRoot}tools/debugging/debugging-tracing.html">Traceview</a> useful
+for profiling, but it's important to realize that it currently disables the JIT,
+which may cause it to misattribute time to code that the JIT may be able to win
+back. It's especially important after making changes suggested by Traceview
+data to ensure that the resulting code actually runs faster when run without
+Traceview.
diff --git a/docs/html/guide/practices/design/responsiveness.jd b/docs/html/guide/practices/responsiveness.jd
similarity index 100%
copy from docs/html/guide/practices/design/responsiveness.jd
copy to docs/html/guide/practices/responsiveness.jd
diff --git a/docs/html/guide/practices/screens-distribution.jd b/docs/html/guide/practices/screens-distribution.jd
index a7c4a8e..90ac752 100644
--- a/docs/html/guide/practices/screens-distribution.jd
+++ b/docs/html/guide/practices/screens-distribution.jd
@@ -213,4 +213,4 @@
<a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
<p>If you need more information about how to publish multiple APKs on Google Play, read <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html">Multiple APK Support</a>.</p>
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html">Multiple APK Support</a>.</p>
diff --git a/docs/html/guide/practices/screens-support-1.5.jd b/docs/html/guide/practices/screens-support-1.5.jd
index 4c6fb99..15f0695 100644
--- a/docs/html/guide/practices/screens-support-1.5.jd
+++ b/docs/html/guide/practices/screens-support-1.5.jd
@@ -59,7 +59,7 @@
<p class="note"><strong>Note:</strong> Before you begin, you should first decide whether it's even
necessary to support Android 1.5. To see the relative number of devices that are still running
Android 1.5, see the <a
-href="http://developer.android.com/resources/dashboard/platform-versions.html">Platform Versions
+href="http://developer.android.com/about/dashboards/index.html">Platform Versions
Dashboard</a>.</p>
diff --git a/docs/html/guide/practices/screens_support.jd b/docs/html/guide/practices/screens_support.jd
index a870b22..ca29589 100644
--- a/docs/html/guide/practices/screens_support.jd
+++ b/docs/html/guide/practices/screens_support.jd
@@ -57,7 +57,7 @@
Providing Alternative Resources</a></li>
<li><a href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">Icon Design
Guidelines</a></li>
- <li><a href="{@docRoot}guide/developing/devices/index.html">Managing Virtual Devices</a></li>
+ <li><a href="{@docRoot}tools/devices/index.html">Managing Virtual Devices</a></li>
</ol>
</div>
@@ -1253,7 +1253,7 @@
to emulate some of the most common screen configurations.</p>
<p>For more information about creating and using AVDs to test your application, see <a
-href="{@docRoot}guide/developing/devices/managing-avds.html">Managing AVDs with AVD
+href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with AVD
Manager</a>.</p>
@@ -1366,5 +1366,5 @@
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}guide/developing/devices/managing-avds-cmdline.html">Managing AVDs from the
+href="{@docRoot}tools/devices/managing-avds-cmdline.html">Managing AVDs from the
Command Line</a></p>
diff --git a/docs/html/guide/practices/seamlessness.jd b/docs/html/guide/practices/seamlessness.jd
new file mode 100644
index 0000000..ec6b7fd
--- /dev/null
+++ b/docs/html/guide/practices/seamlessness.jd
@@ -0,0 +1,249 @@
+page.title=Designing for Seamlessness
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#drop">Don't Drop Data</a></li>
+ <li><a href="#expose">Don't Expose Raw Data</a></li>
+ <li><a href="#interrupt">Don't Interrupt the User</a></li>
+ <li><a href="#threads">Got a Lot to Do? Do it in a Thread</a></li>
+ <li><a href="#multiple-activities">Don't Overload a Single Activity Screen</a></li>
+ <li><a href="#themes">Extend System Themes</a></li>
+ <li><a href="#flexui">Design Your UI to Work with Multiple Screen Resolutions</a></li>
+ <li><a href="#network">Assume the Network is Slow</a></li>
+ <li><a href="#keyboard">Don't Assume Touchscreen or Keyboard</a></li>
+ <li><a href="#battery">Do Conserve the Device Battery</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>Even if your application is fast and responsive, certain design decisions can
+still cause problems for users — because of unplanned interactions with
+other applications or dialogs, inadvertent loss of data, unintended blocking,
+and so on. To avoid these problems, it helps to understand the context in which
+your applications run and the system interactions that can affect your
+application. In short, you should strive to develop an application that
+interacts seamlessly with the system and with other applications. </p>
+
+<p>A common seamlessness problem is when an application's background process
+— for example, a service or broadcast receiver — pops up a dialog in
+response to some event. This may seem like harmless behavior, especially when
+you are building and testing your application in isolation, on the emulator.
+However, when your application is run on an actual device, your application may
+not have user focus at the time your background process displays the dialog. So
+it could end up that your application would display it's dialog behind the
+active application, or it could take focus from the current application and
+display the dialog in front of whatever the user was doing (such as dialing a
+phone call, for example). That behavior would not work for your application or
+for the user. </p>
+
+<p>To avoid these problems, your application should use the proper system
+facility for notifying the user — the
+{@link android.app.Notification Notification} classes. Using
+notifications, your application can signal the user that an event has
+taken place, by displaying an icon in the status bar rather than taking
+focus and interrupting the user.</p>
+
+<p>Another example of a seamlessness problem is when an activity inadvertently
+loses state or user data because it doesn't correctly implement the onPause()
+and other lifecycle methods. Or, if your application exposes data intended to be
+used by other applications, you should expose it via a ContentProvider, rather
+than (for example) doing so through a world-readable raw file or database.</p>
+
+<p>What those examples have in common is that they involve cooperating nicely
+with the system and other applications. The Android system is designed to treat
+applications as a sort of federation of loosely-coupled components, rather than
+chunks of black-box code. This allows you as the developer to view the entire
+system as just an even-larger federation of these components. This benefits you
+by allowing you to integrate cleanly and seamlessly with other applications, and
+so you should design your own code to return the favor.</p>
+
+<p>This document discusses common seamlessness problems and how to avoid them.</p>
+
+<h2 id="drop">Don't Drop Data</h2>
+
+<p>Always keep in mind that Android is a mobile platform. It may seem obvious to
+say it, but it's important to remember that another Activity (such as the
+"Incoming Phone Call" app) can pop up over your own Activity at any moment.
+This will fire the onSaveInstanceState() and onPause() methods, and will likely result in
+your application being killed.</p>
+
+<p>If the user was editing data in your application when the other Activity
+appeared, your application will likely lose that data when your application is
+killed. Unless, of course, you save the work in progress first. The "Android
+Way" is to do just that: Android applications that accept or edit input should
+override the onSaveInstanceState() method and save their state in some appropriate
+fashion. When the user revisits the application, she should be able to
+retrieve her data.</p>
+
+<p>A classic example of a good use of this behavior is a mail application. If the
+user was composing an email when another Activity started up, the application
+should save the in-process email as a draft.</p>
+
+<h2 id="expose">Don't Expose Raw Data</h2>
+
+<p>If you wouldn't walk down the street in your underwear, neither should your
+data. While it's possible to expose certain kinds of application to the world
+to read, this is usually not the best idea. Exposing raw data requires other
+applications to understand your data format; if you change that format, you'll
+break any other applications that aren't similarly updated.</p>
+
+<p>The "Android Way" is to create a ContentProvider to expose your data to other
+applications via a clean, well-thought-out, and maintainable API. Using a
+ContentProvider is much like inserting a Java language interface to split up and
+componentize two tightly-coupled pieces of code. This means you'll be able to
+modify the internal format of your data without changing the interface exposed
+by the ContentProvider, and this without affecting other applications.</p>
+
+<h2 id="interrupt">Don't Interrupt the User</h2>
+
+<p>If the user is running an application (such as the Phone application during a
+call) it's a pretty safe bet he did it on purpose. That's why you should avoid
+spawning activities except in direct response to user input from the current
+Activity.</p>
+
+<p>That is, don't call startActivity() from BroadcastReceivers or Services running in
+the background. Doing so will interrupt whatever application is currently
+running, and result in an annoyed user. Perhaps even worse, your Activity may
+become a "keystroke bandit" and receive some of the input the user was in the
+middle of providing to the previous Activity. Depending on what your
+application does, this could be bad news.</p>
+
+<p>Instead of spawning Activity UIs directly from the background, you should
+instead use the NotificationManager to set Notifications. These will appear in
+the status bar, and the user can then click on them at his leisure, to see
+what your application has to show him.</p>
+
+<p>(Note that all this doesn't apply to cases where your own Activity is already
+in the foreground: in that case, the user expects to see your next Activity in
+response to input.)</p>
+
+<h2 id="threads">Got a Lot to Do? Do it in a Thread</h2>
+
+<p>If your application needs to perform some expensive or long-running
+computation, you should probably move it to a thread. This will prevent the
+dreaded "Application Not Responding" dialog from being displayed to the user,
+with the ultimate result being the fiery demise of your application.</p>
+
+<p>By default, all code in an Activity as well as all its Views run in the same
+thread. This is the same thread that also handles UI events. For example, when
+the user presses a key, a key-down event is added to the Activity's main
+thread's queue. The event handler system needs to dequeue and handle that
+event quickly; if it doesn't, the system concludes after a few seconds that
+the application is hung and offers to kill it for the user.</p>
+
+<p>If you have long-running code, running it inline in your Activity will run it
+on the event handler thread, effectively blocking the event handler. This will
+delay input processing, and result in the ANR dialogs. To avoid this, move
+your computations to a thread. This <a
+href="responsiveness.html">Design for Responsiveness</a> document
+discusses how to do that..</p>
+
+<h2 id="multiple-activities">Don't Overload a Single Activity Screen</h2>
+
+<p>Any application worth using will probably have several different screens.
+When designing the screens of your UI, be sure to make use of multiple Activity
+object instances.</p>
+
+<p>Depending on your development background, you may interpret an Activity as
+similar to something like a Java Applet, in that it is the entry point for
+your application. However, that's not quite accurate: where an Applet subclass
+is the single entry point for a Java Applet, an Activity should be thought of
+as one of potentially several entry points to your application. The only
+difference between your "main" Activity and any others you might have is that
+the "main" one just happens to be the only one that expressed an interest in
+the "android.intent.action.MAIN" action in your AndroidManifest..xml file.</p>
+
+<p>So, when designing your application, think of your application as a federation
+of Activity objects. This will make your code a lot more maintainable in the long
+run, and as a nice side effect also plays nicely with Android's application
+history and "backstack" model.</p>
+
+<h2 id="themes">Extend System Themes</h2>
+
+<p>When it comes to the look-and-feel of the user interface, it's important to
+blend in nicely. Users are jarred by applications which contrast with the user
+interface they've come to expect. When designing your UIs, you should try and
+avoid rolling your own as much as possible. Instead, use a Theme. You
+can override or extend those parts of the theme that you need to, but at least
+you're starting from the same UI base as all the other applications. For all
+the details, read <a href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a>.</p>
+
+<h2 id="flexui">Design Your UI to Work with Multiple Screen Resolutions</h2>
+
+<p>Different Android-powered devices will support different screen resolutions.
+Some will even be able to change resolutions on the fly, such as by switching
+to landscape mode. It's important to make sure your layouts and drawables
+are flexible enough to display properly on a variety of device screens.</p>
+
+<p>Fortunately, this is very easy to do. In brief, what you must do is
+provide different versions of your artwork (if you use any) for the key
+resolutions, and then design your layout to accommodate various dimensions.
+(For example, avoid using hard-coded positions and instead use relative
+layouts.) If you do that much, the system handles the rest, and your
+application looks great on any device.</p>
+
+<h2 id="network">Assume the Network is Slow</h2>
+
+<p>Android devices will come with a variety of network-connectivity options. All
+will have some data-access provision, though some will be faster than others.
+The lowest common denominator, however, is GPRS, the non-3G data service for
+GSM networks. Even 3G-capable devices will spend lots of time on non-3G
+networks, so slow networks will remain a reality for quite a long time to
+come.</p>
+
+<p>That's why you should always code your applications to minimize network
+accesses and bandwidth. You can't assume the network is fast, so you should
+always plan for it to be slow. If your users happen to be on faster networks,
+then that's great — their experience will only improve. You want to avoid the
+inverse case though: applications that are usable some of the time, but
+frustratingly slow the rest based on where the user is at any given moment are
+likely to be unpopular.</p>
+
+<p>One potential gotcha here is that it's very easy to fall into this trap if
+you're using the emulator, since the emulator uses your desktop computer's
+network connection. That's almost guaranteed to be much faster than a cell
+network, so you'll want to change the settings on the emulator that simulate
+slower network speeds. You can do this in Eclipse, in the "Emulator Settings"
+tab of your launch configuration or via a <a
+href="{@docRoot}tools/help/emulator.html#netspeed">command-line
+option</a> when starting the emulator.</p>
+
+<h2 id="keyboard">Don't Assume Touchscreen or Keyboard</h2>
+
+<p>
+Android will support a variety of handset form-factors. That's a fancy way of
+saying that some Android devices will have full "QWERTY" keyboards, while
+others will have 40-key, 12-key, or even other key configurations. Similarly,
+some devices will have touch-screens, but many won't.
+</p><p>
+When building your applications, keep that in mind. Don't make assumptions
+about specific keyboard layouts -- unless, of course, you're really interested
+in restricting your application so that it can only be used on those devices.
+</p>
+
+<h2 id="battery">Do Conserve the Device Battery</h2>
+<p>
+A mobile device isn't very mobile if it's constantly plugged into the
+wall. Mobile devices are battery-powered, and the longer we can make that
+battery last on a charge, the happier everyone is — especially the user.
+Two of the biggest consumers of battery power are the processor, and the
+radio; that's why it's important to write your applications to do as little
+work as possible, and use the network as infrequently as possible.
+</p><p>
+Minimizing the amount of processor time your application uses really comes
+down to <a href="performance.html">writing efficient
+code</a>. To minimize the power drain from using the radio, be sure to handle
+error conditions gracefully, and only fetch what you need. For example, don't
+constantly retry a network operation if one failed. If it failed once, it's
+likely because the user has no reception, so it's probably going to fail again
+if you try right away; all you'll do is waste battery power.
+</p><p>
+Users are pretty smart: if your program is power-hungry, you can count on
+them noticing. The only thing you can be sure of at that point is that your
+program won't stay installed very long.
+</p>
diff --git a/docs/html/guide/practices/security.jd b/docs/html/guide/practices/security.jd
index eeaac44..48ccdeb 100644
--- a/docs/html/guide/practices/security.jd
+++ b/docs/html/guide/practices/security.jd
@@ -20,8 +20,7 @@
<ol>
<li><a href="http://source.android.com/tech/security/index.html">Android
Security Overview</a></li>
-<li><a href="{@docRoot}guide/topics/security/security.html">Android Security
-And Permissions</a></li>
+<li><a href="{@docRoot}guide/topics/security/permissions.html">Permissions</a></li>
</ol>
</div></div>
<p>Android was designed so that most developers will be able to build
@@ -136,7 +135,7 @@
<p>To provide additional protection for sensitive data, some applications
choose to encrypt local files using a key that is not accessible to the
application. (For example, a key can be placed in a <code><a
-href={@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> and
+href="{@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> and
protected with a user password that is not stored on the device). While this
does not protect data from a root compromise that can monitor the user
inputting the password, it can provide protection for a lost device without <a
diff --git a/docs/html/guide/practices/tablets-and-handsets.jd b/docs/html/guide/practices/tablets-and-handsets.jd
index 8e07a08..8d6d3dd3 100644
--- a/docs/html/guide/practices/tablets-and-handsets.jd
+++ b/docs/html/guide/practices/tablets-and-handsets.jd
@@ -26,7 +26,7 @@
<h2>See also</h2>
<ol>
- <li><a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a></li>
+ <li><a href="{@docRoot}guide/components/fragments.html">Fragments</a></li>
<li><a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a></li>
<li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></li>
</ol>
@@ -85,7 +85,7 @@
running.</p>
<p>If you haven't used fragments yet, start by reading the <a
-href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a> developer guide.</p>
+href="{@docRoot}guide/components/fragments.html">Fragments</a> developer guide.</p>
</li>
@@ -141,16 +141,16 @@
<h3>Remaining backward-compatible</h3>
<p>If you want to use fragments in your application <em>and</em> remain compatible with
versions of Android older than 3.0, you can do so by using the Android <a
-href="{@docRoot}sdk/compatibility-library.html">Support Library</a> (downloadable from the
+href="{@docRoot}tools/extras/support-library.html">Support Library</a> (downloadable from the
SDK Manager).</p>
<p>The support library includes APIs for <a
-href="{@docRoot}guide/topics/fundamentals/fragments.html">fragments</a>, <a
-href="{@docRoot}guide/topics/fundamentals/loaders.html">loaders</a>, and other APIs added in newer
+href="{@docRoot}guide/components/fragments.html">fragments</a>, <a
+href="{@docRoot}guide/components/loaders.html">loaders</a>, and other APIs added in newer
versions of Android. By simply adding this library to your Android project, you can use
backward-compatible versions of these APIs in your application and remain compatible with Android
1.6 (your <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
android:minSdkVersion}</a> value can be as low as {@code "4"}). For information about how to get the
-library and start using it, see the <a href="{@docRoot}sdk/compatibility-library.html">Support
+library and start using it, see the <a href="{@docRoot}tools/extras/support-library.html">Support
Library</a> document.</p>
<p>The support library <em>does not</em> provide APIs for the action bar, but you can use
diff --git a/docs/html/guide/practices/ui_guidelines/activity_task_design.jd b/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
index 8e4528e..cb2bc37 100644
--- a/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/activity_task_design.jd
@@ -19,7 +19,7 @@
for <a href="{@docRoot}design/patterns/app-structure.html">App Structure</a> and
<a href="{@docRoot}design/patterns/navigation.html">Navigation</a>, or the developer guide
about <a
-href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a>.</p>
+href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a>.</p>
<input style="margin-top:1em;padding:5px" type="button"
value="That's nice, but I still want to read this document"
@@ -88,7 +88,7 @@
<h2>See also</h2>
<ol>
- <li><a href="{@docRoot}guide/topics/fundamentals.html">Application Fundamentals</a></li>
+ <li><a href="{@docRoot}guide/components/fundamentals.html">Application Fundamentals</a></li>
</ol>
</div>
@@ -121,9 +121,9 @@
<p>
Be sure to look at the <a href="#design_tips">Design Tips</a> section
for guidelines, tips, and things to avoid. This document is a
- complement to the <a href="{@docRoot}guide/topics/fundamentals.html">Application
+ complement to the <a href="{@docRoot}guide/components/fundamentals.html">Application
Fundamentals</a> documentation (particularly the <a
-href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a>
+href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a>
document),
which covers the underlying mechanics for programmers.
</p>
@@ -189,7 +189,7 @@
<p>
An activity handles a particular type of content (data) and accepts a
set of related user actions. Each activity has a
- <a href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">lifecycle</a> that is
+ <a href="{@docRoot}guide/components/activities.html#Lifecycle">lifecycle</a> that is
independent of the other
activities in its application or task — each activity is
launched (started) independently, and the user or system can start,
@@ -268,7 +268,7 @@
An activity is the most prominent of four <em>components</em> of an
application. The other components are service, content provider and
broadcast receiver. For more details on activities, see the
- <a href="{@docRoot}guide/topics/fundamentals/activities.html">Activities</a> document.
+ <a href="{@docRoot}guide/components/activities.html">Activities</a> document.
</p>
@@ -750,7 +750,7 @@
<p>
For more about intents, see <a
-href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>.
+href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>.
</p>
@@ -947,7 +947,7 @@
Home screen), or from a shortcut icon on the Home screen, or
from the task switcher. (The mechanism for this is for the
activity to have an
- <a href={@docRoot}guide/topics/intents/intents-filters.html>intent filter</a> with action
+ <a href={@docRoot}guide/components/intents-filters.html>intent filter</a> with action
MAIN and
category LAUNCHER.)
</li>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd b/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
index 4b6768f..28817fd 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_launcher.jd
@@ -241,8 +241,8 @@
<h3 id="icons_in_market">Application Icons on Google Play</h3>
-<p>If you are <a href="{@docRoot}guide/publishing/publishing.html">publishing your application on
-Google Play</a>, you will also need to provide a 512 x 512 pixel, high-resolution application icon
+<p>If you are publishing your app on
+Google Play, you will also need to provide a 512 x 512 pixel, high-resolution application icon
in the <a href="http://play.google.com/apps/publish">developer console</a> at upload time. This icon
will be used in various locations on Google Play and does not replace your launcher icon.</p>
diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd b/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
index 85a3cc8..f6c2247 100644
--- a/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
+++ b/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd
@@ -58,7 +58,7 @@
<h2 id="market">Application Icons on Google Play</h2>
-<p>If you are <a href="{@docRoot}guide/publishing/publishing.html">publishing
+<p>If you are <a href="{@docRoot}tools/publishing/publishing.html">publishing
your application on Google Play</a>, you will also need to provide a 512x512
pixel, high-resolution application icon in the <a
href="http://play.google.com/apps/publish">developer console</a> at upload-time.
diff --git a/docs/html/guide/practices/ui_guidelines/widget_design.jd b/docs/html/guide/practices/ui_guidelines/widget_design.jd
index d789407..616f9ae 100644
--- a/docs/html/guide/practices/ui_guidelines/widget_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/widget_design.jd
@@ -229,7 +229,7 @@
practice to define this shape using nine patches; one for each screen density (see <a
href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a> for details).
Nine-patches can be created with the <a
-href="{@docRoot}guide/developing/tools/draw9patch.html">draw9patch</a> tool, or simply with a
+href="{@docRoot}tools/help/draw9patch.html">draw9patch</a> tool, or simply with a
graphics editing program such as Adobe® Photoshop. This will allow the widget background shape
to take up the entire available space. The nine-patch should be edge-to-edge with no transparent
pixels providing extra margins, save for perhaps a few border pixels for <strong>subtle</strong>
diff --git a/docs/html/guide/publishing/app-signing.jd b/docs/html/guide/publishing/app-signing.jd
deleted file mode 100644
index 5bd9be55..0000000
--- a/docs/html/guide/publishing/app-signing.jd
+++ /dev/null
@@ -1,618 +0,0 @@
-page.title=Signing Your Applications
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>Quickview</h2>
-
-<ul>
-<li>All Android apps <em>must</em> be signed</li>
-<li>You can sign with a self-signed key</li>
-<li>How you sign your apps is critical — read this document carefully</li>
-<li>Determine your signing strategy early in the development process</li>
-</ul>
-
-<h2>In this document</h2>
-
-<ol>
-<li><a href="#signing">Signing Process</a></li>
-<li><a href="#strategies">Signing Strategies</a></li>
-<li><a href="#setup">Basic Setup for Signing</a></li>
-<li><a href="#debugmode">Signing in Debug Mode</a></li>
-<li><a href="#releasemode">Signing Release Mode</a>
- <ol>
- <li><a href="#cert">Obtain a suitable private key</a></li>
- <li><a href="#releasecompile">Compile the application in release mode</a></li>
- <li><a href="#signapp">Sign your application with your private key</a></li>
- <li><a href="#align">Align the final APK package</a></li>
- <li><a href="#ExportWizard">Compile and sign with Eclipse ADT</a></li>
- </ol>
-</li>
-<li><a href="#secure-key">Securing Your Private Key</a></li>
-
-</ol>
-
-<h2>See also</h2>
-
-<ol>
-<li><a href="{@docRoot}guide/publishing/versioning.html">Versioning Your Applications</a></li>
-<li><a href="{@docRoot}guide/publishing/preparing.html">Preparing to Publish</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>The Android system requires that all installed applications be digitally signed with a
-certificate whose private key is held by the application's developer. The Android system uses the
-certificate as a means of identifying the author of an application and establishing trust
-relationships between applications. The certificate is not used to control which applications the
-user can install. The certificate does not need to be signed by a certificate authority: it is
-perfectly allowable, and typical, for Android applications to use self-signed certificates.</p>
-
-<p>The important points to understand about signing Android applications are:</p>
-
-<ul>
- <li>All applications <em>must</em> be signed. The system will not install an application
-on an emulator or a device if it is not signed.</li>
- <li>To test and debug your application, the build tools sign your application with a special debug
- key that is created by the Android SDK build tools.</li>
- <li>When you are ready to release your application for end-users, you must sign it with a suitable
- private key. You cannot publish an application that is signed with the debug key generated
- by the SDK tools.</li>
- <li>You can use self-signed certificates to sign your applications. No certificate authority is
- needed.</li>
- <li>The system tests a signer certificate's expiration date only at install time. If an
-application's signer certificate expires after the application is installed, the application
-will continue to function normally.</li>
- <li>You can use standard tools — Keytool and Jarsigner — to generate keys and
-sign your application {@code .apk} files.</li>
- <li>After you sign your application for release, we recommend that you use the
- <code>zipalign</code> tool to optimize the final APK package.</li>
-</ul>
-
-<p>The Android system will not install or run an application that is not signed appropriately. This
-applies wherever the Android system is run, whether on an actual device or on the emulator.
-For this reason, you must <a href="#setup">set up signing</a> for your application before you can
-run it or debug it on an emulator or device.</p>
-
-<h2 id="signing">Signing Process</h3>
-
-<p>The Android build process signs your application differently depending on which build mode you
-use to build your application. There are two build modes: <em>debug mode</em> and <em>release
-mode</em>. You use debug mode when you are developing and testing your application. You use
-release mode when you want to build a release version of your application that you can
-distribute directly to users or publish on an application marketplace such as Google Play.</p>
-
-<p>When you build in <em>debug mode</em> the Android SDK build tools use the Keytool utility
-(included in the JDK) to create a debug key. Because the SDK build tools created the debug key,
-they know the debug key's alias and password. Each time you compile your application in debug mode,
-the build tools use the debug key along with the Jarsigner utility (also included in the JDK) to
-sign your application's <code>.apk</code> file. Because the alias and password are known to the SDK
-build tools, the tools don't need to prompt you for the debug key's alias and password each time
-you compile.</p>
-
-<p>When you build in <em>release mode</em> you use your own private key to sign your application. If
-you don't have a private key, you can use the Keytool utility to create one for you. When you
-compile your application in release mode, the build tools use your private key along with the
-Jarsigner utility to sign your application's <code>.apk</code> file. Because the certificate and
-private key you use are your own, you will have to provide the password for the keystore and key
-alias.</p>
-
-<p>The debug signing process happens automatically when you run or debug your application using
-Eclipse with the ADT plugin. Debug signing also happens automatically when you use the Ant build
-script with the <code>debug</code> option. You can automate the release signing process by using the
-Eclipse Export Wizard or by modifying the Ant build script and building with the
-<code>release</code> option.</p>
-
-<h2 id="strategies">Signing Strategies</h2>
-
-<p>Some aspects of application signing may affect how you approach the development
-of your application, especially if you are planning to release multiple
-applications. </p>
-
-<p>In general, the recommended strategy for all developers is to sign
-all of your applications with the same certificate, throughout the expected
-lifespan of your applications. There are several reasons why you should do so: </p>
-
-<ul>
-<li>Application upgrade – As you release updates to your application, you
-will want to continue to sign the updates with the same certificate or set of
-certificates, if you want users to upgrade seamlessly to the new version. When
-the system is installing an update to an application, it compares the
-certificate(s) in the new version with those in the existing version. If the
-certificates match exactly, including both the certificate data and order, then
-the system allows the update. If you sign the new version without using matching
-certificates, you will also need to assign a different package name to the
-application — in this case, the user installs the new version as a
-completely new application. </li>
-
-<li>Application modularity – The Android system allows applications that
-are signed by the same certificate to run in the same process, if the
-applications so requests, so that the system treats them as a single application.
-In this way you can deploy your application in modules, and users can update
-each of the modules independently if needed.</li>
-
-<li>Code/data sharing through permissions – The Android system provides
-signature-based permissions enforcement, so that an application can expose
-functionality to another application that is signed with a specified
-certificate. By signing multiple applications with the same certificate and
-using signature-based permissions checks, your applications can share code and
-data in a secure manner. </li>
-
-</ul>
-
-<p>Another important consideration in determining your signing strategy is
-how to set the validity period of the key that you will use to sign your
-applications.</p>
-
-<ul>
-<li>If you plan to support upgrades for a single application, you should ensure
-that your key has a validity period that exceeds the expected lifespan of
-that application. A validity period of 25 years or more is recommended.
-When your key's validity period expires, users will no longer be
-able to seamlessly upgrade to new versions of your application.</li>
-
-<li>If you will sign multiple distinct applications with the same key,
-you should ensure that your key's validity period exceeds the expected
-lifespan of <em>all versions of all of the applications</em>, including
-dependent applications that may be added to the suite in the future. </li>
-
-<li>If you plan to publish your application(s) on Google Play, the
-key you use to sign the application(s) must have a validity period
-ending after 22 October 2033. Google Play enforces this requirement
-to ensure that users can seamlessly upgrade applications when
-new versions are available. </li>
-</ul>
-
-<p>As you design your application, keep these points in mind and make sure to
-use a <a href="#cert">suitable certificate</a> to sign your applications. </p>
-
-<h2 id="setup">Basic Setup for Signing</h2>
-
-<p>Before you begin, make sure that the Keytool utility and Jarsigner utility are available to
-the SDK build tools. Both of these tools are available in the JDK. In most cases, you can tell
-the SDK build tools how to find these utilities by setting your <code>JAVA_HOME</code> environment
-variable so it references a suitable JDK. Alternatively, you can add the JDK version of Keytool and
-Jarsigner to your <code>PATH</code> variable.</p>
-
-<p>If you are developing on a version of Linux that originally came with GNU Compiler for
-Java, make sure that the system is using the JDK version of Keytool, rather than the gcj
-version. If Keytool is already in your <code>PATH</code>, it might be pointing to a symlink at
-<code>/usr/bin/keytool</code>. In this case, check the symlink target to be sure it points
-to the Keytool in the JDK.</p>
-
-<h2 id="debugmode">Signing in Debug Mode</h2>
-
-<p>The Android build tools provide a debug signing mode that makes it easier for you
-to develop and debug your application, while still meeting the Android system
-requirement for signing your APK.
-When using debug mode to build your app, the SDK tools invoke Keytool to automatically create
-a debug keystore and key. This debug key is then used to automatically sign the APK, so
-you do not need to sign the package with your own key.</p>
-
-<p>The SDK tools create the debug keystore/key with predetermined names/passwords:</p>
-<ul>
-<li>Keystore name: "debug.keystore"</li>
-<li>Keystore password: "android"</li>
-<li>Key alias: "androiddebugkey"</li>
-<li>Key password: "android"</li>
-<li>CN: "CN=Android Debug,O=Android,C=US"</li>
-</ul>
-
-<p>If necessary, you can change the location/name of the debug keystore/key or
-supply a custom debug keystore/key to use. However, any custom debug
-keystore/key must use the same keystore/key names and passwords as the default
-debug key (as described above). (To do so in Eclipse/ADT, go to
-<strong>Windows</strong> > <strong>Preferences</strong> >
-<strong>Android</strong> > <strong>Build</strong>.) </p>
-
-<p class="caution"><strong>Caution:</strong> You <em>cannot</em> release your application
-to the public when signed with the debug certificate.</p>
-
-<h3>Eclipse Users</h3>
-
-<p>If you are developing in Eclipse/ADT (and have set up Keytool and Jarsigner as described above in
-<a href="#setup">Basic Setup for Signing</a>),
-signing in debug mode is enabled by default. When you run or debug your
-application, ADT signs the {@code .apk} file with the debug certificate, runs {@code zipalign} on
-the package, then installs it on
-the selected emulator or connected device. No specific action on your part is needed,
-provided ADT has access to Keytool.</p>
-
-<h3>Ant Users</h3>
-
-<p>If you are using Ant to build your {@code .apk} file, debug signing mode
-is enabled by using the <code>debug</code> option with the <code>ant</code> command
-(assuming that you are using a <code>build.xml</code> file generated by the
-<code>android</code> tool). When you run <code>ant debug</code> to
-compile your app, the build script generates a keystore/key and signs the APK for you.
-The script then also aligns the APK with the <code>zipalign</code> tool.
-No other action on your part is needed. Read
-<a href="{@docRoot}guide/developing/building/building-cmdline.html#DebugMode">Building and Running Apps
-on the Command Line</a> for more information.</p>
-
-
-<h3 id="debugexpiry">Expiry of the Debug Certificate</h3>
-
-<p>The self-signed certificate used to sign your application in debug mode (the default on
-Eclipse/ADT and Ant builds) will have an expiration date of 365 days from its creation date.</p>
-
-<p>When the certificate expires, you will get a build error. On Ant builds, the error
-looks like this:</p>
-
-<pre>debug:
-[echo] Packaging bin/samples-debug.apk, and signing it with a debug key...
-[exec] Debug Certificate expired on 8/4/08 3:43 PM</pre>
-
-<p>In Eclipse/ADT, you will see a similar error in the Android console.</p>
-
-<p>To fix this problem, simply delete the <code>debug.keystore</code> file.
-The default storage location for AVDs is in <code>~/.android/</code> on OS X and Linux,
-in <code>C:\Documents and Settings\<user>\.android\</code> on Windows XP, and in
-<code>C:\Users\<user>\.android\</code> on Windows Vista and Windows 7.</p>
-
-
-<p>The next time you build, the build tools will regenerate a new keystore and debug key.</p>
-
-<p>Note that, if your development machine is using a non-Gregorian locale, the build
-tools may erroneously generate an already-expired debug certificate, so that you get an
-error when trying to compile your application. For workaround information, see the
-troubleshooting topic <a href="{@docRoot}resources/faq/troubleshooting.html#signingcalendar">
-I can't compile my app because the build tools generated an expired debug
-certificate</a>. </p>
-
-
-<h2 id="releasemode">Signing in Release Mode</h2>
-
-<p>When your application is ready for release to other users, you must:</p>
-<ol>
- <li><a href="#cert">Obtain a suitable private key</a></li>
- <li><a href="#releasecompile">Compile the application in release mode</a></li>
- <li><a href="#signapp">Sign your application with your private key</a></li>
- <li><a href="#align">Align the final APK package</a></li>
-</ol>
-
-<p>If you are developing in Eclipse with the ADT plugin, you can use the Export Wizard
-to perform the compile, sign, and align procedures. The Export Wizard even allows you to
-generate a new keystore and private key in the process. So if you use Eclipse, you can
-skip to <a href="#ExportWizard">Compile and sign with Eclipse ADT</a>.</p>
-
-
-
-<h3 id="cert">1. Obtain a suitable private key</h3>
-
-<p>In preparation for signing your application, you must first ensure that
-you have a suitable private key with which to sign. A suitable private
-key is one that:</p>
-
-<ul>
-<li>Is in your possession</li>
-<li>Represents the personal, corporate, or organizational entity to be identified
-with the application</li>
-<li>Has a validity period that exceeds the expected lifespan of the application
-or application suite. A validity period of more than 25 years is recommended.
-<p>If you plan to publish your application(s) on Google Play, note that a
-validity period ending after 22 October 2033 is a requirement. You can not upload an
-application if it is signed with a key whose validity expires before that date.
-</p></li>
-<li>Is not the debug key generated by the Android SDK tools. </li>
-</ul>
-
-<p>The key may be self-signed. If you do not have a suitable key, you must
-generate one using Keytool. Make sure that you have Keytool available, as described
-in <a href="#setup">Basic Setup</a>.</p>
-
-<p>To generate a self-signed key with Keytool, use the <code>keytool</code>
-command and pass any of the options listed below (and any others, as
-needed). </p>
-
-<p class="warning"><strong>Warning:</strong> Keep your private key secure.
-Before you run Keytool, make sure to read
-<a href="#secure-key">Securing Your Private Key</a> for a discussion of how to keep
-your key secure and why doing so is critically important to you and to users. In
-particular, when you are generating your key, you should select strong passwords
-for both the keystore and key.</p>
-
-<table>
-<tr>
-<th>Keytool Option</th>
-<th>Description</th>
-</tr>
-<tr>
-<td><code>-genkey</code></td><td>Generate a key pair (public and private
-keys)</td>
-</tr>
-<tr>
-<td><code>-v</code></td><td>Enable verbose output.</td>
-</tr>
-<tr>
-<td><code>-alias <alias_name></code></td><td>An alias for the key. Only
-the first 8 characters of the alias are used.</td>
-</tr>
-<tr>
-<td><code>-keyalg <alg></code></td><td>The encryption algorithm to use
-when generating the key. Both DSA and RSA are supported.</td>
-</tr>
-<tr>
-<td><code>-keysize <size></code></td><td>The size of each generated key
-(bits). If not supplied, Keytool uses a default key size of 1024 bits. In
-general, we recommend using a key size of 2048 bits or higher. </td>
-</tr>
-<tr>
-<td><code>-dname <name></code></td><td><p>A Distinguished Name that describes
-who created the key. The value is used as the issuer and subject fields in the
-self-signed certificate. </p><p>Note that you do not need to specify this option
-in the command line. If not supplied, Jarsigner prompts you to enter each
-of the Distinguished Name fields (CN, OU, and so on).</p></td>
-</tr>
-<tr>
-<td><code>-keypass <password></code></td><td><p>The password for the
-key.</p> <p>As a security precaution, do not include this option in your command
-line. If not supplied, Keytool prompts you to enter the password. In this way,
-your password is not stored in your shell history.</p></td>
-</tr>
-<tr>
-<td><code>-validity <valdays></code></td><td><p>The validity period for the
-key, in days. </p><p><strong>Note:</strong> A value of 10000 or greater is recommended.</p></td>
-</tr>
-<tr>
-<td><code>-keystore <keystore-name>.keystore</code></td><td>A name
-for the keystore containing the private key.</td>
-</tr>
-<tr>
-<td><code>-storepass <password></code></td><td><p>A password for the
-keystore.</p><p>As a security precaution, do not include this option in your
-command line. If not supplied, Keytool prompts you to enter the password. In
-this way, your password is not stored in your shell history.</p></td>
-</tr>
-</table>
-
-<p>Here's an example of a Keytool command that generates a private key:</p>
-
-<pre>$ keytool -genkey -v -keystore my-release-key.keystore
--alias alias_name -keyalg RSA -keysize 2048 -validity 10000</pre>
-
-<p>Running the example command above, Keytool prompts you to provide
-passwords for the keystore and key, and to provide the Distinguished
-Name fields for your key. It then generates the keystore as a file called
-<code>my-release-key.keystore</code>. The keystore and key are
-protected by the passwords you entered. The keystore contains
-a single key, valid for 10000 days. The alias is a name that you —
-will use later, to refer to this keystore when signing your application. </p>
-
-<p>For more information about Keytool, see the documentation at
-<a
-href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html">
-http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html</a></p>
-
-
-
-<h3 id="releasecompile">2. Compile the application in release mode</h3>
-
-<p>In order to release your application to users, you must compile it in release mode.
-In release mode, the compiled application is not signed by default and you will need
-to sign it with your private key.</p>
-
-<p class="caution"><strong>Caution:</strong>
-You can not release your application unsigned, or signed with the debug key.</p>
-
-<h4>With Eclipse</h4>
-
-<p>To export an <em>unsigned</em> APK from Eclipse, right-click the project in the Package
-Explorer and select <strong>Android Tools</strong> > <strong>Export Unsigned Application
-Package</strong>. Then specify the file location for the unsigned APK.
-(Alternatively, open your <code>AndroidManifest.xml</code> file in Eclipse, select
-the <strong>Manifest</strong> tab, and click <strong>Export an unsigned APK</strong>.)</p>
-
-<p>Note that you can combine the compiling and signing steps with the Export Wizard. See
-<a href="#ExportWizard">Compiling and signing with Eclipse ADT</a>.</p>
-
-<h4>With Ant</h4>
-
-<p>If you are using Ant, you can enable release mode by using the <code>release</code> option
-with the <code>ant</code> command. For example, if you are running Ant from the
-directory containing your {@code build.xml} file, the command would look like this:</p>
-
-<pre>$ ant release</pre>
-
-<p>By default, the build script compiles the application APK without signing it. The output file
-in your project {@code bin/} will be <code><em><your_project_name></em>-unsigned.apk</code>.
-Because the application APK is still unsigned, you must manually sign it with your private
-key and then align it using {@code zipalign}.</p>
-
-<p>However, the Ant build script can also perform the signing
-and aligning for you, if you have provided the path to your keystore and the name of
-your key alias in the project's {@code ant.properties} file. With this information provided,
-the build script will prompt you for your keystore and alias password when you perform
-<code>ant release</code>, it will sign the package and then align it. The final output
-file in {@code bin/} will instead be
-<code><em><your_project_name></em>-release.apk</code>. With these steps
-automated for you, you're able to skip the manual procedures below (steps 3 and 4).
-To learn how to specify your keystore and alias in the {@code ant.properties} file,
-see <a href="{@docRoot}guide/developing/building/building-cmdline.html#ReleaseMode">
-Building and Running Apps on the Command Line</a>.</p>
-
-
-
-<h3 id="signapp">3. Sign your application with your private key</h3>
-
-<p>When you have an application package that is ready to be signed, you can do sign it
-using the Jarsigner tool. Make sure that you have Jarsigner available on your
-machine, as described in <a href="#setup">Basic Setup</a>. Also, make sure that
-the keystore containing your private key is available.</p>
-
-<p>To sign your application, you run Jarsigner, referencing both the
-application's APK and the keystore containing the private key with which to
-sign the APK. The table below shows the options you could use. </p>
-
-<table>
-<tr>
-<th>Jarsigner Option</th>
-<th>Description</th>
-</tr>
-<tr>
-<td><code>-keystore <keystore-name>.keystore</code></td><td>The name of
-the keystore containing your private key.</td>
-</tr>
-<tr>
-<td><code>-verbose</code></td><td>Enable verbose output.</td>
-</tr>
-<tr>
-<td><code>-sigalg</code></td><td>The name of the signature algorithim to use in signing the APK.
-Use the value {@code MD5withRSA}.</td>
-</tr>
-<tr>
-<td><code>-digestalg</code></td><td>The message digest algorithim to use in processing the entries
-of an APK. Use the value {@code SHA1}.</td>
-</tr>
-<tr>
-<td><code>-storepass <password></code></td><td><p>The password for the
-keystore. </p><p>As a security precaution, do not include this option
-in your command line unless you are working at a secure computer.
-If not supplied, Jarsigner prompts you to enter the password. In this
-way, your password is not stored in your shell history.</p></td>
-</tr>
-<tr>
-<td><code>-keypass <password></code></td><td><p>The password for the private
-key. </p><p>As a security precaution, do not include this option
-in your command line unless you are working at a secure computer.
-If not supplied, Jarsigner prompts you to enter the password. In this
-way, your password is not stored in your shell history.</p></td>
-</tr>
-</table>
-
-<p>Here's how you would use Jarsigner to sign an application package called
-<code>my_application.apk</code>, using the example keystore created above.
-</p>
-
-<pre>$ jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore my-release-key.keystore
-my_application.apk alias_name</pre>
-
-<p>Running the example command above, Jarsigner prompts you to provide
-passwords for the keystore and key. It then modifies the APK
-in-place, meaning the APK is now signed. Note that you can sign an
-APK multiple times with different keys.</p>
-
-<p class="caution"><strong>Caution:</strong> As of JDK 7, the default signing algorithim has
-changed, requiring you to specify the signature and digest algorithims ({@code -sigalg} and {@code
--digestalg}) when you sign an APK.</p>
-
-<p>To verify that your APK is signed, you can use a command like this:</p>
-
-<pre>$ jarsigner -verify my_signed.apk</pre>
-
-<p>If the APK is signed properly, Jarsigner prints "jar verified".
-If you want more details, you can try one of these commands:</p>
-
-<pre>$ jarsigner -verify -verbose my_application.apk</pre>
-
-<p>or</p>
-
-<pre>$ jarsigner -verify -verbose -certs my_application.apk</pre>
-
-<p>The command above, with the <code>-certs</code> option added, will show you the
-"CN=" line that describes who created the key.</p>
-
-<p class="note"><strong>Note:</strong> If you see "CN=Android Debug", this means the APK was
-signed with the debug key generated by the Android SDK. If you intend to release
-your application, you must sign it with your private key instead of the debug
-key.</p>
-
-<p>For more information about Jarsigner, see the documentation at
-<a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html">
-http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html</a></p>
-
-
-<h3 id="align">4. Align the final APK package</h3>
-
-<p>Once you have signed the APK with your private key, run <code>zipalign</code> on the file.
-This tool ensures that all uncompressed data starts with a particular byte alignment,
-relative to the start of the file. Ensuring alignment at 4-byte boundaries provides
-a performance optimization when installed on a device. When aligned, the Android
-system is able to read files with {@code mmap()}, even if
-they contain binary data with alignment restrictions, rather than copying all
-of the data from the package. The benefit is a reduction in the amount of
-RAM consumed by the running application.</p>
-
-<p>The <code>zipalign</code> tool is provided with the Android SDK, inside the
-<code>tools/</code> directory. To align your signed APK, execute:</p>
-
-<pre>$ zipalign -v 4 <em>your_project_name</em>-unaligned.apk <em>your_project_name</em>.apk</pre>
-
-<p>The {@code -v} flag turns on verbose output (optional). {@code 4} is the
-byte-alignment (don't use anything other than 4). The first file argument is
-your signed {@code .apk} file (the input) and the second file is the destination {@code .apk} file
-(the output). If you're overriding an existing APK, add the {@code -f} flag.</p>
-
-<p class="caution"><strong>Caution:</strong> Your input APK must be signed with your
-private key <strong>before</strong> you optimize the package with {@code zipalign}.
-If you sign it after using {@code zipalign}, it will undo the alignment.</p>
-
-<p>For more information, read about the
-<a href="{@docRoot}guide/developing/tools/zipalign.html">zipalign</a> tool.
-
-
-<h3 id="ExportWizard">Compile and sign with Eclipse ADT</h3>
-
-<p>If you are using Eclipse with the ADT plugin, you can use the Export Wizard to
-export a <em>signed</em> APK (and even create a new keystore,
-if necessary). The Export Wizard performs all the interaction with
-the Keytool and Jarsigner for you, which allows you to sign the package using a GUI
-instead of performing the manual procedures to compile, sign,
-and align, as discussed above. Once the wizard has compiled and signed your package,
-it will also perfom package alignment with {@code zipalign}.
-Because the Export Wizard uses both Keytool and Jarsigner, you should
-ensure that they are accessible on your computer, as described above
-in the <a href="#setup">Basic Setup for Signing</a>.</p>
-
-<p>To create a signed and aligned APK in Eclipse:</p>
-
-<ol>
- <li>Select the project in the Package
-Explorer and select <strong>File > Export</strong>.</li>
- <li>Open the Android folder, select Export Android Application,
- and click <strong>Next</strong>.
- <p>The Export Android Application wizard now starts, which will
- guide you through the process of signing your application,
- including steps for selecting the private key with which to sign the APK
- (or creating a new keystore and private key).</p>
- <li>Complete the Export Wizard and your application will be compiled,
- signed, aligned, and ready for distribution.</li>
-</ol>
-
-
-
-<h2 id="secure-key">Securing Your Private Key</h2>
-
-<p>Maintaining the security of your private key is of critical importance, both
-to you and to the user. If you allow someone to use your key, or if you leave
-your keystore and passwords in an unsecured location such that a third-party
-could find and use them, your authoring identity and the trust of the user
-are compromised. </p>
-
-<p>If a third party should manage to take your key without your knowledge or
-permission, that person could sign and distribute applications that maliciously
-replace your authentic applications or corrupt them. Such a person could also
-sign and distribute applications under your identity that attack other
-applications or the system itself, or corrupt or steal user data. </p>
-
-<p>Your reputation as a developer entity depends on your securing your private
-key properly, at all times, until the key is expired. Here are some tips for
-keeping your key secure: </p>
-
-<ul>
-<li>Select strong passwords for the keystore and key.</li>
-<li>When you generate your key with Keytool, <em>do not</em> supply the
-<code>-storepass</code> and <code>-keypass</code> options at the command line.
-If you do so, your passwords will be available in your shell history,
-which any user on your computer could access.</li>
-<li>Similarly, when signing your applications with Jarsigner,
-<em>do not</em> supply the <code>-storepass</code> and <code>-keypass</code>
-options at the command line. </li>
-<li>Do not give or lend anyone your private key, and do not let unauthorized
-persons know your keystore and key passwords.</li>
-</ul>
-
-<p>In general, if you follow common-sense precautions when generating, using,
-and storing your key, it will remain secure. </p>
\ No newline at end of file
diff --git a/docs/html/guide/publishing/licensing.html b/docs/html/guide/publishing/licensing.html
deleted file mode 100644
index 8e97f32..0000000
--- a/docs/html/guide/publishing/licensing.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh"
-content="0;url=http://developer.android.com/guide/market/licensing/index.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should have been redirected. Please <a
-href="http://developer.android.com/guide/market/licensing/index.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/publishing/preparing.jd b/docs/html/guide/publishing/preparing.jd
deleted file mode 100644
index 8e75728..0000000
--- a/docs/html/guide/publishing/preparing.jd
+++ /dev/null
@@ -1,358 +0,0 @@
-page.title=Preparing for Release
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>Quickview</h2>
- <ul>
- <li>Learn which resources you'll need to release your app.</li>
- <li>Find out how to configure and build your app for release.</li>
- <li>Learn best practices for releasing your app.</li>
- </ul>
- <h2>In this document</h2>
- <ol>
- <li><a href="#publishing-intro">Introduction</a></li>
- <li><a href="#publishing-gather">Gathering Materials and Resources</a></li>
- <li><a href="#publishing-configure">Configuring Your Application</a></li>
- <li><a href="#publishing-build">Building Your Application</a></li>
- <li><a href="#publishing-resources">Preparing External Servers and Resources</a></li>
- <li><a href="#publishing-test">Testing Your Application for Release</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/publishing/publishing_overview.html">Publishing Overview</a></li>
- <li><a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a></li>
- <li><a href="{@docRoot}guide/publishing/publishing.html">Publishing on Google Play</a></li>
- </ol>
- </div>
-</div>
-
-<p>Before you distribute your Android application to users you need to prepare it for release. The
-preparation process is a required <a href="{@docRoot}guide/developing/index.html">development
-task</a> for all Android applications and is the first step in the publishing process (see figure
-1).</p>
-
-<p>When you prepare your application for release, you configure, build, and test a release
-version of your application. The configuration tasks are straightforward, involving basic code
-cleanup and code modification tasks that help optimize your application. The build process is
-similar to the debug build process and can be done using JDK and Android SDK tools. The testing
-tasks serve as a final check, ensuring that your application performs as expected under real-world
-conditions. When you are finished preparing your application for release you have a signed
-<code>.apk</code> file, which you can distribute directly to users or distribute through an
-application marketplace such as Google Play.</p>
-
-<p>This document summarizes the main tasks you need to perform to prepare your application for
-release. The tasks that are described in this document apply to all Android applications regardless
-how they are released or distributed to users. If you are releasing your application through Google
-Play, you should also read <a href="{@docRoot}guide/publishing/publishing.html">Publishing on
-Google Play</a> to be sure your release-ready application satisfies all Google Play
-requirements.</p>
-
-<p class="note"><strong>Note:</strong> As a best practice, your application should meet all of your
-release criteria for functionality, performance, and stability before you perform the tasks outlined
-in this document.</p>
-
-<img src="{@docRoot}images/publishing/publishing_overview_prep.png"
- alt="Shows how the preparation process fits into the development process"
- height="190"
- id="figure1" />
-<p class="img-caption">
- <strong>Figure 1.</strong> Preparing for release is a required <a
-href="{@docRoot}guide/developing/index.html">development
-task</a> and is the first step in the publishing process.
-</p>
-
-<h2 id="publishing-intro">Introduction</h2>
-
-<p>To release your application to users you need to create a release-ready package that users can
-install and run on their Android-powered devices. The release-ready package contains the same
-components as the debug <code>.apk</code> file — compiled source code, resources, manifest
-file, and so on — and it is built using the same build tools. However, unlike the debug
-<code>.apk</code> file, the release-ready <code>.apk</code> file is signed with your own certificate
-and it is optimized with the zipalign tool.</p>
-
-<div class="figure" style="width:331px">
- <img src="{@docRoot}images/publishing/publishing_preparing.png"
- alt="Shows the five tasks you perform to prepare your app for release"
- height="450" />
- <p class="img-caption">
- <strong>Figure 2.</strong> You perform five main tasks to prepare your application for
- release.
- </p>
-</div>
-
-<p>The signing and optimization tasks are usually seamless if you are building your application with
-Eclipse and the ADT plugin or with the Ant build script (included with the Android SDK). For
-example, you can use the Eclipse Export Wizard to compile, sign, and optimize your application all
-at once. You can also configure the Ant build script to do the same when you build from the command
-line.</p>
-
-<p>To prepare your application for release you typically perform five main tasks (see figure 2).
-Each main task may include one or more smaller tasks depending on how you are releasing your
-application. For example, if you are releasing your application through Google Play you may want
-to add special filtering rules to your manifest while you are configuring your application for
-release. Similarly, to meet Google Play publishing guidelines you may have to prepare screenshots
-and create promotional text while you are gathering materials for release.</p>
-
-<p>You usually perform the tasks listed in figure 2 after you have throroughly debugged and tested
-your application. The Android SDK contains several tools to help you test and debug your Android
-applications. For more information, see the <a
-href="{@docRoot}guide/developing/debugging/index.html">Debugging</a> and <a
-href="{@docRoot}guide/developing/testing/index.html">Testing</a> sections in the Dev Guide.</p>
-
-<h2 id="publishing-gather">Gathering Materials and Resources</h2>
-
-<p>To begin preparing your application for release you need to gather several supporting items. At a
-minimum this includes cryptographic keys for signing your application and an application icon. You
-might also want to include an end-user license agreement.</p>
-
-<h4 id="publishing-keys">Cryptographic keys</h4>
-
-<p>The Android system requires that each installed application be digitally signed with a
-certificate that is owned by the application's developer (that is, a certificate for which the
-developer holds the private key). The Android system uses the certificate as a means of identifying
-the author of an application and establishing trust relationships between applications. The
-certificate that you use for signing does not need to be signed by a certificate authority; the
-Android system allows you to sign your applications with a self-signed certificate. To learn about
-certificate requirements, see <a href="{@docRoot}guide/publishing/app-signing.html#cert">Obtain a
-suitable private key</a>.</p>
-
-<p class="caution"><strong>Important:</strong> Your application must be signed with a cryptographic
-key whose validity period ends after 22 October 2033.</p>
-
-<p>You may also have to obtain other release keys if your application accesses a service or uses a
-third-party library that requires you to use a key that is based on your private key. For example,
-if your application uses the <a
-href="http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapView.html">MapView</a>
-class, which is part of the <a
-href="http://code.google.com/android/add-ons/google-apis/maps-overview.html">Google Maps external
-library</a>, you will need to register your application with the Google Maps service and obtain
-a Maps API key. For information about getting a Maps API key, see <a
-href="http://code.google.com/android/add-ons/google-apis/mapkey.html"> Obtaining a Maps API
-key</a>.</p>
-
-<h4>Application Icon</h4>
-
-<p>Be sure you have an application icon and that it meets the recommended <a
-href="{@docRoot}guide/practices/ui_guidelines/icon_design_launcher.html">icon guidelines</a>. Your
-application's icon helps users identify your application on a device's Home
-screen and in the Launcher window. It also appears in Manage Applications, My Downloads, and
-elsewhere. In addition, publishing services such as Google Play display your icon to users.</p>
-
-<p class="note"><strong>Note:</strong> If you are releasing your application on Google Play, you
-need to create a high resolution
- version of your icon. See <a
-href="https://www.google.com/support/androidmarket/developer/bin/answer.py?answer=1078870">Graphic
-Assets for your Application</a> for more information.</p>
-
-<h4>End-user License Agreement</h4>
-
-<p>Consider preparing an End User License Agreement (EULA) for your application. A EULA can help
-protect your person, organization, and intellectual property, and we recommend that you provide one
-with your application.</p>
-
-<h4>Miscellaneous Materials</h4>
-
-<p>You might also have to prepare promotional and marketing materials to publicize your application.
-For example, if you are releasing your application on Google Play you will need to prepare some
-promotional text and you will need to create screenshots of your application. For more
-information, see
-<a href="https://www.google.com/support/androidmarket/developer/bin/answer.py?answer=1078870">
-Graphic Assets for your Application</a></p>
-
-<h2 id="publishing-configure">Configuring Your Application for Release</h2>
-
-<p>After you gather all of your supporting materials you can start configuring your application
-for release. This section provides a summary of the configuration changes we recommend that you make
-to your source code, resource files, and application manifest prior to releasing your application.
-Although most of the configuration changes listed in this section are optional, they are
-considered good coding practices and we encourage you to implement them. In some cases,
-you may have already made these configuration changes as part of your development process.</p>
-
-<h4>Choose a good package name</h4>
-
-<p>Make sure you choose a package name that is suitable over the life of your application. You
-cannot change the package name after you distribute your application to users. You can set the
-package name in application's manifest file. For more information, see the <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#package">package</a> attribute
-documentation.</p>
-
-<h4>Turn off logging and debugging</h4>
-
-<p>Make sure you deactivate logging and disable the debugging option before you build your
-application for release. You can deactivate logging by removing calls to
-{@link android.util.Log} methods in your source files. You can disable debugging by removing the
-<code>android:debuggable</code> attribute from the <code><application></code> tag in your
-manifest file, or by setting the <code>android:debuggable</code> attribute to
-<code>false</code> in your manifest file. Also, remove any log files or static test files that
-were created in your project.</p>
-
-<p>Also, you should remove all {@link android.os.Debug} tracing calls that you
-added to your code, such as {@link android.os.Debug#startMethodTracing()} and
-{@link android.os.Debug#stopMethodTracing()} method calls.</p>
-
-<h4>Clean up your project directories</h4>
-
-<p>Clean up your project and make sure it conforms to the directory structure described in <a
-href="{@docRoot}guide/developing/projects/index.html#ApplicationProjects">Android Projects</a>.
-Leaving stray or orphaned files in your project can prevent your application from compiling and
-cause your application to behave unpredictably. At a minimum you should do the following cleanup
-tasks:</p>
-
-<ul>
- <li>Review the contents of your <code>jni/</code>, <code>lib/</code>, and <code>src/</code>
- directories. The <code>jni/</code> directory should contain only source files associated with the
- <a href="{@docRoot}sdk/ndk/index.html">Android NDK</a>, such as
- <code>.c</code>, <code>.cpp</code>, <code>.h</code>, and <code>.mk</code> files. The
- <code>lib/</code> directory should contain only third-party library files or private library
- files, including prebuilt shared and static libraries (for example, <code>.so</code> files). The
- <code>src/</code> directory should contain only the source files for your application
- (<code>.java</code> and <code>.aidl</code> files). The <code>src/</code> directory should not
- contain any <code>.jar</code> files.</li>
- <li>Check your project for private or proprietary data files that your application does not use
- and remove them. For example, look in your project's <code>res/</code> directory for old
- drawable files, layout files, and values files that you are no longer using and delete them.</li>
- <li>Check your <code>lib/</code> directory for test libraries and remove them if they are no
- longer being used by your application.</li>
- <li>Review the contents of your <code>assets/</code> directory and your <code>res/raw/</code>
- directory for raw asset files and static files that you need to update or remove prior to
- release.</li>
-</ul>
-
-<h4>Review and update your manifest settings</h4>
-
-<p>Verify that the following manifest items are set correctly:</p>
-
-<ul>
- <li><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">
- <uses-permission></a> element
- <p>You should specify only those permissions that are relevant and required for your application.</p>
- </li>
- <li><code>android:icon</code> and <code>android:label</code> attributes
- <p>You must specify values for these attributes, which are located in the
- <a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a>
- element.</p>
- </li>
- <li><code>android:versionCode</code> and <code>android:versionName</code> attributes.
- <p>We recommend that you specify values for these attributes, which are located in the
- <a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a>
- element. For more information see
- <a href="{@docRoot}guide/publishing/versioning.html">Versioning your Application</a>.</p>
- </li>
-</ul>
-
-<p>There are several additional manifest elements that you can set if you are releasing your
-application on Google Play. For example, the <code>android:minSdkVersion</code> and
-<code>android:targetSdkVersion</code> attributes, which are located in the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"> <uses-sdk></a> element. For more
-information about these and other Google Play settings, see <a
-href="{@docRoot}/guide//appendix/market-filters.html">Filters on Google Play</a>.</p>
-
-<h4>Address compatibility issues</h4>
-
-<p>Android provides several tools and techniques to make your application compatible with a wide
-range of devices. To make your application available to the largest number of users, consider
-doing the following:</p>
-
-<ul>
- <li><strong>Add support for multiple screen configurations</strong>
- <p>Make sure you meet the
- <a href="{@docRoot}guide/practices/screens_support.html#screen-independence">
- best practices for supporting multiple screens</a>. By supporting multiple screen configurations
- you can create an application that functions properly and looks good on any of the screen sizes
- supported by Android.</p>
- </li>
- <li><strong>Optimize your application for Android 3.0 devices.</strong>
- <p>If your application is designed for devices older than Android 3.0, make it compatible
- with Android 3.0 devices by following the guidelines and best practices described in
- <a href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing Apps for Android 3.0
- </a>.</p>
- </li>
- <li><strong>Consider using the Support Library</strong>
- <p>If your application is designed for devices running Android 3.x, make your application
- compatible with older versions of Android by adding the
- <a href="{@docRoot}sdk/compatibility-library.html">Support Library</a> to your
- application project. The Support Library provides static support libraries that you can add to
- your Android application, which enables you to use APIs that are either not available on
- older platform versions or use utility APIs that are not part of the framework APIs.</p>
- </li>
-</ul>
-
-<h4>Update URLs for servers and services</h4>
-
-<p>If your application accesses remote servers or services, make sure you are using the production
-URL or path for the server or service and not a test URL or path.</p>
-
-<h4>Implement Licensing (if you are releasing on Google Play)</h4>
-
-<p>If you are releasing a paid application through Google Play, consider adding support for
-Google Play Licensing. Licensing lets you control access to your application based on whether the
-current user has purchased it. Using Google Play Licensing is optional even if you are
-releasing your app through Google Play.</p>
-
-<p>For more information about Google Play Licensing Service and how to use it in your
-application, see <a href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a>.</p>
-
-<h2 id="publishing-build">Building Your Application for Release</h2>
-
-<p>After you finish configuring your application you can build it into a release-ready
-<code>.apk</code> fle that is signed and optimized. The JDK includes the tools for signing the
-<code>.apk</code> file (Keytool and Jarsigner); the Android SDK includes the tools for compiling and
-optimizing the <code>.apk</code> file. If you are using Eclipse with the ADT plugin or you are using
-the Ant build script from the command line, you can automate the entire build process.</p>
-
-<h3>Building with Eclipse</h3>
-
-<p>You can use the Eclipse Export Wizard to build a release-ready <code>.apk</code> file that is
-signed with your private key and optimized. To learn how to run the Export Wizard, see
-<a href="{@docRoot}guide/publishing/app-signing.html#ExportWizard">Compile and sign with Eclipse
-ADT</a>. The Export Wizard compiles your application for release, signs your application with your
-private key, and optimizes your application with the zipalign tool. The Export Wizard should run
-successfully if you have run or debugged your application from Eclipse and you have no errors in
-your application (see <a href="{@docRoot}guide/developing/building/building-eclipse.html">Building
-and Running from Eclipse with ADT</a> for more information.</p>
-
-<p>The Export Wizard assumes that you have a <a href="#billing-keys">certificate and private key</a>
-suitable for signing your application. If you do not have a suitable certificate and private key,
-the Export Wizard will help you generate one (see
-<a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a> for more
-information about the signing process and signing guidelines.</p>
-
-<h3>Building with Ant</h3>
-
-<p>You can use the Ant build script (included in the Android SDK) to build a release-ready
-<code>.apk</code> file that is signed with your private key and optimized. To learn how to do this,
-see <a href="{@docRoot}guide/developing/building/building-cmdline.html#ReleaseMode">Building in
-Release Mode</a>. This build method assumes you have a <a href="#billing-keys">certificate and
-private key</a> suitable for signing your application. If you do not have a suitable certificate and
-private key, the Export Wizard will help you generate one (see
-<a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a> for more
-information about the signing process and signing guidelines.</p>
-
-<h2 id="publishing-resources">Preparing External Servers and Resources</h2>
-
-<p>If your application relies on a remote server, make sure the server is secure and that it is
-configured for production use. This is particularly important if you are implementing <a
-href="{@docRoot}guide/market/billing/index.html">in-app billing</a> in your application and you are
-performing the signature verification step on a remote server.</p>
-
-<p>Also, if your application fetches content from a remote server or a real-time service (such as a
-content feed), be sure the content you are providing is up to date and production-ready.</p>
-
-<h2 id="publishing-test">Testing Your Application for Release</h2>
-
-<p>Testing the release version of your application helps ensure that your application runs properly
-under realistic device and network conditions. Ideally, you should test your application on at least
-one handset-sized device and one tablet-sized device to verify that your user interface elements are
-sized correctly and that your application's performance and battery efficiency are acceptable.</p>
-
-<p>As a starting point for testing, see
-<a href="{@docRoot}guide/topics/testing/what_to_test.html">What to Test</a>. This article provides
-a summary of common Android situations that you should consider when you are testing. When you are
-done testing and you are satisfied that the release version of your application
-behaves correctly, you can release your application to users. For more information, see
-<a href="{@docRoot}guide/publishing/publishing_overview.html#publishing-release">Releasing Your
-Application to Users</a>. If you are publishing your application on Google Play, see
-<a href="{@docRoot}guide/publishing/publishing.html">Publishing on Google Play</a>.</p>
-
-
diff --git a/docs/html/guide/publishing/publishing.jd b/docs/html/guide/publishing/publishing.jd
deleted file mode 100644
index b9513ab..0000000
--- a/docs/html/guide/publishing/publishing.jd
+++ /dev/null
@@ -1,703 +0,0 @@
-page.title=Publishing on Google Play
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>Quickview</h2>
-
-<ul>
-<li>Learn how to publish and update apps on Google Play.</li>
-<li>Find out how to create links to apps that are published on Google Play.</li>
-<li>Learn about Google Play features.</li>
-</ul>
-
-
-<h2>In this document</h2>
-
-<ol>
-<li><a href="#overview">About Google Play</a>
-<li><A href="#marketpublish">Publishing Apps on Google Play</a></li>
-<li><a href="#marketupgrade">Publishing Updates on Google Play</a></li>
-<li><a href="#marketLicensing">Using Google Play Licensing Service</a></li>
-<li><a href="#marketinappbilling">Using Google Play In-app Billing</a></li>
-<li><a href="#marketintent">Linking to Your Apps on Google Play</a>
- <ol>
- <li><a href="#OpeningDetails">Opening an app's details page</a></li>
- <li><a href="#PerformingSearch">Performing a search</a></li>
- <li><a href="#BuildaButton">Build a Google Play button</a></li>
- <li><a href="#UriSummary">Summary of URI formats</a></li>
- </ol>
-</li>
-</ol>
-
-<h2>See also</h2>
-
-<ol>
-<li><a href="{@docRoot}guide/publishing/publishing_overview.html">Publishing Overview</a></li>
-<li><a href="{@docRoot}guide/publishing/preparing.html">Preparing for Release</a></li>
-</ol>
-
-<div id="qv-extra">
- <img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
- <div id="qv-sub-rule">
- <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0 5px;">
- <h2 style="color:#669999;">Already know about Google Play and want to get started?</h2>
- <p>Go to <a href="http://play.google.com/apps/publish">Google Play</a>, create a developer
-account, and upload your application. For more information about required assets, listing details,
-and publishing options, see <a
-href="http://market.android.com/support/bin/answer.py?answer=113469">Upload
-Applications</a>.</p>
- </div>
-</div>
-
-</div>
-</div>
-
-<p>One of the most effective ways to get your application into users' hands is to
-publish it on an application marketplace like Google Play. Publishing on Google Play is a
-straightforward process that you can do in just a few simple steps—register, configure,
-upload, and publish. Registration takes only a few minutes and needs to be done only once.
-The configuration and publishing steps can all be done through the Google Play Android Developer Console
-after you register as a Google Play developer.</p>
-
-<p>To start publishing on Google Play, first read this topic and then go to the <a
-href="https://play.google.com/apps/publish">Google Play Android Developer Console</a> and register as
-a Google Play developer.</p>
-
-
-<h2 id="overview">About Google Play</h2>
-
-<p>Google Play is a robust publishing platform that helps you publicize, sell, and distribute
-your Android applications to users around the world. When you release your applications through
-Google Play you have access to a suite of developer tools that let you analyze your sales,
-identify market trends, and control who your applications are being distributed to. You also have
-access to several revenue-enhancing features, such as <a
-href="{@docRoot}guide/market/billing/index.html">in-app billing</a> and
-<a href="{@docRoot}guide/market/licensing/index.html">application licensing</a>.</p>
-
-<p>Before you can publish applications on Google Play, you need to <a
-href="http://play.google.com/apps/publish">register</a> as a Google Play developer. During the
-registration process you will need to create a developer profile, pay a registration fee, and agree
-to the <a href="http://www.android.com/us/developer-distribution-agreement.html">Google Play
-Developer Distribution Agreement</a>. After you register you can access the Developer
-Console, where you can upload applications, configure publishing options, and monitor publishing
-data. If you want to sell your applications or use the in-app billing feature, you will also need
-to set up a Google Checkout merchant account. For more information about the registration process,
-see <a href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=113468">
-Developer Registration</a>.</p>
-
-<h2 id="marketpublish">Publishing Apps on Google Play</h2>
-
-<p>Publishing your application on Google Play is a simple process that involves three basic
-tasks (see figure 1):</p>
-
-<ul>
- <li>Creating various graphical assets that
-accompany your app on Google Play.</li>
- <li>Using the Google Play <a
-href="http://play.google.com/apps/publish">Developer Console</a> to configure publishing options,
-specify listing details, and upload your app and graphical assets to Google Play.</li>
- <li>Reviewing your publishing settings and changing the release
-status of your app from Unpublished to Published.</li>
-</ul>
-
-<img src="{@docRoot}images/publishing/publishing_android_market.png"
- alt="Shows the three steps that are required to publish on Google Play"
- height="168"
- id="figure1" />
-<p class="img-caption">
- <strong>Figure 1.</strong> To publish apps on Google Play you must first <a
-href="{@docRoot}guide/publishing/preparing.html">prepare your app for release</a> and then perform
-three simple tasks.
-</p>
-
-<p class="caution"><strong>Important:</strong> You must <a
-href="{@docRoot}guide/publishing/preparing.html">prepare your application for release</a> before you
-can publish it on Google Play. When you prepare your application for release you configure it for
-release and build it in release mode. Building in release mode signs your application's {@code .apk}
-file with your private release key. You cannot publish an application on Google Play unless it is
-signed with your own private release key.</p>
-
-<h3>Preparing promotional materials</h3>
-
-<p>To fully leverage the marketing and publicity capabilities of Google Play, you need to create
-several graphical assets that accompany your app on Google Play, such as screenshots, videos,
-promotional graphics, and promotional text. At a minimum you must provide two screenshots of your
-application and a high resolution application icon. The screenshots are displayed on the details
-page for your application on Google Play, and the high resolution application icon is displayed
-in various locations throughout Google Play. The high resolution icon does not replace the
-launcher icon for your application, rather, it serves as a supplemental icon and should look
-the same as your launcher icon. Promotional video,
-graphics, and text are optional, although we strongly recommended that you prepare these for your
-app. For more information about the graphic assets that accompany your application, see <a
-href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=1078870">Graphic
-Assets for your Application</a>.</p>
-
-<h3>Configuring options and uploading assets</h3>
-
-<p>Google Play lets you target your application to a worldwide pool of users and devices. To
-reach these users you can use the Developer Console to configure various publishing
-options and listing details for your app. For example, you can choose the <a
-href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=138294&topic=
-2365624&ctx=topic">countries</a> you want to reach, the listing languages you want to use, and the
-<a
-href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=138412&topic=
-15867&ctx=topic">price</a> you want to charge in each country. You can also configure listing
-details such as the application type, <a
-href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=113475&topic=
-2365760&ctx=topic">category</a>, and <a
-href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=188189&topic=
-2364761&ctx=topic">content rating</a>. In addition, if you want to sell items within your app using
-the in-app billing feature, you can use the Developer Console to <a
-href="http://grendel.sea.corp.google.com:48014/guide/market/billing/billing_admin.html#billing-list
-- setup">create a product list</a> and control which items are available for purchase in your
-app.</p>
-
-<p>When you are finished setting publishing options and listing details, you can upload your assets
-and your application to Google Play. You can also upload your application as a draft
-(unpublished) application, which lets you do final testing before you publish it for final
-release.</p>
-
-<p>To learn more about Google Play publishing settings, see the following resources:</p>
-
-<ul>
- <li><a
-href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=113469&topic=
-236562&ctx=topic">Upload Applications</a>—provides a summary of the publishing settings
-you can configure for an app.</li>
- <li><a
-href="http://support.google.com/androidmarket/developer/bin/topic.py?hl=en&topic=15867">Selling
-Your Apps</a>—provides guidance about pricing, supported currencies, tax rates, and many
-other topics related to selling apps.</li>
- <li><a
-href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=1169947&topic=
-15867&ctx=topic">Selling Apps in Multiple Currencies</a>—provides a description of how
-pricing, payouts, and exchange rates work.</li>
-</ul>
-
-<h3>Publishing your application</h3>
-
-<p>When you are satisfied that your publishing settings are correctly configured and your uploaded
-application is ready to be released to the public, you can simply click <strong>Publish</strong> in
-the Developer Console to make your app available for download
-around the world. Keep in mind, it can take several hours for your app to appear on Google
-Play after you click <strong>Publish</strong> in the Developer Console.</p>
-
-<h3>Controlling Distribution to Devices</h3>
-
-<p>If your application targets different device configurations, you can control which Android-powered
-devices have access to your application on Google Play by
-using Google Play filters. Filtering compares device configurations that you declare in your
-app's manifest file to the configuration defined by a device. For example, if you declare the camera
-filter in your manifest, only those devices that have a camera will see your app on Google
-Play. Filters must be configured in your application's manifest file when you are <a
-href="{@docRoot}guide/publishing/preparing.html">preparing your app for release</a> (that is, before
-you upload your app to Google Play). For more information, see <a
-href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>.</p>
-
-<p>You can also use the multiple APK feature to distribute different {@code .apk} files under the same
-application listing and the same package name; however, you should use this option only as a last
-resort. Android applications usually run on most compatible devices with a single APK, by supplying
-alternative resources for different configurations (for example, different layouts for different screen
-sizes) and the Android system selects the appropriate resources for the device at runtime. In a
-few cases, however, a single APK is unable to support all device configurations, because alternative
-resources make the APK file too big (greater than 50MB) or other technical challenges prevent a
-single APK from working on all devices. Although we encourage you to develop and publish a single
-APK that supports as many device configurations as possible, doing so is sometimes
-not possible. To help you publish your application for as many devices as possible, Google Play
-allows you to publish multiple APKs under the same application listing. Google Play then supplies
-each APK to the appropriate devices based on configuration support you've declared in the manifest
-file of each APK. To use this feature, you need to build your separate {@code .apk} files when you are <a
-href="{@docRoot}guide/publishing/preparing.html">preparing your app for release</a> (that is, before
-you upload your app to Google Play). For more information, see <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html">Multiple APK Support</a>.</p>
-
-<h2 id="marketupgrade">Publishing Updates on Google Play</h2>
-
-<p>At any time after publishing an application on Google Play, you can upload
-and publish an update to the same application package. When you publish an
-update to an application, users who have already installed the
-application may receive a notification that an update is
-available for the application. They can then choose to update the application
-to the latest version.</p>
-
-<p>Before uploading the updated application, be sure that you have incremented
-the <code>android:versionCode</code> and <code>android:versionName</code>
-attributes in the <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html"><code><manifest></code></a>
-element of the manifest file. Also, the package name must be the same as the existing version and
-the {@code .apk} file must be signed with the same private key. If the package name and signing
-certificate do <em>not</em> match those of the existing version, Google Play will
-consider it a new application, publish it as such, and will not offer it to existing users as an
-update.</p>
-
-<p>If you plan to publish your application on Google Play, you must make sure
- that it meets the requirements listed below, which are enforced by Google Play
- when you upload the application.</p>
-
-<h2 id="marketLicensing">Using Google Play Licensing Service</h2>
-
-<p>Google Play offers a licensing service that lets you enforce licensing
-policies for paid applications that you publish through Google Play. With
-Google Play Licensing, your applications can query Google Play at runtime
-to obtain the licensing status for the current user, then allow or disallow
-further use of the application as appropriate. Using the service, you can apply a flexible
-licensing policy on an application-by-application basis—each
-application can enforce its licensing status in the way most appropriate
-for it. </p>
-
-<p>Any application that you publish through Google Play can use the Google
-Play Licensing Service. The service uses no dedicated framework APIs, so you can
-add licensing to any application that uses a minimum API Level of 3 or
-higher.</p>
-
-<p>For complete information about Google Play Licensing Service and how to
-use it in your application, read <a
-href="{@docRoot}guide/market/licensing/index.html">Application Licensing</a>.</p>
-
-<h2 id="marketinappbilling">Using Google Play In-app Billing</h2>
-
-<p><a href="{@docRoot}guide/market/billing/billing_overview.html">Google Play In-app Billing</a>
-is a Google Play service that lets you sell digital content in your applications. You can use
-the service to sell a wide range of content, including downloadable content such as media files or
-photos, and virtual content such as game levels or potions.</p>
-
-<p>When you use Google Play's in-app billing service to sell an item, Google Play handles all
-billing details so your application never has to directly process any financial transactions.
-Google Play uses the same checkout service that is used for application purchases, so your users
-experience a consistent and familiar purchase flow (see figure 1). Also, the transaction fee for
-in-app purchases is the same as the transaction fee for application purchases (30%).</p>
-
-<p>Any application that you publish through Google Play can implement in-app billing. No special
-account or registration is required other than a Google Play publisher account and a Google
-Checkout Merchant account. Also, because the service uses no dedicated framework APIs, you can add
-in-app billing to any application that uses a minimum API level of 4 or higher.</p>
-
-<p>To help you integrate in-app billing into your application, the Android SDK provides a <a
-href="{@docRoot}guide/market/billing/billing_integrate.html#billing-download">sample application</a>
-that demonstrates a simple implementation of in-app billing. The sample application contains
-examples of billing-related classes you can use to implement in-app billing in your application. It
-also contains examples of the database, user interface, and business logic you might use to
-implement in-app billing. For more information about the in-app billing feature, see the
-<a href="{@docRoot}guide/market/billing/index.html">In-app Billing documentation</a>.</p>
-
-<h2 id="marketintent">Linking to Your Apps on Google Play</h2>
-
-<p>To help users discover your published applications, you can use two special Google Play URIs
-that direct users to your application's details page or perform a search for all of your published
-applications on Google Play. You can use these URIs to create a button in your application or a
-link on a web page that:</p>
-
-<ul>
- <li>Opens your application's details page in the Google Play application or web site.</li>
- <li>Searches for all your published applications in the Google Play application or web
-site.</li>
-</ul>
-
-<p>You can launch the Google Play application or web site in the following ways:</p>
-<ul>
- <li>Initiate an {@link android.content.Intent} from your application that launches the
-Google Play application on the user's device.</li>
- <li>Provide a link on a web page that opens the Google Play web site (but will also
-open the Google Play application if clicked from a device).</li>
-</ul>
-
-<p>In both cases, whether you want to initiate the action from your application or from a web
-page, the URIs are quite similar. The only difference is the URI prefix.</p>
-
-<p>To open the Google Play application from your application, the prefix for the intent's data
-URI is:</p>
-
-<p style="margin-left:2em"><code>market://</code></p>
-
-<p>To open Google Play store from your web site, the prefix for the link URI is:</p>
-
-<p style="margin-left:2em"><code>http://play.google.com/store/</code></p>
-
-<p>The following sections describe how to create a complete URI for each action.</p>
-
-<p class="note"><strong>Note:</strong> If you create a link to open Google Play from your web
-site and the user selects it from an Android-powered device, the device's Google Play application will
-resolve the link so the user can use the Google Play application on the device instead of opening the web
-site. As such, you should always use {@code http://play.google.com/store/apps/...} URIs when
-creating a link on
-a web page. When pointing to your apps from within your Android app, use the
-{@code market://} URIs in an intent, so that the Google Play application always opens.</p>
-
-
-<h3 id="OpeningDetails">Opening an app's details page</h3>
-
-<p>As described above, you can open the details page for a specific application either on the
-Google Play application or the Google Play web site. The details page allows the user to see
-the application description, screenshots, reviews and more, and choose to install it.</p>
-
-<p>The format for the URI that opens the details page is:</p>
-
-<p style="margin-left:2em"><code><URI_prefix><b>apps/details?id=</b><package_name></code></p>
-
-<p>The <code><package_name></code> is a placeholder for the target application's
-fully-qualified package name, as declared in the <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#package">{@code
-package}</a> attribute of the <a href="{@docRoot}guide/topics/manifest/manifest-element.html">{@code
-<manifest>}</a> element.</p>
-
-<p>For example: <code>http://play.google.com/store/apps/details?id=com.example.myapp</code></p>
-
-
-<h4>Opening the app details page from your Android app</h4>
-
-<p>To open the Google Play details page from your application,
-create an intent with the {@link android.content.Intent#ACTION_VIEW} action and include a data URI
-in this format:</p>
-
-<p style="margin-left:2em"><code>market://details?id=<package_name></code></p>
-
-<p>For example, here's how you can create an intent and open an application's details page in
-Google Play:</p>
-
-<pre>
-Intent intent = new Intent(Intent.ACTION_VIEW);
-intent.setData(Uri.parse("market://details?id=com.example.android"));
-startActivity(intent);
-</pre>
-
-<p>This will open the Google Play application on the device to view the {@code
-com.example.android} application.</p>
-
-
-<h4>Opening the app details page from a web site</h4>
-
-<p>To open the details page from your web site, create a link with a URI in this
-format:</p>
-
-<p style="margin-left:2em">
- <code>http://play.google.com/store/apps/details?id=<package_name></code>
-</p>
-
-<p>For example, here's a link that opens an application's details page on Google Play:</p>
-
-<pre>
-<a href="http://play.google.com/store/apps/details?id=com.example.android">App Link</a>
-</pre>
-
-<p>When clicked from a desktop web browser, this opens the Google Play web site to view the
-{@code com.example.android} application. When clicked from an Android-powered device, users are
-given the option to use either their web browser or the Google Play application to view the
-application.</p>
-
-
-
-<h3 id="PerformingSearch">Performing a search</h3>
-
-<p>To initiate a search on Google Play, the format for the URI is:</p>
-
-<p style="margin-left:2em">
- <code><URI_prefix><b>search?q=</b><query></code>
-</p>
-
-<p>The <code><query></code> is a placeholder for the search query to execute in Google
-Play. The query can be a raw text string or you can include a parameter that performs a search
-based on the publisher name:</p>
-
-<ul>
- <li>To perform a raw text search, append the query string:
- <p><code><URI_prefix><b>search?q=</b><search_query></code></p></li>
-
- <li>To search based on the publisher name, use the {@code pub:} parameter in the query, followed
-by the publisher name:
- <p><code><URI_prefix><b>search?q=pub:</b><publisher_name></code></p>
- <p>You can use this type of search to show all of your published applications.</p></li>
-</ul>
-
-
-<h4>Searching from your Android app</h4>
-
-<p>To initiate a search on Google Play from your application, create an intent with the
-{@link android.content.Intent#ACTION_VIEW} action and include a data URI in this format:</p>
-
-<p style="margin-left:2em"><code>market://search?q=<query></code></p>
-
-<p>The query may include the {@code pub:} parameter described above.</p>
-
-<p>For example, here's how you can initiate a search in the Google Play application, based on the
-publisher name:</p>
-
-<pre>
-Intent intent = new Intent(Intent.ACTION_VIEW);
-intent.setData(Uri.parse("market://search?q=pub:Your Publisher Name"));
-startActivity(intent);
-</pre>
-
-<p>This opens the Google Play application to perform the search. The search result shows all
-applications published by the publisher that are compatible with the current device.</p>
-
-
-<h4>Searching from a web site</h4>
-
-<p>To initiate a search on Google Play from your web site, create a link with a URI in this
-format:</p>
-
-<p style="margin-left:2em">
- <code>http://play.google.com/store/search?q=<query></code>
-</p>
-
-<p>The query may include the {@code pub:} parameter described above.</p>
-
-<p>For example, here's a link that initiates a search on Google Play, based on the
-publisher name:</p>
-
-<pre>
-<a href="http://play.google.com/store/search?q=pub:Your Publisher Name">Search Link</a>
-</pre>
-
-<p>When clicked from a desktop web browser, this opens the Google Play web site and performs the
-search. When clicked from an Android-powered device, users are given the option to use either their
-web browser or the Google Play application to perform the search.</p>
-
-
-
-<h3 id="BuildaButton">Build a Google Play button</h3>
-
-<p>Use the following form to create a button for your web site that takes users to your application
-on Google Play. Input either your application's package name or your publisher name and the button
-will take users to Google Play to either view your application's information or view a list of your
-published apps. If users click the button while on an Android-powered device, the Google Play
-application will respond to show users your application(s).</p>
-
-<p>This form offers two styles of the official brand badge each at recommended sizes. You can pick
-between either "Get it on Google Play" or "Android app on Google Play." You should not modify the
-badge images in any way. For more usage guidelines,
-see the <a href="http://www.android.com/branding.html">Android Brand Guidelines</a>.</p>
-
-<style type="text/css">
-
-form.button-form {
- margin-top:2em;
-}
-
-/* the label and input elements are blocks that float left in order to
- keep the left edgets of the input aligned, and IE 6/7 do not fully support "inline-block" */
-label.block {
- display: block;
- float: left;
- width: 100px;
- padding-right: 10px;
-}
-
-input.text {
- display: block;
- float: left;
- width: 250px;
-}
-
-div.button-row {
- white-space:nowrap;
- min-height:80px;
-}
-
-div.button-row input {
- vertical-align:120%;
-}
-
-#jd-content div.button-row img {
- margin: 0;
-}
-
-</style>
-
-<script type="text/javascript">
-
-// variables for creating 'try it out' demo button
-var imagePath = "http://www.android.com/images/brand/"
-var linkStart = "<a href=\"http://play.google.com/store/";
-var imageStart = "\">\n"
- + " <img alt=\"";
- // leaves opening for the alt text value
-var imageSrc = "\"\n src=\"" + imagePath;
- // leaves opening for the image file name
-var imageEnd = ".png\" />\n</a>";
-
-// variables for creating code snippet
-var linkStartCode = "<a href=\"http://play.google.com/store/";
-var imageStartCode = "\">\n"
- + " <img alt=\"";
- // leaves opening for the alt text value
-var imageSrcCode = "\"\n src=\"" + imagePath;
- // leaves opening for the image file name
-var imageEndCode = ".png\" />\n</a>";
-
-/** Generate the HTML snippet and demo based on form values */
-function buildButton(form) {
- var selectedValue = $('form input[type=radio]:checked').val();
- var altText = selectedValue.indexOf("get_it") != -1 ? "Get it on Google Play" : "Android app on Google Play";
-
- if (form["package"].value != "com.example.android") {
- $("#preview").show();
- $("#snippet").show().html(linkStartCode + "apps/details?id=" + form["package"].value
- + imageStartCode + altText + imageSrcCode
- + selectedValue + imageEndCode);
- $("#button-preview").html(linkStart + "apps/details?id=" + form["package"].value
- + imageStart + altText + imageSrc
- + selectedValue + imageEnd);
- } else if (form["publisher"].value != "Example, Inc.") {
- $("#preview").show();
- $("#snippet").show().html(linkStartCode + "search?q=pub:" + form["publisher"].value
- + imageStartCode + altText + imageSrcCode
- + selectedValue + imageEndCode);
- $("#button-preview").html(linkStart + "search?q=pub:" + form["publisher"].value
- + imageStart + altText + imageSrc
- + selectedValue + imageEnd);
- } else {
- alert("Please enter your package name or publisher name");
- }
- return false;
-}
-
-/** Listen for Enter key */
-function onTextEntered(event, form, me) {
- // 13 = enter
- if (event.keyCode == 13) {
- buildButton(form);
- }
-}
-
-/** When input is focused, remove example text and disable other input */
-function onInputFocus(object, example) {
- if (object.value == example) {
- $(object).val('').css({'color' : '#000'});
- }
- $('input[type="text"]:not(input[name='+object.name+'])',
- object.parentNode).attr('disabled','true');
- $('#'+object.name+'-clear').show();
-}
-
-/** When input is blured, restore example text if appropriate and enable other input */
-function onInputBlur(object, example) {
- if (object.value.length < 1) {
- $(object).attr('value',example).css({'color':'#ccc'});
- $('input[type="text"]', object.parentNode).removeAttr('disabled');
- $('#'+object.name+'-clear').hide();
- }
-}
-
-/** Clear the form to start over */
-function clearLabel(id, example) {
- $("#preview").hide();
- $('#'+id+'').html('').attr('value',example).css({'color':'#ccc'});
- $('input[type="text"]', $('#'+id+'').parent()).removeAttr('disabled');
- $('#'+id+'-clear').hide();
- return false;
-}
-
-/** When the doc is ready, find the inputs and color the input grey if the value is the example
- text. This is necessary to handle back-navigation, which can auto-fill the form with previous
- values (and text should not be grey) */
-$(document).ready(function() {
- $(".button-form input.text").each(function(index) {
- if ($(this).val() == $(this).attr("default")) {
- $(this).css("color","#ccc");
- } else {
- /* This is necessary to handle back-navigation to the page after form was filled */
- $('input[type="text"]:not(input[name='+this.name+'])',
- this.parentNode).attr('disabled','true');
- $('#'+this.name+'-clear').show();
- }
- });
-});
-
-</script>
-
-<form class="button-form">
- <label class="block" for="package">Package name:</label>
- <input class="text" type="text" id="package" name="package"
- value="com.example.android"
- default="com.example.android"
- onfocus="onInputFocus(this, 'com.example.android')"
- onblur="onInputBlur(this, 'com.example.android')"
- onkeyup="return onTextEntered(event, this.parentNode, this)"/>
- <a id="package-clear" style="display:none" href="#"
- onclick="return clearLabel('package','com.example.android');">clear</a>
- <p style="clear:both;margin:0"> <em>or</em></p>
- <label class="block" style="margin-top:5px" for="publisher">Publisher name:</label>
- <input class="text" type="text" id="publisher" name="publisher"
- value="Example, Inc."
- default="Example, Inc."
- onfocus="onInputFocus(this, 'Example, Inc.')"
- onblur="onInputBlur(this, 'Example, Inc.')"
- onkeyup="return onTextEntered(event, this.parentNode, this)"/>
- <a id="publisher-clear" style="display:none" href="#"
- onclick="return clearLabel('publisher','Example, Inc.');">clear</a>
- <br/><br/>
-
-<div class="button-row">
- <input type="radio" name="buttonStyle" value="get_it_on_play_logo_small" id="ns" checked="checked" />
- <label for="ns"><img src="http://www.android.com/images/brand/get_it_on_play_logo_small.png"
-alt="Get it on Google Play (small)" /></label>
-
- <input type="radio" name="buttonStyle" value="get_it_on_play_logo_large" id="nm" />
- <label for="nm"><img src="http://www.android.com/images/brand/get_it_on_play_logo_large.png"
-alt="Get it on Google Play (large)" /></label>
-</div>
-
-<div class="button-row">
- <input type="radio" name="buttonStyle" value="android_app_on_play_logo_small" id="ws" />
- <label for="ws"><img src="http://www.android.com/images/brand/android_app_on_play_logo_small.png"
-alt="Android app on Google Play (small)" /></label>
-
- <input type="radio" name="buttonStyle" value="android_app_on_play_logo_large" id="wm" />
- <label for="wm"><img src="http://www.android.com/images/brand/android_app_on_play_logo_large.png"
-alt="Android app on Google Play (large)" /></label>
-</div>
-
- <input type="button" onclick="return buildButton(this.parentNode)" value="Build my button"
-style="padding:5px" />
- <br/>
-</form>
-
-<div id="preview" style="display:none">
- <p>Copy and paste this HTML into your web site:</p>
- <textarea id="snippet" cols="100" rows="5" onclick="this.select()"
-style="font-family:monospace;background-color:#efefef;padding:5px;display:none;margin-bottom:1em">
- </textarea >
-
-<p>Try it out:</p>
-<div id="button-preview" style="margin-top:1em"></div>
-</div>
-
-
-
-
-
-
-<h3 id="UriSummary">Summary of URI formats</h3>
-
-<p>The table below provides a summary of the URIs currently supported by the Google Play (both on
-the web and in the Android application), as discussed in the previous sections.</p>
-
-<table>
-<tr>
-<th>For this result</th>
-<th>Use this URI in a web page link</th>
-<th>Or this URI in an {@link android.content.Intent#ACTION_VIEW} intent</th>
-</tr>
-
-<tr>
-<td>Display the details screen for a specific application</td>
-<td><code>http://play.google.com/store/apps/details?id=<package_name></code>
-<td><code>market://details?id=<package_name></code></td>
-</tr>
-
-<tr>
-<td>Search for applications using a general string query.</td>
-<td><code>http://play.google.com/store/search?q=<query></code></td>
-<td><code>market://search?q=<query></code></td>
-</tr>
-
-<tr>
-<td>Search for applications by publisher name</td>
-<td><nobr><code>http://play.google.com/store/search?q=pub:<publisher_name></code></nobr></td>
-<td><nobr><code>market://search?q=pub:<publisher_name></code></nobr></td>
-</tr>
-
-</table>
diff --git a/docs/html/guide/publishing/publishing_overview.jd b/docs/html/guide/publishing/publishing_overview.jd
deleted file mode 100755
index 6fb77e1..0000000
--- a/docs/html/guide/publishing/publishing_overview.jd
+++ /dev/null
@@ -1,231 +0,0 @@
-page.title=Publishing Overview
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>Quickview</h2>
- <ul>
- <li>Learn how to publish Android apps.</li>
- <li>Find out how to prepare apps for release.</li>
- <li>Learn how to release apps to users.</li>
- </ul>
- <h2>In this document</h2>
- <ol>
- <li><a href="#publishing-prepare">Preparing Your Application for Release</a></li>
- <li><a href="#publishing-release">Releasing Your Application to Users</a>
- <ol>
- <li><a href="#publishing-market">Releasing on Google Play</a></li>
- <li><a href="#publishing-website">Releasing on your own website</a></li>
- <li><a href="#publishing-email">Releasing through email</a></li>
- </ol>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/publishing/preparing.html">Preparing for
- Release</a></li>
- <li><a href="{@docRoot}guide/publishing/publishing.html">Publishing on Google Play</a></li>
- </ol>
-</div>
-</div>
-
-<p>Publishing is the process that makes your Android applications available to users. When you
-publish an Android application you perform two main tasks:</p>
-
-<ul>
- <li>You prepare the application for release.
- <p>During the preparation step you build a release version of your application, which users can
- download and install on their Android-powered devices.</p>
- </li>
- <li>You release the application to users.
- <p>During the release step you publicize, sell, and distribute the release version of your
- application to users.</p>
- </li>
-</ul>
-
-<p>Usually, you release your application through an application marketplace, such as Google Play.
-However, you can also release applications by sending them directly to users or by letting users
-download them from your own website.</p>
-
-<p>Figure 1 shows how the publishing process fits into the overall Android <a
-href="{@docRoot}guide/developing/index.html">application development process</a>.
-The publishing process is typically performed after you finish testing your application in a debug
-environment. Also, as a best practice, your application should meet all of your release criteria for
-functionality, performance, and stability before you begin the publishing process.</p>
-
-<img src="{@docRoot}images/publishing/publishing_overview.png" alt="Shows where the publishing
- process fits into the overall development process" height="86" id="figure1" />
-<p class="img-caption">
- <strong>Figure 1.</strong> Publishing is the last phase of the Android <a
-href="{@docRoot}guide/developing/index.html">application development process</a>.
-</p>
-
-<h2 id="publishing-prepare">Preparing Your Application for Release</h2>
-
-<p>Preparing your application for release is a multi-step process that involves the following
-tasks:</p>
-
-<ul>
-
- <li>Configuring your application for release.
- <p>At a minimum you need to remove {@link android.util.Log} calls and remove the
- <a href="{@docRoot}guide/topics/manifest/application-element.html#debug">android:debuggable</a>
- attribute from your manifest file. You should also provide values for the
- <code>android:versionCode</code> and <code>android:versionName</code> attributes, which are
- located in the
- <a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a>
- element. You may also have to configure several other settings to meet Google Play
- requirements or accomodate whatever method you're using to release your application.</p>
- </li>
- <li>Building and signing a release version of your application.
- <p>The Android Development Tools (ADT) plugin and the Ant build script that are provided
- with the Android SDK tools provide everything you need to build and sign a release version of
- your application.</p>
- </li>
- <li>Testing the release version of your application.
- <p>Before you distribute your application, you should thoroughly test the release version on at
- least one target handset device and one target tablet device.</p>
- </li>
- <li>Updating application resources for release.
- <p>You need to be sure that all application resources such as multimedia files and graphics
- are updated and included with your application or staged on the proper production servers.</p>
- </li>
- <li>Preparing remote servers and services that your application depends on.
- <p>If your application depends on external servers or services, you need to be sure they
- are secure and production ready.</p>
- </li>
-</ul>
-
-<p>You may have to perform several other tasks as part of the preparation process. For example, you
-will need to get a private key for signing your application, and you may need to get a Maps API
-release key if you are using the <a
-href="http://code.google.com/android/add-ons/google-apis/maps-overview.html">Google Maps external
-library</a>. You will also need to create an icon for your application, and you may want to prepare
-an End User License Agreement (EULA) to protect your person, organization, and intellectual
-property.</p>
-
-<p>When you are finished preparing your application for release you will have a signed
-<code>.apk</code> file that you can distribute to users.</p>
-
-<p>To learn how to prepare your application for release, see <a
-href="{@docRoot}guide/publishing/preparing.html">Preparing for Release</a> in the Dev Guide. This
-topic provides step-by-step instructions for configuring and building a release version of your
-application.</p>
-
-<h2 id="publishing-release">Releasing Your Application to Users</h2>
-
-<p>You can release your Android applications several ways. Usually, you release applications
-through an application marketplace, such as Google Play, but you can also release applications
-on your own website or by sending an application directly to a user. Google Play is the
-recommended marketplace for Android applications and is particularly useful if you want to
-distribute your applications to a large global audience. The other two release methods—server
-distribution and email distribution—are useful if you are releasing an application to a small
-group of users (for example, a work group in an enterprise environment), or if you do not want to
-make your application available to the general public.</p>
-
-<h3 id="publishing-market">Releasing Your Applications on Google Play</h3>
-
-<p>Google Play is a robust publishing platform that helps you publicize, sell, and distribute
-your Android applications to users around the world. When you release your applications through
-Google Play you have access to a suite of developer tools that let you analyze your sales,
-identify market trends, and control who your applications are being distributed to. You also have
-access to several revenue-enhancing features that are not available anywhere else, such as <a
-href="{@docRoot}guide/market/billing/index.html">in-app billing</a> and <a
-href="{@docRoot}guide/market/licensing.html">application licensing</a>. This rich array of tools
-and features, coupled with numerous end-user community features, makes Google Play the premier
-marketplace for selling and buying Android applications.</p>
-
-<p>Releasing your application on Google Play is a simple process that involves three basic
- steps:</p>
-
-<div class="figure" style="width:275px">
- <img src="{@docRoot}images/publishing/publishing_unknown_sources.png"
- alt="Screenshot showing the graphical user interface element that allows unknown sources
- to be installed" />
- <p class="img-caption">
- <strong>Figure 2.</strong> The <strong>Unknown sources</strong> setting lets you install
- applications that are not published on Google Play .
- </p>
-</div>
-
-<ul>
- <li>Preparing promotional materials.
- <p>To fully leverage the marketing and publicity capabilities of Google Play, you need to
- create promotional materials for your application, such as screenshots, videos, graphics, and
- promotional text.</p>
- </li>
- <li>Configuring options and uploading assets.
- <p>Google Play lets you target your application to a worldwide pool of users and devices.
- By configuring various Google Play settings, you can choose the countries you want to
- reach, the listing languages you want to use, and the price you want to charge in each
- country. You can also configure listing details such as the application type, category, and
- content rating. When you are done configuring options you can upload your promotional materials
- and your application as a draft (unpublished) application.</p>
- </li>
- <li>Publishing the release version of your application.
- <p>If you are satisfied that your publishing settings are correctly configured and your
- uploaded application is ready to be released to the public, you can simply click
- <strong>Publish</strong > in the developer console and within minutes your application will be
- live and available for download around the world.</p>
- </li>
-</ul>
-
-<p>For information about Google Play, see <a
-href="{@docRoot}guide/publishing/publishing.html#market">Publishing on Google Play</a>. This
-topic provides an introduction to Google Play features and provides a step-by-step guide for
-distributing your applications on Google Play.</p>
-
-<h3 id="publishing-website">Releasing your application on your own website</h3>
-
-<p>If you do not want to release your application on an application marketplace like Google Play,
-you can release your application by making it available for download on your own website or server.
-To do this, you must first prepare your application for release (that is, you must build it for
-release and sign it). Then all you need to do is host the release-ready application on your website
-and provide a download link for the application. When users browse to your website with their
-Android-powered devices and download your application, the Android system will automatically start
-installing the application on the device. However, the installation process will start automatically
-only if the user has configured their device to allow the installation of non-Google Play
-applications.</p>
-
-<div class="figure" style="width:275px">
- <img src="{@docRoot}images/publishing/publishing_via_email.png"
- alt="Screenshot showing the graphical user interface users see when you send them an app"
- height="453" />
- <p class="img-caption">
- <strong>Figure 3.</strong> Users can simply click <strong>Install</strong> when you send them
- an application via email.
- </p>
-</div>
-
-<p>By default, Android-powered devices allow users to install applications only if the applications
-have been downloaded from Google Play. To allow the installation of applications from other
-sources, users need to enable the <strong>Unknown sources</strong> setting on their devices, and
-they need to make this configuration change before they download your application to their
-device (see figure 2).</p>
-
-<p class="note"><strong>Note:</strong> Some network providers do not allow users to install
-applications from unknown sources.</p>
-
-<p>Although it is relatively easy to release your application on your own website, it can be
-inefficient and cumbersome. For example, if you want to monetize your application you will
-have to process and track all financial transactions yourself and you will not be able to use
-Google Play's in-app billing feature to sell in-app products. In addition, you will not be
-able to use the licensing feature to help prevent unauthorized installation and use of your
-application.</p>
-
-<h3 id="publishing-email">Releasing your application through email</h3>
-
-<p>The easiest and quickest way to release your application is to send it to a user through
-email. To do this, you prepare your application for release and then attach it to an email
-and send it to a user. When the user opens your email message on their Android-powered device
-the Android system will recognize the <code>.apk</code> and display an <strong>Install Now</strong>
-button in the email message (see figure 3). Users can install your application by touching the
-button.</p>
-
-<p class="note"><strong>Note:</strong> The <strong>Install Now</strong> button appears only if a
-user has configured their device to allow the installation of non-Google Play applications and
-they open your email with the native Gmail application.</p>
-
-<p>Releasing applications through email is convenient if you are sending your application to
-only a few trusted users, but it provides few protections from piracy and unauthorized
-distribution; that is, anyone you send your application to can simply forward it to someone else.
-else.
diff --git a/docs/html/guide/publishing/versioning.jd b/docs/html/guide/publishing/versioning.jd
deleted file mode 100644
index da57e3e..0000000
--- a/docs/html/guide/publishing/versioning.jd
+++ /dev/null
@@ -1,174 +0,0 @@
-page.title=Versioning Your Applications
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>Quickview</h2>
-
-<ul>
-<li>Your application <em>must</em> be versioned</a></li>
-<li>You set the version in the application's manifest file</li>
-<li>How you version your applications affects how users upgrade </li>
-<li>Determine your versioning strategy early in the development process, including considerations for future releases.</li>
-</ul>
-
-<h2>In this document</h2>
-
-<ol>
-<li><a href="#appversioning">Setting Application Version</a></li>
-<li><a href="#minsdkversion">Specifying Your Application's System API Requirements</a>
-</ol>
-
-
-<h2>See also</h2>
-
-<ol>
-<li><a href="{@docRoot}guide/publishing/preparing.html">Preparing to Publish Your Application</a></li>
-<li><a href="{@docRoot}guide/publishing/publishing.html#market">Publishing On Google Play</a></li>
-<li><a href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>Versioning is a critical component of your application upgrade and maintenance
-strategy. Versioning is important because:</p>
-
-<ul>
-<li>Users need to have specific information about the application version that
-is installed on their devices and the upgrade versions available for
-installation. </li>
-<li>Other applications — including other applications that you publish as
-a suite — need to query the system for your application's version, to
-determine compatibility and identify dependencies.</li>
-<li>Services through which you will publish your application(s) may also need to
-query your application for its version, so that they can display the version to
-users. A publishing service may also need to check the application version to
-determine compatibility and establish upgrade/downgrade relationships.</li>
-</ul>
-
-<p>The Android system does not use app version information to enforce
-restrictions on upgrades, downgrades, or compatibility of third-party apps. Instead, you (the
-developer) are responsible for enforcing version restrictions within your application or by
-informing users of the version restrictions and limitations. The Android system does, however,
-enforce system version compatibility as expressed by the <code>minSdkVersion</code> attribute in the
-manifest. This attribute allows an application to specify the minimum system API with which it is
-compatible. For more information see <a href="#minsdkversion">Specifying Minimum System API
-Version</a>.</p>
-
-<h2 id="appversioning">Setting Application Version</h2>
-<p>To define the version information for your application, you set attributes in
-the application's manifest file. Two attributes are available, and you should
-always define values for both of them: </p>
-
-<ul>
-<li><code>android:versionCode</code> — An integer value that represents
-the version of the application code, relative to other versions.
-
-<p>The value is an integer so that other applications can programmatically
-evaluate it, for example to check an upgrade or downgrade relationship. You can
-set the value to any integer you want, however you should make sure that each
-successive release of your application uses a greater value. The system does not
-enforce this behavior, but increasing the value with successive releases is
-normative. </p>
-
-<p>Typically, you would release the first version of your application with
-versionCode set to 1, then monotonically increase the value with each release,
-regardless whether the release constitutes a major or minor release. This means
-that the <code>android:versionCode</code> value does not necessarily have a
-strong resemblance to the application release version that is visible to the
-user (see <code>android:versionName</code>, below). Applications and publishing
-services should not display this version value to users.</p>
-</li>
-<li><code>android:versionName</code> — A string value that represents the
-release version of the application code, as it should be shown to users.
-<p>The value is a string so that you can describe the application version as a
-<major>.<minor>.<point> string, or as any other type of
-absolute or relative version identifier. </p>
-
-<p>As with <code>android:versionCode</code>, the system does not use this value
-for any internal purpose, other than to enable applications to display it to
-users. Publishing services may also extract the <code>android:versionName</code>
-value for display to users.</p>
-</li>
-</ul>
-
-<p>You define both of these version attributes in the
-<code><manifest></code> element of the manifest file. </p>
-
-<p>Here's an example manifest that shows the <code>android:versionCode</code>
-and <code>android:versionName</code> attributes in the
-<code><manifest></code> element. </p>
-
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.package.name"
- android:versionCode="2"
- android:versionName="1.1">
- <application android:icon="@drawable/icon" android:label="@string/app_name">
- ...
- </application>
-</manifest>
-</pre>
-
-<p>In this example, note that <code>android:versionCode</code> value indicates
-that the current .apk contains the second release of the application code, which
-corresponds to a minor follow-on release, as shown by the
-<code>android:versionName</code> string. </p>
-
-<p>The Android framework provides an API to let applications query the system
-for version information about your application. To obtain version information,
-applications use the
-{@link android.content.pm.PackageManager#getPackageInfo(java.lang.String, int)}
-method of {@link android.content.pm.PackageManager PackageManager}. </p>
-
-<h2 id="minsdkversion">Specifying Your Application's System API Requirements</h2>
-
-<p>If your application requires a specific minimum version of the Android
-platform, or is designed only to support a certain range of Android platform
-versions, you can specify those version requirements as API Level identifiers
-in the application's manifest file. Doing so ensures that your
-application can only be installed on devices that
-are running a compatible version of the Android system. </p>
-
-<p>To specify API Level requirements, add a <code><uses-sdk></code>
-element in the application's manifest, with one or more of these attributes: </p>
-
-<ul>
-<li><code>android:minSdkVersion</code> — The minimum version
-of the Android platform on which the application will run, specified
-by the platform's API Level identifier. </li>
-<li><code>android:targetSdkVersion</code> — Specifies the API Level
-on which the application is designed to run. In some cases, this allows the
-application to use manifest elements or behaviors defined in the target
-API Level, rather than being restricted to using only those defined
-for the minimum API Level.</li>
-<li><code>android:maxSdkVersion</code> — The maximum version
-of the Android platform on which the application is designed to run,
-specified by the platform's API Level identifier. <strong>Important:</strong> Please read the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
-documentation before using this attribute. </li>
-</ul>
-
-<p>When preparing to install your application, the system checks the value of this
-attribute and compares it to the system version. If the
-<code>android:minSdkVersion</code> value is greater than the system version, the
-system aborts the installation of the application. Similarly, the system
-installs your application only if its <code>android:maxSdkVersion</code>
-is compatible with the platform version.</p>
-
-<p>If you do not specify these attributes in your manifest, the system assumes
-that your application is compatible with all platform versions, with no
-maximum API Level. </p>
-
-<p>To specify a minimum platform version for your application, add a
-<code><uses-sdk></code> element as a child of
-<code><manifest></code>, then define the
-<code>android:minSdkVersion</code> as an attribute. </p>
-
-<p>For more information, see the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
-manifest element documentation and the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document.</p>
diff --git a/docs/html/guide/topics/admin/index.jd b/docs/html/guide/topics/admin/index.jd
new file mode 100644
index 0000000..b2a896f8
--- /dev/null
+++ b/docs/html/guide/topics/admin/index.jd
@@ -0,0 +1,22 @@
+page.title=Administration
+page.landing=true
+page.landing.intro=If you are an enterprise administrator, you can take advantage of APIs and system capabilities to manage Android devices and control access.
+page.landing.image=
+
+@jd:body
+
+<div class="landing-docs">
+
+ <div class="col-12">
+ <h3>Blog Articles</h3>
+ <a
+href="http://android-developers.blogspot.com/2012/03/unifying-key-store-access-in-ics.html">
+ <h4>Unifying Key Store Access in ICS</h4>
+ <p>Android 4.0 (ICS) comes with a number of enhancements that make it easier for people to
+bring their personal Android devices to work. In this post, we’re going to have a look at the key
+store functionality.</p>
+ </a>
+ </div>
+
+
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/topics/admin/keychain.jd b/docs/html/guide/topics/admin/keychain.jd
new file mode 100644
index 0000000..2ea2408
--- /dev/null
+++ b/docs/html/guide/topics/admin/keychain.jd
@@ -0,0 +1,4 @@
+page.title=Text and Input
+@jd:body
+
+<p>Add contnet here</p>
diff --git a/docs/html/guide/topics/appwidgets/index.jd b/docs/html/guide/topics/appwidgets/index.jd
index ba7b67c..a46f9a7 100644
--- a/docs/html/guide/topics/appwidgets/index.jd
+++ b/docs/html/guide/topics/appwidgets/index.jd
@@ -295,7 +295,7 @@
<p>Creating the App Widget layout is simple if you're
familiar with <a
-href="{@docRoot}guide/topics/ui/declaring-layout.html">XML Layouts</a>.
+href="{@docRoot}guide/topics/ui/declaring-layout.html">Layouts</a>.
However, you must be aware that App Widget layouts are based on {@link
android.widget.RemoteViews},
which do not support every kind of layout or view widget.</p>
@@ -516,7 +516,7 @@
{@link android.appwidget.AppWidgetProvider#onUpdate(Context,AppWidgetManager,int[]) onUpdate()}
method. From within the Service, you can perform your own updates
to the App Widget without worrying about the AppWidgetProvider closing down due
-to an <a href="{@docRoot}guide/practices/design/responsiveness.html">Application
+to an <a href="{@docRoot}guide/practices/responsiveness.html">Application
Not Responding</a> (ANR) error. See the <a
href="http://code.google.com/p/wiktionary-android/source/browse/trunk/Wiktionary/src/com/example/android/wiktionary/WordWidget.java">Wiktionary sample's AppWidgetProvider</a> for an example of an App Widget running a {@link
android.app.Service}.</p>
diff --git a/docs/html/guide/topics/connectivity/bluetooth.jd b/docs/html/guide/topics/connectivity/bluetooth.jd
new file mode 100644
index 0000000..832b850
--- /dev/null
+++ b/docs/html/guide/topics/connectivity/bluetooth.jd
@@ -0,0 +1,1086 @@
+page.title=Bluetooth
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Quickview</h2>
+ <ul>
+ <li>Android's bluetooth APIs allow your application to perform wireless data transactions with
+other devices</li>
+ </ul>
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#TheBasics">The Basics</a></li>
+ <li><a href="#Permissions">Bluetooth Permissions</a></li>
+ <li><a href="#SettingUp">Setting Up Bluetooth</a></li>
+ <li><a href="#FindingDevices">Finding Devices</a>
+ <ol>
+ <li><a href="#QueryingPairedDevices">Querying paired devices</a></li>
+ <li><a href="#DiscoveringDevices">Discovering devices</a></li>
+ </ol></li>
+ <li><a href="#ConnectingDevices">Connecting Devices</a>
+ <ol>
+ <li><a href="#ConnectingAsAServer">Connecting as a server</a></li>
+ <li><a href="#ConnectingAsAClient">Connecting as a client</a></li>
+ </ol></li>
+ <li><a href="#ManagingAConnection">Managing a Connection</a></li>
+ <li><a href="#Profiles">Working with Profiles</a>
+ <ol>
+ <li><a href="#AT-Commands">Vendor-specific AT commands</a>
+ <li><a href="#HDP">Health Device Profile</a>
+ </ol></li>
+ </ol>
+
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.bluetooth.BluetoothAdapter}</li>
+ <li>{@link android.bluetooth.BluetoothDevice}</li>
+ <li>{@link android.bluetooth.BluetoothSocket}</li>
+ <li>{@link android.bluetooth.BluetoothServerSocket}</li>
+ </ol>
+
+ <h2>Related samples</h2>
+ <ol>
+ <li><a href="{@docRoot}resources/samples/BluetoothChat/index.html">Bluetooth Chat</a></li>
+ <li><a href="{@docRoot}resources/samples/BluetoothHDP/index.html">Bluetooth HDP (Health Device Profile)</a></li>
+ </ol>
+
+</div>
+</div>
+
+
+<p>The Android platform includes support for the Bluetooth network stack,
+which allows a device to wirelessly exchange data with other Bluetooth devices.
+The application framework provides access to the Bluetooth functionality through
+the Android Bluetooth APIs. These APIs let applications wirelessly
+connect to other Bluetooth devices, enabling point-to-point and multipoint
+wireless features.</p>
+
+<p>Using the Bluetooth APIs, an Android application can perform the
+following:</p>
+<ul>
+ <li>Scan for other Bluetooth devices</li>
+ <li>Query the local Bluetooth adapter for paired Bluetooth devices</li>
+ <li>Establish RFCOMM channels</li>
+ <li>Connect to other devices through service discovery</li>
+ <li>Transfer data to and from other devices</li>
+ <li>Manage multiple connections</li>
+</ul>
+
+
+<h2 id="TheBasics">The Basics</h2>
+
+<p>This document describes how to use the Android Bluetooth APIs to accomplish
+the four major tasks necessary to communicate using Bluetooth: setting up
+Bluetooth, finding devices that are either paired or available in the local
+area, connecting devices, and transferring data between devices.</p>
+
+<p>All of the Bluetooth APIs are available in the {@link android.bluetooth}
+package. Here's a summary of the classes and interfaces you will need to create Bluetooth
+connections:</p>
+
+<dl>
+<dt>{@link android.bluetooth.BluetoothAdapter}</dt>
+<dd>Represents the local Bluetooth adapter (Bluetooth radio). The
+{@link android.bluetooth.BluetoothAdapter} is the entry-point for all Bluetooth
+interaction. Using this,
+you can discover other Bluetooth devices, query a list of bonded (paired)
+devices, instantiate a {@link android.bluetooth.BluetoothDevice} using a known
+MAC address, and create a {@link android.bluetooth.BluetoothServerSocket} to
+listen for communications
+from other devices.</dd>
+
+<dt>{@link android.bluetooth.BluetoothDevice}</dt>
+<dd>Represents a remote Bluetooth device. Use this to request a connection
+with a remote device through a {@link android.bluetooth.BluetoothSocket} or
+query information about the
+device such as its name, address, class, and bonding state.</dd>
+
+<dt>{@link android.bluetooth.BluetoothSocket}</dt>
+<dd>Represents the interface for a Bluetooth socket (similar to a TCP
+{@link java.net.Socket}). This is the connection point that allows
+an application to exchange data with another Bluetooth device via InputStream
+and OutputStream.</dd>
+
+<dt>{@link android.bluetooth.BluetoothServerSocket}</dt>
+<dd>Represents an open server socket that listens for incoming requests
+(similar to a TCP {@link java.net.ServerSocket}). In order to connect two
+Android devices, one device must open a server socket with this class. When a
+remote Bluetooth device makes a connection request to the this device, the
+{@link android.bluetooth.BluetoothServerSocket} will return a connected {@link
+android.bluetooth.BluetoothSocket} when the
+connection is accepted.</dd>
+
+<dt>{@link android.bluetooth.BluetoothClass}</dt>
+<dd>Describes the general characteristics and capabilities of a Bluetooth
+device. This is a read-only set of properties that define the device's major and
+minor device classes and its services. However, this does not reliably describe
+all Bluetooth profiles and services supported by the device, but is useful as a
+hint to the device type.</dd>
+
+<dt>{@link android.bluetooth.BluetoothProfile}</dt> <dd>An interface that
+represents a Bluetooth profile. A <em>Bluetooth profile</em> is a wireless
+interface specification for Bluetooth-based communication between devices. An
+example is the Hands-Free profile. For more discussion of profiles, see <a
+href="#Profiles">Working with Profiles</a></dd>
+
+<dt>{@link android.bluetooth.BluetoothHeadset}</dt> <dd>Provides support for
+Bluetooth headsets to be used with mobile phones. This includes both Bluetooth
+Headset and Hands-Free (v1.5) profiles.</dd>
+
+<dt>{@link android.bluetooth.BluetoothA2dp}</dt> <dd> Defines how high quality
+audio can be streamed from one device to another over a Bluetooth connection.
+"A2DP" stands for Advanced Audio Distribution Profile.</dd>
+
+<dt>{@link android.bluetooth.BluetoothHealth}</dt>
+<dd> Represents a Health Device Profile proxy that controls the Bluetooth service.</dd>
+
+<dt>{@link android.bluetooth.BluetoothHealthCallback}</dt>
+
+<dd>An abstract class that you use to implement {@link
+android.bluetooth.BluetoothHealth} callbacks. You must extend this class and
+implement the callback methods to receive updates about changes in the
+application’s registration state and Bluetooth channel state.</dd>
+
+<dt>{@link android.bluetooth.BluetoothHealthAppConfiguration}</dt>
+
+<dd>Represents an application configuration that the Bluetooth Health third-party
+application registers to communicate with a remote Bluetooth health
+device.</dd>
+
+<dt>{@link android.bluetooth.BluetoothProfile.ServiceListener}</dt>
+
+<dd>An interface that notifies {@link android.bluetooth.BluetoothProfile} IPC
+clients when they have been connected to or disconnected from the service (that
+is, the internal service that runs a particular profile). </dd>
+
+</dl>
+
+
+
+
+<h2 id="Permissions">Bluetooth Permissions</h2>
+
+<p>In order to use Bluetooth features in your application, you need to declare
+at least one of two Bluetooth permissions: {@link
+android.Manifest.permission#BLUETOOTH} and {@link
+android.Manifest.permission#BLUETOOTH_ADMIN}.</p>
+
+<p>You must request the {@link android.Manifest.permission#BLUETOOTH} permission
+in order to perform any Bluetooth communication, such as requesting a
+connection, accepting a connection, and transferring data.</p>
+
+<p>You must request the {@link android.Manifest.permission#BLUETOOTH_ADMIN}
+permission in order to initiate device discovery or manipulate Bluetooth
+settings. Most applications need this permission solely for the
+ability to discover local Bluetooth devices. The other abilities granted by this
+permission should not be used, unless the application is a "power manager" that
+will modify Bluetooth settings upon user request. <strong>Note:</strong> If you
+use {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission, then must
+also have the {@link android.Manifest.permission#BLUETOOTH} permission.</p>
+
+<p>Declare the Bluetooth permission(s) in your application manifest file. For
+example:</p>
+
+<pre>
+<manifest ... >
+ <uses-permission android:name="android.permission.BLUETOOTH" />
+ ...
+</manifest>
+</pre>
+
+<p>See the <a
+href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a>
+reference for more information about declaring application permissions.</p>
+
+
+<h2 id="SettingUp">Setting Up Bluetooth</h2>
+
+<div class="figure" style="width:200px">
+<img src="{@docRoot}images/bt_enable_request.png" />
+<strong>Figure 1:</strong> The enabling Bluetooth dialog.
+</div>
+
+<p>Before your application can communicate over Bluetooth, you need to verify
+that Bluetooth is supported on the device, and if so, ensure that it is enabled.</p>
+
+<p>If Bluetooth is not supported, then you should gracefully disable any
+Bluetooth features. If Bluetooth is supported, but disabled, then you can request that the
+user enable Bluetooth without leaving your application. This setup is
+accomplished in two steps, using the {@link android.bluetooth.BluetoothAdapter}.</p>
+
+
+<ol>
+<li>Get the {@link android.bluetooth.BluetoothAdapter}
+<p>The {@link android.bluetooth.BluetoothAdapter} is required for any and all Bluetooth
+activity. To get the {@link android.bluetooth.BluetoothAdapter}, call the static {@link
+android.bluetooth.BluetoothAdapter#getDefaultAdapter()} method. This returns a
+{@link android.bluetooth.BluetoothAdapter} that represents the device's own
+Bluetooth adapter (the Bluetooth radio). There's one Bluetooth adapter for the
+entire system, and your application can interact with it using this object. If
+{@link android.bluetooth.BluetoothAdapter#getDefaultAdapter()} returns null,
+then the device does not support Bluetooth and your story ends here. For example:</p>
+<pre>
+BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+if (mBluetoothAdapter == null) {
+ // Device does not support Bluetooth
+}
+</pre>
+</li>
+
+<li>Enable Bluetooth
+<p>Next, you need to ensure that Bluetooth is enabled. Call {@link
+android.bluetooth.BluetoothAdapter#isEnabled()} to check whether Bluetooth is
+currently enable. If this method returns false, then Bluetooth is disabled. To
+request that Bluetooth be enabled, call {@link
+android.app.Activity#startActivityForResult(Intent,int) startActivityForResult()}
+with the {@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_ENABLE} action Intent.
+This will issue a request to enable Bluetooth through the system settings (without
+stopping your application). For example:</p>
+<pre>
+if (!mBluetoothAdapter.isEnabled()) {
+ Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
+ startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
+}
+</pre>
+
+<p>A dialog will appear requesting user permission to enable Bluetooth, as shown
+in Figure 1. If the user responds "Yes," the system will begin to enable Bluetooth
+and focus will return to your application once the process completes (or fails).</p>
+
+<p>The {@code REQUEST_ENABLE_BT} constant passed to {@link
+android.app.Activity#startActivityForResult(Intent,int) startActivityForResult()} is a locally
+defined integer (which must be greater than 0), that the system passes back to you in your
+{@link
+android.app.Activity#onActivityResult(int,int,Intent) onActivityResult()} implementation as the
+<code>requestCode</code> parameter.</p>
+
+<p>If enabling Bluetooth succeeds, your activity receives the {@link
+android.app.Activity#RESULT_OK} result code in the {@link
+android.app.Activity#onActivityResult(int,int,Intent) onActivityResult()}
+callback. If Bluetooth was not enabled
+due to an error (or the user responded "No") then the result code is {@link
+android.app.Activity#RESULT_CANCELED}.</p>
+</li>
+</ol>
+
+<p>Optionally, your application can also listen for the
+{@link android.bluetooth.BluetoothAdapter#ACTION_STATE_CHANGED} broadcast Intent, which
+the system will broadcast whenever the Bluetooth state has changed. This broadcast contains
+the extra fields {@link android.bluetooth.BluetoothAdapter#EXTRA_STATE} and {@link
+android.bluetooth.BluetoothAdapter#EXTRA_PREVIOUS_STATE}, containing the new and old
+Bluetooth states, respectively. Possible values for these extra fields are
+{@link android.bluetooth.BluetoothAdapter#STATE_TURNING_ON}, {@link
+android.bluetooth.BluetoothAdapter#STATE_ON}, {@link
+android.bluetooth.BluetoothAdapter#STATE_TURNING_OFF}, and {@link
+android.bluetooth.BluetoothAdapter#STATE_OFF}. Listening for this
+broadcast can be useful to detect changes made to the Bluetooth state while your
+app is running.</p>
+
+<p class="note"><strong>Tip:</strong> Enabling discoverability will automatically
+enable Bluetooth. If you plan to consistently enable device discoverability before
+performing Bluetooth activity, you can skip
+step 2 above. Read about <a href="#EnablingDiscoverability">enabling discoverability</a>,
+below.</p>
+
+
+<h2 id="FindingDevices">Finding Devices</h2>
+
+<p>Using the {@link android.bluetooth.BluetoothAdapter}, you can find remote Bluetooth
+devices either through device discovery or by querying the list of paired (bonded)
+devices.</p>
+
+<p>Device discovery is a scanning procedure that searches the local area for
+Bluetooth enabled devices and then requesting some information about each one
+(this is sometimes referred to as "discovering," "inquiring" or "scanning").
+However, a Bluetooth device within the local area will respond to a discovery
+request only if it is currently enabled to be discoverable. If a device is
+discoverable, it will respond to the discovery request by sharing some
+information, such as the device name, class, and its unique MAC address. Using
+this information, the device performing discovery can then choose to initiate a
+connection to the discovered device.</p>
+
+<p>Once a connection is made with a remote device for the first time, a pairing
+request is automatically presented to the user. When a device is
+paired, the basic information about that device (such as the device name, class,
+and MAC address) is saved and can be read using the Bluetooth APIs. Using the
+known MAC address for a remote device, a connection can be initiated with it at
+any time without performing discovery (assuming the device is within range).</p>
+
+<p>Remember there is a difference between being paired and being connected. To
+be paired means that two devices are aware of each other's existence, have a
+shared link-key that can be used for authentication, and are capable of
+establishing an encrypted connection with each other. To be connected means that
+the devices currently share an RFCOMM channel and are able to transmit data with
+each other. The current Android Bluetooth API's require devices to be paired
+before an RFCOMM connection can be established. (Pairing is automatically performed
+when you initiate an encrypted connection with the Bluetooth APIs.)</p>
+
+<p>The following sections describe how to find devices that have been paired, or
+discover new devices using device discovery.</p>
+
+<p class="note"><strong>Note:</strong> Android-powered devices are not
+discoverable by default. A user can make
+the device discoverable for a limited time through the system settings, or an
+application can request that the user enable discoverability without leaving the
+application. How to <a href="#EnablingDiscoverability">enable discoverability</a>
+is discussed below.</p>
+
+
+<h3 id="QueryingPairedDevices">Querying paired devices</h3>
+
+<p>Before performing device discovery, its worth querying the set
+of paired devices to see if the desired device is already known. To do so,
+call {@link android.bluetooth.BluetoothAdapter#getBondedDevices()}. This
+will return a Set of {@link android.bluetooth.BluetoothDevice}s representing
+paired devices. For example, you can query all paired devices and then
+show the name of each device to the user, using an ArrayAdapter:</p>
+<pre>
+Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
+// If there are paired devices
+if (pairedDevices.size() > 0) {
+ // Loop through paired devices
+ for (BluetoothDevice device : pairedDevices) {
+ // Add the name and address to an array adapter to show in a ListView
+ mArrayAdapter.add(device.getName() + "\n" + device.getAddress());
+ }
+}
+</pre>
+
+<p>All that's needed from the {@link android.bluetooth.BluetoothDevice} object
+in order to initiate a connection is the MAC address. In this example, it's saved
+as a part of an ArrayAdapter that's shown to the user. The MAC address can later
+be extracted in order to initiate the connection. You can learn more about creating
+a connection in the section about <a href="#ConnectingDevices">Connecting Devices</a>.</p>
+
+
+<h3 id="DiscoveringDevices">Discovering devices</h3>
+
+<p>To start discovering devices, simply call {@link
+android.bluetooth.BluetoothAdapter#startDiscovery()}. The
+process is asynchronous and the method will immediately return with a boolean
+indicating whether discovery has successfully started. The discovery process
+usually involves an inquiry scan of about 12 seconds, followed by a page scan of
+each found device to retrieve its Bluetooth name.</p>
+
+<p>Your application must register a BroadcastReceiver for the
+{@link android.bluetooth.BluetoothDevice#ACTION_FOUND} Intent in
+order to receive information about each
+device discovered. For each device, the system will broadcast the
+{@link android.bluetooth.BluetoothDevice#ACTION_FOUND} Intent. This
+Intent carries the extra fields
+{@link android.bluetooth.BluetoothDevice#EXTRA_DEVICE} and
+{@link android.bluetooth.BluetoothDevice#EXTRA_CLASS}, containing a
+{@link android.bluetooth.BluetoothDevice} and a {@link
+android.bluetooth.BluetoothClass}, respectively. For example, here's how you can
+register to handle the broadcast when devices are discovered:</p>
+<pre>
+// Create a BroadcastReceiver for ACTION_FOUND
+private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ // When discovery finds a device
+ if (BluetoothDevice.ACTION_FOUND.equals(action)) {
+ // Get the BluetoothDevice object from the Intent
+ BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
+ // Add the name and address to an array adapter to show in a ListView
+ mArrayAdapter.add(device.getName() + "\n" + device.getAddress());
+ }
+ }
+};
+// Register the BroadcastReceiver
+IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);
+registerReceiver(mReceiver, filter); // Don't forget to unregister during onDestroy
+</pre>
+
+<p>All that's needed from the {@link android.bluetooth.BluetoothDevice} object
+in order to initiate a
+connection is the MAC address. In this example, it's saved as a part of an
+ArrayAdapter that's shown to the user. The MAC address can later be extracted in
+order to initiate the connection. You can learn more about creating a connection
+in the section about <a href="#ConnectingDevices">Connecting Devices</a>.</p>
+
+<p class="caution"><strong>Caution:</strong> Performing device discovery is
+a heavy procedure for the Bluetooth
+adapter and will consume a lot of its resources. Once you have found a device to
+connect, be certain that you always stop discovery with
+{@link android.bluetooth.BluetoothAdapter#cancelDiscovery()} before
+attempting a connection. Also, if you
+already hold a connection with a device, then performing discovery can
+significantly reduce the bandwidth available for the connection, so you should
+not perform discovery while connected.</p>
+
+<h4 id="EnablingDiscoverability">Enabling discoverability</h4>
+
+<p>If you would like to make the local device discoverable to other devices,
+call {@link android.app.Activity#startActivityForResult(Intent,int)} with the
+{@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_DISCOVERABLE} action
+Intent. This will issue a request to enable discoverable mode through the system
+settings (without stopping your application). By default, the device will become
+discoverable for 120 seconds. You can define a different duration by adding the
+{@link android.bluetooth.BluetoothAdapter#EXTRA_DISCOVERABLE_DURATION} Intent
+extra. The maximum duration an app can set is 3600 seconds, and a value of 0
+means the device is always discoverable. Any value below 0 or above 3600 is
+automatically set to 120 secs). For example, this snippet sets the duration to
+300:</p>
+
+<pre>Intent discoverableIntent = new
+Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
+discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);
+startActivity(discoverableIntent);
+</pre>
+
+<div class="figure" style="width:200px">
+<img src="{@docRoot}images/bt_enable_discoverable.png" />
+<strong>Figure 2:</strong> The enabling discoverability dialog.
+</div>
+
+<p>A dialog will be displayed, requesting user permission to make the device
+discoverable, as shown in Figure 2. If the user responds "Yes," then the device
+will become discoverable for the specified amount of time. Your activity will
+then receive a call to the {@link android.app.Activity#onActivityResult(int,int,Intent)
+onActivityResult())} callback, with the result code equal to the duration that the device
+is discoverable. If the user responded "No" or if an error occurred, the result code will
+be {@link android.app.Activity#RESULT_CANCELED}.</p>
+
+<p class="note"><strong>Note:</strong> If Bluetooth has not been enabled on the device,
+then enabling device discoverability will automatically enable Bluetooth.</p>
+
+<p>The device will silently remain in discoverable mode for the allotted time.
+If you would like to be notified when the discoverable mode has changed, you can
+register a BroadcastReceiver for the {@link
+android.bluetooth.BluetoothAdapter#ACTION_SCAN_MODE_CHANGED}
+Intent. This will contain the extra fields {@link
+android.bluetooth.BluetoothAdapter#EXTRA_SCAN_MODE} and
+{@link android.bluetooth.BluetoothAdapter#EXTRA_PREVIOUS_SCAN_MODE}, which tell you the
+new and old scan mode, respectively. Possible values for each are
+{@link android.bluetooth.BluetoothAdapter#SCAN_MODE_CONNECTABLE_DISCOVERABLE},
+{@link android.bluetooth.BluetoothAdapter#SCAN_MODE_CONNECTABLE}, or {@link
+android.bluetooth.BluetoothAdapter#SCAN_MODE_NONE},
+which indicate that the device is either in discoverable mode, not in
+discoverable mode but still able to receive connections, or not in discoverable
+mode and unable to receive connections, respectively.</p>
+
+<p>You do not need to enable device discoverability if you will be initiating
+the connection to a remote device. Enabling discoverability is only necessary when
+you want your application to host a server socket that will accept incoming
+connections, because the remote devices must be able to discover the device
+before it can initiate the connection.</p>
+
+
+
+<h2 id="ConnectingDevices">Connecting Devices</h2>
+
+<p>In order to create a connection between your application on two devices, you
+must implement both the server-side and client-side mechanisms, because one
+device must open a server socket and the other one must initiate the connection
+(using the server device's MAC address to initiate a connection). The server and
+client are considered connected to each other when they each have a connected
+{@link android.bluetooth.BluetoothSocket} on the same RFCOMM channel. At this
+point, each device can obtain input and output streams and data transfer can
+begin, which is discussed in the section about <a
+href="#ManagingAConnection">Managing a Connection</a>. This section describes how
+to initiate the connection between two devices.</p>
+
+<p>The server device and the client device each obtain the required {@link
+android.bluetooth.BluetoothSocket} in different ways. The server will receive it
+when an incoming connection is accepted. The client will receive it when it
+opens an RFCOMM channel to the server.</p>
+
+<div class="figure" style="width:200px">
+<img src="{@docRoot}images/bt_pairing_request.png" />
+<strong>Figure 3:</strong> The Bluetooth pairing dialog.
+</div>
+
+<p>One implementation technique is to automatically prepare each device as a
+server, so that each one has a server socket open and listening for connections.
+Then either device can initiate a connection with the other and become the
+client. Alternatively, one device can explicitly "host" the connection and open
+a server socket on demand and the other device can simply initiate the
+connection.</p>
+
+<p class="note"><strong>Note:</strong> If the two devices have not been previously paired,
+then the Android framework will automatically show a pairing request notification or
+dialog to the user during the connection procedure, as shown in Figure 3. So
+when attempting to connect devices,
+your application does not need to be concerned about whether or not the devices are
+paired. Your RFCOMM connection attempt will block until the user has successfully paired,
+or will fail if the user rejects pairing, or if pairing fails or times out. </p>
+
+
+<h3 id="ConnectingAsAServer">Connecting as a server</h3>
+
+<p>When you want to connect two devices, one must act as a server by holding an
+open {@link android.bluetooth.BluetoothServerSocket}. The purpose of the server
+socket is to listen for incoming connection requests and when one is accepted,
+provide a connected {@link android.bluetooth.BluetoothSocket}. When the {@link
+android.bluetooth.BluetoothSocket} is acquired from the {@link
+android.bluetooth.BluetoothServerSocket},
+the {@link android.bluetooth.BluetoothServerSocket} can (and should) be
+discarded, unless you want to accept more connections.</p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>About UUID</h2>
+
+<p>A Universally Unique Identifier (UUID) is a standardized 128-bit format for a string
+ID used to uniquely identify information. The point of a UUID is that it's big
+enough that you can select any random and it won't clash. In this case, it's
+used to uniquely identify your application's Bluetooth service. To get a UUID to
+use with your application, you can use one of the many random UUID generators on
+the web, then initialize a {@link java.util.UUID} with {@link
+java.util.UUID#fromString(String)}.</p>
+</div>
+</div>
+
+<p>Here's the basic procedure to set up a server socket and accept a
+connection:</p>
+
+<ol>
+<li>Get a {@link android.bluetooth.BluetoothServerSocket} by calling the
+{@link
+android.bluetooth.BluetoothAdapter#listenUsingRfcommWithServiceRecord(String,
+UUID)}.
+<p>The string is an identifiable name of your service, which the system will
+automatically write to a new Service Discovery Protocol (SDP) database entry on
+the device (the name is arbitrary and can simply be your application name). The
+UUID is also included in the SDP entry and will be the basis for the connection
+agreement with the client device. That is, when the client attempts to connect
+with this device, it will carry a UUID that uniquely identifies the service with
+which it wants to connect. These UUIDs must match in order for the connection to
+be accepted (in the next step).</p>
+</li>
+
+<li>Start listening for connection requests by calling
+{@link android.bluetooth.BluetoothServerSocket#accept()}.
+<p>This is a blocking call. It will return when either a connection has been
+accepted or an exception has occurred. A connection is accepted only when a
+remote device has sent a connection request with a UUID matching the one
+registered with this listening server socket. When successful, {@link
+android.bluetooth.BluetoothServerSocket#accept()} will
+return a connected {@link android.bluetooth.BluetoothSocket}.</p>
+</li>
+
+<li>Unless you want to accept additional connections, call
+{@link android.bluetooth.BluetoothServerSocket#close()}.
+<p>This releases the server socket and all its resources, but does <em>not</em> close the
+connected {@link android.bluetooth.BluetoothSocket} that's been returned by {@link
+android.bluetooth.BluetoothServerSocket#accept()}. Unlike TCP/IP, RFCOMM only allows one
+connected client per channel at a time, so in most cases it makes sense to call {@link
+android.bluetooth.BluetoothServerSocket#close()} on the {@link
+android.bluetooth.BluetoothServerSocket} immediately after accepting a connected
+socket.</p>
+</li>
+</ol>
+
+<p>The {@link android.bluetooth.BluetoothServerSocket#accept()} call should not
+be executed in the main activity UI thread because it is a blocking call and
+will prevent any other interaction with the application. It usually makes
+sense to do all work with a {@link android.bluetooth.BluetoothServerSocket} or {@link
+android.bluetooth.BluetoothSocket} in a new
+thread managed by your application. To abort a blocked call such as {@link
+android.bluetooth.BluetoothServerSocket#accept()}, call {@link
+android.bluetooth.BluetoothServerSocket#close()} on the {@link
+android.bluetooth.BluetoothServerSocket} (or {@link
+android.bluetooth.BluetoothSocket}) from another thread and the blocked call will
+immediately return. Note that all methods on a {@link
+android.bluetooth.BluetoothServerSocket} or {@link android.bluetooth.BluetoothSocket}
+are thread-safe.</p>
+
+<h4>Example</h4>
+
+<p>Here's a simplified thread for the server component that accepts incoming
+connections:</p>
+<pre>
+private class AcceptThread extends Thread {
+ private final BluetoothServerSocket mmServerSocket;
+
+ public AcceptThread() {
+ // Use a temporary object that is later assigned to mmServerSocket,
+ // because mmServerSocket is final
+ BluetoothServerSocket tmp = null;
+ try {
+ // MY_UUID is the app's UUID string, also used by the client code
+ tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID);
+ } catch (IOException e) { }
+ mmServerSocket = tmp;
+ }
+
+ public void run() {
+ BluetoothSocket socket = null;
+ // Keep listening until exception occurs or a socket is returned
+ while (true) {
+ try {
+ socket = mmServerSocket.accept();
+ } catch (IOException e) {
+ break;
+ }
+ // If a connection was accepted
+ if (socket != null) {
+ // Do work to manage the connection (in a separate thread)
+ manageConnectedSocket(socket);
+ mmServerSocket.close();
+ break;
+ }
+ }
+ }
+
+ /** Will cancel the listening socket, and cause the thread to finish */
+ public void cancel() {
+ try {
+ mmServerSocket.close();
+ } catch (IOException e) { }
+ }
+}
+</pre>
+
+<p>In this example, only one incoming connection is desired, so as soon as a
+connection is accepted and the {@link android.bluetooth.BluetoothSocket} is
+acquired, the application
+sends the acquired {@link android.bluetooth.BluetoothSocket} to a separate
+thread, closes the
+{@link android.bluetooth.BluetoothServerSocket} and breaks the loop.</p>
+
+<p>Note that when {@link android.bluetooth.BluetoothServerSocket#accept()}
+returns the {@link android.bluetooth.BluetoothSocket}, the socket is already
+connected, so you should <em>not</em> call {@link
+android.bluetooth.BluetoothSocket#connect()} (as you do from the
+client-side).</p>
+
+<p><code>manageConnectedSocket()</code> is a fictional method in the application
+that will
+initiate the thread for transferring data, which is discussed in the section
+about <a href="#ManagingAConnection">Managing a Connection</a>.</p>
+
+<p>You should usually close your {@link android.bluetooth.BluetoothServerSocket}
+as soon as you are done listening for incoming connections. In this example, {@link
+android.bluetooth.BluetoothServerSocket#close()} is called as soon
+as the {@link android.bluetooth.BluetoothSocket} is acquired. You may also want
+to provide a public method in your thread that can close the private {@link
+android.bluetooth.BluetoothSocket} in the event that you need to stop listening on the
+server socket.</p>
+
+
+<h3 id="ConnectingAsAClient">Connecting as a client</h3>
+
+<p>In order to initiate a connection with a remote device (a device holding an
+open
+server socket), you must first obtain a {@link
+android.bluetooth.BluetoothDevice} object that represents the remote device.
+(Getting a {@link android.bluetooth.BluetoothDevice} is covered in the above
+section about <a
+href="#FindingDevices">Finding Devices</a>.) You must then use the
+{@link android.bluetooth.BluetoothDevice} to acquire a {@link
+android.bluetooth.BluetoothSocket} and initiate the connection.</p>
+
+<p>Here's the basic procedure:</p>
+
+<ol>
+<li>Using the {@link android.bluetooth.BluetoothDevice}, get a {@link
+android.bluetooth.BluetoothSocket} by calling {@link
+android.bluetooth.BluetoothDevice#createRfcommSocketToServiceRecord(UUID)}.
+<p>This initializes a {@link android.bluetooth.BluetoothSocket} that will
+connect to the {@link android.bluetooth.BluetoothDevice}. The UUID passed here
+must match the UUID used by the server device when it opened its
+{@link android.bluetooth.BluetoothServerSocket} (with {@link
+android.bluetooth.BluetoothAdapter#listenUsingRfcommWithServiceRecord(String,
+UUID)}). Using the same UUID is simply a matter of hard-coding the UUID string
+into your application and then referencing it from both the server and client
+code.</p>
+</li>
+
+<li>Initiate the connection by calling {@link
+android.bluetooth.BluetoothSocket#connect()}.
+<p>Upon this call, the system will perform an SDP lookup on the remote device in
+order to match the UUID. If the lookup is successful and the remote device
+accepts the connection, it will share the RFCOMM channel to use during the
+connection and {@link
+android.bluetooth.BluetoothSocket#connect()} will return. This method is a
+blocking call. If, for
+any reason, the connection fails or the {@link
+android.bluetooth.BluetoothSocket#connect()} method times out (after about
+12 seconds), then it will throw an exception.</p>
+<p>Because {@link
+android.bluetooth.BluetoothSocket#connect()} is a blocking call, this connection
+procedure should always be performed in a thread separate from the main activity
+thread.</p>
+<p class="note">Note: You should always ensure that the device is not performing
+device discovery when you call {@link
+android.bluetooth.BluetoothSocket#connect()}. If discovery is in progress, then
+the
+connection attempt will be significantly slowed and is more likely to fail.</p>
+</li>
+</ol>
+
+<h4>Example</h4>
+
+<p>Here is a basic example of a thread that initiates a Bluetooth
+connection:</p>
+<pre>
+private class ConnectThread extends Thread {
+ private final BluetoothSocket mmSocket;
+ private final BluetoothDevice mmDevice;
+
+ public ConnectThread(BluetoothDevice device) {
+ // Use a temporary object that is later assigned to mmSocket,
+ // because mmSocket is final
+ BluetoothSocket tmp = null;
+ mmDevice = device;
+
+ // Get a BluetoothSocket to connect with the given BluetoothDevice
+ try {
+ // MY_UUID is the app's UUID string, also used by the server code
+ tmp = device.createRfcommSocketToServiceRecord(MY_UUID);
+ } catch (IOException e) { }
+ mmSocket = tmp;
+ }
+
+ public void run() {
+ // Cancel discovery because it will slow down the connection
+ mBluetoothAdapter.cancelDiscovery();
+
+ try {
+ // Connect the device through the socket. This will block
+ // until it succeeds or throws an exception
+ mmSocket.connect();
+ } catch (IOException connectException) {
+ // Unable to connect; close the socket and get out
+ try {
+ mmSocket.close();
+ } catch (IOException closeException) { }
+ return;
+ }
+
+ // Do work to manage the connection (in a separate thread)
+ manageConnectedSocket(mmSocket);
+ }
+
+ /** Will cancel an in-progress connection, and close the socket */
+ public void cancel() {
+ try {
+ mmSocket.close();
+ } catch (IOException e) { }
+ }
+}
+</pre>
+
+<p>Notice that {@link android.bluetooth.BluetoothAdapter#cancelDiscovery()} is called
+before the connection is made. You should always do this before connecting and it is safe
+to call without actually checking whether it is running or not (but if you do want to
+check, call {@link android.bluetooth.BluetoothAdapter#isDiscovering()}).</p>
+
+<p><code>manageConnectedSocket()</code> is a fictional method in the application
+that will initiate the thread for transferring data, which is discussed in the section
+about <a href="#ManagingAConnection">Managing a Connection</a>.</p>
+
+<p>When you're done with your {@link android.bluetooth.BluetoothSocket}, always
+call {@link android.bluetooth.BluetoothSocket#close()} to clean up.
+Doing so will immediately close the connected socket and clean up all internal
+resources.</p>
+
+
+<h2 id="ManagingAConnection">Managing a Connection</h2>
+
+<p>When you have successfully connected two (or more) devices, each one will
+have a connected {@link android.bluetooth.BluetoothSocket}. This is where the fun
+begins because you can share data between devices. Using the {@link
+android.bluetooth.BluetoothSocket}, the general procedure to transfer arbitrary data is
+simple:</p>
+<ol>
+<li>Get the {@link java.io.InputStream} and {@link java.io.OutputStream} that
+handle transmissions through the socket, via {@link
+android.bluetooth.BluetoothSocket#getInputStream()} and
+{@link android.bluetooth.BluetoothSocket#getOutputStream}, respectively.</li>
+
+<li>Read and write data to the streams with {@link
+java.io.InputStream#read(byte[])} and {@link java.io.OutputStream#write(byte[])}.</li>
+</ol>
+
+<p>That's it.</p>
+
+<p>There are, of course, implementation details to consider. First and foremost,
+you should use a dedicated thread for all stream reading and writing. This is
+important because both {@link java.io.InputStream#read(byte[])} and {@link
+java.io.OutputStream#write(byte[])} methods are blocking calls. {@link
+java.io.InputStream#read(byte[])} will block until there is something to read
+from the stream. {@link java.io.OutputStream#write(byte[])} does not usually
+block, but can block for flow control if the remote device is not calling {@link
+java.io.InputStream#read(byte[])} quickly enough and the intermediate buffers are full.
+So, your main loop in the thread should be dedicated to reading from the {@link
+java.io.InputStream}. A separate public method in the thread can be used to initiate
+writes to the {@link java.io.OutputStream}.</p>
+
+<h4>Example</h4>
+
+<p>Here's an example of how this might look:</p>
+<pre>
+private class ConnectedThread extends Thread {
+ private final BluetoothSocket mmSocket;
+ private final InputStream mmInStream;
+ private final OutputStream mmOutStream;
+
+ public ConnectedThread(BluetoothSocket socket) {
+ mmSocket = socket;
+ InputStream tmpIn = null;
+ OutputStream tmpOut = null;
+
+ // Get the input and output streams, using temp objects because
+ // member streams are final
+ try {
+ tmpIn = socket.getInputStream();
+ tmpOut = socket.getOutputStream();
+ } catch (IOException e) { }
+
+ mmInStream = tmpIn;
+ mmOutStream = tmpOut;
+ }
+
+ public void run() {
+ byte[] buffer = new byte[1024]; // buffer store for the stream
+ int bytes; // bytes returned from read()
+
+ // Keep listening to the InputStream until an exception occurs
+ while (true) {
+ try {
+ // Read from the InputStream
+ bytes = mmInStream.read(buffer);
+ // Send the obtained bytes to the UI activity
+ mHandler.obtainMessage(MESSAGE_READ, bytes, -1, buffer)
+ .sendToTarget();
+ } catch (IOException e) {
+ break;
+ }
+ }
+ }
+
+ /* Call this from the main activity to send data to the remote device */
+ public void write(byte[] bytes) {
+ try {
+ mmOutStream.write(bytes);
+ } catch (IOException e) { }
+ }
+
+ /* Call this from the main activity to shutdown the connection */
+ public void cancel() {
+ try {
+ mmSocket.close();
+ } catch (IOException e) { }
+ }
+}
+</pre>
+
+<p>The constructor acquires the necessary streams and once executed, the thread
+will wait for data to come through the InputStream. When {@link
+java.io.InputStream#read(byte[])} returns with
+bytes from the stream, the data is sent to the main activity using a member
+Handler from the parent class. Then it goes back and waits for more bytes from
+the stream.</p>
+
+<p>Sending outgoing data is as simple as calling the thread's
+<code>write()</code> method from the main activity and passing in the bytes to
+be sent. This method then simply calls {@link
+java.io.OutputStream#write(byte[])} to send the data to the remote device.</p>
+
+<p>The thread's <code>cancel()</code> method is important so that the connection
+can be
+terminated at any time by closing the {@link android.bluetooth.BluetoothSocket}.
+This should always be called when you're done using the Bluetooth
+connection.</p>
+
+<div class="special">
+<p>For a demonstration of using the Bluetooth APIs, see the <a
+href="{@docRoot}resources/samples/BluetoothChat/index.html">Bluetooth Chat sample app</a>.</p>
+</div>
+
+<h2 id="Profiles">Working with Profiles</h2>
+
+<p>Starting in Android 3.0, the Bluetooth API includes support for working with
+Bluetooth profiles. A <em>Bluetooth profile</em> is a wireless interface
+specification for Bluetooth-based communication between devices. An example
+is the Hands-Free profile. For a mobile phone to connect to a wireless headset,
+both devices must support the Hands-Free profile. </p>
+
+<p>You can implement the interface {@link android.bluetooth.BluetoothProfile} to write
+your own classes to support a particular Bluetooth profile. The Android
+Bluetooth API provides implementations for the following Bluetooth
+profiles:</p>
+<ul>
+
+ <li><strong>Headset</strong>. The Headset profile provides support for
+Bluetooth headsets to be used with mobile phones. Android provides the {@link
+android.bluetooth.BluetoothHeadset} class, which is a proxy for controlling the
+Bluetooth Headset Service via interprocess communication (<a
+href="{@docRoot}guide/components/processes-and-threads.html#IPC">IPC</a
+>). This includes both Bluetooth Headset and Hands-Free (v1.5) profiles. The
+{@link android.bluetooth.BluetoothHeadset} class includes support for AT commands.
+For more discussion of this topic, see <a href="#AT-Commands">Vendor-specific AT commands</a></li>
+
+ <li><strong>A2DP</strong>. The Advanced Audio Distribution Profile (A2DP)
+profile defines how high quality audio can be streamed from one device to
+another over a Bluetooth connection. Android provides the {@link
+android.bluetooth.BluetoothA2dp} class, which is a proxy for controlling
+the Bluetooth A2DP Service via IPC.</li>
+
+ <li><strong>Health Device</strong>. Android 4.0 (API level 14) introduces
+support for the Bluetooth Health Device Profile (HDP). This lets you create
+applications that use Bluetooth to communicate with health devices that support
+Bluetooth, such as heart-rate monitors, blood meters, thermometers, scales, and
+so on. For a list of supported devices and their corresponding device data
+specialization codes, refer to <strong>Bluetooth Assigned Numbers</strong> at <a
+href="http://www.bluetooth.org">www.bluetooth.org</a>. Note that these values
+are also referenced in the ISO/IEEE 11073-20601 [7] specification as
+MDC_DEV_SPEC_PROFILE_* in the Nomenclature Codes Annex. For more discussion of
+HDP, see <a href="#HDP">Health Device Profile</a>.</li>
+
+</ul>
+
+<p>Here are the basic steps for working with a profile:</p>
+<ol>
+
+ <li>Get the default adapter, as described in
+ <a href="{@docRoot}guide/topics/connectivity/bluetooth.html#SettingUp">Setting Up
+ Bluetooth</a>.</li>
+
+ <li>Use {@link
+android.bluetooth.BluetoothAdapter#getProfileProxy(android.content.Context,
+android.bluetooth.BluetoothProfile.ServiceListener, int) getProfileProxy()} to
+establish a connection to the profile proxy object associated with the profile.
+In the example below, the profile proxy object is an instance of {@link
+android.bluetooth.BluetoothHeadset}. </li>
+
+ <li>Set up a {@link android.bluetooth.BluetoothProfile.ServiceListener}. This
+listener notifies {@link android.bluetooth.BluetoothProfile} IPC clients when
+they have been connected to or disconnected from the service.</li>
+
+ <li>In {@link
+android.bluetooth.BluetoothProfile.ServiceListener#onServiceConnected(int,
+android.bluetooth.BluetoothProfile) onServiceConnected()}, get a handle
+to the profile proxy object.</li>
+
+ <li>Once you have the profile proxy object, you can use it to monitor the
+state of the connection and perform other operations that are relevant to that
+profile.</li>
+</ol>
+
+<p> For example, this code snippet shows how to connect to a {@link
+android.bluetooth.BluetoothHeadset} proxy object so that you can control the
+Headset profile:</p>
+
+<pre>BluetoothHeadset mBluetoothHeadset;
+
+// Get the default adapter
+BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+
+// Establish connection to the proxy.
+mBluetoothAdapter.getProfileProxy(context, mProfileListener, BluetoothProfile.HEADSET);
+
+private BluetoothProfile.ServiceListener mProfileListener = new BluetoothProfile.ServiceListener() {
+ public void onServiceConnected(int profile, BluetoothProfile proxy) {
+ if (profile == BluetoothProfile.HEADSET) {
+ mBluetoothHeadset = (BluetoothHeadset) proxy;
+ }
+ }
+ public void onServiceDisconnected(int profile) {
+ if (profile == BluetoothProfile.HEADSET) {
+ mBluetoothHeadset = null;
+ }
+ }
+};
+
+// ... call functions on mBluetoothHeadset
+
+// Close proxy connection after use.
+mBluetoothAdapter.closeProfileProxy(mBluetoothHeadset);
+</pre>
+
+
+
+<h3 id="AT-Commands">Vendor-specific AT commands</h3>
+
+<p>Starting in Android 3.0, applications can register to receive system
+broadcasts of pre-defined vendor-specific AT commands sent by headsets (such as
+a Plantronics +XEVENT command). For example, an application could receive
+broadcasts that indicate a connected device's battery level and could notify the
+user or take other action as needed. Create a broadcast receiver for the {@link
+android.bluetooth.BluetoothHeadset#ACTION_VENDOR_SPECIFIC_HEADSET_EVENT} intent
+to handle vendor-specific AT commands for the headset.</p>
+
+<h3 id="HDP">Health Device Profile</h3>
+
+<p>Android 4.0 (API level 14) introduces support for the Bluetooth Health Device
+Profile (HDP). This lets you create applications that use Bluetooth to
+communicate with health devices that support Bluetooth, such as heart-rate
+monitors, blood meters, thermometers, and scales. The Bluetooth Health API
+includes the classes {@link android.bluetooth.BluetoothHealth}, {@link
+android.bluetooth.BluetoothHealthCallback}, and {@link
+android.bluetooth.BluetoothHealthAppConfiguration}, which are described in <a
+href="#TheBasics">The Basics</a>. </p>
+
+<p>In using the Bluetooth Health API, it's helpful to understand these key HDP concepts:</p>
+<table>
+ <tr>
+ <th>Concept</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><strong>Source</strong></td>
+
+ <td>A role defined in HDP. A <em>source</em> is a health device that
+transmits medical data (weight scale, glucose meter, thermometer, etc.) to a
+smart device such as an Android phone or tablet. </td>
+ </tr>
+ <tr>
+ <td><strong>Sink</strong></td>
+
+ <td>A role defined in HDP. In HDP, a <em>sink</em> is the smart device that
+receives the medical data. In an Android HDP application, the sink is
+represented by a {@link android.bluetooth.BluetoothHealthAppConfiguration}
+object.</td>
+ </tr>
+ <tr>
+ <td><strong>Registration</strong></td>
+ <td>Refers to registering a sink for a particular health device.</td>
+ </tr>
+ <tr>
+ <td><strong>Connection</strong></td>
+
+ <td>Refers to opening a channel between a health device and a smart device
+such as an Android phone or tablet.</td>
+ </tr>
+</table>
+
+<h4>Creating an HDP Application</h4>
+
+<p>Here are the basic steps involved in creating an Android HDP application:</p>
+<ol>
+
+ <li>Get a reference to the {@link android.bluetooth.BluetoothHealth} proxy
+object. <p>Similar to regular headset and A2DP profile devices, you must call
+{@link android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()}
+with a {@link android.bluetooth.BluetoothProfile.ServiceListener} and the {@link
+android.bluetooth.BluetoothProfile.ServiceListener#HEALTH} profile type to
+establish a connection with the profile proxy object.</p> </li>
+
+ <li>Create a {@link android.bluetooth.BluetoothHealthCallback} and register an
+application configuration
+({@link android.bluetooth.BluetoothHealthAppConfiguration})
+that acts as a health
+sink.</li>
+
+ <li>Establish a connection to a health device. Some devices will initiate the
+connection. It is unnecessary to carry out this step for those devices.</li>
+
+ <li>When connected successfully to a health device, read/write to the health
+device using the file descriptor. <p>The received data needs to be interpreted
+using a health manager which implements the IEEE 11073-xxxxx
+specifications.</p></li>
+
+ <li>When done, close the health channel and unregister the application. The
+channel also closes when there is extended inactivity.</li>
+</ol>
+
+<p>For a complete code sample that illustrates these steps, see <a
+href="{@docRoot}resources/samples/BluetoothHDP/index.html">Bluetooth HDP (Health
+Device Profile)</a>. </p>
diff --git a/docs/html/guide/topics/connectivity/index.jd b/docs/html/guide/topics/connectivity/index.jd
new file mode 100644
index 0000000..322518e
--- /dev/null
+++ b/docs/html/guide/topics/connectivity/index.jd
@@ -0,0 +1,42 @@
+page.title=Connectivity
+page.landing=true
+page.landing.intro=Android provides rich APIs to let your app connect and interact with other devices over Bluetooth, NFC, Wi-Fi Direct, USB, and SIP, in addition to standard network connections.
+page.landing.image=images/develop/connectivity.png
+
+@jd:body
+
+<div class="landing-docs">
+
+ <div class="col-6">
+ <h3>Blog Articles</h3>
+
+ <a href="http://android-developers.blogspot.com/2011/09/androids-http-clients.html">
+ <h4>Android’s HTTP Clients</h4>
+ <p>Most network-connected Android apps will use HTTP to send and receive data. Android
+includes two HTTP clients: HttpURLConnection and Apache HTTP Client. Both support HTTPS, streaming
+uploads and downloads, configurable timeouts, IPv6 and connection pooling.</p>
+ </a>
+
+ </div>
+
+ <div class="col-6">
+ <h3>Training</h3>
+
+ <a href="http://developer.android.com/training/efficient-downloads/index.html">
+ <h4>Transferring Data Without Draining the Battery</h4>
+ <p>This class demonstrates the best practices for scheduling and executing downloads using
+techniques such as caching, polling, and prefetching. You will learn how the power-use profile of
+the wireless radio can affect your choices on when, what, and how to transfer data in order to
+minimize impact on battery life.</p>
+ </a>
+
+ <a href="http://developer.android.com/training/cloudsync/index.html">
+ <h4>Syncing to the Cloud</h4>
+ <p>This class covers different strategies for cloud enabled applications. It covers syncing
+data with the cloud using your own back-end web application, and backing up data using the cloud so
+that users can restore their data when installing your application on a new device.</p>
+ </a>
+
+ </div>
+
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/topics/connectivity/nfc/advanced-nfc.jd b/docs/html/guide/topics/connectivity/nfc/advanced-nfc.jd
new file mode 100644
index 0000000..9d6cda5
--- /dev/null
+++ b/docs/html/guide/topics/connectivity/nfc/advanced-nfc.jd
@@ -0,0 +1,300 @@
+page.title=Advanced NFC
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#tag-tech">Working with Supported Tag Technologies</a>
+ <ol>
+ <li><a href="#tech-intent">Working with tag technologies and the ACTION_TECH_DISCOVERED
+ intent</a></li>
+ <li><a href="#read-write">Reading and writing to tags</a></li>
+ </ol></li>
+ <li><a href="#foreground-dispatch">Using the Foreground Dispatch System</a></li>
+ </ol>
+</div>
+</div>
+
+<p>This document describes advanced NFC topics, such as working with various tag technologies,
+writing to NFC tags, and foreground dispatching, which allows an application in the foreground to
+handle intents even when other applications filter for the same ones.</p>
+
+<h2 id="tag-tech">Working with Supported Tag Technologies</h2>
+<p>When working with NFC tags and Android-powered devices, the main format you use to read
+and write data on tags is NDEF. When a device scans a tag with NDEF data, Android provides support
+in parsing the message and delivering it in an {@link android.nfc.NdefMessage} when
+possible. There are cases, however, when you scan a tag that does not contain
+NDEF data or when the NDEF data could not be mapped to a MIME type or URI.
+In these cases, you need to open communication directly with the tag and read and write to it with
+your own protocol (in raw bytes). Android provides generic support for these use cases with the
+{@link android.nfc.tech} package, which is described in <a href="#tech-table">Table 1</a>. You can
+use the {@link android.nfc.Tag#getTechList getTechList()} method to determine the technologies
+supported by the tag and create the corresponding {@link android.nfc.tech.TagTechnology}
+object with one of classes provided by {@link android.nfc.tech} </p>
+
+<p class="table-caption" id="table1">
+<strong>Table 1.</strong> Supported tag technologies</p>
+<table id="tech-table">
+
+ <tr>
+ <th>Class</th>
+
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>{@link android.nfc.tech.TagTechnology}</td>
+
+ <td>The interface that all tag technology classes must implement.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.nfc.tech.NfcA}</td>
+
+ <td>Provides access to NFC-A (ISO 14443-3A) properties and I/O operations.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.nfc.tech.NfcB}</td>
+
+ <td>Provides access to NFC-B (ISO 14443-3B) properties and I/O operations.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.nfc.tech.NfcF}</td>
+
+ <td>Provides access to NFC-F (JIS 6319-4) properties and I/O operations.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.nfc.tech.NfcV}</td>
+
+ <td>Provides access to NFC-V (ISO 15693) properties and I/O operations.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.nfc.tech.IsoDep}</td>
+
+ <td>Provides access to ISO-DEP (ISO 14443-4) properties and I/O operations.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.nfc.tech.Ndef}</td>
+
+ <td>Provides access to NDEF data and operations on NFC tags that have been formatted as
+ NDEF.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.nfc.tech.NdefFormatable}</td>
+
+ <td>Provides a format operations for tags that may be NDEF formattable.</td>
+ </tr>
+ </table>
+<p>The following tag technlogies are not required to be supported by Android-powered devices.</p>
+ <p class="table-caption" id="table2">
+<strong>Table 2.</strong> Optional supported tag technologies</p>
+ <table>
+ <tr>
+ <th>Class</th>
+
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>{@link android.nfc.tech.MifareClassic}</td>
+
+ <td>Provides access to MIFARE Classic properties and I/O operations, if this Android device
+ supports MIFARE.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.nfc.tech.MifareUltralight}</td>
+
+ <td>Provides access to MIFARE Ultralight properties and I/O operations, if this Android
+ device supports MIFARE.</td>
+ </tr>
+ </table>
+
+<h3 id="tech-intent">Working with tag technologies and the ACTION_TECH_DISCOVERED intent</h3>
+<p>When a device scans a tag that has NDEF data on it, but could not be mapped to a MIME or URI,
+the tag dispatch system tries to start an activity with the {@link
+android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}
+intent. The {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} is also used when a tag
+with non-NDEF data is scanned. Having this fallback allows you to work with the data on the tag
+directly if the tag dispatch system could not parse it for you. The basic steps when working with
+tag technologies are as follows:</p>
+
+<ol>
+ <li>Filter for an {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent specifying the
+tag technologies that you want to handle. See <a
+href="{@docRoot}guide/topics/connectivity/nfc/nfc.html#tech-disc">Filtering for NFC
+intents</a> for more information. In general, the tag dispatch system tries to start a {@link
+android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent when an NDEF message
+cannot be mapped to a MIME type or URI, or if the tag scanned did not contain NDEF data. For
+more information on how this is determined, see <a
+href="{@docRoot}guide/topics/connectivity/nfc/nfc.html#tag-dispatch">The Tag Dispatch System</a>.</li>
+ <li>When your application receives the intent, obtain the {@link android.nfc.Tag} object from
+the intent:
+<pre>Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);</pre></li>
+<li>Obtain an instance of a {@link android.nfc.tech.TagTechnology}, by calling one of the
+<code>get</code> factory methods of the classes in the {@link android.nfc.tech} package. You can
+enumerate the supported technologies of the tag by calling {@link android.nfc.Tag#getTechList
+getTechList()} before calling a <code>get</code> factory method. For example, to obtain an instance
+of {@link android.nfc.tech.MifareUltralight} from a {@link android.nfc.Tag}, do the following:
+
+<pre>
+MifareUltralight.get(intent.getParcelableExtra(NfcAdapter.EXTRA_TAG));
+</pre>
+</li>
+</ol>
+
+
+
+<h3 id="read-write">Reading and writing to tags</h3>
+
+<p>Reading and writing to an NFC tag involves obtaining the tag from the intent and
+opening communication with the tag. You must define your own protocol stack to read and write data
+to the tag. Keep in mind, however, that you can still read and write NDEF data when working
+directly with a tag. It is up to you how you want to structure things. The
+following example shows how to work with a MIFARE Ultralight tag.</p>
+
+<pre>
+package com.example.android.nfc;
+
+import android.nfc.Tag;
+import android.nfc.tech.MifareUltralight;
+import android.util.Log;
+import java.io.IOException;
+import java.nio.charset.Charset;
+
+public class MifareUltralightTagTester {
+
+ private static final String TAG = MifareUltralightTagTester.class.getSimpleName();
+
+ public void writeTag(Tag tag, String tagText) {
+ MifareUltralight ultralight = MifareUltralight.get(tag);
+ try {
+ ultralight.connect();
+ ultralight.writePage(4, "abcd".getBytes(Charset.forName("US-ASCII")));
+ ultralight.writePage(5, "efgh".getBytes(Charset.forName("US-ASCII")));
+ ultralight.writePage(6, "ijkl".getBytes(Charset.forName("US-ASCII")));
+ ultralight.writePage(7, "mnop".getBytes(Charset.forName("US-ASCII")));
+ } catch (IOException e) {
+ Log.e(TAG, "IOException while closing MifareUltralight...", e);
+ } finally {
+ try {
+ ultralight.close();
+ } catch (IOException e) {
+ Log.e(TAG, "IOException while closing MifareUltralight...", e);
+ }
+ }
+ }
+
+ public String readTag(Tag tag) {
+ MifareUltralight mifare = MifareUltralight.get(tag);
+ try {
+ mifare.connect();
+ byte[] payload = mifare.readPages(4);
+ return new String(payload, Charset.forName("US-ASCII"));
+ } catch (IOException e) {
+ Log.e(TAG, "IOException while writing MifareUltralight
+ message...", e);
+ } finally {
+ if (mifare != null) {
+ try {
+ mifare.close();
+ }
+ catch (IOException e) {
+ Log.e(TAG, "Error closing tag...", e);
+ }
+ }
+ }
+ return null;
+ }
+}
+</pre>
+
+</pre>
+
+ <h2 id="foreground-dispatch">Using the Foreground Dispatch System</h2>
+
+ <p>The foreground dispatch system allows an activity to intercept an intent and claim
+priority over other activities that handle the same intent. Using this system involves
+ constructing a few data structures for the Android system to be able to send the appropriate
+ intents to your application. To enable the foreground dispatch system:</p>
+
+ <ol>
+ <li>Add the following code in the <code>onCreate()</code> method of your activity:
+
+ <ol>
+ <li>Create a {@link android.app.PendingIntent} object so the Android system can populate it
+ with the details of the tag when it is scanned.
+ <pre>
+PendingIntent pendingIntent = PendingIntent.getActivity(
+ this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
+</pre>
+ </li>
+
+ <li>Declare intent filters to handle the intents that you want to intercept. The foreground
+ dispatch system checks the specified intent filters with the intent that is received when
+ the device scans a tag. If it matches, then your application handles the intent. If it does
+ not match, the foreground dispatch system falls back to the intent dispatch system.
+ Specifying a <code>null</code> array of intent filters and technology filters, specifies
+ that you want to filter for all tags that fallback to the <code>TAG_DISCOVERED</code>
+ intent. The code snippet below handles all MIME types for <code>NDEF_DISCOVERED</code>. You
+ should only handle the ones that you need.
+<pre>
+IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED);
+ try {
+ ndef.addDataType("*/*"); /* Handles all MIME based dispatches.
+ You should specify only the ones that you need. */
+ }
+ catch (MalformedMimeTypeException e) {
+ throw new RuntimeException("fail", e);
+ }
+ intentFiltersArray = new IntentFilter[] {ndef, };
+</pre>
+ </li>
+
+ <li>Set up an array of tag technologies that your application wants to handle. Call the
+ <code>Object.class.getName()</code> method to obtain the class of the technology that you
+ want to support.
+<pre>
+techListsArray = new String[][] { new String[] { NfcF.class.getName() } };
+</pre>
+ </li>
+ </ol>
+ </li>
+
+ <li>Override the following activity lifecycle callbacks and add logic to enable and disable the
+ foreground dispatch when the activity loses ({@link android.app.Activity#onPause onPause()})
+ and regains ({@link android.app.Activity#onResume onResume()}) focus. {@link
+ android.nfc.NfcAdapter#enableForegroundDispatch enableForegroundDispatch()} must be called from
+the main thread and only when the activity is in the foreground (calling in {@link
+android.app.Activity#onResume onResume()} guarantees this). You also need to implement the {@link
+ android.app.Activity#onNewIntent onNewIntent} callback to process the data from the scanned NFC
+ tag.</li>
+
+<pre>
+public void onPause() {
+ super.onPause();
+ mAdapter.disableForegroundDispatch(this);
+}
+
+public void onResume() {
+ super.onResume();
+ mAdapter.enableForegroundDispatch(this, pendingIntent, intentFiltersArray, techListsArray);
+}
+
+public void onNewIntent(Intent intent) {
+ Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
+ //do something with tagFromIntent
+}
+</pre>
+ </li>
+ </ol>
+
+ <p>See the <a href=
+"{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/ForegroundDispatch.html">
+ForegroundDispatch</a> sample from API Demos for the complete sample.</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/connectivity/nfc/index.jd b/docs/html/guide/topics/connectivity/nfc/index.jd
new file mode 100644
index 0000000..88c206f
--- /dev/null
+++ b/docs/html/guide/topics/connectivity/nfc/index.jd
@@ -0,0 +1,33 @@
+page.title=Near Field Communication
+@jd:body
+
+ <p>Near Field Communication (NFC) is a set of short-range wireless technologies, typically
+ requiring a distance of 4cm or less to initiate a connection. NFC allows you to share small
+ payloads of data between an NFC tag and an Android-powered device, or between two Android-powered
+ devices.
+
+ <p>Tags can range in complexity. Simple tags offer just read and write semantics, sometimes with
+ one-time-programmable areas to make the card read-only. More complex tags offer math operations,
+ and have cryptographic hardware to authenticate access to a sector. The most sophisticated tags
+ contain operating environments, allowing complex interactions with code executing on the tag.
+ The data stored in the tag can also be written in a variety of formats, but many of the Android
+ framework APIs are based around a <a href="http://www.nfc-forum.org/">NFC Forum</a> standard
+ called NDEF (NFC Data Exchange Format).</p>
+
+ <dl>
+ <dt><strong><a href="{@docRoot}guide/topics/connectivity/nfc/nfc.html">NFC Basics</a></strong></dt>
+ <dd>This document describes how Android handles discovered NFC tags and how it notifies
+applications of data that is relevant to the application. It also goes over how to work with the
+NDEF data in your applications and gives an overview of the framework APIs that support the basic
+NFC feature set of Android.</dd>
+
+ <dt><strong><a href="{@docRoot}guide/topics/connectivity/nfc/advanced-nfc.html">Advanced
+ NFC</a></strong></dt>
+ <dd>This document goes over the APIs that enable use of the various tag technologies that
+ Android supports. When you are not working with NDEF data, or when you are working with NDEF
+ data that Android cannot fully understand, you have to manually read or write to the tag in raw
+ bytes using your own protocol stack. In these cases, Android provides support to detect
+ certain tag technologies and to open communication with the tag using your own protocol
+ stack.</dd>
+ </dl>
+</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/connectivity/nfc/nfc.jd b/docs/html/guide/topics/connectivity/nfc/nfc.jd
new file mode 100644
index 0000000..51c7bee
--- /dev/null
+++ b/docs/html/guide/topics/connectivity/nfc/nfc.jd
@@ -0,0 +1,923 @@
+page.title=NFC Basics
+@jd:body
+
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#tag-dispatch">The Tag Dispatch System</a>
+ <ol>
+ <li><a href="#ndef">How NFC tags are mapped to MIME types and URIs</a></li>
+ <li><a href="#dispatching">How NFC Tags are Dispatched to Applications</a></li>
+ </ol>
+ </li>
+ <li><a href="#manifest">Requesting NFC Access in the Android Manifest</a></li>
+ <li><a href="#filtering-intents">Filtering for Intents</a>
+ <ol>
+ <li><a href="#ndef-disc">ACTION_NDEF_DISCOVERED</a></li>
+ <li><a href="#tech-disc">ACTION_TECH_DISCOVERED</a></li>
+ <li><a href="#tag-disc">ACTION_TAG_DISCOVERED</a></li>
+ <li><a href="#obtain-info">Obtaining information from intents</a></li>
+ </ol>
+ </li>
+ <li><a href="#creating-records">Creating Common Types of NDEF Records</a>
+ <ol>
+ <li><a href="#abs-uri">TNF_ABSOLUTE_URI</a></li>
+ <li><a href="#mime">TNF_MIME_MEDIA</a></li>
+ <li><a href="#well-known-text">TNF_WELL_KNOWN with RTD_TEXT</a></li>
+ <li><a href="#well-known-uri">TNF_WELL_KNOWN with RTD_URI</a></li>
+ <li><a href="#ext-type">TNF_EXTERNAL_TYPE</a></li>
+ <li><a href="#aar">Android Application Records</a></li>
+ </ol>
+ </li>
+ <li><a href="#p2p">Beaming NDEF Messages to Other Devices</a></li>
+ </ol>
+</div>
+</div>
+
+<p>This document describes the basic NFC tasks you perform in Android. It explains how to send and
+receive NFC data in the form of NDEF messages and describes the Android framework APIs that support
+these features. For more advanced topics, including a discussion of working with non-NDEF data,
+see <a href="{@docRoot}guide/topics/connectivity/nfc/advanced-nfc.html">Advanced NFC</a>.</p>
+
+
+<p>There are two major uses cases when working with NDEF data and Android:</p>
+
+<ul>
+ <li>Reading NDEF data from an NFC tag</li>
+ <li>Beaming NDEF messages from one device to another with <a href="#p2p">Android
+Beam™</a></li>
+</ul>
+
+
+<p>Reading NDEF data from an NFC tag is handled with the <a href="#tag-dispatch">tag dispatch
+system</a>, which analyzes discovered NFC tags, appropriately categorizes the data, and starts
+an application that is interested in the categorized data. An application that wants to handle the
+scanned NFC tag can <a href="#filtering-intents">declare an intent filter</a> and
+request to handle the data.</p>
+
+<p>The Android Beam™ feature allows a device to push an NDEF message onto
+another device by physically tapping the devices together. This interaction provides an easier way
+to send data than other wireless technologies like Bluetooth, because with NFC, no manual device
+discovery or pairing is required. The connection is automatically started when two devices come
+into range. Android Beam is available through a set of NFC APIs, so any application can transmit
+information between devices. For example, the Contacts, Browser, and YouTube applications use
+Android Beam to share contacts, web pages, and videos with other devices.
+</p>
+
+
+<h2 id="tag-dispatch">The Tag Dispatch System</h2>
+
+<p>Android-powered devices are usually looking for NFC tags when the screen
+is unlocked, unless NFC is disabled in the device's Settings menu.
+When an Android-powered device discovers an NFC tag, the desired behavior
+is to have the most appropriate activity handle the intent without asking the user what application
+to use. Because devices scan NFC tags at a very short range, it is likely that making users manually
+select an activity would force them to move the device away from the tag and break the connection.
+You should develop your activity to only handle the NFC tags that your activity cares about to
+prevent the Activity Chooser from appearing.</p>
+
+<p>To help you with this goal, Android provides a special tag dispatch system that analyzes scanned
+NFC tags, parses them, and tries to locate applications that are interested in the scanned data. It
+does this by:</p>
+
+<ol>
+ <li>Parsing the NFC tag and figuring out the MIME type or a URI that identifies the data payload
+ in the tag.</li>
+ <li>Encapsulating the MIME type or URI and the payload into an intent. These first two
+ steps are described in <a href="#ndef">How NFC tags are mapped to MIME types and URIs</a>.</li>
+ <li>Starts an activity based on the intent. This is described in
+ <a href="#dispatching">How NFC Tags are Dispatched to Applications</a>.</li>
+</ol>
+
+<h3 id="ndef">How NFC tags are mapped to MIME types and URIs</h3>
+<p>Before you begin writing your NFC applications, it is important to understand the different
+types of NFC tags, how the tag dispatch system parses NFC tags, and the special work that the tag
+dispatch system does when it detects an NDEF message. NFC tags come in a
+wide array of technologies and can also have data written to them in many different ways.
+Android has the most support for the NDEF standard, which is defined by the <a
+href="http://www.nfc-forum.org/home">NFC Forum</a>.
+</p>
+
+<p>NDEF data is encapsulated inside a message ({@link android.nfc.NdefMessage}) that contains one
+or more records ({@link android.nfc.NdefRecord}). Each NDEF record must be well-formed according to
+the specification of the type of record that you want to create. Android
+also supports other types of tags that do not contain NDEF data, which you can work with by using
+the classes in the {@link android.nfc.tech} package. To learn more
+about these technologies, see the <a href="{@docRoot}guide/topics/connectivity/nfc/advanced-nfc.html">Advanced
+NFC</a> topic. Working with these other types of tags involves
+writing your own protocol stack to communicate with the tags, so we recommend using NDEF when
+possible for ease of development and maximum support for Android-powered devices.
+</p>
+
+<p class="note"><strong>Note:</strong>
+To download complete NDEF specifications, go to the <a
+href="http://www.nfc-forum.org/specs/spec_license">NFC Forum Specification Download</a> site and see
+<a href="#creating-records">Creating common types of NDEF records</a> for examples of how to
+construct NDEF records. </p>
+
+<p>Now that you have some background in NFC tags, the following sections describe in more detail how
+Android handles NDEF formatted tags. When an Android-powered device scans an NFC tag containing NDEF
+formatted data, it parses the message and tries to figure out the data's MIME type or identifying
+URI. To do this, the system reads the first {@link android.nfc.NdefRecord} inside the {@link
+android.nfc.NdefMessage} to determine how to interpret the entire NDEF message (an NDEF message can
+have multiple NDEF records). In a well-formed NDEF message, the first {@link android.nfc.NdefRecord}
+contains the following fields:
+<dl>
+ <dt><strong>3-bit TNF (Type Name Format)</strong></dt>
+ <dd>Indicates how to interpret the variable length type field. Valid values are described in
+described in <a href="#table1">Table 1</a>.</dd>
+
+ <dt><strong>Variable length type</strong></dt>
+ <dd>Describes the type of the record. If using {@link android.nfc.NdefRecord#TNF_WELL_KNOWN}, use
+this field to specify the Record Type Definition (RTD). Valid RTD values are described in <a
+href="#table2">Table 2</a>.</dd>
+
+<dt><strong>Variable length ID</strong></dt>
+<dd>A unique identifier for the record. This field is not used often, but
+if you need to uniquely identify a tag, you can create an ID for it.</dd>
+
+<dt><strong>Variable length payload</strong></dt>
+<dd>The actual data payload that you want to read or write. An NDEF
+message can contain multiple NDEF records, so don't assume the full payload is in the first NDEF
+record of the NDEF message.</dd>
+
+</dl>
+
+<p>The tag dispatch system uses the TNF and type fields to try to map a MIME type or URI to the
+NDEF message. If successful, it encapsulates that information inside of a {@link
+android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} intent along with the actual payload. However, there
+are cases when the tag dispatch system cannot determine the type of data based on the first NDEF
+record. This happens when the NDEF data cannot be mapped to a MIME type or URI, or when the
+NFC tag does not contain NDEF data to begin with. In such cases, a {@link
+android.nfc.Tag} object that has information about the tag's technologies and the payload are
+encapsulated inside of a {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent instead.</p>
+
+<p>
+<a href="#table1">Table 1.</a> describes how the tag dispatch system maps TNF and type
+fields to MIME types or URIs. It also describes which TNFs cannot be mapped to a MIME type or URI.
+In these cases, the tag dispatch system falls back to
+{@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.
+
+<p>For example, if the tag dispatch system encounters a record of type {@link
+android.nfc.NdefRecord#TNF_ABSOLUTE_URI}, it maps the variable length type field of that record
+into a URI. The tag dispatch system encapsulates that URI in the data field of an {@link
+android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} intent along with other information about the tag,
+such as the payload. On the other hand, if it encounters a record of type {@link
+android.nfc.NdefRecord#TNF_UNKNOWN}, it creates an intent that encapsulates the tag's technologies
+instead.</p>
+
+
+<p class="table-caption" id="table1">
+ <strong>Table 1.</strong> Supported TNFs and their mappings</p>
+<table id="mappings">
+ <tr>
+ <th>Type Name Format (TNF)</th>
+ <th>Mapping</th>
+ </tr>
+ <tr>
+ <td>{@link android.nfc.NdefRecord#TNF_ABSOLUTE_URI}</td>
+ <td>URI based on the type field.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#TNF_EMPTY}</td>
+ <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#TNF_EXTERNAL_TYPE}</td>
+ <td>URI based on the URN in the type field. The URN is encoded into the NDEF type field in
+ a shortened form: <code><em><domain_name>:<service_name></em></code>.
+ Android maps this to a URI in the form:
+ <code>vnd.android.nfc://ext/<em><domain_name>:<service_name></em></code>.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#TNF_MIME_MEDIA}</td>
+ <td>MIME type based on the type field.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#TNF_UNCHANGED}</td>
+ <td>Invalid in the first record, so falls back to
+ {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#TNF_UNKNOWN}</td>
+ <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#TNF_WELL_KNOWN}</td>
+ <td>MIME type or URI depending on the Record Type Definition (RTD), which you set in the
+type field. See <a href="#well_known">Table 2.</a> for more information on
+available RTDs and their mappings.</td>
+ </tr>
+</table>
+
+<p class="table-caption" id="table2">
+ <strong>Table 2.</strong> Supported RTDs for TNF_WELL_KNOWN and their
+mappings</p>
+<table id="well-known">
+ <tr>
+ <th>Record Type Definition (RTD)</th>
+ <th>Mapping</th>
+ </tr>
+ <tr>
+ <td>{@link android.nfc.NdefRecord#RTD_ALTERNATIVE_CARRIER}</td>
+ <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#RTD_HANDOVER_CARRIER}</td>
+ <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#RTD_HANDOVER_REQUEST}</td>
+ <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#RTD_HANDOVER_SELECT}</td>
+ <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#RTD_SMART_POSTER}</td>
+ <td>URI based on parsing the payload.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#RTD_TEXT}</td>
+ <td>MIME type of <code>text/plain</code>.</td>
+ </tr>
+ <td>{@link android.nfc.NdefRecord#RTD_URI}</td>
+ <td>URI based on payload.</td>
+ </tr>
+</table>
+
+<h3 id="dispatching">How NFC Tags are Dispatched to Applications</h3>
+
+<p>When the tag dispatch system is done creating an intent that encapsulates the NFC tag and its
+identifying information, it sends the intent to an interested application that
+filters for the intent. If more than one application can handle the intent, the Activity Chooser
+is presented so the user can select the Activity. The tag dispatch system defines three intents,
+which are listed in order of highest to lowest priority:</p>
+
+<ol>
+ <li>
+ {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED}: This intent is used to start an
+Activity when a tag that contains an NDEF payload is scanned and is of a recognized type. This is
+the highest priority intent, and the tag dispatch system tries to start an Activity with this
+intent before any other intent, whenever possible.
+ </li>
+
+ <li>{@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}: If no activities register to
+handle the {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED}
+intent, the tag dispatch system tries to start an application with this intent. This
+intent is also directly started (without starting {@link
+android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} first) if the tag that is scanned
+contains NDEF data that cannot be mapped to a MIME type or URI, or if the tag does not contain NDEF
+data but is of a known tag technology.
+</li>
+
+ <li>{@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}: This intent is started
+ if no activities handle the {@link
+android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} or {@link
+android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}
+ intents.</li>
+ </ol>
+
+<p>The basic way the tag dispatch system works is as follows:</p>
+
+<ol>
+ <li>Try to start an Activity with the intent that was created by the tag dispatch system
+when parsing the NFC tag (either
+{@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} or {@link
+android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}).</li>
+ <li>If no activities filter for that intent, try to start an Activity with the next
+ lowest priority intent (either {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} or {@link
+android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}) until an application filters for the
+ intent or until the tag dispatch system tries all possible intents.</li>
+ <li>If no applications filter for any of the intents, do nothing.</li>
+</ol>
+
+<img src="{@docRoot}images/nfc_tag_dispatch.png" />
+
+<p class="figure"><strong>Figure 1. </strong> Tag Dispatch System</p>
+
+
+<p>Whenever possible, work with NDEF messages and the {@link
+android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} intent, because it is the most specific out of
+the three. This intent allows you to start your application at a more appropriate time than the
+other two intents, giving the user a better experience.</p>
+
+<h2 id="manifest">Requesting NFC Access in the Android Manifest</h2>
+
+ <p>Before you can access a device's NFC hardware and properly handle NFC intents, declare these
+ items in your <code>AndroidManifest.xml</code> file:</p>
+
+ <ul>
+ <li>The NFC <code><uses-permission></code> element to access the NFC hardware:
+ <pre>
+<uses-permission android:name="android.permission.NFC" />
+</pre>
+ </li>
+
+ <li>The minimum SDK version that your application can support. API level 9 only supports
+ limited tag dispatch via {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}, and only gives
+ access to NDEF messages via the {@link android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES} extra. No
+ other tag properties or I/O operations are accessible. API level 10
+ includes comprehensive reader/writer support as well as foreground NDEF pushing, and API level
+ 14 provides an easier way to push NDEF messages to other devices with Android Beam and extra
+ convenience methods to create NDEF records.
+<pre class="pretty-print">
+<uses-sdk android:minSdkVersion="10"/>
+</pre>
+ </li>
+
+ <li>The <code>uses-feature</code> element so that your application shows up in Google
+Play only for devices that have NFC hardware:
+ <pre>
+<uses-feature android:name="android.hardware.nfc" android:required="true" />
+</pre>
+<p>If your application uses NFC functionality, but that functionality is not crucial to your
+application, you can omit the <code>uses-feature</code> element and check for NFC avalailbility at
+runtime by checking to see if {@link android.nfc.NfcAdapter#getDefaultAdapter getDefaultAdapter()}
+is <code>null</code>.</p>
+ </li>
+ </ul>
+
+ <h2 id="filtering-intents">Filtering for NFC Intents</h2>
+
+ <p>To start your application when an NFC tag that you want to handle is scanned, your application
+can filter for one, two, or all three of the NFC intents in the Android manifest. However, you
+usually want to filter for the {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} intent for the
+most control of when your application starts. The {@link
+android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent is a fallback for {@link
+android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} when no applications filter for
+ {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} or for when the payload is not
+NDEF. Filtering for {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED} is usually too general of a
+category to filter on. Many applications will filter for {@link
+android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} or {@link
+android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} before {@link
+android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}, so your application has a low probability of
+starting. {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED} is only available as a last resort
+for applications to filter for in the cases where no other applications are installed to handle the
+{@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} or {@link
+android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}intent.</p>
+
+<p>Because NFC tag deployments vary and are many times not under your control, this is not always
+possible, which is why you can fallback to the other two intents when necessary. When you have
+control over the types of tags and data written, it is recommended that you use NDEF to format your
+tags. The following sections describe how to filter for each type of intent.</p>
+
+
+<h3 id="ndef-disc">ACTION_NDEF_DISCOVERED</h3>
+<p>
+To filter for {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} intents, declare the
+intent filter along with the type of data that you want to filter for. The
+following example filters for {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED}
+intents with a MIME type of <code>text/plain</code>:
+</p>
+<pre>
+<intent-filter>
+ <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
+ <category android:name="android.intent.category.DEFAULT"/>
+ <data android:mimeType="text/plain" />
+</intent-filter>
+</pre>
+<p>The following example filters for a URI in the form of
+<code>http://developer.android.com/index.html</code>.
+<pre>
+<intent-filter>
+ <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
+ <category android:name="android.intent.category.DEFAULT"/>
+ <data android:scheme="http"
+ android:host="developer.android.com"
+ android:pathPrefix="/index.html" />
+</intent-filter>
+</pre>
+
+
+ <h3 id="tech-disc">ACTION_TECH_DISCOVERED</h3>
+
+ <p>If your activity filters for the {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent,
+you must create an XML resource file that specifies the technologies that your activity supports
+within a <code>tech-list</code> set. Your activity is
+ considered a match if a <code>tech-list</code> set is a subset of the technologies that are
+ supported by the tag, which you can obtain by calling {@link android.nfc.Tag#getTechList
+ getTechList()}.</p>
+
+ <p>For example, if the tag that is scanned supports MifareClassic, NdefFormatable, and NfcA, your
+ <code>tech-list</code> set must specify all three, two, or one of the technologies (and nothing
+ else) in order for your activity to be matched.</p>
+
+ <p>The following sample defines all of the technologies. You can remove the ones that you do not
+ need. Save this file (you can name it anything you wish) in the
+ <code><project-root>/res/xml</code> folder.</p>
+ <pre>
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <tech-list>
+ <tech>android.nfc.tech.IsoDep</tech>
+ <tech>android.nfc.tech.NfcA</tech>
+ <tech>android.nfc.tech.NfcB</tech>
+ <tech>android.nfc.tech.NfcF</tech>
+ <tech>android.nfc.tech.NfcV</tech>
+ <tech>android.nfc.tech.Ndef</tech>
+ <tech>android.nfc.tech.NdefFormatable</tech>
+ <tech>android.nfc.tech.MifareClassic</tech>
+ <tech>android.nfc.tech.MifareUltralight</tech>
+ </tech-list>
+</resources>
+</pre>
+
+ <p>You can also specify multiple <code>tech-list</code> sets. Each of the <code>tech-list</code>
+ sets is considered independently, and your activity is considered a match if any single
+ <code>tech-list</code> set is a subset of the technologies that are returned by {@link
+ android.nfc.Tag#getTechList getTechList()}. This provides <code>AND</code> and <code>OR</code>
+ semantics for matching technologies. The following example matches tags that can support the
+ NfcA and Ndef technologies or can support the NfcB and Ndef technologies:</p>
+ <pre>
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <tech-list>
+ <tech>android.nfc.tech.NfcA</tech>
+ <tech>android.nfc.tech.Ndef</tech>
+ </tech-list>
+</resources>
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <tech-list>
+ <tech>android.nfc.tech.NfcB</tech>
+ <tech>android.nfc.tech.Ndef</tech>
+ </tech-list>
+</resources>
+</pre>
+
+ <p>In your <code>AndroidManifest.xml</code> file, specify the resource file that you just created
+ in the <code><meta-data></code> element inside the <code><activity></code>
+ element like in the following example:</p>
+ <pre>
+<activity>
+...
+<intent-filter>
+ <action android:name="android.nfc.action.TECH_DISCOVERED"/>
+</intent-filter>
+
+<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
+ android:resource="@xml/nfc_tech_filter" />
+...
+</activity>
+</pre>
+
+<p>For more information about working with tag technologies and the {@link
+android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent, see <a
+href="{@docRoot}guide/topics/connectivity/nfc/advanced-nfc.html#tag-tech">Working with Supported Tag
+Technologies</a> in the Advanced NFC document.</p>
+<h3 id="tag-disc">ACTION_TAG_DISCOVERED</h3>
+<p>To filter for {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED} use the following intent
+filter:</p>
+
+
+<pre><intent-filter>
+ <action android:name="android.nfc.action.TAG_DISCOVERED"/>
+</intent-filter>
+</pre>
+
+
+
+<h3 id="obtain-info">Obtaining information from intents</h3>
+
+<p>If an activity starts because of an NFC intent, you can obtain information about the scanned NFC
+tag from the intent. Intents can contain the following extras depending on the tag that was scanned:
+
+<ul>
+ <li>{@link android.nfc.NfcAdapter#EXTRA_TAG} (required): A {@link android.nfc.Tag} object
+representing the scanned tag.</li>
+ <li>{@link android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES} (optional): An array of NDEF messages
+parsed from the tag. This extra is mandatory on {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED
+intents.</li>
+ <li>{@link android.nfc.NfcAdapter#EXTRA_ID} (optional): The low-level ID of the tag.</li></ul>
+
+<p>To obtain these extras, check to see if your activity was launched with one of
+the NFC intents to ensure that a tag was scanned, and then obtain the extras out of the
+intent. The following example checks for the {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED}
+intent and gets the NDEF messages from an intent extra.</p>
+
+<pre>
+public void onResume() {
+ super.onResume();
+ ...
+ if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) {
+ Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
+ if (rawMsgs != null) {
+ msgs = new NdefMessage[rawMsgs.length];
+ for (int i = 0; i < rawMsgs.length; i++) {
+ msgs[i] = (NdefMessage) rawMsgs[i];
+ }
+ }
+ }
+ //process the msgs array
+}
+</pre>
+
+<p>Alternatively, you can obtain a {@link android.nfc.Tag} object from the intent, which will
+contain the payload and allow you to enumerate the tag's technologies:</p>
+
+<pre>Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);</pre>
+
+
+<h2 id="creating-records">Creating Common Types of NDEF Records</h2>
+<p>This section describes how to create common types of NDEF records to help you when writing to
+NFC tags or sending data with Android Beam. It also describes how to create the corresponding
+intent filter for the record. All of these NDEF record examples should be in the first NDEF
+record of the NDEF message that you are writing to a tag or beaming.</p>
+
+<h3 id="abs-uri">TNF_ABSOLUTE_URI</h3>
+<p>Given the following {@link android.nfc.NdefRecord#TNF_ABSOLUTE_URI} NDEF record, which is
+stored as the first record inside of an {@link android.nfc.NdefMessage}:</p>
+
+<pre>
+NdefRecord uriRecord = new NdefRecord(
+ NdefRecord.TNF_ABSOLUTE_URI ,
+ "http://developer.android.com/index.html".getBytes(Charset.forName("US-ASCII")),
+ new byte[0], new byte[0]);
+</pre>
+
+<p>the intent filter would look like this:</p>
+<pre>
+<intent-filter>
+ <action android:name="android.nfc.action.NDEF_DISCOVERED" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:scheme="http"
+ android:host="developer.android.com"
+ android:pathPrefix="/index.html" />
+</intent-filter>
+</pre>
+
+
+<h3 id="mime">TNF_MIME_MEDIA</h3>
+<p>Given the following {@link android.nfc.NdefRecord#TNF_MIME_MEDIA} NDEF record, which is stored as
+the first record inside
+of an {@link android.nfc.NdefMessage}:</p>
+<pre>
+NdefRecord mimeRecord = new NdefRecord(
+ NdefRecord.TNF_MIME_MEDIA ,
+ "application/com.example.android.beam".getBytes(Charset.forName("US-ASCII")),
+ new byte[0], "Beam me up, Android!".getBytes(Charset.forName("US-ASCII")));
+</pre>
+
+<p>the intent filter would look like this:</p>
+<pre>
+<intent-filter>
+ <action android:name="android.nfc.action.NDEF_DISCOVERED" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:mimeType="application/com.example.android.beam" />
+</intent-filter>
+</pre>
+
+
+<h3 id="well-known-text">TNF_WELL_KNOWN with RTD_TEXT</h3>
+
+<p>Given the following {@link android.nfc.NdefRecord#TNF_WELL_KNOWN} NDEF record, which is stored as
+the first record inside of an {@link android.nfc.NdefMessage}:</p>
+<pre>
+public NdefRecord createTextRecord(String payload, Locale locale, boolean encodeInUtf8) {
+ byte[] langBytes = locale.getLanguage().getBytes(Charset.forName("US-ASCII"));
+ Charset utfEncoding = encodeInUtf8 ? Charset.forName("UTF-8") : Charset.forName("UTF-16");
+ byte[] textBytes = payload.getBytes(utfEncoding);
+ int utfBit = encodeInUtf8 ? 0 : (1 << 7);
+ char status = (char) (utfBit + langBytes.length);
+ byte[] data = new byte[1 + langBytes.length + textBytes.length];
+ data[0] = (byte) status;
+ System.arraycopy(langBytes, 0, data, 1, langBytes.length);
+ System.arraycopy(textBytes, 0, data, 1 + langBytes.length, textBytes.length);
+ NdefRecord record = new NdefRecord(NdefRecord.TNF_WELL_KNOWN,
+ NdefRecord.RTD_TEXT, new byte[0], data);
+ return record;
+}
+</pre>
+
+<p>the intent filter would look like this:</p>
+<pre>
+<intent-filter>
+ <action android:name="android.nfc.action.NDEF_DISCOVERED" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:mimeType="text/plain" />
+</intent-filter>
+</pre>
+
+
+<h3 id="well-known-uri">TNF_WELL_KNOWN with RTD_URI</h3>
+
+<p>Given the following {@link android.nfc.NdefRecord#TNF_WELL_KNOWN} NDEF record, which is stored as
+the first record inside of an {@link android.nfc.NdefMessage}:</p>
+
+<pre>
+byte[] uriField = "example.com".getBytes(Charset.forName("US-ASCII"));
+byte[] payload = new byte[uriField.length + 1]; //add 1 for the URI Prefix
+byte payload[0] = 0x01; //prefixes http://www. to the URI
+System.arraycopy(uriField, 0, payload, 1, uriField.length); //appends URI to payload
+NdefRecord rtdUriRecord = new NdefRecord(
+ NdefRecord.TNF_WELL_KNOWN, NdefRecord.RTD_URI, new byte[0], payload);
+</pre>
+
+<p>the intent filter would look like this:</p>
+
+<pre>
+<intent-filter>
+ <action android:name="android.nfc.action.NDEF_DISCOVERED" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:scheme="http"
+ android:host="example.com"
+ android:pathPrefix="" />
+</intent-filter>
+</pre>
+
+<h3 id="ext-type">TNF_EXTERNAL_TYPE</h3>
+<p>Given the following {@link android.nfc.NdefRecord#TNF_EXTERNAL_TYPE} NDEF record, which is stored
+as the first record inside of an {@link android.nfc.NdefMessage}:</p>
+
+<pre>
+byte[] payload;
+...
+NdefRecord mimeRecord = new NdefRecord(
+ NdefRecord.TNF_EXTERNAL_TYPE, "example.com:externalType", new byte[0], payload);
+</pre>
+
+<p>the intent filter would look like this:</p>
+<pre>
+<intent-filter>
+ <action android:name="android.nfc.action.NDEF_DISCOVERED" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:scheme="vnd.android.nfc"
+ android:host="ext"
+ android:pathPrefix="/example.com:externalType"/>
+</intent-filter>
+</pre>
+
+
+<p>Use TNF_EXTERNAL_TYPE for more generic NFC tag deployments to better support both
+Android-powered and non-Android-powered devices.</p>
+
+<p class="note"><strong>Note</strong>: URNs for {@link
+android.nfc.NdefRecord#TNF_EXTERNAL_TYPE} have a canonical format of:
+<code>urn:nfc:ext:example.com:externalType</code>, however the NFC Forum RTD specification
+declares that the <code>urn:nfc:ext:</code> portion of the URN must be ommitted from the
+NDEF record. So all you need to provide is the domain (<code>example.com</code> in the example)
+and type (<code>externalType</code> in the example) separated by a colon.
+When dispatching TNF_EXTERNAL_TYPE, Android converts the <code>urn:nfc:ext:example.com:externalType</code> URN to a
+<code>vnd.android.nfc://ext/example.com:externalType</code> URI, which is what the intent filter in the example
+declares.</p>
+
+<h3 id="aar">Android Application Records</h3>
+
+<p>
+Introduced in Android 4.0 (API level 14), an Android Application Record (AAR) provides a stronger
+certainty that your application is started when an NFC tag is scanned. An AAR has the package name
+of an application embedded inside an NDEF record. You can add an AAR to any NDEF record of your NDEF message,
+because Android searches the entire NDEF message for AARs. If it finds an AAR, it starts the application based
+on the package name inside the AAR. If the application is not present on the device,
+Google Play is launched to download the application.</p>
+
+<p>AARs are useful if you want to prevent other applications from filtering for the same intent and
+potentially handling specific tags that you have deployed. AARs are only supported at the
+application level, because of the package name constraint, and not at the Activity level as with
+intent filtering. If you want to handle an intent at the Activity level, <a
+href="#filtering-intents">use intent filters</a>.
+</p>
+
+
+
+<p>If a tag contains an AAR, the tag dispatch system dispatches in the following manner:</p>
+<ol>
+ <li>Try to start an Activity using an intent filter as normal. If the Activity that matches
+the intent also matches the AAR, start the Activity.</li>
+ <li>If the Activity that filters for the intent does not match the
+AAR, if multiple Activities can handle the intent, or if no Activity handles the intent, start the
+application specified by the AAR.</li>
+ <li>If no application can start with the AAR, go to Google Play to download the
+application based on the AAR.</li>
+</ol>
+
+</p>
+
+<p class="note"><strong>Note:</strong> You can override AARs and the intent dispatch system with the <a
+href="{@docRoot}guide/topics/connectivity/nfc/advanced-nfc.html#foreground-dispatch">foreground dispatch
+system</a>, which allows a foreground activity to have priority when an NFC tag is discovered.
+With this method, the activity must be in the foreground to
+override AARs and the intent dispatch system.</p>
+
+<p>If you still want to filter for scanned tags that do not contain an AAR, you can declare
+intent filters as normal. This is useful if your application is interested in other tags
+that do not contain an AAR. For example, maybe you want to guarantee that your application handles
+proprietary tags that you deploy as well as general tags deployed by third parties. Keep in mind
+that AARs are specific to Android 4.0 devices or later, so when deploying tags, you most likely want
+to use a combination of AARs and MIME types/URIs to support the widest range of devices. In
+addition, when you deploy NFC tags, think about how you want to write your NFC tags to enable
+support for the most devices (Android-powered and other devices). You can do this by
+defining a relatively unique MIME type or URI to make it easier for applications to distinguish.
+</p>
+
+<p>Android provides a simple API to create an AAR,
+{@link android.nfc.NdefRecord#createApplicationRecord createApplicationRecord()}. All you need to
+do is embed the AAR anywhere in your {@link android.nfc.NdefMessage}. You do not want
+to use the first record of your {@link android.nfc.NdefMessage}, unless the AAR is the only
+record in the {@link android.nfc.NdefMessage}. This is because the Android
+system checks the first record of an {@link android.nfc.NdefMessage} to determine the MIME type or
+URI of the tag, which is used to create an intent for applications to filter. The following code
+shows you how to create an AAR:</p>
+
+<pre>
+NdefMessage msg = new NdefMessage(
+ new NdefRecord[] {
+ ...,
+ NdefRecord.createApplicationRecord("com.example.android.beam")}
+</pre>
+
+
+<h2 id="p2p">Beaming NDEF Messages to Other Devices</h2>
+
+<p>Android Beam allows simple peer-to-peer data exchange between two Android-powered devices. The
+application that wants to beam data to another device must be in the foreground and the device
+receiving the data must not be locked. When the beaming device comes in close enough contact with a
+receiving device, the beaming device displays the "Touch to Beam" UI. The user can then choose
+whether or not to beam the message to the receiving device.</p>
+
+<p class="note"><strong>Note:</strong> Foreground NDEF pushing was available at API level 10,
+which provides similar functionality to Android Beam. These APIs have since been deprecated, but
+are available to support older devices. See {@link android.nfc.NfcAdapter#enableForegroundNdefPush
+enableForegroundNdefPush()} for more information.</p>
+
+<p>You can enable Android Beam for your application by calling one of the two methods:</p>
+ <ul>
+ <li>{@link android.nfc.NfcAdapter#setNdefPushMessage setNdefPushMessage()}: Accepts an
+{@link android.nfc.NdefMessage} to set as the message to beam. Automatically beams the message
+when two devices are in close enough proximity.</li>
+ <li>{@link android.nfc.NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback()}:
+Accepts a callback that contains a
+{@link android.nfc.NfcAdapter.CreateNdefMessageCallback#createNdefMessage createNdefMessage()}
+which is called when a device is in range to beam data to. The callback lets you create
+the NDEF message only when necessary.</li>
+ </ul>
+
+<p>An activity can only push one NDEF message at a time, so {@link
+android.nfc.NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback()} takes precedence
+over {@link android.nfc.NfcAdapter#setNdefPushMessage setNdefPushMessage()} if both are set. To use
+Android Beam, the following general guidelines must be met:
+</p>
+
+ <ul>
+ <li>The activity that is beaming the data must be in the foreground. Both devices must have
+their screens unlocked.</li>
+
+ <li>You must encapsulate the data that you are beaming in an {@link android.nfc.NdefMessage}
+ object.</li>
+
+ <li>The NFC device that is receiving the beamed data must support the
+ <code>com.android.npp</code> NDEF push protocol or NFC Forum's SNEP (Simple NDEF Exchange
+Protocol). The <code>com.android.npp</code> protocol is required for devices on API level 9 (Android
+2.3) to API level 13 (Android 3.2). <code>com.android.npp</code> and SNEP are both required on
+API level 14 (Android 4.0) and later.</li>
+</li>
+ </ul>
+
+ <p class="note"><strong>Note:</strong> If your activity enables Android Beam and is
+in the foreground, the standard intent dispatch system is disabled. However, if your activity also
+enables <a href="{@docRoot}guide/topics/connectivity/nfc/advanced-nfc.html#foreground-dispatch">foreground
+dispatching</a>, then it can still scan tags that match the intent filters set in the foreground
+dispatching.</p>
+
+ <p>To enable Android Beam:</p>
+
+ <ol>
+ <li>Create an {@link android.nfc.NdefMessage} that contains the {@link android.nfc.NdefRecord}s
+that you want to push onto the other device.</li>
+
+ <li>Call {@link
+android.nfc.NfcAdapter#setNdefPushMessage setNdefPushMessage()} with a {@link
+android.nfc.NdefMessage} or call {@link
+android.nfc.NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback} passing in a {@link
+android.nfc.NfcAdapter.CreateNdefMessageCallback} object in the <code>onCreate()</code> method of
+your activity. These methods require at least one activity that you want to enable with Android
+Beam, along with an optional list of other activities to activate.
+
+<p>In general, you normally use {@link
+android.nfc.NfcAdapter#setNdefPushMessage setNdefPushMessage()} if your Activity only needs to
+push the same NDEF message at all times, when two devices are in range to communicate. You use
+{@link android.nfc.NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback} when your
+application cares about the current context of the application and wants to push an NDEF message
+depending on what the user is doing in your application.</p>
+ </li>
+ </ol>
+
+<p>The following sample shows how a simple activity calls {@link
+android.nfc.NfcAdapter.CreateNdefMessageCallback} in the <code>onCreate()</code> method of an
+activity (see <a href="{@docRoot}resources/samples/AndroidBeamDemo/index.html">AndroidBeamDemo</a>
+for the complete sample). This example also has methods to help you create a MIME record:</p>
+
+<pre id="code-example">
+package com.example.android.beam;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.nfc.NdefMessage;
+import android.nfc.NdefRecord;
+import android.nfc.NfcAdapter;
+import android.nfc.NfcAdapter.CreateNdefMessageCallback;
+import android.nfc.NfcEvent;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.widget.TextView;
+import android.widget.Toast;
+import java.nio.charset.Charset;
+
+
+public class Beam extends Activity implements CreateNdefMessageCallback {
+ NfcAdapter mNfcAdapter;
+ TextView textView;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+ TextView textView = (TextView) findViewById(R.id.textView);
+ // Check for available NFC Adapter
+ mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
+ if (mNfcAdapter == null) {
+ Toast.makeText(this, "NFC is not available", Toast.LENGTH_LONG).show();
+ finish();
+ return;
+ }
+ // Register callback
+ mNfcAdapter.setNdefPushMessageCallback(this, this);
+ }
+
+ @Override
+ public NdefMessage createNdefMessage(NfcEvent event) {
+ String text = ("Beam me up, Android!\n\n" +
+ "Beam Time: " + System.currentTimeMillis());
+ NdefMessage msg = new NdefMessage(
+ new NdefRecord[] { createMimeRecord(
+ "application/com.example.android.beam", text.getBytes())
+ /**
+ * The Android Application Record (AAR) is commented out. When a device
+ * receives a push with an AAR in it, the application specified in the AAR
+ * is guaranteed to run. The AAR overrides the tag dispatch system.
+ * You can add it back in to guarantee that this
+ * activity starts when receiving a beamed message. For now, this code
+ * uses the tag dispatch system.
+ */
+ //,NdefRecord.createApplicationRecord("com.example.android.beam")
+ });
+ return msg;
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ // Check to see that the Activity started due to an Android Beam
+ if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) {
+ processIntent(getIntent());
+ }
+ }
+
+ @Override
+ public void onNewIntent(Intent intent) {
+ // onResume gets called after this to handle the intent
+ setIntent(intent);
+ }
+
+ /**
+ * Parses the NDEF Message from the intent and prints to the TextView
+ */
+ void processIntent(Intent intent) {
+ textView = (TextView) findViewById(R.id.textView);
+ Parcelable[] rawMsgs = intent.getParcelableArrayExtra(
+ NfcAdapter.EXTRA_NDEF_MESSAGES);
+ // only one message sent during the beam
+ NdefMessage msg = (NdefMessage) rawMsgs[0];
+ // record 0 contains the MIME type, record 1 is the AAR, if present
+ textView.setText(new String(msg.getRecords()[0].getPayload()));
+ }
+
+ /**
+ * Creates a custom MIME type encapsulated in an NDEF record
+ */
+ public NdefRecord createMimeRecord(String mimeType, byte[] payload) {
+ byte[] mimeBytes = mimeType.getBytes(Charset.forName("US-ASCII"));
+ NdefRecord mimeRecord = new NdefRecord(
+ NdefRecord.TNF_MIME_MEDIA, mimeBytes, new byte[0], payload);
+ return mimeRecord;
+ }
+}
+</pre>
+
+<p>Note that this code comments out an AAR, which you can remove. If you enable the AAR, the
+application specified in the AAR always receives the Android Beam message. If the application is not
+present, Google Play launches to download the application. Therefore, the following intent
+filter is not technically necessary for Android 4.0 devices or later if the AAR is used:
+</p>
+
+<pre>
+<intent-filter>
+ <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
+ <category android:name="android.intent.category.DEFAULT"/>
+ <data android:mimeType="application/com.example.android.beam"/>
+</intent-filter>
+</pre>
+<p>With this intent filter, the <code>com.example.android.beam</code> application now can be started
+when it scans an NFC tag or receives an Android Beam with an AAR of
+type <code>com.example.android.beam</code>, or when an NDEF formatted message contains a MIME record
+of type <code>application/com.example.android.beam</code>.</p>
+
+<p>Even though AARs guarantee an application is started or downloaded, intent filters are
+recommended, because they let you start an Activity of your choice in your
+application instead of always starting the main Activity within the package specified by an AAR.
+AARs do not have Activity level granularity. Also, because some Android-powered devices do not
+support AARs, you should also embed identifying information in the first NDEF record of your NDEF
+messages and filter for that as well, just in case. See <a href="#creating-records">Creating Common
+Types of NDEF records</a> for more information on how to create records.
+</p>
diff --git a/docs/html/guide/topics/connectivity/sip.jd b/docs/html/guide/topics/connectivity/sip.jd
new file mode 100644
index 0000000..a5f0e2e
--- /dev/null
+++ b/docs/html/guide/topics/connectivity/sip.jd
@@ -0,0 +1,490 @@
+page.title=Session Initiation Protocol
+@jd:body
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+
+ <li><a href="#requirements">Requirements and Limitations</a></li>
+ <li><a href="#classes">Classes and Interfaces</a></li>
+ <li><a href="#manifest">Creating the Manifest</a></li>
+ <li><a href="#manager">Creating a SIP Manager</a></li>
+ <li><a href="#profiles">Registering with a SIP Server</a></li>
+ <li><a href="#audio">Making an Audio Call</a></li>
+ <li><a href="#receiving">Receiving Calls</a></li>
+ <li><a href="#testing">Testing SIP Applications</a></li>
+ </ol>
+
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.net.sip.SipManager}</li>
+ <li>{@link android.net.sip.SipProfile}</li>
+ <li>{@link android.net.sip.SipAudioCall}</li>
+
+ </ol>
+
+ <h2>Related samples</h2>
+ <ol>
+ <li> <a href="{@docRoot}resources/samples/SipDemo/index.html"> SipDemo</a></li>
+ </ol>
+ </div>
+</div>
+
+<p>Android provides an API that supports the Session Initiation Protocol (SIP).
+This lets you add SIP-based internet telephony features to your applications.
+Android includes a full SIP protocol stack and integrated call management
+services that let applications easily set up outgoing and incoming voice calls,
+without having to manage sessions, transport-level communication, or audio
+record or playback directly.</p>
+
+<p>Here are examples of the types of applications that might use the SIP API:</p>
+<ul>
+ <li>Video conferencing.</li>
+ <li>Instant messaging.</li>
+</ul>
+<h2 id="requirements">Requirements and Limitations</h2>
+<p>Here are the requirements for developing a SIP application:</p>
+<ul>
+
+ <li>You must have a mobile device that is running Android 2.3 or higher. </li>
+
+ <li>SIP runs over a wireless data connection, so your device must have a data
+connection (with a mobile data service or Wi-Fi)</span>. This means that you
+can't test on AVD—you can only test on a physical device. For details, see
+<a href="#testing">Testing SIP Applications</a>.</li>
+
+ <li>Each participant in the application's communication session must have a
+SIP account. There are many different SIP providers that offer SIP accounts.</li>
+</ul>
+
+
+<h2 id="classes">SIP API Classes and Interfaces</h2>
+
+<p>Here is a summary of the classes and one interface
+(<code>SipRegistrationListener</code>) that are included in the Android SIP
+API:</p>
+
+<table>
+ <thead>
+ <tr>
+ <th>Class/Interface</th>
+ <th>Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{@link android.net.sip.SipAudioCall}</td>
+ <td>Handles an Internet audio call over SIP.</td>
+ </tr>
+ <tr>
+ <td>{@link android.net.sip.SipAudioCall.Listener}</td>
+ <td>Listener for events relating to a SIP call, such as when a call is being
+received ("on ringing") or a call is outgoing ("on calling").</td>
+ </tr>
+ <tr>
+ <td>{@link android.net.sip.SipErrorCode}</td>
+ <td>Defines error codes returned during SIP actions.</td>
+ </tr>
+ <tr>
+ <td>{@link android.net.sip.SipManager}</td>
+ <td>Provides APIs for SIP tasks, such as initiating SIP connections, and provides access
+to related SIP services.</td>
+ </tr>
+ <tr>
+ <td>{@link android.net.sip.SipProfile}</td>
+ <td>Defines a SIP profile, including a SIP account, domain and server information.
+</td>
+ </tr>
+ <tr>
+ <td>{@link android.net.sip.SipProfile.Builder}</td>
+ <td>Helper class for creating a SipProfile.</td>
+ </tr>
+ <tr>
+ <td>{@link android.net.sip.SipSession}</td>
+ <td>Represents a SIP session that is associated with a SIP dialog or a standalone transaction
+not within a dialog.</td>
+ </tr>
+ <tr>
+ <td>{@link android.net.sip.SipSession.Listener}</td>
+ <td>Listener for events relating to a SIP session, such as when a session is being registered
+("on registering") or a call is outgoing ("on calling"). </td>
+ </tr>
+ <tr>
+ <td>{@link android.net.sip.SipSession.State}</td>
+ <td>Defines SIP session states, such as "registering", "outgoing call", and "in call". </td>
+ </tr>
+ <tr>
+ <td>{@link android.net.sip.SipRegistrationListener}</td>
+ <td>An interface that is a listener for SIP registration events.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="manifest">Creating the Manifest</h2>
+
+<p>If you are developing an application that uses the SIP API, remember that the
+feature is supported only on Android 2.3 (API level 9) and higher versions of
+the platform. Also, among devices running Android 2.3 (API level 9) or higher,
+not all devices will offer SIP support.</p>
+
+<p>To use SIP, add the following permissions to your application's manifest:</p>
+<ul>
+ <li><code>android.permission.USE_SIP</code></li>
+ <li><code>android.permission.INTERNET</code></li>
+</ul>
+
+<p> To ensure that your application can only be installed on devices that are
+capable of supporting SIP, add the following to your application's
+manifest:</p>
+
+<ul>
+ <li><code><uses-sdk android:minSdkVersion="9" /></code>. This
+ indicates that your application requires Android 2.3 or higher. For more
+information, see <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API
+Levels</a> and the documentation for the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a
+> element.</li>
+</ul>
+
+<p>To control how your application is filtered from devices that do not support
+SIP (for example, on Google Play), add the following to your application's
+manifest:</p>
+
+<ul>
+
+ <li><code><uses-feature android:name="android.hardware.sip.voip"
+/></code>. This states that your application uses the SIP API. The
+declaration should include an <code>android:required</code> attribute that
+indicates whether you want the application to be filtered from devices that do
+not offer SIP support. Other <code><uses-feature></code> declarations
+may also be needed, depending on your implementation. For more information,
+see the documentation for the <a
+href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-
+feature></a> element.</li>
+
+</ul>
+<p>If your application is designed to receive calls, you must also define a receiver ({@link android.content.BroadcastReceiver} subclass) in the application's manifest: </p>
+
+<ul>
+ <li><code><receiver android:name=".IncomingCallReceiver" android:label="Call Receiver"/></code></li>
+</ul>
+<p>Here are excerpts from the <strong>SipDemo</strong> manifest:</p>
+
+
+
+<pre><?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.sip">
+ ...
+ <receiver android:name=".IncomingCallReceiver" android:label="Call Receiver"/>
+ ...
+ <uses-sdk android:minSdkVersion="9" />
+ <uses-permission android:name="android.permission.USE_SIP" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ ...
+ <uses-feature android:name="android.hardware.sip.voip" android:required="true" />
+ <uses-feature android:name="android.hardware.wifi" android:required="true" />
+ <uses-feature android:name="android.hardware.microphone" android:required="true" />
+</manifest>
+</pre>
+
+
+<h2 id="manager">Creating a SipManager</h2>
+
+<p>To use the SIP API, your application must create a {@link
+android.net.sip.SipManager} object. The {@link android.net.sip.SipManager} takes
+care of the following in your application:</p>
+
+<ul>
+ <li>Initiating SIP sessions.</li>
+ <li>Initiating and receiving calls.</li>
+ <li>Registering and unregistering with a SIP provider.</li>
+ <li>Verifying session connectivity.</li>
+</ul>
+<p>You instantiate a new {@link android.net.sip.SipManager} as follows:</p>
+<pre>public SipManager mSipManager = null;
+...
+if(mSipManager == null) {
+ mSipManager = SipManager.newInstance(this);
+}</pre>
+<h2 id="profiles">Registering with a SIP Server</h2>
+
+<p>A typical Android SIP application involves one or more users, each of whom
+has a SIP account. In an Android SIP application, each SIP account is
+represented by a {@link android.net.sip.SipProfile} object.</p>
+
+<p>A {@link android.net.sip.SipProfile} defines a SIP profile, including a SIP
+account, and domain and server information. The profile associated with the SIP
+account on the device running the application is called the <em>local
+profile</em>. The profile that the session is connected to is called the
+<em>peer profile</em>. When your SIP application logs into the SIP server with
+the local {@link android.net.sip.SipProfile}, this effectively registers the
+device as the location to send SIP calls to for your SIP address.</p>
+
+<p>This section shows how to create a {@link android.net.sip.SipProfile},
+register it with a SIP server, and track registration events.</p>
+
+<p>You create a {@link android.net.sip.SipProfile} object as follows:</p>
+<pre>
+public SipProfile mSipProfile = null;
+...
+
+SipProfile.Builder builder = new SipProfile.Builder(username, domain);
+builder.setPassword(password);
+mSipProfile = builder.build();</pre>
+
+<p>The following code excerpt opens the local profile for making calls and/or
+receiving generic SIP calls. The caller can make subsequent calls through
+<code>mSipManager.makeAudioCall</code>. This excerpt also sets the action
+<code>android.SipDemo.INCOMING_CALL</code>, which will be used by an intent
+filter when the device receives a call (see <a href="#intent_filter">Setting up
+an intent filter to receive calls</a>). This is the registration step:</p>
+
+<pre>Intent intent = new Intent();
+intent.setAction("android.SipDemo.INCOMING_CALL");
+PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, Intent.FILL_IN_DATA);
+mSipManager.open(mSipProfile, pendingIntent, null);</pre>
+
+<p>Finally, this code sets a <code>SipRegistrationListener</code> on the {@link
+android.net.sip.SipManager}. This tracks whether the {@link
+android.net.sip.SipProfile} was successfully registered with your SIP service
+provider:<br>
+</p>
+
+<pre>mSipManager.setRegistrationListener(mSipProfile.getUriString(), new SipRegistrationListener() {
+
+public void onRegistering(String localProfileUri) {
+ updateStatus("Registering with SIP Server...");
+}
+
+public void onRegistrationDone(String localProfileUri, long expiryTime) {
+ updateStatus("Ready");
+}
+
+public void onRegistrationFailed(String localProfileUri, int errorCode,
+ String errorMessage) {
+ updateStatus("Registration failed. Please check settings.");
+}</pre>
+
+
+<p>When your application is done using a profile, it should close it to free
+associated objects into memory and unregister the device from the server. For
+example:</p>
+
+<pre>public void closeLocalProfile() {
+ if (mSipManager == null) {
+ return;
+ }
+ try {
+ if (mSipProfile != null) {
+ mSipManager.close(mSipProfile.getUriString());
+ }
+ } catch (Exception ee) {
+ Log.d("WalkieTalkieActivity/onDestroy", "Failed to close local profile.", ee);
+ }
+}</pre>
+
+<h2 id="audio">Making an Audio Call</h2>
+<p>To make an audio call, you must have the following in place:</p>
+<ul>
+
+ <li>A {@link android.net.sip.SipProfile} that is making the call (the
+"local profile"), and a valid SIP address to receive the call (the
+"peer profile").
+
+ <li>A {@link android.net.sip.SipManager} object. </li>
+</ul>
+
+<p>To make an audio call, you should set up a {@link
+android.net.sip.SipAudioCall.Listener}. Much of the client's interaction with
+the SIP stack happens through listeners. In this snippet, you see how the {@link
+android.net.sip.SipAudioCall.Listener} sets things up after the call is
+established:</p>
+
+<pre>
+SipAudioCall.Listener listener = new SipAudioCall.Listener() {
+
+ @Override
+ public void onCallEstablished(SipAudioCall call) {
+ call.startAudio();
+ call.setSpeakerMode(true);
+ call.toggleMute();
+ ...
+ }
+
+ @Override
+ public void onCallEnded(SipAudioCall call) {
+ // Do something.
+ }
+};</pre>
+
+<p>Once you've set up the {@link android.net.sip.SipAudioCall.Listener}, you can
+make the call. The {@link android.net.sip.SipManager} method
+<code>makeAudioCall</code> takes the following parameters:</p>
+
+<ul>
+ <li>A local SIP profile (the caller).</li>
+ <li>A peer SIP profile (the user being called).</li>
+
+ <li>A {@link android.net.sip.SipAudioCall.Listener} to listen to the call
+events from {@link android.net.sip.SipAudioCall}. This can be <code>null</code>,
+but as shown above, the listener is used to set things up once the call is
+established.</li>
+
+ <li>The timeout value, in seconds.</li>
+</ul>
+<p>For example:</p>
+<pre> call = mSipManager.makeAudioCall(mSipProfile.getUriString(), sipAddress, listener, 30);</pre>
+
+<h2 id="receiving">Receiving Calls</h2>
+
+<p>To receive calls, a SIP application must include a subclass of {@link
+android.content.BroadcastReceiver} that has the ability to respond to an intent
+indicating that there is an incoming call. Thus, you must do the following in
+your application:</p>
+
+<ul>
+ <li>In <code>AndroidManifest.xml</code>, declare a
+<code><receiver></code>. In <strong>SipDemo</strong>, this is
+<code><receiver android:name=".IncomingCallReceiver"
+android:label="Call Receiver"/></code>.</li>
+
+ <li>Implement the receiver, which is a subclass of {@link
+android.content.BroadcastReceiver}. In <strong>SipDemo</strong>, this is
+<code>IncomingCallReceiver</code>.</li>
+
+ <li>Initialize the local profile ({@link android.net.sip.SipProfile}) with a
+pending intent that fires your receiver when someone calls the local profile.
+</li>
+
+ <li>Set up an intent filter that filters by the action that represents an
+incoming call. In <strong>SipDemo</strong>, this action is
+<code>android.SipDemo.INCOMING_CALL</code>. </li>
+</ul>
+<h4 id="BroadcastReceiver">Subclassing BroadcastReceiver</h4>
+
+<p>To receive calls, your SIP application must subclass {@link
+android.content.BroadcastReceiver}. <span id="internal-source-marker_0.">The
+Android system handles incoming SIP calls and broadcasts an "incoming
+call"<code></code> intent (as defined by the application) when it receives
+a call.</span> Here is the subclassed {@link android.content.BroadcastReceiver}
+code from <strong>SipDemo</strong>. To see the full example, go to <a
+href="{@docRoot}resources/samples/SipDemo/index.html">SipDemo sample</a>, which
+is included in the SDK samples. For information on downloading and installing
+the SDK samples, see <a
+href="{@docRoot}resources/samples/get.html">
+Getting the Samples</a>. </p>
+
+<pre>/*** Listens for incoming SIP calls, intercepts and hands them off to WalkieTalkieActivity.
+ */
+public class IncomingCallReceiver extends BroadcastReceiver {
+ /**
+ * Processes the incoming call, answers it, and hands it over to the
+ * WalkieTalkieActivity.
+ * @param context The context under which the receiver is running.
+ * @param intent The intent being received.
+ */
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ SipAudioCall incomingCall = null;
+ try {
+ SipAudioCall.Listener listener = new SipAudioCall.Listener() {
+ @Override
+ public void onRinging(SipAudioCall call, SipProfile caller) {
+ try {
+ call.answerCall(30);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ };
+ WalkieTalkieActivity wtActivity = (WalkieTalkieActivity) context;
+ incomingCall = wtActivity.mSipManager.takeAudioCall(intent, listener);
+ incomingCall.answerCall(30);
+ incomingCall.startAudio();
+ incomingCall.setSpeakerMode(true);
+ if(incomingCall.isMuted()) {
+ incomingCall.toggleMute();
+ }
+ wtActivity.call = incomingCall;
+ wtActivity.updateStatus(incomingCall);
+ } catch (Exception e) {
+ if (incomingCall != null) {
+ incomingCall.close();
+ }
+ }
+ }
+}
+</pre>
+
+<h4 id="intent_filter">Setting up an intent filter to receive calls</h4>
+
+<p>When the SIP service receives a new call, it sends out an intent with the
+action string provided by the application. In SipDemo, this action string is
+<code>android.SipDemo.INCOMING_CALL</code>. </p>
+<p>This code excerpt from <strong>SipDemo</strong> shows how the {@link
+android.net.sip.SipProfile} object gets created with a pending intent based on
+the action string <code>android.SipDemo.INCOMING_CALL</code>. The
+<code>PendingIntent</code> object will perform a broadcast when the {@link
+android.net.sip.SipProfile} receives a call:</p>
+
+<pre>
+public SipManager mSipManager = null;
+public SipProfile mSipProfile = null;
+...
+
+Intent intent = new Intent();
+intent.setAction("android.SipDemo.INCOMING_CALL");
+PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, Intent.FILL_IN_DATA);
+mSipManager.open(mSipProfile, pendingIntent, null);</pre>
+
+<p>The broadcast will be intercepted by the intent filter, which will then fire
+the receiver (<code>IncomingCallReceiver</code>). You can specify an intent
+filter in your application's manifest file, or do it in code as in the <strong>SipDemo</strong>
+sample application's <code>onCreate()</code> method
+of the application's <code>Activity</code>:</p>
+
+<pre>
+public class WalkieTalkieActivity extends Activity implements View.OnTouchListener {
+...
+ public IncomingCallReceiver callReceiver;
+ ...
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+
+ IntentFilter filter = new IntentFilter();
+ filter.addAction("android.SipDemo.INCOMING_CALL");
+ callReceiver = new IncomingCallReceiver();
+ this.registerReceiver(callReceiver, filter);
+ ...
+ }
+ ...
+}
+</pre>
+
+
+<h2 id="testing">Testing SIP Applications</h2>
+
+<p>To test SIP applications, you need the following:</p>
+<ul>
+<li>A mobile device that is running Android 2.3 or higher. SIP runs over
+wireless, so you must test on an actual device. Testing on AVD won't work.</li>
+<li>A SIP account. There are many different SIP providers that offer SIP accounts.</li>
+<li>If you are placing a call, it must also be to a valid SIP account. </li>
+</ul>
+<p>To test a SIP application:</p>
+<ol>
+
+<li>On your device, connect to wireless (<strong>Settings > Wireless & networks
+> Wi-Fi > Wi-Fi settings</strong>)</li>
+<li>Set up your mobile device for testing, as described in <a
+href="{@docRoot}tools/device.html">Developing on a Device</a>.</li>
+<li>Run your application on your mobile device, as described in <a
+href="{@docRoot}tools/device.html">Developing on a Device</a>.</li>
+
+<li>If you are using Eclipse, you can view the application log output in Eclipse
+using LogCat (<strong>Window > Show View > Other > Android >
+LogCat</strong>).</li>
+</ol>
+
diff --git a/docs/html/guide/topics/connectivity/usb/accessory.jd b/docs/html/guide/topics/connectivity/usb/accessory.jd
new file mode 100644
index 0000000..a217767
--- /dev/null
+++ b/docs/html/guide/topics/connectivity/usb/accessory.jd
@@ -0,0 +1,462 @@
+page.title=USB Accessory
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li>
+ <a href="#choosing">Choosing the Right USB Accessory APIs</a>
+
+ <ol>
+ <li><a href="#installing">Installing the Google APIs add-on library</a></li>
+ </ol>
+ </li>
+
+ <li>
+ <a href="#api">API Overview</a>
+
+ <ol>
+ <li><a href="#usage">Usage differences between the add-on library and the platform
+ APIs</a></li>
+ </ol>
+ </li>
+
+ <li><a href="#manifest">Android Manifest Requirements</a></li>
+
+ <li>
+ <a href="#working-a">Working with accessories</a>
+
+ <ol>
+ <li><a href="#discovering-a">Discovering an accessory</a></li>
+
+ <li><a href="#permission-a">Obtaining permission to communicate with an
+ accessory</a></li>
+
+ <li><a href="#communicating-a">Communicating with an accessory</a></li>
+
+ <li><a href="#terminating-a">Terminating communication with an accessory</a></li>
+ </ol>
+ </li>
+ </ol>
+
+ <h2>See also</h2>
+
+ <ol>
+ <li><a href="http://accessories.android.com/demokit">Android USB Accessory Development
+ Kit</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>USB accessory mode allows users to connect
+ USB host hardware specifically designed for Android-powered devices. The accessories must adhere
+ to the Android accessory protocol outlined in the <a href=
+ "http://accessories.android.com/demokit">Android Accessory Development Kit</a> documentation.
+ This allows Android-powered devices that cannot act as a USB host to still interact with USB
+ hardware. When an Android-powered device is in USB accessory mode, the attached Android USB
+ accessory acts as the host, provides power to the USB bus, and enumerates connected devices.
+ Android 3.1 (API level 12) supports USB accessory mode and the feature is also backported to
+ Android 2.3.4 (API level 10) to enable support for a broader range of devices.</p>
+
+ <h2 id="choosing">Choosing the Right USB Accessory APIs</h2>
+
+ <p>Although the USB accessory APIs were introduced to the platform in Android 3.1, they are also
+ available in Android 2.3.4 using the Google APIs add-on library. Because these APIs were
+ backported using an external library, there are two packages that you can import to support USB
+ accessory mode. Depending on what Android-powered devices you want to support, you might have to
+ use one over the other:</p>
+
+ <ul>
+ <li><code>com.android.future.usb</code>: To support USB accessory mode in Android 2.3.4, the
+ <a href="http://code.google.com/android/add-ons/google-apis/index.html">Google APIs add-on
+ library</a> includes the backported USB accessory APIs and they are contained in this
+ namespace. Android 3.1 also supports importing and calling the classes within this namespace to
+ support applications written with the add-on library. This add-on library is a thin wrapper
+ around the {@link android.hardware.usb} accessory APIs and does not support USB host mode. If
+ you want to support the widest range of devices that support USB accessory mode, use the add-on
+ library and import this package. It is important to note that not all Android 2.3.4 devices are
+ required to support the USB accessory feature. Each individual device manufacturer decides
+ whether or not to support this capability, which is why you must declare it in your manifest
+ file.</li>
+
+ <li>{@link android.hardware.usb}: This namespace contains the classes that support USB
+ accessory mode in Android 3.1. This package is included as part of the framework APIs, so
+ Android 3.1 supports USB accessory mode without the use of an add-on library. Use this package
+ if you only care about Android 3.1 or newer devices that have hardware support for USB
+ accessory mode, which you can declare in your manifest file.</li>
+ </ul>
+
+ <h3 id="installing">Installing the Google APIs add-on library</h3>
+
+ <p>If you want to install the add-on, you can do so by installing the Google APIs Android API 10
+ package with the SDK Manager. See <a href=
+ "http://code.google.com/android/add-ons/google-apis/installing.html">Installing the Google APIs
+ Add-on</a> for more information on installing the add-on library.</p>
+
+ <h2 id="api">API Overview</h2>
+
+ <p>Because the add-on library is a wrapper for the framework APIs, the classes that support the
+ USB accessory feature are similar. You can use the reference documentation for the {@link
+ android.hardware.usb} even if you are using the add-on library.</p>
+
+ <p class="note"><strong>Note:</strong> There is, however, a minor <a href="#usage">usage
+ difference</a> between the add-on library and framework APIs that you should be aware of.</p>
+
+ <p>The following table describes the classes that support the USB accessory APIs:</p>
+
+ <table>
+ <tr>
+ <th>Class</th>
+
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>{@link android.hardware.usb.UsbManager}</td>
+
+ <td>Allows you to enumerate and communicate with connected USB accessories.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.hardware.usb.UsbAccessory}</td>
+
+ <td>Represents a USB accessory and contains methods to access its identifying
+ information.</td>
+ </tr>
+ </table>
+
+ <h3 id="usage">Usage differences between the add-on library and platform APIs</h3>
+
+ <p>There are two usage differences between using the Google APIs add-on library and the platform
+ APIs.</p>
+
+ <p>If you are using the add-on library, you must obtain the {@link
+ android.hardware.usb.UsbManager} object in the following manner:</p>
+ <pre>
+UsbManager manager = UsbManager.getInstance(this);
+</pre>
+
+ <p>If you are not using the add-on library, you must obtain the {@link
+ android.hardware.usb.UsbManager} object in the following manner:</p>
+ <pre>
+UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
+</pre>
+
+ <p>When you filter for a connected accessory with an intent filter, the {@link
+ android.hardware.usb.UsbAccessory} object is contained inside the intent that is passed to your
+ application. If you are using the add-on library, you must obtain the {@link
+ android.hardware.usb.UsbAccessory} object in the following manner:</p>
+ <pre>
+UsbAccessory accessory = UsbManager.getAccessory(intent);
+</pre>
+
+ <p>If you are not using the add-on library, you must obtain the {@link
+ android.hardware.usb.UsbAccessory} object in the following manner:</p>
+ <pre>
+UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
+</pre>
+
+ <h2 id="manifest">Android Manifest requirements</h2>
+
+ <p>The following list describes what you need to add to your application's manifest file before
+ working with the USB accesory APIs. The <a href="#manifest-example">manifest and resource file
+ examples</a> show how to declare these items:</p>
+
+ <ul>
+ <li>Because not all Android-powered devices are guaranteed to support the USB accessory APIs,
+ include a <code><uses-feature></code> element that declares that your application uses
+ the <code>android.hardware.usb.accessory</code> feature.</li>
+
+ <li>If you are using the
+ <a href="http://code.google.com/android/add-ons/google-apis/index.html">add-on library</a>,
+ add the <code><uses-library></code> element specifying
+ <code>com.android.future.usb.accessory</code> for the library.</li>
+
+ <li>Set the minimum SDK of the application to API Level 10 if you are using the add-on library
+ or 12 if you are using the {@link android.hardware.usb} package.</li>
+
+ <li>
+ <p>If you want your application to be notified of an attached USB accessory, specify an
+ <code><intent-filter></code> and <code><meta-data></code> element pair for the
+ <code>android.hardware.usb.action.USB_ACCESSORY_ATTACHED</code> intent in your main activity.
+ The <code><meta-data></code> element points to an external XML resource file that
+ declares identifying information about the accessory that you want to detect.</p>
+
+ <p>In the XML resource file, declare <code><usb-accessory></code> elements for the
+ accessories that you want to filter. Each <code><usb-accessory></code> can have the
+ following attributes:</p>
+
+ <ul>
+ <li><code>manufacturer</code></li>
+
+ <li><code>model</code></li>
+
+ <li><code>version</code></li>
+ </ul>
+
+ <p>Save the resource file in the <code>res/xml/</code> directory. The resource file name
+ (without the .xml extension) must be the same as the one you specified in the
+ <code><meta-data></code> element. The format for the XML resource file is also shown in
+ the <a href="#example">example</a> below.</p>
+ </li>
+ </ul>
+
+ <h3 id="manifest-example">Manifest and resource file examples</h3>
+
+ <p>The following example shows a sample manifest and its corresponding resource file:</p>
+ <pre>
+<manifest ...>
+ <uses-feature android:name="android.hardware.usb.accessory" />
+ <!-- version must be either 10 or 12 -->
+ <uses-sdk android:minSdkVersion="<<em>version</em>>" />
+ ...
+ <application>
+ <uses-library android:name="com.android.future.usb.accessory" />
+ <activity ...>
+ ...
+ <intent-filter>
+ <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
+ </intent-filter>
+
+ <meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
+ android:resource="@xml/accessory_filter" />
+ </activity>
+ </application>
+</manifest>
+</pre>
+
+ <p>In this case, the following resource file should be saved in
+ <code>res/xml/accessory_filter.xml</code> and specifies that any accessory that has the
+ corresponding model, manufacturer, and version should be filtered. The accessory sends these
+ attributes the Android-powered device:</p>
+ <pre>
+<?xml version="1.0" encoding="utf-8"?>
+
+<resources>
+ <usb-accessory model="DemoKit" manufacturer="Google" version="1.0"/>
+</resources>
+</pre>
+
+ <h2 id="working-a">Working with Accessories</h2>
+
+ <p>When users connect USB accessories to an Android-powered device, the Android system can
+ determine whether your application is interested in the connected accessory. If so, you can set
+ up communication with the accessory if desired. To do this, your application has to:</p>
+
+ <ol>
+ <li>Discover connected accessories by using an intent filter that filters for accessory
+ attached events or by enumerating connected accessories and finding the appropriate one.</li>
+
+ <li>Ask the user for permission to communicate with the accessory, if not already
+ obtained.</li>
+
+ <li>Communicate with the accessory by reading and writing data on the appropriate interface
+ endpoints.</li>
+ </ol>
+
+ <h3 id="discovering-a">Discovering an accessory</h3>
+
+ <p>Your application can discover accessories by either using an intent filter to be notified when
+ the user connects an accessory or by enumerating accessories that are already connected. Using an
+ intent filter is useful if you want to be able to have your application automatically detect a
+ desired accessory. Enumerating connected accessories is useful if you want to get a list of all
+ connected accessories or if your application did not filter for an intent.</p>
+
+ <h4 id="discover-a-intent">Using an intent filter</h4>
+
+ <p>To have your application discover a particular USB accessory, you can specify an intent filter
+ to filter for the <code>android.hardware.usb.action.USB_ACCESSORY_ATTACHED</code> intent. Along
+ with this intent filter, you need to specify a resource file that specifies properties of the USB
+ accessory, such as manufacturer, model, and version. When users connect an accessory that matches
+ your accessory filter,</p>
+
+ <p>The following example shows how to declare the intent filter:</p>
+ <pre>
+<activity ...>
+ ...
+ <intent-filter>
+ <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
+ </intent-filter>
+
+ <meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
+ android:resource="@xml/accessory_filter" />
+</activity>
+</pre>
+
+ <p>The following example shows how to declare the corresponding resource file that specifies the
+ USB accessories that you're interested in:</p>
+ <pre>
+<?xml version="1.0" encoding="utf-8"?>
+
+<resources>
+ <usb-accessory manufacturer="Google, Inc." model="DemoKit" version="1.0" />
+</resources>
+</pre>
+
+ <p>In your activity, you can obtain the {@link android.hardware.usb.UsbAccessory} that represents
+ the attached accessory from the intent like this (with the add-on library):</p>
+ <pre>
+UsbAccessory accessory = UsbManager.getAccessory(intent);
+</pre>
+
+ <p>or like this (with the platform APIs):</p>
+ <pre>
+UsbAccessory accessory = (UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
+</pre>
+
+ <h4 id="discover-a-enumerate">Enumerating accessories</h4>
+
+ <p>You can have your application enumerate accesories that have identified themselves while your
+ application is running.</p>
+
+ <p>Use the {@link android.hardware.usb.UsbManager#getAccessoryList() getAccessoryList()} method
+ to get an array all the USB accessories that are connected:</p>
+ <pre>
+UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
+UsbAccessory[] accessoryList = manager.getAcccessoryList();
+</pre>
+
+ <p class="note"><strong>Note:</strong> Currently, only one connected accessory is supported at
+ one time, but the API is designed to support multiple accessories in the future.</p>
+
+ <h3 id="permission-a">Obtaining permission to communicate with an accessory</h3>
+
+ <p>Before communicating with the USB accessory, your applicaton must have permission from your
+ users.</p>
+
+ <p class="note"><strong>Note:</strong> If your application <a href="#using-intents">uses an
+ intent filter</a> to discover accessories as they're connected, it automatically receives
+ permission if the user allows your application to handle the intent. If not, you must request
+ permission explicitly in your application before connecting to the accessory.</p>
+
+ <p>Explicitly asking for permission might be neccessary in some situations such as when your
+ application enumerates accessories that are already connected and then wants to communicate with
+ one. You must check for permission to access an accessory before trying to communicate with it.
+ If not, you will receive a runtime error if the user denied permission to access the
+ accessory.</p>
+
+ <p>To explicitly obtain permission, first create a broadcast receiver. This receiver listens for
+ the intent that gets broadcast when you call {@link
+ android.hardware.usb.UsbManager#requestPermission requestPermission()}. The call to {@link
+ android.hardware.usb.UsbManager#requestPermission requestPermission()} displays a dialog to the
+ user asking for permission to connect to the accessory. The following sample code shows how to
+ create the broadcast receiver:</p>
+ <pre>
+private static final String ACTION_USB_PERMISSION =
+ "com.android.example.USB_PERMISSION";
+private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
+
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ if (ACTION_USB_PERMISSION.equals(action)) {
+ synchronized (this) {
+ UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
+
+ if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {
+ if(accessory != null){
+ //call method to set up accessory communication
+ }
+ }
+ else {
+ Log.d(TAG, "permission denied for accessory " + accessory);
+ }
+ }
+ }
+ }
+};
+</pre>
+
+ <p>To register the broadcast receiver, put this in your <code>onCreate()</code> method in your
+ activity:</p>
+ <pre>
+UsbManager mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
+private static final String ACTION_USB_PERMISSION =
+ "com.android.example.USB_PERMISSION";
+...
+mPermissionIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0);
+IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
+registerReceiver(mUsbReceiver, filter);
+</pre>
+
+ <p>To display the dialog that asks users for permission to connect to the accessory, call the
+ {@link android.hardware.usb.UsbManager#requestPermission requestPermission()} method:</p>
+ <pre>
+UsbAccessory accessory;
+...
+mUsbManager.requestPermission(accessory, mPermissionIntent);
+</pre>
+
+ <p>When users reply to the dialog, your broadcast receiver receives the intent that contains the
+ {@link android.hardware.usb.UsbManager#EXTRA_PERMISSION_GRANTED} extra, which is a boolean
+ representing the answer. Check this extra for a value of true before connecting to the
+ accessory.</p>
+
+ <h3 id="communicating-a">Communicating with an accessory</h3>
+
+ <p>You can communicate with the accessory by using the {@link android.hardware.usb.UsbManager} to
+ obtain a file descriptor that you can set up input and output streams to read and write data to
+ descriptor. The streams represent the accessory's input and output bulk endpoints. You should set
+ up the communication between the device and accessory in another thread, so you don't lock the
+ main UI thread. The following example shows how to open an accessory to communicate with:</p>
+ <pre>
+UsbAccessory mAccessory;
+ParcelFileDescriptor mFileDescriptor;
+FileInputStream mInputStream;
+FileOutputStream mOutputStream;
+
+...
+
+private void openAccessory() {
+ Log.d(TAG, "openAccessory: " + accessory);
+ mFileDescriptor = mUsbManager.openAccessory(mAccessory);
+ if (mFileDescriptor != null) {
+ FileDescriptor fd = mFileDescriptor.getFileDescriptor();
+ mInputStream = new FileInputStream(fd);
+ mOutputStream = new FileOutputStream(fd);
+ Thread thread = new Thread(null, this, "AccessoryThread");
+ thread.start();
+ }
+}
+</pre>
+
+ <p>In the thread's <code>run()</code> method, you can read and write to the accessory by using
+ the {@link java.io.FileInputStream} or {@link java.io.FileOutputStream} objects. When reading
+ data from an accessory with a {@link java.io.FileInputStream} object, ensure that the buffer that
+ you use is big enough to store the USB packet data. The Android accessory protocol supports
+ packet buffers up to 16384 bytes, so you can choose to always declare your buffer to be of this
+ size for simplicity.</p>
+
+ <p class="note"><strong>Note:</strong> At a lower level, the packets are 64 bytes for USB
+ full-speed accessories and 512 bytes for USB high-speed accessories. The Android accessory
+ protocol bundles the packets together for both speeds into one logical packet for simplicity.</p>
+
+ <p>For more information about using threads in Android, see <a href=
+ "{@docRoot}guide/components/processes-and-threads.html#Threads">Processes and
+ Threads</a>.</p>
+
+ <h3 id="terminating-a">Terminating communication with an accessory</h3>
+
+ <p>When you are done communicating with an accessory or if the accessory was detached, close the
+ file descriptor that you opened by calling {@link android.os.ParcelFileDescriptor#close close()}.
+ To listen for detached events, create a broadcast receiver like below:</p>
+ <pre>
+BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+
+ if (UsbManager.ACTION_USB_ACCESSORY_DETACHED.equals(action)) {
+ UsbAccessory accessory = (UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
+ if (accessory != null) {
+ // call your method that cleans up and closes communication with the accessory
+ }
+ }
+ }
+};
+</pre>
+
+ <p>Creating the broadcast receiver within the application, and not the manifest, allows your
+ application to only handle detached events while it is running. This way, detached events are
+ only sent to the application that is currently running and not broadcast to all applications.</p>
+
diff --git a/docs/html/guide/topics/connectivity/usb/adk.jd b/docs/html/guide/topics/connectivity/usb/adk.jd
new file mode 100644
index 0000000..034728c
--- /dev/null
+++ b/docs/html/guide/topics/connectivity/usb/adk.jd
@@ -0,0 +1,909 @@
+page.title=Android Open Accessory Development Kit
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#components">ADK Components</a></li>
+ <li>
+
+ <a href="#getting-started">Getting Started with the ADK</a>
+
+ <ol>
+ <li><a href="#installing">Installing the Arduino software and necessary
+ libraries</a></li>
+
+ <li><a href="#installing-firmware">Installing the firmware to the ADK board</a></li>
+
+ <li><a href="#running-demokit">Running the DemoKit Android application</a></li>
+
+ <li><a href="#monitoring">Monitoring the ADK board</a></li>
+ </ol>
+ </li>
+
+ <li>
+ <a href="#accessory-protocol">Implementing the Android Accessory Protocol</a>
+
+ <ol>
+ <li><a href="#wait">Wait for and detect connected devices</a></li>
+
+ <li><a href="#determine">Determine the connected device's accessory mode
+ support</a></li>
+
+ <li><a href="#start">Attempt to start the device in accessory mode</a></li>
+
+ <li><a href="#establish">Establish communication with the device</a></li>
+ </ol>
+ </li>
+
+ <li>
+ <a href="#firmware">How the ADK board implements the Android Accessory Protocol</a>
+
+ <ol>
+ <li><a href="#wait-adk">Wait for and detect connected devices</a></li>
+
+ <li><a href="#determine-adk">Determine the connected device's accessory mode
+ support</a></li>
+
+ <li><a href="#start-adk">Attempt to start the device in accessory mode</a></li>
+
+ <li><a href="#establish-adk">Establish communication with the device</a></li>
+ </ol>
+ </li>
+ </ol>
+
+ <h2>Download</h2>
+ <ol>
+ <li><a href="https://dl-ssl.google.com/android/adk/adk_release_0512.zip">ADK package</a></li>
+ </ol>
+
+ <h2>See also</h2>
+
+ <ol>
+ <li><a href="http://www.youtube.com/watch?v=s7szcpXf2rE">Google I/O Session Video</a></li>
+ <li><a href="{@docRoot}guide/topics/connectivity/usb/accessory.html">USB Accessory Dev Guide</a></li>
+ </ol>
+
+ <h2>Where to buy</h2>
+
+ <ol>
+
+ <li><a href="http://store.arduino.cc/">
+ Arduino Store</a></li>
+
+ <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">
+ 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>
+
+ <li><a href="http://shop.moderndevice.com/products/freeduino-usb-host-board">
+ Modern Device</a></li>
+
+ <li><a href=
+ "http://www.rt-net.jp/shop/index.php?main_page=product_info&cPath=3_4&products_id=1">
+ RT Corp</a></li>
+
+ <li><a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html">
+ Seeed Studio</a></li>
+
+ <li><a href="http://www.sparkfun.com/products/10748">
+ SparkFun</a></li>
+
+ <li><a href="http://troido.de/de/shoplsmallgbuy-android-stufflsmallg">
+ Troido</a></li>
+
+ </ol>
+ </div>
+ </div>
+
+ <p>The Android 3.1 platform (also backported to Android 2.3.4) introduces Android Open Accessory
+ support, which allows external USB hardware (an Android USB accessory) to interact with an
+ Android-powered device in a special "accessory" mode. When an Android-powered powered device is
+ in accessory mode, the connected accessory acts as the USB host (powers the bus and enumerates
+ devices) and the Android-powered device acts as the USB device. Android USB accessories are
+ specifically designed to attach to Android-powered devices and adhere to a simple protocol
+ (Android accessory protocol) that allows them to detect Android-powered devices that support
+ accessory mode. Accessories must also provide 500mA at 5V for charging power. Many previously
+ released Android-powered devices are only capable of acting as a USB device and cannot initiate
+ connections with external USB devices. Android Open Accessory support overcomes this limitation
+ and allows you to build accessories that can interact with an assortment of Android-powered
+ devices by allowing the accessory to initiate the connection.</p>
+
+ <p class="note"><strong>Note:</strong> Accessory mode is ultimately dependent on the device's
+ hardware and not all devices will support accessory mode. Devices that support accessory mode can
+ be filtered using a <code><uses-feature></code> element in your corresponding application's
+ Android manifest. For more information, see the <a href=
+ "{@docRoot}guide/topics/connectivity/usb/accessory.html#manifest">USB Accessory</a> Developer Guide.</p>
+
+ <p>The following list of distributers are currently producing Android Open Accessory compatible
+ development boards:</p>
+
+ <ul>
+
+ <li>The <a href="http://store.arduino.cc/">Arduino Store</a> provides the Arduino Mega ADK
+ (in <a href="http://store.arduino.cc/eu/index.php?main_page=product_info&cPath=11_12&products_id=144">EU nations</a>
+ or <a href="http://store.arduino.cc/ww/index.php?main_page=product_info&cPath=11_12&products_id=144">non-EU nations</a>)
+ that is based on the ATmega2560 and supports the ADK firmware.</li>
+
+ <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">DIY
+ 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>
+
+ <li><a href="http://shop.moderndevice.com/products/freeduino-usb-host-board">Modern
+ Device</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
+
+ <li><a href="http://www.rt-net.jp/shop/index.php?main_page=product_info&cPath=3_4&products_id=1">
+ RT Corp</a> provides an Arduino-compatible board based on the Android ADK board design.</li>
+
+ <li><a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html">
+ Seeed Studio</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
+
+ <li><a href="http://www.sparkfun.com/products/10748">
+ SparkFun</a>'s IOIO board now has beta support for the ADK firmware.</li>
+
+ </ul>
+
+ <p>We expect more hardware distributers to create a variety of kits, so please stay tuned for
+ further developments.</p>
+
+ <h2 id="components">ADK Components</h2>
+ <p>The Android Open Accessory Development Kit (ADK) provides an implementation of an Android USB
+ accessory that is based on the <a href="http://www.arduino.cc/">Arduino open source electronics
+ prototyping platform</a>, the accessory's hardware design files, code that implements the
+ accessory's firmware, and the Android application that interacts with the accessory. The hardware
+ design files and firmware code are contained in the <a href=
+ "https://dl-ssl.google.com/android/adk/adk_release_20120606.zip">ADK package download</a>.</p>
+ <p>The main hardware and software components of the ADK include:</p>
+
+ <ul>
+ <li>A USB micro-controller board that is based on the Arduino Mega2560 and Circuits@Home USB
+ Host Shield designs (now referred to as the ADK board), which you will later implement as an
+ Android USB accessory. The ADK board provides input and output pins that you can implement
+ through the use of attachments called "shields." Custom firmware, written in C++, is installed
+ on the board to define the board's functionality and interaction with the attached shield and
+ Android-powered device. The hardware design files for the board are located in
+ <code>hardware/</code> directory.</li>
+
+ <li>An Android Demo Shield (ADK shield) that affixes atop the ADK board implements the input
+ and output points on the board. These implementations include a joystick, LED outputs, and
+ temperature and light sensors. You can create or buy your own shields or wire your own features
+ to the ADK board to implement custom functionality. The hardware design files for the shield
+ are located in <code>hardware/</code>.</li>
+
+ <li>A library based on the <a href=
+ "http://www.circuitsathome.com/arduino_usb_host_shield_projects">Arduino USB Host Shield</a>
+ library provides the logic for the USB micro-controller board to act as a USB Host. This allows
+ the board to initiate transactions with USB devices. Describing how to use this entire library
+ is beyond the scope of this document. Where needed, this document points out important
+ interactions with the library. For more information, see the source code for the Arduino USB
+ Host Shield library in the <code>arduino_libs/USB_Host_Shield</code> directory.</li>
+
+ <li>An Arduino sketch, <code>arduino_libs/AndroidAccessory/examples/demokit/demokit.pde</code>,
+ defines the firmware that
+ runs on the ADK board and is written in C++. The sketch calls the Android accessory protocol
+ library to interact with the Android-powered device. It also sends data from the ADK board and
+ shield to the Android application and receives data from the Android application and outputs it
+ to the ADK board and shield.</li>
+
+ <li>The Android accessory protocol library, which is located in the
+ <code>arduino_libs/AndroidAccessory</code> directory. This library defines how to
+ enumerate the bus, find a connected Android-powered device that supports accessory mode, and
+ how to setup communication with the device.</li>
+
+ <li>Other third party libraries to support the ADK board's functionality:
+ <ul>
+ <li><a href="http://www.arduino.cc/playground/Main/CapSense">CapSense library</a></li>
+
+ <li><a href="http://www.arduino.cc/playground/Learning/I2C">I2C / TWI (Two-Wire Interface)
+ library</a></li>
+
+ <li><a href="http://www.arduino.cc/playground/ComponentLib/Servo">Servo library</a></li>
+
+ <li><a href="http://www.arduino.cc/playground/Code/Spi">Spi library</a></li>
+
+ <li><a href="http://www.arduino.cc/en/Reference/Wire">Wire library</a></li>
+
+ <li>An Android application, DemoKit, that communicates with the ADK board and shield. The
+ source for this project is in the <code>app/</code> directory.</li>
+ </ul>
+ </li>
+
+ </ul>
+
+ <h2 id="getting-started">Getting Started with the ADK</h2>
+
+ <p>The following sections describe how to install the Arduino software on your computer, use the
+ Arduino IDE to install the ADK board's firmware, and install and run the accompanying
+ Android application for the ADK board. Before you begin, download the following items to set up
+ your development environment:</p>
+
+ <ul>
+ <li><a href="http://arduino.cc/en/Main/Software">Arduino 1.0 or higher</a>: contains
+ libraries and an IDE for coding and installing firmware to the ADK board.</li>
+
+ <li><a href="http://www.arduino.cc/playground/Main/CapSense">CapSense library v.04</a>:
+ contains the libraries to sense human capacitance. This library is needed for the capacitive
+ button that is located on the ADK shield.</li>
+
+ <li><a href="https://dl-ssl.google.com/android/adk/adk_release_20120606.zip">ADK software
+ package</a>: contains the firmware for the ADK board and hardware design files for the ADK
+ board and shield.</li>
+ </ul>
+
+ <h3 id="installing">Installing the Arduino software and necessary libraries</h3>
+
+ <p>To install the Arduino software:</p>
+
+ <ol>
+ <li>
+ <a href="http://arduino.cc/en/Main/Software">Download and install</a> the Arduino 1.0 or
+ higher as described on the Arduino website.
+
+ <p class="note"><strong>Note:</strong> If you are on a Mac, install the FTDI USB Serial
+ Driver that is included in the Arduino package, even though the installation instructions say
+ otherwise.</p>
+ </li>
+
+ <li><a href="https://dl-ssl.google.com/android/adk/adk_release_20120606.zip">Download</a> and
+ extract the ADK package to a directory of your choice. You should have an <code>app</code>,
+ <code>arduino_libs</code>, and <code>hardware</code> directories.</li>
+
+ <li><a href="http://www.arduino.cc/playground/Main/CapSense">Download</a> and extract
+ the CapSense package to a directory of your choice.</li>
+
+ <li>Install the necessary libraries:
+
+ <p>On Windows:</p>
+
+ <ol type="a">
+ <li>Copy the <code>arduino_libs/AndroidAccessory</code> and
+ <code>arduino_libs/USB_Host_Shield</code> directories (the complete directories,
+ not just the files within) to the <code><arduino_installation_root>/libraries/</code>
+ directory.</li>
+
+ <li>Copy the extracted <code>CapSense/</code> library directory and its contents to the
+ <code><arduino_installation_root>/libraries/</code> directory.</li>
+ </ol>
+
+ <p>On Mac:</p>
+
+ <ol type="a">
+ <li>Create, if it does not already exist, an <code>Arduino</code>
+ directory inside your user account's <code>Documents</code> directory, and within
+ that, a <code>libraries</code> directory.</li>
+
+ <li>Copy the <code>arduino_libs/AndroidAccessory</code> and
+ <code>arduino_libs/USB_Host_Shield</code> directories (the
+ complete directories, not just the files within) to your
+ <code>Documents/Arduino/libraries/</code> directory.</li>
+
+ <li>Copy the extracted <code>CapSense/</code> library directory and its contents to the
+ <code>Documents/Arduino/libraries/</code> directory.
+ </ol>
+
+ <p>On Linux (Ubuntu):</p>
+
+ <ol type="a">
+ <li>Copy the <code>firmware/arduino_libs/AndroidAccessory</code> and
+ <code>firmware/arduino_libs/USB_Host_Shield</code> directories (the complete directories,
+ not just the files within) to the <code><arduino_installation_root>/libraries/</code>
+ directory.</li>
+
+ <li>Copy the extracted <code>CapSense/</code> library directory and its contents to the
+ <code><arduino_installation_root>/libraries/</code> directory.</li>
+
+ <li>Install the avr-libc library by entering <code>sudo apt-get install avr-libc</code>
+ from a shell prompt.</li>
+ </ol>
+ </li>
+ </ol>
+
+ <p>You should now have three new directories in the Arduino <code>libraries/</code> directory:
+ <code>AndroidAccessory</code>, <code>USB_Host_Shield</code>, and <code>CapSense</code>.</p>
+
+ <h3 id="installing-firmware">Installing the firmware to the ADK board</h3>
+
+ <p>To install the firmware to the ADK board:</p>
+
+ <ol>
+ <li>Connect the ADK board to your computer using the micro-USB port, which allows two-way
+ communication and provides power to the ADK board.</li>
+
+ <li>Launch the Arduino IDE.</li>
+
+ <li>Click <strong>Tools > Board > Arduino Mega 2560</strong> to specify the ADK board's
+ type.</li>
+
+ <li>Select the appropriate USB port:
+
+ <ul>
+ <li>On Windows: click <strong>Tools > Serial Port > COM#</strong> to specify the port
+ of communication. The COM port number varies depending on your computer. COM1 is usually
+ reserved for serial port connections. You most likely want COM2 or COM3.</li>
+
+ <li>On Mac: Click <strong>Tools > Serial Port > dev/tty.usbserial-###</strong> to
+ specify the port of communication.</li>
+
+ <li>On Linux (Ubuntu): Click <strong>Tools > Serial Port > dev/ttyUSB#</strong> to
+ specify the port of communication.</li>
+ </ul>
+ </li>
+
+ <li>To open the Demokit sketch (firmware code), click <strong>File > Examples >
+ AndroidAccessory > demokit</strong>.</li>
+
+ <li>Click <strong>Sketch > Verify/Compile</strong> to ensure that the sketch has no
+ errors.</li>
+
+ <li>Select <strong>File > Upload</strong>. When Arduino outputs <strong>Done
+ uploading.</strong>, the board is ready to communicate with your Android-powered device.</li>
+ </ol>
+
+ <h3 id="running-demokit">Running the DemoKit Android application</h3>
+
+ <p>The DemoKit Android application runs on your Android-powered device and communicates with the
+ ADK board. The ADK board receives commands such as lighting up the board's LEDs or sends data
+ from the board such as joystick movement and temperature readings.</p>
+
+ <p>To install and run the application in Eclipse:</p>
+
+ <ol>
+ <li><a href="http://code.google.com/android/add-ons/google-apis/installing.html">Install the
+ Google APIs API Level 10 add-on library</a>, which includes the Open Accessory library for
+ 2.3.4 devices that support accessory mode. This library is also forward compatible with Android
+ 3.1 or newer devices that support accessory mode. If you only care about Android 3.1 or newer
+ devices, all you need is API Level 12. For more information on deciding which API level to use,
+ see the <a href="{@docRoot}guide/topics/connectivity/usb/accessory.html#choosing">USB Accessory</a>
+ documentation.</li>
+
+ <li>Click <strong>File > New > Project...</strong>, then select <strong>Android >
+ Android Project</strong></li>
+
+ <li>In the <strong>Project name:</strong> field, type DemoKit.</li>
+
+ <li>Choose <strong>Create project from existing source</strong>, click <strong>Browse</strong>,
+ select the <code>app</code> directory, click <strong>Open</strong> to close that dialog and then
+ click <strong>Finish</strong>.</li>
+
+ <li>For Build Target, select <strong>Google APIs</strong> (Platform 2.3.3, API Level 10).
+
+ <p class="note"><strong>Note:</strong> Even though the add-on is labeled as
+ <strong>2.3.3</strong>, the newest Google API add-on library for API level 10 adds USB Open
+ Accessory API support for 2.3.4 devices.</p>
+ </li>
+
+ <li>Click <strong>Finish</strong>.</li>
+
+ <li>Install the application to your device.</li>
+
+ <li>Connect the ADK board (USB-A) to your Android-powered device (micro-USB). Ensure that the
+ power cable to the accessory is plugged in or that the micro-USB port on the accesory is
+ connected to your computer for power (this also allows you to <a href="#monitoring">monitor the
+ ADK board</a>). When connected, accept the prompt that asks for whether or not to open the
+ DemoKit application to connect to the accessory. If the prompt does not show up, connect and
+ reconnect the accessory.</li>
+ </ol>
+
+ <p>You can now interact with the ADK board by moving the color LED or servo sliders (make sure
+ the servos are connected) or by pressing the relay buttons in the application. On the ADK shield,
+ you can press the buttons and move the joystick to see their outputs displayed in the
+ application.</p>
+
+ <h3 id="monitoring">Monitoring the ADK Board</h3>
+
+ <p>The ADK firmware consists of a few files that you should be looking at if you want to build
+ your own accessory. The files in the <code>arduino_libs/AndroidAccessory</code>
+ directory are the most important files and have the logic to detect and connect to
+ Android-powered devices that support accessory mode. Feel free to add debug statements (Arduino
+ <code>Serial.println()</code> statements) to the code located in the
+ <code><arduino_installation_root>/libraries/AndroidAccessory</code> directory and
+ <code>demokit.pde</code> sketch and re-upload the sketch to the ADK board to
+ discover more about how the firmware works.</p>
+
+ <p>You can view the debug statements in the Arduino Serial Monitor by clicking <strong>Tools >
+ Serial Monitor</strong> and setting the baud to 115200. The following sections about how
+ accessories communicate with Android-powered devices describe much of what you should be doing in
+ your own accessory.</p>
+
+ <h2 id="accessory-protocol">Implementing the Android Accessory Protocol</h2>
+
+ <p>An Android USB accessory must adhere to Android Accessory Protocol, which defines how
+ an accessory detects and sets up communication with an Android-powered device. In general, an
+ accessory should carry out the following steps:</p>
+
+ <ol>
+ <li>Wait for and detect connected devices</li>
+
+ <li>Determine the device's accessory mode support</li>
+
+ <li>Attempt to start the device in accessory mode if needed</li>
+
+ <li>Establish communication with the device if it supports the Android accessory protocol</li>
+ </ol>
+
+ <p>The following sections go into depth about how to implement these steps.</p>
+
+ <h3 id="wait">Wait for and detect connected devices</h3>
+
+ <p>Your accessory should have logic to continuously check
+ for connected Android-powered devices. When a device is connected, your accessory should
+ determine if the device supports accessory mode.</p>
+
+ <h3 id="determine">Determine the device's accessory mode support</h3>
+
+
+ <p>When an Android-powered device is connected, it can be in one of three states:</p>
+
+ <ol type="a">
+ <li>The attached device supports Android accessory mode and is already in accessory mode.</li>
+
+ <li>The attached device supports Android accessory mode, but it is not in accessory mode.</li>
+
+ <li>The attached device does not support Android accessory mode.</li>
+ </ol>
+
+ <p>During the initial connection, the accessory should check the vendor and product IDs of the
+ connected device's USB device descriptor. The vendor ID should match Google's ID (0x18D1) and the
+ product ID should be 0x2D00 or 0x2D01 if the device is already in accessory mode (case A). If so,
+ the accessory can now <a href="#establish">establish communication with the device</a> through
+ bulk transfer endpoints with its own communication protocol. There is no need to start the device
+ in accessory mode.</p>
+
+ <p class="note"><strong>Note:</strong> 0x2D00 is reserved for Android-powered devices that
+ support accessory mode. 0x2D01 is reserved for devices that support accessory mode as well as the
+ ADB (Android Debug Bridge) protocol, which exposes a second interface with two bulk endpoints for
+ ADB. You can use these endpoints for debugging the accessory application if you are simulating
+ the accessory on a computer. In general, do not use this interface unless your accessory is
+ implementing a passthrough to ADB on the device.</p>
+
+ <p>If the vendor and product ID do not match, there is no way to distinguish between states b and
+ c, so the accessory <a href="#start">attempts to start the device in accessory mode</a> to figure
+ out if the device is supported.</p>
+
+ <h3 id="start">Attempt to start the device in accessory mode</h3>
+
+ <p>If the vendor and product IDs do not correspond to an Android-powered device in accessory
+ mode, the accessory cannot discern whether the device supports accessory mode and is not in that
+ state, or if the device does not support accessory mode at all. This is because devices that
+ support accessory mode but aren't in it initially report the device's manufacturer vendor ID and
+ product ID, and not the special Android Open Accessory ones. In either case, the accessory should try to start
+ the device into accessory mode to figure out if the device supports it. The following steps
+ explain how to do this:</p>
+
+ <ol>
+ <li>Send a 51 control request ("Get Protocol") to figure out if the device supports the Android
+ accessory protocol. A non-zero number is returned if the protocol is supported, which
+ represents the version of the protocol that the device supports (currently, only version 1
+ exists). This request is a control request on endpoint 0 with the following characteristics:
+ <pre>
+requestType: USB_DIR_IN | USB_TYPE_VENDOR
+request: 51
+value: 0
+index: 0
+data: protocol version number (16 bits little endian sent from the device to the accessory)
+</pre>
+ </li>
+
+ <li>If the device returns a proper protocol version, send identifying string information to the
+ device. This information allows the device to figure out an appropriate application for this
+ accessory and also present the user with a URL if an appropriate application does not exist.
+ These requests are control requests on endpoint 0 (for each string ID) with the following
+ characteristics:
+ <pre>
+requestType: USB_DIR_OUT | USB_TYPE_VENDOR
+request: 52
+value: 0
+index: string ID
+data zero terminated UTF8 string sent from accessory to device
+</pre>
+
+ <p>The following string IDs are supported, with a maximum size of 256 bytes for each string
+ (must be zero terminated with \0).</p>
+ <pre>
+manufacturer name: 0
+model name: 1
+description: 2
+version: 3
+URI: 4
+serial number: 5
+</pre>
+ </li>
+
+ <li>When the identifying strings are sent, request the device start up in accessory mode. This
+ request is a control request on endpoint 0 with the following characteristics:
+ <pre>
+requestType: USB_DIR_OUT | USB_TYPE_VENDOR
+request: 53
+value: 0
+index: 0
+data: none
+</pre>
+ </li>
+ </ol>
+
+ <p>After sending the final control request, the connected USB device should re-introduce itself
+ on the bus in accessory mode and the accessory can re-enumerate the connected devices. The
+ algorithm jumps back to <a href="#determine">determining the device's accessory mode support</a>
+ to check for the vendor and product ID. The vendor ID and product ID of the device will be
+ different if the device successfully switched to accessory mode and will now correspond to
+ Google's vendor and product IDs instead of the device manufacturer's IDs. The accessory can now
+ <a href="#establish">establish communication with the device</a>.</p>
+
+ <p>If at any point these steps fail, the device does not support Android accessory mode and the
+ accessory should wait for the next device to be connected.</p>
+
+ <h3 id="establish">Establish communication with the device</h3>
+
+ <p>If an Android-powered device in accessory mode is detected, the accessory can query the
+ device's interface and endpoint descriptors to obtain the bulk endpoints to communicate with the
+ device. An Android-powered device that has a product ID of 0x2D00 has one interface with two bulk
+ endpoints for input and output communication. A device with product ID of 0x2D01 has two
+ interfaces with two bulk endpoints each for input and output communication. The first interface
+ is for standard communication while the second interface is for ADB communication. To communicate
+ on an interface, all you need to do is find the first bulk input and output endpoints, set the
+ device's configuration to a value of 1 with a SET_CONFIGURATION (0x09) device request, then
+ communicate using the endpoints.</p>
+
+ <h2 id="firmware">How the ADK board implements the Android Accessory protocol</h2>
+
+ <p>If you have access to the ADK board and shield, the following sections describe the firmware
+ code that you installed onto the ADK board. The firmware demonstrates a practical example of how
+ to implement the Android Accessory protocol. Even if you do not have the ADK board and shield,
+ reading through how the hardware detects and interacts with devices in accessory mode is still
+ useful if you want to port the code over for your own accessories.</p>
+
+ <p>The important pieces of the firmware are the
+ <code>arduino_libs/AndroidAccessory/examples/demokit/demokit/demokit.pde</code> sketch, which is
+ the code that receives and sends data to the DemoKit application running on the Android-powered
+ device. The code to detect and set up communication with the Android-powered device is contained
+ in the <code>arduino_libs/AndroidAccessory/AndroidAccessory.h</code> and
+ <code>arduino_libs/AndroidAccessory/AndroidAccessory.cpp</code> files. This code
+ includes most of the logic that will help you implement your own accessory's firmware. It might
+ be useful to have all three of these files open in a text editor as you read through these next
+ sections.</p>
+
+ <p>The following sections describe the firmware code in the context of the algorithm described in
+ <a href="#accessory-protocol">Implementing the Android Accessory Protocol</a>.</p>
+
+ <h3 id="wait-adk">Wait for and detect connected devices</h3>
+
+ <p>In the firmware code (<code>demokit.pde</code>), the <code>loop()</code> function runs
+ repeatedly and calls <code>AndroidAccessory::isConnected()</code> to check for any connected
+ devices. If there is a connected device, it continuously updates the input and output streams
+ going to and from the board and application. If nothing is connected, it continuously checks for
+ a device to be connected:</p>
+ <pre>
+...
+
+AndroidAccessory acc("Google, Inc.",
+ "DemoKit",
+ "DemoKit Arduino Board",
+ "1.0",
+ "http://www.android.com",
+ "0000000012345678");
+
+...
+void loop()
+{
+...
+ if (acc.isConnected()) {
+ //communicate with Android application
+ }
+ else{
+ //set the accessory to its default state
+ }
+...
+}
+</pre>
+
+ <h3 id="determine-adk">Determine the connected device's accessory mode support</h3>
+
+ <p>When a device is connected to the ADK board, it can already be in accessory mode, support
+ accessory mode and is not in that mode, or does not support accessory mode. The
+ <code>AndroidAccessory::isConnected()</code> method checks for these cases and responds
+ accordingly when the <code>loop()</code> function calls it. This function first checks to see if
+ the device that is connected hasn't already been handled. If not, it gets the connected device's
+ device descriptor to figure out if the device is already in accessory mode by calling
+ <code>AndroidAccessory::isAccessoryDevice()</code>. This method checks the vendor and product ID
+ of the device descriptor. A device in accessory mode has a vendor ID of 0x18D1 and a product ID
+ of 0x2D00 or 0x2D01. If the device is in accessory mode, then the ADK board can <a href=
+ "#establish">establish communication with the device</a>. If not, the board <a href=
+ "#start">attempts to start the device in accessory mode</a>.</p>
+ <pre>
+bool AndroidAccessory::isConnected(void)
+{
+ USB_DEVICE_DESCRIPTOR *devDesc = (USB_DEVICE_DESCRIPTOR *) descBuff;
+ byte err;
+
+ max.Task();
+ usb.Task();
+
+ if (!connected &&
+ usb.getUsbTaskState() >= USB_STATE_CONFIGURING &&
+ usb.getUsbTaskState() != USB_STATE_RUNNING) {
+ Serial.print("\nDevice addressed... ");
+ Serial.print("Requesting device descriptor.");
+
+ err = usb.getDevDescr(1, 0, 0x12, (char *) devDesc);
+ if (err) {
+ Serial.print("\nDevice descriptor cannot be retrieved. Program Halted\n");
+ while(1);
+ }
+
+ if (isAccessoryDevice(devDesc)) {
+ Serial.print("found android accessory device\n");
+
+ connected = configureAndroid();
+ } else {
+ Serial.print("found possible device. switching to serial mode\n");
+ switchDevice(1);
+ }
+ } else if (usb.getUsbTaskState() == USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE) {
+ connected = false;
+ }
+
+ return connected;
+}
+</pre>
+
+ <h3 id="start-adk">Attempt to start the device in accessory mode</h3>
+
+ <p>If the device is not already in accessory mode, then the ADK board must determine whether or
+ not it supports it by sending control request 51 to check the version of the USB accessory
+ protocol that the device supports (see <code>AndroidAccessory::getProtocol()</code>). Protocol
+ version 1 is the only version for now, but this can be an integer greater than zero in the
+ future. If the appropriate protocol version is returned, the board sends control request 52 (one
+ for each string with <code>AndroidAcessory:sendString()</code>) to send it's identifying
+ information, and tries to start the device in accessory mode with control request 53. The
+ <code>AndroidAccessory::switchDevice()</code> method takes care of this:</p>
+ <pre>
+bool AndroidAccessory::switchDevice(byte addr)
+{
+ int protocol = getProtocol(addr);
+ if (protocol == 1) {
+ Serial.print("device supports protocol 1\n");
+ } else {
+ Serial.print("could not read device protocol version\n");
+ return false;
+ }
+
+ sendString(addr, ACCESSORY_STRING_MANUFACTURER, manufacturer);
+ sendString(addr, ACCESSORY_STRING_MODEL, model);
+ sendString(addr, ACCESSORY_STRING_DESCRIPTION, description);
+ sendString(addr, ACCESSORY_STRING_VERSION, version);
+ sendString(addr, ACCESSORY_STRING_URI, uri);
+ sendString(addr, ACCESSORY_STRING_SERIAL, serial);
+
+ usb.ctrlReq(addr, 0, USB_SETUP_HOST_TO_DEVICE | USB_SETUP_TYPE_VENDOR | USB_SETUP_RECIPIENT_DEVICE,
+ ACCESSORY_START, 0, 0, 0, 0, NULL);
+ return true;
+}
+</pre>If this method returns false, the board waits until a new device is connected. If it is
+successful, the device displays itself on the USB bus as being in accessory mode when the ADK board
+re-enumerates the bus. When the device is in accessory mode, the accessory then <a href=
+"#establish-adk">establishes communication with the device</a>.
+
+ <h3 id="establish-adk">Establish communication with the device</h3>
+
+ <p>If a device is detected as being in accessory mode, the accessory must find the proper bulk
+ endpoints and set up communication with the device. When the ADK board detects an Android-powered
+ device in accessory mode, it calls the <code>AndroidAccessory::configureAndroid()</code>
+ function:</p>
+ <pre>
+...
+if (isAccessoryDevice(devDesc)) {
+ Serial.print("found android acessory device\n");
+
+ connected = configureAndroid();
+ }
+...
+</pre>
+
+ <p>which in turn calls the <code>findEndpoints()</code> function:</p>
+ <pre>
+...
+bool AndroidAccessory::configureAndroid(void)
+{
+ byte err;
+ EP_RECORD inEp, outEp;
+
+ if (!findEndpoints(1, &inEp, &outEp))
+ return false;
+...
+</pre>
+
+ <p>The <code>AndroidAccessory::findEndpoints()</code> function queries the Android-powered
+ device's configuration descriptor and finds the bulk data endpoints in which to communicate with
+ the USB device. To do this, it first gets the device's first four bytes of the configuration
+ descriptor (only need descBuff[2] and descBuff[3]), which contains the information about the
+ total length of data returned by getting the descriptor. This data is used to determine whether
+ or not the descriptor can fit in the descriptor buffer. This descriptor also contains information
+ about all the interfaces and endpoint descriptors. If the descriptor is of appropriate size, the
+ method reads the entire configuration descriptor and fills the entire descriptor buffer with this
+ device's configuration descriptor. If for some reason the descriptor is no longer attainable, an
+ error is returned.</p>
+ <pre>
+...
+
+bool AndroidAccessory::findEndpoints(byte addr, EP_RECORD *inEp, EP_RECORD *outEp)
+{
+ int len;
+ byte err;
+ uint8_t *p;
+
+ err = usb.getConfDescr(addr, 0, 4, 0, (char *)descBuff);
+ if (err) {
+ Serial.print("Can't get config descriptor length\n");
+ return false;
+ }
+
+
+ len = descBuff[2] | ((int)descBuff[3] << 8);
+ if (len > sizeof(descBuff)) {
+ Serial.print("config descriptor too large\n");
+ /* might want to truncate here */
+ return false;
+ }
+
+ err = usb.getConfDescr(addr, 0, len, 0, (char *)descBuff);
+ if (err) {
+ Serial.print("Can't get config descriptor\n");
+ return false;
+ }
+
+...
+</pre>
+
+ <p>Once the descriptor is in memory, a pointer is assigned to the first position of the buffer
+ and is used to index the buffer for reading. There are two endpoint pointers (input and output)
+ that are passed into <code>AndroidAccessory::findEndpoints()</code> and their addresses are set
+ to 0, because the code hasn't found any suitable bulk endpoints yet. A loop reads the buffer,
+ parsing each configuration, interface, or endpoint descriptor. For each descriptor, Position 0
+ always contains the size of the descriptor in bytes and position 1 always contains the descriptor
+ type. Using these two values, the loop skips any configuration and interface descriptors and
+ increments the buffer with the <code>descLen</code> variable to get to the next descriptor.</p>
+
+ <p class="note"><strong>Note:</strong> An Android-powered device in accessory mode can
+ potentially have two interfaces, one for the default communication to the device and the other
+ for ADB communication. The default communication interface is always indexed first, so finding
+ the first input and output bulk endpoints will return the default communication endpoints, which
+ is what the <code>demokit.pde</code> sketch does. If you are writing your own firmware, the logic
+ to find the appropriate endpoints for your accessory might be different.</p>
+
+ <p>When it finds the first input and output endpoint descriptors, it sets the endpoint pointers
+ to those addresses. If the findEndpoints() function finds both an input and output endpoint, it
+ returns true. It ignores any other endpoints that it finds (the endpoints for the ADB interface,
+ if present).</p>
+ <pre>
+...
+ p = descBuff;
+ inEp->epAddr = 0;
+ outEp->epAddr = 0;
+ while (p < (descBuff + len)){
+ uint8_t descLen = p[0];
+ uint8_t descType = p[1];
+ USB_ENDPOINT_DESCRIPTOR *epDesc;
+ EP_RECORD *ep;
+
+ switch (descType) {
+ case USB_DESCRIPTOR_CONFIGURATION:
+ Serial.print("config desc\n");
+ break;
+
+ case USB_DESCRIPTOR_INTERFACE:
+ Serial.print("interface desc\n");
+ break;
+
+ case USB_DESCRIPTOR_ENDPOINT:
+ epDesc = (USB_ENDPOINT_DESCRIPTOR *)p;
+ if (!inEp->epAddr && (epDesc->bEndpointAddress & 0x80))
+ ep = inEp;
+ else if (!outEp->epAddr)
+ ep = outEp;
+ else
+ ep = NULL;
+
+ if (ep) {
+ ep->epAddr = epDesc->bEndpointAddress & 0x7f;
+ ep->Attr = epDesc->bmAttributes;
+ ep->MaxPktSize = epDesc->wMaxPacketSize;
+ ep->sndToggle = bmSNDTOG0;
+ ep->rcvToggle = bmRCVTOG0;
+ }
+ break;
+
+ default:
+ Serial.print("unkown desc type ");
+ Serial.println( descType, HEX);
+ break;
+ }
+
+ p += descLen;
+ }
+
+ if (!(inEp->epAddr && outEp->epAddr))
+ Serial.println("can't find accessory endpoints");
+
+ return inEp->epAddr && outEp->epAddr;
+}
+
+...
+</pre>
+
+ <p>Back in the <code>configureAndroid()</code> function, if there were endpoints found, they are
+ appropriately set up for communication. The device's configuration is set to 1 and the state of
+ the device is set to "running", which signifies that the device is properly set up to communicate
+ with your USB accessory. Setting this status prevents the device from being re-detected and
+ re-configured in the <code>AndroidAccessory::isConnected()</code> function.</p>
+ <pre>
+bool AndroidAccessory::configureAndroid(void)
+{
+ byte err;
+ EP_RECORD inEp, outEp;
+
+ if (!findEndpoints(1, &inEp, &outEp))
+ return false;
+
+ memset(&epRecord, 0x0, sizeof(epRecord));
+
+ epRecord[inEp.epAddr] = inEp;
+ if (outEp.epAddr != inEp.epAddr)
+ epRecord[outEp.epAddr] = outEp;
+
+ in = inEp.epAddr;
+ out = outEp.epAddr;
+
+ Serial.print("inEp: ");
+ Serial.println(inEp.epAddr, HEX);
+ Serial.print("outEp: ");
+ Serial.println(outEp.epAddr, HEX);
+
+ epRecord[0] = *(usb.getDevTableEntry(0,0));
+ usb.setDevTableEntry(1, epRecord);
+
+ err = usb.setConf( 1, 0, 1 );
+ if (err) {
+ Serial.print("Can't set config to 1\n");
+ return false;
+ }
+
+ usb.setUsbTaskState( USB_STATE_RUNNING );
+
+ return true;
+}
+</pre>
+
+ <p>Lastly, methods to read and write to the appropriate endpoints are needed. The
+ <code>demokit.pde</code> sketch calls these methods depending on the data that is read from the
+ Android-powered device or sent by the ADK board. For instance, moving the joystick on the ADK
+ shield writes data that is read by the DemoKit application running on the Android-powered device.
+ Moving sliders on the DemoKit application is read by the <code>demokit.pde</code> sketch and
+ changes the state of the accessory, such as lighting up or changing the color of the LED
+ lights.</p>
+ <pre>
+int AndroidAccessory::read(void *buff, int len, unsigned int nakLimit) {
+ return usb.newInTransfer(1, in, len, (char *)buff, nakLimit); }
+
+int AndroidAccessory::write(void *buff, int len) {
+ usb.outTransfer(1, out, len, (char *)buff);
+ return len; }
+</pre>
+
+ <p>See the <code>demokit.pde</code> sketch for information about how the ADK board
+ reads and writes data.</p>
diff --git a/docs/html/guide/topics/connectivity/usb/host.jd b/docs/html/guide/topics/connectivity/usb/host.jd
new file mode 100644
index 0000000..355dd2d
--- /dev/null
+++ b/docs/html/guide/topics/connectivity/usb/host.jd
@@ -0,0 +1,440 @@
+page.title=USB Host
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#api">API Overview</a></li>
+
+ <li><a href="#usage">Android Manifest Requirements</a></li>
+
+ <li>
+ <a href="#working-d">Working with devices</a>
+
+ <ol>
+ <li><a href="#discovering-d">Discovering a device</a></li>
+
+ <li><a href="#permission-d">Obtaining permission to communicate with a device</a></li>
+
+ <li><a href="#communicating-d">Communicating with a device</a></li>
+
+ <li><a href="#terminating-d">Terminating communication with a device</a></li>
+ </ol>
+ </li>
+ </ol>
+
+ <h2>Related Samples</h2>
+
+ <ol>
+ <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>
+ </ol>
+ </div>
+ </div>
+
+ <p>When your Android-powered device is in USB host mode, it acts as the USB host, powers the bus,
+ and enumerates connected USB devices. USB host mode is supported in Android 3.1 and higher.</p>
+
+ <h2 id="api">API Overview</h2>
+
+ <p>Before you begin, it is important to understand the classes that you need to work with. The
+ following table describes the USB host APIs in the {@link android.hardware.usb} package.</p>
+
+ <p class="table-caption"><strong>Table 1.</strong> USB Host APIs</p>
+
+ <table>
+ <tr>
+ <th>Class</th>
+
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>{@link android.hardware.usb.UsbManager}</td>
+
+ <td>Allows you to enumerate and communicate with connected USB devices.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.hardware.usb.UsbDevice}</td>
+
+ <td>Represents a connected USB device and contains methods to access its identifying
+ information, interfaces, and endpoints.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.hardware.usb.UsbInterface}</td>
+
+ <td>Represents an interface of a USB device, which defines a set of functionality for the
+ device. A device can have one or more interfaces on which to communicate on.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.hardware.usb.UsbEndpoint}</td>
+
+ <td>Represents an interface endpoint, which is a communication channel for this interface. An
+ interface can have one or more endpoints, and usually has input and output endpoints for
+ two-way communication with the device.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.hardware.usb.UsbDeviceConnection}</td>
+
+ <td>Represents a connection to the device, which transfers data on endpoints. This class
+ allows you to send data back and forth sychronously or asynchronously.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.hardware.usb.UsbRequest}</td>
+
+ <td>Represents an asynchronous request to communicate with a device through a {@link
+ android.hardware.usb.UsbDeviceConnection}.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.hardware.usb.UsbConstants}</td>
+
+ <td>Defines USB constants that correspond to definitions in linux/usb/ch9.h of the Linux
+ kernel.</td>
+ </tr>
+ </table>
+
+ <p>In most situations, you need to use all of these classes ({@link
+ android.hardware.usb.UsbRequest} is only required if you are doing asynchronous communication)
+ when communicating with a USB device. In general, you obtain a {@link
+ android.hardware.usb.UsbManager} to retrieve the desired {@link android.hardware.usb.UsbDevice}.
+ When you have the device, you need to find the appropriate {@link
+ android.hardware.usb.UsbInterface} and the {@link android.hardware.usb.UsbEndpoint} of that
+ interface to communicate on. Once you obtain the correct endpoint, open a {@link
+ android.hardware.usb.UsbDeviceConnection} to communicate with the USB device.</p>
+
+ <h2 id="manifest">Android Manifest Requirements</h2>
+
+ <p>The following list describes what you need to add to your application's manifest file before
+ working with the USB host APIs:</p>
+
+ <ul>
+ <li>Because not all Android-powered devices are guaranteed to support the USB host APIs,
+ include a <code><uses-feature></code> element that declares that your application uses
+ the <code>android.hardware.usb.host</code> feature.</li>
+
+ <li>Set the minimum SDK of the application to API Level 12 or higher. The USB host APIs are not
+ present on earlier API levels.</li>
+
+ <li>If you want your application to be notified of an attached USB device, specify an
+ <code><intent-filter></code> and <code><meta-data></code> element pair for the
+ <code>android.hardware.usb.action.USB_DEVICE_ATTACHED</code> intent in your main activity. The
+ <code><meta-data></code> element points to an external XML resource file that declares
+ identifying information about the device that you want to detect.
+
+ <p>In the XML resource file, declare <code><usb-device></code> elements for the USB
+ devices that you want to filter. The following list describes the attributes of
+ <code><usb-device></code>. In general, use vendor and product ID if you want to filter
+ for a specific device and use class, subclass, and protocol if you want to filter for a group
+ of USB devices, such as mass storage devices or digital cameras. You can specify none or
+ all of these attributes. Specifying no attributes matches every USB device, so only do this
+ if your application requires it:</p>
+
+ <ul>
+ <li><code>vendor-id</code></li>
+
+ <li><code>product-id</code></li>
+
+ <li><code>class</code></li>
+
+ <li><code>subclass</code></li>
+
+ <li><code>protocol</code> (device or interface)</li>
+ </ul>
+
+ <p>Save the resource file in the <code>res/xml/</code> directory. The resource file name
+ (without the .xml extension) must be the same as the one you specified in the
+ <code><meta-data></code> element. The format for the XML resource file is in the
+ <a href="#example">example</a> below.</p>
+ </li>
+ </ul>
+
+ <h3 id="manifest-example">Manifest and resource file examples</h3>
+
+ <p>The following example shows a sample manifest and its corresponding resource file:</p>
+ <pre>
+<manifest ...>
+ <uses-feature android:name="android.hardware.usb.host" />
+ <uses-sdk android:minSdkVersion="12" />
+ ...
+ <application>
+ <activity ...>
+ ...
+ <intent-filter>
+ <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
+ </intent-filter>
+
+ <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
+ android:resource="@xml/device_filter" />
+ </activity>
+ </application>
+</manifest>
+</pre>
+
+ <p>In this case, the following resource file should be saved in
+ <code>res/xml/device_filter.xml</code> and specifies that any USB device with the specified
+ attributes should be filtered:</p>
+ <pre>
+<?xml version="1.0" encoding="utf-8"?>
+
+<resources>
+ <usb-device vendor-id="1234" product-id="5678" class="255" subclass="66" protocol="1" />
+</resources>
+</pre>
+
+ <h2 id="working-d">Working with Devices</h2>
+
+ <p>When users connect USB devices to an Android-powered device, the Android system can determine
+ whether your application is interested in the connected device. If so, you can set up
+ communication with the device if desired. To do this, your application has to:</p>
+
+ <ol>
+ <li>Discover connected USB devices by using an intent filter to be notified when the user
+ connects a USB device or by enumerating USB devices that are already connected.</li>
+
+ <li>Ask the user for permission to connect to the USB device, if not already obtained.</li>
+
+ <li>Communicate with the USB device by reading and writing data on the appropriate interface
+ endpoints.</li>
+ </ol>
+
+ <h3 id="discovering-d">Discovering a device</h3>
+
+ <p>Your application can discover USB devices by either using an intent filter to be notified when
+ the user connects a device or by enumerating USB devices that are already connected. Using an
+ intent filter is useful if you want to be able to have your application automatically detect a
+ desired device. Enumerating connected USB devices is useful if you want to get a list of all
+ connected devices or if your application did not filter for an intent.</p>
+
+ <h4 id="using-intents">Using an intent filter</h4>
+
+ <p>To have your application discover a particular USB device, you can specify an intent filter to
+ filter for the <code>android.hardware.usb.action.USB_DEVICE_ATTACHED</code> intent. Along with
+ this intent filter, you need to specify a resource file that specifies properties of the USB
+ device, such as product and vendor ID. When users connect a device that matches your device
+ filter, the system presents them with a dialog that asks if they want to start your application.
+ If users accept, your application automatically has permission to access the device until the
+ device is disconnected.</p>
+
+ <p>The following example shows how to declare the intent filter:</p>
+ <pre>
+<activity ...>
+...
+ <intent-filter>
+ <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
+ </intent-filter>
+
+ <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
+ android:resource="@xml/device_filter" />
+</activity>
+</pre>
+
+ <p>The following example shows how to declare the corresponding resource file that specifies the
+ USB devices that you're interested in:</p>
+ <pre>
+<?xml version="1.0" encoding="utf-8"?>
+
+<resources>
+ <usb-device vendor-id="1234" product-id="5678" />
+</resources>
+</pre><!-- REMEMBER TO ADD PROTOCOL, and device class and subclass, if applicable -->
+
+ <p>In your activity, you can obtain the {@link android.hardware.usb.UsbDevice} that represents
+ the attached device from the intent like this:</p>
+ <pre>
+UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
+</pre>
+
+ <h4>Enumerating devices</h4>
+
+ <p>If your application is interested in inspecting all of the USB devices currently connected
+ while your application is running, it can enumerate devices on the bus. Use the {@link
+ android.hardware.usb.UsbManager#getDeviceList() getDeviceList()} method to get a hash map of all
+ the USB devices that are connected. The hash map is keyed by the USB device's name if you want to
+ obtain a device from the map.</p>
+ <pre>
+UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
+...
+HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
+UsbDevice device = deviceList.get("deviceName");
+</pre>
+
+ <p>If desired, you can also just obtain an iterator from the hash map and process each device one
+ by one:</p>
+ <pre>
+UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
+...
+HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
+Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
+while(deviceIterator.hasNext()){
+ UsbDevice device = deviceIterator.next()
+ //your code
+}
+</pre>
+
+ <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
+ users.</p>
+
+ <p class="note"><strong>Note:</strong> If your application <a href="#using-intents">uses an
+ intent filter</a> to discover USB devices as they're connected, it automatically receives
+ permission if the user allows your application to handle the intent. If not, you must request
+ permission explicitly in your application before connecting to the device.</p>
+
+ <p>Explicitly asking for permission might be neccessary in some situations such as when your
+ application enumerates USB devices that are already connected and then wants to communicate with
+ one. You must check for permission to access a device before trying to communicate with it. If
+ not, you will receive a runtime error if the user denied permission to access the device.</p>
+
+ <p>To explicitly obtain permission, first create a broadcast receiver. This receiver listens for
+ the intent that gets broadcast when you call {@link
+ android.hardware.usb.UsbManager#requestPermission requestPermission()}. The call to {@link
+ android.hardware.usb.UsbManager#requestPermission requestPermission()} displays a dialog to the
+ user asking for permission to connect to the device. The following sample code shows how to
+ create the broadcast receiver:</p>
+ <pre>
+private static final String ACTION_USB_PERMISSION =
+ "com.android.example.USB_PERMISSION";
+private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
+
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ if (ACTION_USB_PERMISSION.equals(action)) {
+ synchronized (this) {
+ UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
+
+ if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {
+ if(device != null){
+ //call method to set up device communication
+ }
+ }
+ else {
+ Log.d(TAG, "permission denied for device " + device);
+ }
+ }
+ }
+ }
+};
+</pre>
+
+ <p>To register the broadcast receiver, add this in your <code>onCreate()</code> method in your
+ activity:</p>
+ <pre>
+UsbManager mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
+private static final String ACTION_USB_PERMISSION =
+ "com.android.example.USB_PERMISSION";
+...
+mPermissionIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0);
+IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
+registerReceiver(mUsbReceiver, filter);
+</pre>
+
+ <p>To display the dialog that asks users for permission to connect to the device, call the {@link
+ android.hardware.usb.UsbManager#requestPermission requestPermission()} method:</p>
+ <pre>
+UsbDevice device;
+...
+mUsbManager.requestPermission(device, mPermissionIntent);
+</pre>
+
+ <p>When users reply to the dialog, your broadcast receiver receives the intent that contains the
+ {@link android.hardware.usb.UsbManager#EXTRA_PERMISSION_GRANTED} extra, which is a boolean
+ representing the answer. Check this extra for a value of true before connecting to the
+ device.</p>
+
+ <h3 id="communicating-d">Communicating with a device</h3>
+
+ <p>Communication with a USB device can be either synchronous or asynchronous. In either case, you
+ should create a new thread on which to carry out all data transmissions, so you don't block the
+ UI thread. To properly set up communication with a device, you need to obtain the appropriate
+ {@link android.hardware.usb.UsbInterface} and {@link android.hardware.usb.UsbEndpoint} of the
+ device that you want to communicate on and send requests on this endpoint with a {@link
+ android.hardware.usb.UsbDeviceConnection}. In general, your code should:</p>
+
+ <ul>
+ <li>Check a {@link android.hardware.usb.UsbDevice} object's attributes, such as product ID,
+ vendor ID, or device class to figure out whether or not you want to communicate with the
+ device.</li>
+
+ <li>When you are certain that you want to communicate with the device, find the appropriate
+ {@link android.hardware.usb.UsbInterface} that you want to use to communicate along with the
+ appropriate {@link android.hardware.usb.UsbEndpoint} of that interface. Interfaces can have one
+ or more endpoints, and commonly will have an input and output endpoint for two-way
+ communication.</li>
+
+ <li>When you find the correct endpoint, open a {@link android.hardware.usb.UsbDeviceConnection}
+ on that endpoint.</li>
+
+ <li>Supply the data that you want to transmit on the endpoint with the {@link
+ android.hardware.usb.UsbDeviceConnection#bulkTransfer bulkTransfer()} or {@link
+ android.hardware.usb.UsbDeviceConnection#controlTransfer controlTransfer()} method. You should
+ carry out this step in another thread to prevent blocking the main UI thread. For more
+ information about using threads in Android, see <a href=
+ "{@docRoot}guide/components/processes-and-threads.html#Threads">Processes and
+ Threads</a>.</li>
+ </ul>
+
+ <p>The following code snippet is a trivial way to do a synchronous data transfer. Your code
+ 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 static int TIMEOUT = 0;
+private boolean forceClaim = true;
+
+...
+
+UsbInterface intf = device.getInterface(0);
+UsbEndpoint endpoint = intf.getEndpoint(0);
+UsbDeviceConnection connection = mUsbManager.openDevice(device);
+connection.claimInterface(intf, forceClaim);
+connection.bulkTransfer(endpoint, bytes, bytes.length, TIMEOUT); //do in another thread
+</pre>
+
+ <p>To send data asynchronously, use the {@link android.hardware.usb.UsbRequest} class to {@link
+ android.hardware.usb.UsbRequest#initialize initialize} and {@link
+ android.hardware.usb.UsbRequest#queue queue} an asynchronous request, then wait for the result
+ with {@link android.hardware.usb.UsbDeviceConnection#requestWait requestWait()}.</p>
+
+ <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
+ shows how to listen on an interrupt endpoint asynchronously.</p>
+
+ <h3 id="terminating-d">Terminating communication with a device</h3>
+
+ <p>When you are done communicating with a device or if the device was detached, close the {@link
+ android.hardware.usb.UsbInterface} and {@link android.hardware.usb.UsbDeviceConnection} by
+ calling {@link android.hardware.usb.UsbDeviceConnection#releaseInterface releaseInterface()} and
+ {@link android.hardware.usb.UsbDeviceConnection#close() close()}. To listen for detached events,
+ create a broadcast receiver like below:</p>
+ <pre>
+BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+
+ if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action)) {
+ UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
+ if (device != null) {
+ // call your method that cleans up and closes communication with the device
+ }
+ }
+ }
+};
+</pre>
+
+ <p>Creating the broadcast receiver within the application, and not the manifest, allows your
+ application to only handle detached events while it is running. This way, detached events are
+ only sent to the application that is currently running and not broadcast to all applications.</p>
+
diff --git a/docs/html/guide/topics/connectivity/usb/index.jd b/docs/html/guide/topics/connectivity/usb/index.jd
new file mode 100644
index 0000000..7086ab1
--- /dev/null
+++ b/docs/html/guide/topics/connectivity/usb/index.jd
@@ -0,0 +1,67 @@
+page.title=USB Host and Accessory
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>Topics</h2>
+
+ <ol>
+ <li><a href="{@docRoot}guide/topics/connectivity/usb/accessory.html">USB Accessory</a></li>
+
+ <li><a href="{@docRoot}guide/topics/connectivity/usb/host.html">USB Host</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>Android supports a variety of USB peripherals and Android USB accessories (hardware that
+ implements the Android accessory protocol) through two modes: USB accessory and USB host. In USB
+ accessory mode, the external USB hardware act as the USB hosts. Examples of accessories might
+ include robotics controllers; docking stations; diagnostic and musical equipment; kiosks; card
+ readers; and much more. This gives Android-powered devices that do not have host capabilities the
+ ability to interact with USB hardware. Android USB accessories must be designed to work with
+ Android-powered devices and must adhere to the <a href=
+ "http://accessories.android.com/demokit">Android accessory communication protocol</a>. In USB
+ host mode, the Android-powered device acts as the host. Examples of devices include digital
+ cameras, keyboards, mice, and game controllers. USB devices that are designed for a wide range of
+ applications and environments can still interact with Android applications that can correctly
+ communicate with the device.</p>
+
+ <p>Figure 1 shows the differences between the two modes. When the Android-powered device is in
+ host mode, it acts as the USB host and powers the bus. When the Android-powered device is in USB
+ accessory mode, the connected USB hardware (an Android USB accessory in this case) acts as the
+ host and powers the bus.</p><img src="{@docRoot}images/usb-host-accessory.png" alt="">
+
+ <p class="img-caption"><strong>Figure 1.</strong> USB Host and Accessory Modes</p>
+
+ <p>USB accessory and host modes are directly supported in Android 3.1 (API level 12) or newer
+ platforms. USB accessory mode is also backported to Android 2.3.4 (API level 10) as an add-on
+ library to support a broader range of devices. Device manufacturers can choose whether or not to
+ include the add-on library on the device's system image.</p>
+
+ <p class="note"><strong>Note:</strong> Support for USB host and accessory modes are ultimately
+ dependant on the device's hardware, regardless of platform level. You can filter for devices that
+ support USB host and accessory through a <a href=
+ "{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature></a> element. See
+ the USB <a href="{@docRoot}guide/topics/connectivity/usb/accessory.html">accessory</a> and <a href=
+ "{@docRoot}guide/topics/connectivity/usb/host.html">host</a> documentation for more details.</p>
+
+ <h2>Debugging considerations</h2>
+
+ <p>When debugging applications that use USB accessory or host features, you most likely will have
+ USB hardware connected to your Android-powered device. This will prevent you from having an
+ <code>adb</code> connection to the Android-powered device via USB. You can still access
+ <code>adb</code> over a network connection. To enable <code>adb</code> over a network
+ connection:</p>
+
+ <ol>
+ <li>Connect the Android-powered device via USB to your computer.</li>
+
+ <li>From your SDK <code>platform-tools/</code> directory, enter <code>adb tcpip 5555</code> at
+ the command prompt.</li>
+
+ <li>Enter <code>adb connect <device-ip-address>:5555</code> You should now be connected
+ to the Android-powered device and can issue the usual <code>adb</code> commands like <code>adb
+ logcat</code>.</li>
+
+ <li>To set your device to listen on USB, enter <code>adb usb</code>.</li>
+ </ol>
diff --git a/docs/html/guide/topics/wireless/wifip2p.jd b/docs/html/guide/topics/connectivity/wifip2p.jd
similarity index 100%
rename from docs/html/guide/topics/wireless/wifip2p.jd
rename to docs/html/guide/topics/connectivity/wifip2p.jd
diff --git a/docs/html/guide/topics/data/backup.jd b/docs/html/guide/topics/data/backup.jd
index d91e422..602b6e8 100644
--- a/docs/html/guide/topics/data/backup.jd
+++ b/docs/html/guide/topics/data/backup.jd
@@ -47,7 +47,7 @@
<h2>See also</h2>
<ol>
- <li><a href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool</a></li>
+ <li><a href="{@docRoot}tools/help/bmgr.html">{@code bmgr} tool</a></li>
</ol>
</div>
@@ -316,7 +316,7 @@
<p class="note"><strong>Tip:</strong> While developing your application, you can initiate an
immediate backup operation from the Backup Manager with the <a
-href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool</a>.</p>
+href="{@docRoot}tools/help/bmgr.html">{@code bmgr} tool</a>.</p>
<p>When the Backup Manager calls your {@link
android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor,BackupDataOutput,ParcelFileDescriptor)
@@ -460,7 +460,7 @@
href="#RequestingRestore">Requesting restore</a> for more information).</p>
<p class="note"><strong>Note:</strong> While developing your application, you can also request a
-restore operation with the <a href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr}
+restore operation with the <a href="{@docRoot}tools/help/bmgr.html">{@code bmgr}
tool</a>.</p>
<p>When the Backup Manager calls your {@link
@@ -863,7 +863,7 @@
<p class="note"><strong>Note:</strong> While developing your application, you can request a
backup and initiate an immediate backup operation with the <a
-href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr}
+href="{@docRoot}tools/help/bmgr.html">{@code bmgr}
tool</a>.</p>
@@ -878,7 +878,7 @@
implementation, passing the data from the current set of backup data.</p>
<p class="note"><strong>Note:</strong> While developing your application, you can request a
-restore operation with the <a href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr}
+restore operation with the <a href="{@docRoot}tools/help/bmgr.html">{@code bmgr}
tool</a>.</p>
@@ -886,7 +886,7 @@
<p>Once you've implemented your backup agent, you can test the backup and restore functionality
with the following procedure, using <a
-href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr}</a>.</p>
+href="{@docRoot}tools/help/bmgr.html">{@code bmgr}</a>.</p>
<ol>
<li>Install your application on a suitable Android system image
diff --git a/docs/html/guide/topics/data/data-storage.jd b/docs/html/guide/topics/data/data-storage.jd
index d31afa5..e9d2d25 100644
--- a/docs/html/guide/topics/data/data-storage.jd
+++ b/docs/html/guide/topics/data/data-storage.jd
@@ -1,4 +1,4 @@
-page.title=Data Storage
+page.title=Storage Options
@jd:body
@@ -16,22 +16,9 @@
<h2>In this document</h2>
<ol>
<li><a href="#pref">Using Shared Preferences</a></li>
- <li><a href="#filesInternal">Using the Internal Storage</a>
- <ol>
- <li><a href="#InternalCache">Saving cache files</a></li>
- <li><a href="#InternalMethods">Other useful methods</a></li>
- </ol></li>
- <li><a href="#filesExternal">Using the External Storage</a>
- <ol>
- <li><a href="#MediaAvail">Checking media availability</a></li>
- <li><a href="#AccessingExtFiles">Accessing files on external storage</a></li>
- <li><a href="#SavingSharedFiles">Saving files that should be shared</a></li>
- <li><a href="#ExternalCache">Saving cache files</a></li>
- </ol></li>
- <li><a href="#db">Using Databases</a>
- <ol>
- <li><a href="#dbDebugging">Database debugging</a></li>
- </ol></li>
+ <li><a href="#filesInternal">Using the Internal Storage</a></li>
+ <li><a href="#filesExternal">Using the External Storage</a></li>
+ <li><a href="#db">Using Databases</a></li>
<li><a href="#netw">Using a Network Connection</a></li>
</ol>
@@ -449,7 +436,7 @@
<p>The Android SDK includes a {@code sqlite3} database tool that allows you to browse
table contents, run SQL commands, and perform other useful functions on SQLite
-databases. See <a href="{@docRoot}guide/developing/tools/adb.html#sqlite">Examining sqlite3
+databases. See <a href="{@docRoot}tools/help/adb.html#sqlite">Examining sqlite3
databases from a remote shell</a> to learn how to run this tool.
</p>
diff --git a/docs/html/guide/topics/data/index.html b/docs/html/guide/topics/data/index.html
deleted file mode 100644
index a94f8c0..0000000
--- a/docs/html/guide/topics/data/index.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=data-storage.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<a href="data-storage.html">click here</a> if you are not redirected.
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/topics/data/index.jd b/docs/html/guide/topics/data/index.jd
new file mode 100644
index 0000000..1e082b3
--- /dev/null
+++ b/docs/html/guide/topics/data/index.jd
@@ -0,0 +1,23 @@
+page.title=Data Storage
+page.landing=true
+page.landing.intro=Store application data in databases, files, or preferences, in internal or removeable storage. You can also add a data backup service to let users store and recover application and system data.
+page.landing.image=
+
+@jd:body
+
+<div class="landing-docs">
+
+
+ <div class="col-12">
+ <h3>Training</h3>
+
+ <a href="http://developer.android.com/training/cloudsync/index.html">
+ <h4>Syncing to the Cloud</h4>
+ <p>This class covers different strategies for cloud enabled applications. It covers syncing
+data with the cloud using your own back-end web application, and backing up data using the cloud so
+that users can restore their data when installing your application on a new device.</p>
+ </a>
+
+ </div>
+
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/topics/data/install-location.jd b/docs/html/guide/topics/data/install-location.jd
new file mode 100644
index 0000000..19c4b39
--- /dev/null
+++ b/docs/html/guide/topics/data/install-location.jd
@@ -0,0 +1,206 @@
+page.title=App Install Location
+@jd:body
+
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Quickview</h2>
+ <ul>
+ <li>You can allow your application to install on the device's external storage.</li>
+ <li>Some types of applications should <strong>not</strong> allow installation on the external
+storage.</li>
+ <li>Installing on the external storage is ideal for large applications that are not tightly
+integrated with the system (most commonly, games).</li>
+ </ul>
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#Compatiblity">Backward Compatibility</a></li>
+ <li><a href="#ShouldNot">Applications That Should NOT Install on External Storage</a></li>
+ <li><a href="#Should">Applications That Should Install on External Storage</a></li>
+ </ol>
+
+ <h2>See also</h2>
+ <ol>
+ <li><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">
+<manifest></a></code></li>
+ </ol>
+
+</div>
+</div>
+
+<p>Beginning with API Level 8, you can allow your application to be installed on the
+external storage (for example, the device's SD card). This is an optional feature you can declare
+for your application with the <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#install">{@code
+android:installLocation}</a> manifest attribute. If you do
+<em>not</em> declare this attribute, your application will be installed on the internal storage
+only and it cannot be moved to the external storage.</p>
+
+<p>To allow the system to install your application on the external storage, modify your
+manifest file to include the <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#install">{@code
+android:installLocation}</a> attribute in the <code><a
+href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element,
+with a value of either "{@code preferExternal}" or "{@code auto}". For example:</p>
+
+<pre>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ android:installLocation="preferExternal"
+ ... >
+</pre>
+
+<p>If you declare "{@code preferExternal}", you request that your application be installed on the
+external storage, but the system does not guarantee that your application will be installed on
+the external storage. If the external storage is full, the system will install it on the internal
+storage. The user can also move your application between the two locations.</p>
+
+<p>If you declare "{@code auto}", you indicate that your application may be installed on the
+external storage, but you don't have a preference of install location. The system will
+decide where to install your application based on several factors. The user can also move your
+application between the two locations.</p>
+
+<p>When your application is installed on the external storage:</p>
+<ul>
+ <li>There is no effect on the application performance so long
+as the external storage is mounted on the device.</li>
+ <li>The {@code .apk} file is saved on the external storage, but all private user data,
+databases, optimized {@code .dex} files, and extracted native code are saved on the
+internal device memory.</li>
+ <li>The unique container in which your application is stored is encrypted with a randomly
+generated key that can be decrypted only by the device that originally installed it. Thus, an
+application installed on an SD card works for only one device.</li>
+ <li>The user can move your application to the internal storage through the system settings.</li>
+</ul>
+
+<p class="warning"><strong>Warning:</strong> When the user enables USB mass storage to share files
+with a computer or unmounts the SD card via the system settings, the external storage is unmounted
+from the device and all applications running on the external storage are immediately killed.</p>
+
+
+
+<h2 id="Compatiblity">Backward Compatibility</h2>
+
+<p>The ability for your application to install on the external storage is a feature available only
+on devices running API Level 8 (Android 2.2) or greater. Existing applications that were built prior
+to API Level 8 will always install on the internal storage and cannot be moved to the external
+storage (even on devices with API Level 8). However, if your application is designed to support an
+API Level <em>lower than</em> 8, you can choose to support this feature for devices with API Level 8
+or greater and still be compatible with devices using an API Level lower than 8.</p>
+
+<p>To allow installation on external storage and remain compatible with versions lower than API
+Level 8:</p>
+<ol>
+ <li>Include the {@code android:installLocation} attribute with a value of "{@code auto}" or
+"{@code preferExternal}" in the <code><a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><manifest></a></code>
+element.</li>
+ <li>Leave your {@code android:minSdkVersion} attribute as is (something <em>less
+than</em> "8") and be certain that your application code uses only APIs compatible with that
+level.</li>
+ <li>In order to compile your application, change your build target to API Level 8. This is
+necessary because older Android libraries don't understand the {@code android:installLocation}
+attribute and will not compile your application when it's present.</li>
+</ol>
+
+<p>When your application is installed on a device with an API Level lower than 8, the {@code
+android:installLocation} attribute is ignored and the application is installed on the internal
+storage.</p>
+
+<p class="caution"><strong>Caution:</strong> Although XML markup such as this will be ignored by
+older platforms, you must be careful not to use programming APIs introduced in API Level 8
+while your {@code minSdkVersion} is less than "8", unless you perform the work necessary to
+provide backward compatibility in your code. For information about building
+backward compatibility in your application code, see the <a
+href="{@docRoot}resources/articles/backward-compatibility.html">Backward Compatibility</a>
+article.</p>
+
+
+
+<h2 id="ShouldNot">Applications That Should NOT Install on External Storage</h2>
+
+<p>When the user enables USB mass storage to share files with their computer (or otherwise
+unmounts or removes the external storage), any application
+installed on the external storage and currently running is killed. The system effectively becomes
+unaware of the application until mass storage is disabled and the external storage is
+remounted on the device. Besides killing the application and making it unavailable to the user,
+this can break some types of applications in a more serious way. In order for your application to
+consistently behave as expected, you <strong>should not</strong> allow your application to be
+installed on the external storage if it uses any of the following features, due to the cited
+consequences when the external storage is unmounted:</p>
+
+<dl>
+ <dt>Services</dt>
+ <dd>Your running {@link android.app.Service} will be killed and will not be restarted when
+external storage is remounted. You can, however, register for the {@link
+android.content.Intent#ACTION_EXTERNAL_APPLICATIONS_AVAILABLE} broadcast Intent, which will notify
+your application when applications installed on external storage have become available to the
+system again. At which time, you can restart your Service.</dd>
+ <dt>Alarm Services</dt>
+ <dd>Your alarms registered with {@link android.app.AlarmManager} will be cancelled. You must
+manually re-register any alarms when external storage is remounted.</dd>
+ <dt>Input Method Engines</dt>
+ <dd>Your <a href="{@docRoot}resources/articles/on-screen-inputs.html">IME</a> will be
+replaced by the default IME. When external storage is remounted, the user can open system settings
+to enable your IME again.</dd>
+ <dt>Live Wallpapers</dt>
+ <dd>Your running <a href="{@docRoot}resources/articles/live-wallpapers.html">Live Wallpaper</a>
+will be replaced by the default Live Wallpaper. When external storage is remounted, the user can
+select your Live Wallpaper again.</dd>
+ <dt>Live Folders</dt>
+ <dd>Your <a href="{@docRoot}resources/articles/live-folders.html">Live Folder</a> will be
+removed from the home screen. When external storage is remounted, the user can add your Live Folder
+to the home screen again.</dd>
+ <dt>App Widgets</dt>
+ <dd>Your <a href="{@docRoot}guide/topics/appwidgets/index.html">App Widget</a> will be removed
+from the home screen. When external storage is remounted, your App Widget will <em>not</em> be
+available for the user to select until the system resets the home application (usually not until a
+system reboot).</dd>
+ <dt>Account Managers</dt>
+ <dd>Your accounts created with {@link android.accounts.AccountManager} will disappear until
+external storage is remounted.</dd>
+ <dt>Sync Adapters</dt>
+ <dd>Your {@link android.content.AbstractThreadedSyncAdapter} and all its sync functionality will
+not work until external storage is remounted.</dd>
+ <dt>Device Administrators</dt>
+ <dd>Your {@link android.app.admin.DeviceAdminReceiver} and all its admin capabilities will
+be disabled, which can have unforeseeable consequences for the device functionality, which may
+persist after external storage is remounted.</dd>
+ <dt>Broadcast Receivers listening for "boot completed"</dt>
+ <dd>The system delivers the {@link android.content.Intent#ACTION_BOOT_COMPLETED} broadcast
+before the external storage is mounted to the device. If your application is installed on the
+external storage, it can never receive this broadcast.</dd>
+ <dt>Copy Protection</dt>
+ <dd>Your application cannot be installed to a device's SD card if it uses Google Play's
+ Copy Protection feature. However, if you use Google Play's
+ <a href="{@docRoot}guide/google/play/licensing.html">Application Licensing</a> instead, your
+ application <em>can</em> be installed to internal or external storage, including SD cards.</dd>
+</dl>
+
+<p>If your application uses any of the features listed above, you <strong>should not</strong> allow
+your application to install on external storage. By default, the system <em>will not</em> allow your
+application to install on the external storage, so you don't need to worry about your existing
+applications. However, if you're certain that your application should never be installed on the
+external storage, then you should make this clear by declaring <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#install">{@code
+android:installLocation}</a> with a value of "{@code internalOnly}". Though this does not
+change the default behavior, it explicitly states that your application should only be installed
+on the internal storage and serves as a reminder to you and other developers that this decision has
+been made.</p>
+
+
+<h2 id="Should">Applications That Should Install on External Storage</h2>
+
+<p>In simple terms, anything that does not use the features listed in the previous section
+are safe when installed on external storage. Large games are more commonly the types of
+applications that should allow installation on external storage, because games don't typically
+provide additional services when inactive. When external storage becomes unavailable and a game
+process is killed, there should be no visible effect when the storage becomes available again and
+the user restarts the game (assuming that the game properly saved its state during the normal
+<a href="{@docRoot}guide/components/activities.html#Lifecycle">Activity lifecycle</a>).</p>
+
+<p>If your application requires several megabytes for the APK file, you should
+carefully consider whether to enable the application to install on the external storage so that
+users can preserve space on their internal storage.</p>
+
diff --git a/docs/html/guide/topics/drawing/index.html b/docs/html/guide/topics/drawing/index.html
deleted file mode 100644
index 43c1499..0000000
--- a/docs/html/guide/topics/drawing/index.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=opengl.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<a href="opengl.html">click here</a> if you are not redirected.
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/topics/drawing/opengl.jd b/docs/html/guide/topics/drawing/opengl.jd
deleted file mode 100644
index e22a251..0000000
--- a/docs/html/guide/topics/drawing/opengl.jd
+++ /dev/null
@@ -1,53 +0,0 @@
-page.title=OpenGL
-@jd:body
-
-<p>Android includes support for 3D hardware acceleration. This functionality is
-accessed via the OpenGL API — specifically, the OpenGL ES API.</p>
-
-<p>OpenGL ES is a flavor of the OpenGL specification intended for embedded
-devices. Versions of OpenGL ES are loosely peered to versions of the primary
-OpenGL standard. Android currently supports OpenGL ES 1.0, which corresponds
-to OpenGL 1.3. So, if the application you have in mind is possible with OpenGL
-1.3 on a desktop system, it should be possible on Android.</p>
-
-<p>The specific API provided by Android is similar to the J2ME JSR239 OpenGL
-ES API. However, it may not be identical, so watch out for deviations.</p>
-
-<h2>Using the API</h2>
-
-<p>Here's how to use the API at an extremely high level:</p>
-
-<ol>
-<li>Write a custom View subclass.</li>
-<li>Obtain a handle to an OpenGLContext, which provides access to the OpenGL functionality.</li>
-<li>In your View's onDraw() method, get a handle to a GL object, and use its methods to perform GL operations.</li>
-</ol>
-
-<p>For an example of this usage model (based on the classic GL ColorCube),
-see
-<a href="{@docRoot}samples/ApiDemos/src/com/example/android/apis/graphics/GLView1.html">com.android.samples.graphics.GLView1.java</a>
-in the ApiDemos sample code project. A slightly more sophisticated version showing how to use
-it with threads can be found in
-<a href="{@docRoot}samples/ApiDemos/src/com/example/android/apis/graphics/GLSurfaceViewActivity.html">com.android.samples.graphics.GLSurfaceViewActivity.java</a>.
-</p>
-
-<p>Writing a summary of how to actually write 3D applications using OpenGL is
-beyond the scope of this text and is left as an exercise for the reader.</p>
-
-<h2>Links to Additional Information</h2>
-
-<p>Information about OpenGL ES can be
-found at <a title="http://www.khronos.org/opengles/"
-href="http://www.khronos.org/opengles/">http://www.khronos.org/opengles/</a>.</p>
-
-<p>Information specifically
-about OpenGL ES 1.0 (including a detailed specification) can be found
-at <a title="http://www.khronos.org/opengles/1_X/"
-href="http://www.khronos.org/opengles/1_X/">http://www.khronos.org/opengles/1_X/</a>.</p>
-
-<p>The documentation for the Android {@link javax.microedition.khronos.opengles.GL
-OpenGL ES implementations} are also available.</p>
-
-<p>Finally, note that though Android does include some basic support for
-OpenGL ES 1.1, the support is <strong>not complete</strong>, and should not be relied
-upon at this time.</p>
diff --git a/docs/html/guide/topics/fundamentals.jd b/docs/html/guide/topics/fundamentals.jd
deleted file mode 100644
index a86d905..0000000
--- a/docs/html/guide/topics/fundamentals.jd
+++ /dev/null
@@ -1,518 +0,0 @@
-page.title=Application Fundamentals
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>Quickview</h2>
-<ul>
- <li>Android applications are composed of one or more application components (activities,
-services, content providers, and broadcast receivers)</li>
- <li>Each component performs a different role in the overall application behavior, and each
-one can be activated individually (even by other applications)</li>
- <li>The manifest file must declare all components in the application and should also declare
-all application requirements, such as the minimum version of Android required and any hardware
-configurations required</li>
- <li>Non-code application resources (images, strings, layout files, etc.) should include
-alternatives for different device configurations (such as different strings for different
-languages and different layouts for different screen sizes)</li>
-</ul>
-
-
-<h2>In this document</h2>
-<ol>
-<li><a href="#Components">Application Components</a>
- <ol>
- <li><a href="#ActivatingComponents">Activating components</a></li>
- </ol>
-</li>
-<li><a href="#Manifest">The Manifest File</a>
- <ol>
- <li><a href="#DeclaringComponents">Declaring components</a></li>
- <li><a href="#DeclaringRequirements">Declaring application requirements</a></li>
- </ol>
-</li>
-<li><a href="#Resources">Application Resources</a></li>
-</ol>
-</div>
-</div>
-
-<p>Android applications are written in the Java programming language. The Android SDK tools compile
-the code—along with any data and resource files—into an <i>Android package</i>, an
-archive file with an {@code .apk} suffix. All the code in a single {@code .apk} file is considered
-to be one application and is the file that Android-powered devices use to install the
-application.</p>
-
-<p>Once installed on a device, each Android application lives in its own security sandbox: </p>
-
-<ul>
- <li>The Android operating system is a multi-user Linux system in which each application is a
-different user.</li>
-
-<li>By default, the system assigns each application a unique Linux user ID (the ID is used only by
-the system and is unknown to the application). The system sets permissions for all the files in an
-application so that only the user ID assigned to that application can access them. </li>
-
-<li>Each process has its own virtual machine (VM), so an application's code runs in isolation from
-other applications.</li>
-
-<li>By default, every application runs in its own Linux process. Android starts the process when any
-of the application's components need to be executed, then shuts down the process when it's no longer
-needed or when the system must recover memory for other applications.</li>
-</ul>
-
-<p>In this way, the Android system implements the <em>principle of least privilege</em>. That is,
-each application, by default, has access only to the components that it requires to do its work and
-no more. This creates a very secure environment in which an application cannot access parts of
-the system for which it is not given permission.</p>
-
-<p>However, there are ways for an application to share data with other applications and for an
-application to access system services:</p>
-
-<ul>
- <li>It's possible to arrange for two applications to share the same Linux user ID, in which case
-they are able to access each other's files. To conserve system resources, applications with the
-same user ID can also arrange to run in the same Linux process and share the same VM (the
-applications must also be signed with the same certificate).</li>
- <li>An application can request permission to access device data such as the user's
-contacts, SMS messages, the mountable storage (SD card), camera, Bluetooth, and more. All
-application permissions must be granted by the user at install time.</li>
-</ul>
-
-<p>That covers the basics regarding how an Android application exists within the system. The rest of
-this document introduces you to:</p>
-<ul>
- <li>The core framework components that define your application.</li>
- <li>The manifest file in which you declare components and required device features for your
-application.</li>
- <li>Resources that are separate from the application code and allow your application to
-gracefully optimize its behavior for a variety of device configurations.</li>
-</ul>
-
-<!--
-<p class="note"><strong>Tip:</strong> If you're new to Android development, we suggest that you
-follow the Beginner's Path link at the bottom of this page. For each document in the Application
-Fundamentals, the Beginner's Path points you to the document we suggest you read next, in order
-to get up to speed on the core Android concepts.</p>
--->
-
-
-<h2 id="Components">Application Components</h2>
-
-<p>Application components are the essential building blocks of an Android application. Each
-component is a different point through which the system can enter your application. Not all
-components are actual entry points for the user and some depend on each other, but each one exists
-as its own entity and plays a specific role—each one is a unique building block that
-helps define your application's overall behavior.</p>
-
-<p>There are four different types of application components. Each type serves a distinct purpose
-and has a distinct lifecycle that defines how the component is created and destroyed.</p>
-
-<p>Here are the four types of application components:</p>
-
-<dl>
-
-<dt><b>Activities</b></dt>
-
-<dd>An <i>activity</i> represents a single screen with a user interface. For example,
-an email application might have one activity that shows a list of new
-emails, another activity to compose an email, and another activity for reading emails. Although
-the activities work together to form a cohesive user experience in the email application, each one
-is independent of the others. As such, a different application can start any one of these
-activities (if the email application allows it). For example, a camera application can start the
-activity in the email application that composes new mail, in order for the user to share a picture.
-
-<p>An activity is implemented as a subclass of {@link android.app.Activity} and you can learn more
-about it in the <a href="{@docRoot}guide/topics/fundamentals/activities.html">Activities</a>
-developer guide.</p>
-</dd>
-
-
-<dt><b>Services</b></dt>
-
-<dd>A <i>service</i> is a component that runs in the background to perform long-running
-operations or to perform work for remote processes. A service
-does not provide a user interface. For example, a service might play music in the background while
-the user is in a different application, or it might fetch data over the network without
-blocking user interaction with an activity. Another component, such as an activity, can start the
-service and let it run or bind to it in order to interact with it.
-
-<p>A service is implemented as a subclass of {@link android.app.Service} and you can learn more
-about it in the <a href="{@docRoot}guide/topics/fundamentals/services.html">Services</a> developer
-guide.</p>
-</dd>
-
-
-<dt><b>Content providers</b></dt>
-
-<dd>A <i>content provider</i> manages a shared set of application data. You can store the data in
-the file system, an SQLite database, on the web, or any other persistent storage location your
-application can access. Through the content provider, other applications can query or even modify
-the data (if the content provider allows it). For example, the Android system provides a content
-provider that manages the user's contact information. As such, any application with the proper
-permissions can query part of the content provider (such as {@link
-android.provider.ContactsContract.Data}) to read and write information about a particular person.
-
-<p>Content providers are also useful for reading and writing data that is private to your
-application and not shared. For example, the <a
-href="{@docRoot}resources/samples/NotePad/index.html">Note Pad</a> sample application uses a
-content provider to save notes.</p>
-
-<p>A content provider is implemented as a subclass of {@link android.content.ContentProvider}
-and must implement a standard set of APIs that enable other applications to perform
-transactions. For more information, see the <a
-href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a> developer
-guide.</p>
-</dd>
-
-
-<dt><b>Broadcast receivers</b></dt>
-
-<dd>A <i>broadcast receiver</i> is a component that responds to system-wide broadcast
-announcements. Many broadcasts originate from the system—for example, a broadcast announcing
-that the screen has turned off, the battery is low, or a picture was captured.
-Applications can also initiate broadcasts—for example, to let other applications know that
-some data has been downloaded to the device and is available for them to use. Although broadcast
-receivers don't display a user interface, they may <a
-href="{@docRoot}guide/topics/ui/notifiers/notifications.html">create a status bar notification</a>
-to alert the user when a broadcast event occurs. More commonly, though, a broadcast receiver is
-just a "gateway" to other components and is intended to do a very minimal amount of work. For
-instance, it might initiate a service to perform some work based on the event.
-
-<p>A broadcast receiver is implemented as a subclass of {@link android.content.BroadcastReceiver}
-and each broadcast is delivered as an {@link android.content.Intent} object. For more information,
-see the {@link android.content.BroadcastReceiver} class.</p>
-</dd>
-
-</dl>
-
-
-
-<p>A unique aspect of the Android system design is that any application can start another
-application’s component. For example, if you want the user to capture a
-photo with the device camera, there's probably another application that does that and your
-application can use it, instead of developing an activity to capture a photo yourself. You don't
-need to incorporate or even link to the code from the camera application.
-Instead, you can simply start the activity in the camera application that captures a
-photo. When complete, the photo is even returned to your application so you can use it. To the user,
-it seems as if the camera is actually a part of your application.</p>
-
-<p>When the system starts a component, it starts the process for that application (if it's not
-already running) and instantiates the classes needed for the component. For example, if your
-application starts the activity in the camera application that captures a photo, that activity
-runs in the process that belongs to the camera application, not in your application's process.
-Therefore, unlike applications on most other systems, Android applications don't have a single entry
-point (there's no {@code main()} function, for example).</p>
-
-<p>Because the system runs each application in a separate process with file permissions that
-restrict access to other applications, your application cannot directly activate a component from
-another application. The Android system, however, can. So, to activate a component in
-another application, you must deliver a message to the system that specifies your <em>intent</em> to
-start a particular component. The system then activates the component for you.</p>
-
-
-<h3 id="ActivatingComponents">Activating Components</h3>
-
-<p>Three of the four component types—activities, services, and
-broadcast receivers—are activated by an asynchronous message called an <em>intent</em>.
-Intents bind individual components to each other at runtime (you can think of them
-as the messengers that request an action from other components), whether the component belongs
-to your application or another.</p>
-
-<p>An intent is created with an {@link android.content.Intent} object, which defines a message to
-activate either a specific component or a specific <em>type</em> of component—an intent
-can be either explicit or implicit, respectively.</p>
-
-<p>For activities and services, an intent defines the action to perform (for example, to "view" or
-"send" something) and may specify the URI of the data to act on (among other things that the
-component being started might need to know). For example, an intent might convey a request for an
-activity to show an image or to open a web page. In some cases, you can start an
-activity to receive a result, in which case, the activity also returns
-the result in an {@link android.content.Intent} (for example, you can issue an intent to let
-the user pick a personal contact and have it returned to you—the return intent includes a
-URI pointing to the chosen contact).</p>
-
-<p>For broadcast receivers, the intent simply defines the
-announcement being broadcast (for example, a broadcast to indicate the device battery is low
-includes only a known action string that indicates "battery is low").</p>
-
-<p>The other component type, content provider, is not activated by intents. Rather, it is
-activated when targeted by a request from a {@link android.content.ContentResolver}. The content
-resolver handles all direct transactions with the content provider so that the component that's
-performing transactions with the provider doesn't need to and instead calls methods on the {@link
-android.content.ContentResolver} object. This leaves a layer of abstraction between the content
-provider and the component requesting information (for security).</p>
-
-<p>There are separate methods for activating each type of component:</p>
-<ul>
- <li>You can start an activity (or give it something new to do) by
-passing an {@link android.content.Intent} to {@link android.content.Context#startActivity
-startActivity()} or {@link android.app.Activity#startActivityForResult startActivityForResult()}
-(when you want the activity to return a result).</li>
- <li>You can start a service (or give new instructions to an ongoing service) by
-passing an {@link android.content.Intent} to {@link android.content.Context#startService
-startService()}. Or you can bind to the service by passing an {@link android.content.Intent} to
-{@link android.content.Context#bindService bindService()}.</li>
- <li>You can initiate a broadcast by passing an {@link android.content.Intent} to methods like
-{@link android.content.Context#sendBroadcast(Intent) sendBroadcast()}, {@link
-android.content.Context#sendOrderedBroadcast(Intent, String) sendOrderedBroadcast()}, or {@link
-android.content.Context#sendStickyBroadcast sendStickyBroadcast()}.</li>
- <li>You can perform a query to a content provider by calling {@link
-android.content.ContentProvider#query query()} on a {@link android.content.ContentResolver}.</li>
-</ul>
-
-<p>For more information about using intents, see the <a
-href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and
-Intent Filters</a> document. More information about activating specific components is also provided
-in the following documents: <a
-href="{@docRoot}guide/topics/fundamentals/activities.html">Activities</a>, <a
-href="{@docRoot}guide/topics/fundamentals/services.html">Services</a>, {@link
-android.content.BroadcastReceiver} and <a
-href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.</p>
-
-
-<h2 id="Manifest">The Manifest File</h2>
-
-<p>Before the Android system can start an application component, the system must know that the
-component exists by reading the application's {@code AndroidManifest.xml} file (the "manifest"
-file). Your application must declare all its components in this file, which must be at the root of
-the application project directory.</p>
-
-<p>The manifest does a number of things in addition to declaring the application's components,
-such as:</p>
-<ul>
- <li>Identify any user permissions the application requires, such as Internet access or
-read-access to the user's contacts.</li>
- <li>Declare the minimum <a href="{@docRoot}guide/appendix/api-levels.html">API Level</a>
-required by the application, based on which APIs the application uses.</li>
- <li>Declare hardware and software features used or required by the application, such as a camera,
-bluetooth services, or a multitouch screen.</li>
- <li>API libraries the application needs to be linked against (other than the Android framework
-APIs), such as the <a
-href="http://code.google.com/android/add-ons/google-apis/maps-overview.html">Google Maps
-library</a>.</li>
- <li>And more</li>
-</ul>
-
-
-<h3 id="DeclaringComponents">Declaring components</h3>
-
-<p>The primary task of the manifest is to inform the system about the application's components. For
-example, a manifest file can declare an activity as follows: </p>
-
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<manifest ... >
- <application android:icon="@drawable/app_icon.png" ... >
- <activity android:name="com.example.project.ExampleActivity"
- android:label="@string/example_label" ... >
- </activity>
- ...
- </application>
-</manifest></pre>
-
-<p>In the <code><a
-href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code>
-element, the {@code android:icon} attribute points to resources for an icon that identifies the
-application.</p>
-
-<p>In the <code><a
-href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> element,
-the {@code android:name} attribute specifies the fully qualified class name of the {@link
-android.app.Activity} subclass and the {@code android:label} attributes specifies a string
-to use as the user-visible label for the activity.</p>
-
-<p>You must declare all application components this way:</p>
-<ul>
- <li><code><a
-href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> elements
-for activities</li>
- <li><code><a
-href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code> elements for
-services</li>
- <li><code><a
-href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code> elements
-for broadcast receivers</li>
- <li><code><a
-href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code> elements
-for content providers</li>
-</ul>
-
-<p>Activities, services, and content providers that you include in your source but do not declare
-in the manifest are not visible to the system and, consequently, can never run. However,
-broadcast
-receivers can be either declared in the manifest or created dynamically in code (as
-{@link android.content.BroadcastReceiver} objects) and registered with the system by calling
-{@link android.content.Context#registerReceiver registerReceiver()}.</p>
-
-<p>For more about how to structure the manifest file for your application, see the <a
-href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a>
-documentation. </p>
-
-
-
-<h3 id="DeclaringComponentCapabilities">Declaring component capabilities</h3>
-
-<p>As discussed above, in <a href="#ActivatingComponents">Activating Components</a>, you can use an
-{@link android.content.Intent} to start activities, services, and broadcast receivers. You can do so
-by explicitly naming the target component (using the component class name) in the intent. However,
-the real power of intents lies in the concept of intent actions. With intent actions, you simply
-describe the type of action you want to perform (and optionally, the data upon which you’d like to
-perform the action) and allow the system to find a component on the device that can perform the
-action and start it. If there are multiple components that can perform the action described by the
-intent, then the user selects which one to use.</p>
-
-<p>The way the system identifies the components that can respond to an intent is by comparing the
-intent received to the <i>intent filters</i> provided in the manifest file of other applications on
-the device.</p>
-
-<p>When you declare a component in your application's manifest, you can optionally include
-intent filters that declare the capabilities of the component so it can respond to intents
-from other applications. You can declare an intent filter for your component by
-adding an <a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">{@code
-<intent-filter>}</a> element as a child of the component's declaration element.</p>
-
-<p>For example, an email application with an activity for composing a new email might declare an
-intent filter in its manifest entry to respond to "send" intents (in order to send email). An
-activity in your application can then create an intent with the “send” action ({@link
-android.content.Intent#ACTION_SEND}), which the system matches to the email application’s “send”
-activity and launches it when you invoke the intent with {@link android.app.Activity#startActivity
-startActivity()}.</p>
-
-<p>For more about creating intent filters, see the <a
-href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a> document.
-</p>
-
-
-
-<h3 id="DeclaringRequirements">Declaring application requirements</h3>
-
-<p>There are a variety of devices powered by Android and not all of them provide the
-same features and capabilities. In order to prevent your application from being installed on devices
-that lack features needed by your application, it's important that you clearly define a profile for
-the types of devices your application supports by declaring device and software requirements in your
-manifest file. Most of these declarations are informational only and the system does not read
-them, but external services such as Google Play do read them in order to provide filtering
-for users when they search for applications from their device.</p>
-
-<p>For example, if your application requires a camera and uses APIs introduced in Android 2.1 (<a
-href="{@docRoot}guide/appendix/api-levels.html">API Level</a> 7), you should declare these as
-requirements in your manifest file. That way, devices that do <em>not</em> have a camera and have an
-Android version <em>lower</em> than 2.1 cannot install your application from Google Play.</p>
-
-<p>However, you can also declare that your application uses the camera, but does not
-<em>require</em> it. In that case, your application must perform a check at runtime to determine
-if the device has a camera and disable any features that use the camera if one is not available.</p>
-
-<p>Here are some of the important device characteristics that you should consider as you design and
-develop your application:</p>
-
-<dl>
- <dt>Screen size and density</dt>
- <dd>In order to categorize devices by their screen type, Android defines two characteristics for
-each device: screen size (the physical dimensions of the screen) and screen density (the physical
-density of the pixels on the screen, or dpi—dots per inch). To simplify all the different
-types of screen configurations, the Android system generalizes them into select groups that make
-them easier to target.
-<p>The screen sizes are: small, normal, large, and extra large.<br/>
-The screen densities are: low density, medium density, high density, and extra high density.</p>
-
-<p>By default, your application is compatible with all screen sizes and densities,
-because the Android system makes the appropriate adjustments to your UI layout and image
-resources. However, you should create specialized layouts for certain screen sizes and provide
-specialized images for certain densities, using alternative layout resources, and by declaring in
-your manifest exactly which screen sizes your application supports with the <a
-href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
-<supports-screens>}</a> element.</p>
-<p>For more information, see the <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>
-document.</p></dd>
-
- <dt>Input configurations</dt>
- <dd>Many devices provide a different type of user input mechanism, such as a hardware keyboard, a
-trackball, or a five-way navigation pad. If your application requires a particular kind of input
-hardware, then you should declare it in your manifest with the <a
-href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">{@code
-<uses-configuration>}</a> element. However, it is rare that an application should require
-a certain input configuration.</dd>
-
- <dt>Device features</dt>
- <dd>There are many hardware and software features that may or may not exist on a given
-Android-powered device, such as a camera, a light sensor, bluetooth, a certain
-version of OpenGL, or the fidelity of the touchscreen. You should never assume that a certain
-feature is available on all Android-powered devices (other than the availability of the standard
-Android library), so you should declare any features used by your application with the <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
-element.</dd>
-
- <dt>Platform Version</dt>
- <dd>Different Android-powered devices often run different versions of the Android platform,
-such as Android 1.6 or Android 2.3. Each successive version often includes additional APIs not
-available in the previous version. In order to indicate which set of APIs are available, each
-platform version specifies an <a
-href="{@docRoot}guide/appendix/api-levels.html">API Level</a> (for example, Android 1.0 is API Level
-1 and Android 2.3 is API Level 9). If you use any APIs that were added to the platform after
-version 1.0, you should declare the minimum API Level in which those APIs were introduced using the
-<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a>
-element.</dd>
-</dl>
-
-<p>It's important that you declare all such requirements for your application, because, when you
-distribute your application on Google Play, the store uses these declarations to filter which
-applications are available on each device. As such, your application should be available only to
-devices that meet all your application requirements.</p>
-
-<p>For more information about how Google Play filters applications based on these (and other)
-requirements, see the <a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>
-document.</p>
-
-
-
-<h2 id="Resources">Application Resources</h2>
-
-<p>An Android application is composed of more than just code—it requires resources that are
-separate from the source code, such as images, audio files, and anything relating to the visual
-presentation of the application. For example, you should define animations, menus, styles, colors,
-and the layout of activity user interfaces with XML files. Using application resources makes it easy
-to update various characteristics of your application without modifying code and—by providing
-sets of alternative resources—enables you to optimize your application for a variety of
-device configurations (such as different languages and screen sizes).</p>
-
-<p>For every resource that you include in your Android project, the SDK build tools define a unique
-integer ID, which you can use to reference the resource from your application code or from
-other resources defined in XML. For example, if your application contains an image file named {@code
-logo.png} (saved in the {@code res/drawable/} directory), the SDK tools generate a resource ID
-named {@code R.drawable.logo}, which you can use to reference the image and insert it in your
-user interface.</p>
-
-<p>One of the most important aspects of providing resources separate from your source code
-is the ability for you to provide alternative resources for different device
-configurations. For example, by defining UI strings in XML, you can translate the strings into other
-languages and save those strings in separate files. Then, based on a language <em>qualifier</em>
-that you append to the resource directory's name (such as {@code res/values-fr/} for French string
-values) and the user's language setting, the Android system applies the appropriate language strings
-to your UI.</p>
-
-<p>Android supports many different <em>qualifiers</em> for your alternative resources. The
-qualifier is a short string that you include in the name of your resource directories in order to
-define the device configuration for which those resources should be used. As another
-example, you should often create different layouts for your activities, depending on the
-device's screen orientation and size. For example, when the device screen is in portrait
-orientation (tall), you might want a layout with buttons to be vertical, but when the screen is in
-landscape orientation (wide), the buttons should be aligned horizontally. To change the layout
-depending on the orientation, you can define two different layouts and apply the appropriate
-qualifier to each layout's directory name. Then, the system automatically applies the appropriate
-layout depending on the current device orientation.</p>
-
-<p>For more about the different kinds of resources you can include in your application and how
-to create alternative resources for various device configurations, see the <a
-href="{@docRoot}guide/topics/resources/index.html">Application Resources</a> developer guide.</p>
-
-
-<!--
-<h2>Beginner's Path</h2>
-
-<p>For a close look at implementing activities—the components your users use to
-interact with your application—continue with the <b><a
-href="{@docRoot}guide/topics/fundamentals/activities.html">Activities</a></b> document.</p>
--->
diff --git a/docs/html/guide/topics/fundamentals/activities.jd b/docs/html/guide/topics/fundamentals/activities.jd
deleted file mode 100644
index b79136c..0000000
--- a/docs/html/guide/topics/fundamentals/activities.jd
+++ /dev/null
@@ -1,777 +0,0 @@
-page.title=Activities
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-<h2>Quickview</h2>
-<ul>
- <li>An activity provides a user interface for a single screen in your application</li>
- <li>Activities can move into the background and then be resumed with their state restored</li>
-</ul>
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#Creating">Creating an Activity</a>
- <ol>
- <li><a href="#UI">Implementing a user interface</a></li>
- <li><a href="#Declaring">Declaring the activity in the manifest</a></li>
- </ol>
- </li>
- <li><a href="#StartingAnActivity">Starting an Activity</a>
- <ol>
- <li><a href="#StartingAnActivityForResult">Starting an activity for a result</a></li>
- </ol>
- </li>
- <li><a href="#ShuttingDown">Shutting Down an Activity</a></li>
- <li><a href="#Lifecycle">Managing the Activity Lifecycle</a>
- <ol>
- <li><a href="#ImplementingLifecycleCallbacks">Implementing the lifecycle callbacks</a></li>
- <li><a href="#SavingActivityState">Saving activity state</a></li>
- <li><a href="#ConfigurationChanges">Handling configuration changes</a></li>
- <li><a href="#CoordinatingActivities">Coordinating activities</a></li>
- </ol>
- </li>
-</ol>
-
-<h2>Key classes</h2>
-<ol>
- <li>{@link android.app.Activity}</li>
-</ol>
-
-<h2>See also</h2>
-<ol>
- <li><a href="{@docRoot}resources/tutorials/hello-world.html">Hello World Tutorial</a></li>
- <li><a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back
-Stack</a></li>
-</ol>
-
-</div>
-</div>
-
-
-
-<p>An {@link android.app.Activity} is an application component that provides a screen with which
-users can interact in order to do something, such as dial the phone, take a photo, send an email, or
-view a map. Each activity is given a window in which to draw its user interface. The window
-typically fills the screen, but may be smaller than the screen and float on top of other
-windows.</p>
-
-<p> An application usually consists of multiple activities that are loosely bound
-to each other. Typically, one activity in an application is specified as the "main" activity, which
-is presented to the user when launching the application for the first time. Each
-activity can then start another activity in order to perform different actions. Each time a new
-activity starts, the previous activity is stopped, but the system preserves the activity
-in a stack (the "back stack"). When a new activity starts, it is pushed onto the back stack and
-takes user focus. The back stack abides to the basic "last in, first out" stack mechanism,
-so, when the user is done with the current activity and presses the <em>Back</em> button, it
-is popped from the stack (and destroyed) and the previous activity resumes. (The back stack is
-discussed more in the <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks
-and Back Stack</a> document.)</p>
-
-<p>When an activity is stopped because a new activity starts, it is notified of this change in state
-through the activity's lifecycle callback methods.
-There are several callback methods that an activity might receive, due to a change in its
-state—whether the system is creating it, stopping it, resuming it, or destroying it—and
-each callback provides you the opportunity to perform specific work that's
-appropriate to that state change. For instance, when stopped, your activity should release any
-large objects, such as network or database connections. When the activity resumes, you can
-reacquire the necessary resources and resume actions that were interrupted. These state transitions
-are all part of the activity lifecycle.</p>
-
-<p>The rest of this document discusses the basics of how to build and use an activity,
-including a complete discussion of how the activity lifecycle works, so you can properly manage
-the transition between various activity states.</p>
-
-
-
-<h2 id="Creating">Creating an Activity</h2>
-
-<p>To create an activity, you must create a subclass of {@link android.app.Activity} (or
-an existing subclass of it). In your subclass, you need to implement callback methods that the
-system calls when the activity transitions between various states of its lifecycle, such as when
-the activity is being created, stopped, resumed, or destroyed. The two most important callback
-methods are:</p>
-
-<dl>
- <dt>{@link android.app.Activity#onCreate onCreate()}</dt>
- <dd>You must implement this method. The system calls this when creating your
- activity. Within your implementation, you should initialize the essential components of your
-activity.
- Most importantly, this is where you must call {@link android.app.Activity#setContentView
- setContentView()} to define the layout for the activity's user interface.</dd>
- <dt>{@link android.app.Activity#onPause onPause()}</dt>
- <dd>The system calls this method as the first indication that the user is leaving your
-activity (though it does not always mean the activity is being destroyed). This is usually where you
-should commit any changes that should be persisted beyond the current user session (because
-the user might not come back).</dd>
-</dl>
-
-<p>There are several other lifecycle callback methods that you should use in order to provide a
-fluid user experience between activities and handle unexpected interuptions that cause your activity
-to be stopped and even destroyed. All of the lifecycle callback methods are discussed later, in
-the section about <a href="#Lifecycle">Managing the Activity Lifecycle</a>.</p>
-
-
-
-<h3 id="UI">Implementing a user interface</h3>
-
-<p> The user interface for an activity is provided by a hierarchy of views—objects derived
-from the {@link android.view.View} class. Each view controls a particular rectangular space
-within the activity's window and can respond to user interaction. For example, a view might be a
-button that initiates an action when the user touches it.</p>
-
-<p>Android provides a number of ready-made views that you can use to design and organize your
-layout. "Widgets" are views that provide a visual (and interactive) elements for the screen, such
-as a button, text field, checkbox, or just an image. "Layouts" are views derived from {@link
-android.view.ViewGroup} that provide a unique layout model for its child views, such as a linear
-layout, a grid layout, or relative layout. You can also subclass the {@link android.view.View} and
-{@link android.view.ViewGroup} classes (or existing subclasses) to create your own widgets and
-layouts and apply them to your activity layout.</p>
-
-<p>The most common way to define a layout using views is with an XML layout file saved in your
-application resources. This way, you can maintain the design of your user interface separately from
-the source code that defines the activity's behavior. You can set the layout as the UI for your
-activity with {@link android.app.Activity#setContentView(int) setContentView()}, passing the
-resource ID for the layout. However, you can also create new {@link android.view.View}s in your
-activity code and build a view hierarchy by inserting new {@link
-android.view.View}s into a {@link android.view.ViewGroup}, then use that layout by passing the root
-{@link android.view.ViewGroup} to {@link android.app.Activity#setContentView(View)
-setContentView()}.</p>
-
-<p>For information about creating a user interface, see the <a
-href="{@docRoot}guide/topics/ui/index.html">User Interface</a> documentation.</p>
-
-
-
-<h3 id="Declaring">Declaring the activity in the manifest</h3>
-
-<p>You must declare your activity in the manifest file in order for it to
-be accessible to the system. To declare your activity, open your manifest file and add an <a
-href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element
-as a child of the <a
-href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
-element. For example:</p>
-
-<pre>
-<manifest ... >
- <application ... >
- <activity android:name=".ExampleActivity" />
- ...
- </application ... >
- ...
-</manifest >
-</pre>
-
-<p>There are several other attributes that you can include in this element, to define properties
-such as the label for the activity, an icon for the activity, or a theme to style the activity's
-UI. The <a href="{@docRoot}guide/topics/manifest/activity-element.html#nm">{@code android:name}</a>
-attribute is the only required attribute—it specifies the class name of the activity. Once
-you publish your application, you should not change this name, because if you do, you might break
-some functionality, such as application shortcuts (read the blog post, <a
-href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">Things
-That Cannot Change</a>).</p>
-
-<p>See the <a
-href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element
-reference for more information about declaring your activity in the manifest.</p>
-
-
-<h4>Using intent filters</h4>
-
-<p>An <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
-<activity>}</a> element can also specify various intent filters—using the <a
-href="{@docRoot}guide/topics/manifest/intent-filter-element.html">{@code
-<intent-filter>}</a> element—in order to declare how other application components may
-activate it.</p>
-
-<p>When you create a new application using the Android SDK tools, the stub activity
-that's created for you automatically includes an intent filter that declares the activity
-responds to the "main" action and should be placed in the "launcher" category. The intent filter
-looks like this:</p>
-
-<pre>
-<activity android:name=".ExampleActivity" android:icon="@drawable/app_icon">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
-</activity>
-</pre>
-
-<p>The <a href="{@docRoot}guide/topics/manifest/action-element.html">{@code
-<action>}</a> element specifies that this is the "main" entry point to the application. The <a
-href="{@docRoot}guide/topics/manifest/category-element.html">{@code
-<category>}</a> element specifies that this activity should be listed in the
-system's application launcher (to allow users to launch this activity).</p>
-
-<p>If you intend for your application to be self-contained and not allow other applications to
-activate its activities, then you don't need any other intent filters. Only one activity should
-have the "main" action and "launcher" category, as in the previous example. Activities that
-you don't want to make available to other applications should have no intent filters and you can
-start them yourself using explicit intents (as discussed in the following section).</p>
-
-<p>However, if you want your activity to respond to implicit intents that are delivered from
-other applications (and your own), then you must define additional intent filters for your
-activity. For each type of intent to which you want to respond, you must include an <a
-href="{@docRoot}guide/topics/manifest/intent-filter-element.html">{@code
-<intent-filter>}</a> that includes an
-<a href="{@docRoot}guide/topics/manifest/action-element.html">{@code
-<action>}</a> element and, optionally, a <a
-href="{@docRoot}guide/topics/manifest/category-element.html">{@code
-<category>}</a> element and/or a <a
-href="{@docRoot}guide/topics/manifest/data-element.html">{@code
-<data>}</a> element. These elements specify the type of intent to which your activity can
-respond.</p>
-
-<p>For more information about how your activities can respond to intents, see the <a
-href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>
-document.</p>
-
-
-
-<h2 id="StartingAnActivity">Starting an Activity</h2>
-
-<p>You can start another activity by calling {@link android.app.Activity#startActivity
- startActivity()}, passing it an {@link android.content.Intent} that describes the activity you
- want to start. The intent specifies either the exact activity you want to start or describes the
- type of action you want to perform (and the system selects the appropriate activity for you,
-which
- can even be from a different application). An intent can also carry small amounts of data to be
- used by the activity that is started.</p>
-
-<p>When working within your own application, you'll often need to simply launch a known activity.
- You can do so by creating an intent that explicitly defines the activity you want to start,
-using the class name. For example, here's how one activity starts another activity named {@code
-SignInActivity}:</p>
-
-<pre>
-Intent intent = new Intent(this, SignInActivity.class);
-startActivity(intent);
-</pre>
-
-<p>However, your application might also want to perform some action, such as send an email, text
- message, or status update, using data from your activity. In this case, your application might
- not have its own activities to perform such actions, so you can instead leverage the activities
- provided by other applications on the device, which can perform the actions for you. This is where
-intents are really valuable—you can create an intent that describes an action you want to
-perform and the system
- launches the appropriate activity from another application. If there are
- multiple activities that can handle the intent, then the user can select which one to use. For
- example, if you want to allow the user to send an email message, you can create the
- following intent:</p>
-
-<pre>
-Intent intent = new Intent(Intent.ACTION_SEND);
-intent.putExtra(Intent.EXTRA_EMAIL, recipientArray);
-startActivity(intent);
-</pre>
-
-<p>The {@link android.content.Intent#EXTRA_EMAIL} extra added to the intent is a string array of
- email addresses to which the email should be sent. When an email application responds to this
- intent, it reads the string array provided in the extra and places them in the "to" field of the
- email composition form. In this situation, the email application's activity starts and when the
- user is done, your activity resumes.</p>
-
-
-
-
-<h3 id="StartingAnActivityForResult">Starting an activity for a result</h3>
-
-<p>Sometimes, you might want to receive a result from the activity that you start. In that case,
- start the activity by calling {@link android.app.Activity#startActivityForResult
- startActivityForResult()} (instead of {@link android.app.Activity#startActivity
- startActivity()}). To then receive the result from the subsequent
-activity, implement the {@link android.app.Activity#onActivityResult onActivityResult()} callback
- method. When the subsequent activity is done, it returns a result in an {@link
-android.content.Intent} to your {@link android.app.Activity#onActivityResult onActivityResult()}
-method.</p>
-
-<p>For example, perhaps you want the user to pick one of their contacts, so your activity can
-do something with the information in that contact. Here's how you can create such an intent and
-handle the result:</p>
-
-<pre>
-private void pickContact() {
- // Create an intent to "pick" a contact, as defined by the content provider URI
- Intent intent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI);
- startActivityForResult(intent, PICK_CONTACT_REQUEST);
-}
-
-@Override
-protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- // If the request went well (OK) and the request was PICK_CONTACT_REQUEST
- if (resultCode == Activity.RESULT_OK && requestCode == PICK_CONTACT_REQUEST) {
- // Perform a query to the contact's content provider for the contact's name
- Cursor cursor = getContentResolver().query(data.getData(),
- new String[] {Contacts.DISPLAY_NAME}, null, null, null);
- if (cursor.moveToFirst()) { // True if the cursor is not empty
- int columnIndex = cursor.getColumnIndex(Contacts.DISPLAY_NAME);
- String name = cursor.getString(columnIndex);
- // Do something with the selected contact's name...
- }
- }
-}
-</pre>
-
-<p>This example shows the basic logic you should use in your {@link
-android.app.Activity#onActivityResult onActivityResult()} method in order to handle an
-activity result. The first condition checks whether the request was successful—if it was, then
-the {@code resultCode} will be {@link android.app.Activity#RESULT_OK}—and whether the request
-to which this result is responding is known—in this case, the {@code requestCode} matches the
-second parameter sent with {@link android.app.Activity#startActivityForResult
-startActivityForResult()}. From there, the code handles the activity result by querying the
-data returned in an {@link android.content.Intent} (the {@code data} parameter).</p>
-
-<p>What happens is, a {@link
-android.content.ContentResolver} performs a query against a content provider, which returns a
-{@link android.database.Cursor} that allows the queried data to be read. For more information, see
-the <a
-href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a> document.</p>
-
-<p>For more information about using intents, see the <a
-href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent
-Filters</a> document.</p>
-
-
-<h2 id="ShuttingDown">Shutting Down an Activity</h2>
-
-<p>You can shut down an activity by calling its {@link android.app.Activity#finish
-finish()} method. You can also shut down a separate activity that you previously started by calling
-{@link android.app.Activity#finishActivity finishActivity()}.</p>
-
-<p class="note"><strong>Note:</strong> In most cases, you should not explicitly finish an activity
-using these methods. As discussed in the following section about the activity lifecycle, the
-Android system manages the life of an activity for you, so you do not need to finish your own
-activities. Calling these methods could adversely affect the expected user
-experience and should only be used when you absolutely do not want the user to return to this
-instance of the activity.</p>
-
-
-<h2 id="Lifecycle">Managing the Activity Lifecycle</h2>
-
-<p>Managing the lifecycle of your activities by implementing callback methods is
-crucial to developing a strong
-and flexible application. The lifecycle of an activity is directly affected by its association with
-other activities, its task and back stack.</p>
-
-<p>An activity can exist in essentially three states:</p>
-
-<dl>
- <dt><i>Resumed</i></dt>
- <dd>The activity is in the foreground of the screen and has user focus. (This state is
-also sometimes referred to as "running".)</dd>
-
- <dt><i>Paused</i></dt>
- <dd>Another activity is in the foreground and has focus, but this one is still visible. That is,
-another activity is visible on top of this one and that activity is partially transparent or doesn't
-cover the entire screen. A paused activity is completely alive (the {@link android.app.Activity}
-object is retained in memory, it maintains all state and member information, and remains attached to
-the window manager), but can be killed by the system in extremely low memory situations.</dd>
-
- <dt><i>Stopped</i></dt>
- <dd>The activity is completely obscured by another activity (the activity is now in the
-"background"). A stopped activity is also still alive (the {@link android.app.Activity}
-object is retained in memory, it maintains all state and member information, but is <em>not</em>
-attached to the window manager). However, it is no longer visible to the user and it
-can be killed by the system when memory is needed elsewhere.</dd>
-</dl>
-
-<p>If an activity is paused or stopped, the system can drop it from memory either by asking it to
-finish (calling its {@link android.app.Activity#finish finish()} method), or simply killing its
-process. When the activity is opened again (after being finished or killed), it must be created all
-over.</p>
-
-
-
-<h3 id="ImplementingLifecycleCallbacks">Implementing the lifecycle callbacks</h3>
-
-<p>When an activity transitions into and out of the different states described above, it is notified
-through various callback methods. All of the callback methods are hooks that you
-can override to do appropriate work when the state of your activity changes. The following skeleton
-activity includes each of the fundamental lifecycle methods:</p>
-
-
-<pre>
-public class ExampleActivity extends Activity {
- @Override
- public void {@link android.app.Activity#onCreate onCreate}(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // The activity is being created.
- }
- @Override
- protected void {@link android.app.Activity#onStart onStart()} {
- super.onStart();
- // The activity is about to become visible.
- }
- @Override
- protected void {@link android.app.Activity#onResume onResume()} {
- super.onResume();
- // The activity has become visible (it is now "resumed").
- }
- @Override
- protected void {@link android.app.Activity#onPause onPause()} {
- super.onPause();
- // Another activity is taking focus (this activity is about to be "paused").
- }
- @Override
- protected void {@link android.app.Activity#onStop onStop()} {
- super.onStop();
- // The activity is no longer visible (it is now "stopped")
- }
- @Override
- protected void {@link android.app.Activity#onDestroy onDestroy()} {
- super.onDestroy();
- // The activity is about to be destroyed.
- }
-}
-</pre>
-
-<p class="note"><strong>Note:</strong> Your implementation of these lifecycle methods must
-always call the superclass implementation before doing any work, as shown in the examples above.</p>
-
-<p>Taken together, these methods define the entire lifecycle of an activity. By implementing these
-methods, you can monitor three nested loops in the activity lifecycle: </p>
-
-<ul>
-<li>The <b>entire lifetime</b> of an activity happens between the call to {@link
-android.app.Activity#onCreate onCreate()} and the call to {@link
-android.app.Activity#onDestroy}. Your activity should perform setup of
-"global" state (such as defining layout) in {@link android.app.Activity#onCreate onCreate()}, and
-release all remaining resources in {@link android.app.Activity#onDestroy}. For example, if your
-activity has a thread running in the background to download data from the network, it might create
-that thread in {@link android.app.Activity#onCreate onCreate()} and then stop the thread in {@link
-android.app.Activity#onDestroy}.</li>
-
-<li><p>The <b>visible lifetime</b> of an activity happens between the call to {@link
-android.app.Activity#onStart onStart()} and the call to {@link
-android.app.Activity#onStop onStop()}. During this time, the user can see the activity
-on-screen and interact with it. For example, {@link android.app.Activity#onStop onStop()} is called
-when a new activity starts and this one is no longer visible. Between these two methods, you can
-maintain resources that are needed to show the activity to the user. For example, you can register a
-{@link android.content.BroadcastReceiver} in {@link
-android.app.Activity#onStart onStart()} to monitor changes that impact your UI, and unregister
-it in {@link android.app.Activity#onStop onStop()} when the user can no longer see what you are
-displaying. The system might call {@link android.app.Activity#onStart onStart()} and {@link
-android.app.Activity#onStop onStop()} multiple times during the entire lifetime of the activity, as
-the activity alternates between being visible and hidden to the user.</p></li>
-
-<li><p>The <b>foreground lifetime</b> of an activity happens between the call to {@link
-android.app.Activity#onResume onResume()} and the call to {@link android.app.Activity#onPause
-onPause()}. During this time, the activity is in front of all other activities on screen and has
-user input focus. An activity can frequently transition in and out of the foreground—for
-example, {@link android.app.Activity#onPause onPause()} is called when the device goes to sleep or
-when a dialog appears. Because this state can transition often, the code in these two methods should
-be fairly lightweight in order to avoid slow transitions that make the user wait.</p></li>
-</ul>
-
-<p>Figure 1 illustrates these loops and the paths an activity might take between states.
-The rectangles represent the callback methods you can implement to perform operations when
-the activity transitions between states. <p>
-
-<img src="{@docRoot}images/activity_lifecycle.png" alt="" />
-<p class="img-caption"><strong>Figure 1.</strong> The activity lifecycle.</p>
-
-<p>The same lifecycle callback methods are listed in table 1, which describes each of the callback
-methods in more detail and locates each one within the
-activity's overall lifecycle, including whether the system can kill the activity after the
-callback method completes.</p>
-
-<p class="table-caption"><strong>Table 1.</strong> A summary of the activity lifecycle's
-callback methods.</p>
-
-<table border="2" width="85%" frame="hsides" rules="rows">
-<colgroup align="left" span="3"></colgroup>
-<colgroup align="left"></colgroup>
-<colgroup align="center"></colgroup>
-<colgroup align="center"></colgroup>
-
-<thead>
-<tr><th colspan="3">Method</th> <th>Description</th> <th>Killable after?</th> <th>Next</th></tr>
-</thead>
-
-<tbody>
-<tr>
- <td colspan="3" align="left"><code>{@link android.app.Activity#onCreate onCreate()}</code></td>
- <td>Called when the activity is first created.
- This is where you should do all of your normal static set up —
- create views, bind data to lists, and so on. This method is passed
- a Bundle object containing the activity's previous state, if that
- state was captured (see <a href="#actstate">Saving Activity State</a>,
- later).
- <p>Always followed by {@code onStart()}.</p></td>
- <td align="center">No</td>
- <td align="center">{@code onStart()}</td>
-</tr>
-
-<tr>
- <td rowspan="5" style="border-left: none; border-right: none;"> </td>
- <td colspan="2" align="left"><code>{@link android.app.Activity#onRestart
-onRestart()}</code></td>
- <td>Called after the activity has been stopped, just prior to it being
- started again.
- <p>Always followed by {@code onStart()}</p></td>
- <td align="center">No</td>
- <td align="center">{@code onStart()}</td>
-</tr>
-
-<tr>
- <td colspan="2" align="left"><code>{@link android.app.Activity#onStart onStart()}</code></td>
- <td>Called just before the activity becomes visible to the user.
- <p>Followed by {@code onResume()} if the activity comes
- to the foreground, or {@code onStop()} if it becomes hidden.</p></td>
- <td align="center">No</td>
- <td align="center">{@code onResume()} <br/>or<br/> {@code onStop()}</td>
-</tr>
-
-<tr>
- <td rowspan="2" style="border-left: none;"> </td>
- <td align="left"><code>{@link android.app.Activity#onResume onResume()}</code></td>
- <td>Called just before the activity starts
- interacting with the user. At this point the activity is at
- the top of the activity stack, with user input going to it.
- <p>Always followed by {@code onPause()}.</p></td>
- <td align="center">No</td>
- <td align="center">{@code onPause()}</td>
-</tr>
-
-<tr>
- <td align="left"><code>{@link android.app.Activity#onPause onPause()}</code></td>
- <td>Called when the system is about to start resuming another
- activity. This method is typically used to commit unsaved changes to
- persistent data, stop animations and other things that may be consuming
- CPU, and so on. It should do whatever it does very quickly, because
- the next activity will not be resumed until it returns.
- <p>Followed either by {@code onResume()} if the activity
- returns back to the front, or by {@code onStop()} if it becomes
- invisible to the user.</td>
- <td align="center"><strong style="color:#800000">Yes</strong></td>
- <td align="center">{@code onResume()} <br/>or<br/> {@code onStop()}</td>
-</tr>
-
-<tr>
- <td colspan="2" align="left"><code>{@link android.app.Activity#onStop onStop()}</code></td>
- <td>Called when the activity is no longer visible to the user. This
- may happen because it is being destroyed, or because another activity
- (either an existing one or a new one) has been resumed and is covering it.
- <p>Followed either by {@code onRestart()} if
- the activity is coming back to interact with the user, or by
- {@code onDestroy()} if this activity is going away.</p></td>
- <td align="center"><strong style="color:#800000">Yes</strong></td>
- <td align="center">{@code onRestart()} <br/>or<br/> {@code onDestroy()}</td>
-</tr>
-
-<tr>
- <td colspan="3" align="left"><code>{@link android.app.Activity#onDestroy
-onDestroy()}</code></td>
- <td>Called before the activity is destroyed. This is the final call
- that the activity will receive. It could be called either because the
- activity is finishing (someone called <code>{@link android.app.Activity#finish
- finish()}</code> on it), or because the system is temporarily destroying this
- instance of the activity to save space. You can distinguish
- between these two scenarios with the <code>{@link
- android.app.Activity#isFinishing isFinishing()}</code> method.</td>
- <td align="center"><strong style="color:#800000">Yes</strong></td>
- <td align="center"><em>nothing</em></td>
-</tr>
-</tbody>
-</table>
-
-<p>The column labeled "Killable after?" indicates whether or not the system can
-kill the process hosting the activity at any time <em>after the method returns</em>, without
-executing another line of the activity's code. Three methods are marked "yes": ({@link
-android.app.Activity#onPause
-onPause()}, {@link android.app.Activity#onStop onStop()}, and {@link android.app.Activity#onDestroy
-onDestroy()}). Because {@link android.app.Activity#onPause onPause()} is the first
-of the three, once the activity is created, {@link android.app.Activity#onPause onPause()} is the
-last method that's guaranteed to be called before the process <em>can</em> be killed—if
-the system must recover memory in an emergency, then {@link
-android.app.Activity#onStop onStop()} and {@link android.app.Activity#onDestroy onDestroy()} might
-not be called. Therefore, you should use {@link android.app.Activity#onPause onPause()} to write
-crucial persistent data (such as user edits) to storage. However, you should be selective about
-what information must be retained during {@link android.app.Activity#onPause onPause()}, because any
-blocking procedures in this method block the transition to the next activity and slow the user
-experience.</p>
-
-<p> Methods that are marked "No" in the <b>Killable</b> column protect the process hosting the
-activity from being killed from the moment they are called. Thus, an activity is killable
-from the time {@link android.app.Activity#onPause onPause()} returns to the time
-{@link android.app.Activity#onResume onResume()} is called. It will not again be killable until
-{@link android.app.Activity#onPause onPause()} is again called and returns. </p>
-
-<p class="note"><strong>Note:</strong> An activity that's not technically "killable" by this
-definition in table 1 might still be killed by the system—but that would happen only in
-extreme circumstances when there is no other recourse. When an activity might be killed is
-discussed more in the <a
-href="{@docRoot}guide/topics/fundamentals/processes-and-threads.html">Processes and
-Threading</a> document.</p>
-
-
-<h3 id="SavingActivityState">Saving activity state</h3>
-
-<p>The introduction to <a href="#Lifecycle">Managing the Activity Lifecycle</a> briefly mentions
-that
-when an activity is paused or stopped, the state of the activity is retained. This is true because
-the {@link android.app.Activity} object is still held in memory when it is paused or
-stopped—all information about its members and current state is still alive. Thus, any changes
-the user made within the activity are retained so that when the activity returns to the
-foreground (when it "resumes"), those changes are still there.</p>
-
-<p>However, when the system destroys an activity in order to recover memory, the {@link
-android.app.Activity} object is destroyed, so the system cannot simply resume it with its state
-intact. Instead, the system must recreate the {@link android.app.Activity} object if the user
-navigates back to it. Yet, the user is unaware
-that the system destroyed the activity and recreated it and, thus, probably
-expects the activity to be exactly as it was. In this situation, you can ensure that
-important information about the activity state is preserved by implementing an additional
-callback method that allows you to save information about the state of your activity: {@link
-android.app.Activity#onSaveInstanceState onSaveInstanceState()}.</p>
-
-<p>The system calls {@link android.app.Activity#onSaveInstanceState onSaveInstanceState()}
-before making the activity vulnerable to destruction. The system passes this method
-a {@link android.os.Bundle} in which you can save
-state information about the activity as name-value pairs, using methods such as {@link
-android.os.Bundle#putString putString()} and {@link
-android.os.Bundle#putInt putInt()}. Then, if the system kills your application
-process and the user navigates back to your activity, the system recreates the activity and passes
-the {@link android.os.Bundle} to both {@link android.app.Activity#onCreate onCreate()} and {@link
-android.app.Activity#onRestoreInstanceState onRestoreInstanceState()}. Using either of these
-methods, you can extract your saved state from the {@link android.os.Bundle} and restore the
-activity state. If there is no state information to restore, then the {@link
-android.os.Bundle} passed to you is null (which is the case when the activity is created for
-the first time).</p>
-
-<img src="{@docRoot}images/fundamentals/restore_instance.png" alt="" />
-<p class="img-caption"><strong>Figure 2.</strong> The two ways in which an activity returns to user
-focus with its state intact: either the activity is destroyed, then recreated and the activity must restore
-the previously saved state, or the activity is stopped, then resumed and the activity state
-remains intact.</p>
-
-<p class="note"><strong>Note:</strong> There's no guarantee that {@link
-android.app.Activity#onSaveInstanceState onSaveInstanceState()} will be called before your
-activity is destroyed, because there are cases in which it won't be necessary to save the state
-(such as when the user leaves your activity using the <em>Back</em> button, because the user is
-explicitly
-closing the activity). If the system calls {@link android.app.Activity#onSaveInstanceState
-onSaveInstanceState()}, it does so before {@link
-android.app.Activity#onStop onStop()} and possibly before {@link android.app.Activity#onPause
-onPause()}.</p>
-
-<p>However, even if you do nothing and do not implement {@link
-android.app.Activity#onSaveInstanceState onSaveInstanceState()}, some of the activity state is
-restored by the {@link android.app.Activity} class's default implementation of {@link
-android.app.Activity#onSaveInstanceState onSaveInstanceState()}. Specifically, the default
-implementation calls the corresponding {@link
-android.view.View#onSaveInstanceState onSaveInstanceState()} method for every {@link
-android.view.View} in the layout, which allows each view to provide information about itself
-that should be saved. Almost every widget in the Android framework implements this method as
-appropriate, such that any visible changes to the UI are automatically saved and restored when your
-activity is recreated. For example, the {@link android.widget.EditText} widget saves any text
-entered by the user and the {@link android.widget.CheckBox} widget saves whether it's checked or
-not. The only work required by you is to provide a unique ID (with the <a
-href="{@docRoot}guide/topics/resources/layout-resource.html#idvalue">{@code android:id}</a>
-attribute) for each widget you want to save its state. If a widget does not have an ID, then the
-system cannot save its state.</p>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<p>You can also explicitly stop a view in your layout from saving its state by setting the
-{@link android.R.attr#saveEnabled android:saveEnabled} attribute to {@code "false"} or by calling
-the {@link android.view.View#setSaveEnabled setSaveEnabled()} method. Usually, you should not
-disable this, but you might if you want to restore the state of the activity UI differently.</p>
-</div>
-</div>
-
-<p>Although the default implementation of {@link
-android.app.Activity#onSaveInstanceState onSaveInstanceState()} saves useful information about
-your activity's UI, you still might need to override it to save additional information.
-For example, you might need to save member values that changed during the activity's life (which
-might correlate to values restored in the UI, but the members that hold those UI values are not
-restored, by default).</p>
-
-<p>Because the default implementation of {@link
-android.app.Activity#onSaveInstanceState onSaveInstanceState()} helps save the state of the UI, if
-you override the method in order to save additional state information, you should always call the
-superclass implementation of {@link android.app.Activity#onSaveInstanceState onSaveInstanceState()}
-before doing any work. Likewise, you should also call the supercall implementation of {@link
-android.app.Activity#onRestoreInstanceState onRestoreInstanceState()} if you override it, so the
-default implementation can restore view states.</p>
-
-<p class="note"><strong>Note:</strong> Because {@link android.app.Activity#onSaveInstanceState
-onSaveInstanceState()} is not guaranteed
-to be called, you should use it only to record the transient state of the activity (the state of
-the UI)—you should never use it to store persistent data. Instead, you should use {@link
-android.app.Activity#onPause onPause()} to store persistent data (such as data that should be saved
-to a database) when the user leaves the activity.</p>
-
-<p>A good way to test your application's ability to restore its state is to simply rotate the
-device so that the screen orientation changes. When the screen orientation changes, the system
-destroys and recreates the activity in order to apply alternative resources that might be available
-for the new screen configuration. For this reason alone, it's very important that your activity
-completely restores its state when it is recreated, because users regularly rotate the screen while
-using applications.</p>
-
-
-<h3 id="ConfigurationChanges">Handling configuration changes</h3>
-
-<p>Some device configurations can change during runtime (such as screen orientation, keyboard
-availability, and language). When such a change occurs, Android recreates the running activity
-(the system calls {@link android.app.Activity#onDestroy}, then immediately calls {@link
-android.app.Activity#onCreate onCreate()}). This behavior is
-designed to help your application adapt to new configurations by automatically reloading your
-application with alternative resources that you've provided (such as different layouts for
-different screen orientations and sizes).</p>
-
-<p>If you properly design your activity to handle a restart due to a screen orientation change and
-restore the activity state as described above, your application will be more resilient to other
-unexpected events in the activity lifecycle.</p>
-
-<p>The best way to handle such a restart is
- to save and restore the state of your activity using {@link
- android.app.Activity#onSaveInstanceState onSaveInstanceState()} and {@link
-android.app.Activity#onRestoreInstanceState onRestoreInstanceState()} (or {@link
-android.app.Activity#onCreate onCreate()}), as discussed in the previous section.</p>
-
-<p>For more information about configuration changes that happen at runtime and how you can handle
-them, read the guide to <a href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling
-Runtime Changes</a>.</p>
-
-
-
-<h3 id="CoordinatingActivities">Coordinating activities</h3>
-
- <p>When one activity starts another, they both experience lifecycle transitions. The first activity
-pauses and stops (though, it won't stop if it's still visible in the background), while the other
-activity is created. In case these activities share data saved to disc or elsewhere, it's important
-to understand that the first activity is not completely stopped before the second one is created.
-Rather, the process of starting the second one overlaps with the process of stopping the first
-one.</p>
-
-<p>The order of lifecycle callbacks is well defined, particularly when the two activities are in the
-same process and one is starting the other. Here's the order of operations that occur when Activity
-A starts Acivity B: </p>
-
-<ol>
-<li>Activity A's {@link android.app.Activity#onPause onPause()} method executes.</li>
-
-<li>Activity B's {@link android.app.Activity#onCreate onCreate()}, {@link
-android.app.Activity#onStart onStart()}, and {@link android.app.Activity#onResume onResume()}
-methods execute in sequence. (Activity B now has user focus.)</li>
-
-<li>Then, if Activity A is no longer visible on screen, its {@link
-android.app.Activity#onStop onStop()} method executes.</li>
-</ol>
-
- <p>This predictable sequence of lifecycle callbacks allows you to manage the transition of
-information from one activity to another. For example, if you must write to a database when the
-first activity stops so that the following activity can read it, then you should write to the
-database during {@link android.app.Activity#onPause onPause()} instead of during {@link
-android.app.Activity#onStop onStop()}.</p>
-
-<!--
-<h2>Beginner's Path</h2>
-
-<p>For more information about how Android maintains a history of activities and
-enables user multitasking, continue with the <b><a
-href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back
-Stack</a></b> document.</p>
--->
\ No newline at end of file
diff --git a/docs/html/guide/topics/fundamentals/bound-services.jd b/docs/html/guide/topics/fundamentals/bound-services.jd
deleted file mode 100644
index ec7d723..0000000
--- a/docs/html/guide/topics/fundamentals/bound-services.jd
+++ /dev/null
@@ -1,675 +0,0 @@
-page.title=Bound Services
-parent.title=Services
-parent.link=services.html
-@jd:body
-
-
-<div id="qv-wrapper">
-<ol id="qv">
-<h2>Quickview</h2>
-<ul>
- <li>A bound service allows other components to bind to it, in order to interact with it and
-perform interprocess communication</li>
- <li>A bound service is destroyed once all clients unbind, unless the service was also started</li>
-</ul>
-<h2>In this document</h2>
-<ol>
- <li><a href="#Basics">The Basics</a></li>
- <li><a href="#Creating">Creating a Bound Service</a>
- <ol>
- <li><a href="#Binder">Extending the Binder class</a></li>
- <li><a href="#Messenger">Using a Messenger</a></li>
- </ol>
- </li>
- <li><a href="#Binding">Binding to a Service</a></li>
- <li><a href="#Lifecycle">Managing the Lifecycle of a Bound Service</a></li>
-</ol>
-
-<h2>Key classes</h2>
-<ol>
- <li>{@link android.app.Service}</li>
- <li>{@link android.content.ServiceConnection}</li>
- <li>{@link android.os.IBinder}</li>
-</ol>
-
-<h2>Samples</h2>
-<ol>
- <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.html">{@code
- RemoteService}</a></li>
- <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html">{@code
- LocalService}</a></li>
-</ol>
-
-<h2>See also</h2>
-<ol>
- <li><a href="{@docRoot}guide/topics/fundamentals/services.html">Services</a></li>
-</ol>
-</div>
-
-
-<p>A bound service is the server in a client-server interface. A bound service allows components
-(such as activities) to bind to the service, send requests, receive responses, and even perform
-interprocess communication (IPC). A bound service typically lives only while it serves another
-application component and does not run in the background indefinitely.</p>
-
-<p>This document shows you how to create a bound service, including how to bind
-to the service from other application components. However, you should also refer to the <a
-href="{@docRoot}guide/topics/fundamentals/services.html">Services</a> document for additional
-information about services in general, such as how to deliver notifications from a service, set
-the service to run in the foreground, and more.</p>
-
-
-<h2 id="Basics">The Basics</h2>
-
-<p>A bound service is an implementation of the {@link android.app.Service} class that allows
-other applications to bind to it and interact with it. To provide binding for a
-service, you must implement the {@link android.app.Service#onBind onBind()} callback method. This
-method returns an {@link android.os.IBinder} object that defines the programming interface that
-clients can use to interact with the service.</p>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h3>Binding to a Started Service</h3>
-
-<p>As discussed in the <a href="{@docRoot}guide/topics/fundamentals/services.html">Services</a>
-document, you can create a service that is both started and bound. That is, the service can be
-started by calling {@link android.content.Context#startService startService()}, which allows the
-service to run indefinitely, and also allow a client to bind to the service by calling {@link
-android.content.Context#bindService bindService()}.
- <p>If you do allow your service to be started and bound, then when the service has been
-started, the system does <em>not</em> destroy the service when all clients unbind. Instead, you must
-explicitly stop the service, by calling {@link android.app.Service#stopSelf stopSelf()} or {@link
-android.content.Context#stopService stopService()}.</p>
-
-<p>Although you should usually implement either {@link android.app.Service#onBind onBind()}
-<em>or</em> {@link android.app.Service#onStartCommand onStartCommand()}, it's sometimes necessary to
-implement both. For example, a music player might find it useful to allow its service to run
-indefinitely and also provide binding. This way, an activity can start the service to play some
-music and the music continues to play even if the user leaves the application. Then, when the user
-returns to the application, the activity can bind to the service to regain control of playback.</p>
-
-<p>Be sure to read the section about <a href="#Lifecycle">Managing the Lifecycle of a Bound
-Service</a>, for more information about the service lifecycle when adding binding to a
-started service.</p>
-</div>
-</div>
-
-<p>A client can bind to the service by calling {@link android.content.Context#bindService
-bindService()}. When it does, it must provide an implementation of {@link
-android.content.ServiceConnection}, which monitors the connection with the service. The {@link
-android.content.Context#bindService bindService()} method returns immediately without a value, but
-when the Android system creates the connection between the
-client and service, it calls {@link
-android.content.ServiceConnection#onServiceConnected onServiceConnected()} on the {@link
-android.content.ServiceConnection}, to deliver the {@link android.os.IBinder} that
-the client can use to communicate with the service.</p>
-
-<p>Multiple clients can connect to the service at once. However, the system calls your service's
-{@link android.app.Service#onBind onBind()} method to retrieve the {@link android.os.IBinder} only
-when the first client binds. The system then delivers the same {@link android.os.IBinder} to any
-additional clients that bind, without calling {@link android.app.Service#onBind onBind()} again.</p>
-
-<p>When the last client unbinds from the service, the system destroys the service (unless the
-service was also started by {@link android.content.Context#startService startService()}).</p>
-
-<p>When you implement your bound service, the most important part is defining the interface
-that your {@link android.app.Service#onBind onBind()} callback method returns. There are a few
-different ways you can define your service's {@link android.os.IBinder} interface and the following
-section discusses each technique.</p>
-
-
-
-<h2 id="Creating">Creating a Bound Service</h2>
-
-<p>When creating a service that provides binding, you must provide an {@link android.os.IBinder}
-that provides the programming interface that clients can use to interact with the service. There
-are three ways you can define the interface:</p>
-
-<dl>
- <dt><a href="#Binder">Extending the Binder class</a></dt>
- <dd>If your service is private to your own application and runs in the same process as the client
-(which is common), you should create your interface by extending the {@link android.os.Binder} class
-and returning an instance of it from
-{@link android.app.Service#onBind onBind()}. The client receives the {@link android.os.Binder} and
-can use it to directly access public methods available in either the {@link android.os.Binder}
-implementation or even the {@link android.app.Service}.
- <p>This is the preferred technique when your service is merely a background worker for your own
-application. The only reason you would not create your interface this way is because
-your service is used by other applications or across separate processes.</dd>
-
- <dt><a href="#Messenger">Using a Messenger</a></dt>
- <dd>If you need your interface to work across different processes, you can create
-an interface for the service with a {@link android.os.Messenger}. In this manner, the service
-defines a {@link android.os.Handler} that responds to different types of {@link
-android.os.Message} objects. This {@link android.os.Handler}
-is the basis for a {@link android.os.Messenger} that can then share an {@link android.os.IBinder}
-with the client, allowing the client to send commands to the service using {@link
-android.os.Message} objects. Additionally, the client can define a {@link android.os.Messenger} of
-its own so the service can send messages back.
- <p>This is the simplest way to perform interprocess communication (IPC), because the {@link
-android.os.Messenger} queues all requests into a single thread so that you don't have to design
-your service to be thread-safe.</p>
- </dd>
-
- <dt>Using AIDL</dt>
- <dd>AIDL (Android Interface Definition Language) performs all the work to decompose objects into
-primitives that the operating system can understand and marshall them across processes to perform
-IPC. The previous technique, using a {@link android.os.Messenger}, is actually based on AIDL as
-its underlying structure. As mentioned above, the {@link android.os.Messenger} creates a queue of
-all the client requests in a single thread, so the service receives requests one at a time. If,
-however, you want your service to handle multiple requests simultaneously, then you can use AIDL
-directly. In this case, your service must be capable of multi-threading and be built thread-safe.
- <p>To use AIDL directly, you must
-create an {@code .aidl} file that defines the programming interface. The Android SDK tools use
-this file to generate an abstract class that implements the interface and handles IPC, which you
-can then extend within your service.</p>
- </dd>
-</dl>
-
- <p class="note"><strong>Note:</strong> Most applications <strong>should not</strong> use AIDL to
-create a bound service, because it may require multithreading capabilities and
-can result in a more complicated implementation. As such, AIDL is not suitable for most applications
-and this document does not discuss how to use it for your service. If you're certain that you need
-to use AIDL directly, see the <a href="{@docRoot}guide/developing/tools/aidl.html">AIDL</a>
-document.</p>
-
-
-
-
-<h3 id="Binder">Extending the Binder class</h3>
-
-<p>If your service is used only by the local application and does not need to work across processes,
-then you can implement your own {@link android.os.Binder} class that provides your client direct
-access to public methods in the service.</p>
-
-<p class="note"><strong>Note:</strong> This works only if the client and service are in the same
-application and process, which is most common. For example, this would work well for a music
-application that needs to bind an activity to its own service that's playing music in the
-background.</p>
-
-<p>Here's how to set it up:</p>
-<ol>
- <li>In your service, create an instance of {@link android.os.Binder} that either:
- <ul>
- <li>contains public methods that the client can call</li>
- <li>returns the current {@link android.app.Service} instance, which has public methods the
-client can call</li>
- <li>or, returns an instance of another class hosted by the service with public methods the
-client can call</li>
- </ul>
- <li>Return this instance of {@link android.os.Binder} from the {@link
-android.app.Service#onBind onBind()} callback method.</li>
- <li>In the client, receive the {@link android.os.Binder} from the {@link
-android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback method and
-make calls to the bound service using the methods provided.</li>
-</ol>
-
-<p class="note"><strong>Note:</strong> The reason the service and client must be in the same
-application is so the client can cast the returned object and properly call its APIs. The service
-and client must also be in the same process, because this technique does not perform any
-marshalling across processes.</p>
-
-<p>For example, here's a service that provides clients access to methods in the service through
-a {@link android.os.Binder} implementation:</p>
-
-<pre>
-public class LocalService extends Service {
- // Binder given to clients
- private final IBinder mBinder = new LocalBinder();
- // Random number generator
- private final Random mGenerator = new Random();
-
- /**
- * Class used for the client Binder. Because we know this service always
- * runs in the same process as its clients, we don't need to deal with IPC.
- */
- public class LocalBinder extends Binder {
- LocalService getService() {
- // Return this instance of LocalService so clients can call public methods
- return LocalService.this;
- }
- }
-
- @Override
- public IBinder onBind(Intent intent) {
- return mBinder;
- }
-
- /** method for clients */
- public int getRandomNumber() {
- return mGenerator.nextInt(100);
- }
-}
-</pre>
-
-<p>The {@code LocalBinder} provides the {@code getService()} method for clients to retrieve the
-current instance of {@code LocalService}. This allows clients to call public methods in the
-service. For example, clients can call {@code getRandomNumber()} from the service.</p>
-
-<p>Here's an activity that binds to {@code LocalService} and calls {@code getRandomNumber()}
-when a button is clicked:</p>
-
-<pre>
-public class BindingActivity extends Activity {
- LocalService mService;
- boolean mBound = false;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- }
-
- @Override
- protected void onStart() {
- super.onStart();
- // Bind to LocalService
- Intent intent = new Intent(this, LocalService.class);
- bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
- }
-
- @Override
- protected void onStop() {
- super.onStop();
- // Unbind from the service
- if (mBound) {
- unbindService(mConnection);
- mBound = false;
- }
- }
-
- /** Called when a button is clicked (the button in the layout file attaches to
- * this method with the android:onClick attribute) */
- public void onButtonClick(View v) {
- if (mBound) {
- // Call a method from the LocalService.
- // However, if this call were something that might hang, then this request should
- // occur in a separate thread to avoid slowing down the activity performance.
- int num = mService.getRandomNumber();
- Toast.makeText(this, "number: " + num, Toast.LENGTH_SHORT).show();
- }
- }
-
- /** Defines callbacks for service binding, passed to bindService() */
- private ServiceConnection mConnection = new ServiceConnection() {
-
- @Override
- public void onServiceConnected(ComponentName className,
- IBinder service) {
- // We've bound to LocalService, cast the IBinder and get LocalService instance
- LocalBinder binder = (LocalBinder) service;
- mService = binder.getService();
- mBound = true;
- }
-
- @Override
- public void onServiceDisconnected(ComponentName arg0) {
- mBound = false;
- }
- };
-}
-</pre>
-
-<p>The above sample shows how the client binds to the service using an implementation of
-{@link android.content.ServiceConnection} and the {@link
-android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback. The next
-section provides more information about this process of binding to the service.</p>
-
-<p class="note"><strong>Note:</strong> The example above doesn't explicitly unbind from the service,
-but all clients should unbind at an appropriate time (such as when the activity pauses).</p>
-
-<p>For more sample code, see the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html">{@code
-LocalService.java}</a> class and the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LocalServiceActivities.html">{@code
-LocalServiceActivities.java}</a> class in <a
-href="{@docRoot}resources/samples/ApiDemos/index.html">ApiDemos</a>.</p>
-
-
-
-
-
-<h3 id="Messenger">Using a Messenger</h3>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h4>Compared to AIDL</h4>
- <p>When you need to perform IPC, using a {@link android.os.Messenger} for your interface is
-simpler than implementing it with AIDL, because {@link android.os.Messenger} queues
-all calls to the service, whereas, a pure AIDL interface sends simultaneous requests to the
-service, which must then handle multi-threading.</p>
- <p>For most applications, the service doesn't need to perform multi-threading, so using a {@link
-android.os.Messenger} allows the service to handle one call at a time. If it's important
-that your service be multi-threaded, then you should use <a
-href="{@docRoot}guide/developing/tools/aidl.html">AIDL</a> to define your interface.</p>
-</div>
-</div>
-
-<p>If you need your service to communicate with remote processes, then you can use a
-{@link android.os.Messenger} to provide the interface for your service. This technique allows
-you to perform interprocess communication (IPC) without the need to use AIDL.</p>
-
-<p>Here's a summary of how to use a {@link android.os.Messenger}:</p>
-
-<ul>
- <li>The service implements a {@link android.os.Handler} that receives a callback for each
-call from a client.</li>
- <li>The {@link android.os.Handler} is used to create a {@link android.os.Messenger} object
-(which is a reference to the {@link android.os.Handler}).</li>
- <li>The {@link android.os.Messenger} creates an {@link android.os.IBinder} that the service
-returns to clients from {@link android.app.Service#onBind onBind()}.</li>
- <li>Clients use the {@link android.os.IBinder} to instantiate the {@link android.os.Messenger}
-(that references the service's {@link android.os.Handler}), which the client uses to send
-{@link android.os.Message} objects to the service.</li>
- <li>The service receives each {@link android.os.Message} in its {@link
-android.os.Handler}—specifically, in the {@link android.os.Handler#handleMessage
-handleMessage()} method.</li>
-</ul>
-
-
-<p>In this way, there are no "methods" for the client to call on the service. Instead, the
-client delivers "messages" ({@link android.os.Message} objects) that the service receives in
-its {@link android.os.Handler}.</p>
-
-<p>Here's a simple example service that uses a {@link android.os.Messenger} interface:</p>
-
-<pre>
-public class MessengerService extends Service {
- /** Command to the service to display a message */
- static final int MSG_SAY_HELLO = 1;
-
- /**
- * Handler of incoming messages from clients.
- */
- class IncomingHandler extends Handler {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_SAY_HELLO:
- Toast.makeText(getApplicationContext(), "hello!", Toast.LENGTH_SHORT).show();
- break;
- default:
- super.handleMessage(msg);
- }
- }
- }
-
- /**
- * Target we publish for clients to send messages to IncomingHandler.
- */
- final Messenger mMessenger = new Messenger(new IncomingHandler());
-
- /**
- * When binding to the service, we return an interface to our messenger
- * for sending messages to the service.
- */
- @Override
- public IBinder onBind(Intent intent) {
- Toast.makeText(getApplicationContext(), "binding", Toast.LENGTH_SHORT).show();
- return mMessenger.getBinder();
- }
-}
-</pre>
-
-<p>Notice that the {@link android.os.Handler#handleMessage handleMessage()} method in the
-{@link android.os.Handler} is where the service receives the incoming {@link android.os.Message}
-and decides what to do, based on the {@link android.os.Message#what} member.</p>
-
-<p>All that a client needs to do is create a {@link android.os.Messenger} based on the {@link
-android.os.IBinder} returned by the service and send a message using {@link
-android.os.Messenger#send send()}. For example, here's a simple activity that binds to the
-service and delivers the {@code MSG_SAY_HELLO} message to the service:</p>
-
-<pre>
-public class ActivityMessenger extends Activity {
- /** Messenger for communicating with the service. */
- Messenger mService = null;
-
- /** Flag indicating whether we have called bind on the service. */
- boolean mBound;
-
- /**
- * Class for interacting with the main interface of the service.
- */
- private ServiceConnection mConnection = new ServiceConnection() {
- public void onServiceConnected(ComponentName className, IBinder service) {
- // This is called when the connection with the service has been
- // established, giving us the object we can use to
- // interact with the service. We are communicating with the
- // service using a Messenger, so here we get a client-side
- // representation of that from the raw IBinder object.
- mService = new Messenger(service);
- mBound = true;
- }
-
- public void onServiceDisconnected(ComponentName className) {
- // This is called when the connection with the service has been
- // unexpectedly disconnected -- that is, its process crashed.
- mService = null;
- mBound = false;
- }
- };
-
- public void sayHello(View v) {
- if (!mBound) return;
- // Create and send a message to the service, using a supported 'what' value
- Message msg = Message.obtain(null, MessengerService.MSG_SAY_HELLO, 0, 0);
- try {
- mService.send(msg);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- }
-
- @Override
- protected void onStart() {
- super.onStart();
- // Bind to the service
- bindService(new Intent(this, MessengerService.class), mConnection,
- Context.BIND_AUTO_CREATE);
- }
-
- @Override
- protected void onStop() {
- super.onStop();
- // Unbind from the service
- if (mBound) {
- unbindService(mConnection);
- mBound = false;
- }
- }
-}
-</pre>
-
-<p>Notice that this example does not show how the service can respond to the client. If you want the
-service to respond, then you need to also create a {@link android.os.Messenger} in the client. Then
-when the client receives the {@link android.content.ServiceConnection#onServiceConnected
-onServiceConnected()} callback, it sends a {@link android.os.Message} to the service that includes
-the client's {@link android.os.Messenger} in the {@link android.os.Message#replyTo} parameter
-of the {@link android.os.Messenger#send send()} method.</p>
-
-<p>You can see an example of how to provide two-way messaging in the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/MessengerService.html">{@code
-MessengerService.java}</a> (service) and <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/MessengerServiceActivities.html">{@code
-MessengerServiceActivities.java}</a> (client) samples.</p>
-
-
-
-
-
-<h2 id="Binding">Binding to a Service</h2>
-
-<p>Application components (clients) can bind to a service by calling
-{@link android.content.Context#bindService bindService()}. The Android
-system then calls the service's {@link android.app.Service#onBind
-onBind()} method, which returns an {@link android.os.IBinder} for interacting with the service.</p>
-
-<p>The binding is asynchronous. {@link android.content.Context#bindService
-bindService()} returns immediately and does <em>not</em> return the {@link android.os.IBinder} to
-the client. To receive the {@link android.os.IBinder}, the client must create an instance of {@link
-android.content.ServiceConnection} and pass it to {@link android.content.Context#bindService
-bindService()}. The {@link android.content.ServiceConnection} includes a callback method that the
-system calls to deliver the {@link android.os.IBinder}.</p>
-
-<p class="note"><strong>Note:</strong> Only activities, services, and content providers can bind
-to a service—you <strong>cannot</strong> bind to a service from a broadcast receiver.</p>
-
-<p>So, to bind to a service from your client, you must: </p>
-<ol>
- <li>Implement {@link android.content.ServiceConnection}.
- <p>Your implementation must override two callback methods:</p>
- <dl>
- <dt>{@link android.content.ServiceConnection#onServiceConnected onServiceConnected()}</dt>
- <dd>The system calls this to deliver the {@link android.os.IBinder} returned by
-the service's {@link android.app.Service#onBind onBind()} method.</dd>
- <dt>{@link android.content.ServiceConnection#onServiceDisconnected
-onServiceDisconnected()}</dt>
- <dd>The Android system calls this when the connection to the service is unexpectedly
-lost, such as when the service has crashed or has been killed. This is <em>not</em> called when the
-client unbinds.</dd>
- </dl>
- </li>
- <li>Call {@link
-android.content.Context#bindService bindService()}, passing the {@link
-android.content.ServiceConnection} implementation. </li>
- <li>When the system calls your {@link android.content.ServiceConnection#onServiceConnected
-onServiceConnected()} callback method, you can begin making calls to the service, using
-the methods defined by the interface.</li>
- <li>To disconnect from the service, call {@link
-android.content.Context#unbindService unbindService()}.
- <p>When your client is destroyed, it will unbind from the service, but you should always unbind
-when you're done interacting with the service or when your activity pauses so that the service can
-shutdown while its not being used. (Appropriate times to bind and unbind is discussed
-more below.)</p>
- </li>
-</ol>
-
-<p>For example, the following snippet connects the client to the service created above by
-<a href="#Binder">extending the Binder class</a>, so all it must do is cast the returned
-{@link android.os.IBinder} to the {@code LocalService} class and request the {@code
-LocalService} instance:</p>
-
-<pre>
-LocalService mService;
-private ServiceConnection mConnection = new ServiceConnection() {
- // Called when the connection with the service is established
- public void onServiceConnected(ComponentName className, IBinder service) {
- // Because we have bound to an explicit
- // service that is running in our own process, we can
- // cast its IBinder to a concrete class and directly access it.
- LocalBinder binder = (LocalBinder) service;
- mService = binder.getService();
- mBound = true;
- }
-
- // Called when the connection with the service disconnects unexpectedly
- public void onServiceDisconnected(ComponentName className) {
- Log.e(TAG, "onServiceDisconnected");
- mBound = false;
- }
-};
-</pre>
-
-<p>With this {@link android.content.ServiceConnection}, the client can bind to a service by passing
-this it to {@link android.content.Context#bindService bindService()}. For example:</p>
-
-<pre>
-Intent intent = new Intent(this, LocalService.class);
-bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
-</pre>
-
-<ul>
- <li>The first parameter of {@link android.content.Context#bindService bindService()} is an
-{@link android.content.Intent} that explicitly names the service to bind (thought the intent
-could be implicit).</li>
-<li>The second parameter is the {@link android.content.ServiceConnection} object.</li>
-<li>The third parameter is a flag indicating options for the binding. It should usually be {@link
-android.content.Context#BIND_AUTO_CREATE} in order to create the service if its not already alive.
-Other possible values are {@link android.content.Context#BIND_DEBUG_UNBIND}
-and {@link android.content.Context#BIND_NOT_FOREGROUND}, or {@code 0} for none.</li>
-</ul>
-
-
-<h3>Additional notes</h3>
-
-<p>Here are some important notes about binding to a service:</p>
-<ul>
- <li>You should always trap {@link android.os.DeadObjectException} exceptions, which are thrown
-when the connection has broken. This is the only exception thrown by remote methods.</li>
- <li>Objects are reference counted across processes. </li>
- <li>You should usually pair the binding and unbinding during
-matching bring-up and tear-down moments of the client's lifecycle. For example:
- <ul>
- <li>If you only need to interact with the service while your activity is visible, you
-should bind during {@link android.app.Activity#onStart onStart()} and unbind during {@link
-android.app.Activity#onStop onStop()}.</li>
- <li>If you want your activity to receive responses even while it is stopped in the
-background, then you can bind during {@link android.app.Activity#onCreate onCreate()} and unbind
-during {@link android.app.Activity#onDestroy onDestroy()}. Beware that this implies that your
-activity needs to use the service the entire time it's running (even in the background), so if
-the service is in another process, then you increase the weight of the process and it becomes
-more likely that the system will kill it.</li>
- </ul>
- <p class="note"><strong>Note:</strong> You should usually <strong>not</strong> bind and unbind
-during your activity's {@link android.app.Activity#onResume onResume()} and {@link
-android.app.Activity#onPause onPause()}, because these callbacks occur at every lifecycle transition
-and you should keep the processing that occurs at these transitions to a minimum. Also, if
-multiple activities in your application bind to the same service and there is a transition between
-two of those activities, the service may be destroyed and recreated as the current activity unbinds
-(during pause) before the next one binds (during resume). (This activity transition for how
-activities coordinate their lifecycles is described in the <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#CoordinatingActivities">Activities</a>
-document.)</p>
-</ul>
-
-<p>For more sample code, showing how to bind to a service, see the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.html">{@code
-RemoteService.java}</a> class in <a
-href="{@docRoot}resources/samples/ApiDemos/index.html">ApiDemos</a>.</p>
-
-
-
-
-
-<h2 id="Lifecycle">Managing the Lifecycle of a Bound Service</h2>
-
-<div class="figure" style="width:588px">
-<img src="{@docRoot}images/fundamentals/service_binding_tree_lifecycle.png" alt="" />
-<p class="img-caption"><strong>Figure 1.</strong> The lifecycle for a service that is started
-and also allows binding.</p>
-</div>
-
-<p>When a service is unbound from all clients, the Android system destroys it (unless it was also
-started with {@link android.app.Service#onStartCommand onStartCommand()}). As such, you don't have
-to manage the lifecycle of your service if it's purely a bound
-service—the Android system manages it for you based on whether it is bound to any clients.</p>
-
-<p>However, if you choose to implement the {@link android.app.Service#onStartCommand
-onStartCommand()} callback method, then you must explicitly stop the service, because the
-service is now considered to be <em>started</em>. In this case, the service runs until the service
-stops itself with {@link android.app.Service#stopSelf()} or another component calls {@link
-android.content.Context#stopService stopService()}, regardless of whether it is bound to any
-clients.</p>
-
-<p>Additionally, if your service is started and accepts binding, then when the system calls
-your {@link android.app.Service#onUnbind onUnbind()} method, you can optionally return
-{@code true} if you would like to receive a call to {@link android.app.Service#onRebind
-onRebind()} the next time a client binds to the service (instead of receiving a call to {@link
-android.app.Service#onBind onBind()}). {@link android.app.Service#onRebind
-onRebind()} returns void, but the client still receives the {@link android.os.IBinder} in its
-{@link android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback.
-Below, figure 1 illustrates the logic for this kind of lifecycle.</p>
-
-<p>For more information about the lifecycle of an started service, see the <a
-href="{@docRoot}guide/topics/fundamentals/services.html#Lifecycle">Services</a> document.</p>
-
-
-
-
diff --git a/docs/html/guide/topics/fundamentals/fragments.jd b/docs/html/guide/topics/fundamentals/fragments.jd
deleted file mode 100644
index 2a22394..0000000
--- a/docs/html/guide/topics/fundamentals/fragments.jd
+++ /dev/null
@@ -1,836 +0,0 @@
-page.title=Fragments
-parent.title=Activities
-parent.link=activities.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>Quickview</h2>
- <ul>
- <li>Fragments decompose application functionality and UI into reusable modules</li>
- <li>Add multiple fragments to a screen to avoid switching activities</li>
- <li>Fragments have their own lifecycle, state, and back stack</li>
- <li>Fragments require API Level 11 or greater</li>
- </ul>
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#Design">Design Philosophy</a></li>
- <li><a href="#Creating">Creating a Fragment</a>
- <ol>
- <li><a href="#UI">Adding a user interface</a></li>
- <li><a href="#Adding">Adding a fragment to an activity</a></li>
- </ol>
- </li>
- <li><a href="#Managing">Managing Fragments</a></li>
- <li><a href="#Transactions">Performing Fragment Transactions</a></li>
- <li><a href="#CommunicatingWithActivity">Communicating with the Activity</a>
- <ol>
- <li><a href="#EventCallbacks">Creating event callbacks to the activity</a></li>
- <li><a href="#ActionBar">Adding items to the Action Bar</a></li>
- </ol>
- </li>
- <li><a href="#Lifecycle">Handling the Fragment Lifecycle</a>
- <ol>
- <li><a href="#CoordinatingWithActivity">Coordinating with the activity lifecycle</a></li>
- </ol>
- </li>
- <li><a href="#Example">Example</a></li>
- </ol>
-
- <h2>Key classes</h2>
- <ol>
- <li>{@link android.app.Fragment}</li>
- <li>{@link android.app.FragmentManager}</li>
- <li>{@link android.app.FragmentTransaction}</li>
- </ol>
-
- <h2>Related samples</h2>
- <ol>
- <li><a
-href="{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a></li>
- <li><a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#Fragment">ApiDemos</a></li>
- </ol>
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets
-and Handsets</a></li>
- </ol>
-</div>
-</div>
-
-<p>A {@link android.app.Fragment} represents a behavior or a portion of user interface in an
-{@link android.app.Activity}. You can combine multiple fragments in a single activity to build a
-multi-pane UI and reuse a fragment in multiple activities. You can think of a fragment as a
-modular section of an activity, which has its own lifecycle, receives its own input events, and
-which you can add or remove while the activity is running (sort of like a "sub activity" that
-you can reuse in different activities).</p>
-
-<p>A fragment must always be embedded in an activity and the fragment's lifecycle is directly
-affected by the host activity's lifecycle. For example, when the activity is paused, so are all
-fragments in it, and when the activity is destroyed, so are all fragments. However, while an
-activity is running (it is in the <em>resumed</em> <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">lifecycle state</a>), you can
-manipulate each fragment independently, such as add or remove them. When you perform such a
-fragment transaction, you can also add it to a back stack that's managed by the
-activity—each back stack entry in the activity is a record of the fragment transaction that
-occurred. The back stack allows the user to reverse a fragment transaction (navigate backwards),
-by pressing the <em>Back</em> button.</p>
-
-<p>When you add a fragment as a part of your activity layout, it lives in a {@link
-android.view.ViewGroup} inside the activity's view hierarchy and the fragment defines its own view
-layout.
-You can insert a fragment into your activity layout by declaring the fragment in the activity's
-layout file, as a {@code <fragment>} element, or from your application code by adding it to an
-existing {@link android.view.ViewGroup}. However, a fragment is not required to be a part of the
-activity layout; you may also use a fragment without its own UI as an invisible worker for the
-activity.</p>
-
-<p>This document describes how to build your application to use fragments, including
-how fragments can maintain their state when added to the activity's back stack, share
-events with the activity and other fragments in the activity, contribute to the activity's action
-bar, and more.</p>
-
-
-<h2 id="Design">Design Philosophy</h2>
-
-<p>Android introduced fragments in Android 3.0 (API level 11), primarily to support more
-dynamic and flexible UI designs on large screens, such as tablets. Because a
-tablet's screen is much larger than that of a handset, there's more room to combine and
-interchange UI components. Fragments allow such designs without the need for you to manage complex
-changes to the view hierarchy. By dividing the layout of an activity into fragments, you become able
-to modify the activity's appearance at runtime and preserve those changes in a back stack
-that's managed by the activity.</p>
-
-<p>For example, a news application can use one fragment to show a list of articles on the
-left and another fragment to display an article on the right—both fragments appear in one
-activity, side by side, and each fragment has its own set of lifecycle callback methods and handle
-their own user input events. Thus, instead of using one activity to select an article and another
-activity to read the article, the user can select an article and read it all within the same
-activity, as illustrated in the tablet layout in figure 1.</p>
-
-<p>You should design each fragment as a modular and reusable activity component. That is, because
-each fragment defines its own layout and its own behavior with its own lifecycle callbacks, you can
-include one fragment in multiple activities, so you should design for reuse and avoid directly
-manipulating one fragment from another fragment. This is especially important because a modular
-fragment allows you to change your fragment combinations for different screen sizes. When designing
-your application to support both tablets and handsets, you can reuse your fragments in different
-layout configurations to optimize the user experience based on the available screen space. For
-example, on a handset, it might be necessary to separate fragments to provide a single-pane UI when
-more than one cannot fit within the same activity.</p>
-
-<img src="{@docRoot}images/fundamentals/fragments.png" alt="" />
-<p class="img-caption"><strong>Figure 1.</strong> An example of how two UI modules defined by
-fragments can be combined into one activity for a tablet design, but separated for a
-handset design.</p>
-
-<p>For example—to continue with the news application example—the application can embed
-two fragments in <em>Activity A</em>, when running on a tablet-sized device. However, on a
-handset-sized screen, there's not enough room for both fragments, so <em>Activity A</em> includes
-only the fragment for the list of articles, and when the user selects an article, it starts
-<em>Activity B</em>, which includes the second fragment to read the article. Thus, the application
-supports both tablets and handsets by reusing fragments in different combinations, as illustrated in
-figure 1.</p>
-
-<p>For more information about designing your application with different fragment combinations for
-different screen configurations, see the guide to <a
-href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets and Handsets</a>.</p>
-
-
-
-<h2 id="Creating">Creating a Fragment</h2>
-
-<div class="figure" style="width:327px">
-<img src="{@docRoot}images/fragment_lifecycle.png" alt="" />
-<p class="img-caption"><strong>Figure 2.</strong> The lifecycle of a fragment (while its
-activity is running).</p>
-</div>
-
-<p>To create a fragment, you must create a subclass of {@link android.app.Fragment} (or an existing
-subclass of it). The {@link android.app.Fragment} class has code that looks a lot like
-an {@link android.app.Activity}. It contains callback methods similar to an activity, such
-as {@link android.app.Fragment#onCreate onCreate()}, {@link android.app.Fragment#onStart onStart()},
-{@link android.app.Fragment#onPause onPause()}, and {@link android.app.Fragment#onStop onStop()}. In
-fact, if you're converting an existing Android application to use fragments, you might simply move
-code from your activity's callback methods into the respective callback methods of your
-fragment.</p>
-
-<p>Usually, you should implement at least the following lifecycle methods:</p>
-
-<dl>
- <dt>{@link android.app.Fragment#onCreate onCreate()}</dt>
- <dd>The system calls this when creating the fragment. Within your implementation, you should
-initialize essential components of the fragment that you want to retain when the fragment is
-paused or stopped, then resumed.</dd>
- <dt>{@link android.app.Fragment#onCreateView onCreateView()}</dt>
- <dd>The system calls this when it's time for the fragment to draw its user interface for the
-first time. To draw a UI for your fragment, you must return a {@link android.view.View} from this
-method that is the root of your fragment's layout. You can return null if the fragment does not
-provide a UI.</dd>
- <dt>{@link android.app.Activity#onPause onPause()}</dt>
- <dd>The system calls this method as the first indication that the user is leaving the
-fragment (though it does not always mean the fragment is being destroyed). This is usually where you
-should commit any changes that should be persisted beyond the current user session (because
-the user might not come back).</dd>
-</dl>
-
-<p>Most applications should implement at least these three methods for every fragment, but there are
-several other callback methods you should also use to handle various stages of the
-fragment lifecycle. All the lifecycle callback methods are discussed more later, in the section
-about <a href="#Lifecycle">Handling the Fragment Lifecycle</a>.</p>
-
-
-<p>There are also a few subclasses that you might want to extend, instead of the base {@link
-android.app.Fragment} class:</p>
-
-<dl>
- <dt>{@link android.app.DialogFragment}</dt>
- <dd>Displays a floating dialog. Using this class to create a dialog is a good alternative to using
-the dialog helper methods in the {@link android.app.Activity} class, because you can
-incorporate a fragment dialog into the back stack of fragments managed by the activity,
-allowing the user to return to a dismissed fragment.</dd>
-
- <dt>{@link android.app.ListFragment}</dt>
- <dd>Displays a list of items that are managed by an adapter (such as a {@link
-android.widget.SimpleCursorAdapter}), similar to {@link android.app.ListActivity}. It provides
-several methods for managing a list view, such as the {@link
-android.app.ListFragment#onListItemClick(ListView,View,int,long) onListItemClick()} callback to
-handle click events.</dd>
-
- <dt>{@link android.preference.PreferenceFragment}</dt>
- <dd>Displays a hierarchy of {@link android.preference.Preference} objects as a list, similar to
-{@link android.preference.PreferenceActivity}. This is useful when creating a "settings"
-activity for your application.</dd>
-</dl>
-
-
-<h3 id="UI">Adding a user interface</h3>
-
-<p>A fragment is usually used as part of an activity's user interface and contributes its own
-layout to the activity.</p>
-
-<p>To provide a layout for a fragment, you must implement the {@link
-android.app.Fragment#onCreateView onCreateView()} callback method, which the Android system calls
-when it's time for the fragment to draw its layout. Your implementation of this method must return a
-{@link android.view.View} that is the root of your fragment's layout.</p>
-
-<p class="note"><strong>Note:</strong> If your fragment is a subclass of {@link
-android.app.ListFragment}, the default implementation returns a {@link android.widget.ListView} from
-{@link android.app.Fragment#onCreateView onCreateView()}, so you don't need to implement it.</p>
-
-<p>To return a layout from {@link
-android.app.Fragment#onCreateView onCreateView()}, you can inflate it from a <a
-href="{@docRoot}guide/topics/resources/layout-resource.html">layout resource</a> defined in XML. To
-help you do so, {@link android.app.Fragment#onCreateView onCreateView()} provides a
-{@link android.view.LayoutInflater} object.</p>
-
-<p>For example, here's a subclass of {@link android.app.Fragment} that loads a layout from the
-{@code example_fragment.xml} file:</p>
-
-<pre>
-public static class ExampleFragment extends Fragment {
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- // Inflate the layout for this fragment
- return inflater.inflate(R.layout.example_fragment, container, false);
- }
-}
-</pre>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h3>Creating a layout</h3>
- <p>In the sample above, {@code R.layout.example_fragment} is a reference to a layout resource
-named {@code example_fragment.xml} saved in the application resources. For information about how to
-create a layout in XML, see the <a href="{@docRoot}guide/topics/ui/index.html">User Interface</a>
-documentation.</p>
-</div>
-</div>
-
-<p>The {@code container} parameter passed to {@link android.app.Fragment#onCreateView
-onCreateView()} is the parent {@link android.view.ViewGroup} (from the activity's layout) in which
-your fragment layout
-will be inserted. The {@code savedInstanceState} parameter is a {@link android.os.Bundle} that
-provides data about the previous instance of the fragment, if the fragment is being resumed
-(restoring state is discussed more in the section about <a href="#Lifecycle">Handling the
-Fragment Lifecycle</a>).</p>
-
-<p>The {@link android.view.LayoutInflater#inflate(int,ViewGroup,boolean) inflate()} method takes
-three arguments:</p>
-<ul>
- <li>The resource ID of the layout you want to inflate.</li>
- <li>The {@link android.view.ViewGroup} to be the parent of the inflated layout. Passing the {@code
-container} is important in order for the system to apply layout parameters to the root view of the
-inflated layout, specified by the parent view in which it's going.</li>
- <li>A boolean indicating whether the inflated layout should be attached to the {@link
-android.view.ViewGroup} (the second parameter) during inflation. (In this case, this
-is false because the system is already inserting the inflated layout into the {@code
-container}—passing true would create a redundant view group in the final layout.)</li>
-</ul>
-
-<p>Now you've seen how to create a fragment that provides a layout. Next, you need to add
-the fragment to your activity.</p>
-
-
-
-<h3 id="Adding">Adding a fragment to an activity</h3>
-
-<p>Usually, a fragment contributes a portion of UI to the host activity, which is embedded as a part
-of the activity's overall view hierarchy. There are two ways you can add a fragment to the activity
-layout:</p>
-
-<ul>
- <li><b>Declare the fragment inside the activity's layout file.</b>
-<p>In this case, you can
-specify layout properties for the fragment as if it were a view. For example, here's the layout
-file for an activity with two fragments:</p>
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <fragment android:name="com.example.news.ArticleListFragment"
- android:id="@+id/list"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="match_parent" />
- <fragment android:name="com.example.news.ArticleReaderFragment"
- android:id="@+id/viewer"
- android:layout_weight="2"
- android:layout_width="0dp"
- android:layout_height="match_parent" />
-</LinearLayout>
-</pre>
- <p>The {@code android:name} attribute in the {@code <fragment>} specifies the {@link
-android.app.Fragment} class to instantiate in the layout.</p>
-
-<p>When the system creates this activity layout, it instantiates each fragment specified in the
-layout and calls the {@link android.app.Fragment#onCreateView onCreateView()} method for each one,
-to retrieve each fragment's layout. The system inserts the {@link android.view.View} returned by the
-fragment directly in place of the {@code <fragment>} element.</p>
-
-<div class="note">
- <p><strong>Note:</strong> Each fragment requires a unique identifier that
-the system can use to restore the fragment if the activity is restarted (and which you can use to
-capture the fragment to perform transactions, such as remove it). There are three ways to provide an
-ID for a fragment:</p>
- <ul>
- <li>Supply the {@code android:id} attribute with a unique ID.</li>
- <li>Supply the {@code android:tag} attribute with a unique string.</li>
- <li>If you provide neither of the previous two, the system uses the ID of the container
-view.</li>
- </ul>
-</div>
- </li>
-
- <li><b>Or, programmatically add the fragment to an existing {@link android.view.ViewGroup}.</b>
-<p>At any time while your activity is running, you can add fragments to your activity layout. You
-simply need to specify a {@link
-android.view.ViewGroup} in which to place the fragment.</p>
- <p>To make fragment transactions in your activity (such as add, remove, or replace a
-fragment), you must use APIs from {@link android.app.FragmentTransaction}. You can get an instance
-of {@link android.app.FragmentTransaction} from your {@link android.app.Activity} like this:</p>
-
-<pre>
-FragmentManager fragmentManager = {@link android.app.Activity#getFragmentManager()}
-FragmentTransaction fragmentTransaction = fragmentManager.{@link android.app.FragmentManager#beginTransaction()};
-</pre>
-
-<p>You can then add a fragment using the {@link
-android.app.FragmentTransaction#add(int,Fragment) add()} method, specifying the fragment to add and
-the view in which to insert it. For example:</p>
-
-<pre>
-ExampleFragment fragment = new ExampleFragment();
-fragmentTransaction.add(R.id.fragment_container, fragment);
-fragmentTransaction.commit();
-</pre>
-
- <p>The first argument passed to {@link android.app.FragmentTransaction#add(int,Fragment) add()}
-is the {@link android.view.ViewGroup} in which the fragment should be placed, specified by
-resource ID, and the second parameter is the fragment to add.</p>
- <p>Once you've made your changes with
-{@link android.app.FragmentTransaction}, you must
-call {@link android.app.FragmentTransaction#commit} for the changes to take effect.</p>
- </li>
-</ul>
-
-
-<h4 id="AddingWithoutUI">Adding a fragment without a UI</h4>
-
-<p>The examples above show how to add a fragment to your activity in order to provide a UI. However,
-you can also use a fragment to provide a background behavior for the activity without presenting
-additional UI.</p>
-
-<p>To add a fragment without a UI, add the fragment from the activity using {@link
-android.app.FragmentTransaction#add(Fragment,String)} (supplying a unique string "tag" for the
-fragment, rather than a view ID). This adds the fragment, but, because it's not associated with a
-view in the activity layout, it does not receive a call to {@link
-android.app.Fragment#onCreateView onCreateView()}. So you don't need to implement that method.</p>
-
-<p>Supplying a string tag for the fragment isn't strictly for non-UI fragments—you can also
-supply string tags to fragments that do have a UI—but if the fragment does not have a
-UI, then the string tag is the only way to identify it. If you want to get the fragment from the
-activity later, you need to use {@link android.app.FragmentManager#findFragmentByTag
-findFragmentByTag()}.</p>
-
-<p>For an example activity that uses a fragment as a background worker, without a UI, see the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/FragmentRetainInstance.html">{@code
-FragmentRetainInstance.java}</a> sample.</p>
-
-
-
-<h2 id="Managing">Managing Fragments</h2>
-
-<p>To manage the fragments in your activity, you need to use {@link android.app.FragmentManager}. To
-get it, call {@link android.app.Activity#getFragmentManager()} from your activity.</p>
-
-<p>Some things that you can do with {@link android.app.FragmentManager} include:</p>
-
-<ul>
- <li>Get fragments that exist in the activity, with {@link
-android.app.FragmentManager#findFragmentById findFragmentById()} (for fragments that provide a UI in
-the activity layout) or {@link android.app.FragmentManager#findFragmentByTag
-findFragmentByTag()} (for fragments that do or don't provide a UI).</li>
- <li>Pop fragments off the back stack, with {@link
-android.app.FragmentManager#popBackStack()} (simulating a <em>Back</em> command by the user).</li>
- <li>Register a listener for changes to the back stack, with {@link
-android.app.FragmentManager#addOnBackStackChangedListener addOnBackStackChangedListener()}.</li>
-</ul>
-
-<p>For more information about these methods and others, refer to the {@link
-android.app.FragmentManager} class documentation.</p>
-
-<p>As demonstrated in the previous section, you can also use {@link android.app.FragmentManager}
-to open a {@link android.app.FragmentTransaction}, which allows you to perform transactions, such as
-add and remove fragments.</p>
-
-
-<h2 id="Transactions">Performing Fragment Transactions</h2>
-
-<p>A great feature about using fragments in your activity is the ability to add, remove, replace,
-and perform other actions with them, in response to user interaction. Each set of changes that you
-commit to the activity is called a transaction and you can perform one using APIs in {@link
-android.app.FragmentTransaction}. You can also save each transaction to a back stack managed by the
-activity, allowing the user to navigate backward through the fragment changes (similar to navigating
-backward through activities).</p>
-
-<p>You can acquire an instance of {@link android.app.FragmentTransaction} from the {@link
-android.app.FragmentManager} like this:</p>
-
-<pre>
-FragmentManager fragmentManager = {@link android.app.Activity#getFragmentManager()};
-FragmentTransaction fragmentTransaction = fragmentManager.{@link android.app.FragmentManager#beginTransaction()};
-</pre>
-
-<p>Each transaction is a set of changes that you want to perform at the same time. You can set
-up all the changes you want to perform for a given transaction using methods such as {@link
-android.app.FragmentTransaction#add add()}, {@link android.app.FragmentTransaction#remove remove()},
-and {@link android.app.FragmentTransaction#replace replace()}. Then, to apply the transaction
-to the activity, you must call {@link android.app.FragmentTransaction#commit()}.</p>
-</dl>
-
-<p>Before you call {@link
-android.app.FragmentTransaction#commit()}, however, you might want to call {@link
-android.app.FragmentTransaction#addToBackStack addToBackStack()}, in order to add the transaction
-to a back stack of fragment transactions. This back stack is managed by the activity and allows
-the user to return to the previous fragment state, by pressing the <em>Back</em> button.</p>
-
-<p>For example, here's how you can replace one fragment with another, and preserve the previous
-state in the back stack:</p>
-
-<pre>
-// Create new fragment and transaction
-Fragment newFragment = new ExampleFragment();
-FragmentTransaction transaction = getFragmentManager().beginTransaction();
-
-// Replace whatever is in the fragment_container view with this fragment,
-// and add the transaction to the back stack
-transaction.replace(R.id.fragment_container, newFragment);
-transaction.addToBackStack(null);
-
-// Commit the transaction
-transaction.commit();
-</pre>
-
-<p>In this example, {@code newFragment} replaces whatever fragment (if any) is currently in the
-layout container identified by the {@code R.id.fragment_container} ID. By calling {@link
-android.app.FragmentTransaction#addToBackStack addToBackStack()}, the replace transaction is
-saved to the back stack so the user can reverse the transaction and bring back the
-previous fragment by pressing the <em>Back</em> button.</p>
-
-<p>If you add multiple changes to the transaction (such as another {@link
-android.app.FragmentTransaction#add add()} or {@link android.app.FragmentTransaction#remove
-remove()}) and call {@link
-android.app.FragmentTransaction#addToBackStack addToBackStack()}, then all changes applied
-before you call {@link android.app.FragmentTransaction#commit commit()} are added to the
-back stack as a single transaction and the <em>Back</em> button will reverse them all together.</p>
-
-<p>The order in which you add changes to a {@link android.app.FragmentTransaction} doesn't matter,
-except:</p>
-<ul>
- <li>You must call {@link android.app.FragmentTransaction#commit()} last</li>
- <li>If you're adding multiple fragments to the same container, then the order in which
-you add them determines the order they appear in the view hierarchy</li>
-</ul>
-
-<p>If you do not call {@link android.app.FragmentTransaction#addToBackStack(String)
-addToBackStack()} when you perform a transaction that removes a fragment, then that fragment is
-destroyed when the transaction is committed and the user cannot navigate back to it. Whereas, if you
-do call {@link android.app.FragmentTransaction#addToBackStack(String) addToBackStack()} when
-removing a fragment, then the fragment is <em>stopped</em> and will be resumed if the user navigates
-back.</p>
-
-<p class="note"><strong>Tip:</strong> For each fragment transaction, you can apply a transition
-animation, by calling {@link android.app.FragmentTransaction#setTransition setTransition()} before
-you commit.</p>
-
-<p>Calling {@link android.app.FragmentTransaction#commit()} does not perform the transaction
-immediately. Rather, it schedules it to run on the activity's UI thread (the "main" thread) as soon
-as the thread is able to do so. If necessary, however, you may call {@link
-android.app.FragmentManager#executePendingTransactions()} from your UI thread to immediately execute
-transactions submitted by {@link android.app.FragmentTransaction#commit()}. Doing so is
-usually not necessary unless the transaction is a dependency for jobs in other threads.</p>
-
-<p class="caution"><strong>Caution:</strong> You can commit a transaction using {@link
-android.app.FragmentTransaction#commit commit()} only prior to the activity <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#SavingActivityState">saving its
-state</a> (when the user leaves the activity). If you attempt to commit after that point, an
-exception will be thrown. This is because the state after the commit can be lost if the activity
-needs to be restored. For situations in which its okay that you lose the commit, use {@link
-android.app.FragmentTransaction#commitAllowingStateLoss()}.</p>
-
-
-
-
-<h2 id="CommunicatingWithActivity">Communicating with the Activity</h2>
-
-<p>Although a {@link android.app.Fragment} is implemented as an object that's independent from an
-{@link android.app.Activity} and can be used inside multiple activities, a given instance of
-a fragment is directly tied to the activity that contains it.</p>
-
-<p>Specifically, the fragment can access the {@link android.app.Activity} instance with {@link
-android.app.Fragment#getActivity()} and easily perform tasks such as find a view in the
-activity layout:</p>
-
-<pre>
-View listView = {@link android.app.Fragment#getActivity()}.{@link android.app.Activity#findViewById findViewById}(R.id.list);
-</pre>
-
-<p>Likewise, your activity can call methods in the fragment by acquiring a reference to the
-{@link android.app.Fragment} from {@link android.app.FragmentManager}, using {@link
-android.app.FragmentManager#findFragmentById findFragmentById()} or {@link
-android.app.FragmentManager#findFragmentByTag findFragmentByTag()}. For example:</p>
-
-<pre>
-ExampleFragment fragment = (ExampleFragment) getFragmentManager().findFragmentById(R.id.example_fragment);
-</pre>
-
-
-<h3 id="EventCallbacks">Creating event callbacks to the activity</h3>
-
-<p>In some cases, you might need a fragment to share events with the activity. A good way to do that
-is to define a callback interface inside the fragment and require that the host activity implement
-it. When the activity receives a callback through the interface, it can share the information with
-other fragments in the layout as necessary.</p>
-
-<p>For example, if a news application has two fragments in an activity—one to show a list of
-articles (fragment A) and another to display an article (fragment B)—then fragment A must tell
-the activity when a list item is selected so that it can tell fragment B to display the article. In
-this case, the {@code OnArticleSelectedListener} interface is declared inside fragment A:</p>
-
-<pre>
-public static class FragmentA extends ListFragment {
- ...
- // Container Activity must implement this interface
- public interface OnArticleSelectedListener {
- public void onArticleSelected(Uri articleUri);
- }
- ...
-}
-</pre>
-
-<p>Then the activity that hosts the fragment implements the {@code OnArticleSelectedListener}
-interface and
-overrides {@code onArticleSelected()} to notify fragment B of the event from fragment A. To ensure
-that the host activity implements this interface, fragment A's {@link
-android.app.Fragment#onAttach onAttach()} callback method (which the system calls when adding
-the fragment to the activity) instantiates an instance of {@code OnArticleSelectedListener} by
-casting the {@link android.app.Activity} that is passed into {@link android.app.Fragment#onAttach
-onAttach()}:</p>
-
-<pre>
-public static class FragmentA extends ListFragment {
- OnArticleSelectedListener mListener;
- ...
- @Override
- public void onAttach(Activity activity) {
- super.onAttach(activity);
- try {
- mListener = (OnArticleSelectedListener) activity;
- } catch (ClassCastException e) {
- throw new ClassCastException(activity.toString() + " must implement OnArticleSelectedListener");
- }
- }
- ...
-}
-</pre>
-
-<p>If the activity has not implemented the interface, then the fragment throws a
-{@link java.lang.ClassCastException}.
-On success, the {@code mListener} member holds a reference to activity's implementation of
-{@code OnArticleSelectedListener}, so that fragment A can share events with the activity by calling
-methods defined by the {@code OnArticleSelectedListener} interface. For example, if fragment A is an
-extension of {@link android.app.ListFragment}, each time
-the user clicks a list item, the system calls {@link android.app.ListFragment#onListItemClick
-onListItemClick()} in the fragment, which then calls {@code onArticleSelected()} to share
-the event with the activity:</p>
-
-<pre>
-public static class FragmentA extends ListFragment {
- OnArticleSelectedListener mListener;
- ...
- @Override
- public void onListItemClick(ListView l, View v, int position, long id) {
- // Append the clicked item's row ID with the content provider Uri
- Uri noteUri = ContentUris.{@link android.content.ContentUris#withAppendedId withAppendedId}(ArticleColumns.CONTENT_URI, id);
- // Send the event and Uri to the host activity
- mListener.onArticleSelected(noteUri);
- }
- ...
-}
-</pre>
-
-<p>The {@code id} parameter passed to {@link
-android.app.ListFragment#onListItemClick onListItemClick()} is the row ID of the clicked item,
-which the activity (or other fragment) uses to fetch the article from the application's {@link
-android.content.ContentProvider}.</p>
-
-<p><!--To see a complete implementation of this kind of callback interface, see the <a
-href="{@docRoot}resources/samples/NotePad/index.html">NotePad sample</a>. -->More information about
-using a content provider is available in the <a
-href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a> document.</p>
-
-
-
-<h3 id="ActionBar">Adding items to the Action Bar</h3>
-
-<p>Your fragments can contribute menu items to the activity's <a
-href="{@docRoot}guide/topics/ui/menus.html#options-menu">Options Menu</a> (and, consequently, the <a
-href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a>) by implementing
-{@link android.app.Fragment#onCreateOptionsMenu(Menu,MenuInflater) onCreateOptionsMenu()}. In order
-for this method to receive calls, however, you must call {@link
-android.app.Fragment#setHasOptionsMenu(boolean) setHasOptionsMenu()} during {@link
-android.app.Fragment#onCreate(Bundle) onCreate()}, to indicate that the fragment
-would like to add items to the Options Menu (otherwise, the fragment will not receive a call to
-{@link android.app.Fragment#onCreateOptionsMenu onCreateOptionsMenu()}).</p>
-
-<p>Any items that you then add to the Options Menu from the fragment are appended to the existing
-menu items. The fragment also receives callbacks to {@link
-android.app.Fragment#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} when a menu item
-is selected.</p>
-
-<p>You can also register a view in your fragment layout to provide a context menu by calling {@link
-android.app.Fragment#registerForContextMenu(View) registerForContextMenu()}. When the user opens
-the context menu, the fragment receives a call to {@link
-android.app.Fragment#onCreateContextMenu(ContextMenu,View,ContextMenu.ContextMenuInfo)
-onCreateContextMenu()}. When the user selects an item, the fragment receives a call to {@link
-android.app.Fragment#onContextItemSelected(MenuItem) onContextItemSelected()}.</p>
-
-<p class="note"><strong>Note:</strong> Although your fragment receives an on-item-selected callback
-for each menu item it adds, the activity is first to receive the respective callback when the user
-selects a menu item. If the activity's implementation of the on-item-selected callback does not
-handle the selected item, then the event is passed to the fragment's callback. This is true for
-the Options Menu and context menus.</p>
-
-<p>For more information about menus, see the <a
-href="{@docRoot}guide/topics/ui/menus.html">Menus</a> and <a
-href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guides.</p>
-
-
-
-
-<h2 id="Lifecycle">Handling the Fragment Lifecycle</h2>
-
-<div class="figure" style="width:350px">
-<img src="{@docRoot}images/activity_fragment_lifecycle.png" alt=""/>
-<p class="img-caption"><strong>Figure 3.</strong> The effect of the activity lifecycle on the fragment
-lifecycle.</p>
-</div>
-
-<p>Managing the lifecycle of a fragment is a lot like managing the lifecycle of an activity. Like
-an activity, a fragment can exist in three states:</p>
-
-<dl>
- <dt><i>Resumed</i></dt>
- <dd>The fragment is visible in the running activity.</dd>
-
- <dt><i>Paused</i></dt>
- <dd>Another activity is in the foreground and has focus, but the activity in which this
-fragment lives is still visible (the foreground activity is partially transparent or doesn't
-cover the entire screen).</dd>
-
- <dt><i>Stopped</i></dt>
- <dd>The fragment is not visible. Either the host activity has been stopped or the
-fragment has been removed from the activity but added to the back stack. A stopped fragment is
-still alive (all state and member information is retained by the system). However, it is no longer
-visible to the user and will be killed if the activity is killed.</dd>
-</dl>
-
-<p>Also like an activity, you can retain the state of a fragment using a {@link
-android.os.Bundle}, in case the activity's process is killed and you need to restore the
-fragment state when the activity is recreated. You can save the state during the fragment's {@link
-android.app.Fragment#onSaveInstanceState onSaveInstanceState()} callback and restore it during
-either {@link android.app.Fragment#onCreate onCreate()}, {@link
-android.app.Fragment#onCreateView onCreateView()}, or {@link
-android.app.Fragment#onActivityCreated onActivityCreated()}. For more information about saving
-state, see the <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#SavingActivityState">Activities</a>
-document.</p>
-
-<p>The most significant difference in lifecycle between an activity and a fragment is how one is
-stored in its respective back stack. An activity is placed into a back stack of activities
-that's managed by the system when it's stopped, by default (so that the user can navigate back
-to it with the <em>Back</em> button, as discussed in <a
-href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a>).
-However, a fragment is placed into a back stack managed by the host activity only when you
-explicitly request that the instance be saved by calling {@link
-android.app.FragmentTransaction#addToBackStack(String) addToBackStack()} during a transaction that
-removes the fragment.</p>
-
-<p>Otherwise, managing the fragment lifecycle is very similar to managing the activity
-lifecycle. So, the same practices for <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">managing the activity
-lifecycle</a> also apply to fragments. What you also need to understand, though, is how the life
-of the activity affects the life of the fragment.</p>
-
-
-<h3 id="CoordinatingWithActivity">Coordinating with the activity lifecycle</h3>
-
-<p>The lifecycle of the activity in which the fragment lives directly affects the lifecycle of the
-fragment, such that each lifecycle callback for the activity results in a similar callback for each
-fragment. For example, when the activity receives {@link android.app.Activity#onPause}, each
-fragment in the activity receives {@link android.app.Fragment#onPause}.</p>
-
-<p>Fragments have a few extra lifecycle callbacks, however, that handle unique interaction with the
-activity in order to perform actions such as build and destroy the fragment's UI. These additional
-callback methods are:</p>
-
-<dl>
- <dt>{@link android.app.Fragment#onAttach onAttach()}</dt>
- <dd>Called when the fragment has been associated with the activity (the {@link
-android.app.Activity} is passed in here).</dd>
- <dt>{@link android.app.Fragment#onCreateView onCreateView()}</dt>
- <dd>Called to create the view hierarchy associated with the fragment.</dd>
- <dt>{@link android.app.Fragment#onActivityCreated onActivityCreated()}</dt>
- <dd>Called when the activity's {@link android.app.Activity#onCreate
-onCreate()} method has returned.</dd>
- <dt>{@link android.app.Fragment#onDestroyView onDestroyView()}</dt>
- <dd>Called when the view hierarchy associated with the fragment is being removed.</dd>
- <dt>{@link android.app.Fragment#onDetach onDetach()}</dt>
- <dd>Called when the fragment is being disassociated from the activity.</dd>
-</dl>
-
-<p>The flow of a fragment's lifecycle, as it is affected by its host activity, is illustrated
-by figure 3. In this figure, you can see how each successive state of the activity determines which
-callback methods a fragment may receive. For example, when the activity has received its {@link
-android.app.Activity#onCreate onCreate()} callback, a fragment in the activity receives no more than
-the {@link android.app.Fragment#onActivityCreated onActivityCreated()} callback.</p>
-
-<p>Once the activity reaches the resumed state, you can freely add and remove fragments to the
-activity. Thus, only while the activity is in the resumed state can the lifecycle of a fragment
-change independently.</p>
-
-<p>However, when the activity leaves the resumed state, the fragment again is pushed through its
-lifecycle by the activity.</p>
-
-
-
-
-<h2 id="Example">Example</h2>
-
-<p>To bring everything discussed in this document together, here's an example of an activity
-using two fragments to create a two-pane layout. The activity below includes one fragment to
-show a list of Shakespeare play titles and another to show a summary of the play when selected
-from the list. It also demonstrates how to provide different configurations of the fragments,
-based on the screen configuration.</p>
-
-<p class="note"><strong>Note:</strong> The complete source code for this activity is available in
-<a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.html">{@code
-FragmentLayout.java}</a>.</p>
-
-<p>The main activity applies a layout in the usual way, during {@link
-android.app.Activity#onCreate onCreate()}:</p>
-
-{@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java main}
-
-<p>The layout applied is {@code fragment_layout.xml}:</p>
-
-{@sample development/samples/ApiDemos/res/layout-land/fragment_layout.xml layout}
-
-<p>Using this layout, the system instantiates the {@code TitlesFragment} (which lists the play
-titles) as soon as the activity loads the layout, while the {@link android.widget.FrameLayout}
-(where the fragment for showing the play summary will go) consumes space on the right side of the
-screen, but remains empty at first. As you'll see below, it's not until the user selects an item
-from the list that a fragment is placed into the {@link android.widget.FrameLayout}.</p>
-
-<p>However, not all screen configurations are wide enough to show both the list of
-plays and the summary, side by side. So, the layout above is used only for the landscape
-screen configuration, by saving it at {@code res/layout-land/fragment_layout.xml}.</p>
-
-<p>Thus, when the screen is in portrait orientation, the system applies the following layout, which
-is saved at {@code res/layout/fragment_layout.xml}:</p>
-
-{@sample development/samples/ApiDemos/res/layout/fragment_layout.xml layout}
-
-<p>This layout includes only {@code TitlesFragment}. This means that, when the device is in
-portrait orientation, only the list of play titles is visible. So, when the user clicks a list
-item in this configuration, the application will start a new activity to show the summary,
-instead of loading a second fragment.</p>
-
-<p>Next, you can see how this is accomplished in the fragment classes. First is {@code
-TitlesFragment}, which shows the list of Shakespeare play titles. This fragment extends {@link
-android.app.ListFragment} and relies on it to handle most of the list view work.</p>
-
-<p>As you inspect this code, notice that there are two possible behaviors when the user clicks a
-list item: depending on which of the two layouts is active, it can either create and display a new
-fragment to show the details in the same activity (adding the fragment to the {@link
-android.widget.FrameLayout}), or start a new activity (where the fragment can be shown).</p>
-
-{@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java titles}
-
-<p>The second fragment, {@code DetailsFragment} shows the play summary for the item selected from
-the list from {@code TitlesFragment}:</p>
-
-{@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java details}
-
-<p>Recall from the {@code TitlesFragment} class, that, if the user clicks a list item and the
-current layout does <em>not</em> include the {@code R.id.details} view (which is where the
-{@code DetailsFragment} belongs), then the application starts the {@code DetailsActivity}
-activity to display the content of the item.</p>
-
-<p>Here is the {@code DetailsActivity}, which simply embeds the {@code DetailsFragment} to display
-the selected play summary when the screen is in portrait orientation:</p>
-
-{@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java
-details_activity}
-
-<p>Notice that this activity finishes itself if the configuration is landscape, so that the main
-activity can take over and display the {@code DetailsFragment} alongside the {@code TitlesFragment}.
-This can happen if the user begins the {@code DetailsActivity} while in portrait orientation, but
-then rotates to landscape (which restarts the current activity).</p>
-
-
-<p>For more samples using fragments (and complete source files for this example),
-see the sample code available in <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#Fragment">
-ApiDemos</a> (available for download from the <a
-href="{@docRoot}resources/samples/get.html">Samples SDK component</a>).</p>
-
-
diff --git a/docs/html/guide/topics/fundamentals/processes-and-threads.jd b/docs/html/guide/topics/fundamentals/processes-and-threads.jd
deleted file mode 100644
index 814d34e..0000000
--- a/docs/html/guide/topics/fundamentals/processes-and-threads.jd
+++ /dev/null
@@ -1,486 +0,0 @@
-page.title=Processes and Threads
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-<h2>Quickview</h2>
-<ul>
- <li>Every application runs in its own process and all components of the application run in that
-process, by default</li>
- <li>Any slow, blocking operations in an activity should be done in a new thread, to avoid slowing
-down the user interface</li>
-</ul>
-
-<h2>In this document</h2>
-<ol>
-<li><a href="#Processes">Processes</a>
- <ol>
- <li><a href="#Lifecycle">Process lifecycle</a></li>
- </ol>
-</li>
-<li><a href="#Threads">Threads</a>
- <ol>
- <li><a href="#WorkerThreads">Worker threads</a></li>
- <li><a href="#ThreadSafe">Thread-safe methods</a></li>
- </ol>
-</li>
-<li><a href="#IPC">Interprocess Communication</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>When an application component starts and the process that should host that thread is not already
-running, the Android system starts a new Linux process for the application with a single thread of
-execution. By default, all components of the same application run in the same process and thread
-(called the "main" thread). If an application component starts and there already exists a process
-for that application (because another component from the application exists or Android has been
-able to retain its previous process cached in the background), then the component is
-started within that process and uses the same thread of execution. However, you can arrange for
-different components in your application to run in separate processes, and you can create additional
-threads for any process.</p>
-
-<p>This document discusses how processes and threads work in an Android application.</p>
-
-
-<h2 id="Processes">Processes</h2>
-
-<p>By default, all components of the same application run in the same process and most applications
-should not change this. However, if you find that you need to control which process a certain
-component belongs to, you can do so in the manifest file.</p>
-
-<p>The manifest entry for each type of component element—<a
-href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
-<activity>}</a>, <a href="{@docRoot}guide/topics/manifest/service-element.html">{@code
-<service>}</a>, <a href="{@docRoot}guide/topics/manifest/receiver-element.html">{@code
-<receiver>}</a>, and <a href="{@docRoot}guide/topics/manifest/provider-element.html">{@code
-<provider>}</a>—supports an {@code android:process} attribute that can specify a
-process in which that component should run. You can set this attribute so that each component runs
-in its own process or so that some components share a process while others do not. You can also set
-{@code android:process} so that components of different applications run in the same
-process—provided that the applications share the same Linux user ID and are signed with the
-same certificates.</p>
-
-<p>The <a href="{@docRoot}guide/topics/manifest/application-element.html">{@code
-<application>}</a> element also supports an {@code android:process} attribute, to set a
-default value that applies to all components.</p>
-
-<p>Android might decide to shut down a process at some point, when memory is low and required by
-other processes that are more immediately serving the user. Application
-components running in the process that's killed are consequently destroyed. A process is started
-again for those components when there's again work for them to do.</p>
-
-<p>When deciding which processes to kill, the Android system weighs their relative importance to
-the user. For example, it more readily shuts down a process hosting activities that are no longer
-visible on screen, compared to a process hosting visible activities. The decision whether to
-terminate a process, therefore, depends on the state of the components running in that process. The
-rules used to decide which processes to terminate is discussed below. </p>
-
-
-<h3 id="Lifecycle">Process lifecycle</h3>
-
-<p>The Android system tries to maintain an application process for as long as possible, but
-eventually needs to remove old processes to reclaim memory for new or more important processes. To
-determine which processes to keep
-and which to kill, the system places each process into an "importance hierarchy" based on the
-components running in the process and the state of those components. Processes with the lowest
-importance are eliminated first, then those with the next lowest importance, and so on, as necessary
-to recover system resources.</p>
-
-<p>The exact mapping of processes to importance and the management of these processes is
-an implementation detail of the platform that changes over time. Broadly speaking, there
-are five levels in the current implementation that are of most relevance to application
-developers. The following list presents these different
-types of processes in order of importance (the first process is <em>most important</em> and is
-<em>killed last</em>):</p>
-
-<ol>
- <li><b>Foreground process</b>
- <p>A process that is required for what the user is currently doing. A
- process is considered to be in the foreground if any of the following conditions are true:</p>
-
- <ul>
- <li>It hosts an {@link android.app.Activity} that the user is interacting with (the {@link
-android.app.Activity}'s {@link android.app.Activity#onResume onResume()} method has been
-called).</li>
-
- <li>It hosts a {@link android.app.Service} that's executing one of its lifecycle
-callbacks ({@link android.app.Service#onCreate onCreate()}, {@link android.app.Service#onStart
-onStart()}, or {@link android.app.Service#onDestroy onDestroy()}).</li>
-
- <li>It hosts a {@link android.content.BroadcastReceiver} that's executing its {@link
- android.content.BroadcastReceiver#onReceive onReceive()} method.</li>
-
- <li>Another foreground process has a dependency on this one: either bound
- to a Service in this process, or using a Content Provider of the process.</li>
- </ul>
-
- <p>Generally, only a few foreground processes exist at any given time. They are killed only as
-a last resort—if memory is so low that they cannot all continue to run. Generally, at that
-point, the device has reached a memory paging state, so killing some foreground processes is
-required to keep the user interface responsive.</p></li>
-
- <li><b>Visible process</b>
- <p>A process that doesn't have any foreground components, but still can
- affect what the user sees on screen. A process is considered to be visible if either of the
- following conditions are true:</p>
-
- <ul>
- <li>It hosts an {@link android.app.Activity} that is not in the foreground, but is still
-visible to the user (its {@link android.app.Activity#onPause onPause()} method has been called).
-This might occur, for example, if the foreground activity started a dialog, which allows the
-previous activity to be seen behind it.</li>
-
- <li>Another visible process has a dependency on this one: either bound
- to a Service in this process, or using a Content Provider of the process.</li>
- </ul>
-
- <p>A visible process is considered extremely important and will not be killed unless doing so
-is required to keep all foreground processes running. </p>
- </li>
-
- <li><b>Perceptible process</b>
- <p>A process that doesn't have any foreground or visible components, but is still
- doing something that is directly perceptible by the user. A classic example of such
- a process would be one doing background music playback. The main way applications
- get into this state is through {@link android.app.Service#startForeground} or because
- another perceptible process has a dependency on one of its services or content
- providers. In addition, as of {@link android.os.Build.VERSION_CODES#HONEYCOMB},
- processes can go into this state when {@link android.app.Activity#onStop
- Activity.onStop()} is executing, allowing the process to continue executing
- critical code after no longer being visible to the user but before going
- fully into the background.</p>
-
- <p>Like visible processes, a perceptible process is considered extremely important
- and will not be killed unless doing so is required to keep all foreground and
- visible processes running. </p>
- </li>
-
- <li><b>Service process</b>
- <p>A process that is running a service that has been started with the {@link
-android.content.Context#startService startService()} method and does not fall into any of the
-higher categories. Although service processes are not directly tied to anything the user sees, they
-are generally doing things that the user cares about (such as downloading a file the user has requested),
-so the system keeps them running unless there's not enough memory to retain them along with all
-foreground and visible processes. </p>
-
- <p>Even though Android tries to keep these processes running, it is considered normal
- operation for them to temporarily be killed to support the needs of more important
- processes. For example, if the user opens a very heavy-weight web page that needs
- most of the device's RAM, background services may be temporarily killed to satisfy
- those needs. Services in these processes thus must be prepared to deal gracefully
- with being killed while doing their work and later restarted.</p>
-
- <p>In recent implementations of Android, there are actually a number of sub-divisions
- in this area for processes that Android considers more important to the user and so
- would like to try harder to keep around. For example, the process hosting the current
- home app is generally kept in this area so that the user will not see long delays in
- returning home because that process has been killed.</p>
- </li>
-
- <li><b>Background (cached) process</b>
- <p>The final importance level is for processes that are not of current significance.
- This is basically any process that does not fall into one of the previous levels.
- These processes have no direct impact on the user experience, and the system can kill
- them at any time to reclaim memory for the other more important processes.
- This includes everything from processes holding running activity objects that are not currently
- visible to the user (the activity's {@link android.app.Activity#onStop onStop()}
- method has been called) to processes that have no active code at all but may be
- useful to keep around in case they are needed in the near future.</p>
-
- <p>Usually there are many background processes being maintained, so they are kept
- in an LRU list to allow older processes to be killed before more recent ones. This
- helps reduce the frequency that new processes need to be creating, facilitating things
- like more rapid switching between the applications the user has recently visited.
- However, processes in this state must deal correctly with being killed and later
- restarted when needed. For example, if an activity implements its lifecycle methods
-correctly, and saves its current state, killing its process will not have a visible effect on
-the user experience, because when the user navigates back to the activity, the activity restores
-all of its visible state. See the <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#SavingActivityState">Activities</a>
-document for information about saving and restoring state.</p>
-
- <p>Android may also employ other additional policies for killing background processes. For
- example, there are typically restrictions on a maximum number of such processes to
- keep around, and limits on the amount of time they can spend holding wake locks
- or consuming CPU power until they will be removed.</p>
- </li>
-</ol>
-
-
- <p>Android ranks a process at the highest level it can, based upon the importance of the
-components currently active in the process. For example, if a process hosts a service and a visible
-activity, the process is ranked as a visible process, not a service process.</p>
-
- <p>In addition, a process's ranking might be increased because other processes are dependent on
-it—a process that is serving another process can not generally be ranked lower than the process it is
-serving. For example, if a content provider in process A is serving a client in process B, or if a
-service in process A has been bound to by a client in process B, process A is always considered at least
-as important as process B.</p>
-
- <p>Because a process running a service is ranked higher than a process with background activities,
-an activity that initiates a long-running operation may sometimes start a <a
-href="{@docRoot}guide/topics/fundamentals/services.html">service</a> for that operation, rather than
-simply create a worker thread—but only when the operation is a specific task that needs
-to be accomplished regardless of whether the user returns to the application.
-For example, an activity that's uploading a picture to a web site should start a service to perform
-the upload so that the upload can continue in the background even if the user leaves the activity.
-Using a service guarantees that the operation will have at least "service process" priority,
-regardless of what happens to the activity. This is not however an approach that should always
-be used. It would not be appropriate when simply downloading the data for a web page, since
-that can easily be restarted later if the user returns to the web browser. Allowing
-such a process to be in the background (instead of running a service) gives Android better
-information about how to manage that process in relation to others.
-
- <p>For a similar reason, broadcast receivers will often employ services rather than
- simply put time-consuming operations in a thread.</p>
-
- <p>Some command line tools are available to help you understand how Android is managing
- its processes. The most common command is <code>adb shell dumpsys activity</code>
- which provides a summary of various key state, including at the end a list of the
- process states, one per line (plus an optional second line for any key dependency
- on that process), ordered from higher importance to lowest. The exact
- contents of these lines has changed across different versions of Android, but the
- typical state for one process in the list would be:</p>
- <pre>
-Proc # 2: adj=prcp /F trm= 0 848:com.google.android.inputmethod.latin/u0a32 (service)
- com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME<=Proc{417:system/1000}
-</pre>
-
- <p>This is a perceptible process (adj=prcp) that is running with the foreground
- scheduling class (/F), and has not recently been told to trim any memory
- (trm= 0). Its process id is 848; its name is com.google.android.inputmethod.latin;
- its Linux uid is u0a32 (10032), and the key state contributing to its current
- importance level is a service.</p>
-
- <p>The second line provides the name of the service that is important, because another
- process has a dependency on it (here the system process).</p>
-
-<h2 id="Threads">Threads</h2>
-
-<p>When an application is launched, the system creates a thread of execution for the application,
-called "main." This thread is very important because it is in charge of dispatching events to
-the appropriate user interface widgets, including drawing events. It is also the thread in which
-your application interacts with components from the Android UI toolkit (components from the {@link
-android.widget} and {@link android.view} packages). As such, the main thread is also sometimes
-called the UI thread.</p>
-
-<p>The system does <em>not</em> create a separate thread for each instance of a component. All
-components that run in the same process are instantiated in the UI thread, and system calls to
-each component are dispatched from that thread. Consequently, methods that respond to system
-callbacks (such as {@link android.view.View#onKeyDown onKeyDown()} to report user actions
-or a lifecycle callback method) always run in the UI thread of the process.</p>
-
-<p>For instance, when the user touches a button on the screen, your app's UI thread dispatches the
-touch event to the widget, which in turn sets its pressed state and posts an invalidate request to
-the event queue. The UI thread dequeues the request and notifies the widget that it should redraw
-itself.</p>
-
-<p>When your app performs intensive work in response to user interaction, this single thread model
-can yield poor performance unless you implement your application properly. Specifically, if
-everything is happening in the UI thread, performing long operations such as network access or
-database queries will block the whole UI. When the thread is blocked, no events can be dispatched,
-including drawing events. From the user's perspective, the
-application appears to hang. Even worse, if the UI thread is blocked for more than a few seconds
-(about 5 seconds currently) the user is presented with the infamous "<a
-href="http://developer.android.com/guide/practices/design/responsiveness.html">application not
-responding</a>" (ANR) dialog. The user might then decide to quit your application and uninstall it
-if they are unhappy.</p>
-
-<p>Additionally, the Andoid UI toolkit is <em>not</em> thread-safe. So, you must not manipulate
-your UI from a worker thread—you must do all manipulation to your user interface from the UI
-thread. Thus, there are simply two rules to Android's single thread model:</p>
-
-<ol>
-<li>Do not block the UI thread
-<li>Do not access the Android UI toolkit from outside the UI thread
-</ol>
-
-<h3 id="WorkerThreads">Worker threads</h3>
-
-<p>Because of the single thread model described above, it's vital to the responsiveness of your
-application's UI that you do not block the UI thread. If you have operations to perform
-that are not instantaneous, you should make sure to do them in separate threads ("background" or
-"worker" threads).</p>
-
-<p>For example, below is some code for a click listener that downloads an image from a separate
-thread and displays it in an {@link android.widget.ImageView}:</p>
-
-<pre>
-public void onClick(View v) {
- new Thread(new Runnable() {
- public void run() {
- Bitmap b = loadImageFromNetwork("http://example.com/image.png");
- mImageView.setImageBitmap(b);
- }
- }).start();
-}
-</pre>
-
-<p>At first, this seems to work fine, because it creates a new thread to handle the network
-operation. However, it violates the second rule of the single-threaded model: <em>do not access the
-Android UI toolkit from outside the UI thread</em>—this sample modifies the {@link
-android.widget.ImageView} from the worker thread instead of the UI thread. This can result in
-undefined and unexpected behavior, which can be difficult and time-consuming to track down.</p>
-
-<p>To fix this problem, Android offers several ways to access the UI thread from other
-threads. Here is a list of methods that can help:</p>
-
-<ul>
-<li>{@link android.app.Activity#runOnUiThread(java.lang.Runnable)
-Activity.runOnUiThread(Runnable)}</li>
-<li>{@link android.view.View#post(java.lang.Runnable) View.post(Runnable)}</li>
-<li>{@link android.view.View#postDelayed(java.lang.Runnable, long) View.postDelayed(Runnable,
-long)}</li>
-</ul>
-
-<p>For example, you can fix the above code by using the {@link
-android.view.View#post(java.lang.Runnable) View.post(Runnable)} method:</p>
-
-<pre>
-public void onClick(View v) {
- new Thread(new Runnable() {
- public void run() {
- final Bitmap bitmap = loadImageFromNetwork("http://example.com/image.png");
- mImageView.post(new Runnable() {
- public void run() {
- mImageView.setImageBitmap(bitmap);
- }
- });
- }
- }).start();
-}
-</pre>
-
-<p>Now this implementation is thread-safe: the network operation is done from a separate thread
-while the {@link android.widget.ImageView} is manipulated from the UI thread.</p>
-
-<p>However, as the complexity of the operation grows, this kind of code can get complicated and
-difficult to maintain. To handle more complex interactions with a worker thread, you might consider
-using a {@link android.os.Handler} in your worker thread, to process messages delivered from the UI
-thread. Perhaps the best solution, though, is to extend the {@link android.os.AsyncTask} class,
-which simplifies the execution of worker thread tasks that need to interact with the UI.</p>
-
-
-<h4 id="AsyncTask">Using AsyncTask</h4>
-
-<p>{@link android.os.AsyncTask} allows you to perform asynchronous work on your user
-interface. It performs the blocking operations in a worker thread and then publishes the results on
-the UI thread, without requiring you to handle threads and/or handlers yourself.</p>
-
-<p>To use it, you must subclass {@link android.os.AsyncTask} and implement the {@link
-android.os.AsyncTask#doInBackground doInBackground()} callback method, which runs in a pool of
-background threads. To update your UI, you should implement {@link
-android.os.AsyncTask#onPostExecute onPostExecute()}, which delivers the result from {@link
-android.os.AsyncTask#doInBackground doInBackground()} and runs in the UI thread, so you can safely
-update your UI. You can then run the task by calling {@link android.os.AsyncTask#execute execute()}
-from the UI thread.</p>
-
-<p>For example, you can implement the previous example using {@link android.os.AsyncTask} this
-way:</p>
-
-<pre>
-public void onClick(View v) {
- new DownloadImageTask().execute("http://example.com/image.png");
-}
-
-private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
- /** The system calls this to perform work in a worker thread and
- * delivers it the parameters given to AsyncTask.execute() */
- protected Bitmap doInBackground(String... urls) {
- return loadImageFromNetwork(urls[0]);
- }
-
- /** The system calls this to perform work in the UI thread and delivers
- * the result from doInBackground() */
- protected void onPostExecute(Bitmap result) {
- mImageView.setImageBitmap(result);
- }
-}
-</pre>
-
-<p>Now the UI is safe and the code is simpler, because it separates the work into the
-part that should be done on a worker thread and the part that should be done on the UI thread.</p>
-
-<p>You should read the {@link android.os.AsyncTask} reference for a full understanding on
-how to use this class, but here is a quick overview of how it works:</p>
-
-<ul>
-<li>You can specify the type of the parameters, the progress values, and the final
-value of the task, using generics</li>
-<li>The method {@link android.os.AsyncTask#doInBackground doInBackground()} executes automatically
-on a worker thread</li>
-<li>{@link android.os.AsyncTask#onPreExecute onPreExecute()}, {@link
-android.os.AsyncTask#onPostExecute onPostExecute()}, and {@link
-android.os.AsyncTask#onProgressUpdate onProgressUpdate()} are all invoked on the UI thread</li>
-<li>The value returned by {@link android.os.AsyncTask#doInBackground doInBackground()} is sent to
-{@link android.os.AsyncTask#onPostExecute onPostExecute()}</li>
-<li>You can call {@link android.os.AsyncTask#publishProgress publishProgress()} at anytime in {@link
-android.os.AsyncTask#doInBackground doInBackground()} to execute {@link
-android.os.AsyncTask#onProgressUpdate onProgressUpdate()} on the UI thread</li>
-<li>You can cancel the task at any time, from any thread</li>
-</ul>
-
-<p class="caution"><strong>Caution:</strong> Another problem you might encounter when using a worker
-thread is unexpected restarts in your activity due to a <a
-href="{@docRoot}guide/topics/resources/runtime-changes.html">runtime configuration change</a>
-(such as when the user changes the screen orientation), which may destroy your worker thread. To
-see how you can persist your task during one of these restarts and how to properly cancel the task
-when the activity is destroyed, see the source code for the <a
-href="http://code.google.com/p/shelves/">Shelves</a> sample application.</p>
-
-
-<h3 id="ThreadSafe">Thread-safe methods</h3>
-
-<p> In some situations, the methods you implement might be called from more than one thread, and
-therefore must be written to be thread-safe. </p>
-
-<p>This is primarily true for methods that can be called remotely—such as methods in a <a
-href="{@docRoot}guide/topics/fundamentals/bound-services.html">bound service</a>. When a call on a
-method implemented in an {@link android.os.IBinder} originates in the same process in which the
-{@link android.os.IBinder IBinder} is running, the method is executed in the caller's thread.
-However, when the call originates in another process, the method is executed in a thread chosen from
-a pool of threads that the system maintains in the same process as the {@link android.os.IBinder
-IBinder} (it's not executed in the UI thread of the process). For example, whereas a service's
-{@link android.app.Service#onBind onBind()} method would be called from the UI thread of the
-service's process, methods implemented in the object that {@link android.app.Service#onBind
-onBind()} returns (for example, a subclass that implements RPC methods) would be called from threads
-in the pool. Because a service can have more than one client, more than one pool thread can engage
-the same {@link android.os.IBinder IBinder} method at the same time. {@link android.os.IBinder
-IBinder} methods must, therefore, be implemented to be thread-safe.</p>
-
-<p> Similarly, a content provider can receive data requests that originate in other processes.
-Although the {@link android.content.ContentResolver} and {@link android.content.ContentProvider}
-classes hide the details of how the interprocess communication is managed, {@link
-android.content.ContentProvider} methods that respond to those requests—the methods {@link
-android.content.ContentProvider#query query()}, {@link android.content.ContentProvider#insert
-insert()}, {@link android.content.ContentProvider#delete delete()}, {@link
-android.content.ContentProvider#update update()}, and {@link android.content.ContentProvider#getType
-getType()}—are called from a pool of threads in the content provider's process, not the UI
-thread for the process. Because these methods might be called from any number of threads at the
-same time, they too must be implemented to be thread-safe. </p>
-
-
-<h2 id="IPC">Interprocess Communication</h2>
-
-<p>Android offers a mechanism for interprocess communication (IPC) using remote procedure calls
-(RPCs), in which a method is called by an activity or other application component, but executed
-remotely (in another process), with any result returned back to the
-caller. This entails decomposing a method call and its data to a level the operating system can
-understand, transmitting it from the local process and address space to the remote process and
-address space, then reassembling and reenacting the call there. Return values are then
-transmitted in the opposite direction. Android provides all the code to perform these IPC
-transactions, so you can focus on defining and implementing the RPC programming interface. </p>
-
-<p>To perform IPC, your application must bind to a service, using {@link
-android.content.Context#bindService bindService()}. For more information, see the <a
-href="{@docRoot}guide/topics/fundamentals/services.html">Services</a> developer guide.</p>
-
-
-<!--
-<h2>Beginner's Path</h2>
-
-<p>For information about how to perform work in the background for an indefinite period of time
-(without a user interface), continue with the <b><a
-href="{@docRoot}guide/topics/fundamentals/services.html">Services</a></b> document.</p>
--->
diff --git a/docs/html/guide/topics/fundamentals/services.jd b/docs/html/guide/topics/fundamentals/services.jd
deleted file mode 100644
index 9c38897..0000000
--- a/docs/html/guide/topics/fundamentals/services.jd
+++ /dev/null
@@ -1,874 +0,0 @@
-page.title=Services
-@jd:body
-
-<div id="qv-wrapper">
-<ol id="qv">
-<h2>Quickview</h2>
-<ul>
- <li>A service can run in the background to perform work even while the user is in a different
-application</li>
- <li>A service can allow other components to bind to it, in order to interact with it and
-perform interprocess communication</li>
- <li>A service runs in the main thread of the application that hosts it, by default</li>
-</ul>
-<h2>In this document</h2>
-<ol>
-<li><a href="#Basics">The Basics</a></li>
-<ol>
- <li><a href="#Declaring">Declaring a service in the manifest</a></li>
-</ol>
-<li><a href="#CreatingAService">Creating a Started Service</a>
- <ol>
- <li><a href="#ExtendingIntentService">Extending the IntentService class</a></li>
- <li><a href="#ExtendingService">Extending the Service class</a></li>
- <li><a href="#StartingAService">Starting a service</a></li>
- <li><a href="#Stopping">Stopping a service</a></li>
- </ol>
-</li>
-<li><a href="#CreatingBoundService">Creating a Bound Service</a></li>
-<li><a href="#Notifications">Sending Notifications to the User</a></li>
-<li><a href="#Foreground">Running a Service in the Foreground</a></li>
-<li><a href="#Lifecycle">Managing the Lifecycle of a Service</a>
-<ol>
- <li><a href="#LifecycleCallbacks">Implementing the lifecycle callbacks</a></li>
-</ol>
-</li>
-</ol>
-
-<h2>Key classes</h2>
-<ol>
- <li>{@link android.app.Service}</li>
- <li>{@link android.app.IntentService}</li>
-</ol>
-
-<h2>Samples</h2>
-<ol>
- <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/ServiceStartArguments.html">{@code
- ServiceStartArguments}</a></li>
- <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html">{@code
- LocalService}</a></li>
-</ol>
-
-<h2>Articles</h2>
-<ol>
- <li><a href="{@docRoot}resources/articles/multitasking-android-way.html">Multitasking the Android Way</a></li>
- <li><a href="{@docRoot}resources/articles/service-api-changes-starting-with.html">Service API changes starting
- with Android 2.0</a></li>
-</ol>
-
-<h2>See also</h2>
-<ol>
-<li><a href="{@docRoot}guide/topics/fundamentals/bound-services.html">Bound Services</a></li>
-</ol>
-
-</div>
-
-
-<p>A {@link android.app.Service} is an application component that can perform
-long-running operations in the background and does not provide a user interface. Another
-application component can start a service and it will continue to run in the background even if the
-user switches to another application. Additionally, a component can bind to a service to
-interact with it and even perform interprocess communication (IPC). For example, a service might
-handle network transactions, play music, perform file I/O, or interact with a content provider, all
-from the background.</p>
-
-<p>A service can essentially take two forms:</p>
-
-<dl>
- <dt>Started</dt>
- <dd>A service is "started" when an application component (such as an activity) starts it by
-calling {@link android.content.Context#startService startService()}. Once started, a service
-can run in the background indefinitely, even if the component that started it is destroyed. Usually,
-a started service performs a single operation and does not return a result to the caller.
-For example, it might download or upload a file over the network. When the operation is done, the
-service should stop itself.</dd>
- <dt>Bound</dt>
- <dd>A service is "bound" when an application component binds to it by calling {@link
-android.content.Context#bindService bindService()}. A bound service offers a client-server
-interface that allows components to interact with the service, send requests, get results, and even
-do so across processes with interprocess communication (IPC). A bound service runs only as long as
-another application component is bound to it. Multiple components can bind to the service at once,
-but when all of them unbind, the service is destroyed.</dd>
-</dl>
-
-<p>Although this documentation generally discusses these two types of services separately, your
-service can work both ways—it can be started (to run indefinitely) and also allow binding.
-It's simply a matter of whether you implement a couple callback methods: {@link
-android.app.Service#onStartCommand onStartCommand()} to allow components to start it and {@link
-android.app.Service#onBind onBind()} to allow binding.</p>
-
-<p>Regardless of whether your application is started, bound, or both, any application component
-can use the service (even from a separate application), in the same way that any component can use
-an activity—by starting it with an {@link android.content.Intent}. However, you can declare
-the service as private, in the manifest file, and block access from other applications. This is
-discussed more in the section about <a href="#Declaring">Declaring the service in the
-manifest</a>.</p>
-
-<p class="caution"><strong>Caution:</strong> A service runs in the
-main thread of its hosting process—the service does <strong>not</strong> create its own thread
-and does <strong>not</strong> run in a separate process (unless you specify otherwise). This means
-that, if your service is going to do any CPU intensive work or blocking operations (such as MP3
-playback or networking), you should create a new thread within the service to do that work. By using
-a separate thread, you will reduce the risk of Application Not Responding (ANR) errors and the
-application's main thread can remain dedicated to user interaction with your activities.</p>
-
-
-<h2 id="Basics">The Basics</h2>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h3>Should you use a service or a thread?</h3>
- <p>A service is simply a component that can run in the background even when the user is not
-interacting with your application. Thus, you should create a service only if that is what you
-need.</p>
- <p>If you need to perform work outside your main thread, but only while the user is interacting
-with your application, then you should probably instead create a new thread and not a service. For
-example, if you want to play some music, but only while your activity is running, you might create
-a thread in {@link android.app.Activity#onCreate onCreate()}, start running it in {@link
-android.app.Activity#onStart onStart()}, then stop it in {@link android.app.Activity#onStop
-onStop()}. Also consider using {@link android.os.AsyncTask} or {@link android.os.HandlerThread},
-instead of the traditional {@link java.lang.Thread} class. See the <a
-href="{@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and
-Threading</a> document for more information about threads.</p>
- <p>Remember that if you do use a service, it still runs in your application's main thread by
-default, so you should still create a new thread within the service if it performs intensive or
-blocking operations.</p>
-</div>
-</div>
-
-<p>To create a service, you must create a subclass of {@link android.app.Service} (or one
-of its existing subclasses). In your implementation, you need to override some callback methods that
-handle key aspects of the service lifecycle and provide a mechanism for components to bind to
-the service, if appropriate. The most important callback methods you should override are:</p>
-
-<dl>
- <dt>{@link android.app.Service#onStartCommand onStartCommand()}</dt>
- <dd>The system calls this method when another component, such as an activity,
-requests that the service be started, by calling {@link android.content.Context#startService
-startService()}. Once this method executes, the service is started and can run in the
-background indefinitely. If you implement this, it is your responsibility to stop the service when
-its work is done, by calling {@link android.app.Service#stopSelf stopSelf()} or {@link
-android.content.Context#stopService stopService()}. (If you only want to provide binding, you don't
-need to implement this method.)</dd>
- <dt>{@link android.app.Service#onBind onBind()}</dt>
- <dd>The system calls this method when another component wants to bind with the
-service (such as to perform RPC), by calling {@link android.content.Context#bindService
-bindService()}. In your implementation of this method, you must provide an interface that clients
-use to communicate with the service, by returning an {@link android.os.IBinder}. You must always
-implement this method, but if you don't want to allow binding, then you should return null.</dd>
- <dt>{@link android.app.Service#onCreate()}</dt>
- <dd>The system calls this method when the service is first created, to perform one-time setup
-procedures (before it calls either {@link android.app.Service#onStartCommand onStartCommand()} or
-{@link android.app.Service#onBind onBind()}). If the service is already running, this method is not
-called.</dd>
- <dt>{@link android.app.Service#onDestroy()}</dt>
- <dd>The system calls this method when the service is no longer used and is being destroyed.
-Your service should implement this to clean up any resources such as threads, registered
-listeners, receivers, etc. This is the last call the service receives.</dd>
-</dl>
-
-<p>If a component starts the service by calling {@link
-android.content.Context#startService startService()} (which results in a call to {@link
-android.app.Service#onStartCommand onStartCommand()}), then the service
-remains running until it stops itself with {@link android.app.Service#stopSelf()} or another
-component stops it by calling {@link android.content.Context#stopService stopService()}.</p>
-
-<p>If a component calls
-{@link android.content.Context#bindService bindService()} to create the service (and {@link
-android.app.Service#onStartCommand onStartCommand()} is <em>not</em> called), then the service runs
-only as long as the component is bound to it. Once the service is unbound from all clients, the
-system destroys it.</p>
-
-<p>The Android system will force-stop a service only when memory is low and it must recover system
-resources for the activity that has user focus. If the service is bound to an activity that has user
-focus, then it's less likely to be killed, and if the service is declared to <a
-href="#Foreground">run in the foreground</a> (discussed later), then it will almost never be killed.
-Otherwise, if the service was started and is long-running, then the system will lower its position
-in the list of background tasks over time and the service will become highly susceptible to
-killing—if your service is started, then you must design it to gracefully handle restarts
-by the system. If the system kills your service, it restarts it as soon as resources become
-available again (though this also depends on the value you return from {@link
-android.app.Service#onStartCommand onStartCommand()}, as discussed later). For more information
-about when the system might destroy a service, see the <a
-href="{@docRoot}guide/topics/fundamentals/processes-and-threads.html">Processes and Threading</a>
-document.</p>
-
-<p>In the following sections, you'll see how you can create each type of service and how to use
-it from other application components.</p>
-
-
-
-<h3 id="Declaring">Declaring a service in the manifest</h3>
-
-<p>Like activities (and other components), you must declare all services in your application's
-manifest file.</p>
-
-<p>To declare your service, add a <a
-href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element
-as a child of the <a
-href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
-element. For example:</p>
-
-<pre>
-<manifest ... >
- ...
- <application ... >
- <service android:name=".ExampleService" />
- ...
- </application>
-</manifest>
-</pre>
-
-<p>There are other attributes you can include in the <a
-href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element to
-define properties such as permissions required to start the service and the process in
-which the service should run. The <a
-href="{@docRoot}guide/topics/manifest/service-element.html#nm">{@code android:name}</a>
-attribute is the only required attribute—it specifies the class name of the service. Once
-you publish your application, you should not change this name, because if you do, you might break
-some functionality where explicit intents are used to reference your service (read the blog post, <a
-href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">Things
-That Cannot Change</a>).
-
-<p>See the <a
-href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element
-reference for more information about declaring your service in the manifest.</p>
-
-<p>Just like an activity, a service can define intent filters that allow other components to
-invoke the service using implicit intents. By declaring intent filters, components
-from any application installed on the user's device can potentially start your service if your
-service declares an intent filter that matches the intent another application passes to {@link
-android.content.Context#startService startService()}.</p>
-
-<p>If you plan on using your service only locally (other applications do not use it), then you
-don't need to (and should not) supply any intent filters. Without any intent filters, you must
-start the service using an intent that explicitly names the service class. More information
-about <a href="#StartingAService">starting a service</a> is discussed below.</p>
-
-<p>Additionally, you can ensure that your service is private to your application only if
-you include the <a
-href="{@docRoot}guide/topics/manifest/service-element.html#exported">{@code android:exported}</a>
-attribute and set it to {@code "false"}. This is effective even if your service supplies intent
-filters.</p>
-
-<p>For more information about creating intent filters for your service, see the <a
-href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>
-document.</p>
-
-
-
-<h2 id="CreatingStartedService">Creating a Started Service</h2>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h2>Targeting Android 1.6 or lower</h2>
- <p>If you're building an application for Android 1.6 or lower, you need
-to implement {@link android.app.Service#onStart onStart()}, instead of {@link
-android.app.Service#onStartCommand onStartCommand()} (in Android 2.0,
-{@link android.app.Service#onStart onStart()} was deprecated in favor of {@link
-android.app.Service#onStartCommand onStartCommand()}).</p>
- <p>For more information about providing compatibility with versions of Android older than 2.0, see
-the {@link android.app.Service#onStartCommand onStartCommand()} documentation.</p>
-</div>
-</div>
-
-<p>A started service is one that another component starts by calling {@link
-android.content.Context#startService startService()}, resulting in a call to the service's
-{@link android.app.Service#onStartCommand onStartCommand()} method.</p>
-
-<p>When a service is started, it has a lifecycle that's independent of the
-component that started it and the service can run in the background indefinitely, even if
-the component that started it is destroyed. As such, the service should stop itself when its job
-is done by calling {@link android.app.Service#stopSelf stopSelf()}, or another component can stop it
-by calling {@link android.content.Context#stopService stopService()}.</p>
-
-<p>An application component such as an activity can start the service by calling {@link
-android.content.Context#startService startService()} and passing an {@link android.content.Intent}
-that specifies the service and includes any data for the service to use. The service receives
-this {@link android.content.Intent} in the {@link android.app.Service#onStartCommand
-onStartCommand()} method.</p>
-
-<p>For instance, suppose an activity needs to save some data to an online database. The activity can
-start a companion service and deliver it the data to save by passing an intent to {@link
-android.content.Context#startService startService()}. The service receives the intent in {@link
-android.app.Service#onStartCommand onStartCommand()}, connects to the Internet and performs the
-database transaction. When the transaction is done, the service stops itself and it is
-destroyed.</p>
-
-<p class="caution"><strong>Caution:</strong> A services runs in the same process as the application
-in which it is declared and in the main thread of that application, by default. So, if your service
-performs intensive or blocking operations while the user interacts with an activity from the same
-application, the service will slow down activity performance. To avoid impacting application
-performance, you should start a new thread inside the service.</p>
-
-<p>Traditionally, there are two classes you can extend to create a started service:</p>
-<dl>
- <dt>{@link android.app.Service}</dt>
- <dd>This is the base class for all services. When you extend this class, it's important that
-you create a new thread in which to do all the service's work, because the service uses your
-application's main thread, by default, which could slow the performance of any activity your
-application is running.</dd>
- <dt>{@link android.app.IntentService}</dt>
- <dd>This is a subclass of {@link android.app.Service} that uses a worker thread to handle all
-start requests, one at a time. This is the best option if you don't require that your service
-handle multiple requests simultaneously. All you need to do is implement {@link
-android.app.IntentService#onHandleIntent onHandleIntent()}, which receives the intent for each
-start request so you can do the background work.</dd>
-</dl>
-
-<p>The following sections describe how you can implement your service using either one for these
-classes.</p>
-
-
-<h3 id="ExtendingIntentService">Extending the IntentService class</h3>
-
-<p>Because most started services don't need to handle multiple requests simultaneously
-(which can actually be a dangerous multi-threading scenario), it's probably best if you
-implement your service using the {@link android.app.IntentService} class.</p>
-
-<p>The {@link android.app.IntentService} does the following:</p>
-
-<ul>
- <li>Creates a default worker thread that executes all intents delivered to {@link
-android.app.Service#onStartCommand onStartCommand()} separate from your application's main
-thread.</li>
- <li>Creates a work queue that passes one intent at a time to your {@link
-android.app.IntentService#onHandleIntent onHandleIntent()} implementation, so you never have to
-worry about multi-threading.</li>
- <li>Stops the service after all start requests have been handled, so you never have to call
-{@link android.app.Service#stopSelf}.</li>
- <li>Provides default implementation of {@link android.app.IntentService#onBind onBind()} that
-returns null.</li>
- <li>Provides a default implementation of {@link android.app.IntentService#onStartCommand
-onStartCommand()} that sends the intent to the work queue and then to your {@link
-android.app.IntentService#onHandleIntent onHandleIntent()} implementation.</li>
-</ul>
-
-<p>All this adds up to the fact that all you need to do is implement {@link
-android.app.IntentService#onHandleIntent onHandleIntent()} to do the work provided by the
-client. (Though, you also need to provide a small constructor for the service.)</p>
-
-<p>Here's an example implementation of {@link android.app.IntentService}:</p>
-
-<pre>
-public class HelloIntentService extends IntentService {
-
- /**
- * A constructor is required, and must call the super {@link android.app.IntentService#IntentService}
- * constructor with a name for the worker thread.
- */
- public HelloIntentService() {
- super("HelloIntentService");
- }
-
- /**
- * The IntentService calls this method from the default worker thread with
- * the intent that started the service. When this method returns, IntentService
- * stops the service, as appropriate.
- */
- @Override
- protected void onHandleIntent(Intent intent) {
- // Normally we would do some work here, like download a file.
- // For our sample, we just sleep for 5 seconds.
- long endTime = System.currentTimeMillis() + 5*1000;
- while (System.currentTimeMillis() < endTime) {
- synchronized (this) {
- try {
- wait(endTime - System.currentTimeMillis());
- } catch (Exception e) {
- }
- }
- }
- }
-}
-</pre>
-
-<p>That's all you need: a constructor and an implementation of {@link
-android.app.IntentService#onHandleIntent onHandleIntent()}.</p>
-
-<p>If you decide to also override other callback methods, such as {@link
-android.app.IntentService#onCreate onCreate()}, {@link
-android.app.IntentService#onStartCommand onStartCommand()}, or {@link
-android.app.IntentService#onDestroy onDestroy()}, be sure to call the super implementation, so
-that the {@link android.app.IntentService} can properly handle the life of the worker thread.</p>
-
-<p>For example, {@link android.app.IntentService#onStartCommand onStartCommand()} must return
-the default implementation (which is how the intent gets delivered to {@link
-android.app.IntentService#onHandleIntent onHandleIntent()}):</p>
-
-<pre>
-@Override
-public int onStartCommand(Intent intent, int flags, int startId) {
- Toast.makeText(this, "service starting", Toast.LENGTH_SHORT).show();
- return super.onStartCommand(intent,flags,startId);
-}
-</pre>
-
-<p>Besides {@link android.app.IntentService#onHandleIntent onHandleIntent()}, the only method
-from which you don't need to call the super class is {@link android.app.IntentService#onBind
-onBind()} (but you only need to implement that if your service allows binding).</p>
-
-<p>In the next section, you'll see how the same kind of service is implemented when extending
-the base {@link android.app.Service} class, which is a lot more code, but which might be
-appropriate if you need to handle simultaneous start requests.</p>
-
-
-<h3 id="ExtendingService">Extending the Service class</h3>
-
-<p>As you saw in the previous section, using {@link android.app.IntentService} makes your
-implementation of a started service very simple. If, however, you require your service to
-perform multi-threading (instead of processing start requests through a work queue), then you
-can extend the {@link android.app.Service} class to handle each intent.</p>
-
-<p>For comparison, the following example code is an implementation of the {@link
-android.app.Service} class that performs the exact same work as the example above using {@link
-android.app.IntentService}. That is, for each start request, it uses a worker thread to perform the
-job and processes only one request at a time.</p>
-
-<pre>
-public class HelloService extends Service {
- private Looper mServiceLooper;
- private ServiceHandler mServiceHandler;
-
- // Handler that receives messages from the thread
- private final class ServiceHandler extends Handler {
- public ServiceHandler(Looper looper) {
- super(looper);
- }
- @Override
- public void handleMessage(Message msg) {
- // Normally we would do some work here, like download a file.
- // For our sample, we just sleep for 5 seconds.
- long endTime = System.currentTimeMillis() + 5*1000;
- while (System.currentTimeMillis() < endTime) {
- synchronized (this) {
- try {
- wait(endTime - System.currentTimeMillis());
- } catch (Exception e) {
- }
- }
- }
- // Stop the service using the startId, so that we don't stop
- // the service in the middle of handling another job
- stopSelf(msg.arg1);
- }
- }
-
- @Override
- public void onCreate() {
- // Start up the thread running the service. Note that we create a
- // separate thread because the service normally runs in the process's
- // main thread, which we don't want to block. We also make it
- // background priority so CPU-intensive work will not disrupt our UI.
- HandlerThread thread = new HandlerThread("ServiceStartArguments",
- Process.THREAD_PRIORITY_BACKGROUND);
- thread.start();
-
- // Get the HandlerThread's Looper and use it for our Handler
- mServiceLooper = thread.getLooper();
- mServiceHandler = new ServiceHandler(mServiceLooper);
- }
-
- @Override
- public int onStartCommand(Intent intent, int flags, int startId) {
- Toast.makeText(this, "service starting", Toast.LENGTH_SHORT).show();
-
- // For each start request, send a message to start a job and deliver the
- // start ID so we know which request we're stopping when we finish the job
- Message msg = mServiceHandler.obtainMessage();
- msg.arg1 = startId;
- mServiceHandler.sendMessage(msg);
-
- // If we get killed, after returning from here, restart
- return START_STICKY;
- }
-
- @Override
- public IBinder onBind(Intent intent) {
- // We don't provide binding, so return null
- return null;
- }
-
- @Override
- public void onDestroy() {
- Toast.makeText(this, "service done", Toast.LENGTH_SHORT).show();
- }
-}
-</pre>
-
-<p>As you can see, it's a lot more work than using {@link android.app.IntentService}.</p>
-
-<p>However, because you handle each call to {@link android.app.Service#onStartCommand
-onStartCommand()} yourself, you can perform multiple requests simultaneously. That's not what
-this example does, but if that's what you want, then you can create a new thread for each
-request and run them right away (instead of waiting for the previous request to finish).</p>
-
-<p>Notice that the {@link android.app.Service#onStartCommand onStartCommand()} method must return an
-integer. The integer is a value that describes how the system should continue the service in the
-event that the system kills it (as discussed above, the default implementation for {@link
-android.app.IntentService} handles this for you, though you are able to modify it). The return value
-from {@link android.app.Service#onStartCommand onStartCommand()} must be one of the following
-constants:</p>
-
-<dl>
- <dt>{@link android.app.Service#START_NOT_STICKY}</dt>
- <dd>If the system kills the service after {@link android.app.Service#onStartCommand
-onStartCommand()} returns, <em>do not</em> recreate the service, unless there are pending
-intents to deliver. This is the safest option to avoid running your service when not necessary
-and when your application can simply restart any unfinished jobs.</dd>
- <dt>{@link android.app.Service#START_STICKY}</dt>
- <dd>If the system kills the service after {@link android.app.Service#onStartCommand
-onStartCommand()} returns, recreate the service and call {@link
-android.app.Service#onStartCommand onStartCommand()}, but <em>do not</em> redeliver the last intent.
-Instead, the system calls {@link android.app.Service#onStartCommand onStartCommand()} with a
-null intent, unless there were pending intents to start the service, in which case,
-those intents are delivered. This is suitable for media players (or similar services) that are not
-executing commands, but running indefinitely and waiting for a job.</dd>
- <dt>{@link android.app.Service#START_REDELIVER_INTENT}</dt>
- <dd>If the system kills the service after {@link android.app.Service#onStartCommand
-onStartCommand()} returns, recreate the service and call {@link
-android.app.Service#onStartCommand onStartCommand()} with the last intent that was delivered to the
-service. Any pending intents are delivered in turn. This is suitable for services that are
-actively performing a job that should be immediately resumed, such as downloading a file.</dd>
-</dl>
-<p>For more details about these return values, see the linked reference documentation for each
-constant.</p>
-
-
-
-<h3 id="StartingAService">Starting a Service</h3>
-
-<p>You can start a service from an activity or other application component by passing an
-{@link android.content.Intent} (specifying the service to start) to {@link
-android.content.Context#startService startService()}. The Android system calls the service's {@link
-android.app.Service#onStartCommand onStartCommand()} method and passes it the {@link
-android.content.Intent}. (You should never call {@link android.app.Service#onStartCommand
-onStartCommand()} directly.)</p>
-
-<p>For example, an activity can start the example service in the previous section ({@code
-HelloSevice}) using an explicit intent with {@link android.content.Context#startService
-startService()}:</p>
-
-<pre>
-Intent intent = new Intent(this, HelloService.class);
-startService(intent);
-</pre>
-
-<p>The {@link android.content.Context#startService startService()} method returns immediately and
-the Android system calls the service's {@link android.app.Service#onStartCommand
-onStartCommand()} method. If the service is not already running, the system first calls {@link
-android.app.Service#onCreate onCreate()}, then calls {@link android.app.Service#onStartCommand
-onStartCommand()}.</p>
-
-<p>If the service does not also provide binding, the intent delivered with {@link
-android.content.Context#startService startService()} is the only mode of communication between the
-application component and the service. However, if you want the service to send a result back, then
-the client that starts the service can create a {@link android.app.PendingIntent} for a broadcast
-(with {@link android.app.PendingIntent#getBroadcast getBroadcast()}) and deliver it to the service
-in the {@link android.content.Intent} that starts the service. The service can then use the
-broadcast to deliver a result.</p>
-
-<p>Multiple requests to start the service result in multiple corresponding calls to the service's
-{@link android.app.Service#onStartCommand onStartCommand()}. However, only one request to stop
-the service (with {@link android.app.Service#stopSelf stopSelf()} or {@link
-android.content.Context#stopService stopService()}) is required to stop it.</p>
-
-
-<h3 id="Stopping">Stopping a service</h3>
-
-<p>A started service must manage its own lifecycle. That is, the system does not stop or
-destroy the service unless it must recover system memory and the service
-continues to run after {@link android.app.Service#onStartCommand onStartCommand()} returns. So,
-the service must stop itself by calling {@link android.app.Service#stopSelf stopSelf()} or another
-component can stop it by calling {@link android.content.Context#stopService stopService()}.</p>
-
-<p>Once requested to stop with {@link android.app.Service#stopSelf stopSelf()} or {@link
-android.content.Context#stopService stopService()}, the system destroys the service as soon as
-possible.</p>
-
-<p>However, if your service handles multiple requests to {@link
-android.app.Service#onStartCommand onStartCommand()} concurrently, then you shouldn't stop the
-service when you're done processing a start request, because you might have since received a new
-start request (stopping at the end of the first request would terminate the second one). To avoid
-this problem, you can use {@link android.app.Service#stopSelf(int)} to ensure that your request to
-stop the service is always based on the most recent start request. That is, when you call {@link
-android.app.Service#stopSelf(int)}, you pass the ID of the start request (the <code>startId</code>
-delivered to {@link android.app.Service#onStartCommand onStartCommand()}) to which your stop request
-corresponds. Then if the service received a new start request before you were able to call {@link
-android.app.Service#stopSelf(int)}, then the ID will not match and the service will not stop.</p>
-
-<p class="caution"><strong>Caution:</strong> It's important that your application stops its services
-when it's done working, to avoid wasting system resources and consuming battery power. If necessary,
-other components can stop the service by calling {@link
-android.content.Context#stopService stopService()}. Even if you enable binding for the service,
-you must always stop the service yourself if it ever received a call to {@link
-android.app.Service#onStartCommand onStartCommand()}.</p>
-
-<p>For more information about the lifecycle of a service, see the section below about <a
-href="#Lifecycle">Managing the Lifecycle of a Service</a>.</p>
-
-
-
-<h2 id="CreatingBoundService">Creating a Bound Service</h2>
-
-<p>A bound service is one that allows application components to bind to it by calling {@link
-android.content.Context#bindService bindService()} in order to create a long-standing connection
-(and generally does not allow components to <em>start</em> it by calling {@link
-android.content.Context#startService startService()}).</p>
-
-<p>You should create a bound service when you want to interact with the service from activities
-and other components in your application or to expose some of your application's functionality to
-other applications, through interprocess communication (IPC).</p>
-
-<p>To create a bound service, you must implement the {@link
-android.app.Service#onBind onBind()} callback method to return an {@link android.os.IBinder} that
-defines the interface for communication with the service. Other application components can then call
-{@link android.content.Context#bindService bindService()} to retrieve the interface and
-begin calling methods on the service. The service lives only to serve the application component that
-is bound to it, so when there are no components bound to the service, the system destroys it
-(you do <em>not</em> need to stop a bound service in the way you must when the service is started
-through {@link android.app.Service#onStartCommand onStartCommand()}).</p>
-
-<p>To create a bound service, the first thing you must do is define the interface that specifies
-how a client can communicate with the service. This interface between the service
-and a client must be an implementation of {@link android.os.IBinder} and is what your service must
-return from the {@link android.app.Service#onBind
-onBind()} callback method. Once the client receives the {@link android.os.IBinder}, it can begin
-interacting with the service through that interface.</p>
-
-<p>Multiple clients can bind to the service at once. When a client is done interacting with the
-service, it calls {@link android.content.Context#unbindService unbindService()} to unbind. Once
-there are no clients bound to the service, the system destroys the service.</p>
-
-<p>There are multiple ways to implement a bound service and the implementation is more
-complicated than a started service, so the bound service discussion appears in a separate
-document about <a
-href="{@docRoot}guide/topics/fundamentals/bound-services.html">Bound Services</a>.</p>
-
-
-
-<h2 id="Notifications">Sending Notifications to the User</h2>
-
-<p>Once running, a service can notify the user of events using <a
-href="{@docRoot}guide/topics/ui/notifiers/toasts.html">Toast Notifications</a> or <a
-href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Status Bar Notifications</a>.</p>
-
-<p>A toast notification is a message that appears on the surface of the current window for a
-moment then disappears, while a status bar notification provides an icon in the status bar with a
-message, which the user can select in order to take an action (such as start an activity).</p>
-
-<p>Usually, a status bar notification is the best technique when some background work has completed
-(such as a file completed
-downloading) and the user can now act on it. When the user selects the notification from the
-expanded view, the notification can start an activity (such as to view the downloaded file).</p>
-
-<p>See the <a
-href="{@docRoot}guide/topics/ui/notifiers/toasts.html">Toast Notifications</a> or <a
-href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Status Bar Notifications</a>
-developer guides for more information.</p>
-
-
-
-<h2 id="Foreground">Running a Service in the Foreground</h2>
-
-<p>A foreground service is a service that's considered to be something the
-user is actively aware of and thus not a candidate for the system to kill when low on memory. A
-foreground service must provide a notification for the status bar, which is placed under the
-"Ongoing" heading, which means that the notification cannot be dismissed unless the service is
-either stopped or removed from the foreground.</p>
-
-<p>For example, a music player that plays music from a service should be set to run in the
-foreground, because the user is explicitly aware
-of its operation. The notification in the status bar might indicate the current song and allow
-the user to launch an activity to interact with the music player.</p>
-
-<p>To request that your service run in the foreground, call {@link
-android.app.Service#startForeground startForeground()}. This method takes two parameters: an integer
-that uniquely identifies the notification and the {@link
-android.app.Notification} for the status bar. For example:</p>
-
-<pre>
-Notification notification = new Notification(R.drawable.icon, getText(R.string.ticker_text),
- System.currentTimeMillis());
-Intent notificationIntent = new Intent(this, ExampleActivity.class);
-PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
-notification.setLatestEventInfo(this, getText(R.string.notification_title),
- getText(R.string.notification_message), pendingIntent);
-startForeground(ONGOING_NOTIFICATION, notification);
-</pre>
-
-
-<p>To remove the service from the foreground, call {@link
-android.app.Service#stopForeground stopForeground()}. This method takes a boolean, indicating
-whether to remove the status bar notification as well. This method does <em>not</em> stop the
-service. However, if you stop the service while it's still running in the foreground, then the
-notification is also removed.</p>
-
-<p class="note"><strong>Note:</strong> The methods {@link
-android.app.Service#startForeground startForeground()} and {@link
-android.app.Service#stopForeground stopForeground()} were introduced in Android 2.0 (API Level
-5). In order to run your service in the foreground on older versions of the platform, you must
-use the previous {@code setForeground()} method—see the {@link
-android.app.Service#startForeground startForeground()} documentation for information about how
-to provide backward compatibility.</p>
-
-<p>For more information about notifications, see <a
-href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Creating Status Bar
-Notifications</a>.</p>
-
-
-
-<h2 id="Lifecycle">Managing the Lifecycle of a Service</h2>
-
-<p>The lifecycle of a service is much simpler than that of an activity. However, it's even more important
-that you pay close attention to how your service is created and destroyed, because a service
-can run in the background without the user being aware.</p>
-
-<p>The service lifecycle—from when it's created to when it's destroyed—can follow two
-different paths:</p>
-
-<ul>
-<li>A started service
- <p>The service is created when another component calls {@link
-android.content.Context#startService startService()}. The service then runs indefinitely and must
-stop itself by calling {@link
-android.app.Service#stopSelf() stopSelf()}. Another component can also stop the
-service by calling {@link android.content.Context#stopService
-stopService()}. When the service is stopped, the system destroys it..</p></li>
-
-<li>A bound service
- <p>The service is created when another component (a client) calls {@link
-android.content.Context#bindService bindService()}. The client then communicates with the service
-through an {@link android.os.IBinder} interface. The client can close the connection by calling
-{@link android.content.Context#unbindService unbindService()}. Multiple clients can bind to
-the same service and when all of them unbind, the system destroys the service. (The service
-does <em>not</em> need to stop itself.)</p></li>
-</ul>
-
-<p>These two paths are not entirely separate. That is, you can bind to a service that was already
-started with {@link android.content.Context#startService startService()}. For example, a background
-music service could be started by calling {@link android.content.Context#startService
-startService()} with an {@link android.content.Intent} that identifies the music to play. Later,
-possibly when the user wants to exercise some control over the player or get information about the
-current song, an activity can bind to the service by calling {@link
-android.content.Context#bindService bindService()}. In cases like this, {@link
-android.content.Context#stopService stopService()} or {@link android.app.Service#stopSelf
-stopSelf()} does not actually stop the service until all clients unbind. </p>
-
-
-<h3 id="LifecycleCallbacks">Implementing the lifecycle callbacks</h3>
-
-<p>Like an activity, a service has lifecycle callback methods that you can implement to monitor
-changes in the service's state and perform work at the appropriate times. The following skeleton
-service demonstrates each of the lifecycle methods:</p>
-
-
-<div class="figure" style="width:432px">
-<img src="{@docRoot}images/service_lifecycle.png" alt="" />
-<p class="img-caption"><strong>Figure 2.</strong> The service lifecycle. The diagram on the left
-shows the lifecycle when the service is created with {@link android.content.Context#startService
-startService()} and the diagram on the right shows the lifecycle when the service is created
-with {@link android.content.Context#bindService bindService()}.</p>
-</div>
-
-<pre>
-public class ExampleService extends Service {
- int mStartMode; // indicates how to behave if the service is killed
- IBinder mBinder; // interface for clients that bind
- boolean mAllowRebind; // indicates whether onRebind should be used
-
- @Override
- public void {@link android.app.Service#onCreate onCreate}() {
- // The service is being created
- }
- @Override
- public int {@link android.app.Service#onStartCommand onStartCommand}(Intent intent, int flags, int startId) {
- // The service is starting, due to a call to {@link android.content.Context#startService startService()}
- return <em>mStartMode</em>;
- }
- @Override
- public IBinder {@link android.app.Service#onBind onBind}(Intent intent) {
- // A client is binding to the service with {@link android.content.Context#bindService bindService()}
- return <em>mBinder</em>;
- }
- @Override
- public boolean {@link android.app.Service#onUnbind onUnbind}(Intent intent) {
- // All clients have unbound with {@link android.content.Context#unbindService unbindService()}
- return <em>mAllowRebind</em>;
- }
- @Override
- public void {@link android.app.Service#onRebind onRebind}(Intent intent) {
- // A client is binding to the service with {@link android.content.Context#bindService bindService()},
- // after onUnbind() has already been called
- }
- @Override
- public void {@link android.app.Service#onDestroy onDestroy}() {
- // The service is no longer used and is being destroyed
- }
-}
-</pre>
-
-<p class="note"><strong>Note:</strong> Unlike the activity lifecycle callback methods, you are
-<em>not</em> required to call the superclass implementation of these callback methods.</p>
-
-<p>By implementing these methods, you can monitor two nested loops of the service's lifecycle: </p>
-
-<ul>
-<li>The <strong>entire lifetime</strong> of a service happens between the time {@link
-android.app.Service#onCreate onCreate()} is called and the time {@link
-android.app.Service#onDestroy} returns. Like an activity, a service does its initial setup in
-{@link android.app.Service#onCreate onCreate()} and releases all remaining resources in {@link
-android.app.Service#onDestroy onDestroy()}. For example, a
-music playback service could create the thread where the music will be played in {@link
-android.app.Service#onCreate onCreate()}, then stop the thread in {@link
-android.app.Service#onDestroy onDestroy()}.
-
-<p>The {@link android.app.Service#onCreate onCreate()} and {@link android.app.Service#onDestroy
-onDestroy()} methods are called for all services, whether
-they're created by {@link android.content.Context#startService startService()} or {@link
-android.content.Context#bindService bindService()}.</p></li>
-
-<li>The <strong>active lifetime</strong> of a service begins with a call to either {@link
-android.app.Service#onStartCommand onStartCommand()} or {@link android.app.Service#onBind onBind()}.
-Each method is handed the {@link
-android.content.Intent} that was passed to either {@link android.content.Context#startService
-startService()} or {@link android.content.Context#bindService bindService()}, respectively.
-<p>If the service is started, the active lifetime ends the same time that the entire lifetime
-ends (the service is still active even after {@link android.app.Service#onStartCommand
-onStartCommand()} returns). If the service is bound, the active lifetime ends when {@link
-android.app.Service#onUnbind onUnbind()} returns.</p>
-</li>
-</ul>
-
-<p class="note"><strong>Note:</strong> Although a started service is stopped by a call to
-either {@link android.app.Service#stopSelf stopSelf()} or {@link
-android.content.Context#stopService stopService()}, there is not a respective callback for the
-service (there's no {@code onStop()} callback). So, unless the service is bound to a client,
-the system destroys it when the service is stopped—{@link
-android.app.Service#onDestroy onDestroy()} is the only callback received.</p>
-
-<p>Figure 2 illustrates the typical callback methods for a service. Although the figure separates
-services that are created by {@link android.content.Context#startService startService()} from those
-created by {@link android.content.Context#bindService bindService()}, keep
-in mind that any service, no matter how it's started, can potentially allow clients to bind to it.
-So, a service that was initially started with {@link android.app.Service#onStartCommand
-onStartCommand()} (by a client calling {@link android.content.Context#startService startService()})
-can still receive a call to {@link android.app.Service#onBind onBind()} (when a client calls
-{@link android.content.Context#bindService bindService()}).</p>
-
-<p>For more information about creating a service that provides binding, see the <a
-href="{@docRoot}guide/topics/fundamentals/bound-services.html">Bound Services</a> document,
-which includes more information about the {@link android.app.Service#onRebind onRebind()}
-callback method in the section about <a
-href="{@docRoot}guide/topics/fundamentals/bound-services.html#Lifecycle">Managing the Lifecycle of
-a Bound Service</a>.</p>
-
-
-<!--
-<h2>Beginner's Path</h2>
-
-<p>To learn how to query data from the system or other applications (such as contacts or media
-stored on the device), continue with the <b><a
-href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a></b>
-document.</p>
--->
diff --git a/docs/html/guide/topics/fundamentals/tasks-and-back-stack.jd b/docs/html/guide/topics/fundamentals/tasks-and-back-stack.jd
deleted file mode 100644
index 0880614..0000000
--- a/docs/html/guide/topics/fundamentals/tasks-and-back-stack.jd
+++ /dev/null
@@ -1,596 +0,0 @@
-page.title=Tasks and Back Stack
-parent.title=Activities
-parent.link=activities.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-<h2>Quickview</h2>
-<ul>
- <li>All activities belong to a task</li>
- <li>A task contains a collection of activities in the order in which the user interacts with
-them</li>
- <li>Tasks can move to the background and retain the state of each activity in order for users
-to perform other tasks without losing their work</li>
-</ul>
-
-<h2>In this document</h2>
-<ol>
-<li><a href="#ActivityState">Saving Activity State</a></li></li>
-<li><a href="#ManagingTasks">Managing Tasks</a>
- <ol>
- <li><a href="#TaskLaunchModes">Defining launch modes</a></li>
- <li><a href="#Affinities">Handling affinities</a></li>
- <li><a href="#Clearing">Clearing the back stack</a></li>
- <li><a href="#Starting">Starting a task</a></li>
- </ol>
-</li>
-</ol>
-
-<h2>Articles</h2>
-<ol>
- <li><a href="{@docRoot}resources/articles/multitasking-android-way.html">Multitasking the Android Way</a></li>
-</ol>
-
-<h2>See also</h2>
-<ol>
- <li><a href="{@docRoot}design/patterns/navigation.html">Android Design:
-Navigation</a></li>
- <li><a href="{@docRoot}videos/index.html#v=fL6gSd4ugSI">Application Lifecycle video</a></li>
- <li><a
-href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>} manifest
-element</a></li>
-</ol>
-</div>
-</div>
-
-
-<p>An application usually contains multiple <a
-href="{@docRoot}guide/topics/fundamentals/activities.html">activities</a>. Each activity
-should be designed around a specific kind of action the user can perform and can start other
-activities. For example, an email application might have one activity to show a list of new email.
-When the user selects an email, a new activity opens to view that email.</p>
-
-<p>An activity can even start activities that exist in other applications on the device. For
-example, if your application wants to send an email, you can define an intent to perform a "send"
-action and include some data, such as an email address and a message. An activity from another
-application that declares itself to handle this kind of intent then opens. In this case, the intent
-is to send an email, so an email application's "compose" activity starts (if multiple activities
-support the same intent, then the system lets the user select which one to use). When the email is
-sent, your activity resumes and it seems as if the email activity was part of your application. Even
-though the activities may be from different applications, Android maintains this seamless user
-experience by keeping both activities in the same <em>task</em>.</p>
-
-<p>A task is a collection of activities that users interact with
-when performing a certain job. The activities are arranged in a stack (the "back stack"), in the
-order in which each activity is opened.</p>
-
-<!-- SAVE FOR WHEN THE FRAGMENT DOC IS ADDED
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h3>Adding fragments to a task's back stack</h3>
-
-<p>Your activity can also include {@link android.app.Fragment}s to the back stack. For example,
-suppose you have a two-pane layout using fragments, one of which is a list view (fragment A) and the
-other being a layout to display an item from the list (fragment B). When the user selects an item
-from the list, fragment B is replaced by a new fragment (fragment C). In this case, it might be
-desireable for the user to navigate back to reveal fragment B, using the <em>Back</em> button.</p>
-<p>In order to add fragment B to the back stack so that this is possible, you must call {@link
-android.app.FragmentTransaction#addToBackStack addToBackStack()} before you {@link
-android.app.FragmentTransaction#commit()} the transaction that replaces fragment B with fragment
-C.</p>
-<p>For more information about using fragments and adding them to the back stack, see the {@link
-android.app.Fragment} class documentation.</p>
-
-</div>
-</div>
--->
-
-<p>The device Home screen is the starting place for most tasks. When the user touches an icon in the
-application
-launcher (or a shortcut on the Home screen), that application's task comes to the foreground. If no
-task exists for the application (the application has not been used recently), then a new task
-is created and the "main" activity for that application opens as the root activity in the stack.</p>
-
-<p>When the current activity starts another, the new activity is pushed on the top of the stack and
-takes focus. The previous activity remains in the stack, but is stopped. When an activity
-stops, the system retains the current state of its user interface. When the user presses the
-<em>Back</em>
-button, the current activity is popped from the top of the stack (the activity is destroyed) and the
-previous activity resumes (the previous state of its UI is restored). Activities in the stack are
-never rearranged, only pushed and popped from the stack—pushed onto the stack when started by
-the current activity and popped off when the user leaves it using the <em>Back</em> button. As such,
-the back
-stack operates as a "last in, first out" object structure. Figure 1 visualizes
-this behavior with a timeline showing the progress between activities along with the current back
-stack at each point in time.</p>
-
-<img src="{@docRoot}images/fundamentals/diagram_backstack.png" alt="" />
-<p class="img-caption"><strong>Figure 1.</strong> A representation of how each new activity in a
-task adds an item to the back stack. When the user presses the <em>Back</em> button, the current
-activity is
-destroyed and the previous activity resumes.</p>
-
-
-<p>If the user continues to press <em>Back</em>, then each activity in the stack is popped off to
-reveal the
-previous one, until the user returns to the Home screen (or to whichever activity was running when
-the task began). When all activities are removed from the stack, the task no longer exists.</p>
-
-<div class="figure" style="width:287px">
-<img src="{@docRoot}images/fundamentals/diagram_multitasking.png" alt="" /> <p
-class="img-caption"><strong>Figure 2.</strong> Two tasks: Task B receives user interaction
-in the foreground, while Task A is in the background, waiting to be resumed.</p>
-</div>
-<div class="figure" style="width:215px">
- <img src="{@docRoot}images/fundamentals/diagram_multiple_instances.png" alt="" /> <p
-class="img-caption"><strong>Figure 3.</strong> A single activity is instantiated multiple times.</p>
-</div>
-
-<p>A task is a cohesive unit that can move to the "background" when users begin a new task or go
-to the Home screen, via the <em>Home</em> button. While in the background, all the activities in the
-task are
-stopped, but the back stack for the task remains intact—the task has simply lost focus while
-another task takes place, as shown in figure 2. A task can then return to the "foreground" so users
-can pick up where they left off. Suppose, for example, that the current task (Task A) has three
-activities in its stack—two under the current activity. The user presses the <em>Home</em>
-button, then
-starts a new application from the application launcher. When the Home screen appears, Task A goes
-into the background. When the new application starts, the system starts a task for that application
-(Task B) with its own stack of activities. After interacting with
-that application, the user returns Home again and selects the application that originally
-started Task A. Now, Task A comes to the
-foreground—all three activities in its stack are intact and the activity at the top of the
-stack resumes. At
-this point, the user can also switch back to Task B by going Home and selecting the application icon
-that started that task (or by touching and holding the <em>Home</em> button to reveal recent tasks
-and selecting
-one). This is an example of multitasking on Android.</p>
-
-<p class="note"><strong>Note:</strong> Multiple tasks can be held in the background at once.
-However, if the user is running many background tasks at the same time, the system might begin
-destroying background activities in order to recover memory, causing the activity states to be lost.
-See the following section about <a href="#ActivityState">Activity state</a>.</p>
-
-<p>Because the activities in the back stack are never rearranged, if your application allows
-users to start a particular activity from more than one activity, a new instance of
-that activity is created and pushed onto the stack (rather than bringing any previous instance of
-the activity to the top). As such, one activity in your application might be instantiated multiple
-times (even from different tasks), as shown in figure 3. As such, if the user navigates backward
-using the <em>Back</em> button, each instance of the activity is revealed in the order they were
-opened (each
-with their own UI state). However, you can modify this behavior if you do not want an activity to be
-instantiated more than once. How to do so is discussed in the later section about <a
-href="#ManagingTasks">Managing Tasks</a>.</p>
-
-
-<p>To summarize the default behavior for activities and tasks:</p>
-
-<ul>
- <li>When Activity A starts Activity B, Activity A is stopped, but the system retains its state
-(such as scroll position and text entered into forms).
-If the user presses the <em>Back</em> button while in Activity B, Activity A resumes with its state
-restored.</li>
- <li>When the user leaves a task by pressing the <em>Home</em> button, the current activity is
-stopped and
-its task goes into the background. The system retains the state of every activity in the task. If
-the user later resumes the task by selecting the launcher icon that began the task, the task comes
-to the foreground and resumes the activity at the top of the stack.</li>
- <li>If the user presses the <em>Back</em> button, the current activity is popped from the stack
-and
-destroyed. The previous activity in the stack is resumed. When an activity is destroyed, the system
-<em>does not</em> retain the activity's state.</li>
- <li>Activities can be instantiated multiple times, even from other tasks.</li>
-</ul>
-
-
-<div class="design-announce">
-<p><strong>Navigation Design</strong></p>
- <p>For more about how app navigation works on Android, read Android Design's <a
-href="{@docRoot}design/patterns/navigation.html">Navigation</a> guide.</p>
-</div>
-
-
-<h2 id="ActivityState">Saving Activity State</h2>
-
-<p>As discussed above, the system's default behavior preserves the state of an activity when it is
-stopped. This way, when users navigate back to a previous activity, its user interface appears
-the way they left it. However, you can—and <strong>should</strong>—proactively retain
-the state of your activities using callback methods, in case the activity is destroyed and must
-be recreated.</p>
-
-<p>When the system stops one of your activities (such as when a new activity starts or the task
-moves to the background), the system might destroy that activity completely if it needs to recover
-system memory. When this happens, information about the activity state is lost. If this happens, the
-system still
-knows that the activity has a place in the back stack, but when the activity is brought to the
-top of the stack the system must recreate it (rather than resume it). In order to
-avoid losing the user's work, you should proactively retain it by implementing the {@link
-android.app.Activity#onSaveInstanceState onSaveInstanceState()} callback
-methods in your activity.</p>
-
-<p>For more information about how to save your activity state, see the <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#SavingActivityState">Activities</a>
-document.</p>
-
-
-
-<h2 id="ManagingTasks">Managing Tasks</h2>
-
-<p>The way Android manages tasks and the back stack, as described above—by placing all
-activities started in succession in the same task and in a "last in, first out" stack—works
-great for most applications and you shouldn't have to worry about how your activities are associated
-with tasks or how they exist in the back stack. However, you might decide that you want to interrupt
-the normal behavior. Perhaps you want an activity in your application to begin a new task when it is
-started (instead of being placed within the current task); or, when you start an activity, you want
-to bring forward an existing instance of it (instead of creating a new
-instance on top of the back stack); or, you want your back stack to be cleared of all
-activities except for the root activity when the user leaves the task.</p>
-
-<p>You can do these things and more, with attributes in the
-<a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
-<activity>}</a> manifest element and with flags in the intent that you pass to {@link
-android.app.Activity#startActivity startActivity()}.</p>
-
-<p>In this regard, the the principal <a
-href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a>
-attributes you can use are:</p>
-
-<ul class="nolist">
- <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#aff">{@code
-taskAffinity}</a></li>
- <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code
-launchMode}</a></li>
- <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">{@code
-allowTaskReparenting}</a></li>
- <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#clear">{@code
-clearTaskOnLaunch}</a></li>
- <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#always">{@code
-alwaysRetainTaskState}</a></li>
- <li><a href="{@docRoot}guide/topics/manifest/activity-element.html#finish">{@code
-finishOnTaskLaunch}</a></li>
-</ul>
-
-<p>And the principal intent flags you can use are:</p>
-
-<ul class="nolist">
- <li>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</li>
- <li>{@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}</li>
- <li>{@link android.content.Intent#FLAG_ACTIVITY_SINGLE_TOP}</li>
-</ul>
-
-<p>In the following sections, you'll see how you can use these manifest attributes and intent
-flags to define how activities are associated with tasks and how the behave in the back stack.</p>
-
-
-<p class="caution"><strong>Caution:</strong> Most applications should not interrupt the default
-behavior for activities and tasks. If you determine that it's necessary for your activity to modify
-the default behaviors, use caution and be sure to test the usability of the activity during
-launch and when navigating back to it from other activities and tasks with the <em>Back</em> button.
-Be sure
-to test for navigation behaviors that might conflict with the user's expected behavior.</p>
-
-
-<h3 id="TaskLaunchModes">Defining launch modes</h3>
-
-<p>Launch modes allow you to define how a new instance of an activity is associated with the
-current task. You can define different launch modes in two ways:</p>
-<ul class="nolist">
- <li><a href="#ManifestForTasks">Using the manifest file</a>
- <p>When you declare an activity in your manifest file, you can specify how the activity
-should associate with tasks when it starts.</li>
- <li><a href="#IntentFlagsForTasks">Using Intent flags</a>
- <p>When you call {@link android.app.Activity#startActivity startActivity()},
-you can include a flag in the {@link android.content.Intent} that declares how (or
-whether) the new activity should associate with the current task.</p></li>
-</ul>
-
-<p>As such, if Activity A starts Activity B, Activity B can define in its manifest how it
-should associate with the current task (if at all) and Activity A can also request how Activity
-B should associate with current task. If both activities define how Activity B
-should associate with a task, then Activity A's request (as defined in the intent) is honored
-over Activity B's request (as defined in its manifest).</p>
-
-<p class="note"><strong>Note:</strong> Some launch modes available for the manifest file
-are not available as flags for an intent and, likewise, some launch modes available as flags
-for an intent cannot be defined in the manifest.</p>
-
-
-<h4 id="ManifestForTasks">Using the manifest file</h4>
-
-<p>When declaring an activity in your manifest file, you can specify how the activity should
-associate with a task using the <a
-href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a>
-element's <a href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code
-launchMode}</a> attribute.</p>
-
-<p>The <a href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code
-launchMode}</a> attribute specifies an instruction on how the activity should be launched into a
-task. There are four different launch modes you can assign to the
-<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">launchMode</a></code>
-attribute:</p>
-
-<dl>
-<dt>{@code "standard"} (the default mode)</dt>
- <dd>Default. The system creates a new instance of the activity in the task from
-which it was started and routes the intent to it. The activity can be instantiated multiple times,
-each instance can belong to different tasks, and one task can have multiple instances.</dd>
-<dt>{@code "singleTop"}</dt>
- <dd>If an instance of the activity already exists at the top of the current task, the system
-routes the intent to that instance through a call to its {@link
-android.app.Activity#onNewIntent onNewIntent()} method, rather than creating a new instance of the
-activity. The activity can be instantiated multiple times, each instance can
-belong to different tasks, and one task can have multiple instances (but only if the the
-activity at the top of the back stack is <em>not</em> an existing instance of the activity).
- <p>For example, suppose a task's back stack consists of root activity A with activities B, C,
-and D on top (the stack is A-B-C-D; D is on top). An intent arrives for an activity of type D.
-If D has the default {@code "standard"} launch mode, a new instance of the class is launched and the
-stack becomes A-B-C-D-D. However, if D's launch mode is {@code "singleTop"}, the existing instance
-of D receives the intent through {@link
-android.app.Activity#onNewIntent onNewIntent()}, because it's at the top of the stack—the
-stack remains A-B-C-D. However, if an intent arrives for an activity of type B, then a new
-instance of B is added to the stack, even if its launch mode is {@code "singleTop"}.</p>
- <p class="note"><strong>Note:</strong> When a new instance of an activity is created,
-the user can press the <em>Back</em> button to return to the previous activity. But when an existing
-instance of
-an activity handles a new intent, the user cannot press the <em>Back</em> button to return to the
-state of
-the activity before the new intent arrived in {@link android.app.Activity#onNewIntent
-onNewIntent()}.</p>
-</dd>
-
-<dt>{@code "singleTask"}</dt>
- <dd>The system creates a new task and instantiates the activity at the root of the new task.
-However, if an instance of the activity already exists in a separate task, the system routes the
-intent to the existing instance through a call to its {@link
-android.app.Activity#onNewIntent onNewIntent()} method, rather than creating a new instance. Only
-one instance of the activity can exist at a time.
- <p class="note"><strong>Note:</strong> Although the activity starts in a new task, the
-<em>Back</em> button still returns the user to the previous activity.</p></dd>
-<dt>{@code "singleInstance"}.</dt>
- <dd>Same as {@code "singleTask"}, except that the system doesn't launch any other activities into
-the task holding the instance. The activity is always the single and only member of its task;
-any activities started by this one open in a separate task.</dd>
-</dl>
-
-
-<p>As another example, the Android Browser application declares that the web browser activity should
-always open in its own task—by specifying the {@code singleTask} launch mode in the <a
-href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element.
-This means that if your application issues an
-intent to open the Android Browser, its activity is <em>not</em> placed in the same
-task as your application. Instead, either a new task starts for the Browser or, if the Browser
-already has a task running in the background, that task is brought forward to handle the new
-intent.</p>
-
-<p>Regardless of whether an activity starts in a new task or in the same task as the activity that
-started it, the <em>Back</em> button always takes the user to the previous activity. However, if you
-start an activity that specifies the {@code singleTask} launch mode, then if an instance of
-that activity exists in a background task, that whole task is brought to the foreground. At this
-point, the back stack now includes all activities from the task brought forward, at the top of the
-stack. Figure 4 illustrates this type of scenario.</p>
-
-<img src="{@docRoot}images/fundamentals/diagram_backstack_singletask_multiactivity.png" alt="" />
-<p class="img-caption"><strong>Figure 4.</strong> A representation of how an activity with
-launch mode "singleTask" is added to the back stack. If the activity is already a part of a
-background task with its own back stack, then the entire back stack also comes
-forward, on top of the current task.</p>
-
-<p>For more information about using launch modes in the manifest file, see the
-<code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code>
-element documentation, where the {@code launchMode} attribute and the accepted values are
-discussed more.</p>
-
-<p class="note"><strong>Note:</strong> The behaviors that you specify for your activity with the <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code launchMode}</a> attribute
-can be overridden by flags included with the intent that start your activity, as discussed in the
-next section.</p>
-
-
-
-<h4 id="#IntentFlagsForTasks">Using Intent flags</h4>
-
-<p>When starting an activity, you can modify the default association of an activity to its task
-by including flags in the intent that you deliver to {@link
-android.app.Activity#startActivity startActivity()}. The flags you can use to modify the
-default behavior are:</p>
-
-<p>
- <dt>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</dt>
- <dd>Start the activity in a new task. If a task is already running for the activity you are now
-starting, that task is brought to the foreground with its last state restored and the activity
-receives the new intent in {@link android.app.Activity#onNewIntent onNewIntent()}.
- <p>This produces the same behavior as the {@code "singleTask"} <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code launchMode}</a> value,
-discussed in the previous section.</p></dd>
- <dt>{@link android.content.Intent#FLAG_ACTIVITY_SINGLE_TOP}</dt>
- <dd>If the activity being started is the current activity (at the top of the back stack), then
-the existing instance receives a call to {@link android.app.Activity#onNewIntent onNewIntent()},
-instead of creating a new instance of the activity.
- <p>This produces the same behavior as the {@code "singleTop"} <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code launchMode}</a> value,
-discussed in the previous section.</p></dd>
- <dt>{@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}</dt>
- <dd>If the activity being started is already running in the current task, then instead
-of launching a new instance of that activity, all of the other activities on top of it are
-destroyed and this intent is delivered to the resumed instance of the activity (now on top),
-through {@link android.app.Activity#onNewIntent onNewIntent()}).
- <p>There is no value for the <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code launchMode}</a>
-attribute that produces this behavior.</p>
- <p>{@code FLAG_ACTIVITY_CLEAR_TOP} is most often used in conjunction with {@code
-FLAG_ACTIVITY_NEW_TASK}. When used together, these flags are a way of locating an existing activity
-in another task and putting it in a position where it can respond to the intent. </p>
- <p class="note"><strong>Note:</strong> If the launch mode of the designated activity is {@code
-"standard"}, it too is removed from the stack and a new instance is launched in its place to handle
-the incoming intent. That's because a new instance is always created for a new intent when the
-launch mode is {@code "standard"}. </p>
-</dd>
-</dl>
-
-
-
-
-
-<h3 id="Affinities">Handling affinities</h3>
-
-<p>The <em>affinity</em> indicates which task an activity prefers to belong to. By default, all the
-activities from the same application have an affinity for each other. So, by default, all
-activities in the same application prefer to be in the same task. However, you can modify
-the default affinity for an activity. Activities defined in
-different applications can share an affinity, or activities defined in the same application can be
-assigned different task affinities.</p>
-
-<p>You can modify the affinity for any given activity with the <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#aff">{@code taskAffinity}</a> attribute
-of the <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a>
-element.</p>
-
-<p>The <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#aff">{@code taskAffinity}</a>
-attribute takes a string value, which must be unique from the default package name
-declared in the <a href="{@docRoot}guide/topics/manifest/manifest-element.html">{@code
-<manifest>}</a> element, because the system uses that name to identify the default task
-affinity for the application.</p>
-
-<p>The affinity comes into play in two circumstances:</p>
-<ul>
- <li>When the intent that launches an activity contains the {@link
-android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag.
-
-<p>A new activity is, by default, launched into the task of the activity
-that called {@link android.app.Activity#startActivity startActivity()}. It's pushed onto the same
-back stack as the caller. However, if the intent passed to {@link
-android.app.Activity#startActivity startActivity()} contains the {@link
-android.content.Intent#FLAG_ACTIVITY_NEW_TASK}
-flag, the system looks for a different task to house the new activity. Often, it's a new task.
-However, it doesn't have to be. If there's already an existing task with the same affinity as the
-new activity, the activity is launched into that task. If not, it begins a new task.</p>
-
-<p>If this flag causes an activity to begin a new task and the user presses the <em>Home</em> button
-to leave
-it, there must be some way for the user to navigate back to the task. Some entities (such as the
-notification manager) always start activities in an external task, never as part of their own, so
-they always put {@code FLAG_ACTIVITY_NEW_TASK} in the intents they pass to {@link
-android.app.Activity#startActivity startActivity()}. If you have an activity that can be invoked by
-an external entity that might use this flag, take care that the user has a independent way to get
-back to the task that's started, such as with a launcher icon (the root activity of the task
-has a {@link android.content.Intent#CATEGORY_LAUNCHER} intent filter; see the <a
-href="#Starting">Starting a task</a> section below).</p>
-</li>
-
- <li>When an activity has its <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">{@code
-allowTaskReparenting}</a> attribute set to {@code "true"}.
- <p>In this case, the activity can move from the task it starts to the task it has an affinity
-for, when that task comes to the foreground.</p>
- <p>For example, suppose that an activity that reports weather conditions in selected cities is
-defined as part of a travel application. It has the same affinity as other activities in the same
-application (the default application affinity) and it allows re-parenting with this attribute.
-When one of your activities starts the weather reporter activity, it initially belongs to the same
-task as your activity. However, when the travel application's task comes to the foreground, the
-weather reporter activity is reassigned to that task and displayed within it.</p>
-</li>
-</ul>
-
-<p class="note"><strong>Tip:</strong> If an {@code .apk} file contains more than one "application"
-from the user's point of view, you probably want to use the <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#aff">{@code taskAffinity}</a>
-attribute to assign different affinities to the activities associated with each "application".</p>
-
-
-
-<h3 id="Clearing">Clearing the back stack</h3>
-
-<p>If the user leaves a task for a long time, the system clears the task of all activities except
-the root activity. When the user returns to the task again, only the root activity is restored.
-The system behaves this way, because, after an extended amount of time, users likely have abandoned
-what they were doing before and are returning to the task to begin something new. </p>
-
-<p>There are some activity attributes that you can use to modify this behavior: </p>
-
-<dl>
-<dt><code><a
-href="{@docRoot}guide/topics/manifest/activity-element.html#always">alwaysRetainTaskState</a></code>
-</dt>
-<dd>If this attribute is set to {@code "true"} in the root activity of a task,
-the default behavior just described does not happen.
-The task retains all activities in its stack even after a long period.</dd>
-
-<dt><code><a
-href="{@docRoot}guide/topics/manifest/activity-element.html#clear">clearTaskOnLaunch</a></code></dt>
-<dd>If this attribute is set to {@code "true"} in the root activity of a task,
-the stack is cleared down to the root activity whenever the user leaves the task
-and returns to it. In other words, it's the opposite of <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#always">{@code
-alwaysRetainTaskState}</a>. The user always returns to the task in its
-initial state, even after a leaving the task for only a moment.</dd>
-
-<dt><code><a
-href="{@docRoot}guide/topics/manifest/activity-element.html#finish">finishOnTaskLaunch</a></code>
-</dt>
-<dd>This attribute is like <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#clear">{@code clearTaskOnLaunch}</a>,
-but it operates on a
-single activity, not an entire task. It can also cause any activity to go
-away, including the root activity. When it's set to {@code "true"}, the
-activity remains part of the task only for the current session. If the user
-leaves and then returns to the task, it is no longer present.</dd>
-</dl>
-
-
-
-
-<h3 id="Starting">Starting a task</h3>
-
-<p>You can set up an activity as the entry point for a task by giving it an intent filter with
-{@code "android.intent.action.MAIN"} as the specified action and {@code
-"android.intent.category.LAUNCHER"} as the specified category. For example:</p>
-
-<pre>
-<activity ... >
- <intent-filter ... >
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- ...
-</activity>
-</pre>
-
-<p>An intent filter of this kind causes an icon and label for the
-activity to be displayed in the application launcher, giving users a way to launch the activity and
-to return to the task that it creates any time after it has been launched.
-</p>
-
-<p>This second ability is important: Users must be able to leave a task and then come back to it
-later using this activity launcher. For this reason, the two <a href="#LaunchModes">launch
-modes</a> that mark activities as always initiating a task, {@code "singleTask"} and "{@code
-"singleInstance"}, should be used only when the activity has an {@link
-android.content.Intent#ACTION_MAIN}
-and a {@link android.content.Intent#CATEGORY_LAUNCHER}
-filter. Imagine, for example, what could happen if the filter is missing: An intent launches a
-{@code "singleTask"} activity, initiating a new task, and the user spends some time working in
-that task. The user then presses the <em>Home</em> button. The task is now sent to the background
-and is
-not visible. Now the user has no way to return to the task, because it is not represented in the
-application launcher.
-</p>
-
-<p>For those cases where you don't want the user to be able to return to an activity, set the
- <code><a
-href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> element's
-<a href="{@docRoot}guide/topics/manifest/activity-element.html#finish">{@code
-finishOnTaskLaunch}</a> to {@code "true"} (see <a
-href="#Clearing">Clearing the stack</a>).</p>
-
-
-
-<!--
-<h2>Beginner's Path</h2>
-
-<p>For more information about how to use intents to
-activate other application components and publish the intents to which your components
-respond, continue with the <b><a
-href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent
-Filters</a></b> document.</p>
--->
diff --git a/docs/html/guide/topics/graphics/2d-graphics.jd b/docs/html/guide/topics/graphics/2d-graphics.jd
index 5cf1a59..d842cb9 100644
--- a/docs/html/guide/topics/graphics/2d-graphics.jd
+++ b/docs/html/guide/topics/graphics/2d-graphics.jd
@@ -476,7 +476,7 @@
do.
</p>
-<p>The <a href="{@docRoot}guide/developing/tools/draw9patch.html">Draw 9-patch</a> tool offers
+<p>The <a href="{@docRoot}tools/help/draw9patch.html">Draw 9-patch</a> tool offers
an extremely handy way to create your NinePatch images, using a WYSIWYG graphics editor. It
even raises warnings if the region you've defined for the stretchable area is at risk of
producing drawing artifacts as a result of the pixel replication.
diff --git a/docs/html/guide/topics/graphics/animation.jd b/docs/html/guide/topics/graphics/animation.jd
deleted file mode 100644
index 561369d..0000000
--- a/docs/html/guide/topics/graphics/animation.jd
+++ /dev/null
@@ -1,64 +0,0 @@
-page.title=Animation
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/topics/graphics/prop-animation.html">Property
-Animation</a></li>
- <li><a href="{@docRoot}guide/topics/graphics/view-animation.html">View Animation</a></li>
- <li><a href="{@docRoot}guide/topics/graphics/drawable-animation.html">Drawable Animation</a></li>
- <ol>
- </div>
- </div>
-
- <p>The Android framework provides two animation systems: property animation
- (introduced in Android 3.0) and view animation. Both animation systems are viable options,
- but the property animation system, in general, is the preferred method to use, because it
- is more flexible and offers more features. In addition to these two systems, you can utilize Drawable
-animation, which allows you to load drawable resources and display them one frame after
-another.</p>
-
- <p>The view animation system provides the capability to only animate {@link android.view.View}
-objects, so if you wanted to animate non-{@link android.view.View} objects, you have to implement
-your own code to do so. The view animation system is also constrained in the fact that it only
-exposes a few aspects of a {@link android.view.View} object to animate, such as the scaling and
-rotation of a View but not the background color, for instance.</p>
-
- <p>Another disadvantage of the view animation system is that it only modified where the
- View was drawn, and not the actual View itself. For instance, if you animated a button to move
- across the screen, the button draws correctly, but the actual location where you can click the
- button does not change, so you have to implement your own logic to handle this.</p>
-
- <p>With the property animation system, these constraints are completely removed, and you can animate
- any property of any object (Views and non-Views) and the object itself is actually modified.
- The property animation system is also more robust in the way it carries out animation. At
- a high level, you assign animators to the properties that you want to animate, such as color,
- position, or size and can define aspects of the animation such as interpolation and
- synchronization of multiple animators.</p>
-
- <p>The view animation system, however, takes less time to setup and requires less code to write.
- If view animation accomplishes everything that you need to do, or if your existing code already
- works the way you want, there is no need to use the property animation system. It also might
- make sense to use both animation systems for different situations if the use case arises.</p>
-
-<dl>
-<dt><strong><a href="{@docRoot}guide/topics/graphics/prop-animation.html">Property
-Animation</a></strong></dt>
-<dd>Introduced in Android 3.0 (API level 11), the property animation system lets you
-animate properties of any object, including ones that are not rendered to the screen. The system is
-extensible and lets you animate properties of custom types as well.</dd>
-
-<dt><strong><a href="{@docRoot}guide/topics/graphics/view-animation.html">View
-Animation</a></strong></dt>
-<dd>View Animation is the older system and can only be used for Views. It is relatively easy to
-setup and offers enough capabilities to meet many application's needs.</dd>
-</dl>
-
-<dt><strong><a href="{@docRoot}guide/topics/graphics/drawable-animation.html">Drawable
-Animation</a></strong></dt>
-<dd>Drawable animation involves displaying {@link android.graphics.drawable.Drawable} resources one
-after another, like a roll of film. This method of animation is useful if you want to animate
-things that are easier to represent with Drawable resources, such as a progression of bitmaps.</dd>
diff --git a/docs/html/guide/topics/graphics/index.jd b/docs/html/guide/topics/graphics/index.jd
index ab623c2..17f6309 100644
--- a/docs/html/guide/topics/graphics/index.jd
+++ b/docs/html/guide/topics/graphics/index.jd
@@ -1,51 +1,49 @@
-page.title=Graphics
+page.title=Animation and Graphics
+page.landing=true
+page.landing.intro=Make your apps look and perform their best using Android's powerful graphics features such as OpenGL, hardware acceleration, and built-in UI animations.
+page.landing.image=
+
@jd:body
-<div id="qv-wrapper">
- <div id="qv">
- <h2>Topics</h2>
- <ol>
- <li><a href="{@docRoot}guide/topics/graphics/2d-graphics.html">Canvas and Drawables</a></li>
- <li><a href="{@docRoot}guide/topics/graphics/hardware-accel.html">Hardware Acceleration</a></li>
- <li><a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL</a></li>
- </ol>
+<div class="landing-docs">
+
+ <div class="col-6">
+ <h3>Blog Articles</h3>
+ <a
+href="http://android-developers.blogspot.com/2011/11/android-40-graphics-and-animations.html">
+ <h4>Android 4.0 Graphics and Animations</h4>
+ <p>Earlier this year, Android 3.0 launched with a new 2D rendering pipeline designed to
+support hardware acceleration on tablets. With this new pipeline, all drawing operations performed
+by the UI toolkit are carried out using the GPU. You’ll be happy to hear that Android 4.0, Ice Cream
+Sandwich, brings an improved version of the hardware-accelerated 2D rendering pipeline.</p>
+ </a>
+
+ <a
+href="http://android-developers.blogspot.com/2011/05/introducing-viewpropertyanimator.html">
+ <h4>Introducing ViewPropertyAnimator</h4>
+ <p>This new animation system makes it easy to animate any kind of property on any object,
+including the new properties added to the View class in 3.0. In the 3.1 release, we added a small
+utility class that makes animating these properties even easier.</p>
+ </a>
+
+ <a
+href="http://android-developers.blogspot.com/2011/03/android-30-hardware-acceleration.html">
+ <h4>Android 3.0 Hardware Acceleration</h4>
+ <p>Hardware accelerated graphics is nothing new to the Android platform, it has always been
+used for windows composition or OpenGL games for instance, but with this new rendering pipeline
+applications can benefit from an extra boost in performance.</p>
+ </a>
</div>
-</div>
-<p>When writing an application, it's important to consider exactly what your graphical demands will be.
-Varying graphical tasks are best accomplished with varying techniques. For example, graphics and animations
-for a rather static application should be implemented much differently than graphics and animations
-for an interactive game. Here, we'll discuss a few of the options you have for drawing graphics
-on Android and which tasks they're best suited for.
-</p>
+ <div class="col-6">
+ <h3>Training</h3>
+ <a href="{@docRoot}training/displaying-bitmaps/index.html">
+ <h4>Displaying Bitmaps Efficiently</h4>
+ <p>This class covers some common techniques for processing and loading Bitmap objects in a way
+that keeps your user interface (UI) components responsive and avoids exceeding your application
+memory limit.</p>
+ </a>
+
-<dl>
-<dt><strong><a href="{@docRoot}guide/topics/graphics/2d-graphics.html">Canvas and
-Drawables</a></strong></dt>
-<dd>Android provides a set of {@link android.view.View} widgets that provide general functionality
-for a wide array of user interfaces. You can also extend these widgets to modify the way they
-look or behave. In addition, you can do your own custom 2D rendering using the various drawing
-methods contained in the {@link android.graphics.Canvas} class or create {@link
-android.graphics.drawable.Drawable} objects for things such as textured buttons or frame-by-frame
-animations.</dd>
-
-<dt><strong><a href="{@docRoot}guide/topics/graphics/hardware-accel.html">Hardware
-Acceleration</a></strong></dt>
-<dd>Beginning in Android 3.0, you can hardware accelerate the majority of
-the drawing done by the Canvas APIs to further increase their performance.</dd>
-
-<dt><strong><a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL</a></strong></dt>
-<dd>Android supports OpenGL ES 1.0 and 2.0, with Android framework APIs as well as natively
-with the Native Development Kit (NDK). Using the framework APIs is desireable when you want to add a
-few graphical enhancements to your application that are not supported with the Canvas APIs, or if
-you desire platform independence and don't demand high performance. There is a performance hit in
-using the framework APIs compared to the NDK, so for many graphic intensive applications such as
-games, using the NDK is beneficial (It is important to note though that you can still get adequate
-performance using the framework APIs. For example, the Google Body app is developed entirely
-using the framework APIs). OpenGL with the NDK is also useful if you have a lot of native
-code that you want to port over to Android. For more information about using the NDK, read the
-docs in the <code>docs/</code> directory of the <a href="{@docRoot}sdk/ndk/index.html">NDK
-download.</a></dd>
-</dl>
-
-
+ </div>
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/topics/graphics/opengl.jd b/docs/html/guide/topics/graphics/opengl.jd
index a786d42..a9fedb7 100644
--- a/docs/html/guide/topics/graphics/opengl.jd
+++ b/docs/html/guide/topics/graphics/opengl.jd
@@ -20,6 +20,7 @@
<li><a href="#proj-es1">Projection and camera in ES 2.0</a></li>
</ol>
</li>
+ <li><a href="#faces-winding">Shape Faces and Winding</li>
<li><a href="#compatibility">OpenGL Versions and Device Compatibility</a>
<ol>
<li><a href="#textures">Texture compression support</a></li>
@@ -33,11 +34,6 @@
<li>{@link android.opengl.GLSurfaceView}</li>
<li>{@link android.opengl.GLSurfaceView.Renderer}</li>
</ol>
- <h2>Related tutorials</h2>
- <ol>
- <li><a href="{@docRoot}resources/tutorials/opengl/opengl-es10.html">OpenGL ES 1.0</a></li>
- <li><a href="{@docRoot}resources/tutorials/opengl/opengl-es20.html">OpenGL ES 2.0</a></li>
- </ol>
<h2>Related samples</h2>
<ol>
<li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/GLSurfaceViewActivity.html">GLSurfaceViewActivity</a></li>
@@ -48,8 +44,8 @@
</ol>
<h2>See also</h2>
<ol>
- <li><a href="{@docRoot}resources/articles/glsurfaceview.html">Introducing
-GLSurfaceView</a></li>
+ <li><a href="{@docRoot}training/graphics/opengl/index.html">
+ Displaying Graphics with OpenGL ES</a></li>
<li><a href="http://www.khronos.org/opengles/">OpenGL ES</a></li>
<li><a href="http://www.khronos.org/opengles/1_X/">OpenGL ES 1.x Specification</a></li>
<li><a href="http://www.khronos.org/opengles/2_X/">OpenGL ES 2.x specification</a></li>
@@ -73,7 +69,7 @@
<p>Android supports OpenGL both through its framework API and the Native Development
Kit (NDK). This topic focuses on the Android framework interfaces. For more information about the
-NDK, see the <a href="{@docRoot}sdk/ndk/index.html">Android NDK</a>.
+NDK, see the <a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK</a>.
<p>There are two foundational classes in the Android framework that let you create and manipulate
graphics with the OpenGL ES API: {@link android.opengl.GLSurfaceView} and {@link
@@ -389,6 +385,43 @@
href="{@docRoot}resources/tutorials/opengl/opengl-es20.html#projection-and-views">OpenGL ES 2.0
tutorial</a>.</p>
+<h2 id="faces-winding">Shape Faces and Winding</h2>
+
+<p>In OpenGL, the face of a shape is a surface defined by three or more points in three-dimensional
+space. A set of three or more three-dimensional points (called vertices in OpenGL) have a front face
+and a back face. How do you know which face is front and which is the back? Good question. The
+answer has to do with winding, or, the direction in which you define the points of a shape.</p>
+
+<img src="{@docRoot}images/opengl/ccw-winding.png">
+<p class="img-caption">
+ <strong>Figure 1.</strong> Illustration of a coordinate list which translates into a
+counterclockwise drawing order.</p>
+
+<p>In this example, the points of the triangle are defined in an order such that they are drawn in a
+counterclockwise direction. The order in which these coordinates are drawn defines the winding
+direction for the shape. By default, in OpenGL, the face which is drawn counterclockwise is the
+front face. The triangle shown in Figure 1 is defined so that you are looking at the front face of
+the shape (as interpreted by OpenGL) and the other side is the back face.</p>
+
+<p>Why is it important to know which face of a shape is the front face? The answer has to do with a
+commonly used feature of OpenGL, called face culling. Face culling is an option for the OpenGL
+environment which allows the rendering pipeline to ignore (not calculate or draw) the back face of a
+shape, saving time, memory and processing cycles:</p>
+
+<pre>
+// enable face culling feature
+gl.glEnable(GL10.GL_CULL_FACE);
+// specify which faces to not draw
+gl.glCullFace(GL10.GL_BACK);
+</pre>
+
+<p>If you try to use the face culling feature without knowing which sides of your shapes are the
+front and back, your OpenGL graphics are going to look a bit thin, or possibly not show up at all.
+So, always define the coordinates of your OpenGL shapes in a counterclockwise drawing order.</p>
+
+<p class="note"><strong>Note:</strong> It is possible to set an OpenGL environment to treat the
+clockwise face as the front face, but doing so requires more code and is likely to confuse
+experienced OpenGL developers when you ask them for help. So don’t do that.</p>
<h2 id="compatibility">OpenGL Versions and Device Compatibility</h2>
@@ -410,7 +443,8 @@
href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/CompressedTextureActivity.html"
>CompressedTextureActivity</a> code sample.</p>
-<p>To check if the ETC1 format is supported on a device, call the {@link
+<p>The ETC format is supported by most Android devices, but it not guarranteed to be available. To
+check if the ETC1 format is supported on a device, call the {@link
android.opengl.ETC1Util#isETC1Supported() ETC1Util.isETC1Supported()} method.</p>
<p class="note"><b>Note:</b> The ETC1 texture compression format does not support textures with an
diff --git a/docs/html/guide/topics/graphics/overview.jd b/docs/html/guide/topics/graphics/overview.jd
new file mode 100644
index 0000000..a53cd3f
--- /dev/null
+++ b/docs/html/guide/topics/graphics/overview.jd
@@ -0,0 +1,73 @@
+page.title=Animation and Graphics Overview
+@jd:body
+
+ <p>Android provides a variety of powerful APIs for applying animation to UI elements and drawing custom
+ 2D and 3D graphics. The sections below provide an overview of the APIs and system capabilities available
+ and help you decide with approach is best for your needs.</p>
+
+ <h3 id="animation">Animation</h3>
+
+ <p>The Android framework provides two animation systems: property animation
+ (introduced in Android 3.0) and view animation. Both animation systems are viable options,
+ but the property animation system, in general, is the preferred method to use, because it
+ is more flexible and offers more features. In addition to these two systems, you can utilize Drawable
+ animation, which allows you to load drawable resources and display them one frame after
+ another.</p>
+
+<dl>
+<dt><strong><a href="{@docRoot}guide/topics/graphics/prop-animation.html">Property
+Animation</a></strong></dt>
+<dd>Introduced in Android 3.0 (API level 11), the property animation system lets you
+animate properties of any object, including ones that are not rendered to the screen. The system is
+extensible and lets you animate properties of custom types as well.</dd>
+
+<dt><strong><a href="{@docRoot}guide/topics/graphics/view-animation.html">View
+Animation</a></strong></dt>
+<dd>View Animation is the older system and can only be used for Views. It is relatively easy to
+setup and offers enough capabilities to meet many application's needs.</dd>
+</dl>
+
+<dt><strong><a href="{@docRoot}guide/topics/graphics/drawable-animation.html">Drawable
+Animation</a></strong></dt>
+<dd>Drawable animation involves displaying {@link android.graphics.drawable.Drawable} resources one
+after another, like a roll of film. This method of animation is useful if you want to animate
+things that are easier to represent with Drawable resources, such as a progression of bitmaps.</dd>
+
+<h3 id="graphics">2D and 3D Graphics</h3>
+
+<p>When writing an application, it's important to consider exactly what your graphical demands will be.
+Varying graphical tasks are best accomplished with varying techniques. For example, graphics and animations
+for a rather static application should be implemented much differently than graphics and animations
+for an interactive game. Here, we'll discuss a few of the options you have for drawing graphics
+on Android and which tasks they're best suited for.
+</p>
+
+<dl>
+<dt><strong><a href="{@docRoot}guide/topics/graphics/2d-graphics.html">Canvas and
+Drawables</a></strong></dt>
+<dd>Android provides a set of {@link android.view.View} widgets that provide general functionality
+for a wide array of user interfaces. You can also extend these widgets to modify the way they
+look or behave. In addition, you can do your own custom 2D rendering using the various drawing
+methods contained in the {@link android.graphics.Canvas} class or create {@link
+android.graphics.drawable.Drawable} objects for things such as textured buttons or frame-by-frame
+animations.</dd>
+
+<dt><strong><a href="{@docRoot}guide/topics/graphics/hardware-accel.html">Hardware
+Acceleration</a></strong></dt>
+<dd>Beginning in Android 3.0, you can hardware accelerate the majority of
+the drawing done by the Canvas APIs to further increase their performance.</dd>
+
+<dt><strong><a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL</a></strong></dt>
+<dd>Android supports OpenGL ES 1.0 and 2.0, with Android framework APIs as well as natively
+with the Native Development Kit (NDK). Using the framework APIs is desireable when you want to add a
+few graphical enhancements to your application that are not supported with the Canvas APIs, or if
+you desire platform independence and don't demand high performance. There is a performance hit in
+using the framework APIs compared to the NDK, so for many graphic intensive applications such as
+games, using the NDK is beneficial (It is important to note though that you can still get adequate
+performance using the framework APIs. For example, the Google Body app is developed entirely
+using the framework APIs). OpenGL with the NDK is also useful if you have a lot of native
+code that you want to port over to Android. For more information about using the NDK, read the
+docs in the <code>docs/</code> directory of the <a href="{@docRoot}tools/sdk/ndk/index.html">NDK
+download.</a></dd>
+</dl>
+
diff --git a/docs/html/guide/topics/graphics/prop-animation.jd b/docs/html/guide/topics/graphics/prop-animation.jd
index be24788..b733624 100644
--- a/docs/html/guide/topics/graphics/prop-animation.jd
+++ b/docs/html/guide/topics/graphics/prop-animation.jd
@@ -166,6 +166,31 @@
"{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/animation/index.html">API
Demos</a> sample project provides many examples on how to use the property
animation system.</p>
+
+ <h2 id="property-vs-view">How Property Animation Differs from View Animation</h2>
+
+ <p>The view animation system provides the capability to only animate {@link android.view.View}
+ objects, so if you wanted to animate non-{@link android.view.View} objects, you have to implement
+ your own code to do so. The view animation system is also constrained in the fact that it only
+ exposes a few aspects of a {@link android.view.View} object to animate, such as the scaling and
+ rotation of a View but not the background color, for instance.</p>
+
+ <p>Another disadvantage of the view animation system is that it only modified where the
+ View was drawn, and not the actual View itself. For instance, if you animated a button to move
+ across the screen, the button draws correctly, but the actual location where you can click the
+ button does not change, so you have to implement your own logic to handle this.</p>
+
+ <p>With the property animation system, these constraints are completely removed, and you can animate
+ any property of any object (Views and non-Views) and the object itself is actually modified.
+ The property animation system is also more robust in the way it carries out animation. At
+ a high level, you assign animators to the properties that you want to animate, such as color,
+ position, or size and can define aspects of the animation such as interpolation and
+ synchronization of multiple animators.</p>
+
+ <p>The view animation system, however, takes less time to setup and requires less code to write.
+ If view animation accomplishes everything that you need to do, or if your existing code already
+ works the way you want, there is no need to use the property animation system. It also might
+ make sense to use both animation systems for different situations if the use case arises.</p>
<h2>API Overview</h2>
diff --git a/docs/html/guide/topics/renderscript/compute.jd b/docs/html/guide/topics/graphics/renderscript/compute.jd
similarity index 100%
rename from docs/html/guide/topics/renderscript/compute.jd
rename to docs/html/guide/topics/graphics/renderscript/compute.jd
diff --git a/docs/html/guide/topics/graphics/renderscript/graphics.jd b/docs/html/guide/topics/graphics/renderscript/graphics.jd
new file mode 100644
index 0000000..58676ea
--- /dev/null
+++ b/docs/html/guide/topics/graphics/renderscript/graphics.jd
@@ -0,0 +1,994 @@
+page.title=Graphics
+parent.title=Renderscript
+parent.link=index.html
+
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li>
+ <a href="#creating-graphics-rs">Creating a Graphics Renderscript</a>
+ <ol>
+ <li><a href="#creating-native">Creating the Renderscript file</a></li>
+ <li><a href="#creating-entry">Creating the Renderscript entry point class</a></li>
+ <li><a href="#creating-view">Creating the view class</a></li>
+ <li><a href="#creating-activity">Creating the activity class</a></li>
+ </ol>
+ </li>
+ <li>
+ <a href="#drawing">Drawing</a>
+ <ol>
+ <li><a href="#drawing-rsg">Simple drawing</a></li>
+ <li><a href="#drawing-mesh">Drawing with a mesh</a></li>
+ </ol>
+ </li>
+ <li>
+ <a href="#shaders">Shaders</a>
+ <ol>
+ <li><a href="#shader-bindings">Shader bindings</a></li>
+ <li><a href="#shader-sampler">Defining a sampler</a></li>
+ </ol>
+ </li>
+ <li>
+ <a href="#fbo">Rendering to a Framebuffer Object</a>
+ </li>
+ </ol>
+
+ <h2>Related Samples</h2>
+
+ <ol>
+ <li><a href="{@docRoot}resources/samples/RenderScript/Balls/index.html">Balls</a></li>
+
+ <li><a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Fountain</a></li>
+
+ <li><a href="{@docRoot}resources/samples/RenderScript/FountainFbo/index.html">FountainFbo</a></li>
+
+ <li><a href="{@docRoot}resources/samples/RenderScript/HelloWorld/index.html">Hello
+World</a></li>
+
+ <li><a
+href="{@docRoot}resources/samples/RenderScript/MiscSamples/index.html">Misc Samples</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>Renderscript provides a number of graphics APIs for rendering, both at the Android
+ framework level as well as at the Renderscript runtime level. For instance, the Android framework APIs let you
+ create meshes and define shaders to customize the graphical rendering pipeline. The native
+ Renderscript graphics APIs let you draw the actual meshes to render your scene. You need to
+ be familiar with both APIs to appropriately render graphics on an Android-powered device.</p>
+
+ <h2 id="creating-graphics-rs">Creating a Graphics Renderscript</h2>
+
+ <p>Renderscript applications require various layers of code, so it is useful to create the following
+ files to help keep your application organized:</p>
+
+ <dl>
+ <dt>The Renderscript <code>.rs</code> file</dt>
+
+ <dd>This file contains the logic to do the graphics rendering.</dd>
+
+ <dt>The Renderscript entry point <code>.java</code> class</dt>
+
+ <dd>This class allows the view class to interact with the code defined in the <code>.rs</code>
+ file. This class contains a Renderscript object (instance of
+ <code>ScriptC_<em>renderscript_file</em></code>), which allows your Android framework code to
+ call the Renderscript code. In general, this class does much of the setup for Renderscript
+ such as shader and mesh building and memory allocation and binding. The SDK samples follow the
+ convention of naming this file ActivityRS.java,
+ where Activity is the name of your main activity class.</dd>
+
+ <dt>The view <code>.java</code> class</dt>
+
+ <dd>This class extends {@link android.renderscript.RSSurfaceView} or {@link
+ android.renderscript.RSTextureView} to provide a surface to render on. A {@link
+ android.renderscript.RSSurfaceView} consumes a whole window, but a {@link
+ android.renderscript.RSTextureView} allows you to draw Renderscript graphics inside of a
+ view and add it to a {@link android.view.ViewGroup} alongside
+ other views. In this class, you create a {@link android.renderscript.RenderScriptGL} context object
+ with a call to {@link android.renderscript.RSSurfaceView#createRenderScriptGL
+ RSSurfaceView.createRenderscriptGL()} or {@link android.renderscript.RSTextureView#createRenderScriptGL
+ RSTextureView.createRenderscriptGL()}. The {@link android.renderscript.RenderScriptGL} context object
+ contains information about the current rendering state of Renderscript such as the vertex and
+ fragment shaders. You pass this context object to the Renderscript entry point class, so that
+ class can modify the rendering context if needed and bind the Renderscript code to the context. Once bound,
+ the view class can use the Renderscript code to display graphics.
+ The view class should also implement callbacks for events inherited from {@link
+ android.view.View}, such as {@link android.view.View#onTouchEvent onTouchEvent()} and {@link
+ android.view.View#onKeyDown onKeyDown()} if you want to detect these types of user interactions.
+ The SDK samples follow the convention of naming this file ActivityView.java,
+ where Activity is the name of your main activity class</dd>
+
+ <dt>The activity <code>.java</code> class</dt>
+
+ <dd>This class is the main activity class and sets your {@link android.renderscript.RSSurfaceView} as the main content
+ view for this activity or uses the {@link android.renderscript.RSTextureView} alongside other views.</dd>
+ </dl>
+ <p>Figure 1 describes how these classes interact with one another in a graphics Renderscript:</p>
+
+ <img src="{@docRoot}images/rs_graphics.png">
+ <p class="img-caption"><strong>Figure 1.</strong> Graphics Renderscript overview</p>
+
+
+ <p>The following sections describe how to create an application that uses a graphics Renderscript by using
+ the <a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Renderscript Fountain
+ sample</a> that is provided in the SDK as a guide (some code has been modified from its original
+ form for simplicity).</p>
+
+ <h3 id="creating-native">Creating the Renderscript file</h3>
+
+ <p>Your Renderscript code resides in <code>.rs</code> and <code>.rsh</code> (headers) files in the
+ <code><project_root>/src/</code> directory. This code contains the logic to render your
+ graphics and declares all other necessary items such as variables, structs,
+ and pointers. Every graphics <code>.rs</code> file generally contains the following items:</p>
+
+ <ul>
+ <li>A pragma declaration (<code>#pragma rs java_package_name(<em>package.name</em>)</code>) that declares
+ the package name of the <code>.java</code> reflection of this Renderscript.</li>
+
+ <li>A pragma declaration (<code>#pragma version(1)</code>) that declares the version of Renderscript that
+ you are using (1 is the only value for now).</li>
+
+ <li>A <code>#include "rs_graphics.rsh"</code> declaration.</li>
+
+ <li>A <code>root()</code> function. This is the main worker function for your Renderscript and
+ calls Renderscript graphics functions to render scenes. This function is called every time a
+ frame refresh occurs, which is specified as its return value. A <code>0</code> (zero) specified for
+ the return value says to only render the frame when a property of the scene that you are
+ rendering changes. A non-zero positive integer specifies the refresh rate of the frame in
+ milliseconds.
+
+ <p class="note"><strong>Note:</strong> The Renderscript runtime makes its best effort to
+ refresh the frame at the specified rate. For example, if you are creating a live wallpaper
+ and set the return value to 20, the Renderscript runtime renders the wallpaper at 50fps if it has just
+ enough or more resources to do so. It renders as fast as it can if not enough resources
+ are available.</p>
+
+ <p>For more information on using the Renderscript graphics functions, see the <a href=
+ "#drawing">Drawing</a> section.</p>
+ </li>
+
+ <li>An <code>init()</code> function. This allows you to do initialization of your
+ Renderscript before the <code>root()</code> function runs, such as assigning values to variables. This
+ function runs once and is called automatically when the Renderscript starts, before anything
+ else in your Renderscript. Creating this function is optional.</li>
+
+ <li>Any variables, pointers, and structures that you wish to use in your Renderscript code (can
+ be declared in <code>.rsh</code> files if desired)</li>
+ </ul>
+
+ <p>The following code shows how the <code>fountain.rs</code> file is implemented:</p>
+ <pre>
+#pragma version(1)
+
+// Tell which java package name the reflected files should belong to
+#pragma rs java_package_name(com.example.android.rs.fountain)
+
+//declare shader binding
+#pragma stateFragment(parent)
+
+// header with graphics APIs, must include explicitly
+#include "rs_graphics.rsh"
+
+static int newPart = 0;
+
+// the mesh to render
+rs_mesh partMesh;
+
+// the point representing where a particle is rendered
+typedef struct __attribute__((packed, aligned(4))) Point {
+ float2 delta;
+ float2 position;
+ uchar4 color;
+} Point_t;
+Point_t *point;
+
+// main worker function that renders particles onto the screen
+int root() {
+ float dt = min(rsGetDt(), 0.1f);
+ rsgClearColor(0.f, 0.f, 0.f, 1.f);
+ const float height = rsgGetHeight();
+ const int size = rsAllocationGetDimX(rsGetAllocation(point));
+ float dy2 = dt * (10.f);
+ Point_t * p = point;
+ for (int ct=0; ct < size; ct++) {
+ p->delta.y += dy2;
+ p->position += p->delta;
+ if ((p->position.y > height) && (p->delta.y > 0)) {
+ p->delta.y *= -0.3f;
+ }
+ p++;
+ }
+
+ rsgDrawMesh(partMesh);
+ return 1;
+}
+
+// adds particles to the screen to render
+static float4 partColor[10];
+void addParticles(int rate, float x, float y, int index, bool newColor)
+{
+ if (newColor) {
+ partColor[index].x = rsRand(0.5f, 1.0f);
+ partColor[index].y = rsRand(1.0f);
+ partColor[index].z = rsRand(1.0f);
+ }
+ float rMax = ((float)rate) * 0.02f;
+ int size = rsAllocationGetDimX(rsGetAllocation(point));
+ uchar4 c = rsPackColorTo8888(partColor[index]);
+
+ Point_t * np = &point[newPart];
+ float2 p = {x, y};
+ while (rate--) {
+ float angle = rsRand(3.14f * 2.f);
+ float len = rsRand(rMax);
+ np->delta.x = len * sin(angle);
+ np->delta.y = len * cos(angle);
+ np->position = p;
+ np->color = c;
+ newPart++;
+ np++;
+ if (newPart >= size) {
+ newPart = 0;
+ np = &point[newPart];
+ }
+ }
+}
+</pre>
+
+ <h3 id="creating-entry">Creating the Renderscript entry point class</h3>
+
+ <p>When you create a Renderscript (<code>.rs</code>) file, it is helpful to create a
+ corresponding Android framework class that is an entry point into the <code>.rs</code> file.
+ The most important thing this class does is receive a {@link android.renderscript.RenderScriptGL} rendering context
+ object from the <a href="#creating-view">view class</a> and binds the actual Renderscript
+ code to the rendering context. This notifies your view class of the code that it needs
+ to render graphics.
+ </p>
+
+ <p>In addition, this class should contain all of the things needed to set up Renderscript.
+ Some important things that you need to do in this class are:</p>
+
+ <ul>
+ <li>Create a Renderscript object
+ <code>ScriptC_<em>rs_filename</em></code>. The Renderscript object is attached to the Renderscript bytecode, which is platform-independent and
+ gets compiled on the device when the Renderscript application runs. The bytecode is referenced
+ as a raw resource and is passed into the constructor for the Renderscript object.
+ For example, this is how the <a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Fountain</a>
+ sample creates the Renderscript object:
+ <pre>
+ RenderScriptGL rs; //obtained from the view class
+ Resources res; //obtained from the view class
+ ...
+ ScriptC_fountain mScript = new ScriptC_fountain(mRS, mRes, R.raw.fountain);
+ </pre>
+ </li>
+ <li>Allocate any necessary memory and bind it to your Renderscript code via the Renderscript object.</li>
+ <li>Build any necessary meshes and bind them to the Renderscript code via the Renderscript object.</li>
+ <li>Create any necessary programs and bind them to the Renderscript code via the Renderscript object.</li>
+ </ul>
+
+ <p>The following code shows how the <a href=
+ "{@docRoot}resources/samples/RenderScript/Fountain/src/com/example/android/rs/fountain/FountainRS.html">
+ FountainRS</a> class is implemented:</p>
+ <pre>
+package com.example.android.rs.fountain;
+
+import android.content.res.Resources;
+import android.renderscript.*;
+import android.util.Log;
+
+public class FountainRS {
+ public static final int PART_COUNT = 50000;
+
+ public FountainRS() {
+ }
+
+ /**
+ * This provides us with the Renderscript context and resources
+ * that allow us to create the Renderscript object
+ */
+ private Resources mRes;
+ private RenderScriptGL mRS;
+
+ // Renderscript object
+ private ScriptC_fountain mScript;
+
+ // Called by the view class to initialize the Renderscript context and renderer
+ public void init(RenderScriptGL rs, Resources res) {
+ mRS = rs;
+ mRes = res;
+
+ /**
+ * Create a shader and bind to the Renderscript context
+ */
+ ProgramFragmentFixedFunction.Builder pfb = new ProgramFragmentFixedFunction.Builder(rs);
+ pfb.setVaryingColor(true);
+ rs.bindProgramFragment(pfb.create());
+
+ /**
+ * Allocate memory for the particles to render and create the mesh to draw
+ */
+ ScriptField_Point points = new ScriptField_Point(mRS, PART_COUNT);
+ Mesh.AllocationBuilder smb = new Mesh.AllocationBuilder(mRS);
+ smb.addVertexAllocation(points.getAllocation());
+ smb.addIndexSetType(Mesh.Primitive.POINT);
+ Mesh sm = smb.create();
+
+ /**
+ * Create and bind the Renderscript object to the Renderscript context
+ */
+ mScript = new ScriptC_fountain(mRS, mRes, R.raw.fountain);
+ mScript.set_partMesh(sm);
+ mScript.bind_point(points);
+ mRS.bindRootScript(mScript);
+ }
+
+ boolean holdingColor[] = new boolean[10];
+
+ /**
+ * Calls Renderscript functions (invoke_addParticles)
+ * via the Renderscript object to add particles to render
+ * based on where a user touches the screen.
+ */
+ public void newTouchPosition(float x, float y, float pressure, int id) {
+ if (id >= holdingColor.length) {
+ return;
+ }
+ int rate = (int)(pressure * pressure * 500.f);
+ if (rate > 500) {
+ rate = 500;
+ }
+ if (rate > 0) {
+ mScript.invoke_addParticles(rate, x, y, id, !holdingColor[id]);
+ holdingColor[id] = true;
+ } else {
+ holdingColor[id] = false;
+ }
+
+ }
+}
+</pre>
+
+
+ <h3 id="creating-view">Creating the view class</h3>
+
+
+ <p>To display graphics, you need a view to render on. Create a class that extends {@link
+ android.renderscript.RSSurfaceView} or {@link android.renderscript.RSTextureView}. This class
+ allows you to create a {@link android.renderscript.RenderScriptGL} context object by calling and
+ pass it to the Rendscript entry point class to bind the two. Once bound, the content is aware
+ of the code that it needs to use to render graphics with. If your Renderscript code
+ depends on any type of information that the view is aware of, such as touches from the user,
+ you can also use this class to relay that information to the Renderscript entry point class.
+ The following code shows how the <code>FountainView</code> class is implemented:</p>
+ <pre>
+package com.example.android.rs.fountain;
+
+import android.renderscript.RSTextureView;
+import android.renderscript.RenderScriptGL;
+import android.content.Context;
+import android.view.MotionEvent;
+
+public class FountainView extends RSTextureView {
+
+ public FountainView(Context context) {
+ super(context);
+ }
+ // Renderscript context
+ private RenderScriptGL mRS;
+ // Renderscript entry point object that calls Renderscript code
+ private FountainRS mRender;
+
+ /**
+ * Create Renderscript context and initialize Renderscript entry point
+ */
+ @Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ android.util.Log.e("rs", "onAttachedToWindow");
+ if (mRS == null) {
+ RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
+ mRS = createRenderScriptGL(sc);
+ mRender = new FountainRS();
+ mRender.init(mRS, getResources());
+ }
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+ android.util.Log.e("rs", "onDetachedFromWindow");
+ if (mRS != null) {
+ mRS = null;
+ destroyRenderScriptGL();
+ }
+ }
+
+
+ /**
+ * Use callbacks to relay data to Renderscript entry point class
+ */
+ @Override
+ public boolean onTouchEvent(MotionEvent ev)
+ {
+ int act = ev.getActionMasked();
+ if (act == ev.ACTION_UP) {
+ mRender.newTouchPosition(0, 0, 0, ev.getPointerId(0));
+ return false;
+ } else if (act == MotionEvent.ACTION_POINTER_UP) {
+ // only one pointer going up, we can get the index like this
+ int pointerIndex = ev.getActionIndex();
+ int pointerId = ev.getPointerId(pointerIndex);
+ mRender.newTouchPosition(0, 0, 0, pointerId);
+ }
+ int count = ev.getHistorySize();
+ int pcount = ev.getPointerCount();
+
+ for (int p=0; p < pcount; p++) {
+ int id = ev.getPointerId(p);
+ mRender.newTouchPosition(ev.getX(p),
+ ev.getY(p),
+ ev.getPressure(p),
+ id);
+
+ for (int i=0; i < count; i++) {
+ mRender.newTouchPosition(ev.getHistoricalX(p, i),
+ ev.getHistoricalY(p, i),
+ ev.getHistoricalPressure(p, i),
+ id);
+ }
+ }
+ return true;
+ }
+}
+</pre>
+
+ <h3 id="creating-activity">Creating the activity class</h3>
+
+ <p>Applications that use Renderscript still behave like normal Android applications, so you
+ need an activity class that handles activity lifecycle callback events appropriately. The activity class
+ also sets your {@link android.renderscript.RSSurfaceView} view class to be the main content view of the
+ activity or uses your {@link android.renderscript.RSTextureView}
+ in a {@link android.view.ViewGroup} alongside other views.</p>
+
+ <p>The following code shows how the <a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Fountain</a>
+ sample declares its activity class:</p>
+ <pre>
+package com.example.android.rs.fountain;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.util.Log;
+
+public class Fountain extends Activity {
+
+ private static final String LOG_TAG = "libRS_jni";
+ private static final boolean DEBUG = false;
+ private static final boolean LOG_ENABLED = false;
+
+ private FountainView mView;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ // Create our Preview view and set it as
+ // the content of our activity
+ mView = new FountainView(this);
+ setContentView(mView);
+ }
+
+ @Override
+ protected void onResume() {
+ Log.e("rs", "onResume");
+
+ // Ideally a game should implement onResume() and onPause()
+ // to take appropriate action when the activity looses focus
+ super.onResume();
+ mView.resume();
+ }
+
+ @Override
+ protected void onPause() {
+ Log.e("rs", "onPause");
+
+ // Ideally a game should implement onResume() and onPause()
+ // to take appropriate action when the activity looses focus
+ super.onPause();
+ mView.pause();
+
+ }
+
+ static void log(String message) {
+ if (LOG_ENABLED) {
+ Log.v(LOG_TAG, message);
+ }
+ }
+}
+</pre>
+
+<p>Now that you have an idea of what is involved in a Renderscript graphics application, you can
+start building your own. It might be easiest to begin with one of the
+<a href="{@docRoot}resources/samples/RenderScript/index.html">Renderscript samples</a> as a starting
+point if this is your first time using Renderscript.</p>
+
+ <h2 id="drawing">Drawing</h2>
+ <p>The following sections describe how to use the graphics functions to draw with Renderscript.</p>
+
+ <h3 id="drawing-rsg">Simple drawing</h3>
+
+ <p>The native Renderscript APIs provide a few convenient functions to easily draw a polygon or text to
+ the screen. You call these in your <code>root()</code> function to have them render to the {@link
+ android.renderscript.RSSurfaceView} or {@link android.renderscript.RSTextureView}. These functions are
+ available for simple drawing and should not be used for complex graphics rendering:</p>
+
+ <ul>
+ <li><code>rsgDrawRect()</code>: Sets up a mesh and draws a rectangle to the screen. It uses the
+ top left vertex and bottom right vertex of the rectangle to draw.</li>
+
+ <li><code>rsgDrawQuad()</code>: Sets up a mesh and draws a quadrilateral to the screen.</li>
+
+ <li><code>rsgDrawQuadTexCoords()</code>: Sets up a mesh and draws a quadrilateral to the screen
+ using the provided coordinates of a texture.</li>
+
+ <li><code>rsgDrawText()</code>: Draws specified text to the screen. Use <code>rsgFontColor()</code>
+ to set the color of the text.</li>
+ </ul>
+
+ <h3 id="drawing-mesh">Drawing with a mesh</h3>
+
+ <p>When you want to render complex scenes to the screen, instantiate a {@link
+ android.renderscript.Mesh} and draw it with <code>rsgDrawMesh()</code>. A {@link
+ android.renderscript.Mesh} is a collection of allocations that represent vertex data (positions,
+ normals, texture coordinates) and index data that provides information on how to draw triangles
+ and lines with the provided vertex data. You can build a Mesh in three different ways:</p>
+
+ <ul>
+ <li>Build the mesh with the {@link android.renderscript.Mesh.TriangleMeshBuilder} class, which
+ allows you to specify a set of vertices and indices for each triangle that you want to draw.</li>
+
+ <li>Build the mesh using an {@link android.renderscript.Allocation} or a set of {@link
+ android.renderscript.Allocation}s with the {@link android.renderscript.Mesh.AllocationBuilder}
+ class. This approach allows you to build a mesh with vertices already stored in memory, which allows you
+ to specify the vertices in Renderscript or Android framework code.</li>
+
+ <li>Build the mesh with the {@link android.renderscript.Mesh.Builder} class. You should use
+ this convenience method when you know the data types you want to use to build your mesh, but
+ don't want to make separate memory allocations like with {@link
+ android.renderscript.Mesh.AllocationBuilder}. You can specify the types that you want and this
+ mesh builder automatically creates the memory allocations for you.</li>
+ </ul>
+
+ <p>To create a mesh using the {@link android.renderscript.Mesh.TriangleMeshBuilder}, you need to
+ supply it with a set of vertices and the indices for the vertices that comprise the triangle. For
+ example, the following code specifies three vertices, which are added to an internal array,
+ indexed in the order they were added. The call to {@link
+ android.renderscript.Mesh.TriangleMeshBuilder#addTriangle addTriangle()} draws the triangle with
+ vertex 0, 1, and 2 (the vertices are drawn counter-clockwise).</p>
+ <pre>
+int float2VtxSize = 2;
+Mesh.TriangleMeshBuilder triangles = new Mesh.TriangleMeshBuilder(renderscriptGL,
+float2VtxSize, Mesh.TriangleMeshBuilder.COLOR);
+triangles.addVertex(300.f, 300.f);
+triangles.addVertex(150.f, 450.f);
+triangles.addVertex(450.f, 450.f);
+triangles.addTriangle(0 , 1, 2);
+Mesh smP = triangle.create(true);
+script.set_mesh(smP);
+</pre>
+
+ <p>To draw a mesh using the {@link android.renderscript.Mesh.AllocationBuilder}, you need to
+ supply it with one or more allocations that contain the vertex data:</p>
+ <pre>
+Allocation vertices;
+
+...
+Mesh.AllocationBuilder triangle = new Mesh.AllocationBuilder(mRS);
+smb.addVertexAllocation(vertices.getAllocation());
+smb.addIndexSetType(Mesh.Primitive.TRIANGLE);
+Mesh smP = smb.create();
+script.set_mesh(smP);
+</pre>
+
+ <p>In your Renderscript code, draw the built mesh to the screen:</p>
+ <pre>
+rs_mesh mesh;
+...
+
+int root(){
+...
+rsgDrawMesh(mesh);
+...
+return 0; //specify a non zero, positive integer to specify the frame refresh.
+ //0 refreshes the frame only when the mesh changes.
+}
+</pre>
+
+ <h2 id="shader">Programs</h2>
+
+ <p>You can attach four program objects to the {@link android.renderscript.RenderScriptGL} context
+ to customize the rendering pipeline. For example, you can create vertex and fragment shaders in
+ GLSL or build a raster program object that controls culling. The four programs mirror a
+ traditional graphical rendering pipeline:</p>
+
+ <table>
+ <tr>
+ <th>Android Object Type</th>
+
+ <th>Renderscript Native Type</th>
+
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>{@link android.renderscript.ProgramVertex}</td>
+
+ <td>rs_program_vertex</td>
+
+ <td>
+ <p>The Renderscript vertex program, also known as a vertex shader, describes the stage in
+ the graphics pipeline responsible for manipulating geometric data in a user-defined way.
+ The object is constructed by providing Renderscript with the following data:</p>
+
+ <ul>
+ <li>An {@link android.renderscript.Element} describing its varying inputs or attributes</li>
+
+ <li>GLSL shader string that defines the body of the program</li>
+
+ <li>a {@link android.renderscript.Type} that describes the layout of an
+ Allocation containing constant or uniform inputs</li>
+ </ul>
+
+ <p>Once the program is created, bind it to the {@link android.renderscript.RenderScriptGL}
+ graphics context by calling {@link android.renderscript.RenderScriptGL#bindProgramVertex
+ bindProgramVertex()}. It is then used for all subsequent draw calls until you bind a new
+ program. If the program has constant inputs, the user needs to bind an allocation
+ containing those inputs. The allocation's type must match the one provided during creation.
+ </p>
+
+ <p>The Renderscript runtime then does all the necessary plumbing to send those constants to
+ the graphics hardware. Varying inputs to the shader, such as position, normal, and texture
+ coordinates are matched by name between the input {@link android.renderscript.Element}
+ and the mesh object that is being drawn. The signatures don't have to be exact or in any
+ strict order. As long as the input name in the shader matches a channel name and size
+ available on the mesh, the Renderscript runtime handles connecting the two. Unlike OpenGL
+ there is no need to link the vertex and fragment programs.</p>
+
+ <p>To bind shader constants to the program, declare a <code>struct</code> that contains the necessary
+ shader constants in your Renderscript code. This <code>struct</code> is generated into a
+ reflected class that you can use as a constant input element during the program's creation.
+ It is an easy way to create an instance of this <code>struct</code> as an allocation. You would then
+ bind this {@link android.renderscript.Allocation} to the program and the
+ Renderscript runtime sends the data that is contained in the <code>struct</code> to the hardware
+ when necessary. To update shader constants, you change the values in the
+ {@link android.renderscript.Allocation} and notify the Renderscript
+ code of the change.</p>
+
+ <p>The {@link android.renderscript.ProgramVertexFixedFunction.Builder} class also
+ lets you build a simple vertex shader without writing GLSL code.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td>{@link android.renderscript.ProgramFragment}</td>
+
+ <td>rs_program_fragment</td>
+
+ <td>
+ <p>The Renderscript fragment program, also known as a fragment shader, is responsible for
+ manipulating pixel data in a user-defined way. It's constructed from a GLSL shader string
+ containing the program body, texture inputs, and a {@link android.renderscript.Type}
+ object that describes the constants
+ used by the program. Like the vertex programs, when an {@link android.renderscript.Allocation}
+ with constant input
+ values is bound to the shader, its values are sent to the graphics program automatically.
+ Note that the values inside the {@link android.renderscript.Allocation} are not explicitly tracked.
+ If they change between two draw calls using the same program object, notify the runtime of that change by
+ calling <code>rsgAllocationSyncAll()</code>, so it can send the new values to hardware. Communication
+ between the vertex and fragment programs is handled internally in the GLSL code. For
+ example, if the fragment program is expecting a varying input called <code>varTex0</code>, the GLSL code
+ inside the program vertex must provide it.</p>
+
+ <p>To bind shader constructs to the program, declare a <code>struct</code> that contains the necessary
+ shader constants in your Renderscript code. This <code>struct</code> is generated into a
+ reflected class that you can use as a constant input element during the program's creation.
+ It is an easy way to create an instance of this <code>struct</code> as an allocation. You would then
+ bind this {@link android.renderscript.Allocation} to the program and the
+ Renderscript runtime sends the data that is contained in the <code>struct</code> to the hardware
+ when necessary. To update shader constants, you change the values in the
+ {@link android.renderscript.Allocation} and notify the Renderscript
+ code of the change.</p>
+
+ <p>The {@link android.renderscript.ProgramFragmentFixedFunction.Builder} class also
+ lets you build a simple fragment shader without writing GLSL code.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td>{@link android.renderscript.ProgramStore}</td>
+
+ <td>rs_program_store</td>
+
+ <td>The Renderscript store program contains a set of parameters that control how the graphics
+ hardware writes to the framebuffer. It could be used to enable and disable depth writes and
+ testing, setup various blending modes for effects like transparency and define write masks
+ for color components.</td>
+ </tr>
+
+ <tr>
+ <td>{@link android.renderscript.ProgramRaster}</td>
+
+ <td>rs_program_raster</td>
+
+ <td>The Renderscript raster program is primarily used to specify whether point sprites are enabled and to
+ control the culling mode. By default back faces are culled.</td>
+ </tr>
+ </table>
+
+ <p>The following example defines a vertex shader in GLSL and binds it to a Renderscript context object:</p>
+ <pre>
+ private RenderScriptGL glRenderer; //rendering context
+ private ScriptField_Point mPoints; //vertices
+ private ScriptField_VpConsts mVpConsts; //shader constants
+
+ ...
+
+ ProgramVertex.Builder sb = new ProgramVertex.Builder(glRenderer);
+ String t = "varying vec4 varColor;\n" +
+ "void main() {\n" +
+ " vec4 pos = vec4(0.0, 0.0, 0.0, 1.0);\n" +
+ " pos.xy = ATTRIB_position;\n" +
+ " gl_Position = UNI_MVP * pos;\n" +
+ " varColor = vec4(1.0, 1.0, 1.0, 1.0);\n" +
+ " gl_PointSize = ATTRIB_size;\n" +
+ "}\n";
+ sb.setShader(t);
+ sb.addConstant(mVpConsts.getType());
+ sb.addInput(mPoints.getElement());
+ ProgramVertex pvs = sb.create();
+ pvs.bindConstants(mVpConsts.getAllocation(), 0);
+ glRenderer.bindProgramVertex(pvs);
+</pre>
+
+
+ <p>The <a href=
+ "{@docRoot}resources/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/RsRenderStatesRS.html">
+ RsRenderStatesRS</a> sample has many examples on how to create a shader without writing GLSL.</p>
+
+ <h3 id="shader-bindings">Program bindings</h3>
+
+ <p>You can also declare four pragmas that control default program bindings to the {@link
+ android.renderscript.RenderScriptGL} context when the script is executing:</p>
+
+ <ul>
+ <li><code>stateVertex</code></li>
+
+ <li><code>stateFragment</code></li>
+
+ <li><code>stateRaster</code></li>
+
+ <li><code>stateStore</code></li>
+ </ul>
+
+ <p>The possible values for each pragma are <code>parent</code> or <code>default</code>. Using
+ <code>default</code> binds the shaders to the graphical context with the system defaults.</p>
+
+ <p>Using <code>parent</code> binds the shaders in the same manner as it is bound in the calling
+ script. If this is the root script, the parent state is taken from the bind points that are set
+ by the {@link android.renderscript.RenderScriptGL} bind methods.</p>
+
+ <p>For example, you can define this at the top of your graphics Renderscript code to have
+ the vertex and store programs inherent the bind properties from their parent scripts:</p>
+ <pre>
+#pragma stateVertex(parent)
+#pragma stateStore(parent)
+</pre>
+
+ <h3 id="shader-sampler">Defining a sampler</h3>
+
+ <p>A {@link android.renderscript.Sampler} object defines how data is extracted from textures.
+ Samplers are bound to a {@link android.renderscript.ProgramFragment} alongside the texture
+ whose sampling they control. These
+ objects are used to specify such things as edge clamping behavior, whether mip-maps are used, and
+ the amount of anisotropy required. There might be situations where hardware does not support the
+ desired behavior of the sampler. In these cases, the Renderscript runtime attempts to provide the
+ closest possible approximation. For example, the user requested 16x anisotropy, but only 8x was
+ set because it's the best available on the hardware.</p>
+
+ <p>The <a href=
+ "{@docRoot}resources/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/RsRenderStatesRS.html">
+ RsRenderStatesRS</a> sample has many examples on how to create a sampler and bind it to a
+ Fragment program.</p>
+
+
+
+<h2 id="fbo">Rendering to a Framebuffer Object</h2>
+
+<p>Framebuffer objects allow you to render offscreen instead of in the default onscreen
+framebuffer. This approach might be useful for situations where you need to post-process a texture before
+rendering it to the screen, or when you want to composite two scenes in one such as rendering a rear-view
+mirror of a car. There are two buffers associated with a framebuffer object: a color buffer
+and a depth buffer. The color buffer (required) contains the actual pixel data of the scene
+that you are rendering, and the depth buffer (optional) contains the values necessary to figure
+out what vertices are drawn depending on their z-values.</p>
+
+<p>In general, you need to do the following to render to a framebuffer object:</p>
+
+<ul>
+ <li>Create {@link android.renderscript.Allocation} objects for the color buffer and
+ depth buffer (if needed). Specify the {@link
+ android.renderscript.Allocation#USAGE_GRAPHICS_RENDER_TARGET} usage attribute for these
+ allocations to notify the Renderscript runtime to use these allocations for the framebuffer
+ object. For the color buffer allocation, you most likely need to declare the {@link
+ android.renderscript.Allocation#USAGE_GRAPHICS_TEXTURE} usage attribute
+ to use the color buffer as a texture, which is the most common use of the framebuffer object.</li>
+
+ <li>Tell the Renderscript runtime to render to the framebuffer object instead of the default
+ framebuffer by calling <code>rsgBindColorTarget()</code> and passing it the color buffer
+ allocation. If applicable, call <code>rsgBindDepthTarget()</code> passing in the depth buffer
+ allocation as well.</li>
+
+ <li>Render your scene normally with the <code>rsgDraw</code> functions. The scene will be
+ rendered into the color buffer instead of the default onscreen framebuffer.</li>
+
+ <li>When done, tell the Renderscript runtime stop rendering to the color buffer and back
+ to the default framebuffer by calling <code>rsgClearAllRenderTargets()</code>.</li>
+
+ <li>Create a fragment shader and bind a the color buffer to it as a texture.</li>
+
+ <li>Render your scene to the default framebuffer. The texture will be used according
+ to the way you setup your fragment shader.</li>
+</ul>
+
+<p>The following example shows you how to render to a framebuffer object by modifying the
+<a href="{@docRoot}guide/resources/renderscript/Fountain/">Fountain</a> Renderscript sample. The end
+result is the <a href="{@docRoot}guide/resources/renderscript/FountainFBO/">FountainFBO</a> sample.
+The modifications render the exact same scene into a framebuffer object as it does the default
+framebuffer. The framebuffer object is then rendered into the default framebuffer in a small
+area at the top left corner of the screen.</p>
+
+<ol>
+ <li>Modify <code>fountain.rs</code> and add the following global variables. This creates setter
+ methods when this file is reflected into a <code>.java</code> file, allowing you to allocate
+ memory in your Android framework code and binding it to the Renderscript runtime.
+<pre>
+//allocation for color buffer
+rs_allocation gColorBuffer;
+//fragment shader for rendering without a texture (used for rendering to framebuffer object)
+rs_program_fragment gProgramFragment;
+//fragment shader for rendering with a texture (used for rendering to default framebuffer)
+rs_program_fragment gTextureProgramFragment;
+</pre>
+ </li>
+
+ <li>Modify the root function of <code>fountain.rs</code> to look like the following code. The
+ modifications are commented:
+<pre>
+int root() {
+ float dt = min(rsGetDt(), 0.1f);
+ rsgClearColor(0.f, 0.f, 0.f, 1.f);
+ const float height = rsgGetHeight();
+ const int size = rsAllocationGetDimX(rsGetAllocation(point));
+ float dy2 = dt * (10.f);
+ Point_t * p = point;
+ for (int ct=0; ct < size; ct++) {
+ p->delta.y += dy2;
+ p->position += p->delta;
+ if ((p->position.y > height) && (p->delta.y > 0)) {
+ p->delta.y *= -0.3f;
+ }
+ p++;
+ }
+ //Tell Renderscript runtime to render to the frame buffer object
+ rsgBindColorTarget(gColorBuffer, 0);
+ //Begin rendering on a white background
+ rsgClearColor(1.f, 1.f, 1.f, 1.f);
+ rsgDrawMesh(partMesh);
+
+ //When done, tell Renderscript runtime to stop rendering to framebuffer object
+ rsgClearAllRenderTargets();
+
+ //Bind a new fragment shader that declares the framebuffer object to be used as a texture
+ rsgBindProgramFragment(gTextureProgramFragment);
+
+ //Bind the framebuffer object to the fragment shader at slot 0 as a texture
+ rsgBindTexture(gTextureProgramFragment, 0, gColorBuffer);
+ //Draw a quad using the framebuffer object as the texture
+ float startX = 10, startY = 10;
+ float s = 256;
+ rsgDrawQuadTexCoords(startX, startY, 0, 0, 1,
+ startX, startY + s, 0, 0, 0,
+ startX + s, startY + s, 0, 1, 0,
+ startX + s, startY, 0, 1, 1);
+
+ //Rebind the original fragment shader to render as normal
+ rsgBindProgramFragment(gProgramFragment);
+
+ //Render the main scene
+ rsgDrawMesh(partMesh);
+
+ return 1;
+}
+</pre>
+ </li>
+
+ <li>In the <code>FountainRS.java</code> file, modify the <code>init()</code> method to look
+ like the following code. The modifications are commented:
+
+<pre>
+/* Add necessary members */
+private ScriptC_fountainfbo mScript;
+private Allocation mColorBuffer;
+private ProgramFragment mProgramFragment;
+private ProgramFragment mTextureProgramFragment;
+
+public void init(RenderScriptGL rs, Resources res) {
+ mRS = rs;
+ mRes = res;
+
+ ScriptField_Point points = new ScriptField_Point(mRS, PART_COUNT);
+
+ Mesh.AllocationBuilder smb = new Mesh.AllocationBuilder(mRS);
+ smb.addVertexAllocation(points.getAllocation());
+ smb.addIndexSetType(Mesh.Primitive.POINT);
+ Mesh sm = smb.create();
+
+ mScript = new ScriptC_fountainfbo(mRS, mRes, R.raw.fountainfbo);
+ mScript.set_partMesh(sm);
+ mScript.bind_point(points);
+
+ ProgramFragmentFixedFunction.Builder pfb = new ProgramFragmentFixedFunction.Builder(rs);
+ pfb.setVaryingColor(true);
+ mProgramFragment = pfb.create();
+ mScript.set_gProgramFragment(mProgramFragment);
+
+ /* Second fragment shader to use a texture (framebuffer object) to draw with */
+ pfb.setTexture(ProgramFragmentFixedFunction.Builder.EnvMode.REPLACE,
+ ProgramFragmentFixedFunction.Builder.Format.RGBA, 0);
+
+ /* Set the fragment shader in the Renderscript runtime */
+ mTextureProgramFragment = pfb.create();
+ mScript.set_gTextureProgramFragment(mTextureProgramFragment);
+
+ /* Create the allocation for the color buffer */
+ Type.Builder colorBuilder = new Type.Builder(mRS, Element.RGBA_8888(mRS));
+ colorBuilder.setX(256).setY(256);
+ mColorBuffer = Allocation.createTyped(mRS, colorBuilder.create(),
+ Allocation.USAGE_GRAPHICS_TEXTURE |
+ Allocation.USAGE_GRAPHICS_RENDER_TARGET);
+
+ /* Set the allocation in the Renderscript runtime */
+ mScript.set_gColorBuffer(mColorBuffer);
+
+ mRS.bindRootScript(mScript);
+}
+</pre>
+
+<p class="note"><strong>Note:</strong> This sample doesn't use a depth buffer, but the following code
+shows you how to declare an example depth buffer if you need to use
+one for your application. The depth buffer must have the same dimensions as the color buffer:
+
+<pre>
+Allocation mDepthBuffer;
+
+...
+
+Type.Builder b = new Type.Builder(mRS, Element.createPixel(mRS, DataType.UNSIGNED_16,
+ DataKind.PIXEL_DEPTH));
+b.setX(256).setY(256);
+mDepthBuffer = Allocation.createTyped(mRS, b.create(),
+Allocation.USAGE_GRAPHICS_RENDER_TARGET);
+
+</pre>
+</p>
+</li>
+
+ <li>Run and use the sample. The smaller, white quad on the top-left corner is using the
+ framebuffer object as a texture, which renders the same scene as the main rendering.</li>
+</ol>
diff --git a/docs/html/guide/topics/renderscript/index.jd b/docs/html/guide/topics/graphics/renderscript/index.jd
similarity index 100%
rename from docs/html/guide/topics/renderscript/index.jd
rename to docs/html/guide/topics/graphics/renderscript/index.jd
diff --git a/docs/html/guide/topics/renderscript/reference.jd b/docs/html/guide/topics/graphics/renderscript/reference.jd
similarity index 100%
rename from docs/html/guide/topics/renderscript/reference.jd
rename to docs/html/guide/topics/graphics/renderscript/reference.jd
diff --git a/docs/html/guide/topics/intents/index.html b/docs/html/guide/topics/intents/index.html
deleted file mode 100644
index b831246..0000000
--- a/docs/html/guide/topics/intents/index.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=intents-filters.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<a href="intents-filters.html">click here</a> if you are not redirected.
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/topics/location/index.jd b/docs/html/guide/topics/location/index.jd
index 8a2e9cd..54c034d 100644
--- a/docs/html/guide/topics/location/index.jd
+++ b/docs/html/guide/topics/location/index.jd
@@ -13,8 +13,7 @@
<h2>Topics</h2>
<ol>
- <li><a href="{@docRoot}guide/topics/location/obtaining-user-location.html">Obtaining User
-Location</a></li>
+ <li><a href="{@docRoot}guide/topics/location/strategies.html">Location Strategies</a></li>
</ol>
<h2>See Also</h2>
@@ -58,8 +57,7 @@
</ul>
<p>For more information, read the guide to <a
-href="{@docRoot}guide/topics/location/obtaining-user-location.html">Obtaining User
-Location</a>.</p>
+href="{@docRoot}guide/topics/location/strategies.html">Location Strategies</a>.</p>
<h2 id="maps">Google Maps External Library</h2>
@@ -98,8 +96,8 @@
href="http://code.google.com/android/add-ons/google-apis">http://code.google.com/android/add-ons/google-apis</a></p>
<p>For your convenience, the Google APIs add-on is also available as a downloadable component from
-the Android SDK Manager (see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>).</p>
+the Android SDK Manager (see <a href="{@docRoot}sdk/exploring.html">Exploring the
+SDK</a>).</p>
<p class="note"><strong>Note:</strong> In order to display Google Maps data in a
MapView, you must register with the Google Maps service and obtain a Maps API
diff --git a/docs/html/guide/topics/location/obtaining-user-location.jd b/docs/html/guide/topics/location/obtaining-user-location.jd
deleted file mode 100644
index 3b450f0..0000000
--- a/docs/html/guide/topics/location/obtaining-user-location.jd
+++ /dev/null
@@ -1,454 +0,0 @@
-page.title=Obtaining User Location
-parent.title=Location and Maps
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>Quickview</h2>
- <ul>
- <li>The Network Location Provider provides good location data without using GPS</li>
- <li>Obtaining user location can consume a lot of battery, so be careful how
-long you listen for updates</li>
- </ul>
- <h2>In this document</h2>
- <ol>
- <li><a href="#Challenges">Challenges in Determining User Location</a></li>
- <li><a href="#Updates">Requesting Location Updates</a>
- <ol>
- <li><a href="#Permission">Requesting User Permissions</a></li>
- </ol>
- </li>
- <li><a href="#BestPerformance">Defining a Model for the Best Performance</a>
- <ol>
- <li><a href="#Flow">Flow for obtaining user location</a></li>
- <li><a href="#StartListening">Deciding when to start listening for updates</a></li>
- <li><a href="#FastFix">Getting a fast fix with the last known location</a></li>
- <li><a href="#StopListening">Deciding when to stop listening for updates</a></li>
- <li><a href="#BestEstimate">Maintaining a current best estimate</a></li>
- <li><a href="#Adjusting">Adjusting the model to save battery and data exchange</a></li>
- </ol>
- </li>
- <li><a href="#MockData">Providing Mock Location Data</a></li>
- </ol>
- <h2>Key classes</h2>
- <ol>
- <li>{@link android.location.LocationManager}</li>
- <li>{@link android.location.LocationListener}</li>
- </ol>
-</div>
-</div>
-
- <p>Knowing where the user is allows your application to be smarter and deliver
-better information to the user. When developing a location-aware application for Android, you can
-utilize GPS and Android's Network Location Provider to acquire the user location. Although
-GPS is most accurate, it only works outdoors, it quickly consumes battery power, and doesn't return
-the location as quickly as users want. Android's Network Location Provider determines user location
-using cell tower and Wi-Fi signals, providing location information in a way that
-works indoors and outdoors, responds faster, and uses less battery power. To obtain the user
-location in your application, you can use both GPS and the Network Location Provider, or just
-one.</p>
-
-
-<h2 id="Challenges">Challenges in Determining User Location</h2>
-
-<p>Obtaining user location from a mobile device can be complicated. There are several reasons
-why a location reading (regardless of the source) can contain errors and be inaccurate.
-Some sources of error in the user location include:</p>
-
-<ul>
- <li><b>Multitude of location sources</b>
- <p>GPS, Cell-ID, and Wi-Fi can each provide a clue to users location. Determining which to use
-and trust is a matter of trade-offs in accuracy, speed, and battery-efficiency.</p>
- </li>
- <li><b>User movement</b>
- <p>Because the user location changes, you must account for movement by re-estimating user
-location every so often.</p>
- </li>
- <li><b>Varying accuracy</b>
- <p>Location estimates coming from each location source are not consistent in their
-accuracy. A location obtained 10 seconds ago from one source might be more accurate than the newest
-location from another or same source.</p>
- </li>
-</ul>
-
- <p>These problems can make it difficult to obtain a reliable user location reading. This
-document provides information to help you meet these challenges to obtain a reliable location
-reading. It also provides ideas that you can use in your
-application to provide the user with an accurate and responsive geo-location experience.</p>
-
-
-<h2 id="Updates">Requesting Location Updates</h2>
-
- <p>Before addressing some of the location errors described above, here is an introduction to
-how you can obtain user location on Android.</p>
-
- <p>Getting user location in Android works by means of callback. You indicate that you'd
-like to receive location updates from the {@link android.location.LocationManager} ("Location
-Manager") by calling {@link android.location.LocationManager#requestLocationUpdates
-requestLocationUpdates()}, passing it a
-{@link android.location.LocationListener}. Your {@link android.location.LocationListener} must
-implement several callback methods that the Location Manager calls when the user location
-changes or when the status of the service changes.</p>
-
-<p>For example, the following code shows how to define a {@link android.location.LocationListener}
-and request location updates:
- </p>
-
-<pre>
-// Acquire a reference to the system Location Manager
-LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
-
-// Define a listener that responds to location updates
-LocationListener locationListener = new LocationListener() {
- public void onLocationChanged(Location location) {
- // Called when a new location is found by the network location provider.
- makeUseOfNewLocation(location);
- }
-
- public void onStatusChanged(String provider, int status, Bundle extras) {}
-
- public void onProviderEnabled(String provider) {}
-
- public void onProviderDisabled(String provider) {}
- };
-
-// Register the listener with the Location Manager to receive location updates
-locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);
-</pre>
-
- <p>The first parameter in {@link
-android.location.LocationManager#requestLocationUpdates requestLocationUpdates()} is the type of
-location provider to use (in this case, the Network Location Provider for cell tower and Wi-Fi
-based location). You can control the frequency at which your listener receives updates
-with the second and third parameter—the second is the minimum time interval between
-notifications and the third is the minimum change in distance between notifications—setting
-both to zero requests location notifications as frequently as possible. The last parameter is your
-{@link android.location.LocationListener}, which receives callbacks for location updates.</p>
-
-<p>To request location updates from the GPS provider,
-substitute <code>GPS_PROVIDER</code> for <code>NETWORK_PROVIDER</code>. You can also request
-location updates from both the GPS and the Network Location Provider by calling {@link
-android.location.LocationManager#requestLocationUpdates requestLocationUpdates()} twice—once
-for <code>NETWORK_PROVIDER</code> and once for <code>GPS_PROVIDER</code>.</p>
-
-
-<h3 id="Permission">Requesting User Permissions</h3>
-
-<p>In order to receive location updates from <code>NETWORK_PROVIDER</code> or
-<code>GPS_PROVIDER</code>, you must request user permission by declaring either the {@code
-ACCESS_COARSE_LOCATION} or {@code ACCESS_FINE_LOCATION} permission, respectively, in your Android
-manifest file. For example:</p>
-
-<pre>
-<manifest ... >
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- ...
-</manifest>
-</pre>
-
-<p>Without these permissions, your application will fail at runtime when requesting
-location updates.</p>
-
-<p class="note"><strong>Note:</strong> If you are using both <code>NETWORK_PROVIDER</code> and
-<code>GPS_PROVIDER</code>, then you need to request only the {@code ACCESS_FINE_LOCATION}
-permission, because it includes permission for both providers. (Permission for {@code
-ACCESS_COARSE_LOCATION} includes permission only for <code>NETWORK_PROVIDER</code>.)</p>
-
-
-<h2 id="BestPerformance">Defining a Model for the Best Performance</h2>
-
- <p>Location-based applications are now commonplace, but due to the less than optimal
-accuracy, user movement, the multitude of methods to obtain the location, and the desire to conserve
-battery, getting user location is complicated. To overcome the obstacles of obtaining a good user
-location while preserving battery power, you must define a consistent model that specifies how your
-application obtains the user location. This model includes when you start and stop listening for
-updates and when to use cached location data.</p>
-
-
- <h3 id="Flow">Flow for obtaining user location</h3>
-
- <p>Here's the typical flow of procedures for obtaining the user location:</p>
-
- <ol>
- <li>Start application.</li>
- <li>Sometime later, start listening for updates from desired location providers.</li>
- <li>Maintain a "current best estimate" of location by filtering out new, but less accurate
-fixes.</li>
- <li>Stop listening for location updates.</li>
- <li>Take advantage of the last best location estimate.</li>
- </ol>
-
- <p>Figure 1 demonstrates this model in a timeline that visualizes the period in which an
-application is listening for location updates and the events that occur during that time.</p>
-
-<img src="{@docRoot}images/location/getting-location.png" alt="" />
-<p class="img-caption"><strong>Figure 1.</strong> A timeline representing the window in which an
-application listens for location updates.</p>
-
- <p>This model of a window—during which location updates are received—frames many of
-the decisions you need to make when adding location-based services to your application.</p>
-
-
- <h3 id="StartListening">Deciding when to start listening for updates</h3>
-
- <p>You might want to start listening for location updates as soon as your application starts, or
-only after users activate a certain feature. Be aware that long windows of listening for location
-fixes can consume a lot of battery power, but short periods might not allow for sufficient
-accuracy.</p>
-
- <p>As demonstrated above, you can begin listening for updates by calling {@link
-android.location.LocationManager#requestLocationUpdates requestLocationUpdates()}:</p>
-
-<pre>
-LocationProvider locationProvider = LocationManager.NETWORK_PROVIDER;
-// Or, use GPS location data:
-// LocationProvider locationProvider = LocationManager.GPS_PROVIDER;
-
-locationManager.requestLocationUpdates(locationProvider, 0, 0, locationListener);
-</pre>
-
-
- <h3 id="FastFix">Getting a fast fix with the last known location</h3>
-
- <p>The time it takes for your location listener to receive the first location fix is often too
-long for users wait. Until a more accurate location is provided to your location listener, you
-should utilize a cached location by calling {@link
-android.location.LocationManager#getLastKnownLocation}:</p>
-<pre>
-LocationProvider locationProvider = LocationManager.NETWORK_PROVIDER;
-// Or use LocationManager.GPS_PROVIDER
-
-Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider);
-</pre>
-
-
- <h3 id="StopListening">Deciding when to stop listening for updates</h3>
-
- <p>The logic of deciding when new fixes are no longer necessary might range from very simple to
-very complex depending on your application. A short gap between when the location is acquired and
-when the location is used, improves the accuracy of the estimate. Always beware that listening for a
-long time consumes a lot of battery power, so as soon as you have the information you need, you
-should stop
-listening for updates by calling {@link android.location.LocationManager#removeUpdates}:</p>
-<pre>
-// Remove the listener you previously added
-locationManager.removeUpdates(locationListener);
-</pre>
-
-
- <h3 id="BestEstimate">Maintaining a current best estimate</h3>
-
- <p>You might expect that the most recent location fix is the most accurate.
-However, because the accuracy of a location fix varies, the most recent fix is not always the best.
-You should include logic for choosing location fixes based on several criteria. The criteria also
-varies depending on the use-cases of the application and field testing.</p>
-
- <p>Here are a few steps you can take to validate the accuracy of a location fix:</p>
- <ul>
- <li>Check if the location retrieved is significantly newer than the previous estimate.</li>
- <li>Check if the accuracy claimed by the location is better or worse than the previous
-estimate.</li>
- <li>Check which provider the new location is from and determine if you trust it more.</li>
- </ul>
-
- <p>An elaborate example of this logic can look something like this:</p>
-
-<pre>
-private static final int TWO_MINUTES = 1000 * 60 * 2;
-
-/** Determines whether one Location reading is better than the current Location fix
- * @param location The new Location that you want to evaluate
- * @param currentBestLocation The current Location fix, to which you want to compare the new one
- */
-protected boolean isBetterLocation(Location location, Location currentBestLocation) {
- if (currentBestLocation == null) {
- // A new location is always better than no location
- return true;
- }
-
- // Check whether the new location fix is newer or older
- long timeDelta = location.getTime() - currentBestLocation.getTime();
- boolean isSignificantlyNewer = timeDelta > TWO_MINUTES;
- boolean isSignificantlyOlder = timeDelta < -TWO_MINUTES;
- boolean isNewer = timeDelta > 0;
-
- // If it's been more than two minutes since the current location, use the new location
- // because the user has likely moved
- if (isSignificantlyNewer) {
- return true;
- // If the new location is more than two minutes older, it must be worse
- } else if (isSignificantlyOlder) {
- return false;
- }
-
- // Check whether the new location fix is more or less accurate
- int accuracyDelta = (int) (location.getAccuracy() - currentBestLocation.getAccuracy());
- boolean isLessAccurate = accuracyDelta > 0;
- boolean isMoreAccurate = accuracyDelta < 0;
- boolean isSignificantlyLessAccurate = accuracyDelta > 200;
-
- // Check if the old and new location are from the same provider
- boolean isFromSameProvider = isSameProvider(location.getProvider(),
- currentBestLocation.getProvider());
-
- // Determine location quality using a combination of timeliness and accuracy
- if (isMoreAccurate) {
- return true;
- } else if (isNewer && !isLessAccurate) {
- return true;
- } else if (isNewer && !isSignificantlyLessAccurate && isFromSameProvider) {
- return true;
- }
- return false;
-}
-
-/** Checks whether two providers are the same */
-private boolean isSameProvider(String provider1, String provider2) {
- if (provider1 == null) {
- return provider2 == null;
- }
- return provider1.equals(provider2);
-}
-</pre>
-
-
- <h3 id="Adjusting">Adjusting the model to save battery and data exchange</h3>
-
- <p>As you test your application, you might find that your model for providing good location and
-good performance needs some adjustment. Here are some things you might change to find a good
-balance between the two.</p>
-
- <h4>Reduce the size of the window</h4>
-
- <p>A smaller window in which you listen for location updates means less interaction with GPS and
-network location services, thus, preserving battery life. But it also allows for fewer locations
-from which to choose a best estimate.</p>
-
- <h4>Set the location providers to return updates less frequently</h4>
-
- <p>Reducing the rate at which new updates appear during the window can also improve battery
-efficiency, but at the cost of accuracy. The value of the trade-off depends on how your
-application is used. You can reduce the rate of updates by increasing the parameters in {@link
-android.location.LocationManager#requestLocationUpdates requestLocationUpdates()} that specify the
-interval time and minimum distance change.</p>
-
- <h4>Restrict a set of providers</h4>
-
- <p>Depending on the environment where your application is used or the desired level of accuracy,
-you might choose to use only the Network Location Provider or only GPS, instead of both. Interacting
-with only one of the services reduces battery usage at a potential cost of accuracy.</p>
-
-
- <h2>Common application cases</h2>
-
- <p>There are many reasons you might want to obtain the user location in your application. Below
-are a couple scenarios in which you can use the user location to enrich your application. Each
-scenario also describes good practices for when you should start and stop listening for the
-location, in order to get a good reading and help preserve battery life.</p>
-
-
- <h3>Tagging user-created content with a location</h3>
-
- <p>You might be creating an application where user-created content is tagged with a location.
-Think of users sharing their local experiences, posting a review for a restaurant, or recording some
-content that can be augmented with their current location. A model of how this
-interaction might happen, with respect to the location services, is visualized in figure 2.</p>
-
- <img src="{@docRoot}images/location/content-tagging.png" alt="" />
-<p class="img-caption"><strong>Figure 2.</strong> A timeline representing the window in which
-the user location is obtained and listening stops when the user consumes the current location.</p>
-
- <p>This lines up with the previous model of how user location is obtained in code (figure 1). For
-best location accuracy, you might choose to start listening for location updates when users begin
-creating
-the content or even when the application starts, then stop listening for updates when content is
-ready to be posted or recorded. You might need to consider how long a typical task of creating the
-content takes and judge if this duration allows for efficient collection of a location estimate.</p>
-
-
- <h3>Helping the user decide on where to go</h3>
-
- <p>You might be creating an application that attempts to provide users with a set
-of options about where to go. For example, you're looking to provide a list of nearby restaurants,
-stores, and entertainment and the order of recommendations changes depending on the user
-location.</p>
-
- <p>To accommodate such a flow, you might choose to:</p>
- <ul>
- <li>Rearrange recommendations when a new best estimate is obtained</li>
- <li>Stop listening for updates if the order of recommendations has stabilized</li>
- </ul>
-
- <p>This kind of model is visualized in figure 3.</p>
-
- <img src="{@docRoot}images/location/where-to-go.png" alt="" />
-<p class="img-caption"><strong>Figure 3.</strong> A timeline representing the window in which a
-dynamic set of data is updated each time the user location updates.</p>
-
-
-
-
-<h2 id="MockData">Providing Mock Location Data</h2>
-
-<p>As you develop your application, you'll certainly need to test how well your model for obtaining
-user location works. This is most easily done using a real Android-powered device. If, however, you
-don't have a device, you can still test your location-based features by mocking location data in
-the Android emulator. There are three different ways to send your application mock location
-data: using Eclipse, DDMS, or the "geo" command in the emulator console.</p>
-
-<p class="note"><strong>Note:</strong> Providing mock location data is injected as GPS location
-data, so you must request location updates from <code>GPS_PROVIDER</code> in order for mock location
-data to work.</p>
-
-<h3 id="MockEclipse">Using Eclipse</h3>
-
-<p>Select <b>Window</b> > <b>Show View</b> > <b>Other</b> > <b>Emulator Control</b>.</p>
-
-<p>In the Emulator Control panel, enter GPS coordinates under Location Controls as individual
-lat/long coordinates, with a GPX file for route playback, or a KML file for multiple place marks.
-(Be sure that you have a device selected in the Devices panel—available from <b>Window</b>
-> <b>Show View</b> > <b>Other</b> > <b>Devices</b>.)</p>
-
-
-<h3 id="MockDdms">Using DDMS</h3>
-
-<p>With the DDMS tool, you can simulate location data a few different ways:</p>
-<ul>
- <li>Manually send individual longitude/latitude coordinates to the device.</li>
- <li>Use a GPX file describing a route for playback to the device.</li>
- <li>Use a KML file describing individual place marks for sequenced playback to the device.</li>
-</ul>
-
-<p>For more information on using DDMS to spoof location data, see
-<a href="{@docRoot}guide/developing/debugging/ddms.html">Using DDMS</a>.
-
-
-<h3 id="MockGeo">Using the "geo" command in the emulator console</h3>
-
-<p>To send mock location data from the command line:</p>
-
-<ol>
- <li>Launch your application in the Android emulator and open a terminal/console in your SDK's
-<code>/tools</code> directory.</li>
- <li>Connect to the emulator console:
-<pre>telnet localhost <em><console-port></em></pre></li>
- <li>Send the location data:</p>
- <ul><li><code>geo fix</code> to send a fixed geo-location.
- <p>This command accepts a longitude and latitude in decimal degrees, and
- an optional altitude in meters. For example:</p>
- <pre>geo fix -121.45356 46.51119 4392</pre>
- </li>
- <li><code>geo nmea</code> to send an NMEA 0183 sentence.
- <p>This command accepts a single NMEA sentence of type '$GPGGA' (fix data) or '$GPRMC' (transit
- data).
- For example:</p>
- <pre>geo nmea $GPRMC,081836,A,3751.65,S,14507.36,E,000.0,360.0,130998,011.3,E*62</pre>
- </li>
- </ul>
- </li>
-</ol>
-
-<p>For information about how to connect to the emulator console, see
-<a href="{@docRoot}guide/developing/devices/emulator.html#console">Using the Emulator Console</a>.</p>
diff --git a/docs/html/guide/topics/location/strategies.jd b/docs/html/guide/topics/location/strategies.jd
new file mode 100644
index 0000000..f790953
--- /dev/null
+++ b/docs/html/guide/topics/location/strategies.jd
@@ -0,0 +1,454 @@
+page.title=Location Strategies
+parent.title=Location and Maps
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Quickview</h2>
+ <ul>
+ <li>The Network Location Provider provides good location data without using GPS</li>
+ <li>Obtaining user location can consume a lot of battery, so be careful how
+long you listen for updates</li>
+ </ul>
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#Challenges">Challenges in Determining User Location</a></li>
+ <li><a href="#Updates">Requesting Location Updates</a>
+ <ol>
+ <li><a href="#Permission">Requesting User Permissions</a></li>
+ </ol>
+ </li>
+ <li><a href="#BestPerformance">Defining a Model for the Best Performance</a>
+ <ol>
+ <li><a href="#Flow">Flow for obtaining user location</a></li>
+ <li><a href="#StartListening">Deciding when to start listening for updates</a></li>
+ <li><a href="#FastFix">Getting a fast fix with the last known location</a></li>
+ <li><a href="#StopListening">Deciding when to stop listening for updates</a></li>
+ <li><a href="#BestEstimate">Maintaining a current best estimate</a></li>
+ <li><a href="#Adjusting">Adjusting the model to save battery and data exchange</a></li>
+ </ol>
+ </li>
+ <li><a href="#MockData">Providing Mock Location Data</a></li>
+ </ol>
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.location.LocationManager}</li>
+ <li>{@link android.location.LocationListener}</li>
+ </ol>
+</div>
+</div>
+
+ <p>Knowing where the user is allows your application to be smarter and deliver
+better information to the user. When developing a location-aware application for Android, you can
+utilize GPS and Android's Network Location Provider to acquire the user location. Although
+GPS is most accurate, it only works outdoors, it quickly consumes battery power, and doesn't return
+the location as quickly as users want. Android's Network Location Provider determines user location
+using cell tower and Wi-Fi signals, providing location information in a way that
+works indoors and outdoors, responds faster, and uses less battery power. To obtain the user
+location in your application, you can use both GPS and the Network Location Provider, or just
+one.</p>
+
+
+<h2 id="Challenges">Challenges in Determining User Location</h2>
+
+<p>Obtaining user location from a mobile device can be complicated. There are several reasons
+why a location reading (regardless of the source) can contain errors and be inaccurate.
+Some sources of error in the user location include:</p>
+
+<ul>
+ <li><b>Multitude of location sources</b>
+ <p>GPS, Cell-ID, and Wi-Fi can each provide a clue to users location. Determining which to use
+and trust is a matter of trade-offs in accuracy, speed, and battery-efficiency.</p>
+ </li>
+ <li><b>User movement</b>
+ <p>Because the user location changes, you must account for movement by re-estimating user
+location every so often.</p>
+ </li>
+ <li><b>Varying accuracy</b>
+ <p>Location estimates coming from each location source are not consistent in their
+accuracy. A location obtained 10 seconds ago from one source might be more accurate than the newest
+location from another or same source.</p>
+ </li>
+</ul>
+
+ <p>These problems can make it difficult to obtain a reliable user location reading. This
+document provides information to help you meet these challenges to obtain a reliable location
+reading. It also provides ideas that you can use in your
+application to provide the user with an accurate and responsive geo-location experience.</p>
+
+
+<h2 id="Updates">Requesting Location Updates</h2>
+
+ <p>Before addressing some of the location errors described above, here is an introduction to
+how you can obtain user location on Android.</p>
+
+ <p>Getting user location in Android works by means of callback. You indicate that you'd
+like to receive location updates from the {@link android.location.LocationManager} ("Location
+Manager") by calling {@link android.location.LocationManager#requestLocationUpdates
+requestLocationUpdates()}, passing it a
+{@link android.location.LocationListener}. Your {@link android.location.LocationListener} must
+implement several callback methods that the Location Manager calls when the user location
+changes or when the status of the service changes.</p>
+
+<p>For example, the following code shows how to define a {@link android.location.LocationListener}
+and request location updates:
+ </p>
+
+<pre>
+// Acquire a reference to the system Location Manager
+LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
+
+// Define a listener that responds to location updates
+LocationListener locationListener = new LocationListener() {
+ public void onLocationChanged(Location location) {
+ // Called when a new location is found by the network location provider.
+ makeUseOfNewLocation(location);
+ }
+
+ public void onStatusChanged(String provider, int status, Bundle extras) {}
+
+ public void onProviderEnabled(String provider) {}
+
+ public void onProviderDisabled(String provider) {}
+ };
+
+// Register the listener with the Location Manager to receive location updates
+locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);
+</pre>
+
+ <p>The first parameter in {@link
+android.location.LocationManager#requestLocationUpdates requestLocationUpdates()} is the type of
+location provider to use (in this case, the Network Location Provider for cell tower and Wi-Fi
+based location). You can control the frequency at which your listener receives updates
+with the second and third parameter—the second is the minimum time interval between
+notifications and the third is the minimum change in distance between notifications—setting
+both to zero requests location notifications as frequently as possible. The last parameter is your
+{@link android.location.LocationListener}, which receives callbacks for location updates.</p>
+
+<p>To request location updates from the GPS provider,
+substitute <code>GPS_PROVIDER</code> for <code>NETWORK_PROVIDER</code>. You can also request
+location updates from both the GPS and the Network Location Provider by calling {@link
+android.location.LocationManager#requestLocationUpdates requestLocationUpdates()} twice—once
+for <code>NETWORK_PROVIDER</code> and once for <code>GPS_PROVIDER</code>.</p>
+
+
+<h3 id="Permission">Requesting User Permissions</h3>
+
+<p>In order to receive location updates from <code>NETWORK_PROVIDER</code> or
+<code>GPS_PROVIDER</code>, you must request user permission by declaring either the {@code
+ACCESS_COARSE_LOCATION} or {@code ACCESS_FINE_LOCATION} permission, respectively, in your Android
+manifest file. For example:</p>
+
+<pre>
+<manifest ... >
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ ...
+</manifest>
+</pre>
+
+<p>Without these permissions, your application will fail at runtime when requesting
+location updates.</p>
+
+<p class="note"><strong>Note:</strong> If you are using both <code>NETWORK_PROVIDER</code> and
+<code>GPS_PROVIDER</code>, then you need to request only the {@code ACCESS_FINE_LOCATION}
+permission, because it includes permission for both providers. (Permission for {@code
+ACCESS_COARSE_LOCATION} includes permission only for <code>NETWORK_PROVIDER</code>.)</p>
+
+
+<h2 id="BestPerformance">Defining a Model for the Best Performance</h2>
+
+ <p>Location-based applications are now commonplace, but due to the less than optimal
+accuracy, user movement, the multitude of methods to obtain the location, and the desire to conserve
+battery, getting user location is complicated. To overcome the obstacles of obtaining a good user
+location while preserving battery power, you must define a consistent model that specifies how your
+application obtains the user location. This model includes when you start and stop listening for
+updates and when to use cached location data.</p>
+
+
+ <h3 id="Flow">Flow for obtaining user location</h3>
+
+ <p>Here's the typical flow of procedures for obtaining the user location:</p>
+
+ <ol>
+ <li>Start application.</li>
+ <li>Sometime later, start listening for updates from desired location providers.</li>
+ <li>Maintain a "current best estimate" of location by filtering out new, but less accurate
+fixes.</li>
+ <li>Stop listening for location updates.</li>
+ <li>Take advantage of the last best location estimate.</li>
+ </ol>
+
+ <p>Figure 1 demonstrates this model in a timeline that visualizes the period in which an
+application is listening for location updates and the events that occur during that time.</p>
+
+<img src="{@docRoot}images/location/getting-location.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> A timeline representing the window in which an
+application listens for location updates.</p>
+
+ <p>This model of a window—during which location updates are received—frames many of
+the decisions you need to make when adding location-based services to your application.</p>
+
+
+ <h3 id="StartListening">Deciding when to start listening for updates</h3>
+
+ <p>You might want to start listening for location updates as soon as your application starts, or
+only after users activate a certain feature. Be aware that long windows of listening for location
+fixes can consume a lot of battery power, but short periods might not allow for sufficient
+accuracy.</p>
+
+ <p>As demonstrated above, you can begin listening for updates by calling {@link
+android.location.LocationManager#requestLocationUpdates requestLocationUpdates()}:</p>
+
+<pre>
+LocationProvider locationProvider = LocationManager.NETWORK_PROVIDER;
+// Or, use GPS location data:
+// LocationProvider locationProvider = LocationManager.GPS_PROVIDER;
+
+locationManager.requestLocationUpdates(locationProvider, 0, 0, locationListener);
+</pre>
+
+
+ <h3 id="FastFix">Getting a fast fix with the last known location</h3>
+
+ <p>The time it takes for your location listener to receive the first location fix is often too
+long for users wait. Until a more accurate location is provided to your location listener, you
+should utilize a cached location by calling {@link
+android.location.LocationManager#getLastKnownLocation}:</p>
+<pre>
+LocationProvider locationProvider = LocationManager.NETWORK_PROVIDER;
+// Or use LocationManager.GPS_PROVIDER
+
+Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider);
+</pre>
+
+
+ <h3 id="StopListening">Deciding when to stop listening for updates</h3>
+
+ <p>The logic of deciding when new fixes are no longer necessary might range from very simple to
+very complex depending on your application. A short gap between when the location is acquired and
+when the location is used, improves the accuracy of the estimate. Always beware that listening for a
+long time consumes a lot of battery power, so as soon as you have the information you need, you
+should stop
+listening for updates by calling {@link android.location.LocationManager#removeUpdates}:</p>
+<pre>
+// Remove the listener you previously added
+locationManager.removeUpdates(locationListener);
+</pre>
+
+
+ <h3 id="BestEstimate">Maintaining a current best estimate</h3>
+
+ <p>You might expect that the most recent location fix is the most accurate.
+However, because the accuracy of a location fix varies, the most recent fix is not always the best.
+You should include logic for choosing location fixes based on several criteria. The criteria also
+varies depending on the use-cases of the application and field testing.</p>
+
+ <p>Here are a few steps you can take to validate the accuracy of a location fix:</p>
+ <ul>
+ <li>Check if the location retrieved is significantly newer than the previous estimate.</li>
+ <li>Check if the accuracy claimed by the location is better or worse than the previous
+estimate.</li>
+ <li>Check which provider the new location is from and determine if you trust it more.</li>
+ </ul>
+
+ <p>An elaborate example of this logic can look something like this:</p>
+
+<pre>
+private static final int TWO_MINUTES = 1000 * 60 * 2;
+
+/** Determines whether one Location reading is better than the current Location fix
+ * @param location The new Location that you want to evaluate
+ * @param currentBestLocation The current Location fix, to which you want to compare the new one
+ */
+protected boolean isBetterLocation(Location location, Location currentBestLocation) {
+ if (currentBestLocation == null) {
+ // A new location is always better than no location
+ return true;
+ }
+
+ // Check whether the new location fix is newer or older
+ long timeDelta = location.getTime() - currentBestLocation.getTime();
+ boolean isSignificantlyNewer = timeDelta > TWO_MINUTES;
+ boolean isSignificantlyOlder = timeDelta < -TWO_MINUTES;
+ boolean isNewer = timeDelta > 0;
+
+ // If it's been more than two minutes since the current location, use the new location
+ // because the user has likely moved
+ if (isSignificantlyNewer) {
+ return true;
+ // If the new location is more than two minutes older, it must be worse
+ } else if (isSignificantlyOlder) {
+ return false;
+ }
+
+ // Check whether the new location fix is more or less accurate
+ int accuracyDelta = (int) (location.getAccuracy() - currentBestLocation.getAccuracy());
+ boolean isLessAccurate = accuracyDelta > 0;
+ boolean isMoreAccurate = accuracyDelta < 0;
+ boolean isSignificantlyLessAccurate = accuracyDelta > 200;
+
+ // Check if the old and new location are from the same provider
+ boolean isFromSameProvider = isSameProvider(location.getProvider(),
+ currentBestLocation.getProvider());
+
+ // Determine location quality using a combination of timeliness and accuracy
+ if (isMoreAccurate) {
+ return true;
+ } else if (isNewer && !isLessAccurate) {
+ return true;
+ } else if (isNewer && !isSignificantlyLessAccurate && isFromSameProvider) {
+ return true;
+ }
+ return false;
+}
+
+/** Checks whether two providers are the same */
+private boolean isSameProvider(String provider1, String provider2) {
+ if (provider1 == null) {
+ return provider2 == null;
+ }
+ return provider1.equals(provider2);
+}
+</pre>
+
+
+ <h3 id="Adjusting">Adjusting the model to save battery and data exchange</h3>
+
+ <p>As you test your application, you might find that your model for providing good location and
+good performance needs some adjustment. Here are some things you might change to find a good
+balance between the two.</p>
+
+ <h4>Reduce the size of the window</h4>
+
+ <p>A smaller window in which you listen for location updates means less interaction with GPS and
+network location services, thus, preserving battery life. But it also allows for fewer locations
+from which to choose a best estimate.</p>
+
+ <h4>Set the location providers to return updates less frequently</h4>
+
+ <p>Reducing the rate at which new updates appear during the window can also improve battery
+efficiency, but at the cost of accuracy. The value of the trade-off depends on how your
+application is used. You can reduce the rate of updates by increasing the parameters in {@link
+android.location.LocationManager#requestLocationUpdates requestLocationUpdates()} that specify the
+interval time and minimum distance change.</p>
+
+ <h4>Restrict a set of providers</h4>
+
+ <p>Depending on the environment where your application is used or the desired level of accuracy,
+you might choose to use only the Network Location Provider or only GPS, instead of both. Interacting
+with only one of the services reduces battery usage at a potential cost of accuracy.</p>
+
+
+ <h2>Common application cases</h2>
+
+ <p>There are many reasons you might want to obtain the user location in your application. Below
+are a couple scenarios in which you can use the user location to enrich your application. Each
+scenario also describes good practices for when you should start and stop listening for the
+location, in order to get a good reading and help preserve battery life.</p>
+
+
+ <h3>Tagging user-created content with a location</h3>
+
+ <p>You might be creating an application where user-created content is tagged with a location.
+Think of users sharing their local experiences, posting a review for a restaurant, or recording some
+content that can be augmented with their current location. A model of how this
+interaction might happen, with respect to the location services, is visualized in figure 2.</p>
+
+ <img src="{@docRoot}images/location/content-tagging.png" alt="" />
+<p class="img-caption"><strong>Figure 2.</strong> A timeline representing the window in which
+the user location is obtained and listening stops when the user consumes the current location.</p>
+
+ <p>This lines up with the previous model of how user location is obtained in code (figure 1). For
+best location accuracy, you might choose to start listening for location updates when users begin
+creating
+the content or even when the application starts, then stop listening for updates when content is
+ready to be posted or recorded. You might need to consider how long a typical task of creating the
+content takes and judge if this duration allows for efficient collection of a location estimate.</p>
+
+
+ <h3>Helping the user decide on where to go</h3>
+
+ <p>You might be creating an application that attempts to provide users with a set
+of options about where to go. For example, you're looking to provide a list of nearby restaurants,
+stores, and entertainment and the order of recommendations changes depending on the user
+location.</p>
+
+ <p>To accommodate such a flow, you might choose to:</p>
+ <ul>
+ <li>Rearrange recommendations when a new best estimate is obtained</li>
+ <li>Stop listening for updates if the order of recommendations has stabilized</li>
+ </ul>
+
+ <p>This kind of model is visualized in figure 3.</p>
+
+ <img src="{@docRoot}images/location/where-to-go.png" alt="" />
+<p class="img-caption"><strong>Figure 3.</strong> A timeline representing the window in which a
+dynamic set of data is updated each time the user location updates.</p>
+
+
+
+
+<h2 id="MockData">Providing Mock Location Data</h2>
+
+<p>As you develop your application, you'll certainly need to test how well your model for obtaining
+user location works. This is most easily done using a real Android-powered device. If, however, you
+don't have a device, you can still test your location-based features by mocking location data in
+the Android emulator. There are three different ways to send your application mock location
+data: using Eclipse, DDMS, or the "geo" command in the emulator console.</p>
+
+<p class="note"><strong>Note:</strong> Providing mock location data is injected as GPS location
+data, so you must request location updates from <code>GPS_PROVIDER</code> in order for mock location
+data to work.</p>
+
+<h3 id="MockEclipse">Using Eclipse</h3>
+
+<p>Select <b>Window</b> > <b>Show View</b> > <b>Other</b> > <b>Emulator Control</b>.</p>
+
+<p>In the Emulator Control panel, enter GPS coordinates under Location Controls as individual
+lat/long coordinates, with a GPX file for route playback, or a KML file for multiple place marks.
+(Be sure that you have a device selected in the Devices panel—available from <b>Window</b>
+> <b>Show View</b> > <b>Other</b> > <b>Devices</b>.)</p>
+
+
+<h3 id="MockDdms">Using DDMS</h3>
+
+<p>With the DDMS tool, you can simulate location data a few different ways:</p>
+<ul>
+ <li>Manually send individual longitude/latitude coordinates to the device.</li>
+ <li>Use a GPX file describing a route for playback to the device.</li>
+ <li>Use a KML file describing individual place marks for sequenced playback to the device.</li>
+</ul>
+
+<p>For more information on using DDMS to spoof location data, see
+<a href="{@docRoot}tools/debugging/ddms.html">Using DDMS</a>.
+
+
+<h3 id="MockGeo">Using the "geo" command in the emulator console</h3>
+
+<p>To send mock location data from the command line:</p>
+
+<ol>
+ <li>Launch your application in the Android emulator and open a terminal/console in your SDK's
+<code>/tools</code> directory.</li>
+ <li>Connect to the emulator console:
+<pre>telnet localhost <em><console-port></em></pre></li>
+ <li>Send the location data:</p>
+ <ul><li><code>geo fix</code> to send a fixed geo-location.
+ <p>This command accepts a longitude and latitude in decimal degrees, and
+ an optional altitude in meters. For example:</p>
+ <pre>geo fix -121.45356 46.51119 4392</pre>
+ </li>
+ <li><code>geo nmea</code> to send an NMEA 0183 sentence.
+ <p>This command accepts a single NMEA sentence of type '$GPGGA' (fix data) or '$GPRMC' (transit
+ data).
+ For example:</p>
+ <pre>geo nmea $GPRMC,081836,A,3751.65,S,14507.36,E,000.0,360.0,130998,011.3,E*62</pre>
+ </li>
+ </ul>
+ </li>
+</ol>
+
+<p>For information about how to connect to the emulator console, see
+<a href="{@docRoot}tools/devices/emulator.html#console">Using the Emulator Console</a>.</p>
diff --git a/docs/html/guide/topics/manifest/action-element.jd b/docs/html/guide/topics/manifest/action-element.jd
index 8ad94cd..037d0dc 100644
--- a/docs/html/guide/topics/manifest/action-element.jd
+++ b/docs/html/guide/topics/manifest/action-element.jd
@@ -16,7 +16,7 @@
An <code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> element must contain
one or more {@code <action>} elements. If it doesn't contain any, no
Intent objects will get through the filter. See
-<a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and
+<a href="{@docRoot}guide/components/intents-filters.html">Intents and
Intent Filters</a> for details on intent filters and the role of action
specifications within a filter.
</dd>
diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd
index 9dc124b..88f226c 100644
--- a/docs/html/guide/topics/manifest/activity-element.jd
+++ b/docs/html/guide/topics/manifest/activity-element.jd
@@ -508,7 +508,7 @@
<p>For more information on launch modes and their interaction with Intent
flags, see the
-<a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a>
+<a href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a>
document.
</p>
</dd>
diff --git a/docs/html/guide/topics/manifest/category-element.jd b/docs/html/guide/topics/manifest/category-element.jd
index f392c0a..41a2cfded 100644
--- a/docs/html/guide/topics/manifest/category-element.jd
+++ b/docs/html/guide/topics/manifest/category-element.jd
@@ -12,7 +12,7 @@
<dt>description:</dt>
<dd>Adds a category name to an intent filter. See
-<a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and
+<a href="{@docRoot}guide/components/intents-filters.html">Intents and
Intent Filters</a> for details on intent filters and the role of category
specifications within a filter.</dd>
diff --git a/docs/html/guide/topics/manifest/compatible-screens-element.jd b/docs/html/guide/topics/manifest/compatible-screens-element.jd
index a27c316..bb004fb 100644
--- a/docs/html/guide/topics/manifest/compatible-screens-element.jd
+++ b/docs/html/guide/topics/manifest/compatible-screens-element.jd
@@ -54,7 +54,7 @@
<supports-screens>}</a> element to declare whether the system should resize your
application for different screen sizes.</p>
- <p>Also see the <a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>
+ <p>Also see the <a href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a>
document for more information about how Google Play filters applications using this and
other manifest elements.</p>
@@ -138,5 +138,5 @@
<dt>see also:</dt>
<dd><a
href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></dd>
-<dd><a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a></dd>
+<dd><a href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a></dd>
</dl>
diff --git a/docs/html/guide/topics/manifest/data-element.jd b/docs/html/guide/topics/manifest/data-element.jd
index 9b0d0df..8fd91de 100644
--- a/docs/html/guide/topics/manifest/data-element.jd
+++ b/docs/html/guide/topics/manifest/data-element.jd
@@ -62,7 +62,7 @@
<p>
Information on how intent filters work, including the rules for how Intent objects
are matched against filters, can be found in another document,
-<a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and
+<a href="{@docRoot}guide/components/intents-filters.html">Intents and
Intent Filters</a>. See also the
<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#ifs">Intent Filters</a>
section in the introduction.
diff --git a/docs/html/guide/topics/manifest/intent-filter-element.jd b/docs/html/guide/topics/manifest/intent-filter-element.jd
index d293400..f90541c 100644
--- a/docs/html/guide/topics/manifest/intent-filter-element.jd
+++ b/docs/html/guide/topics/manifest/intent-filter-element.jd
@@ -41,7 +41,7 @@
<p>
For a more detailed discussion of filters, see the separate
-<a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents
+<a href="{@docRoot}guide/components/intents-filters.html">Intents
and Intent Filters</a> document, as well as the
<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#ifs">Intents Filters</a>
section in the introduction.
diff --git a/docs/html/guide/topics/manifest/manifest-element.jd b/docs/html/guide/topics/manifest/manifest-element.jd
index 98968d7..a3d4a95 100644
--- a/docs/html/guide/topics/manifest/manifest-element.jd
+++ b/docs/html/guide/topics/manifest/manifest-element.jd
@@ -152,7 +152,7 @@
<p class="caution"><strong>Caution:</strong> If your application uses Google Play's Copy
Protection feature, it cannot be installed to a device's SD card. However, if you use Google
- Play's <a href="{@docRoot}guide/market/licensing.html">Application Licensing</a> instead,
+ Play's <a href="{@docRoot}guide/google/play/licensing.html">Application Licensing</a> instead,
your application <em>can</em> be installed to internal or external storage, including SD cards.</p>
<p class="note"><strong>Note:</strong> By default, your application will be installed on the
diff --git a/docs/html/guide/topics/manifest/manifest-intro.jd b/docs/html/guide/topics/manifest/manifest-intro.jd
index 0f20305..a130f7d 100644
--- a/docs/html/guide/topics/manifest/manifest-intro.jd
+++ b/docs/html/guide/topics/manifest/manifest-intro.jd
@@ -345,7 +345,7 @@
<p>
For information on how Intent objects are tested against intent filters,
see a separate document,
-<a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents
+<a href="{@docRoot}guide/components/intents-filters.html">Intents
and Intent Filters</a>.
</p>
diff --git a/docs/html/guide/topics/manifest/supports-gl-texture-element.jd b/docs/html/guide/topics/manifest/supports-gl-texture-element.jd
index ebdd0b1..6dfc59e 100644
--- a/docs/html/guide/topics/manifest/supports-gl-texture-element.jd
+++ b/docs/html/guide/topics/manifest/supports-gl-texture-element.jd
@@ -141,7 +141,7 @@
<dt>see also:</dt>
<dd>
<ul>
- <li><a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a></li>
+ <li><a href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a></li>
</ul>
</dd>
diff --git a/docs/html/guide/topics/manifest/uses-feature-element.jd b/docs/html/guide/topics/manifest/uses-feature-element.jd
index 5f0a501..f605295 100644
--- a/docs/html/guide/topics/manifest/uses-feature-element.jd
+++ b/docs/html/guide/topics/manifest/uses-feature-element.jd
@@ -207,7 +207,7 @@
<li>{@link android.content.pm.FeatureInfo}</li>
<li>{@link android.content.pm.ConfigurationInfo}</li>
<li><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><code><uses-permission></code></a></li>
- <li><a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a></li>
+ <li><a href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a></li>
</ul>
</dd>
@@ -501,7 +501,7 @@
<p class="note"><strong>Note:</strong> You must use the version of
<code>aapt</code> that is provided for the latest Platform-Tools component available. If
you do not have the latest Platform-Tools component, download it using the <a
-href="{@docRoot}sdk/adding-components.html">Android SDK Manager</a>.
+href="{@docRoot}sdk/exploring.html">Android SDK Manager</a>.
</p></li>
<li>Run <code>aapt</code> using this syntax: </li>
</ol>
diff --git a/docs/html/guide/topics/manifest/uses-library-element.jd b/docs/html/guide/topics/manifest/uses-library-element.jd
index 2f8eb50..3ad8ddb 100644
--- a/docs/html/guide/topics/manifest/uses-library-element.jd
+++ b/docs/html/guide/topics/manifest/uses-library-element.jd
@@ -46,7 +46,7 @@
<dd>
Google Play filters applications based on the libraries installed on the
user's device. For more information about filtering, see the topic
- <a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>.
+ <a href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a>.
</dd>
</dl>
<p>
diff --git a/docs/html/guide/topics/manifest/uses-sdk-element.jd b/docs/html/guide/topics/manifest/uses-sdk-element.jd
index 8fa39d1..29dcb56 100644
--- a/docs/html/guide/topics/manifest/uses-sdk-element.jd
+++ b/docs/html/guide/topics/manifest/uses-sdk-element.jd
@@ -3,6 +3,29 @@
parent.link=manifest-intro.html
@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#ApiLevels">What is API Level?</a></li>
+ <li><a href="#uses">Uses of API Level in Android</a></li>
+ <li><a href="#considerations">Development Considerations</a>
+ <ol>
+ <li><a href="#fc">Application forward compatibility</a></li>
+ <li><a href="#bc">Application backward compatibility</a></li>
+ <li><a href="#platform">Selecting a platform version and API Level</a></li>
+ <li><a href="#apilevel">Declaring a minimum API Level</a></li>
+ <li><a href="#testing">Testing against higher API Levels</a></li>
+ </ol>
+ </li>
+ <li><a href="#provisional">Using a Provisional API Level</a></li>
+ <li><a href="#filtering">Filtering the Reference Documentation by API Level</a></li>
+</ol>
+</div>
+</div>
+
<dl class="xml">
<dt>syntax:</dt>
<dd><pre>
@@ -25,9 +48,8 @@
its associated Android version number (for example, it is not the same as the
major version or the sum of the major and minor versions).</p>
-<p>For more information, read about
-<a href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a> and
-<a href="{@docRoot}guide/publishing/versioning.html">Versioning Your Applications</a>.
+<p>Also read the document about
+<a href="{@docRoot}tools/publishing/versioning.html">Versioning Your Applications</a>.
</p></dd>
<div class="sidebox-wrapper" xstyle="margin-bottom:2em;margin-top:.5em;width:90%;">
@@ -42,7 +64,7 @@
attributes in each application's manifest to establish its version-compatibility
range, then shows or hides the application based on a comparison with the API
Level of the user's Android system version. For more information, see <a
-href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a>.</p>
+href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a>.</p>
</div>
</div>
@@ -156,3 +178,403 @@
<dd>API Level 1</dd>
</dl>
+
+
+
+
+
+<!--- CONTENT FROM OLD API LEVEL DOC ---->
+
+
+
+
+<h2 id="ApiLevels">What is API Level?</h2>
+
+<p>API Level is an integer value that uniquely identifies the framework API
+revision offered by a version of the Android platform.</p>
+
+<p>The Android platform provides a framework API that applications can use to
+interact with the underlying Android system. The framework API consists of:</p>
+
+<ul>
+<li>A core set of packages and classes</li>
+<li>A set of XML elements and attributes for declaring a manifest file</li>
+<li>A set of XML elements and attributes for declaring and accessing resources</li>
+<li>A set of Intents</li>
+<li>A set of permissions that applications can request, as well as permission
+enforcements included in the system</li>
+</ul>
+
+<p>Each successive version of the Android platform can include updates to the
+Android application framework API that it delivers. </p>
+
+<p>Updates to the framework API are designed so that the new API remains
+compatible with earlier versions of the API. That is, most changes in the API
+are additive and introduce new or replacement functionality. As parts of the API
+are upgraded, the older replaced parts are deprecated but are not removed, so
+that existing applications can still use them. In a very small number of cases,
+parts of the API may be modified or removed, although typically such changes are
+only needed to ensure API robustness and application or system security. All
+other API parts from earlier revisions are carried forward without
+modification.</p>
+
+<p>The framework API that an Android platform delivers is specified using an
+integer identifier called "API Level". Each Android platform version supports
+exactly one API Level, although support is implicit for all earlier API Levels
+(down to API Level 1). The initial release of the Android platform provided
+API Level 1 and subsequent releases have incremented the API Level.</p>
+
+<p>The following table specifies the API Level supported by each version of the
+Android platform.</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-4.0.3.html">Android 4.0.3</a></td>
+ <td><a href="{@docRoot}sdk/api_diff/15/changes.html" title="Diff Report">15</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1}</td>
+ <td rowspan="2"><a href="{@docRoot}about/versions/android-4.0-highlights.html">Platform
+Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-4.0.html">Android 4.0, 4.0.1, 4.0.2</a></td>
+ <td><a href="{@docRoot}sdk/api_diff/14/changes.html" title="Diff Report">14</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH}</td>
+ </tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-3.2.html">Android 3.2</a></td>
+ <td><a href="{@docRoot}sdk/api_diff/13/changes.html" title="Diff Report">13</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}</td>
+ <td><!-- <a href="{@docRoot}about/versions/android-3.2-highlights.html">Platform
+Highlights</a>--></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-3.1.html">Android 3.1.x</a></td>
+ <td><a href="{@docRoot}sdk/api_diff/12/changes.html" title="Diff Report">12</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB_MR1}</td>
+ <td><a href="{@docRoot}about/versions/android-3.1-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-3.0.html">Android 3.0.x</td>
+ <td><a href="{@docRoot}sdk/api_diff/11/changes.html" title="Diff Report">11</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB}</td>
+ <td><a href="{@docRoot}about/versions/android-3.0-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.3.3.html">Android 2.3.4<br>Android 2.3.3</td>
+ <td><a href="{@docRoot}sdk/api_diff/10/changes.html" title="Diff Report">10</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#GINGERBREAD_MR1}</td>
+ <td rowspan="2"><a href="{@docRoot}about/versions/android-2.3-highlights.html">Platform
+Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.3.html">Android 2.3.2<br>Android 2.3.1<br>Android
+2.3</td>
+ <td><a href="{@docRoot}sdk/api_diff/9/changes.html" title="Diff Report">9</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#GINGERBREAD}</td>
+ </tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.2.html">Android 2.2.x</td>
+ <td ><a href="{@docRoot}sdk/api_diff/8/changes.html" title="Diff Report">8</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#FROYO}</td>
+ <td><a href="{@docRoot}about/versions/android-2.2-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.1.html">Android 2.1.x</td>
+ <td><a href="{@docRoot}sdk/api_diff/7/changes.html" title="Diff Report">7</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#ECLAIR_MR1}</td>
+ <td rowspan="3" ><a href="{@docRoot}about/versions/android-2.0-highlights.html">Platform
+Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.0.1.html">Android 2.0.1</td>
+ <td><a href="{@docRoot}sdk/api_diff/6/changes.html" title="Diff Report">6</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#ECLAIR_0_1}</td>
+ </tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-2.0.html">Android 2.0</td>
+ <td><a href="{@docRoot}sdk/api_diff/5/changes.html" title="Diff Report">5</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#ECLAIR}</td>
+ </tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-1.6.html">Android 1.6</td>
+ <td><a href="{@docRoot}sdk/api_diff/4/changes.html" title="Diff Report">4</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#DONUT}</td>
+ <td><a href="{@docRoot}about/versions/android-1.6-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-1.5.html">Android 1.5</td>
+ <td><a href="{@docRoot}sdk/api_diff/3/changes.html" title="Diff Report">3</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#CUPCAKE}</td>
+ <td><a href="{@docRoot}about/versions/android-1.5-highlights.html">Platform Highlights</a></td></tr>
+
+ <tr><td><a href="{@docRoot}about/versions/android-1.1.html">Android 1.1</td>
+ <td>2</td>
+ <td>{@link android.os.Build.VERSION_CODES#BASE_1_1}</td><td></td></tr>
+
+ <tr><td>Android 1.0</td>
+ <td>1</td>
+ <td>{@link android.os.Build.VERSION_CODES#BASE}</td>
+ <td></td></tr>
+</table>
+
+
+<h2 id="uses">Uses of API Level in Android</h2>
+
+<p>The API Level identifier serves a key role in ensuring the best possible
+experience for users and application developers:
+
+<ul>
+<li>It lets the Android platform describe the maximum framework API revision
+that it supports</li>
+<li>It lets applications describe the framework API revision that they
+require</li>
+<li>It lets the system negotiate the installation of applications on the user's
+device, such that version-incompatible applications are not installed.</li>
+</ul>
+
+<p>Each Android platform version stores its API Level identifier internally, in
+the Android system itself. </p>
+
+<p>Applications can use a manifest element provided by the framework API —
+<code><uses-sdk></code> — to describe the minimum and maximum API
+Levels under which they are able to run, as well as the preferred API Level that
+they are designed to support. The element offers three key attributes:</p>
+
+<ul>
+<li><code>android:minSdkVersion</code> — Specifies the minimum API Level
+on which the application is able to run. The default value is "1".</li>
+<li><code>android:targetSdkVersion</code> — Specifies the API Level
+on which the application is designed to run. In some cases, this allows the
+application to use manifest elements or behaviors defined in the target
+API Level, rather than being restricted to using only those defined
+for the minimum API Level.</li>
+<li><code>android:maxSdkVersion</code> — Specifies the maximum API Level
+on which the application is able to run. <strong>Important:</strong> Please read the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+documentation before using this attribute. </li>
+</ul>
+
+<p>For example, to specify the minimum system API Level that an application
+requires in order to run, the application would include in its manifest a
+<code><uses-sdk></code> element with a <code>android:minSdkVersion</code>
+attribute. The value of <code>android:minSdkVersion</code> would be the integer
+corresponding to the API Level of the earliest version of the Android platform
+under which the application can run. </p>
+
+<p>When the user attempts to install an application, or when revalidating an
+appplication after a system update, the Android system first checks the
+<code><uses-sdk></code> attributes in the application's manifest and
+compares the values against its own internal API Level. The system allows the
+installation to begin only if these conditions are met:</p>
+
+<ul>
+<li>If a <code>android:minSdkVersion</code> attribute is declared, its value
+must be less than or equal to the system's API Level integer. If not declared,
+the system assumes that the application requires API Level 1. </li>
+<li>If a <code>android:maxSdkVersion</code> attribute is declared, its value
+must be equal to or greater than the system's API Level integer.
+If not declared, the system assumes that the application
+has no maximum API Level. Please read the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+documentation for more information about how the system handles this attribute.</li>
+</ul>
+
+<p>When declared in an application's manifest, a <code><uses-sdk></code>
+element might look like this: </p>
+
+<pre><manifest>
+ <uses-sdk android:minSdkVersion="5" />
+ ...
+</manifest></pre>
+
+<p>The principal reason that an application would declare an API Level in
+<code>android:minSdkVersion</code> is to tell the Android system that it is
+using APIs that were <em>introduced</em> in the API Level specified. If the
+application were to be somehow installed on a platform with a lower API Level,
+then it would crash at run-time when it tried to access APIs that don't exist.
+The system prevents such an outcome by not allowing the application to be
+installed if the lowest API Level it requires is higher than that of the
+platform version on the target device.</p>
+
+<p>For example, the {@link android.appwidget} package was introduced with API
+Level 3. If an application uses that API, it must declare a
+<code>android:minSdkVersion</code> attribute with a value of "3". The
+application will then be installable on platforms such as Android 1.5 (API Level
+3) and Android 1.6 (API Level 4), but not on the Android 1.1 (API Level 2) and
+Android 1.0 platforms (API Level 1).</p>
+
+<p>For more information about how to specify an application's API Level
+requirements, see the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+ section of the manifest file documentation.</p>
+
+
+<h2 id="considerations">Development Considerations</h2>
+
+<p>The sections below provide information related to API level that you should
+consider when developing your application.</p>
+
+<h3 id="fc">Application forward compatibility</h3>
+
+<p>Android applications are generally forward-compatible with new versions of
+the Android platform.</p>
+
+<p>Because almost all changes to the framework API are additive, an Android
+application developed using any given version of the API (as specified by its
+API Level) is forward-compatible with later versions of the Android platform and
+higher API levels. The application should be able to run on all later versions
+of the Android platform, except in isolated cases where the application uses a
+part of the API that is later removed for some reason. </p>
+
+<p>Forward compatibility is important because many Android-powered devices
+receive over-the-air (OTA) system updates. The user may install your
+application and use it successfully, then later receive an OTA update to a new
+version of the Android platform. Once the update is installed, your application
+will run in a new run-time version of the environment, but one that has the API
+and system capabilities that your application depends on. </p>
+
+<p>In some cases, changes <em>below</em> the API, such those in the underlying
+system itself, may affect your application when it is run in the new
+environment. For that reason it's important for you, as the application
+developer, to understand how the application will look and behave in each system
+environment. To help you test your application on various versions of the Android
+platform, the Android SDK includes multiple platforms that you can download.
+Each platform includes a compatible system image that you can run in an AVD, to
+test your application. </p>
+
+<h3 id="bc">Application backward compatibility</h3>
+
+<p>Android applications are not necessarily backward compatible with versions of
+the Android platform older than the version against which they were compiled.
+</p>
+
+<p>Each new version of the Android platform can include new framework APIs, such
+as those that give applications access to new platform capabilities or replace
+existing API parts. The new APIs are accessible to applications when running on
+the new platform and, as mentioned above, also when running on later versions of
+the platform, as specified by API Level. Conversely, because earlier versions of
+the platform do not include the new APIs, applications that use the new APIs are
+unable to run on those platforms.</p>
+
+<p>Although it's unlikely that an Android-powered device would be downgraded to
+a previous version of the platform, it's important to realize that there are
+likely to be many devices in the field that run earlier versions of the
+platform. Even among devices that receive OTA updates, some might lag and
+might not receive an update for a significant amount of time. </p>
+
+<h3 id="platform">Selecting a platform version and API Level</h3>
+
+<p>When you are developing your application, you will need to choose
+the platform version against which you will compile the application. In
+general, you should compile your application against the lowest possible
+version of the platform that your application can support.
+
+<p>You can determine the lowest possible platform version by compiling the
+application against successively lower build targets. After you determine the
+lowest version, you should create an AVD using the corresponding platform
+version (and API Level) and fully test your application. Make sure to declare a
+<code>android:minSdkVersion</code> attribute in the application's manifest and
+set its value to the API Level of the platform version. </p>
+
+<h3 id="apilevel">Declaring a minimum API Level</h3>
+
+<p>If you build an application that uses APIs or system features introduced in
+the latest platform version, you should set the
+<code>android:minSdkVersion</code> attribute to the API Level of the latest
+platform version. This ensures that users will only be able to install your
+application if their devices are running a compatible version of the Android
+platform. In turn, this ensures that your application can function properly on
+their devices. </p>
+
+<p>If your application uses APIs introduced in the latest platform version but
+does <em>not</em> declare a <code>android:minSdkVersion</code> attribute, then
+it will run properly on devices running the latest version of the platform, but
+<em>not</em> on devices running earlier versions of the platform. In the latter
+case, the application will crash at runtime when it tries to use APIs that don't
+exist on the earlier versions.</p>
+
+<h3 id="testing">Testing against higher API Levels</h3>
+
+<p>After compiling your application, you should make sure to test it on the
+platform specified in the application's <code>android:minSdkVersion</code>
+attribute. To do so, create an AVD that uses the platform version required by
+your application. Additionally, to ensure forward-compatibility, you should run
+and test the application on all platforms that use a higher API Level than that
+used by your application. </p>
+
+<p>The Android SDK includes multiple platform versions that you can use,
+including the latest version, and provides an updater tool that you can use to
+download other platform versions as necessary. </p>
+
+<p>To access the updater, use the <code>android</code> command-line tool,
+located in the <sdk>/tools directory. You can launch the SDK updater by
+executing <code>android sdk</code>. You can
+also simply double-click the android.bat (Windows) or android (OS X/Linux) file.
+In ADT, you can also access the updater by selecting
+<strong>Window</strong> > <strong>Android SDK
+Manager</strong>.</p>
+
+<p>To run your application against different platform versions in the emulator,
+create an AVD for each platform version that you want to test. For more
+information about AVDs, see <a
+href="{@docRoot}tools/devices/index.html">Creating and Managing Virtual Devices</a>. If
+you are using a physical device for testing, ensure that you know the API Level
+of the Android platform it runs. See the table at the top of this document for
+a list of platform versions and their API Levels. </p>
+
+<h2 id="provisional">Using a Provisional API Level</h2>
+
+<p>In some cases, an "Early Look" Android SDK platform may be available. To let
+you begin developing on the platform although the APIs may not be final, the
+platform's API Level integer will not be specified. You must instead use the
+platform's <em>provisional API Level</em> in your application manifest, in order
+to build applications against the platform. A provisional API Level is not an
+integer, but a string matching the codename of the unreleased platform version.
+The provisional API Level will be specified in the release notes for the Early
+Look SDK release notes and is case-sensitive.</p>
+
+<p>The use of a provisional API Level is designed to protect developers and
+device users from inadvertently publishing or installing applications based on
+the Early Look framework API, which may not run properly on actual devices
+running the final system image.</p>
+
+<p>The provisional API Level will only be valid while using the Early Look SDK
+and can only be used to run applications in the emulator. An application using
+the provisional API Level can never be installed on an Android device. At the
+final release of the platform, you must replace any instances of the provisional
+API Level in your application manifest with the final platform's actual API
+Level integer.</p>
+
+
+<h2 id="filtering">Filtering the Reference Documentation by API Level</h2>
+
+<p>Reference documentation pages on the Android Developers site offer a "Filter
+by API Level" control in the top-right area of each page. You can use the
+control to show documentation only for parts of the API that are actually
+accessible to your application, based on the API Level that it specifies in
+the <code>android:minSdkVersion</code> attribute of its manifest file. </p>
+
+<p>To use filtering, select the checkbox to enable filtering, just below the
+page search box. Then set the "Filter by API Level" control to the same API
+Level as specified by your application. Notice that APIs introduced in a later
+API Level are then grayed out and their content is masked, since they would not
+be accessible to your application. </p>
+
+<p>Filtering by API Level in the documentation does not provide a view
+of what is new or introduced in each API Level — it simply provides a way
+to view the entire API associated with a given API Level, while excluding API
+elements introduced in later API Levels.</p>
+
+<p>If you decide that you don't want to filter the API documentation, just
+disable the feature using the checkbox. By default, API Level filtering is
+disabled, so that you can view the full framework API, regardless of API Level.
+</p>
+
+<p>Also note that the reference documentation for individual API elements
+specifies the API Level at which each element was introduced. The API Level
+for packages and classes is specified as "Since <api level>" at the
+top-right corner of the content area on each documentation page. The API Level
+for class members is specified in their detailed description headers,
+at the right margin. </p>
+
+
+
+
+
+
+
+
+
diff --git a/docs/html/guide/topics/media/camera.jd b/docs/html/guide/topics/media/camera.jd
index 7d72491..a63270a 100644
--- a/docs/html/guide/topics/media/camera.jd
+++ b/docs/html/guide/topics/media/camera.jd
@@ -162,8 +162,7 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
</pre>
<p>For more information about getting user location, see
-<a href="{@docRoot}guide/topics/location/obtaining-user-location.html">Obtaining User
-Location</a>.</p>
+<a href="{@docRoot}guide/topics/location/strategies.html">Location Strategies</a>.</p>
</li>
</ul>
diff --git a/docs/html/guide/topics/media/index.jd b/docs/html/guide/topics/media/index.jd
index 0e0412a..a750c9a 100644
--- a/docs/html/guide/topics/media/index.jd
+++ b/docs/html/guide/topics/media/index.jd
@@ -1,63 +1,56 @@
-page.title=Multimedia and Camera
+page.title=Media and Camera
+page.landing=true
+page.landing.intro=Add video, audio, and photo capabilities to your app with Android's robust APIs for playing and recording media.
+page.landing.image=
+
@jd:body
- <div id="qv-wrapper">
- <div id="qv">
+<div class="landing-docs">
-<h2>Topics</h2>
-<ol>
-<li><a href="{@docRoot}guide/topics/media/mediaplayer.html">Media Playback</a></li>
-<li><a href="{@docRoot}guide/topics/media/jetplayer.html">JetPlayer</a></li>
-<li><a href="{@docRoot}guide/topics/media/camera.html">Camera</a></li>
-<li><a href="{@docRoot}guide/topics/media/audio-capture.html">Audio Capture</a></li>
-</ol>
+ <div class="col-6">
+ <h3>Blog Articles</h3>
+ <a
+href="http://android-developers.blogspot.com/2010/06/allowing-applications-to-play-nicer.html">
+ <h4>Allowing applications to play nice(r) with each other: Handling remote control
+buttons</h4>
+ <p>If your media playback application creates a media playback service, just like Music, that
+responds to the media button events, how will the user know where those events are going to? Music,
+or your new application?</p>
+ </a>
-<h2>Key classes</h2>
-<ol>
-<li>{@link android.media.MediaPlayer}</li>
-<li>{@link android.media.JetPlayer}</li>
-<li>{@link android.hardware.Camera}</li>
-<li>{@link android.media.MediaRecorder}</li>
-<li>{@link android.media.AudioManager}</li>
-<li>{@link android.media.SoundPool}</li>
-</ol>
+ <a
+href="http://android-developers.blogspot.com/2011/11/making-android-games-that-play-nice.html">
+ <h4>Making Android Games that Play Nice</h4>
+ <p>Making a game on Android is easy. Making a great game for a mobile, multitasking, often
+multi-core, multi-purpose system like Android is trickier. Even the best developers frequently make
+mistakes in the way they interact with the Android system and with other applications</p>
+ </a>
-<h2>See also</h2>
-<ol>
-<li></li>
-<li><a href="{@docRoot}guide/appendix/media-formats.html">Android Supported Media Formats</a></li>
-<li><a href="{@docRoot}guide/topics/media/jet/jetcreator_manual.html">JetCreator User
-Manual</a></li>
-</ol>
+ <a href="http://android-developers.blogspot.com/2011/12/more-android-games-that-play-nice.html">
+ <h4>More Android Games that Play Nice</h4>
+ <p>Android users get used to using the back key. We expect the volume keys to work in some
+intuitive fashion. We expect that the home key behaves in a manner consistent with the Android
+navigation paradigm.</p>
+ </a>
+ </div>
-</div>
-</div>
+ <div class="col-6">
+ <h3>Training</h3>
-<p>The Android multimedia framework includes support for capturing and playing audio, video and
-images in a variety of common media types, so that you can easily integrate them into your
-applications. You can play audio or video from media files stored in your application's resources,
-from standalone files in the file system, or from a data stream arriving over a
-network connection, all using the {@link android.media.MediaPlayer} or {@link
-android.media.JetPlayer} APIs. You can also record audio, video and take pictures using the {@link
-android.media.MediaRecorder} and {@link android.hardware.Camera} APIs if supported by the device
-hardware.</p>
+ <a href="http://developer.android.com/training/camera/index.html">
+ <h4>Capturing Photos</h4>
+ <p>This class gets you clicking fast with some super-easy ways of leveraging existing camera
+applications. In later lessons, you dive deeper and learn how to control the camera hardware
+directly.</p>
+ </a>
-<p>The following topics show you how to use the Android framework to implement multimedia capture
-and playback.</p>
+ <a href="http://developer.android.com/training/managing-audio/index.html">
+ <h4>Managing Audio Playback</h4>
+ <p>After this class, you will be able to build apps that respond to hardware audio key
+presses, which request audio focus when playing audio, and which respond appropriately to changes in
+audio focus caused by the system or other applications.</p>
+ </a>
-<dl>
- <dt><strong><a href="{@docRoot}guide/topics/media/mediaplayer.html">Media Playback</a></strong>
- </dt>
- <dd>How to play audio and video in your application.</dd>
+ </div>
- <dt><strong><a href="{@docRoot}guide/topics/media/jetplayer.html">JetPlayer</a></strong></dt>
- <dd>How to play interactive audio and video in your application using content created with
-JetCreator.</dd>
-
- <dt><strong><a href="{@docRoot}guide/topics/media/camera.html">Camera</a></strong></dt>
- <dd>How to use a device camera to take pictures or video in your application.</dd>
-
- <dt><strong><a href="{@docRoot}guide/topics/media/audio-capture.html">Audio
-Capture</a></strong></dt>
- <dd>How to record sound in your application.</dd>
-</dl>
\ No newline at end of file
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/topics/media/mediaplayer.jd b/docs/html/guide/topics/media/mediaplayer.jd
index 002d113..45a58a7 100644
--- a/docs/html/guide/topics/media/mediaplayer.jd
+++ b/docs/html/guide/topics/media/mediaplayer.jd
@@ -457,7 +457,7 @@
</pre>
<p>For more information, see the documentation about <a
-href="{@docRoot}guide/topics/fundamentals/services.html#Foreground">Services</a> and
+href="{@docRoot}guide/components/services.html#Foreground">Services</a> and
<a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Status Bar Notifications</a>.</p>
diff --git a/docs/html/guide/topics/network/sip.jd b/docs/html/guide/topics/network/sip.jd
deleted file mode 100644
index 600da78..0000000
--- a/docs/html/guide/topics/network/sip.jd
+++ /dev/null
@@ -1,490 +0,0 @@
-page.title=Session Initiation Protocol
-@jd:body
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
-
- <li><a href="#requirements">Requirements and Limitations</a></li>
- <li><a href="#classes">Classes and Interfaces</a></li>
- <li><a href="#manifest">Creating the Manifest</a></li>
- <li><a href="#manager">Creating a SIP Manager</a></li>
- <li><a href="#profiles">Registering with a SIP Server</a></li>
- <li><a href="#audio">Making an Audio Call</a></li>
- <li><a href="#receiving">Receiving Calls</a></li>
- <li><a href="#testing">Testing SIP Applications</a></li>
- </ol>
-
- <h2>Key classes</h2>
- <ol>
- <li>{@link android.net.sip.SipManager}</li>
- <li>{@link android.net.sip.SipProfile}</li>
- <li>{@link android.net.sip.SipAudioCall}</li>
-
- </ol>
-
- <h2>Related samples</h2>
- <ol>
- <li> <a href="{@docRoot}resources/samples/SipDemo/index.html"> SipDemo</a></li>
- </ol>
- </div>
-</div>
-
-<p>Android provides an API that supports the Session Initiation Protocol (SIP).
-This lets you add SIP-based internet telephony features to your applications.
-Android includes a full SIP protocol stack and integrated call management
-services that let applications easily set up outgoing and incoming voice calls,
-without having to manage sessions, transport-level communication, or audio
-record or playback directly.</p>
-
-<p>Here are examples of the types of applications that might use the SIP API:</p>
-<ul>
- <li>Video conferencing.</li>
- <li>Instant messaging.</li>
-</ul>
-<h2 id="requirements">Requirements and Limitations</h2>
-<p>Here are the requirements for developing a SIP application:</p>
-<ul>
-
- <li>You must have a mobile device that is running Android 2.3 or higher. </li>
-
- <li>SIP runs over a wireless data connection, so your device must have a data
-connection (with a mobile data service or Wi-Fi)</span>. This means that you
-can't test on AVD—you can only test on a physical device. For details, see
-<a href="#testing">Testing SIP Applications</a>.</li>
-
- <li>Each participant in the application's communication session must have a
-SIP account. There are many different SIP providers that offer SIP accounts.</li>
-</ul>
-
-
-<h2 id="classes">SIP API Classes and Interfaces</h2>
-
-<p>Here is a summary of the classes and one interface
-(<code>SipRegistrationListener</code>) that are included in the Android SIP
-API:</p>
-
-<table>
- <thead>
- <tr>
- <th>Class/Interface</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{@link android.net.sip.SipAudioCall}</td>
- <td>Handles an Internet audio call over SIP.</td>
- </tr>
- <tr>
- <td>{@link android.net.sip.SipAudioCall.Listener}</td>
- <td>Listener for events relating to a SIP call, such as when a call is being
-received ("on ringing") or a call is outgoing ("on calling").</td>
- </tr>
- <tr>
- <td>{@link android.net.sip.SipErrorCode}</td>
- <td>Defines error codes returned during SIP actions.</td>
- </tr>
- <tr>
- <td>{@link android.net.sip.SipManager}</td>
- <td>Provides APIs for SIP tasks, such as initiating SIP connections, and provides access
-to related SIP services.</td>
- </tr>
- <tr>
- <td>{@link android.net.sip.SipProfile}</td>
- <td>Defines a SIP profile, including a SIP account, domain and server information.
-</td>
- </tr>
- <tr>
- <td>{@link android.net.sip.SipProfile.Builder}</td>
- <td>Helper class for creating a SipProfile.</td>
- </tr>
- <tr>
- <td>{@link android.net.sip.SipSession}</td>
- <td>Represents a SIP session that is associated with a SIP dialog or a standalone transaction
-not within a dialog.</td>
- </tr>
- <tr>
- <td>{@link android.net.sip.SipSession.Listener}</td>
- <td>Listener for events relating to a SIP session, such as when a session is being registered
-("on registering") or a call is outgoing ("on calling"). </td>
- </tr>
- <tr>
- <td>{@link android.net.sip.SipSession.State}</td>
- <td>Defines SIP session states, such as "registering", "outgoing call", and "in call". </td>
- </tr>
- <tr>
- <td>{@link android.net.sip.SipRegistrationListener}</td>
- <td>An interface that is a listener for SIP registration events.</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="manifest">Creating the Manifest</h2>
-
-<p>If you are developing an application that uses the SIP API, remember that the
-feature is supported only on Android 2.3 (API level 9) and higher versions of
-the platform. Also, among devices running Android 2.3 (API level 9) or higher,
-not all devices will offer SIP support.</p>
-
-<p>To use SIP, add the following permissions to your application's manifest:</p>
-<ul>
- <li><code>android.permission.USE_SIP</code></li>
- <li><code>android.permission.INTERNET</code></li>
-</ul>
-
-<p> To ensure that your application can only be installed on devices that are
-capable of supporting SIP, add the following to your application's
-manifest:</p>
-
-<ul>
- <li><code><uses-sdk android:minSdkVersion="9" /></code>. This
- indicates that your application requires Android 2.3 or higher. For more
-information, see <a href="{@docRoot}guide/appendix/api-levels.html">API
-Levels</a> and the documentation for the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a
-> element.</li>
-</ul>
-
-<p>To control how your application is filtered from devices that do not support
-SIP (for example, on Google Play), add the following to your application's
-manifest:</p>
-
-<ul>
-
- <li><code><uses-feature android:name="android.hardware.sip.voip"
-/></code>. This states that your application uses the SIP API. The
-declaration should include an <code>android:required</code> attribute that
-indicates whether you want the application to be filtered from devices that do
-not offer SIP support. Other <code><uses-feature></code> declarations
-may also be needed, depending on your implementation. For more information,
-see the documentation for the <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-
-feature></a> element.</li>
-
-</ul>
-<p>If your application is designed to receive calls, you must also define a receiver ({@link android.content.BroadcastReceiver} subclass) in the application's manifest: </p>
-
-<ul>
- <li><code><receiver android:name=".IncomingCallReceiver" android:label="Call Receiver"/></code></li>
-</ul>
-<p>Here are excerpts from the <strong>SipDemo</strong> manifest:</p>
-
-
-
-<pre><?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.android.sip">
- ...
- <receiver android:name=".IncomingCallReceiver" android:label="Call Receiver"/>
- ...
- <uses-sdk android:minSdkVersion="9" />
- <uses-permission android:name="android.permission.USE_SIP" />
- <uses-permission android:name="android.permission.INTERNET" />
- ...
- <uses-feature android:name="android.hardware.sip.voip" android:required="true" />
- <uses-feature android:name="android.hardware.wifi" android:required="true" />
- <uses-feature android:name="android.hardware.microphone" android:required="true" />
-</manifest>
-</pre>
-
-
-<h2 id="manager">Creating a SipManager</h2>
-
-<p>To use the SIP API, your application must create a {@link
-android.net.sip.SipManager} object. The {@link android.net.sip.SipManager} takes
-care of the following in your application:</p>
-
-<ul>
- <li>Initiating SIP sessions.</li>
- <li>Initiating and receiving calls.</li>
- <li>Registering and unregistering with a SIP provider.</li>
- <li>Verifying session connectivity.</li>
-</ul>
-<p>You instantiate a new {@link android.net.sip.SipManager} as follows:</p>
-<pre>public SipManager mSipManager = null;
-...
-if(mSipManager == null) {
- mSipManager = SipManager.newInstance(this);
-}</pre>
-<h2 id="profiles">Registering with a SIP Server</h2>
-
-<p>A typical Android SIP application involves one or more users, each of whom
-has a SIP account. In an Android SIP application, each SIP account is
-represented by a {@link android.net.sip.SipProfile} object.</p>
-
-<p>A {@link android.net.sip.SipProfile} defines a SIP profile, including a SIP
-account, and domain and server information. The profile associated with the SIP
-account on the device running the application is called the <em>local
-profile</em>. The profile that the session is connected to is called the
-<em>peer profile</em>. When your SIP application logs into the SIP server with
-the local {@link android.net.sip.SipProfile}, this effectively registers the
-device as the location to send SIP calls to for your SIP address.</p>
-
-<p>This section shows how to create a {@link android.net.sip.SipProfile},
-register it with a SIP server, and track registration events.</p>
-
-<p>You create a {@link android.net.sip.SipProfile} object as follows:</p>
-<pre>
-public SipProfile mSipProfile = null;
-...
-
-SipProfile.Builder builder = new SipProfile.Builder(username, domain);
-builder.setPassword(password);
-mSipProfile = builder.build();</pre>
-
-<p>The following code excerpt opens the local profile for making calls and/or
-receiving generic SIP calls. The caller can make subsequent calls through
-<code>mSipManager.makeAudioCall</code>. This excerpt also sets the action
-<code>android.SipDemo.INCOMING_CALL</code>, which will be used by an intent
-filter when the device receives a call (see <a href="#intent_filter">Setting up
-an intent filter to receive calls</a>). This is the registration step:</p>
-
-<pre>Intent intent = new Intent();
-intent.setAction("android.SipDemo.INCOMING_CALL");
-PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, Intent.FILL_IN_DATA);
-mSipManager.open(mSipProfile, pendingIntent, null);</pre>
-
-<p>Finally, this code sets a <code>SipRegistrationListener</code> on the {@link
-android.net.sip.SipManager}. This tracks whether the {@link
-android.net.sip.SipProfile} was successfully registered with your SIP service
-provider:<br>
-</p>
-
-<pre>mSipManager.setRegistrationListener(mSipProfile.getUriString(), new SipRegistrationListener() {
-
-public void onRegistering(String localProfileUri) {
- updateStatus("Registering with SIP Server...");
-}
-
-public void onRegistrationDone(String localProfileUri, long expiryTime) {
- updateStatus("Ready");
-}
-
-public void onRegistrationFailed(String localProfileUri, int errorCode,
- String errorMessage) {
- updateStatus("Registration failed. Please check settings.");
-}</pre>
-
-
-<p>When your application is done using a profile, it should close it to free
-associated objects into memory and unregister the device from the server. For
-example:</p>
-
-<pre>public void closeLocalProfile() {
- if (mSipManager == null) {
- return;
- }
- try {
- if (mSipProfile != null) {
- mSipManager.close(mSipProfile.getUriString());
- }
- } catch (Exception ee) {
- Log.d("WalkieTalkieActivity/onDestroy", "Failed to close local profile.", ee);
- }
-}</pre>
-
-<h2 id="audio">Making an Audio Call</h2>
-<p>To make an audio call, you must have the following in place:</p>
-<ul>
-
- <li>A {@link android.net.sip.SipProfile} that is making the call (the
-"local profile"), and a valid SIP address to receive the call (the
-"peer profile").
-
- <li>A {@link android.net.sip.SipManager} object. </li>
-</ul>
-
-<p>To make an audio call, you should set up a {@link
-android.net.sip.SipAudioCall.Listener}. Much of the client's interaction with
-the SIP stack happens through listeners. In this snippet, you see how the {@link
-android.net.sip.SipAudioCall.Listener} sets things up after the call is
-established:</p>
-
-<pre>
-SipAudioCall.Listener listener = new SipAudioCall.Listener() {
-
- @Override
- public void onCallEstablished(SipAudioCall call) {
- call.startAudio();
- call.setSpeakerMode(true);
- call.toggleMute();
- ...
- }
-
- @Override
- public void onCallEnded(SipAudioCall call) {
- // Do something.
- }
-};</pre>
-
-<p>Once you've set up the {@link android.net.sip.SipAudioCall.Listener}, you can
-make the call. The {@link android.net.sip.SipManager} method
-<code>makeAudioCall</code> takes the following parameters:</p>
-
-<ul>
- <li>A local SIP profile (the caller).</li>
- <li>A peer SIP profile (the user being called).</li>
-
- <li>A {@link android.net.sip.SipAudioCall.Listener} to listen to the call
-events from {@link android.net.sip.SipAudioCall}. This can be <code>null</code>,
-but as shown above, the listener is used to set things up once the call is
-established.</li>
-
- <li>The timeout value, in seconds.</li>
-</ul>
-<p>For example:</p>
-<pre> call = mSipManager.makeAudioCall(mSipProfile.getUriString(), sipAddress, listener, 30);</pre>
-
-<h2 id="receiving">Receiving Calls</h2>
-
-<p>To receive calls, a SIP application must include a subclass of {@link
-android.content.BroadcastReceiver} that has the ability to respond to an intent
-indicating that there is an incoming call. Thus, you must do the following in
-your application:</p>
-
-<ul>
- <li>In <code>AndroidManifest.xml</code>, declare a
-<code><receiver></code>. In <strong>SipDemo</strong>, this is
-<code><receiver android:name=".IncomingCallReceiver"
-android:label="Call Receiver"/></code>.</li>
-
- <li>Implement the receiver, which is a subclass of {@link
-android.content.BroadcastReceiver}. In <strong>SipDemo</strong>, this is
-<code>IncomingCallReceiver</code>.</li>
-
- <li>Initialize the local profile ({@link android.net.sip.SipProfile}) with a
-pending intent that fires your receiver when someone calls the local profile.
-</li>
-
- <li>Set up an intent filter that filters by the action that represents an
-incoming call. In <strong>SipDemo</strong>, this action is
-<code>android.SipDemo.INCOMING_CALL</code>. </li>
-</ul>
-<h4 id="BroadcastReceiver">Subclassing BroadcastReceiver</h4>
-
-<p>To receive calls, your SIP application must subclass {@link
-android.content.BroadcastReceiver}. <span id="internal-source-marker_0.">The
-Android system handles incoming SIP calls and broadcasts an "incoming
-call"<code></code> intent (as defined by the application) when it receives
-a call.</span> Here is the subclassed {@link android.content.BroadcastReceiver}
-code from <strong>SipDemo</strong>. To see the full example, go to <a
-href="{@docRoot}resources/samples/SipDemo/index.html">SipDemo sample</a>, which
-is included in the SDK samples. For information on downloading and installing
-the SDK samples, see <a
-href="{@docRoot}resources/samples/get.html">
-Getting the Samples</a>. </p>
-
-<pre>/*** Listens for incoming SIP calls, intercepts and hands them off to WalkieTalkieActivity.
- */
-public class IncomingCallReceiver extends BroadcastReceiver {
- /**
- * Processes the incoming call, answers it, and hands it over to the
- * WalkieTalkieActivity.
- * @param context The context under which the receiver is running.
- * @param intent The intent being received.
- */
- @Override
- public void onReceive(Context context, Intent intent) {
- SipAudioCall incomingCall = null;
- try {
- SipAudioCall.Listener listener = new SipAudioCall.Listener() {
- @Override
- public void onRinging(SipAudioCall call, SipProfile caller) {
- try {
- call.answerCall(30);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- };
- WalkieTalkieActivity wtActivity = (WalkieTalkieActivity) context;
- incomingCall = wtActivity.mSipManager.takeAudioCall(intent, listener);
- incomingCall.answerCall(30);
- incomingCall.startAudio();
- incomingCall.setSpeakerMode(true);
- if(incomingCall.isMuted()) {
- incomingCall.toggleMute();
- }
- wtActivity.call = incomingCall;
- wtActivity.updateStatus(incomingCall);
- } catch (Exception e) {
- if (incomingCall != null) {
- incomingCall.close();
- }
- }
- }
-}
-</pre>
-
-<h4 id="intent_filter">Setting up an intent filter to receive calls</h4>
-
-<p>When the SIP service receives a new call, it sends out an intent with the
-action string provided by the application. In SipDemo, this action string is
-<code>android.SipDemo.INCOMING_CALL</code>. </p>
-<p>This code excerpt from <strong>SipDemo</strong> shows how the {@link
-android.net.sip.SipProfile} object gets created with a pending intent based on
-the action string <code>android.SipDemo.INCOMING_CALL</code>. The
-<code>PendingIntent</code> object will perform a broadcast when the {@link
-android.net.sip.SipProfile} receives a call:</p>
-
-<pre>
-public SipManager mSipManager = null;
-public SipProfile mSipProfile = null;
-...
-
-Intent intent = new Intent();
-intent.setAction("android.SipDemo.INCOMING_CALL");
-PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, Intent.FILL_IN_DATA);
-mSipManager.open(mSipProfile, pendingIntent, null);</pre>
-
-<p>The broadcast will be intercepted by the intent filter, which will then fire
-the receiver (<code>IncomingCallReceiver</code>). You can specify an intent
-filter in your application's manifest file, or do it in code as in the <strong>SipDemo</strong>
-sample application's <code>onCreate()</code> method
-of the application's <code>Activity</code>:</p>
-
-<pre>
-public class WalkieTalkieActivity extends Activity implements View.OnTouchListener {
-...
- public IncomingCallReceiver callReceiver;
- ...
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
-
- IntentFilter filter = new IntentFilter();
- filter.addAction("android.SipDemo.INCOMING_CALL");
- callReceiver = new IncomingCallReceiver();
- this.registerReceiver(callReceiver, filter);
- ...
- }
- ...
-}
-</pre>
-
-
-<h2 id="testing">Testing SIP Applications</h2>
-
-<p>To test SIP applications, you need the following:</p>
-<ul>
-<li>A mobile device that is running Android 2.3 or higher. SIP runs over
-wireless, so you must test on an actual device. Testing on AVD won't work.</li>
-<li>A SIP account. There are many different SIP providers that offer SIP accounts.</li>
-<li>If you are placing a call, it must also be to a valid SIP account. </li>
-</ul>
-<p>To test a SIP application:</p>
-<ol>
-
-<li>On your device, connect to wireless (<strong>Settings > Wireless & networks
-> Wi-Fi > Wi-Fi settings</strong>)</li>
-<li>Set up your mobile device for testing, as described in <a
-href="{@docRoot}guide/developing/device.html">Developing on a Device</a>.</li>
-<li>Run your application on your mobile device, as described in <a
-href="{@docRoot}guide/developing/device.html">Developing on a Device</a>.</li>
-
-<li>If you are using Eclipse, you can view the application log output in Eclipse
-using LogCat (<strong>Window > Show View > Other > Android >
-LogCat</strong>).</li>
-</ol>
-
diff --git a/docs/html/guide/topics/nfc/advanced-nfc.jd b/docs/html/guide/topics/nfc/advanced-nfc.jd
deleted file mode 100644
index b43b559..0000000
--- a/docs/html/guide/topics/nfc/advanced-nfc.jd
+++ /dev/null
@@ -1,300 +0,0 @@
-page.title=Advanced NFC
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#tag-tech">Working with Supported Tag Technologies</a>
- <ol>
- <li><a href="#tech-intent">Working with tag technologies and the ACTION_TECH_DISCOVERED
- intent</a></li>
- <li><a href="#read-write">Reading and writing to tags</a></li>
- </ol></li>
- <li><a href="#foreground-dispatch">Using the Foreground Dispatch System</a></li>
- </ol>
-</div>
-</div>
-
-<p>This document describes advanced NFC topics, such as working with various tag technologies,
-writing to NFC tags, and foreground dispatching, which allows an application in the foreground to
-handle intents even when other applications filter for the same ones.</p>
-
-<h2 id="tag-tech">Working with Supported Tag Technologies</h2>
-<p>When working with NFC tags and Android-powered devices, the main format you use to read
-and write data on tags is NDEF. When a device scans a tag with NDEF data, Android provides support
-in parsing the message and delivering it in an {@link android.nfc.NdefMessage} when
-possible. There are cases, however, when you scan a tag that does not contain
-NDEF data or when the NDEF data could not be mapped to a MIME type or URI.
-In these cases, you need to open communication directly with the tag and read and write to it with
-your own protocol (in raw bytes). Android provides generic support for these use cases with the
-{@link android.nfc.tech} package, which is described in <a href="#tech-table">Table 1</a>. You can
-use the {@link android.nfc.Tag#getTechList getTechList()} method to determine the technologies
-supported by the tag and create the corresponding {@link android.nfc.tech.TagTechnology}
-object with one of classes provided by {@link android.nfc.tech} </p>
-
-<p class="table-caption" id="table1">
-<strong>Table 1.</strong> Supported tag technologies</p>
-<table id="tech-table">
-
- <tr>
- <th>Class</th>
-
- <th>Description</th>
- </tr>
-
- <tr>
- <td>{@link android.nfc.tech.TagTechnology}</td>
-
- <td>The interface that all tag technology classes must implement.</td>
- </tr>
-
- <tr>
- <td>{@link android.nfc.tech.NfcA}</td>
-
- <td>Provides access to NFC-A (ISO 14443-3A) properties and I/O operations.</td>
- </tr>
-
- <tr>
- <td>{@link android.nfc.tech.NfcB}</td>
-
- <td>Provides access to NFC-B (ISO 14443-3B) properties and I/O operations.</td>
- </tr>
-
- <tr>
- <td>{@link android.nfc.tech.NfcF}</td>
-
- <td>Provides access to NFC-F (JIS 6319-4) properties and I/O operations.</td>
- </tr>
-
- <tr>
- <td>{@link android.nfc.tech.NfcV}</td>
-
- <td>Provides access to NFC-V (ISO 15693) properties and I/O operations.</td>
- </tr>
-
- <tr>
- <td>{@link android.nfc.tech.IsoDep}</td>
-
- <td>Provides access to ISO-DEP (ISO 14443-4) properties and I/O operations.</td>
- </tr>
-
- <tr>
- <td>{@link android.nfc.tech.Ndef}</td>
-
- <td>Provides access to NDEF data and operations on NFC tags that have been formatted as
- NDEF.</td>
- </tr>
-
- <tr>
- <td>{@link android.nfc.tech.NdefFormatable}</td>
-
- <td>Provides a format operations for tags that may be NDEF formattable.</td>
- </tr>
- </table>
-<p>The following tag technlogies are not required to be supported by Android-powered devices.</p>
- <p class="table-caption" id="table2">
-<strong>Table 2.</strong> Optional supported tag technologies</p>
- <table>
- <tr>
- <th>Class</th>
-
- <th>Description</th>
- </tr>
- <tr>
- <td>{@link android.nfc.tech.MifareClassic}</td>
-
- <td>Provides access to MIFARE Classic properties and I/O operations, if this Android device
- supports MIFARE.</td>
- </tr>
-
- <tr>
- <td>{@link android.nfc.tech.MifareUltralight}</td>
-
- <td>Provides access to MIFARE Ultralight properties and I/O operations, if this Android
- device supports MIFARE.</td>
- </tr>
- </table>
-
-<h3 id="tech-intent">Working with tag technologies and the ACTION_TECH_DISCOVERED intent</h3>
-<p>When a device scans a tag that has NDEF data on it, but could not be mapped to a MIME or URI,
-the tag dispatch system tries to start an activity with the {@link
-android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}
-intent. The {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} is also used when a tag
-with non-NDEF data is scanned. Having this fallback allows you to work with the data on the tag
-directly if the tag dispatch system could not parse it for you. The basic steps when working with
-tag technologies are as follows:</p>
-
-<ol>
- <li>Filter for an {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent specifying the
-tag technologies that you want to handle. See <a
-href="{@docRoot}guide/topics/nfc/nfc.html#tech-disc">Filtering for NFC
-intents</a> for more information. In general, the tag dispatch system tries to start a {@link
-android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent when an NDEF message
-cannot be mapped to a MIME type or URI, or if the tag scanned did not contain NDEF data. For
-more information on how this is determined, see <a
-href="{@docRoot}guide/topics/nfc/nfc.html#tag-dispatch">The Tag Dispatch System</a>.</li>
- <li>When your application receives the intent, obtain the {@link android.nfc.Tag} object from
-the intent:
-<pre>Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);</pre></li>
-<li>Obtain an instance of a {@link android.nfc.tech.TagTechnology}, by calling one of the
-<code>get</code> factory methods of the classes in the {@link android.nfc.tech} package. You can
-enumerate the supported technologies of the tag by calling {@link android.nfc.Tag#getTechList
-getTechList()} before calling a <code>get</code> factory method. For example, to obtain an instance
-of {@link android.nfc.tech.MifareUltralight} from a {@link android.nfc.Tag}, do the following:
-
-<pre>
-MifareUltralight.get(intent.getParcelableExtra(NfcAdapter.EXTRA_TAG));
-</pre>
-</li>
-</ol>
-
-
-
-<h3 id="read-write">Reading and writing to tags</h3>
-
-<p>Reading and writing to an NFC tag involves obtaining the tag from the intent and
-opening communication with the tag. You must define your own protocol stack to read and write data
-to the tag. Keep in mind, however, that you can still read and write NDEF data when working
-directly with a tag. It is up to you how you want to structure things. The
-following example shows how to work with a MIFARE Ultralight tag.</p>
-
-<pre>
-package com.example.android.nfc;
-
-import android.nfc.Tag;
-import android.nfc.tech.MifareUltralight;
-import android.util.Log;
-import java.io.IOException;
-import java.nio.charset.Charset;
-
-public class MifareUltralightTagTester {
-
- private static final String TAG = MifareUltralightTagTester.class.getSimpleName();
-
- public void writeTag(Tag tag, String tagText) {
- MifareUltralight ultralight = MifareUltralight.get(tag);
- try {
- ultralight.connect();
- ultralight.writePage(4, "abcd".getBytes(Charset.forName("US-ASCII")));
- ultralight.writePage(5, "efgh".getBytes(Charset.forName("US-ASCII")));
- ultralight.writePage(6, "ijkl".getBytes(Charset.forName("US-ASCII")));
- ultralight.writePage(7, "mnop".getBytes(Charset.forName("US-ASCII")));
- } catch (IOException e) {
- Log.e(TAG, "IOException while closing MifareUltralight...", e);
- } finally {
- try {
- ultralight.close();
- } catch (IOException e) {
- Log.e(TAG, "IOException while closing MifareUltralight...", e);
- }
- }
- }
-
- public String readTag(Tag tag) {
- MifareUltralight mifare = MifareUltralight.get(tag);
- try {
- mifare.connect();
- byte[] payload = mifare.readPages(4);
- return new String(payload, Charset.forName("US-ASCII"));
- } catch (IOException e) {
- Log.e(TAG, "IOException while writing MifareUltralight
- message...", e);
- } finally {
- if (mifare != null) {
- try {
- mifare.close();
- }
- catch (IOException e) {
- Log.e(TAG, "Error closing tag...", e);
- }
- }
- }
- return null;
- }
-}
-</pre>
-
-</pre>
-
- <h2 id="foreground-dispatch">Using the Foreground Dispatch System</h2>
-
- <p>The foreground dispatch system allows an activity to intercept an intent and claim
-priority over other activities that handle the same intent. Using this system involves
- constructing a few data structures for the Android system to be able to send the appropriate
- intents to your application. To enable the foreground dispatch system:</p>
-
- <ol>
- <li>Add the following code in the <code>onCreate()</code> method of your activity:
-
- <ol>
- <li>Create a {@link android.app.PendingIntent} object so the Android system can populate it
- with the details of the tag when it is scanned.
- <pre>
-PendingIntent pendingIntent = PendingIntent.getActivity(
- this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
-</pre>
- </li>
-
- <li>Declare intent filters to handle the intents that you want to intercept. The foreground
- dispatch system checks the specified intent filters with the intent that is received when
- the device scans a tag. If it matches, then your application handles the intent. If it does
- not match, the foreground dispatch system falls back to the intent dispatch system.
- Specifying a <code>null</code> array of intent filters and technology filters, specifies
- that you want to filter for all tags that fallback to the <code>TAG_DISCOVERED</code>
- intent. The code snippet below handles all MIME types for <code>NDEF_DISCOVERED</code>. You
- should only handle the ones that you need.
-<pre>
-IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED);
- try {
- ndef.addDataType("*/*"); /* Handles all MIME based dispatches.
- You should specify only the ones that you need. */
- }
- catch (MalformedMimeTypeException e) {
- throw new RuntimeException("fail", e);
- }
- intentFiltersArray = new IntentFilter[] {ndef, };
-</pre>
- </li>
-
- <li>Set up an array of tag technologies that your application wants to handle. Call the
- <code>Object.class.getName()</code> method to obtain the class of the technology that you
- want to support.
-<pre>
-techListsArray = new String[][] { new String[] { NfcF.class.getName() } };
-</pre>
- </li>
- </ol>
- </li>
-
- <li>Override the following activity lifecycle callbacks and add logic to enable and disable the
- foreground dispatch when the activity loses ({@link android.app.Activity#onPause onPause()})
- and regains ({@link android.app.Activity#onResume onResume()}) focus. {@link
- android.nfc.NfcAdapter#enableForegroundDispatch enableForegroundDispatch()} must be called from
-the main thread and only when the activity is in the foreground (calling in {@link
-android.app.Activity#onResume onResume()} guarantees this). You also need to implement the {@link
- android.app.Activity#onNewIntent onNewIntent} callback to process the data from the scanned NFC
- tag.</li>
-
-<pre>
-public void onPause() {
- super.onPause();
- mAdapter.disableForegroundDispatch(this);
-}
-
-public void onResume() {
- super.onResume();
- mAdapter.enableForegroundDispatch(this, pendingIntent, intentFiltersArray, techListsArray);
-}
-
-public void onNewIntent(Intent intent) {
- Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
- //do something with tagFromIntent
-}
-</pre>
- </li>
- </ol>
-
- <p>See the <a href=
-"{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/ForegroundDispatch.html">
-ForegroundDispatch</a> sample from API Demos for the complete sample.</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/nfc/index.jd b/docs/html/guide/topics/nfc/index.jd
deleted file mode 100644
index b86d72d..0000000
--- a/docs/html/guide/topics/nfc/index.jd
+++ /dev/null
@@ -1,33 +0,0 @@
-page.title=Near Field Communication
-@jd:body
-
- <p>Near Field Communication (NFC) is a set of short-range wireless technologies, typically
- requiring a distance of 4cm or less to initiate a connection. NFC allows you to share small
- payloads of data between an NFC tag and an Android-powered device, or between two Android-powered
- devices.
-
- <p>Tags can range in complexity. Simple tags offer just read and write semantics, sometimes with
- one-time-programmable areas to make the card read-only. More complex tags offer math operations,
- and have cryptographic hardware to authenticate access to a sector. The most sophisticated tags
- contain operating environments, allowing complex interactions with code executing on the tag.
- The data stored in the tag can also be written in a variety of formats, but many of the Android
- framework APIs are based around a <a href="http://www.nfc-forum.org/">NFC Forum</a> standard
- called NDEF (NFC Data Exchange Format).</p>
-
- <dl>
- <dt><strong><a href="{@docRoot}guide/topics/nfc/nfc.html">NFC Basics</a></strong></dt>
- <dd>This document describes how Android handles discovered NFC tags and how it notifies
-applications of data that is relevant to the application. It also goes over how to work with the
-NDEF data in your applications and gives an overview of the framework APIs that support the basic
-NFC feature set of Android.</dd>
-
- <dt><strong><a href="{@docRoot}guide/topics/nfc/advanced-nfc.html">Advanced
- NFC</a></strong></dt>
- <dd>This document goes over the APIs that enable use of the various tag technologies that
- Android supports. When you are not working with NDEF data, or when you are working with NDEF
- data that Android cannot fully understand, you have to manually read or write to the tag in raw
- bytes using your own protocol stack. In these cases, Android provides support to detect
- certain tag technologies and to open communication with the tag using your own protocol
- stack.</dd>
- </dl>
-</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/nfc/nfc.jd b/docs/html/guide/topics/nfc/nfc.jd
deleted file mode 100644
index 834656a..0000000
--- a/docs/html/guide/topics/nfc/nfc.jd
+++ /dev/null
@@ -1,923 +0,0 @@
-page.title=NFC Basics
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#tag-dispatch">The Tag Dispatch System</a>
- <ol>
- <li><a href="#ndef">How NFC tags are mapped to MIME types and URIs</a></li>
- <li><a href="#dispatching">How NFC Tags are Dispatched to Applications</a></li>
- </ol>
- </li>
- <li><a href="#manifest">Requesting NFC Access in the Android Manifest</a></li>
- <li><a href="#filtering-intents">Filtering for Intents</a>
- <ol>
- <li><a href="#ndef-disc">ACTION_NDEF_DISCOVERED</a></li>
- <li><a href="#tech-disc">ACTION_TECH_DISCOVERED</a></li>
- <li><a href="#tag-disc">ACTION_TAG_DISCOVERED</a></li>
- <li><a href="#obtain-info">Obtaining information from intents</a></li>
- </ol>
- </li>
- <li><a href="#creating-records">Creating Common Types of NDEF Records</a>
- <ol>
- <li><a href="#abs-uri">TNF_ABSOLUTE_URI</a></li>
- <li><a href="#mime">TNF_MIME_MEDIA</a></li>
- <li><a href="#well-known-text">TNF_WELL_KNOWN with RTD_TEXT</a></li>
- <li><a href="#well-known-uri">TNF_WELL_KNOWN with RTD_URI</a></li>
- <li><a href="#ext-type">TNF_EXTERNAL_TYPE</a></li>
- <li><a href="#aar">Android Application Records</a></li>
- </ol>
- </li>
- <li><a href="#p2p">Beaming NDEF Messages to Other Devices</a></li>
- </ol>
-</div>
-</div>
-
-<p>This document describes the basic NFC tasks you perform in Android. It explains how to send and
-receive NFC data in the form of NDEF messages and describes the Android framework APIs that support
-these features. For more advanced topics, including a discussion of working with non-NDEF data,
-see <a href="{@docRoot}guide/topics/nfc/advanced-nfc.html">Advanced NFC</a>.</p>
-
-
-<p>There are two major uses cases when working with NDEF data and Android:</p>
-
-<ul>
- <li>Reading NDEF data from an NFC tag</li>
- <li>Beaming NDEF messages from one device to another with <a href="#p2p">Android
-Beam™</a></li>
-</ul>
-
-
-<p>Reading NDEF data from an NFC tag is handled with the <a href="#tag-dispatch">tag dispatch
-system</a>, which analyzes discovered NFC tags, appropriately categorizes the data, and starts
-an application that is interested in the categorized data. An application that wants to handle the
-scanned NFC tag can <a href="#filtering-intents">declare an intent filter</a> and
-request to handle the data.</p>
-
-<p>The Android Beam™ feature allows a device to push an NDEF message onto
-another device by physically tapping the devices together. This interaction provides an easier way
-to send data than other wireless technologies like Bluetooth, because with NFC, no manual device
-discovery or pairing is required. The connection is automatically started when two devices come
-into range. Android Beam is available through a set of NFC APIs, so any application can transmit
-information between devices. For example, the Contacts, Browser, and YouTube applications use
-Android Beam to share contacts, web pages, and videos with other devices.
-</p>
-
-
-<h2 id="tag-dispatch">The Tag Dispatch System</h2>
-
-<p>Android-powered devices are usually looking for NFC tags when the screen
-is unlocked, unless NFC is disabled in the device's Settings menu.
-When an Android-powered device discovers an NFC tag, the desired behavior
-is to have the most appropriate activity handle the intent without asking the user what application
-to use. Because devices scan NFC tags at a very short range, it is likely that making users manually
-select an activity would force them to move the device away from the tag and break the connection.
-You should develop your activity to only handle the NFC tags that your activity cares about to
-prevent the Activity Chooser from appearing.</p>
-
-<p>To help you with this goal, Android provides a special tag dispatch system that analyzes scanned
-NFC tags, parses them, and tries to locate applications that are interested in the scanned data. It
-does this by:</p>
-
-<ol>
- <li>Parsing the NFC tag and figuring out the MIME type or a URI that identifies the data payload
- in the tag.</li>
- <li>Encapsulating the MIME type or URI and the payload into an intent. These first two
- steps are described in <a href="#ndef">How NFC tags are mapped to MIME types and URIs</a>.</li>
- <li>Starts an activity based on the intent. This is described in
- <a href="#dispatching">How NFC Tags are Dispatched to Applications</a>.</li>
-</ol>
-
-<h3 id="ndef">How NFC tags are mapped to MIME types and URIs</h3>
-<p>Before you begin writing your NFC applications, it is important to understand the different
-types of NFC tags, how the tag dispatch system parses NFC tags, and the special work that the tag
-dispatch system does when it detects an NDEF message. NFC tags come in a
-wide array of technologies and can also have data written to them in many different ways.
-Android has the most support for the NDEF standard, which is defined by the <a
-href="http://www.nfc-forum.org/home">NFC Forum</a>.
-</p>
-
-<p>NDEF data is encapsulated inside a message ({@link android.nfc.NdefMessage}) that contains one
-or more records ({@link android.nfc.NdefRecord}). Each NDEF record must be well-formed according to
-the specification of the type of record that you want to create. Android
-also supports other types of tags that do not contain NDEF data, which you can work with by using
-the classes in the {@link android.nfc.tech} package. To learn more
-about these technologies, see the <a href="{@docRoot}guide/topics/nfc/advanced-nfc.html">Advanced
-NFC</a> topic. Working with these other types of tags involves
-writing your own protocol stack to communicate with the tags, so we recommend using NDEF when
-possible for ease of development and maximum support for Android-powered devices.
-</p>
-
-<p class="note"><strong>Note:</strong>
-To download complete NDEF specifications, go to the <a
-href="http://www.nfc-forum.org/specs/spec_license">NFC Forum Specification Download</a> site and see
-<a href="#creating-records">Creating common types of NDEF records</a> for examples of how to
-construct NDEF records. </p>
-
-<p>Now that you have some background in NFC tags, the following sections describe in more detail how
-Android handles NDEF formatted tags. When an Android-powered device scans an NFC tag containing NDEF
-formatted data, it parses the message and tries to figure out the data's MIME type or identifying
-URI. To do this, the system reads the first {@link android.nfc.NdefRecord} inside the {@link
-android.nfc.NdefMessage} to determine how to interpret the entire NDEF message (an NDEF message can
-have multiple NDEF records). In a well-formed NDEF message, the first {@link android.nfc.NdefRecord}
-contains the following fields:
-<dl>
- <dt><strong>3-bit TNF (Type Name Format)</strong></dt>
- <dd>Indicates how to interpret the variable length type field. Valid values are described in
-described in <a href="#table1">Table 1</a>.</dd>
-
- <dt><strong>Variable length type</strong></dt>
- <dd>Describes the type of the record. If using {@link android.nfc.NdefRecord#TNF_WELL_KNOWN}, use
-this field to specify the Record Type Definition (RTD). Valid RTD values are described in <a
-href="#table2">Table 2</a>.</dd>
-
-<dt><strong>Variable length ID</strong></dt>
-<dd>A unique identifier for the record. This field is not used often, but
-if you need to uniquely identify a tag, you can create an ID for it.</dd>
-
-<dt><strong>Variable length payload</strong></dt>
-<dd>The actual data payload that you want to read or write. An NDEF
-message can contain multiple NDEF records, so don't assume the full payload is in the first NDEF
-record of the NDEF message.</dd>
-
-</dl>
-
-<p>The tag dispatch system uses the TNF and type fields to try to map a MIME type or URI to the
-NDEF message. If successful, it encapsulates that information inside of a {@link
-android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} intent along with the actual payload. However, there
-are cases when the tag dispatch system cannot determine the type of data based on the first NDEF
-record. This happens when the NDEF data cannot be mapped to a MIME type or URI, or when the
-NFC tag does not contain NDEF data to begin with. In such cases, a {@link
-android.nfc.Tag} object that has information about the tag's technologies and the payload are
-encapsulated inside of a {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent instead.</p>
-
-<p>
-<a href="#table1">Table 1.</a> describes how the tag dispatch system maps TNF and type
-fields to MIME types or URIs. It also describes which TNFs cannot be mapped to a MIME type or URI.
-In these cases, the tag dispatch system falls back to
-{@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.
-
-<p>For example, if the tag dispatch system encounters a record of type {@link
-android.nfc.NdefRecord#TNF_ABSOLUTE_URI}, it maps the variable length type field of that record
-into a URI. The tag dispatch system encapsulates that URI in the data field of an {@link
-android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} intent along with other information about the tag,
-such as the payload. On the other hand, if it encounters a record of type {@link
-android.nfc.NdefRecord#TNF_UNKNOWN}, it creates an intent that encapsulates the tag's technologies
-instead.</p>
-
-
-<p class="table-caption" id="table1">
- <strong>Table 1.</strong> Supported TNFs and their mappings</p>
-<table id="mappings">
- <tr>
- <th>Type Name Format (TNF)</th>
- <th>Mapping</th>
- </tr>
- <tr>
- <td>{@link android.nfc.NdefRecord#TNF_ABSOLUTE_URI}</td>
- <td>URI based on the type field.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#TNF_EMPTY}</td>
- <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#TNF_EXTERNAL_TYPE}</td>
- <td>URI based on the URN in the type field. The URN is encoded into the NDEF type field in
- a shortened form: <code><em><domain_name>:<service_name></em></code>.
- Android maps this to a URI in the form:
- <code>vnd.android.nfc://ext/<em><domain_name>:<service_name></em></code>.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#TNF_MIME_MEDIA}</td>
- <td>MIME type based on the type field.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#TNF_UNCHANGED}</td>
- <td>Invalid in the first record, so falls back to
- {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#TNF_UNKNOWN}</td>
- <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#TNF_WELL_KNOWN}</td>
- <td>MIME type or URI depending on the Record Type Definition (RTD), which you set in the
-type field. See <a href="#well_known">Table 2.</a> for more information on
-available RTDs and their mappings.</td>
- </tr>
-</table>
-
-<p class="table-caption" id="table2">
- <strong>Table 2.</strong> Supported RTDs for TNF_WELL_KNOWN and their
-mappings</p>
-<table id="well-known">
- <tr>
- <th>Record Type Definition (RTD)</th>
- <th>Mapping</th>
- </tr>
- <tr>
- <td>{@link android.nfc.NdefRecord#RTD_ALTERNATIVE_CARRIER}</td>
- <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#RTD_HANDOVER_CARRIER}</td>
- <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#RTD_HANDOVER_REQUEST}</td>
- <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#RTD_HANDOVER_SELECT}</td>
- <td>Falls back to {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#RTD_SMART_POSTER}</td>
- <td>URI based on parsing the payload.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#RTD_TEXT}</td>
- <td>MIME type of <code>text/plain</code>.</td>
- </tr>
- <td>{@link android.nfc.NdefRecord#RTD_URI}</td>
- <td>URI based on payload.</td>
- </tr>
-</table>
-
-<h3 id="dispatching">How NFC Tags are Dispatched to Applications</h3>
-
-<p>When the tag dispatch system is done creating an intent that encapsulates the NFC tag and its
-identifying information, it sends the intent to an interested application that
-filters for the intent. If more than one application can handle the intent, the Activity Chooser
-is presented so the user can select the Activity. The tag dispatch system defines three intents,
-which are listed in order of highest to lowest priority:</p>
-
-<ol>
- <li>
- {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED}: This intent is used to start an
-Activity when a tag that contains an NDEF payload is scanned and is of a recognized type. This is
-the highest priority intent, and the tag dispatch system tries to start an Activity with this
-intent before any other intent, whenever possible.
- </li>
-
- <li>{@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}: If no activities register to
-handle the {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED}
-intent, the tag dispatch system tries to start an application with this intent. This
-intent is also directly started (without starting {@link
-android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} first) if the tag that is scanned
-contains NDEF data that cannot be mapped to a MIME type or URI, or if the tag does not contain NDEF
-data but is of a known tag technology.
-</li>
-
- <li>{@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}: This intent is started
- if no activities handle the {@link
-android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} or {@link
-android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}
- intents.</li>
- </ol>
-
-<p>The basic way the tag dispatch system works is as follows:</p>
-
-<ol>
- <li>Try to start an Activity with the intent that was created by the tag dispatch system
-when parsing the NFC tag (either
-{@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} or {@link
-android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}).</li>
- <li>If no activities filter for that intent, try to start an Activity with the next
- lowest priority intent (either {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} or {@link
-android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}) until an application filters for the
- intent or until the tag dispatch system tries all possible intents.</li>
- <li>If no applications filter for any of the intents, do nothing.</li>
-</ol>
-
-<img src="{@docRoot}images/nfc_tag_dispatch.png" />
-
-<p class="figure"><strong>Figure 1. </strong> Tag Dispatch System</p>
-
-
-<p>Whenever possible, work with NDEF messages and the {@link
-android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} intent, because it is the most specific out of
-the three. This intent allows you to start your application at a more appropriate time than the
-other two intents, giving the user a better experience.</p>
-
-<h2 id="manifest">Requesting NFC Access in the Android Manifest</h2>
-
- <p>Before you can access a device's NFC hardware and properly handle NFC intents, declare these
- items in your <code>AndroidManifest.xml</code> file:</p>
-
- <ul>
- <li>The NFC <code><uses-permission></code> element to access the NFC hardware:
- <pre>
-<uses-permission android:name="android.permission.NFC" />
-</pre>
- </li>
-
- <li>The minimum SDK version that your application can support. API level 9 only supports
- limited tag dispatch via {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}, and only gives
- access to NDEF messages via the {@link android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES} extra. No
- other tag properties or I/O operations are accessible. API level 10
- includes comprehensive reader/writer support as well as foreground NDEF pushing, and API level
- 14 provides an easier way to push NDEF messages to other devices with Android Beam and extra
- convenience methods to create NDEF records.
-<pre class="pretty-print">
-<uses-sdk android:minSdkVersion="10"/>
-</pre>
- </li>
-
- <li>The <code>uses-feature</code> element so that your application shows up in Google
-Play only for devices that have NFC hardware:
- <pre>
-<uses-feature android:name="android.hardware.nfc" android:required="true" />
-</pre>
-<p>If your application uses NFC functionality, but that functionality is not crucial to your
-application, you can omit the <code>uses-feature</code> element and check for NFC avalailbility at
-runtime by checking to see if {@link android.nfc.NfcAdapter#getDefaultAdapter getDefaultAdapter()}
-is <code>null</code>.</p>
- </li>
- </ul>
-
- <h2 id="filtering-intents">Filtering for NFC Intents</h2>
-
- <p>To start your application when an NFC tag that you want to handle is scanned, your application
-can filter for one, two, or all three of the NFC intents in the Android manifest. However, you
-usually want to filter for the {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} intent for the
-most control of when your application starts. The {@link
-android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent is a fallback for {@link
-android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} when no applications filter for
- {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} or for when the payload is not
-NDEF. Filtering for {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED} is usually too general of a
-category to filter on. Many applications will filter for {@link
-android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} or {@link
-android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} before {@link
-android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}, so your application has a low probability of
-starting. {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED} is only available as a last resort
-for applications to filter for in the cases where no other applications are installed to handle the
-{@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} or {@link
-android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED}intent.</p>
-
-<p>Because NFC tag deployments vary and are many times not under your control, this is not always
-possible, which is why you can fallback to the other two intents when necessary. When you have
-control over the types of tags and data written, it is recommended that you use NDEF to format your
-tags. The following sections describe how to filter for each type of intent.</p>
-
-
-<h3 id="ndef-disc">ACTION_NDEF_DISCOVERED</h3>
-<p>
-To filter for {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED} intents, declare the
-intent filter along with the type of data that you want to filter for. The
-following example filters for {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED}
-intents with a MIME type of <code>text/plain</code>:
-</p>
-<pre>
-<intent-filter>
- <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
- <category android:name="android.intent.category.DEFAULT"/>
- <data android:mimeType="text/plain" />
-</intent-filter>
-</pre>
-<p>The following example filters for a URI in the form of
-<code>http://developer.android.com/index.html</code>.
-<pre>
-<intent-filter>
- <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
- <category android:name="android.intent.category.DEFAULT"/>
- <data android:scheme="http"
- android:host="developer.android.com"
- android:pathPrefix="/index.html" />
-</intent-filter>
-</pre>
-
-
- <h3 id="tech-disc">ACTION_TECH_DISCOVERED</h3>
-
- <p>If your activity filters for the {@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent,
-you must create an XML resource file that specifies the technologies that your activity supports
-within a <code>tech-list</code> set. Your activity is
- considered a match if a <code>tech-list</code> set is a subset of the technologies that are
- supported by the tag, which you can obtain by calling {@link android.nfc.Tag#getTechList
- getTechList()}.</p>
-
- <p>For example, if the tag that is scanned supports MifareClassic, NdefFormatable, and NfcA, your
- <code>tech-list</code> set must specify all three, two, or one of the technologies (and nothing
- else) in order for your activity to be matched.</p>
-
- <p>The following sample defines all of the technologies. You can remove the ones that you do not
- need. Save this file (you can name it anything you wish) in the
- <code><project-root>/res/xml</code> folder.</p>
- <pre>
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <tech-list>
- <tech>android.nfc.tech.IsoDep</tech>
- <tech>android.nfc.tech.NfcA</tech>
- <tech>android.nfc.tech.NfcB</tech>
- <tech>android.nfc.tech.NfcF</tech>
- <tech>android.nfc.tech.NfcV</tech>
- <tech>android.nfc.tech.Ndef</tech>
- <tech>android.nfc.tech.NdefFormatable</tech>
- <tech>android.nfc.tech.MifareClassic</tech>
- <tech>android.nfc.tech.MifareUltralight</tech>
- </tech-list>
-</resources>
-</pre>
-
- <p>You can also specify multiple <code>tech-list</code> sets. Each of the <code>tech-list</code>
- sets is considered independently, and your activity is considered a match if any single
- <code>tech-list</code> set is a subset of the technologies that are returned by {@link
- android.nfc.Tag#getTechList getTechList()}. This provides <code>AND</code> and <code>OR</code>
- semantics for matching technologies. The following example matches tags that can support the
- NfcA and Ndef technologies or can support the NfcB and Ndef technologies:</p>
- <pre>
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <tech-list>
- <tech>android.nfc.tech.NfcA</tech>
- <tech>android.nfc.tech.Ndef</tech>
- </tech-list>
-</resources>
-
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <tech-list>
- <tech>android.nfc.tech.NfcB</tech>
- <tech>android.nfc.tech.Ndef</tech>
- </tech-list>
-</resources>
-</pre>
-
- <p>In your <code>AndroidManifest.xml</code> file, specify the resource file that you just created
- in the <code><meta-data></code> element inside the <code><activity></code>
- element like in the following example:</p>
- <pre>
-<activity>
-...
-<intent-filter>
- <action android:name="android.nfc.action.TECH_DISCOVERED"/>
-</intent-filter>
-
-<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
- android:resource="@xml/nfc_tech_filter" />
-...
-</activity>
-</pre>
-
-<p>For more information about working with tag technologies and the {@link
-android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED} intent, see <a
-href="{@docRoot}guide/topics/nfc/advanced-nfc.html#tag-tech">Working with Supported Tag
-Technologies</a> in the Advanced NFC document.</p>
-<h3 id="tag-disc">ACTION_TAG_DISCOVERED</h3>
-<p>To filter for {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED} use the following intent
-filter:</p>
-
-
-<pre><intent-filter>
- <action android:name="android.nfc.action.TAG_DISCOVERED"/>
-</intent-filter>
-</pre>
-
-
-
-<h3 id="obtain-info">Obtaining information from intents</h3>
-
-<p>If an activity starts because of an NFC intent, you can obtain information about the scanned NFC
-tag from the intent. Intents can contain the following extras depending on the tag that was scanned:
-
-<ul>
- <li>{@link android.nfc.NfcAdapter#EXTRA_TAG} (required): A {@link android.nfc.Tag} object
-representing the scanned tag.</li>
- <li>{@link android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES} (optional): An array of NDEF messages
-parsed from the tag. This extra is mandatory on {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED
-intents.</li>
- <li>{@link android.nfc.NfcAdapter#EXTRA_ID} (optional): The low-level ID of the tag.</li></ul>
-
-<p>To obtain these extras, check to see if your activity was launched with one of
-the NFC intents to ensure that a tag was scanned, and then obtain the extras out of the
-intent. The following example checks for the {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED}
-intent and gets the NDEF messages from an intent extra.</p>
-
-<pre>
-public void onResume() {
- super.onResume();
- ...
- if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) {
- Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
- if (rawMsgs != null) {
- msgs = new NdefMessage[rawMsgs.length];
- for (int i = 0; i < rawMsgs.length; i++) {
- msgs[i] = (NdefMessage) rawMsgs[i];
- }
- }
- }
- //process the msgs array
-}
-</pre>
-
-<p>Alternatively, you can obtain a {@link android.nfc.Tag} object from the intent, which will
-contain the payload and allow you to enumerate the tag's technologies:</p>
-
-<pre>Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);</pre>
-
-
-<h2 id="creating-records">Creating Common Types of NDEF Records</h2>
-<p>This section describes how to create common types of NDEF records to help you when writing to
-NFC tags or sending data with Android Beam. It also describes how to create the corresponding
-intent filter for the record. All of these NDEF record examples should be in the first NDEF
-record of the NDEF message that you are writing to a tag or beaming.</p>
-
-<h3 id="abs-uri">TNF_ABSOLUTE_URI</h3>
-<p>Given the following {@link android.nfc.NdefRecord#TNF_ABSOLUTE_URI} NDEF record, which is
-stored as the first record inside of an {@link android.nfc.NdefMessage}:</p>
-
-<pre>
-NdefRecord uriRecord = new NdefRecord(
- NdefRecord.TNF_ABSOLUTE_URI ,
- "http://developer.android.com/index.html".getBytes(Charset.forName("US-ASCII")),
- new byte[0], new byte[0]);
-</pre>
-
-<p>the intent filter would look like this:</p>
-<pre>
-<intent-filter>
- <action android:name="android.nfc.action.NDEF_DISCOVERED" />
- <category android:name="android.intent.category.DEFAULT" />
- <data android:scheme="http"
- android:host="developer.android.com"
- android:pathPrefix="/index.html" />
-</intent-filter>
-</pre>
-
-
-<h3 id="mime">TNF_MIME_MEDIA</h3>
-<p>Given the following {@link android.nfc.NdefRecord#TNF_MIME_MEDIA} NDEF record, which is stored as
-the first record inside
-of an {@link android.nfc.NdefMessage}:</p>
-<pre>
-NdefRecord mimeRecord = new NdefRecord(
- NdefRecord.TNF_MIME_MEDIA ,
- "application/com.example.android.beam".getBytes(Charset.forName("US-ASCII")),
- new byte[0], "Beam me up, Android!".getBytes(Charset.forName("US-ASCII")));
-</pre>
-
-<p>the intent filter would look like this:</p>
-<pre>
-<intent-filter>
- <action android:name="android.nfc.action.NDEF_DISCOVERED" />
- <category android:name="android.intent.category.DEFAULT" />
- <data android:mimeType="application/com.example.android.beam" />
-</intent-filter>
-</pre>
-
-
-<h3 id="well-known-text">TNF_WELL_KNOWN with RTD_TEXT</h3>
-
-<p>Given the following {@link android.nfc.NdefRecord#TNF_WELL_KNOWN} NDEF record, which is stored as
-the first record inside of an {@link android.nfc.NdefMessage}:</p>
-<pre>
-public NdefRecord createTextRecord(String payload, Locale locale, boolean encodeInUtf8) {
- byte[] langBytes = locale.getLanguage().getBytes(Charset.forName("US-ASCII"));
- Charset utfEncoding = encodeInUtf8 ? Charset.forName("UTF-8") : Charset.forName("UTF-16");
- byte[] textBytes = payload.getBytes(utfEncoding);
- int utfBit = encodeInUtf8 ? 0 : (1 << 7);
- char status = (char) (utfBit + langBytes.length);
- byte[] data = new byte[1 + langBytes.length + textBytes.length];
- data[0] = (byte) status;
- System.arraycopy(langBytes, 0, data, 1, langBytes.length);
- System.arraycopy(textBytes, 0, data, 1 + langBytes.length, textBytes.length);
- NdefRecord record = new NdefRecord(NdefRecord.TNF_WELL_KNOWN,
- NdefRecord.RTD_TEXT, new byte[0], data);
- return record;
-}
-</pre>
-
-<p>the intent filter would look like this:</p>
-<pre>
-<intent-filter>
- <action android:name="android.nfc.action.NDEF_DISCOVERED" />
- <category android:name="android.intent.category.DEFAULT" />
- <data android:mimeType="text/plain" />
-</intent-filter>
-</pre>
-
-
-<h3 id="well-known-uri">TNF_WELL_KNOWN with RTD_URI</h3>
-
-<p>Given the following {@link android.nfc.NdefRecord#TNF_WELL_KNOWN} NDEF record, which is stored as
-the first record inside of an {@link android.nfc.NdefMessage}:</p>
-
-<pre>
-byte[] uriField = "example.com".getBytes(Charset.forName("US-ASCII"));
-byte[] payload = new byte[uriField.length + 1]; //add 1 for the URI Prefix
-byte payload[0] = 0x01; //prefixes http://www. to the URI
-System.arraycopy(uriField, 0, payload, 1, uriField.length); //appends URI to payload
-NdefRecord rtdUriRecord = new NdefRecord(
- NdefRecord.TNF_WELL_KNOWN, NdefRecord.RTD_URI, new byte[0], payload);
-</pre>
-
-<p>the intent filter would look like this:</p>
-
-<pre>
-<intent-filter>
- <action android:name="android.nfc.action.NDEF_DISCOVERED" />
- <category android:name="android.intent.category.DEFAULT" />
- <data android:scheme="http"
- android:host="example.com"
- android:pathPrefix="" />
-</intent-filter>
-</pre>
-
-<h3 id="ext-type">TNF_EXTERNAL_TYPE</h3>
-<p>Given the following {@link android.nfc.NdefRecord#TNF_EXTERNAL_TYPE} NDEF record, which is stored
-as the first record inside of an {@link android.nfc.NdefMessage}:</p>
-
-<pre>
-byte[] payload;
-...
-NdefRecord mimeRecord = new NdefRecord(
- NdefRecord.TNF_EXTERNAL_TYPE, "example.com:externalType", new byte[0], payload);
-</pre>
-
-<p>the intent filter would look like this:</p>
-<pre>
-<intent-filter>
- <action android:name="android.nfc.action.NDEF_DISCOVERED" />
- <category android:name="android.intent.category.DEFAULT" />
- <data android:scheme="vnd.android.nfc"
- android:host="ext"
- android:pathPrefix="/example.com:externalType"/>
-</intent-filter>
-</pre>
-
-
-<p>Use TNF_EXTERNAL_TYPE for more generic NFC tag deployments to better support both
-Android-powered and non-Android-powered devices.</p>
-
-<p class="note"><strong>Note</strong>: URNs for {@link
-android.nfc.NdefRecord#TNF_EXTERNAL_TYPE} have a canonical format of:
-<code>urn:nfc:ext:example.com:externalType</code>, however the NFC Forum RTD specification
-declares that the <code>urn:nfc:ext:</code> portion of the URN must be ommitted from the
-NDEF record. So all you need to provide is the domain (<code>example.com</code> in the example)
-and type (<code>externalType</code> in the example) separated by a colon.
-When dispatching TNF_EXTERNAL_TYPE, Android converts the <code>urn:nfc:ext:example.com:externalType</code> URN to a
-<code>vnd.android.nfc://ext/example.com:externalType</code> URI, which is what the intent filter in the example
-declares.</p>
-
-<h3 id="aar">Android Application Records</h3>
-
-<p>
-Introduced in Android 4.0 (API level 14), an Android Application Record (AAR) provides a stronger
-certainty that your application is started when an NFC tag is scanned. An AAR has the package name
-of an application embedded inside an NDEF record. You can add an AAR to any NDEF record of your NDEF message,
-because Android searches the entire NDEF message for AARs. If it finds an AAR, it starts the application based
-on the package name inside the AAR. If the application is not present on the device,
-Google Play is launched to download the application.</p>
-
-<p>AARs are useful if you want to prevent other applications from filtering for the same intent and
-potentially handling specific tags that you have deployed. AARs are only supported at the
-application level, because of the package name constraint, and not at the Activity level as with
-intent filtering. If you want to handle an intent at the Activity level, <a
-href="#filtering-intents">use intent filters</a>.
-</p>
-
-
-
-<p>If a tag contains an AAR, the tag dispatch system dispatches in the following manner:</p>
-<ol>
- <li>Try to start an Activity using an intent filter as normal. If the Activity that matches
-the intent also matches the AAR, start the Activity.</li>
- <li>If the Activity that filters for the intent does not match the
-AAR, if multiple Activities can handle the intent, or if no Activity handles the intent, start the
-application specified by the AAR.</li>
- <li>If no application can start with the AAR, go to Google Play to download the
-application based on the AAR.</li>
-</ol>
-
-</p>
-
-<p class="note"><strong>Note:</strong> You can override AARs and the intent dispatch system with the <a
-href="{@docRoot}guide/topics/nfc/advanced-nfc.html#foreground-dispatch">foreground dispatch
-system</a>, which allows a foreground activity to have priority when an NFC tag is discovered.
-With this method, the activity must be in the foreground to
-override AARs and the intent dispatch system.</p>
-
-<p>If you still want to filter for scanned tags that do not contain an AAR, you can declare
-intent filters as normal. This is useful if your application is interested in other tags
-that do not contain an AAR. For example, maybe you want to guarantee that your application handles
-proprietary tags that you deploy as well as general tags deployed by third parties. Keep in mind
-that AARs are specific to Android 4.0 devices or later, so when deploying tags, you most likely want
-to use a combination of AARs and MIME types/URIs to support the widest range of devices. In
-addition, when you deploy NFC tags, think about how you want to write your NFC tags to enable
-support for the most devices (Android-powered and other devices). You can do this by
-defining a relatively unique MIME type or URI to make it easier for applications to distinguish.
-</p>
-
-<p>Android provides a simple API to create an AAR,
-{@link android.nfc.NdefRecord#createApplicationRecord createApplicationRecord()}. All you need to
-do is embed the AAR anywhere in your {@link android.nfc.NdefMessage}. You do not want
-to use the first record of your {@link android.nfc.NdefMessage}, unless the AAR is the only
-record in the {@link android.nfc.NdefMessage}. This is because the Android
-system checks the first record of an {@link android.nfc.NdefMessage} to determine the MIME type or
-URI of the tag, which is used to create an intent for applications to filter. The following code
-shows you how to create an AAR:</p>
-
-<pre>
-NdefMessage msg = new NdefMessage(
- new NdefRecord[] {
- ...,
- NdefRecord.createApplicationRecord("com.example.android.beam")}
-</pre>
-
-
-<h2 id="p2p">Beaming NDEF Messages to Other Devices</h2>
-
-<p>Android Beam allows simple peer-to-peer data exchange between two Android-powered devices. The
-application that wants to beam data to another device must be in the foreground and the device
-receiving the data must not be locked. When the beaming device comes in close enough contact with a
-receiving device, the beaming device displays the "Touch to Beam" UI. The user can then choose
-whether or not to beam the message to the receiving device.</p>
-
-<p class="note"><strong>Note:</strong> Foreground NDEF pushing was available at API level 10,
-which provides similar functionality to Android Beam. These APIs have since been deprecated, but
-are available to support older devices. See {@link android.nfc.NfcAdapter#enableForegroundNdefPush
-enableForegroundNdefPush()} for more information.</p>
-
-<p>You can enable Android Beam for your application by calling one of the two methods:</p>
- <ul>
- <li>{@link android.nfc.NfcAdapter#setNdefPushMessage setNdefPushMessage()}: Accepts an
-{@link android.nfc.NdefMessage} to set as the message to beam. Automatically beams the message
-when two devices are in close enough proximity.</li>
- <li>{@link android.nfc.NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback()}:
-Accepts a callback that contains a
-{@link android.nfc.NfcAdapter.CreateNdefMessageCallback#createNdefMessage createNdefMessage()}
-which is called when a device is in range to beam data to. The callback lets you create
-the NDEF message only when necessary.</li>
- </ul>
-
-<p>An activity can only push one NDEF message at a time, so {@link
-android.nfc.NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback()} takes precedence
-over {@link android.nfc.NfcAdapter#setNdefPushMessage setNdefPushMessage()} if both are set. To use
-Android Beam, the following general guidelines must be met:
-</p>
-
- <ul>
- <li>The activity that is beaming the data must be in the foreground. Both devices must have
-their screens unlocked.</li>
-
- <li>You must encapsulate the data that you are beaming in an {@link android.nfc.NdefMessage}
- object.</li>
-
- <li>The NFC device that is receiving the beamed data must support the
- <code>com.android.npp</code> NDEF push protocol or NFC Forum's SNEP (Simple NDEF Exchange
-Protocol). The <code>com.android.npp</code> protocol is required for devices on API level 9 (Android
-2.3) to API level 13 (Android 3.2). <code>com.android.npp</code> and SNEP are both required on
-API level 14 (Android 4.0) and later.</li>
-</li>
- </ul>
-
- <p class="note"><strong>Note:</strong> If your activity enables Android Beam and is
-in the foreground, the standard intent dispatch system is disabled. However, if your activity also
-enables <a href="{@docRoot}guide/topics/nfc/advanced-nfc.html#foreground-dispatch">foreground
-dispatching</a>, then it can still scan tags that match the intent filters set in the foreground
-dispatching.</p>
-
- <p>To enable Android Beam:</p>
-
- <ol>
- <li>Create an {@link android.nfc.NdefMessage} that contains the {@link android.nfc.NdefRecord}s
-that you want to push onto the other device.</li>
-
- <li>Call {@link
-android.nfc.NfcAdapter#setNdefPushMessage setNdefPushMessage()} with a {@link
-android.nfc.NdefMessage} or call {@link
-android.nfc.NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback} passing in a {@link
-android.nfc.NfcAdapter.CreateNdefMessageCallback} object in the <code>onCreate()</code> method of
-your activity. These methods require at least one activity that you want to enable with Android
-Beam, along with an optional list of other activities to activate.
-
-<p>In general, you normally use {@link
-android.nfc.NfcAdapter#setNdefPushMessage setNdefPushMessage()} if your Activity only needs to
-push the same NDEF message at all times, when two devices are in range to communicate. You use
-{@link android.nfc.NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback} when your
-application cares about the current context of the application and wants to push an NDEF message
-depending on what the user is doing in your application.</p>
- </li>
- </ol>
-
-<p>The following sample shows how a simple activity calls {@link
-android.nfc.NfcAdapter.CreateNdefMessageCallback} in the <code>onCreate()</code> method of an
-activity (see <a href="{@docRoot}resources/samples/AndroidBeamDemo/index.html">AndroidBeamDemo</a>
-for the complete sample). This example also has methods to help you create a MIME record:</p>
-
-<pre id="code-example">
-package com.example.android.beam;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.nfc.NdefMessage;
-import android.nfc.NdefRecord;
-import android.nfc.NfcAdapter;
-import android.nfc.NfcAdapter.CreateNdefMessageCallback;
-import android.nfc.NfcEvent;
-import android.os.Bundle;
-import android.os.Parcelable;
-import android.widget.TextView;
-import android.widget.Toast;
-import java.nio.charset.Charset;
-
-
-public class Beam extends Activity implements CreateNdefMessageCallback {
- NfcAdapter mNfcAdapter;
- TextView textView;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- TextView textView = (TextView) findViewById(R.id.textView);
- // Check for available NFC Adapter
- mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
- if (mNfcAdapter == null) {
- Toast.makeText(this, "NFC is not available", Toast.LENGTH_LONG).show();
- finish();
- return;
- }
- // Register callback
- mNfcAdapter.setNdefPushMessageCallback(this, this);
- }
-
- @Override
- public NdefMessage createNdefMessage(NfcEvent event) {
- String text = ("Beam me up, Android!\n\n" +
- "Beam Time: " + System.currentTimeMillis());
- NdefMessage msg = new NdefMessage(
- new NdefRecord[] { createMimeRecord(
- "application/com.example.android.beam", text.getBytes())
- /**
- * The Android Application Record (AAR) is commented out. When a device
- * receives a push with an AAR in it, the application specified in the AAR
- * is guaranteed to run. The AAR overrides the tag dispatch system.
- * You can add it back in to guarantee that this
- * activity starts when receiving a beamed message. For now, this code
- * uses the tag dispatch system.
- */
- //,NdefRecord.createApplicationRecord("com.example.android.beam")
- });
- return msg;
- }
-
- @Override
- public void onResume() {
- super.onResume();
- // Check to see that the Activity started due to an Android Beam
- if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) {
- processIntent(getIntent());
- }
- }
-
- @Override
- public void onNewIntent(Intent intent) {
- // onResume gets called after this to handle the intent
- setIntent(intent);
- }
-
- /**
- * Parses the NDEF Message from the intent and prints to the TextView
- */
- void processIntent(Intent intent) {
- textView = (TextView) findViewById(R.id.textView);
- Parcelable[] rawMsgs = intent.getParcelableArrayExtra(
- NfcAdapter.EXTRA_NDEF_MESSAGES);
- // only one message sent during the beam
- NdefMessage msg = (NdefMessage) rawMsgs[0];
- // record 0 contains the MIME type, record 1 is the AAR, if present
- textView.setText(new String(msg.getRecords()[0].getPayload()));
- }
-
- /**
- * Creates a custom MIME type encapsulated in an NDEF record
- */
- public NdefRecord createMimeRecord(String mimeType, byte[] payload) {
- byte[] mimeBytes = mimeType.getBytes(Charset.forName("US-ASCII"));
- NdefRecord mimeRecord = new NdefRecord(
- NdefRecord.TNF_MIME_MEDIA, mimeBytes, new byte[0], payload);
- return mimeRecord;
- }
-}
-</pre>
-
-<p>Note that this code comments out an AAR, which you can remove. If you enable the AAR, the
-application specified in the AAR always receives the Android Beam message. If the application is not
-present, Google Play launches to download the application. Therefore, the following intent
-filter is not technically necessary for Android 4.0 devices or later if the AAR is used:
-</p>
-
-<pre>
-<intent-filter>
- <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
- <category android:name="android.intent.category.DEFAULT"/>
- <data android:mimeType="application/com.example.android.beam"/>
-</intent-filter>
-</pre>
-<p>With this intent filter, the <code>com.example.android.beam</code> application now can be started
-when it scans an NFC tag or receives an Android Beam with an AAR of
-type <code>com.example.android.beam</code>, or when an NDEF formatted message contains a MIME record
-of type <code>application/com.example.android.beam</code>.</p>
-
-<p>Even though AARs guarantee an application is started or downloaded, intent filters are
-recommended, because they let you start an Activity of your choice in your
-application instead of always starting the main Activity within the package specified by an AAR.
-AARs do not have Activity level granularity. Also, because some Android-powered devices do not
-support AARs, you should also embed identifying information in the first NDEF record of your NDEF
-messages and filter for that as well, just in case. See <a href="#creating-records">Creating Common
-Types of NDEF records</a> for more information on how to create records.
-</p>
diff --git a/docs/html/guide/topics/providers/calendar-provider.jd b/docs/html/guide/topics/providers/calendar-provider.jd
index d30dda4..f53b062 100644
--- a/docs/html/guide/topics/providers/calendar-provider.jd
+++ b/docs/html/guide/topics/providers/calendar-provider.jd
@@ -250,27 +250,30 @@
<h3 id="query">Querying a calendar</h3>
-<p>Here is an example that shows how to get all the calendars for a particular
+<p>Here is an example that shows how to get the calendars that are owned by a particular
user. For simplicity's sake, in this example the query operation is shown in the
user interface thread ("main thread"). In practice, this should be done in an asynchronous
thread instead of on the main thread. For more discussion, see
-<a href="{@docRoot}guide/topics/fundamentals/loaders.html">Loaders</a>. If you are not just reading data but modifying it, see {@link android.content.AsyncQueryHandler}.
+<a href="{@docRoot}guide/components/loaders.html">Loaders</a>. If you are not just
+reading data but modifying it, see {@link android.content.AsyncQueryHandler}.
</p>
<pre>
- // Projection array. Creating indices for this array instead of doing
- // dynamic lookups improves performance.
- public static final String[] EVENT_PROJECTION = new String[] {
+// Projection array. Creating indices for this array instead of doing
+// dynamic lookups improves performance.
+public static final String[] EVENT_PROJECTION = new String[] {
Calendars._ID, // 0
Calendars.ACCOUNT_NAME, // 1
- Calendars.CALENDAR_DISPLAY_NAME // 2
- };
+ Calendars.CALENDAR_DISPLAY_NAME, // 2
+ Calendars.OWNER_ACCOUNT // 3
+};
- // The indices for the projection array above.
- private static final int PROJECTION_ID_INDEX = 0;
- private static final int PROJECTION_ACCOUNT_NAME_INDEX = 1;
- private static final int PROJECTION_DISPLAY_NAME_INDEX = 2;</pre>
+// The indices for the projection array above.
+private static final int PROJECTION_ID_INDEX = 0;
+private static final int PROJECTION_ACCOUNT_NAME_INDEX = 1;
+private static final int PROJECTION_DISPLAY_NAME_INDEX = 2;
+private static final int PROJECTION_OWNER_ACCOUNT_INDEX = 3;</pre>
<div class="sidebox-wrapper"> <div class="sidebox"> <h3>Why must you include
@@ -291,11 +294,15 @@
<p> In the next part of the example, you construct your query. The selection
specifies the criteria for the query. In this example the query is looking for
-all calendars that have the <code>ACCOUNT_NAME</code>
-"sampleuser@google.com" and the <code>ACCOUNT_TYPE</code>
-"com.google". The query returns a {@link android.database.Cursor}
+calendars that have the <code>ACCOUNT_NAME</code>
+"sampleuser@google.com", the <code>ACCOUNT_TYPE</code>
+"com.google", and the <code>OWNER_ACCOUNT</code>
+"sampleuser@google.com". If you want to see all calendars that a user
+has viewed, not just calendars the user owns, omit the <code>OWNER_ACCOUNT</code>.
+The query returns a {@link android.database.Cursor}
object that you can use to traverse the result set returned by the database
-query. For more discussion of using queries in content providers, see <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.</p>
+query. For more discussion of using queries in content providers,
+see <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.</p>
<pre>// Run query
@@ -303,8 +310,10 @@
ContentResolver cr = getContentResolver();
Uri uri = Calendars.CONTENT_URI;
String selection = "((" + Calendars.ACCOUNT_NAME + " = ?) AND ("
- + Calendars.ACCOUNT_TYPE + " = ?))";
-String[] selectionArgs = new String[] {"sampleuser@gmail.com", "com.google"};
+ + Calendars.ACCOUNT_TYPE + " = ?) AND ("
+ + Calendars.OWNER_ACCOUNT + " = ?))";
+String[] selectionArgs = new String[] {"sampleuser@gmail.com", "com.google",
+ "sampleuser@gmail.com"};
// Submit the query and get a Cursor object back.
cur = cr.query(uri, EVENT_PROJECTION, selection, selectionArgs, null);</pre>
@@ -316,12 +325,14 @@
while (cur.moveToNext()) {
long calID = 0;
String displayName = null;
- String accountName = null;
+ String accountName = null;
+ String ownerName = null;
// Get the field values
calID = cur.getLong(PROJECTION_ID_INDEX);
displayName = cur.getString(PROJECTION_DISPLAY_NAME_INDEX);
accountName = cur.getString(PROJECTION_ACCOUNT_NAME_INDEX);
+ ownerName = cur.getString(PROJECTION_OWNER_ACCOUNT_INDEX);
// Do something with the values...
@@ -1179,5 +1190,3 @@
</pre>
<p>For a sample implementation of a sync adapter (not specifically related to Calendar), see
<a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">SampleSyncAdapter</a>.
-</body>
-</html>
diff --git a/docs/html/guide/topics/providers/contacts-provider.jd b/docs/html/guide/topics/providers/contacts-provider.jd
new file mode 100644
index 0000000..e3b998a
--- /dev/null
+++ b/docs/html/guide/topics/providers/contacts-provider.jd
@@ -0,0 +1,2361 @@
+page.title=Contacts Provider
+@jd:body
+<div id="qv-wrapper">
+<div id="qv">
+<h2>Quickview</h2>
+<ul>
+ <li>Android's repository of information about people.</li>
+ <li>
+ Syncs with the web.
+ </li>
+ <li>
+ Integrates social stream data.
+ </li>
+</ul>
+<h2>In this document</h2>
+<ol>
+ <li>
+ <a href="#InformationTypes">Contacts Provider Organization</a>
+ </li>
+ <li>
+ <a href="#RawContactBasics">Raw contacts</a>
+ </li>
+ <li>
+ <a href="#DataBasics">Data</a>
+ </li>
+ <li>
+ <a href="#ContactBasics">Contacts</a>
+ </li>
+ <li>
+ <a href="#Sources">Data From Sync Adapters</a>
+ </li>
+ <li>
+ <a href="#Permissions">Required Permissions</a>
+ </li>
+ <li>
+ <a href="#UserProfile">The User Profile</a>
+ </li>
+ <li>
+ <a href="#ContactsProviderMetadata">Contacts Provider Metadata</a>
+ </li>
+ <li>
+ <a href="#Access">Contacts Provider Access</a>
+ <li>
+ </li>
+ <li>
+ <a href="#SyncAdapters">Contacts Provider Sync Adapters</a>
+ </li>
+ <li>
+ <a href="#SocialStream">Social Stream Data</a>
+ </li>
+ <li>
+ <a href="#AdditionalFeatures">Additional Contacts Provider Features</a>
+ </li>
+</ol>
+<h2>Key classes</h2>
+<ol>
+ <li>{@link android.provider.ContactsContract.Contacts}</li>
+ <li>{@link android.provider.ContactsContract.RawContacts}</li>
+ <li>{@link android.provider.ContactsContract.Data}</li>
+ <li>{@link android.provider.ContactsContract.StreamItems}</li>
+</ol>
+<h2>Related Samples</h2>
+<ol>
+ <li>
+ <a href="{@docRoot}resources/samples/ContactManager/index.html">
+ Contact Manager
+ </a>
+ </li>
+ <li>
+ <a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">
+ Sample Sync Adapter</a>
+ </li>
+</ol>
+<h2>See Also</h2>
+<ol>
+ <li>
+ <a href="{@docRoot}guide/topics/providers/content-provider-basics.html">
+ Content Provider Basics
+ </a>
+ </li>
+</ol>
+</div>
+</div>
+<p>
+ The Contacts Provider is a powerful and flexible Android component that manages the
+ device's central repository of data about people. The Contacts Provider is the source of data
+ you see in the device's contacts application, and you can also access its data in your own
+ application and transfer data between the device and online services. The provider accommodates
+ a wide range of data sources and tries to manage as much data as possible for each person, with
+ the result that its organization is complex. Because of this, the provider's API includes an
+ extensive set of contract classes and interfaces that facilitate both data retrieval and
+ modification.
+</p>
+<p>
+ This guide describes the following:
+</p>
+ <ul>
+ <li>
+ The basic provider structure.
+ </li>
+ <li>
+ How to retrieve data from the provider.
+ </li>
+ <li>
+ How to modify data in the provider.
+ </li>
+ <li>
+ How to write a sync adapter for synchronizing data from your server to the
+ Contacts Provider.
+ </li>
+ </ul>
+<p>
+ This guide assumes that you know the basics of Android content providers. To learn more
+ about Android content providers, read the
+ <a href="{@docRoot}guide/topics/providers/content-provider-basics.html">
+ Content Provider Basics</a> guide. The
+ <a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">Sample Sync Adapter</a>
+ sample app is an example of using a sync adapter to transfer data between the Contacts
+ Provider and a sample application hosted by Google Web Services.
+</p>
+<h2 id="InformationTypes">Contacts Provider Organization</h2>
+<p>
+ The Contacts Provider is an Android content provider component. It maintains three types of
+ data about a person, each of which corresponds to a table offered by the provider, as
+ illustrated in figure 1:
+</p>
+<img src="{@docRoot}images/providers/contacts_structure.png" alt=""
+ height="364" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Contacts Provider table structure.
+</p>
+<p>
+ The three tables are commonly referred to by the names of their contract classes. The classes
+ define constants for content URIs, column names, and column values used by the tables:
+</p>
+<dl>
+ <dt>
+ {@link android.provider.ContactsContract.Contacts} table
+ </dt>
+ <dd>
+ Rows representing different people, based on aggregations of raw contact rows.
+ </dd>
+ <dt>
+ {@link android.provider.ContactsContract.RawContacts} table
+ </dt>
+ <dd>
+ Rows containing a summary of a person's data, specific to a user account and type.
+ </dd>
+ <dt>
+ {@link android.provider.ContactsContract.Data} table
+ </dt>
+ <dd>
+ Rows containing the details for raw contact, such as email addresses or phone numbers.
+ </dd>
+</dl>
+<p>
+ The other tables represented by contract classes in {@link android.provider.ContactsContract}
+ are auxiliary tables that the Contacts Provider uses to manage its operations or support
+ specific functions in the device's contacts or telephony applications.
+</p>
+<h2 id="RawContactBasics">Raw contacts</h2>
+<p>
+ A raw contact represents a person's data coming from a single account type and account
+ name. Because the Contacts Provider allows more than one online service as the source of
+ data for a person, the Contacts Provider allows multiple raw contacts for the same person.
+ Multiple raw contacts also allow a user to combine a person's data from more than one account
+ from the same account type.
+</p>
+<p>
+ Most of the data for a raw contact isn't stored in the
+ {@link android.provider.ContactsContract.RawContacts} table. Instead, it's stored in one or more
+ rows in the {@link android.provider.ContactsContract.Data} table. Each data row has a column
+ {@link android.provider.ContactsContract.DataColumns#RAW_CONTACT_ID Data.RAW_CONTACT_ID} that
+ contains the {@link android.provider.BaseColumns#_ID RawContacts._ID} value of its
+ parent {@link android.provider.ContactsContract.RawContacts} row.
+</p>
+<h3 id="RawContactsColumns">Important raw contact columns</h3>
+<p>
+ The important columns in the {@link android.provider.ContactsContract.RawContacts} table are
+ listed in table 1. Please read the notes that follow after the table:
+</p>
+<p class="table-caption" id="table1">
+ <strong>Table 1.</strong> Important raw contact columns.
+</p>
+<table>
+ <tr>
+ <th scope="col">Column name</th>
+ <th scope="col">Use</th>
+ <th scope="col">Notes</th>
+ </tr>
+ <tr>
+ <td>
+ {@link android.provider.ContactsContract.SyncColumns#ACCOUNT_NAME}
+ </td>
+ <td>
+ The account name for the account type that's the source of this raw contact.
+ For example, the account name of a Google account is one of the device owner's Gmail
+ addresses. See the next entry for
+ {@link android.provider.ContactsContract.SyncColumns#ACCOUNT_TYPE} for more
+ information.
+ </td>
+ <td>
+ The format of this name is specific to its account type. It is not
+ necessarily an email address.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ {@link android.provider.ContactsContract.SyncColumns#ACCOUNT_TYPE}
+ </td>
+ <td>
+ The account type that's the source of this raw contact. For example, the account
+ type of a Google account is <code>com.google</code>. Always qualify your account type
+ with a domain identifier for a domain you own or control. This will ensure that your
+ account type is unique.
+ </td>
+ <td>
+ An account type that offers contacts data usually has an associated sync adapter that
+ synchronizes with the Contacts Provider.
+ </tr>
+ <tr>
+ <td>
+ {@link android.provider.ContactsContract.RawContactsColumns#DELETED}
+ </td>
+ <td>
+ The "deleted" flag for a raw contact.
+ </td>
+ <td>
+ This flag allows the Contacts Provider to maintain the row internally until sync
+ adapters are able to delete the row from their servers and then finally delete the row
+ from the repository.
+ </td>
+ </tr>
+</table>
+<h4>Notes</h4>
+<p>
+ The following are important notes about the
+ {@link android.provider.ContactsContract.RawContacts} table:
+</p>
+<ul>
+ <li>
+ A raw contact's name is not stored in its row in
+ {@link android.provider.ContactsContract.RawContacts}. Instead, it's stored in
+ the {@link android.provider.ContactsContract.Data} table, in a
+ {@link android.provider.ContactsContract.CommonDataKinds.StructuredName} row. A raw contact
+ has only one row of this type in the {@link android.provider.ContactsContract.Data} table.
+ </li>
+ <li>
+ <strong>Caution:</strong> To use your own account data in a raw contact row, it must
+ first be registered with the {@link android.accounts.AccountManager}. To do this, prompt
+ users to add the account type and their account name to the list of accounts. If you don't
+ do this, the Contacts Provider will automatically delete your raw contact row.
+ <p>
+ For example, if you want your app to maintain contacts data for your web-based service
+ with the domain {@code com.example.dataservice}, and the user's account for your service
+ is {@code becky.sharp@dataservice.example.com}, the user must first add the account
+ "type" ({@code com.example.dataservice}) and account "name"
+ ({@code becky.smart@dataservice.example.com}) before your app can add raw contact rows.
+ You can explain this requirement to the user in documentation, or you can prompt the
+ user to add the type and name, or both. Account types and account names
+ are described in more detail in the next section.
+ </li>
+</ul>
+<h3 id="RawContactsExample">Sources of raw contacts data</h3>
+<p>
+ To understand how raw contacts work, consider the user "Emily Dickinson" who has the following
+ three user accounts defined on her device:
+</p>
+<ul>
+ <li><code>emily.dickinson@gmail.com</code></li>
+ <li><code>emilyd@gmail.com</code></li>
+ <li>Twitter account "belle_of_amherst"</li>
+</ul>
+<p>
+ This user has enabled <em>Sync Contacts</em> for all three of these accounts in the
+ <em>Accounts</em> settings.
+</p>
+<p>
+ Suppose Emily Dickinson opens a browser window, logs into Gmail as
+ <code>emily.dickinson@gmail.com</code>, opens
+ Contacts, and adds "Thomas Higginson". Later on, she logs into Gmail as
+ <code>emilyd@gmail.com</code> and sends an email to "Thomas Higginson", which automatically
+ adds him as a contact. She also follows "colonel_tom" (Thomas Higginson's Twitter ID) on
+ Twitter.
+</p>
+<p>
+ The Contacts Provider creates three raw contacts as a result of this work:
+</p>
+<ol>
+ <li>
+ A raw contact for "Thomas Higginson" associated with <code>emily.dickinson@gmail.com</code>.
+ The user account type is Google.
+ </li>
+ <li>
+ A second raw contact for "Thomas Higginson" associated with <code>emilyd@gmail.com</code>.
+ The user account type is also Google. There is a second raw contact even
+ though the name is identical to a previous name, because the person was added for a
+ different user account.
+ </li>
+ <li>
+ A third raw contact for "Thomas Higginson" associated with "belle_of_amherst". The user
+ account type is Twitter.
+ </li>
+</ol>
+<h2 id="DataBasics">Data</h2>
+<p>
+ As noted previously, the data for a raw contact is stored in a
+ {@link android.provider.ContactsContract.Data} row that is linked to the raw contact's
+ <code>_ID</code> value. This allows a single raw contact to have multiple instances of the same
+ type of data such as email addresses or phone numbers. For example, if
+ "Thomas Higginson" for {@code emilyd@gmail.com} (the raw contact row for Thomas Higginson
+ associated with the Google account <code>emilyd@gmail.com</code>) has a home email address of
+ <code>thigg@gmail.com</code> and a work email address of
+ <code>thomas.higginson@gmail.com</code>, the Contacts Provider stores the two email address
+ rows and links them both to the raw contact.
+</p>
+<p>
+ Notice that different types of data are stored in this single table. Display name,
+ phone number, email, postal address, photo, and website detail rows are all found in the
+ {@link android.provider.ContactsContract.Data} table. To help manage this, the
+ {@link android.provider.ContactsContract.Data} table has some columns with descriptive names,
+ and others with generic names. The contents of a descriptive-name column have the same meaning
+ regardless of the type of data in the row, while the contents of a generic-name column have
+ different meanings depending on the type of data.
+</p>
+<h3 id="DescriptiveColumns">Descriptive column names</h3>
+<p>
+ Some examples of descriptive column names are:
+</p>
+<dl>
+ <dt>
+ {@link android.provider.ContactsContract.Data#RAW_CONTACT_ID}
+ </dt>
+ <dd>
+ The value of the <code>_ID</code> column of the raw contact for this data.
+ </dd>
+ <dt>
+ {@link android.provider.ContactsContract.Data#MIMETYPE}
+ </dt>
+ <dd>
+ The type of data stored in this row, expressed as a custom MIME type. The Contacts Provider
+ uses the MIME types defined in the subclasses of
+ {@link android.provider.ContactsContract.CommonDataKinds}. These MIME types are open source,
+ and can be used by any application or sync adapter that works with the Contacts Provider.
+ </dd>
+ <dt>
+ {@link android.provider.ContactsContract.DataColumns#IS_PRIMARY}
+ </dt>
+ <dd>
+ If this type of data row can occur more than once for a raw contact, the
+ {@link android.provider.ContactsContract.DataColumns#IS_PRIMARY} column flags
+ the data row that contains the primary data for the type. For example, if
+ the user long-presses a phone number for a contact and selects <strong>Set default</strong>,
+ then the {@link android.provider.ContactsContract.Data} row containing that number
+ has its {@link android.provider.ContactsContract.DataColumns#IS_PRIMARY} column set to a
+ non-zero value.
+ </dd>
+</dl>
+<h3 id="GenericColumns">Generic column names</h3>
+<p>
+ There are 15 generic columns named <code>DATA1</code> through
+ <code>DATA15</code> that are generally available and an additional four generic
+ columns <code>SYNC1</code> through <code>SYNC4</code> that should only be used by sync
+ adapters. The generic column name constants always work, regardless of the type of
+ data the row contains.
+</p>
+<p>
+ The <code>DATA1</code> column is indexed. The Contacts Provider always uses this column for
+ the data that the provider expects will be the most frequent target of a query. For example,
+ in an email row, this column contains the actual email address.
+</p>
+<p>
+ By convention, the column <code>DATA15</code> is reserved for storing Binary Large Object
+ (BLOB) data such as photo thumbnails.
+</p>
+<h3 id="TypeSpecificNames">Type-specific column names</h3>
+<p>
+ To facilitate working with the columns for a particular type of row, the Contacts Provider
+ also provides type-specific column name constants, defined in subclasses of
+ {@link android.provider.ContactsContract.CommonDataKinds}. The constants simply give a
+ different constant name to the same column name, which helps you access data in a row of a
+ particular type.
+</p>
+<p>
+ For example, the {@link android.provider.ContactsContract.CommonDataKinds.Email} class defines
+ type-specific column name constants for a {@link android.provider.ContactsContract.Data} row
+ that has the MIME type
+ {@link android.provider.ContactsContract.CommonDataKinds.Email#CONTENT_ITEM_TYPE
+ Email.CONTENT_ITEM_TYPE}. The class contains the constant
+ {@link android.provider.ContactsContract.CommonDataKinds.Email#ADDRESS} for the email address
+ column. The actual value of
+ {@link android.provider.ContactsContract.CommonDataKinds.Email#ADDRESS} is "data1", which is
+ the same as the column's generic name.
+</p>
+<p class="caution">
+ <strong>Caution:</strong> Don't add your own custom data to the
+ {@link android.provider.ContactsContract.Data} table using a row that has one of the
+ provider's pre-defined MIME types. If you do, you may lose the data or cause the provider to
+ malfunction. For example, you should not add a row with the MIME type
+ {@link android.provider.ContactsContract.CommonDataKinds.Email#CONTENT_ITEM_TYPE
+ Email.CONTENT_ITEM_TYPE} that contains a user name instead of an email address in the
+ column <code>DATA1</code>. If you use your own custom MIME type for the row, then you are free
+ to define your own type-specific column names and use the columns however you wish.
+</p>
+<p>
+ Figure 2 shows how descriptive columns and data columns appear in a
+ {@link android.provider.ContactsContract.Data} row, and how type-specific column names "overlay"
+ the generic column names
+</p>
+<img src="{@docRoot}images/providers/data_columns.png"
+ alt="How type-specific column names map to generic column names"
+ height="311" id="figure2" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> Type-specific column names and generic column names.
+</p>
+<h3 id="ColumnMaps">Type-specific column name classes</h3>
+<p>
+ Table 2 lists the most commonly-used type-specific column name classes:
+</p>
+<p class="table-caption" id="table2">
+ <strong>Table 2.</strong> Type-specific column name classes</p>
+<table>
+ <tr>
+ <th scope="col">Mapping class</th>
+ <th scope="col">Type of data</th>
+ <th scope="col">Notes</th>
+ </tr>
+ <tr>
+ <td>{@link android.provider.ContactsContract.CommonDataKinds.StructuredName}</td>
+ <td>The name data for the raw contact associated with this data row.</td>
+ <td>A raw contact has only one of these rows.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.ContactsContract.CommonDataKinds.Photo}</td>
+ <td>The main photo for the raw contact associated with this data row.</td>
+ <td>A raw contact has only one of these rows.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.ContactsContract.CommonDataKinds.Email}</td>
+ <td>An email address for the raw contact associated with this data row.</td>
+ <td>A raw contact can have multiple email addresses.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.ContactsContract.CommonDataKinds.StructuredPostal}</td>
+ <td>A postal address for the raw contact associated with this data row.</td>
+ <td>A raw contact can have multiple postal addresses.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.ContactsContract.CommonDataKinds.GroupMembership}</td>
+ <td>An identifier that links the raw contact to one of the groups in the Contacts Provider.</td>
+ <td>
+ Groups are an optional feature of an account type and account name. They're described in
+ more detail in the section <a href="#Groups">Contact groups</a>.
+ </td>
+ </tr>
+</table>
+<h3 id="ContactBasics">Contacts</h3>
+<p>
+ The Contacts Provider combines the raw contact rows across all account types and account names
+ to form a <strong>contact</strong>. This facilitates displaying and modifying all the data a
+ user has collected for a person. The Contacts Provider manages the creation of new contact
+ rows, and the aggregation of raw contacts with an existing contact row. Neither applications nor
+ sync adapters are allowed to add contacts, and some columns in a contact row are read-only.
+</p>
+<p class="note">
+ <strong>Note:</strong> If you try to add a contact to the Contacts Provider with an
+ {@link android.content.ContentResolver#insert(Uri,ContentValues) insert()}, you'll get
+ an {@link java.lang.UnsupportedOperationException} exception. If you try to update a column
+ that's listed as "read-only," the update is ignored.
+</p>
+<p>
+ The Contacts Provider creates a new contact in response to the addition of a new raw contact
+ that doesn't match any existing contacts. The provider also does this if an existing raw
+ contact's data changes in such a way that it no longer matches the contact to which it was
+ previously attached. If an application or sync adapter creates a new raw contact that
+ <em>does</em> match an existing contact, the new raw contact is aggregated to the existing
+ contact.
+</p>
+<p>
+ The Contacts Provider links a contact row to its raw contact rows with the contact row's
+ <code>_ID</code> column in the {@link android.provider.ContactsContract.Contacts Contacts}
+ table. The <code>CONTACT_ID</code> column of the raw contacts table
+ {@link android.provider.ContactsContract.RawContacts} contains <code>_ID</code> values for
+ the contacts row associated with each raw contacts row.
+</p>
+<p>
+ The {@link android.provider.ContactsContract.Contacts} table also has the column
+ {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY} that is a
+ "permanent" link to the contact row. Because the Contacts Provider maintains contacts
+ automatically, it may change a contact row's {@link android.provider.BaseColumns#_ID} value
+ in response to an aggregation or sync. Even If this happens, the content URI
+ {@link android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI} combined with
+ contact's {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY} will still
+ point to the contact row, so you can use
+ {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY}
+ to maintain links to "favorite" contacts, and so forth. This column has its own format that is
+ unrelated to the format of the {@link android.provider.BaseColumns#_ID} column.
+</p>
+<p>
+ Figure 3 shows how the three main tables relate to each other.
+</p>
+<img src="{@docRoot}images/providers/contacts_tables.png" alt="Contacts provider main tables"
+ height="514" id="figure4" />
+<p class="img-caption">
+ <strong>Figure 3.</strong> Contacts, Raw Contacts, and Details table relationships.
+</p>
+<h2 id="Sources">Data From Sync Adapters</h2>
+<p>
+ Users enter contacts data directly into the device, but data also flows into the Contacts
+ Provider from web services via <strong>sync adapters</strong>, which automate
+ the transfer of data between the device and services. Sync adapters run in the background
+ under the control of the system, and they call {@link android.content.ContentResolver} methods
+ to manage data.
+</p>
+<p>
+ In Android, the web service that a sync adapter works with is identified by an account type.
+ Each sync adapter works with one account type, but it can support multiple account names for
+ that type. Account types and account names are described briefly in the section
+ <a href="#RawContactsExample">Sources of raw contacts data</a>. The following definitions offer
+ more detail, and describe how account type and name relate to sync adapters and services.
+</p>
+<dl>
+ <dt>
+ Account type
+ </dt>
+ <dd>
+ Identifies a service in which the user has stored data. Most of the time, the user has to
+ authenticate with the service. For example, Google Contacts is an account type, identified
+ by the code <code>google.com</code>. This value corresponds to the account type used by
+ {@link android.accounts.AccountManager}.
+ </dd>
+ <dt>
+ Account name
+ </dt>
+ <dd>
+ Identifies a particular account or login for an account type. Google Contacts accounts
+ are the same as Google accounts, which have an email address as an account name.
+ Other services may use a single-word username or numeric id.
+ </dd>
+</dl>
+<p>
+ Account types don't have to be unique. A user can configure multiple Google Contacts accounts
+ and download their data to the Contacts Provider; this may happen if the user has one set of
+ personal contacts for a personal account name, and another set for work. Account names are
+ usually unique. Together, they identify a specific data flow between the Contacts Provider and
+ an external service.
+</p>
+<p>
+ If you want to transfer your service's data to the Contacts Provider, you need to write your
+ own sync adapter. This is described in more detail in the section
+ <a href="#SyncAdapters">Contacts Provider Sync Adapters</a>.
+</p>
+<p>
+ Figure 4 shows how the Contacts Provider fits into the flow of data
+ about people. In the box marked "sync adapters," each adapter is labeled by its account type.
+</p>
+<img src="{@docRoot}images/providers/ContactsDataFlow.png" alt="Flow of data about people"
+ height="252" id="figure5" />
+<p class="img-caption">
+ <strong>Figure 4.</strong> The Contacts Provider flow of data.
+</p>
+<h2 id="Permissions">Required Permissions</h2>
+<p>
+ Applications that want to access the Contacts Provider must request the following
+ permissions:
+</p>
+<dl>
+ <dt>Read access to one or more tables</dt>
+ <dd>
+ {@link android.Manifest.permission#READ_CONTACTS}, specified in
+ <code>AndroidManifest.xml</code> with the
+ <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">
+ <uses-permission></a></code> element as
+ <code><uses-permission android:name="android.permission.READ_CONTACTS"></code>.
+ </dd>
+ <dt>Write access to one or more tables</dt>
+ <dd>
+ {@link android.Manifest.permission#WRITE_CONTACTS}, specified in
+ <code>AndroidManifest.xml</code> with the
+ <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">
+ <uses-permission></a></code> element as
+ <code><uses-permission android:name="android.permission.WRITE_CONTACTS"></code>.
+ </dd>
+</dl>
+<p>
+ These permissions do not extend to the user profile data. The user profile and its
+ required permissions are discussed in the following section,
+ <a href="#UserProfile">The User Profile</a>.
+</p>
+<p>
+ Remember that the user's contacts data is personal and sensitive. Users are concerned about
+ their privacy, so they don't want applications collecting data about them or their contacts.
+ If it's not obvious why you need permission to access their contacts data, they may give
+ your application low ratings or simply refuse to install it.
+</p>
+<h2 id="UserProfile">The User Profile</h2>
+<p>
+ The {@link android.provider.ContactsContract.Contacts} table has a single row containing
+ profile data for the device's user. This data describes the device's <code>user</code> rather
+ than one of the user's contacts. The profile contacts row is linked to a raw
+ contacts row for each system that uses a profile.
+ Each profile raw contact row can have multiple data rows. Constants for accessing the user
+ profile are available in the {@link android.provider.ContactsContract.Profile} class.
+</p>
+<p>
+ Access to the user profile requires special permissions. In addition to the
+ {@link android.Manifest.permission#READ_CONTACTS} and
+ {@link android.Manifest.permission#WRITE_CONTACTS} permissions needed to read and write, access
+ to the user profile requires the {@link android.Manifest.permission#READ_PROFILE} and
+ {@link android.Manifest.permission#WRITE_PROFILE} permissions for read and write access,
+ respectively.
+</p>
+<p>
+ Remember that you should consider a user's profile to be sensitive. The permission
+ {@link android.Manifest.permission#READ_PROFILE} allows you to access the device user's
+ personally-identifying data. Make sure to tell the user why
+ you need user profile access permissions in the description of your application.
+</p>
+<p>
+ To retrieve the contact row that contains the user's profile,
+ call {@link android.content.ContentResolver#query(Uri,String[], String, String[], String)
+ ContentResolver.query()}. Set the content URI to
+ {@link android.provider.ContactsContract.Profile#CONTENT_URI} and don't provide any
+ selection criteria. You can also use this content URI as the base URI for retrieving raw
+ contacts or data for the profile. For example, this snippet retrieves data for the profile:
+</p>
+<pre>
+// Sets the columns to retrieve for the user profile
+mProjection = new String[]
+ {
+ Profile._ID,
+ Profile.DISPLAY_NAME_PRIMARY,
+ Profile.LOOKUP_KEY,
+ Profile.PHOTO_THUMBNAIL_URI
+ };
+
+// Retrieves the profile from the Contacts Provider
+mProfileCursor =
+ getContentResolver().query(
+ Profile.CONTENT_URI,
+ mProjection ,
+ null,
+ null,
+ null);
+</pre>
+<p class="note">
+ <strong>Note:</strong> If you retrieve multiple contact rows, and you want to determine if one of them
+ is the user profile, test the row's
+ {@link android.provider.ContactsContract.ContactsColumns#IS_USER_PROFILE} column. This column
+ is set to "1" if the contact is the user profile.
+</p>
+<h2 id="ContactsProviderMetadata">Contacts Provider Metadata</h2>
+<p>
+ The Contacts Provider manages data that keeps track of the state of contacts data in the
+ repository. This metadata about the repository is stored in various places, including the
+ Raw Contacts, Data, and Contacts table rows, the
+ {@link android.provider.ContactsContract.Settings} table, and the
+ {@link android.provider.ContactsContract.SyncState} table. The following table shows the
+ effect of each of these pieces of metadata:
+</p>
+<p class="table-caption" id="table3">
+ <strong>Table 3.</strong> Metadata in the Contacts Provider</p>
+<table>
+ <tr>
+ <th scope="col">Table</th>
+ <th scope="col">Column</th>
+ <th scope="col">Values</th>
+ <th scope="col">Meaning</th>
+ </tr>
+ <tr>
+ <td rowspan="2">{@link android.provider.ContactsContract.RawContacts}</td>
+ <td rowspan="2">{@link android.provider.ContactsContract.SyncColumns#DIRTY}</td>
+ <td>"0" - not changed since the last sync.</td>
+ <td rowspan="2">
+ Marks raw contacts that were changed on the device and have to be synced back to the
+ server. The value is set automatically by the Contacts Provider when Android
+ applications update a row.
+ <p>
+ Sync adapters that modify the raw contact or data tables should always append the
+ string {@link android.provider.ContactsContract#CALLER_IS_SYNCADAPTER} to the
+ content URI they use. This prevents the provider from marking rows as dirty.
+ Otherwise, sync adapter modifications appear to be local modifications and are
+ sent to the server, even though the server was the source of the modification.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>"1" - changed since last sync, needs to be synced back to the server.</td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.ContactsContract.RawContacts}</td>
+ <td>{@link android.provider.ContactsContract.SyncColumns#VERSION}</td>
+ <td>The version number of this row.</td>
+ <td>
+ The Contacts Provider automatically increments this value whenever the row or
+ its related data changes.
+ </td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.ContactsContract.Data}</td>
+ <td>{@link android.provider.ContactsContract.DataColumns#DATA_VERSION}</td>
+ <td>The version number of this row.</td>
+ <td>
+ The Contacts Provider automatically increments this value whenever the data row
+ is changed.
+ </td>
+ </tr>
+ <tr>
+ <td>{@link android.provider.ContactsContract.RawContacts}</td>
+ <td>{@link android.provider.ContactsContract.SyncColumns#SOURCE_ID}</td>
+ <td>
+ A string value that uniquely identifies this raw contact to the account in
+ which it was created.
+ </td>
+ <td>
+ When a sync adapter creates a new raw contact, this column should be set to the
+ server's unique ID for the raw contact. When an Android application creates a new
+ raw contact, the application should leave this column empty. This signals the sync
+ adapter that it should create a new raw contact on the server, and get a
+ value for the {@link android.provider.ContactsContract.SyncColumns#SOURCE_ID}.
+ <p>
+ In particular, the source id must be <strong>unique</strong> for each account
+ type and should be stable across syncs:
+ </p>
+ <ul>
+ <li>
+ Unique: Each raw contact for an account must have its own source id. If you
+ don't enforce this, you'll cause problems in the contacts application.
+ Notice that two raw contacts for the same account <em>type</em> may have
+ the same source id. For example, the raw contact "Thomas Higginson" for the
+ account {@code emily.dickinson@gmail.com} is allowed to have the same source
+ id as the raw contact "Thomas Higginson" for the account
+ {@code emilyd@gmail.com}.
+ </li>
+ <li>
+ Stable: Source ids are a permanent part of the online service's data for
+ the raw contact. For example, if the user clears Contacts Storage from the
+ Apps settings and re-syncs, the restored raw contacts should have the same
+ source ids as before. If you don't enforce this, shortcuts will stop
+ working.
+ </li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td rowspan="2">{@link android.provider.ContactsContract.Groups}</td>
+ <td rowspan="2">{@link android.provider.ContactsContract.GroupsColumns#GROUP_VISIBLE}</td>
+ <td>"0" - Contacts in this group should not be visible in Android application UIs.</td>
+ <td>
+ This column is for compatibility with servers that allow a user to hide contacts in
+ certain groups.
+ </td>
+ </tr>
+ <tr>
+ <td>"1" - Contacts in this group are allowed to be visible in application UIs.</td>
+ </tr>
+ <tr>
+ <td rowspan="2">{@link android.provider.ContactsContract.Settings}</td>
+ <td rowspan="2">
+ {@link android.provider.ContactsContract.SettingsColumns#UNGROUPED_VISIBLE}</td>
+ <td>
+ "0" - For this account and account type, contacts that don't belong to a group are
+ invisible to Android application UIs.
+ </td>
+ <td rowspan="2">
+ By default, contacts are invisible if none of their raw contacts belongs to a group
+ (Group membership for a raw contact is indicated by one or more
+ {@link android.provider.ContactsContract.CommonDataKinds.GroupMembership} rows
+ in the {@link android.provider.ContactsContract.Data} table).
+ By setting this flag in the {@link android.provider.ContactsContract.Settings} table row
+ for an account type and account, you can force contacts without groups to be visible.
+ One use of this flag is to show contacts from servers that don't use groups.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ "1" - For this account and account type, contacts that don't belong to a group are
+ visible to application UIs.
+ </td>
+
+ </tr>
+ <tr>
+ <td>{@link android.provider.ContactsContract.SyncState}</td>
+ <td>(all)</td>
+ <td>
+ Use this table to store metadata for your sync adapter.
+ </td>
+ <td>
+ With this table you can store sync state and other sync-related data persistently on
+ the device.
+ </td>
+ </tr>
+</table>
+<h2 id="Access">Contacts Provider Access</h2>
+<p>
+ This section describes guidelines for accessing data from the Contacts Provider, focusing on
+ the following:
+</p>
+<ul>
+ <li>
+ Entity queries.
+ </li>
+ <li>
+ Batch modification.
+ </li>
+ <li>
+ Retrieval and modification with intents.
+ </li>
+ <li>
+ Data integrity.
+ </li>
+</ul>
+<p>
+ Making modifications from a sync adapter is also covered in more detail in the section
+ <a href="#SyncAdapters">Contacts Provider Sync Adapters</a>.
+</p>
+<h3 id="Entities">Querying entities</h3>
+<p>
+ Because the Contacts Provider tables are organized in a hierarchy, it's often useful to
+ retrieve a row and all of the "child" rows that are linked to it. For example, to display
+ all the information for a person, you may want to retrieve all the
+ {@link android.provider.ContactsContract.RawContacts} rows for a single
+ {@link android.provider.ContactsContract.Contacts} row, or all the
+ {@link android.provider.ContactsContract.CommonDataKinds.Email} rows for a single
+ {@link android.provider.ContactsContract.RawContacts} row. To facilitate this, the Contacts
+ Provider offers <strong>entity</strong> constructs, which act like database joins between
+ tables.
+</p>
+<p>
+ An entity is like a table composed of selected columns from a parent table and its child table.
+ When you query an entity, you supply a projection and search criteria based on the columns
+ available from the entity. The result is a {@link android.database.Cursor} that contains
+ contains one row for each child table row that was retrieved. For example, if you query
+ {@link android.provider.ContactsContract.Contacts.Entity} for a contact name
+ and all the {@link android.provider.ContactsContract.CommonDataKinds.Email} rows for all the
+ raw contacts for that name, you get back a {@link android.database.Cursor} containing one row
+ for each {@link android.provider.ContactsContract.CommonDataKinds.Email} row.
+</p>
+<p>
+ Entities simplify queries. Using an entity, you can retrieve all of the contacts data for a
+ contact or raw contact at once, instead of having to query the parent table first to get an
+ ID, and then having to query the child table with that ID. Also, the Contacts Provider processes
+ a query against an entity in a single transaction, which ensures that the retrieved data is
+ internally consistent.
+</p>
+<p class="note">
+ <strong>Note:</strong> An entity usually doesn't contain all the columns of the parent and
+ child table. If you attempt to work with a column name that isn't in the list of column name
+ constants for the entity, you'll get an {@link java.lang.Exception}.
+</p>
+<p>
+ The following snippet shows how to retrieve all the raw contact rows for a contact. The snippet
+ is part of a larger application that has two activities, "main" and "detail". The main activity
+ shows a list of contact rows; when the user select one, the activity sends its ID to the detail
+ activity. The detail activity uses the {@link android.provider.ContactsContract.Contacts.Entity}
+ to display all of the data rows from all of the raw contacts associated with the selected
+ contact.
+</p>
+<p>
+ This snippet is taken from the "detail" activity:
+</p>
+<pre>
+...
+ /*
+ * Appends the entity path to the URI. In the case of the Contacts Provider, the
+ * expected URI is content://com.google.contacts/#/entity (# is the ID value).
+ */
+ mContactUri = Uri.withAppendedPath(
+ mContactUri,
+ ContactsContract.Contacts.Entity.CONTENT_DIRECTORY);
+
+ // Initializes the loader identified by LOADER_ID.
+ getLoaderManager().initLoader(
+ LOADER_ID, // The identifier of the loader to initialize
+ null, // Arguments for the loader (in this case, none)
+ this); // The context of the activity
+
+ // Creates a new cursor adapter to attach to the list view
+ mCursorAdapter = new SimpleCursorAdapter(
+ this, // the context of the activity
+ R.layout.detail_list_item, // the view item containing the detail widgets
+ mCursor, // the backing cursor
+ mFromColumns, // the columns in the cursor that provide the data
+ mToViews, // the views in the view item that display the data
+ 0); // flags
+
+ // Sets the ListView's backing adapter.
+ mRawContactList.setAdapter(mCursorAdapter);
+...
+@Override
+public Loader<Cursor> onCreateLoader(int id, Bundle args) {
+
+ /*
+ * Sets the columns to retrieve.
+ * RAW_CONTACT_ID is included to identify the raw contact associated with the data row.
+ * DATA1 contains the first column in the data row (usually the most important one).
+ * MIMETYPE indicates the type of data in the data row.
+ */
+ String[] projection =
+ {
+ ContactsContract.Contacts.Entity.RAW_CONTACT_ID,
+ ContactsContract.Contacts.Entity.DATA1,
+ ContactsContract.Contacts.Entity.MIMETYPE
+ };
+
+ /*
+ * Sorts the retrieved cursor by raw contact id, to keep all data rows for a single raw
+ * contact collated together.
+ */
+ String sortOrder =
+ ContactsContract.Contacts.Entity.RAW_CONTACT_ID +
+ " ASC";
+
+ /*
+ * Returns a new CursorLoader. The arguments are similar to
+ * ContentResolver.query(), except for the Context argument, which supplies the location of
+ * the ContentResolver to use.
+ */
+ return new CursorLoader(
+ getApplicationContext(), // The activity's context
+ mContactUri, // The entity content URI for a single contact
+ projection, // The columns to retrieve
+ null, // Retrieve all the raw contacts and their data rows.
+ null, //
+ sortOrder); // Sort by the raw contact ID.
+}
+</pre>
+<p>
+ When the load is finished, {@link android.app.LoaderManager} invokes a callback to
+ {@link android.app.LoaderManager.LoaderCallbacks#onLoadFinished(Loader, D)
+ onLoadFinished()}. One of the incoming arguments to this method is a
+ {@link android.database.Cursor} with the results of the query. In your own app, you can get the
+ data from this {@link android.database.Cursor} to display it or work with it further.
+</p>
+<h3 id="Transactions">Batch modification</h3>
+<p>
+ Whenever possible, you should insert, update, and delete data in the Contacts Provider in
+ "batch mode", by creating an {@link java.util.ArrayList} of
+ {@link android.content.ContentProviderOperation} objects and calling
+ {@link android.content.ContentResolver#applyBatch(String, ArrayList) applyBatch()}. Because
+ the Contacts Provider performs all of the operations in an
+ {@link android.content.ContentResolver#applyBatch(String, ArrayList) applyBatch()} in a single
+ transaction, your modifications will never leave the contacts repository in an inconsistent
+ state. A batch modification also facilitates inserting a raw contact and its detail data at
+ the same time.
+</p>
+<p class="note">
+ <strong>Note:</strong> To modify a <em>single</em> raw contact, consider sending an intent to
+ the device's contacts application rather than handling the modification in your app.
+ Doing this is described in more detail in the section
+ <a href="#Intents">Retrieval and modification with intents</a>.
+</p>
+<h4>Yield points</h4>
+<p>
+ A batch modification containing a large number of operations can block other processes,
+ resulting in a bad overall user experience. To organize all the modifications you want to
+ perform in as few separate lists as possible, and at the same time prevent them from
+ blocking the system, you should set <strong>yield points</strong> for one or more operations.
+ A yield point is a {@link android.content.ContentProviderOperation} object that has its
+ {@link android.content.ContentProviderOperation#isYieldAllowed()} value set to
+ <code>true</code>. When the Contacts Provider encounters a yield point, it pauses its work to
+ let other processes run and closes the current transaction. When the provider starts again, it
+ continues with the next operation in the {@link java.util.ArrayList} and starts a new
+ transaction.
+</p>
+<p>
+ Yield points do result in more than one transaction per call to
+ {@link android.content.ContentResolver#applyBatch(String, ArrayList) applyBatch()}. Because of
+ this, you should set a yield point for the last operation for a set of related rows.
+ For example, you should set a yield point for the last operation in a set that adds a
+ raw contact rows and its associated data rows, or the last operation for a set of rows related
+ to a single contact.
+</p>
+<p>
+ Yield points are also a unit of atomic operation. All accesses between two yield points will
+ either succeed or fail as a single unit. If you don't set any yield points, the smallest
+ atomic operation is the entire batch of operations. If you do use yield points, you prevent
+ operations from degrading system performance, while at the same time ensuring that a subset of
+ operations is atomic.
+</p>
+<h4>Modification back references</h4>
+<p>
+ When you're inserting a new raw contact row and its associated data rows as a set of
+ {@link android.content.ContentProviderOperation} objects, you have to link the data rows to
+ the raw contact row by inserting the raw contact's
+ {@link android.provider.BaseColumns#_ID} value as the
+ {@link android.provider.ContactsContract.DataColumns#RAW_CONTACT_ID} value. However, this
+ value isn't available when you're creating the {@link android.content.ContentProviderOperation}
+ for the data row, because you haven't yet applied the
+ {@link android.content.ContentProviderOperation} for the raw contact row. To work around this,
+ the {@link android.content.ContentProviderOperation.Builder} class has the method
+ {@link android.content.ContentProviderOperation.Builder#withValueBackReference(String, int) withValueBackReference()}.
+ This method allows you to insert or modify a column with the
+ result of a previous operation.
+</p>
+<p>
+ The {@link android.content.ContentProviderOperation.Builder#withValueBackReference(String, int) withValueBackReference()}
+ method has two arguments:
+</p>
+ <dl>
+ <dt>
+ <code>key</code>
+ </dt>
+ <dd>
+ The key of a key-value pair. The value of this argument should be the name of a column
+ in the table that you're modifying.
+ </dd>
+ <dt>
+ <code>previousResult</code>
+ </dt>
+ <dd>
+ The 0-based index of a value in the array of
+ {@link android.content.ContentProviderResult} objects from
+ {@link android.content.ContentResolver#applyBatch(String, ArrayList) applyBatch()}. As
+ the batch operations are applied, the result of each operation is stored in an
+ intermediate array of results. The <code>previousResult</code> value is the index
+ of one of these results, which is retrieved and stored with the <code>key</code>
+ value. This allows you to insert a new raw contact record and get back its
+ {@link android.provider.BaseColumns#_ID} value, then make a "back reference" to the
+ value when you add a {@link android.provider.ContactsContract.Data} row.
+ <p>
+ The entire result array is created when you first call
+ {@link android.content.ContentResolver#applyBatch(String, ArrayList) applyBatch()},
+ with a size equal to the size of the {@link java.util.ArrayList} of
+ {@link android.content.ContentProviderOperation} objects you provide. However, all
+ the elements in the result array are set to <code>null</code>, and if you try
+ to do a back reference to a result for an operation that hasn't yet been applied,
+{@link android.content.ContentProviderOperation.Builder#withValueBackReference(String, int) withValueBackReference()}
+ throws an {@link java.lang.Exception}.
+
+ </p>
+ </dd>
+ </dl>
+<p>
+ The following snippets show how to insert a new raw contact and data in batch. They
+ includes code that establishes a yield point and uses a back reference. The snippets are an
+ expanded version of the <code>createContacEntry()</code> method, which is part of the
+ <code>ContactAdder</code> class in the
+ <code><a href="{@docRoot}resources/samples/ContactManager/index.html">
+ Contact Manager</a></code> sample application.
+</p>
+<p>
+ The first snippet retrieves contact data from the UI. At this point, the user has already
+ selected the account for which the new raw contact should be added.
+</p>
+<pre>
+// Creates a contact entry from the current UI values, using the currently-selected account.
+protected void createContactEntry() {
+ /*
+ * Gets values from the UI
+ */
+ String name = mContactNameEditText.getText().toString();
+ String phone = mContactPhoneEditText.getText().toString();
+ String email = mContactEmailEditText.getText().toString();
+
+ int phoneType = mContactPhoneTypes.get(
+ mContactPhoneTypeSpinner.getSelectedItemPosition());
+
+ int emailType = mContactEmailTypes.get(
+ mContactEmailTypeSpinner.getSelectedItemPosition());
+</pre>
+<p>
+ The next snippet creates an operation to insert the raw contact row into the
+ {@link android.provider.ContactsContract.RawContacts} table:
+</p>
+<pre>
+ /*
+ * Prepares the batch operation for inserting a new raw contact and its data. Even if
+ * the Contacts Provider does not have any data for this person, you can't add a Contact,
+ * only a raw contact. The Contacts Provider will then add a Contact automatically.
+ */
+
+ // Creates a new array of ContentProviderOperation objects.
+ ArrayList<ContentProviderOperation> ops =
+ new ArrayList<ContentProviderOperation>();
+
+ /*
+ * Creates a new raw contact with its account type (server type) and account name
+ * (user's account). Remember that the display name is not stored in this row, but in a
+ * StructuredName data row. No other data is required.
+ */
+ ContentProviderOperation.Builder op =
+ ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI)
+ .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, mSelectedAccount.getType())
+ .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, mSelectedAccount.getName());
+
+ // Builds the operation and adds it to the array of operations
+ ops.add(op.build());
+</pre>
+<p>
+ Next, the code creates data rows for the display name, phone, and email rows.
+</p>
+<p>
+ Each operation builder object uses
+ {@link android.content.ContentProviderOperation.Builder#withValueBackReference(String, int) withValueBackReference()}
+ to get the
+ {@link android.provider.ContactsContract.DataColumns#RAW_CONTACT_ID}. The reference points
+ back to the {@link android.content.ContentProviderResult} object from the first operation,
+ which adds the raw contact row and returns its new {@link android.provider.BaseColumns#_ID}
+ value. As a result, each data row is automatically linked by its
+ {@link android.provider.ContactsContract.DataColumns#RAW_CONTACT_ID}
+ to the new {@link android.provider.ContactsContract.RawContacts} row to which it belongs.
+</p>
+<p>
+ The {@link android.content.ContentProviderOperation.Builder} object that adds the email row is
+ flagged with {@link android.content.ContentProviderOperation.Builder#withYieldAllowed(boolean)
+ withYieldAllowed()}, which sets a yield point:
+</p>
+<pre>
+ // Creates the display name for the new raw contact, as a StructuredName data row.
+ op =
+ ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
+ /*
+ * withValueBackReference sets the value of the first argument to the value of
+ * the ContentProviderResult indexed by the second argument. In this particular
+ * call, the raw contact ID column of the StructuredName data row is set to the
+ * value of the result returned by the first operation, which is the one that
+ * actually adds the raw contact row.
+ */
+ .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
+
+ // Sets the data row's MIME type to StructuredName
+ .withValue(ContactsContract.Data.MIMETYPE,
+ ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
+
+ // Sets the data row's display name to the name in the UI.
+ .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, name);
+
+ // Builds the operation and adds it to the array of operations
+ ops.add(op.build());
+
+ // Inserts the specified phone number and type as a Phone data row
+ op =
+ ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
+ /*
+ * Sets the value of the raw contact id column to the new raw contact ID returned
+ * by the first operation in the batch.
+ */
+ .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
+
+ // Sets the data row's MIME type to Phone
+ .withValue(ContactsContract.Data.MIMETYPE,
+ ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)
+
+ // Sets the phone number and type
+ .withValue(ContactsContract.CommonDataKinds.Phone.NUMBER, phone)
+ .withValue(ContactsContract.CommonDataKinds.Phone.TYPE, phoneType);
+
+ // Builds the operation and adds it to the array of operations
+ ops.add(op.build());
+
+ // Inserts the specified email and type as a Phone data row
+ op =
+ ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
+ /*
+ * Sets the value of the raw contact id column to the new raw contact ID returned
+ * by the first operation in the batch.
+ */
+ .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
+
+ // Sets the data row's MIME type to Email
+ .withValue(ContactsContract.Data.MIMETYPE,
+ ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE)
+
+ // Sets the email address and type
+ .withValue(ContactsContract.CommonDataKinds.Email.ADDRESS, email)
+ .withValue(ContactsContract.CommonDataKinds.Email.TYPE, emailType);
+
+ /*
+ * Demonstrates a yield point. At the end of this insert, the batch operation's thread
+ * will yield priority to other threads. Use after every set of operations that affect a
+ * single contact, to avoid degrading performance.
+ */
+ op.withYieldAllowed(true);
+
+ // Builds the operation and adds it to the array of operations
+ ops.add(op.build());
+</pre>
+<p>
+ The last snippet shows the call to
+ {@link android.content.ContentResolver#applyBatch(String, ArrayList) applyBatch()} that
+ inserts the new raw contact and data rows.
+</p>
+<pre>
+ // Ask the Contacts Provider to create a new contact
+ Log.d(TAG,"Selected account: " + mSelectedAccount.getName() + " (" +
+ mSelectedAccount.getType() + ")");
+ Log.d(TAG,"Creating contact: " + name);
+
+ /*
+ * Applies the array of ContentProviderOperation objects in batch. The results are
+ * discarded.
+ */
+ try {
+
+ getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
+ } catch (Exception e) {
+
+ // Display a warning
+ Context ctx = getApplicationContext();
+
+ CharSequence txt = getString(R.string.contactCreationFailure);
+ int duration = Toast.LENGTH_SHORT;
+ Toast toast = Toast.makeText(ctx, txt, duration);
+ toast.show();
+
+ // Log exception
+ Log.e(TAG, "Exception encountered while inserting contact: " + e);
+ }
+}
+</pre>
+<p>
+ Batch operations also allow you to implement <strong>optimistic concurrency control</strong>,
+ a method of applying modification transactions without having to lock the underlying repository.
+ To use this method, you apply the transaction and then check for other modifications that
+ may have been made at the same time. If you find an inconsistent modification has occurred, you
+ roll back your transaction and retry it.
+</p>
+<p>
+ Optimistic concurrency control is useful for a mobile device, where there's only one user at
+ a time, and simultaneous accesses to a data repository are rare. Because locking isn't used,
+ no time is wasted on setting locks or waiting for other transactions to release their locks.
+</p>
+<p>
+ To use optimistic concurrency control while updating a single
+ {@link android.provider.ContactsContract.RawContacts} row, follow these steps:
+</p>
+<ol>
+ <li>
+ Retrieve the raw contact's {@link android.provider.ContactsContract.SyncColumns#VERSION}
+ column along with the other data you retrieve.
+ </li>
+ <li>
+ Create a {@link android.content.ContentProviderOperation.Builder} object suitable for
+ enforcing a constraint, using the method
+ {@link android.content.ContentProviderOperation#newAssertQuery(Uri)}. For the content URI,
+ use {@link android.provider.ContactsContract.RawContacts#CONTENT_URI
+ RawContacts.CONTENT_URI}
+ with the raw contact's {@link android.provider.BaseColumns#_ID} appended to it.
+ </li>
+ <li>
+ For the {@link android.content.ContentProviderOperation.Builder} object, call
+ {@link android.content.ContentProviderOperation.Builder#withValue(String, Object)
+ withValue()} to compare the {@link android.provider.ContactsContract.SyncColumns#VERSION}
+ column to the version number you just retrieved.
+ </li>
+ <li>
+ For the same {@link android.content.ContentProviderOperation.Builder}, call
+ {@link android.content.ContentProviderOperation.Builder#withExpectedCount(int)
+ withExpectedCount()} to ensure that only one row is tested by this assertion.
+ </li>
+ <li>
+ Call {@link android.content.ContentProviderOperation.Builder#build()} to create the
+ {@link android.content.ContentProviderOperation} object, then add this object as the
+ first object in the {@link java.util.ArrayList} that you pass to
+ {@link android.content.ContentResolver#applyBatch(String, ArrayList) applyBatch()}.
+ </li>
+ <li>
+ Apply the batch transaction.
+ </li>
+</ol>
+<p>
+ If the raw contact row is updated by another operation between the time you read the row and
+ the time you attempt to modify it, the "assert" {@link android.content.ContentProviderOperation}
+ will fail, and the entire batch of operations will be backed out. You can then choose to retry
+ the batch or take some other action.
+</p>
+<p>
+ The following snippet demonstrates how to create an "assert"
+ {@link android.content.ContentProviderOperation} after querying for a single raw contact using
+ a {@link android.content.CursorLoader}:
+</p>
+<pre>
+/*
+ * The application uses CursorLoader to query the raw contacts table. The system calls this method
+ * when the load is finished.
+ */
+public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
+
+ // Gets the raw contact's _ID and VERSION values
+ mRawContactID = cursor.getLong(cursor.getColumnIndex(BaseColumns._ID));
+ mVersion = cursor.getInt(cursor.getColumnIndex(SyncColumns.VERSION));
+}
+
+...
+
+// Sets up a Uri for the assert operation
+Uri rawContactUri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, mRawContactID);
+
+// Creates a builder for the assert operation
+ContentProviderOperation.Builder assertOp = ContentProviderOperation.netAssertQuery(rawContactUri);
+
+// Adds the assertions to the assert operation: checks the version and count of rows tested
+assertOp.withValue(SyncColumns.VERSION, mVersion);
+assertOp.withExpectedCount(1);
+
+// Creates an ArrayList to hold the ContentProviderOperation objects
+ArrayList ops = new ArrayList<ContentProviderOperationg>;
+
+ops.add(assertOp.build());
+
+// You would add the rest of your batch operations to "ops" here
+
+...
+
+// Applies the batch. If the assert fails, an Exception is thrown
+try
+ {
+ ContentProviderResult[] results =
+ getContentResolver().applyBatch(AUTHORITY, ops);
+
+ } catch (OperationApplicationException e) {
+
+ // Actions you want to take if the assert operation fails go here
+ }
+</pre>
+<h3 id="Intents">Retrieval and modification with intents</h3>
+<p>
+ Sending an intent to the device's contacts application allows you to access the Contacts
+ Provider indirectly. The intent starts the device's contacts application UI, in which users can
+ do contacts-related work. With this type of access, users can:
+ <ul>
+ <li>Pick a contact from a list and have it returned to your app for further work.</li>
+ <li>Edit an existing contact's data.</li>
+ <li>Insert a new raw contact for any of their accounts.</li>
+ <li>Delete a contact or contacts data.</li>
+ </ul>
+<p>
+ If the user is inserting or updating data, you can collect the data first and send it as
+ part of the intent.
+</p>
+<p>
+ When you use intents to access the Contacts Provider via the device's contacts application, you
+ don't have to write your own UI or code for accessing the provider. You also don't have to
+ request permission to read or write to the provider. The device's contacts application can
+ delegate read permission for a contact to you, and because you're making modifications to the
+ provider through another application, you don't have to have write permissions.
+</p>
+<p>
+ The general process of sending an intent to access a provider is described in detail in the
+ <a href="{@docRoot}guide/topics/providers/content-provider-basics.html">
+ Content Provider Basics</a> guide in the section "Data access via intents." The action,
+ MIME type, and data values you use for the available tasks are summarized in Table 4, while the
+ extras values you can use with
+ {@link android.content.Intent#putExtra(String, String) putExtra()} are listed in the
+ reference documentation for {@link android.provider.ContactsContract.Intents.Insert}:
+</p>
+<p class="table-caption" id="table4">
+ <strong>Table 4.</strong> Contacts Provider Intents.
+</p>
+<table style="width:75%">
+ <tr>
+ <th scope="col" style="width:10%">Task</th>
+ <th scope="col" style="width:5%">Action</th>
+ <th scope="col" style="width:10%">Data</th>
+ <th scope="col" style="width:10%">MIME type</th>
+ <th scope="col" style="width:25%">Notes</th>
+ </tr>
+ <tr>
+ <td><strong>Pick a contact from a list</strong></td>
+ <td>{@link android.content.Intent#ACTION_PICK}</td>
+ <td>
+ One of:
+ <ul>
+ <li>
+{@link android.provider.ContactsContract.Contacts#CONTENT_URI Contacts.CONTENT_URI},
+ which displays a list of contacts.
+ </li>
+ <li>
+{@link android.provider.ContactsContract.CommonDataKinds.Phone#CONTENT_URI Phone.CONTENT_URI},
+ which displays a list of phone numbers for a raw contact.
+ </li>
+ <li>
+{@link android.provider.ContactsContract.CommonDataKinds.StructuredPostal#CONTENT_URI
+StructuredPostal.CONTENT_URI},
+ which displays a list of postal addresses for a raw contact.
+ </li>
+ <li>
+{@link android.provider.ContactsContract.CommonDataKinds.Email#CONTENT_URI Email.CONTENT_URI},
+ which displays a list of email addresses for a raw contact.
+ </li>
+ </ul>
+ </td>
+ <td>
+ Not used
+ </td>
+ <td>
+ Displays a list of raw contacts or a list of data from a raw contact, depending on the
+ content URI type you supply.
+ <p>
+ Call
+ {@link android.app.Activity#startActivityForResult(Intent, int) startActivityForResult()},
+ which returns the content URI of the selected row. The form of the URI is the
+ table's content URI with the row's <code>LOOKUP_ID</code> appended to it.
+ The device's contacts app delegates read and write permissions to this content URI
+ for the life of your activity. See the
+ <a href="{@docRoot}guide/topics/providers/content-provider-basics.html">
+ Content Provider Basics</a> guide for more details.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong>Insert a new raw contact</strong></td>
+ <td>{@link android.provider.ContactsContract.Intents.Insert#ACTION Insert.ACTION}</td>
+ <td>N/A</td>
+ <td>
+ {@link android.provider.ContactsContract.RawContacts#CONTENT_TYPE
+ RawContacts.CONTENT_TYPE}, MIME type for a set of raw contacts.
+ </td>
+ <td>
+ Displays the device's contacts application's <strong>Add Contact</strong> screen. The
+ extras values you add to the intent are displayed. If sent with
+ {@link android.app.Activity#startActivityForResult(Intent, int) startActivityForResult()},
+ the content URI of the newly-added raw contact is passed back to your activity's
+ {@link android.app.Activity#onActivityResult(int, int, Intent) onActivityResult()}
+ callback method in the {@link android.content.Intent} argument, in the
+ "data" field. To get the value, call {@link android.content.Intent#getData()}.
+ </td>
+ </tr>
+ <tr>
+ <td><strong>Edit a contact</strong></td>
+ <td>{@link android.content.Intent#ACTION_EDIT}</td>
+ <td>
+ {@link android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI} for
+ the contact. The editor activity will allow the user to edit any of the data associated
+ with this contact.
+ </td>
+ <td>
+ {@link android.provider.ContactsContract.Contacts#CONTENT_ITEM_TYPE
+ Contacts.CONTENT_ITEM_TYPE}, a single contact.</td>
+ <td>
+ Displays the Edit Contact screen in the contacts application. The extras values you add
+ to the intent are displayed. When the user clicks <strong>Done</strong> to save the
+ edits, your activity returns to the foreground.
+ </td>
+ </tr>
+ <tr>
+ <td><strong>Display a picker that can also add data.</strong></td>
+ <td>{@link android.content.Intent#ACTION_INSERT_OR_EDIT}</td>
+ <td>
+ N/A
+ </td>
+ <td>
+ {@link android.provider.ContactsContract.Contacts#CONTENT_ITEM_TYPE}
+ </td>
+ <td>
+ This intent always displays the contacts app's picker screen. The user can either
+ pick a contact to edit, or add a new contact. Either the edit or the add screen
+ appears, depending on the user's choice, and the extras data you pass in the intent
+ is displayed. If your app displays contact data such as an email or phone number, use
+ this intent to allow the user to add the data to an existing contact.
+ contact,
+ <p class="note">
+ <strong>Note:</strong> There's no need to send a name value in this intent's extras,
+ because the user always picks an existing name or adds a new one. Moreover,
+ if you send a name, and the user chooses to do an edit, the contacts app will
+ display the name you send, overwriting the previous value. If the user doesn't
+ notice this and saves the edit, the old value is lost.
+ </p>
+ </td>
+ </tr>
+</table>
+<p>
+ The device's contacts app doesn't allow you to delete a raw contact or any of its data with an
+ intent. Instead, to delete a raw contact, use
+ {@link android.content.ContentResolver#delete(Uri, String, String[]) ContentResolver.delete()}
+ or {@link android.content.ContentProviderOperation#newDelete(Uri)
+ ContentProviderOperation.newDelete()}.
+</p>
+<p>
+ The following snippet shows how to construct and send an intent that inserts a new raw
+ contact and data:
+</p>
+<pre>
+// Gets values from the UI
+String name = mContactNameEditText.getText().toString();
+String phone = mContactPhoneEditText.getText().toString();
+String email = mContactEmailEditText.getText().toString();
+
+String company = mCompanyName.getText().toString();
+String jobtitle = mJobTitle.getText().toString();
+
+// Creates a new intent for sending to the device's contacts application
+Intent insertIntent = new Intent(ContactsContract.Intents.Insert.ACTION);
+
+// Sets the MIME type to the one expected by the insertion activity
+insertIntent.setType(ContactsContract.RawContacts.CONTENT_TYPE);
+
+// Sets the new contact name
+insertIntent.putExtra(ContactsContract.Intents.Insert.NAME, name);
+
+// Sets the new company and job title
+insertIntent.putExtra(ContactsContract.Intents.Insert.COMPANY, company);
+insertIntent.putExtra(ContactsContract.Intents.Insert.JOB_TITLE, jobtitle);
+
+/*
+ * Demonstrates adding data rows as an array list associated with the DATA key
+ */
+
+// Defines an array list to contain the ContentValues objects for each row
+ArrayList<ContentValues> contactData = new ArrayList<ContentValues>();
+
+
+/*
+ * Defines the raw contact row
+ */
+
+// Sets up the row as a ContentValues object
+ContentValues rawContactRow = new ContentValues();
+
+// Adds the account type and name to the row
+rawContactRow.put(ContactsContract.RawContacts.ACCOUNT_TYPE, mSelectedAccount.getType());
+rawContactRow.put(ContactsContract.RawContacts.ACCOUNT_NAME, mSelectedAccount.getName());
+
+// Adds the row to the array
+contactData.add(rawContactRow);
+
+/*
+ * Sets up the phone number data row
+ */
+
+// Sets up the row as a ContentValues object
+ContentValues phoneRow = new ContentValues();
+
+// Specifies the MIME type for this data row (all data rows must be marked by their type)
+phoneRow.put(
+ ContactsContract.Data.MIMETYPE,
+ ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE
+);
+
+// Adds the phone number and its type to the row
+phoneRow.put(ContactsContract.CommonDataKinds.Phone.NUMBER, phone);
+
+// Adds the row to the array
+contactData.add(phoneRow);
+
+/*
+ * Sets up the email data row
+ */
+
+// Sets up the row as a ContentValues object
+ContentValues emailRow = new ContentValues();
+
+// Specifies the MIME type for this data row (all data rows must be marked by their type)
+emailRow.put(
+ ContactsContract.Data.MIMETYPE,
+ ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE
+);
+
+// Adds the email address and its type to the row
+emailRow.put(ContactsContract.CommonDataKinds.Email.ADDRESS, email);
+
+// Adds the row to the array
+contactData.add(emailRow);
+
+/*
+ * Adds the array to the intent's extras. It must be a parcelable object in order to
+ * travel between processes. The device's contacts app expects its key to be
+ * Intents.Insert.DATA
+ */
+insertIntent.putParcelableArrayListExtra(ContactsContract.Intents.Insert.DATA, contactData);
+
+// Send out the intent to start the device's contacts app in its add contact activity.
+startActivity(insertIntent);
+</pre>
+<h3 id="DataIntegrity">Data integrity</h3>
+<p>
+ Because the contacts repository contains important and sensitive data that users expect to be
+ correct and up-to-date, the Contacts Provider has well-defined rules for data integrity. It's
+ your responsibility to conform to these rules when you modify contacts data. The important
+ rules are listed here:
+</p>
+<dl>
+ <dt>
+ Always add a {@link android.provider.ContactsContract.CommonDataKinds.StructuredName} row
+ for every {@link android.provider.ContactsContract.RawContacts} row you add.
+ </dt>
+ <dd>
+ A {@link android.provider.ContactsContract.RawContacts} row without a
+ {@link android.provider.ContactsContract.CommonDataKinds.StructuredName} row in the
+ {@link android.provider.ContactsContract.Data} table may cause problems during
+ aggregation.
+ </dd>
+ <dt>
+ Always link new {@link android.provider.ContactsContract.Data} rows to their parent
+ {@link android.provider.ContactsContract.RawContacts} row.
+ </dt>
+ <dd>
+ A {@link android.provider.ContactsContract.Data} row that isn't linked to a
+ {@link android.provider.ContactsContract.RawContacts} won't be visible in the device's
+ contacts application, and it might cause problems with sync adapters.
+ </dd>
+ <dt>
+ Change data only for those raw contacts that you own.
+ </dt>
+ <dd>
+ Remember that the Contacts Provider is usually managing data from several different
+ account types/online services. You need to ensure that your application only modifies
+ or deletes data for rows that belong to you, and that it only inserts data with an
+ account type and name that you control.
+ </dd>
+ <dt>
+ Always use the constants defined in {@link android.provider.ContactsContract} and its
+ subclasses for authorities, content URIs, URI paths, column names, MIME types, and
+ {@link android.provider.ContactsContract.CommonDataKinds.CommonColumns#TYPE} values.
+ </dt>
+ <dd>
+ Using these constants helps you to avoid errors. You'll also be notified with compiler
+ warnings if any of the constants is deprecated.
+ </dd>
+</dl>
+<h3 id="CustomData">Custom data rows</h3>
+<p>
+ By creating and using your own custom MIME types, you can insert, edit, delete, and retrieve
+ your own data rows in the {@link android.provider.ContactsContract.Data} table. Your rows
+ are limited to using the column defined in
+ {@link android.provider.ContactsContract.DataColumns}, although you can map your own
+ type-specific column names to the default column names. In the device's contacts application,
+ the data for your rows is displayed but can't be edited or deleted, and users can't add
+ additional data. To allow users to modify your custom data rows, you must provide an editor
+ activity in your own application.
+</p>
+<p>
+ To display your custom data, provide a <code>contacts.xml</code> file containing a
+ <code><ContactsAccountType></code> element and one or more of its
+ <code><ContactsDataKind></code> child elements. This is described in more detail in the
+ section <a href="#SocialStreamDataKind"><code><ContactsDataKind> element</code></a>.
+</p>
+<p>
+ To learn more about custom MIME types, read the
+ <a href="{@docRoot}guide/topics/providers/content-provider-creating.html">
+ Creating a Content Provider</a> guide.
+</p>
+<h2 id="SyncAdapters">Contacts Provider Sync Adapters</h2>
+<p>
+ The Contacts Provider is specifically designed for handling <strong>synchronization</strong>
+ of contacts data between a device and an online service. This allows users to download
+ existing data to a new device and upload existing data to a new account.
+ Synchronization also ensures that users have the latest data at hand, regardless
+ of the source of additions and changes. Another advantage of synchronization is that it makes
+ contacts data available even when the device is not connected to the network.
+</p>
+<p>
+ Although you can implement synchronization in a variety of ways, the Android system provides
+ a plug-in synchronization framework that automates the following tasks:
+ <ul>
+
+ <li>
+ Checking network availability.
+ </li>
+ <li>
+ Scheduling and executing synchronization, based on user preferences.
+ </li>
+ <li>
+ Restarting synchronizations that have stopped.
+ </li>
+ </ul>
+<p>
+ To use this framework, you supply a sync adapter plug-in. Each sync adapter is unique to a
+ service and content provider, but can handle multiple account names for the same service. The
+ framework also allows multiple sync adapters for the same service and provider.
+</p>
+<h3 id="SyncClassesFiles">Sync adapter classes and files</h3>
+<p>
+ You implement a sync adapter as a subclass of
+ {@link android.content.AbstractThreadedSyncAdapter} and install it as part of an Android
+ application. The system learns about the sync adapter from elements in your application
+ manifest, and from a special XML file pointed to by the manifest. The XML file defines the
+ account type for the online service and the authority for the content provider, which together
+ uniquely identify the adapter. The sync adapter does not become active until the user adds an
+ account for the sync adapter's account type and enables synchronization for the content
+ provider the sync adapter syncs with. At that point, the system starts managing the adapter,
+ calling it as necessary to synchronize between the content provider and the server.
+</p>
+<p class="note">
+ <strong>Note:</strong> Using an account type as part of the sync adapter's identification allows
+ the system to detect and group together sync adapters that access different services from the
+ same organization. For example, sync adapters for Google online services all have the same
+ account type <code>com.google</code>. When users add a Google account to their devices, all
+ of the installed sync adapters for Google services are listed together; each sync adapter
+ listed syncs with a different content provider on the device.
+</p>
+<p>
+ Because most services require users to verify their identity before accessing
+ data, the Android system offers an authentication framework that is similar to, and often
+ used in conjunction with, the sync adapter framework. The authentication framework uses
+ plug-in authenticators that are subclasses of
+ {@link android.accounts.AbstractAccountAuthenticator}. An authenticator verifies
+ the user's identity in the following steps:
+ <ol>
+ <li>
+ Collects the user's name, password or similar information (the user's
+ <strong>credentials</strong>).
+ </li>
+ <li>
+ Sends the credentials to the service
+ </li>
+ <li>
+ Examines the service's reply.
+ </li>
+ </ol>
+<p>
+ If the service accepts the credentials, the authenticator can
+ store the credentials for later use. Because of the plug-in authenticator framework, the
+ {@link android.accounts.AccountManager} can provide access to any authtokens an authenticator
+ supports and chooses to expose, such as OAuth2 authtokens.
+</p>
+<p>
+ Although authentication is not required, most contacts services use it.
+ However, you're not required to use the Android authentication framework to do authentication.
+</p>
+<h3 id="SyncAdapterImplementing">Sync adapter implementation</h3>
+<p>
+ To implement a sync adapter for the Contacts Provider, you start by creating an
+ Android application that contains the following:
+</p>
+ <dl>
+ <dt>
+ A {@link android.app.Service} component that responds to requests from the system to
+ bind to the sync adapter.
+ </dt>
+ <dd>
+ When the system wants to run a synchronization, it calls the service's
+ {@link android.app.Service#onBind(Intent) onBind()} method to get an
+ {@link android.os.IBinder} for the sync adapter. This allows the system to do
+ cross-process calls to the adapter's methods.
+ <p>
+ In the <a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">
+ Sample Sync Adapter</a> sample app, the class name of this service is
+ <code>com.example.android.samplesync.syncadapter.SyncService</code>.
+ </p>
+ </dd>
+ <dt>
+ The actual sync adapter, implemented as a concrete subclass of
+ {@link android.content.AbstractThreadedSyncAdapter}.
+ </dt>
+ <dd>
+ This class does the work of downloading data from the server, uploading data from the
+ device, and resolving conflicts. The main work of the adapter is
+ done in the method {@link android.content.AbstractThreadedSyncAdapter#onPerformSync(
+ Account, Bundle, String, ContentProviderClient, SyncResult)
+ onPerformSync()}. This class must be instantiated as a singleton.
+ <p>
+ In the <a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">
+ Sample Sync Adapter</a> sample app, the sync adapter is defined in the class
+ <code>com.example.android.samplesync.syncadapter.SyncAdapter</code>.
+ </p>
+ </dd>
+ <dt>
+ A subclass of {@link android.app.Application}.
+ </dt>
+ <dd>
+ This class acts as a factory for the sync adapter singleton. Use the
+ {@link android.app.Application#onCreate()} method to instantiate the sync adapter, and
+ provide a static "getter" method to return the singleton to the
+ {@link android.app.Service#onBind(Intent) onBind()} method of the sync adapter's
+ service.
+ </dd>
+ <dt>
+ <strong>Optional:</strong> A {@link android.app.Service} component that responds to
+ requests from the system for user authentication.
+ </dt>
+ <dd>
+ {@link android.accounts.AccountManager} starts this service to begin the authentication
+ process. The service's {@link android.app.Service#onCreate()} method instantiates an
+ authenticator object. When the system wants to authenticate a user account for the
+ application's sync adapter, it calls the service's
+ {@link android.app.Service#onBind(Intent) onBind()} method to get an
+ {@link android.os.IBinder} for the authenticator. This allows the system to do
+ cross-process calls to the authenticator's methods..
+ <p>
+ In the <a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">
+ Sample Sync Adapter</a> sample app, the class name of this service is
+ <code>com.example.android.samplesync.authenticator.AuthenticationService</code>.
+ </p>
+ </dd>
+ <dt>
+ <strong>Optional:</strong> A concrete subclass of
+ {@link android.accounts.AbstractAccountAuthenticator} that handles requests for
+ authentication.
+ </dt>
+ <dd>
+ This class provides methods that the {@link android.accounts.AccountManager} invokes
+ to authenticate the user's credentials with the server. The details of the
+ authentication process vary widely, based on the server technology in use. You should
+ refer to the documentation for your server software to learn more about authentication.
+ <p>
+ In the <a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">
+ Sample Sync Adapter</a> sample app, the authenticator is defined in the class
+ <code>com.example.android.samplesync.authenticator.Authenticator</code>.
+ </p>
+ </dd>
+ <dt>
+ XML files that define the sync adapter and authenticator to the system.
+ </dt>
+ <dd>
+ The sync adapter and authenticator service components described previously are
+ defined in
+<code><<a href="{@docRoot}guide/topics/manifest/service-element.html">service</a>></code>
+ elements in the application manifest. These elements
+ contain
+<code><<a href="{@docRoot}guide/topics/manifest/meta-data-element.html">meta-data</a>></code>
+child elements that provide specific data to the
+ system:
+ <ul>
+ <li>
+ The
+<code><<a href="{@docRoot}guide/topics/manifest/meta-data-element.html">meta-data</a>></code>
+ element for the sync adapter service points to the
+ XML file <code>res/xml/syncadapter.xml</code>. In turn, this file specifies
+ a URI for the web service that will be synchronized with the Contacts Provider,
+ and an account type for the web service.
+ </li>
+ <li>
+ <strong>Optional:</strong> The
+<code><<a href="{@docRoot}guide/topics/manifest/meta-data-element.html">meta-data</a>></code>
+ element for the authenticator points to the XML file
+ <code>res/xml/authenticator.xml</code>. In turn, this file specifies the
+ account type that this authenticator supports, as well as UI resources that
+ appear during the authentication process. The account type specified in this
+ element must be the same as the account type specified for the sync
+ adapter.
+ </li>
+ </ul>
+ </dd>
+ </dl>
+<h2 id="SocialStream">Social Stream Data</h2>
+<p>
+ The {@link android.provider.ContactsContract.StreamItems} and
+ {@link android.provider.ContactsContract.StreamItemPhotos} tables
+ manage incoming data from social networks. You can write a sync adapter that adds stream data
+ from your own network to these tables, or you can read stream data from these tables and
+ display it in your own application, or both. With these features, your social networking
+ services and applications can be integrated into Android's social networking experience.
+</p>
+<h3 id="StreamText">Social stream text</h3>
+<p>
+ Stream items are always associated with a raw contact. The
+ {@link android.provider.ContactsContract.StreamItemsColumns#RAW_CONTACT_ID} links to the
+ <code>_ID</code> value for the raw contact. The account type and account name of the raw
+ contact are also stored in the stream item row.
+</p>
+<p>
+ Store the data from your stream in the following columns:
+</p>
+<dl>
+ <dt>
+ {@link android.provider.ContactsContract.StreamItemsColumns#ACCOUNT_TYPE}
+ </dt>
+ <dd>
+ <strong>Required.</strong> The user's account type for the raw contact associated with this
+ stream item. Remember to set this value when you insert a stream item.
+ </dd>
+ <dt>
+ {@link android.provider.ContactsContract.StreamItemsColumns#ACCOUNT_NAME}
+ </dt>
+ <dd>
+ <strong>Required.</strong> The user's account name for the raw contact associated with this
+ stream item. Remember to set this value when you insert a stream item.
+ </dd>
+ <dt>
+ Identifier columns
+ </dt>
+ <dd>
+ <strong>Required.</strong> You must insert the following identifier columns when you
+ insert a stream item:
+ <ul>
+ <li>
+ {@link android.provider.ContactsContract.StreamItemsColumns#CONTACT_ID}: The
+ {@link android.provider.BaseColumns#_ID} value of the contact that this stream
+ item is associated with.
+ </li>
+ <li>
+ {@link android.provider.ContactsContract.StreamItemsColumns#CONTACT_LOOKUP_KEY}: The
+ {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY} value of the
+ contact this stream item is associated with.
+ </li>
+ <li>
+ {@link android.provider.ContactsContract.StreamItemsColumns#RAW_CONTACT_ID}: The
+ {@link android.provider.BaseColumns#_ID} value of the raw contact that this stream
+ item is associated with.
+ </li>
+ </ul>
+ </dd>
+ <dt>
+ {@link android.provider.ContactsContract.StreamItemsColumns#COMMENTS}
+ </dt>
+ <dd>
+ Optional. Stores summary information that you can display at the beginning of a stream item.
+ </dd>
+ <dt>
+ {@link android.provider.ContactsContract.StreamItemsColumns#TEXT}
+ </dt>
+ <dd>
+ The text of the stream item, either the content that was posted by the source of the item,
+ or a description of some action that generated the stream item. This column can contain
+ any formatting and embedded resource images that can be rendered by
+ {@link android.text.Html#fromHtml(String) fromHtml()}. The provider may truncate or
+ ellipsize long content, but it will try to avoid breaking tags.
+ </dd>
+ <dt>
+ {@link android.provider.ContactsContract.StreamItemsColumns#TIMESTAMP}
+ </dt>
+ <dd>
+ A text string containing the time the stream item was inserted or updated, in the form
+ of <em>milliseconds</em> since epoch. Applications that insert or update stream items are
+ responsible for maintaining this column; it is not automatically maintained by the
+ Contacts Provider.
+ </dd>
+</dl>
+<p>
+ To display identifying information for your stream items, use the
+ {@link android.provider.ContactsContract.StreamItemsColumns#RES_ICON},
+ {@link android.provider.ContactsContract.StreamItemsColumns#RES_LABEL}, and
+ {@link android.provider.ContactsContract.StreamItemsColumns#RES_PACKAGE} to link to resources
+ in your application.
+</p>
+<p>
+ The {@link android.provider.ContactsContract.StreamItems} table also contains the columns
+ {@link android.provider.ContactsContract.StreamItemsColumns#SYNC1} through
+ {@link android.provider.ContactsContract.StreamItemsColumns#SYNC4} for the exclusive use of
+ sync adapters.
+</p>
+<h3 id="StreamPhotos">Social stream photos</h3>
+<p>
+ The {@link android.provider.ContactsContract.StreamItemPhotos} table stores photos associated
+ with a stream item. The table's
+ {@link android.provider.ContactsContract.StreamItemPhotosColumns#STREAM_ITEM_ID} column
+ links to values in the {@link android.provider.BaseColumns#_ID} column of
+ {@link android.provider.ContactsContract.StreamItems} table. Photo references are stored in the
+ table in these columns:
+</p>
+<dl>
+ <dt>
+ {@link android.provider.ContactsContract.StreamItemPhotos#PHOTO} column (a BLOB).
+ </dt>
+ <dd>
+ A binary representation of the photo, resized by the provider for storage and display.
+ This column is available for backwards compatibility with previous versions of the Contacts
+ Provider that used it for storing photos. However, in the current version
+ you should not use this column to store photos. Instead, use
+ either {@link android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_FILE_ID} or
+ {@link android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_URI} (both of
+ which are described in the following points) to store photos in a file. This column now
+ contains a thumbnail of the photo, which is available for reading.
+ </dd>
+ <dt>
+ {@link android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_FILE_ID}
+ </dt>
+ <dd>
+ A numeric identifier of a photo for a raw contact. Append this value to the constant
+ {@link android.provider.ContactsContract.DisplayPhoto#CONTENT_URI DisplayPhoto.CONTENT_URI}
+ to get a content URI pointing to a single photo file, and then call
+ {@link android.content.ContentResolver#openAssetFileDescriptor(Uri, String)
+ openAssetFileDescriptor()} to get a handle to the photo file.
+ </dd>
+ <dt>
+ {@link android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_URI}
+ </dt>
+ <dd>
+ A content URI pointing directly to the photo file for the photo represented by this row.
+ Call {@link android.content.ContentResolver#openAssetFileDescriptor(Uri, String)
+ openAssetFileDescriptor()} with this URI to get a handle to the photo file.
+ </dd>
+</dl>
+<h3 id="SocialStreamTables">Using the social stream tables</h3>
+<p>
+ These tables work the same as the other main tables in the Contacts Provider, except that:
+</p>
+ <ul>
+ <li>
+ These tables require additional access permissions. To read from them, your application
+ must have the permission {@link android.Manifest.permission#READ_SOCIAL_STREAM}. To
+ modify them, your application must have the permission
+ {@link android.Manifest.permission#WRITE_SOCIAL_STREAM}.
+ </li>
+ <li>
+ For the {@link android.provider.ContactsContract.StreamItems} table, the number of rows
+ stored for each raw contact is limited. Once this limit is reached,
+ the Contacts Provider makes space for new stream item rows by automatically deleting
+ the rows having the oldest
+ {@link android.provider.ContactsContract.StreamItemsColumns#TIMESTAMP}. To get the
+ limit, issue a query to the content URI
+ {@link android.provider.ContactsContract.StreamItems#CONTENT_LIMIT_URI}. You can leave
+ all the arguments other than the content URI set to <code>null</code>. The query
+ returns a Cursor containing a single row, with the single column
+ {@link android.provider.ContactsContract.StreamItems#MAX_ITEMS}.
+ </li>
+ </ul>
+
+<p>
+ The class {@link android.provider.ContactsContract.StreamItems.StreamItemPhotos} defines a
+ sub-table of {@link android.provider.ContactsContract.StreamItemPhotos} containing the photo
+ rows for a single stream item.
+</p>
+<h3 id="SocialStreamInteraction">Social stream interactions</h3>
+<p>
+ The social stream data managed by the Contacts Provider, in conjunction with the
+ device's contacts application, offers a powerful way to connect your social networking system
+ with existing contacts. The following features are available:
+</p>
+ <ul>
+ <li>
+ By syncing your social networking service to the Contacts Provider with a sync
+ adapter, you can retrieve recent activity for a user's contacts and store it in
+ the {@link android.provider.ContactsContract.StreamItems} and
+ {@link android.provider.ContactsContract.StreamItemPhotos} tables for later use.
+ </li>
+ <li>
+ Besides regular synchronization, you can trigger your sync adapter to retrieve
+ additional data when the user selects a contact to view. This allows your sync adapter
+ to retrieve high-resolution photos and the most recent stream items for the contact.
+ </li>
+ <li>
+ By registering a notification with the device's contacts application and the Contacts
+ Provider, you can <em>receive</em> an intent when a contact is viewed, and at that point
+ update the contact's status from your service. This approach may be faster and use less
+ bandwidth than doing a full sync with a sync adapter.
+ </li>
+ <li>
+ Users can add a contact to your social networking service while looking at the contact
+ in the device's contacts application. You enable this with the "invite contact" feature,
+ which you enable with a combination of an activity that adds an existing contact to your
+ network, and an XML file that provides the device's contacts application and the
+ Contacts Provider with the details of your application.
+ </li>
+ </ul>
+<p>
+ Regular synchronization of stream items with the Contacts Provider is the same as
+ other synchronizations. To learn more about synchronization, see the section
+ <a href="#SyncAdapters">Contacts Provider Sync Adapters</a>. Registering notifications and
+ inviting contacts are covered in the next two sections.
+</p>
+<h4>Registering to handle social networking views</h4>
+<p>
+ To register your sync adapter to receive notifications when the user views a contact that's
+ managed by your sync adapter:
+</p>
+<ol>
+ <li>
+ Create a file named <code>contacts.xml</code> in your project's <code>res/xml/</code>
+ directory. If you already have this file, you can skip this step.
+ </li>
+ <li>
+ In this file, add the element
+<code><ContactsAccountType xmlns:android="http://schemas.android.com/apk/res/android"></code>.
+ If this element already exists, you can skip this step.
+ </li>
+ <li>
+ To register a service that is notified when the user opens a contact's detail page in
+ the device's contacts application, add the attribute
+ <code>viewContactNotifyService="<em>serviceclass</em>"</code> to the element, where
+ <code><em>serviceclass</em></code> is the fully-qualified classname of the service
+ that should receive the intent from the device's contacts application. For the notifier
+ service, use a class that extends {@link android.app.IntentService}, to allow the service to
+ receive intents. The data in the incoming intent contains the content URI of the raw
+ contact the user clicked. From the notifier service, you can bind to and then call your
+ sync adapter to update the data for the raw contact.
+ </li>
+</ol>
+<p>
+ To register an activity to be called when the user clicks on a stream item or photo or both:
+</p>
+<ol>
+ <li>
+ Create a file named <code>contacts.xml</code> in your project's <code>res/xml/</code>
+ directory. If you already have this file, you can skip this step.
+ </li>
+ <li>
+ In this file, add the element
+<code><ContactsAccountType xmlns:android="http://schemas.android.com/apk/res/android"></code>.
+ If this element already exists, you can skip this step.
+ </li>
+ <li>
+ To register one of your activities to handle the user clicking on a stream item in the
+ device's contacts application, add the attribute
+ <code>viewStreamItemActivity="<em>activityclass</em>"</code> to the element, where
+ <code><em>activityclass</em></code> is the fully-qualified classname of the activity
+ that should receive the intent from the device's contacts application.
+ </li>
+ <li>
+ To register one of your activities to handle the user clicking on a stream photo in the
+ device's contacts application, add the attribute
+ <code>viewStreamItemPhotoActivity="<em>activityclass</em>"</code> to the element, where
+ <code><em>activityclass</em></code> is the fully-qualified classname of the activity
+ that should receive the intent from the device's contacts application.
+ </li>
+</ol>
+<p>
+ The <code><ContactsAccountType></code> element is described in more detail in the
+ section <a href="#SocialStreamAcctType"><ContactsAccountType> element</a>.
+</p>
+<p>
+ The incoming intent contains the content URI of the item or photo that the user clicked.
+ To have separate activities for text items and for photos, use both attributes in the same file.
+</p>
+<h4>Interacting with your social networking service</h4>
+<p>
+ Users don't have to leave the device's contacts application to invite a contact to your social
+ networking site. Instead, you can have the device's contacts app send an intent for inviting the
+ contact to one of your activities. To set this up:
+</p>
+<ol>
+ <li>
+ Create a file named <code>contacts.xml</code> in your project's <code>res/xml/</code>
+ directory. If you already have this file, you can skip this step.
+ </li>
+ <li>
+ In this file, add the element
+<code><ContactsAccountType xmlns:android="http://schemas.android.com/apk/res/android"></code>.
+ If this element already exists, you can skip this step.
+ </li>
+ <li>
+ Add the following attributes:
+ <ul>
+ <li><code>inviteContactActivity="<em>activityclass</em>"</code></li>
+ <li>
+ <code>inviteContactActionLabel="@string/<em>invite_action_label</em>"</code>
+ </li>
+ </ul>
+ The <code><em>activityclass</em></code> value is the fully-qualified classname of the
+ activity that should receive the intent. The <code><em>invite_action_label</em></code>
+ value is a text string that's displayed in the <strong>Add Connection</strong> menu in the
+ device's contacts application.
+ </li>
+</ol>
+<p class="note">
+ <strong>Note:</strong> <code>ContactsSource</code> is a deprecated tag name for
+ <code>ContactsAccountType</code>.
+</p>
+<h3 id="ContactsFile">contacts.xml reference</h3>
+<p>
+ The file <code>contacts.xml</code> contains XML elements that control the interaction of your
+ sync adapter and application with the contacts application and the Contacts Provider. These
+ elements are described in the following sections.
+</p>
+<h4 id="SocialStreamAcctType"><ContactsAccountType> element</h4>
+<p>
+ The <code><ContactsAccountType></code> element controls the interaction of your
+ application with the contacts application. It has the following syntax:
+</p>
+<pre>
+<ContactsAccountType
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ inviteContactActivity="<em>activity_name</em>"
+ inviteContactActionLabel="<em>invite_command_text</em>"
+ viewContactNotifyService="<em>view_notify_service</em>"
+ viewGroupActivity="<em>group_view_activity</em>"
+ viewGroupActionLabel="<em>group_action_text</em>"
+ viewStreamItemActivity="<em>viewstream_activity_name</em>"
+ viewStreamItemPhotoActivity="<em>viewphotostream_activity_name</em>">
+</pre>
+<p>
+ <strong>contained in:</strong>
+</p>
+<p>
+ <code>res/xml/contacts.xml</code>
+</p>
+<p>
+ <strong>can contain:</strong>
+</p>
+<p>
+ <strong><code><ContactsDataKind></code></strong>
+</p>
+<p>
+ <strong>Description:</strong>
+</p>
+<p>
+ Declares Android components and UI labels that allow users to invite one of their contacts to
+ a social network, notify users when one of their social networking streams is updated, and
+ so forth.
+</p>
+<p>
+ Notice that the attribute prefix <code>android:</code> is not necessary for the attributes
+ of <code><ContactsAccountType></code>.
+</p>
+<p>
+ <strong>Attributes:</strong>
+</p>
+<dl>
+ <dt>{@code inviteContactActivity}</dt>
+ <dd>
+ The fully-qualified class name of the activity in your application that you want to
+ activate when the user selects <strong>Add connection</strong> from the device's
+ contacts application.
+ </dd>
+ <dt>{@code inviteContactActionLabel}</dt>
+ <dd>
+ A text string that is displayed for the activity specified in
+ {@code inviteContactActivity}, in the <strong>Add connection</strong> menu.
+ For example, you can use the string "Follow in my network". You can use a string resource
+ identifier for this label.
+ </dd>
+ <dt>{@code viewContactNotifyService}</dt>
+ <dd>
+ The fully-qualified class name of a service in your application that should receive
+ notifications when the user views a contact. This notification is sent by the device's
+ contacts application; it allows your application to postpone data-intensive operations
+ until they're needed. For example, your application can respond to this notification
+ by reading in and displaying the contact's high-resolution photo and most recent
+ social stream items. This feature is described in more detail in the section
+ <a href="#SocialStreamInteraction">Social stream interactions</a>. You can see an
+ example of the notification service in the <code>NotifierService.java</code> file in the
+ <a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">SampleSyncAdapter</a>
+ sample app.
+ </dd>
+ <dt>{@code viewGroupActivity}</dt>
+ <dd>
+ The fully-qualified class name of an activity in your application that can display
+ group information. When the user clicks the group label in the device's contacts
+ application, the UI for this activity is displayed.
+ </dd>
+ <dt>{@code viewGroupActionLabel}</dt>
+ <dd>
+ The label that the contacts application displays for a UI control that allows
+ the user to look at groups in your application.
+ <p>
+ For example, if you install the Google+ application on your device and you sync
+ Google+ with the contacts application, you'll see Google+ circles listed as groups
+ in your contacts application's <strong>Groups</strong> tab. If you click on a
+ Google+ circle, you'll see people in that circle listed as a "group". At the top of
+ the display, you'll see a Google+ icon; if you click it, control switches to the
+ Google+ app. The contacts application does this with the
+ {@code viewGroupActivity}, using the Google+ icon as the value of
+ {@code viewGroupActionLabel}.
+ </p>
+ <p>
+ A string resource identifier is allowed for this attribute.
+ </p>
+ </dd>
+ <dt>{@code viewStreamItemActivity}</dt>
+ <dd>
+ The fully-qualified class name of an activity in your application that the device's
+ contacts application launches when the user clicks a stream item for a raw contact.
+ </dd>
+ <dt>{@code viewStreamItemPhotoActivity}</dt>
+ <dd>
+ The fully-qualified class name of an activity in your application that the device's
+ contacts application launches when the user clicks a photo in the stream item
+ for a raw contact.
+ </dd>
+</dl>
+<h4 id="SocialStreamDataKind"><ContactsDataKind> element</h4>
+<p>
+ The <code><ContactsDataKind></code> element controls the display of your application's
+ custom data rows in the contacts application's UI. It has the following syntax:
+</p>
+<pre>
+<ContactsDataKind
+ android:mimeType="<em>MIMEtype</em>"
+ android:icon="<em>icon_resources</em>"
+ android:summaryColumn="<em>column_name</em>"
+ android:detailColumn="<em>column_name</em>">
+</pre>
+<p>
+ <strong>contained in:</strong>
+</p>
+<code><ContactsAccountType></code>
+<p>
+ <strong>Description:</strong>
+</p>
+<p>
+ Use this element to have the contacts application display the contents of a custom data row as
+ part of the details of a raw contact. Each <code><ContactsDataKind></code> child element
+ of <code><ContactsAccountType></code> represents a type of custom data row that your sync
+ adapter adds to the {@link android.provider.ContactsContract.Data} table. Add one
+ <code><ContactsDataKind></code> element for each custom MIME type you use. You don't have
+ to add the element if you have a custom data row for which you don't want to display data.
+</p>
+<p>
+ <strong>Attributes:</strong>
+</p>
+<dl>
+ <dt>{@code android:mimeType}</dt>
+ <dd>
+ The custom MIME type you've defined for one of your custom data row types in the
+ {@link android.provider.ContactsContract.Data} table. For example, the value
+ <code>vnd.android.cursor.item/vnd.example.locationstatus</code> could be a custom
+ MIME type for a data row that records a contact's last known location.
+ </dd>
+ <dt>{@code android:icon}</dt>
+ <dd>
+ An Android
+ <a href="{@docRoot}guide/topics/resources/drawable-resource.html">drawable resource</a>
+ that the contacts application displays next to your data. Use this to indicate to the
+ user that the data comes from your service.
+ </dd>
+ <dt>{@code android:summaryColumn}</dt>
+ <dd>
+ The column name for the first of two values retrieved from the data row. The
+ value is displayed as the first line of the entry for this data row. The first line is
+ intended to be used as a summary of the data, but that is optional. See also
+ <a href="#detailColumn">android:detailColumn</a>.
+ </dd>
+ <dt>{@code android:detailColumn}</dt>
+ <dd>
+ The column name for the second of two values retrieved from the data row. The value is
+ displayed as the second line of the entry for this data row. See also
+ {@code android:summaryColumn}.
+ </dd>
+</dl>
+<h2 id="AdditionalFeatures">Additional Contacts Provider Features</h2>
+<p>
+ Besides the main features described in previous sections, the Contacts Provider offers
+ these useful features for working with contacts data:
+</p>
+ <ul>
+ <li>Contact groups</li>
+ <li>Photo features</li>
+ </ul>
+<h3 id="Groups">Contact groups</h3>
+<p>
+ The Contacts Provider can optionally label collections of related contacts with
+ <strong>group</strong> data. If the server associated with a user account
+ wants to maintain groups, the sync adapter for the account's account type should transfer
+ groups data between the Contacts Provider and the server. When users add a new contact to the
+ server and then put this contact in a new group, the sync adapter must add the new group
+ to the {@link android.provider.ContactsContract.Groups} table. The group or groups a raw
+ contact belongs to are stored in the {@link android.provider.ContactsContract.Data} table, using
+ the {@link android.provider.ContactsContract.CommonDataKinds.GroupMembership} MIME type.
+</p>
+<p>
+ If you're designing a sync adapter that will add raw contact data from
+ server to the Contacts Provider, and you aren't using groups, then you need to tell the
+ Provider to make your data visible. In the code that is executed when a user adds an account
+ to the device, update the {@link android.provider.ContactsContract.Settings}
+ row that the Contacts Provider adds for the account. In this row, set the value of the
+ {@link android.provider.ContactsContract.SettingsColumns#UNGROUPED_VISIBLE
+ Settings.UNGROUPED_VISIBLE} column to 1. When you do this, the Contacts Provider will always
+ make your contacts data visible, even if you don't use groups.
+</p>
+<h3 id="Photos">Contact photos</h3>
+<p>
+ The {@link android.provider.ContactsContract.Data} table stores photos as rows with MIME type
+ {@link android.provider.ContactsContract.CommonDataKinds.Photo#CONTENT_ITEM_TYPE
+ Photo.CONTENT_ITEM_TYPE}. The row's
+ {@link android.provider.ContactsContract.RawContactsColumns#CONTACT_ID} column is linked to the
+ {@link android.provider.BaseColumns#_ID} column of the raw contact to which it belongs.
+ The class {@link android.provider.ContactsContract.Contacts.Photo} defines a sub-table of
+ {@link android.provider.ContactsContract.Contacts} containing photo information for a contact's
+ primary photo, which is the primary photo of the contact's primary raw contact. Similarly,
+ the class {@link android.provider.ContactsContract.RawContacts.DisplayPhoto} defines a sub-table
+ of {@link android.provider.ContactsContract.RawContacts} containing photo information for a
+ raw contact's primary photo.
+</p>
+<p>
+ The reference documentation for {@link android.provider.ContactsContract.Contacts.Photo} and
+ {@link android.provider.ContactsContract.RawContacts.DisplayPhoto} contain examples of
+ retrieving photo information. There is no convenience class for retrieving the primary
+ thumbnail for a raw contact, but you can send a query to the
+ {@link android.provider.ContactsContract.Data} table, selecting on the raw contact's
+ {@link android.provider.BaseColumns#_ID}, the
+ {@link android.provider.ContactsContract.CommonDataKinds.Photo#CONTENT_ITEM_TYPE
+ Photo.CONTENT_ITEM_TYPE}, and the {@link android.provider.ContactsContract.Data#IS_PRIMARY}
+ column to find the raw contact's primary photo row.
+</p>
+<p>
+ Social stream data for a person may also include photos. These are stored in the
+ {@link android.provider.ContactsContract.StreamItemPhotos} table, which is described in more
+ detail in the section <a href="#StreamPhotos">Social stream photos</a>.
+</p>
diff --git a/docs/html/guide/topics/providers/content-provider-basics.jd b/docs/html/guide/topics/providers/content-provider-basics.jd
index de89568..b1d6827 100644
--- a/docs/html/guide/topics/providers/content-provider-basics.jd
+++ b/docs/html/guide/topics/providers/content-provider-basics.jd
@@ -371,7 +371,7 @@
ContentResolver.query()} on the "UI thread"". In actual code, however, you should
do queries asynchronously on a separate thread. One way to do this is to use the
{@link android.content.CursorLoader} class, which is described
- in more detail in the <a href="{@docRoot}guide/topics/fundamentals/loaders.html">
+ in more detail in the <a href="{@docRoot}guide/components/loaders.html">
Loaders</a> guide. Also, the lines of code are snippets only; they don't show a complete
application.
</p>
@@ -941,7 +941,7 @@
<li>
Asynchronous queries: You should do queries in a separate thread. One way to do this is to
use a {@link android.content.CursorLoader} object. The examples in the
- <a href="{@docRoot}guide/topics/fundamentals/loaders.html">Loaders</a> guide demonstrate
+ <a href="{@docRoot}guide/components/loaders.html">Loaders</a> guide demonstrate
how to do this.
</li>
<li>
diff --git a/docs/html/guide/topics/providers/content-provider-creating.jd b/docs/html/guide/topics/providers/content-provider-creating.jd
index 4ebdb50..bad5390 100644
--- a/docs/html/guide/topics/providers/content-provider-creating.jd
+++ b/docs/html/guide/topics/providers/content-provider-creating.jd
@@ -551,7 +551,7 @@
All of these methods except {@link android.content.ContentProvider#onCreate() onCreate()}
can be called by multiple threads at once, so they must be thread-safe. To learn
more about multiple threads, see the topic
- <a href="{@docRoot}guide/topics/fundamentals/processes-and-threads.html">
+ <a href="{@docRoot}guide/components/processes-and-threads.html">
Processes and Threads</a>.
</li>
<li>
@@ -1211,5 +1211,5 @@
<p>
Handling an incoming intent that wishes to modify your provider's data is no different from
handling other intents. You can learn more about using intents by reading the topic
- <a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>.
+ <a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>.
</p>
diff --git a/docs/html/guide/topics/providers/content-providers.jd b/docs/html/guide/topics/providers/content-providers.jd
index 1707f03..751fc95 100644
--- a/docs/html/guide/topics/providers/content-providers.jd
+++ b/docs/html/guide/topics/providers/content-providers.jd
@@ -18,6 +18,9 @@
<li>
<a href="{@docRoot}guide/topics/providers/calendar-provider.html">Calendar Provider</a>
</li>
+ <li>
+ <a href="{@docRoot}guide/topics/providers/contacts-provider.html">Contacts Provider</a>
+ </li>
</ol>
<!-- Related Samples -->
@@ -38,6 +41,10 @@
href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/List7.html">
"Cursor (Phones)"</a>
</li>
+ <li>
+ <a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">
+ Sample Sync Adapter</a>
+ </li>
</ol>
</div>
</div>
@@ -93,4 +100,11 @@
<dd>
How to access the Calendar Provider that is part of the Android platform.
</dd>
+ <dt>
+ <strong><a href="{@docRoot}guide/topics/providers/contacts-provider.html">
+ Contacts Provider</a></strong>
+ </dt>
+ <dd>
+ How to access the Contacts Provider that is part of the Android platform.
+ </dd>
</dl>
diff --git a/docs/html/guide/topics/renderscript/graphics.jd b/docs/html/guide/topics/renderscript/graphics.jd
deleted file mode 100644
index 462a990..0000000
--- a/docs/html/guide/topics/renderscript/graphics.jd
+++ /dev/null
@@ -1,993 +0,0 @@
-page.title=Graphics
-parent.title=Renderscript
-parent.link=index.html
-
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li>
- <a href="#creating-graphics-rs">Creating a Graphics Renderscript</a>
- <ol>
- <li><a href="#creating-native">Creating the Renderscript file</a></li>
- <li><a href="#creating-entry">Creating the Renderscript entry point class</a></li>
- <li><a href="#creating-view">Creating the view class</a></li>
- <li><a href="#creating-activity">Creating the activity class</a></li>
- </ol>
- </li>
- <li>
- <a href="#drawing">Drawing</a>
- <ol>
- <li><a href="#drawing-rsg">Simple drawing</a></li>
- <li><a href="#drawing-mesh">Drawing with a mesh</a></li>
- </ol>
- </li>
- <li>
- <a href="#shaders">Shaders</a>
- <ol>
- <li><a href="#shader-bindings">Shader bindings</a></li>
- <li><a href="#shader-sampler">Defining a sampler</a></li>
- </ol>
- </li>
- <li>
- <a href="#fbo">Rendering to a Framebuffer Object</a>
- </li>
- </ol>
-
- <h2>Related Samples</h2>
-
- <ol>
- <li><a href="{@docRoot}resources/samples/RenderScript/Balls/index.html">Balls</a></li>
-
- <li><a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Fountain</a></li>
-
- <li><a href="{@docRoot}resources/samples/RenderScript/FountainFbo/index.html">FountainFbo</a></li>
-
- <li><a href="{@docRoot}resources/samples/RenderScript/HelloWorld/index.html">Hello World</a></li>
-
- <li><a
-href="{@docRoot}resources/samples/RenderScript/MiscSamples/index.html">Misc Samples</a></li>
- </ol>
- </div>
- </div>
-
- <p>Renderscript provides a number of graphics APIs for rendering, both at the Android
- framework level as well as at the Renderscript runtime level. For instance, the Android framework APIs let you
- create meshes and define shaders to customize the graphical rendering pipeline. The native
- Renderscript graphics APIs let you draw the actual meshes to render your scene. You need to
- be familiar with both APIs to appropriately render graphics on an Android-powered device.</p>
-
- <h2 id="creating-graphics-rs">Creating a Graphics Renderscript</h2>
-
- <p>Renderscript applications require various layers of code, so it is useful to create the following
- files to help keep your application organized:</p>
-
- <dl>
- <dt>The Renderscript <code>.rs</code> file</dt>
-
- <dd>This file contains the logic to do the graphics rendering.</dd>
-
- <dt>The Renderscript entry point <code>.java</code> class</dt>
-
- <dd>This class allows the view class to interact with the code defined in the <code>.rs</code>
- file. This class contains a Renderscript object (instance of
- <code>ScriptC_<em>renderscript_file</em></code>), which allows your Android framework code to
- call the Renderscript code. In general, this class does much of the setup for Renderscript
- such as shader and mesh building and memory allocation and binding. The SDK samples follow the
- convention of naming this file ActivityRS.java,
- where Activity is the name of your main activity class.</dd>
-
- <dt>The view <code>.java</code> class</dt>
-
- <dd>This class extends {@link android.renderscript.RSSurfaceView} or {@link
- android.renderscript.RSTextureView} to provide a surface to render on. A {@link
- android.renderscript.RSSurfaceView} consumes a whole window, but a {@link
- android.renderscript.RSTextureView} allows you to draw Renderscript graphics inside of a
- view and add it to a {@link android.view.ViewGroup} alongside
- other views. In this class, you create a {@link android.renderscript.RenderScriptGL} context object
- with a call to {@link android.renderscript.RSSurfaceView#createRenderScriptGL
- RSSurfaceView.createRenderscriptGL()} or {@link android.renderscript.RSTextureView#createRenderScriptGL
- RSTextureView.createRenderscriptGL()}. The {@link android.renderscript.RenderScriptGL} context object
- contains information about the current rendering state of Renderscript such as the vertex and
- fragment shaders. You pass this context object to the Renderscript entry point class, so that
- class can modify the rendering context if needed and bind the Renderscript code to the context. Once bound,
- the view class can use the Renderscript code to display graphics.
- The view class should also implement callbacks for events inherited from {@link
- android.view.View}, such as {@link android.view.View#onTouchEvent onTouchEvent()} and {@link
- android.view.View#onKeyDown onKeyDown()} if you want to detect these types of user interactions.
- The SDK samples follow the convention of naming this file ActivityView.java,
- where Activity is the name of your main activity class</dd>
-
- <dt>The activity <code>.java</code> class</dt>
-
- <dd>This class is the main activity class and sets your {@link android.renderscript.RSSurfaceView} as the main content
- view for this activity or uses the {@link android.renderscript.RSTextureView} alongside other views.</dd>
- </dl>
- <p>Figure 1 describes how these classes interact with one another in a graphics Renderscript:</p>
-
- <img src="{@docRoot}images/rs_graphics.png">
- <p class="img-caption"><strong>Figure 1.</strong> Graphics Renderscript overview</p>
-
-
- <p>The following sections describe how to create an application that uses a graphics Renderscript by using
- the <a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Renderscript Fountain
- sample</a> that is provided in the SDK as a guide (some code has been modified from its original
- form for simplicity).</p>
-
- <h3 id="creating-native">Creating the Renderscript file</h3>
-
- <p>Your Renderscript code resides in <code>.rs</code> and <code>.rsh</code> (headers) files in the
- <code><project_root>/src/</code> directory. This code contains the logic to render your
- graphics and declares all other necessary items such as variables, structs,
- and pointers. Every graphics <code>.rs</code> file generally contains the following items:</p>
-
- <ul>
- <li>A pragma declaration (<code>#pragma rs java_package_name(<em>package.name</em>)</code>) that declares
- the package name of the <code>.java</code> reflection of this Renderscript.</li>
-
- <li>A pragma declaration (<code>#pragma version(1)</code>) that declares the version of Renderscript that
- you are using (1 is the only value for now).</li>
-
- <li>A <code>#include "rs_graphics.rsh"</code> declaration.</li>
-
- <li>A <code>root()</code> function. This is the main worker function for your Renderscript and
- calls Renderscript graphics functions to render scenes. This function is called every time a
- frame refresh occurs, which is specified as its return value. A <code>0</code> (zero) specified for
- the return value says to only render the frame when a property of the scene that you are
- rendering changes. A non-zero positive integer specifies the refresh rate of the frame in
- milliseconds.
-
- <p class="note"><strong>Note:</strong> The Renderscript runtime makes its best effort to
- refresh the frame at the specified rate. For example, if you are creating a live wallpaper
- and set the return value to 20, the Renderscript runtime renders the wallpaper at 50fps if it has just
- enough or more resources to do so. It renders as fast as it can if not enough resources
- are available.</p>
-
- <p>For more information on using the Renderscript graphics functions, see the <a href=
- "#drawing">Drawing</a> section.</p>
- </li>
-
- <li>An <code>init()</code> function. This allows you to do initialization of your
- Renderscript before the <code>root()</code> function runs, such as assigning values to variables. This
- function runs once and is called automatically when the Renderscript starts, before anything
- else in your Renderscript. Creating this function is optional.</li>
-
- <li>Any variables, pointers, and structures that you wish to use in your Renderscript code (can
- be declared in <code>.rsh</code> files if desired)</li>
- </ul>
-
- <p>The following code shows how the <code>fountain.rs</code> file is implemented:</p>
- <pre>
-#pragma version(1)
-
-// Tell which java package name the reflected files should belong to
-#pragma rs java_package_name(com.example.android.rs.fountain)
-
-//declare shader binding
-#pragma stateFragment(parent)
-
-// header with graphics APIs, must include explicitly
-#include "rs_graphics.rsh"
-
-static int newPart = 0;
-
-// the mesh to render
-rs_mesh partMesh;
-
-// the point representing where a particle is rendered
-typedef struct __attribute__((packed, aligned(4))) Point {
- float2 delta;
- float2 position;
- uchar4 color;
-} Point_t;
-Point_t *point;
-
-// main worker function that renders particles onto the screen
-int root() {
- float dt = min(rsGetDt(), 0.1f);
- rsgClearColor(0.f, 0.f, 0.f, 1.f);
- const float height = rsgGetHeight();
- const int size = rsAllocationGetDimX(rsGetAllocation(point));
- float dy2 = dt * (10.f);
- Point_t * p = point;
- for (int ct=0; ct < size; ct++) {
- p->delta.y += dy2;
- p->position += p->delta;
- if ((p->position.y > height) && (p->delta.y > 0)) {
- p->delta.y *= -0.3f;
- }
- p++;
- }
-
- rsgDrawMesh(partMesh);
- return 1;
-}
-
-// adds particles to the screen to render
-static float4 partColor[10];
-void addParticles(int rate, float x, float y, int index, bool newColor)
-{
- if (newColor) {
- partColor[index].x = rsRand(0.5f, 1.0f);
- partColor[index].y = rsRand(1.0f);
- partColor[index].z = rsRand(1.0f);
- }
- float rMax = ((float)rate) * 0.02f;
- int size = rsAllocationGetDimX(rsGetAllocation(point));
- uchar4 c = rsPackColorTo8888(partColor[index]);
-
- Point_t * np = &point[newPart];
- float2 p = {x, y};
- while (rate--) {
- float angle = rsRand(3.14f * 2.f);
- float len = rsRand(rMax);
- np->delta.x = len * sin(angle);
- np->delta.y = len * cos(angle);
- np->position = p;
- np->color = c;
- newPart++;
- np++;
- if (newPart >= size) {
- newPart = 0;
- np = &point[newPart];
- }
- }
-}
-</pre>
-
- <h3 id="creating-entry">Creating the Renderscript entry point class</h3>
-
- <p>When you create a Renderscript (<code>.rs</code>) file, it is helpful to create a
- corresponding Android framework class that is an entry point into the <code>.rs</code> file.
- The most important thing this class does is receive a {@link android.renderscript.RenderScriptGL} rendering context
- object from the <a href="#creating-view">view class</a> and binds the actual Renderscript
- code to the rendering context. This notifies your view class of the code that it needs
- to render graphics.
- </p>
-
- <p>In addition, this class should contain all of the things needed to set up Renderscript.
- Some important things that you need to do in this class are:</p>
-
- <ul>
- <li>Create a Renderscript object
- <code>ScriptC_<em>rs_filename</em></code>. The Renderscript object is attached to the Renderscript bytecode, which is platform-independent and
- gets compiled on the device when the Renderscript application runs. The bytecode is referenced
- as a raw resource and is passed into the constructor for the Renderscript object.
- For example, this is how the <a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Fountain</a>
- sample creates the Renderscript object:
- <pre>
- RenderScriptGL rs; //obtained from the view class
- Resources res; //obtained from the view class
- ...
- ScriptC_fountain mScript = new ScriptC_fountain(mRS, mRes, R.raw.fountain);
- </pre>
- </li>
- <li>Allocate any necessary memory and bind it to your Renderscript code via the Renderscript object.</li>
- <li>Build any necessary meshes and bind them to the Renderscript code via the Renderscript object.</li>
- <li>Create any necessary programs and bind them to the Renderscript code via the Renderscript object.</li>
- </ul>
-
- <p>The following code shows how the <a href=
- "{@docRoot}resources/samples/RenderScript/Fountain/src/com/example/android/rs/fountain/FountainRS.html">
- FountainRS</a> class is implemented:</p>
- <pre>
-package com.example.android.rs.fountain;
-
-import android.content.res.Resources;
-import android.renderscript.*;
-import android.util.Log;
-
-public class FountainRS {
- public static final int PART_COUNT = 50000;
-
- public FountainRS() {
- }
-
- /**
- * This provides us with the Renderscript context and resources
- * that allow us to create the Renderscript object
- */
- private Resources mRes;
- private RenderScriptGL mRS;
-
- // Renderscript object
- private ScriptC_fountain mScript;
-
- // Called by the view class to initialize the Renderscript context and renderer
- public void init(RenderScriptGL rs, Resources res) {
- mRS = rs;
- mRes = res;
-
- /**
- * Create a shader and bind to the Renderscript context
- */
- ProgramFragmentFixedFunction.Builder pfb = new ProgramFragmentFixedFunction.Builder(rs);
- pfb.setVaryingColor(true);
- rs.bindProgramFragment(pfb.create());
-
- /**
- * Allocate memory for the particles to render and create the mesh to draw
- */
- ScriptField_Point points = new ScriptField_Point(mRS, PART_COUNT);
- Mesh.AllocationBuilder smb = new Mesh.AllocationBuilder(mRS);
- smb.addVertexAllocation(points.getAllocation());
- smb.addIndexSetType(Mesh.Primitive.POINT);
- Mesh sm = smb.create();
-
- /**
- * Create and bind the Renderscript object to the Renderscript context
- */
- mScript = new ScriptC_fountain(mRS, mRes, R.raw.fountain);
- mScript.set_partMesh(sm);
- mScript.bind_point(points);
- mRS.bindRootScript(mScript);
- }
-
- boolean holdingColor[] = new boolean[10];
-
- /**
- * Calls Renderscript functions (invoke_addParticles)
- * via the Renderscript object to add particles to render
- * based on where a user touches the screen.
- */
- public void newTouchPosition(float x, float y, float pressure, int id) {
- if (id >= holdingColor.length) {
- return;
- }
- int rate = (int)(pressure * pressure * 500.f);
- if (rate > 500) {
- rate = 500;
- }
- if (rate > 0) {
- mScript.invoke_addParticles(rate, x, y, id, !holdingColor[id]);
- holdingColor[id] = true;
- } else {
- holdingColor[id] = false;
- }
-
- }
-}
-</pre>
-
-
- <h3 id="creating-view">Creating the view class</h3>
-
-
- <p>To display graphics, you need a view to render on. Create a class that extends {@link
- android.renderscript.RSSurfaceView} or {@link android.renderscript.RSTextureView}. This class
- allows you to create a {@link android.renderscript.RenderScriptGL} context object by calling and
- pass it to the Rendscript entry point class to bind the two. Once bound, the content is aware
- of the code that it needs to use to render graphics with. If your Renderscript code
- depends on any type of information that the view is aware of, such as touches from the user,
- you can also use this class to relay that information to the Renderscript entry point class.
- The following code shows how the <code>FountainView</code> class is implemented:</p>
- <pre>
-package com.example.android.rs.fountain;
-
-import android.renderscript.RSTextureView;
-import android.renderscript.RenderScriptGL;
-import android.content.Context;
-import android.view.MotionEvent;
-
-public class FountainView extends RSTextureView {
-
- public FountainView(Context context) {
- super(context);
- }
- // Renderscript context
- private RenderScriptGL mRS;
- // Renderscript entry point object that calls Renderscript code
- private FountainRS mRender;
-
- /**
- * Create Renderscript context and initialize Renderscript entry point
- */
- @Override
- protected void onAttachedToWindow() {
- super.onAttachedToWindow();
- android.util.Log.e("rs", "onAttachedToWindow");
- if (mRS == null) {
- RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
- mRS = createRenderScriptGL(sc);
- mRender = new FountainRS();
- mRender.init(mRS, getResources());
- }
- }
-
- @Override
- protected void onDetachedFromWindow() {
- super.onDetachedFromWindow();
- android.util.Log.e("rs", "onDetachedFromWindow");
- if (mRS != null) {
- mRS = null;
- destroyRenderScriptGL();
- }
- }
-
-
- /**
- * Use callbacks to relay data to Renderscript entry point class
- */
- @Override
- public boolean onTouchEvent(MotionEvent ev)
- {
- int act = ev.getActionMasked();
- if (act == ev.ACTION_UP) {
- mRender.newTouchPosition(0, 0, 0, ev.getPointerId(0));
- return false;
- } else if (act == MotionEvent.ACTION_POINTER_UP) {
- // only one pointer going up, we can get the index like this
- int pointerIndex = ev.getActionIndex();
- int pointerId = ev.getPointerId(pointerIndex);
- mRender.newTouchPosition(0, 0, 0, pointerId);
- }
- int count = ev.getHistorySize();
- int pcount = ev.getPointerCount();
-
- for (int p=0; p < pcount; p++) {
- int id = ev.getPointerId(p);
- mRender.newTouchPosition(ev.getX(p),
- ev.getY(p),
- ev.getPressure(p),
- id);
-
- for (int i=0; i < count; i++) {
- mRender.newTouchPosition(ev.getHistoricalX(p, i),
- ev.getHistoricalY(p, i),
- ev.getHistoricalPressure(p, i),
- id);
- }
- }
- return true;
- }
-}
-</pre>
-
- <h3 id="creating-activity">Creating the activity class</h3>
-
- <p>Applications that use Renderscript still behave like normal Android applications, so you
- need an activity class that handles activity lifecycle callback events appropriately. The activity class
- also sets your {@link android.renderscript.RSSurfaceView} view class to be the main content view of the
- activity or uses your {@link android.renderscript.RSTextureView}
- in a {@link android.view.ViewGroup} alongside other views.</p>
-
- <p>The following code shows how the <a href="{@docRoot}resources/samples/RenderScript/Fountain/index.html">Fountain</a>
- sample declares its activity class:</p>
- <pre>
-package com.example.android.rs.fountain;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-
-public class Fountain extends Activity {
-
- private static final String LOG_TAG = "libRS_jni";
- private static final boolean DEBUG = false;
- private static final boolean LOG_ENABLED = false;
-
- private FountainView mView;
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
-
- // Create our Preview view and set it as
- // the content of our activity
- mView = new FountainView(this);
- setContentView(mView);
- }
-
- @Override
- protected void onResume() {
- Log.e("rs", "onResume");
-
- // Ideally a game should implement onResume() and onPause()
- // to take appropriate action when the activity looses focus
- super.onResume();
- mView.resume();
- }
-
- @Override
- protected void onPause() {
- Log.e("rs", "onPause");
-
- // Ideally a game should implement onResume() and onPause()
- // to take appropriate action when the activity looses focus
- super.onPause();
- mView.pause();
-
- }
-
- static void log(String message) {
- if (LOG_ENABLED) {
- Log.v(LOG_TAG, message);
- }
- }
-}
-</pre>
-
-<p>Now that you have an idea of what is involved in a Renderscript graphics application, you can
-start building your own. It might be easiest to begin with one of the
-<a href="{@docRoot}resources/samples/RenderScript/index.html">Renderscript samples</a> as a starting
-point if this is your first time using Renderscript.</p>
-
- <h2 id="drawing">Drawing</h2>
- <p>The following sections describe how to use the graphics functions to draw with Renderscript.</p>
-
- <h3 id="drawing-rsg">Simple drawing</h3>
-
- <p>The native Renderscript APIs provide a few convenient functions to easily draw a polygon or text to
- the screen. You call these in your <code>root()</code> function to have them render to the {@link
- android.renderscript.RSSurfaceView} or {@link android.renderscript.RSTextureView}. These functions are
- available for simple drawing and should not be used for complex graphics rendering:</p>
-
- <ul>
- <li><code>rsgDrawRect()</code>: Sets up a mesh and draws a rectangle to the screen. It uses the
- top left vertex and bottom right vertex of the rectangle to draw.</li>
-
- <li><code>rsgDrawQuad()</code>: Sets up a mesh and draws a quadrilateral to the screen.</li>
-
- <li><code>rsgDrawQuadTexCoords()</code>: Sets up a mesh and draws a quadrilateral to the screen
- using the provided coordinates of a texture.</li>
-
- <li><code>rsgDrawText()</code>: Draws specified text to the screen. Use <code>rsgFontColor()</code>
- to set the color of the text.</li>
- </ul>
-
- <h3 id="drawing-mesh">Drawing with a mesh</h3>
-
- <p>When you want to render complex scenes to the screen, instantiate a {@link
- android.renderscript.Mesh} and draw it with <code>rsgDrawMesh()</code>. A {@link
- android.renderscript.Mesh} is a collection of allocations that represent vertex data (positions,
- normals, texture coordinates) and index data that provides information on how to draw triangles
- and lines with the provided vertex data. You can build a Mesh in three different ways:</p>
-
- <ul>
- <li>Build the mesh with the {@link android.renderscript.Mesh.TriangleMeshBuilder} class, which
- allows you to specify a set of vertices and indices for each triangle that you want to draw.</li>
-
- <li>Build the mesh using an {@link android.renderscript.Allocation} or a set of {@link
- android.renderscript.Allocation}s with the {@link android.renderscript.Mesh.AllocationBuilder}
- class. This approach allows you to build a mesh with vertices already stored in memory, which allows you
- to specify the vertices in Renderscript or Android framework code.</li>
-
- <li>Build the mesh with the {@link android.renderscript.Mesh.Builder} class. You should use
- this convenience method when you know the data types you want to use to build your mesh, but
- don't want to make separate memory allocations like with {@link
- android.renderscript.Mesh.AllocationBuilder}. You can specify the types that you want and this
- mesh builder automatically creates the memory allocations for you.</li>
- </ul>
-
- <p>To create a mesh using the {@link android.renderscript.Mesh.TriangleMeshBuilder}, you need to
- supply it with a set of vertices and the indices for the vertices that comprise the triangle. For
- example, the following code specifies three vertices, which are added to an internal array,
- indexed in the order they were added. The call to {@link
- android.renderscript.Mesh.TriangleMeshBuilder#addTriangle addTriangle()} draws the triangle with
- vertex 0, 1, and 2 (the vertices are drawn counter-clockwise).</p>
- <pre>
-int float2VtxSize = 2;
-Mesh.TriangleMeshBuilder triangles = new Mesh.TriangleMeshBuilder(renderscriptGL,
-float2VtxSize, Mesh.TriangleMeshBuilder.COLOR);
-triangles.addVertex(300.f, 300.f);
-triangles.addVertex(150.f, 450.f);
-triangles.addVertex(450.f, 450.f);
-triangles.addTriangle(0 , 1, 2);
-Mesh smP = triangle.create(true);
-script.set_mesh(smP);
-</pre>
-
- <p>To draw a mesh using the {@link android.renderscript.Mesh.AllocationBuilder}, you need to
- supply it with one or more allocations that contain the vertex data:</p>
- <pre>
-Allocation vertices;
-
-...
-Mesh.AllocationBuilder triangle = new Mesh.AllocationBuilder(mRS);
-smb.addVertexAllocation(vertices.getAllocation());
-smb.addIndexSetType(Mesh.Primitive.TRIANGLE);
-Mesh smP = smb.create();
-script.set_mesh(smP);
-</pre>
-
- <p>In your Renderscript code, draw the built mesh to the screen:</p>
- <pre>
-rs_mesh mesh;
-...
-
-int root(){
-...
-rsgDrawMesh(mesh);
-...
-return 0; //specify a non zero, positive integer to specify the frame refresh.
- //0 refreshes the frame only when the mesh changes.
-}
-</pre>
-
- <h2 id="shader">Programs</h2>
-
- <p>You can attach four program objects to the {@link android.renderscript.RenderScriptGL} context
- to customize the rendering pipeline. For example, you can create vertex and fragment shaders in
- GLSL or build a raster program object that controls culling. The four programs mirror a
- traditional graphical rendering pipeline:</p>
-
- <table>
- <tr>
- <th>Android Object Type</th>
-
- <th>Renderscript Native Type</th>
-
- <th>Description</th>
- </tr>
-
- <tr>
- <td>{@link android.renderscript.ProgramVertex}</td>
-
- <td>rs_program_vertex</td>
-
- <td>
- <p>The Renderscript vertex program, also known as a vertex shader, describes the stage in
- the graphics pipeline responsible for manipulating geometric data in a user-defined way.
- The object is constructed by providing Renderscript with the following data:</p>
-
- <ul>
- <li>An {@link android.renderscript.Element} describing its varying inputs or attributes</li>
-
- <li>GLSL shader string that defines the body of the program</li>
-
- <li>a {@link android.renderscript.Type} that describes the layout of an
- Allocation containing constant or uniform inputs</li>
- </ul>
-
- <p>Once the program is created, bind it to the {@link android.renderscript.RenderScriptGL}
- graphics context by calling {@link android.renderscript.RenderScriptGL#bindProgramVertex
- bindProgramVertex()}. It is then used for all subsequent draw calls until you bind a new
- program. If the program has constant inputs, the user needs to bind an allocation
- containing those inputs. The allocation's type must match the one provided during creation.
- </p>
-
- <p>The Renderscript runtime then does all the necessary plumbing to send those constants to
- the graphics hardware. Varying inputs to the shader, such as position, normal, and texture
- coordinates are matched by name between the input {@link android.renderscript.Element}
- and the mesh object that is being drawn. The signatures don't have to be exact or in any
- strict order. As long as the input name in the shader matches a channel name and size
- available on the mesh, the Renderscript runtime handles connecting the two. Unlike OpenGL
- there is no need to link the vertex and fragment programs.</p>
-
- <p>To bind shader constants to the program, declare a <code>struct</code> that contains the necessary
- shader constants in your Renderscript code. This <code>struct</code> is generated into a
- reflected class that you can use as a constant input element during the program's creation.
- It is an easy way to create an instance of this <code>struct</code> as an allocation. You would then
- bind this {@link android.renderscript.Allocation} to the program and the
- Renderscript runtime sends the data that is contained in the <code>struct</code> to the hardware
- when necessary. To update shader constants, you change the values in the
- {@link android.renderscript.Allocation} and notify the Renderscript
- code of the change.</p>
-
- <p>The {@link android.renderscript.ProgramVertexFixedFunction.Builder} class also
- lets you build a simple vertex shader without writing GLSL code.
- </p>
- </td>
- </tr>
-
- <tr>
- <td>{@link android.renderscript.ProgramFragment}</td>
-
- <td>rs_program_fragment</td>
-
- <td>
- <p>The Renderscript fragment program, also known as a fragment shader, is responsible for
- manipulating pixel data in a user-defined way. It's constructed from a GLSL shader string
- containing the program body, texture inputs, and a {@link android.renderscript.Type}
- object that describes the constants
- used by the program. Like the vertex programs, when an {@link android.renderscript.Allocation}
- with constant input
- values is bound to the shader, its values are sent to the graphics program automatically.
- Note that the values inside the {@link android.renderscript.Allocation} are not explicitly tracked.
- If they change between two draw calls using the same program object, notify the runtime of that change by
- calling <code>rsgAllocationSyncAll()</code>, so it can send the new values to hardware. Communication
- between the vertex and fragment programs is handled internally in the GLSL code. For
- example, if the fragment program is expecting a varying input called <code>varTex0</code>, the GLSL code
- inside the program vertex must provide it.</p>
-
- <p>To bind shader constructs to the program, declare a <code>struct</code> that contains the necessary
- shader constants in your Renderscript code. This <code>struct</code> is generated into a
- reflected class that you can use as a constant input element during the program's creation.
- It is an easy way to create an instance of this <code>struct</code> as an allocation. You would then
- bind this {@link android.renderscript.Allocation} to the program and the
- Renderscript runtime sends the data that is contained in the <code>struct</code> to the hardware
- when necessary. To update shader constants, you change the values in the
- {@link android.renderscript.Allocation} and notify the Renderscript
- code of the change.</p>
-
- <p>The {@link android.renderscript.ProgramFragmentFixedFunction.Builder} class also
- lets you build a simple fragment shader without writing GLSL code.
- </p>
- </td>
- </tr>
-
- <tr>
- <td>{@link android.renderscript.ProgramStore}</td>
-
- <td>rs_program_store</td>
-
- <td>The Renderscript store program contains a set of parameters that control how the graphics
- hardware writes to the framebuffer. It could be used to enable and disable depth writes and
- testing, setup various blending modes for effects like transparency and define write masks
- for color components.</td>
- </tr>
-
- <tr>
- <td>{@link android.renderscript.ProgramRaster}</td>
-
- <td>rs_program_raster</td>
-
- <td>The Renderscript raster program is primarily used to specify whether point sprites are enabled and to
- control the culling mode. By default back faces are culled.</td>
- </tr>
- </table>
-
- <p>The following example defines a vertex shader in GLSL and binds it to a Renderscript context object:</p>
- <pre>
- private RenderScriptGL glRenderer; //rendering context
- private ScriptField_Point mPoints; //vertices
- private ScriptField_VpConsts mVpConsts; //shader constants
-
- ...
-
- ProgramVertex.Builder sb = new ProgramVertex.Builder(glRenderer);
- String t = "varying vec4 varColor;\n" +
- "void main() {\n" +
- " vec4 pos = vec4(0.0, 0.0, 0.0, 1.0);\n" +
- " pos.xy = ATTRIB_position;\n" +
- " gl_Position = UNI_MVP * pos;\n" +
- " varColor = vec4(1.0, 1.0, 1.0, 1.0);\n" +
- " gl_PointSize = ATTRIB_size;\n" +
- "}\n";
- sb.setShader(t);
- sb.addConstant(mVpConsts.getType());
- sb.addInput(mPoints.getElement());
- ProgramVertex pvs = sb.create();
- pvs.bindConstants(mVpConsts.getAllocation(), 0);
- glRenderer.bindProgramVertex(pvs);
-</pre>
-
-
- <p>The <a href=
- "{@docRoot}resources/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/RsRenderStatesRS.html">
- RsRenderStatesRS</a> sample has many examples on how to create a shader without writing GLSL.</p>
-
- <h3 id="shader-bindings">Program bindings</h3>
-
- <p>You can also declare four pragmas that control default program bindings to the {@link
- android.renderscript.RenderScriptGL} context when the script is executing:</p>
-
- <ul>
- <li><code>stateVertex</code></li>
-
- <li><code>stateFragment</code></li>
-
- <li><code>stateRaster</code></li>
-
- <li><code>stateStore</code></li>
- </ul>
-
- <p>The possible values for each pragma are <code>parent</code> or <code>default</code>. Using
- <code>default</code> binds the shaders to the graphical context with the system defaults.</p>
-
- <p>Using <code>parent</code> binds the shaders in the same manner as it is bound in the calling
- script. If this is the root script, the parent state is taken from the bind points that are set
- by the {@link android.renderscript.RenderScriptGL} bind methods.</p>
-
- <p>For example, you can define this at the top of your graphics Renderscript code to have
- the vertex and store programs inherent the bind properties from their parent scripts:</p>
- <pre>
-#pragma stateVertex(parent)
-#pragma stateStore(parent)
-</pre>
-
- <h3 id="shader-sampler">Defining a sampler</h3>
-
- <p>A {@link android.renderscript.Sampler} object defines how data is extracted from textures.
- Samplers are bound to a {@link android.renderscript.ProgramFragment} alongside the texture
- whose sampling they control. These
- objects are used to specify such things as edge clamping behavior, whether mip-maps are used, and
- the amount of anisotropy required. There might be situations where hardware does not support the
- desired behavior of the sampler. In these cases, the Renderscript runtime attempts to provide the
- closest possible approximation. For example, the user requested 16x anisotropy, but only 8x was
- set because it's the best available on the hardware.</p>
-
- <p>The <a href=
- "{@docRoot}resources/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/RsRenderStatesRS.html">
- RsRenderStatesRS</a> sample has many examples on how to create a sampler and bind it to a
- Fragment program.</p>
-
-
-
-<h2 id="fbo">Rendering to a Framebuffer Object</h2>
-
-<p>Framebuffer objects allow you to render offscreen instead of in the default onscreen
-framebuffer. This approach might be useful for situations where you need to post-process a texture before
-rendering it to the screen, or when you want to composite two scenes in one such as rendering a rear-view
-mirror of a car. There are two buffers associated with a framebuffer object: a color buffer
-and a depth buffer. The color buffer (required) contains the actual pixel data of the scene
-that you are rendering, and the depth buffer (optional) contains the values necessary to figure
-out what vertices are drawn depending on their z-values.</p>
-
-<p>In general, you need to do the following to render to a framebuffer object:</p>
-
-<ul>
- <li>Create {@link android.renderscript.Allocation} objects for the color buffer and
- depth buffer (if needed). Specify the {@link
- android.renderscript.Allocation#USAGE_GRAPHICS_RENDER_TARGET} usage attribute for these
- allocations to notify the Renderscript runtime to use these allocations for the framebuffer
- object. For the color buffer allocation, you most likely need to declare the {@link
- android.renderscript.Allocation#USAGE_GRAPHICS_TEXTURE} usage attribute
- to use the color buffer as a texture, which is the most common use of the framebuffer object.</li>
-
- <li>Tell the Renderscript runtime to render to the framebuffer object instead of the default
- framebuffer by calling <code>rsgBindColorTarget()</code> and passing it the color buffer
- allocation. If applicable, call <code>rsgBindDepthTarget()</code> passing in the depth buffer
- allocation as well.</li>
-
- <li>Render your scene normally with the <code>rsgDraw</code> functions. The scene will be
- rendered into the color buffer instead of the default onscreen framebuffer.</li>
-
- <li>When done, tell the Renderscript runtime stop rendering to the color buffer and back
- to the default framebuffer by calling <code>rsgClearAllRenderTargets()</code>.</li>
-
- <li>Create a fragment shader and bind a the color buffer to it as a texture.</li>
-
- <li>Render your scene to the default framebuffer. The texture will be used according
- to the way you setup your fragment shader.</li>
-</ul>
-
-<p>The following example shows you how to render to a framebuffer object by modifying the
-<a href="{@docRoot}guide/resources/renderscript/Fountain/">Fountain</a> Renderscript sample. The end
-result is the <a href="{@docRoot}guide/resources/renderscript/FountainFBO/">FountainFBO</a> sample.
-The modifications render the exact same scene into a framebuffer object as it does the default
-framebuffer. The framebuffer object is then rendered into the default framebuffer in a small
-area at the top left corner of the screen.</p>
-
-<ol>
- <li>Modify <code>fountain.rs</code> and add the following global variables. This creates setter
- methods when this file is reflected into a <code>.java</code> file, allowing you to allocate
- memory in your Android framework code and binding it to the Renderscript runtime.
-<pre>
-//allocation for color buffer
-rs_allocation gColorBuffer;
-//fragment shader for rendering without a texture (used for rendering to framebuffer object)
-rs_program_fragment gProgramFragment;
-//fragment shader for rendering with a texture (used for rendering to default framebuffer)
-rs_program_fragment gTextureProgramFragment;
-</pre>
- </li>
-
- <li>Modify the root function of <code>fountain.rs</code> to look like the following code. The
- modifications are commented:
-<pre>
-int root() {
- float dt = min(rsGetDt(), 0.1f);
- rsgClearColor(0.f, 0.f, 0.f, 1.f);
- const float height = rsgGetHeight();
- const int size = rsAllocationGetDimX(rsGetAllocation(point));
- float dy2 = dt * (10.f);
- Point_t * p = point;
- for (int ct=0; ct < size; ct++) {
- p->delta.y += dy2;
- p->position += p->delta;
- if ((p->position.y > height) && (p->delta.y > 0)) {
- p->delta.y *= -0.3f;
- }
- p++;
- }
- //Tell Renderscript runtime to render to the frame buffer object
- rsgBindColorTarget(gColorBuffer, 0);
- //Begin rendering on a white background
- rsgClearColor(1.f, 1.f, 1.f, 1.f);
- rsgDrawMesh(partMesh);
-
- //When done, tell Renderscript runtime to stop rendering to framebuffer object
- rsgClearAllRenderTargets();
-
- //Bind a new fragment shader that declares the framebuffer object to be used as a texture
- rsgBindProgramFragment(gTextureProgramFragment);
-
- //Bind the framebuffer object to the fragment shader at slot 0 as a texture
- rsgBindTexture(gTextureProgramFragment, 0, gColorBuffer);
- //Draw a quad using the framebuffer object as the texture
- float startX = 10, startY = 10;
- float s = 256;
- rsgDrawQuadTexCoords(startX, startY, 0, 0, 1,
- startX, startY + s, 0, 0, 0,
- startX + s, startY + s, 0, 1, 0,
- startX + s, startY, 0, 1, 1);
-
- //Rebind the original fragment shader to render as normal
- rsgBindProgramFragment(gProgramFragment);
-
- //Render the main scene
- rsgDrawMesh(partMesh);
-
- return 1;
-}
-</pre>
- </li>
-
- <li>In the <code>FountainRS.java</code> file, modify the <code>init()</code> method to look
- like the following code. The modifications are commented:
-
-<pre>
-/* Add necessary members */
-private ScriptC_fountainfbo mScript;
-private Allocation mColorBuffer;
-private ProgramFragment mProgramFragment;
-private ProgramFragment mTextureProgramFragment;
-
-public void init(RenderScriptGL rs, Resources res) {
- mRS = rs;
- mRes = res;
-
- ScriptField_Point points = new ScriptField_Point(mRS, PART_COUNT);
-
- Mesh.AllocationBuilder smb = new Mesh.AllocationBuilder(mRS);
- smb.addVertexAllocation(points.getAllocation());
- smb.addIndexSetType(Mesh.Primitive.POINT);
- Mesh sm = smb.create();
-
- mScript = new ScriptC_fountainfbo(mRS, mRes, R.raw.fountainfbo);
- mScript.set_partMesh(sm);
- mScript.bind_point(points);
-
- ProgramFragmentFixedFunction.Builder pfb = new ProgramFragmentFixedFunction.Builder(rs);
- pfb.setVaryingColor(true);
- mProgramFragment = pfb.create();
- mScript.set_gProgramFragment(mProgramFragment);
-
- /* Second fragment shader to use a texture (framebuffer object) to draw with */
- pfb.setTexture(ProgramFragmentFixedFunction.Builder.EnvMode.REPLACE,
- ProgramFragmentFixedFunction.Builder.Format.RGBA, 0);
-
- /* Set the fragment shader in the Renderscript runtime */
- mTextureProgramFragment = pfb.create();
- mScript.set_gTextureProgramFragment(mTextureProgramFragment);
-
- /* Create the allocation for the color buffer */
- Type.Builder colorBuilder = new Type.Builder(mRS, Element.RGBA_8888(mRS));
- colorBuilder.setX(256).setY(256);
- mColorBuffer = Allocation.createTyped(mRS, colorBuilder.create(),
- Allocation.USAGE_GRAPHICS_TEXTURE |
- Allocation.USAGE_GRAPHICS_RENDER_TARGET);
-
- /* Set the allocation in the Renderscript runtime */
- mScript.set_gColorBuffer(mColorBuffer);
-
- mRS.bindRootScript(mScript);
-}
-</pre>
-
-<p class="note"><strong>Note:</strong> This sample doesn't use a depth buffer, but the following code
-shows you how to declare an example depth buffer if you need to use
-one for your application. The depth buffer must have the same dimensions as the color buffer:
-
-<pre>
-Allocation mDepthBuffer;
-
-...
-
-Type.Builder b = new Type.Builder(mRS, Element.createPixel(mRS, DataType.UNSIGNED_16,
- DataKind.PIXEL_DEPTH));
-b.setX(256).setY(256);
-mDepthBuffer = Allocation.createTyped(mRS, b.create(),
-Allocation.USAGE_GRAPHICS_RENDER_TARGET);
-
-</pre>
-</p>
-</li>
-
- <li>Run and use the sample. The smaller, white quad on the top-left corner is using the
- framebuffer object as a texture, which renders the same scene as the main rendering.</li>
-</ol>
diff --git a/docs/html/guide/topics/resources/animation-resource.jd b/docs/html/guide/topics/resources/animation-resource.jd
index 6473155..3af52aa 100644
--- a/docs/html/guide/topics/resources/animation-resource.jd
+++ b/docs/html/guide/topics/resources/animation-resource.jd
@@ -18,7 +18,7 @@
<h2>See also</h2>
<ol>
<li><a href="{@docRoot}guide/topics/graphics/view-animation.html">View Animation</a></li>
- <li><a href="{@docRoot}guide/topics/graphics/animation.html">Property Animation</a></li>
+ <li><a href="{@docRoot}guide/topics/graphics/prop-animation.html">Property Animation</a></li>
</ol>
</div>
</div>
@@ -334,7 +334,7 @@
<dt>see also:</dt>
<dd>
<ul>
- <li><a href="{@docRoot}guide/topics/graphics/animation.html">Property Animation</a></li>
+ <li><a href="{@docRoot}guide/topics/graphics/prop-animation.html">Property Animation</a></li>
<li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/animation/index.html">API Demos</a> for examples
on how to use the property animation system.</li>
</ul>
diff --git a/docs/html/guide/topics/resources/index.jd b/docs/html/guide/topics/resources/index.jd
index 3f0f1ee..386abf5 100644
--- a/docs/html/guide/topics/resources/index.jd
+++ b/docs/html/guide/topics/resources/index.jd
@@ -1,103 +1,55 @@
-page.title=Application Resources
+page.title=App Resources
+page.landing=true
+page.landing.intro=It takes more than just code to build a great app. Resources are the additional files and static content that your code uses, such as bitmaps, layout definitions, user interface strings, animation instructions, and more.
+page.landing.image=images/develop/resources.png
+
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
- <h2>Topics</h2>
- <ol>
- <li><a href="providing-resources.html">Providing Resources</a></li>
- <li><a href="accessing-resources.html">Accessing Resources</a></li>
- <li><a href="runtime-changes.html">Handling Runtime Changes</a></li>
- <li><a href="localization.html">Localization</a></li>
- </ol>
+<div class="landing-docs">
- <h2>Reference</h2>
- <ol>
- <li><a href="available-resources.html">Resource Types</a></li>
- </ol>
-</div>
-</div>
+ <div class="col-6">
+ <h3>Blog Articles</h3>
+ <a
+href="http://android-developers.blogspot.com/2011/07/new-tools-for-managing-screen-sizes.html">
+ <h4>New Tools For Managing Screen Sizes</h4>
+ <p>Android 3.2 includes new tools for supporting devices with a wide range of screen sizes.
+One important result is better support for a new size of screen; what is typically called a ?7-inch?
+tablet. This release also offers several new APIs to simplify developers? work in adjusting to
+different screen sizes.</p>
+ </a>
-<p>You should always externalize resources such as images and strings from your application
-code, so that you can maintain them independently. Externalizing your
-resources also allows you to provide alternative resources that support specific device
-configurations such as different languages or screen sizes, which becomes increasingly
-important as more Android-powered devices become available with different configurations. In order
-to provide compatibility with different configurations, you must organize resources in your
-project's {@code res/} directory, using various sub-directories that group resources by type and
-configuration.</p>
+ <a href="http://android-developers.blogspot.com/2012/01/holo-everywhere.html">
+ <h4>Holo Everywhere</h4>
+ <p>Before Android 4.0 the variance in system themes from device to device could make it
+difficult to design an app with a single predictable look and feel. We set out to improve this
+situation for the developer community in Ice Cream Sandwich and beyond.</p>
+ </a>
+
+ <a
+href="http://android-developers.blogspot.com/2011/07/new-mode-for-apps-on-large-screens.html">
+ <h4>New Mode for Apps on Large Screens</h4>
+ <p>Android tablets are becoming more popular, and we're pleased to note that the vast majority
+of apps resize to the larger screens just fine. To keep the few apps that don't resize well from
+frustrating users with awkward-looking apps on their tablets, Android 3.2 introduces a screen
+compatibility mode that makes these apps more usable on tablets.</p>
+ </a>
+ </div>
-<div class="figure" style="width:429px">
-<img src="{@docRoot}images/resources/resource_devices_diagram1.png" height="167" alt="" />
-<p class="img-caption">
-<strong>Figure 1.</strong> Two different devices, each using the default layout
-(the app provides no alternative layouts).</p>
-</div>
+ <div class="col-6">
+ <h3>Training</h3>
-<div class="figure" style="width:429px">
-<img src="{@docRoot}images/resources/resource_devices_diagram2.png" height="167" alt="" />
-<p class="img-caption">
-<strong>Figure 2.</strong> Two different devices, each using a different layout provided
-for different screen sizes.</p>
-</div>
-
-<p>For any type of resource, you can specify <em>default</em> and multiple
-<em>alternative</em> resources for your application:</p>
-<ul>
- <li>Default resources are those that should be used regardless of
-the device configuration or when there are no alternative resources that match the current
-configuration.</li>
- <li>Alternative resources are those that you've designed for use with a specific
-configuration. To specify that a group of resources are for a specific configuration,
-append an appropriate configuration qualifier to the directory name.</li>
-</ul>
-
-<p>For example, while your default UI
-layout is saved in the {@code res/layout/} directory, you might specify a different layout to
-be used when the screen is in landscape orientation, by saving it in the {@code res/layout-land/}
-directory. Android automatically applies the appropriate resources by matching the
-device's current configuration to your resource directory names.</p>
-
-<p>Figure 1 illustrates how the system applies the same layout for
-two different devices when there are no alternative resources available. Figure 2 shows
-the same application when it adds an alternative layout resource for larger screens.</p>
-
-<p>The following documents provide a complete guide to how you can organize your application resources,
-specify alternative resources, access them in your application, and more:</p>
-
-<dl>
- <dt><strong><a href="providing-resources.html">Providing Resources</a></strong></dt>
- <dd>What kinds of resources you can provide in your app, where to save them, and how to create
-alternative resources for specific device configurations.</dd>
- <dt><strong><a href="accessing-resources.html">Accessing Resources</a></strong></dt>
- <dd>How to use the resources you've provided, either by referencing them from your application
-code or from other XML resources.</dd>
- <dt><strong><a href="runtime-changes.html">Handling Runtime Changes</a></strong></dt>
- <dd>How to manage configuration changes that occur while your Activity is running.</dd>
- <dt><strong><a href="localization.html">Localization</a></strong></dt>
- <dd>A bottom-up guide to localizing your application using alternative resources. While this is
-just one specific use of alternative resources, it is very important in order to reach more
-users.</dd>
- <dt><strong><a href="available-resources.html">Resource Types</a></strong></dt>
- <dd>A reference of various resource types you can provide, describing their XML elements,
-attributes, and syntax. For example, this reference shows you how to create a resource for
-application menus, drawables, animations, and more.</dd>
-</dl>
-
-<!--
-<h2>Raw Assets</h2>
-
-<p>An alternative to saving files in {@code res/} is to save files in the {@code
-assets/} directory. This should only be necessary if you need direct access to original files and
-directories by name. Files saved in the {@code assets/} directory will not be given a resource
-ID, so you can't reference them through the {@code R} class or from XML resources. Instead, you can
-query data in the {@code assets/} directory like an ordinary file system, search through the
-directory and
-read raw data using {@link android.content.res.AssetManager}. For example, this can be more useful
-when dealing with textures for a game. However, if you only need to read raw data from a file
-(such as a video or audio file), then you should save files into the {@code res/raw/} directory and
-then read a stream of bytes using {@link android.content.res.Resources#openRawResource(int)}. This
-is uncommon, but if you need direct access to original files in {@code assets/}, refer to the {@link
-android.content.res.AssetManager} documentation.</p>
--->
+ <a href="http://developer.android.com/training/basics/supporting-devices/index.html">
+ <h4>Supporting Different Devices</h4>
+ <p>This class teaches you how to use basic platform features that leverage alternative
+resources and other features so your app can provide an optimized user experience on a variety of
+Android-compatible devices, using a single application package (APK).</p>
+ </a>
+
+ <a href="http://developer.android.com/training/multiscreen/index.html">
+ <h4>Designing for Multiple Screens</h4>
+ <p>This class shows you how to implement a user interface that's optimized for several screen
+configurations.</p>
+ </a>
+ </div>
+</div><!-- end landing-docs -->
diff --git a/docs/html/guide/topics/resources/layout-resource.jd b/docs/html/guide/topics/resources/layout-resource.jd
index 286e3d1..5643075 100644
--- a/docs/html/guide/topics/resources/layout-resource.jd
+++ b/docs/html/guide/topics/resources/layout-resource.jd
@@ -7,7 +7,7 @@
<div id="qv">
<h2>See also</h2>
<ol>
- <li><a href="{@docRoot}guide/topics/ui/declaring-layout.html">XML Layouts</a></li>
+ <li><a href="{@docRoot}guide/topics/ui/declaring-layout.html">Layouts</a></li>
</ol>
</div>
</div>
@@ -128,7 +128,7 @@
<p>More attributes are supported by the {@link android.view.View}
base class, and many more are supported by each implementation of
{@link android.view.View}. Read <a
-href="{@docRoot}guide/topics/ui/declaring-layout.html">XML Layouts</a> for more information. For
+href="{@docRoot}guide/topics/ui/declaring-layout.html">Layouts</a> for more information. For
a reference of all available attributes,
see the corresponding reference documentation (for example, the <a
href="{@docRoot}reference/android/widget/TextView.html#lattrs">TextView XML attributes</a>).</p>
@@ -275,7 +275,7 @@
<dt>see also:</dt>
<dd>
<ul>
- <li><a href="{@docRoot}guide/topics/ui/declaring-layout.html">XML Layouts</a></li>
+ <li><a href="{@docRoot}guide/topics/ui/declaring-layout.html">Layouts</a></li>
<li>{@link android.view.View}</li>
<li>{@link android.view.ViewGroup}</li>
</ul>
diff --git a/docs/html/guide/topics/resources/localization.jd b/docs/html/guide/topics/resources/localization.jd
index c2b668d..41961a3 100755
--- a/docs/html/guide/topics/resources/localization.jd
+++ b/docs/html/guide/topics/resources/localization.jd
@@ -38,7 +38,6 @@
<li><a href="#emulator">Testing on an Emulator</a></li>
<li><a href="#test-for-default">Testing for Default Resources</a></li>
</ol>
-<li><a href="#publishing">Publishing</a></li>
<li><a href="#checklist">Localization Checklists</a></li>
<ol>
<li><a href="#planning-checklist">Planning and Design Checklist</a></li>
@@ -52,7 +51,7 @@
<li><a
href="{@docRoot}resources/tutorials/localization/index.html">Hello, L10N Tutorial</a></li>
<li><a href="{@docRoot}guide/topics/resources/providing-resources.html">Providing Resources</a></li>
- <li><a href="{@docRoot}guide/topics/ui/declaring-layout.html">XML Layouts</a></li>
+ <li><a href="{@docRoot}guide/topics/ui/declaring-layout.html">Layouts</a></li>
<li><a href="{@docRoot}reference/android/app/Activity.html#ActivityLifecycle">Activity Lifecycle</a></li>
</ol>
</div>
@@ -430,7 +429,7 @@
<h3 id="emulator">Testing on an Emulator</h3>
<p>For details about using the emulator, see See <a
-href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a>.</p>
+href="{@docRoot}tools/help/emulator.html">Android Emulator</a>.</p>
<h4>Creating and using a custom locale</h4>
<p>A "custom" locale is a language/region combination that the Android
@@ -505,26 +504,6 @@
<code>res/layout-port/main.xml</code>, then set the emulator or device to
portrait orientation and see if the application will run.
-<h2 id="publishing">Publishing Localized Applications</h2>
-
-<p>The Google Play is
- the main application distribution system for Android devices. To publish a
- localized application, you need to sign your application, version it, and go
-through all the other steps described in <a
-href="{@docRoot}guide/publishing/preparing.html">Preparing to Publish</a>. </p>
-
-<p>If you split your application in several .apk files, each targeted to a
-different locale, follow these guidelines:</p>
-
-<ul>
- <li>Sign each .apk file with the same certificate. For more about this, see <a
-href="{@docRoot}guide/publishing/app-signing.html#strategies">Signing
-Strategies</a>. </li>
- <li>Give each .apk file a different application name. Currently it is
-impossible to publish two applications on Google Play that have exactly the
-same name.</li>
-<li>Include a complete set of default resources in each .apk file.</li>
-</ul>
<h2 id="checklist">Localization Checklists</h2>
@@ -640,8 +619,6 @@
border="0"></td>
<td>Upload your .apk file or files to Google Play, selecting the appropriate
languages as
- you upload. (For more details, see <a
-href="{@docRoot}guide/publishing/publishing.html">Publishing Your
-Applications</a>.)</td>
+ you upload.</td>
</tr>
</table>
\ No newline at end of file
diff --git a/docs/html/guide/topics/resources/menu-resource.jd b/docs/html/guide/topics/resources/menu-resource.jd
index fb7612e..b2d6eb3 100644
--- a/docs/html/guide/topics/resources/menu-resource.jd
+++ b/docs/html/guide/topics/resources/menu-resource.jd
@@ -111,7 +111,7 @@
callback to {@link android.app.Activity#onOptionsItemSelected onOptionsItemSelected()}. See the
example at the bottom.
<p class="warning"><strong>Warning:</strong> If you obfuscate your code using <a
-href="{@docRoot}guide/developing/tools/proguard.html">ProGuard</a> (or a similar tool),
+href="{@docRoot}tools/help/proguard.html">ProGuard</a> (or a similar tool),
be sure to exclude the method you specify in this attribute from renaming, because it can break the
functionality.</p>
<p>Introduced in API Level 11.</p></dd>
@@ -133,7 +133,8 @@
bar. Setting multiple items to always appear as action items can result in them overlapping
with other UI in the action bar.</td></tr>
<tr><td><code>collapseActionView</code></td><td>The action view associated
-with this action item (as declared by <code>android:actionViewLayout</code>) is
+with this action item (as declared by <code>android:actionLayout</code> or
+<code>android:actionViewClass</code>) is
collapsible.<br/>Introduced in API Level 14.</td></tr>
</table>
<p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer
@@ -141,7 +142,7 @@
<p>Introduced in API Level 11.</p>
</dd>
- <dt><code>android:actionViewLayout</code></dt>
+ <dt><code>android:actionLayout</code></dt>
<dd><em>Layout resource</em>. A layout to use as the action view.
<p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer
guide for more information.</p>
@@ -154,7 +155,7 @@
<p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer
guide for more information.</p>
<p class="warning"><strong>Warning:</strong> If you obfuscate your code using <a
-href="{@docRoot}guide/developing/tools/proguard.html">ProGuard</a> (or a similar tool),
+href="{@docRoot}tools/help/proguard.html">ProGuard</a> (or a similar tool),
be sure to exclude the class you specify in this attribute from renaming, because it can break the
functionality.</p>
<p>Introduced in API Level 11.</p></dd>
@@ -166,7 +167,7 @@
<p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer
guide for more information.</p>
<p class="warning"><strong>Warning:</strong> If you obfuscate your code using <a
-href="{@docRoot}guide/developing/tools/proguard.html">ProGuard</a> (or a similar tool),
+href="{@docRoot}tools/help/proguard.html">ProGuard</a> (or a similar tool),
be sure to exclude the class you specify in this attribute from renaming, because it can break the
functionality.</p>
<p>Introduced in API Level 14.</p></dd>
diff --git a/docs/html/guide/topics/resources/overview.jd b/docs/html/guide/topics/resources/overview.jd
new file mode 100644
index 0000000..c3bd0bf
--- /dev/null
+++ b/docs/html/guide/topics/resources/overview.jd
@@ -0,0 +1,103 @@
+page.title=Resources Overview
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>Topics</h2>
+ <ol>
+ <li><a href="providing-resources.html">Providing Resources</a></li>
+ <li><a href="accessing-resources.html">Accessing Resources</a></li>
+ <li><a href="runtime-changes.html">Handling Runtime Changes</a></li>
+ <li><a href="localization.html">Localization</a></li>
+ </ol>
+
+ <h2>Reference</h2>
+ <ol>
+ <li><a href="available-resources.html">Resource Types</a></li>
+ </ol>
+</div>
+</div>
+
+
+<p>You should always externalize resources such as images and strings from your application
+code, so that you can maintain them independently. Externalizing your
+resources also allows you to provide alternative resources that support specific device
+configurations such as different languages or screen sizes, which becomes increasingly
+important as more Android-powered devices become available with different configurations. In order
+to provide compatibility with different configurations, you must organize resources in your
+project's {@code res/} directory, using various sub-directories that group resources by type and
+configuration.</p>
+
+<div class="figure" style="width:429px">
+<img src="{@docRoot}images/resources/resource_devices_diagram1.png" height="167" alt="" />
+<p class="img-caption">
+<strong>Figure 1.</strong> Two different devices, each using the default layout
+(the app provides no alternative layouts).</p>
+</div>
+
+<div class="figure" style="width:429px">
+<img src="{@docRoot}images/resources/resource_devices_diagram2.png" height="167" alt="" />
+<p class="img-caption">
+<strong>Figure 2.</strong> Two different devices, each using a different layout provided
+for different screen sizes.</p>
+</div>
+
+<p>For any type of resource, you can specify <em>default</em> and multiple
+<em>alternative</em> resources for your application:</p>
+<ul>
+ <li>Default resources are those that should be used regardless of
+the device configuration or when there are no alternative resources that match the current
+configuration.</li>
+ <li>Alternative resources are those that you've designed for use with a specific
+configuration. To specify that a group of resources are for a specific configuration,
+append an appropriate configuration qualifier to the directory name.</li>
+</ul>
+
+<p>For example, while your default UI
+layout is saved in the {@code res/layout/} directory, you might specify a different layout to
+be used when the screen is in landscape orientation, by saving it in the {@code res/layout-land/}
+directory. Android automatically applies the appropriate resources by matching the
+device's current configuration to your resource directory names.</p>
+
+<p>Figure 1 illustrates how the system applies the same layout for
+two different devices when there are no alternative resources available. Figure 2 shows
+the same application when it adds an alternative layout resource for larger screens.</p>
+
+<p>The following documents provide a complete guide to how you can organize your application resources,
+specify alternative resources, access them in your application, and more:</p>
+
+<dl>
+ <dt><strong><a href="providing-resources.html">Providing Resources</a></strong></dt>
+ <dd>What kinds of resources you can provide in your app, where to save them, and how to create
+alternative resources for specific device configurations.</dd>
+ <dt><strong><a href="accessing-resources.html">Accessing Resources</a></strong></dt>
+ <dd>How to use the resources you've provided, either by referencing them from your application
+code or from other XML resources.</dd>
+ <dt><strong><a href="runtime-changes.html">Handling Runtime Changes</a></strong></dt>
+ <dd>How to manage configuration changes that occur while your Activity is running.</dd>
+ <dt><strong><a href="localization.html">Localization</a></strong></dt>
+ <dd>A bottom-up guide to localizing your application using alternative resources. While this is
+just one specific use of alternative resources, it is very important in order to reach more
+users.</dd>
+ <dt><strong><a href="available-resources.html">Resource Types</a></strong></dt>
+ <dd>A reference of various resource types you can provide, describing their XML elements,
+attributes, and syntax. For example, this reference shows you how to create a resource for
+application menus, drawables, animations, and more.</dd>
+</dl>
+
+<!--
+<h2>Raw Assets</h2>
+
+<p>An alternative to saving files in {@code res/} is to save files in the {@code
+assets/} directory. This should only be necessary if you need direct access to original files and
+directories by name. Files saved in the {@code assets/} directory will not be given a resource
+ID, so you can't reference them through the {@code R} class or from XML resources. Instead, you can
+query data in the {@code assets/} directory like an ordinary file system, search through the
+directory and
+read raw data using {@link android.content.res.AssetManager}. For example, this can be more useful
+when dealing with textures for a game. However, if you only need to read raw data from a file
+(such as a video or audio file), then you should save files into the {@code res/raw/} directory and
+then read a stream of bytes using {@link android.content.res.Resources#openRawResource(int)}. This
+is uncommon, but if you need direct access to original files in {@code assets/}, refer to the {@link
+android.content.res.AssetManager} documentation.</p>
+-->
diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd
index 82b5e29..b0d5d6f 100644
--- a/docs/html/guide/topics/resources/providing-resources.jd
+++ b/docs/html/guide/topics/resources/providing-resources.jd
@@ -44,7 +44,7 @@
<p>You should always externalize application resources such as images and strings from your
code, so that you can maintain them independently. You should also provide alternative resources for
specific device configurations, by grouping them in specially-named resource directories. At
-runtime, Android uses uses the appropriate resource based on the current configuration. For
+runtime, Android uses the appropriate resource based on the current configuration. For
example, you might want to provide a different UI layout depending on the screen size or different
strings depending on the language setting.</p>
@@ -89,7 +89,7 @@
<tr>
<td><code>animator/</code></td>
- <td>XML files that define <a href="{@docRoot}guide/topics/graphics/animation.html">property
+ <td>XML files that define <a href="{@docRoot}guide/topics/graphics/prop-animation.html">property
animations</a>.</td>
</tr>
@@ -744,7 +744,7 @@
<p>The API level supported by the device. For example, <code>v1</code> for API level
1 (devices with Android 1.0 or higher) and <code>v4</code> for API level 4 (devices with Android
1.6 or higher). See the <a
-href="{@docRoot}guide/appendix/api-levels.html">Android API levels</a> document for more information
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">Android API levels</a> document for more information
about these values.</p>
<p class="caution"><strong>Caution:</strong> Android 1.5 and 1.6 only match resources
with this qualifier when it exactly matches the platform version. See the section below about <a
@@ -976,7 +976,7 @@
notlong} resources in the corresponding default resource directory.</p>
</li>
- <li>Ensure that your <a href="{@docRoot}sdk/tools-notes.html">SDK Tools</a> version
+ <li>Ensure that your <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools</a> version
is r6 or greater.
<p>You need SDK Tools, Revision 6 (or greater), because it includes a new packaging tool that
diff --git a/docs/html/guide/topics/resources/runtime-changes.jd b/docs/html/guide/topics/resources/runtime-changes.jd
index 871b063..f5475b4 100644
--- a/docs/html/guide/topics/resources/runtime-changes.jd
+++ b/docs/html/guide/topics/resources/runtime-changes.jd
@@ -32,7 +32,7 @@
<p>To properly handle a restart, it is important that your activity restores its previous
state through the normal <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">Activity
+href="{@docRoot}guide/components/activities.html#Lifecycle">Activity
lifecycle</a>, in which Android calls
{@link android.app.Activity#onSaveInstanceState(Bundle) onSaveInstanceState()} before it destroys
your activity so that you can save data about the application state. You can then restore the state
@@ -45,7 +45,7 @@
user data or state in order to handle events such as configuration changes or when the user receives
an incoming phone call and then returns to your application much later after your application
process may have been destroyed. To learn how you can restore your activity state, read about the <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">Activity lifecycle</a>.</p>
+href="{@docRoot}guide/components/activities.html#Lifecycle">Activity lifecycle</a>.</p>
<p>However, you might encounter a situation in which restarting your application and
restoring significant amounts of data can be costly and create a poor user experience. In such a
diff --git a/docs/html/guide/topics/search/index.jd b/docs/html/guide/topics/search/index.jd
index 218511b..2ee624b 100644
--- a/docs/html/guide/topics/search/index.jd
+++ b/docs/html/guide/topics/search/index.jd
@@ -1,4 +1,4 @@
-page.title=Search
+page.title=Search Overview
@jd:body
<div id="qv-wrapper">
diff --git a/docs/html/guide/topics/search/search-dialog.jd b/docs/html/guide/topics/search/search-dialog.jd
index 8b8e75b..49451ac 100644
--- a/docs/html/guide/topics/search/search-dialog.jd
+++ b/docs/html/guide/topics/search/search-dialog.jd
@@ -561,7 +561,7 @@
events are triggered once the user executes a search (the current activity receives {@link
android.app.Activity#onPause()} and so forth, as
described in the <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">Activities</a>
+href="{@docRoot}guide/components/activities.html#Lifecycle">Activities</a>
document). If, however, the current activity is the searchable activity, then one of two
things happens:</p>
diff --git a/docs/html/guide/topics/security/index.jd b/docs/html/guide/topics/security/index.jd
new file mode 100644
index 0000000..775fc03
--- /dev/null
+++ b/docs/html/guide/topics/security/index.jd
@@ -0,0 +1,65 @@
+page.title=Security and Permissions
+page.landing=true
+page.landing.intro=Android's security architecture gives the user full control over what resources are accessible to each app, protecting the system itself and all apps in it. Learn how to use system permissions to request access to the resources your app needs and design your app for optimal security.
+page.landing.image=
+
+@jd:body
+
+<div style="width=100%;padding-left:1em;">
+
+ <div style="float:left;clear:both;padding-top:20px;">
+ <p style="text-transform:uppercase;"><b style="color:#666;font-size:14px;">Blog Articles</b></p>
+
+ <div class="" style="border-top:2px solid #DDD;margin:1em 0;background-color:#F7F7F7;width:336px">
+
+ <div style="float:left;padding:8px;padding-right:16px;">
+ <img src="/assets/images/resource-article.png">
+ </div>
+
+ <div class="caption">
+ <p style="margin:0;padding:0;font-weight:bold;"><a href="">Accessibility: Are You Serving All Your Users?</a></p>
+ <p style="margin:0;padding:0">In the upcoming weeks, some of the older Client Login authentication keys will expire.
+ If you generated the token you’re currently using to authenticate with the C2DM servers before October 2011, it will stop working.</p>
+
+ <p style="margin:0;padding:0;font-weight:bold;"><a href="">Android C2DM — Client Login key expiration</a></p>
+ <p style="margin:0;padding:0">Accessibility is about making sure that Android users who have limited vision or other physical impairments can use your application just as well</p>
+
+ <p style="margin:0;padding:0;font-weight:bold;"><a href="">A Faster Emulator with Better Hardware Support</a></p>
+ <p style="margin:0;padding:0">The Android emulator is a key tool for Android developers in building and testing their apps.
+ As the power and diversity of Android devices has grown quickly, it’s been hard for the emulator keep pace. </p>
+
+ <a href="">More »</a>
+ </div>
+ </div>
+ </div>
+
+ <div style="float:right;padding-top:20px;">
+ <p style="text-transform:uppercase;"><b style="color:#666;font-size:14px;">Training</b></p>
+
+ <div class="" style="border-top:2px solid #DDD;bordddser-top:2px solid #FF8800;margin:1em 0;background-color:#F7F7F7;width:336px">
+
+ <div style="float:left;padding:8px;padding-right:16px;">
+ <img src="/assets/images/resource-tutorial.png">
+ </div>
+
+ <div class="caption">
+ <p style="margin:0;padding:0;font-weight:bold;"><a href="">Managing the Activity Lifecycle</a></p>
+ <p style="margin:0;padding:0">This class explains important lifecycle callback methods that each Activity
+ instance receives and how you can use them so your activity does what the user expects and does not consume system
+ resources when your activity doesn't need them.</p>
+
+ <p style="margin:0;padding:0;font-weight:bold;"><a href="">Supporting Different Devices</a></p>
+ <p style="margin:0;padding:0">This class teaches you how to use basic platform features that leverage alternative
+ resources and other features so your app can provide an optimized user experience on a variety of Android-compatible devices,
+ using a single application package (APK).</p>
+
+ <p style="margin:0;padding:0;font-weight:bold;"><a href="">Sharing Content</a></p>
+ <p style="margin:0;padding:0">This class covers some common ways you can send and receive content between
+ applications using Intent APIs and the ActionProvider object.</p>
+
+ <a href="">More »</a>
+ </div>
+ </div>
+</div>
+
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/topics/security/permissions.jd b/docs/html/guide/topics/security/permissions.jd
new file mode 100644
index 0000000..3013e38
--- /dev/null
+++ b/docs/html/guide/topics/security/permissions.jd
@@ -0,0 +1,407 @@
+page.title=Permissions
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+<li><a href="#arch">Security Architecture</a></li>
+<li><a href="#signing">Application Signing</a></li>
+<li><a href="#userid">User IDs and File Access</a></li>
+<li><a href="#permissions">Using Permissions</a></li>
+<li><a href="#declaring">Declaring and Enforcing Permissions</a>
+ <ol>
+ <li><a href="#manifest">...in AndroidManifest.xml</a></li>
+ <li><a href="#broadcasts">...when Sending Broadcasts</a></li>
+ <li><a href="#enforcement">Other Permission Enforcement</a></li>
+ </ol></li>
+<li><a href="#uri">URI Permissions</a></li>
+</ol>
+</div>
+</div>
+<p>This document describes how application developers can use the
+security features provided by Android. A more general <a
+href="http://source.android.com/tech/security/index.html"> Android Security
+Overview</a> is provided in the Android Open Source Project.</p>
+
+<p>Android is a privilege-separated operating system, in which each
+application runs with a distinct system identity (Linux user ID and group
+ID). Parts of the system are also separated into distinct identities.
+Linux thereby isolates applications from each other and from the system.</p>
+
+<p>Additional finer-grained security features are provided through a
+"permission" mechanism that enforces restrictions on the specific operations
+that a particular process can perform, and per-URI permissions for granting
+ad-hoc access to specific pieces of data.</p>
+
+<a name="arch"></a>
+<h2>Security Architecture</h2>
+
+<p>A central design point of the Android security architecture is that no
+application, by default, has permission to perform any operations that would
+adversely impact other applications, the operating system, or the user. This
+includes reading or writing the user's private data (such as contacts or
+e-mails), reading or writing another application's files, performing
+network access, keeping the device awake, etc.</p>
+
+<p>Because Android sandboxes applications from each other, applications
+must explicitly share resources and data. They do this by declaring the
+<em>permissions</em> they need for additional capabilities not provided by
+the basic sandbox. Applications statically declare the permissions they
+require, and the Android system prompts the user for consent at the time the
+application is installed. Android has no mechanism for granting permissions
+dynamically (at run-time) because it complicates the user experience to the
+detriment of security.</p>
+
+<p>The application sandbox does not depend on the technology used to build
+an application. In particular the Dalvik VM is not a security boundary, and
+any app can run native code (see <a href="/sdk/ndk/index.html">the Android
+NDK</a>). All types of applications — Java, native, and hybrid —
+are sandboxed in the same way and have the same degree of security from each
+other.</p>
+
+<a name="signing"></a>
+<h2>Application Signing</h2>
+
+<p>All Android applications (.apk files) must be signed with a certificate
+whose private key is held by their developer. This certificate identifies
+the author of the application. The certificate does <em>not</em> need to be
+signed by a certificate authority: it is perfectly allowable, and typical,
+for Android applications to use self-signed certificates. The purpose of
+certificates in Android is to distinguish application authors. This allows
+the system to grant or deny applications access to <a
+href="/guide/topics/manifest/permission-element.html#plevel">signature-level
+permissions</a> and to grant or deny an application's <a
+href="/guide/topics/manifest/manifest-element.html#uid">request to be given
+the same Linux identity</a> as another application.</p>
+
+<a name="userid"></a>
+<h2>User IDs and File Access</h2>
+
+<p>At install time, Android gives each package a distinct Linux user ID. The
+identity remains constant for the duration of the package's life on that
+device. On a different device, the same package may have a different UID;
+what matters is that each package has a distinct UID on a given device.</p>
+
+<p>Because security enforcement happens at the
+process level, the code of any two packages can not normally
+run in the same process, since they need to run as different Linux users.
+You can use the {@link android.R.attr#sharedUserId} attribute in the
+<code>AndroidManifest.xml</code>'s
+{@link android.R.styleable#AndroidManifest manifest} tag of each package to
+have them assigned the same user ID. By doing this, for purposes of security
+the two packages are then treated as being the same application, with the same
+user ID and file permissions. Note that in order to retain security, only two applications
+signed with the same signature (and requesting the same sharedUserId) will
+be given the same user ID.</p>
+
+<p>Any data stored by an application will be assigned that application's user
+ID, and not normally accessible to other packages. When creating a new file
+with {@link android.content.Context#getSharedPreferences},
+{@link android.content.Context#openFileOutput}, or
+{@link android.content.Context#openOrCreateDatabase},
+you can use the
+{@link android.content.Context#MODE_WORLD_READABLE} and/or
+{@link android.content.Context#MODE_WORLD_WRITEABLE} flags to allow any other
+package to read/write the file. When setting these flags, the file is still
+owned by your application, but its global read and/or write permissions have
+been set appropriately so any other application can see it.</p>
+
+
+<a name="permissions"></a>
+<h2>Using Permissions</h2>
+
+<p>A basic Android application has no permissions associated with it,
+meaning it can not do anything that would adversely impact the user experience
+or any data on the device. To make use of protected features of the device,
+you must include in your <code>AndroidManifest.xml</code> one or more
+<code>{@link android.R.styleable#AndroidManifestUsesPermission <uses-permission>}</code>
+tags declaring the permissions that your application needs.</p>
+
+<p>For example, an application that needs to monitor incoming SMS messages would
+specify:</p>
+
+<pre><manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.app.myapp" >
+ <uses-permission android:name="android.permission.RECEIVE_SMS" />
+ ...
+</manifest></pre>
+
+<p>At application install time, permissions requested by the application are
+granted to it by the package installer, based on checks against the
+signatures of the applications declaring those permissions and/or interaction
+with the user. <em>No</em> checks with the user
+are done while an application is running: it either was granted a particular
+permission when installed, and can use that feature as desired, or the
+permission was not granted and any attempt to use the feature will fail
+without prompting the user.</p>
+
+<p>Often times a permission failure will result in a {@link
+java.lang.SecurityException} being thrown back to the application. However,
+this is not guaranteed to occur everywhere. For example, the {@link
+android.content.Context#sendBroadcast} method checks permissions as data is
+being delivered to each receiver, after the method call has returned, so you
+will not receive an exception if there are permission failures. In almost all
+cases, however, a permission failure will be printed to the system log.</p>
+
+<p>The permissions provided by the Android system can be found at {@link
+android.Manifest.permission}. Any application may also define and enforce its
+own permissions, so this is not a comprehensive list of all possible
+permissions.</p>
+
+<p>A particular permission may be enforced at a number of places during your
+program's operation:</p>
+
+<ul>
+<li>At the time of a call into the system, to prevent an application from
+executing certain functions.</li>
+<li>When starting an activity, to prevent applications from launching
+activities of other applications.</li>
+<li>Both sending and receiving broadcasts, to control who can receive
+your broadcast or who can send a broadcast to you.</li>
+<li>When accessing and operating on a content provider.</li>
+<li>Binding to or starting a service.</li>
+</ul>
+
+
+<a name="declaring"></a>
+<h2>Declaring and Enforcing Permissions</h2>
+
+<p>To enforce your own permissions, you must first declare them in your
+<code>AndroidManifest.xml</code> using one or more
+<code>{@link android.R.styleable#AndroidManifestPermission <permission>}</code>
+tags.</p>
+
+<p>For example, an application that wants to control who can start one
+of its activities could declare a permission for this operation as follows:</p>
+
+<pre><manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.me.app.myapp" >
+ <permission android:name="com.me.app.myapp.permission.DEADLY_ACTIVITY"
+ android:label="@string/permlab_deadlyActivity"
+ android:description="@string/permdesc_deadlyActivity"
+ android:permissionGroup="android.permission-group.COST_MONEY"
+ android:protectionLevel="dangerous" />
+ ...
+</manifest></pre>
+
+<p>The {@link android.R.styleable#AndroidManifestPermission_protectionLevel
+<protectionLevel>} attribute is required, telling the system how the
+user is to be informed of applications requiring the permission, or who is
+allowed to hold that permission, as described in the linked documentation.</p>
+
+<p>The {@link android.R.styleable#AndroidManifestPermission_permissionGroup
+<permissionGroup>} attribute is optional, and only used to help the system display
+permissions to the user. You will usually want to set this to either a standard
+system group (listed in {@link android.Manifest.permission_group
+android.Manifest.permission_group}) or in more rare cases to one defined by
+yourself. It is preferred to use an existing group, as this simplifies the
+permission UI shown to the user.</p>
+
+<p>Note that both a label and description should be supplied for the
+permission. These are string resources that can be displayed to the user when
+they are viewing a list of permissions
+(<code>{@link android.R.styleable#AndroidManifestPermission_label android:label}</code>)
+or details on a single permission (
+<code>{@link android.R.styleable#AndroidManifestPermission_description android:description}</code>).
+The label should be short, a few words
+describing the key piece of functionality the permission is protecting. The
+description should be a couple sentences describing what the permission allows
+a holder to do. Our convention for the description is two sentences, the first
+describing the permission, the second warning the user of what bad things
+can happen if an application is granted the permission.</p>
+
+<p>Here is an example of a label and description for the CALL_PHONE
+permission:</p>
+
+<pre>
+ <string name="permlab_callPhone">directly call phone numbers</string>
+ <string name="permdesc_callPhone">Allows the application to call
+ phone numbers without your intervention. Malicious applications may
+ cause unexpected calls on your phone bill. Note that this does not
+ allow the application to call emergency numbers.</string>
+</pre>
+
+<p>You can look at the permissions currently defined in the system with the
+Settings app and the shell command <code>adb shell pm list permissions</code>.
+To use the Settings app, go to Settings > Applications. Pick an app and
+scroll down to see the permissions that the app uses. For developers, the adb '-s'
+option displays the permissions in a form similar to how the user will see them:</p>
+
+<pre>
+$ adb shell pm list permissions -s
+All Permissions:
+
+Network communication: view Wi-Fi state, create Bluetooth connections, full
+Internet access, view network state
+
+Your location: access extra location provider commands, fine (GPS) location,
+mock location sources for testing, coarse (network-based) location
+
+Services that cost you money: send SMS messages, directly call phone numbers
+
+...</pre>
+
+<a name="manifest"></a>
+<h3>Enforcing Permissions in AndroidManifest.xml</h3>
+
+<p>High-level permissions restricting access to entire components of the
+system or application can be applied through your
+<code>AndroidManifest.xml</code>. All that this requires is including an {@link
+android.R.attr#permission android:permission} attribute on the desired
+component, naming the permission that will be used to control access to
+it.</p>
+
+<p><strong>{@link android.app.Activity}</strong> permissions
+(applied to the
+{@link android.R.styleable#AndroidManifestActivity <activity>} tag)
+restrict who can start the associated
+activity. The permission is checked during
+{@link android.content.Context#startActivity Context.startActivity()} and
+{@link android.app.Activity#startActivityForResult Activity.startActivityForResult()};
+if the caller does not have
+the required permission then {@link java.lang.SecurityException} is thrown
+from the call.</p>
+
+<p><strong>{@link android.app.Service}</strong> permissions
+(applied to the
+{@link android.R.styleable#AndroidManifestService <service>} tag)
+restrict who can start or bind to the
+associated service. The permission is checked during
+{@link android.content.Context#startService Context.startService()},
+{@link android.content.Context#stopService Context.stopService()} and
+{@link android.content.Context#bindService Context.bindService()};
+if the caller does not have
+the required permission then {@link java.lang.SecurityException} is thrown
+from the call.</p>
+
+<p><strong>{@link android.content.BroadcastReceiver}</strong> permissions
+(applied to the
+{@link android.R.styleable#AndroidManifestReceiver <receiver>} tag)
+restrict who can send broadcasts to the associated receiver.
+The permission is checked <em>after</em>
+{@link android.content.Context#sendBroadcast Context.sendBroadcast()} returns,
+as the system tries
+to deliver the submitted broadcast to the given receiver. As a result, a
+permission failure will not result in an exception being thrown back to the
+caller; it will just not deliver the intent. In the same way, a permission
+can be supplied to
+{@link android.content.Context#registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, String, android.os.Handler)
+Context.registerReceiver()}
+to control who can broadcast to a programmatically registered receiver.
+Going the other way, a permission can be supplied when calling
+{@link android.content.Context#sendBroadcast(Intent, String) Context.sendBroadcast()}
+to restrict which BroadcastReceiver objects are allowed to receive the broadcast (see
+below).</p>
+
+<p><strong>{@link android.content.ContentProvider}</strong> permissions
+(applied to the
+{@link android.R.styleable#AndroidManifestProvider <provider>} tag)
+restrict who can access the data in
+a {@link android.content.ContentProvider}. (Content providers have an important
+additional security facility available to them called
+<a href="#uri">URI permissions</a> which is described later.)
+Unlike the other components,
+there are two separate permission attributes you can set:
+{@link android.R.attr#readPermission android:readPermission} restricts who
+can read from the provider, and
+{@link android.R.attr#writePermission android:writePermission} restricts
+who can write to it. Note that if a provider is protected with both a read
+and write permission, holding only the write permission does not mean
+you can read from a provider. The permissions are checked when you first
+retrieve a provider (if you don't have either permission, a SecurityException
+will be thrown), and as you perform operations on the provider. Using
+{@link android.content.ContentResolver#query ContentResolver.query()} requires
+holding the read permission; using
+{@link android.content.ContentResolver#insert ContentResolver.insert()},
+{@link android.content.ContentResolver#update ContentResolver.update()},
+{@link android.content.ContentResolver#delete ContentResolver.delete()}
+requires the write permission.
+In all of these cases, not holding the required permission results in a
+{@link java.lang.SecurityException} being thrown from the call.</p>
+
+
+<a name="broadcasts"></a>
+<h3>Enforcing Permissions when Sending Broadcasts</h3>
+
+<p>In addition to the permission enforcing who can send Intents to a
+registered {@link android.content.BroadcastReceiver} (as described above), you
+can also specify a required permission when sending a broadcast. By calling {@link
+android.content.Context#sendBroadcast(android.content.Intent,String)
+Context.sendBroadcast()} with a
+permission string, you require that a receiver's application must hold that
+permission in order to receive your broadcast.</p>
+
+<p>Note that both a receiver and a broadcaster can require a permission. When
+this happens, both permission checks must pass for the Intent to be delivered
+to the associated target.</p>
+
+
+<a name="enforcement"></a>
+<h3>Other Permission Enforcement</h3>
+
+<p>Arbitrarily fine-grained permissions can be enforced at any call into a
+service. This is accomplished with the {@link
+android.content.Context#checkCallingPermission Context.checkCallingPermission()}
+method. Call with a desired
+permission string and it will return an integer indicating whether that
+permission has been granted to the current calling process. Note that this can
+only be used when you are executing a call coming in from another process,
+usually through an IDL interface published from a service or in some other way
+given to another process.</p>
+
+<p>There are a number of other useful ways to check permissions. If you have
+the pid of another process, you can use the Context method {@link
+android.content.Context#checkPermission(String, int, int) Context.checkPermission(String, int, int)}
+to check a permission against that pid. If you have the package name of another
+application, you can use the direct PackageManager method {@link
+android.content.pm.PackageManager#checkPermission(String, String)
+PackageManager.checkPermission(String, String)}
+to find out whether that particular package has been granted a specific permission.</p>
+
+
+<a name="uri"></a>
+<h2>URI Permissions</h2>
+
+<p>The standard permission system described so far is often not sufficient
+when used with content providers. A content provider may want to
+protect itself with read and write permissions, while its direct clients
+also need to hand specific URIs to other applications for them to operate on.
+A typical example is attachments in a mail application. Access to the mail
+should be protected by permissions, since this is sensitive user data. However,
+if a URI to an image attachment is given to an image viewer, that image viewer
+will not have permission to open the attachment since it has no reason to hold
+a permission to access all e-mail.</p>
+
+<p>The solution to this problem is per-URI permissions: when starting an
+activity or returning a result to an activity, the caller can set
+{@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION
+Intent.FLAG_GRANT_READ_URI_PERMISSION} and/or
+{@link android.content.Intent#FLAG_GRANT_WRITE_URI_PERMISSION
+Intent.FLAG_GRANT_WRITE_URI_PERMISSION}. This grants the receiving activity
+permission access the specific data URI in the Intent, regardless of whether
+it has any permission to access data in the content provider corresponding
+to the Intent.</p>
+
+<p>This mechanism allows a common capability-style model where user interaction
+(opening an attachment, selecting a contact from a list, etc) drives ad-hoc
+granting of fine-grained permission. This can be a key facility for reducing
+the permissions needed by applications to only those directly related to their
+behavior.</p>
+
+<p>The granting of fine-grained URI permissions does, however, require some
+cooperation with the content provider holding those URIs. It is strongly
+recommended that content providers implement this facility, and declare that
+they support it through the
+{@link android.R.styleable#AndroidManifestProvider_grantUriPermissions
+android:grantUriPermissions} attribute or
+{@link android.R.styleable#AndroidManifestGrantUriPermission
+<grant-uri-permissions>} tag.</p>
+
+<p>More information can be found in the
+{@link android.content.Context#grantUriPermission Context.grantUriPermission()},
+{@link android.content.Context#revokeUriPermission Context.revokeUriPermission()}, and
+{@link android.content.Context#checkUriPermission Context.checkUriPermission()}
+methods.</p>
+
diff --git a/docs/html/guide/topics/security/security.jd b/docs/html/guide/topics/security/security.jd
index 1fd9ba0..eeaac44 100644
--- a/docs/html/guide/topics/security/security.jd
+++ b/docs/html/guide/topics/security/security.jd
@@ -1,407 +1,770 @@
-page.title=Security and Permissions
+page.title=Designing for Security
@jd:body
<div id="qv-wrapper">
<div id="qv">
-
<h2>In this document</h2>
<ol>
-<li><a href="#arch">Security Architecture</a></li>
-<li><a href="#signing">Application Signing</a></li>
-<li><a href="#userid">User IDs and File Access</a></li>
-<li><a href="#permissions">Using Permissions</a></li>
-<li><a href="#declaring">Declaring and Enforcing Permissions</a>
- <ol>
- <li><a href="#manifest">...in AndroidManifest.xml</a></li>
- <li><a href="#broadcasts">...when Sending Broadcasts</a></li>
- <li><a href="#enforcement">Other Permission Enforcement</a></li>
- </ol></li>
-<li><a href="#uri">URI Permissions</a></li>
+<li><a href="#Dalvik">Using Davlik Code</a></li>
+<li><a href="#Native">Using Native Code</a></li>
+<li><a href="#Data">Storing Data</a></li>
+<li><a href="#IPC">Using IPC</a></li>
+<li><a href="#Permissions">Using Permissions</a></li>
+<li><a href="#Networking">Using Networking</a></li>
+<li><a href="#DynamicCode">Dynamically Loading Code</a></li>
+<li><a href="#Input">Performing Input Validation</a></li>
+<li><a href="#UserData">Handling User Data</a></li>
+<li><a href="#Crypto">Using Cryptography</a></li>
</ol>
-</div>
-</div>
-<p>This document describes how application developers can use the
-security features provided by Android. A more general <a
-href="http://source.android.com/tech/security/index.html"> Android Security
-Overview</a> is provided in the Android Open Source Project.</p>
+<h2>See also</h2>
+<ol>
+<li><a href="http://source.android.com/tech/security/index.html">Android
+Security Overview</a></li>
+<li><a href="{@docRoot}guide/topics/security/security.html">Android Security
+And Permissions</a></li>
+</ol>
+</div></div>
+<p>Android was designed so that most developers will be able to build
+applications using the default settings and not be confronted with difficult
+decisions about security. Android also has a number of security features built
+into the operating system that significantly reduce the frequency and impact of
+application security issues.</p>
-<p>Android is a privilege-separated operating system, in which each
-application runs with a distinct system identity (Linux user ID and group
-ID). Parts of the system are also separated into distinct identities.
-Linux thereby isolates applications from each other and from the system.</p>
+<p>Some of the security features that help developers build secure applications
+include:
+<ul>
+<li>The Android Application Sandbox that isolates data and code execution on a
+per-application basis.</li>
+<li>Android application framework with robust implementations of common
+security functionality such as cryptography, permissions, and secure IPC.</li>
+<li>Technologies like ASLR, NX, ProPolice, safe_iop, OpenBSD dlmalloc, OpenBSD
+calloc, and Linux mmap_min_addr to mitigate risks associated with common memory
+management errors</li>
+<li>An encrypted filesystem that can be enabled to protect data on lost or
+stolen devices.</li>
+</ul></p>
-<p>Additional finer-grained security features are provided through a
-"permission" mechanism that enforces restrictions on the specific operations
-that a particular process can perform, and per-URI permissions for granting
-ad-hoc access to specific pieces of data.</p>
+<p>Nevertheless, it is important for developers to be familiar with Android
+security best practices to make sure they take advantage of these capabilities
+and to reduce the likelihood of inadvertently introducing security issues that
+can affect their applications.</p>
-<a name="arch"></a>
-<h2>Security Architecture</h2>
+<p>This document is organized around common APIs and development techniques
+that can have security implications for your application and its users. As
+these best practices are constantly evolving, we recommend you check back
+occasionally throughout your application development process.</p>
-<p>A central design point of the Android security architecture is that no
-application, by default, has permission to perform any operations that would
-adversely impact other applications, the operating system, or the user. This
-includes reading or writing the user's private data (such as contacts or
-e-mails), reading or writing another application's files, performing
-network access, keeping the device awake, etc.</p>
+<a name="Dalvik"></a>
+<h2>Using Dalvik Code</h2>
+<p>Writing secure code that runs in virtual machines is a well-studied topic
+and many of the issues are not specific to Android. Rather than attempting to
+rehash these topics, we’d recommend that you familiarize yourself with the
+existing literature. Two of the more popular resources are:
+<ul>
+<li><a href="http://www.securingjava.com/toc.html">
+http://www.securingjava.com/toc.html</a></li>
+<li><a
+href="https://www.owasp.org/index.php/Java_Security_Resources">
+https://www.owasp.org/index.php/Java_Security_Resources</a></li>
+</ul></p>
-<p>Because Android sandboxes applications from each other, applications
-must explicitly share resources and data. They do this by declaring the
-<em>permissions</em> they need for additional capabilities not provided by
-the basic sandbox. Applications statically declare the permissions they
-require, and the Android system prompts the user for consent at the time the
-application is installed. Android has no mechanism for granting permissions
-dynamically (at run-time) because it complicates the user experience to the
-detriment of security.</p>
+<p>This document is focused on the areas which are Android specific and/or
+different from other environments. For developers experienced with VM
+programming in other environments, there are two broad issues that may be
+different about writing apps for Android:
+<ul>
+<li>Some virtual machines, such as the JVM or .net runtime, act as a security
+boundary, isolating code from the underlying operating system capabilities. On
+Android, the Dalvik VM is not a security boundary -- the application sandbox is
+implemented at the OS level, so Dalvik can interoperate with native code in the
+same application without any security constraints.</li>
+<li>Given the limited storage on mobile devices, it’s common for developers
+to want to build modular applications and use dynamic class loading. When
+doing this consider both the source where you retrieve your application logic
+and where you store it locally. Do not use dynamic class loading from sources
+that are not verified, such as unsecured network sources or external storage,
+since that code can be modified to include malicious behavior.</li>
+</ul></p>
-<p>The application sandbox does not depend on the technology used to build
-an application. In particular the Dalvik VM is not a security boundary, and
-any app can run native code (see <a href="/sdk/ndk/index.html">the Android
-NDK</a>). All types of applications — Java, native, and hybrid —
-are sandboxed in the same way and have the same degree of security from each
-other.</p>
+<a name="Native"></a>
+<h2>Using Native Code</h2>
-<a name="signing"></a>
-<h2>Application Signing</h2>
+<p>In general, we encourage developers to use the Android SDK for most
+application development, rather than using native code. Applications built
+with native code are more complex, less portable, and more like to include
+common memory corruption errors such as buffer overflows.</p>
-<p>All Android applications (.apk files) must be signed with a certificate
-whose private key is held by their developer. This certificate identifies
-the author of the application. The certificate does <em>not</em> need to be
-signed by a certificate authority: it is perfectly allowable, and typical,
-for Android applications to use self-signed certificates. The purpose of
-certificates in Android is to distinguish application authors. This allows
-the system to grant or deny applications access to <a
-href="/guide/topics/manifest/permission-element.html#plevel">signature-level
-permissions</a> and to grant or deny an application's <a
-href="/guide/topics/manifest/manifest-element.html#uid">request to be given
-the same Linux identity</a> as another application.</p>
+<p>Android is built using the Linux kernel and being familiar with Linux
+development security best practices is especially useful if you are going to
+use native code. This document is too short to discuss all of those best
+practices, but one of the most popular resources is “Secure Programming for
+Linux and Unix HOWTO”, available at <a
+href="http://www.dwheeler.com/secure-programs">
+http://www.dwheeler.com/secure-programs</a>.</p>
-<a name="userid"></a>
-<h2>User IDs and File Access</h2>
+<p>An important difference between Android and most Linux environments is the
+Application Sandbox. On Android, all applications run in the Application
+Sandbox, including those written with native code. At the most basic level, a
+good way to think about it for developers familiar with Linux is to know that
+every application is given a unique UID with very limited permissions. This is
+discussed in more detail in the <a
+href="http://source.android.com/tech/security/index.html">Android Security
+Overview</a> and you should be familiar with application permissions even if
+you are using native code.</p>
-<p>At install time, Android gives each package a distinct Linux user ID. The
-identity remains constant for the duration of the package's life on that
-device. On a different device, the same package may have a different UID;
-what matters is that each package has a distinct UID on a given device.</p>
+<a name="Data"></a>
+<h2>Storing Data</h2>
-<p>Because security enforcement happens at the
-process level, the code of any two packages can not normally
-run in the same process, since they need to run as different Linux users.
-You can use the {@link android.R.attr#sharedUserId} attribute in the
-<code>AndroidManifest.xml</code>'s
-{@link android.R.styleable#AndroidManifest manifest} tag of each package to
-have them assigned the same user ID. By doing this, for purposes of security
-the two packages are then treated as being the same application, with the same
-user ID and file permissions. Note that in order to retain security, only two applications
-signed with the same signature (and requesting the same sharedUserId) will
-be given the same user ID.</p>
+<h3>Using internal files</h3>
-<p>Any data stored by an application will be assigned that application's user
-ID, and not normally accessible to other packages. When creating a new file
-with {@link android.content.Context#getSharedPreferences},
-{@link android.content.Context#openFileOutput}, or
-{@link android.content.Context#openOrCreateDatabase},
-you can use the
-{@link android.content.Context#MODE_WORLD_READABLE} and/or
-{@link android.content.Context#MODE_WORLD_WRITEABLE} flags to allow any other
-package to read/write the file. When setting these flags, the file is still
-owned by your application, but its global read and/or write permissions have
-been set appropriately so any other application can see it.</p>
+<p>By default, files created on <a
+href="{@docRoot}guide/topics/data/data-storage.html#filesInternal">internal
+storage</a> are only accessible to the application that created the file. This
+protection is implemented by Android and is sufficient for most
+applications.</p>
+<p>Use of <a
+href="{@docRoot}reference/android/content/Context.html#MODE_WORLD_WRITEABLE">
+world writable</a> or <a
+href="{@docRoot}reference/android/content/Context.html#MODE_WORLD_READABLE">world
+readable</a> files for IPC is discouraged because it does not provide
+the ability to limit data access to particular applications, nor does it
+provide any control on data format. As an alternative, you might consider using
+a ContentProvider which provides read and write permissions, and can make
+dynamic permission grants on a case-by-case basis.</p>
-<a name="permissions"></a>
-<h2>Using Permissions</h2>
+<p>To provide additional protection for sensitive data, some applications
+choose to encrypt local files using a key that is not accessible to the
+application. (For example, a key can be placed in a <code><a
+href={@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> and
+protected with a user password that is not stored on the device). While this
+does not protect data from a root compromise that can monitor the user
+inputting the password, it can provide protection for a lost device without <a
+href="http://source.android.com/tech/encryption/index.html">file system
+encryption</a>.</p>
-<p>A basic Android application has no permissions associated with it,
-meaning it can not do anything that would adversely impact the user experience
-or any data on the device. To make use of protected features of the device,
-you must include in your <code>AndroidManifest.xml</code> one or more
-<code>{@link android.R.styleable#AndroidManifestUsesPermission <uses-permission>}</code>
-tags declaring the permissions that your application needs.</p>
+<h3>Using external storage</h3>
-<p>For example, an application that needs to monitor incoming SMS messages would
-specify:</p>
+<p>Files created on <a
+href="{@docRoot}guide/topics/data/data-storage.html#filesExternal">external
+storage</a>, such as SD Cards, are globally readable and writable. Since
+external storage can be removed by the user and also modified by any
+application, applications should not store sensitive information using
+external storage.</p>
-<pre><manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.app.myapp" >
- <uses-permission android:name="android.permission.RECEIVE_SMS" />
- ...
-</manifest></pre>
+<p>As with data from any untrusted source, applications should perform input
+validation when handling data from external storage (see Input Validation
+section). We strongly recommend that applications not store executables or
+class files on external storage prior to dynamic loading. If an application
+does retrieve executable files from external storage they should be signed and
+cryptographically verified prior to dynamic loading.</p>
-<p>At application install time, permissions requested by the application are
-granted to it by the package installer, based on checks against the
-signatures of the applications declaring those permissions and/or interaction
-with the user. <em>No</em> checks with the user
-are done while an application is running: it either was granted a particular
-permission when installed, and can use that feature as desired, or the
-permission was not granted and any attempt to use the feature will fail
-without prompting the user.</p>
+<h3>Using content providers</h3>
-<p>Often times a permission failure will result in a {@link
-java.lang.SecurityException} being thrown back to the application. However,
-this is not guaranteed to occur everywhere. For example, the {@link
-android.content.Context#sendBroadcast} method checks permissions as data is
-being delivered to each receiver, after the method call has returned, so you
-will not receive an exception if there are permission failures. In almost all
-cases, however, a permission failure will be printed to the system log.</p>
+<p>ContentProviders provide a structured storage mechanism that can be limited
+to your own application, or exported to allow access by other applications. By
+default, a <code>
+<a href="{@docRoot}reference/android/content/ContentProvider.html">
+ContentProvider</a></code> is
+<a href="{@docRoot}guide/topics/manifest/provider-element.html#exported">exported
+</a> for use by other applications. If you do not intend to provide other
+applications with access to your<code>
+<a href="{@docRoot}reference/android/content/ContentProvider.html">
+ContentProvider</a></code>, mark them as <code><a
+href="{@docRoot}guide/topics/manifest/provider-element.html#exported">
+android:exported=false</a></code> in the application manifest.</p>
-<p>The permissions provided by the Android system can be found at {@link
-android.Manifest.permission}. Any application may also define and enforce its
-own permissions, so this is not a comprehensive list of all possible
+<p>When creating a <code>
+<a href="{@docRoot}reference/android/content/ContentProvider.html">ContentProvider
+</a></code> that will be exported for use by other applications, you can specify
+a single
+<a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">permission
+</a> for reading and writing, or distinct permissions for reading and writing
+within the manifest. We recommend that you limit your permissions to those
+required to accomplish the task at hand. Keep in mind that it’s usually
+easier to add permissions later to expose new functionality than it is to take
+them away and break existing users.</p>
+
+<p>If you are using a <code>
+<a href="{@docRoot}reference/android/content/ContentProvider.html">
+ContentProvider</a></code> for sharing data between applications built by the
+same developer, it is preferable to use
+<a href="{@docRoot}guide/topics/manifest/permission-element.html#plevel">signature
+level permissions</a>. Signature permissions do not require user confirmation,
+so they provide a better user experience and more controlled access to the
+<code>
+<a href="{@docRoot}reference/android/content/ContentProvider.html">
+ContentProvider</a></code>.</p>
+
+<p>ContentProviders can also provide more granular access by declaring the <a
+href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">
+grantUriPermissions</a> element and using the <code><a
+href="{@docRoot}reference/android/content/Intent.html#FLAG_GRANT_READ_URI_PERMISSION">FLAG_GRANT_READ_URI_PERMISSION</a></code>
+and <code><a
+href="{@docRoot}reference/android/content/Intent.html#FLAG_GRANT_WRITE_URI_PERMISSION">FLAG_GRANT_WRITE_URI_PERMISSION</a></code>
+flags in the Intent object
+that activates the component. The scope of these permissions can be further
+limited by the <code><a
+href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html">
+grant-uri-permission element</a></code>.</p>
+
+<p>When accessing a <code>
+<a href="{@docRoot}reference/android/content/ContentProvider.html">
+ContentProvider</a></code>, use parameterized query methods such as <code>
+<a href="{@docRoot}reference/android/content/ContentProvider.html#query(android.net.Uri,%20java.lang.String[],%20java.lang.String,%20java.lang.String[],%20java.lang.String)">query()</a></code>, <code><a
+href="{@docRoot}reference/android/content/ContentProvider.html#update(android.net.Uri,%20android.content.ContentValues,%20java.lang.String,%20java.lang.String[])">update()</a></code>, and <code><a
+href="{@docRoot}reference/android/content/ContentProvider.html#delete(android.net.Uri,%20java.lang.String,%20java.lang.String[])">delete()</a></code> to avoid
+potential <a href="http://en.wikipedia.org/wiki/SQL_injection">SQL
+Injection</a> from untrusted data. Note that using parameterized methods is not
+sufficient if the <code>selection</code> is built by concatenating user data
+prior to submitting it to the method.</p>
+
+<p>Do not have a false sense of security about the write permission. Consider
+that the write permission allows SQL statements which make it possible for some
+data to be confirmed using creative <code>WHERE</code> clauses and parsing the
+results. For example, an attacker might probe for presence of a specific phone
+number in a call-log by modifying a row only if that phone number already
+exists. If the content provider data has predictable structure, the write
+permission may be equivalent to providing both reading and writing.</p>
+
+<a name="IPC"></a>
+<h2>Using Interprocess Communication (IPC)</h2>
+
+<p>Some Android applications attempt to implement IPC using traditional Linux
+techniques such as network sockets and shared files. We strongly encourage the
+use of Android system functionality for IPC such as Intents, Binders, Services,
+and Receivers. The Android IPC mechanisms allow you to verify the identity of
+the application connecting to your IPC and set security policy for each IPC
+mechanism.</p>
+
+<p>Many of the security elements are shared across IPC mechanisms. <a
+href="{@docRoot}reference/android/content/BroadcastReceiver.html">
+Broadcast Receivers</a>, <a
+href="{@docRoot}reference/android/R.styleable.html#AndroidManifestActivity">
+Activities</a>, and <a
+href="{@docRoot}reference/android/R.styleable.html#AndroidManifestService">
+Services</a> are all declared in the application manifest. If your IPC mechanism is
+not intended for use by other applications, set the <a
+href="{@docRoot}guide/topics/manifest/service-element.html#exported">{@code android:exported}</a>
+property to false. This is useful for applications that consist of multiple processes
+within the same UID, or if you decide late in development that you do not
+actually want to expose functionality as IPC but you don’t want to rewrite
+the code.</p>
+
+<p>If your IPC is intended to be accessible to other applications, you can
+apply a security policy by using the <a
+href="{@docRoot}reference/android/R.styleable.html#AndroidManifestPermission">
+Permission</a> tag. If IPC is between applications built by the same developer,
+it is preferable to use <a
+href="{@docRoot}guide/topics/manifest/permission-element.html#plevel">signature
+level permissions</a>. Signature permissions do not require user confirmation,
+so they provide a better user experience and more controlled access to the IPC
+mechanism.</p>
+
+<p>One area that can introduce confusion is the use of intent filters. Note
+that Intent filters should not be considered a security feature -- components
+can be invoked directly and may not have data that would conform to the intent
+filter. You should perform input validation within your intent receiver to
+confirm that it is properly formatted for the invoked receiver, service, or
+activity.</p>
+
+<h3>Using intents</h3>
+
+<p>Intents are the preferred mechanism for asynchronous IPC in Android.
+Depending on your application requirements, you might use <code><a
+href="{@docRoot}reference/android/content/Context.html#sendBroadcast(android.content.Intent)">sendBroadcast()</a></code>,
+<code><a
+href="{@docRoot}reference/android/content/Context.html#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)">sendOrderedBroadcast()</a></code>,
+or direct an intent to a specific application component.</p>
+
+<p>Note that ordered broadcasts can be “consumed” by a recipient, so they
+may not be delivered to all applications. If you are sending an Intent where
+delivery to a specific receiver is required, the intent must be delivered
+directly to the receiver.</p>
+
+<p>Senders of an intent can verify that the recipient has a permission
+specifying a non-Null Permission upon sending. Only applications with that
+Permission will receive the intent. If data within a broadcast intent may be
+sensitive, you should consider applying a permission to make sure that
+malicious applications cannot register to receive those messages without
+appropriate permissions. In those circumstances, you may also consider
+invoking the receiver directly, rather than raising a broadcast.</p>
+
+<h3>Using binder and AIDL interfaces</h3>
+
+<p><a href="{@docRoot}reference/android/os/Binder.html">Binders</a> are the
+preferred mechanism for RPC-style IPC in Android. They provide a well-defined
+interface that enables mutual authentication of the endpoints, if required.</p>
+
+<p>We strongly encourage designing interfaces in a manner that does not require
+interface specific permission checks. Binders are not declared within the
+application manifest, and therefore you cannot apply declarative permissions
+directly to a Binder. Binders generally inherit permissions declared in the
+application manifest for the Service or Activity within which they are
+implemented. If you are creating an interface that requires authentication
+and/or access controls on a specific binder interface, those controls must be
+explicitly added as code in the interface.</p>
+
+<p>If providing an interface that does require access controls, use <code><a
+href="{@docRoot}reference/android/content/Context.html#checkCallingPermission(java.lang.String)">checkCallingPermission()</a></code>
+to verify whether the
+caller of the Binder has a required permission. This is especially important
+before accessing a Service on behalf of the caller, as the identify of your
+application is passed to other interfaces. If invoking an interface provided
+by a Service, the <code><a
+href="{@docRoot}reference/android/content/Context.html#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)">bindService()</a></code>
+ invocation may fail if you do not have permission to access the given Service.
+ If calling an interface provided locally by your own application, it may be
+useful to use the <code><a
+href="{@docRoot}reference/android/os/Binder.html#clearCallingIdentity()">
+clearCallingIdentity()</a></code> to satisfy internal security checks.</p>
+
+<h3>Using broadcast receivers</h3>
+
+<p>Broadcast receivers are used to handle asynchronous requests initiated via
+an intent.</p>
+
+<p>By default, receivers are exported and can be invoked by any other
+application. If your <code><a
+href="{@docRoot}reference/android/content/BroadcastReceiver.html">
+BroadcastReceivers</a></code> is intended for use by other applications, you
+may want to apply security permissions to receivers using the <code><a
+href="{@docRoot}guide/topics/manifest/receiver-element.html">
+<receiver></a></code> element within the application manifest. This will
+prevent applications without appropriate permissions from sending an intent to
+the <code><a
+href="{@docRoot}reference/android/content/BroadcastReceiver.html">
+BroadcastReceivers</a></code>.</p>
+
+<h3>Using Services</h3>
+
+<p>Services are often used to supply functionality for other applications to
+use. Each service class must have a corresponding <service> declaration in its
+package's AndroidManifest.xml.</p>
+
+<p>By default, Services are exported and can be invoked by any other
+application. Services can be protected using the <a
+href="{@docRoot}guide/topics/manifest/service-element.html#prmsn">{@code android:permission}</a>
+attribute
+within the manifest’s <code><a
+href="{@docRoot}guide/topics/manifest/service-element.html">
+<service></a></code> tag. By doing so, other applications will need to declare
+a corresponding <code><a
+href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a>
+</code> element in their own manifest to be
+able to start, stop, or bind to the service.</p>
+
+<p>A Service can protect individual IPC calls into it with permissions, by
+calling <code><a
+href="{@docRoot}reference/android/content/Context.html#checkCallingPermission(java.lang.String)">checkCallingPermission()</a></code>
+before executing
+the implementation of that call. We generally recommend using the
+declarative permissions in the manifest, since those are less prone to
+oversight.</p>
+
+<h3>Using Activities</h3>
+
+<p>Activities are most often used for providing the core user-facing
+functionality of an application. By default, Activities are exported and
+invokable by other applications only if they have an intent filter or binder
+declared. In general, we recommend that you specifically declare a Receiver or
+Service to handle IPC, since this modular approach reduces the risk of exposing
+functionality that is not intended for use by other applications.</p>
+
+<p>If you do expose an Activity for purposes of IPC, the <code><a
+href="{@docRoot}guide/topics/manifest/activity-element.html#prmsn">android:permission</a></code>
+attribute in the <code><a
+href="{@docRoot}guide/topics/manifest/activity-element.html">
+<activity></a></code> declaration in the application manifest can be used to
+restrict access to only those applications which have the stated
permissions.</p>
-<p>A particular permission may be enforced at a number of places during your
-program's operation:</p>
+<a name="Permissions"></a>
+<h2>Using Permissions</h2>
+<h3>Requesting Permissions</h3>
+
+<p>We recommend minimizing the number of permissions requested by an
+application. Not having access to sensitive permissions reduces the risk of
+inadvertently misusing those permissions, can improve user adoption, and makes
+applications less attractive targets for attackers.</p>
+
+<p>If it is possible to design your application in a way that does not require
+a permission, that is preferable. For example, rather than requesting access
+to device information to create an identifier, create a <a
+href="{@docRoot}reference/java/util/UUID.html">GUID</a> for your application.
+(This specific example is also discussed in Handling User Data) Or, rather than
+using external storage, store data in your application directory.</p>
+
+<p>If a permission is not required, do not request it. This sounds simple, but
+there has been quite a bit of research into the frequency of over-requesting
+permissions. If you’re interested in the subject you might start with this
+research paper published by U.C. Berkeley: <a
+href="http://www.eecs.berkeley.edu/Pubs/TechRpts/2011/EECS-2011-48.pdf">
+http://www.eecs.berkeley.edu/Pubs/TechRpts/2011/EECS-2011-48.pdf</a></p>
+
+<p>In addition to requesting permissions, your application can use <a
+href="{@docRoot}guide/topics/manifest/permission-element.html">permissions</a>
+to protect IPC that is security sensitive and will be exposed to other
+applications -- such as a <code><a
+href="{@docRoot}reference/android/content/ContentProvider.html">
+ContentProvider</a></code>. In general, we recommend using access controls
+other than user confirmed permissions where possible since permissions can
+be confusing for users. For example, consider using the <a
+href="{@docRoot}guide/topics/manifest/permission-element.html#plevel">signature
+protection level</a> on permissions for IPC communication between applications
+provided by a single developer.</p>
+
+<p>Do not cause permission re-delegation. This occurs when an app exposes data
+over IPC that is only available because it has a specific permission, but does
+not require that permission of any clients of it’s IPC interface. More
+details on the potential impacts, and frequency of this type of problem is
+provided in this research paper published at USENIX: <a
+href="http://www.cs.berkeley.edu/~afelt/felt_usenixsec2011.pdf">http://www.cs.be
+rkeley.edu/~afelt/felt_usenixsec2011.pdf</a></p>
+
+<h3>Creating Permissions</h3>
+
+<p>Generally, you should strive to create as few permissions as possible while
+satisfying your security requirements. Creating a new permission is relatively
+uncommon for most applications, since <a
+href="{@docRoot}reference/android/Manifest.permission.html">system-defined
+permissions</a> cover many situations. Where appropriate,
+perform access checks using existing permissions.</p>
+
+<p>If you must create a new permission, consider whether you can accomplish
+your task with a Signature permission. Signature permissions are transparent
+to the user and only allow access by applications signed by the same developer
+as application performing the permission check. If you create a Dangerous
+permission, then the user needs to decide whether to install the application.
+This can be confusing for other developers, as well as for users.</p>
+
+<p>If you create a Dangerous permission, there are a number of complexities
+that you need to consider.
<ul>
-<li>At the time of a call into the system, to prevent an application from
-executing certain functions.</li>
-<li>When starting an activity, to prevent applications from launching
-activities of other applications.</li>
-<li>Both sending and receiving broadcasts, to control who can receive
-your broadcast or who can send a broadcast to you.</li>
-<li>When accessing and operating on a content provider.</li>
-<li>Binding to or starting a service.</li>
-</ul>
+<li>The permission must have a string that concisely expresses to a user the
+security decision they will be required to make.</li>
+<li>The permission string must be localized to many different languages.</li>
+<li>Uses may choose not to install an application because a permission is
+confusing or perceived as risky.</li>
+<li>Applications may request the permission when the creator of the permission
+has not been installed.</li>
+</ul></p>
+
+<p>Each of these poses a significant non-technical challenge for an application
+developer, which is why we discourage the use of Dangerous permission.</p>
+
+<a name="Networking"></a>
+<h2>Using Networking</h2>
+
+<h3>Using IP Networking</h3>
+
+<p>Networking on Android is not significantly different from Linux
+environments. The key consideration is making sure that appropriate protocols
+are used for sensitive data, such as <a
+href="{@docRoot}reference/javax/net/ssl/HttpsURLConnection.html">HTTPS</a> for
+web traffic. We prefer use of HTTPS over HTTP anywhere that HTTPS is
+supported on the server, since mobile devices frequently connect on networks
+that are not secured, such as public WiFi hotspots.</p>
+
+<p>Authenticated, encrypted socket-level communication can be easily
+implemented using the <code><a
+href="{@docRoot}reference/javax/net/ssl/SSLSocket.html">SSLSocket</a></code>
+class. Given the frequency with which Android devices connect to unsecured
+wireless networks using WiFi, the use of secure networking is strongly
+encouraged for all applications.</p>
+
+<p>We have seen some applications use <a
+href="http://en.wikipedia.org/wiki/Localhost">localhost</a> network ports for
+handling sensitive IPC. We discourage this approach since these interfaces are
+accessible by other applications on the device. Instead, use an Android IPC
+mechanism where authentication is possible such as a Service and Binder. (Even
+worse than using loopback is to bind to INADDR_ANY since then your application
+may receive requests from anywhere. We’ve seen that, too.)</p>
+
+<p>Also, one common issue that warrants repeating is to make sure that you do
+not trust data downloaded from HTTP or other insecure protocols. This includes
+validation of input in <code><a
+href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code> and
+any responses to intents issued against HTTP.</p>
+
+<h3>Using Telephony Networking</h3>
+
+<p>SMS is the telephony protocol most frequently used by Android developers.
+Developers should keep in mind that this protocol was primarily designed for
+user-to-user communication and is not well-suited for some application
+purposes. Due to the limitations of SMS, we strongly recommend the use of <a
+href="http://code.google.com/android/c2dm/">C2DM</a> and IP networking for
+sending data messages to devices.</p>
+
+<p>Many developers do not realize that SMS is not encrypted or strongly
+authenticated on the network or on the device. In particular, any SMS receiver
+should expect that a malicious user may have sent the SMS to your application
+-- do not rely on unauthenticated SMS data to perform sensitive commands.
+Also, you should be aware that SMS may be subject to spoofing and/or
+interception on the network. On the Android-powered device itself, SMS
+messages are transmitted as Broadcast intents, so they may be read or captured
+by other applications that have the READ_SMS permission.</p>
+
+<a name="DynamicCode"></a>
+<h2>Dynamically Loading Code</h2>
+
+<p>We strongly discourage loading code from outside of the application APK.
+Doing so significantly increases the likelihood of application compromise due
+to code injection or code tampering. It also adds complexity around version
+management and application testing. Finally, it can make it impossible to
+verify the behavior of an application, so it may be prohibited in some
+environments.</p>
+
+<p>If your application does dynamically load code, the most important thing to
+keep in mind about dynamically loaded code is that it runs with the same
+security permissions as the application APK. The user made a decision to
+install your application based on your identity, and they are expecting that
+you provide any code run within the application, including code that is
+dynamically loaded.</p>
+
+<p>The major security risk associated with dynamically loading code is that the
+code needs to come from a verifiable source. If the modules are included
+directly within your APK, then they cannot be modified by other applications.
+This is true whether the code is a native library or a class being loaded using
+<a href="{@docRoot}reference/dalvik/system/DexClassLoader.html">
+<code>DexClassLoader</code></a>. We have seen many instances of applications
+attempting to load code from insecure locations, such as downloaded from the
+network over unencrypted protocols or from world writable locations such as
+external storage. These locations could allow someone on the network to modify
+the content in transit, or another application on a users device to modify the
+content, respectively.</p>
-<a name="declaring"></a>
-<h2>Declaring and Enforcing Permissions</h2>
+<h3>Using WebView</h3>
-<p>To enforce your own permissions, you must first declare them in your
-<code>AndroidManifest.xml</code> using one or more
-<code>{@link android.R.styleable#AndroidManifestPermission <permission>}</code>
-tags.</p>
+<p>Since WebView consumes web content that can include HTML and JavaScript,
+improper use can introduce common web security issues such as <a
+href="http://en.wikipedia.org/wiki/Cross_site_scripting">cross-site-scripting</a
+> (JavaScript injection). Android includes a number of mechanisms to reduce
+the scope of these potential issues by limiting the capability of WebView to
+the minimum functionality required by your application.</p>
-<p>For example, an application that wants to control who can start one
-of its activities could declare a permission for this operation as follows:</p>
+<p>If your application does not directly use JavaScript within a <code><a
+href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code>, do
+not call
+<a href="{@docRoot}reference/android/webkit/WebSettings.html#setJavaScriptEnabled(boolean)">
+<code>setJavaScriptEnabled()</code></a>. We have seen this method invoked
+in sample code that might be repurposed in production application -- so
+remove it if necessary. By default, <code><a
+href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code> does
+not execute JavaScript so cross-site-scripting is not possible.</p>
-<pre><manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.me.app.myapp" >
- <permission android:name="com.me.app.myapp.permission.DEADLY_ACTIVITY"
- android:label="@string/permlab_deadlyActivity"
- android:description="@string/permdesc_deadlyActivity"
- android:permissionGroup="android.permission-group.COST_MONEY"
- android:protectionLevel="dangerous" />
- ...
-</manifest></pre>
+<p>Use <code><a
+href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> with
+particular care because it allows JavaScript to invoke operations that are
+normally reserved for Android applications. Only expose <code><a
+href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> to
+sources from which all input is trustworthy. If untrusted input is allowed,
+untrusted JavaScript may be able to invoke Android methods. In general, we
+recommend only exposing <code><a
+href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> to
+JavaScript that is contained within your application APK.</p>
-<p>The {@link android.R.styleable#AndroidManifestPermission_protectionLevel
-<protectionLevel>} attribute is required, telling the system how the
-user is to be informed of applications requiring the permission, or who is
-allowed to hold that permission, as described in the linked documentation.</p>
+<p>Do not trust information downloaded over HTTP, use HTTPS instead. Even if
+you are connecting only to a single website that you trust or control, HTTP is
+subject to <a
+href="http://en.wikipedia.org/wiki/Man-in-the-middle_attack">MiTM</a> attacks
+and interception of data. Sensitive capabilities using <code><a
+href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> should
+not ever be exposed to unverified script downloaded over HTTP. Note that even
+with the use of HTTPS,
+<code><a
+href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code>
+increases the attack surface of your application to include the server
+infrastructure and all CAs trusted by the Android-powered device.</p>
-<p>The {@link android.R.styleable#AndroidManifestPermission_permissionGroup
-<permissionGroup>} attribute is optional, and only used to help the system display
-permissions to the user. You will usually want to set this to either a standard
-system group (listed in {@link android.Manifest.permission_group
-android.Manifest.permission_group}) or in more rare cases to one defined by
-yourself. It is preferred to use an existing group, as this simplifies the
-permission UI shown to the user.</p>
+<p>If your application accesses sensitive data with a <code><a
+href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code>, you
+may want to use the <code><a
+href="{@docRoot}reference/android/webkit/WebView.html#clearCache(boolean)">
+clearCache()</a></code> method to delete any files stored locally. Server side
+headers like no-cache can also be used to indicate that an application should
+not cache particular content.</p>
-<p>Note that both a label and description should be supplied for the
-permission. These are string resources that can be displayed to the user when
-they are viewing a list of permissions
-(<code>{@link android.R.styleable#AndroidManifestPermission_label android:label}</code>)
-or details on a single permission (
-<code>{@link android.R.styleable#AndroidManifestPermission_description android:description}</code>).
-The label should be short, a few words
-describing the key piece of functionality the permission is protecting. The
-description should be a couple sentences describing what the permission allows
-a holder to do. Our convention for the description is two sentences, the first
-describing the permission, the second warning the user of what bad things
-can happen if an application is granted the permission.</p>
+<a name="Input"></a>
+<h2>Performing Input Validation</h2>
-<p>Here is an example of a label and description for the CALL_PHONE
-permission:</p>
+<p>Insufficient input validation is one of the most common security problems
+affecting applications, regardless of what platform they run on. Android does
+have platform-level countermeasures that reduce the exposure of applications to
+input validation issues, you should use those features where possible. Also
+note that selection of type-safe languages tends to reduce the likelihood of
+input validation issues. We strongly recommend building your applications with
+the Android SDK.</p>
-<pre>
- <string name="permlab_callPhone">directly call phone numbers</string>
- <string name="permdesc_callPhone">Allows the application to call
- phone numbers without your intervention. Malicious applications may
- cause unexpected calls on your phone bill. Note that this does not
- allow the application to call emergency numbers.</string>
-</pre>
+<p>If you are using native code, then any data read from files, received over
+the network, or received from an IPC has the potential to introduce a security
+issue. The most common problems are <a
+href="http://en.wikipedia.org/wiki/Buffer_overflow">buffer overflows</a>, <a
+href="http://en.wikipedia.org/wiki/Double_free#Use_after_free">use after
+free</a>, and <a
+href="http://en.wikipedia.org/wiki/Off-by-one_error">off-by-one errors</a>.
+Android provides a number of technologies like ASLR and DEP that reduce the
+exploitability of these errors, but they do not solve the underlying problem.
+These can be prevented by careful handling of pointers and managing of
+buffers.</p>
-<p>You can look at the permissions currently defined in the system with the
-Settings app and the shell command <code>adb shell pm list permissions</code>.
-To use the Settings app, go to Settings > Applications. Pick an app and
-scroll down to see the permissions that the app uses. For developers, the adb '-s'
-option displays the permissions in a form similar to how the user will see them:</p>
+<p>Dynamic, string based languages such as JavaScript and SQL are also subject
+to input validation problems due to escape characters and <a
+href="http://en.wikipedia.org/wiki/Code_injection">script injection</a>.</p>
-<pre>
-$ adb shell pm list permissions -s
-All Permissions:
+<p>If you are using data within queries that are submitted to SQL Database or a
+Content Provider, SQL Injection may be an issue. The best defense is to use
+parameterized queries, as is discussed in the ContentProviders section.
+Limiting permissions to read-only or write-only can also reduce the potential
+for harm related to SQL Injection.</p>
-Network communication: view Wi-Fi state, create Bluetooth connections, full
-Internet access, view network state
+<p>If you are using <code><a
+href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code>, then
+you must consider the possibility of XSS. If your application does not
+directly use JavaScript within a <code><a
+href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code>, do
+not call setJavaScriptEnabled() and XSS is no longer possible. If you must
+enable JavaScript then the WebView section provides other security best
+practices.</p>
-Your location: access extra location provider commands, fine (GPS) location,
-mock location sources for testing, coarse (network-based) location
+<p>If you cannot use the security features above, we strongly recommend the use
+of well-structured data formats and verifying that the data conforms to the
+expected format. While blacklisting of characters or character-replacement can
+be an effective strategy, these techniques are error-prone in practice and
+should be avoided when possible.</p>
-Services that cost you money: send SMS messages, directly call phone numbers
+<a name="UserData"></a>
+<h2>Handling User Data</h2>
-...</pre>
+<p>In general, the best approach is to minimize use of APIs that access
+sensitive or personal user data. If you have access to data and can avoid
+storing or transmitting the information, do not store or transmit the data.
+Finally, consider if there is a way that your application logic can be
+implemented using a hash or non-reversible form of the data. For example, your
+application might use the hash of an an email address as a primary key, to
+avoid transmitting or storing the email address. This reduces the chances of
+inadvertently exposing data, and it also reduces the chance of attackers
+attempting to exploit your application.</p>
-<a name="manifest"></a>
-<h3>Enforcing Permissions in AndroidManifest.xml</h3>
+<p>If your application accesses personal information such as passwords or
+usernames, keep in mind that some jurisdictions may require you to provide a
+privacy policy explaining your use and storage of that data. So following the
+security best practice of minimizing access to user data may also simplify
+compliance.</p>
-<p>High-level permissions restricting access to entire components of the
-system or application can be applied through your
-<code>AndroidManifest.xml</code>. All that this requires is including an {@link
-android.R.attr#permission android:permission} attribute on the desired
-component, naming the permission that will be used to control access to
-it.</p>
+<p>You should also consider whether your application might be inadvertently
+exposing personal information to other parties such as third-party components
+for advertising or third-party services used by your application. If you don't
+know why a component or service requires a personal information, don’t
+provide it. In general, reducing the access to personal information by your
+application will reduce the potential for problems in this area.</p>
-<p><strong>{@link android.app.Activity}</strong> permissions
-(applied to the
-{@link android.R.styleable#AndroidManifestActivity <activity>} tag)
-restrict who can start the associated
-activity. The permission is checked during
-{@link android.content.Context#startActivity Context.startActivity()} and
-{@link android.app.Activity#startActivityForResult Activity.startActivityForResult()};
-if the caller does not have
-the required permission then {@link java.lang.SecurityException} is thrown
-from the call.</p>
+<p>If access to sensitive data is required, evaluate whether that information
+must be transmitted to a server, or whether the operation can be performed on
+the client. Consider running any code using sensitive data on the client to
+avoid transmitting user data.</p>
-<p><strong>{@link android.app.Service}</strong> permissions
-(applied to the
-{@link android.R.styleable#AndroidManifestService <service>} tag)
-restrict who can start or bind to the
-associated service. The permission is checked during
-{@link android.content.Context#startService Context.startService()},
-{@link android.content.Context#stopService Context.stopService()} and
-{@link android.content.Context#bindService Context.bindService()};
-if the caller does not have
-the required permission then {@link java.lang.SecurityException} is thrown
-from the call.</p>
+<p>Also, make sure that you do not inadvertently expose user data to other
+application on the device through overly permissive IPC, world writable files,
+or network sockets. This is a special case of permission redelegation,
+discussed in the Requesting Permissions section.</p>
-<p><strong>{@link android.content.BroadcastReceiver}</strong> permissions
-(applied to the
-{@link android.R.styleable#AndroidManifestReceiver <receiver>} tag)
-restrict who can send broadcasts to the associated receiver.
-The permission is checked <em>after</em>
-{@link android.content.Context#sendBroadcast Context.sendBroadcast()} returns,
-as the system tries
-to deliver the submitted broadcast to the given receiver. As a result, a
-permission failure will not result in an exception being thrown back to the
-caller; it will just not deliver the intent. In the same way, a permission
-can be supplied to
-{@link android.content.Context#registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, String, android.os.Handler)
-Context.registerReceiver()}
-to control who can broadcast to a programmatically registered receiver.
-Going the other way, a permission can be supplied when calling
-{@link android.content.Context#sendBroadcast(Intent, String) Context.sendBroadcast()}
-to restrict which BroadcastReceiver objects are allowed to receive the broadcast (see
-below).</p>
+<p>If a GUID is required, create a large, unique number and store it. Do not
+use phone identifiers such as the phone number or IMEI which may be associated
+with personal information. This topic is discussed in more detail in the <a
+href="http://android-developers.blogspot.com/2011/03/identifying-app-installations.html">Android Developer Blog</a>.</p>
-<p><strong>{@link android.content.ContentProvider}</strong> permissions
-(applied to the
-{@link android.R.styleable#AndroidManifestProvider <provider>} tag)
-restrict who can access the data in
-a {@link android.content.ContentProvider}. (Content providers have an important
-additional security facility available to them called
-<a href="#uri">URI permissions</a> which is described later.)
-Unlike the other components,
-there are two separate permission attributes you can set:
-{@link android.R.attr#readPermission android:readPermission} restricts who
-can read from the provider, and
-{@link android.R.attr#writePermission android:writePermission} restricts
-who can write to it. Note that if a provider is protected with both a read
-and write permission, holding only the write permission does not mean
-you can read from a provider. The permissions are checked when you first
-retrieve a provider (if you don't have either permission, a SecurityException
-will be thrown), and as you perform operations on the provider. Using
-{@link android.content.ContentResolver#query ContentResolver.query()} requires
-holding the read permission; using
-{@link android.content.ContentResolver#insert ContentResolver.insert()},
-{@link android.content.ContentResolver#update ContentResolver.update()},
-{@link android.content.ContentResolver#delete ContentResolver.delete()}
-requires the write permission.
-In all of these cases, not holding the required permission results in a
-{@link java.lang.SecurityException} being thrown from the call.</p>
+<p>Application developers should be careful writing to on-device logs.
+In Android, logs are a shared resource, and are available
+to an application with the
+<a href="{@docRoot}reference/android/Manifest.permission.html#READ_LOGS">
+<code>READ_LOGS</code></a> permission. Even though the phone log data
+is temporary and erased on reboot, inappropriate logging of user information
+could inadvertently leak user data to other applications.</p>
-<a name="broadcasts"></a>
-<h3>Enforcing Permissions when Sending Broadcasts</h3>
+<h3>Handling Credentials</h3>
-<p>In addition to the permission enforcing who can send Intents to a
-registered {@link android.content.BroadcastReceiver} (as described above), you
-can also specify a required permission when sending a broadcast. By calling {@link
-android.content.Context#sendBroadcast(android.content.Intent,String)
-Context.sendBroadcast()} with a
-permission string, you require that a receiver's application must hold that
-permission in order to receive your broadcast.</p>
+<p>In general, we recommend minimizing the frequency of asking for user
+credentials -- to make phishing attacks more conspicuous, and less likely to be
+successful. Instead use an authorization token and refresh it.</p>
-<p>Note that both a receiver and a broadcaster can require a permission. When
-this happens, both permission checks must pass for the Intent to be delivered
-to the associated target.</p>
+<p>Where possible, username and password should not be stored on the device.
+Instead, perform initial authentication using the username and password
+supplied by the user, and then use a short-lived, service-specific
+authorization token.</p>
+<p>Services that will be accessible to multiple applications should be accessed
+using <code>
+<a href="{@docRoot}reference/android/accounts/AccountManager.html">
+AccountManager</a></code>. If possible, use the <code><a
+href="{@docRoot}reference/android/accounts/AccountManager.html">
+AccountManager</a></code> class to invoke a cloud-based service and do not store
+passwords on the device.</p>
-<a name="enforcement"></a>
-<h3>Other Permission Enforcement</h3>
+<p>After using <code><a
+href="{@docRoot}reference/android/accounts/AccountManager.html">
+AccountManager</a></code> to retrieve an Account, check the <code><a
+href="{@docRoot}reference/android/accounts/Account.html#CREATOR">CREATOR</a>
+</code> before passing in any credentials, so that you do not inadvertently pass
+credentials to the wrong application.</p>
-<p>Arbitrarily fine-grained permissions can be enforced at any call into a
-service. This is accomplished with the {@link
-android.content.Context#checkCallingPermission Context.checkCallingPermission()}
-method. Call with a desired
-permission string and it will return an integer indicating whether that
-permission has been granted to the current calling process. Note that this can
-only be used when you are executing a call coming in from another process,
-usually through an IDL interface published from a service or in some other way
-given to another process.</p>
+<p>If credentials are to be used only by applications that you create, then you
+can verify the application which accesses the <code><a
+href="{@docRoot}reference/android/accounts/AccountManager.html">
+AccountManager</a></code> using <code><a
+href="{@docRoot}reference/android/content/pm/PackageManager.html#checkSignatures(java.lang.String,%20java.lang.String)">checkSignature()</a></code>.
+Alternatively, if only one application will use the credential, you might use a
+<code><a
+href={@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> for
+storage.</p>
-<p>There are a number of other useful ways to check permissions. If you have
-the pid of another process, you can use the Context method {@link
-android.content.Context#checkPermission(String, int, int) Context.checkPermission(String, int, int)}
-to check a permission against that pid. If you have the package name of another
-application, you can use the direct PackageManager method {@link
-android.content.pm.PackageManager#checkPermission(String, String)
-PackageManager.checkPermission(String, String)}
-to find out whether that particular package has been granted a specific permission.</p>
+<a name="Crypto"></a>
+<h2>Using Cryptography</h2>
+<p>In addition to providing data isolation, supporting full-filesystem
+encryption, and providing secure communications channels Android provides a
+wide array of algorithms for protecting data using cryptography.</p>
-<a name="uri"></a>
-<h2>URI Permissions</h2>
+<p>In general, try to use the highest level of pre-existing framework
+implementation that can support your use case. If you need to securely
+retrieve a file from a known location, a simple HTTPS URI may be adequate and
+require no knowledge of cryptography on your part. If you need a secure
+tunnel, consider using
+<a href="{@docRoot}reference/javax/net/ssl/HttpsURLConnection.html">
+<code>HttpsURLConnection</code></a> or <code><a
+href="{@docRoot}reference/javax/net/ssl/SSLSocket.html">SSLSocket</a></code>,
+rather than writing your own protocol.</p>
-<p>The standard permission system described so far is often not sufficient
-when used with content providers. A content provider may want to
-protect itself with read and write permissions, while its direct clients
-also need to hand specific URIs to other applications for them to operate on.
-A typical example is attachments in a mail application. Access to the mail
-should be protected by permissions, since this is sensitive user data. However,
-if a URI to an image attachment is given to an image viewer, that image viewer
-will not have permission to open the attachment since it has no reason to hold
-a permission to access all e-mail.</p>
+<p>If you do find yourself needing to implement your own protocol, we strongly
+recommend that you not implement your own cryptographic algorithms. Use
+existing cryptographic algorithms such as those in the implementation of AES or
+RSA provided in the <code><a
+href="{@docRoot}reference/javax/crypto/Cipher.html">Cipher</a></code> class.</p>
-<p>The solution to this problem is per-URI permissions: when starting an
-activity or returning a result to an activity, the caller can set
-{@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION
-Intent.FLAG_GRANT_READ_URI_PERMISSION} and/or
-{@link android.content.Intent#FLAG_GRANT_WRITE_URI_PERMISSION
-Intent.FLAG_GRANT_WRITE_URI_PERMISSION}. This grants the receiving activity
-permission access the specific data URI in the Intent, regardless of whether
-it has any permission to access data in the content provider corresponding
-to the Intent.</p>
+<p>Use a secure random number generator (
+<a href="{@docRoot}reference/java/security/SecureRandom.html">
+<code>SecureRandom</code></a>) to initialize any cryptographic keys (<a
+href="{@docRoot}reference/javax/crypto/KeyGenerator.html">
+<code>KeyGenerator</code></a>). Use of a key that is not generated with a secure random
+number generator significantly weakens the strength of the algorithm, and may
+allow offline attacks.</p>
-<p>This mechanism allows a common capability-style model where user interaction
-(opening an attachment, selecting a contact from a list, etc) drives ad-hoc
-granting of fine-grained permission. This can be a key facility for reducing
-the permissions needed by applications to only those directly related to their
-behavior.</p>
+<p>If you need to store a key for repeated use, use a mechanism like <code><a
+href="{@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> that
+provides a mechanism for long term storage and retrieval of cryptographic
+keys.</p>
-<p>The granting of fine-grained URI permissions does, however, require some
-cooperation with the content provider holding those URIs. It is strongly
-recommended that content providers implement this facility, and declare that
-they support it through the
-{@link android.R.styleable#AndroidManifestProvider_grantUriPermissions
-android:grantUriPermissions} attribute or
-{@link android.R.styleable#AndroidManifestGrantUriPermission
-<grant-uri-permissions>} tag.</p>
+<h2>Conclusion</h2>
-<p>More information can be found in the
-{@link android.content.Context#grantUriPermission Context.grantUriPermission()},
-{@link android.content.Context#revokeUriPermission Context.revokeUriPermission()}, and
-{@link android.content.Context#checkUriPermission Context.checkUriPermission()}
-methods.</p>
+<p>Android provides developers with the ability to design applications with a
+broad range of security requirements. These best practices will help you make
+sure that your application takes advantage of the security benefits provided by
+the platform.</p>
+<p>You can receive more information on these topics and discuss security best
+practices with other developers in the <a
+href="http://groups.google.com/group/android-security-discuss">Android Security
+Discuss</a> Google Group</p>
diff --git a/docs/html/guide/topics/sensors/index.jd b/docs/html/guide/topics/sensors/index.jd
index 43903dc..a045899 100644
--- a/docs/html/guide/topics/sensors/index.jd
+++ b/docs/html/guide/topics/sensors/index.jd
@@ -1,88 +1,40 @@
-page.title=Sensors
+page.title=Location and Sensors
+page.landing=true
+page.landing.intro=Use sensors on the device to add rich location and motion capabilities to your app, from GPS or network location to accelerometer, gyroscope, temperature, barometer, and more.
+page.landing.image=
+
@jd:body
-<div id="qv-wrapper">
- <div id="qv">
- <h2>Topics</h2>
- <ol>
- <li><a href="{@docRoot}guide/topics/sensors/sensors_overview.html">Sensors Overview</a></li>
- <li><a href="{@docRoot}guide/topics/sensors/sensors_motion.html">Motion Sensors</a></li>
- <li><a href="{@docRoot}guide/topics/sensors/sensors_position.html">Position
- Sensors</a></li>
- <li><a href="{@docRoot}guide/topics/sensors/sensors_environment.html">Environment
- Sensors</a></li>
- </ol>
- <h2>Key classes and interfaces</h2>
- <ol>
- <li>{@link android.hardware.Sensor}</li>
- <li>{@link android.hardware.SensorEvent}</li>
- <li>{@link android.hardware.SensorManager}</li>
- <li>{@link android.hardware.SensorEventListener}</li>
- </ol>
- <h2>Related samples</h2>
- <ol>
- <li><a href="{@docRoot}resources/samples/AccelerometerPlay/index.html">Accelerometer
- Play</a></li>
- <li><a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/os/RotationVectorDemo.html">
-API Demos (OS - RotationVectorDemo)</a></li>
- <li><a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/os/Sensors.html">API Demos
-(OS - Sensors)</a></li>
- </ol>
+<div class="landing-docs">
+
+ <div class="col-6">
+ <h3>Blog Articles</h3>
+
+ <a href="http://android-developers.blogspot.com/2010/09/one-screen-turn-deserves-another.html">
+ <h4>One Screen Turn Deserves Another</h4>
+ <p>However, there’s a new wrinkle: recently, a few devices have shipped (see here and here)
+that run Android on screens that are naturally landscape in their orientation. That is, when held in
+the default position, the screens are wider than they are tall. This introduces a few fairly subtle
+issues that we’ve noticed causing problems in some apps.</p>
+ </a>
+
+ <a href="android-developers.blogspot.com/2011/06/deep-dive-into-location.html">
+ <h4>A Deep Dive Into Location</h4>
+ <p>I’ve written an open-source reference app that incorporates all of the tips, tricks, and
+cheats I know to reduce the time between opening an app and seeing an up-to-date list of nearby
+venues - as well as providing a reasonable level of offline support</p>
+ </a>
</div>
-</div>
-<p>Most Android-powered devices have built-in sensors that measure motion, orientation,
-and various environmental conditions. These sensors are capable of providing raw data with high
-precision and accuracy, and are useful if you want to monitor three-dimensional device movement or
-positioning, or you want to monitor changes in the ambient environment near a device. For example, a
-game might track readings from a device's gravity sensor to infer complex user gestures
-and motions, such as tilt, shake, rotation, or swing. Likewise, a weather application might use a
-device's temperature sensor and humidity sensor to calculate and report the dewpoint, or a travel
-application might use the geomagnetic field sensor and accelerometer to report a compass
-bearing.</p>
+ <div class="col-6">
+ <h3>Training</h3>
+
+ <a href="http://developer.android.com/training/basics/location/index.html">
+ <h4>Making Your App Location Aware</h4>
+ <p>This class teaches you how to incorporate location based services in your Android
+application. You'll learn a number of methods to receive location updates and related best
+practices.</p>
+ </a>
+ </div>
-<p>The Android platform supports three broad categories of sensors:</p>
-
-<ul>
- <li>Motion sensors
- <p>These sensors measure acceleration forces and rotational forces along three axes. This
- category includes accelerometers, gravity sensors, gyroscopes, and rotational vector
- sensors.</p>
- </li>
- <li>Environmental sensors
- <p>These sensors measure various environmental parameters, such as ambient air temperature
- and pressure, illumination, and humidity. This category includes barometers, photometers, and
- thermometers.</p>
- </li>
- <li>Position sensors
- <p>These sensors measure the physical position of a device. This category includes
- orientation sensors and magnetometers.</p>
- </li>
-</ul>
-
-<p>To access these sensors, you can use the Android sensor framework. The sensor framework provides
-several classes and interfaces that help you perform a wide variety of sensor-related tasks. To
-learn more about the framework and the sensors that are supported on the Android system, read the
-following documents:</p>
-
-<dl>
- <dt><strong><a href="{@docRoot}guide/topics/sensors/sensors_overview.html">Sensors
- Overview</a></strong></dt>
- <dd>Learn how to list the sensors that are on a device, set up sensor event listeners, and
- acquire sensor data. Also learn best practices for accessing and using sensors.</dd>
- <dt><strong><a href="{@docRoot}guide/topics/sensors/sensors_motion.html">Motion
- Sensors</a></strong></dt>
- <dd>Learn how to use the sensors that provide acceleration data, such as the accelerometer,
- gravity sensor, and linear acceleration sensor. Also learn how to use the sensors that
- provide rotational data, such as gyroscopes and rotational vector sensors.</dd>
- <dt><strong><a href="{@docRoot}guide/topics/sensors/sensors_position.html">Position
- Sensors</a></strong></dt>
- <dd>Learn how to use the sensors that provide orientation and compass data, such as the
- orientation sensor and the geomagnetic field sensor.</dd>
- <dt><strong><a href="{@docRoot}guide/topics/sensors/sensors_environment.html">Environment
- Sensors</a></strong></dt>
- <dd>Learn how to use the sensors that provide environmental data, such as the light,
- humidity, pressure, temperature, and proximity sensors.</dd>
-</dl>
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/topics/sensors/sensors_overview.jd b/docs/html/guide/topics/sensors/sensors_overview.jd
index 543872c..e38a843 100644
--- a/docs/html/guide/topics/sensors/sensors_overview.jd
+++ b/docs/html/guide/topics/sensors/sensors_overview.jd
@@ -50,13 +50,39 @@
</div>
</div>
-<p>Most Android-powered devices have sensors that let you monitor changes in device
-position and motion. Many devices also have sensors that let you determine ambient environmental
-conditions, such as temperature, pressure, humidity, and lighting. You can access these
-sensors and acquire raw sensor data by using the Android sensor framework.</p>
+<p>Most Android-powered devices have built-in sensors that measure motion, orientation,
+and various environmental conditions. These sensors are capable of providing raw data with high
+precision and accuracy, and are useful if you want to monitor three-dimensional device movement or
+positioning, or you want to monitor changes in the ambient environment near a device. For example, a
+game might track readings from a device's gravity sensor to infer complex user gestures
+and motions, such as tilt, shake, rotation, or swing. Likewise, a weather application might use a
+device's temperature sensor and humidity sensor to calculate and report the dewpoint, or a travel
+application might use the geomagnetic field sensor and accelerometer to report a compass
+bearing.</p>
-<p>The sensor framework provides several classes and interfaces that help you perform a wide variety
-of sensor-related tasks. For example, you can use the sensor framework to do the following:</p>
+<p>The Android platform supports three broad categories of sensors:</p>
+
+<ul>
+ <li>Motion sensors
+ <p>These sensors measure acceleration forces and rotational forces along three axes. This
+ category includes accelerometers, gravity sensors, gyroscopes, and rotational vector
+ sensors.</p>
+ </li>
+ <li>Environmental sensors
+ <p>These sensors measure various environmental parameters, such as ambient air temperature
+ and pressure, illumination, and humidity. This category includes barometers, photometers, and
+ thermometers.</p>
+ </li>
+ <li>Position sensors
+ <p>These sensors measure the physical position of a device. This category includes
+ orientation sensors and magnetometers.</p>
+ </li>
+</ul>
+
+
+<p>You can access sensors available on the device and acquire raw sensor data by using the Android
+sensor framework. The sensor framework provides several classes and interfaces that help you perform a wide
+variety of sensor-related tasks. For example, you can use the sensor framework to do the following:</p>
<ul>
<li>Determine which sensors are available on a device.</li>
diff --git a/docs/html/guide/topics/testing/activity_testing.jd b/docs/html/guide/topics/testing/activity_testing.jd
deleted file mode 100644
index 51121f4..0000000
--- a/docs/html/guide/topics/testing/activity_testing.jd
+++ /dev/null
@@ -1,394 +0,0 @@
-page.title=Activity Testing
-parent.title=Testing
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li>
- <a href="#ActivityTestAPI">The Activity Testing API</a>
- <ol>
- <li>
- <a href="#ActivityInstrumentationTestCase2">ActivityInstrumentationTestCase2</a>
- </li>
- <li>
- <a href="#ActivityUnitTestCase">ActivityUnitTestCase</a>
- </li>
- <li>
- <a href="#SingleLaunchActivityTestCase">SingleLaunchActivityTestCase</a>
- </li>
- <li>
- <a href="#MockObjectNotes">Mock objects and activity testing</a>
- </li>
- <li>
- <a href="#AssertionNotes">Assertions for activity testing</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#WhatToTest">What to Test</a>
- </li>
- <li>
- <a href="#NextSteps">Next Steps</a>
- </li>
- <li>
- <a href="#UITesting">Appendix: UI Testing Notes</a>
- <ol>
- <li>
- <a href="#RunOnUIThread">Testing on the UI thread</a>
- </li>
- <li>
- <a href="#NotouchMode">Turning off touch mode</a>
- </li>
- <li>
- <a href="#UnlockDevice">Unlocking the Emulator or Device</a>
- </li>
- <li>
- <a href="#UITestTroubleshooting">Troubleshooting UI tests</a>
- </li>
- </ol>
- </li>
- </ol>
-<h2>Key Classes</h2>
- <ol>
- <li>{@link android.test.InstrumentationTestRunner}</li>
- <li>{@link android.test.ActivityInstrumentationTestCase2}</li>
- <li>{@link android.test.ActivityUnitTestCase}</li>
- </ol>
-<h2>Related Tutorials</h2>
- <ol>
- <li>
- <a href="{@docRoot}resources/tutorials/testing/helloandroid_test.html">
- Hello, Testing</a>
- </li>
- <li>
- <a href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity Testing</a>
- </li>
- </ol>
-<h2>See Also</h2>
- <ol>
- <li>
- <a href="{@docRoot}guide/developing/testing/testing_eclipse.html">
- Testing in Eclipse, with ADT</a>
- </li>
- <li>
- <a href="{@docRoot}guide/developing/testing/testing_otheride.html">
- Testing in Other IDEs</a>
- </li>
- </ol>
- </div>
-</div>
-<p>
- Activity testing is particularly dependent on the the Android instrumentation framework.
- Unlike other components, activities have a complex lifecycle based on callback methods; these
- can't be invoked directly except by instrumentation. Also, the only way to send events to the
- user interface from a program is through instrumentation.
-</p>
-<p>
- This document describes how to test activities using instrumentation and other test
- facilities. The document assumes you have already read
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Fundamentals</a>,
- the introduction to the Android testing and instrumentation framework.
-</p>
-<h2 id="ActivityTestAPI">The Activity Testing API</h2>
-<p>
- The activity testing API base class is {@link android.test.InstrumentationTestCase},
- which provides instrumentation to the test case subclasses you use for Activities.
-</p>
-<p>
- For activity testing, this base class provides these functions:
-</p>
-<ul>
- <li>
- Lifecycle control: With instrumentation, you can start the activity under test, pause it,
- and destroy it, using methods provided by the test case classes.
- </li>
- <li>
- Dependency injection: Instrumentation allows you to create mock system objects such as
- Contexts or Applications and use them to run the activity under test. This
- helps you control the test environment and isolate it from production systems. You can
- also set up customized Intents and start an activity with them.
- </li>
- <li>
- User interface interaction: You use instrumentation to send keystrokes or touch events
- directly to the UI of the activity under test.
- </li>
-</ul>
-<p>
- The activity testing classes also provide the JUnit framework by extending
- {@link junit.framework.TestCase} and {@link junit.framework.Assert}.
-</p>
-<p>
- The two main testing subclasses are {@link android.test.ActivityInstrumentationTestCase2} and
- {@link android.test.ActivityUnitTestCase}. To test an Activity that is launched in a mode
- other than <code>standard</code>, you use {@link android.test.SingleLaunchActivityTestCase}.
-</p>
-<h3 id="ActivityInstrumentationTestCase2">ActivityInstrumentationTestCase2</h3>
-<p>
- The {@link android.test.ActivityInstrumentationTestCase2} test case class is designed to do
- functional testing of one or more Activities in an application, using a normal system
- infrastructure. It runs the Activities in a normal instance of the application under test,
- using a standard system Context. It allows you to send mock Intents to the activity under
- test, so you can use it to test an activity that responds to multiple types of intents, or
- an activity that expects a certain type of data in the intent, or both. Notice, though, that it
- does not allow mock Contexts or Applications, so you can not isolate the test from the rest of
- a production system.
-</p>
-<h3 id="ActivityUnitTestCase">ActivityUnitTestCase</h3>
-<p>
- The {@link android.test.ActivityUnitTestCase} test case class tests a single activity in
- isolation. Before you start the activity, you can inject a mock Context or Application, or both.
- You use it to run activity tests in isolation, and to do unit testing of methods
- that do not interact with Android. You can not send mock Intents to the activity under test,
- although you can call
- {@link android.app.Activity#startActivity(Intent) Activity.startActivity(Intent)} and then
- look at arguments that were received.
-</p>
-<h3 id="SingleLaunchActivityTestCase">SingleLaunchActivityTestCase</h3>
-<p>
- The {@link android.test.SingleLaunchActivityTestCase} class is a convenience class for
- testing a single activity in an environment that doesn't change from test to test.
- It invokes {@link junit.framework.TestCase#setUp() setUp()} and
- {@link junit.framework.TestCase#tearDown() tearDown()} only once, instead of once per
- method call. It does not allow you to inject any mock objects.
-</p>
-<p>
- This test case is useful for testing an activity that runs in a mode other than
- <code>standard</code>. It ensures that the test fixture is not reset between tests. You
- can then test that the activity handles multiple calls correctly.
-</p>
-<h3 id="MockObjectNotes">Mock objects and activity testing</h3>
-<p>
- This section contains notes about the use of the mock objects defined in
- {@link android.test.mock} with activity tests.
-</p>
-<p>
- The mock object {@link android.test.mock.MockApplication} is only available for activity
- testing if you use the {@link android.test.ActivityUnitTestCase} test case class.
- By default, <code>ActivityUnitTestCase</code>, creates a hidden <code>MockApplication</code>
- object that is used as the application under test. You can inject your own object using
- {@link android.test.ActivityUnitTestCase#setApplication(Application) setApplication()}.
-</p>
-<h3 id="AssertionNotes">Assertions for activity testing</h3>
-<p>
- {@link android.test.ViewAsserts} defines assertions for Views. You use it to verify the
- alignment and position of View objects, and to look at the state of ViewGroup objects.
-</p>
-<h2 id="WhatToTest">What To Test</h2>
-<ul>
- <li>
- Input validation: Test that an activity responds correctly to input values in an
- EditText View. Set up a keystroke sequence, send it to the activity, and then
- use {@link android.view.View#findViewById(int)} to examine the state of the View. You can
- verify that a valid keystroke sequence enables an OK button, while an invalid one leaves the
- button disabled. You can also verify that the Activity responds to invalid input by
- setting error messages in the View.
- </li>
- <li>
- Lifecycle events: Test that each of your application's activities handles lifecycle events
- correctly. In general, lifecycle events are actions, either from the system or from the
- user, that trigger a callback method such as <code>onCreate()</code> or
- <code>onClick()</code>. For example, an activity should respond to pause or destroy events
- by saving its state. Remember that even a change in screen orientation causes the current
- activity to be destroyed, so you should test that accidental device movements don't
- accidentally lose the application state.
- </li>
- <li>
- Intents: Test that each activity correctly handles the intents listed in the intent
- filter specified in its manifest. You can use
- {@link android.test.ActivityInstrumentationTestCase2} to send mock Intents to the
- activity under test.
- </li>
- <li>
- Runtime configuration changes: Test that each activity responds correctly to the
- possible changes in the device's configuration while your application is running. These
- include a change to the device's orientation, a change to the current language, and so
- forth. Handling these changes is described in detail in the topic
- <a href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime
- Changes</a>.
- </li>
- <li>
- Screen sizes and resolutions: Before you publish your application, make sure to test it on
- all of the screen sizes and densities on which you want it to run. You can test the
- application on multiple sizes and densities using AVDs, or you can test your application
- directly on the devices that you are targeting. For more information, see the topic
- <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.
- </li>
-</ul>
-<h2 id="NextSteps">Next Steps</h2>
-<p>
- To learn how to set up and run tests in Eclipse, please refer to <a
- href="{@docRoot}guide/developing/testing/testing_eclipse.html">Testing in
- Eclipse, with ADT</a>. If you're not working in Eclipse, refer to <a
- href="{@docRoot}guide/developing/testing/testing_otheride.html">Testing in Other
- IDEs</a>.
-</p>
-<p>
- If you want a step-by-step introduction to testing activities, try one of the
- testing tutorials:
-</p>
-<ul>
- <li>
- The <a
- href="{@docRoot}resources/tutorials/testing/helloandroid_test.html">Hello,
- Testing</a> tutorial introduces basic testing concepts and procedures in the
- context of the Hello, World application.
- </li>
- <li>
- The <a
- href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity
- Testing</a> tutorial is an excellent follow-up to the Hello, Testing tutorial.
- It guides you through a more complex testing scenario that you develop against a
- more realistic activity-oriented application.
- </li>
-</ul>
-<h2 id="UITesting">Appendix: UI Testing Notes</h2>
-<p>
- The following sections have tips for testing the UI of your Android application, specifically
- to help you handle actions that run in the UI thread, touch screen and keyboard events, and home
- screen unlock during testing.
-</p>
-<h3 id="RunOnUIThread">Testing on the UI thread</h3>
-<p>
- An application's activities run on the application's <strong>UI thread</strong>. Once the
- UI is instantiated, for example in the activity's <code>onCreate()</code> method, then all
- interactions with the UI must run in the UI thread. When you run the application normally, it
- has access to the thread and does not have to do anything special.
-</p>
-<p>
- This changes when you run tests against the application. With instrumentation-based classes,
- you can invoke methods against the UI of the application under test. The other test classes
- don't allow this. To run an entire test method on the UI thread, you can annotate the thread
- with <code>@UIThreadTest</code>. Notice that this will run <em>all</em> of the method statements
- on the UI thread. Methods that do not interact with the UI are not allowed; for example, you
- can't invoke <code>Instrumentation.waitForIdleSync()</code>.
-</p>
-<p>
- To run a subset of a test method on the UI thread, create an anonymous class of type
- <code>Runnable</code>, put the statements you want in the <code>run()</code> method, and
- instantiate a new instance of the class as a parameter to the method
- <code><em>appActivity</em>.runOnUiThread()</code>, where <code><em>appActivity</em></code> is
- the instance of the application you are testing.
-</p>
-<p>
- For example, this code instantiates an activity to test, requests focus (a UI action) for the
- Spinner displayed by the activity, and then sends a key to it. Notice that the calls to
- <code>waitForIdleSync</code> and <code>sendKeys</code> aren't allowed to run on the UI thread:
-</p>
-<pre>
- private MyActivity mActivity; // MyActivity is the class name of the app under test
- private Spinner mSpinner;
-
- ...
-
- protected void setUp() throws Exception {
- super.setUp();
- mInstrumentation = getInstrumentation();
-
- mActivity = getActivity(); // get a references to the app under test
-
- /*
- * Get a reference to the main widget of the app under test, a Spinner
- */
- mSpinner = (Spinner) mActivity.findViewById(com.android.demo.myactivity.R.id.Spinner01);
-
- ...
-
- public void aTest() {
- /*
- * request focus for the Spinner, so that the test can send key events to it
- * This request must be run on the UI thread. To do this, use the runOnUiThread method
- * and pass it a Runnable that contains a call to requestFocus on the Spinner.
- */
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mSpinner.requestFocus();
- }
- });
-
- mInstrumentation.waitForIdleSync();
-
- this.sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
-</pre>
-
-<h3 id="NotouchMode">Turning off touch mode</h3>
-<p>
- To control the emulator or a device with key events you send from your tests, you must turn off
- touch mode. If you do not do this, the key events are ignored.
-</p>
-<p>
- To turn off touch mode, you invoke
- <code>ActivityInstrumentationTestCase2.setActivityTouchMode(false)</code>
- <em>before</em> you call <code>getActivity()</code> to start the activity. You must invoke the
- method in a test method that is <em>not</em> running on the UI thread. For this reason, you
- can't invoke the touch mode method from a test method that is annotated with
- <code>@UIThread</code>. Instead, invoke the touch mode method from <code>setUp()</code>.
-</p>
-<h3 id="UnlockDevice">Unlocking the emulator or device</h3>
-<p>
- You may find that UI tests don't work if the emulator's or device's home screen is disabled with
- the keyguard pattern. This is because the application under test can't receive key events sent
- by <code>sendKeys()</code>. The best way to avoid this is to start your emulator or device
- first and then disable the keyguard for the home screen.
-</p>
-<p>
- You can also explicitly disable the keyguard. To do this,
- you need to add a permission in the manifest file (<code>AndroidManifest.xml</code>) and
- then disable the keyguard in your application under test. Note, though, that you either have to
- remove this before you publish your application, or you have to disable it with code in
- the published application.
-</p>
-<p>
- To add the the permission, add the element
- <code><uses-permission android:name="android.permission.DISABLE_KEYGUARD"/></code>
- as a child of the <code><manifest></code> element. To disable the KeyGuard, add the
- following code to the <code>onCreate()</code> method of activities you intend to test:
-</p>
-<pre>
- mKeyGuardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE);
- mLock = mKeyGuardManager.newKeyguardLock("<em>activity_classname</em>");
- mLock.disableKeyguard();
-</pre>
-<p>where <code><em>activity_classname</em></code> is the class name of the activity.</p>
-<h3 id="UITestTroubleshooting">Troubleshooting UI tests</h3>
-<p>
- This section lists some of the common test failures you may encounter in UI testing, and their
- causes:
-</p>
-<dl>
- <dt><code>WrongThreadException</code></dt>
- <dd>
- <p><strong>Problem:</strong></p>
- For a failed test, the Failure Trace contains the following error message:
- <code>
- android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created
- a view hierarchy can touch its views.
- </code>
- <p><strong>Probable Cause:</strong></p>
- This error is common if you tried to send UI events to the UI thread from outside the UI
- thread. This commonly happens if you send UI events from the test application, but you don't
- use the <code>@UIThread</code> annotation or the <code>runOnUiThread()</code> method. The
- test method tried to interact with the UI outside the UI thread.
- <p><strong>Suggested Resolution:</strong></p>
- Run the interaction on the UI thread. Use a test class that provides instrumentation. See
- the previous section <a href="#RunOnUIThread">Testing on the UI Thread</a>
- for more details.
- </dd>
- <dt><code>java.lang.RuntimeException</code></dt>
- <dd>
- <p><strong>Problem:</strong></p>
- For a failed test, the Failure Trace contains the following error message:
- <code>
- java.lang.RuntimeException: This method can not be called from the main application thread
- </code>
- <p><strong>Probable Cause:</strong></p>
- This error is common if your test method is annotated with <code>@UiThreadTest</code> but
- then tries to do something outside the UI thread or tries to invoke
- <code>runOnUiThread()</code>.
- <p><strong>Suggested Resolution:</strong></p>
- Remove the <code>@UiThreadTest</code> annotation, remove the <code>runOnUiThread()</code>
- call, or re-factor your tests.
- </dd>
-</dl>
diff --git a/docs/html/guide/topics/testing/contentprovider_testing.jd b/docs/html/guide/topics/testing/contentprovider_testing.jd
deleted file mode 100644
index edaae8c..0000000
--- a/docs/html/guide/topics/testing/contentprovider_testing.jd
+++ /dev/null
@@ -1,225 +0,0 @@
-page.title=Content Provider Testing
-parent.title=Testing
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li>
- <a href="#DesignAndTest">Content Provider Design and Testing</a>
- </li>
- <li>
- <a href="#ContentProviderTestAPI">The Content Provider Testing API</a>
- <ol>
- <li>
- <a href="#ProviderTestCase2">ProviderTestCase2 </a>
- </li>
- <li>
- <a href="#MockObjects">Mock object classes</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#WhatToTest">What To Test</a>
- </li>
- <li>
- <a href="#NextSteps">Next Steps</a>
- </li>
- </ol>
- <h2>Key Classes</h2>
- <ol>
- <li>{@link android.test.InstrumentationTestRunner}</li>
- <li>{@link android.test.ProviderTestCase2}</li>
- <li>{@link android.test.IsolatedContext}</li>
- <li>{@link android.test.mock.MockContentResolver}</li>
- </ol>
- <h2>See Also</h2>
- <ol>
- <li>
- <a
- href="{@docRoot}guide/topics/testing/testing_android.html">
- Testing Fundamentals</a>
- </li>
- <li>
- <a href="{@docRoot}guide/developing/testing/testing_eclipse.html">
- Testing in Eclipse, with ADT</a>
- </li>
- <li>
- <a href="{@docRoot}guide/developing/testing/testing_otheride.html">
- Testing in Other IDEs</a>
- </li>
- </ol>
- </div>
-</div>
-<p>
- Content providers, which store and retrieve data and make it accessible across applications,
- are a key part of the Android API. As an application developer you're allowed to provide your
- own public providers for use by other applications. If you do, then you should test them
- using the API you publish.
-</p>
-<p>
- This document describes how to test public content providers, although the information is
- also applicable to providers that you keep private to your own application. If you aren't
- familiar with content providers or the Android testing framework, please read
- <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>,
- the guide to developing content providers, and
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Fundamentals</a>,
- the introduction to the Android testing and instrumentation framework.
-</p>
-<h2 id="DesignAndTest">Content Provider Design and Testing</h2>
-<p>
- In Android, content providers are viewed externally as data APIs that provide
- tables of data, with their internals hidden from view. A content provider may have many
- public constants, but it usually has few if any public methods and no public variables.
- This suggests that you should write your tests based only on the provider's public members.
- A content provider that is designed like this is offering a contract between itself and its
- users.
-</p>
-<p>
- The base test case class for content providers,
- {@link android.test.ProviderTestCase2}, allows you to test your content provider in an
- isolated environment. Android mock objects such as {@link android.test.IsolatedContext} and
- {@link android.test.mock.MockContentResolver} also help provide an isolated test environment.
-</p>
-<p>
- As with other Android tests, provider test packages are run under the control of the test
- runner {@link android.test.InstrumentationTestRunner}. The section
- <a href="{@docRoot}guide/topics/testing/testing_android.html#InstrumentationTestRunner">
- Running Tests With InstrumentationTestRunner</a> describes the test runner in
- more detail. The topic <a href="{@docRoot}guide/developing/testing/testing_eclipse.html">
- Testing in Eclipse, with ADT</a> shows you how to run a test package in Eclipse, and the
- topic <a href="{@docRoot}guide/developing/testing/testing_otheride.html">
- Testing in Other IDEs</a>
- shows you how to run a test package from the command line.
-</p>
-<h2 id="ContentProviderTestAPI">Content Provider Testing API</h2>
-<p>
- The main focus of the provider testing API is to provide an isolated testing environment. This
- ensures that tests always run against data dependencies set explicitly in the test case. It
- also prevents tests from modifying actual user data. For example, you want to avoid writing
- a test that fails because there was data left over from a previous test, and you want to
- avoid adding or deleting contact information in a actual provider.
-</p>
-<p>
- The test case class and mock object classes for provider testing set up this isolated testing
- environment for you.
-</p>
-<h3 id="ProviderTestCase2">ProviderTestCase2</h3>
-<p>
- You test a provider with a subclass of {@link android.test.ProviderTestCase2}. This base class
- extends {@link android.test.AndroidTestCase}, so it provides the JUnit testing framework as well
- as Android-specific methods for testing application permissions. The most important
- feature of this class is its initialization, which creates the isolated test environment.
-</p>
-<p>
- The initialization is done in the constructor for {@link android.test.ProviderTestCase2}, which
- subclasses call in their own constructors. The {@link android.test.ProviderTestCase2}
- constructor creates an {@link android.test.IsolatedContext} object that allows file and
- database operations but stubs out other interactions with the Android system.
- The file and database operations themselves take place in a directory that is local to the
- device or emulator and has a special prefix.
-</p>
-<p>
- The constructor then creates a {@link android.test.mock.MockContentResolver} to use as the
- resolver for the test. The {@link android.test.mock.MockContentResolver} class is described in
- detail in the section
- <a href="{@docRoot}guide/topics/testing/testing_android.html#MockObjectClasses">Mock object
-classes</a>.
-</p>
-<p>
- Lastly, the constructor creates an instance of the provider under test. This is a normal
- {@link android.content.ContentProvider} object, but it takes all of its environment information
- from the {@link android.test.IsolatedContext}, so it is restricted to
- working in the isolated test environment. All of the tests done in the test case class run
- against this isolated object.
-</p>
-<h3 id="MockObjects">Mock object classes</h3>
-<p>
- {@link android.test.ProviderTestCase2} uses {@link android.test.IsolatedContext} and
- {@link android.test.mock.MockContentResolver}, which are standard mock object classes. To
- learn more about them, please read
- <a href="{@docRoot}guide/topics/testing/testing_android.html#MockObjectClasses">
- Testing Fundamentals</a>.
-</p>
-<h2 id="WhatToTest">What To Test</h2>
-<p>
- The topic <a href="{@docRoot}guide/topics/testing/what_to_test.html">What To Test</a>
- lists general considerations for testing Android components.
- Here are some specific guidelines for testing content providers.
-</p>
-<ul>
- <li>
- Test with resolver methods: Even though you can instantiate a provider object in
- {@link android.test.ProviderTestCase2}, you should always test with a resolver object
- using the appropriate URI. This ensures that you are testing the provider using the same
- interaction that a regular application would use.
- </li>
- <li>
- Test a public provider as a contract: If you intent your provider to be public and
- available to other applications, you should test it as a contract. This includes
- the following ideas:
- <ul>
- <li>
- Test with constants that your provider publicly exposes. For
- example, look for constants that refer to column names in one of the provider's
- data tables. These should always be constants publicly defined by the provider.
- </li>
- <li>
- Test all the URIs offered by your provider. Your provider may offer several URIs,
- each one referring to a different aspect of the data. The
- <a href="{@docRoot}resources/samples/NotePad/index.html">Note Pad</a> sample,
- for example, features a provider that offers one URI for retrieving a list of notes,
- another for retrieving an individual note by it's database ID, and a third for
- displaying notes in a live folder.
- </li>
- <li>
- Test invalid URIs: Your unit tests should deliberately call the provider with an
- invalid URI, and look for errors. Good provider design is to throw an
- IllegalArgumentException for invalid URIs.
-
- </li>
- </ul>
- </li>
- <li>
- Test the standard provider interactions: Most providers offer six access methods:
- query, insert, delete, update, getType, and onCreate(). Your tests should verify that all
- of these methods work. These are described in more detail in the topic
- <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.
- </li>
- <li>
- Test business logic: Don't forget to test the business logic that your provider should
- enforce. Business logic includes handling of invalid values, financial or arithmetic
- calculations, elimination or combining of duplicates, and so forth. A content provider
- does not have to have business logic, because it may be implemented by activities that
- modify the data. If the provider does implement business logic, you should test it.
- </li>
-</ul>
-<h2 id="NextSteps">Next Steps</h2>
-<p>
- To learn how to set up and run tests in Eclipse, please refer to <a
- href="{@docRoot}guide/developing/testing/testing_eclipse.html">Testing in
- Eclipse, with ADT</a>. If you're not working in Eclipse, refer to <a
- href="{@docRoot}guide/developing/testing/testing_otheride.html">Testing in Other
- IDEs</a>.
-</p>
-<p>
- If you want a step-by-step introduction to testing activities, try one of the
- testing tutorials:
-</p>
-<ul>
- <li>
- The <a
- href="{@docRoot}resources/tutorials/testing/helloandroid_test.html">Hello,
- Testing</a> tutorial introduces basic testing concepts and procedures in the
- context of the Hello, World application.
- </li>
- <li>
- The <a
- href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity
- Testing</a> tutorial is an excellent follow-up to the Hello, Testing tutorial.
- It guides you through a more complex testing scenario that you develop against a
- more realistic activity-oriented application.
- </li>
-</ul>
diff --git a/docs/html/guide/topics/testing/index.jd b/docs/html/guide/topics/testing/index.jd
deleted file mode 100644
index cf87187..0000000
--- a/docs/html/guide/topics/testing/index.jd
+++ /dev/null
@@ -1,86 +0,0 @@
-page.title=Testing
-@jd:body
-<p>
- The Android development environment includes an integrated testing framework that helps you
- test all aspects of your application.
-</p>
-<h4>Fundamentals</h4>
-<p>
- To start learning how to use the framework to create tests for your applications, please
- read the topic <a href="{@docRoot}guide/topics/testing/testing_android.html">
- Testing Fundamentals</a>.
-</p>
-<h4>Concepts</h4>
-<ul>
- <li>
- <a href="{@docRoot}guide/topics/testing/activity_testing.html">
- Activity Testing</a> focuses on testing activities. It describes how instrumentation allows
- you to control activities outside the normal application lifecycle. It also lists
- activity-specific features you should test, and it provides tips for testing Android
- user interfaces.
- </li>
- <li>
- <a href="{@docRoot}guide/topics/testing/contentprovider_testing.html">
- Content Provider Testing</a> focuses on testing content providers. It describes the
- mock system objects you can use, provides tips for designing providers so that they
- can be tested, and lists provider-specific features you should test.
- </li>
- <li>
- <a href="{@docRoot}guide/topics/testing/service_testing.html">
- Service Testing</a> focuses on testing services. It also lists service-specific features
- you should test.
- </li>
- <li>
- <a href="{@docRoot}guide/topics/testing/what_to_test.html">What to Test</a>
- is an overview of the types of testing you should do. It focuses on testing
- system-wide aspects of Android that can affect every component in your application.
- </li>
-</ul>
-<h4>Procedures</h4>
-<ul>
- <li>
- The topic <a href="{@docRoot}guide/developing/testing/testing_eclipse.html">
- Testing in Eclipse, with ADT</a> describes how to create and run tests in Eclipse with ADT.
- </li>
- <li>
- The topic <a href="{@docRoot}guide/developing/testing/testing_otheride.html">
- Testing in other IDEs</a> describes how to create and run tests with command-line tools.
- </li>
-</ul>
-<h4>Tutorials</h4>
-<ul>
- <li>
- The <a href="{@docRoot}resources/tutorials/testing/helloandroid_test.html">
- Hello, Testing</a> tutorial introduces basic testing concepts and procedures.
- </li>
- <li>
- For a more advanced tutorial, try
- <a href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity Testing</a>,
- which guides you through a more complex testing scenario.
- </li>
-</ul>
-<h4>Tools</h4>
-<ul>
- <li>
- The
- <a href="{@docRoot}guide/developing/tools/monkey.html">UI/Application Exerciser Monkey</a>,
- usually called Monkey, is a command-line tool that sends pseudo-random
- streams of keystrokes, touches, and gestures to a device.
- </li>
- <li>
- The <a href="{@docRoot}guide/developing/tools/monkeyrunner_concepts.html">monkeyrunner</a> tool
- is an API and execution environment. You use monkeyrunner with Python programs
- to test applications and devices.
- </li>
-</ul>
-<!--
-<h4>Samples</h4>
-<ul>
- <li>
- The <a href="{@docRoot}resources/samples/AlarmServiceTest.html">Alarm Service Test</a>
- is a test package for the <a href="{@docRoot}resources/samples/Alarm.html">Alarm</a>
- sample application. It provides a simple example of unit
- testing a {@link android.app.Service}.
- </li>
-</ul>
--->
diff --git a/docs/html/guide/topics/testing/service_testing.jd b/docs/html/guide/topics/testing/service_testing.jd
deleted file mode 100644
index eae8607..0000000
--- a/docs/html/guide/topics/testing/service_testing.jd
+++ /dev/null
@@ -1,180 +0,0 @@
-page.title=Service Testing
-parent.title=Testing
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li>
- <a href="#DesignAndTest">Service Design and Testing</a>
- </li>
- <li>
- <a href="#ServiceTestCase">ServiceTestCase</a>
- </li>
- <li>
- <a href="#MockObjects">Mock object classes</a>
- </li>
- <li>
- <a href="#TestAreas">What to Test</a>
- </li>
- </ol>
- <h2>Key Classes</h2>
- <ol>
- <li>{@link android.test.InstrumentationTestRunner}</li>
- <li>{@link android.test.ServiceTestCase}</li>
- <li>{@link android.test.mock.MockApplication}</li>
- <li>{@link android.test.RenamingDelegatingContext}</li>
- </ol>
- <h2>Related Tutorials</h2>
- <ol>
- <li>
- <a href="{@docRoot}resources/tutorials/testing/helloandroid_test.html">
- Hello, Testing</a>
- </li>
- <li>
- <a href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity Testing</a>
- </li>
- </ol>
- <h2>See Also</h2>
- <ol>
- <li>
- <a href="{@docRoot}guide/developing/testing/testing_eclipse.html">
- Testing in Eclipse, with ADT</a>
- </li>
- <li>
- <a href="{@docRoot}guide/developing/testing/testing_otheride.html">
- Testing in Other IDEs</a>
- </li>
- </ol>
- </div>
-</div>
-<p>
- Android provides a testing framework for Service objects that can run them in
- isolation and provides mock objects. The test case class for Service objects is
- {@link android.test.ServiceTestCase}. Since the Service class assumes that it is separate
- from its clients, you can test a Service object without using instrumentation.
-</p>
-<p>
- This document describes techniques for testing Service objects. If you aren't familiar with the
- Service class, please read the <a href="{@docRoot}guide/topics/fundamentals/services.html">
- Services</a> document. If you aren't familiar with Android testing, please read
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Fundamentals</a>,
- the introduction to the Android testing and instrumentation framework.
-</p>
-<h2 id="DesignAndTest">Service Design and Testing</h2>
-<p>
- When you design a Service, you should consider how your tests can examine the various states
- of the Service lifecycle. If the lifecycle methods that start up your Service, such as
- {@link android.app.Service#onCreate() onCreate()} or
- {@link android.app.Service#onStartCommand(Intent, int, int) onStartCommand()} do not normally
- set a global variable to indicate that they were successful, you may want to provide such a
- variable for testing purposes.
-</p>
-<p>
- Most other testing is facilitated by the methods in the {@link android.test.ServiceTestCase}
- test case class. For example, the {@link android.test.ServiceTestCase#getService()} method
- returns a handle to the Service under test, which you can test to confirm that the Service is
- running even at the end of your tests.
-</p>
-<h2 id="ServiceTestCase">ServiceTestCase</h2>
-<p>
- {@link android.test.ServiceTestCase} extends the JUnit {@link junit.framework.TestCase} class
- with with methods for testing application permissions and for controlling the application and
- Service under test. It also provides mock application and Context objects that isolate your
- test from the rest of the system.
-</p>
-<p>
- {@link android.test.ServiceTestCase} defers initialization of the test environment until you
- call {@link android.test.ServiceTestCase#startService(Intent) ServiceTestCase.startService()} or
- {@link android.test.ServiceTestCase#bindService(Intent) ServiceTestCase.bindService()}. This
- allows you to set up your test environment, particularly your mock objects, before the Service
- is started.
-</p>
-<p>
- Notice that the parameters to <code>ServiceTestCase.bindService()</code>are different from
- those for <code>Service.bindService()</code>. For the <code>ServiceTestCase</code> version,
- you only provide an Intent. Instead of returning a boolean,
- <code>ServiceTestCase.bindService()</code> returns an object that subclasses
- {@link android.os.IBinder}.
-</p>
-<p>
- The {@link android.test.ServiceTestCase#setUp()} method for {@link android.test.ServiceTestCase}
- is called before each test. It sets up the test fixture by making a copy of the current system
- Context before any test methods touch it. You can retrieve this Context by calling
- {@link android.test.ServiceTestCase#getSystemContext()}. If you override this method, you must
- call <code>super.setUp()</code> as the first statement in the override.
-</p>
-<p>
- The methods {@link android.test.ServiceTestCase#setApplication(Application) setApplication()}
- and {@link android.test.AndroidTestCase#setContext(Context)} setContext()} allow you to set
- a mock Context or mock Application (or both) for the Service, before you start it. These mock
- objects are described in <a href="#MockObjects">Mock object classes</a>.
-</p>
-<p>
- By default, {@link android.test.ServiceTestCase} runs the test method
- {@link android.test.AndroidTestCase#testAndroidTestCaseSetupProperly()}, which asserts that
- the base test case class successfully set up a Context before running.
-</p>
-<h2 id="MockObjects">Mock object classes</h2>
-<p>
- <code>ServiceTestCase</code> assumes that you will use a mock Context or mock Application
- (or both) for the test environment. These objects isolate the test environment from the
- rest of the system. If you don't provide your own instances of these objects before you
- start the Service, then {@link android.test.ServiceTestCase} will create its own internal
- instances and inject them into the Service. You can override this behavior by creating and
- injecting your own instances before starting the Service
-</p>
-<p>
- To inject a mock Application object into the Service under test, first create a subclass of
- {@link android.test.mock.MockApplication}. <code>MockApplication</code> is a subclass of
- {@link android.app.Application} in which all the methods throw an Exception, so to use it
- effectively you subclass it and override the methods you need. You then inject it into the
- Service with the
- {@link android.test.ServiceTestCase#setApplication(Application) setApplication()} method.
- This mock object allows you to control the application values that the Service sees, and
- isolates it from the real system. In addition, any hidden dependencies your Service has on
- its application reveal themselves as exceptions when you run the test.
-</p>
-<p>
- You inject a mock Context into the Service under test with the
- {@link android.test.AndroidTestCase#setContext(Context) setContext()} method. The mock
- Context classes you can use are described in more detail in
- <a href="{@docRoot}guide/topics/testing/testing_android.html#MockObjectClasses">
- Testing Fundamentals</a>.
-</p>
-<h2 id="TestAreas">What to Test</h2>
-<p>
- The topic <a href="{@docRoot}guide/topics/testing/what_to_test.html">What To Test</a>
- lists general considerations for testing Android components.
- Here are some specific guidelines for testing a Service:
-</p>
-<ul>
- <li>
- Ensure that the {@link android.app.Service#onCreate()} is called in response to
- {@link android.content.Context#startService(Intent) Context.startService()} or
- {@link android.content.Context#bindService(Intent,ServiceConnection,int) Context.bindService()}.
- Similarly, you should ensure that {@link android.app.Service#onDestroy()} is called in
- response to {@link android.content.Context#stopService(Intent) Context.stopService()},
- {@link android.content.Context#unbindService(ServiceConnection) Context.unbindService()},
- {@link android.app.Service#stopSelf()}, or
- {@link android.app.Service#stopSelfResult(int) stopSelfResult()}.
- </li>
- <li>
- Test that your Service correctly handles multiple calls from
- <code>Context.startService()</code>. Only the first call triggers
- <code>Service.onCreate()</code>, but all calls trigger a call to
- <code>Service.onStartCommand()</code>.
- <p>
- In addition, remember that <code>startService()</code> calls don't
- nest, so a single call to <code>Context.stopService()</code> or
- <code>Service.stopSelf()</code> (but not <code>stopSelf(int)</code>)
- will stop the Service. You should test that your Service stops at the correct point.
- </p>
- </li>
- <li>
- Test any business logic that your Service implements. Business logic includes checking for
- invalid values, financial and arithmetic calculations, and so forth.
- </li>
-</ul>
diff --git a/docs/html/guide/topics/testing/testing_android.jd b/docs/html/guide/topics/testing/testing_android.jd
deleted file mode 100755
index adbc59d..0000000
--- a/docs/html/guide/topics/testing/testing_android.jd
+++ /dev/null
@@ -1,666 +0,0 @@
-page.title=Testing Fundamentals
-parent.title=Testing
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li>
- <a href="#TestStructure">Test Structure</a>
- </li>
- <li>
- <a href="#TestProjects">Test Projects</a>
- </li>
- <li>
- <a href="#TestAPI">The Testing API</a>
- <ol>
- <li>
- <a href="#JUnit">JUnit</a>
- </li>
- <li>
- <a href="#Instrumentation">Instrumentation</a>
- </li>
- <li>
- <a href="#TestCaseClasses">Test case classes</a>
- </li>
- <li>
- <a href="#AssertionClasses">Assertion classes</a>
- </li>
- <li>
- <a href="#MockObjectClasses">Mock object classes</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#InstrumentationTestRunner">Running Tests</a>
- </li>
- <li>
- <a href="#TestResults">Seeing Test Results</a>
- </li>
- <li>
- <a href="#Monkeys">monkey and monkeyrunner</a>
- </li>
- <li>
- <a href="#PackageNames">Working With Package Names</a>
- </li>
- <li>
- <a href="#WhatToTest">What To Test</a>
- </li>
- <li>
- <a href="#NextSteps">Next Steps</a>
- </li>
- </ol>
- <h2>Key classes</h2>
- <ol>
- <li>{@link android.test.InstrumentationTestRunner}</li>
- <li>{@link android.test}</li>
- <li>{@link android.test.mock}</li>
- <li>{@link junit.framework}</li>
- </ol>
- <h2>Related tutorials</h2>
- <ol>
- <li>
- <a href="{@docRoot}resources/tutorials/testing/helloandroid_test.html">
- Hello, Testing</a>
- </li>
- <li>
- <a href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity Testing</a>
- </li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li>
- <a href="{@docRoot}guide/developing/testing/testing_eclipse.html">
- Testing in Eclipse, with ADT</a>
- </li>
- <li>
- <a href="{@docRoot}guide/developing/testing/testing_otheride.html">
- Testing in Other IDEs</a>
- </li>
- <li>
- <a href="{@docRoot}guide/developing/tools/monkeyrunner_concepts.html">
- monkeyrunner</a>
- </li>
- <li>
- <a href="{@docRoot}guide/developing/tools/monkey.html">UI/Application Exerciser Monkey</a>
- </li>
- </ol>
- </div>
-</div>
-<p>
- The Android testing framework, an integral part of the development environment,
- provides an architecture and powerful tools that help you test every aspect of your application
- at every level from unit to framework.
-</p>
-<p>
- The testing framework has these key features:
-</p>
-<ul>
- <li>
- Android test suites are based on JUnit. You can use plain JUnit to test a class that doesn't
- call the Android API, or Android's JUnit extensions to test Android components. If you're
- new to Android testing, you can start with general-purpose test case classes such as {@link
- android.test.AndroidTestCase} and then go on to use more sophisticated classes.
- </li>
- <li>
- The Android JUnit extensions provide component-specific test case classes. These classes
- provide helper methods for creating mock objects and methods that help you control the
- lifecycle of a component.
- </li>
- <li>
- Test suites are contained in test packages that are similar to main application packages, so
- you don't need to learn a new set of tools or techniques for designing and building tests.
- </li>
- <li>
- The SDK tools for building and tests are available in Eclipse with ADT, and also in
- command-line form for use with other IDES. These tools get information from the project of
- the application under test and use this information to automatically create the build files,
- manifest file, and directory structure for the test package.
- </li>
- <li>
- The SDK also provides
- <a href="{@docRoot}guide/developing/tools/monkeyrunner_concepts.html">monkeyrunner</a>, an API
- testing devices with Python programs, and <a
- href="{@docRoot}guide/developing/tools/monkey.html">UI/Application Exerciser Monkey</a>,
- a command-line tool for stress-testing UIs by sending pseudo-random events to a device.
- </li>
-</ul>
-<p>
- This document describes the fundamentals of the Android testing framework, including the
- structure of tests, the APIs that you use to develop tests, and the tools that you use to run
- tests and view results. The document assumes you have a basic knowledge of Android application
- programming and JUnit testing methodology.
-</p>
-<p>
- The following diagram summarizes the testing framework:
-</p>
-<div style="width: 70%; margin-left:auto; margin-right:auto;">
-<a href="{@docRoot}images/testing/test_framework.png">
- <img src="{@docRoot}images/testing/test_framework.png"
- alt="The Android testing framework"/>
-</a>
-</div>
-<h2 id="TestStructure">Test Structure</h2>
-<p>
- Android's build and test tools assume that test projects are organized into a standard
- structure of tests, test case classes, test packages, and test projects.
-</p>
-<p>
- Android testing is based on JUnit. In general, a JUnit test is a method whose
- statements test a part of the application under test. You organize test methods into classes
- called test cases (or test suites). Each test is an isolated test of an individual module in
- the application under test. Each class is a container for related test methods, although it
- often provides helper methods as well.
-</p>
-<p>
- In JUnit, you build one or more test source files into a class file. Similarly, in Android you
- use the SDK's build tools to build one or more test source files into class files in an
- Android test package. In JUnit, you use a test runner to execute test classes. In Android, you
- use test tools to load the test package and the application under test, and the tools then
- execute an Android-specific test runner.
-</p>
-<h2 id="TestProjects">Test Projects</h2>
-<p>
- Tests, like Android applications, are organized into projects.
-</p>
-<p>
- A test project is a directory or Eclipse project in which you create the source code, manifest
- file, and other files for a test package. The Android SDK contains tools for Eclipse with ADT
- and for the command line that create and update test projects for you. The tools create the
- directories you use for source code and resources and the manifest file for the test package.
- The command-line tools also create the Ant build files you need.
-</p>
-<p>
- You should always use Android tools to create a test project. Among other benefits,
- the tools:
-</p>
- <ul>
- <li>
- Automatically set up your test package to use
- {@link android.test.InstrumentationTestRunner} as the test case runner. You must use
- <code>InstrumentationTestRunner</code> (or a subclass) to run JUnit tests.
- </li>
- <li>
- Create an appropriate name for the test package. If the application
- under test has a package name of <code>com.mydomain.myapp</code>, then the
- Android tools set the test package name to <code>com.mydomain.myapp.test</code>. This
- helps you identify their relationship, while preventing conflicts within the system.
- </li>
- <li>
- Automatically create the proper build files, manifest file, and directory
- structure for the test project. This helps you to build the test package without
- having to modify build files and sets up the linkage between your test package and
- the application under test.
- The
- </li>
- </ul>
-<p>
- You can create a test project anywhere in your file system, but the best approach is to
- add the test project so that its root directory <code>tests/</code> is at the same level
- as the <code>src/</code> directory of the main application's project. This helps you find the
- tests associated with an application. For example, if your application project's root directory
- is <code>MyProject</code>, then you should use the following directory structure:
-</p>
-<pre class="classic no-pretty-print">
- MyProject/
- AndroidManifest.xml
- res/
- ... (resources for main application)
- src/
- ... (source code for main application) ...
- tests/
- AndroidManifest.xml
- res/
- ... (resources for tests)
- src/
- ... (source code for tests)
-</pre>
-<h2 id="TestAPI">The Testing API</h2>
-<p>
- The Android testing API is based on the JUnit API and extended with a instrumentation
- framework and Android-specific testing classes.
-</p>
-<h3 id="JUnit">JUnit</h3>
-<p>
- You can use the JUnit {@link junit.framework.TestCase TestCase} class to do unit testing on
- a plain Java object. <code>TestCase</code> is also the base class for
- {@link android.test.AndroidTestCase}, which you can use to test Android-dependent objects.
- Besides providing the JUnit framework, AndroidTestCase offers Android-specific setup,
- teardown, and helper methods.
-</p>
-<p>
- You use the JUnit {@link junit.framework.Assert} class to display test results.
- The assert methods compare values you expect from a test to the actual results and
- throw an exception if the comparison fails. Android also provides a class of assertions that
- extend the possible types of comparisons, and another class of assertions for testing the UI.
- These are described in more detail in the section <a href="#AssertionClasses">
- Assertion classes</a>
-</p>
-<p>
- To learn more about JUnit, you can read the documentation on the
- <a href="http://www.junit.org">junit.org</a> home page.
- Note that the Android testing API supports JUnit 3 code style, but not JUnit 4. Also, you must
- use Android's instrumented test runner {@link android.test.InstrumentationTestRunner} to run
- your test case classes. This test runner is described in the
- section <a href="#InstrumentationTestRunner">Running Tests</a>.
-</p>
-<h3 id="Instrumentation">Instrumentation</h3>
-<p>
- Android instrumentation is a set of control methods or "hooks" in the Android system. These hooks
- control an Android component independently of its normal lifecycle. They also control how
- Android loads applications.
-</p>
-<p>
- Normally, an Android component runs in a lifecycle determined by the system. For example, an
- Activity object's lifecycle starts when the Activity is activated by an Intent. The object's
- <code>onCreate()</code> method is called, followed by <code>onResume()</code>. When the user
- starts another application, the <code>onPause()</code> method is called. If the Activity
- code calls the <code>finish()</code> method, the <code>onDestroy()</code> method is called.
- The Android framework API does not provide a way for your code to invoke these callback
- methods directly, but you can do so using instrumentation.
-</p>
-<p>
- Also, the system runs all the components of an application into the same
- process. You can allow some components, such as content providers, to run in a separate process,
- but you can't force an application to run in the same process as another application that is
- already running.
-</p>
-<p>
- With Android instrumentation, though, you can invoke callback methods in your test code.
- This allows you to run through the lifecycle of a component step by step, as if you were
- debugging the component. The following test code snippet demonstrates how to use this to
- test that an Activity saves and restores its state:
-</p>
-<a name="ActivitySnippet"></a>
-<pre>
- // Start the main activity of the application under test
- mActivity = getActivity();
-
- // Get a handle to the Activity object's main UI widget, a Spinner
- mSpinner = (Spinner)mActivity.findViewById(com.android.example.spinner.R.id.Spinner01);
-
- // Set the Spinner to a known position
- mActivity.setSpinnerPosition(TEST_STATE_DESTROY_POSITION);
-
- // Stop the activity - The onDestroy() method should save the state of the Spinner
- mActivity.finish();
-
- // Re-start the Activity - the onResume() method should restore the state of the Spinner
- mActivity = getActivity();
-
- // Get the Spinner's current position
- int currentPosition = mActivity.getSpinnerPosition();
-
- // Assert that the current position is the same as the starting position
- assertEquals(TEST_STATE_DESTROY_POSITION, currentPosition);
-</pre>
-<p>
- The key method used here is
- {@link android.test.ActivityInstrumentationTestCase2#getActivity()}, which is a
- part of the instrumentation API. The Activity under test is not started until you call this
- method. You can set up the test fixture in advance, and then call this method to start the
- Activity.
-</p>
-<p>
- Also, instrumentation can load both a test package and the application under test into the
- same process. Since the application components and their tests are in the same process, the
- tests can invoke methods in the components, and modify and examine fields in the components.
-</p>
-<h3 id="TestCaseClasses">Test case classes</h3>
-<p>
- Android provides several test case classes that extend {@link junit.framework.TestCase} and
- {@link junit.framework.Assert} with Android-specific setup, teardown, and helper methods.
-</p>
-<h4 id="AndroidTestCase">AndroidTestCase</h4>
-<p>
- A useful general test case class, especially if you are
- just starting out with Android testing, is {@link android.test.AndroidTestCase}. It extends
- both {@link junit.framework.TestCase} and {@link junit.framework.Assert}. It provides the
- JUnit-standard <code>setUp()</code> and <code>tearDown()</code> methods, as well as
- all of JUnit's Assert methods. In addition, it provides methods for testing permissions, and a
- method that guards against memory leaks by clearing out certain class references.
-</p>
-<h4 id="ComponentTestCase">Component-specific test cases</h4>
-<p>
- A key feature of the Android testing framework is its component-specific test case classes.
- These address specific component testing needs with methods for fixture setup and
- teardown and component lifecycle control. They also provide methods for setting up mock objects.
- These classes are described in the component-specific testing topics:
-</p>
-<ul>
- <li>
- <a href="{@docRoot}guide/topics/testing/activity_testing.html">Activity Testing</a>
- </li>
- <li>
- <a href="{@docRoot}guide/topics/testing/contentprovider_testing.html">
- Content Provider Testing</a>
- </li>
- <li>
- <a href="{@docRoot}guide/topics/testing/service_testing.html">Service Testing</a>
- </li>
-</ul>
-<p>
- Android does not provide a separate test case class for BroadcastReceiver. Instead, test a
- BroadcastReceiver by testing the component that sends it Intent objects, to verify that the
- BroadcastReceiver responds correctly.
-</p>
-<h4 id="ApplicationTestCase">ApplicationTestCase</h4>
-<p>
- You use the {@link android.test.ApplicationTestCase} test case class to test the setup and
- teardown of {@link android.app.Application} objects. These objects maintain the global state of
- information that applies to all the components in an application package. The test case can
- be useful in verifying that the <application> element in the manifest file is correctly
- set up. Note, however, that this test case does not allow you to control testing of the
- components within your application package.
-</p>
-<h4 id="InstrumentationTestCase">InstrumentationTestCase</h4>
-<p>
- If you want to use instrumentation methods in a test case class, you must use
- {@link android.test.InstrumentationTestCase} or one of its subclasses. The
- {@link android.app.Activity} test cases extend this base class with other functionality that
- assists in Activity testing.
-</p>
-
-<h3 id="AssertionClasses">Assertion classes</h3>
-<p>
- Because Android test case classes extend JUnit, you can use assertion methods to display the
- results of tests. An assertion method compares an actual value returned by a test to an
- expected value, and throws an AssertionException if the comparison test fails. Using assertions
- is more convenient than doing logging, and provides better test performance.
-</p>
-<p>
- Besides the JUnit {@link junit.framework.Assert} class methods, the testing API also provides
- the {@link android.test.MoreAsserts} and {@link android.test.ViewAsserts} classes:
-</p>
-<ul>
- <li>
- {@link android.test.MoreAsserts} contains more powerful assertions such as
- {@link android.test.MoreAsserts#assertContainsRegex}, which does regular expression
- matching.
- </li>
- <li>
- {@link android.test.ViewAsserts} contains useful assertions about Views. For example
- it contains {@link android.test.ViewAsserts#assertHasScreenCoordinates} that tests if a View
- has a particular X and Y position on the visible screen. These asserts simplify testing of
- geometry and alignment in the UI.
- </li>
-</ul>
-<h3 id="MockObjectClasses">Mock object classes</h3>
-<p>
- To facilitate dependency injection in testing, Android provides classes that create mock system
- objects such as {@link android.content.Context} objects,
- {@link android.content.ContentProvider} objects, {@link android.content.ContentResolver}
- objects, and {@link android.app.Service} objects. Some test cases also provide mock
- {@link android.content.Intent} objects. You use these mocks both to isolate tests
- from the rest of the system and to facilitate dependency injection for testing. These classes
- are found in the Java packages {@link android.test} and {@link android.test.mock}.
-</p>
-<p>
- Mock objects isolate tests from a running system by stubbing out or overriding
- normal operations. For example, a {@link android.test.mock.MockContentResolver}
- replaces the normal resolver framework with its own local framework, which is isolated
- from the rest of the system. MockContentResolver also stubs out the
- {@link android.content.ContentResolver#notifyChange(Uri, ContentObserver, boolean)} method
- so that observer objects outside the test environment are not accidentally triggered.
-</p>
-<p>
- Mock object classes also facilitate dependency injection by providing a subclass of the
- normal object that is non-functional except for overrides you define. For example, the
- {@link android.test.mock.MockResources} object provides a subclass of
- {@link android.content.res.Resources} in which all the methods throw Exceptions when called.
- To use it, you override only those methods that must provide information.
-</p>
-<p>
- These are the mock object classes available in Android:
-</p>
-<h4 id="SimpleMocks">Simple mock object classes</h4>
-<p>
- {@link android.test.mock.MockApplication}, {@link android.test.mock.MockContext},
- {@link android.test.mock.MockContentProvider}, {@link android.test.mock.MockCursor},
- {@link android.test.mock.MockDialogInterface}, {@link android.test.mock.MockPackageManager}, and
- {@link android.test.mock.MockResources} provide a simple and useful mock strategy. They are
- stubbed-out versions of the corresponding system object class, and all of their methods throw an
- {@link java.lang.UnsupportedOperationException} exception if called. To use them, you override
- the methods you need in order to provide mock dependencies.
-</p>
-<p class="Note"><strong>Note:</strong>
- {@link android.test.mock.MockContentProvider}
- and {@link android.test.mock.MockCursor} are new as of API level 8.
-</p>
-<h4 id="ResolverMocks">Resolver mock objects</h4>
-<p>
- {@link android.test.mock.MockContentResolver} provides isolated testing of content providers by
- masking out the normal system resolver framework. Instead of looking in the system to find a
- content provider given an authority string, MockContentResolver uses its own internal table. You
- must explicitly add providers to this table using
- {@link android.test.mock.MockContentResolver#addProvider(String,ContentProvider)}.
-</p>
-<p>
- With this feature, you can associate a mock content provider with an authority. You can create
- an instance of a real provider but use test data in it. You can even set the provider for an
- authority to <code>null</code>. In effect, a MockContentResolver object isolates your test
- from providers that contain real data. You can control the
- function of the provider, and you can prevent your test from affecting real data.
-</p>
-<h3 id="ContextMocks">Contexts for testing</h3>
-<p>
- Android provides two Context classes that are useful for testing:
-</p>
-<ul>
- <li>
- {@link android.test.IsolatedContext} provides an isolated {@link android.content.Context},
- File, directory, and database operations that use this Context take place in a test area.
- Though its functionality is limited, this Context has enough stub code to respond to
- system calls.
- <p>
- This class allows you to test an application's data operations without affecting real
- data that may be present on the device.
- </p>
- </li>
- <li>
- {@link android.test.RenamingDelegatingContext} provides a Context in which
- most functions are handled by an existing {@link android.content.Context}, but
- file and database operations are handled by a {@link android.test.IsolatedContext}.
- The isolated part uses a test directory and creates special file and directory names.
- You can control the naming yourself, or let the constructor determine it automatically.
- <p>
- This object provides a quick way to set up an isolated area for data operations,
- while keeping normal functionality for all other Context operations.
- </p>
- </li>
-</ul>
-<h2 id="InstrumentationTestRunner">Running Tests</h2>
-<p>
- Test cases are run by a test runner class that loads the test case class, set ups,
- runs, and tears down each test. An Android test runner must also be instrumented, so that
- the system utility for starting applications can control how the test package
- loads test cases and the application under test. You tell the Android platform
- which instrumented test runner to use by setting a value in the test package's manifest file.
-</p>
-<p>
- {@link android.test.InstrumentationTestRunner} is the primary Android test runner class. It
- extends the JUnit test runner framework and is also instrumented. It can run any of the test
- case classes provided by Android and supports all possible types of testing.
-</p>
-<p>
- You specify <code>InstrumentationTestRunner</code> or a subclass in your test package's
- manifest file, in the <a href="{@docRoot}guide/topics/manifest/instrumentation-element.html">
- instrumentation</a> element. Also, <code>InstrumentationTestRunner</code> code resides
- in the shared library <code>android.test.runner</code>, which is not normally linked to
- Android code. To include it, you must specify it in a
- <a href="{@docRoot}guide/topics/manifest/uses-library-element.html">uses-library</a> element.
- You do not have to set up these elements yourself. Both Eclipse with ADT and the
- <code>android</code> command-line tool construct them automatically and add them to your
- test package's manifest file.
-</p>
-<p class="Note">
- <strong>Note:</strong> If you use a test runner other than
- <code>InstrumentationTestRunner</code>, you must change the <instrumentation>
- element to point to the class you want to use.
-</p>
-<p>
- To run {@link android.test.InstrumentationTestRunner}, you use internal system classes called by
- Android tools. When you run a test in Eclipse with ADT, the classes are called automatically.
- When you run a test from the command line, you run these classes with
- <a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge (adb)</a>.
-</p>
-<p>
- The system classes load and start the test package, kill any processes that
- are running an instance of the application under test, and then load a new instance of the
- application under test. They then pass control to
- {@link android.test.InstrumentationTestRunner}, which runs
- each test case class in the test package. You can also control which test cases and
- methods are run using settings in Eclipse with ADT, or using flags with the command-line tools.
-</p>
-<p>
- Neither the system classes nor {@link android.test.InstrumentationTestRunner} run
- the application under test. Instead, the test case does this directly. It either calls methods
- in the application under test, or it calls its own methods that trigger lifecycle events in
- the application under test. The application is under the complete control of the test case,
- which allows it to set up the test environment (the test fixture) before running a test. This
- is demonstrated in the previous <a href="#ActivitySnippet">code snippet</a> that tests an
- Activity that displays a Spinner widget.
-</p>
-<p>
- To learn more about running tests, please read the topics
- <a href="{@docRoot}guide/developing/testing/testing_eclipse.html"">
- Testing in Eclipse, with ADT</a> or
- <a href="{@docRoot}guide/developing/testing/testing_otheride.html">
- Testing in Other IDes</a>.
-</p>
-<h2 id="TestResults">Seeing Test Results</h2>
-<p>
- The Android testing framework returns test results back to the tool that started the test.
- If you run a test in Eclipse with ADT, the results are displayed in a new JUnit view pane. If
- you run a test from the command line, the results are displayed in <code>STDOUT</code>. In
- both cases, you see a test summary that displays the name of each test case and method that
- was run. You also see all the assertion failures that occurred. These include pointers to the
- line in the test code where the failure occurred. Assertion failures also list the expected
- value and actual value.
-</p>
-<p>
- The test results have a format that is specific to the IDE that you are using. The test
- results format for Eclipse with ADT is described in
- <a href="{@docRoot}guide/developing/testing/testing_eclipse.html#RunTestEclipse">
- Testing in Eclipse, with ADT</a>. The test results format for tests run from the
- command line is described in
- <a href="{@docRoot}guide/developing/testing/testing_otheride.html#RunTestsCommand">
- Testing in Other IDEs</a>.
-</p>
-<h2 id="Monkeys">monkey and monkeyrunner</h2>
-<p>
- The SDK provides two tools for functional-level application testing:
-</p>
- <ul>
- <li>
-The <a href="{@docRoot}guide/developing/tools/monkey.html">UI/Application Exerciser Monkey</a>,
- usually called "monkey", is a command-line tool that sends pseudo-random streams of
- keystrokes, touches, and gestures to a device. You run it with the
- <a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a> (adb) tool.
- You use it to stress-test your application and report back errors that are encountered.
- You can repeat a stream of events by running the tool each time with the same random
- number seed.
- </li>
- <li>
- The <a href="{@docRoot}guide/developing/tools/monkeyrunner_concepts.html">monkeyrunner</a> tool
- is an API and execution environment for test programs written in Python. The API
- includes functions for connecting to a device, installing and uninstalling packages,
- taking screenshots, comparing two images, and running a test package against an
- application. Using the API, you can write a wide range of large, powerful, and complex
- tests. You run programs that use the API with the <code>monkeyrunner</code> command-line
- tool.
- </li>
- </ul>
-<h2 id="PackageNames">Working With Package names</h2>
-<p>
- In the test environment, you work with both Android application package names and
- Java package identifiers. Both use the same naming format, but they represent substantially
- different entities. You need to know the difference to set up your tests correctly.
-</p>
-<p>
- An Android package name is a unique system name for a <code>.apk</code> file, set by the
- "android:package" attribute of the <manifest> element in the package's
- manifest. The Android package name of your test package must be different from the
- Android package name of the application under test. By default, Android tools create the
- test package name by appending ".test" to the package name of the application under test.
-</p>
-<p>
- The test package also uses an Android package name to target the application package it
- tests. This is set in the "android:targetPackage" attribute of the
- <instrumentation> element in the test package's manifest.
-</p>
-<p>
- A Java package identifier applies to a source file. This package name reflects the directory
- path of the source file. It also affects the visibility of classes and members to each other.
-</p>
-<p>
- Android tools that create test projects set up an Android test package name for you.
- From your input, the tools set up the test package name and the target package name for the
- application under test. For these tools to work, the application project must already exist.
-</p>
-<p>
- By default, these tools set the Java package identifier for the test class to be the same
- as the Android package identifier. You may want to change this if you want to expose
- members in the application under test by giving them package visibility. If you do this,
- change only the Java package identifier, not the Android package names, and change only the
- test case source files. Do not change the Java package name of the generated
- <code>R.java</code> class in your test package, because it will then conflict with the
- <code>R.java</code> class in the application under test. Do not change the Android package name
- of your test package to be the same as the application it tests, because then their names
- will no longer be unique in the system.
-</p>
-<h2 id="WhatToTest">What to Test</h2>
-<p>
- The topic <a href="{@docRoot}guide/topics/testing/what_to_test.html">What To Test</a>
- describes the key functionality you should test in an Android application, and the key
- situations that might affect that functionality.
-</p>
-<p>
- Most unit testing is specific to the Android component you are testing.
- The topics <a href="{@docRoot}guide/topics/testing/activity_testing.html">Activity Testing</a>,
- <a href="{@docRoot}guide/topics/testing/contentprovider_testing.html">
- Content Provider Testing</a>, and <a href="{@docRoot}guide/topics/testing/service_testing.html">
- Service Testing</a> each have a section entitled "What To Test" that lists possible testing
- areas.
-</p>
-<p>
- When possible, you should run these tests on an actual device. If this is not possible, you can
- use the <a href="{@docRoot}guide/developing/devices/emulator.html">Android Emulator</a> with
- Android Virtual Devices configured for the hardware, screens, and versions you want to test.
-</p>
-<h2 id="NextSteps">Next Steps</h2>
-<p>
- To learn how to set up and run tests in Eclipse, please refer to <a
- href="{@docRoot}guide/developing/testing/testing_eclipse.html">Testing in
- Eclipse, with ADT</a>. If you're not working in Eclipse, refer to <a
- href="{@docRoot}guide/developing/testing/testing_otheride.html">Testing in Other
- IDEs</a>.
-</p>
-<p>
- If you want a step-by-step introduction to Android testing, try one of the
- testing tutorials or sample test packages:
-</p>
-<ul>
- <li>
- The <a
- href="{@docRoot}resources/tutorials/testing/helloandroid_test.html">Hello,
- Testing</a> tutorial introduces basic testing concepts and procedures in the
- context of the Hello, World application.
- </li>
- <li>
- The <a href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity
- Testing</a> tutorial is an excellent follow-up to the Hello, Testing tutorial.
- It guides you through a more complex testing scenario that you develop against a
- more realistic application.
- </li>
- <!-- sample is not available
- <li>
- The sample test package <a href="{@docRoot}resources/samples/AlarmServiceTest/index.html">
- Alarm Service Test</a> is an example of testing a {@link android.app.Service}. It contains
- a set of unit tests for the Alarm Service sample application's {@link android.app.Service}.
- </li>
- -->
-</ul>
-
diff --git a/docs/html/guide/topics/testing/what_to_test.jd b/docs/html/guide/topics/testing/what_to_test.jd
deleted file mode 100644
index 99061df..0000000
--- a/docs/html/guide/topics/testing/what_to_test.jd
+++ /dev/null
@@ -1,86 +0,0 @@
-page.title=What To Test
-parent.title=Testing
-parent.link=index.html
-@jd:body
-<p>
- As you develop Android applications, knowing what to test is as important as knowing how to
- test. This document lists some most common Android-related situations that you should consider
- when you test, even at the unit test level. This is not an exhaustive list, and you consult the
- documentation for the features that you use for more ideas. The
- <a href="http://groups.google.com/group/android-developers">android-developers</a> Google Groups
- site is another resource for information about testing.
-</p>
-<h2 id="Tests">Ideas for Testing</h2>
-<p>
- The following sections are organized by behaviors or situations that you should test. Each
- section contains a scenario that further illustrates the situation and the test or tests you
- should do.
-</p>
-<h4>Change in orientation</h4>
-<p>
- For devices that support multiple orientations, Android detects a change in orientation when
- the user turns the device so that the display is "landscape" (long edge is horizontal) instead
- of "portrait" (long edge is vertical).
-</p>
-<p>
- When Android detects a change in orientation, its default behavior is to destroy and then
- re-start the foreground Activity. You should consider testing the following:
-</p>
-<ul>
- <li>
- Is the screen re-drawn correctly? Any custom UI code you have should handle changes in the
- orientation.
- </li>
- <li>
- Does the application maintain its state? The Activity should not lose anything that the
- user has already entered into the UI. The application should not "forget" its place in the
- current transaction.
- </li>
-</ul>
-<h4>Change in configuration</h4>
-<p>
- A situation that is more general than a change in orientation is a change in the device's
- configuration, such as a change in the availability of a keyboard or a change in system
- language.
-</p>
-<p>
- A change in configuration also triggers the default behavior of destroying and then restarting
- the foreground Activity. Besides testing that the application maintains the UI and its
- transaction state, you should also test that the application updates itself to respond
- correctly to the new configuration.
-</p>
-<h4>Battery life</h4>
-<p>
- Mobile devices primarily run on battery power. A device has finite "battery budget", and when it
- is gone, the device is useless until it is recharged. You need to write your application to
- minimize battery usage, you need to test its battery performance, and you need to test the
- methods that manage battery usage.
-</p>
-<p>
- Techniques for minimizing battery usage were presented at the 2010 Google I/O conference in the
- presentation
- <a href="http://code.google.com/events/io/2009/sessions/CodingLifeBatteryLife.html">
- Coding for Life -- Battery Life, That Is</a>. This presentation describes the impact on battery
- life of various operations, and the ways you can design your application to minimize these
- impacts. When you code your application to reduce battery usage, you also write the
- appropriate unit tests.
-</p>
-<h4>Dependence on external resources</h4>
-<p>
- If your application depends on network access, SMS, Bluetooth, or GPS, then you should
- test what happens when the resource or resources are not available.
-</p>
-<p>
- For example, if your application uses the network,it can notify the user if access is
- unavailable, or disable network-related features, or do both. For GPS, it can switch to
- IP-based location awareness. It can also wait for WiFi access before doing large data transfers,
- since WiFi transfers maximize battery usage compared to transfers over 3G or EDGE.
-</p>
-<p>
- You can use the emulator to test network access and bandwidth. To learn more, please see
- <a href="{@docRoot}guide/developing/tools/emulator.html#netspeed">Network Speed Emulation</a>.
- To test GPS, you can use the emulator console and {@link android.location.LocationManager}. To
- learn more about the emulator console, please see
- <a href="{@docRoot}guide/developing/tools/emulator.html#console">
- Using the Emulator Console</a>.
-</p>
diff --git a/docs/html/guide/topics/clipboard/copy-paste.jd b/docs/html/guide/topics/text/copy-paste.jd
similarity index 100%
rename from docs/html/guide/topics/clipboard/copy-paste.jd
rename to docs/html/guide/topics/text/copy-paste.jd
diff --git a/docs/html/guide/topics/text/creating-input-method.jd b/docs/html/guide/topics/text/creating-input-method.jd
new file mode 100644
index 0000000..e49610f
--- /dev/null
+++ b/docs/html/guide/topics/text/creating-input-method.jd
@@ -0,0 +1,528 @@
+page.title=Creating an Input Method
+parent.title=Articles
+parent.link=../browser.html?tag=article
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>See also</h2>
+<ol>
+ <li>
+ <a href="http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html">Onscreen Input Methods</a>
+ </li>
+ <li>
+ <a href="{@docRoot}resources/samples/SoftKeyboard/index.html">Soft Keyboard sample</a>
+ </li>
+</ol>
+</div>
+</div>
+<p>
+ An input method editor (IME) is a user control that enables users to enter text. Android
+ provides an extensible input method framework that allows applications to provide users
+ alternative input methods, such as on-screen keyboards or even speech input. Once installed,
+ users can select which IME they want to use from the system settings and use it across the
+ entire system; only one IME may be enabled at a time.
+</p>
+<p>
+ To add an IME to the Android system, you create an Android application
+ containing a class that extends {@link android.inputmethodservice.InputMethodService}. In
+ addition, you usually create a "settings" activity that passes options to the IME
+ service. You can also define a settings UI that's displayed as part of the system settings.
+</p>
+<p>This article covers the following:</p>
+<ul>
+ <li>The IME lifecycle.</li>
+ <li>Declaring IME components in the application manifest.</li>
+ <li>The IME API.</li>
+ <li>Designing an IME UI.</li>
+ <li>Sending text from an IME to an application.</li>
+ <li>Working with IME subtypes.</li>
+</ul>
+<p>
+ If you haven't worked with IMEs before, you should read the introductory article
+ <a href="http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html">Onscreen Input Methods</a> first.
+ Also, the Soft Keyboard sample app included in the SDK contains sample code that you can modify
+ to start building your own IME.
+</p>
+<h2 id="InputMethodLifecycle">The IME Lifecycle</h2>
+<p>
+ The following diagram describes the life cycle of an IME:
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_lifecycle_image.png" alt="" height="845"
+ id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> The life cycle of an IME.
+</p>
+<p>
+ The following sections describe how to implement the UI and code associated with an IME that
+ follows this lifecycle.
+</p>
+<h2 id="DefiningIME">Declaring IME Components in the Manifest</h2>
+<p>
+ In the Android system, an IME is an Android application that contains a special IME service.
+ The application's manifest file must declare the service, request the necessary permissions,
+ provide an intent filter that matches the action <code>action.view.InputMethod</code>, and
+ provide metadata that defines characteristics of the IME. In addition, to provide a settings
+ interface that allows the user to modify the behavior of the IME, you can define a "settings"
+ activity that can be launched from System Settings.
+</p>
+<p>
+ The following snippet declares IME service. It requests the permission {@link
+ android.Manifest.permission#BIND_INPUT_METHOD} to allow the service to connect the IME to
+ the system, sets up an intent filter that matches the action
+ <code>android.view.InputMethod</code>, and defines metadata for the IME:
+</p>
+<pre>
+<!-- Declares the input method service -->
+ <service android:name="FastInputIME"
+ android:label="@string/fast_input_label"
+ android:permission="android.permission.BIND_INPUT_METHOD">
+ <intent-filter>
+ <action android:name="android.view.InputMethod" />
+ </intent-filter>
+ <meta-data android:name="android.view.im" android:resource="@xml/method" />
+ </service>
+</pre>
+<p>
+ This next snippet declares the settings activity for the IME. It has an intent filter for
+ {@link android.content.Intent#ACTION_MAIN} that indicates this activity is the main entry point
+ for the IME application:</p>
+<pre>
+ <!-- Optional: an activity for controlling the IME settings -->
+ <activity android:name="FastInputIMESettings"
+ android:label="@string/fast_input_settings">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ </intent-filter>
+ </activity>
+</pre>
+<p>
+ You can also provide access to the IME's settings directly from its UI.
+</p>
+<h2 id="IMEAPI">The Input Method API</h2>
+<p>
+ Classes specific to IMEs are found in the {@link android.inputmethodservice} and {@link
+ android.view.inputmethod} packages. The {@link android.view.KeyEvent} class is important for
+ handling keyboard characters.
+</p>
+<p>
+ The central part of an IME is a service component, a class that extends
+ {@link android.inputmethodservice.InputMethodService}. In addition to implementing the
+ normal service lifecycle, this class has callbacks for providing your IME's UI, handling user
+ input, and delivering text to the field that currently has focus. By default, the
+ {@link android.inputmethodservice.InputMethodService} class provides most of the implementation
+ for managing the state and visibility of the IME and communicating with the current
+ input field.
+</p>
+<p>
+ The following classes are also important:
+</p>
+<dl>
+ <dt>{@link android.view.inputmethod.BaseInputConnection}</dt>
+ <dd>
+ Defines the communication channel from an {@link android.view.inputmethod.InputMethod}
+ back to the application that is receiving its input. You use it to read text around the
+ cursor, commit text to the text box, and send raw key events to the application.
+ Applications should extend this class rather than implementing the base interface
+ {@link android.view.inputmethod.InputConnection}.
+ </dd>
+ <dt>{@link android.inputmethodservice.KeyboardView}</dt>
+ <dd>
+ An extension of {@link android.view.View} that renders a keyboard and responds to user
+ input events. The keyboard layout is specified by an instance of
+ {@link android.inputmethodservice.Keyboard}, which you can define in an XML file.
+ </dd>
+</dl>
+<h2 id="IMEUI">Designing the Input Method UI</h2>
+<p>
+ There are two main visual elements for an IME: the <strong>input</strong> view and the
+ <strong>candidates</strong> view. You only have to implement the elements that are relevant to
+ the input method you're designing.
+</p>
+<h3 id="InputView">Input view</h3>
+<p>
+ The input view is the UI where the user inputs text, in the form of keyclicks, handwriting or
+ gestures. When the iIME is displayed for the first time, the system calls the
+ {@link android.inputmethodservice.InputMethodService#onCreateInputView()} callback. In your
+ implementation of this method, you create the layout you want to display in the IME
+ window and return the layout to the system. This snippet is an example of implementing the
+ {@link android.inputmethodservice.InputMethodService#onCreateInputView()} method:
+<pre>
+ @Override
+ public View onCreateInputView() {
+ MyKeyboardView inputView =
+ (MyKeyboardView) getLayoutInflater().inflate( R.layout.input, null);
+
+ inputView.setOnKeyboardActionListener(this); inputView.setKeyboard(mLatinKeyboard);
+
+ return mInputView;
+ }
+</pre>
+<p>
+ In this example, {@code MyKeyboardView} is an instance of a custom implementation of
+ {@link android.inputmethodservice.KeyboardView} that renders a
+ {@link android.inputmethodservice.Keyboard}. If you’re building a traditional QWERTY keyboard,
+ see the <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample
+ app for an example of how to extend the {@link android.inputmethodservice.KeyboardView} class.
+</p>
+<h3 id="CandidateView">Candidates view</h3>
+<p>
+ The candidates view is the UI where the IME displays potential word corrections or
+ suggestions for the user to select. In the IME lifecycle, the system calls
+ {@link android.inputmethodservice.InputMethodService#onCreateCandidatesView()} when it's ready
+ to display the candidate view. In your implementation of this method, return a layout that shows
+ word suggestions, or return null if you don’t want to show anything (a null response is the
+ default behavior, so you don’t have to implement this if you don’t provide suggestions).</p>
+<p>
+ For an example implementation that provides user suggestions, see the
+ <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample app.
+</p>
+<h3 id="DesignConsiderations">UI design considerations</h3>
+<p>
+ This section describes some specific UI design considerations for IMEs.
+</p>
+<h4>Handling multiple screen sizes</h4>
+<p>
+ The UI for your IME must be able to scale for different screen sizes, and it also
+ must handle both landscape and portrait orientations. In non-fullscreen IME mode, leave
+ sufficient space for the application to show the text field and any associated context, so that
+ no more than half the screen is occupied by the IME. In fullscreen IME mode this is not an
+ issue.
+</p>
+<h4>Handling different input types</h4>
+<p>
+ Android text fields allow you to set a specific input type, such as free form text, numbers,
+ URLs, email addresses, and search strings. When you implement a new IME, you need to
+ detect the input type of each field and provide the appropriate interface for it. However, you
+ don't have to set up your IME to check that the user entered text that's valid for the
+ input type; that's the responsibility of the application that owns the text field.
+</p>
+<p>
+ For example, here are screenshots of the interfaces that the Latin IME provided with the
+ Android platform provides for text and phone number inputs:
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_text_type_screenshot.png" alt=""
+ height="142" id="figure2" />
+<img src="{@docRoot}resources/articles/images/inputmethod_numeric_type_screenshot.png" alt=""
+ height="120" id="figure2a" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> Latin IME input types.
+</p>
+<p>
+ When an input field receives focus and your IME starts, the system calls
+ {@link android.inputmethodservice.InputMethodService#onStartInputView(EditorInfo, boolean)
+ onStartInputView()}, passing in an {@link android.view.inputmethod.EditorInfo} object that
+ contains details about the input type and other attributes of the text field. In this object,
+ the {@link android.view.inputmethod.EditorInfo#inputType} field contains the text field's input
+ type.
+</p>
+<p>
+ The {@link android.view.inputmethod.EditorInfo#inputType} field is an <code>int</code>
+ that contains bit patterns for various input type settings. To test it for the text field's
+ input type, mask it with the constant {@link android.text.InputType#TYPE_MASK_CLASS}, like
+ this:
+</p>
+<pre>
+inputType & InputType.TYPE_MASK_CLASS
+</pre>
+<p>
+The input type bit pattern can have one of several values, including:
+</p>
+<dl>
+ <dt>{@link android.text.InputType#TYPE_CLASS_NUMBER}</dt>
+ <dd>
+ A text field for entering numbers. As illustrated in the previous screen shot, the
+ Latin IME displays a number pad for fields of this type.
+ </dd>
+ <dt>{@link android.text.InputType#TYPE_CLASS_DATETIME}</dt>
+ <dd>
+ A text field for entering a date and time.
+ </dd>
+ <dt>{@link android.text.InputType#TYPE_CLASS_PHONE}</dt>
+ <dd>
+ A text field for entering telephone numbers.
+ </dd>
+ <dt>{@link android.text.InputType#TYPE_CLASS_TEXT}</dt>
+ <dd>
+ A text field for entering all supported characters.
+ </dd>
+</dl>
+<p>
+ These constants are described in more detail in the reference documentation for
+ {@link android.text.InputType}.
+</p>
+<p>
+ The {@link android.view.inputmethod.EditorInfo#inputType} field can contain other bits that
+ indicate a variant of the text field type, such as:
+</p>
+<dl>
+ <dt>{@link android.text.InputType#TYPE_TEXT_VARIATION_PASSWORD}</dt>
+ <dd>
+ A variant of {@link android.text.InputType#TYPE_CLASS_TEXT} for entering passwords. The
+ input method will display dingbats instead of the actual text.
+ </dd>
+ <dt>{@link android.text.InputType#TYPE_TEXT_VARIATION_URI}</dt>
+ <dd>
+ A variant of {@link android.text.InputType#TYPE_CLASS_TEXT} for entering web URLs and
+ other Uniform Resource Identifiers (URIs).
+ </dd>
+ <dt>{@link android.text.InputType#TYPE_TEXT_FLAG_AUTO_COMPLETE}</dt>
+ <dd>
+ A variant of {@link android.text.InputType#TYPE_CLASS_TEXT} for entering text that the
+ application "auto-completes" from a dictionary, search, or other facility.
+ </dd>
+</dl>
+<p>
+ Remember to mask {@link android.view.inputmethod.EditorInfo#inputType} with the appropriate
+ constant when you test for these variants. The available mask constants are listed in the
+ reference documentation for {@link android.text.InputType}.
+</p>
+<p class="caution">
+ <strong>Caution:</strong> In your own IME, make sure you handle text correctly when you send it
+ to a password field. Hide the password in your UI both in the input view and in the candidates
+ view. Also remember that you shouldn't store passwords on a device. To learn more, see the <a
+ href="{@docRoot}guide/practices/security.html">Designing for Security</a> guide.
+</p>
+<h2 id="SendText">Sending Text to the Application</h2>
+<p>
+ As the user inputs text with your IME, you can send text to the application by
+ sending individual key events or by editing the text around the cursor in the application's text
+ field. In either case, you use an instance of {@link android.view.inputmethod.InputConnection}
+ to deliver the text. To get this instance, call
+ {@link android.inputmethodservice.InputMethodService#getCurrentInputConnection
+ InputMethodService.getCurrentInputConnection()}.
+</p>
+<h3 id="EditingCursor">Editing the text around the cursor</h3>
+<p>
+ When you're handling the editing of existing text in a text field, some of the more useful
+ methods in {@link android.view.inputmethod.BaseInputConnection} are:
+</p>
+<dl>
+ <dt>
+ {@link android.view.inputmethod.BaseInputConnection#getTextBeforeCursor(int, int)
+ getTextBeforeCursor()}</dt>
+ <dd>
+ Returns a {@link java.lang.CharSequence} containing the number of requested characters
+ before the current cursor position.
+ </dd>
+ <dt>
+ {@link android.view.inputmethod.BaseInputConnection#getTextAfterCursor(int, int)
+ getTextAfterCursor()}
+ </dt>
+ <dd>
+ Returns a {@link java.lang.CharSequence} containing the number of requested characters
+ following the current cursor position.
+ </dd>
+ <dt>
+ {@link android.view.inputmethod.BaseInputConnection#deleteSurroundingText(int, int)
+ deleteSurroundingText()}
+ </dt>
+ <dd>
+ Deletes the specified number of characters before and following the current cursor
+ position.
+ </dd>
+ <dt>
+ {@link android.view.inputmethod.BaseInputConnection#commitText(CharSequence, int)
+ commitText()}
+ </dt>
+ <dd>
+ Commit a {@link java.lang.CharSequence} to the text field and set a new cursor
+ position.
+ </dd>
+</dl>
+<p>
+ For example, the following snippet shows how to replace the text "Fell" to the left of the
+ with the text "Hello!":
+</p>
+<pre>
+ InputConnection ic = getCurrentInputConnection();
+
+ ic.deleteSurroundingText(4, 0);
+
+ ic.commitText("Hello", 1);
+
+ ic.commitText("!", 1);
+</pre>
+<h3 id="ComposeThenCommit">Composing text before committing</h3>
+<p>
+ If your IME does text prediction or requires multiple steps to compose a glyph or
+ word, you can show the progress in the text field until the user commits the word, and then you
+ can replace the partial composition with the completed text. You may give special treatment to
+ the text by adding a "span" to it when you pass it to InputConnection#setComposingText().
+</p>
+<p>
+ The following snippet shows how to show progress in a text field:
+</p>
+<pre>
+ InputConnection ic = getCurrentInputConnection();
+
+ ic.setComposingText("Composi", 1);
+...
+
+ ic.setComposingText("Composin", 1);
+
+...
+
+ ic.commitText("Composing ", 1);
+</pre>
+<p>
+ The following screenshots show how this appears to the user:
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_composing_text_1.png" alt="" height="54"
+ id="figure3a" />
+<img src="{@docRoot}resources/articles/images/inputmethod_composing_text_2.png" alt="" height="53"
+ id="figure3b" />
+<img src="{@docRoot}resources/articles/images/inputmethod_composing_text_3.png" alt="" height="31"
+ id="figure3c" />
+<p class="img-caption">
+ <strong>Figure 3.</strong> Composing text before committing.
+</p>
+<h3 id="HardwareKeyEvents">Intercepting hardware key events</h3>
+<p>
+ Even though the input method window doesn't have explicit focus, it receives hardware key
+ events first and can choose to consume them or forward them along to the application. For
+ example, you may want to consume the directional keys to navigate within your UI for candidate
+ selection during composition. You may also want to trap the back key to dismiss any popups
+ originating from the input method window.</p>
+<p>
+ To intercept hardware keys, override
+ {@link android.inputmethodservice.InputMethodService#onKeyDown(int, KeyEvent) onKeyDown()}
+ and {@link android.inputmethodservice.InputMethodService#onKeyUp(int, KeyEvent) onKeyUp()}.
+ See the <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample
+ app for an example.
+</p>
+<p>
+ Remember to call the <code>super()</code> method for keys you don't want to handle yourself.
+</p>
+<h2 id="IMESubTypes">Creating an IME Subtype</h2>
+<p>
+ Subtypes allow the IME to expose multiple input modes and languages supported by an IME. A
+ subtype can represent:
+</p>
+<ul>
+ <li>A locale such as en_US or fr_FR</li>
+ <li>An input mode such as voice, keyboard, or handwriting</li>
+ <li>
+ Other input styles, forms, or properties specific to the IME, such as 10-key or qwerty
+ keyboard layouts.
+ </li>
+</ul>
+<p>
+ Basically, the mode can be any text such as "keyboard", "voice", and so forth.
+</p>
+<p>A subtype can also expose a combination of these.</p>
+<p>
+ Subtype information is used for an IME switcher dialog that's available from the notification
+ bar and also for IME settings. The information also allows the framework to bring up a
+ specific subtype of an IME directly. When you build an IME, use the subtype facility, because
+ it helps the user identify and switch between different IME languages and modes.
+</p>
+<p>
+ You define subtypes in one of the input method's XML resource files, using the
+ <code><subtype></code> element. The following snippet defines an IME with two
+ subtypes: a keyboard subtype for the US English locale, and another keyboard subtype for the
+ French language locale for France:
+</p>
+<pre>
+<input-method xmlns:android="http://schemas.android.com/apk/res/android"
+ android:settingsActivity="com.example.softkeyboard.Settings"
+ android:icon="@drawable/ime_icon"
+ <subtype android:name="@string/display_name_english_keyboard_ime"
+ android:icon="@drawable/subtype_icon_english_keyboard_ime"
+ android:imeSubtypeLanguage="en_US"
+ android:imeSubtypeMode="keyboard"
+ android:imeSubtypeExtraValue="somePrivateOption=true"
+ />
+ <subtype android:name="@string/display_name_french_keyboard_ime"
+ android:icon="@drawable/subtype_icon_french_keyboard_ime"
+ android:imeSubtypeLanguage="fr_FR"
+ android:imeSubtypeMode="keyboard"
+ android:imeSubtypeExtraValue="foobar=30,someInternalOption=false"
+ />
+ <subtype android:name="@string/display_name_german_keyboard_ime"
+ ...
+ />
+/>
+</pre>
+<p>
+ To ensure that your subtypes are labeled correctly in the UI, use %s to get a subtype label
+ that is the same as the subtype’s locale label. This is demonstrated in the next two snippets.
+ The first snippet shows part of the input method's XML file:
+</p>
+<pre>
+ <subtype
+ android:label="@string/label_subtype_generic"
+ android:imeSubtypeLocale="en_US"
+ android:icon="@drawable/icon_en_us"
+ android:imeSubtypeMode="keyboard" />
+</pre>
+<p>
+ The next snippet is part of the IME's <code>strings.xml</code> file. The string
+ resource <code>label_subtype_generic</code>, which is used by the input method UI definition to
+ set the subtype's label, is defined as:
+</p>
+<pre>
+<string name="label_subtype_generic">%s</string>
+</pre>
+<p>
+ This sets the subtype’s display name to “English (United States)” in any English language
+ locale, or to the appropriate localization in other locales.
+</p>
+<h3 id="SubtypeProcessing">Choosing IME subtypes from the notification bar</h3>
+<p>
+ The Android system manages all subtypes exposed by all IMEs. IME subtypes are
+ treated as modes of the IME they belong to. In the notification bar, a user can select an
+ available subtype for the currently-set IME, as shown in the following screenshot:
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_subtype_notification.png" alt=""
+ height="85" id="figure4" />
+<p class="img-caption">
+ <strong>Figure 4.</strong> Choosing an IME subtype from the notification bar.
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_subtype_preferences.png" alt=""
+ height="165" id="figure5" />
+<p class="img-caption">
+ <strong>Figure 5.</strong> Setting subtype preferences in System Settings.
+</p>
+<h3 id="SubtypeSettings">Choosing IME subtypes from System Settings</h3>
+<p>
+ A user can control how subtypes are used in the “Language & input” settings panel in the
+ System Settings area. In the Soft Keyboard sample, the file
+ <code>InputMethodSettingsFragment.java</code> contains an implementation that
+ facilitates a subtype enabler in the IME settings. Please refer to the SoftKeyboard sample in
+ the Android SDK for more information about how to support Input Method Subtypes in your IME.
+</p>
+<img src="{@docRoot}resources/articles/images/inputmethod_subtype_settings.png" alt=""
+ height="210" id="figure6" />
+<p class="img-caption">
+ <strong>Figure 6.</strong> Choosing a language for the IME.
+</p>
+<h2 id="GeneralDesign">General IME Considerations</h2>
+<p>
+ Here are some other things to consider as you're implementing your IME:
+</p>
+<ul>
+<li>
+ Provide a way for users to set options directly from the IME's UI.
+</li>
+<li>
+ Because multiple IMEs may be installed on the device, provide a way for the user to switch to a
+ different IME directly from the input method UI.
+</li>
+<li>
+ Bring up the IME's UI quickly. Preload or load on demand any large resources so that users
+ see the IME as soon as they tap on a text field. Cache resources and views for subsequent
+ invocations of the input method.
+</li>
+<li>
+ Conversely, you should release large memory allocations soon after the input method window is
+ hidden, so that applications can have sufficient memory to run. Consider using a delayed message
+ to release resources if the IME is in a hidden state for a few seconds.
+</li>
+<li>
+ Make sure that users can enter as many characters as possible for the language or locale
+ associated with the IME. Remember that users may use punctuation in passwords or user
+ names, so your IME has to provide many different characters to allow users to enter a
+ password and get access to the device.
+</li>
+</ul>
diff --git a/docs/html/guide/topics/text/index.jd b/docs/html/guide/topics/text/index.jd
new file mode 100644
index 0000000..3865f25
--- /dev/null
+++ b/docs/html/guide/topics/text/index.jd
@@ -0,0 +1,40 @@
+page.title=Text and Input
+page.landing=true
+page.landing.intro=Use text services to add conventient features such as copy/paste and spell checking to your app. You can also develop your own text services to offer custom IMEs, dictionaries, and spelling checkers that you can distribute to users as applications.
+page.landing.image=
+
+@jd:body
+
+<div class="landing-docs">
+
+ <div class="col-12">
+ <h3>Blog Articles</h3>
+
+ <a href="http://android-developers.blogspot.com/2011/12/add-voice-typing-to-your-ime.html">
+ <h4>Add Voice Typing To Your IME</h4>
+ <p>A new feature available in Android 4.0 is voice typing: the difference for users is that
+the recognition results appear in the text box while they are still speaking. If you are an IME
+developer, you can easily integrate with voice typing.</p>
+ </a>
+
+ <a href="http://android-developers.blogspot.com/2010/03/speech-input-api-for-android.html">
+ <h4>Speech Input API for Android</h4>
+ <p>We believe speech can fundamentally change the mobile experience. We would like to invite
+every Android application developer to consider integrating speech input capabilities via the
+Android SDK.</p>
+ </a>
+
+ <a href="http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html">
+ <h4>Making Sense of Multitouch</h4>
+ <p>The word "multitouch" gets thrown around quite a bit and it’s not always clear what people
+are referring to. For some it’s about hardware capability, for others it refers to specific gesture
+support in software. Whatever you decide to call it, today we’re going to look at how to make your
+apps and views behave nicely with multiple fingers on the screen.</p>
+ </a>
+ </div>
+
+ <div class="col-6">
+
+ </div>
+
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/topics/text/spell-checker-framework.jd b/docs/html/guide/topics/text/spell-checker-framework.jd
new file mode 100644
index 0000000..05b6890
--- /dev/null
+++ b/docs/html/guide/topics/text/spell-checker-framework.jd
@@ -0,0 +1,236 @@
+page.title=Spelling Checker Framework
+parent.title=Articles
+parent.link=../browser.html?tag=article
+@jd:body
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In This Document</h2>
+<ol>
+ <li>
+ <a href="#SpellCheckLifeCycle">Spell Check Lifecycle</a>
+ </li>
+ <li>
+ <a href="#SpellCheckImplementation">Implementing a Spell Checker Service</a>
+ </li>
+ <li>
+ <a href="#SpellCheckClient">Implementing a Spell Checker Client</a>
+ </li>
+</ol>
+ <h2>See also</h2>
+ <ol>
+ <li>
+ <a href="{@docRoot}resources/samples/SpellChecker/SampleSpellCheckerService/index.html">
+ Spell Checker Service</a> sample app
+ </li>
+ <li>
+ <a href="{@docRoot}resources/samples/SpellChecker/HelloSpellChecker/index.html">
+ Spell Checker Client</a> sample app
+ </li>
+ </ol>
+</div>
+</div>
+
+<p>
+ The Android platform offers a spelling checker framework that lets you implement
+ and access spell checking in your application. The framework is one of the
+ Text Service APIs offered by the Android platform.
+</p>
+<p>
+ To use the framework in your app, you create a special type of Android service that
+ generates a spelling checker <strong>session</strong> object. Based on text you provide,
+ the session object returns spelling suggestions generated by the spelling checker.
+</p>
+<h2 id="SpellCheckLifeCycle">Spell Checker Lifecycle</h2>
+<p>
+ The following diagram shows the lifecycle of the spelling checker service:
+</p>
+<img src="{@docRoot}resources/articles/images/spellcheck_lifecycle.png" alt="" height="596"
+ id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> The spelling checker service lifecycle.
+</p>
+<p>
+ To initiate spell checking, your app starts its implementation of the spelling checker
+ service. Clients in your app, such as activities or individual UI elements, request a
+ spelling checker session from the service, then use the session to get suggestions for text.
+ As a client terminates its operation, it closes its spelling checker session. If necessary, your
+ app can shut down the spelling checker service at any time.
+</p>
+<h2 id="SpellCheckImplementation">Implementing a Spell Checker Service</h2>
+<p>
+ To use the spelling checker framework in your app, add a spelling checker service component including
+ the session object definition. You can also add to your app an optional activity that
+ controls settings. You must also add an XML metadata file that describes
+ the spelling checker service, and add the appropriate elements to your manifest file.
+</p>
+<h3 id="SpellCheckCode">Spell checker classes</h3>
+<p>
+ Define the service and session object with the following classes:
+</p>
+<dl>
+ <dt>
+ A subclass of {@link android.service.textservice.SpellCheckerService}
+ </dt>
+ <dd>
+ The {@link android.service.textservice.SpellCheckerService} implements both the
+ {@link android.app.Service} class and the spelling checker framework interface. Within your
+ subclass, you must implement the following method:
+ <dl>
+ <dt>{@link android.service.textservice.SpellCheckerService#createSession()}</dt>
+ <dd>
+ A factory method that returns a
+ {@link android.service.textservice.SpellCheckerService.Session} object to a
+ client that wants to do spell checking.
+ </dd>
+ </dl>
+ <p>
+ See the
+ <a href="{@docRoot}resources/samples/SpellChecker/SampleSpellCheckerService/index.html">
+ Spell Checker Service</a> sample app to learn more about implementing this class.
+ </p>
+ </dd>
+ <dt>
+ An implementation of {@link android.service.textservice.SpellCheckerService.Session}
+ </dt>
+ <dd>
+ An object that the spelling checker service provides to clients, to let them pass text to
+ the spelling checker and receive suggestions. Within this class, you must implement the
+ following methods:
+ <dl>
+ <dt>
+ {@link android.service.textservice.SpellCheckerService.Session#onCreate()}
+ </dt>
+ <dd>
+ Called by the system in response to
+ {@link android.service.textservice.SpellCheckerService#createSession()}. In this
+ method, you can initialize the
+ {@link android.service.textservice.SpellCheckerService.Session} object based on
+ the current locale and so forth.
+ </dd>
+ <dt>
+ {@link android.service.textservice.SpellCheckerService.Session#onGetSuggestions(TextInfo, int)
+ onGetSuggestions()}
+ </dt>
+ <dd>
+ Does the actual spell checking. This method returns an object containing
+ suggestions for the text passed to it.
+ </dd>
+ </dl>
+ <p>
+ Optionally, you can implement
+ {@link android.service.textservice.SpellCheckerService.Session#onCancel()}, which
+ handles requests to cancel spell checking, or
+{@link android.service.textservice.SpellCheckerService.Session#onGetSuggestionsMultiple(TextInfo[], int, boolean)
+onGetSuggestionsMultiple()}, which handles batches of suggestion requests, or both.
+ </p>
+ <p>
+ See the
+ <a href="{@docRoot}resources/samples/SpellChecker/HelloSpellChecker/index.html">
+ Spell Checker Client</a> sample app to learn more about implementing this class.
+ </p>
+ </dd>
+</dl>
+<p class="note">
+ <strong>Note:</strong> You must implement all aspects of spell checking as asynchronous and
+ thread-safe. A spelling checker may be called simultaneously by different threads running on
+ different cores. The {@link android.service.textservice.SpellCheckerService} and
+ {@link android.service.textservice.SpellCheckerService.Session} take care of this
+ automatically.
+</p>
+<h3 id="SpellCheckXML">Spell checker manifest and metadata</h3>
+<p>
+ In addition to code, you need to provide the appropriate manifest file and a metadata file for
+ the spelling checker.
+</p>
+<p>
+ The manifest file defines the application, the service, and the activity for controlling
+ settings, as shown in the following snippet:
+</p>
+<pre>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.samplespellcheckerservice" >
+ <application
+ android:label="@string/app_name" >
+ <service
+ android:label="@string/app_name"
+ android:name=".SampleSpellCheckerService"
+ android:permission="android.permission.BIND_TEXT_SERVICE" >
+ <intent-filter >
+ <action android:name="android.service.textservice.SpellCheckerService" />
+ </intent-filter>
+
+ <meta-data
+ android:name="android.view.textservice.scs"
+ android:resource="@xml/spellchecker" />
+ </service>
+
+ <activity
+ android:label="@string/sample_settings"
+ android:name="SpellCheckerSettingsActivity" >
+ <intent-filter >
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
+</pre>
+<p>
+ Notice that components that want to use the service must request the permission
+ {@link android.Manifest.permission#BIND_TEXT_SERVICE} to ensure that only the system binds to
+ the service. The service's definition also specifies the <code>spellchecker.xml</code> metadata
+ file, which is described in the next section.
+</p>
+<p>
+ The metadata file <code>spellchecker.xml</code> contains the following XML:
+</p>
+<pre>
+<spell-checker xmlns:android="http://schemas.android.com/apk/res/android"
+ android:label="@string/spellchecker_name"
+ android:settingsActivity="com.example.SpellCheckerSettingsActivity">
+ <subtype
+ android:label="@string/subtype_generic"
+ android:subtypeLocale="en”
+ />
+ <subtype
+ android:label="@string/subtype_generic"
+ android:subtypeLocale="fr”
+ />
+</spell-checker>
+</pre>
+<p>
+ The metadata specifies the activity that the spelling checker uses for controlling settings. It
+ also defines subtypes for the spelling checker; in this case, the subtypes define locales that
+ the spelling checker can handle.
+</p>
+
+
+<!-- Accessing the Spell Checker Service from a Client -->
+<h2 id="SpellCheckClient">Accessing the Spell Checker Service from a Client</h2>
+<p>
+ Applications that use {@link android.widget.TextView} views automatically benefit from spell
+ checking, because {@link android.widget.TextView} automatically uses a spelling checker. The
+ following screenshots show this:
+</p>
+<img src="{@docRoot}resources/articles/images/textview_spellcheck_screenshot_1.png" alt=""
+ height="45" id="figure2a" />
+<br>
+<img src="{@docRoot}resources/articles/images/textview_spellcheck_screenshot_2.png" alt=""
+ height="121" id="figure2b" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> Spell checking in TextView.
+</p>
+<p>
+ However, you may want to interact directly with a spelling checker service in other cases as well.
+ The following diagram shows the flow of control for interacting with a spelling checker service:
+</p>
+<img src="{@docRoot}resources/articles/images/spellcheck_client_flow.png" alt=""
+ height="394" id="figure3" />
+<p class="img-caption">
+ <strong>Figure 3.</strong> Interacting with a spelling checker service.
+</p>
+<p>
+ The <a href="{@docRoot}resources/samples/SpellChecker/HelloSpellChecker/index.html">
+ Spell Checker Client</a> sample app shows how to interact with a spelling checker service. The
+ LatinIME input method editor in the Android Open Source Project also contains an example of
+ spell checking.
+</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/ui/accessibility/apps.jd b/docs/html/guide/topics/ui/accessibility/apps.jd
index dc91638..d23512b 100644
--- a/docs/html/guide/topics/ui/accessibility/apps.jd
+++ b/docs/html/guide/topics/ui/accessibility/apps.jd
@@ -328,7 +328,7 @@
<li>If your application targets Android 4.0 (API level 14) and higher, override and implement the
accessibility methods listed above directly in your custom view class.</li>
<li>If your custom view is intended to be compatible with Android 1.6 (API Level 4) and above, add
-the Android <a href="{@docRoot}sdk/compatibility-library.html">Support Library</a>, revision 5 or
+the Android <a href="{@docRoot}tools/extras/support-library.html">Support Library</a>, revision 5 or
higher, to your project. Then, within your custom view class, call the
{@link android.support.v4.view.ViewCompat#setAccessibilityDelegate
ViewCompat.setAccessibilityDelegate()} method to implement the accessibility methods
@@ -467,7 +467,7 @@
<p>The example code below shows how override these three methods by using
{@link android.support.v4.view.ViewCompat#setAccessibilityDelegate
ViewCompat.setAccessibilityDelegate()}. Note that this sample code requires that the Android
-<a href="{@docRoot}sdk/compatibility-library.html">Support Library</a> for API Level 4 (revision 5
+<a href="{@docRoot}tools/extras/support-library.html">Support Library</a> for API Level 4 (revision 5
or higher) is added to your project.</p>
<pre>
@@ -511,7 +511,7 @@
<p>On applications targeting Android 4.0 (API Level 14) and higher, these methods can be implemented
directly in your custom view class. For another example of this approach, see the Android
-<a href="{@docRoot}sdk/compatibility-library.html">Support Library</a> (revision 5 or higher) sample
+<a href="{@docRoot}tools/extras/support-library.html">Support Library</a> (revision 5 or higher) sample
{@code AccessibilityDelegateSupportActivity} in
({@code <sdk>/extras/android/support/v4/samples/Support4Demos/}).</p>
@@ -567,7 +567,7 @@
<p>As part of your accessibility testing, you can test navigation of your application using focus,
even if your test devices does not have a directional controller. The <a
-href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a> provides a
+href="{@docRoot}tools/help/emulator.html">Android Emulator</a> provides a
simulated directional controller that you can easily use to test navigation. You can also use a
software-based directional controller, such as the one provided by the
<a href="https://play.google.com/store/apps/details?id=com.googlecode.eyesfree.inputmethod.latin">
diff --git a/docs/html/guide/topics/ui/accessibility/index.jd b/docs/html/guide/topics/ui/accessibility/index.jd
index 414d5f3..6fd71e2 100644
--- a/docs/html/guide/topics/ui/accessibility/index.jd
+++ b/docs/html/guide/topics/ui/accessibility/index.jd
@@ -47,9 +47,9 @@
<dd>Development practices and API features to ensure your application is accessible to users with
disabilities.</dd>
- <dt><strong><a href="{@docRoot}guide/topics/ui/accessibility/service.html">Building Accessibility
+ <dt><strong><a href="{@docRoot}guide/topics/ui/accessibility/services.html">Building Accessibility
Services</a></strong>
</dt>
<dd>How to use API features to build services that make other applications more accessible for
users.</dd>
-</dl>
\ No newline at end of file
+</dl>
diff --git a/docs/html/guide/topics/ui/accessibility/services.jd b/docs/html/guide/topics/ui/accessibility/services.jd
index 0dad4ec..0c1d065 100644
--- a/docs/html/guide/topics/ui/accessibility/services.jd
+++ b/docs/html/guide/topics/ui/accessibility/services.jd
@@ -50,7 +50,7 @@
Support Library was also updated with the release of Android 4.0 to provide support for these
enhanced accessibility features back to Android 1.6. Developers aiming for widely compatible
accessibility services are encouraged to use the
-<a href="{@docRoot}sdk/compatibility-library.html">Support Library</a> and develop for the more
+<a href="{@docRoot}tools/extras/support-library.html">Support Library</a> and develop for the more
advanced accessibility features introduced in Android 4.0.</p>
@@ -279,7 +279,7 @@
accessibility services that are compatible with Android 1.6 (API Level 4) and higher.</li>
<li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/accessibility/TaskBackService.html">TaskBackService</a>
- This service is based on the enhanced accessibility APIs introduced in Android 4.0 (API Level
-14). However, you can use the Android <a href="{@docRoot}sdk/compatibility-library.html">Support
+14). However, you can use the Android <a href="{@docRoot}tools/extras/support-library.html">Support
Libary</a> to substitute classes introduced in later API levels (e.g.,
{@link android.view.accessibility.AccessibilityRecord},
{@link android.view.accessibility.AccessibilityNodeInfo}
diff --git a/docs/html/guide/topics/ui/actionbar.jd b/docs/html/guide/topics/ui/actionbar.jd
index bf7369a..4842000 100644
--- a/docs/html/guide/topics/ui/actionbar.jd
+++ b/docs/html/guide/topics/ui/actionbar.jd
@@ -6,13 +6,6 @@
<div id="qv-wrapper">
<div id="qv">
- <h2>Quickview</h2>
- <ul>
- <li>A title bar that includes the application icon and activity title</li>
- <li>Provides access to menu items and navigation modes such as tabs</li>
- <li>Requires API level 11 or greater</li>
- </ul>
-
<h2>In this document</h2>
<ol>
<li><a href="#Adding">Adding the Action Bar</a>
@@ -102,7 +95,7 @@
<li>Provide consistent navigation and view refinement across different applications.
<p>The action bar provides built-in tab navigation for switching between <a
-href="{@docRoot}guide/topics/fundamentals/fragments.html">fragments</a>. It also offers a drop-down
+href="{@docRoot}guide/components/fragments.html">fragments</a>. It also offers a drop-down
list you can use as an alternative navigation mode or to refine the current view (such as to sort
a list by different criteria).</p>
</li>
@@ -120,7 +113,7 @@
</li>
</ul>
-<img src="{@docRoot}images/ui/actionbar.png" alt="" />
+<img src="{@docRoot}images/ui/actionbar.png" alt="" width="440" />
<p class="img-caption"><strong>Figure 1.</strong> Action bar from the <a
href="{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a> app (on a
landscape handset), showing the logo on the left, navigation tabs, and an action item on the
@@ -510,7 +503,7 @@
</pre>
<p>For more information about these flags and other back stack behaviors, read the <a
-href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a>
+href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a>
developer guide.</p>
<p class="note"><strong>Note:</strong> If you're using the icon to navigate to the home
@@ -955,7 +948,7 @@
<p>To switch between fragments using the tabs, you must perform a fragment
transaction each time a tab is selected. If you're not familiar with how to change fragments
using {@link android.app.FragmentTransaction}, first read the <a
-href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a> developer guide.</p>
+href="{@docRoot}guide/components/fragments.html">Fragments</a> developer guide.</p>
<p>To get started, your layout must include a {@link android.view.ViewGroup} in which you place each
{@link android.app.Fragment} associated with a tab. Be sure the {@link android.view.ViewGroup} has a
@@ -1092,7 +1085,7 @@
<p>If your activity stops, you should retain the currently selected tab with the <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#SavingActivityState">saved instance
+href="{@docRoot}guide/components/activities.html#SavingActivityState">saved instance
state</a> so you can open the appropriate tab when the user returns. When it's time to save the
state, you can query the currently selected tab with {@link
android.app.ActionBar#getSelectedNavigationIndex()}. This returns the index position of the selected
@@ -1101,7 +1094,7 @@
<p class="caution"><strong>Caution:</strong> It's important that you save the state of each fragment
as necessary, so that when users switch fragments with the tabs and then return to a previous
fragment, it looks the way it did when they left. For information about saving the state of your
-fragment, see the <a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a>
+fragment, see the <a href="{@docRoot}guide/components/fragments.html">Fragments</a>
developer guide.</p>
diff --git a/docs/html/guide/topics/ui/binding.jd b/docs/html/guide/topics/ui/binding.jd
index 26364ee..e8b49d5 100644
--- a/docs/html/guide/topics/ui/binding.jd
+++ b/docs/html/guide/topics/ui/binding.jd
@@ -1,4 +1,4 @@
-page.title=Binding to Data with AdapterView
+page.title=AdapterView
parent.title=User Interface
parent.link=index.html
@jd:body
@@ -20,32 +20,7 @@
</div>
</div>
-<p>The {@link android.widget.AdapterView} is a ViewGroup subclass whose child Views are determined by an {@link android.widget.Adapter Adapter} that
-binds to data of some type. AdapterView is useful whenever you need to display stored data (as opposed to resource strings or drawables) in your layout.</p>
-<p>{@link android.widget.Gallery Gallery}, {@link android.widget.ListView ListView}, and {@link android.widget.Spinner Spinner} are examples of AdapterView subclasses that you can use to bind to a specific type of data and display it in a certain way. </p>
-
-
-<p>AdapterView objects have two main responsibilities: </p>
-<ul>
- <li>Filling the layout with data
- </li>
- <li>Handling user selections
- </li>
-</ul>
-
-
-<h2 id="FillingTheLayout">Filling the Layout with Data</h2>
-<p>Inserting data into the layout is typically done by binding the AdapterView class to an {@link
-android.widget.Adapter}, which retrieves data from an external source (perhaps a list that
-the code supplies or query results from the device's database). </p>
-<p>The following code sample does the following:</p>
-<ol>
- <li>Creates a {@link android.widget.Spinner Spinner} with an existing View and binds it to a new ArrayAdapter
-that reads an array of colors from the local resources.</li>
- <li>Creates another Spinner object from a View and binds it to a new SimpleCursorAdapter that will read
-people's names from the device contacts (see {@link android.provider.Contacts.People}).</li>
-</ol>
<pre>
// Get a Spinner and bind it to an ArrayAdapter that
diff --git a/docs/html/guide/topics/ui/controls.jd b/docs/html/guide/topics/ui/controls.jd
new file mode 100644
index 0000000..83bb0c8
--- /dev/null
+++ b/docs/html/guide/topics/ui/controls.jd
@@ -0,0 +1,92 @@
+page.title=Input Controls
+parent.title=User Interface
+parent.link=index.html
+@jd:body
+
+<div class="figure" style="margin:0">
+ <img src="{@docRoot}images/ui/ui-controls.png" alt="" style="margin:0" />
+</div>
+
+<p>Input controls are the interactive components in your app's user interface. Android provides a
+wide variety of controls you can use in your UI, such as buttons, text fields, seek bars,
+checkboxes, zoom buttons, toggle buttons, and many more.</p>
+
+<p>Adding an input control to your UI is as simple as adding an XML element to your <a
+href="{@docRoot}guide/topics/ui/declaring-layout.html">XML layout</a>. For example, here's a
+layout with a text field and button:</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="horizontal">
+ <EditText android:id="@+id/edit_message"
+ android:layout_weight="1"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:hint="@string/edit_message" />
+ <Button android:id="@+id/button_send"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/button_send"
+ android:onClick="sendMessage" />
+</LinearLayout>
+</pre>
+
+<p>Each input control supports a specific set of input events so you can handle events such as when
+the user enters text or touches a button.</p>
+
+
+<h2 id="CommonControls">Common Controls</h2>
+<p>Here's a list of some common controls that you can use in your app. Follow the links to learn
+more about using each one.</p>
+
+<p class="note"><strong>Note:</strong> Android provides several more controls than are listed
+here. Browse the {@link android.widget} package to discover more. If your app requires a
+specific kind of input control, you can build your own <a
+href="{@docRoot}guide/topics/ui/custom-components.html">custom components</a>.</p>
+
+<table>
+ <tr>
+ <th scope="col">Control Type</th>
+ <th scope="col">Description</th>
+ <th scope="col">Related Classes</th>
+ </tr>
+ <tr>
+ <td><a href="controls/button.html">Button</a></td>
+ <td>A push-button that can be pressed, or clicked, by the user to perform an action.</td>
+ <td>{@link android.widget.Button Button} </td>
+ </tr>
+ <tr>
+ <td><a href="controls/text.html">Text field</a></td>
+ <td>An editable text field. You can use the <code>AutoCompleteTextView</code> widget to create a text entry widget that provides auto-complete suggestions</td>
+ <td>{@link android.widget.EditText EditText}, {@link android.widget.AutoCompleteTextView}</td>
+ </tr>
+ <tr>
+ <td><a href="controls/checkbox.html">Checkbox</a></td>
+ <td>An on/off switch that can be toggled by the user. You should use checkboxes when presenting users with a group of selectable options that are not mutually exclusive.</td>
+ <td>{@link android.widget.CheckBox CheckBox} </td>
+ </tr>
+ <tr>
+ <td><a href="controls/radiobutton.html">Radio button</a></td>
+ <td>Similar to checkboxes, except that only one option can be selected in the group.</td>
+ <td>{@link android.widget.RadioGroup RadioGroup}
+ <br>{@link android.widget.RadioButton RadioButton} </td>
+ </tr>
+ <tr>
+ <td><a href="controls/togglebutton.html" style="white-space:nowrap">Toggle button</a></td>
+ <td>An on/off button with a light indicator.</td>
+ <td>{@link android.widget.ToggleButton ToggleButton} </td>
+ </tr>
+ <tr>
+ <td><a href="controls/spinner.html">Spinner</a></td>
+ <td>A drop-down list that allows users to select one value from a set.</td>
+ <td>{@link android.widget.Spinner Spinner} </td>
+ </tr>
+ <tr>
+ <td><a href="controls/pickers.html">Pickers</a></td>
+ <td>A dialog for users to select a single value for a set by using up/down buttons or via a swipe gesture. Use a <code>DatePicker</code>code> widget to enter the values for the date (month, day, year) or a <code>TimePicker</code> widget to enter the values for a time (hour, minute, AM/PM), which will be formatted automatically for the user's locale.</td>
+ <td>{@link android.widget.DatePicker}, {@link android.widget.TimePicker}</td>
+ </tr>
+</table>
diff --git a/docs/html/guide/topics/ui/controls/button.jd b/docs/html/guide/topics/ui/controls/button.jd
new file mode 100644
index 0000000..8d48e9c
--- /dev/null
+++ b/docs/html/guide/topics/ui/controls/button.jd
@@ -0,0 +1,245 @@
+page.title=Buttons
+parent.title=Input Controls
+parent.link=../controls.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+<ol>
+ <li><a href="#HandlingEvents">Responding to Click Events</a>
+ <ol>
+ <li><a href="#ClickListener">Using an OnClickListener</a></li>
+ </ol>
+ </li>
+ <li><a href="#Style">Styling Your Button</a>
+ <ol>
+ <li><a href="#Borderless">Borderless button</a></li>
+ <li><a href="#CustomBackground">Custom background</a></li>
+ </ol>
+ </li>
+</ol>
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.widget.Button}</li>
+ <li>{@link android.widget.ImageButton}</li>
+ </ol>
+</div>
+</div>
+
+
+<p>A button consists of text or an icon (or both text and an icon) that communicates what action
+occurs when the user touches it.</p>
+
+<img src="{@docRoot}images/ui/button-types.png" alt="" />
+
+<p>Depending on whether you want a button with text, an icon, or both, you can create the
+button in your layout in three ways:</p>
+<ul>
+ <li>With text, using the {@link android.widget.Button} class:
+<pre>
+<Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/button_text"
+ ... />
+</pre>
+ </li>
+ <li>With an icon, using the {@link android.widget.ImageButton} class:
+<pre>
+<ImageButton
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/button_icon"
+ ... />
+</pre>
+ </li>
+ <li>With text and an icon, using the {@link android.widget.Button} class with the <a
+href="{@docRoot}reference/android/widget/TextView.html#attr_android:drawableLeft">{@code
+android:drawableLeft}</a> attribute:
+<pre>
+<Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/button_text"
+ android:drawableLeft="@drawable/button_icon"
+ ... />
+</pre>
+</li>
+</ul>
+
+<h2 id="HandlingEvents">Responding to Click Events</h2>
+
+<p>When the user clicks a button, the {@link android.widget.Button} object receives
+an on-click event.</p>
+
+<p>To define the click event handler for a button, add the {@link
+android.R.attr#onClick android:onClick} attribute to the {@code <Button>} element in your XML
+layout. The value for this attribute must be the name of the method you want to call in response
+to a click event. The {@link android.app.Activity} hosting the layout must then implement the
+corresponding method.</p>
+
+<p>For example, here's a layout with a button using {@link
+android.R.attr#onClick android:onClick}:</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<Button xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/button_send"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/button_send"
+ android:onClick="sendMessage" />
+</pre>
+
+<p>Within the {@link android.app.Activity} that hosts this layout, the following method handles
+the click event:</p>
+
+<pre>
+/** Called when the user touches the button */
+public void sendMessage(View view) {
+ // Do something in response to button click
+}
+</pre>
+
+<p>The method you declare in the {@link android.R.attr#onClick android:onClick} attribute must have
+a signature exactly as shown above. Specifically, the method must:</p>
+<ul>
+ <li>Be public</li>
+ <li>Return void</li>
+ <li>Define a {@link android.view.View} as its only parameter (this will be the {@link
+android.view.View} that was clicked)</li>
+</ul>
+
+
+<h3 id="ClickListener">Using an OnClickListener</h3>
+
+<p>You can also declare the click event handler pragmatically rather than in an XML layout. This
+might be necessary if you instantiate the {@link android.widget.Button} at runtime or you need to
+declare the click behavior in a {@link android.app.Fragment} subclass.</p>
+
+<p>To declare the event handler programmatically, create an {@link
+android.view.View.OnClickListener} object and assign it to the button by calling {@link
+android.view.View#setOnClickListener}. For example:</p>
+
+<pre>
+Button button = (Button) findViewById(R.id.button_send);
+button.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
+ // Do something in response to button click
+ }
+});
+</pre>
+
+
+<h2 id="Style">Styling Your Button</h2>
+
+<p>The appearance of your button (background image and font) may vary from one device to
+another, because devices by different manufacturers often have different default styles for
+input controls.</p>
+
+<p>You can control exactly how your controls are styled using a theme that you apply to your
+entire application. For instance, to ensure that all devices running Android 4.0 and higher use
+the Holo theme in your app, declare {@code android:theme="@android:style/Theme.Holo"} in your
+manifest's {@code <application>} element. Also read the blog post, <a
+href="http://android-developers.blogspot.com/2012/01/holo-everywhere.html">Holo Everywhere</a>
+for information about using the Holo theme while supporting older devices.</p>
+
+<p>To customize individual buttons with a different background, specify the {@link
+android.R.attr#background android:background} attribute with a drawable or color resource.
+Alternatively, you can apply a <em>style</em> for the button, which works in a manner similar to
+HTML styles to define multiple style properties such as the background, font, size, and others.
+For more information about applying styles, see <a
+href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a>.</p>
+
+
+<h3 id="Borderless">Borderless button</h3>
+
+<p>One design that can be useful is a "borderless" button. Borderless buttons resemble
+basic buttons except that they have no borders or background but still change appearance during
+different states, such as when clicked.</p>
+
+<p>To create a borderless button, apply the {@link android.R.attr#borderlessButtonStyle}
+style to the button. For example:</p>
+
+<pre>
+<Button
+ android:id="@+id/button_send"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/button_send"
+ android:onClick="sendMessage"
+ style="?android:attr/borderlessButtonStyle" />
+</pre>
+
+
+
+<h3 id="CustomBackground">Custom background</h3>
+
+<p>If you want to truly redefine the appearance of your button, you can specify a custom
+background. Instead of supplying a simple bitmap or color, however, your background should be a
+state list resource that changes appearance depending on the button's current state.</p>
+
+<p>You can define the state list in an XML file that defines three different images or colors to use
+for the different button states.</p>
+
+<p>To create a state list drawable for your button background:</p>
+
+<ol>
+ <li>Create three bitmaps for the button background that represent the default, pressed, and
+focused button states.
+ <p>To ensure that your images fit buttons of various sizes, create the bitmaps as <a
+href="{@docRoot}guide/topics/graphics/2d-graphics.html#nine-patch">Nine-patch</a> bitmaps.</p>
+ </li>
+ <li>Place the bitmaps into the <code>res/drawable/</code> directory of
+your project. Be sure each bitmap is named properly to reflect the button state that they each
+represent, such as {@code button_default.9.png}, {@code button_pressed.9.png}, and {@code
+button_focused.9.png}.</li>
+ <li>Create a new XML file in the <code>res/drawable/</code> directory (name it something like
+<code>button_custom.xml</code>). Insert the following XML:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/button_pressed"
+ android:state_pressed="true" />
+ <item android:drawable="@drawable/button_focused"
+ android:state_focused="true" />
+ <item android:drawable="@drawable/button_default" />
+</selector>
+</pre>
+ <p>This defines a single drawable resource, which will change its image based on the current
+state of the button.</p>
+<ul>
+ <li>The first <code><item></code> defines the bitmap to use when the button is
+pressed (activated).</li>
+ <li>The second <code><item></code> defines the bitmap to use when the button is
+focused (when the button is highlighted using the trackball or directional
+pad).</li>
+ <li>The third <code><item></code> defines the bitmap to use when the button is in the
+default state (it's neither pressed nor focused).</li>
+</ul>
+ <p class="note"><strong>Note:</strong> The order of the <code><item></code> elements is
+important. When this drawable is referenced, the <code><item></code> elements are traversed
+in-order to determine which one is appropriate for the current button state. Because the default
+bitmap is last, it is only applied when the conditions <code>android:state_pressed</code> and
+<code>android:state_focused</code> have both evaluated as false.</p>
+ <p>This XML file now represents a single
+drawable resource and when referenced by a {@link android.widget.Button} for its background,
+the image displayed will change based on these three states.</p>
+</li>
+ <li>Then simply apply the drawable XML file as the button background:
+<pre>
+<Button
+ android:id="@+id/button_send"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/button_send"
+ android:onClick="sendMessage"
+ android:background="@drawable/button_custom" />
+</pre>
+</ol>
+
+ <p>For more information about this XML syntax, including how to define a disabled, hovered, or
+other button states, read about <a
+href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList">State List
+Drawable</a>.</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/ui/controls/checkbox.jd b/docs/html/guide/topics/ui/controls/checkbox.jd
new file mode 100644
index 0000000..35b8f56
--- /dev/null
+++ b/docs/html/guide/topics/ui/controls/checkbox.jd
@@ -0,0 +1,101 @@
+page.title=Checkboxes
+parent.title=Input Controls
+parent.link=../controls.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+<ol>
+ <li><a href="#HandlingEvents">Responding to Click Events</a></li>
+</ol>
+
+<h2>Key classes</h2>
+<ol>
+ <li>{@link android.widget.CheckBox}</li>
+</ol>
+</div>
+</div>
+
+<p>Checkboxes allow the user to select one or more options from a set. Typically, you should
+present each checkbox option in a vertical list.</p>
+
+<img src="{@docRoot}images/ui/checkboxes.png" alt="" />
+
+<p>To create each checkbox option, create a {@link android.widget.CheckBox} in your layout. Because
+a set of checkbox options allows the user to select multiple items, each checkbox is managed
+separately and you must register a click listener for each one.</p>
+
+<h2 id="HandlingEvents">Responding to Click Events</h2>
+
+<p>When the user selects a checkbox, the {@link android.widget.CheckBox} object receives an
+on-click event.</p>
+
+<p>To define the click event handler for a checkbox, add the <code><a
+href="/reference/android/R.attr.html#onClick">android:onClick</a></code> attribute to the
+<code><CheckBox></code> element in your XML
+layout. The value for this attribute must be the name of the method you want to call in response
+to a click event. The {@link android.app.Activity} hosting the layout must then implement the
+corresponding method.</p>
+
+<p>For example, here are a couple {@link android.widget.CheckBox} objects in a list:</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <CheckBox android:id="@+id/checkbox_meat"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/meat"
+ android:onClick="onCheckboxClicked"/>
+ <CheckBox android:id="@+id/checkbox_cheese"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/cheese"
+ android:onClick="onCheckboxClicked"/>
+</LinearLayout>
+</pre>
+
+<p>Within the {@link android.app.Activity} that hosts this layout, the following method handles the
+click event for both checkboxes:</p>
+
+<pre>
+public void onCheckboxClicked(View view) {
+ // Is the view now checked?
+ boolean checked = (CheckBox) view).isChecked();
+
+ // Check which checkbox was clicked
+ switch(view.getId()) {
+ case R.id.checkbox_meat:
+ if (checked)
+ // Put some meat on the sandwich
+ else
+ // Remove the meat
+ break;
+ case R.id.checkbox_cheese:
+ if (checked)
+ // Cheese me
+ else
+ // I'm lactose intolerant
+ break;
+ // TODO: Veggie sandwich
+ }
+}
+</pre>
+
+<p>The method you declare in the {@link android.R.attr#onClick android:onClick} attribute
+must have a signature exactly as shown above. Specifically, the method must:</p>
+<ul>
+ <li>Be public</li>
+ <li>Return void</li>
+ <li>Define a {@link android.view.View} as its only parameter (this will be the {@link
+android.view.View} that was clicked)</li>
+</ul>
+
+<p class="note"><strong>Tip:</strong> If you need to change the radio button state
+yourself (such as when loading a saved {@link android.preference.CheckBoxPreference}),
+use the {@link android.widget.CompoundButton#setChecked(boolean)} or {@link
+android.widget.CompoundButton#toggle()} method.</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/ui/controls/pickers.jd b/docs/html/guide/topics/ui/controls/pickers.jd
new file mode 100644
index 0000000..cf90f1d
--- /dev/null
+++ b/docs/html/guide/topics/ui/controls/pickers.jd
@@ -0,0 +1,259 @@
+page.title= Pickers
+parent.title=Form Controls
+parent.link=controls-form.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+<ol>
+ <li><a href="#TimePicker">Creating a Time Picker</a>
+ <ol>
+ <li><a href="#TimePickerFragment">Extending DialogFragment for a time picker</a></li>
+ <li><a href="#ShowingTheTimePicker">Showing the time picker</a></li>
+ </ol>
+ </li>
+ <li><a href="#DatePicker">Creating a Date Picker</a>
+ <ol>
+ <li><a href="#DatePickerFragment">Extending DialogFragment for a date picker</a></li>
+ <li><a href="#ShowingTheDatePicker">Showing the date picker</a></li>
+ </ol>
+ </li>
+</ol>
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.app.DatePickerDialog}</li>
+ <li>{@link android.app.TimePickerDialog}</li>
+ <li>{@link android.support.v4.app.DialogFragment}</li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/components/fragments.html">Fragments</a></li>
+ </ol>
+</div>
+</div>
+
+<p>Android provides controls for the user to pick a time or pick a date as ready-to-use dialogs.
+Each picker provides controls for selecting each part of the time (hour, minute, AM/PM) or date
+(month, day, year). Using these pickers helps ensure that your users can pick a time or date that
+is valid, formatted correctly, and adjusted to the user's locale.</p>
+
+<img src="{@docRoot}images/ui/pickers.png" alt="" />
+
+<p>We recommend that you use {@link android.support.v4.app.DialogFragment} to host each time or date
+picker. The {@link android.support.v4.app.DialogFragment} manages the dialog lifecycle for you and
+allows you to display the pickers in different layout configurations,
+such as in a basic dialog on handsets or as an embedded part of the layout on large screens.</p>
+
+<p>Although {@link android.app.DialogFragment} was first added to the platform in Android 3.0 (API
+level 11), if your app supports versions of Android older than 3.0—even as low as Android
+1.6—you can use the {@link android.support.v4.app.DialogFragment} class that's available in
+the <a href="{@docRoot}tools/extras/support-library.html">support library</a> for backward
+compatibility.</p>
+
+<p class="note"><strong>Note:</strong> The code samples below show how to create dialogs for a time
+picker and date picker using the <a href="{@docRoot}tools/extras/support-library.html">support
+library</a> APIs for {@link android.support.v4.app.DialogFragment}. If your app's <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> is 11 or
+higher, you can instead use the platform version of {@link android.app.DialogFragment}.</p>
+
+
+
+<h2 id="TimePicker">Creating a Time Picker</h2>
+
+<p>To display a {@link android.app.TimePickerDialog} using {@link
+android.support.v4.app.DialogFragment}, you need to define a fragment class that extends {@link
+android.support.v4.app.DialogFragment} and return a {@link android.app.TimePickerDialog} from the
+fragment's {@link android.support.v4.app.DialogFragment#onCreateDialog onCreateDialog()} method.</p>
+
+<p class="note"><strong>Note:</strong> If your app supports versions of Android older than 3.0,
+be sure you've set up your Android project with the support library as described in <a
+href="{@docRoot}tools/extras/support-library.html#SettingUp">Setting Up a Project to Use a
+Library</a>.</p>
+
+<h3 id="TimePickerFragment">Extending DialogFragment for a time picker</h3>
+
+<p>To define a {@link
+android.support.v4.app.DialogFragment} for a {@link android.app.TimePickerDialog}, you
+must:</p>
+<ul>
+ <li>Define the {@link android.support.v4.app.DialogFragment#onCreateDialog onCreateDialog()}
+method to return an instance of {@link android.app.TimePickerDialog}</li>
+ <li>Implement the
+{@link android.app.TimePickerDialog.OnTimeSetListener} interface to receive a callback when the user
+sets the time.</li>
+</ul>
+
+<p>Here's an example:</p>
+
+<pre>
+public static class TimePickerFragment extends DialogFragment
+ implements TimePickerDialog.OnTimeSetListener {
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Use the current time as the default values for the picker
+ final Calendar c = Calendar.getInstance();
+ int hour = c.get(Calendar.HOUR_OF_DAY);
+ int minute = c.get(Calendar.MINUTE);
+
+ // Create a new instance of TimePickerDialog and return it
+ return new TimePickerDialog(getActivity(), this, hour, minute,
+ DateFormat.is24HourFormat(getActivity()));
+ }
+
+ public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
+ // Do something with the time chosen by the user
+ }
+}
+</pre>
+
+<p>See the {@link android.app.TimePickerDialog} class for information about the constructor
+arguments.</p>
+
+<p>Now all you need is an event that adds an instance of this fragment to your activity.</p>
+
+
+<h3 id="ShowingTheTimePicker">Showing the time picker</h3>
+
+<p>Once you've defined a {@link android.support.v4.app.DialogFragment} like the one shown above,
+you can display the time picker by creating an instance of the {@link
+android.support.v4.app.DialogFragment} and calling {@link
+android.support.v4.app.DialogFragment#show show()}.</p>
+
+<p>For example, here's a button that, when clicked, calls a method to show the dialog:</p>
+
+<pre>
+<Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/pick_time"
+ android:onClick="showTimePickerDialog" />
+</pre>
+
+<p>When the user clicks this button, the system calls the following method:</p>
+
+<pre>
+public void showTimePickerDialog(View v) {
+ DialogFragment newFragment = new TimePickerFragment();
+ newFragment.show(getSupportFragmentManager(), "timePicker");
+}
+</pre>
+
+<p>This method calls {@link
+android.support.v4.app.DialogFragment#show show()} on a new instance of the {@link
+android.support.v4.app.DialogFragment} defined above. The {@link
+android.support.v4.app.DialogFragment#show show()} method requires an instance of {@link
+android.support.v4.app.FragmentManager} and a unique tag name for the fragment.</p>
+
+<p class="caution"><strong>Caution:</strong> If your app supports versions of Android lower than
+3.0, be sure that you call {@link
+android.support.v4.app.FragmentActivity#getSupportFragmentManager()} to acquire an instance of
+{@link android.support.v4.app.FragmentManager}. Also make sure that your activity that displays the
+time picker extends {@link android.support.v4.app.FragmentActivity} instead of the standard {@link
+android.app.Activity} class.</p>
+
+
+
+
+
+
+
+
+
+<h2 id="DatePicker">Creating a Date Picker</h2>
+
+<p>Creating a {@link android.app.DatePickerDialog} is just like creating a {@link
+android.app.TimePickerDialog}. The only difference is the dialog you create for the fragment.</p>
+
+<p>To display a {@link android.app.DatePickerDialog} using {@link
+android.support.v4.app.DialogFragment}, you need to define a fragment class that extends {@link
+android.support.v4.app.DialogFragment} and return a {@link android.app.DatePickerDialog} from the
+fragment's {@link android.support.v4.app.DialogFragment#onCreateDialog onCreateDialog()} method.</p>
+
+<p class="note"><strong>Note:</strong> If your app supports versions of Android older than 3.0,
+be sure you've set up your Android project with the support library as described in <a
+href="{@docRoot}tools/extras/support-library.html#SettingUp">Setting Up a Project to Use a
+Library</a>.</p>
+
+<h3 id="DatePickerFragment">Extending DialogFragment for a date picker</h3>
+
+<p>To define a {@link
+android.support.v4.app.DialogFragment} for a {@link android.app.DatePickerDialog}, you
+must:</p>
+<ul>
+ <li>Define the {@link android.support.v4.app.DialogFragment#onCreateDialog onCreateDialog()}
+method to return an instance of {@link android.app.DatePickerDialog}</li>
+ <li>Implement the
+{@link android.app.DatePickerDialog.OnDateSetListener} interface to receive a callback when the user
+sets the date.</li>
+</ul>
+
+<p>Here's an example:</p>
+
+<pre>
+public static class DatePickerFragment extends DialogFragment
+ implements DatePickerDialog.OnDateSetListener {
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Use the current date as the default date in the picker
+ final Calendar c = Calendar.getInstance();
+ int year = c.get(Calendar.YEAR);
+ int month = c.get(Calendar.MONTH);
+ int day = c.get(Calendar.DAY_OF_MONTH);
+
+ // Create a new instance of DatePickerDialog and return it
+ return new DatePickerDialog(getActivity(), this, year, month, day);
+ }
+
+ public void onDateSet(DatePicker view, int year, int month, int day) {
+ // Do something with the date chosen by the user
+ }
+}
+</pre>
+
+<p>See the {@link android.app.DatePickerDialog} class for information about the constructor
+arguments.</p>
+
+<p>Now all you need is an event that adds an instance of this fragment to your activity.</p>
+
+
+<h3 id="ShowingTheDatePicker">Showing the date picker</h3>
+
+<p>Once you've defined a {@link android.support.v4.app.DialogFragment} like the one shown above,
+you can display the date picker by creating an instance of the {@link
+android.support.v4.app.DialogFragment} and calling {@link
+android.support.v4.app.DialogFragment#show show()}.</p>
+
+<p>For example, here's a button that, when clicked, calls a method to show the dialog:</p>
+
+<pre>
+<Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/pick_date"
+ android:onClick="showDatePickerDialog" />
+</pre>
+
+<p>When the user clicks this button, the system calls the following method:</p>
+
+<pre>
+public void showDatePickerDialog(View v) {
+ DialogFragment newFragment = new DatePickerFragment();
+ newFragment.show(getSupportFragmentManager(), "datePicker");
+}
+</pre>
+
+<p>This method calls {@link
+android.support.v4.app.DialogFragment#show show()} on a new instance of the {@link
+android.support.v4.app.DialogFragment} defined above. The {@link
+android.support.v4.app.DialogFragment#show show()} method requires an instance of {@link
+android.support.v4.app.FragmentManager} and a unique tag name for the fragment.</p>
+
+<p class="caution"><strong>Caution:</strong> If your app supports versions of Android lower than
+3.0, be sure that you call {@link
+android.support.v4.app.FragmentActivity#getSupportFragmentManager()} to acquire an instance of
+{@link android.support.v4.app.FragmentManager}. Also make sure that your activity that displays the
+time picker extends {@link android.support.v4.app.FragmentActivity} instead of the standard {@link
+android.app.Activity} class.</p>
diff --git a/docs/html/guide/topics/ui/controls/radiobutton.jd b/docs/html/guide/topics/ui/controls/radiobutton.jd
new file mode 100644
index 0000000..f6f6d49
--- /dev/null
+++ b/docs/html/guide/topics/ui/controls/radiobutton.jd
@@ -0,0 +1,103 @@
+page.title=Radio Buttons
+parent.title=Input Controls
+parent.link=../controls.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+<ol>
+ <li><a href="#HandlingEvents">Responding to Click Events</a></li>
+</ol>
+
+<h2>Key classes</h2>
+<ol>
+ <li>{@link android.widget.RadioButton}</li>
+ <li>{@link android.widget.RadioGroup}</li>
+</ol>
+</div>
+</div>
+
+<p>Radio buttons allow the user to select one option from a set. You should use radio buttons for
+optional sets that are mutually exclusive if you think that the user needs to see all available
+options side-by-side. If it's not necessary to show all options side-by-side, use a <a
+href="{@docRoot}guide/topics/ui/controls/spinner.html">spinner</a> instead.</p>
+
+<img src="{@docRoot}images/ui/radiobuttons.png" alt="" />
+
+<p>To create each radio button option, create a {@link android.widget.RadioButton} in your layout.
+However, because radio buttons are mutually exclusive, you must group them together inside a
+{@link android.widget.RadioGroup}. By grouping them together, the system ensures that only one
+radio button can be selected at a time.</p>
+
+<h2 id="HandlingEvents">Responding to Click Events</h2>
+
+<p>When the user selects one of the radio buttons, the corresponding {@link
+android.widget.RadioButton} object receives an on-click event.</p>
+
+<p>To define the click event handler for a button, add the <code><a
+href="/reference/android/R.attr.html#onClick">android:onClick</a></code> attribute to the
+<code><RadioButton></code> element in your XML
+layout. The value for this attribute must be the name of the method you want to call in response
+to a click event. The {@link android.app.Activity} hosting the layout must then implement the
+corresponding method.</p>
+
+<p>For example, here are a couple {@link android.widget.RadioButton} objects:</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+ <RadioButton android:id="@+id/radio_pirates"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/pirates"
+ android:onClick="onRadioButtonClicked"/>
+ <RadioButton android:id="@+id/radio_ninjas"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/ninjas"
+ android:onClick="onRadioButtonClicked"/>
+</RadioGroup>
+</pre>
+
+<p class="note"><strong>Note:</strong> The {@link android.widget.RadioGroup} is a subclass of
+{@link android.widget.LinearLayout} that has a vertical orientation by default.</p>
+
+<p>Within the {@link android.app.Activity} that hosts this layout, the following method handles the
+click event for both radio buttons:</p>
+
+<pre>
+public void onRadioButtonClicked(View view) {
+ // Is the button now checked?
+ boolean checked = (RadioButton) view).isChecked();
+
+ // Check which radio button was clicked
+ switch(view.getId()) {
+ case R.id.radio_pirates:
+ if (checked)
+ // Pirates are the best
+ break;
+ case R.id.radio_ninjas:
+ if (checked)
+ // Ninjas rule
+ break;
+ }
+}
+</pre>
+
+<p>The method you declare in the {@link android.R.attr#onClick android:onClick} attribute
+must have a signature exactly as shown above. Specifically, the method must:</p>
+<ul>
+ <li>Be public</li>
+ <li>Return void</li>
+ <li>Define a {@link android.view.View} as its only parameter (this will be the {@link
+android.view.View} that was clicked)</li>
+</ul>
+
+<p class="note"><strong>Tip:</strong> If you need to change the radio button state
+yourself (such as when loading a saved {@link android.preference.CheckBoxPreference}),
+use the {@link android.widget.CompoundButton#setChecked(boolean)} or {@link
+android.widget.CompoundButton#toggle()} method.</p>
diff --git a/docs/html/guide/topics/ui/controls/spinner.jd b/docs/html/guide/topics/ui/controls/spinner.jd
new file mode 100644
index 0000000..deba3e6
--- /dev/null
+++ b/docs/html/guide/topics/ui/controls/spinner.jd
@@ -0,0 +1,147 @@
+page.title= Spinners
+parent.title=Input Controls
+parent.link=../controls.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#Populate">Populate the Spinner with User Choices</a></li>
+ <li><a href="#SelectListener">Responding to User Selections</a></li>
+</ol>
+<h2>Key classes</h2>
+<ol>
+ <li>{@link android.widget.Spinner}</li>
+ <li>{@link android.widget.SpinnerAdapter}</li>
+ <li>{@link android.widget.AdapterView.OnItemSelectedListener}</li>
+</ol>
+
+</div>
+</div>
+
+<p>Spinners provide a quick way to select one value from a set. In the default state, a spinner
+shows its currently selected value. Touching the spinner displays a dropdown menu with all other
+available values, from which the user can select a new one.</p>
+
+<img src="{@docRoot}images/ui/spinner.png" alt="" />
+
+<p>You can add a spinner to your layout with the {@link android.widget.Spinner} object. You
+should usually do so in your XML layout with a {@code <Spinner>} element. For example:</p>
+
+<pre>
+<Spinner
+ android:id="@+id/planets_spinner"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+</pre>
+
+<p>To populate the spinner with a list of choices, you then need to specify a {@link
+android.widget.SpinnerAdapter} in your {@link android.app.Activity} or {@link android.app.Fragment}
+source code.</p>
+
+<h2 id="Populate">Populate the Spinner with User Choices</h2>
+
+<p>The choices you provide for the spinner can come from any source, but must be provided through
+an {@link android.widget.SpinnerAdapter}, such as an {@link android.widget.ArrayAdapter} if the
+choices are available in an array or a {@link android.widget.CursorAdapter} if the choices are
+available from a database query.</p>
+
+<p>For instance, if the available choices for your spinner are pre-determined, you can provide
+them with a string array defined in a <a
+href="{@docRoot}guide/topics/resources/string-resource.html">string
+resource file</a>:</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string-array name="planets_array">
+ <item>Mercury</item>
+ <item>Venus</item>
+ <item>Earth</item>
+ <item>Mars</item>
+ <item>Jupiter</item>
+ <item>Saturn</item>
+ <item>Uranus</item>
+ <item>Neptune</item>
+ </string-array>
+</resources>
+</pre>
+
+ <p>With an array such as this one, you can use the following code in your {@link
+android.app.Activity} or {@link android.app.Fragment} to supply the spinner with the array using
+an instance of {@link android.widget.ArrayAdapter}:
+
+<pre>
+Spinner spinner = (Spinner) findViewById(R.id.spinner);
+// Create an ArrayAdapter using the string array and a default spinner layout
+ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
+ R.array.planets_array, android.R.layout.simple_spinner_item);
+// Specify the layout to use when the list of choices appears
+adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+// Apply the adapter to the spinner
+spinner.setAdapter(adapter);
+</pre>
+
+<p>The {@link
+android.widget.ArrayAdapter#createFromResource(Context,int,int) createFromResource()} method allows
+you to create an {@link android.widget.ArrayAdapter} from the string array. The third argument for
+this method is a layout resource that defines how the selected choice appears in the
+spinner control. The {@link android.R.layout#simple_spinner_item} layout is provided by the
+platform and is the default layout you should use unless you'd like to define your own layout
+for the spinner's appearance.</p>
+
+<p>You should then call {@link android.widget.ArrayAdapter#setDropDownViewResource(int)} to specify
+the layout the adapter should use to display the list of spinner choices ({@link
+android.R.layout#simple_spinner_dropdown_item} is another standard layout defined by the
+platform).</p>
+
+<p>Call {@link android.widget.AdapterView#setAdapter setAdapter()} to apply the adapter to your
+{@link android.widget.Spinner}.</p>
+
+
+<h2 id="SelectListener">Responding to User Selections</h2>
+
+<p>When the user selects an item from the drop-down, the {@link android.widget.Spinner} object
+receives an on-item-selected event.</p>
+
+<p>To define the selection event handler for a spinner, implement the {@link
+android.widget.AdapterView.OnItemSelectedListener} interface and the corresponding {@link
+android.widget.AdapterView.OnItemSelectedListener#onItemSelected onItemSelected()} callback method.
+For example, here's an implementation of the interface in an {@link android.app.Activity}:</p>
+
+<pre>
+public class SpinnerActivity extends Activity implements OnItemSelectedListener {
+ ...
+
+ public void onItemSelected(AdapterView<?> parent, View view,
+ int pos, long id) {
+ // An item was selected. You can retrieve the selected item using
+ // parent.getItemAtPosition(pos)
+ }
+
+ public void onNothingSelected(AdapterView<?> parent) {
+ // Another interface callback
+ }
+}
+</pre>
+
+<p>The {@link android.widget.AdapterView.OnItemSelectedListener} requires the {@link
+android.widget.AdapterView.OnItemSelectedListener#onItemSelected(AdapterView,View,int,long)
+onItemSelected()} and {@link
+android.widget.AdapterView.OnItemSelectedListener#onNothingSelected(AdapterView)
+onNothingSelected()} callback methods.</p>
+
+<p>Then you need to specify the interface implementation by calling {@link
+android.widget.AdapterView#setOnItemSelectedListener setOnItemSelectedListener()}:</p>
+
+<pre>
+Spinner spinner = (Spinner) findViewById(R.id.spinner);
+spinner.setOnItemSelectedListener(this);
+</pre>
+
+<p>If you implement the {@link
+android.widget.AdapterView.OnItemSelectedListener} interface with your {@link
+android.app.Activity} or {@link android.app.Fragment} (such as in the example above), you can pass
+<code>this</code> as the interface instance.</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/ui/controls/text.jd b/docs/html/guide/topics/ui/controls/text.jd
new file mode 100644
index 0000000..2d9d215
--- /dev/null
+++ b/docs/html/guide/topics/ui/controls/text.jd
@@ -0,0 +1,306 @@
+page.title=Text Fields
+parent.title=Input Controls
+parent.link=../controls.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#Keyboard">Specifying the Keyboard Type</a>
+ <ol>
+ <li><a href="#Behaviors">Controlling other behaviors</a></li>
+ </ol>
+ </li>
+ <li><a href="#Actions">Specifying Keyboard Actions</a>
+ <ol>
+ <li><a href="#ActionEvent">Responding to action button events</a></li>
+ <li><a href="#ActionLabel">Setting a custom action button label</a></li>
+ </ol>
+ </li>
+ <li><a href="#Flags">Adding Other Keyboard Flags</a></li>
+ <li><a href="#AutoComplete">Providing Auto-complete Suggestions</a></li>
+</ol>
+<h2>Key classes</h2>
+<ol>
+ <li>{@link android.widget.EditText}</li>
+ <li>{@link android.widget.AutoCompleteTextView}</li>
+</ol>
+
+</div>
+</div>
+
+<p>A text field allows the user to type text into your app. It can be either single line or
+multi-line. Touching a text field places the cursor and automatically displays the keyboard. In
+addition to typing, text fields allow for a variety of other activities, such as text selection
+(cut, copy, paste) and data look-up via auto-completion.</p>
+
+<p>You can add a text field to you layout with the {@link android.widget.EditText} object. You
+should usually do so in your XML layout with a {@code <EditText>} element.</p>
+
+<img src="{@docRoot}images/ui/edittext-noextract.png" alt="" />
+
+
+
+<h2 id="Keyboard">Specifying the Keyboard Type</h2>
+
+<div class="figure" style="width:300px;margin-top:0">
+<img src="{@docRoot}images/ui/edittext-text.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> The default {@code text} input type.</p>
+</div>
+
+<div class="figure" style="width:300px">
+<img src="{@docRoot}images/ui/edittext-email.png" alt="" />
+<p class="img-caption"><strong>Figure 2.</strong> The {@code textEmailAddress} input type.</p>
+</div>
+
+<div class="figure" style="width:300px">
+<img src="{@docRoot}images/ui/edittext-phone.png" alt="" />
+<p class="img-caption"><strong>Figure 3.</strong> The {@code phone} input type.</p>
+</div>
+
+<p>Text fields can have different input types, such as number, date, password, or email address. The
+type determines what kind of characters are allowed inside the field, and may prompt the virtual
+keyboard to optimize its layout for frequently used characters.</p>
+
+<p>You can specify the type of keyboard you want for your {@link android.widget.EditText} object
+with the <a href="{@docRoot}reference/android/widget/TextView.html#attr_android:inputType">{@code
+android:inputType}</a> attribute. For example, if you want the user to input an email address, you
+should use the {@code textEmailAddress} input type:</p>
+
+<pre>
+<EditText
+ android:id="@+id/email_address"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/email_hint"
+ android:inputType="textEmailAddress" />
+</pre>
+
+
+<p>There are several different input types available for different situations. You can find
+them all listed with the documentation for <a
+href="{@docRoot}reference/android/widget/TextView.html#attr_android:inputType">{@code
+android:inputType}</a>.</p>
+
+<p class="note"><strong>Tip:</strong> To allow users to input long strings of text with line
+breaks, use the {@code "textMultiLine"} input type. By default, an {@link android.widget.EditText}
+object is restricted to one line of text and scrolls horizontally when the text exceeds the
+available width.</p>
+
+
+<h3 id="Behaviors">Controlling other behaviors</h3>
+
+<p>The <a href="{@docRoot}reference/android/widget/TextView.html#attr_android:inputType">{@code
+android:inputType}</a> also allows you to specify certain keyboard behaviors, such as whether to
+capitalize all new words or use features like auto-complete and spelling suggestions.</p>
+
+<p>The <a href="{@docRoot}reference/android/widget/TextView.html#attr_android:inputType">{@code
+android:inputType}</a> attribute allows bitwise combinations so you can specify both a keyboard
+layout and one or more behaviors at once. For example, here's how you can collect a postal
+address, capitalize each word, and disable text suggestions:</p>
+
+<pre>
+<EditText
+ android:id="@+id/postal_address"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/postal_address_hint"
+ android:inputType="textPostalAddress|
+ textCapWords|
+ textNoSuggestions" />
+</pre>
+
+<p>All behaviors are also listed with the <a
+href="{@docRoot}reference/android/widget/TextView.html#attr_android:inputType">{@code
+android:inputType}</a> documentation.</p>
+
+
+<h2 id="Actions">Specifying Keyboard Actions</h2>
+
+<div class="figure" style="width:300px">
+<img src="{@docRoot}images/ui/edittext-actionsend.png" alt="" />
+<p class="img-caption"><strong>Figure 4.</strong> If you declare {@code
+android:imeOptions="actionSend"}, the keyboard includes the Send action.</p>
+</div>
+
+<p>In addition to changing the keyboard's input type, Android allows you to specify an action to be
+made when users have completed their input. The action specifies the button that appears in place of
+the carriage return key and the action to be made, such as "Search" or "Send."</p>
+
+<p>You can specify the action by setting the <a
+href="{@docRoot}reference/android/widget/TextView.html#attr_android:imeOptions">{@code
+android:imeOptions}</a> attribute. For example, here's how you can specify the Send action:</p>
+
+<pre>
+<EditText
+ android:id="@+id/search"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/search_hint"
+ android:inputType="text"
+ android:imeOptions="actionSend" />
+</pre>
+
+<p>If you do not explicitly specify an input action then the system attempts to determine if there
+are any subsequent <a
+href="{@docRoot}reference/android/view/View.html#attr_android:focusable">{@code
+android:focusable}</a> fields. If any focusable fields are found following this one, the system
+applies the (@code actionNext} action to the current {@link android.widget.EditText} so the user can
+select Next to move to the next field. If there's no subsequent focusable field, the system applies
+the {@code "actionDone"} action. You can override this by setting the <a
+href="{@docRoot}reference/android/widget/TextView.html#attr_android:imeOptions">{@code
+android:imeOptions}</a> attribute to any other value such as {@code "actionSend"} or {@code
+"actionSearch"} or suppress the default behavior by using the {@code "actionNone"} action.</p>
+
+
+<h3 id="ActionEvent">Responding to action button events</h3>
+
+<p>If you have specified a keyboard action for the input method using <a
+href="{@docRoot}reference/android/widget/TextView.html#attr_android:imeOptions">{@code
+android:imeOptions}</a> attribute (such as {@code "actionSend"}), you can listen for the specific
+action event using an {@link android.widget.TextView.OnEditorActionListener}. The {@link
+android.widget.TextView.OnEditorActionListener} interface provides a callback method called {@link
+android.widget.TextView.OnEditorActionListener#onEditorAction onEditorAction()} that indicates the
+action type invoked with an action ID such as {@link
+android.view.inputmethod.EditorInfo#IME_ACTION_SEND} or {@link
+android.view.inputmethod.EditorInfo#IME_ACTION_SEARCH}.</p>
+
+<p>For example, here's how you can listen for when the user clicks the Send button on the
+keyboard:</p>
+
+<pre>
+EditText editText = (EditText) findViewById(R.id.search);
+editText.setOnEditorActionListener(new OnEditorActionListener() {
+ @Override
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+ boolean handled = false;
+ if (actionId == EditorInfo.IME_ACTION_SEND) {
+ // Send the user message
+ handled = true;
+ }
+ return handled;
+ }
+});
+</pre>
+
+
+<h3 id="ActionLabel">Setting a custom action button label</h3>
+
+<p>If the keyboard is too large to reasonably share space with the underlying application (such as
+when a handset device is in landscape orientation) then fullscreen ("extract mode") is triggered. In
+this mode, a labeled action button is displayed next to the input. You can customize the text of
+this button by setting the <a
+href="{@docRoot}reference/android/widget/TextView.html#attr_android:imeActionLabel">{@code
+android:imeActionLabel}</a> attribute:</p>
+
+<pre>
+<EditText
+ android:id="@+id/launch_codes"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/enter_launch_codes"
+ android:inputType="number"
+ android:imeActionLabel="@string/launch" />
+</pre>
+
+<img src="{@docRoot}images/ui/edittext-actionlabel.png" alt="" />
+<p class="img-caption"><strong>Figure 5.</strong> A custom action label with <a
+href="{@docRoot}reference/android/widget/TextView.html#attr_android:imeActionLabel">{@code
+android:imeActionLabel}</a>.</p>
+
+
+
+<h2 id="Flags">Adding Other Keyboard Flags</h2>
+
+<p>In addition to the actions you can specify with the <a
+href="{@docRoot}reference/android/widget/TextView.html#attr_android:imeOptions">{@code
+android:imeOptions}</a> attribute, you can add additional flags to specify other keyboard
+behaviors. All available flags are listed along with the actions in the <a
+href="{@docRoot}reference/android/widget/TextView.html#attr_android:imeOptions">{@code
+android:imeOptions}</a> documentation.</p>
+
+<p>For example, figure 5 shows how the system enables a fullscreen text field when a handset device
+is in landscape orientation (or the screen space is otherwise constrained for space). You can
+disable the fullscreen input mode with {@code flagNoExtractUi} in the <a
+href="{@docRoot}reference/android/widget/TextView.html#attr_android:imeOptions">{@code
+android:imeOptions}</a> attribute, as shown in figure 6.</p>
+
+<img src="{@docRoot}images/ui/edittext-noextract.png" alt="" />
+<p class="img-caption"><strong>Figure 6.</strong> The fullscreen text field ("extract mode") is
+disabled with {@code android:imeOptions="flagNoExtractUi"}.</p>
+
+
+
+
+<h2 id="AutoComplete">Providing Auto-complete Suggestions</h2>
+
+<p>If you want to provide suggestions to users as they type, you can use a subclass of {@link
+android.widget.EditText} called {@link android.widget.AutoCompleteTextView}. To implement
+auto-complete, you must specify an (@link android.widget.Adapter) that provides the text
+suggestions. There are several kinds of adapters available, depending on where the data is coming
+from, such as from a database or an array.</p>
+
+<img src="{@docRoot}images/ui/edittext-autocomplete.png" alt="" />
+<p class="img-caption"><strong>Figure 7.</strong> Example of {@link
+android.widget.AutoCompleteTextView} with text suggestions.</p>
+
+<p>The following procedure describes how to set up an {@link android.widget.AutoCompleteTextView}
+that provides suggestions from an array, using {@link android.widget.ArrayAdapter}:
+
+<ol>
+ <li>Add the {@link android.widget.AutoCompleteTextView} to your layout. Here's a
+layout with only the text field:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<AutoCompleteTextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/autocomplete_country"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+</pre>
+</li>
+
+<li>Define the array that contains all text suggestions. For example, here's an array of country
+names that's defined in an XML resource file ({@code res/values/strings.xml}):
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string-array name="countries_array">
+ <item>Afghanistan</item>
+ <item>Albania</item>
+ <item>Algeria</item>
+ <item>American Samoa</item>
+ <item>Andorra</item>
+ <item>Angola</item>
+ <item>Anguilla</item>
+ <item>Antarctica</item>
+ ...
+ </string-array>
+</resources>
+</pre>
+</li>
+
+<li>In your {@link android.app.Activity} or {@link android.app.Fragment}, use the following
+code to specify the adapter that supplies the suggestions:
+<pre>
+// Get a reference to the AutoCompleteTextView in the layout
+AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_country);
+// Get the string array
+String[] countries = getResources().getStringArray(R.array.countries_array);
+// Create the adapter and set it to the AutoCompleteTextView
+ArrayAdapter<String> adapter =
+ new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, countries);
+textView.setAdapter(adapter);
+</pre>
+
+<p>Here, a new {@link
+android.widget.ArrayAdapter} is initialized to bind each item in the <code>COUNTRIES</code>
+string array to a {@link android.widget.TextView} that exists in the {@code simple_list_item_1}
+layout (this is a layout provided by Android that provides a standard appearance for text in a
+list).</p>
+<p>Then assign the adapter to the {@link android.widget.AutoCompleteTextView} by
+calling {@link android.widget.AutoCompleteTextView#setAdapter setAdapter()}.</p>
+</li>
+</ol>
+
diff --git a/docs/html/guide/topics/ui/controls/togglebutton.jd b/docs/html/guide/topics/ui/controls/togglebutton.jd
new file mode 100644
index 0000000..dd7634b
--- /dev/null
+++ b/docs/html/guide/topics/ui/controls/togglebutton.jd
@@ -0,0 +1,124 @@
+page.title=Toggle Buttons
+parent.title=Input Controls
+parent.link=../controls.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+<ol>
+ <li><a href="#HandlingEvents">Responding to Click Events</a>
+ <ol>
+ <li><a href="#ClickListener">Using an OnCheckedChangeListener</a></li>
+ </ol>
+ </li>
+</ol>
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.widget.ToggleButton}</li>
+ <li>{@link android.widget.Switch}</li>
+ </ol>
+</div>
+</div>
+
+<p>A toggle button allows the user to change a setting between two states.</p>
+
+<p>You can add a basic toggle button to your layout with the {@link android.widget.ToggleButton}
+object. Android 4.0 (API level 14) introduces another kind of toggle button called a switch that
+provides a slider control, which you can add with a {@link android.widget.Switch} object.</p>
+
+<div style="float:left;width:200px">
+<img src="{@docRoot}images/ui/togglebutton.png" alt="" />
+<p class="img-caption"><em>Toggle buttons</em></p>
+</div>
+
+<div style="float:left;width:200px;margin-top:24px">
+<img src="{@docRoot}images/ui/switch.png" alt="" />
+<p class="img-caption"><em>Switches (in Android 4.0+)</em></p>
+</div>
+
+<p style="clear:left">The {@link android.widget.ToggleButton} and {@link android.widget.Switch}
+controls are subclasses of {@link android.widget.CompoundButton} and function in the same manner, so
+you can implement their behavior the same way.</p>
+
+<h2 id="HandlingEvents">Responding to Click Events</h2>
+
+<p>When the user selects a {@link android.widget.ToggleButton} and {@link android.widget.Switch},
+the object receives an on-click event.</p>
+
+<p>To define the click event handler, add the <code><a
+href="/reference/android/R.attr.html#onClick">android:onClick</a></code> attribute to the
+<code><ToggleButton></code> or <code><Switch></code> element in your XML
+layout. The value for this attribute must be the name of the method you want to call in response
+to a click event. The {@link android.app.Activity} hosting the layout must then implement the
+corresponding method.</p>
+
+<p>For example, here's a {@link android.widget.ToggleButton} with the <code><a
+href="/reference/android/R.attr.html#onClick">android:onClick</a></code> attribute:</p>
+
+<pre>
+<ToggleButton
+ android:id="@+id/togglebutton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textOn="Vibrate on"
+ android:textOff="Vibrate off"
+ android:onClick="onToggleClicked"/>
+</pre>
+
+<p>Within the {@link android.app.Activity} that hosts this layout, the following method handles the
+click event:</p>
+
+<pre>
+public void onToggleClicked(View view) {
+ // Is the toggle on?
+ boolean on = ((ToggleButton) view).isChecked();
+
+ if (on) {
+ // Enable vibrate
+ } else {
+ // Disable vibrate
+ }
+}
+</pre>
+
+<p>The method you declare in the {@link android.R.attr#onClick android:onClick} attribute
+must have a signature exactly as shown above. Specifically, the method must:</p>
+<ul>
+ <li>Be public</li>
+ <li>Return void</li>
+ <li>Define a {@link android.view.View} as its only parameter (this will be the {@link
+android.view.View} that was clicked)</li>
+</ul>
+
+<p class="note"><strong>Tip:</strong> If you need to change the state
+yourself,
+use the {@link android.widget.CompoundButton#setChecked(boolean)} or {@link
+android.widget.CompoundButton#toggle()} method to change the state.</p>
+
+
+
+<h3 id="ClickListener">Using an OnCheckedChangeListener</h3>
+
+<p>You can also declare a click event handler pragmatically rather than in an XML layout. This
+might be necessary if you instantiate the {@link android.widget.ToggleButton} or {@link
+android.widget.Switch} at runtime or you need to
+declare the click behavior in a {@link android.app.Fragment} subclass.</p>
+
+<p>To declare the event handler programmatically, create an {@link
+android.widget.CompoundButton.OnCheckedChangeListener} object and assign it to the button by calling
+{@link
+android.widget.CompoundButton#setOnCheckedChangeListener}. For example:</p>
+
+<pre>
+ToggleButton toggle = (ToggleButton) findViewById(R.id.togglebutton);
+toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ if (isChecked) {
+ // The toggle is enabled
+ } else {
+ // The toggle is disabled
+ }
+ }
+});
+</pre>
diff --git a/docs/html/guide/topics/ui/declaring-layout.jd b/docs/html/guide/topics/ui/declaring-layout.jd
index 8af4a1c..3c9faa8 100644
--- a/docs/html/guide/topics/ui/declaring-layout.jd
+++ b/docs/html/guide/topics/ui/declaring-layout.jd
@@ -1,4 +1,4 @@
-page.title=XML Layouts
+page.title=Layouts
parent.title=User Interface
parent.link=index.html
@jd:body
@@ -6,18 +6,25 @@
<div id="qv-wrapper">
<div id="qv">
<h2>In this document</h2>
- <ol>
- <li><a href="#write">Write the XML</a></li>
- <li><a href="#load">Load the XML Resource</a></li>
- <li><a href="#attributes">Attributes</a>
- <ol>
- <li><a href="#id">ID</a></li>
- <li><a href="#layout-params">Layout Parameters</a></li>
- </ol>
- </li>
- <li><a href="#Position">Position</a></li>
- <li><a href="#SizePaddingMargins">Size, Padding and Margins</a></li>
- </ol>
+<ol>
+ <li><a href="#write">Write the XML</a></li>
+ <li><a href="#load">Load the XML Resource</a></li>
+ <li><a href="#attributes">Attributes</a>
+ <ol>
+ <li><a href="#id">ID</a></li>
+ <li><a href="#layout-params">Layout Parameters</a></li>
+ </ol>
+ </li>
+ <li><a href="#Position">Layout Position</a></li>
+ <li><a href="#SizePaddingMargins">Size, Padding and Margins</a></li>
+ <li><a href="#CommonLayouts">Common Layouts</a></li>
+ <li><a href="#AdapterViews">Building Layouts with an Adapter</a>
+ <ol>
+ <li><a href="#FillingTheLayout">Filling an adapter view with data</a></li>
+ <li><a href="#HandlingUserSelections">Handling click events</a></li>
+ </ol>
+ </li>
+</ol>
<h2>Key classes</h2>
<ol>
@@ -43,15 +50,15 @@
<div class="sidebox-wrapper">
<div class="sidebox">
<ul>
- <li>The <a href="{@docRoot}sdk/eclipse-adt.html">ADT
+ <li>The <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT
Plugin for Eclipse</a> offers a layout preview of your XML —
with the XML file opened, select the <strong>Layout</strong> tab.</li>
<li>You should also try the
- <a href="{@docRoot}guide/developing/debugging/debugging-ui.html#hierarchyViewer">Hierarchy Viewer</a> tool,
+ <a href="{@docRoot}tools/debugging/debugging-ui.html#hierarchyViewer">Hierarchy Viewer</a> tool,
for debugging layouts — it reveals layout property values,
draws wireframes with padding/margin indicators, and full rendered views while
you debug on the emulator or device.</li>
- <li>The <a href="{@docRoot}guide/developing/debugging/debugging-ui.html#layoutopt">layoutopt</a> tool lets
+ <li>The <a href="{@docRoot}tools/debugging/debugging-ui.html#layoutopt">layoutopt</a> tool lets
you quickly analyze your layouts and hierarchies for inefficiencies or other problems.</li>
</div>
</div>
@@ -125,7 +132,7 @@
<p>The <code>onCreate()</code> callback method in your Activity is called by the Android framework when
your Activity is launched (see the discussion about lifecycles, in the
-<a href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">Activities</a>
+<a href="{@docRoot}guide/components/activities.html#Lifecycle">Activities</a>
document).</p>
@@ -300,5 +307,213 @@
</p>
+
+
+
+
+<style type="text/css">
+div.layout {
+ float:left;
+ width:200px;
+ margin:0 0 20px 20px;
+}
+div.layout.first {
+ margin-left:0;
+ clear:left;
+}
+</style>
+
+
+
+
+<h2 id="CommonLayouts">Common Layouts</h2>
+
+<p>Each subclass of the {@link android.view.ViewGroup} class provides a unique way to display
+the views you nest within it. Below are some of the more common layout types that are built
+into the Android platform.</p>
+
+<p class="note"><strong>Note:</strong> Although you can nest one or more layouts within another
+layout to acheive your UI design, you should strive to keep your layout hierarchy as shallow as
+possible. Your layout draws faster if it has fewer nested layouts (a wide view hierarchy is
+better than a deep view hierarchy).</p>
+
+<!--
+<h2 id="framelayout">FrameLayout</h2>
+<p>{@link android.widget.FrameLayout FrameLayout} is the simplest type of layout
+object. It's basically a blank space on your screen that you can
+later fill with a single object — for example, a picture that you'll swap in and out.
+All child elements of the FrameLayout are pinned to the top left corner of the screen; you cannot
+specify a different location for a child view. Subsequent child views will simply be drawn over
+previous ones,
+partially or totally obscuring them (unless the newer object is transparent).
+</p>
+-->
+
+
+<div class="layout first">
+ <h4><a href="layout/linear.html">Linear Layout</a></h4>
+ <a href="layout/linear.html"><img src="{@docRoot}images/ui/linearlayout-small.png" alt="" /></a>
+ <p>A layout that organizes its children into a single horizontal or vertical row. It
+ creates a scrollbar if the length of the window exceeds the length of the screen.</p>
+</div>
+
+<div class="layout">
+ <h4><a href="layout/relative.html">Relative Layout</a></h4>
+ <a href="layout/relative.html"><img src="{@docRoot}images/ui/relativelayout-small.png" alt=""
+/></a>
+ <p>Enables you to specify the location of child objects relative to each other (child A to
+the left of child B) or to the parent (aligned to the top of the parent).</p>
+</div>
+
+<!--
+<div class="layout">
+ <h4><a href="layout/tabs.html">Tabs</a></h4>
+ <a href="layout/tabs.html"><img src="{@docRoot}images/ui/tabs-small.png" alt="" /></a>
+ <p>Provides a tab selection list that monitors clicks and enables the application to change
+the screen whenever a tab is clicked.</p>
+</div>
+
+<div class="layout first">
+ <h4><a href="layout/grid.html">Table Layout</a></h4>
+ <a href="layout/table.html"><img src="{@docRoot}images/ui/gridlayout-small.png" alt="" /></a>
+ <p>A tabular layout with an arbitrary number of rows and columns, each cell holding the
+widget of your choice. The rows resize to fit the largest column. The cell borders are not
+visible.</p>
+</div>
+-->
+
+<div class="layout">
+ <h4><a href="{@docRoot}guide/webapps/webview.html">Web View</a></h4>
+ <a href="{@docRoot}guide/webapps/webview.html"><img src="{@docRoot}images/ui/webview-small.png"
+alt="" /></a>
+ <p>Displays web pages.</p>
+</div>
+
+
+
+
+<h2 id="AdapterViews" style="clear:left">Building Layouts with an Adapter</h2>
+
+<p>When the content for your layout is dynamic or not pre-determined, you can use a layout that
+subclasses {@link android.widget.AdapterView} to populate the layout with views at runtime. A
+subclass of the {@link android.widget.AdapterView} class uses an {@link android.widget.Adapter} to
+bind data to its layout. The {@link android.widget.Adapter} behaves as a middle-man between the data
+source and the {@link android.widget.AdapterView} layout—the {@link android.widget.Adapter}
+retreives the data (from a source such as an array or a database query) and converts each entry
+into a view that can be added into the {@link android.widget.AdapterView} layout.</p>
+
+<p>Common layouts backed by an adapter include:</p>
+
+<div class="layout first">
+ <h4><a href="layout/listview.html">List View</a></h4>
+ <a href="layout/list.html"><img src="{@docRoot}images/ui/listview-small.png" alt="" /></a>
+ <p>Displays a scrolling single column list.</p>
+</div>
+
+<div class="layout">
+ <h4><a href="layout/gridview.html">Grid View</a></h4>
+ <a href="layout/grid.html"><img src="{@docRoot}images/ui/gridview-small.png" alt="" /></a>
+ <p>Displays a scrolling grid of columns and rows.</p>
+</div>
+
+
+
+<h3 id="FillingTheLayout" style="clear:left">Filling an adapter view with data</h3>
+
+<p>You can populate an {@link android.widget.AdapterView} such as {@link android.widget.ListView} or
+{@link android.widget.GridView} by binding the {@link android.widget.AdapterView} instance to an
+{@link android.widget.Adapter}, which retrieves data from an external source and creates a {@link
+android.view.View} that represents each data entry.</p>
+
+<p>Android provides several subclasses of {@link android.widget.Adapter} that are useful for
+retrieving different kinds of data and building views for an {@link android.widget.AdapterView}. The
+two most common adapters are:</p>
+
+<dl>
+ <dt>{@link android.widget.ArrayAdapter}</dt>
+ <dd>Use this adapter when your data source is an array. By default, {@link
+android.widget.ArrayAdapter} creates a view for each array item by calling {@link
+java.lang.Object#toString()} on each item and placing the contents in a {@link
+android.widget.TextView}.
+ <p>For example, if you have an array of strings you want to display in a {@link
+android.widget.ListView}, initialize a new {@link android.widget.ArrayAdapter} using a
+constructor to specify the layout for each string and the string array:</p>
+<pre>
+ArrayAdapter adapter = new ArrayAdapter<String>(this,
+ android.R.layout.simple_list_item_1, myStringArray);
+</pre>
+<p>The arguments for this constructor are:</p>
+<ul>
+ <li>Your app {@link android.content.Context}</li>
+ <li>The layout that contains a {@link android.widget.TextView} for each string in the array</li>
+ <li>The string array</li>
+</ul>
+<p>Then simply call
+{@link android.widget.ListView#setAdapter setAdapter()} on your {@link android.widget.ListView}:</p>
+<pre>
+ListView listView = (ListView) findViewById(R.id.listview);
+listView.setAdapter(adapter);
+</pre>
+
+ <p>To customize the appearance of each item you can override the {@link
+java.lang.Object#toString()} method for the objects in your array. Or, to create a view for each
+item that's something other than a {@link android.widget.TextView} (for example, if you want an
+{@link android.widget.ImageView} for each array item), extend the {@link
+android.widget.ArrayAdapter} class and override {@link android.widget.ArrayAdapter#getView
+getView()} to return the type of view you want for each item.</p>
+
+</dd>
+
+ <dt>{@link android.widget.SimpleCursorAdapter}</dt>
+ <dd>Use this adapter when your data comes from a {@link android.database.Cursor}. When
+using {@link android.widget.SimpleCursorAdapter}, you must specify a layout to use for each
+row in the {@link android.database.Cursor} and which columns in the {@link android.database.Cursor}
+should be inserted into which views of the layout. For example, if you want to create a list of
+people's names and phone numbers, you can perform a query that returns a {@link
+android.database.Cursor} containing a row for each person and columns for the names and
+numbers. You then create a string array specifying which columns from the {@link
+android.database.Cursor} you want in the layout for each result and an integer array specifying the
+corresponding views that each column should be placed:</p>
+<pre>
+String[] fromColumns = {ContactsContract.Data.DISPLAY_NAME,
+ ContactsContract.CommonDataKinds.Phone.NUMBER};
+int[] toViews = {R.id.display_name, R.id.phone_number};
+</pre>
+<p>When you instantiate the {@link android.widget.SimpleCursorAdapter}, pass the layout to use for
+each result, the {@link android.database.Cursor} containing the results, and these two arrays:</p>
+<pre>
+SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
+ R.layout.person_name_and_number, cursor, fromColumns, toViews, 0);
+ListView listView = getListView();
+listView.setAdapter(adapter);
+</pre>
+<p>The {@link android.widget.SimpleCursorAdapter} then creates a view for each row in the
+{@link android.database.Cursor} using the provided layout by inserting each {@code
+fromColumns} item into the corresponding {@code toViews} view.</p>.</dd>
+</dl>
+
+
+<p>If, during the course of your application's life, you change the underlying data that is read by
+your adapter, you should call {@link android.widget.ArrayAdapter#notifyDataSetChanged()}. This will
+notify the attached view that the data has been changed and it should refresh itself.</p>
+
+
+
+<h3 id="HandlingUserSelections">Handling click events</h3>
+
+<p>You can respond to click events on each item in an {@link android.widget.AdapterView} by
+implementing the {@link android.widget.AdapterView.OnItemClickListener} interface. For example:</p>
+
+<pre>
+// Create a message handling object as an anonymous class.
+private OnItemClickListener mMessageClickedHandler = new OnItemClickListener() {
+ public void onItemClick(AdapterView parent, View v, int position, long id) {
+ // Do something in response to the click
+ }
+};
+
+listView.setOnItemClickListener(mMessageClickedHandler);
+</pre>
+
diff --git a/docs/html/guide/topics/ui/dialogs.jd b/docs/html/guide/topics/ui/dialogs.jd
index 82cbfd1..9c28058 100644
--- a/docs/html/guide/topics/ui/dialogs.jd
+++ b/docs/html/guide/topics/ui/dialogs.jd
@@ -313,7 +313,7 @@
<p class="note"><strong>Note:</strong> To save the selection when the user leaves or
pauses the Activity, you must properly save and restore the setting throughout
-the <a href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">activity lifecycle</a>.
+the <a href="{@docRoot}guide/components/activities.html#Lifecycle">activity lifecycle</a>.
To permanently save the selections, even when the Activity process is completely shutdown,
you need to save the settings
with one of the <a href="{@docRoot}guide/topics/data/data-storage.html">Data
diff --git a/docs/html/resources/tutorials/views/images/android_focused.png b/docs/html/guide/topics/ui/images/android_focused.png
similarity index 100%
rename from docs/html/resources/tutorials/views/images/android_focused.png
rename to docs/html/guide/topics/ui/images/android_focused.png
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/android_normal.png b/docs/html/guide/topics/ui/images/android_normal.png
similarity index 100%
rename from docs/html/resources/tutorials/views/images/android_normal.png
rename to docs/html/guide/topics/ui/images/android_normal.png
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/android_pressed.png b/docs/html/guide/topics/ui/images/android_pressed.png
similarity index 100%
rename from docs/html/resources/tutorials/views/images/android_pressed.png
rename to docs/html/guide/topics/ui/images/android_pressed.png
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-gallery.png b/docs/html/guide/topics/ui/images/hello-gallery.png
similarity index 100%
rename from docs/html/guide/tutorials/views/images/hello-gallery.png
rename to docs/html/guide/topics/ui/images/hello-gallery.png
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-gridview.png b/docs/html/guide/topics/ui/images/hello-gridview.png
similarity index 100%
rename from docs/html/guide/tutorials/views/images/hello-gridview.png
rename to docs/html/guide/topics/ui/images/hello-gridview.png
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-linearlayout.png b/docs/html/guide/topics/ui/images/hello-linearlayout.png
similarity index 100%
rename from docs/html/guide/tutorials/views/images/hello-linearlayout.png
rename to docs/html/guide/topics/ui/images/hello-linearlayout.png
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-listview.png b/docs/html/guide/topics/ui/images/hello-listview.png
similarity index 100%
rename from docs/html/resources/tutorials/views/images/hello-listview.png
rename to docs/html/guide/topics/ui/images/hello-listview.png
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-mapview.png b/docs/html/guide/topics/ui/images/hello-mapview.png
similarity index 100%
rename from docs/html/resources/tutorials/views/images/hello-mapview.png
rename to docs/html/guide/topics/ui/images/hello-mapview.png
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-relativelayout.png b/docs/html/guide/topics/ui/images/hello-relativelayout.png
similarity index 100%
rename from docs/html/guide/tutorials/views/images/hello-relativelayout.png
rename to docs/html/guide/topics/ui/images/hello-relativelayout.png
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-tablelayout.png b/docs/html/guide/topics/ui/images/hello-tablelayout.png
similarity index 100%
rename from docs/html/guide/tutorials/views/images/hello-tablelayout.png
rename to docs/html/guide/topics/ui/images/hello-tablelayout.png
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-tabwidget.png b/docs/html/guide/topics/ui/images/hello-tabwidget.png
similarity index 100%
rename from docs/html/resources/tutorials/views/images/hello-tabwidget.png
rename to docs/html/guide/topics/ui/images/hello-tabwidget.png
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-webview.png b/docs/html/guide/topics/ui/images/hello-webview.png
similarity index 100%
rename from docs/html/resources/tutorials/views/images/hello-webview.png
rename to docs/html/guide/topics/ui/images/hello-webview.png
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/ic_tab_artists_grey.png b/docs/html/guide/topics/ui/images/ic_tab_artists_grey.png
similarity index 100%
rename from docs/html/resources/tutorials/views/images/ic_tab_artists_grey.png
rename to docs/html/guide/topics/ui/images/ic_tab_artists_grey.png
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/ic_tab_artists_white.png b/docs/html/guide/topics/ui/images/ic_tab_artists_white.png
similarity index 100%
rename from docs/html/resources/tutorials/views/images/ic_tab_artists_white.png
rename to docs/html/guide/topics/ui/images/ic_tab_artists_white.png
Binary files differ
diff --git a/docs/html/guide/topics/ui/index.jd b/docs/html/guide/topics/ui/index.jd
index be07249..f342b06 100644
--- a/docs/html/guide/topics/ui/index.jd
+++ b/docs/html/guide/topics/ui/index.jd
@@ -1,236 +1,61 @@
page.title=User Interface
+page.landing=true
+page.landing.intro=Your app's user interface is everything that the user can see and interact with. Android provides a variety of pre-build UI components such as structured layout objects and UI controls that allow you to build the graphical user interface for your app. Android also provides other UI modules for special interfaces such as dialogs, notifications, and menus.
+page.landing.image=images/ui/ui_index.png
+page.landing.next=overview.html
+
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div class="landing-docs">
- <h2>In this document</h2>
- <ol>
- <li><a href="#ViewHierarchy">View Hierarchy</a></li>
- <li><a href="#Layout">Layout</a></li>
- <li><a href="#Widgets">Widgets</a></li>
- <li><a href="#Events">Input Events</a></li>
- <li><a href="#Menus">Menus</a></li>
- <li><a href="#Advanced">Advanced Topics</a>
- <ol>
- <li><a href="#Adapters">Adapters</a></li>
- <li><a href="#StylesAndThemes">Styles and Themes</a></li>
- </ol>
- </li>
- </ol>
+ <div class="col-6">
+ <h3>Blog Articles</h3>
+
+ <a href="http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html">
+ <h4>Say Goodbye to the Menu Button</h4>
+ <p>As Ice Cream Sandwich rolls out to more devices, it’s important that you begin to migrate
+your designs to the action bar in order to promote a consistent Android user experience.</p> </a>
- <h2>Key classes</h2>
- <ol>
- <li>{@link android.view.View}</li>
- <li>{@link android.view.ViewGroup}</li>
- <li>{@link android.widget Widget classes}</li>
- </ol>
-</div>
+ <a href="http://android-developers.blogspot.com/2011/11/new-layout-widgets-space-and-gridlayout.html">
+ <h4>New Layout Widgets: Space and GridLayout</h4>
+ <p>Ice Cream Sandwich (ICS) sports two new widgets that have been designed to support the
+richer user interfaces made possible by larger displays: Space and GridLayout.</p> </a>
+
+ <a href="http://android-developers.blogspot.com/2011/04/customizing-action-bar.html">
+ <h4>Customizing the Action Bar</h4>
+ <p>By using the Action Bar in your Honeycomb-targeted apps, you'll give your users a familiar
+way to interact with your application.</p> </a>
+
+ <a href="http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html">
+ <h4>Horizontal View Swiping with ViewPager</h4>
+ <p>Whether you have just started out in Android app development or are a veteran of the craft,
+it probably won’t be too long before you’ll need to implement horizontally scrolling sets of views.
+</p> </a>
+ </div>
+
+ <div class="col-6">
+ <h3>Training</h3>
+
+ <a href="http://developer.android.com/training/implementing-navigation/index.html">
+ <h4>Implementing Effective Navigation</h4>
+ <p>This class shows you how to plan out the high-level screen hierarchy for your application
+and then choose appropriate forms of navigation to allow users to effectively and intuitively
+traverse your content.</p> </a>
+
+ <a href="http://developer.android.com/training/multiscreen/index.html">
+ <h4>Designing for Multiple Screens</h4>
+ <p>Android powers hundreds of device types with several different screen sizes, ranging from
+small phones to large TV sets. This class shows you how to implement a user interface that's
+optimized for several screen configurations.</p>
+ </a>
+
+ <a href="http://developer.android.com/training/improving-layouts/index.html">
+ <h4>Improving Layout Performance</h4>
+ <p>Layouts are a key part of Android applications that directly affect the user experience. If
+implemented poorly, your layout can lead to a memory hungry application with slow UIs. This
+class shows you how to avoid such problems.</p>
+ </a>
+ </div>
+
</div>
-<p>In an Android application, the user interface is built using {@link android.view.View} and
-{@link android.view.ViewGroup} objects. There are many types of views and view groups, each of which
-is a descendant of the {@link android.view.View} class.</p>
-
-<p>View objects are the basic units of user interface expression on the Android platform.
-The View class serves as the base for subclasses called "widgets," which offer fully implemented
-UI objects, like text fields and buttons. The ViewGroup class serves as the base for subclasses called "layouts,"
-which offer different kinds of layout architecture, like linear, tabular and relative.</p>
-
-<p>A View object is a data structure whose properties store the layout parameters and content for a specific
-rectangular area of the screen. A View object handles its own measurement, layout, drawing, focus change,
-scrolling, and key/gesture interactions for the rectangular area of the screen in which it resides. As an
-object in the user interface, a View is also a point of interaction for the user and the receiver
-of the interaction events.</p>
-
-
-<h2 id="ViewHierarchy">View Hierarchy</h2>
-
-<p>On the Android platform, you define an Activity's UI using a hierarchy of View and ViewGroup nodes,
-as shown in the diagram below. This hierarchy tree can be as simple or complex as you need it to be, and you
-can build it up using Android's set of predefined widgets and layouts, or with custom Views that you
-create yourself.</p>
-
-<img src="{@docRoot}images/viewgroup.png" alt="" />
-
-<p>
-In order to attach the view hierarchy tree to the screen for rendering, your Activity must call the
-<code>{@link android.app.Activity#setContentView(int) setContentView()}</code>
-method and pass a reference to the root node object. The Android system
-receives this reference and uses it to invalidate, measure, and draw the tree. The root node of the hierarchy requests
-that its child nodes draw themselves — in turn, each view group node is responsible for calling
-upon each of its own child views to draw themselves.
-The children may request a size and location within the parent, but the parent object has the final
-decision on where how big each child can be. Android parses
-the elements of your layout in-order (from the top of the hierarchy tree), instantiating the Views and
-adding them to their parent(s). Because these are drawn in-order, if there are elements that
-overlap positions, the last one to be drawn will lie on top of others previously drawn to that space.</p>
-
-<p>For a more detailed discussion on how view hierarchies are measured
-and drawn, read <a href="how-android-draws.html">How Android Draws Views</a>.</p>
-
-
-<h2 id="Layout">Layout</h2>
-
-<p>The most common way to define your layout and express the view hierarchy is with an XML layout file.
-XML offers a human-readable structure for the layout, much like HTML. Each element in XML is
-either a View or ViewGroup object (or descendant thereof). View objects are leaves in the tree,
-ViewGroup objects are branches in the tree (see the View Hierarchy figure above).</p>
-<p>The name of an XML element
-is respective to the Java class that it represents. So a <code><TextView></code> element creates
-a {@link android.widget.TextView} in your UI, and a <code><LinearLayout></code> element creates
-a {@link android.widget.LinearLayout} view group. When you load a layout resource,
-the Android system initializes these run-time objects, corresponding to the elements in your layout.</p>
-
-<p>For example, a simple vertical layout with a text view and a button looks like this:</p>
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
- <TextView android:id="@+id/text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello, I am a TextView" />
- <Button android:id="@+id/button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello, I am a Button" />
-</LinearLayout>
-</pre>
-
-<p>Notice that the LinearLayout element contains both the TextView and the Button. You can nest
-another LinearLayout (or other type of view group) inside here, to lengthen the view hierarchy and create a more
-complex layout.</p>
-
-<p>For more on building a UI layout, read <a href="declaring-layout.html">XML Layouts</a>.
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <p><b>Tip:</b> You can also draw View and ViewGroups objects in Java code,
- using the <code>{@link android.view.ViewGroup#addView(View)}</code> methods
- to dynamically insert new View and ViewGroup objects.</p>
-</div>
-</div>
-
-<p>There are a variety of ways in which you can layout your views. Using more and different kinds of view groups,
-you can structure child views and view groups in an infinite number of ways.
-Some pre-defined view groups offered by Android (called layouts) include LinearLayout, RelativeLayout,
-TableLayout, GridLayout and others. Each offers a unique set of layout parameters that are used to define the
-positions of child views and layout structure.</p>
-<p>To learn about some of the different kinds of view groups used for a layout,
-read <a href="layout-objects.html">Common Layout Objects</a>.</p>
-
-
-<h2 id="Widgets">Widgets</h2>
-
-<p>A widget is a View object that serves as an interface for interaction with the user.
-Android provides a set of fully implemented
-widgets, like buttons, checkboxes, and text-entry fields, so you can quickly build your UI.
-Some widgets provided by Android are more complex, like a date picker, a clock, and zoom controls.
-But you're not limited to the kinds of widgets provided by the Android platform. If you'd
-like to do something more customized and create your own actionable elements, you can, by defining your own
-View object or by extending and combining existing widgets.</p>
-<p>Read more in the <a href="custom-components.html">Custom Components</a> developer guide.</p>
-
-<p>For a list of the widgets provided by Android, see the {@link android.widget} package.</p>
-
-
-<h2 id="Events">Input Events</h2>
-
-<p>Once you've added some Views/widgets to the UI, you probably want to know about the
-user's interaction with them, so you can perform actions. To be informed of user input events, you
-need to do one of two things:</p>
-<ul>
- <li><strong>Define an event listener and register it with the View.</strong> More often than not,
-this is how you'll listen for events. The View class contains a collection of nested interfaces named
-On<em><something></em>Listener, each with a callback method called <code>On<em><something></em>()</code>.
-For example, {@link android.view.View.OnClickListener} (for handling "clicks" on a View),
-{@link android.view.View.OnTouchListener} (for handling touch screen events in a View), and
-{@link android.view.View.OnKeyListener} if you want to handle hardware key presses within a View. So if you want your View
-to be notified when it is "clicked" (such as when a button is selected), implement OnClickListener and define
-its <code>onClick()</code> callback method (where you perform the action upon click), and register it
-to the View with <code>{@link android.view.View#setOnClickListener(View.OnClickListener) setOnClickListener()}</code>.
-</li>
- <li><strong>Override an existing callback method for the View.</strong> This is
-what you should do when you've implemented your own View class and want to listen for specific events
-that occur within it. Example events you can handle include when the
-screen is touched (<code>{@link android.view.View#onTouchEvent(MotionEvent) onTouchEvent()}</code>), when
-the trackball is moved (<code>{@link android.view.View#onTrackballEvent(MotionEvent) onTrackballEvent()}</code>),
-or when a <em>hardware</em> key on the device is pressed (<code>{@link android.view.View#onKeyDown(int, KeyEvent)
-onKeyDown()}</code>). This allows you to define the default behavior for each event inside your custom View and determine
-whether the event should be passed on to some other child View. Again, these are callbacks to the View class,
-so your only chance to define them is when you
-<a href="{@docRoot}guide/topics/ui/custom-components.html">build a custom component</a>.
-</li>
-</ul>
-
-<p>Continue reading about handling user interaction with Views in the <a
-href="ui-events.html">Input Events</a> document.</p>
-
-
-<h2 id="Menus">Menus</h2>
-
-<p>Application menus are another important part of an application's UI. Menus offers a reliable interface that reveals
-application functions and settings. The most common application menu is revealed by pressing
-the <em>Menu</em> button on the device. However, you can also add Context Menus, which may be
-revealed when the user presses
-and holds down on an item.</p>
-
-<p>Menus are also structured using a View hierarchy, but you don't define this structure yourself. Instead,
-you define the <code>{@link android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()}</code> or
-<code>{@link android.app.Activity#onCreateContextMenu(ContextMenu,View,ContextMenu.ContextMenuInfo) onCreateContextMenu()}</code>
-callback methods for your Activity and declare the items that you want to include in your menu.
-At the appropriate time, Android will automatically create the necessary View hierarchy for the menu and
-draw each of your menu items in it.</p>
-
-<p>Menus also handle their own events, so there's no need to register event listeners on the items in your menu.
-When an item in your menu is selected, the <code>{@link android.app.Activity#onOptionsItemSelected(MenuItem)
-onOptionsItemSelected()}</code> or
-<code>{@link android.app.Activity#onContextItemSelected(MenuItem) onContextItemSelected()}</code>
-method will be called by the framework.</p>
-
-<p>And just like your application layout, you have the option to declare the items for you menu in an XML file.</p>
-
-<p>Read <a href="{@docRoot}guide/topics/ui/menus.html">Menus</a> to learn more.</p>
-
-
-<h2 id="Advanced">Advanced Topics</h2>
-
-<p>Once you've grappled the fundamentals of creating a user interface, you can explore
-some advanced features for creating a more complex application interface.</p>
-
-<h3 id="Adapters">Adapters</h3>
-
-<p>Sometimes you'll want to populate a view group with some information that can't be hard-coded, instead,
-you want to bind your view to an external source of data. To do this, you use an AdapterView as
-your view group and each child View is initialized and populated with data from the Adapter.</p>
-<p>The AdapterView object is an implementation of ViewGroup that determines its child views
-based on a given Adapter object. The Adapter acts like a courier between your data source (perhaps an
-array of external strings) and the AdapterView, which displays it. There are several implementations
-of the Adapter class, for specific tasks, such as the CursorAdapter for reading database data from a Cursor,
-or an ArrayAdapter for reading from an arbitrary array.</p>
-<p>To learn more about using an Adapter to populate your views, read
-<a href="binding.html">Binding to Data with AdapterView</a>.</p>
-
-
-<h3 id="StylesAndThemes">Styles and Themes</h3>
-
-<p>Perhaps you're not satisfied with the look of the standard widgets. To revise them, you can create some
-of your own styles and themes.</p>
-
-<ul>
- <li>A style is a set of one or more formatting attributes that you can apply as a unit to individual elements
-in your layout. For example, you could define a style that specifies a certain text size and color, then
-apply it to only specific View elements.</li>
- <li>A theme is a set of one or more formatting attributes that you can apply as a unit to all activities in
-an application, or just a single activity. For example, you could define a theme that sets specific colors for
-the window frame and the panel background, and sets text sizes and colors for menus. This theme can then be
-applied to specific activities or the entire application.</li>
-</ul>
-
-<p>Styles and themes are resources. Android provides some default style and theme resources that you can use,
-or you can declare your own custom style and theme resources.</p>
-<p>Learn more about using styles and themes in the
-<a href="themes.html">Styles and Themes</a> document.</p>
diff --git a/docs/html/guide/topics/ui/layout-objects.jd b/docs/html/guide/topics/ui/layout-objects.jd
index e251fe9..1d15ad60 100644
--- a/docs/html/guide/topics/ui/layout-objects.jd
+++ b/docs/html/guide/topics/ui/layout-objects.jd
@@ -1,291 +1,6 @@
-page.title=Common Layout Objects
+page.title=Layouts
parent.title=User Interface
parent.link=index.html
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#framelayout">FrameLayout</a></li>
- <li><a href="#linearlayout">LinearLayout</a></li>
- <li><a href="#tablelayout">TableLayout</a></li>
- <li><a href="#relativelayout">RelativeLayout</a></li>
- <li><a href="#viewgroupsummary">Summary of Important View Groups</a></li>
- </ol>
-</div>
-</div>
-
-<p>This section describes some of the more common types of layout objects
-to use in your applications. Like all layouts, they are subclasses of {@link android.view.ViewGroup ViewGroup}.</p>
-
-<p>Also see the <a href="{@docRoot}resources/tutorials/views/index.html">Hello Views</a> tutorials for
-some guidance on using more Android View layouts.</p>
-
-<h2 id="framelayout">FrameLayout</h2>
-<p>{@link android.widget.FrameLayout FrameLayout} is the simplest type of layout
-object. It's basically a blank space on your screen that you can
-later fill with a single object — for example, a picture that you'll swap in and out.
-All child elements of the FrameLayout are pinned to the top left corner of the screen; you cannot
-specify a different location for a child view. Subsequent child views will simply be drawn over previous ones,
-partially or totally obscuring them (unless the newer object is transparent).
-</p>
-
-
-<h2 id="linearlayout">LinearLayout</h2>
-<p>{@link android.widget.LinearLayout LinearLayout} aligns all children in a
-single direction — vertically or horizontally, depending on how you
-define the <code>orientation</code> attribute. All children are
-stacked one after the other, so a vertical list will only have one child per
-row, no matter how wide they are, and a horizontal list will only be one row
-high (the height of the tallest child, plus padding). A {@link
-android.widget.LinearLayout LinearLayout} respects <em>margin</em>s between children
-and the <em>gravity</em> (right, center, or left alignment) of each child. </p>
-
-<p>{@link android.widget.LinearLayout LinearLayout} also supports assigning a
-<em>weight</em> to individual children. This attribute assigns an "importance" value to a view,
-and allows it to expand to fill any remaining space in the parent view.
-Child views can specify an integer weight value, and then any remaining space in the view group is
-assigned to children in the proportion of their declared weight. Default
-weight is zero. For example, if there are three text boxes and two of
-them declare a weight of 1, while the other is given no weight (0), the third text box without weight
-will not grow and will only occupy the area required by its content.
-The other two will expand equally to fill the space remaining after all three boxes are measured.
-If the third box is then given a weight of 2 (instead of 0), then it is now declared
-"more important" than both the others, so it gets half the total remaining space, while the first two
-share the rest equally.</p>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<p><strong>Tip</strong>: To create a proportionate size
-layout on the screen, create a container view group object with the
-<code>layout_width</code> and <code>layout_height</code> attributes set to <var>fill_parent</var>; assign
-the children <code>height</code> or <code>width</code> to <code>0</code> (zero); then assign relative
-<code>weight</code> values
-to each child, depending on what proportion of the screen each should
-have.</p>
-</div>
-</div>
-
-<p>The following two forms represent a {@link android.widget.LinearLayout LinearLayout} with a set of elements: a
-button, some labels and text boxes. The text boxes have their width set to <var>fill_parent</var>; other
-elements are set to <var>wrap_content</var>. The gravity, by default, is left.
-The difference between the two versions of the form is that the form
-on the left has weight values unset (0 by default), while the form on the right has
-the comments text box weight set to 1. If the Name textbox had also been set
-to 1, the Name and Comments text boxes would be the same height. </p>
-
-<img src="{@docRoot}images/linearlayout.png" alt="" />
-
-<p>Within a horizontal {@link android.widget.LinearLayout LinearLayout}, items are aligned by the position of
-their text base line (the first line of the first list element — topmost or
-leftmost — is considered the reference line). This is so that people scanning
-elements in a form shouldn't have to jump up and down to read element text in
-neighboring elements. This can be turned off by setting
-<code>android:baselineAligned="false"</code> in the layout XML. </p>
-
-<p>To view other sample code, see the
-<a href="{@docRoot}resources/tutorials/views/hello-linearlayout.html">Hello LinearLayout</a> tutorial.</p>
-
-
-<h2 id="tablelayout">TableLayout</h2>
-<p>{@link android.widget.TableLayout} positions its children into rows
- and columns. TableLayout containers do not display border lines for their rows, columns,
- or cells. The table will have as many columns as the row with the most cells. A table can leave
-cells empty, but cells cannot span columns, as they can in HTML.</p>
-<p>{@link android.widget.TableRow} objects are the child views of a TableLayout
-(each TableRow defines a single row in the table).
-Each row has zero or more cells, each of which is defined by any kind of other View. So, the cells of a row may be
-composed of a variety of View objects, like ImageView or TextView objects.
-A cell may also be a ViewGroup object (for example, you can nest another TableLayout as a cell).</p>
-<p>The following sample layout has two rows and two cells in each. The accompanying screenshot shows the
-result, with cell borders displayed as dotted lines (added for visual effect). </p>
-
-<table class="columns">
- <tr>
- <td>
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:stretchColumns="1">
- <TableRow>
- <TextView
- android:text="@string/table_layout_4_open"
- android:padding="3dip" />
- <TextView
- android:text="@string/table_layout_4_open_shortcut"
- android:gravity="right"
- android:padding="3dip" />
- </TableRow>
-
- <TableRow>
- <TextView
- android:text="@string/table_layout_4_save"
- android:padding="3dip" />
- <TextView
- android:text="@string/table_layout_4_save_shortcut"
- android:gravity="right"
- android:padding="3dip" />
- </TableRow>
-</TableLayout>
-</pre></td>
- <td><img src="{@docRoot}images/table_layout.png" alt="" style="margin:0" /></td>
- </tr>
-</table>
-
-<p>Columns can be hidden, marked to stretch and fill the available screen space,
- or can be marked as shrinkable to force the column to shrink until the table
- fits the screen. See the {@link android.widget.TableLayout TableLayout reference}
-documentation for more details. </p>
-
-<p>To view sample code, see the <a href="{@docRoot}resources/tutorials/views/hello-tablelayout.html">Hello
-TableLayout</a> tutorial.</p>
-
-
-<h2 id="relativelayout">RelativeLayout</h2>
-<p>{@link android.widget.RelativeLayout} lets child views specify their
- position relative to the parent view or to each other (specified by ID). So you can
- align two elements by right border, or make one below another, centered in
- the screen, centered left, and so on. Elements are rendered in the order given, so if the first element
- is centered in the screen, other elements aligning themselves to that element
- will be aligned relative to screen center. Also, because of this ordering, if using XML to specify this layout,
- the element that you will reference (in order to position other view objects) must be listed in the XML
-file before you refer to it from the other views via its reference ID. </p>
-<p>The example below shows an XML file and the resulting screen in the UI.
-Note that the attributes that refer to relative elements (e.g., <var>layout_toLeft</var>)
-refer to the ID using the syntax of a relative resource
-(<var>@id/<em>id</em></var>). </p>
-
-<table class="columns">
- <tr>
- <td>
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/blue"
- android:padding="10px" >
-
- <TextView android:id="@+id/label"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Type here:" />
-
- <EditText android:id="@+id/entry"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@android:drawable/editbox_background"
- android:layout_below="@id/label" />
-
- <Button android:id="@+id/ok"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/entry"
- android:layout_alignParentRight="true"
- android:layout_marginLeft="10px"
- android:text="OK" />
-
- <Button android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toLeftOf="@id/ok"
- android:layout_alignTop="@id/ok"
- android:text="Cancel" />
-</RelativeLayout>
-</pre></td>
- <td><img src="{@docRoot}images/designing_ui_layout_example.png" alt="" style="margin:0" /></td>
- </tr>
-</table>
-
-
-<p>Some of these properties are supported directly by
- the element, and some are supported by its LayoutParams member (subclass RelativeLayout
- for all the elements in this screen, because all elements are children of a RelativeLayout
- parent object). The defined RelativeLayout parameters are: <code>width</code>, <code>height</code>,
- <code>below</code>, <code>alignTop</code>, <code>toLeft</code>, <code>padding[Bottom|Left|Right|Top]</code>,
- and <code>margin[Bottom|Left|Right|Top]</code>. Note that some of these parameters specifically support
- relative layout positions — their values must be the ID of the element to which you'd like this view laid relative.
- For example, assigning the parameter <code>toLeft="my_button"</code> to a TextView would place the TextView to
- the left of the View with the ID <var>my_button</var> (which must be written in the XML <em>before</em> the TextView). </p>
-
-<p>To view this sample code, see the <a href="{@docRoot}resources/tutorials/views/hello-relativelayout.html">Hello
-RelativeLayout</a> tutorial.</p>
-
-
-<h2 id="viewgroupsummary">Summary of Important View Groups</h2>
-<p>These objects all hold child UI elements. Some provide their own form of a visible UI, while others
- are invisible structures that only manage the layout of their child views. </p>
-<table width="100%" border="1">
- <tr>
- <th scope="col">Class</th>
- <th scope="col">Description</th>
- </tr>
- <tr>
- <td>{@link android.widget.FrameLayout FrameLayout}</td>
- <td>Layout that acts as a view frame to display
- a single object. </td>
- </tr>
- <tr>
- <td>{@link android.widget.Gallery Gallery} </td>
- <td>A horizontal scrolling display of images, from a bound list. </td>
- </tr>
- <tr>
- <td>{@link android.widget.GridView GridView} </td>
- <td>Displays a scrolling grid of m columns and n rows.</td>
- </tr>
- <tr>
- <td>{@link android.widget.LinearLayout LinearLayout} </td>
- <td>A layout that organizes its children into a single horizontal or vertical
- row. It creates a scrollbar if the length of the window exceeds the length
- of the screen. </td>
- </tr>
- <tr>
- <td>{@link android.widget.ListView ListView} </td>
- <td>Displays a scrolling single column list. </td>
- </tr>
- <tr>
- <td>{@link android.widget.RelativeLayout RelativeLayout} </td>
- <td>Enables you to specify the location of child objects relative to each
- other (child A to the left of child B) or to the parent (aligned to the
- top of the parent). </td>
- </tr>
- <tr>
- <td>{@link android.widget.ScrollView ScrollView} </td>
- <td>A vertically scrolling column of elements. </td>
- </tr>
- <tr>
- <td>{@link android.widget.Spinner Spinner} </td>
- <td>Displays a single item at a time from a bound list, inside a one-row
- textbox. Rather like a one-row listbox that can scroll either horizontally
- or vertically. </td>
- </tr>
- <tr>
- <td>{@link android.view.SurfaceView SurfaceView} </td>
- <td>Provides direct access to a dedicated drawing surface. It can hold child
- views layered on top of the surface, but is intended for applications
- that need to draw pixels, rather than using widgets. </td>
- </tr>
- <tr>
- <td>{@link android.widget.TabHost TabHost} </td>
- <td>Provides a tab selection list that monitors clicks and enables the application
- to change the screen whenever a tab is clicked. </td>
- </tr>
- <tr>
- <td>{@link android.widget.TableLayout TableLayout} </td>
- <td>A tabular layout with an arbitrary number of rows and columns, each cell
- holding the widget of your choice. The rows resize to fit the largest
- column. The cell borders are not
- visible. </td>
- </tr>
- <tr>
- <td>{@link android.widget.ViewFlipper ViewFlipper} </td>
- <td>A list that displays one item at a time, inside a one-row textbox. It
- can be set to swap items at timed intervals, like a slide show. </td>
- </tr>
- <tr>
- <td>{@link android.widget.ViewSwitcher ViewSwitcher} </td>
- <td>Same as ViewFlipper. </td>
- </tr>
-</table>
+<p>You should have been redirected to <a href="declaring-layout.html">Layouts</a>.</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/ui/layout/grid.jd b/docs/html/guide/topics/ui/layout/grid.jd
new file mode 100644
index 0000000..52f453b
--- /dev/null
+++ b/docs/html/guide/topics/ui/layout/grid.jd
@@ -0,0 +1,187 @@
+page.title=Table
+parent.title=Layouts
+parent.link=layout-objects.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+ <ol>
+ <li><a href="#example">Example</a></li>
+ </ol>
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.widget.TableLayout}</li>
+ <li>{@link android.widget.TableRow}</li>
+ <li>{@link android.widget.TextView}</li>
+ </ol>
+</div>
+</div>
+<p>{@link android.widget.TableLayout} is a {@link android.view.ViewGroup} that
+displays child {@link android.view.View} elements in rows and columns.</p>
+
+
+<img src="{@docRoot}images/ui/gridlayout.png" alt="" />
+
+<p>{@link android.widget.TableLayout} positions its children into rows
+ and columns. TableLayout containers do not display border lines for their rows, columns,
+ or cells. The table will have as many columns as the row with the most cells. A table can leave
+cells empty, but cells cannot span columns, as they can in HTML.</p>
+<p>{@link android.widget.TableRow} objects are the child views of a TableLayout
+(each TableRow defines a single row in the table).
+Each row has zero or more cells, each of which is defined by any kind of other View. So, the cells of a row may be
+composed of a variety of View objects, like ImageView or TextView objects.
+A cell may also be a ViewGroup object (for example, you can nest another TableLayout as a cell).</p>
+<p>The following sample layout has two rows and two cells in each. The accompanying screenshot shows the
+result, with cell borders displayed as dotted lines (added for visual effect). </p>
+
+<table class="columns">
+ <tr>
+ <td>
+ <pre>
+<?xml version="1.0" encoding="utf-8"?>
+<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:stretchColumns="1">
+ <TableRow>
+ <TextView
+ android:text="@string/table_layout_4_open"
+ android:padding="3dip" />
+ <TextView
+ android:text="@string/table_layout_4_open_shortcut"
+ android:gravity="right"
+ android:padding="3dip" />
+ </TableRow>
+
+ <TableRow>
+ <TextView
+ android:text="@string/table_layout_4_save"
+ android:padding="3dip" />
+ <TextView
+ android:text="@string/table_layout_4_save_shortcut"
+ android:gravity="right"
+ android:padding="3dip" />
+ </TableRow>
+</TableLayout>
+</pre></td>
+ <td><img src="{@docRoot}images/table_layout.png" alt="" style="margin:0" /></td>
+ </tr>
+</table>
+
+<p>Columns can be hidden, marked to stretch and fill the available screen space,
+ or can be marked as shrinkable to force the column to shrink until the table
+ fits the screen. See the {@link android.widget.TableLayout TableLayout reference}
+documentation for more details. </p>
+
+
+<h2 id="example">Example</h2>
+<ol>
+ <li>Start a new project named <em>HelloTableLayout</em>.</li>
+ <li>Open the <code>res/layout/main.xml</code> file and insert the following:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:stretchColumns="1">
+
+ <TableRow>
+ <TextView
+ android:layout_column="1"
+ android:text="Open..."
+ android:padding="3dip" />
+ <TextView
+ android:text="Ctrl-O"
+ android:gravity="right"
+ android:padding="3dip" />
+ </TableRow>
+
+ <TableRow>
+ <TextView
+ android:layout_column="1"
+ android:text="Save..."
+ android:padding="3dip" />
+ <TextView
+ android:text="Ctrl-S"
+ android:gravity="right"
+ android:padding="3dip" />
+ </TableRow>
+
+ <TableRow>
+ <TextView
+ android:layout_column="1"
+ android:text="Save As..."
+ android:padding="3dip" />
+ <TextView
+ android:text="Ctrl-Shift-S"
+ android:gravity="right"
+ android:padding="3dip" />
+ </TableRow>
+
+ <View
+ android:layout_height="2dip"
+ android:background="#FF909090" />
+
+ <TableRow>
+ <TextView
+ android:text="X"
+ android:padding="3dip" />
+ <TextView
+ android:text="Import..."
+ android:padding="3dip" />
+ </TableRow>
+
+ <TableRow>
+ <TextView
+ android:text="X"
+ android:padding="3dip" />
+ <TextView
+ android:text="Export..."
+ android:padding="3dip" />
+ <TextView
+ android:text="Ctrl-E"
+ android:gravity="right"
+ android:padding="3dip" />
+ </TableRow>
+
+ <View
+ android:layout_height="2dip"
+ android:background="#FF909090" />
+
+ <TableRow>
+ <TextView
+ android:layout_column="1"
+ android:text="Quit"
+ android:padding="3dip" />
+ </TableRow>
+</TableLayout>
+</pre>
+<p>Notice how this resembles the structure of an HTML table. The {@link android.widget.TableLayout}
+element is like the HTML <code><table></code> element; {@link android.widget.TableRow} is like
+a <code>><tr>></code> element;
+but for the cells, you can use any kind of {@link android.view.View} element. In this example, a
+{@link android.widget.TextView} is used for each cell. In between some of the rows, there is also a
+basic {@link android.view.View}, which is used to draw a horizontal line.</p>
+
+</li>
+<li>Make sure your <em>HelloTableLayout</em> Activity loads this layout in the
+{@link android.app.Activity#onCreate(Bundle) onCreate()} method:
+<pre>
+public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+}
+</pre>
+<p>The {@link android.app.Activity#setContentView(int)} method loads the
+layout file for the {@link android.app.Activity}, specified by the resource
+ID — <code>R.layout.main</code> refers to the <code>res/layout/main.xml</code> layout
+file.</p>
+</li>
+<li>Run the application.</li>
+</ol>
+<p>You should see the following:</p>
+<img src="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
new file mode 100644
index 0000000..284a25a
--- /dev/null
+++ b/docs/html/guide/topics/ui/layout/gridview.jd
@@ -0,0 +1,191 @@
+page.title=Grid
+parent.title=Layouts
+parent.link=layout-objects.html
+@jd:body
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+ <ol>
+ <li><a href="#example">Example</a></li>
+ </ol>
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.widget.GridView}</li>
+ <li>{@link android.widget.ImageView}</li>
+ <li>{@link android.widget.BaseAdapter}</li>
+ <li>{@link android.widget.AdapterView.OnItemClickListener}</li>
+ </ol>
+</div>
+</div>
+<p>{@link android.widget.GridView} is a {@link android.view.ViewGroup} that displays items in a
+two-dimensional,
+scrollable grid. The grid items are automatically inserted to the layout using a {@link
+android.widget.ListAdapter}.</p>
+
+<img src="{@docRoot}images/ui/gridview.png" alt="" />
+
+
+<h2 id="example">Example</h2>
+<p>In this tutorial, you'll create a grid of image thumbnails. When an item is selected, a
+toast message will display the position of the image.</p>
+
+
+<ol>
+ <li>Start a new project named <em>HelloGridView</em>.</li>
+ <li>Find some photos you'd like to use, or <a
+href="{@docRoot}shareables/sample_images.zip">download these sample images</a>. Save the image files
+into the project's
+<code>res/drawable/</code> directory.</li>
+ <li>Open the <code>res/layout/main.xml</code> file and insert the following:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<GridView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/gridview"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:columnWidth="90dp"
+ android:numColumns="auto_fit"
+ android:verticalSpacing="10dp"
+ android:horizontalSpacing="10dp"
+ android:stretchMode="columnWidth"
+ android:gravity="center"
+/>
+</pre>
+ <p>This {@link android.widget.GridView} will fill the entire screen. The attributes are rather
+self explanatory. For more information about valid attributes, see the {@link
+android.widget.GridView} reference.</p>
+</li>
+ <li>Open <code>HelloGridView.java</code> and insert the following code for the
+{@link android.app.Activity#onCreate(Bundle) onCreate()} method:
+<pre>
+public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ GridView gridview = (GridView) findViewById(R.id.gridview);
+ gridview.setAdapter(new ImageAdapter(this));
+
+ gridview.setOnItemClickListener(new OnItemClickListener() {
+ public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
+ Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show();
+ }
+ });
+}
+</pre>
+ <p>After the {@code main.xml} layout is set for the content view, the
+{@link android.widget.GridView} is captured from the layout with {@link
+android.app.Activity#findViewById(int)}. The {@link
+android.widget.GridView#setAdapter(T) setAdapter()} method then sets a custom adapter ({@code
+ImageAdapter}) as the source for all items to be displayed in the grid. The {@code ImageAdapter} is
+created in the next step.</p>
+<p>To do something when an item in the grid is clicked, the {@link
+android.widget.AdapterView#setOnItemClickListener(OnItemClickListener) setOnItemClickListener()}
+method is passed a new {@link android.widget.AdapterView.OnItemClickListener}. This anonymous
+instance defines the {@link
+android.widget.AdapterView.OnItemClickListener#onItemClick(AdapterView,View,int,long)
+onItemClick()} callback method to show a {@link android.widget.Toast} that displays the index
+position (zero-based) of the selected item (in a real world scenario, the position could be used to
+get the full sized
+image for some other task).</p>
+
+</li>
+<li>Create a new class called <code>ImageAdapter</code> that extends {@link
+android.widget.BaseAdapter}:
+<pre>
+public class ImageAdapter extends BaseAdapter {
+ private Context mContext;
+
+ public ImageAdapter(Context c) {
+ mContext = c;
+ }
+
+ public int getCount() {
+ return mThumbIds.length;
+ }
+
+ public Object getItem(int position) {
+ return null;
+ }
+
+ public long getItemId(int position) {
+ return 0;
+ }
+
+ // 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
+ imageView = new ImageView(mContext);
+ imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
+ imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
+ imageView.setPadding(8, 8, 8, 8);
+ } else {
+ imageView = (ImageView) convertView;
+ }
+
+ imageView.setImageResource(mThumbIds[position]);
+ return imageView;
+ }
+
+ // references to our images
+ private Integer[] mThumbIds = {
+ R.drawable.sample_2, R.drawable.sample_3,
+ R.drawable.sample_4, R.drawable.sample_5,
+ R.drawable.sample_6, R.drawable.sample_7,
+ R.drawable.sample_0, R.drawable.sample_1,
+ R.drawable.sample_2, R.drawable.sample_3,
+ R.drawable.sample_4, R.drawable.sample_5,
+ R.drawable.sample_6, R.drawable.sample_7,
+ R.drawable.sample_0, R.drawable.sample_1,
+ R.drawable.sample_2, R.drawable.sample_3,
+ R.drawable.sample_4, R.drawable.sample_5,
+ R.drawable.sample_6, R.drawable.sample_7
+ };
+}
+</pre>
+<p>First, this implements some required methods inherited from {@link
+android.widget.BaseAdapter}. The constructor and {@link
+android.widget.Adapter#getCount()} are self-explanatory. Normally, {@link
+android.widget.Adapter#getItem(int)} should return the actual object at the specified position in
+the adapter, but it's ignored for this example. Likewise, {@link
+android.widget.Adapter#getItemId(int)} should return the row id of the item, but it's not
+needed here.</p>
+
+<p>The first method necessary is {@link android.widget.Adapter#getView(int,View,ViewGroup)
+getView()}. This method creates a new {@link android.view.View} for each image added to the {@code
+ImageAdapter}. When this is called, a {@link android.view.View} is passed in, which is normally a
+recycled object (at least after this has been called once), so there's a check to see if the
+object is null. If it <em>is</em> null, an {@link android.widget.ImageView} is instantiated and
+configured with desired properties for the image presentation:</p>
+<ul>
+ <li>{@link android.view.View#setLayoutParams(ViewGroup.LayoutParams)} sets
+the height and width for the View—this ensures that, no matter the size of the drawable, each
+image is resized and cropped to fit in these dimensions, as appropriate.</li>
+ <li>{@link android.widget.ImageView#setScaleType(ImageView.ScaleType)} declares that images should
+be cropped toward the center (if necessary).</li>
+ <li>{@link android.widget.ImageView#setPadding(int,int,int,int)} defines the padding for all
+sides. (Note that, if the images have different aspect-ratios, then less
+padding will cause for more cropping of the image if it does not match
+the dimensions given to the ImageView.)</li>
+</ul>
+
+<p>If the {@link android.view.View} passed to {@link
+android.widget.Adapter#getView(int,View,ViewGroup) getView()} is <em>not</em> null, then the local
+{@link android.widget.ImageView} is initialized with the recycled {@link android.view.View}
+object.</p>
+
+<p>At the end of the {@link android.widget.Adapter#getView(int,View,ViewGroup) getView()} method,
+the {@code
+position} integer passed into the method is used to select an image from the {@code mThumbIds}
+array, which is set as the image resource for the {@link android.widget.ImageView}.</p>
+<p>All that's left is to define the {@code mThumbIds} array of drawable resources.</p>
+</li>
+<li>Run the application.</li>
+</ol>
+
+<p>Try experimenting with the behaviors of the {@link android.widget.GridView} and {@link
+android.widget.ImageView} elements by adjusting their properties. For example, instead of using
+{@link android.view.View#setLayoutParams(ViewGroup.LayoutParams)}, try using
+{@link android.widget.ImageView#setAdjustViewBounds(boolean)}. </p>
+
+
diff --git a/docs/html/guide/topics/ui/layout/linear.jd b/docs/html/guide/topics/ui/layout/linear.jd
new file mode 100644
index 0000000..8e33706
--- /dev/null
+++ b/docs/html/guide/topics/ui/layout/linear.jd
@@ -0,0 +1,116 @@
+page.title=Linear Layout
+parent.title=Layouts
+parent.link=layout-objects.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+<ol>
+ <li><a href="#Weight">Layout Weight</a></li>
+ <li><a href="#Example">Example</a></li>
+</ol>
+
+<h2>Key classes</h2>
+<ol>
+ <li>{@link android.widget.LinearLayout}</li>
+ <li>{@link android.widget.LinearLayout.LayoutParams}</li>
+</ol>
+</div>
+</div>
+
+<p>{@link android.widget.LinearLayout} is a view group that aligns all children in a single
+direction, vertically or horizontally. You can specify the layout direction with the
+<a href="{@docRoot}reference/android/widget/LinearLayout.html#attr_android:orientation">{@code
+android:orientation}</a> attribute.</p>
+
+<img src="{@docRoot}images/ui/linearlayout.png" alt="" />
+
+<p>All children of a {@link android.widget.LinearLayout} are
+stacked one after the other, so a vertical list will only have one child per
+row, no matter how wide they are, and a horizontal list will only be one row
+high (the height of the tallest child, plus padding). A {@link
+android.widget.LinearLayout LinearLayout} respects <em>margin</em>s between children
+and the <em>gravity</em> (right, center, or left alignment) of each child. </p>
+
+
+<h2 id="Weight">Layout Weight</h2>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <h3>Equally weighted children</h3>
+<p>To create a linear layout in which each child uses the same amount of
+space on the screen, set the <a
+href="{@docRoot}reference/android/view/ViewGroup.LayoutParams.html#attr_android:layout_height"
+>{@code android:layout_height}</a> of each view to {@code "0dp"} (for a
+vertical layout) or the <a
+href="{@docRoot}reference/android/view/ViewGroup.LayoutParams.html#attr_android:layout_width"
+>{@code android:layout_width}</a> of each view to {@code "0dp"} (for a
+horizontal
+layout). Then set the <a
+href="{@docRoot}reference/android/widget/LinearLayout.LayoutParams.html#attr_android:layout_weight"
+>{@code android:layout_weight}</a> of each view to {@code "1"}.</p>
+</div>
+</div>
+
+
+<p>{@link android.widget.LinearLayout} also supports assigning a
+<em>weight</em> to individual children with the <a
+href="{@docRoot}reference/android/widget/LinearLayout.LayoutParams.html#attr_android:layout_weight"
+>{@code android:layout_weight}</a> attribute.
+This attribute assigns an "importance" value to a view in
+terms of how much space is should occupy on the screen. A larger weight value allows it to expand
+to fill any remaining space in the parent view.
+Child views can specify a weight value, and then any remaining space in the view group is
+assigned to children in the proportion of their declared weight. Default
+weight is zero.</p>
+
+<p>For example, if there are three text fields and two of them declare a weight of 1, while the
+other is given no weight, the third text field without weight will not grow and will only occupy the
+area required by its content. The other two will expand equally to fill the space remaining after
+all three fields are measured. If the third field is then given a weight of 2 (instead of 0), then
+it is now declared more important than both the others, so it gets half the total remaining space,
+while the first two
+share the rest equally.</p>
+
+
+<h2 id="Example">Example</h2>
+
+<div class="figure" style="width:220px;margin-top:0">
+<img src="{@docRoot}images/ui/sample-linearlayout.png" alt="" />
+</div>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:orientation="vertical" >
+ <EditText
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/to" />
+ <EditText
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/subject" />
+ <EditText
+ android:layout_width="fill_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:gravity="top"
+ android:hint="@string/message" />
+ <Button
+ android:layout_width="100dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="right"
+ android:text="@string/send" />
+</LinearLayout>
+</pre>
+
+<p>For details about the attributes available to each child view of a {@link
+android.widget.LinearLayout}, see {@link android.widget.LinearLayout.LayoutParams}.</p>
+
+
diff --git a/docs/html/guide/topics/ui/layout/listview.jd b/docs/html/guide/topics/ui/layout/listview.jd
new file mode 100644
index 0000000..26a7597
--- /dev/null
+++ b/docs/html/guide/topics/ui/layout/listview.jd
@@ -0,0 +1,151 @@
+page.title=List View
+parent.title=Layouts
+parent.link=declaring-layout.html
+@jd:body
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+ <ol>
+ <li><a href="#Loader">Using a Loader</a></li>
+ <li><a href="#Example">Example</a></li>
+ </ol>
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.widget.ListView}</li>
+ <li>{@link android.widget.Adapter}</li>
+ <li>{@link android.support.v4.content.CursorLoader}</li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a
+href="{@docRoot}guide/components/loaders.html">Loaders</a></li>
+ </ol>
+</div>
+</div>
+
+<p>{@link android.widget.ListView} is a view group that displays a list of
+scrollable items. The list items are automatically inserted to the list using an {@link
+android.widget.Adapter} that pulls content from a source such as an array or database query and
+converts each item result into a view that's placed into the list.</p>
+
+<img src="{@docRoot}images/ui/listview.png" alt="" />
+
+<h2 id="Loader">Using a Loader</h2>
+
+<p>Using a {@link
+android.support.v4.content.CursorLoader} is the standard way to query a {@link
+android.database.Cursor} as an asynchronous task in order to avoid blocking your app's main thread
+with the query. When the {@link android.support.v4.content.CursorLoader} receives the {@link
+android.database.Cursor} result, the {@link android.support.v4.app.LoaderManager.LoaderCallbacks
+LoaderCallbacks} receives a callback to {@link
+android.support.v4.app.LoaderManager.LoaderCallbacks#onLoadFinished onLoadFinished()}, which is
+where you update your {@link
+android.widget.Adapter} with the new {@link android.database.Cursor} and the list view then
+displays the results.</p>
+
+<p>Although the {@link android.support.v4.content.CursorLoader} APIs were first introduced in
+Android 3.0 (API level 11), they are also available in the <a
+href="{@docRoot}tools/extras/support-library.html">Support Library</a> so that your app may use them
+while supporting devices running Android 1.6 or higher.</p>
+
+<p>For more information about using a {@link
+android.support.v4.content.Loader} to asynchronously load data, see the <a
+href="{@docRoot}guide/components/loaders.html">Loaders</a> guide.</p>
+
+
+<h2 id="Example">Example</h2>
+
+<p>The following example uses {@link android.app.ListActivity}, which is an activity that includes
+a {@link android.widget.ListView} as its only layout element by default. It performs a query to
+the <a
+href="{@docRoot}guide/topics/providers/contacts-provider.html">Contacts
+Provider</a> for a list of names and phone numbers.</p>
+
+<p>The activity implements the {@link android.support.v4.app.LoaderManager.LoaderCallbacks
+LoaderCallbacks} interface in order to use a {@link android.support.v4.content.CursorLoader} that
+dynamically loads the data for the list view.</p>
+
+<pre>
+public class ListViewLoader extends ListActivity
+ implements LoaderManager.LoaderCallbacks<Cursor> {
+
+ // This is the Adapter being used to display the list's data
+ SimpleCursorAdapter mAdapter;
+
+ // These are the Contacts rows that we will retrieve
+ static final String[] PROJECTION = new String[] {ContactsContract.Data._ID,
+ ContactsContract.Data.DISPLAY_NAME};
+
+ // This is the select criteria
+ static final String SELECTION = "((" +
+ ContactsContract.Data.DISPLAY_NAME + " NOTNULL) AND (" +
+ ContactsContract.Data.DISPLAY_NAME + " != '' ))";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Create a progress bar to display while the list loads
+ ProgressBar progressBar = new ProgressBar(this);
+ progressBar.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
+ LayoutParams.WRAP_CONTENT, Gravity.CENTER));
+ progressBar.setIndeterminate(true);
+ getListView().setEmptyView(progressBar);
+
+ // Must add the progress bar to the root of the layout
+ ViewGroup root = (ViewGroup) findViewById(android.R.id.content);
+ root.addView(progressBar);
+
+ // For the cursor adapter, specify which columns go into which views
+ String[] fromColumns = {ContactsContract.Data.DISPLAY_NAME};
+ int[] toViews = {android.R.id.text1}; // The TextView in simple_list_item_1
+
+ // Create an empty adapter we will use to display the loaded data.
+ // We pass null for the cursor, then update it in onLoadFinished()
+ mAdapter = new SimpleCursorAdapter(this,
+ android.R.layout.simple_list_item_1, null,
+ fromColumns, toViews, 0);
+ setListAdapter(mAdapter);
+
+ // Prepare the loader. Either re-connect with an existing one,
+ // or start a new one.
+ getLoaderManager().initLoader(0, null, this);
+ }
+
+ // Called when a new Loader needs to be created
+ public Loader<Cursor> onCreateLoader(int id, Bundle args) {
+ // Now create and return a CursorLoader that will take care of
+ // creating a Cursor for the data being displayed.
+ return new CursorLoader(this, ContactsContract.Data.CONTENT_URI,
+ PROJECTION, SELECTION, null, null);
+ }
+
+ // Called when a previously created loader has finished loading
+ public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
+ // Swap the new cursor in. (The framework will take care of closing the
+ // old cursor once we return.)
+ mAdapter.swapCursor(data);
+ }
+
+ // Called when a previously created loader is reset, making the data unavailable
+ public void onLoaderReset(Loader<Cursor> loader) {
+ // This is called when the last Cursor provided to onLoadFinished()
+ // above is about to be closed. We need to make sure we are no
+ // longer using it.
+ mAdapter.swapCursor(null);
+ }
+
+ @Override
+ public void onListItemClick(ListView l, View v, int position, long id) {
+ // Do something when a list item is clicked
+ }
+}
+</pre>
+
+<p class="note"><strong>Note:</strong> Because this sample performs a query on the <a
+href="{@docRoot}guide/topics/providers/contacts-provider.html">Contacts
+Provider</a>, if you want to
+try this code, your app must request the {@link android.Manifest.permission#READ_CONTACTS}
+permission in the manifest file:<br/>
+<code><uses-permission android:name="android.permission.READ_CONTACTS" /></p>
+
diff --git a/docs/html/guide/topics/ui/layout/relative.jd b/docs/html/guide/topics/ui/layout/relative.jd
new file mode 100644
index 0000000..ee6cf02
--- /dev/null
+++ b/docs/html/guide/topics/ui/layout/relative.jd
@@ -0,0 +1,118 @@
+page.title=Relative Layout
+parent.title=Layouts
+parent.link=layout-objects.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+ <ol>
+ <li><a href="#Position">Positioning Views</a></li>
+ <li><a href="#Example">Example</a></li>
+ </ol>
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.widget.RelativeLayout}</li>
+ <li>{@link android.widget.RelativeLayout.LayoutParams}</li>
+ </ol>
+</div>
+</div>
+
+<p>{@link android.widget.RelativeLayout} is a view group that displays child views in relative
+positions. The position of each view can be specified as relative to sibling elements (such as to
+the left-of or below another view) or in positions relative to the parent {@link
+android.widget.RelativeLayout} area (such as aligned to the bottom, left of center).</p>
+
+<img src="{@docRoot}images/ui/relativelayout.png" alt="" />
+
+<p>A {@link android.widget.RelativeLayout} is a very powerful utility for designing a user interface
+because it can eliminate nested view groups and keep your layout hierarchy flat, which improves
+performance. If you find yourself using several nested {@link android.widget.LinearLayout} groups,
+you may be able to replace them with a single {@link android.widget.RelativeLayout}.</p>
+
+
+<h2 id="Position">Positioning Views</h2>
+
+<p>{@link android.widget.RelativeLayout} lets child views specify their position relative to the
+parent view or to each other (specified by ID). So you can align two elements by right border, or
+make one below another, centered in the screen, centered left, and so on. By default, all child
+views are drawn at the top-left of the layout, so you must define the position of each view
+using the various layout properties available from {@link
+android.widget.RelativeLayout.LayoutParams}.</p>
+
+<p>Some of the many layout properties available to views in a {@link android.widget.RelativeLayout}
+include:</p>
+<dl>
+ <dt><a
+href="{docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_alignParentTop"
+>{@code android:layout_alignParentTop}</a></dt>
+ <dd>If {@code "true"}, makes the top edge of this view match the top edge of the parent. </dd>
+ <dt><a
+href="{docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_centerVertical"
+>{@code android:layout_centerVertical}</a></dt>
+ <dd>If {@code "true"}, centers this child vertically within its parent.</dd>
+ <dt><a
+href="{docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_below"
+>{@code android:layout_below}</a></dt>
+ <dd>Positions the top edge of this view below the view specified with a resource ID.</dd>
+ <dt><a
+href="{docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_toRightOf"
+>{@code android:layout_toRightOf}</a></dt>
+ <dd>Positions the left edge of this view to the right of the view specified with a resource ID.</dd>
+</dl>
+
+<p>These are just a few examples. All layout attributes are documented at {@link
+android.widget.RelativeLayout.LayoutParams}.</p>
+
+<p>The value for each layout property is either a boolean to
+enable a layout position relative to the parent {@link android.widget.RelativeLayout} or an ID that
+references another view in the layout against which the view should be positioned.</p>
+
+<p>In your XML layout, dependencies against other views in the layout can be declared in any order.
+For example, you can declare that "view1" be positioned below "view2" even if "view2" is the last
+view declared in the hierarchy. The example below demonstrates such a scenario.</p>
+
+
+<h2 id="Example">Example</h2>
+
+<p>Each of the attributes that control the relative position of each view are emphasized.</p>
+<div class="figure" style="width:220px;margin-top:0">
+<img src="{@docRoot}images/ui/sample-relativelayout.png" alt="" />
+</div>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp" >
+ <EditText
+ android:id="@+id/name"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/reminder" />
+ <Spinner
+ android:id="@+id/dates"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ <strong>android:layout_below="@id/name"</strong>
+ <strong>android:layout_alignParentLeft="true"</strong>
+ <strong>android:layout_toLeftOf="@+id/times"</strong> />
+ <Spinner
+ android:id="@id/times"
+ android:layout_width="96dp"
+ android:layout_height="wrap_content"
+ <strong>android:layout_below="@id/name"</strong>
+ <strong>android:layout_alignParentRight="true"</strong> />
+ <Button
+ android:layout_width="96dp"
+ android:layout_height="wrap_content"
+ <strong>android:layout_below="@id/times"</strong>
+ <strong>android:layout_alignParentRight="true"</strong>
+ android:text="@string/done" />
+</RelativeLayout>
+</pre>
+
+<p>For details about all the layout attributes available to each child view of a {@link
+android.widget.RelativeLayout}, see {@link android.widget.RelativeLayout.LayoutParams}.</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/ui/layout/tabs.jd b/docs/html/guide/topics/ui/layout/tabs.jd
new file mode 100644
index 0000000..62663de
--- /dev/null
+++ b/docs/html/guide/topics/ui/layout/tabs.jd
@@ -0,0 +1,219 @@
+page.title=Tabbed
+parent.title=Layouts
+parent.link=layout-objects.html
+@jd:body
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+ <ol>
+ <li><a href="#example">Example</a></li>
+ </ol>
+ <h2>Key classes</h2>
+ <ol>
+<li>{@link android.widget.TabWidget}</li>
+<li>{@link android.widget.TabHost}</li>
+<li>{@link android.widget.TabHost.TabSpec}</li>
+<li>{@link android.widget.FrameLayout}</li>
+ </ol>
+</div>
+</div>
+<p>To create a tabbed UI, you need to use a {@link android.widget.TabHost} and a {@link
+android.widget.TabWidget}. The {@link android.widget.TabHost} must be the root node for the layout,
+which contains both the {@link android.widget.TabWidget} for displaying the tabs and a {@link
+android.widget.FrameLayout} for displaying the tab content.</p>
+
+<img src="{@docRoot}images/ui/tabs.png" alt="" />
+
+<p>You can implement your tab content in one of two ways: use the tabs to swap
+{@link android.view.View}s within the same {@link android.app.Activity}, or use the tabs to change
+between entirely separate activities. Which method you want for your application will depend on your
+demands, but if each tab provides a distinct user activity, then it probably makes sense to use
+a separate {@link android.app.Activity} for each tab, so that you can better manage the application
+in discrete groups, rather than one massive application and layout.</p>
+<h2 id="example">Example</h2>
+<p>In this tutorial, you'll create a tabbed UI that uses a separate {@link
+android.app.Activity} for each tab.</p>
+
+<ol>
+ <li>Start a new project named <em>HelloTabWidget</em>.</li>
+ <li>First, create three separate {@link android.app.Activity} classes in your project:
+<code>ArtistsActivity</code>, <code>AlbumsActivity</code>, and <code>SongsActivity</code>. These
+will each represent a separate tab. For now, make each one display a simple message using a {@link
+android.widget.TextView}. For example:
+<pre>
+public class ArtistsActivity extends Activity {
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ TextView textview = new TextView(this);
+ textview.setText("This is the Artists tab");
+ setContentView(textview);
+ }
+}
+</pre>
+ <p>Notice that this doesn't use a layout file. Just create a {@link
+android.widget.TextView}, give it some text and set that as the content. Duplicate this for
+each of the three activities, and add the corresponding <code><activity/></code> tags to the Android Manifest file.</p>
+
+ <li>You need an icon for each of your tabs. For each icon, you should create two versions: one
+for when the tab is selected and one for when it is unselected. The
+general design recommendation is for the selected icon to be a dark color (grey), and the
+unselected icon to be a light color (white). (See the <a
+href="{@docRoot}guide/practices/ui_guidelines/icon_design.html#tabstructure">Icon Design
+Guidelines</a>.) For example:
+ <p>
+ <img src="images/ic_tab_artists_white.png" title="unselected tab icon" alt="" />
+ <img src="images/ic_tab_artists_grey.png" title="selected tab icon" alt="" />
+ </p>
+ <p>For this tutorial, you can copy these images and use them for all three tabs. (When you
+create tabs in your own application, you should create customized tab icons.)</p>
+ <p>Now create a <a
+href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList">state-list drawable</a>
+that specifies which image to use for each tab state:</p>
+ <ol>
+ <li>Save the icon images in your project <code>res/drawable/</code> directory.</li>
+ <li>Create a new XML file in <code>res/drawable/</code>
+named <code>ic_tab_artists.xml</code> and insert the following:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- When selected, use grey -->
+ <item android:drawable="@drawable/ic_tab_artists_grey"
+ android:state_selected="true" />
+ <!-- When not selected, use white-->
+ <item android:drawable="@drawable/ic_tab_artists_white" />
+</selector>
+</pre>
+ <p>This is a <a
+href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList">state-list drawable</a>,
+which you will apply as the tab image. When the tab state changes, the tab icon will
+automatically switch between the images defined here.</p>
+ </li>
+ </ol>
+ </li>
+
+ <li>Open the <code>res/layout/main.xml</code> file and insert the following:
+ <pre>
+<?xml version="1.0" encoding="utf-8"?>
+<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@android:id/tabhost"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:padding="5dp">
+ <TabWidget
+ android:id="@android:id/tabs"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+ <FrameLayout
+ android:id="@android:id/tabcontent"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:padding="5dp" />
+ </LinearLayout>
+</TabHost>
+</pre>
+ <p>This is the layout that will display the tabs and provide navigation between each {@link
+ android.app.Activity} created above.</p>
+ <p>The {@link android.widget.TabHost} requires that a {@link android.widget.TabWidget} and a
+{@link android.widget.FrameLayout} both live somewhere within it. To position the {@link
+android.widget.TabWidget} and {@link android.widget.FrameLayout} vertically, a {@link
+android.widget.LinearLayout} is used. The {@link android.widget.FrameLayout} is where the content
+for each tab goes, which is empty now because the {@link android.widget.TabHost} will automatically
+embed each {@link android.app.Activity} within it.</p>
+ <p>Notice that the {@link android.widget.TabWidget} and the {@link android.widget.FrameLayout}
+ elements have the IDs {@code tabs} and {@code tabcontent}, respectively. These names
+ must be used so that the {@link android.widget.TabHost} can retrieve references to each of
+ them. It expects exactly these names.</p>
+ </li>
+
+ <li>Now open <code>HelloTabWidget.java</code> and make it extend {@link
+ android.app.TabActivity}:</p>
+<pre>
+public class HelloTabWidget extends TabActivity {
+</pre>
+ </li>
+ <li>Use the following code for the {@link android.app.Activity#onCreate(Bundle) onCreate()}
+ method:
+<pre>
+public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ Resources res = getResources(); // Resource object to get Drawables
+ TabHost tabHost = getTabHost(); // The activity TabHost
+ TabHost.TabSpec spec; // Resusable TabSpec for each tab
+ Intent intent; // Reusable Intent for each tab
+
+ // Create an Intent to launch an Activity for the tab (to be reused)
+ intent = new Intent().setClass(this, ArtistsActivity.class);
+
+ // Initialize a TabSpec for each tab and add it to the TabHost
+ spec = tabHost.newTabSpec("artists").setIndicator("Artists",
+ res.getDrawable(R.drawable.ic_tab_artists))
+ .setContent(intent);
+ tabHost.addTab(spec);
+
+ // Do the same for the other tabs
+ intent = new Intent().setClass(this, AlbumsActivity.class);
+ spec = tabHost.newTabSpec("albums").setIndicator("Albums",
+ res.getDrawable(R.drawable.ic_tab_albums))
+ .setContent(intent);
+ tabHost.addTab(spec);
+
+ intent = new Intent().setClass(this, SongsActivity.class);
+ spec = tabHost.newTabSpec("songs").setIndicator("Songs",
+ res.getDrawable(R.drawable.ic_tab_songs))
+ .setContent(intent);
+ tabHost.addTab(spec);
+
+ tabHost.setCurrentTab(2);
+}
+</pre>
+ <p>This sets up each tab with their text and icon, and assigns each one an {@link
+android.app.Activity}.</p>
+ <p>A reference to the {@link android.widget.TabHost} is first captured with {@link
+android.app.TabActivity#getTabHost()}. Then, for
+each tab, a {@link android.widget.TabHost.TabSpec} is created to define the tab properties. The
+{@link android.widget.TabHost#newTabSpec(String)} method creates a new {@link
+android.widget.TabHost.TabSpec} identified by the given string tag. For each
+{@link android.widget.TabHost.TabSpec}, {@link
+android.widget.TabHost.TabSpec#setIndicator(CharSequence,Drawable)} is called to set the text and
+icon for the tab, and {@link android.widget.TabHost.TabSpec#setContent(Intent)} is called to specify
+the {@link android.content.Intent} to open the appropriate {@link android.app.Activity}. Each
+{@link android.widget.TabHost.TabSpec} is then added to the {@link android.widget.TabHost} by
+calling {@link android.widget.TabHost#addTab(TabHost.TabSpec)}.</p>
+
+ <p>At the very end, {@link
+ android.widget.TabHost#setCurrentTab(int)} opens the tab to be displayed by default, specified
+ by the index position of the tab.</p>
+
+ <p>Notice that not once was the {@link android.widget.TabWidget} object referenced. This is
+ because a {@link android.widget.TabWidget} must always be a child of a {@link
+ android.widget.TabHost}, which is what you use for almost all interaction with the tabs. So when
+ a tab is added to the {@link android.widget.TabHost}, it's automatically added to the child
+ {@link android.widget.TabWidget}.</p>
+ </li>
+
+ <li>Now open the Android Manifest file and add the <code>NoTitleBar</code> theme to the
+<em>HelloTabWidget</em>'s
+ <code><activity></code> tag. This will remove the default application title from the top
+ of the layout, leaving more space for the tabs, which effectively operate as their own titles.
+ The <code><activity></code> tag should look like this:
+<pre>
+<activity android:name=".HelloTabWidget" android:label="@string/app_name"
+ android:theme="@android:style/Theme.NoTitleBar">
+</pre>
+ </li>
+
+ <li>Run the application.</li>
+</ol>
+
+
+<p>Your application should look like this (though your icons may be different):</p>
+<img src="images/hello-tabwidget.png" width="150px" />
+
+
diff --git a/docs/html/guide/topics/ui/menus.jd b/docs/html/guide/topics/ui/menus.jd
index d51a378..01d373e 100644
--- a/docs/html/guide/topics/ui/menus.jd
+++ b/docs/html/guide/topics/ui/menus.jd
@@ -1040,7 +1040,7 @@
</pre>
<p>Read more about writing intent filters in the
-<a href="/guide/topics/intents/intents-filters.html">Intents and Intent Filters</a> document.</p>
+<a href="/guide/components/intents-filters.html">Intents and Intent Filters</a> document.</p>
<p>For a sample application using this technique, see the
<a href="{@docRoot}resources/samples/NotePad/src/com/example/android/notepad/NoteEditor.html">Note
diff --git a/docs/html/guide/topics/ui/notifiers/index.jd b/docs/html/guide/topics/ui/notifiers/index.jd
index c61d4f0..caf0df7 100644
--- a/docs/html/guide/topics/ui/notifiers/index.jd
+++ b/docs/html/guide/topics/ui/notifiers/index.jd
@@ -21,7 +21,7 @@
<ul>
<li>A <a href="#Toast">Toast Notification</a>, for brief messages that come
from the background.</li>
- <li>A <a href="#StatusBar">Status Bar Notification</a>, for persistent reminders
+ <li>A <a href="#StatusBar">Status Notification</a>, for persistent reminders
that come from the background and request the user's response.</li>
<li>A <a href="#Dialog">Dialog Notification</a>, for Activity-related notifications.</li>
</ul>
@@ -44,16 +44,16 @@
when you're fairly certain the user is paying attention
to the screen. A toast can not accept user interaction events; if you'd like
the user to respond and take action, consider using a
-<a href="#StatusBar">Status Bar Notification</a> instead.</p>
+<a href="#StatusBar">Status Notification</a> instead.</p>
<p>For more information, refer to <a href="toasts.html">Toast Notifications</a>.</p>
-<h2 id="StatusBar">Status Bar Notification</h2>
+<h2 id="StatusBar">Status Notification</h2>
<img src="{@docRoot}images/notifications_window.png" alt="" style="float:right; clear:right;" />
-<p>A status bar notification adds an icon to the system's status bar
+<p>A status 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
@@ -68,7 +68,7 @@
<a href="#Dialog">Dialog Notification</a> instead.</p>
<p>For more information, refer to
-<a href="notifications.html">Status Bar Notifications</a>.</p>
+<a href="notifications.html">Status Notifications</a>.</p>
<h2 id="Dialog">Dialog Notification</h2>
diff --git a/docs/html/guide/topics/ui/notifiers/notifications.jd b/docs/html/guide/topics/ui/notifiers/notifications.jd
index d104b4b..52092f9 100644
--- a/docs/html/guide/topics/ui/notifiers/notifications.jd
+++ b/docs/html/guide/topics/ui/notifiers/notifications.jd
@@ -1,4 +1,4 @@
-page.title=Status Bar Notifications
+page.title=Status Notifications
parent.title=Notifications
parent.link=index.html
@jd:body
@@ -7,7 +7,7 @@
<div id="qv">
<h2>Quickview</h2>
<ul>
- <li>A status bar notification allows your application to notify the user of an event
+ <li>A status notification allows your application to notify the user of an event
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>
@@ -43,7 +43,7 @@
</div>
</div>
-<p>A status bar notification adds an icon to the system's status bar
+<p>A status 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
@@ -51,11 +51,11 @@
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
+<p>A status 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
+The service should instead create a status notification that will launch the activity
when selected by the user.</p>
<p>Figure 1 shows the status bar with a notification icon on the left side.</p>
@@ -78,9 +78,9 @@
<h2 id="Basics">The Basics</h2>
-<p>An {@link android.app.Activity} or {@link android.app.Service} can initiate a status bar
+<p>An {@link android.app.Activity} or {@link android.app.Service} can initiate a status
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
+running in the foreground and its window has focus, you will usually create status notifications
from a
service. This way, the notification can be created from the background,
while the user is using another application or
@@ -88,9 +88,9 @@
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 notification message, and extra settings
+status notification, such as the status 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
+that executes and manages all status 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
@@ -98,7 +98,7 @@
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>
+<p>To create a status notification:</p>
<ol>
<li>Get a reference to the {@link android.app.NotificationManager}:
<pre>
@@ -277,7 +277,7 @@
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
</pre>
-<p>When you want to deliver your status bar notification, pass the {@link android.app.Notification}
+<p>When you want to deliver your status 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
@@ -287,7 +287,7 @@
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
+<p>To clear the status 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
@@ -300,14 +300,14 @@
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>
+<p>A status notification <em>requires</em> all of the following:</p>
<ul>
<li>An icon for the status bar</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>
+<p>Optional settings for the status notification include:</p>
<ul>
<li>A ticker-text message for the status bar</li>
<li>An alert sound</li>
@@ -339,7 +339,7 @@
<h3 id="Updating">Updating the notification</h3>
-<p>You can update the information in your status bar notification as events
+<p>You can update the information in your status 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.
@@ -484,7 +484,7 @@
your notification is on-going.</dd>
<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.
+ The appropriate number is overlaid on top of the status 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>
diff --git a/docs/html/guide/topics/ui/overview.jd b/docs/html/guide/topics/ui/overview.jd
new file mode 100644
index 0000000..41f7cc7
--- /dev/null
+++ b/docs/html/guide/topics/ui/overview.jd
@@ -0,0 +1,74 @@
+page.title=UI Overview
+@jd:body
+
+
+<p>All user interface elements in an Android app are built using {@link android.view.View} and
+{@link android.view.ViewGroup} objects. A {@link android.view.View} is an object that draws
+something on the screen that the user can interact with. A {@link android.view.ViewGroup} is an
+object that holds other {@link android.view.View} (and {@link android.view.ViewGroup}) objects in
+order to define the layout of the interface.</p>
+
+<p>Android provides a collection of both {@link android.view.View} and {@link
+android.view.ViewGroup} subclasses that offer you common input controls (such as buttons and text
+fields) and various layout models (such as a linear or relative layout).</p>
+
+
+<h2 id="Layout">User Interface Layout</h2>
+
+<p>The user interface for each component of your app is defined using a hierarchy of {@link
+android.view.View} and {@link android.view.ViewGroup} objects, as shown in figure 1. Each view group
+is an invisible container that organizes child views, while the child views may be input
+controls or other widgets that
+draw some part of the UI. This hierarchy tree can be as simple or complex as you need
+it to be (but simplicity is best for performance).</p>
+
+<img src="{@docRoot}images/viewgroup.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> Illustration of a view hierarchy, which defines a
+UI layout.</p>
+
+<p>To declare your layout, you can instantiate {@link android.view.View} objects in code and start
+building a tree, but the easiest and most effective way to define your layout is with an XML file.
+XML offers a human-readable structure for the layout, similar to HTML.</p>
+
+<p>The name of an XML element for a view is respective to the Android class it represents. So a
+<code><TextView></code> element creates a {@link android.widget.TextView} widget in your UI,
+and a <code><LinearLayout></code> element creates a {@link android.widget.LinearLayout} view
+group. </p>
+
+<p>For example, a simple vertical layout with a text view and a button looks like this:</p>
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+ <TextView android:id="@+id/text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="I am a TextView" />
+ <Button android:id="@+id/button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="I am a Button" />
+</LinearLayout>
+</pre>
+
+<p>When you load a layout resource in your app, Android initializes each node of the layout into a
+runtime object you can use to define additional behaviors, query the object state, or modify the
+layout.</p>
+
+<p>For a complete guide to creating a UI layout, see <a href="declaring-layout.html">XML
+Layouts</a>.
+
+
+<h2 id="UIComponents">User Interface Components</h2>
+
+<p>You don't have to build all of your UI using {@link android.view.View} and {@link
+android.view.ViewGroup} objects. Android provides several app components that offer
+a standard UI layout for which you simply need to define the content. These UI components each
+have a unique set of APIs that are described in their respective documents, such as <a
+href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a>, <a
+href="{@docRoot}guide/topics/ui/dialogs.html">Dialogs</a>, and <a
+href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Status Notifications</a>.</p>
+
+
diff --git a/docs/html/guide/topics/ui/sharables/sample_images.zip b/docs/html/guide/topics/ui/sharables/sample_images.zip
new file mode 100644
index 0000000..007a68a
--- /dev/null
+++ b/docs/html/guide/topics/ui/sharables/sample_images.zip
Binary files differ
diff --git a/docs/html/guide/topics/usb/accessory.jd b/docs/html/guide/topics/usb/accessory.jd
deleted file mode 100644
index 8b74bc0..0000000
--- a/docs/html/guide/topics/usb/accessory.jd
+++ /dev/null
@@ -1,462 +0,0 @@
-page.title=USB Accessory
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li>
- <a href="#choosing">Choosing the Right USB Accessory APIs</a>
-
- <ol>
- <li><a href="#installing">Installing the Google APIs add-on library</a></li>
- </ol>
- </li>
-
- <li>
- <a href="#api">API Overview</a>
-
- <ol>
- <li><a href="#usage">Usage differences between the add-on library and the platform
- APIs</a></li>
- </ol>
- </li>
-
- <li><a href="#manifest">Android Manifest Requirements</a></li>
-
- <li>
- <a href="#working-a">Working with accessories</a>
-
- <ol>
- <li><a href="#discovering-a">Discovering an accessory</a></li>
-
- <li><a href="#permission-a">Obtaining permission to communicate with an
- accessory</a></li>
-
- <li><a href="#communicating-a">Communicating with an accessory</a></li>
-
- <li><a href="#terminating-a">Terminating communication with an accessory</a></li>
- </ol>
- </li>
- </ol>
-
- <h2>See also</h2>
-
- <ol>
- <li><a href="http://accessories.android.com/demokit">Android USB Accessory Development
- Kit</a></li>
- </ol>
- </div>
- </div>
-
- <p>USB accessory mode allows users to connect
- USB host hardware specifically designed for Android-powered devices. The accessories must adhere
- to the Android accessory protocol outlined in the <a href=
- "http://accessories.android.com/demokit">Android Accessory Development Kit</a> documentation.
- This allows Android-powered devices that cannot act as a USB host to still interact with USB
- hardware. When an Android-powered device is in USB accessory mode, the attached Android USB
- accessory acts as the host, provides power to the USB bus, and enumerates connected devices.
- Android 3.1 (API level 12) supports USB accessory mode and the feature is also backported to
- Android 2.3.4 (API level 10) to enable support for a broader range of devices.</p>
-
- <h2 id="choosing">Choosing the Right USB Accessory APIs</h2>
-
- <p>Although the USB accessory APIs were introduced to the platform in Android 3.1, they are also
- available in Android 2.3.4 using the Google APIs add-on library. Because these APIs were
- backported using an external library, there are two packages that you can import to support USB
- accessory mode. Depending on what Android-powered devices you want to support, you might have to
- use one over the other:</p>
-
- <ul>
- <li><code>com.android.future.usb</code>: To support USB accessory mode in Android 2.3.4, the
- <a href="http://code.google.com/android/add-ons/google-apis/index.html">Google APIs add-on
- library</a> includes the backported USB accessory APIs and they are contained in this
- namespace. Android 3.1 also supports importing and calling the classes within this namespace to
- support applications written with the add-on library. This add-on library is a thin wrapper
- around the {@link android.hardware.usb} accessory APIs and does not support USB host mode. If
- you want to support the widest range of devices that support USB accessory mode, use the add-on
- library and import this package. It is important to note that not all Android 2.3.4 devices are
- required to support the USB accessory feature. Each individual device manufacturer decides
- whether or not to support this capability, which is why you must declare it in your manifest
- file.</li>
-
- <li>{@link android.hardware.usb}: This namespace contains the classes that support USB
- accessory mode in Android 3.1. This package is included as part of the framework APIs, so
- Android 3.1 supports USB accessory mode without the use of an add-on library. Use this package
- if you only care about Android 3.1 or newer devices that have hardware support for USB
- accessory mode, which you can declare in your manifest file.</li>
- </ul>
-
- <h3 id="installing">Installing the Google APIs add-on library</h3>
-
- <p>If you want to install the add-on, you can do so by installing the Google APIs Android API 10
- package with the SDK Manager. See <a href=
- "http://code.google.com/android/add-ons/google-apis/installing.html">Installing the Google APIs
- Add-on</a> for more information on installing the add-on library.</p>
-
- <h2 id="api">API Overview</h2>
-
- <p>Because the add-on library is a wrapper for the framework APIs, the classes that support the
- USB accessory feature are similar. You can use the reference documentation for the {@link
- android.hardware.usb} even if you are using the add-on library.</p>
-
- <p class="note"><strong>Note:</strong> There is, however, a minor <a href="#usage">usage
- difference</a> between the add-on library and framework APIs that you should be aware of.</p>
-
- <p>The following table describes the classes that support the USB accessory APIs:</p>
-
- <table>
- <tr>
- <th>Class</th>
-
- <th>Description</th>
- </tr>
-
- <tr>
- <td>{@link android.hardware.usb.UsbManager}</td>
-
- <td>Allows you to enumerate and communicate with connected USB accessories.</td>
- </tr>
-
- <tr>
- <td>{@link android.hardware.usb.UsbAccessory}</td>
-
- <td>Represents a USB accessory and contains methods to access its identifying
- information.</td>
- </tr>
- </table>
-
- <h3 id="usage">Usage differences between the add-on library and platform APIs</h3>
-
- <p>There are two usage differences between using the Google APIs add-on library and the platform
- APIs.</p>
-
- <p>If you are using the add-on library, you must obtain the {@link
- android.hardware.usb.UsbManager} object in the following manner:</p>
- <pre>
-UsbManager manager = UsbManager.getInstance(this);
-</pre>
-
- <p>If you are not using the add-on library, you must obtain the {@link
- android.hardware.usb.UsbManager} object in the following manner:</p>
- <pre>
-UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
-</pre>
-
- <p>When you filter for a connected accessory with an intent filter, the {@link
- android.hardware.usb.UsbAccessory} object is contained inside the intent that is passed to your
- application. If you are using the add-on library, you must obtain the {@link
- android.hardware.usb.UsbAccessory} object in the following manner:</p>
- <pre>
-UsbAccessory accessory = UsbManager.getAccessory(intent);
-</pre>
-
- <p>If you are not using the add-on library, you must obtain the {@link
- android.hardware.usb.UsbAccessory} object in the following manner:</p>
- <pre>
-UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
-</pre>
-
- <h2 id="manifest">Android Manifest requirements</h2>
-
- <p>The following list describes what you need to add to your application's manifest file before
- working with the USB accesory APIs. The <a href="#manifest-example">manifest and resource file
- examples</a> show how to declare these items:</p>
-
- <ul>
- <li>Because not all Android-powered devices are guaranteed to support the USB accessory APIs,
- include a <code><uses-feature></code> element that declares that your application uses
- the <code>android.hardware.usb.accessory</code> feature.</li>
-
- <li>If you are using the
- <a href="http://code.google.com/android/add-ons/google-apis/index.html">add-on library</a>,
- add the <code><uses-library></code> element specifying
- <code>com.android.future.usb.accessory</code> for the library.</li>
-
- <li>Set the minimum SDK of the application to API Level 10 if you are using the add-on library
- or 12 if you are using the {@link android.hardware.usb} package.</li>
-
- <li>
- <p>If you want your application to be notified of an attached USB accessory, specify an
- <code><intent-filter></code> and <code><meta-data></code> element pair for the
- <code>android.hardware.usb.action.USB_ACCESSORY_ATTACHED</code> intent in your main activity.
- The <code><meta-data></code> element points to an external XML resource file that
- declares identifying information about the accessory that you want to detect.</p>
-
- <p>In the XML resource file, declare <code><usb-accessory></code> elements for the
- accessories that you want to filter. Each <code><usb-accessory></code> can have the
- following attributes:</p>
-
- <ul>
- <li><code>manufacturer</code></li>
-
- <li><code>model</code></li>
-
- <li><code>version</code></li>
- </ul>
-
- <p>Save the resource file in the <code>res/xml/</code> directory. The resource file name
- (without the .xml extension) must be the same as the one you specified in the
- <code><meta-data></code> element. The format for the XML resource file is also shown in
- the <a href="#example">example</a> below.</p>
- </li>
- </ul>
-
- <h3 id="manifest-example">Manifest and resource file examples</h3>
-
- <p>The following example shows a sample manifest and its corresponding resource file:</p>
- <pre>
-<manifest ...>
- <uses-feature android:name="android.hardware.usb.accessory" />
- <!-- version must be either 10 or 12 -->
- <uses-sdk android:minSdkVersion="<<em>version</em>>" />
- ...
- <application>
- <uses-library android:name="com.android.future.usb.accessory" />
- <activity ...>
- ...
- <intent-filter>
- <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
- </intent-filter>
-
- <meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
- android:resource="@xml/accessory_filter" />
- </activity>
- </application>
-</manifest>
-</pre>
-
- <p>In this case, the following resource file should be saved in
- <code>res/xml/accessory_filter.xml</code> and specifies that any accessory that has the
- corresponding model, manufacturer, and version should be filtered. The accessory sends these
- attributes the Android-powered device:</p>
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-
-<resources>
- <usb-accessory model="DemoKit" manufacturer="Google" version="1.0"/>
-</resources>
-</pre>
-
- <h2 id="working-a">Working with Accessories</h2>
-
- <p>When users connect USB accessories to an Android-powered device, the Android system can
- determine whether your application is interested in the connected accessory. If so, you can set
- up communication with the accessory if desired. To do this, your application has to:</p>
-
- <ol>
- <li>Discover connected accessories by using an intent filter that filters for accessory
- attached events or by enumerating connected accessories and finding the appropriate one.</li>
-
- <li>Ask the user for permission to communicate with the accessory, if not already
- obtained.</li>
-
- <li>Communicate with the accessory by reading and writing data on the appropriate interface
- endpoints.</li>
- </ol>
-
- <h3 id="discovering-a">Discovering an accessory</h3>
-
- <p>Your application can discover accessories by either using an intent filter to be notified when
- the user connects an accessory or by enumerating accessories that are already connected. Using an
- intent filter is useful if you want to be able to have your application automatically detect a
- desired accessory. Enumerating connected accessories is useful if you want to get a list of all
- connected accessories or if your application did not filter for an intent.</p>
-
- <h4 id="discover-a-intent">Using an intent filter</h4>
-
- <p>To have your application discover a particular USB accessory, you can specify an intent filter
- to filter for the <code>android.hardware.usb.action.USB_ACCESSORY_ATTACHED</code> intent. Along
- with this intent filter, you need to specify a resource file that specifies properties of the USB
- accessory, such as manufacturer, model, and version. When users connect an accessory that matches
- your accessory filter,</p>
-
- <p>The following example shows how to declare the intent filter:</p>
- <pre>
-<activity ...>
- ...
- <intent-filter>
- <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
- </intent-filter>
-
- <meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
- android:resource="@xml/accessory_filter" />
-</activity>
-</pre>
-
- <p>The following example shows how to declare the corresponding resource file that specifies the
- USB accessories that you're interested in:</p>
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-
-<resources>
- <usb-accessory manufacturer="Google, Inc." model="DemoKit" version="1.0" />
-</resources>
-</pre>
-
- <p>In your activity, you can obtain the {@link android.hardware.usb.UsbAccessory} that represents
- the attached accessory from the intent like this (with the add-on library):</p>
- <pre>
-UsbAccessory accessory = UsbManager.getAccessory(intent);
-</pre>
-
- <p>or like this (with the platform APIs):</p>
- <pre>
-UsbAccessory accessory = (UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
-</pre>
-
- <h4 id="discover-a-enumerate">Enumerating accessories</h4>
-
- <p>You can have your application enumerate accesories that have identified themselves while your
- application is running.</p>
-
- <p>Use the {@link android.hardware.usb.UsbManager#getAccessoryList() getAccessoryList()} method
- to get an array all the USB accessories that are connected:</p>
- <pre>
-UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
-UsbAccessory[] accessoryList = manager.getAcccessoryList();
-</pre>
-
- <p class="note"><strong>Note:</strong> Currently, only one connected accessory is supported at
- one time, but the API is designed to support multiple accessories in the future.</p>
-
- <h3 id="permission-a">Obtaining permission to communicate with an accessory</h3>
-
- <p>Before communicating with the USB accessory, your applicaton must have permission from your
- users.</p>
-
- <p class="note"><strong>Note:</strong> If your application <a href="#using-intents">uses an
- intent filter</a> to discover accessories as they're connected, it automatically receives
- permission if the user allows your application to handle the intent. If not, you must request
- permission explicitly in your application before connecting to the accessory.</p>
-
- <p>Explicitly asking for permission might be neccessary in some situations such as when your
- application enumerates accessories that are already connected and then wants to communicate with
- one. You must check for permission to access an accessory before trying to communicate with it.
- If not, you will receive a runtime error if the user denied permission to access the
- accessory.</p>
-
- <p>To explicitly obtain permission, first create a broadcast receiver. This receiver listens for
- the intent that gets broadcast when you call {@link
- android.hardware.usb.UsbManager#requestPermission requestPermission()}. The call to {@link
- android.hardware.usb.UsbManager#requestPermission requestPermission()} displays a dialog to the
- user asking for permission to connect to the accessory. The following sample code shows how to
- create the broadcast receiver:</p>
- <pre>
-private static final String ACTION_USB_PERMISSION =
- "com.android.example.USB_PERMISSION";
-private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
-
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
- if (ACTION_USB_PERMISSION.equals(action)) {
- synchronized (this) {
- UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
-
- if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {
- if(accessory != null){
- //call method to set up accessory communication
- }
- }
- else {
- Log.d(TAG, "permission denied for accessory " + accessory);
- }
- }
- }
- }
-};
-</pre>
-
- <p>To register the broadcast receiver, put this in your <code>onCreate()</code> method in your
- activity:</p>
- <pre>
-UsbManager mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
-private static final String ACTION_USB_PERMISSION =
- "com.android.example.USB_PERMISSION";
-...
-mPermissionIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0);
-IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
-registerReceiver(mUsbReceiver, filter);
-</pre>
-
- <p>To display the dialog that asks users for permission to connect to the accessory, call the
- {@link android.hardware.usb.UsbManager#requestPermission requestPermission()} method:</p>
- <pre>
-UsbAccessory accessory;
-...
-mUsbManager.requestPermission(accessory, mPermissionIntent);
-</pre>
-
- <p>When users reply to the dialog, your broadcast receiver receives the intent that contains the
- {@link android.hardware.usb.UsbManager#EXTRA_PERMISSION_GRANTED} extra, which is a boolean
- representing the answer. Check this extra for a value of true before connecting to the
- accessory.</p>
-
- <h3 id="communicating-a">Communicating with an accessory</h3>
-
- <p>You can communicate with the accessory by using the {@link android.hardware.usb.UsbManager} to
- obtain a file descriptor that you can set up input and output streams to read and write data to
- descriptor. The streams represent the accessory's input and output bulk endpoints. You should set
- up the communication between the device and accessory in another thread, so you don't lock the
- main UI thread. The following example shows how to open an accessory to communicate with:</p>
- <pre>
-UsbAccessory mAccessory;
-ParcelFileDescriptor mFileDescriptor;
-FileInputStream mInputStream;
-FileOutputStream mOutputStream;
-
-...
-
-private void openAccessory() {
- Log.d(TAG, "openAccessory: " + accessory);
- mFileDescriptor = mUsbManager.openAccessory(mAccessory);
- if (mFileDescriptor != null) {
- FileDescriptor fd = mFileDescriptor.getFileDescriptor();
- mInputStream = new FileInputStream(fd);
- mOutputStream = new FileOutputStream(fd);
- Thread thread = new Thread(null, this, "AccessoryThread");
- thread.start();
- }
-}
-</pre>
-
- <p>In the thread's <code>run()</code> method, you can read and write to the accessory by using
- the {@link java.io.FileInputStream} or {@link java.io.FileOutputStream} objects. When reading
- data from an accessory with a {@link java.io.FileInputStream} object, ensure that the buffer that
- you use is big enough to store the USB packet data. The Android accessory protocol supports
- packet buffers up to 16384 bytes, so you can choose to always declare your buffer to be of this
- size for simplicity.</p>
-
- <p class="note"><strong>Note:</strong> At a lower level, the packets are 64 bytes for USB
- full-speed accessories and 512 bytes for USB high-speed accessories. The Android accessory
- protocol bundles the packets together for both speeds into one logical packet for simplicity.</p>
-
- <p>For more information about using threads in Android, see <a href=
- "{@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and
- Threads</a>.</p>
-
- <h3 id="terminating-a">Terminating communication with an accessory</h3>
-
- <p>When you are done communicating with an accessory or if the accessory was detached, close the
- file descriptor that you opened by calling {@link android.os.ParcelFileDescriptor#close close()}.
- To listen for detached events, create a broadcast receiver like below:</p>
- <pre>
-BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
-
- if (UsbManager.ACTION_USB_ACCESSORY_DETACHED.equals(action)) {
- UsbAccessory accessory = (UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
- if (accessory != null) {
- // call your method that cleans up and closes communication with the accessory
- }
- }
- }
-};
-</pre>
-
- <p>Creating the broadcast receiver within the application, and not the manifest, allows your
- application to only handle detached events while it is running. This way, detached events are
- only sent to the application that is currently running and not broadcast to all applications.</p>
-
diff --git a/docs/html/guide/topics/usb/adk.jd b/docs/html/guide/topics/usb/adk.jd
deleted file mode 100644
index c8949a3..0000000
--- a/docs/html/guide/topics/usb/adk.jd
+++ /dev/null
@@ -1,916 +0,0 @@
-page.title=Android Open Accessory Development Kit
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#components">ADK Components</a></li>
- <li>
-
- <a href="#getting-started">Getting Started with the ADK</a>
-
- <ol>
- <li><a href="#installing">Installing the Arduino software and necessary
- libraries</a></li>
-
- <li><a href="#installing-firmware">Installing the firmware to the ADK board</a></li>
-
- <li><a href="#running-demokit">Running the DemoKit Android application</a></li>
-
- <li><a href="#monitoring">Monitoring the ADK board</a></li>
- </ol>
- </li>
-
- <li>
- <a href="#accessory-protocol">Implementing the Android Accessory Protocol</a>
-
- <ol>
- <li><a href="#wait">Wait for and detect connected devices</a></li>
-
- <li><a href="#determine">Determine the connected device's accessory mode
- support</a></li>
-
- <li><a href="#start">Attempt to start the device in accessory mode</a></li>
-
- <li><a href="#establish">Establish communication with the device</a></li>
- </ol>
- </li>
-
- <li>
- <a href="#firmware">How the ADK board implements the Android Accessory Protocol</a>
-
- <ol>
- <li><a href="#wait-adk">Wait for and detect connected devices</a></li>
-
- <li><a href="#determine-adk">Determine the connected device's accessory mode
- support</a></li>
-
- <li><a href="#start-adk">Attempt to start the device in accessory mode</a></li>
-
- <li><a href="#establish-adk">Establish communication with the device</a></li>
- </ol>
- </li>
- </ol>
-
- <h2>Download</h2>
- <ol>
- <li><a href="https://dl-ssl.google.com/android/adk/adk_release_0512.zip">ADK package</a></li>
- </ol>
-
- <h2>See also</h2>
-
- <ol>
- <li><a href="http://www.youtube.com/watch?v=s7szcpXf2rE">Google I/O Session Video</a></li>
- <li><a href="{@docRoot}guide/topics/usb/accessory.html">USB Accessory Dev Guide</a></li>
- </ol>
-
- <h2>Where to buy</h2>
-
- <ol>
-
- <li><a href="http://store.arduino.cc/">
- Arduino Store</a></li>
-
- <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">
- 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>
-
- <li><a href="http://shop.moderndevice.com/products/freeduino-usb-host-board">
- Modern Device</a></li>
-
- <li><a href=
- "http://www.rt-net.jp/shop/index.php?main_page=product_info&cPath=3_4&products_id=1">
- RT Corp</a></li>
-
- <li><a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html">
- Seeed Studio</a></li>
-
- <li><a href="http://www.sparkfun.com/products/10748">
- SparkFun</a></li>
-
- <li><a href="http://troido.de/de/shoplsmallgbuy-android-stufflsmallg">
- Troido</a></li>
-
- </ol>
- </div>
- </div>
-
- <p>The Android 3.1 platform (also backported to Android 2.3.4) introduces Android Open Accessory
- support, which allows external USB hardware (an Android USB accessory) to interact with an
- Android-powered device in a special "accessory" mode. When an Android-powered powered device is
- in accessory mode, the connected accessory acts as the USB host (powers the bus and enumerates
- devices) and the Android-powered device acts as the USB device. Android USB accessories are
- specifically designed to attach to Android-powered devices and adhere to a simple protocol
- (Android accessory protocol) that allows them to detect Android-powered devices that support
- accessory mode. Accessories must also provide 500mA at 5V for charging power. Many previously
- released Android-powered devices are only capable of acting as a USB device and cannot initiate
- connections with external USB devices. Android Open Accessory support overcomes this limitation
- and allows you to build accessories that can interact with an assortment of Android-powered
- devices by allowing the accessory to initiate the connection.</p>
-
- <p class="note"><strong>Note:</strong> Accessory mode is ultimately dependent on the device's
- hardware and not all devices will support accessory mode. Devices that support accessory mode can
- be filtered using a <code><uses-feature></code> element in your corresponding application's
- Android manifest. For more information, see the <a href=
- "{@docRoot}guide/topics/usb/accessory.html#manifest">USB Accessory</a> Developer Guide.</p>
-
- <p>The following list of distributers are currently producing Android Open Accessory compatible
- development boards:</p>
-
- <ul>
-
- <li>The <a href="http://store.arduino.cc/">Arduino Store</a> provides the Arduino Mega ADK
- (in <a href="http://store.arduino.cc/eu/index.php?main_page=product_info&cPath=11_12&products_id=144">EU nations</a>
- or <a href="http://store.arduino.cc/ww/index.php?main_page=product_info&cPath=11_12&products_id=144">non-EU nations</a>)
- that is based on the ATmega2560 and supports the ADK firmware.</li>
-
- <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">DIY
- 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>
-
- <li><a href="http://shop.moderndevice.com/products/freeduino-usb-host-board">Modern
- Device</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
-
- <li><a href="http://www.rt-net.jp/shop/index.php?main_page=product_info&cPath=3_4&products_id=1">
- RT Corp</a> provides an Arduino-compatible board based on the Android ADK board design.</li>
-
- <li><a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html">
- Seeed Studio</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
-
- <li><a href="http://www.sparkfun.com/products/10748">
- SparkFun</a>'s IOIO board now has beta support for the ADK firmware.</li>
-
- </ul>
-
- <p>We expect more hardware distributers to create a variety of kits, so please stay tuned for
- further developments.</p>
-
- <h2 id="components">ADK Components</h2>
- <p>The Android Open Accessory Development Kit (ADK) provides an implementation of an Android USB
- accessory that is based on the <a href="http://www.arduino.cc/">Arduino open source electronics
- prototyping platform</a>, the accessory's hardware design files, code that implements the
- accessory's firmware, and the Android application that interacts with the accessory. The hardware
- design files and firmware code are contained in the <a href=
- "https://dl-ssl.google.com/android/adk/adk_release_0512.zip">ADK package download</a>.</p>
- <p>The main hardware and software components of the ADK include:</p>
-
- <ul>
- <li>A USB micro-controller board that is based on the Arduino Mega2560 and Circuits@Home USB
- Host Shield designs (now referred to as the ADK board), which you will later implement as an
- Android USB accessory. The ADK board provides input and output pins that you can implement
- through the use of attachments called "shields." Custom firmware, written in C++, is installed
- on the board to define the board's functionality and interaction with the attached shield and
- Android-powered device. The hardware design files for the board are located in
- <code>hardware/</code> directory.</li>
-
- <li>An Android Demo Shield (ADK shield) that affixes atop the ADK board implements the input
- and output points on the board. These implementations include a joystick, LED outputs, and
- temperature and light sensors. You can create or buy your own shields or wire your own features
- to the ADK board to implement custom functionality. The hardware design files for the shield
- are located in <code>hardware/</code>.</li>
-
- <li>A library based on the <a href=
- "http://www.circuitsathome.com/arduino_usb_host_shield_projects">Arduino USB Host Shield</a>
- library provides the logic for the USB micro-controller board to act as a USB Host. This allows
- the board to initiate transactions with USB devices. Describing how to use this entire library
- is out of the scope of this document. Where needed, this document points out important
- interactions with the library. For more information, see the source code for the Arduino USB
- Host Shield library in the <code>firmware/arduino_libs/USB_Host_Shield</code> directory.</li>
-
- <li>An Arduino sketch, <code>firmware/demokit/demokit.pde</code>, defines the firmware that
- runs on the ADK board and is written in C++. The sketch calls the Android accessory protocol
- library to interact with the Android-powered device. It also sends data from the ADK board and
- shield to the Android application and receives data from the Android application and outputs it
- to the ADK board and shield.</li>
-
- <li>The Android accessory protocol library, which is located in the
- <code>firmware/arduino_libs/AndroidAccessory</code> directory. This library defines how to
- enumerate the bus, find a connected Android-powered device that supports accessory mode, and
- how to setup communication with the device.</li>
-
- <li>Other third party libraries to support the ADK board's functionality:
- <ul>
- <li><a href="http://www.arduino.cc/playground/Main/CapSense">CapSense library</a></li>
-
- <li><a href="http://www.arduino.cc/playground/Learning/I2C">I2C / TWI (Two-Wire Interface)
- library</a></li>
-
- <li><a href="http://www.arduino.cc/playground/ComponentLib/Servo">Servo library</a></li>
-
- <li><a href="http://www.arduino.cc/playground/Code/Spi">Spi library</a></li>
-
- <li><a href="http://www.arduino.cc/en/Reference/Wire">Wire library</a></li>
-
- <li>An Android application, DemoKit, that communicates with the ADK board and shield. The
- source for this project is in the <code>app/</code> directory.</li>
- </ul>
- </li>
-
- </ul>
-
- <h2 id="getting-started">Getting Started with the ADK</h2>
-
- <p>The following sections describe how to install the Arduino software on your computer, use the
- Arduino software to install the ADK board's firmware, and install and run the accompanying
- Android application for the ADK board. Before you begin, download the following items to set up
- your development environment:</p>
-
- <ul>
- <li><a href="http://www.arduino.cc/en/Main/software">Arduino Software</a>: contains libraries
- and an IDE for coding and installing firmware to the ADK board.</li>
-
- <li><a href="http://www.arduino.cc/playground/Main/CapSense">CapSense library</a>: contains the
- libraries to sense human capacitance. This is needed for the capacative button that is located
- on the ADK shield.</li>
-
- <li><a href="https://dl-ssl.google.com/android/adk/adk_release_0512.zip">The ADK package</a>: contains the firmware for the ADK board and hardware design
- files for the ADK board and shield.</li>
- </ul>
-
- <h3 id="installing">Installing the Arduino software and necessary libraries</h3>
-
- <p>To install the Arduino software:</p>
-
- <ol>
- <li>
- <a href="http://arduino.cc/en/Guide/HomePage">Download and install</a> the Arduino Software
- as described on the Arduino website.
-
- <p class="note"><strong>Note:</strong> If you are on a Mac, install the FTDI USB Serial
- Driver that is included in the Arduino package, even though the installation instructions say
- otherwise.</p>
- </li>
-
- <li><a href="https://dl-ssl.google.com/android/adk/adk_release_0512.zip">Download</a> and
- extract the ADK package to a directory of your choice. You should have an <code>app</code>,
- <code>firmware</code>, and <code>hardware</code> directories.</li>
-
- <li>Extract the CapSense download to a directory of your choice.</li>
-
- <li>Install the necessary libraries:
-
- <p>On Windows:</p>
-
- <ol type="a">
- <li>Copy the <code>firmware/arduino_libs/AndroidAccessory</code> and
- <code>firmware/arduino_libs/USB_Host_Shield</code> directories (the complete directories,
- not just the files within) to the <code><arduino_installation_root>/libraries/</code>
- directory.</li>
-
- <li>Create a CapSense directory in the
- <code><arduino_installation_root>/libraries/</code> directory</li>
-
- <li>Copy <code>CapSense.cpp</code> and <code>CapSense.h</code> from the unzipped CapSense
- download to the <code>CapSense</code> directory.</li>
- </ol>
-
- <p>On Mac:</p>
-
- <ol type="a">
- <li>Create, if it does not already exist, an <code>Arduino</code>
- directory inside your user account's <code>Documents</code> directory, and within
- that, a <code>libraries</code> directory.</li>
-
- <li>Copy the <code>firmware/arduino_libs/AndroidAccessory</code> and
- <code>firmware/arduino_libs/USB_Host_Shield</code> directories (the
- complete directories, not just the files within) to your
- <code>Documents/Arduino/libraries/</code> directory.</li>
-
- <li>Create a <code>CapSense</code> directory in your
- <code>Documents/Arduino/libraries/</code> directory.</li>
-
- <li>Copy <code>CapSense.cpp</code> and <code>CapSense.h</code> from the unzipped CapSense
- download to the <code>CapSense</code> directory.</li>
- </ol>
-
- <p>On Linux (Ubuntu):</p>
-
- <ol type="a">
- <li>Copy the <code>firmware/arduino_libs/AndroidAccessory</code> and
- <code>firmware/arduino_libs/USB_Host_Shield</code> directories (the complete directories,
- not just the files within) to the <code><arduino_installation_root>/libraries/</code>
- directory.</li>
-
- <li>Create a <code>CapSense</code> directory in the
- <code><arduino_installation_root>/libraries/</code> directory.</li>
-
- <li>Copy <code>CapSense.cpp</code> and <code>CapSense.h</code> from the unzipped CapSense
- download to the <code>CapSense</code> directory.</li>
-
- <li>Install the avr-libc library by entering <code>sudo apt-get install avr-libc</code>
- from a shell prompt.</li>
- </ol>
- </li>
- </ol>
-
- <p>You should now have three new directories in the Arduino libraries directory:
- <code>AndroidAccessory</code>, <code>USB_Host_Shield</code>, and <code>CapSense</code>.</p>
-
- <h3 id="installing-firmware">Installing the firmware to the ADK board</h3>
-
- <p>To install the firmware to the ADK board:</p>
-
- <ol>
- <li>Connect the ADK board to your computer using the micro-USB port, which allows two-way
- communication and provides power to the ADK board.</li>
-
- <li>Launch Arduino.</li>
-
- <li>Click <strong>Tools > Board > Arduino Mega 2560</strong> to specify the ADK board's
- type.</li>
-
- <li>Select the appropriate USB port:
-
- <ul>
- <li>On Windows: click <strong>Tools > Serial Port > COM#</strong> to specify the port
- of communication. The COM port number varies depending on your computer. COM1 is usually
- reserved for serial port connections. You most likely want COM2 or COM3.</li>
-
- <li>On Mac: Click <strong>Tools > Serial Port > dev/tty.usbserial-###</strong> to
- specify the port of communication.</li>
-
- <li>On Linux (Ubuntu): Click <strong>Tools > Serial Port > dev/ttyUSB#</strong> to
- specify the port of communication.</li>
- </ul>
- </li>
-
- <li>To open the firmware code (a sketch), click <strong>File > Open</strong> and select
- <code>firmware/demokit/demokit.pde</code>.</li>
-
- <li>Click <strong>Sketch > Verify/Compile</strong> to ensure that the sketch has no
- errors.</li>
-
- <li>Select <strong>File > Upload to I/O Board</strong>. When Arduino outputs <strong>Done
- uploading.</strong>, the board is ready to communicate with your Android-powered device.</li>
- </ol>
-
- <h3 id="running-demokit">Running the DemoKit Android application</h3>
-
- <p>The DemoKit Android application runs on your Android-powered device and communicates with the
- ADK board. The ADK board receives commands such as lighting up the board's LEDs or sends data
- from the board such as joystick movement and temperature readings.</p>
-
- <p>To install and run the application in Eclipse:</p>
-
- <ol>
- <li><a href="http://code.google.com/android/add-ons/google-apis/installing.html">Install the
- Google APIs API Level 10 add-on library</a>, which includes the Open Accessory library for
- 2.3.4 devices that support accessory mode. This library is also forward compatible with Android
- 3.1 or newer devices that support accessory mode. If you only care about Android 3.1 or newer
- devices, all you need is API Level 12. For more information on deciding which API level to use,
- see the <a href="{@docRoot}guide/topics/usb/accessory.html#choosing">USB Accessory</a>
- documentation.</li>
-
- <li>Click <strong>File > New > Project...</strong>, then select <strong>Android >
- Android Project</strong></li>
-
- <li>In the <strong>Project name:</strong> field, type DemoKit.</li>
-
- <li>Choose <strong>Create project from existing source</strong>, click <strong>Browse</strong>,
- select the <code>app</code> directory, click <strong>Open</strong> to close that dialog and then
- click <strong>Finish</strong>.</li>
-
- <li>For Build Target, select <strong>Google APIs</strong> (Platform 2.3.3, API Level 10).
-
- <p class="note"><strong>Note:</strong> Even though the add-on is labeled as
- <strong>2.3.3</strong>, the newest Google API add-on library for API level 10 adds USB Open
- Accessory API support for 2.3.4 devices.</p>
- </li>
-
- <li>Click <strong>Finish</strong>.</li>
-
- <li>Install the application to your device.</li>
-
- <li>Connect the ADK board (USB-A) to your Android-powered device (micro-USB). Ensure that the
- power cable to the accessory is plugged in or that the micro-USB port on the accesory is
- connected to your computer for power (this also allows you to <a href="#monitoring">monitor the
- ADK board</a>). When connected, accept the prompt that asks for whether or not to open the
- DemoKit application to connect to the accessory. If the prompt does not show up, connect and
- reconnect the accessory.</li>
- </ol>
-
- <p>You can now interact with the ADK board by moving the color LED or servo sliders (make sure
- the servos are connected) or by pressing the relay buttons in the application. On the ADK shield,
- you can press the buttons and move the joystick to see their outputs displayed in the
- application.</p>
-
- <h3 id="monitoring">Monitoring the ADK Board</h3>
-
- <p>The ADK firmware consists of a few files that you should be looking at if you want to build
- your own accessory. The files in the <code>firmware/arduino_libs/AndroidAccessory</code>
- directory are the most important files and have the logic to detect and connect to
- Android-powered devices that support accessory mode. Feel free to add debug statements (Arduino
- <code>Serial.print()</code> statements) to the code located in the
- <code>arduino_libraries_directory/AndroidAccessory</code> directory and
- <code>firmware/demokit/demokit.pde</code> sketch and re-upload the sketch to the ADK board to
- discover more about how the firmware works.</p>
-
- <p>You can view the debug statements in the Arduino Serial Monitor by clicking <strong>Tools >
- Serial Monitor</strong> and setting the baud to 115200. The following sections about how
- accessories communicate with Android-powered devices describe much of what you should be doing in
- your own accessory.</p>
-
- <h2 id="accessory-protocol">Implementing the Android Accessory Protocol</h2>
-
- <p>An Android USB accessory must adhere to Android Accessory Protocol, which defines how
- an accessory detects and sets up communication with an Android-powered device. In general, an
- accessory should carry out the following steps:</p>
-
- <ol>
- <li>Wait for and detect connected devices</li>
-
- <li>Determine the device's accessory mode support</li>
-
- <li>Attempt to start the device in accessory mode if needed</li>
-
- <li>Establish communication with the device if it supports the Android accessory protocol</li>
- </ol>
-
- <p>The following sections go into depth about how to implement these steps.</p>
-
- <h3 id="wait">Wait for and detect connected devices</h3>
-
- <p>Your accessory should have logic to continuously check
- for connected Android-powered devices. When a device is connected, your accessory should
- determine if the device supports accessory mode.</p>
-
- <h3 id="determine">Determine the device's accessory mode support</h3>
-
-
- <p>When an Android-powered device is connected, it can be in one of three states:</p>
-
- <ol type="a">
- <li>The attached device supports Android accessory mode and is already in accessory mode.</li>
-
- <li>The attached device supports Android accessory mode, but it is not in accessory mode.</li>
-
- <li>The attached device does not support Android accessory mode.</li>
- </ol>
-
- <p>During the initial connection, the accessory should check the vendor and product IDs of the
- connected device's USB device descriptor. The vendor ID should match Google's ID (0x18D1) and the
- product ID should be 0x2D00 or 0x2D01 if the device is already in accessory mode (case A). If so,
- the accessory can now <a href="#establish">establish communication with the device</a> through
- bulk transfer endpoints with its own communication protocol. There is no need to start the device
- in accessory mode.</p>
-
- <p class="note"><strong>Note:</strong> 0x2D00 is reserved for Android-powered devices that
- support accessory mode. 0x2D01 is reserved for devices that support accessory mode as well as the
- ADB (Android Debug Bridge) protocol, which exposes a second interface with two bulk endpoints for
- ADB. You can use these endpoints for debugging the accessory application if you are simulating
- the accessory on a computer. In general, do not use this interface unless your accessory is
- implementing a passthrough to ADB on the device.</p>
-
- <p>If the vendor and product ID do not match, there is no way to distinguish between states b and
- c, so the accessory <a href="#start">attempts to start the device in accessory mode</a> to figure
- out if the device is supported.</p>
-
- <h3 id="start">Attempt to start the device in accessory mode</h3>
-
- <p>If the vendor and product IDs do not correspond to an Android-powered device in accessory
- mode, the accessory cannot discern whether the device supports accessory mode and is not in that
- state, or if the device does not support accessory mode at all. This is because devices that
- support accessory mode but aren't in it initially report the device's manufacturer vendor ID and
- product ID, and not the special Android Open Accessory ones. In either case, the accessory should try to start
- the device into accessory mode to figure out if the device supports it. The following steps
- explain how to do this:</p>
-
- <ol>
- <li>Send a 51 control request ("Get Protocol") to figure out if the device supports the Android
- accessory protocol. A non-zero number is returned if the protocol is supported, which
- represents the version of the protocol that the device supports (currently, only version 1
- exists). This request is a control request on endpoint 0 with the following characteristics:
- <pre>
-requestType: USB_DIR_IN | USB_TYPE_VENDOR
-request: 51
-value: 0
-index: 0
-data: protocol version number (16 bits little endian sent from the device to the accessory)
-</pre>
- </li>
-
- <li>If the device returns a proper protocol version, send identifying string information to the
- device. This information allows the device to figure out an appropriate application for this
- accessory and also present the user with a URL if an appropriate application does not exist.
- These requests are control requests on endpoint 0 (for each string ID) with the following
- characteristics:
- <pre>
-requestType: USB_DIR_OUT | USB_TYPE_VENDOR
-request: 52
-value: 0
-index: string ID
-data zero terminated UTF8 string sent from accessory to device
-</pre>
-
- <p>The following string IDs are supported, with a maximum size of 256 bytes for each string
- (must be zero terminated with \0).</p>
- <pre>
-manufacturer name: 0
-model name: 1
-description: 2
-version: 3
-URI: 4
-serial number: 5
-</pre>
- </li>
-
- <li>When the identifying strings are sent, request the device start up in accessory mode. This
- request is a control request on endpoint 0 with the following characteristics:
- <pre>
-requestType: USB_DIR_OUT | USB_TYPE_VENDOR
-request: 53
-value: 0
-index: 0
-data: none
-</pre>
- </li>
- </ol>
-
- <p>After sending the final control request, the connected USB device should re-introduce itself
- on the bus in accessory mode and the accessory can re-enumerate the connected devices. The
- algorithm jumps back to <a href="#determine">determining the device's accessory mode support</a>
- to check for the vendor and product ID. The vendor ID and product ID of the device will be
- different if the device successfully switched to accessory mode and will now correspond to
- Google's vendor and product IDs instead of the device manufacturer's IDs. The accessory can now
- <a href="#establish">establish communication with the device</a>.</p>
-
- <p>If at any point these steps fail, the device does not support Android accessory mode and the
- accessory should wait for the next device to be connected.</p>
-
- <h3 id="establish">Establish communication with the device</h3>
-
- <p>If an Android-powered device in accessory mode is detected, the accessory can query the
- device's interface and endpoint descriptors to obtain the bulk endpoints to communicate with the
- device. An Android-powered device that has a product ID of 0x2D00 has one interface with two bulk
- endpoints for input and output communication. A device with product ID of 0x2D01 has two
- interfaces with two bulk endpoints each for input and output communication. The first interface
- is for standard communication while the second interface is for ADB communication. To communicate
- on an interface, all you need to do is find the first bulk input and output endpoints, set the
- device's configuration to a value of 1 with a SET_CONFIGURATION (0x09) device request, then
- communicate using the endpoints.</p>
-
- <h2 id="firmware">How the ADK board implements the Android Accessory protocol</h2>
-
- <p>If you have access to the ADK board and shield, the following sections describe the firmware
- code that you installed onto the ADK board. The firmware demonstrates a practical example of how
- to implement the Android Accessory protocol. Even if you do not have the ADK board and shield,
- reading through how the hardware detects and interacts with devices in accessory mode is still
- useful if you want to port the code over for your own accessories.</p>
-
- <p>The important pieces of the firmware are the
- <code>accessory/demokit/demokit/demokit.pde</code> sketch, which is the code that receives and
- sends data to the DemoKit application running on the Android-powered device. The code to detect
- and set up communication with the Android-powered device is contained in the
- <code>accessory/arduino_libs/AndroidAccessory/AndroidAccessory.h</code> and
- <code>accessory/arduino_libs/AndroidAccessory/AndroidAccessory.cpp</code> files. This code
- includes most of the logic that will help you implement your own accessory's firmware. It might
- be useful to have all three of these files open in a text editor as you read through these next
- sections.</p>
-
- <p>The following sections describe the firmware code in the context of the algorithm described in
- <a href="#accessory-protocol">Implementing the Android Accessory Protocol</a>.</p>
-
- <h3 id="wait-adk">Wait for and detect connected devices</h3>
-
- <p>In the firmware code (<code>demokit.pde</code>), the <code>loop()</code> function runs
- repeatedly and calls <code>AndroidAccessory::isConnected()</code> to check for any connected
- devices. If there is a connected device, it continuously updates the input and output streams
- going to and from the board and application. If nothing is connected, it continuously checks for
- a device to be connected:</p>
- <pre>
-...
-
-AndroidAccessory acc("Google, Inc.",
- "DemoKit",
- "DemoKit Arduino Board",
- "1.0",
- "http://www.android.com",
- "0000000012345678");
-
-...
-void loop()
-{
-...
- if (acc.isConnected()) {
- //communicate with Android application
- }
- else{
- //set the accessory to its default state
- }
-...
-}
-</pre>
-
- <h3 id="determine-adk">Determine the connected device's accessory mode support</h3>
-
- <p>When a device is connected to the ADK board, it can already be in accessory mode, support
- accessory mode and is not in that mode, or does not support accessory mode. The
- <code>AndroidAccessory::isConnected()</code> method checks for these cases and responds
- accordingly when the <code>loop()</code> function calls it. This function first checks to see if
- the device that is connected hasn't already been handled. If not, it gets the connected device's
- device descriptor to figure out if the device is already in accessory mode by calling
- <code>AndroidAccessory::isAccessoryDevice()</code>. This method checks the vendor and product ID
- of the device descriptor. A device in accessory mode has a vendor ID of 0x18D1 and a product ID
- of 0x2D00 or 0x2D01. If the device is in accessory mode, then the ADK board can <a href=
- "#establish">establish communication with the device</a>. If not, the board <a href=
- "#start">attempts to start the device in accessory mode</a>.</p>
- <pre>
-bool AndroidAccessory::isConnected(void)
-{
- USB_DEVICE_DESCRIPTOR *devDesc = (USB_DEVICE_DESCRIPTOR *) descBuff;
- byte err;
-
- max.Task();
- usb.Task();
-
- if (!connected &&
- usb.getUsbTaskState() >= USB_STATE_CONFIGURING &&
- usb.getUsbTaskState() != USB_STATE_RUNNING) {
- Serial.print("\nDevice addressed... ");
- Serial.print("Requesting device descriptor.");
-
- err = usb.getDevDescr(1, 0, 0x12, (char *) devDesc);
- if (err) {
- Serial.print("\nDevice descriptor cannot be retrieved. Program Halted\n");
- while(1);
- }
-
- if (isAccessoryDevice(devDesc)) {
- Serial.print("found android accessory device\n");
-
- connected = configureAndroid();
- } else {
- Serial.print("found possible device. switching to serial mode\n");
- switchDevice(1);
- }
- } else if (usb.getUsbTaskState() == USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE) {
- connected = false;
- }
-
- return connected;
-}
-</pre>
-
- <h3 id="start-adk">Attempt to start the device in accessory mode</h3>
-
- <p>If the device is not already in accessory mode, then the ADK board must determine whether or
- not it supports it by sending control request 51 to check the version of the USB accessory
- protocol that the device supports (see <code>AndroidAccessory::getProtocol()</code>). Protocol
- version 1 is the only version for now, but this can be an integer greater than zero in the
- future. If the appropriate protocol version is returned, the board sends control request 52 (one
- for each string with <code>AndroidAcessory:sendString()</code>) to send it's identifying
- information, and tries to start the device in accessory mode with control request 53. The
- <code>AndroidAccessory::switchDevice()</code> method takes care of this:</p>
- <pre>
-bool AndroidAccessory::switchDevice(byte addr)
-{
- int protocol = getProtocol(addr);
- if (protocol == 1) {
- Serial.print("device supports protocol 1\n");
- } else {
- Serial.print("could not read device protocol version\n");
- return false;
- }
-
- sendString(addr, ACCESSORY_STRING_MANUFACTURER, manufacturer);
- sendString(addr, ACCESSORY_STRING_MODEL, model);
- sendString(addr, ACCESSORY_STRING_DESCRIPTION, description);
- sendString(addr, ACCESSORY_STRING_VERSION, version);
- sendString(addr, ACCESSORY_STRING_URI, uri);
- sendString(addr, ACCESSORY_STRING_SERIAL, serial);
-
- usb.ctrlReq(addr, 0, USB_SETUP_HOST_TO_DEVICE | USB_SETUP_TYPE_VENDOR | USB_SETUP_RECIPIENT_DEVICE,
- ACCESSORY_START, 0, 0, 0, 0, NULL);
- return true;
-}
-</pre>If this method returns false, the board waits until a new device is connected. If it is
-successful, the device displays itself on the USB bus as being in accessory mode when the ADK board
-re-enumerates the bus. When the device is in accessory mode, the accessory then <a href=
-"#establish-adk">establishes communication with the device</a>.
-
- <h3 id="establish-adk">Establish communication with the device</h3>
-
- <p>If a device is detected as being in accessory mode, the accessory must find the proper bulk
- endpoints and set up communication with the device. When the ADK board detects an Android-powered
- device in accessory mode, it calls the <code>AndroidAccessory::configureAndroid()</code>
- function:</p>
- <pre>
-...
-if (isAccessoryDevice(devDesc)) {
- Serial.print("found android acessory device\n");
-
- connected = configureAndroid();
- }
-...
-</pre>
-
- <p>which in turn calls the <code>findEndpoints()</code> function:</p>
- <pre>
-...
-bool AndroidAccessory::configureAndroid(void)
-{
- byte err;
- EP_RECORD inEp, outEp;
-
- if (!findEndpoints(1, &inEp, &outEp))
- return false;
-...
-</pre>
-
- <p>The <code>AndroidAccessory::findEndpoints()</code> function queries the Android-powered
- device's configuration descriptor and finds the bulk data endpoints in which to communicate with
- the USB device. To do this, it first gets the device's first four bytes of the configuration
- descriptor (only need descBuff[2] and descBuff[3]), which contains the information about the
- total length of data returned by getting the descriptor. This data is used to determine whether
- or not the descriptor can fit in the descriptor buffer. This descriptor also contains information
- about all the interfaces and endpoint descriptors. If the descriptor is of appropriate size, the
- method reads the entire configuration descriptor and fills the entire descriptor buffer with this
- device's configuration descriptor. If for some reason the descriptor is no longer attainable, an
- error is returned.</p>
- <pre>
-...
-
-bool AndroidAccessory::findEndpoints(byte addr, EP_RECORD *inEp, EP_RECORD *outEp)
-{
- int len;
- byte err;
- uint8_t *p;
-
- err = usb.getConfDescr(addr, 0, 4, 0, (char *)descBuff);
- if (err) {
- Serial.print("Can't get config descriptor length\n");
- return false;
- }
-
-
- len = descBuff[2] | ((int)descBuff[3] << 8);
- if (len > sizeof(descBuff)) {
- Serial.print("config descriptor too large\n");
- /* might want to truncate here */
- return false;
- }
-
- err = usb.getConfDescr(addr, 0, len, 0, (char *)descBuff);
- if (err) {
- Serial.print("Can't get config descriptor\n");
- return false;
- }
-
-...
-</pre>
-
- <p>Once the descriptor is in memory, a pointer is assigned to the first position of the buffer
- and is used to index the buffer for reading. There are two endpoint pointers (input and output)
- that are passed into <code>AndroidAccessory::findEndpoints()</code> and their addresses are set
- to 0, because the code hasn't found any suitable bulk endpoints yet. A loop reads the buffer,
- parsing each configuration, interface, or endpoint descriptor. For each descriptor, Position 0
- always contains the size of the descriptor in bytes and position 1 always contains the descriptor
- type. Using these two values, the loop skips any configuration and interface descriptors and
- increments the buffer with the <code>descLen</code> variable to get to the next descriptor.</p>
-
- <p class="note"><strong>Note:</strong> An Android-powered device in accessory mode can
- potentially have two interfaces, one for the default communication to the device and the other
- for ADB communication. The default communication interface is always indexed first, so finding
- the first input and output bulk endpoints will return the default communication endpoints, which
- is what the <code>demokit.pde</code> sketch does. If you are writing your own firmware, the logic
- to find the appropriate endpoints for your accessory might be different.</p>
-
- <p>When it finds the first input and output endpoint descriptors, it sets the endpoint pointers
- to those addresses. If the findEndpoints() function finds both an input and output endpoint, it
- returns true. It ignores any other endpoints that it finds (the endpoints for the ADB interface,
- if present).</p>
- <pre>
-...
- p = descBuff;
- inEp->epAddr = 0;
- outEp->epAddr = 0;
- while (p < (descBuff + len)){
- uint8_t descLen = p[0];
- uint8_t descType = p[1];
- USB_ENDPOINT_DESCRIPTOR *epDesc;
- EP_RECORD *ep;
-
- switch (descType) {
- case USB_DESCRIPTOR_CONFIGURATION:
- Serial.print("config desc\n");
- break;
-
- case USB_DESCRIPTOR_INTERFACE:
- Serial.print("interface desc\n");
- break;
-
- case USB_DESCRIPTOR_ENDPOINT:
- epDesc = (USB_ENDPOINT_DESCRIPTOR *)p;
- if (!inEp->epAddr && (epDesc->bEndpointAddress & 0x80))
- ep = inEp;
- else if (!outEp->epAddr)
- ep = outEp;
- else
- ep = NULL;
-
- if (ep) {
- ep->epAddr = epDesc->bEndpointAddress & 0x7f;
- ep->Attr = epDesc->bmAttributes;
- ep->MaxPktSize = epDesc->wMaxPacketSize;
- ep->sndToggle = bmSNDTOG0;
- ep->rcvToggle = bmRCVTOG0;
- }
- break;
-
- default:
- Serial.print("unkown desc type ");
- Serial.println( descType, HEX);
- break;
- }
-
- p += descLen;
- }
-
- if (!(inEp->epAddr && outEp->epAddr))
- Serial.println("can't find accessory endpoints");
-
- return inEp->epAddr && outEp->epAddr;
-}
-
-...
-</pre>
-
- <p>Back in the <code>configureAndroid()</code> function, if there were endpoints found, they are
- appropriately set up for communication. The device's configuration is set to 1 and the state of
- the device is set to "running", which signifies that the device is properly set up to communicate
- with your USB accessory. Setting this status prevents the device from being re-detected and
- re-configured in the <code>AndroidAccessory::isConnected()</code> function.</p>
- <pre>
-bool AndroidAccessory::configureAndroid(void)
-{
- byte err;
- EP_RECORD inEp, outEp;
-
- if (!findEndpoints(1, &inEp, &outEp))
- return false;
-
- memset(&epRecord, 0x0, sizeof(epRecord));
-
- epRecord[inEp.epAddr] = inEp;
- if (outEp.epAddr != inEp.epAddr)
- epRecord[outEp.epAddr] = outEp;
-
- in = inEp.epAddr;
- out = outEp.epAddr;
-
- Serial.print("inEp: ");
- Serial.println(inEp.epAddr, HEX);
- Serial.print("outEp: ");
- Serial.println(outEp.epAddr, HEX);
-
- epRecord[0] = *(usb.getDevTableEntry(0,0));
- usb.setDevTableEntry(1, epRecord);
-
- err = usb.setConf( 1, 0, 1 );
- if (err) {
- Serial.print("Can't set config to 1\n");
- return false;
- }
-
- usb.setUsbTaskState( USB_STATE_RUNNING );
-
- return true;
-}
-</pre>
-
- <p>Lastly, methods to read and write to the appropriate endpoints are needed. The
- <code>demokit.pde</code> sketch calls these methods depending on the data that is read from the
- Android-powered device or sent by the ADK board. For instance, moving the joystick on the ADK
- shield writes data that is read by the DemoKit application running on the Android-powered device.
- Moving sliders on the DemoKit application is read by the <code>demokit.pde</code> sketch and
- changes the state of the accessory, such as lighting up or changing the color of the LED
- lights.</p>
- <pre>
-int AndroidAccessory::read(void *buff, int len, unsigned int nakLimit) {
- return usb.newInTransfer(1, in, len, (char *)buff, nakLimit); }
-
-int AndroidAccessory::write(void *buff, int len) {
- usb.outTransfer(1, out, len, (char *)buff);
- return len; }
-
-</pre>
-
- <p>See the <code>firmware/demokit/demokit.pde</code> file for information about how the ADK board
- reads and writes data.</p>
diff --git a/docs/html/guide/topics/usb/host.jd b/docs/html/guide/topics/usb/host.jd
deleted file mode 100644
index b561754..0000000
--- a/docs/html/guide/topics/usb/host.jd
+++ /dev/null
@@ -1,440 +0,0 @@
-page.title=USB Host
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#api">API Overview</a></li>
-
- <li><a href="#usage">Android Manifest Requirements</a></li>
-
- <li>
- <a href="#working-d">Working with devices</a>
-
- <ol>
- <li><a href="#discovering-d">Discovering a device</a></li>
-
- <li><a href="#permission-d">Obtaining permission to communicate with a device</a></li>
-
- <li><a href="#communicating-d">Communicating with a device</a></li>
-
- <li><a href="#terminating-d">Terminating communication with a device</a></li>
- </ol>
- </li>
- </ol>
-
- <h2>Related Samples</h2>
-
- <ol>
- <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>
- </ol>
- </div>
- </div>
-
- <p>When your Android-powered device is in USB host mode, it acts as the USB host, powers the bus,
- and enumerates connected USB devices. USB host mode is supported in Android 3.1 and higher.</p>
-
- <h2 id="api">API Overview</h2>
-
- <p>Before you begin, it is important to understand the classes that you need to work with. The
- following table describes the USB host APIs in the {@link android.hardware.usb} package.</p>
-
- <p class="table-caption"><strong>Table 1.</strong> USB Host APIs</p>
-
- <table>
- <tr>
- <th>Class</th>
-
- <th>Description</th>
- </tr>
-
- <tr>
- <td>{@link android.hardware.usb.UsbManager}</td>
-
- <td>Allows you to enumerate and communicate with connected USB devices.</td>
- </tr>
-
- <tr>
- <td>{@link android.hardware.usb.UsbDevice}</td>
-
- <td>Represents a connected USB device and contains methods to access its identifying
- information, interfaces, and endpoints.</td>
- </tr>
-
- <tr>
- <td>{@link android.hardware.usb.UsbInterface}</td>
-
- <td>Represents an interface of a USB device, which defines a set of functionality for the
- device. A device can have one or more interfaces on which to communicate on.</td>
- </tr>
-
- <tr>
- <td>{@link android.hardware.usb.UsbEndpoint}</td>
-
- <td>Represents an interface endpoint, which is a communication channel for this interface. An
- interface can have one or more endpoints, and usually has input and output endpoints for
- two-way communication with the device.</td>
- </tr>
-
- <tr>
- <td>{@link android.hardware.usb.UsbDeviceConnection}</td>
-
- <td>Represents a connection to the device, which transfers data on endpoints. This class
- allows you to send data back and forth sychronously or asynchronously.</td>
- </tr>
-
- <tr>
- <td>{@link android.hardware.usb.UsbRequest}</td>
-
- <td>Represents an asynchronous request to communicate with a device through a {@link
- android.hardware.usb.UsbDeviceConnection}.</td>
- </tr>
-
- <tr>
- <td>{@link android.hardware.usb.UsbConstants}</td>
-
- <td>Defines USB constants that correspond to definitions in linux/usb/ch9.h of the Linux
- kernel.</td>
- </tr>
- </table>
-
- <p>In most situations, you need to use all of these classes ({@link
- android.hardware.usb.UsbRequest} is only required if you are doing asynchronous communication)
- when communicating with a USB device. In general, you obtain a {@link
- android.hardware.usb.UsbManager} to retrieve the desired {@link android.hardware.usb.UsbDevice}.
- When you have the device, you need to find the appropriate {@link
- android.hardware.usb.UsbInterface} and the {@link android.hardware.usb.UsbEndpoint} of that
- interface to communicate on. Once you obtain the correct endpoint, open a {@link
- android.hardware.usb.UsbDeviceConnection} to communicate with the USB device.</p>
-
- <h2 id="manifest">Android Manifest Requirements</h2>
-
- <p>The following list describes what you need to add to your application's manifest file before
- working with the USB host APIs:</p>
-
- <ul>
- <li>Because not all Android-powered devices are guaranteed to support the USB host APIs,
- include a <code><uses-feature></code> element that declares that your application uses
- the <code>android.hardware.usb.host</code> feature.</li>
-
- <li>Set the minimum SDK of the application to API Level 12 or higher. The USB host APIs are not
- present on earlier API levels.</li>
-
- <li>If you want your application to be notified of an attached USB device, specify an
- <code><intent-filter></code> and <code><meta-data></code> element pair for the
- <code>android.hardware.usb.action.USB_DEVICE_ATTACHED</code> intent in your main activity. The
- <code><meta-data></code> element points to an external XML resource file that declares
- identifying information about the device that you want to detect.
-
- <p>In the XML resource file, declare <code><usb-device></code> elements for the USB
- devices that you want to filter. The following list describes the attributes of
- <code><usb-device></code>. In general, use vendor and product ID if you want to filter
- for a specific device and use class, subclass, and protocol if you want to filter for a group
- of USB devices, such as mass storage devices or digital cameras. You can specify none or
- all of these attributes. Specifying no attributes matches every USB device, so only do this
- if your application requires it:</p>
-
- <ul>
- <li><code>vendor-id</code></li>
-
- <li><code>product-id</code></li>
-
- <li><code>class</code></li>
-
- <li><code>subclass</code></li>
-
- <li><code>protocol</code> (device or interface)</li>
- </ul>
-
- <p>Save the resource file in the <code>res/xml/</code> directory. The resource file name
- (without the .xml extension) must be the same as the one you specified in the
- <code><meta-data></code> element. The format for the XML resource file is in the
- <a href="#example">example</a> below.</p>
- </li>
- </ul>
-
- <h3 id="manifest-example">Manifest and resource file examples</h3>
-
- <p>The following example shows a sample manifest and its corresponding resource file:</p>
- <pre>
-<manifest ...>
- <uses-feature android:name="android.hardware.usb.host" />
- <uses-sdk android:minSdkVersion="12" />
- ...
- <application>
- <activity ...>
- ...
- <intent-filter>
- <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
- </intent-filter>
-
- <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
- android:resource="@xml/device_filter" />
- </activity>
- </application>
-</manifest>
-</pre>
-
- <p>In this case, the following resource file should be saved in
- <code>res/xml/device_filter.xml</code> and specifies that any USB device with the specified
- attributes should be filtered:</p>
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-
-<resources>
- <usb-device vendor-id="1234" product-id="5678" class="255" subclass="66" protocol="1" />
-</resources>
-</pre>
-
- <h2 id="working-d">Working with Devices</h2>
-
- <p>When users connect USB devices to an Android-powered device, the Android system can determine
- whether your application is interested in the connected device. If so, you can set up
- communication with the device if desired. To do this, your application has to:</p>
-
- <ol>
- <li>Discover connected USB devices by using an intent filter to be notified when the user
- connects a USB device or by enumerating USB devices that are already connected.</li>
-
- <li>Ask the user for permission to connect to the USB device, if not already obtained.</li>
-
- <li>Communicate with the USB device by reading and writing data on the appropriate interface
- endpoints.</li>
- </ol>
-
- <h3 id="discovering-d">Discovering a device</h3>
-
- <p>Your application can discover USB devices by either using an intent filter to be notified when
- the user connects a device or by enumerating USB devices that are already connected. Using an
- intent filter is useful if you want to be able to have your application automatically detect a
- desired device. Enumerating connected USB devices is useful if you want to get a list of all
- connected devices or if your application did not filter for an intent.</p>
-
- <h4 id="using-intents">Using an intent filter</h4>
-
- <p>To have your application discover a particular USB device, you can specify an intent filter to
- filter for the <code>android.hardware.usb.action.USB_DEVICE_ATTACHED</code> intent. Along with
- this intent filter, you need to specify a resource file that specifies properties of the USB
- device, such as product and vendor ID. When users connect a device that matches your device
- filter, the system presents them with a dialog that asks if they want to start your application.
- If users accept, your application automatically has permission to access the device until the
- device is disconnected.</p>
-
- <p>The following example shows how to declare the intent filter:</p>
- <pre>
-<activity ...>
-...
- <intent-filter>
- <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
- </intent-filter>
-
- <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
- android:resource="@xml/device_filter" />
-</activity>
-</pre>
-
- <p>The following example shows how to declare the corresponding resource file that specifies the
- USB devices that you're interested in:</p>
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-
-<resources>
- <usb-device vendor-id="1234" product-id="5678" />
-</resources>
-</pre><!-- REMEMBER TO ADD PROTOCOL, and device class and subclass, if applicable -->
-
- <p>In your activity, you can obtain the {@link android.hardware.usb.UsbDevice} that represents
- the attached device from the intent like this:</p>
- <pre>
-UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
-</pre>
-
- <h4>Enumerating devices</h4>
-
- <p>If your application is interested in inspecting all of the USB devices currently connected
- while your application is running, it can enumerate devices on the bus. Use the {@link
- android.hardware.usb.UsbManager#getDeviceList() getDeviceList()} method to get a hash map of all
- the USB devices that are connected. The hash map is keyed by the USB device's name if you want to
- obtain a device from the map.</p>
- <pre>
-UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
-...
-HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
-UsbDevice device = deviceList.get("deviceName");
-</pre>
-
- <p>If desired, you can also just obtain an iterator from the hash map and process each device one
- by one:</p>
- <pre>
-UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
-...
-HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
-Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
-while(deviceIterator.hasNext()){
- UsbDevice device = deviceIterator.next()
- //your code
-}
-</pre>
-
- <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
- users.</p>
-
- <p class="note"><strong>Note:</strong> If your application <a href="#using-intents">uses an
- intent filter</a> to discover USB devices as they're connected, it automatically receives
- permission if the user allows your application to handle the intent. If not, you must request
- permission explicitly in your application before connecting to the device.</p>
-
- <p>Explicitly asking for permission might be neccessary in some situations such as when your
- application enumerates USB devices that are already connected and then wants to communicate with
- one. You must check for permission to access a device before trying to communicate with it. If
- not, you will receive a runtime error if the user denied permission to access the device.</p>
-
- <p>To explicitly obtain permission, first create a broadcast receiver. This receiver listens for
- the intent that gets broadcast when you call {@link
- android.hardware.usb.UsbManager#requestPermission requestPermission()}. The call to {@link
- android.hardware.usb.UsbManager#requestPermission requestPermission()} displays a dialog to the
- user asking for permission to connect to the device. The following sample code shows how to
- create the broadcast receiver:</p>
- <pre>
-private static final String ACTION_USB_PERMISSION =
- "com.android.example.USB_PERMISSION";
-private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
-
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
- if (ACTION_USB_PERMISSION.equals(action)) {
- synchronized (this) {
- UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
-
- if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {
- if(device != null){
- //call method to set up device communication
- }
- }
- else {
- Log.d(TAG, "permission denied for device " + device);
- }
- }
- }
- }
-};
-</pre>
-
- <p>To register the broadcast receiver, add this in your <code>onCreate()</code> method in your
- activity:</p>
- <pre>
-UsbManager mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
-private static final String ACTION_USB_PERMISSION =
- "com.android.example.USB_PERMISSION";
-...
-mPermissionIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0);
-IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
-registerReceiver(mUsbReceiver, filter);
-</pre>
-
- <p>To display the dialog that asks users for permission to connect to the device, call the {@link
- android.hardware.usb.UsbManager#requestPermission requestPermission()} method:</p>
- <pre>
-UsbDevice device;
-...
-mUsbManager.requestPermission(device, mPermissionIntent);
-</pre>
-
- <p>When users reply to the dialog, your broadcast receiver receives the intent that contains the
- {@link android.hardware.usb.UsbManager#EXTRA_PERMISSION_GRANTED} extra, which is a boolean
- representing the answer. Check this extra for a value of true before connecting to the
- device.</p>
-
- <h3 id="communicating-d">Communicating with a device</h3>
-
- <p>Communication with a USB device can be either synchronous or asynchronous. In either case, you
- should create a new thread on which to carry out all data transmissions, so you don't block the
- UI thread. To properly set up communication with a device, you need to obtain the appropriate
- {@link android.hardware.usb.UsbInterface} and {@link android.hardware.usb.UsbEndpoint} of the
- device that you want to communicate on and send requests on this endpoint with a {@link
- android.hardware.usb.UsbDeviceConnection}. In general, your code should:</p>
-
- <ul>
- <li>Check a {@link android.hardware.usb.UsbDevice} object's attributes, such as product ID,
- vendor ID, or device class to figure out whether or not you want to communicate with the
- device.</li>
-
- <li>When you are certain that you want to communicate with the device, find the appropriate
- {@link android.hardware.usb.UsbInterface} that you want to use to communicate along with the
- appropriate {@link android.hardware.usb.UsbEndpoint} of that interface. Interfaces can have one
- or more endpoints, and commonly will have an input and output endpoint for two-way
- communication.</li>
-
- <li>When you find the correct endpoint, open a {@link android.hardware.usb.UsbDeviceConnection}
- on that endpoint.</li>
-
- <li>Supply the data that you want to transmit on the endpoint with the {@link
- android.hardware.usb.UsbDeviceConnection#bulkTransfer bulkTransfer()} or {@link
- android.hardware.usb.UsbDeviceConnection#controlTransfer controlTransfer()} method. You should
- carry out this step in another thread to prevent blocking the main UI thread. For more
- information about using threads in Android, see <a href=
- "{@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and
- Threads</a>.</li>
- </ul>
-
- <p>The following code snippet is a trivial way to do a synchronous data transfer. Your code
- 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 static int TIMEOUT = 0;
-private boolean forceClaim = true;
-
-...
-
-UsbInterface intf = device.getInterface(0);
-UsbEndpoint endpoint = intf.getEndpoint(0);
-UsbDeviceConnection connection = mUsbManager.openDevice(device);
-connection.claimInterface(intf, forceClaim);
-connection.bulkTransfer(endpoint, bytes, bytes.length, TIMEOUT); //do in another thread
-</pre>
-
- <p>To send data asynchronously, use the {@link android.hardware.usb.UsbRequest} class to {@link
- android.hardware.usb.UsbRequest#initialize initialize} and {@link
- android.hardware.usb.UsbRequest#queue queue} an asynchronous request, then wait for the result
- with {@link android.hardware.usb.UsbDeviceConnection#requestWait requestWait()}.</p>
-
- <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
- shows how to listen on an interrupt endpoint asynchronously.</p>
-
- <h3 id="terminating-d">Terminating communication with a device</h3>
-
- <p>When you are done communicating with a device or if the device was detached, close the {@link
- android.hardware.usb.UsbInterface} and {@link android.hardware.usb.UsbDeviceConnection} by
- calling {@link android.hardware.usb.UsbDeviceConnection#releaseInterface releaseInterface()} and
- {@link android.hardware.usb.UsbDeviceConnection#close() close()}. To listen for detached events,
- create a broadcast receiver like below:</p>
- <pre>
-BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
-
- if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action)) {
- UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
- if (device != null) {
- // call your method that cleans up and closes communication with the device
- }
- }
- }
-};
-</pre>
-
- <p>Creating the broadcast receiver within the application, and not the manifest, allows your
- application to only handle detached events while it is running. This way, detached events are
- only sent to the application that is currently running and not broadcast to all applications.</p>
-
diff --git a/docs/html/guide/topics/usb/index.jd b/docs/html/guide/topics/usb/index.jd
deleted file mode 100644
index ef53bdf..0000000
--- a/docs/html/guide/topics/usb/index.jd
+++ /dev/null
@@ -1,67 +0,0 @@
-page.title=USB Host and Accessory
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>Topics</h2>
-
- <ol>
- <li><a href="{@docRoot}guide/topics/usb/accessory.html">USB Accessory</a></li>
-
- <li><a href="{@docRoot}guide/topics/usb/host.html">USB Host</a></li>
- </ol>
- </div>
- </div>
-
- <p>Android supports a variety of USB peripherals and Android USB accessories (hardware that
- implements the Android accessory protocol) through two modes: USB accessory and USB host. In USB
- accessory mode, the external USB hardware act as the USB hosts. Examples of accessories might
- include robotics controllers; docking stations; diagnostic and musical equipment; kiosks; card
- readers; and much more. This gives Android-powered devices that do not have host capabilities the
- ability to interact with USB hardware. Android USB accessories must be designed to work with
- Android-powered devices and must adhere to the <a href=
- "http://accessories.android.com/demokit">Android accessory communication protocol</a>. In USB
- host mode, the Android-powered device acts as the host. Examples of devices include digital
- cameras, keyboards, mice, and game controllers. USB devices that are designed for a wide range of
- applications and environments can still interact with Android applications that can correctly
- communicate with the device.</p>
-
- <p>Figure 1 shows the differences between the two modes. When the Android-powered device is in
- host mode, it acts as the USB host and powers the bus. When the Android-powered device is in USB
- accessory mode, the connected USB hardware (an Android USB accessory in this case) acts as the
- host and powers the bus.</p><img src="{@docRoot}images/usb-host-accessory.png" alt="">
-
- <p class="img-caption"><strong>Figure 1.</strong> USB Host and Accessory Modes</p>
-
- <p>USB accessory and host modes are directly supported in Android 3.1 (API level 12) or newer
- platforms. USB accessory mode is also backported to Android 2.3.4 (API level 10) as an add-on
- library to support a broader range of devices. Device manufacturers can choose whether or not to
- include the add-on library on the device's system image.</p>
-
- <p class="note"><strong>Note:</strong> Support for USB host and accessory modes are ultimately
- dependant on the device's hardware, regardless of platform level. You can filter for devices that
- support USB host and accessory through a <a href=
- "{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature></a> element. See
- the USB <a href="{@docRoot}guide/topics/usb/accessory.html">accessory</a> and <a href=
- "{@docRoot}guide/topics/usb/host.html">host</a> documentation for more details.</p>
-
- <h2>Debugging considerations</h2>
-
- <p>When debugging applications that use USB accessory or host features, you most likely will have
- USB hardware connected to your Android-powered device. This will prevent you from having an
- <code>adb</code> connection to the Android-powered device via USB. You can still access
- <code>adb</code> over a network connection. To enable <code>adb</code> over a network
- connection:</p>
-
- <ol>
- <li>Connect the Android-powered device via USB to your computer.</li>
-
- <li>From your SDK <code>platform-tools/</code> directory, enter <code>adb tcpip 5555</code> at
- the command prompt.</li>
-
- <li>Enter <code>adb connect <device-ip-address>:5555</code> You should now be connected
- to the Android-powered device and can issue the usual <code>adb</code> commands like <code>adb
- logcat</code>.</li>
-
- <li>To set your device to listen on USB, enter <code>adb usb</code>.</li>
- </ol>
diff --git a/docs/html/guide/topics/views/custom-views.jd b/docs/html/guide/topics/views/custom-views.jd
deleted file mode 100644
index 8589b1a..0000000
--- a/docs/html/guide/topics/views/custom-views.jd
+++ /dev/null
@@ -1,544 +0,0 @@
-page.title=Building Custom Views
-parent.title=Views and Layout
-parent.link=index.html
-@jd:body
-
-<p>Android offers a sophisticated and powerful componentized model for building your UI, based on the fundamental building block classes {@link android.view.View} and {@link android.view.ViewGroup}. To start with, the platform includes a variety of prebuilt View and ViewGroup subclasses — called widgets and layouts, respectively — that you can use to construct your UI. The widgets and layouts are fully implemented and handle all of their own measuring and drawing, so you can use them right away. You can make new types of UI elements simply by nesting and grouping the widgets and layouts. Using widgets and layouts is the recommended approach to building a UI for your applications.</p>
-
-<p>A partial list of available widgets includes {@link android.widget.Button Button},
-{@link android.widget.TextView TextView},
-{@link android.widget.EditText EditText},
-{@link android.widget.ListView ListView},
-{@link android.widget.CheckBox CheckBox},
-{@link android.widget.RadioButton RadioButton},
-{@link android.widget.Gallery Gallery},
-{@link android.widget.Spinner Spinner}, and the more special-purpose
-{@link android.widget.AutoCompleteTextView AutoCompleteTextView},
-{@link android.widget.ImageSwitcher ImageSwitcher}, and
-{@link android.widget.TextSwitcher TextSwitcher}. </p>
-
-<p>Among the layouts available are {@link android.widget.LinearLayout LinearLayout},
-{@link android.widget.FrameLayout FrameLayout}, {@link android.widget.AbsoluteLayout AbsoluteLayout}, and others. For more examples, see <a href="layout">Common Layout Objects</a>.</p>
-
-<p>If none of the prebuilt widgets or layouts meets your needs, you can also create your own View subclass, such as a layout group or compound control. If you only need to make small adjustments to an existing widget or layout, you can simply subclass the widget or layout and override its methods.
-</p>
-
-<p>Creating your own View subclasses gives you precise control over the appearance and function of a screen element. To give an idea of the control you get with custom views, here are some examples of what you could do with them:</p>
-
-<ul>
- <li>
- You could create a completely custom-rendered View type, for example a "volume
- control" knob rendered using 2D graphics, and which resembles an
- analog electronic control.
- </li>
- <li>
- You could combine a group of View components into a new single component, perhaps
- to make something like a ComboBox (a combination of popup list and free
- entry text field), a dual-pane selector control (a left and right pane
- with a list in each where you can re-assign which item is in which
- list), and so on.
- </li>
- <li>
- You could override the way that an EditText component is rendered on the screen
- (the <a href="{@docRoot}resources/samples/NotePad/">Notepad sample</a> uses this to good effect,
- to create a lined-notepad page).
- </li>
- <li>
- You could capture other events like key presses and handle them in some custom
- way (such as for a game).
- </li>
-</ul>
-<p>
-The sections below explain how to create custom Views and use them in your application.
-For detailed reference information, see the {@link android.view.View} class. </p>
-
-<p>This document covers the following:</p>
-<ol class="toc">
- <li><a href="#basic">The Basic Approach</a></li>
- <li><a href="#custom">Fully Customized Views</a></li>
- <li><a href="#customexample">Customized View Example</a></li>
- <li><a href="#compound">Compound Controls</a></li>
- <li><a href="#tweaking">Modifying an Existing Component Type</a></li>
-</ol>
-
-<a name="basic"></a>
-<h2>The Basic Approach
-</h2>
-<p>
-These steps provide a high level overview of
-what you need to know to get started in creating your own
-View components:</p>
-
-<ol>
- <li>
- Extend an existing {@link android.view.View View} class or subclass
- with your own class.
- </li>
- <li>
- Override some of the methods from the superclass: the superclass methods
- to override start with '<code>on</code>', for
- example, {@link android.view.View#onDraw onDraw()},
- {@link android.view.View#onMeasure onMeasure()}, and
- {@link android.view.View#onKeyDown onKeyDown()}.
- <ul>
- <li>
- This is similar to the <code>on...</code> events in {@link android.app.Activity
- Activity} or {@link android.app.ListActivity ListActivity}
- that you override for life cycle and other functionality hooks.
- </li>
- </ul>
- <li>
- Use your new extension class: once completed, your new extension class
- can be used in place of the view upon which it was based, but now with the new
- functionality.
- </li>
-</ol>
-<p class="note"><strong>Tip:</strong>
- Extension classes can be defined as inner classes inside the activities
- that use them. This is useful because it controls access to them but
- isn't necessary (perhaps you want to create a new public View for
- wider use in your application).
-</p>
-
-<a name="custom"></a>
-<h2>Fully Customized Components</h2>
-<p>
-Fully customized components can be used to create graphical components that
-appear however you wish. Perhaps a graphical VU
-meter that looks like an old analog gauge, or a sing-a-long text view where
-a bouncing ball moves along the words so you can sing along with a karaoke
-machine. Either way, you want something that the built-in components just
-won't do, no matter how you combine them.</p>
-<p>Fortunately, you can easily create components that look and behave in any
-way you like, limited perhaps only by your imagination, the size of the
-screen, and the available processing power (remember that ultimately your
-application might have to run on something with significantly less power
-than your desktop workstation).</p>
-<p>To create a fully customized component:</p>
-<ol>
- <li>
- The most generic view you can extend is, unsurprisingly, {@link
- android.view.View View}, so you will usually start by extending this to
- create your new super component.
- </li>
- <li>
- You can supply a constructor which can
- take attributes and parameters from the XML, and you can also consume
- your own such attributes and parameters (perhaps the color and range of
- the VU meter, or the width and damping of the needle, etc.)
- </li>
- <li>
- You will probably want to create your own event listeners,
- property accessors and modifiers, and possibly more sophisticated
- behavior in your component class as well.
- </li>
- <li>
- You will almost certainly want to override <code>onMeasure()</code> and
- are also likely to need to override <code>onDraw()</code> if you want
- the component to show something. While both have default behavior,
- the default <code>onDraw()</code> will do nothing, and the default
- <code>onMeasure()</code> will always set a size of 100x100 — which is
- probably not what you want.
- </li>
- <li>
- Other <code>on...</code> methods may also be overridden as required.
- </li>
-</ol>
-<h4><code>onDraw()</code> and <code>onMeasure()</code></h4>
-<p><code>onDraw()</code> delivers you a {@link android.graphics.Canvas Canvas}
-upon which you can implement anything you want: 2D graphics, other standard or
-custom components, styled text, or anything else you can think of.</p>
-<p><em>Note:</em>
-Except for 3D graphics. If you want to
-use 3D graphics, you must extend {@link android.view.SurfaceView SurfaceView}
-instead of View, and draw from a separate thread. See the
-GLSurfaceViewActivity sample
-for details.</p>
-<p><code>onMeasure()</code> is a little more involved. <code>onMeasure()</code>
-is a critical piece of the rendering contract between your component and its
-container. <code>onMeasure()</code> should be overridden to efficiently and
-accurately report the measurements of its contained parts. This is made
-slightly more complex by the requirements of limits from the parent
-(which are passed in to the <code>onMeasure()</code> method) and by the
-requirement to call the <code>setMeasuredDimension()</code> method with the
-measured width and height once they have been calculated. If you fail to
-call this method from an overridden <code>onMeasure()</code> method, the
-result will be an exception at measurement time.</p>
-<p>At a high level, implementing <code>onMeasure()</code> looks something
- like this:</p>
-
-<ol>
- <li>
- The overridden <code>onMeasure()</code> method is called with width and
- height measure specifications (<code>widthMeasureSpec</code> and
- <code>heightMeasureSpec</code> parameters, both are integer codes
- representing dimensions) which should be treated as requirements for
- the restrictions on the width and height measurements you should produce. A
- full reference to the kind of restrictions these specifications can require
- can be found in the reference documentation under {@link
- android.view.View#onMeasure View.onMeasure(int, int)} (this reference
- documentation does a pretty good job of explaining the whole measurement
- operation as well).
- </li>
- <li>
- Your component's <code>onMeasure()</code> method should calculate a
- measurement width and height which will be required to render the
- component. It should try to stay within the specifications passed in,
- although it can choose to exceed them (in this case, the parent can
- choose what to do, including clipping, scrolling, throwing an exception,
- or asking the <code>onMeasure()</code> to try again, perhaps with
- different measurement specifications).
- </li>
- <li>
- Once the width and height are calculated, the <code>setMeasuredDimension(int
- width, int height)</code> method must be called with the calculated
- measurements. Failure to do this will result in an exception being
- thrown.
- </li>
-</ol>
-
-<p>
-Here's a summary of some of the other standard methods that the framework calls on views:
-</p>
-<table border="2" width="85%" align="center" cellpadding="5">
- <thead>
- <tr><th>Category</th> <th>Methods</th> <th>Description</th></tr>
- </thead>
-
- <tbody>
- <tr>
- <td rowspan="2">Creation</td>
- <td>Constructors</td>
- <td>There is a form of the constructor that are called when the view
- is created from code and a form that is called when the view is
- inflated from a layout file. The second form should parse and apply
- any attributes defined in the layout file.
- </td>
- </tr>
- <tr>
- <td><code>{@link android.view.View#onFinishInflate()}</code></td>
- <td>Called after a view and all of its children has been inflated
- from XML.</td>
- </tr>
-
- <tr>
- <td rowspan="3">Layout</td>
- <td><code>{@link android.view.View#onMeasure}</code></td>
- <td>Called to determine the size requirements for this view and all
- of its children.
- </td>
- </tr>
- <tr>
- <td><code>{@link android.view.View#onLayout}</code></td>
- <td>Called when this view should assign a size and position to all
- of its children.
- </td>
- </tr>
- <tr>
- <td><code>{@link android.view.View#onSizeChanged}</code></td>
- <td>Called when the size of this view has changed.
- </td>
- </tr>
-
- <tr>
- <td>Drawing</td>
- <td><code>{@link android.view.View#onDraw}</code></td>
- <td>Called when the view should render its content.
- </td>
- </tr>
-
- <tr>
- <td rowspan="4">Event processing</td>
- <td><code>{@link android.view.View#onKeyDown}</code></td>
- <td>Called when a new key event occurs.
- </td>
- </tr>
- <tr>
- <td><code>{@link android.view.View#onKeyUp}</code></td>
- <td>Called when a key up event occurs.
- </td>
- </tr>
- <tr>
- <td><code>{@link android.view.View#onTrackballEvent}</code></td>
- <td>Called when a trackball motion event occurs.
- </td>
- </tr>
- <tr>
- <td><code>{@link android.view.View#onTouchEvent}</code></td>
- <td>Called when a touch screen motion event occurs.
- </td>
- </tr>
-
- <tr>
- <td rowspan="2">Focus</td>
- <td><code>{@link android.view.View#onFocusChanged}</code></td>
- <td>Called when the view gains or loses focus.
- </td>
- </tr>
-
- <tr>
- <td><code>{@link android.view.View#onWindowFocusChanged}</code></td>
- <td>Called when the window containing the view gains or loses focus.
- </td>
- </tr>
-
- <tr>
- <td rowspan="3">Attaching</td>
- <td><code>{@link android.view.View#onAttachedToWindow()}</code></td>
- <td>Called when the view is attached to a window.
- </td>
- </tr>
-
- <tr>
- <td><code>{@link android.view.View#onDetachedFromWindow}</code></td>
- <td>Called when the view is detached from its window.
- </td>
- </tr>
-
- <tr>
- <td><code>{@link android.view.View#onWindowVisibilityChanged}</code></td>
- <td>Called when the visibility of the window containing the view
- has changed.
- </td>
- </tr>
- </tbody>
-
- </table>
-
-
-<a name="customexample"></a>
-<h3>A Custom View Example</h3>
-<p>The CustomView sample in the
-<a href="{@docRoot}samples/ApiDemos/index.html">API Demos</a> provides an example
-of a customized View. The custom View is defined in the
-<a href="{@docRoot}samples/ApiDemos/src/com/example/android/apis/view/LabelView.html">LabelView</a>
-class.</p>
-<p>The LabelView sample demonstrates a number of different aspects of custom components:</p>
-<ul>
- <li>Extending the View class for a completely custom component.</li>
- <li>Parameterized constructor that takes the view inflation parameters
- (parameters defined in the XML). Some of these are passed through to the
- View superclass, but more importantly, there are some custom attributes defined
- and used for LabelView.</li>
- <li>Standard public methods of the type you would expect to see for a label
- component, for example <code>setText()</code>, <code>setTextSize()</code>,
- <code>setTextColor()</code> and so on.</li>
- <li>An overridden <code>onMeasure</code> method to determine and set the
- rendering size of the component. (Note that in LabelView, the real work is done
- by a private <code>measureWidth()</code> method.)</li>
- <li>An overridden <code>onDraw()</code> method to draw the label onto the
- provided canvas.</li>
-</ul>
-<p>You can see some sample usages of the LabelView custom View in
-<a href="{@docRoot}samples/ApiDemos/res/layout/custom_view_1.html">custom_view_1.xml</a>
-from the samples. In particular, you can see a mix of both <code>android:</code>
-namespace parameters and custom <code>app:</code> namespace parameters. These
-<code>app:</code> parameters are the custom ones that the LabelView recognizes
-and works with, and are defined in a styleable inner class inside of the
-samples R resources definition class.</p>
-
-<a name="compound"></a>
-<h2>Compound Controls
-</h2>
-<p>If you don't want to create a completely customized component, but instead
-are looking to put together a reusable component that consists of a group of
-existing controls, then creating a Compound Component (or Compound Control) might
-fit the bill. In a nutshell, this brings together a number of more atomic
-controls (or views) into a logical group of items that can be treated as a
-single thing. For example, a Combo Box can be thought of as a
-combination of a single line EditText field and an adjacent button with an attached
- PopupList. If you press the button and select
-something from the list, it populates the EditText field, but the user can
-also type something directly into the EditText if they prefer.</p>
-<p>In Android, there are actually two other Views readily available to do
-this: {@link android.widget.Spinner Spinner} and
-{@link android.widget.AutoCompleteTextView AutoCompleteTextView}, but
-regardless, the concept of a Combo Box makes an easy-to-understand
-example.</p>
-<p>To create a compound component:</p>
-<ol>
- <li>
- The usual starting point is a Layout of some kind, so create a class
- that extends a Layout. Perhaps in the case of a Combo box we might use
- a LinearLayout with horizontal orientation. Remember that other layouts
- can be nested inside, so the compound component can be arbitrarily
- complex and structured. Note that just like with an Activity, you can
- use either the declarative (XML-based) approach to creating the
- contained components, or you can nest them programmatically from your
- code.
- </li>
- <li>
- In the constructor for the new class, take whatever parameters the
- superclass expects, and pass them through to the superclass constructor
- first. Then you can set up the other views to use within your new
- component; this is where you would create the EditText field and the
- PopupList. Note that you also might introduce your own attributes and
- parameters into the XML that can be pulled out and used by your
- constructor.
- </li>
- <li>
- You can also create listeners for events that your contained views might
- generate, for example, a listener method for the List Item Click Listener
- to update the contents of the EditText if a list selection is made.
- </li>
- <li>
- You might also create your own properties with accessors and modifiers,
- for example, allow the EditText value to be set initially in the
- component and query for its contents when needed.
- </li>
- <li>
- In the case of extending a Layout, you don't need to override the
- <code>onDraw()</code> and <code>onMeasure()</code> methods since the
- layout will have default behavior that will likely work just fine. However,
- you can still override them if you need to.
- </li>
- <li>
- You might override other <code>on...</code> methods, like
- <code>onKeyDown()</code>, to perhaps choose certain default values from
- the popup list of a combo box when a certain key is pressed.
- </li>
-</ol>
-<p>
- To summarize, the use of a Layout as the basis for a Custom Control has a
-number of advantages, including:</p>
-
-<ul>
- <li>
- You can specify the layout using the declarative XML files just like
- with an activity screen, or you can create views programmatically and
- nest them into the layout from your code.
- </li>
- <li>
- The <code>onDraw()</code> and <code>onMeasure()</code> methods (plus
- most of the other <code>on...</code> methods) will likely have suitable behavior so
- you don't have to override them.
- </li>
- <li>
- In the end, you can very quickly construct arbitrarily complex compound
- views and re-use them as if they were a single component.
- </li>
-</ul>
-<h4>Examples of Compound Controls</h4>
-<p>In the API Demos project
- that comes with the SDK, there are two List
- examples — Example 4 and Example 6 under Views/Lists demonstrate a
- SpeechView which extends LinearLayout to make a component for displaying
- Speech quotes. The corresponding classes in the sample code are
- <code>List4.java</code> and <code>List6.java</code>.</p>
-
-<a name="tweaking"></a>
-<h2>Modifying an Existing View Type
-</h2>
-<p>There is an even easier option for creating a custom View which is
-useful in certain circumstances. If there is a component that is already very
-similar to what you want, you can simply extend that component and just
-override the behavior that you want to change. You can do all of the things
-you would do with a fully customized component, but by starting with a more
-specialized class in the View hierarchy, you can also get a lot of behavior for
-free that probably does exactly what you want.</p>
-<p>For example, the SDK includes a <a
-href="{@docRoot}samples/NotePad/index.html">NotePad application</a> in the
-samples. This demonstrates many aspects of using the Android platform, among
-them is extending an EditText View to make a lined notepad. This is not a
-perfect example, and the APIs for doing this might change from this early
-preview, but it does demonstrate the principles.</p>
-<p>If you haven't done so already, import the
-NotePad sample into Eclipse (or
-just look at the source using the link provided). In particular look at the definition of
-<code>MyEditText</code> in the <a
-href="{@docRoot}samples/NotePad/src/com/example/android/notepad/NoteEditor.html">NoteEditor.java</a>
-file.</p>
-<p>Some points to note here</p>
-<ol>
- <li>
- <strong>The Definition</strong>
- <p>The class is defined with the following line:</p>
- <code>public static class MyEditText extends EditText</code><br><br>
-
- <ul>
- <li>
- It is defined as an inner class within the <code>NoteEditor</code>
- activity, but it is public so that it could be accessed as
- <code>NoteEditor.MyEditText</code> from outside of the <code>NoteEditor</code>
- class if desired.
- </li>
- <li>
- It is <code>static</code>, meaning it does not generate the so-called
- "synthetic methods" that allow it to access data from the parent
- class, which in turn means that it really behaves as a separate
- class rather than something strongly related to <code>NoteEditor</code>.
- This is a cleaner way to create inner classes if they do not need
- access to state from the outer class, keeps the generated class
- small, and allows it to be used easily from other classes.
- </li>
- <li>
- It extends <code>EditText</code>, which is the View we have chosen to
- customize in this case. When we are finished, the new class will be
- able to substitute for a normal <code>EditText</code> view.<br>
- <br>
- </li>
- </ul>
- </li>
- <li>
- <strong>Class Initialization</strong>
- <p>As always, the super is called first. Furthermore,
- this is not a default constructor, but a parameterized one. The
- EditText is created with these parameters when it is inflated from an
- XML layout file, thus, our constructor needs to both take them and pass them
- to the superclass constructor as well.</p>
- </li>
- <li>
- <strong>Overridden Methods</strong>
- <p>In this example, there is only one method to be overridden:
- <code>onDraw()</code> — but there could easily be others needed when you
- create your own custom components.</p>
- <p>For the NotePad sample, overriding the <code>onDraw()</code> method allows
- us to paint the blue lines on the <code>EditText</code> view canvas (the
- canvas is passed into the overridden <code>onDraw()</code> method). The
- super.onDraw() method is called before the method ends. The
- superclass method should be invoked, but in this case, we do it at the
- end after we have painted the lines we want to include.</p>
- <li>
- <strong>Use the Custom Component</strong>
- <p>We now have our custom component, but how can we use it? In the
- NotePad example, the custom component is used directly from the
- declarative layout, so take a look at <code>note_editor.xml</code> in the
- <code>res/layout</code> folder.</p>
- <pre>
-<view xmlns:android="http://schemas.android.com/apk/res/android"
- class="com.android.notepad.NoteEditor$MyEditText"
- id="@+id/note"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="@android:drawable/empty"
- android:padding="10dip"
- android:scrollbars="vertical"
- android:fadingEdge="vertical" /> </pre>
-
- <ul>
- <li>
- The custom component is created as a generic view in the XML, and
- the class is specified using the full package. Note also that the
- inner class we defined is referenced using the
- <code>NoteEditor$MyEditText</code> notation which is a standard way to
- refer to inner classes in the Java programming language.
- </li>
- <li>
- The other attributes and parameters in the definition are the ones
- passed into the custom component constructor, and then passed
- through to the EditText constructor, so they are the same
- parameters that you would use for an EditText view. Note that it is
- possible to add your own parameters as well, and we will touch on
- this again below.
- </li>
- </ul>
- </li>
-</ol>
-<p>And that's all there is to it. Admittedly this is a simple case, but
-that's the point — creating custom components is only as complicated as you
-need it to be.</p>
-<p>A more sophisticated component may override even more <code>on...</code> methods and
-introduce some of its own helper methods, substantially customizing its properties and
-behavior. The only limit is your imagination and what you need the component to
-do.</p>
-
diff --git a/docs/html/guide/topics/views/intro.jd b/docs/html/guide/topics/views/intro.jd
deleted file mode 100644
index f49f547..0000000
--- a/docs/html/guide/topics/views/intro.jd
+++ /dev/null
@@ -1,49 +0,0 @@
-page.title=Introduction to Views
-parent.title=Views and Layout
-parent.link=index.html
-@jd:body
-
-<p>The basic functional unit of an Android application is the <em>activity</em> — an object of the class {@link android.app.Activity android.app.Activity}. An activity can do many things, but by itself it does not have a presence on the screen. To give your activity a screen presence and design its UI, you work with <em>views</em> and <em>viewgroups</em> -- basic units of user interface expression on the Android platform.</p>
-
-<h2>Views</h2>
-<p>A view is an object of base class {@link android.view.View android.view.View}. It's a data structure whose properties store the layout and content for a specific rectangular area of the screen. A View object handles measuring and layout, drawing, focus change, scrolling, and key/gestures for the screen area it represents. </p>
-<p>The View class serves as a base class for <em>widgets </em> — a set of fully implemented subclasses that draw interactive screen elements. Widgets handle their own measuring and drawing, so you can use them to build your UI more quickly. The list of widgets available includes Text, EditText, InputMethod, MovementMethod, Button, RadioButton, Checkbox, and ScrollView.</p>
-
-<h2>Viewgroups </h2>
-
-<p>A viewgroup is an object of class {@link android.view.ViewGroup android.view.Viewgroup}. As its name indicates, a viewgroup is a special type of view object whose function is to contain and manage a subordinate set of views and other viewgroups, Viewgroups let you add structure to your UI and build up complex screen elements that can be addressed as a single entity. </p>
-
-<p>The Viewgroup class serves as a base class for <em>layouts</em> — a set of fully implemented subclasses that provide common types of screen layout. The layouts give you a way to build a structure for a set of views. </p>
-
-<h2>A Tree-Structured UI</h2>
-
-<p>On the Android platform, you define an Activity's UI using a tree of view and viewgroup nodes, as shown in the diagram below. The tree can be as simple or complex as you need to make it, and you can build it up using Android's set of predefined widgets and layouts or custom view types that you create yourself. </p>
-
-<img src={@docRoot}images/viewgroup.png alt="An example of a tree of views and viewgroups" width="312" height="211" align="center"/>
-
-<p>To attach the tree to the screen for rendering, your Activity calls its setContentView() method and passes a reference to the root node object. Once the Android system has the reference to the root node object, it can work directly with the node to invalidate, measure, and draw the tree. When your Activity becomes active and receives focus, the system notifies your activity and requests the root node to measure and draw the tree. The root node then requests that its child nodes draw themselves — in turn, each viewgroup node in the tree is responsible for drawing its direct children. </p>
-
-<p>As mentioned previously, each view group has the responsibility of
- measuring its available space, laying out its children, and calling Draw() on
- each child to let it render itself. The children may request a size and location
- in the parent, but the parent object has the final decision on where how big
- each child can be.</p>
-
-<h2>LayoutParams: How a Child Specifies Its Position and Size</h2>
-
-<p>Every viewgroup class uses a nested class that extends {@link
-android.view.ViewGroup.LayoutParams ViewGroup.LayoutParams}. This subclass
- contains property types that define a child's size and position, in properties
- appropriate for that view group class. </p>
-
-<img src={@docRoot}images/layoutparams.png alt="An example of layoutparams" width="632" height="369" align="center"/>
-
-<p>Note that every LayoutParams subclass has its own syntax for setting
-values. Each child element must define LayoutParams that are appropriate for its parent, although it may define different LayoutParams for its children. </p>
-
-<p>All viewgroups include width and height. Many also include margins and
-borders. You can specify width and height exactly, though you probably won't want
-to do this often. More often you will tell your view to size itself either to
-the dimensions of its content, or to become as big as its containing object
-will allow.</p>
-
diff --git a/docs/html/guide/topics/views/ui-xml.jd b/docs/html/guide/topics/views/ui-xml.jd
deleted file mode 100644
index bcfa562..0000000
--- a/docs/html/guide/topics/views/ui-xml.jd
+++ /dev/null
@@ -1,138 +0,0 @@
-page.title=Declaring a UI in XML
-parent.title=Views and Layout
-parent.link=index.html
-@jd:body
-
-<p>You can create your application's user interface in two ways:
-<ul>
-<li>You can declare UI elements statically, in XML. Android provides a straightforward XML vocabulary that corresponds to the View classes and subclasses, such as those for widgets and layouts. </li>
-<li>You can instantiate screen elements dynamically, at runtime, through code in your application. Your application can refer to or create View or other class objects and manipulate their properties programmatically. </li>
-</ul>
-
-<p>One advantage of declaring your UI in XML is that it enables you to better separate the presentation of your application from the code that controls it's behavior. Your UI description is external to your application code, which means that you can modify or adapt it without having to modify your source code and recompile. For example, you can create XML layouts for different screen orientations and for a variety of device screen sizes or languages. Additionally, declaring in XML makes it easier to see the elements and structure of your UI, so it's easier to debug problems. </p>
-
-<p>The Android framework gives you the flexibility to use either or both of these ways of declaring and managing your application's UI. For example, you could declare your application's default layouts in XML, including the screen elements that will appear in them and their properties. You could then add code in your application that would modify the state of the screen objects, including those declared in XML, at run time. </p>
-
-<p>You build your application's UI in approximately the same way, whether you are declaring it in XML or programmatically. In both cases, your UI will be a tree structure that may include multiple View or Viewgroup subclasses. <p>
-
-<p>In general, the XML vocabulary for declaring UI elements closely follows the structure and naming of the framework's UI-related classes and methods, where element names correspond to class names and attribute names correspond to methods. In fact, the correspondence is often so direct that you can guess what XML attribute corresponds to a class method, or guess what class corresponds to a given xml element. </p>
-
-<p>However, note that the XML vocabulary for defining UI is not entirely identical to the framework's classes and methods. In some cases, there are slight naming differences. For
-example, the EditText element has a <code>text</code> attribute that corresponds to
-EditText.setText. </p>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<p>For your convenience, the API reference documentation for UI related classes
-lists the available XML attributes that correspond to the class methods, including inherited
-attributes.</p>
-
-<p>To learn more about the available XML elements and attributes, as well as the format of the XML file, see <a
-href="{@docRoot}reference/available-resources.html#layoutresources">Layout Resources</a>.</p>
-</div>
-</div>
-
-<p>Using Android's XML vocabulary, you can quickly design UI layouts and the screen elements they contain, in the same way you create HTML files — as a series of nested tags. </p>
-
-<p>Each layout file must contain exactly one root element, and the root element must be a View or ViewGroup object. Once you've defined the root element, you can add additional layout objects or controls as child elements of the root element, if needed. In the example below, the tree of XML elements evaluates to the outermost LinearLayout object.
-
-<p>After you've declared your layout in XML, you must save the file, with the <code>.xml</code> extension, in the proper location, so that it will be compiled correctly. The proper location for storing layout files is in your application's <code>res/layout/</code> directory. </p>
-
-<p>When you compile your application, each XML layout file is compiled into an
-android.view.View resource. You can then load the layout resource from your application code, by calling <code>setContentView(R.layout.<em>layout_file_name</em>)</code> in your {@link android.app.Activity#onCreate(android.os.Bundle) Activity.onCreate()}
-implementation.</p>
-
-<p>When you load a layout resource, the Android system initializes run-time objects corresponding to the elements in your layout. It parses the elements of your layout in-order (depth-first), instantiating the Views and adding them to their parent(s). </p>
-
-<p>Attributes named <code>layout_<em>something</em></code> apply to that
-object's LayoutParams member. <a href="{@docRoot}reference/available-resources.html#layoutresources">Layout
-Resources</a> also describes how to learn the syntax for specifying
-LayoutParams properties. </p>
-
-<p>Also note that Android draws elements in the order in which they
-appear in the XML. Therefore, if elements overlap, the last one in the XML
-file will probably be drawn on top of any previously listed elements in that
-same space.</p>
-
-<p>The following values are supported for dimensions (described in {@link
-android.util.TypedValue TypedValue}):</p>
-
-<ul>
- <li>px (pixels) </li>
- <li>dip (device independent pixels) </li>
- <li>sp (scaled pixels — best for text size) </li>
- <li>pt (points) </li>
- <li>in (inches) </li>
- <li>mm (millimeters) </li>
-</ul>
-
-<p>Example: <code>android:layout_width="25px"</code> </p>
-
-<p>For more information about these dimensions, see <a href="{@docRoot}reference/available-resources.html#dimension">Dimension Values</a>.</p>
-
-<p>The example below shows an XML file and the resulting screen in the UI. Note that the text on the
-top of the screen was set by calling {@link
-android.app.Activity#setTitle(java.lang.CharSequence) Activity.setTitle}. Note
-that the attributes that refer to relative elements (i.e., layout_toLeft)
-refer to the ID using the syntax of a relative resource
-(@id/<em>id_number</em>). </p>
-
-<table border="1">
- <tr>
- <td>
- <pre><?xml version="1.0" encoding="utf-8"?>
-<!-- Demonstrates using a relative layout to create a form -->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/blue"
- android:padding="10px">
-
- <TextView id="@+id/label"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Type here:"/>
-
- <EditText id="@+id/entry"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@android:drawable/editbox_background"
- android:layout_below="@id/label"/>
-
- <Button id="@+id/ok"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/entry"
- android:layout_alignParentRight="true"
- android:layout_marginLeft="10px"
- android:text="OK" />
-
- <Button android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toLeftOf="@id/ok"
- android:layout_alignTop="@id/ok"
- android:text="Cancel" />
-</RelativeLayout></pre></td>
- <td><img src="{@docRoot}images/designing_ui_layout_example.png" alt="Screen shot showing how this layout XML file is rendered." /></td>
- </tr>
-</table>
-
-<h3>Loading the XML Resource </h3>
-
-<p>Loading the compiled layout resource is very easy, and done with a single
-call in the activity's onCreate() method, as shown here:</p>
-
-<pre>
-protected void onCreate(Bundle savedValues)
-{
- // Be sure to call the super class.
- super.onCreate(savedValues);
-
- // Load the compiled layout resource into the window's
- // default ViewGroup.
- // The source file is res/layout/hello_activity.xml
- setContentView(R.layout.hello_activity);
-
- // Retrieve any important stored values.
- restoreValues(savedValues);
-} </pre>
diff --git a/docs/html/guide/topics/wireless/bluetooth.jd b/docs/html/guide/topics/wireless/bluetooth.jd
deleted file mode 100644
index 0567799..0000000
--- a/docs/html/guide/topics/wireless/bluetooth.jd
+++ /dev/null
@@ -1,1086 +0,0 @@
-page.title=Bluetooth
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>Quickview</h2>
- <ul>
- <li>Android's bluetooth APIs allow your application to perform wireless data transactions with
-other devices</li>
- </ul>
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#TheBasics">The Basics</a></li>
- <li><a href="#Permissions">Bluetooth Permissions</a></li>
- <li><a href="#SettingUp">Setting Up Bluetooth</a></li>
- <li><a href="#FindingDevices">Finding Devices</a>
- <ol>
- <li><a href="#QueryingPairedDevices">Querying paired devices</a></li>
- <li><a href="#DiscoveringDevices">Discovering devices</a></li>
- </ol></li>
- <li><a href="#ConnectingDevices">Connecting Devices</a>
- <ol>
- <li><a href="#ConnectingAsAServer">Connecting as a server</a></li>
- <li><a href="#ConnectingAsAClient">Connecting as a client</a></li>
- </ol></li>
- <li><a href="#ManagingAConnection">Managing a Connection</a></li>
- <li><a href="#Profiles">Working with Profiles</a>
- <ol>
- <li><a href="#AT-Commands">Vendor-specific AT commands</a>
- <li><a href="#HDP">Health Device Profile</a>
- </ol></li>
- </ol>
-
- <h2>Key classes</h2>
- <ol>
- <li>{@link android.bluetooth.BluetoothAdapter}</li>
- <li>{@link android.bluetooth.BluetoothDevice}</li>
- <li>{@link android.bluetooth.BluetoothSocket}</li>
- <li>{@link android.bluetooth.BluetoothServerSocket}</li>
- </ol>
-
- <h2>Related samples</h2>
- <ol>
- <li><a href="{@docRoot}resources/samples/BluetoothChat/index.html">Bluetooth Chat</a></li>
- <li><a href="{@docRoot}resources/samples/BluetoothHDP/index.html">Bluetooth HDP (Health Device Profile)</a></li>
- </ol>
-
-</div>
-</div>
-
-
-<p>The Android platform includes support for the Bluetooth network stack,
-which allows a device to wirelessly exchange data with other Bluetooth devices.
-The application framework provides access to the Bluetooth functionality through
-the Android Bluetooth APIs. These APIs let applications wirelessly
-connect to other Bluetooth devices, enabling point-to-point and multipoint
-wireless features.</p>
-
-<p>Using the Bluetooth APIs, an Android application can perform the
-following:</p>
-<ul>
- <li>Scan for other Bluetooth devices</li>
- <li>Query the local Bluetooth adapter for paired Bluetooth devices</li>
- <li>Establish RFCOMM channels</li>
- <li>Connect to other devices through service discovery</li>
- <li>Transfer data to and from other devices</li>
- <li>Manage multiple connections</li>
-</ul>
-
-
-<h2 id="TheBasics">The Basics</h2>
-
-<p>This document describes how to use the Android Bluetooth APIs to accomplish
-the four major tasks necessary to communicate using Bluetooth: setting up
-Bluetooth, finding devices that are either paired or available in the local
-area, connecting devices, and transferring data between devices.</p>
-
-<p>All of the Bluetooth APIs are available in the {@link android.bluetooth}
-package. Here's a summary of the classes and interfaces you will need to create Bluetooth
-connections:</p>
-
-<dl>
-<dt>{@link android.bluetooth.BluetoothAdapter}</dt>
-<dd>Represents the local Bluetooth adapter (Bluetooth radio). The
-{@link android.bluetooth.BluetoothAdapter} is the entry-point for all Bluetooth
-interaction. Using this,
-you can discover other Bluetooth devices, query a list of bonded (paired)
-devices, instantiate a {@link android.bluetooth.BluetoothDevice} using a known
-MAC address, and create a {@link android.bluetooth.BluetoothServerSocket} to
-listen for communications
-from other devices.</dd>
-
-<dt>{@link android.bluetooth.BluetoothDevice}</dt>
-<dd>Represents a remote Bluetooth device. Use this to request a connection
-with a remote device through a {@link android.bluetooth.BluetoothSocket} or
-query information about the
-device such as its name, address, class, and bonding state.</dd>
-
-<dt>{@link android.bluetooth.BluetoothSocket}</dt>
-<dd>Represents the interface for a Bluetooth socket (similar to a TCP
-{@link java.net.Socket}). This is the connection point that allows
-an application to exchange data with another Bluetooth device via InputStream
-and OutputStream.</dd>
-
-<dt>{@link android.bluetooth.BluetoothServerSocket}</dt>
-<dd>Represents an open server socket that listens for incoming requests
-(similar to a TCP {@link java.net.ServerSocket}). In order to connect two
-Android devices, one device must open a server socket with this class. When a
-remote Bluetooth device makes a connection request to the this device, the
-{@link android.bluetooth.BluetoothServerSocket} will return a connected {@link
-android.bluetooth.BluetoothSocket} when the
-connection is accepted.</dd>
-
-<dt>{@link android.bluetooth.BluetoothClass}</dt>
-<dd>Describes the general characteristics and capabilities of a Bluetooth
-device. This is a read-only set of properties that define the device's major and
-minor device classes and its services. However, this does not reliably describe
-all Bluetooth profiles and services supported by the device, but is useful as a
-hint to the device type.</dd>
-
-<dt>{@link android.bluetooth.BluetoothProfile}</dt> <dd>An interface that
-represents a Bluetooth profile. A <em>Bluetooth profile</em> is a wireless
-interface specification for Bluetooth-based communication between devices. An
-example is the Hands-Free profile. For more discussion of profiles, see <a
-href="#Profiles">Working with Profiles</a></dd>
-
-<dt>{@link android.bluetooth.BluetoothHeadset}</dt> <dd>Provides support for
-Bluetooth headsets to be used with mobile phones. This includes both Bluetooth
-Headset and Hands-Free (v1.5) profiles.</dd>
-
-<dt>{@link android.bluetooth.BluetoothA2dp}</dt> <dd> Defines how high quality
-audio can be streamed from one device to another over a Bluetooth connection.
-"A2DP" stands for Advanced Audio Distribution Profile.</dd>
-
-<dt>{@link android.bluetooth.BluetoothHealth}</dt>
-<dd> Represents a Health Device Profile proxy that controls the Bluetooth service.</dd>
-
-<dt>{@link android.bluetooth.BluetoothHealthCallback}</dt>
-
-<dd>An abstract class that you use to implement {@link
-android.bluetooth.BluetoothHealth} callbacks. You must extend this class and
-implement the callback methods to receive updates about changes in the
-application’s registration state and Bluetooth channel state.</dd>
-
-<dt>{@link android.bluetooth.BluetoothHealthAppConfiguration}</dt>
-
-<dd>Represents an application configuration that the Bluetooth Health third-party
-application registers to communicate with a remote Bluetooth health
-device.</dd>
-
-<dt>{@link android.bluetooth.BluetoothProfile.ServiceListener}</dt>
-
-<dd>An interface that notifies {@link android.bluetooth.BluetoothProfile} IPC
-clients when they have been connected to or disconnected from the service (that
-is, the internal service that runs a particular profile). </dd>
-
-</dl>
-
-
-
-
-<h2 id="Permissions">Bluetooth Permissions</h2>
-
-<p>In order to use Bluetooth features in your application, you need to declare
-at least one of two Bluetooth permissions: {@link
-android.Manifest.permission#BLUETOOTH} and {@link
-android.Manifest.permission#BLUETOOTH_ADMIN}.</p>
-
-<p>You must request the {@link android.Manifest.permission#BLUETOOTH} permission
-in order to perform any Bluetooth communication, such as requesting a
-connection, accepting a connection, and transferring data.</p>
-
-<p>You must request the {@link android.Manifest.permission#BLUETOOTH_ADMIN}
-permission in order to initiate device discovery or manipulate Bluetooth
-settings. Most applications need this permission solely for the
-ability to discover local Bluetooth devices. The other abilities granted by this
-permission should not be used, unless the application is a "power manager" that
-will modify Bluetooth settings upon user request. <strong>Note:</strong> If you
-use {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission, then must
-also have the {@link android.Manifest.permission#BLUETOOTH} permission.</p>
-
-<p>Declare the Bluetooth permission(s) in your application manifest file. For
-example:</p>
-
-<pre>
-<manifest ... >
- <uses-permission android:name="android.permission.BLUETOOTH" />
- ...
-</manifest>
-</pre>
-
-<p>See the <a
-href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a>
-reference for more information about declaring application permissions.</p>
-
-
-<h2 id="SettingUp">Setting Up Bluetooth</h2>
-
-<div class="figure" style="width:200px">
-<img src="{@docRoot}images/bt_enable_request.png" />
-<strong>Figure 1:</strong> The enabling Bluetooth dialog.
-</div>
-
-<p>Before your application can communicate over Bluetooth, you need to verify
-that Bluetooth is supported on the device, and if so, ensure that it is enabled.</p>
-
-<p>If Bluetooth is not supported, then you should gracefully disable any
-Bluetooth features. If Bluetooth is supported, but disabled, then you can request that the
-user enable Bluetooth without leaving your application. This setup is
-accomplished in two steps, using the {@link android.bluetooth.BluetoothAdapter}.</p>
-
-
-<ol>
-<li>Get the {@link android.bluetooth.BluetoothAdapter}
-<p>The {@link android.bluetooth.BluetoothAdapter} is required for any and all Bluetooth
-activity. To get the {@link android.bluetooth.BluetoothAdapter}, call the static {@link
-android.bluetooth.BluetoothAdapter#getDefaultAdapter()} method. This returns a
-{@link android.bluetooth.BluetoothAdapter} that represents the device's own
-Bluetooth adapter (the Bluetooth radio). There's one Bluetooth adapter for the
-entire system, and your application can interact with it using this object. If
-{@link android.bluetooth.BluetoothAdapter#getDefaultAdapter()} returns null,
-then the device does not support Bluetooth and your story ends here. For example:</p>
-<pre>
-BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
-if (mBluetoothAdapter == null) {
- // Device does not support Bluetooth
-}
-</pre>
-</li>
-
-<li>Enable Bluetooth
-<p>Next, you need to ensure that Bluetooth is enabled. Call {@link
-android.bluetooth.BluetoothAdapter#isEnabled()} to check whether Bluetooth is
-currently enable. If this method returns false, then Bluetooth is disabled. To
-request that Bluetooth be enabled, call {@link
-android.app.Activity#startActivityForResult(Intent,int) startActivityForResult()}
-with the {@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_ENABLE} action Intent.
-This will issue a request to enable Bluetooth through the system settings (without
-stopping your application). For example:</p>
-<pre>
-if (!mBluetoothAdapter.isEnabled()) {
- Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
- startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
-}
-</pre>
-
-<p>A dialog will appear requesting user permission to enable Bluetooth, as shown
-in Figure 1. If the user responds "Yes," the system will begin to enable Bluetooth
-and focus will return to your application once the process completes (or fails).</p>
-
-<p>The {@code REQUEST_ENABLE_BT} constant passed to {@link
-android.app.Activity#startActivityForResult(Intent,int) startActivityForResult()} is a locally
-defined integer (which must be greater than 0), that the system passes back to you in your
-{@link
-android.app.Activity#onActivityResult(int,int,Intent) onActivityResult()} implementation as the
-<code>requestCode</code> parameter.</p>
-
-<p>If enabling Bluetooth succeeds, your activity receives the {@link
-android.app.Activity#RESULT_OK} result code in the {@link
-android.app.Activity#onActivityResult(int,int,Intent) onActivityResult()}
-callback. If Bluetooth was not enabled
-due to an error (or the user responded "No") then the result code is {@link
-android.app.Activity#RESULT_CANCELED}.</p>
-</li>
-</ol>
-
-<p>Optionally, your application can also listen for the
-{@link android.bluetooth.BluetoothAdapter#ACTION_STATE_CHANGED} broadcast Intent, which
-the system will broadcast whenever the Bluetooth state has changed. This broadcast contains
-the extra fields {@link android.bluetooth.BluetoothAdapter#EXTRA_STATE} and {@link
-android.bluetooth.BluetoothAdapter#EXTRA_PREVIOUS_STATE}, containing the new and old
-Bluetooth states, respectively. Possible values for these extra fields are
-{@link android.bluetooth.BluetoothAdapter#STATE_TURNING_ON}, {@link
-android.bluetooth.BluetoothAdapter#STATE_ON}, {@link
-android.bluetooth.BluetoothAdapter#STATE_TURNING_OFF}, and {@link
-android.bluetooth.BluetoothAdapter#STATE_OFF}. Listening for this
-broadcast can be useful to detect changes made to the Bluetooth state while your
-app is running.</p>
-
-<p class="note"><strong>Tip:</strong> Enabling discoverability will automatically
-enable Bluetooth. If you plan to consistently enable device discoverability before
-performing Bluetooth activity, you can skip
-step 2 above. Read about <a href="#EnablingDiscoverability">enabling discoverability</a>,
-below.</p>
-
-
-<h2 id="FindingDevices">Finding Devices</h2>
-
-<p>Using the {@link android.bluetooth.BluetoothAdapter}, you can find remote Bluetooth
-devices either through device discovery or by querying the list of paired (bonded)
-devices.</p>
-
-<p>Device discovery is a scanning procedure that searches the local area for
-Bluetooth enabled devices and then requesting some information about each one
-(this is sometimes referred to as "discovering," "inquiring" or "scanning").
-However, a Bluetooth device within the local area will respond to a discovery
-request only if it is currently enabled to be discoverable. If a device is
-discoverable, it will respond to the discovery request by sharing some
-information, such as the device name, class, and its unique MAC address. Using
-this information, the device performing discovery can then choose to initiate a
-connection to the discovered device.</p>
-
-<p>Once a connection is made with a remote device for the first time, a pairing
-request is automatically presented to the user. When a device is
-paired, the basic information about that device (such as the device name, class,
-and MAC address) is saved and can be read using the Bluetooth APIs. Using the
-known MAC address for a remote device, a connection can be initiated with it at
-any time without performing discovery (assuming the device is within range).</p>
-
-<p>Remember there is a difference between being paired and being connected. To
-be paired means that two devices are aware of each other's existence, have a
-shared link-key that can be used for authentication, and are capable of
-establishing an encrypted connection with each other. To be connected means that
-the devices currently share an RFCOMM channel and are able to transmit data with
-each other. The current Android Bluetooth API's require devices to be paired
-before an RFCOMM connection can be established. (Pairing is automatically performed
-when you initiate an encrypted connection with the Bluetooth APIs.)</p>
-
-<p>The following sections describe how to find devices that have been paired, or
-discover new devices using device discovery.</p>
-
-<p class="note"><strong>Note:</strong> Android-powered devices are not
-discoverable by default. A user can make
-the device discoverable for a limited time through the system settings, or an
-application can request that the user enable discoverability without leaving the
-application. How to <a href="#EnablingDiscoverability">enable discoverability</a>
-is discussed below.</p>
-
-
-<h3 id="QueryingPairedDevices">Querying paired devices</h3>
-
-<p>Before performing device discovery, its worth querying the set
-of paired devices to see if the desired device is already known. To do so,
-call {@link android.bluetooth.BluetoothAdapter#getBondedDevices()}. This
-will return a Set of {@link android.bluetooth.BluetoothDevice}s representing
-paired devices. For example, you can query all paired devices and then
-show the name of each device to the user, using an ArrayAdapter:</p>
-<pre>
-Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
-// If there are paired devices
-if (pairedDevices.size() > 0) {
- // Loop through paired devices
- for (BluetoothDevice device : pairedDevices) {
- // Add the name and address to an array adapter to show in a ListView
- mArrayAdapter.add(device.getName() + "\n" + device.getAddress());
- }
-}
-</pre>
-
-<p>All that's needed from the {@link android.bluetooth.BluetoothDevice} object
-in order to initiate a connection is the MAC address. In this example, it's saved
-as a part of an ArrayAdapter that's shown to the user. The MAC address can later
-be extracted in order to initiate the connection. You can learn more about creating
-a connection in the section about <a href="#ConnectingDevices">Connecting Devices</a>.</p>
-
-
-<h3 id="DiscoveringDevices">Discovering devices</h3>
-
-<p>To start discovering devices, simply call {@link
-android.bluetooth.BluetoothAdapter#startDiscovery()}. The
-process is asynchronous and the method will immediately return with a boolean
-indicating whether discovery has successfully started. The discovery process
-usually involves an inquiry scan of about 12 seconds, followed by a page scan of
-each found device to retrieve its Bluetooth name.</p>
-
-<p>Your application must register a BroadcastReceiver for the
-{@link android.bluetooth.BluetoothDevice#ACTION_FOUND} Intent in
-order to receive information about each
-device discovered. For each device, the system will broadcast the
-{@link android.bluetooth.BluetoothDevice#ACTION_FOUND} Intent. This
-Intent carries the extra fields
-{@link android.bluetooth.BluetoothDevice#EXTRA_DEVICE} and
-{@link android.bluetooth.BluetoothDevice#EXTRA_CLASS}, containing a
-{@link android.bluetooth.BluetoothDevice} and a {@link
-android.bluetooth.BluetoothClass}, respectively. For example, here's how you can
-register to handle the broadcast when devices are discovered:</p>
-<pre>
-// Create a BroadcastReceiver for ACTION_FOUND
-private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
- // When discovery finds a device
- if (BluetoothDevice.ACTION_FOUND.equals(action)) {
- // Get the BluetoothDevice object from the Intent
- BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
- // Add the name and address to an array adapter to show in a ListView
- mArrayAdapter.add(device.getName() + "\n" + device.getAddress());
- }
- }
-};
-// Register the BroadcastReceiver
-IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);
-registerReceiver(mReceiver, filter); // Don't forget to unregister during onDestroy
-</pre>
-
-<p>All that's needed from the {@link android.bluetooth.BluetoothDevice} object
-in order to initiate a
-connection is the MAC address. In this example, it's saved as a part of an
-ArrayAdapter that's shown to the user. The MAC address can later be extracted in
-order to initiate the connection. You can learn more about creating a connection
-in the section about <a href="#ConnectingDevices">Connecting Devices</a>.</p>
-
-<p class="caution"><strong>Caution:</strong> Performing device discovery is
-a heavy procedure for the Bluetooth
-adapter and will consume a lot of its resources. Once you have found a device to
-connect, be certain that you always stop discovery with
-{@link android.bluetooth.BluetoothAdapter#cancelDiscovery()} before
-attempting a connection. Also, if you
-already hold a connection with a device, then performing discovery can
-significantly reduce the bandwidth available for the connection, so you should
-not perform discovery while connected.</p>
-
-<h4 id="EnablingDiscoverability">Enabling discoverability</h4>
-
-<p>If you would like to make the local device discoverable to other devices,
-call {@link android.app.Activity#startActivityForResult(Intent,int)} with the
-{@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_DISCOVERABLE} action
-Intent. This will issue a request to enable discoverable mode through the system
-settings (without stopping your application). By default, the device will become
-discoverable for 120 seconds. You can define a different duration by adding the
-{@link android.bluetooth.BluetoothAdapter#EXTRA_DISCOVERABLE_DURATION} Intent
-extra. The maximum duration an app can set is 3600 seconds, and a value of 0
-means the device is always discoverable. Any value below 0 or above 3600 is
-automatically set to 120 secs). For example, this snippet sets the duration to
-300:</p>
-
-<pre>Intent discoverableIntent = new
-Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
-discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);
-startActivity(discoverableIntent);
-</pre>
-
-<div class="figure" style="width:200px">
-<img src="{@docRoot}images/bt_enable_discoverable.png" />
-<strong>Figure 2:</strong> The enabling discoverability dialog.
-</div>
-
-<p>A dialog will be displayed, requesting user permission to make the device
-discoverable, as shown in Figure 2. If the user responds "Yes," then the device
-will become discoverable for the specified amount of time. Your activity will
-then receive a call to the {@link android.app.Activity#onActivityResult(int,int,Intent)
-onActivityResult())} callback, with the result code equal to the duration that the device
-is discoverable. If the user responded "No" or if an error occurred, the result code will
-be {@link android.app.Activity#RESULT_CANCELED}.</p>
-
-<p class="note"><strong>Note:</strong> If Bluetooth has not been enabled on the device,
-then enabling device discoverability will automatically enable Bluetooth.</p>
-
-<p>The device will silently remain in discoverable mode for the allotted time.
-If you would like to be notified when the discoverable mode has changed, you can
-register a BroadcastReceiver for the {@link
-android.bluetooth.BluetoothAdapter#ACTION_SCAN_MODE_CHANGED}
-Intent. This will contain the extra fields {@link
-android.bluetooth.BluetoothAdapter#EXTRA_SCAN_MODE} and
-{@link android.bluetooth.BluetoothAdapter#EXTRA_PREVIOUS_SCAN_MODE}, which tell you the
-new and old scan mode, respectively. Possible values for each are
-{@link android.bluetooth.BluetoothAdapter#SCAN_MODE_CONNECTABLE_DISCOVERABLE},
-{@link android.bluetooth.BluetoothAdapter#SCAN_MODE_CONNECTABLE}, or {@link
-android.bluetooth.BluetoothAdapter#SCAN_MODE_NONE},
-which indicate that the device is either in discoverable mode, not in
-discoverable mode but still able to receive connections, or not in discoverable
-mode and unable to receive connections, respectively.</p>
-
-<p>You do not need to enable device discoverability if you will be initiating
-the connection to a remote device. Enabling discoverability is only necessary when
-you want your application to host a server socket that will accept incoming
-connections, because the remote devices must be able to discover the device
-before it can initiate the connection.</p>
-
-
-
-<h2 id="ConnectingDevices">Connecting Devices</h2>
-
-<p>In order to create a connection between your application on two devices, you
-must implement both the server-side and client-side mechanisms, because one
-device must open a server socket and the other one must initiate the connection
-(using the server device's MAC address to initiate a connection). The server and
-client are considered connected to each other when they each have a connected
-{@link android.bluetooth.BluetoothSocket} on the same RFCOMM channel. At this
-point, each device can obtain input and output streams and data transfer can
-begin, which is discussed in the section about <a
-href="#ManagingAConnection">Managing a Connection</a>. This section describes how
-to initiate the connection between two devices.</p>
-
-<p>The server device and the client device each obtain the required {@link
-android.bluetooth.BluetoothSocket} in different ways. The server will receive it
-when an incoming connection is accepted. The client will receive it when it
-opens an RFCOMM channel to the server.</p>
-
-<div class="figure" style="width:200px">
-<img src="{@docRoot}images/bt_pairing_request.png" />
-<strong>Figure 3:</strong> The Bluetooth pairing dialog.
-</div>
-
-<p>One implementation technique is to automatically prepare each device as a
-server, so that each one has a server socket open and listening for connections.
-Then either device can initiate a connection with the other and become the
-client. Alternatively, one device can explicitly "host" the connection and open
-a server socket on demand and the other device can simply initiate the
-connection.</p>
-
-<p class="note"><strong>Note:</strong> If the two devices have not been previously paired,
-then the Android framework will automatically show a pairing request notification or
-dialog to the user during the connection procedure, as shown in Figure 3. So
-when attempting to connect devices,
-your application does not need to be concerned about whether or not the devices are
-paired. Your RFCOMM connection attempt will block until the user has successfully paired,
-or will fail if the user rejects pairing, or if pairing fails or times out. </p>
-
-
-<h3 id="ConnectingAsAServer">Connecting as a server</h3>
-
-<p>When you want to connect two devices, one must act as a server by holding an
-open {@link android.bluetooth.BluetoothServerSocket}. The purpose of the server
-socket is to listen for incoming connection requests and when one is accepted,
-provide a connected {@link android.bluetooth.BluetoothSocket}. When the {@link
-android.bluetooth.BluetoothSocket} is acquired from the {@link
-android.bluetooth.BluetoothServerSocket},
-the {@link android.bluetooth.BluetoothServerSocket} can (and should) be
-discarded, unless you want to accept more connections.</p>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>About UUID</h2>
-
-<p>A Universally Unique Identifier (UUID) is a standardized 128-bit format for a string
-ID used to uniquely identify information. The point of a UUID is that it's big
-enough that you can select any random and it won't clash. In this case, it's
-used to uniquely identify your application's Bluetooth service. To get a UUID to
-use with your application, you can use one of the many random UUID generators on
-the web, then initialize a {@link java.util.UUID} with {@link
-java.util.UUID#fromString(String)}.</p>
-</div>
-</div>
-
-<p>Here's the basic procedure to set up a server socket and accept a
-connection:</p>
-
-<ol>
-<li>Get a {@link android.bluetooth.BluetoothServerSocket} by calling the
-{@link
-android.bluetooth.BluetoothAdapter#listenUsingRfcommWithServiceRecord(String,
-UUID)}.
-<p>The string is an identifiable name of your service, which the system will
-automatically write to a new Service Discovery Protocol (SDP) database entry on
-the device (the name is arbitrary and can simply be your application name). The
-UUID is also included in the SDP entry and will be the basis for the connection
-agreement with the client device. That is, when the client attempts to connect
-with this device, it will carry a UUID that uniquely identifies the service with
-which it wants to connect. These UUIDs must match in order for the connection to
-be accepted (in the next step).</p>
-</li>
-
-<li>Start listening for connection requests by calling
-{@link android.bluetooth.BluetoothServerSocket#accept()}.
-<p>This is a blocking call. It will return when either a connection has been
-accepted or an exception has occurred. A connection is accepted only when a
-remote device has sent a connection request with a UUID matching the one
-registered with this listening server socket. When successful, {@link
-android.bluetooth.BluetoothServerSocket#accept()} will
-return a connected {@link android.bluetooth.BluetoothSocket}.</p>
-</li>
-
-<li>Unless you want to accept additional connections, call
-{@link android.bluetooth.BluetoothServerSocket#close()}.
-<p>This releases the server socket and all its resources, but does <em>not</em> close the
-connected {@link android.bluetooth.BluetoothSocket} that's been returned by {@link
-android.bluetooth.BluetoothServerSocket#accept()}. Unlike TCP/IP, RFCOMM only allows one
-connected client per channel at a time, so in most cases it makes sense to call {@link
-android.bluetooth.BluetoothServerSocket#close()} on the {@link
-android.bluetooth.BluetoothServerSocket} immediately after accepting a connected
-socket.</p>
-</li>
-</ol>
-
-<p>The {@link android.bluetooth.BluetoothServerSocket#accept()} call should not
-be executed in the main activity UI thread because it is a blocking call and
-will prevent any other interaction with the application. It usually makes
-sense to do all work with a {@link android.bluetooth.BluetoothServerSocket} or {@link
-android.bluetooth.BluetoothSocket} in a new
-thread managed by your application. To abort a blocked call such as {@link
-android.bluetooth.BluetoothServerSocket#accept()}, call {@link
-android.bluetooth.BluetoothServerSocket#close()} on the {@link
-android.bluetooth.BluetoothServerSocket} (or {@link
-android.bluetooth.BluetoothSocket}) from another thread and the blocked call will
-immediately return. Note that all methods on a {@link
-android.bluetooth.BluetoothServerSocket} or {@link android.bluetooth.BluetoothSocket}
-are thread-safe.</p>
-
-<h4>Example</h4>
-
-<p>Here's a simplified thread for the server component that accepts incoming
-connections:</p>
-<pre>
-private class AcceptThread extends Thread {
- private final BluetoothServerSocket mmServerSocket;
-
- public AcceptThread() {
- // Use a temporary object that is later assigned to mmServerSocket,
- // because mmServerSocket is final
- BluetoothServerSocket tmp = null;
- try {
- // MY_UUID is the app's UUID string, also used by the client code
- tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID);
- } catch (IOException e) { }
- mmServerSocket = tmp;
- }
-
- public void run() {
- BluetoothSocket socket = null;
- // Keep listening until exception occurs or a socket is returned
- while (true) {
- try {
- socket = mmServerSocket.accept();
- } catch (IOException e) {
- break;
- }
- // If a connection was accepted
- if (socket != null) {
- // Do work to manage the connection (in a separate thread)
- manageConnectedSocket(socket);
- mmServerSocket.close();
- break;
- }
- }
- }
-
- /** Will cancel the listening socket, and cause the thread to finish */
- public void cancel() {
- try {
- mmServerSocket.close();
- } catch (IOException e) { }
- }
-}
-</pre>
-
-<p>In this example, only one incoming connection is desired, so as soon as a
-connection is accepted and the {@link android.bluetooth.BluetoothSocket} is
-acquired, the application
-sends the acquired {@link android.bluetooth.BluetoothSocket} to a separate
-thread, closes the
-{@link android.bluetooth.BluetoothServerSocket} and breaks the loop.</p>
-
-<p>Note that when {@link android.bluetooth.BluetoothServerSocket#accept()}
-returns the {@link android.bluetooth.BluetoothSocket}, the socket is already
-connected, so you should <em>not</em> call {@link
-android.bluetooth.BluetoothSocket#connect()} (as you do from the
-client-side).</p>
-
-<p><code>manageConnectedSocket()</code> is a fictional method in the application
-that will
-initiate the thread for transferring data, which is discussed in the section
-about <a href="#ManagingAConnection">Managing a Connection</a>.</p>
-
-<p>You should usually close your {@link android.bluetooth.BluetoothServerSocket}
-as soon as you are done listening for incoming connections. In this example, {@link
-android.bluetooth.BluetoothServerSocket#close()} is called as soon
-as the {@link android.bluetooth.BluetoothSocket} is acquired. You may also want
-to provide a public method in your thread that can close the private {@link
-android.bluetooth.BluetoothSocket} in the event that you need to stop listening on the
-server socket.</p>
-
-
-<h3 id="ConnectingAsAClient">Connecting as a client</h3>
-
-<p>In order to initiate a connection with a remote device (a device holding an
-open
-server socket), you must first obtain a {@link
-android.bluetooth.BluetoothDevice} object that represents the remote device.
-(Getting a {@link android.bluetooth.BluetoothDevice} is covered in the above
-section about <a
-href="#FindingDevices">Finding Devices</a>.) You must then use the
-{@link android.bluetooth.BluetoothDevice} to acquire a {@link
-android.bluetooth.BluetoothSocket} and initiate the connection.</p>
-
-<p>Here's the basic procedure:</p>
-
-<ol>
-<li>Using the {@link android.bluetooth.BluetoothDevice}, get a {@link
-android.bluetooth.BluetoothSocket} by calling {@link
-android.bluetooth.BluetoothDevice#createRfcommSocketToServiceRecord(UUID)}.
-<p>This initializes a {@link android.bluetooth.BluetoothSocket} that will
-connect to the {@link android.bluetooth.BluetoothDevice}. The UUID passed here
-must match the UUID used by the server device when it opened its
-{@link android.bluetooth.BluetoothServerSocket} (with {@link
-android.bluetooth.BluetoothAdapter#listenUsingRfcommWithServiceRecord(String,
-UUID)}). Using the same UUID is simply a matter of hard-coding the UUID string
-into your application and then referencing it from both the server and client
-code.</p>
-</li>
-
-<li>Initiate the connection by calling {@link
-android.bluetooth.BluetoothSocket#connect()}.
-<p>Upon this call, the system will perform an SDP lookup on the remote device in
-order to match the UUID. If the lookup is successful and the remote device
-accepts the connection, it will share the RFCOMM channel to use during the
-connection and {@link
-android.bluetooth.BluetoothSocket#connect()} will return. This method is a
-blocking call. If, for
-any reason, the connection fails or the {@link
-android.bluetooth.BluetoothSocket#connect()} method times out (after about
-12 seconds), then it will throw an exception.</p>
-<p>Because {@link
-android.bluetooth.BluetoothSocket#connect()} is a blocking call, this connection
-procedure should always be performed in a thread separate from the main activity
-thread.</p>
-<p class="note">Note: You should always ensure that the device is not performing
-device discovery when you call {@link
-android.bluetooth.BluetoothSocket#connect()}. If discovery is in progress, then
-the
-connection attempt will be significantly slowed and is more likely to fail.</p>
-</li>
-</ol>
-
-<h4>Example</h4>
-
-<p>Here is a basic example of a thread that initiates a Bluetooth
-connection:</p>
-<pre>
-private class ConnectThread extends Thread {
- private final BluetoothSocket mmSocket;
- private final BluetoothDevice mmDevice;
-
- public ConnectThread(BluetoothDevice device) {
- // Use a temporary object that is later assigned to mmSocket,
- // because mmSocket is final
- BluetoothSocket tmp = null;
- mmDevice = device;
-
- // Get a BluetoothSocket to connect with the given BluetoothDevice
- try {
- // MY_UUID is the app's UUID string, also used by the server code
- tmp = device.createRfcommSocketToServiceRecord(MY_UUID);
- } catch (IOException e) { }
- mmSocket = tmp;
- }
-
- public void run() {
- // Cancel discovery because it will slow down the connection
- mBluetoothAdapter.cancelDiscovery();
-
- try {
- // Connect the device through the socket. This will block
- // until it succeeds or throws an exception
- mmSocket.connect();
- } catch (IOException connectException) {
- // Unable to connect; close the socket and get out
- try {
- mmSocket.close();
- } catch (IOException closeException) { }
- return;
- }
-
- // Do work to manage the connection (in a separate thread)
- manageConnectedSocket(mmSocket);
- }
-
- /** Will cancel an in-progress connection, and close the socket */
- public void cancel() {
- try {
- mmSocket.close();
- } catch (IOException e) { }
- }
-}
-</pre>
-
-<p>Notice that {@link android.bluetooth.BluetoothAdapter#cancelDiscovery()} is called
-before the connection is made. You should always do this before connecting and it is safe
-to call without actually checking whether it is running or not (but if you do want to
-check, call {@link android.bluetooth.BluetoothAdapter#isDiscovering()}).</p>
-
-<p><code>manageConnectedSocket()</code> is a fictional method in the application
-that will initiate the thread for transferring data, which is discussed in the section
-about <a href="#ManagingAConnection">Managing a Connection</a>.</p>
-
-<p>When you're done with your {@link android.bluetooth.BluetoothSocket}, always
-call {@link android.bluetooth.BluetoothSocket#close()} to clean up.
-Doing so will immediately close the connected socket and clean up all internal
-resources.</p>
-
-
-<h2 id="ManagingAConnection">Managing a Connection</h2>
-
-<p>When you have successfully connected two (or more) devices, each one will
-have a connected {@link android.bluetooth.BluetoothSocket}. This is where the fun
-begins because you can share data between devices. Using the {@link
-android.bluetooth.BluetoothSocket}, the general procedure to transfer arbitrary data is
-simple:</p>
-<ol>
-<li>Get the {@link java.io.InputStream} and {@link java.io.OutputStream} that
-handle transmissions through the socket, via {@link
-android.bluetooth.BluetoothSocket#getInputStream()} and
-{@link android.bluetooth.BluetoothSocket#getOutputStream}, respectively.</li>
-
-<li>Read and write data to the streams with {@link
-java.io.InputStream#read(byte[])} and {@link java.io.OutputStream#write(byte[])}.</li>
-</ol>
-
-<p>That's it.</p>
-
-<p>There are, of course, implementation details to consider. First and foremost,
-you should use a dedicated thread for all stream reading and writing. This is
-important because both {@link java.io.InputStream#read(byte[])} and {@link
-java.io.OutputStream#write(byte[])} methods are blocking calls. {@link
-java.io.InputStream#read(byte[])} will block until there is something to read
-from the stream. {@link java.io.OutputStream#write(byte[])} does not usually
-block, but can block for flow control if the remote device is not calling {@link
-java.io.InputStream#read(byte[])} quickly enough and the intermediate buffers are full.
-So, your main loop in the thread should be dedicated to reading from the {@link
-java.io.InputStream}. A separate public method in the thread can be used to initiate
-writes to the {@link java.io.OutputStream}.</p>
-
-<h4>Example</h4>
-
-<p>Here's an example of how this might look:</p>
-<pre>
-private class ConnectedThread extends Thread {
- private final BluetoothSocket mmSocket;
- private final InputStream mmInStream;
- private final OutputStream mmOutStream;
-
- public ConnectedThread(BluetoothSocket socket) {
- mmSocket = socket;
- InputStream tmpIn = null;
- OutputStream tmpOut = null;
-
- // Get the input and output streams, using temp objects because
- // member streams are final
- try {
- tmpIn = socket.getInputStream();
- tmpOut = socket.getOutputStream();
- } catch (IOException e) { }
-
- mmInStream = tmpIn;
- mmOutStream = tmpOut;
- }
-
- public void run() {
- byte[] buffer = new byte[1024]; // buffer store for the stream
- int bytes; // bytes returned from read()
-
- // Keep listening to the InputStream until an exception occurs
- while (true) {
- try {
- // Read from the InputStream
- bytes = mmInStream.read(buffer);
- // Send the obtained bytes to the UI activity
- mHandler.obtainMessage(MESSAGE_READ, bytes, -1, buffer)
- .sendToTarget();
- } catch (IOException e) {
- break;
- }
- }
- }
-
- /* Call this from the main activity to send data to the remote device */
- public void write(byte[] bytes) {
- try {
- mmOutStream.write(bytes);
- } catch (IOException e) { }
- }
-
- /* Call this from the main activity to shutdown the connection */
- public void cancel() {
- try {
- mmSocket.close();
- } catch (IOException e) { }
- }
-}
-</pre>
-
-<p>The constructor acquires the necessary streams and once executed, the thread
-will wait for data to come through the InputStream. When {@link
-java.io.InputStream#read(byte[])} returns with
-bytes from the stream, the data is sent to the main activity using a member
-Handler from the parent class. Then it goes back and waits for more bytes from
-the stream.</p>
-
-<p>Sending outgoing data is as simple as calling the thread's
-<code>write()</code> method from the main activity and passing in the bytes to
-be sent. This method then simply calls {@link
-java.io.OutputStream#write(byte[])} to send the data to the remote device.</p>
-
-<p>The thread's <code>cancel()</code> method is important so that the connection
-can be
-terminated at any time by closing the {@link android.bluetooth.BluetoothSocket}.
-This should always be called when you're done using the Bluetooth
-connection.</p>
-
-<div class="special">
-<p>For a demonstration of using the Bluetooth APIs, see the <a
-href="{@docRoot}resources/samples/BluetoothChat/index.html">Bluetooth Chat sample app</a>.</p>
-</div>
-
-<h2 id="Profiles">Working with Profiles</h2>
-
-<p>Starting in Android 3.0, the Bluetooth API includes support for working with
-Bluetooth profiles. A <em>Bluetooth profile</em> is a wireless interface
-specification for Bluetooth-based communication between devices. An example
-is the Hands-Free profile. For a mobile phone to connect to a wireless headset,
-both devices must support the Hands-Free profile. </p>
-
-<p>You can implement the interface {@link android.bluetooth.BluetoothProfile} to write
-your own classes to support a particular Bluetooth profile. The Android
-Bluetooth API provides implementations for the following Bluetooth
-profiles:</p>
-<ul>
-
- <li><strong>Headset</strong>. The Headset profile provides support for
-Bluetooth headsets to be used with mobile phones. Android provides the {@link
-android.bluetooth.BluetoothHeadset} class, which is a proxy for controlling the
-Bluetooth Headset Service via interprocess communication (<a
-href="{@docRoot}guide/topics/fundamentals/processes-and-threads.html#IPC">IPC</a
->). This includes both Bluetooth Headset and Hands-Free (v1.5) profiles. The
-{@link android.bluetooth.BluetoothHeadset} class includes support for AT commands.
-For more discussion of this topic, see <a href="#AT-Commands">Vendor-specific AT commands</a></li>
-
- <li><strong>A2DP</strong>. The Advanced Audio Distribution Profile (A2DP)
-profile defines how high quality audio can be streamed from one device to
-another over a Bluetooth connection. Android provides the {@link
-android.bluetooth.BluetoothA2dp} class, which is a proxy for controlling
-the Bluetooth A2DP Service via IPC.</li>
-
- <li><strong>Health Device</strong>. Android 4.0 (API level 14) introduces
-support for the Bluetooth Health Device Profile (HDP). This lets you create
-applications that use Bluetooth to communicate with health devices that support
-Bluetooth, such as heart-rate monitors, blood meters, thermometers, scales, and
-so on. For a list of supported devices and their corresponding device data
-specialization codes, refer to <strong>Bluetooth Assigned Numbers</strong> at <a
-href="http://www.bluetooth.org">www.bluetooth.org</a>. Note that these values
-are also referenced in the ISO/IEEE 11073-20601 [7] specification as
-MDC_DEV_SPEC_PROFILE_* in the Nomenclature Codes Annex. For more discussion of
-HDP, see <a href="#HDP">Health Device Profile</a>.</li>
-
-</ul>
-
-<p>Here are the basic steps for working with a profile:</p>
-<ol>
-
- <li>Get the default adapter, as described in
- <a href="{@docRoot}guide/topics/wireless/bluetooth.html#SettingUp">Setting Up
- Bluetooth</a>.</li>
-
- <li>Use {@link
-android.bluetooth.BluetoothAdapter#getProfileProxy(android.content.Context,
-android.bluetooth.BluetoothProfile.ServiceListener, int) getProfileProxy()} to
-establish a connection to the profile proxy object associated with the profile.
-In the example below, the profile proxy object is an instance of {@link
-android.bluetooth.BluetoothHeadset}. </li>
-
- <li>Set up a {@link android.bluetooth.BluetoothProfile.ServiceListener}. This
-listener notifies {@link android.bluetooth.BluetoothProfile} IPC clients when
-they have been connected to or disconnected from the service.</li>
-
- <li>In {@link
-android.bluetooth.BluetoothProfile.ServiceListener#onServiceConnected(int,
-android.bluetooth.BluetoothProfile) onServiceConnected()}, get a handle
-to the profile proxy object.</li>
-
- <li>Once you have the profile proxy object, you can use it to monitor the
-state of the connection and perform other operations that are relevant to that
-profile.</li>
-</ol>
-
-<p> For example, this code snippet shows how to connect to a {@link
-android.bluetooth.BluetoothHeadset} proxy object so that you can control the
-Headset profile:</p>
-
-<pre>BluetoothHeadset mBluetoothHeadset;
-
-// Get the default adapter
-BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
-
-// Establish connection to the proxy.
-mBluetoothAdapter.getProfileProxy(context, mProfileListener, BluetoothProfile.HEADSET);
-
-private BluetoothProfile.ServiceListener mProfileListener = new BluetoothProfile.ServiceListener() {
- public void onServiceConnected(int profile, BluetoothProfile proxy) {
- if (profile == BluetoothProfile.HEADSET) {
- mBluetoothHeadset = (BluetoothHeadset) proxy;
- }
- }
- public void onServiceDisconnected(int profile) {
- if (profile == BluetoothProfile.HEADSET) {
- mBluetoothHeadset = null;
- }
- }
-};
-
-// ... call functions on mBluetoothHeadset
-
-// Close proxy connection after use.
-mBluetoothAdapter.closeProfileProxy(mBluetoothHeadset);
-</pre>
-
-
-
-<h3 id="AT-Commands">Vendor-specific AT commands</h3>
-
-<p>Starting in Android 3.0, applications can register to receive system
-broadcasts of pre-defined vendor-specific AT commands sent by headsets (such as
-a Plantronics +XEVENT command). For example, an application could receive
-broadcasts that indicate a connected device's battery level and could notify the
-user or take other action as needed. Create a broadcast receiver for the {@link
-android.bluetooth.BluetoothHeadset#ACTION_VENDOR_SPECIFIC_HEADSET_EVENT} intent
-to handle vendor-specific AT commands for the headset.</p>
-
-<h3 id="HDP">Health Device Profile</h3>
-
-<p>Android 4.0 (API level 14) introduces support for the Bluetooth Health Device
-Profile (HDP). This lets you create applications that use Bluetooth to
-communicate with health devices that support Bluetooth, such as heart-rate
-monitors, blood meters, thermometers, and scales. The Bluetooth Health API
-includes the classes {@link android.bluetooth.BluetoothHealth}, {@link
-android.bluetooth.BluetoothHealthCallback}, and {@link
-android.bluetooth.BluetoothHealthAppConfiguration}, which are described in <a
-href="#TheBasics">The Basics</a>. </p>
-
-<p>In using the Bluetooth Health API, it's helpful to understand these key HDP concepts:</p>
-<table>
- <tr>
- <th>Concept</th>
- <th>Description</th>
- </tr>
- <tr>
- <td><strong>Source</strong></td>
-
- <td>A role defined in HDP. A <em>source</em> is a health device that
-transmits medical data (weight scale, glucose meter, thermometer, etc.) to a
-smart device such as an Android phone or tablet. </td>
- </tr>
- <tr>
- <td><strong>Sink</strong></td>
-
- <td>A role defined in HDP. In HDP, a <em>sink</em> is the smart device that
-receives the medical data. In an Android HDP application, the sink is
-represented by a {@link android.bluetooth.BluetoothHealthAppConfiguration}
-object.</td>
- </tr>
- <tr>
- <td><strong>Registration</strong></td>
- <td>Refers to registering a sink for a particular health device.</td>
- </tr>
- <tr>
- <td><strong>Connection</strong></td>
-
- <td>Refers to opening a channel between a health device and a smart device
-such as an Android phone or tablet.</td>
- </tr>
-</table>
-
-<h4>Creating an HDP Application</h4>
-
-<p>Here are the basic steps involved in creating an Android HDP application:</p>
-<ol>
-
- <li>Get a reference to the {@link android.bluetooth.BluetoothHealth} proxy
-object. <p>Similar to regular headset and A2DP profile devices, you must call
-{@link android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()}
-with a {@link android.bluetooth.BluetoothProfile.ServiceListener} and the {@link
-android.bluetooth.BluetoothProfile.ServiceListener#HEALTH} profile type to
-establish a connection with the profile proxy object.</p> </li>
-
- <li>Create a {@link android.bluetooth.BluetoothHealthCallback} and register an
-application configuration
-({@link android.bluetooth.BluetoothHealthAppConfiguration})
-that acts as a health
-sink.</li>
-
- <li>Establish a connection to a health device. Some devices will initiate the
-connection. It is unnecessary to carry out this step for those devices.</li>
-
- <li>When connected successfully to a health device, read/write to the health
-device using the file descriptor. <p>The received data needs to be interpreted
-using a health manager which implements the IEEE 11073-xxxxx
-specifications.</p></li>
-
- <li>When done, close the health channel and unregister the application. The
-channel also closes when there is extended inactivity.</li>
-</ol>
-
-<p>For a complete code sample that illustrates these steps, see <a
-href="{@docRoot}resources/samples/BluetoothHDP/index.html">Bluetooth HDP (Health
-Device Profile)</a>. </p>
diff --git a/docs/html/guide/topics/wireless/index.jd b/docs/html/guide/topics/wireless/index.jd
deleted file mode 100644
index 23d2f0f..0000000
--- a/docs/html/guide/topics/wireless/index.jd
+++ /dev/null
@@ -1,23 +0,0 @@
-page.title=Wireless Controls
-@jd:body
-
-Go away.
-
-<!--
-<h2>Wi-Fi</h2>
-<p>The Wi-Fi APIs provide a means by which application can communicate with the lower-level
-wireless stack that provides Wi-Fi network access. Almost all information from the device supplicant
-is available, including the connected network's link speed, IP address, negotiation state, and more.
-It also provides information about all non-connected available networks. Some of the available network
-interactions include the ability to scan, add, dave, terminate and initiate connections.</p>
-
-
-<h2>Bluetooth</h2>
-<p>The Android platform includes support for the Bluetooth network stack, which allows a device to
-wirelessly exchange data with other Bluetooth devices. The application framework provides access to
-the Bluetooth functionality through the Android Bluetooth APIs. These APIs let applications
-wirelessly connect to other Bluetooth devices, enabling point-to-point and multipoint wireless
-features.</p>
--->
-
-
diff --git a/docs/html/guide/topics/wireless/wifi.jd b/docs/html/guide/topics/wireless/wifi.jd
deleted file mode 100644
index 761e463..0000000
--- a/docs/html/guide/topics/wireless/wifi.jd
+++ /dev/null
@@ -1,18 +0,0 @@
-page.title=Wi-Fi
-parent.title=Wireless Controls
-parent.link=index.html
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
- <ol>
-
- </ol>
-
-</div>
-</div>
-
-
-Go away.
\ No newline at end of file
diff --git a/docs/html/guide/tutorials/hello-world.html b/docs/html/guide/tutorials/hello-world.html
deleted file mode 100644
index 55187bd..0000000
--- a/docs/html/guide/tutorials/hello-world.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/resources/tutorials/hello-world.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should have been redirected. Please <a
-href="http://developer.android.com/resources/tutorials/hello-world.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/tutorials/images/hello_world_0.png b/docs/html/guide/tutorials/images/hello_world_0.png
deleted file mode 100644
index 330a07c..0000000
--- a/docs/html/guide/tutorials/images/hello_world_0.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/images/hello_world_1.png b/docs/html/guide/tutorials/images/hello_world_1.png
deleted file mode 100644
index 1e5f7b0..0000000
--- a/docs/html/guide/tutorials/images/hello_world_1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/images/hello_world_2.png b/docs/html/guide/tutorials/images/hello_world_2.png
deleted file mode 100644
index 3e9c58b..0000000
--- a/docs/html/guide/tutorials/images/hello_world_2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/images/hello_world_3.png b/docs/html/guide/tutorials/images/hello_world_3.png
deleted file mode 100644
index 22901a9..0000000
--- a/docs/html/guide/tutorials/images/hello_world_3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/images/hello_world_4.png b/docs/html/guide/tutorials/images/hello_world_4.png
deleted file mode 100644
index 5c41e80..0000000
--- a/docs/html/guide/tutorials/images/hello_world_4.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/images/hello_world_5.png b/docs/html/guide/tutorials/images/hello_world_5.png
deleted file mode 100644
index 96b830a..0000000
--- a/docs/html/guide/tutorials/images/hello_world_5.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/images/hello_world_8.png b/docs/html/guide/tutorials/images/hello_world_8.png
deleted file mode 100644
index 07db360..0000000
--- a/docs/html/guide/tutorials/images/hello_world_8.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/images/hello_world_9.png b/docs/html/guide/tutorials/images/hello_world_9.png
deleted file mode 100644
index a66526a..0000000
--- a/docs/html/guide/tutorials/images/hello_world_9.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/index.html b/docs/html/guide/tutorials/index.html
deleted file mode 100644
index e412dec..0000000
--- a/docs/html/guide/tutorials/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/resources/browser.html?tag=tutorial">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should have been redirected. Please <a
-href="http://developer.android.com/resources/browser.html?tag=tutorial">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/tutorials/localization/index.html b/docs/html/guide/tutorials/localization/index.html
deleted file mode 100644
index 2ea6661..0000000
--- a/docs/html/guide/tutorials/localization/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/resources/tutorials/localization/index.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should have been redirected. Please <a
-href="http://developer.android.com/resources/tutorials/localization/index.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/tutorials/notepad/codelab/NotepadCodeLab.zip b/docs/html/guide/tutorials/notepad/codelab/NotepadCodeLab.zip
deleted file mode 100644
index 24fefc1..0000000
--- a/docs/html/guide/tutorials/notepad/codelab/NotepadCodeLab.zip
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/notepad/index.html b/docs/html/guide/tutorials/notepad/index.html
deleted file mode 100644
index 01e4d09..0000000
--- a/docs/html/guide/tutorials/notepad/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/resources/tutorials/notepad/index.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should have been redirected. Please <a
-href="http://developer.android.com/resources/tutorials/notepad/index.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/tutorials/notepad/notepad-ex1.jd b/docs/html/guide/tutorials/notepad/notepad-ex1.jd
deleted file mode 100644
index cf7765e..0000000
--- a/docs/html/guide/tutorials/notepad/notepad-ex1.jd
+++ /dev/null
@@ -1,582 +0,0 @@
-page.title=Notepad Exercise 1
-parent.title=Notepad Tutorial
-parent.link=index.html
-@jd:body
-
-
-<p><em>In this exercise, you will construct a simple notes list that lets the
-user add new notes but not edit them. The exercise demonstrates:</em></p>
-<ul>
-<li><em>The basics of <code>ListActivities</code> and creating and handling menu
-options. </em></li>
-<li><em>How to use a SQLite database to store the notes.</em></li>
-<li><em>How to bind data from a database cursor into a ListView using a
-SimpleCursorAdapter.</em></li>
-<li><em>The basics of screen layouts, including how to lay out a list view, how
-you can add items to the activity menu, and how the activity handles those menu
-selections. </em></li>
-</ul>
-
-<div style="float:right;white-space:nowrap">
-<span style="color:#BBB;">
- [<a href="notepad-ex1.html" style="color:#BBB;">Exercise 1</a>]</span>
- [<a href="notepad-ex2.html">Exercise 2</a>]
- [<a href="notepad-ex3.html">Exercise 3</a>]
- [<a href="notepad-extra-credit.html">Extra Credit</a>]
-</div>
-
-
-
-<h2>Step 1</h2>
-
- <p>Open up the <code>Notepadv1</code> project in Eclipse.</p>
-
- <p><code>Notepadv1</code> is a project that is provided as a starting point. It
- takes care of some of the boilerplate work that you have already seen if you
- followed the <a href="{@docRoot}resources/tutorials/hello-world.html">Hello,
- World</a> tutorial.</p>
-
- <ol>
- <li>
- Start a new Android Project by clicking <strong>File</strong> >
- <strong>New</strong> > <strong>Android Project</strong>.</li>
- <li>
- In the New Android Project dialog, select <strong>Create project from existing source</strong>.</li>
- <li>
- Click <strong>Browse</strong> and navigate to where you copied the <code>NotepadCodeLab</code>
- (downloaded during <a href="{@docRoot}resources/tutorials/notepad/index.html#preparing">setup</a>)
- and select <code>Notepadv1</code>.</li>
- <li>
- The Project Name and other properties should be automatically filled for you.
- You must select the Build Target—we recommend selecting a target with the
- lowest platform version available. Also add an integer to the Min SDK Version field
- that matches the API Level of the selected Build Target.</li>
- <li>
- Click <strong>Finish</strong>. The <code>Notepadv1</code> project should open and be
- visible in your Eclipse package explorer.</li>
- </ol>
-
- <p>If you see an error about <code>AndroidManifest.xml</code>, or some
- problems related to an Android zip file, right click on the project and
- select <strong>Android Tools</strong> > <strong>Fix Project Properties</strong>.
- (The project is looking in the wrong location for the library file,
- this will fix it for you.)</p>
-
- <h2>Step 2</h2>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Accessing and modifying data</h2>
- <p>For this
- exercise, we are using a SQLite database to store our data. This is useful
- if only <em>your</em> application will need to access or modify the data. If you wish for
- other activities to access or modify the data, you have to expose the data using a
- {@link android.content.ContentProvider ContentProvider}.</p>
- <p>If you are interested, you can find out more about
- <a href="{@docRoot}guide/topics/providers/content-providers.html">content providers</a> or the
-whole
- subject of <a href="{@docRoot}guide/topics/data/data-storage.html">Data Storage</a>.
- The NotePad sample in the <code>samples/</code> folder of the SDK also has an example of how
- to create a ContentProvider.</p>
- </div>
- </div>
-
- <p>Take a look at the <code>NotesDbAdapter</code> class — this class is provided to
- encapsulate data access to a SQLite database that will hold our notes data
- and allow us to update it.</p>
- <p>At the top of the class are some constant definitions that will be used in the application
- to look up data from the proper field names in the database. There is also a database creation
- string defined, which is used to create a new database schema if one doesn't exist already.</p>
- <p>Our database will have the name <code>data</code>, and have a single table called
- <code>notes</code>, which in turn has three fields: <code>_id</code>, <code>title</code> and
- <code>body</code>. The <code>_id</code> is named with an underscore convention used in a number of
- places inside the Android SDK and helps keep a track of state. The <code>_id</code>
- usually has to be specified when querying or updating the database (in the column projections
- and so on). The other two fields are simple text fields that will store data.
- </p>
- <p>The constructor for <code>NotesDbAdapter</code> takes a Context, which allows it to communicate with aspects
- of the Android operating system. This is quite common for classes that need to touch the
- Android system in some way. The Activity class implements the Context class, so usually you will just pass
- <code>this</code> from your Activity, when needing a Context.</p>
- <p>The <code>open()</code> method calls up an instance of DatabaseHelper, which is our local
- implementation of the SQLiteOpenHelper class. It calls <code>getWritableDatabase()</code>,
- which handles creating/opening a database for us.</p>
- <p><code>close()</code> just closes the database, releasing resources related to the
- connection.</p>
- <p><code>createNote()</code> takes strings for the title and body of a new note,
- then creates that note in the database. Assuming the new note is created successfully, the
- method also returns the row <code>_id</code> value for the newly created note.</p>
- <p><code>deleteNote()</code> takes a <var>rowId</var> for a particular note, and deletes that note from
- the database.</p>
-
- <p><code>fetchAllNotes()</code> issues a query to return a {@link android.database.Cursor} over all notes in the
- database. The <code>query()</code> call is worth examination and understanding. The first field is the
- name of the database table to query (in this case <code>DATABASE_TABLE</code> is "notes").
- The next is the list of columns we want returned, in this case we want the <code>_id</code>,
- <code>title</code> and <code>body</code> columns so these are specified in the String array.
- The remaining fields are, in order: <code>selection</code>,
- <code>selectionArgs</code>, <code>groupBy</code>, <code>having</code> and <code>orderBy</code>.
- Having these all <code>null</code> means we want all data, need no grouping, and will take the default
- order. See {@link android.database.sqlite.SQLiteDatabase SQLiteDatabase} for more details.</p>
- <p class="note"><b>Note:</b> A Cursor is returned rather than a collection of rows. This allows
- Android to use resources efficiently -- instead of putting lots of data straight into memory
- the cursor will retrieve and release data as it is needed, which is much more efficient for
- tables with lots of rows.</p>
-
- <p><code>fetchNote()</code> is similar to <code>fetchAllNotes()</code> but just gets one note
- with the <var>rowId</var> we specify. It uses a slightly different version of the
- {@link android.database.sqlite.SQLiteDatabase} <code>query()</code> method.
- The first parameter (set <em>true</em>) indicates that we are interested
- in one distinct result. The <var>selection</var> parameter (the fourth parameter) has been specified to search
- only for the row "where _id =" the <var>rowId</var> we passed in. So we are returned a Cursor on
- the one row.</p>
- <p>And finally, <code>updateNote()</code> takes a <var>rowId</var>, <var>title</var> and <var>body</var>, and uses a
- {@link android.content.ContentValues ContentValues} instance to update the note of the given
- <var>rowId</var>.</p>
-
-<h2 style="clear:right;">Step 3</h2>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Layouts and activities</h2>
- <p>Most Activity classes will have a layout associated with them. The layout
- will be the "face" of the Activity to the user. In this case our layout will
- take over the whole screen and provide a list of notes.</p>
- <p>Full screen layouts are not the only option for an Activity however. You
- might also want to use a <a
-href="{@docRoot}resources/faq/commontasks.html#floatingorfull">floating
- layout</a> (for example, a <a
-href="{@docRoot}resources/faq/commontasks.html#dialogsandalerts">dialog
- or alert</a>),
- or perhaps you don't need a layout at all (the Activity will be invisible
- to the user unless you specify some kind of layout for it to use).</p>
- </div>
- </div>
-
- <p>Open the <code>notepad_list.xml</code> file in <code>res/layout</code>
-and
- take a look at it. (You may have to
- hit the <em>xml</em> tab, at the bottom, in order to view the XML markup.)</p>
-
- <p>This is a mostly-empty layout definition file. Here are some
- things you should know about a layout file:</p>
-
-
- <ul>
- <li>
- All Android layout files must start with the XML header line:
- <code><?xml version="1.0" encoding="utf-8"?></code>. </li>
- <li>
- The next definition will often (but not always) be a layout
- definition of some kind, in this case a <code>LinearLayout</code>. </li>
- <li>
- The XML namespace of Android should always be defined in
- the top level component or layout in the XML so that <code>android:</code> tags can
- be used through the rest of the file:
- <p><code>xmlns:android="http://schemas.android.com/apk/res/android"</code></p>
- </li>
- </ul>
-
- <h2 style="clear:right;">Step 4</h2>
- <p>We need to create the layout to hold our list. Add code inside
- of the <code>LinearLayout</code> element so the whole file looks like this: </p>
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
-
- <ListView android:id="@android:id/list"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
- <TextView android:id="@android:id/empty"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/no_notes"/>
-
-</LinearLayout>
-</pre>
- <ul>
- <li>
- The <strong>@</strong> symbol in the id strings of the <code>ListView</code> and
- <code>TextView</code> tags means
- that the XML parser should parse and expand the rest of
- the id string and use an ID resource.</li>
- <li>
- The <code>ListView</code> and <code>TextView</code> can be
- thought as two alternative views, only one of which will be displayed at once.
- ListView will be used when there are notes to be shown, while the TextView
- (which has a default value of "No Notes Yet!" defined as a string
- resource in <code>res/values/strings.xml</code>) will be displayed if there
- aren't any notes to display.</li>
- <li>The <code>list</code> and <code>empty</code> IDs are
- provided for us by the Android platform, so, we must
- prefix the <code>id</code> with <code>android:</code> (e.g., <code>@android:id/list</code>).</li>
- <li>The View with the <code>empty</code> id is used
- automatically when the {@link android.widget.ListAdapter} has no data for the ListView. The
- ListAdapter knows to look for this name by default. Alternatively, you could change the
- default empty view by using {@link android.widget.AdapterView#setEmptyView(View)}
- on the ListView.
- <p>
- More broadly, the <code>android.R</code> class is a set of predefined
- resources provided for you by the platform, while your project's
- <code>R</code> class is the set of resources your project has defined.
- Resources found in the <code>android.R</code> resource class can be
- used in the XML files by using the <code>android:</code> name space prefix
- (as we see here).</p>
- </li>
- </ul>
-
- <h2 style="clear:right;">Step 5</h2>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Resources and the R class</h2>
- <p>The folders under res/ in the Eclipse project are for resources.
- There is a <a href="{@docRoot}resources/faq/commontasks.html#filelist">specific structure</a>
-to the
- folders and files under res/.</p>
- <p>Resources defined in these folders and files will have
- corresponding entries in the R class allowing them to be easily accessed
- and used from your application. The R class is automatically generated using the contents
- of the res/ folder by the eclipse plugin (or by aapt if you use the command line tools).
- Furthermore, they will be bundled and deployed for you as part of the application.</p>
- </p>
- </div>
- </div>
-
- <p>To make the list of notes in the ListView, we also need to define a View for each row:</p>
- <ol>
- <li>
- Create a new file under <code>res/layout</code> called
- <code>notes_row.xml</code>. </li>
- <li>
- Add the following contents (note: again the XML header is used, and the
- first node defines the Android XML namespace)<br>
- <pre style="overflow:auto">
-<?xml version="1.0" encoding="utf-8"?>
-<TextView android:id="@+id/text1"
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/></pre>
- <p>
- This is the View that will be used for each notes title row — it has only
- one text field in it. </p>
- <p>In this case we create a new id called <code>text1</code>. The
- <strong>+</strong> after the <strong>@</strong> in the id string indicates that the id should
- be automatically created as a resource if it does not already exist, so we are defining
- <code>text1</code> on the fly and then using it.</p>
- </li>
- <li>Save the file.</li>
- </ol>
- <p>Open the <code>R.java</code> class in the
- project and look at it, you should see new definitions for
- <code>notes_row</code> and <code>text1</code> (our new definitions)
- meaning we can now gain access to these from the our code. </p>
-
- <h2 style="clear:right;">Step 6</h2>
-<p>Next, open the <code>Notepadv1</code> class in the source. In the following steps, we are going to
- alter this class to become a list adapter and display our notes, and also
- allow us to add new notes.</p>
-
-<p><code>Notepadv1</code> will inherit from a subclass
- of <code>Activity</code> called a <code>ListActivity</code>,
- which has extra functionality to accommodate the kinds of
- things you might want to do with a list, for
- example: displaying an arbitrary number of list items in rows on the screen,
- moving through the list items, and allowing them to be selected.</p>
-
-<p>Take a look through the existing code in <code>Notepadv1</code> class.
- There is a currently an unused private field called <code>mNoteNumber</code> that
- we will use to create numbered note titles.</p>
- <p>There are also three override methods defined:
- <code>onCreate</code>, <code>onCreateOptionsMenu</code> and
- <code>onOptionsItemSelected</code>; we need to fill these
- out:</p>
- <ul>
- <li><code>onCreate()</code> is called when the activity is
- started — it is a little like the "main" method for an Activity. We use
- this to set up resources and state for the activity when it is
- running.</li>
- <li><code>onCreateOptionsMenu()</code> is used to populate the
- menu for the Activity. This is shown when the user hits the menu button,
-and
- has a list of options they can select (like "Create
- Note"). </li>
- <li><code>onOptionsItemSelected()</code> is the other half of the
- menu equation, it is used to handle events generated from the menu (e.g.,
- when the user selects the "Create Note" item).
- </li>
- </ul>
-
- <h2>Step 7</h2>
- <p>Change the inheritance of <code>Notepadv1</code> from
-<code>Activity</code>
- to <code>ListActivity</code>:</p>
- <pre>public class Notepadv1 extends ListActivity</pre>
- <p>Note: you will have to import <code>ListActivity</code> into the
-Notepadv1
- class using Eclipse, <strong>ctrl-shift-O</strong> on Windows or Linux, or
- <strong>cmd-shift-O</strong> on the Mac (organize imports) will do this for you
- after you've written the above change.</p>
-
- <h2>Step 8</h2>
- <p>Fill out the body of the <code>onCreate()</code> method.</p>
- <p>Here we will set the title for the Activity (shown at the top of the
- screen), use the <code>notepad_list</code> layout we created in XML,
- set up the <code>NotesDbAdapter</code> instance that will
- access notes data, and populate the list with the available note
- titles:</p>
- <ol>
- <li>
- In the <code>onCreate</code> method, call <code>super.onCreate()</code> with the
- <code>savedInstanceState</code> parameter that's passed in.</li>
- <li>
- Call <code>setContentView()</code> and pass <code>R.layout.notepad_list</code>.</li>
- <li>
- At the top of the class, create a new private class field called <code>mDbHelper</code> of class
- <code>NotesDbAdapter</code>.
- </li>
- <li>
- Back in the <code>onCreate</code> method, construct a new
-<code>NotesDbAdapter</code>
- instance and assign it to the <code>mDbHelper</code> field (pass
- <code>this</code> into the constructor for <code>DBHelper</code>)
- </li>
- <li>
- Call the <code>open()</code> method on <code>mDbHelper</code> to open (or create) the
- database.
- </li>
- <li>
- Finally, call a new method <code>fillData()</code>, which will get the data and
- populate the ListView using the helper — we haven't defined this method yet. </li>
- </ol>
- <p>
- <code>onCreate()</code> should now look like this:</p>
- <pre>
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.notepad_list);
- mDbHelper = new NotesDbAdapter(this);
- mDbHelper.open();
- fillData();
- }</pre>
- <p>And be sure you have the <code>mDbHelper</code> field definition (right
- under the mNoteNumber definition): </p>
- <pre> private NotesDbAdapter mDbHelper;</pre>
-
- <h2>Step 9</h2>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>More about menus</h2>
- <p>The notepad application we are constructing only scratches the
- surface with <a href="{@docRoot}resources/faq/commontasks.html#addmenuitems">menus</a>. </p>
- <p>You can also <a href="{@docRoot}resources/faq/commontasks.html#menukeyshortcuts">add
-shortcut keys for menu items</a>, <a
-href="{@docRoot}resources/faq/commontasks.html#menukeyshortcuts">create
-submenus</a> and even <a href="{@docRoot}resources/faq/commontasks.html#addingtoothermenus">add
-menu items to other applications!</a>. </p>
- </div>
- </div>
-
-<p>Fill out the body of the <code>onCreateOptionsMenu()</code> method.</p>
-
-<p>We will now create the "Add Item" button that can be accessed by pressing the menu
-button on the device. We'll specify that it occupy the first position in the menu.</p>
-
- <ol>
- <li>
- In <code>strings.xml</code> resource (under <code>res/values</code>), add
- a new string named "menu_insert" with its value set to <code>Add Item</code>:
- <pre><string name="menu_insert">Add Item</string></pre>
- <p>Then save the file and return to <code>Notepadv1</code>.</p>
- </li>
- <li>Create a menu position constant at the top of the class:
- <pre>public static final int INSERT_ID = Menu.FIRST;</pre>
- </li>
- <li>In the <code>onCreateOptionsMenu()</code> method, change the
- <code>super</code> call so we capture the boolean return as <code>result</code>. We'll return this value at the end.</li>
- <li>Then add the menu item with <code>menu.add()</code>.</li>
- </ol>
- <p>The whole method should now look like this:
- <pre>
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- boolean result = super.onCreateOptionsMenu(menu);
- menu.add(0, INSERT_ID, 0, R.string.menu_insert);
- return result;
- }</pre>
- <p>The arguments passed to <code>add()</code> indicate: a group identifier for this menu (none,
- in this case), a unique ID (defined above), the order of the item (zero indicates no preference),
- and the resource of the string to use for the item.</p>
-
-<h2 style="clear:right;">Step 10</h2>
- <p>Fill out the body of the <code>onOptionsItemSelected()</code> method:</p>
- <p>This is going
- to handle our new "Add Note" menu item. When this is selected, the
- <code>onOptionsItemSelected()</code> method will be called with the
- <code>item.getId()</code> set to <code>INSERT_ID</code> (the constant we
- used to identify the menu item). We can detect this, and take the
- appropriate actions:</p>
- <ol>
- <li>
- The <code>super.onOptionsItemSelected(item)</code> method call goes at the
- end of this method — we want to catch our events first! </li>
- <li>
- Write a switch statement on <code>item.getItemId()</code>.
- <p>In the case of <var>INSERT_ID</var>, call a new method, <code>createNote()</code>,
- and return true, because we have handled this event and do not want to
- propagate it through the system.</p>
- </li>
- <li>Return the result of the superclass' <code>onOptionsItemSelected()</code>
- method at the end.</li>
- </ol>
- <p>
- The whole <code>onOptionsItemSelect()</code> method should now look like
- this:</p>
- <pre>
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case INSERT_ID:
- createNote();
- return true;
- }
-
- return super.onOptionsItemSelected(item);
- }</pre>
-
-<h2>Step 11</h2>
- <p>Add a new <code>createNote()</code> method:</p>
- <p>In this first version of
- our application, <code>createNote()</code> is not going to be very useful.
-We will simply
- create a new note with a title assigned to it based on a counter ("Note 1",
- "Note 2"...) and with an empty body. At present we have no way of editing
- the contents of a note, so for now we will have to be content making one
- with some default values:</p>
- <ol>
- <li>Construct the name using "Note" and the counter we defined in the class: <code>
- String noteName = "Note " + mNoteNumber++</code></li>
- <li>
- Call <code>mDbHelper.createNote()</code> using <code>noteName</code> as the
- title and <code>""</code> for the body
- </li>
- <li>
- Call <code>fillData()</code> to populate the list of notes (inefficient but
- simple) — we'll create this method next.</li>
- </ol>
- <p>
- The whole <code>createNote()</code> method should look like this: </p>
- <pre>
- private void createNote() {
- String noteName = "Note " + mNoteNumber++;
- mDbHelper.createNote(noteName, "");
- fillData();
- }</pre>
-
-
-<h2>Step 12</h2>
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>List adapters</h2>
- <p>Our example uses a {@link android.widget.SimpleCursorAdapter
- SimpleCursorAdapter} to bind a database {@link android.database.Cursor Cursor}
- into a ListView, and this is a common way to use a {@link android.widget.ListAdapter
- ListAdapter}. Other options exist like {@link android.widget.ArrayAdapter ArrayAdapter} which
- can be used to take a List or Array of in-memory data and bind it in to
- a list as well.</p>
- </div>
- </div>
-
- <p>Define the <code>fillData()</code> method:</p>
- <p>This
- method uses <code>SimpleCursorAdapter,</code> which takes a database <code>Cursor</code>
- and binds it to fields provided in the layout. These fields define the row elements of our list
- (in this case we use the <code>text1</code> field in our
- <code>notes_row.xml</code> layout), so this allows us to easily populate the list with
- entries from our database.</p>
- <p>To do this we have to provide a mapping from the <code>title</code> field in the returned Cursor, to
- our <code>text1</code> TextView, which is done by defining two arrays: the first a string array
- with the list of columns to map <em>from</em> (just "title" in this case, from the constant
- <code>NotesDbAdapter.KEY_TITLE</code>) and, the second, an int array
- containing references to the views that we'll bind the data <em>into</em>
- (the <code>R.id.text1</code> TextView).</p>
- <p>This is a bigger chunk of code, so let's first take a look at it:</p>
-
- <pre>
- private void fillData() {
- // Get all of the notes from the database and create the item list
- Cursor c = mDbHelper.fetchAllNotes();
- startManagingCursor(c);
-
- String[] from = new String[] { NotesDbAdapter.KEY_TITLE };
- int[] to = new int[] { R.id.text1 };
-
- // Now create an array adapter and set it to display using our row
- SimpleCursorAdapter notes =
- new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);
- setListAdapter(notes);
- }</pre>
-
- <p>Here's what we've done:</p>
- <ol>
- <li>
- After obtaining the Cursor from <code>mDbHelper.fetchAllNotes()</code>, we
- use an Activity method called
- <code>startManagingCursor()</code> that allows Android to take care of the
- Cursor lifecycle instead of us needing to worry about it. (We will cover the implications
- of the lifecycle in exercise 3, but for now just know that this allows Android to do some
- of our resource management work for us.)</li>
- <li>
- Then we create a string array in which we declare the column(s) we want
- (just the title, in this case), and an int array that defines the View(s)
- to which we'd like to bind the columns (these should be in order, respective to
- the string array, but here we only have one for each).</li>
- <li>
- Next is the SimpleCursorAdapter instantiation.
- Like many classes in Android, the SimpleCursorAdapter needs a Context in order to do its
- work, so we pass in <code>this</code> for the context (since subclasses of Activity
- implement Context). We pass the <code>notes_row</code> View we created as the receptacle
- for the data, the Cursor we just created, and then our arrays.</li>
- </ol>
- <p>
- In the future, remember that the mapping between the <strong>from</strong> columns and <strong>to</strong> resources
- is done using the respective ordering of the two arrays. If we had more columns we wanted
- to bind, and more Views to bind them in to, we would specify them in order, for example we
- might use <code>{ NotesDbAdapter.KEY_TITLE, NotesDbAdapter.KEY_BODY }</code> and
- <code>{ R.id.text1, R.id.text2 }</code> to bind two fields into the row (and we would also need
- to define text2 in the notes_row.xml, for the body text). This is how you can bind multiple fields
- into a single row (and get a custom row layout as well).</p>
- <p>
- If you get compiler errors about classes not being found, ctrl-shift-O or
- (cmd-shift-O on the mac) to organize imports.
- </p>
-
-<h2 style="clear:right;">Step 13</h2>
- <p>Run it!
- <ol>
- <li>
- Right click on the <code>Notepadv1</code> project.</li>
- <li>
- From the popup menu, select <strong>Run As</strong> >
- <strong>Android Application</strong>.</li>
- <li>
- If you see a dialog come up, select Android Launcher as the way of running
- the application (you can also use the link near the top of the dialog to
- set this as your default for the workspace; this is recommended as it will
- stop the plugin from asking you this every time).</li>
- <li>Add new notes by hitting the menu button and selecting <em>Add
- Item</em> from the menu.</li>
- </ol>
-
-<h2 style="clear:right;">Solution and Next Steps</h2>
- <p>You can see the solution to this class in <code>Notepadv1Solution</code>
-from
-the zip file to compare with your own.</p>
-
-<p>Once you are ready, move on to <a href="notepad-ex2.html">Tutorial
-Exercise 2</a> to add the ability to create, edit and delete notes.</p>
-
diff --git a/docs/html/guide/tutorials/notepad/notepad-ex2.jd b/docs/html/guide/tutorials/notepad/notepad-ex2.jd
deleted file mode 100644
index fed40ab..0000000
--- a/docs/html/guide/tutorials/notepad/notepad-ex2.jd
+++ /dev/null
@@ -1,642 +0,0 @@
-Rpage.title=Notepad Exercise 2
-parent.title=Notepad Tutorial
-parent.link=index.html
-@jd:body
-
-
-<p><em>In this exercise, you will add a second Activity to your notepad application, to let the user
-create and edit notes. You will also allow the user to delete existing notes through a context menu.
-The new Activity assumes responsibility for creating new notes by
-collecting user input and packing it into a return Bundle provided by the intent. This exercise
-demonstrates:</em></p>
-<ul>
-<li><em>Constructing a new Activity and adding it to the Android manifest</em></li>
-<li><em>Invoking another Activity asynchronously using <code>startActivityForResult()</code></em></li>
-<li><em>Passing data between Activity in Bundle objects</em></li>
-<li><em>How to use a more advanced screen layout</em></li>
-<li><em>How to create a context menu</em></li>
-</ul>
-
-<div style="float:right;white-space:nowrap">
- [<a href="notepad-ex1.html">Exercise 1</a>]
- <span style="color:#BBB;">
- [<a href="notepad-ex2.html" style="color:#DDD;">Exercise 2</a>]
- </span>
- [<a href="notepad-ex3.html">Exercise 3</a>]
- [<a href="notepad-extra-credit.html">Extra Credit</a>]
-</div>
-
-<h2>Step 1</h2>
-
-<p>Create a new Android project using the sources from <code>Notepadv2</code> under the
-<code>NotepadCodeLab</code> folder, just like you did for the first exercise. If you see an error about
-<code>AndroidManifest.xml</code>, or some problems related to an
-<code>android.zip</code> file, right click on the project and select <strong>Android
-Tools</strong> > <strong>Fix Project Properties</strong>.</p>
-
-<p>Open the <code>Notepadv2</code> project and take a look around:</p>
-<ul>
- <li>
- Open and look at the <code>strings.xml</code> file under
- <code>res/values</code> — there are several new strings which we will use
- for our new functionality
- </li>
- <li>
- Also, open and take a look at the top of the <code>Notepadv2</code> class,
- you will notice several new constants have been defined along with a new <code>mNotesCursor</code>
- field used to hold the cursor we are using.
- </li>
- <li>
- Note also that the <code>fillData()</code> method has a few more comments and now uses
- the new field to store the notes Cursor. The <code>onCreate()</code> method is
- unchanged from the first exercise. Also notice that the member field used to store the
- notes Cursor is now called <code>mNotesCursor</code>. The <code>m</code> denotes a member
- field and is part of the Android coding style standards.
- </li>
- <li>
- There are also a couple of new overridden methods
- (<code>onCreateContextMenu()</code>, <code>onContextItemSelected()</code>,
- <code>onListItemClick()</code> and <code>onActivityResult()</code>)
- which we will be filling in below.
- </li>
-</ul>
-
-
-<h2>Step 2</h2>
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<p>Context menus should always be used when performing actions upon specific elements in the UI.
-When you register a View to a context menu, the context menu is revealed by performing a "long-click"
-on the UI component (press and hold the touchscreen or highlight and hold down the selection key for about two seconds).</p>
-</div>
-</div>
-
-<p>First, let's create the context menu that will allow users to delete individual notes.
-Open the Notepadv2 class.</p>
-
-<ol>
- <li>In order for each list item in the ListView to register for the context menu, we call
- <code>registerForContextMenu()</code> and pass it our ListView. So, at the very end of
- the <code>onCreate()</code> method add this line:
- <pre>registerForContextMenu(getListView());</pre>
- <p>Because our Activity extends the ListActivity class, <code>getListView()</code> will return us
- the local ListView object for the Activity. Now, each list item in this ListView will activate the
- context menu.
- <li>
- Now fill in the <code>onCreateContextMenu()</code> method. This callback is similar to the other
- menu callback used for the options menu. Here, we add just one line, which will add a menu item
- to delete a note. Call <code>menu.add()</code> like so:
- <pre>
-public void onCreateContextMenu(Menu menu, View v,
- ContextMenu.ContextMenuInfo menuInfo) {
- super.onCreateContextMenu(menu, v, menuInfo);
- menu.add(0, DELETE_ID, 0, R.string.menu_delete);
-}</pre>
- <p>The <code>onCreateContextMenu()</code> callback passes some other information in addition to the Menu object,
- such as the View that has been triggered for the menu and
- an extra object that may contain additional information about the object selected. However, we don't care about
- these here, because we only have one kind of object in the Activity that uses context menus. In the next
- step, we'll handle the menu item selection.</p>
- </li>
-</ol>
-
-<h2>Step 3</h2>
- <p>Now that the we've registered our ListView for a context menu and defined our context menu item, we need
- to handle the callback when it is selected. For this, we need to identify the list ID of the
- selected item, then delete it. So fill in the
- <code>onContextItemSelected()</code> method like this:</p>
-<pre>
-public boolean onContextItemSelected(MenuItem item) {
- switch(item.getItemId()) {
- case DELETE_ID:
- AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
- mDbHelper.deleteNote(info.id);
- fillData();
- return true;
- }
- return super.onContextItemSelected(item);
-}</pre>
-<p>Here, we retrieve the {@link android.widget.AdapterView.AdapterContextMenuInfo AdapterContextMenuInfo}
-with {@link android.view.MenuItem#getMenuInfo()}. The <var>id</var> field of this object tells us
-the position of the item in the ListView. We then pass this to the <code>deleteNote()</code>
-method of our NotesDbAdapter and the note is deleted. That's it for the context menu — notes
-can now be deleted.</p>
-
-<h2 style="clear:right;">Step 4</h2>
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Starting Other Activities</h2>
- <p>In this example our Intent uses a class name specifically.
- As well as
- <a href="{@docRoot}resources/faq/commontasks.html#intentexamples">starting intents</a> in
- classes we already know about, be they in our own application or another
- application, we can also create Intents without knowing exactly which
- application will handle it.</p>
- <p>For example, we might want to open a page in a
- browser, and for this we still use
- an Intent. But instead of specifying a class to handle it, we use
- a predefined Intent constant, and a content URI that describes what we
- want to do. See {@link android.content.Intent
- android.content.Intent} for more information.</p>
- </div>
- </div>
-
- <p>Fill in the body of the <code>createNote()</code> method:
- <p>Create a new <code>Intent</code> to create a note
- (<code>ACTIVITY_CREATE</code>) using the <code>NoteEdit</code> class.
- Then fire the Intent using the <code>startActivityForResult()</code> method
- call:</p>
- <pre style="overflow:auto">
-Intent i = new Intent(this, NoteEdit.class);
-startActivityForResult(i, ACTIVITY_CREATE);</pre>
- <p>This form of the Intent call targets a specific class in our Activity, in this case
- <code>NoteEdit</code>. Since the Intent class will need to communicate with the Android
- operating system to route requests, we also have to provide a Context (<code>this</code>).</p>
- <p>The <code>startActivityForResult()</code> method fires the Intent in a way that causes a method
- in our Activity to be called when the new Activity is completed. The method in our Activity
- that receives the callback is called
- <code>onActivityResult()</code> and we will implement it in a later step. The other way
- to call an Activity is using <code>startActivity()</code> but this is a "fire-and-forget" way
- of calling it — in this manner, our Activity is not informed when the Activity is completed, and there is
- no way to return result information from the called Activity with <code>startActivity()</code>.
- <p>Don't worry about the fact that <code>NoteEdit</code> doesn't exist yet,
- we will fix that soon. </p>
- </li>
-
-
-<h2>Step 5</h2>
-
- <p>Fill in the body of the <code>onListItemClick()</code> override.</p>
- <p><code>onListItemClick()</code> is a callback method that we'll override. It is called when
- the user selects an item from the list. It is passed four parameters: the
- <code>ListView</code> object it was invoked from, the <code>View</code>
- inside the <code>ListView</code> that was clicked on, the
- <code>position</code> in the list that was clicked, and the
- <code>mRowId</code> of the item that was clicked. In this instance we can
- ignore the first two parameters (we only have one <code>ListView</code> it
- could be), and we ignore the <code>mRowId</code> as well. All we are
- interested in is the <code>position</code> that the user selected. We use
- this to get the data from the correct row, and bundle it up to send to
- the <code>NoteEdit</code> Activity.</p>
- <p>In our implementation of the callback, the method creates an
- <code>Intent</code> to edit the note using
- the <code>NoteEdit</code> class. It then adds data into the extras Bundle of
- the Intent, which will be passed to the called Activity. We use it
- to pass in the title and body text, and the <code>mRowId</code> for the note we are
- editing. Finally, it will fire the Intent using the
- <code>startActivityForResult()</code> method call. Here's the code that
- belongs in <code>onListItemClick()</code>:</p>
- <pre>
-super.onListItemClick(l, v, position, id);
-Cursor c = mNotesCursor;
-c.moveToPosition(position);
-Intent i = new Intent(this, NoteEdit.class);
-i.putExtra(NotesDbAdapter.KEY_ROWID, id);
-i.putExtra(NotesDbAdapter.KEY_TITLE, c.getString(
- c.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE)));
-i.putExtra(NotesDbAdapter.KEY_BODY, c.getString(
- c.getColumnIndexOrThrow(NotesDbAdapter.KEY_BODY)));
-startActivityForResult(i, ACTIVITY_EDIT);</pre>
- <ul>
- <li>
- <code>putExtra()</code> is the method to add items into the extras Bundle
- to pass in to intent invocations. Here, we are
- using the Bundle to pass in the title, body and mRowId of the note we want to edit.
- </li>
- <li>
- The details of the note are pulled out from our query Cursor, which we move to the
- proper position for the element that was selected in the list, with
- the <code>moveToPosition()</code> method.</li>
- <li>With the extras added to the Intent, we invoke the Intent on the
- <code>NoteEdit</code> class by passing <code>startActivityForResult()</code>
- the Intent and the request code. (The request code will be
- returned to <code>onActivityResult</code> as the <code>requestCode</code> parameter.)</li>
- </ul>
- <p class="note"><b>Note:</b> We assign the mNotesCursor field to a local variable at the
- start of the method. This is done as an optimization of the Android code. Accessing a local
- variable is much more efficient than accessing a field in the Dalvik VM, so by doing this
- we make only one access to the field, and five accesses to the local variable, making the
- routine much more efficient. It is recommended that you use this optimization when possible.</p>
-
-
-<h2>Step 6</h2>
-
-<p>The above <code>createNote()</code> and <code>onListItemClick()</code>
- methods use an asynchronous Intent invocation. We need a handler for the callback, so here we fill
- in the body of the <code>onActivityResult()</code>. </p>
-<p><code>onActivityResult()</code> is the overridden method
- which will be called when an Activity returns with a result. (Remember, an Activity
- will only return a result if launched with <code>startActivityForResult</code>.) The parameters provided
- to the callback are: </p>
- <ul>
- <li><code>requestCode</code> — the original request code
- specified in the Intent invocation (either <code>ACTIVITY_CREATE</code> or
- <code>ACTIVITY_EDIT</code> for us).
- </li>
- <li><code>resultCode</code> — the result (or error code) of the call, this
- should be zero if everything was OK, but may have a non-zero code indicating
- that something failed. There are standard result codes available, and you
- can also create your own constants to indicate specific problems.
- </li>
- <li><code>intent</code> — this is an Intent created by the Activity returning
- results. It can be used to return data in the Intent "extras."
- </li>
- </ul>
- <p>The combination of <code>startActivityForResult()</code> and
- <code>onActivityResult()</code> can be thought of as an asynchronous RPC
- (remote procedure call) and forms the recommended way for an Activity to invoke
- another and share services.</p>
- <p>Here's the code that belongs in your <code>onActivityResult()</code>:</p>
- <pre>
-super.onActivityResult(requestCode, resultCode, intent);
-Bundle extras = intent.getExtras();
-
-switch(requestCode) {
-case ACTIVITY_CREATE:
- String title = extras.getString(NotesDbAdapter.KEY_TITLE);
- String body = extras.getString(NotesDbAdapter.KEY_BODY);
- mDbHelper.createNote(title, body);
- fillData();
- break;
-case ACTIVITY_EDIT:
- Long mRowId = extras.getLong(NotesDbAdapter.KEY_ROWID);
- if (mRowId != null) {
- String editTitle = extras.getString(NotesDbAdapter.KEY_TITLE);
- String editBody = extras.getString(NotesDbAdapter.KEY_BODY);
- mDbHelper.updateNote(mRowId, editTitle, editBody);
- }
- fillData();
- break;
-}</pre>
-
- <ul>
- <li>
- We are handling both the <code>ACTIVITY_CREATE</code> and
- <code>ACTIVITY_EDIT</code> activity results in this method.
- </li>
- <li>
- In the case of a create, we pull the title and body from the extras (retrieved from the
- returned Intent) and use them to create a new note.
- </li>
- <li>
- In the case of an edit, we pull the mRowId as well, and use that to update
- the note in the database.
- </li>
- <li>
- <code>fillData()</code> at the end ensures everything is up to date .
- </li>
- </ul>
-
-
-<h2>Step 7</h2>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>The Art of Layout</h2>
- <p>The provided
- note_edit.xml layout file is the most sophisticated one in the application we will be building,
- but that doesn't mean it is even close to the kind of sophistication you will be likely to want
- in real Android applications.</p>
- <p>Creating a
- good UI is part art and part science, and the rest is work. Mastery of <a
- href="{@docRoot}guide/topics/ui/declaring-layout.html">XML Layouts</a> is an essential part of
-creating
- a good looking Android application.</p>
- <p>Take a look at the
- <a href="{@docRoot}resources/tutorials/views/index.html">Hello Views</a>
- for some example layouts and how to use them. The ApiDemos sample project is also a
- great resource from which to learn how to create different layouts.</p>
- </div>
- </div>
-
-<p>Open the file <code>note_edit.xml</code> that has been provided and take a
- look at it. This is the UI code for the Note Editor.</p>
- <p>This is the most
- sophisticated UI we have dealt with yet. The file is given to you to avoid
- problems that may sneak in when typing the code. (The XML is very strict
- about case sensitivity and structure, mistakes in these are the usual cause
- of problems with layout.)</p>
- <p>There is a new parameter used
- here that we haven't seen before: <code>android:layout_weight</code> (in
- this case set to use the value 1 in each case).</p>
- <p><code>layout_weight</code> is used in LinearLayouts
- to assign "importance" to Views within the layout. All Views have a default
- <code>layout_weight</code> of zero, meaning they take up only as much room
- on the screen as they need to be displayed. Assigning a value higher than
- zero will split up the rest of the available space in the parent View, according
- to the value of each View's <code>layout_weight</code> and its ratio to the
- overall <code>layout_weight</code> specified in the current layout for this
- and other View elements.</p>
- <p>To give an example: let's say we have a text label
- and two text edit elements in a horizontal row. The label has no
- <code>layout_weight</code> specified, so it takes up the minimum space
- required to render. If the <code>layout_weight</code> of each of the two
- text edit elements is set to 1, the remaining width in the parent layout will
- be split equally between them (because we claim they are equally important).
- If the first one has a <code>layout_weight</code> of 1
- and the second has a <code>layout_weight</code> of 2, then one third of the
- remaining space will be given to the first, and two thirds to the
- second (because we claim the second one is more important).</p>
- <p>This layout also demonstrates how to nest multiple layouts
- inside each other to achieve a more complex and pleasant layout. In this
- example, a horizontal linear layout is nested inside the vertical one to
- allow the title label and text field to be alongside each other,
- horizontally.</p>
-
-
-<h2 style="clear:right;">Step 8</h2>
-
- <p>Create a <code>NoteEdit</code> class that extends
- <code>android.app.Activity</code>.</p>
- <p>This is the first time we will have
- created an Activity without the Android Eclipse plugin doing it for us. When
- you do so, the <code>onCreate()</code> method is not automatically
- overridden for you. It is hard to imagine an Activity that doesn't override
- the <code>onCreate()</code> method, so this should be the first thing you do.</p>
- <ol>
- <li>Right click on the <code>com.android.demo.notepad2</code> package
- in the Package Explorer, and select <strong>New</strong> > <strong>Class</strong> from the popup
- menu.</li>
- <li>Fill in <code>NoteEdit</code> for the <code>Name:</code> field in the
- dialog.</li>
- <li>In the <code>Superclass:</code> field, enter
- <code>android.app.Activity</code> (you can also just type Activity and hit
- Ctrl-Space on Windows and Linux or Cmd-Space on the Mac, to invoke code
- assist and find the right package and class).</li>
- <li>Click <strong>Finish</strong>.</li>
- <li>In the resulting <code>NoteEdit</code> class, right click in the editor
- window and select <strong>Source</strong> > <strong>Override/Implement Methods...</strong></li>
- <li>Scroll down through the checklist in the dialog until you see
- <code>onCreate(Bundle)</code> — and check the box next to it.</li>
- <li>Click <strong>OK</strong>.<p>The method should now appear in your class.</p></li>
- </ol>
-
-<h2>Step 9</h2>
-
-<p>Fill in the body of the <code>onCreate()</code> method for <code>NoteEdit</code>.</p>
-
-<p>This will set the title of our new Activity to say "Edit Note" (one
- of the strings defined in <code>strings.xml</code>). It will also set the
- content view to use our <code>note_edit.xml</code> layout file. We can then
- grab handles to the title and body text edit views, and the confirm button,
- so that our class can use them to set and get the note title and body,
- and attach an event to the confirm button for when it is pressed by the
- user.</p>
- <p>We can then unbundle the values that were passed in to the Activity
- with the extras Bundle attached to the calling Intent. We'll use them to pre-populate
- the title and body text edit views so that the user can edit them.
- Then we will grab and store the <code>mRowId</code> so we can keep
- track of what note the user is editing.</p>
-
- <ol>
- <li>
- Inside <code>onCreate()</code>, set up the layout:<br>
- <pre>setContentView(R.layout.note_edit);</pre>
- </li>
- <li>
- Find the edit and button components we need:
- <p>These are found by the
- IDs associated to them in the R class, and need to be cast to the right
- type of <code>View</code> (<code>EditText</code> for the two text views,
- and <code>Button</code> for the confirm button):</p>
- <pre>
-mTitleText = (EditText) findViewById(R.id.title);
-mBodyText = (EditText) findViewById(R.id.body);
-Button confirmButton = (Button) findViewById(R.id.confirm);</pre>
- <p>Note that <code>mTitleText</code> and <code>mBodyText</code> are member
- fields (you need to declare them at the top of the class definition).</p>
- </li>
- <li>At the top of the class, declare a <code>Long mRowId</code> private field to store
- the current <code>mRowId</code> being edited (if any).
- </li>
- <li>Continuing inside <code>onCreate()</code>,
- add code to initialize the <code>title</code>, <code>body</code> and
- <code>mRowId</code> from the extras Bundle in
- the Intent (if it is present):<br>
- <pre>
-mRowId = null;
-Bundle extras = getIntent().getExtras();
-if (extras != null) {
- String title = extras.getString(NotesDbAdapter.KEY_TITLE);
- String body = extras.getString(NotesDbAdapter.KEY_BODY);
- mRowId = extras.getLong(NotesDbAdapter.KEY_ROWID);
-
- if (title != null) {
- mTitleText.setText(title);
- }
- if (body != null) {
- mBodyText.setText(body);
- }
-}</pre>
- <ul>
- <li>
- We are pulling the <code>title</code> and
- <code>body</code> out of the
- <code>extras</code> Bundle that was set from the
- Intent invocation.
- </li><li>
- We also null-protect the text field setting (i.e., we don't want to set
- the text fields to null accidentally).</li>
- </ul>
- </li>
- <li>
- Create an <code>onClickListener()</code> for the button:
- <p>Listeners can be one of the more confusing aspects of UI
- implementation, but
- what we are trying to achieve in this case is simple. We want an
- <code>onClick()</code> method to be called when the user presses the
- confirm button, and use that to do some work and return the values
- of the edited note to the Intent caller. We do this using something called
- an anonymous inner class. This is a bit confusing to look at unless you
- have seen them before, but all you really need to take away from this is
- that you can refer to this code in the future to see how to create a
- listener and attach it to a button. (Listeners are a common idiom
- in Java development, particularly for user interfaces.) Here's the empty listener:<br>
- <pre>
-confirmButton.setOnClickListener(new View.OnClickListener() {
-
- public void onClick(View view) {
-
- }
-
-});</pre>
- </li>
- </ol>
-<h2>Step 10</h2>
-
-<p>Fill in the body of the <code>onClick()</code> method of the <code>OnClickListener</code> created in the last step.</p>
-
- <p>This is the code that will be run when the user clicks on the
- confirm button. We want this to grab the title and body text from the edit
- text fields, and put them into the return Bundle so that they can be passed
- back to the Activity that invoked this <code>NoteEdit</code> Activity. If the
- operation is an edit rather than a create, we also want to put the
- <code>mRowId</code> into the Bundle so that the
- <code>Notepadv2</code> class can save the changes back to the correct
- note.</p>
- <ol>
- <li>
- Create a <code>Bundle</code> and put the title and body text into it using the
- constants defined in Notepadv2 as keys:<br>
- <pre>
-Bundle bundle = new Bundle();
-
-bundle.putString(NotesDbAdapter.KEY_TITLE, mTitleText.getText().toString());
-bundle.putString(NotesDbAdapter.KEY_BODY, mBodyText.getText().toString());
-if (mRowId != null) {
- bundle.putLong(NotesDbAdapter.KEY_ROWID, mRowId);
-}</pre>
- </li>
- <li>
- Set the result information (the Bundle) in a new Intent and finish the Activity:
- <pre>
-Intent mIntent = new Intent();
-mIntent.putExtras(bundle);
-setResult(RESULT_OK, mIntent);
-finish();</pre>
- <ul>
- <li>The Intent is simply our data carrier that carries our Bundle
- (with the title, body and mRowId).</li>
- <li>The <code>setResult()</code> method is used to set the result
- code and return Intent to be passed back to the
- Intent caller. In this case everything worked, so we return RESULT_OK for the
- result code.</li>
- <li>The <code>finish()</code> call is used to signal that the Activity
- is done (like a return call). Anything set in the Result will then be
- returned to the caller, along with execution control.</li>
- </ul>
- </li>
- </ol>
- <p>The full <code>onCreate()</code> method (plus supporting class fields) should
- now look like this:</p>
- <pre>
-private EditText mTitleText;
-private EditText mBodyText;
-private Long mRowId;
-
-@Override
-protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.note_edit);
-
- mTitleText = (EditText) findViewById(R.id.title);
- mBodyText = (EditText) findViewById(R.id.body);
-
- Button confirmButton = (Button) findViewById(R.id.confirm);
-
- mRowId = null;
- Bundle extras = getIntent().getExtras();
- if (extras != null) {
- String title = extras.getString(NotesDbAdapter.KEY_TITLE);
- String body = extras.getString(NotesDbAdapter.KEY_BODY);
- mRowId = extras.getLong(NotesDbAdapter.KEY_ROWID);
-
- if (title != null) {
- mTitleText.setText(title);
- }
- if (body != null) {
- mBodyText.setText(body);
- }
- }
-
- confirmButton.setOnClickListener(new View.OnClickListener() {
-
- public void onClick(View view) {
- Bundle bundle = new Bundle();
-
- bundle.putString(NotesDbAdapter.KEY_TITLE, mTitleText.getText().toString());
- bundle.putString(NotesDbAdapter.KEY_BODY, mBodyText.getText().toString());
- if (mRowId != null) {
- bundle.putLong(NotesDbAdapter.KEY_ROWID, mRowId);
- }
-
- Intent mIntent = new Intent();
- mIntent.putExtras(bundle);
- setResult(RESULT_OK, mIntent);
- finish();
- }
- });
-}</pre>
- </li>
- </ol>
-
-<h2>Step 11</h2>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>The All-Important Android Manifest File</h2>
- <p>The AndroidManifest.xml file is the way in which Android sees your
- application. This file defines the category of the application, where
- it shows up (or even if it shows up) in the launcher or settings, what
- activities, services, and content providers it defines, what intents it can
- receive, and more. </p>
- <p>For more information, see the reference document
- <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml
-File</a></p>
- </div>
- </div>
-
-<p>Finally, the new Activity has to be defined in the manifest file:</p>
- <p>Before the new Activity can be seen by Android, it needs its own
- Activity entry in the <code>AndroidManifest.xml</code> file. This is to let
- the system know that it is there and can be called. We could also specify
- which IntentFilters the activity implements here, but we are going to skip
- this for now and just let Android know that the Activity is
- defined.</p>
- <p>There is a Manifest editor included in the Eclipse plugin that makes it much easier
- to edit the AndroidManifest file, and we will use this. If you prefer to edit the file directly
- or are not using the Eclipse plugin, see the box at the end for information on how to do this
- without using the new Manifest editor.<p>
- <ol>
- <li>Double click on the <code>AndroidManifest.xml</code> file in the package explorer to open it.
- </li>
- <li>Click the <strong>Application</strong> tab at the bottom of the Manifest editor.</li>
- <li>Click <strong>Add...</strong> in the Application Nodes section.
- <p>If you see a dialog with radiobuttons at the top, select the top radio button:
- "Create a new element at the top level, in Application".</p></li>
- <li>Make sure "(A) Activity" is selected in the selection pane of the dialog, and click <strong>OK</strong>.</li>
- <li>Click on the new "Activity" node, in the Application Nodes section, then
- type <code>.NoteEdit</code> into the <em>Name*</em>
- field to the right. Press Return/Enter.</li>
- </ol>
- <p>The Android Manifest editor helps you add more complex entries into the AndroidManifest.xml
- file, have a look around at some of the other options available (but be careful not to select
- them otherwise they will be added to your Manifest). This editor should help you understand
- and alter the AndroidManifest.xml file as you move on to more advanced Android applications.</p>
-
- <p class="note">If you prefer to edit this file directly, simply open the
- <code>AndroidManifest.xml</code> file and look at the source (use the
- <code>AndroidManifest.xml</code> tab in the eclipse editor to see the source code directly).
- Then edit the file as follows:<br>
- <code><activity android:name=".NoteEdit" /></code><br><br>
- This should be placed just below the line that reads:<br>
- <code></activity></code> for the <code>.Notepadv2</code> activity.</p>
-
-<h2 style="clear:right;">Step 12</h2>
-
-<p>Now Run it!</p>
-<p>You should now be able to add real notes from
-the menu, as well as delete an existing one. Notice that in order to delete, you must
-first use the directional controls on the device to highlight the note.
-Furthermore, selecting a note title from the list should bring up the note
-editor to let you edit it. Press confirm when finished to save the changes
-back to the database.
-
-<h2>Solution and Next Steps</h2>
-
-<p>You can see the solution to this exercise in <code>Notepadv2Solution</code>
-from the zip file to compare with your own.</p>
-<p>Now try editing a note, and then hitting the back button on the emulator
-instead of the confirm button (the back button is below the menu button). You
-will see an error come up. Clearly our application still has some problems.
-Worse still, if you did make some changes and hit the back button, when you go
-back into the notepad to look at the note you changed, you will find that all
-your changes have been lost. In the next exercise we will fix these
-problems.</p>
-
-<p>
-Once you are ready, move on to <a href="notepad-ex3.html">Tutorial
-Exercise 3</a> where you will fix the problems with the back button and lost
-edits by introducing a proper life cycle into the NoteEdit Activity.</p>
-
-
diff --git a/docs/html/guide/tutorials/notepad/notepad-ex3.jd b/docs/html/guide/tutorials/notepad/notepad-ex3.jd
deleted file mode 100644
index 557738e..0000000
--- a/docs/html/guide/tutorials/notepad/notepad-ex3.jd
+++ /dev/null
@@ -1,366 +0,0 @@
-page.title=Notepad Exercise 3
-parent.title=Notepad Tutorial
-parent.link=index.html
-@jd:body
-
-
-<p><em>In this exercise, you will use life-cycle event callbacks to store and
-retrieve application state data. This exercise demonstrates:</em></p>
-<ul>
-<li><em>Life-cycle events and how your application can use them</em></li>
-<li><em>Techniques for maintaining application state</em></li>
-</ul>
-
-<div style="float:right;white-space:nowrap">
- [<a href="notepad-ex1.html">Exercise 1</a>]
- [<a href="notepad-ex2.html">Exercise 2</a>]
- <span style="color:#BBB;">
- [<a href="notepad-ex3.html" style="color:#BBB;">Exercise 3</a>]
- </span>
- [<a href="notepad-extra-credit.html">Extra Credit</a>]
-</div>
-
-<h2>Step 1</h2>
-
-<p>Import <code>Notepadv3</code> into Eclipse. If you see an error about
-<code>AndroidManifest.xml,</code> or some problems related to an Android zip
-file, right click on the project and select <strong>Android Tools</strong> >
-<strong>Fix Project Properties</strong> from the popup menu. The starting point for this exercise is
-exactly where we left off at the end of the Notepadv2. </p>
-<p>The current application has some problems — hitting the back button when editing
-causes a crash, and anything else that happens during editing will cause the
-edits to be lost.</p>
-<p>To fix this, we will move most of the functionality for creating and editing
-the note into the NoteEdit class, and introduce a full life cycle for editing
-notes.</p>
-
- <ol>
- <li>Remove the code in <code>NoteEdit</code> that parses the title and body
- from the extras Bundle.
- <p>Instead, we are going to use the <code>DBHelper</code> class
- to access the notes from the database directly. All we need passed into the
- NoteEdit Activity is a <code>mRowId</code> (but only if we are editing, if creating we pass
- nothing). Remove these lines:</p>
- <pre>
-String title = extras.getString(NotesDbAdapter.KEY_TITLE);
-String body = extras.getString(NotesDbAdapter.KEY_BODY);</pre>
- </li>
- <li>We will also get rid of the properties that were being passed in
- the <code>extras</code> Bundle, which we were using to set the title
- and body text edit values in the UI. So delete:
- <pre>
-if (title != null) {
- mTitleText.setText(title);
-}
-if (body != null) {
- mBodyText.setText(body);
-}</pre>
- </li>
- </ol>
-
-<h2>Step 2</h2>
-
-<p>Create a class field for a <code>NotesDbAdapter</code> at the top of the NoteEdit class:</p>
- <pre> private NotesDbAdapter mDbHelper;</pre>
-<p>Also add an instance of <code>NotesDbAdapter</code> in the
- <code>onCreate()</code> method (right below the <code>super.onCreate()</code> call):</p>
- <pre>
- mDbHelper = new NotesDbAdapter(this);<br>
- mDbHelper.open();</pre>
-
-<h2>Step 3</h2>
-
-<p>In <code>NoteEdit</code>, we need to check the <var>savedInstanceState</var> for the
-<code>mRowId</code>, in case the note
- editing contains a saved state in the Bundle, which we should recover (this would happen
- if our Activity lost focus and then restarted).</p>
- <ol>
- <li>
- Replace the code that currently initializes the <code>mRowId</code>:<br>
- <pre>
- mRowId = null;
-
- Bundle extras = getIntent().getExtras();
- if (extras != null) {
- mRowId = extras.getLong(NotesDbAdapter.KEY_ROWID);
- }
- </pre>
- with this:
- <pre>
- mRowId = (savedInstanceState == null) ? null :
- (Long) savedInstanceState.getSerializable(NotesDbAdapter.KEY_ROWID);
- if (mRowId == null) {
- Bundle extras = getIntent().getExtras();
- mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID)
- : null;
- }
- </pre>
- </li>
- <li>
- Note the null check for <code>savedInstanceState</code>, and we still need to load up
- <code>mRowId</code> from the <code>extras</code> Bundle if it is not
- provided by the <code>savedInstanceState</code>. This is a ternary operator shorthand
- to safely either use the value or null if it is not present.
- </li>
- <li>
- Note the use of <code>Bundle.getSerializable()</code> instead of
- <code>Bundle.getLong()</code>. The latter encoding returns a <code>long</code> primitive and
- so can not be used to represent the case when <code>mRowId</code> is <code>null</code>.
- </li>
- </ol>
-
-<h2>Step 4</h2>
-
-<p>Next, we need to populate the fields based on the <code>mRowId</code> if we
- have it:</p>
- <pre>populateFields();</pre>
- <p>This goes before the <code>confirmButton.setOnClickListener()</code> line.
- We'll define this method in a moment.</p>
-
-<h2>Step 5</h2>
-
-<p>Get rid of the Bundle creation and Bundle value settings from the
- <code>onClick()</code> handler method. The Activity no longer needs to
- return any extra information to the caller. And because we no longer have
- an Intent to return, we'll use the shorter version
- of <code>setResult()</code>:</p>
- <pre>
-public void onClick(View view) {
- setResult(RESULT_OK);
- finish();
-}</pre>
- <p>We will take care of storing the updates or new notes in the database
- ourselves, using the life-cycle methods.</p>
-
- <p>The whole <code>onCreate()</code> method should now look like this:</p>
- <pre>
-super.onCreate(savedInstanceState);
-
-mDbHelper = new NotesDbAdapter(this);
-mDbHelper.open();
-
-setContentView(R.layout.note_edit);
-
-mTitleText = (EditText) findViewById(R.id.title);
-mBodyText = (EditText) findViewById(R.id.body);
-
-Button confirmButton = (Button) findViewById(R.id.confirm);
-
-mRowId = (savedInstanceState == null) ? null :
- (Long) savedInstanceState.getSerializable(NotesDbAdapter.KEY_ROWID);
-if (mRowId == null) {
- Bundle extras = getIntent().getExtras();
- mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID)
- : null;
-}
-
-populateFields();
-
-confirmButton.setOnClickListener(new View.OnClickListener() {
-
- public void onClick(View view) {
- setResult(RESULT_OK);
- finish();
- }
-
-});</pre>
-
-<h2>Step 6</h2>
-
-<p>Define the <code>populateFields()</code> method.</p>
- <pre>
-private void populateFields() {
- if (mRowId != null) {
- Cursor note = mDbHelper.fetchNote(mRowId);
- startManagingCursor(note);
- mTitleText.setText(note.getString(
- note.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE)));
- mBodyText.setText(note.getString(
- note.getColumnIndexOrThrow(NotesDbAdapter.KEY_BODY)));
- }
-}</pre>
-<p>This method uses the <code>NotesDbAdapter.fetchNote()</code> method to find the right note to
-edit, then it calls <code>startManagingCursor()</code> from the <code>Activity</code> class, which
-is an Android convenience method provided to take care of the Cursor life-cycle. This will release
-and re-create resources as dictated by the Activity life-cycle, so we don't need to worry about
-doing that ourselves. After that, we just look up the title and body values from the Cursor
-and populate the View elements with them.</p>
-
-
-<h2>Step 7</h2>
-
- <div class="sidebox-wrapper">
- <div class="sidebox">
- <h2>Why handling life-cycle events is important</h2>
- <p>If you are used to always having control in your applications, you
- might not understand why all this life-cycle work is necessary. The reason
- is that in Android, you are not in control of your Activity, the
- operating system is!</p>
- <p>As we have already seen, the Android model is based around activities
- calling each other. When one Activity calls another, the current Activity
- is paused at the very least, and may be killed altogether if the
- system starts to run low on resources. If this happens, your Activity will
- have to store enough state to come back up later, preferably in the same
- state it was in when it was killed.</p>
- <p>
- Activities have a <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">well-defined life
-cycle</a>.
- Lifecycle events can happen even if you are not handing off control to
- another Activity explicitly. For example, perhaps a call comes in to the
- handset. If this happens, and your Activity is running, it will be swapped
- out while the call Activity takes over.</p>
- </div>
- </div>
-
-<p>Still in the <code>NoteEdit</code> class, we now override the methods
- <code>onSaveInstanceState()</code>, <code>onPause()</code> and
- <code>onResume()</code>. These are our life-cycle methods
- (along with <code>onCreate()</code> which we already have).</p>
-
-<p><code>onSaveInstanceState()</code> is called by Android if the
- Activity is being stopped and <strong>may be killed before it is
- resumed!</strong> This means it should store any state necessary to
- re-initialize to the same condition when the Activity is restarted. It is
- the counterpart to the <code>onCreate()</code> method, and in fact the
- <code>savedInstanceState</code> Bundle passed in to <code>onCreate()</code> is the same
- Bundle that you construct as <code>outState</code> in the
- <code>onSaveInstanceState()</code> method.</p>
-
-<p><code>onPause()</code> and <code>onResume()</code> are also
- complimentary methods. <code>onPause()</code> is always called when the
- Activity ends, even if we instigated that (with a <code>finish()</code> call for example).
- We will use this to save the current note back to the database. Good
- practice is to release any resources that can be released during an
- <code>onPause()</code> as well, to take up less resources when in the
- passive state. <code>onResume()</code> will call our <code>populateFields()</code> method
- to read the note out of the database again and populate the fields.</p>
-
-<p>So, add some space after the <code>populateFields()</code> method
- and add the following life-cycle methods:</p>
- <ol type="a">
- <li><code>
- onSaveInstanceState()</code>:
- <pre>
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- saveState();
- outState.putSerializable(NotesDbAdapter.KEY_ROWID, mRowId);
- }</pre>
- <p>We'll define <code>saveState()</code> next.</p>
- </li>
- <li><code>
- onPause()</code>:
- <pre>
- @Override
- protected void onPause() {
- super.onPause();
- saveState();
- }</pre>
- </li>
- <li><code>
- onResume()</code>:
- <pre>
- @Override
- protected void onResume() {
- super.onResume();
- populateFields();
- }</pre>
- </li>
- </ol>
-<p>Note that <code>saveState()</code> must be called in both <code>onSaveInstanceState()</code>
-and <code>onPause()</code> to ensure that the data is saved. This is because there is no
-guarantee that <code>onSaveInstanceState()</code> will be called and because when it <em>is</em>
-called, it is called before <code>onPause()</code>.</p>
-
-
-<h2 style="clear:right;">Step 8</h2>
-
-<p>Define the <code>saveState()</code> method to put the data out to the
-database.</p>
- <pre>
- private void saveState() {
- String title = mTitleText.getText().toString();
- String body = mBodyText.getText().toString();
-
- if (mRowId == null) {
- long id = mDbHelper.createNote(title, body);
- if (id > 0) {
- mRowId = id;
- }
- } else {
- mDbHelper.updateNote(mRowId, title, body);
- }
- }</pre>
- <p>Note that we capture the return value from <code>createNote()</code> and if a valid row ID is
- returned, we store it in the <code>mRowId</code> field so that we can update the note in future
- rather than create a new one (which otherwise might happen if the life-cycle events are
- triggered).</p>
-
-
-<h2 style="clear:right;">Step 9</h2>
-
-<p>Now pull out the previous handling code from the
- <code>onActivityResult()</code> method in the <code>Notepadv3</code>
- class.</p>
-<p>All of the note retrieval and updating now happens within the
- <code>NoteEdit</code> life cycle, so all the <code>onActivityResult()</code>
- method needs to do is update its view of the data, no other work is
- necessary. The resulting method should look like this:</p>
-<pre>
-@Override
-protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
- super.onActivityResult(requestCode, resultCode, intent);
- fillData();
-}</pre>
-
-<p>Because the other class now does the work, all this has to do is refresh
- the data.</p>
-
-<h2>Step 10</h2>
-
-<p>Also remove the lines which set the title and body from the
- <code>onListItemClick()</code> method (again they are no longer needed,
- only the <code>mRowId</code> is):</p>
-<pre>
- Cursor c = mNotesCursor;
- c.moveToPosition(position);</pre>
-<br>
-and also remove:
-<br>
-<pre>
- i.putExtra(NotesDbAdapter.KEY_TITLE, c.getString(
- c.getColumnIndex(NotesDbAdapter.KEY_TITLE)));
- i.putExtra(NotesDbAdapter.KEY_BODY, c.getString(
- c.getColumnIndex(NotesDbAdapter.KEY_BODY)));</pre>
-<br>
-so that all that should be left in that method is:
-<br>
-<pre>
- super.onListItemClick(l, v, position, id);
- Intent i = new Intent(this, NoteEdit.class);
- i.putExtra(NotesDbAdapter.KEY_ROWID, id);
- startActivityForResult(i, ACTIVITY_EDIT);</pre>
-
- <p>You can also now remove the mNotesCursor field from the class, and set it back to using
- a local variable in the <code>fillData()</code> method:
-<br><pre>
- Cursor notesCursor = mDbHelper.fetchAllNotes();</pre></p>
- <p>Note that the <code>m</code> in <code>mNotesCursor</code> denotes a member field, so when we
- make <code>notesCursor</code> a local variable, we drop the <code>m</code>. Remember to rename the
- other occurrences of <code>mNotesCursor</code> in your <code>fillData()</code> method.
-</ol>
-<p>
-Run it! (use <em>Run As -> Android Application</em> on the project right
-click menu again)</p>
-
-<h2>Solution and Next Steps</h2>
-
-<p>You can see the solution to this exercise in <code>Notepadv3Solution</code>
-from
-the zip file to compare with your own.</p>
-<p>
-When you are ready, move on to the <a href="notepad-extra-credit.html">Tutorial
-Extra Credit</a> exercise, where you can use the Eclipse debugger to
-examine the life-cycle events as they happen.</p>
diff --git a/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd b/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd
deleted file mode 100644
index 34f7063..0000000
--- a/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd
+++ /dev/null
@@ -1,70 +0,0 @@
-page.title=Notepad Extra Credit
-parent.title=Notepad Tutorial
-parent.link=index.html
-@jd:body
-
-
-<p><em>In this exercise, you will use the debugger to look at the work you did
-in Exercise 3. This exercise demonstrates:</em></p>
-<ul>
-<li><em>How to set breakpoints to observe execution</em> </li>
-<li><em>How to run your application in debug mode</code></em></li>
-</ul>
-
-<div style="float:right;white-space:nowrap">
-
- [<a href="notepad-ex1.html">Exercise 1</a>]
- [<a href="notepad-ex2.html">Exercise 2</a>]
- [<a href="notepad-ex3.html">Exercise 3</a>]
- <span style="color:#BBB;">
- [<a href="notepad-extra-credit.html" style="color:#BBB;">Extra Credit</a>]
- </span>
-</div>
-
-<h2>Step 1</h2>
-
-<p>Using the working <code>Notepadv3</code>, put breakpoints in the code at the
- beginning of the <code>onCreate()</code>, <code>onPause()</code>,
- <code>onSaveInstanceState()</code> and <code>onResume()</code> methods in the
- <code>NoteEdit</code> class (if you are not familiar with Eclipse, just
- right click in the narrow grey border on the left of the edit window at the
- line you want a breakpoint, and select <em>Toggle Breakpoint</em>, you
-should see a blue dot appear).</p>
-
-<h2>Step 2</h2>
-
-<p>Now start the notepad demo in debug mode:</p>
-
-<ol type="a">
- <li>
- Right click on the <code>Notepadv3</code> project and from the Debug menu
- select <em>Debug As -> Android Application.</em></li>
- <li>
- The Android emulator should say <em>"waiting for debugger to connect"</em>
- briefly and then run the application.</li>
- <li>
- If it gets stuck on the waiting... screen, quit the emulator and Eclipse,
- from the command line do an <code>adb kill-server</code>, and then restart
-Eclipse and try again.</li></ol>
-
- <h2>Step 3</h2>
-
-<p>When you edit or create a new note you should see the breakpoints getting
- hit and the execution stopping.</p>
-
- <h2>Step 4</h2>
-
-<p>Hit the Resume button to let execution continue (yellow rectangle with a
-green triangle to its right in the Eclipse toolbars near the top).</p>
-
-<h2>Step 5</h2>
-
-<p>Experiment a bit with the confirm and back buttons, and try pressing Home and
- making other mode changes. Watch what life-cycle events are generated and
-when.</p>
-
-<p>The Android Eclipse plugin not only offers excellent debugging support for
-your application development, but also superb profiling support. You can also
-try using <a href="{@docRoot}guide/developing/debugging/debugging-tracing.html">Traceview</a> to profile your application. If your application is running too slow, this can help you
-find the bottlenecks and fix them.</p>
-
diff --git a/docs/html/guide/tutorials/notepad/notepad-index.jd b/docs/html/guide/tutorials/notepad/notepad-index.jd
deleted file mode 100644
index 151c50d..0000000
--- a/docs/html/guide/tutorials/notepad/notepad-index.jd
+++ /dev/null
@@ -1,143 +0,0 @@
-page.title=Notepad Tutorial
-@jd:body
-
-
-<p>The tutorial in this section gives you a "hands-on" introduction
-to the Android framework and the tools you use to build applications on it.
-Starting from a preconfigured project file, it guides you through the process of
-developing a simple notepad application and provides concrete examples of how to
-set up the project, develop the application logic and user interface, and then
-compile and run the application. </p>
-
-<p>The tutorial presents the notepad application development as a set of
-exercises (see below), each consisting of several steps. You can follow along
-with the steps in each exercise and gradually build up and refine your
-application. The exercises explain each step in detail and provide all the
-sample code you need to complete the application. </p>
-
-<p>When you are finished with the tutorial, you will have created a functioning
-Android application and learned in depth about many of the most important
-concepts in Android development. If you want to add more complex features to
-your application, you can examine the code in an alternative implementation
-of a notepad application, in the
-<a href="{@docRoot}samples/NotePad/index.html">Sample Code</a> documentation. </p>
-
-
-<a name="who"></a>
-<h2>Who Should Use this Tutorial</h2>
-
-<p>This tutorial is designed for experienced developers, especially those with
-knowledge of the Java programming language. If you haven't written Java
-applications before, you can still use the tutorial, but you might need to work
-at a slower pace. </p>
-
-<p>The tutorial assumes that you have some familiarity with the basic Android
-application concepts and terminology. If you aren't yet familiar with those, you
-should read <a href="{@docRoot}intro/anatomy.html">Overview of an Android
-Application</a> before continuing. </p>
-
-<p>Also note that this tutorial uses
-the Eclipse development environment, with the Android plugin installed. If you
-are not using Eclipse, you can follow the exercises and build the application,
-but you will need to determine how to accomplish the Eclipse-specific
-steps in your environment. </p>
-
-<a name="preparing"></a>
-<h2>Preparing for the Exercises</h2>
-
-<p>This tutorial builds on the information provided in the <a
-href="{@docRoot}intro/installing.html">Installing the SDK</a> and <a
-href="{@docRoot}intro/hello-android.html">Hello Android</a>
-documents, which explain in detail how to set up your development environment
-for building Android applications. Before you start this tutorial, you should
-read both these documents, have the SDK installed, and your work environment set up.</p>
-
-<p>To prepare for this lesson:</p>
-
-<ol>
- <li>Download the <a href="codelab/NotepadCodeLab.zip">project
- exercises archive (.zip)</a></li>
- <li>Unpack the archive file to a suitable location on your machine</li>
- <li>Open the <code>NotepadCodeLab</code> folder</li>
-</ol>
-
-<p>Inside the <code>NotepadCodeLab</code> folder, you should see six project
-files: <code>Notepadv1</code>,
- <code>Notepadv2</code>, <code>Notepadv3</code>,
- <code>Notepadv1Solution</code>, <code>Notepadv2Solution</code>
- and <code>Notepadv3Solution</code>. The <code>Notepadv#</code> projects are
-the starting points for each of the exercises, while the
-<code>Notepadv#Solution</code> projects are the exercise
- solutions. If you are having trouble with a particular exercise, you
- can compare your current work against the exercise solution.</p>
-
-<a name="exercises"></a>
-<h2> Exercises</h2>
-
- <p>The table below lists the tutorial exercises and describes the development
-areas that each covers. Each exercise assumes that you have completed any
-previous exercises.</p>
-
- <table border="0" style="padding:4px;spacing:2px;" summary="This
-table lists the
-tutorial examples and describes what each covers. ">
- <tr>
- <th width="120"><a href="{@docRoot}intro/tutorial-ex1.html">Exercise
-1</a></th>
- <td>Start here. Construct a simple notes list that lets the user add new notes but not
-edit them. Demonstrates the basics of <code>ListActivity</code> and creating
-and handling
- menu options. Uses a SQLite database to store the notes.</td>
- </tr>
- <tr>
- <th><a href="{@docRoot}intro/tutorial-ex2.html">Exercise 2</a></th>
- <td>Add a second Activity to the
-application. Demonstrates constructing a
-new Activity, adding it to the Android manifest, passing data between the
-activities, and using more advanced screen layout. Also shows how to
-invoke another Activity to return a result, using
-<code>startActivityForResult()</code>.</td>
- </tr>
- <tr>
- <th><a href="{@docRoot}intro/tutorial-ex3.html">Exercise 3</a></th>
- <td>Add handling of life-cycle events to
-the application, to let it
-maintain application state across the life cycle. </td>
- </tr>
- <tr>
- <th><a href="{@docRoot}intro/tutorial-extra-credit.html">Extra
-Credit</a></th>
- <td>Demonstrates how to use the Eclipse
-debugger and how you can use it to
-view life-cycle events as they are generated. This section is optional but
-highly recommended.</td>
- </tr>
-</table>
-
-
-<a name="other"></a>
-<h2>Other Resources and Further Learning</h2>
-<ul>
-<li>For a lighter but broader introduction to concepts not covered in the
-tutorial,
-take a look at <a href="{@docRoot}kb/commontasks.html">Common Android Tasks</a>.</li>
-<li>The Android SDK includes a variety of fully functioning sample applications
-that make excellent opportunities for further learning. You can find the sample
-applications in the <code>samples/</code> directory of your downloaded SDK.</li>
-<li>This tutorial draws from the full Notepad application included in the
-<code>samples/</code> directory of the SDK, though it does not match it exactly.
-When you are done with the tutorial,
-it is highly recommended that you take a closer look at this version of the Notepad
-application,
-as it demonstrates a variety of interesting additions for your application,
-such as:</li>
- <ul>
- <li>Setting up a custom striped list for the list of notes.</li>
- <li>Creating a custom text edit view that overrides the <code>draw()</code>
-method to
- make it look like a lined notepad.</li>
- <li>Implementing a full <code>ContentProvider</code> for notes.</li>
- <li>Reverting and discarding edits instead of just automatically saving
-them.</li>
-</ul>
-</ul>
diff --git a/docs/html/guide/tutorials/views/hello-autocomplete.jd b/docs/html/guide/tutorials/views/hello-autocomplete.jd
deleted file mode 100644
index 07235a1..0000000
--- a/docs/html/guide/tutorials/views/hello-autocomplete.jd
+++ /dev/null
@@ -1,116 +0,0 @@
-page.title=Hello, AutoCompleteTextView
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>{@link android.widget.AutoCompleteTextView} is an implementation of the EditText widget that will provide
-auto-complete suggestions as the user types. The suggestions are extracted from a collection of strings.</p>
-
-
-<ol>
- <li>Start a new project/Activity called HelloAutoComplete.</li>
- <li>Open the layout file.
- Make it like so:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Country" />
-
- <AutoCompleteTextView android:id="@+id/edit"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"/>
-
-</LinearLayout>
-</pre>
-</li>
-
-<li>Open HelloAutoComplete.java and insert the following as the <code>onCreate</code> method:
-<pre>
-@Override
-protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit);
- ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
- android.R.layout.simple_dropdown_item_1line, COUNTRIES);
- textView.setAdapter(adapter);
-}
-</pre>
- <p>Here, we create an AutoCompleteTextView from our layout. We then
- create an {@link android.widget.ArrayAdapter} that binds a <code>simple_dropdown_item_1line</code>
- layout item to each entry in the <code>COUNTRIES</code> array (which we'll add next).
- The last part sets the ArrayAdapter to associate with our AutoCompleteTextView.</p>
-</li>
-
-<li>After the <code>onCreate()</code> method, add the String array:
-<pre>
-static final String[] COUNTRIES = new String[] {
- "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
- "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",
- "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan",
- "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
- "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
- "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory",
- "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi",
- "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde",
- "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
- "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
- "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic",
- "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic",
- "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea",
- "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland",
- "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia",
- "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar",
- "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau",
- "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary",
- "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica",
- "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos",
- "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg",
- "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands",
- "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova",
- "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia",
- "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand",
- "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas",
- "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru",
- "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar",
- "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena",
- "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon",
- "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal",
- "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands",
- "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea",
- "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden",
- "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas",
- "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey",
- "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda",
- "Ukraine", "United Arab Emirates", "United Kingdom",
- "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan",
- "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara",
- "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
-};
-</pre>
- <p>This is the list of suggestions that will be offered as the user types into the
- AutoCompleteTextView.</p>
-</li>
-
-<li>Now run it.</li>
-</ol>
-<p>As you type, you should see something like this:</p>
-<img src="images/hello-autocomplete.png" width="150px" />
-
-
-<h3>References</h3>
-<ul>
- <li>{@link android.R.layout}</li>
- <li>{@link android.widget.ArrayAdapter}</li>
- <li>{@link android.widget.AutoCompleteTextView}</li>
-</ul>
-
-
diff --git a/docs/html/guide/tutorials/views/hello-datepicker.jd b/docs/html/guide/tutorials/views/hello-datepicker.jd
deleted file mode 100644
index fcd43f3..0000000
--- a/docs/html/guide/tutorials/views/hello-datepicker.jd
+++ /dev/null
@@ -1,151 +0,0 @@
-page.title=Hello, DatePicker
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>A {@link android.widget.DatePicker} is a widget that allows the user to select a month, day and year.</p>
-
-
-<ol>
- <li>Start a new project/Activity called HelloDatePicker.</li>
- <li>Open the layout file and make it like so:
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView android:id="@+id/dateDisplay"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text=""/>
-
- <Button android:id="@+id/pickDate"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Change the date"/>
-
-</LinearLayout>
-</pre>
- <p>For the layout, we're using a vertical LinearLayout, with a {@link android.widget.TextView} that
- will display the date and a {@link android.widget.Button} that will initiate the DatePicker dialog.
- With this layout, the TextView will sit above the Button.
- The text value in the TextView is set empty, as it will be filled
- with the current date when our Activity runs.</p>
- </li>
-
- <li>Open HelloDatePicker.java. Insert the following to the HelloDatePicker class:
-<pre>
- private TextView mDateDisplay;
- private Button mPickDate;
-
- private int mYear;
- private int mMonth;
- private int mDay;
-
- static final int DATE_DIALOG_ID = 0;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- // capture our View elements
- mDateDisplay = (TextView) findViewById(R.id.dateDisplay);
- mPickDate = (Button) findViewById(R.id.pickDate);
-
- // add a click listener to the button
- mPickDate.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- showDialog(DATE_DIALOG_ID);
- }
- });
-
- // get the current date
- final Calendar c = Calendar.getInstance();
- mYear = c.get(Calendar.YEAR);
- mMonth = c.get(Calendar.MONTH);
- mDay = c.get(Calendar.DAY_OF_MONTH);
-
- // display the current date
- updateDisplay();
- }
-</pre>
-<p class="note"><strong>Tip:</strong> Press Ctrl(or Cmd) + Shift + O to import all needed packages.</p>
- <p>We start by instantiating variables for our Views and date fields.
- The <code>DATE_DIALOG_ID</code> is a static integer that uniquely identifies the Dialog. In the
- <code>onCreate()</code> method, we get prepared by setting the layout and capturing the View elements.
- Then we create an on-click listener for the Button, so that when it is clicked it will
- show our DatePicker dialog. The <code>showDialog()</code> method will pop-up the date picker dialog
- by calling the <code>onCreateDialog()</code> callback method
- (which we'll define in the next section). We then create an
- instance of {@link java.util.Calendar} and get the current year, month and day. Finally, we call
- <code>updateDisplay()</code>—our own method (defined later) that will fill the TextView.</p>
-</li>
-
-<li>After the <code>onCreate()</code> method, add the <code>onCreateDialog()</code> callback method
-(which is called by <code>showDialog()</code>)
-<pre>
-@Override
-protected Dialog onCreateDialog(int id) {
- switch (id) {
- case DATE_DIALOG_ID:
- return new DatePickerDialog(this,
- mDateSetListener,
- mYear, mMonth, mDay);
- }
- return null;
-}
-</pre>
- <p>This method is passed the identifier we gave <code>showDialog()</code> and initializes
- the DatePicker to the date we retrieved from our Calendar instance.</p>
-</li>
-
-<li>Following that, add the <code>updateDisplay()</code> method:
-<pre>
- // updates the date we display in the TextView
- private void updateDisplay() {
- mDateDisplay.setText(
- new StringBuilder()
- // Month is 0 based so add 1
- .append(mMonth + 1).append("-")
- .append(mDay).append("-")
- .append(mYear).append(" "));
- }
-</pre>
-<p>This uses the member date values to write the date to our TextView.</p>
-</li>
-<li>Finally, add a listener that will be called when the user sets a new date:
-<pre>
- // the callback received when the user "sets" the date in the dialog
- private DatePickerDialog.OnDateSetListener mDateSetListener =
- new DatePickerDialog.OnDateSetListener() {
-
- public void onDateSet(DatePicker view, int year,
- int monthOfYear, int dayOfMonth) {
- mYear = year;
- mMonth = monthOfYear;
- mDay = dayOfMonth;
- updateDisplay();
- }
- };
-</pre>
- <p>This <code>OnDateSetListener</code> method listens for when the user is done setting the date
- (clicks the "Set" button). At that time, this fires and we update our member fields with
- the new date defined by the user and update our TextView by calling <code>updateDisplay()</code>.</p>
-</li>
-
-<li>Now run it.</li>
-</ol>
-<p>When you press the "Change the date" button, you should see the following:</p>
-<img src="images/hello-datepicker.png" width="150px" />
-
-<h3>References</h3>
-<ul>
-<li>{@link android.widget.DatePicker}</li>
-<li>{@link android.widget.Button}</li>
-<li>{@link android.widget.TextView}</li>
-<li>{@link java.util.Calendar}</li>
-</ul>
-
diff --git a/docs/html/guide/tutorials/views/hello-formstuff.jd b/docs/html/guide/tutorials/views/hello-formstuff.jd
deleted file mode 100644
index b554001..0000000
--- a/docs/html/guide/tutorials/views/hello-formstuff.jd
+++ /dev/null
@@ -1,262 +0,0 @@
-page.title=Hello, Form Stuff
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>This page introduces a variety of widgets, like image buttons,
-text fields, checkboxes and radio buttons.</p>
-
-
-<ol>
- <li>Start a new project/Activity called HelloFormStuff.</li>
- <li>Your layout file should have a basic LinearLayout:
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
-
-</LinearLayout>
-</pre>
- <p>For each widget you want to add, just put the respective View inside here.</p>
-</li>
-</ol>
-<p class="note"><strong>Tip:</strong> As you add new Android code, press Ctrl(or Cmd) + Shift + O
-to import all needed packages.</p>
-
-
-<h2>ImageButton</h2>
-<p>A button with a custom image on it.
-We'll make it display a message when pressed.</p>
-<ol>
- <li><img src="images/android.png" align="right"/>
- Drag the Android image on the right (or your own image) into the
- res/drawable/ directory of your project.
- We'll use this for the button.</li>
- <li>Open the layout file and, inside the LinearLayout, add the {@link android.widget.ImageButton} element:
-<pre>
-<ImageButton
- android:id="@+id/android_button"
- android:layout_width="100dip"
- android:layout_height="wrap_content"
- android:src="@drawable/android" />
-</pre>
- <p>The source of the button
- is from the res/drawable/ directory, where we've placed the android.png.</p>
- <p class="note"><strong>Tip:</strong> You can also reference some of the many built-in
- images from the Android {@link android.R.drawable} resources,
- like <code>ic_media_play</code>, for a "play" button image. To do so, change the source
- attribute to <code>android:src="@android:drawable/ic_media_play"</code>.</p>
-</li>
-<li>To make the button to actually do something, add the following
-code at the end of the <code>onCreate()</code> method:
-<pre>
-final ImageButton button = (ImageButton) findViewById(R.id.android_button);
-button.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- // Perform action on clicks
- Toast.makeText(HelloFormStuff.this, "Beep Bop", Toast.LENGTH_SHORT).show();
- }
-});
-</pre>
-<p>This captures our ImageButton from the layout, then adds an on-click listener to it.
-The {@link android.view.View.OnClickListener} must define the <code>onClick()</code> method, which
-defines the action to be made when the button is clicked. Here, we show a
-{@link android.widget.Toast} message when clicked.</p>
-</li>
-<li>Run it.</li>
-</ol>
-
-
-<h2>EditText</h2>
-<p>A text field for user input. We'll make it display the text entered so far when the "Enter" key is pressed.</p>
-
-<ol>
- <li>Open the layout file and, inside the LinearLayout, add the {@link android.widget.EditText} element:
-<pre>
-<EditText
- android:id="@+id/edittext"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"/>
-</pre>
-</li>
-<li>To do something with the text that the user enters, add the following code
-to the end of the <code>onCreate()</code> method:
-<pre>
-final EditText edittext = (EditText) findViewById(R.id.edittext);
-edittext.setOnKeyListener(new OnKeyListener() {
- public boolean onKey(View v, int keyCode, KeyEvent event) {
- if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
- // Perform action on key press
- Toast.makeText(HelloFormStuff.this, edittext.getText(), Toast.LENGTH_SHORT).show();
- return true;
- }
- return false;
- }
-});
-</pre>
-<p>This captures our EditText element from the layout, then adds an on-key listener to it.
-The {@link android.view.View.OnKeyListener} must define the <code>onKey()</code> method, which
-defines the action to be made when a key is pressed. In this case, we want to listen for the
-Enter key (when pressed down), then pop up a {@link android.widget.Toast} message with the
-text from the EditText field. Be sure to return <var>true</var> after the event is handled,
-so that the event doesn't bubble-up and get handled by the View (which would result in a
-carriage return in the text field).</p>
-<li>Run it.</li>
-</ol>
-
-
-<h2>CheckBox</h2>
-<p>A checkbox for selecting items. We'll make it display the the current state when pressed.</p>
-
-<ol>
- <li>Open the layout file and, inside the LinearLayout, add the {@link android.widget.CheckBox} element:
-<pre>
-<CheckBox android:id="@+id/checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="check it out" />
-</pre>
-</li>
-<li>To do something when the state is changed, add the following code
-to the end of the <code>onCreate()</code> method:
-<pre>
-final CheckBox checkbox = (CheckBox) findViewById(R.id.checkbox);
-checkbox.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- // Perform action on clicks
- if (checkbox.isChecked()) {
- Toast.makeText(HelloFormStuff.this, "Selected", Toast.LENGTH_SHORT).show();
- } else {
- Toast.makeText(HelloFormStuff.this, "Not selected", Toast.LENGTH_SHORT).show();
- }
- }
-});
-</pre>
-<p>This captures our CheckBox element from the layout, then adds an on-click listener to it.
-The {@link android.view.View.OnClickListener} must define the <code>onClick()</code> method, which
-defines the action to be made when the checkbox is clicked. Here, we query the current state of the
-checkbox, then pop up a {@link android.widget.Toast} message that displays the current state.
-Notice that the CheckBox handles its own state change between checked and un-checked, so we just
-ask which it currently is.</p>
-<li>Run it.</li>
-</ol>
-<p class="note"><strong>Tip:</strong> If you find that you need to change the state
-in another way (such as when loading a saved {@link android.preference.CheckBoxPreference}),
-use <code>setChecked(true)</code> or <code>toggle()</code>.</p>
-
-
-<h2>RadioButton</h2>
-<p>Two mutually-exclusive radio buttons—enabling one disables the other.
-When each is pressed, we'll pop up a message.</p>
-
-<ol>
- <li>Open the layout file and, inside the LinearLayout, add two {@link android.widget.RadioButton}s,
-inside a {@link android.widget.RadioGroup}:
-<pre>
-<RadioGroup
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <RadioButton android:id="@+id/radio_red"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Red" />
-
- <RadioButton android:id="@+id/radio_blue"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Blue" />
-
-</RadioGroup>
-</pre>
-</li>
-<li>To do something when each is selected, we'll need an OnClickListener. Unlike the other
-listeners we've created, instead of creating this one as an anonymous inner class,
-we'll create it as a new object. This way, we can re-use the OnClickListener for
-both RadioButtons. So, add the following code in the HelloFormStuff Activity
-(<em>outside</em> the <code>onCreate()</code> method):
-<pre>
-OnClickListener radio_listener = new OnClickListener() {
- public void onClick(View v) {
- // Perform action on clicks
- RadioButton rb = (RadioButton) v;
- Toast.makeText(HelloFormStuff.this, rb.getText(), Toast.LENGTH_SHORT).show();
- }
-};
-</pre>
-<p>Our <code>onClick()</code> method will be handed the View clicked, so the first thing to do
-is cast it into a RadioButton. Then we pop up a
-{@link android.widget.Toast} message that displays the selection.</p>
-<li>Now, at the bottom of the <code>onCreate()</code> method, add the following:
-<pre>
- final RadioButton radio_red = (RadioButton) findViewById(R.id.radio_red);
- final RadioButton radio_blue = (RadioButton) findViewById(R.id.radio_blue);
- radio_red.setOnClickListener(radio_listener);
- radio_blue.setOnClickListener(radio_listener);
-</pre>
-<p>This captures each of the RadioButtons from our layout and adds the newly-created
-OnClickListener to each.</p>
-<li>Run it.</li>
-</ol>
-<p class="note"><strong>Tip:</strong> If you find that you need to change the state of a
-RadioButton in another way (such as when loading a saved {@link android.preference.CheckBoxPreference}),
-use <code>setChecked(true)</code> or <code>toggle()</code>.</p>
-
-
-<h2>ToggleButton</h2>
-<p>A button used specifically for toggling something on and off.</p>
-
-<ol>
- <li>Open the layout file and, inside the LinearLayout, add the {@link android.widget.ToggleButton} element:
-<pre>
-<ToggleButton android:id="@+id/togglebutton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
-</pre>
-</li>
-<li>To do something when the state is changed, add the following code
-to the end of the <code>onCreate()</code> method:
-<pre>
-final ToggleButton togglebutton = (ToggleButton) findViewById(R.id.togglebutton);
-togglebutton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- // Perform action on clicks
- if (togglebutton.isChecked()) {
- Toast.makeText(HelloFormStuff.this, "ON", Toast.LENGTH_SHORT).show();
- } else {
- Toast.makeText(HelloFormStuff.this, "OFF", Toast.LENGTH_SHORT).show();
- }
- }
-});
-</pre>
-<p>This captures our ToggleButton element from the layout, then adds an on-click listener to it.
-The {@link android.view.View.OnClickListener} must define the <code>onClick()</code> method, which
-defines the action to be made when the button is clicked. Here, we query the current state of the
-ToggleButton, then pop up a {@link android.widget.Toast} message that displays the current state.
-Notice that the ToggleButton handles its own state change between checked and un-checked, so we just
-ask which it is.</p>
-<li>Run it.</li>
-</ol>
-
-<p class="note"><strong>Tip:</strong> By default, the text on the button is "ON" and "OFF", but
-you can change each of these with <code>setTextOn(<var>CharSequence</var>)</code> and
-<code>setTextOff(<var>CharSequence</var>)</code>. And, if you find that you need to change the state
-in another way (such as when loading a saved {@link android.preference.CheckBoxPreference}),
-use <code>setChecked(true)</code> or <code>toggle()</code>. </p>
-
-
-<p>If you've added all the form items above, your application should look something like this:</p>
-<img src="images/hello-formstuff.png" width="150px" />
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.ImageButton}</li>
- <li>{@link android.widget.EditText}</li>
- <li>{@link android.widget.CheckBox}</li>
- <li>{@link android.widget.RadioButton}</li>
- <li>{@link android.widget.ToggleButton}</li>
-</ul>
-
diff --git a/docs/html/guide/tutorials/views/hello-gallery.jd b/docs/html/guide/tutorials/views/hello-gallery.jd
deleted file mode 100644
index 084f912..0000000
--- a/docs/html/guide/tutorials/views/hello-gallery.jd
+++ /dev/null
@@ -1,135 +0,0 @@
-page.title=Hello, Gallery
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>A {@link android.widget.Gallery} is a View commonly used to display items in a horizontally scrolling list
-that locks the current selection at the center. When one is selected, we'll show a message.</p>
-
-
-<ol>
- <li>Start a new project/Activity called HelloGallery.</li>
- <li>Add some images to your res/drawable/ directory.</li>
- <li>Open the layout file and make it like so:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/gallery"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
-/>
-</pre>
-</li>
-
-
-<li>Open the HelloGallery.java file. Insert the following for the <code>onCreate()</code> method:
-<pre>
-@Override
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- Gallery g = (Gallery) findViewById(R.id.gallery);
- g.setAdapter(new ImageAdapter(this));
-
- g.setOnItemClickListener(new OnItemClickListener() {
- public void onItemClick(AdapterView parent, View v, int position, long id) {
- Toast.makeText(HelloGallery.this, "" + position, Toast.LENGTH_SHORT).show();
- }
- });
-}
-</pre>
- <p>We start as usual: set the layout and capture the View we want (our Gallery).
-We then set an Adapter, called ImageAdapter for the Gallery—this is a new class that
-we'll create next. Then we create an item click listener for the Gallery. This is like a normal
-on-click listener (which you might be familiar with for buttons), but it listens to each item
-that we've added to the Gallery. The <code>onItemClick()</code> callback method
-receives the AdapterView where the click occurred, the specific View that received the click, the
-position of the View clicked (zero-based), and the row id of the item clicked (if applicable). All
-that we care about is the position, so that we can pop up a {@link android.widget.Toast} message that
-tells us the index position of the item clicked. We do this with <code>Toast.makeText().show()</code>.
-</p>
-</li>
-
-<li>After the <code>onCreate()</code> method, add the <code>ImageAdapter</code> class:
-<pre>
-public class ImageAdapter extends BaseAdapter {
- int mGalleryItemBackground;
- private Context mContext;
-
- private Integer[] mImageIds = {
- R.drawable.sample_1,
- R.drawable.sample_2,
- R.drawable.sample_3,
- R.drawable.sample_4,
- R.drawable.sample_5,
- R.drawable.sample_6,
- R.drawable.sample_7
- };
-
- public ImageAdapter(Context c) {
- mContext = c;
- TypedArray a = obtainStyledAttributes(android.R.styleable.Theme);
- mGalleryItemBackground = a.getResourceId(
- android.R.styleable.Theme_galleryItemBackground, 0);
- a.recycle();
- }
-
- public int getCount() {
- return mImageIds.length;
- }
-
- public Object getItem(int position) {
- return position;
- }
-
- public long getItemId(int position) {
- return position;
- }
-
- public View getView(int position, View convertView, ViewGroup parent) {
- ImageView i = new ImageView(mContext);
-
- i.setImageResource(mImageIds[position]);
- i.setLayoutParams(new Gallery.LayoutParams(150, 100));
- i.setScaleType(ImageView.ScaleType.FIT_XY);
- i.setBackgroundResource(mGalleryItemBackground);
-
- return i;
- }
-}
-</pre>
-<p>First, there are a few member variables, including an array of IDs that reference
-the images we placed in our drawable resources directory.</p>
-<p>Next is the constructor, where we define the member Context. The rest of the constructor
-sets up a reference for our Gallery them, which adds the nice framing for each Gallery item.
-Once we have our <code>mGalleryItemBackground</code>, it's important to recycle the
-StyledAttribute for later re-use.</p>
-<p>The next three methods are required for basic member queries.
-But then we have the <code>getView()</code> method, which is called
-for each item read by our ImageAdapter, when the Gallery is being built. Here, we
-use our member Context to create a new {@link android.widget.ImageView}. We then define
-the image resource with the current position of the Gallery items (corresponding to our
-array of drawables), set the dimensions for the ImageView,
-set the image scaling to fit the ImageView dimensions, then finally set the
-background theme for the ImageView.</p>
-
-<p>See {@link android.widget.ImageView.ScaleType}
-for other image scaling options, in case you want to avoid stretching images that don't
-exactly match the ImageView dimensions.</p>
-
-<li>Now run it.</li>
-</ol>
-<p>You should see something like this:</p>
-<img src="images/hello-gallery.png" width="150px" />
-
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.BaseAdapter}</li>
- <li>{@link android.widget.Gallery}</li>
- <li>{@link android.widget.ImageView}</li>
- <li>{@link android.widget.Toast}</li>
-</ul>
-
-
diff --git a/docs/html/guide/tutorials/views/hello-gridview.jd b/docs/html/guide/tutorials/views/hello-gridview.jd
deleted file mode 100644
index 186c4e7..0000000
--- a/docs/html/guide/tutorials/views/hello-gridview.jd
+++ /dev/null
@@ -1,129 +0,0 @@
-page.title=Hello, GridView
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>A {@link android.widget.GridView} displays items in a two-dimensional, scrolling grid. The items
-are acquired from a {@link android.widget.ListAdapter}.</p>
-
-
-<ol>
- <li>Start a new project/Activity called HelloGridView.</li>
- <li>Find some photos you'd like to use, or copy some from the SDK samples res/drawable/
- folder of your project.</li>
- <li>Open the layout and make it like so:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<GridView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/gridview"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:numColumns="auto_fit"
- android:verticalSpacing="10dp"
- android:horizontalSpacing="10dp"
- android:columnWidth="90dp"
- android:stretchMode="columnWidth"
- android:gravity="center"
-/>
-</pre>
-</li>
- <li>Open the HelloGridView Java file. Insert the following for the <code>onCreate()</code> method:
-<pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- GridView gridview = (GridView) findViewById(R.id.gridview);
- gridview.setAdapter(new ImageAdapter(this));
-}
-</pre>
- <p>Here, we get a handle on our GridView, from the layout, and give it an Adapter.
- We're actually going to create our own Adapter called ImageAdapter.</p>
-</li>
-<li>Create a new class (nested or otherwise), called ImageAdapter, which extends {@link android.widget.BaseAdapter}:
-<pre>
-public class ImageAdapter extends BaseAdapter {
- private Context mContext;
-
- public ImageAdapter(Context c) {
- mContext = c;
- }
-
- public int getCount() {
- return mThumbIds.length;
- }
-
- public Object getItem(int position) {
- return null;
- }
-
- public long getItemId(int position) {
- return 0;
- }
-
- // 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
- imageView = new ImageView(mContext);
- imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
- imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
- imageView.setPadding(8, 8, 8, 8);
- } else {
- imageView = (ImageView) convertView;
- }
-
- imageView.setImageResource(mThumbIds[position]);
- return imageView;
- }
-
- // references to our images
- private Integer[] mThumbIds = {
- R.drawable.sample_2, R.drawable.sample_3,
- R.drawable.sample_4, R.drawable.sample_5,
- R.drawable.sample_6, R.drawable.sample_7,
- R.drawable.sample_0, R.drawable.sample_1,
- R.drawable.sample_2, R.drawable.sample_3,
- R.drawable.sample_4, R.drawable.sample_5,
- R.drawable.sample_6, R.drawable.sample_7,
- R.drawable.sample_0, R.drawable.sample_1,
- R.drawable.sample_2, R.drawable.sample_3,
- R.drawable.sample_4, R.drawable.sample_5,
- R.drawable.sample_6, R.drawable.sample_7
- };
-}
-</pre>
- <p>First we take care of some required methods inherited from BaseAdapter.
- The constructor and <code>getCount()</code> are self-explanatory. Normally, <code>getItem()</code>
- should return the actual object at the specified position in our Adapter, but for this Hello World,
- we're not going to bother. Likewise, <code>getItemId()</code> should return the row id of
- the item, but right now we don't care.</p>
- <p>However, <code>getView()</code> is the method we care about. This one creates a new View for each image that we
- put in our ImageAdapter. So we're going to create an ImageView each time. When this is called, we're
- going to receive a View, which is likely a recycled View object (at least after the first call), so we
- check for this—if it's null, we initialize the ImageView and setup all the properties we want.
- The <code>LayoutParams()</code> initialization sets the height and width of the View—this ensures
- that no matter the drawable size, each image is resized and cropped to fit in the ImageView (if necessary).
- With <code>setScaleType()</code>, we say that images should be cropped toward the center (if necessary).
- And finally, we set the padding within the ImageView. (Note that, if the images have various aspect-ratios,
- as they do in this demo, then less padding will cause for more cropping of the image, if it does not match
- the dimensions given to the ImageView.) At the end of <code>getView()</code> we set the image resource and
- return the ImageView.</p>
- <p>All that's left is our array or drawable resources at the bottom.</p>
-</li>
-<li>Run it.</li>
-</ol>
-<p>Your grid layout should look something like this:</p>
-<img src="images/hello-gridview.png" width="150px" />
-
-<p>Try experimenting with the behaviors of the GridView and ImageView by adjusting their properties. For example,
- instead of setting the ImageView LayoutParams, you can try using
- {@link android.widget.ImageView#setAdjustViewBounds(boolean)}. </p>
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.GridView}</li>
- <li>{@link android.widget.ImageView}</li>
- <li>{@link android.widget.BaseAdapter}</li>
-</ul>
-
diff --git a/docs/html/guide/tutorials/views/hello-linearlayout.jd b/docs/html/guide/tutorials/views/hello-linearlayout.jd
deleted file mode 100644
index 0e8947c..0000000
--- a/docs/html/guide/tutorials/views/hello-linearlayout.jd
+++ /dev/null
@@ -1,130 +0,0 @@
-page.title=Hello, LinearLayout
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>A {@link android.widget.LinearLayout} is a GroupView that will lay child View elements
-vertically or horizontally.</p>
-
-
-<ol>
- <li>Start a new project/Activity called HelloLinearLayout.</li>
- <li>Open the layout file.
- Make it like so:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_weight="1">
-
- <TextView
- android:text="red"
- android:gravity="center_horizontal"
- android:background="#aa0000"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_weight="1"/>
-
- <TextView
- android:text="green"
- android:gravity="center_horizontal"
- android:background="#00aa00"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_weight="1"/>
-
- <TextView
- android:text="blue"
- android:gravity="center_horizontal"
- android:background="#0000aa"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_weight="1"/>
-
- <TextView
- android:text="yellow"
- android:gravity="center_horizontal"
- android:background="#aaaa00"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_weight="1"/>
-
- </LinearLayout>
-
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_weight="1">
-
- <TextView
- android:text="row one"
- android:textSize="15pt"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"/>
-
- <TextView
- android:text="row two"
- android:textSize="15pt"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"/>
-
- <TextView
- android:text="row three"
- android:textSize="15pt"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"/>
-
- <TextView
- android:text="row four"
- android:textSize="15pt"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"/>
-
- </LinearLayout>
-
-</LinearLayout>
-</pre>
- <p>Carefully inspect the XML. You'll notice how this layout works a lot like
- an HTML layout. There is one parent LinearLayout that is defined to lay
- its child elements vertically. The first child is another LinearLayout that uses a horizontal layout
- and the second uses a vertical layout. Each LinearLayout contains several {@link android.widget.TextView}
- elements.</p>
-</li>
-<li>Now open the HelloLinearLayout Activity and be sure it loads this layout in the <code>onCreate()</code> method:</p>
-<pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-}
-</pre>
-<p><code>R.layout.main</code> refers to the <code>main.xml</code> layout file.</p>
-</li>
-<li>Run it.</li>
-</ol>
-<p>You should see the following:</p>
-<img src="images/hello-linearlayout.png" width="150px" />
-
-<p>Notice how the various XML attributes define the View's behavior.
-Pay attention to the effect of the <code>layout_weight</code>. Try
- experimenting with different values to see how the screen real estate is
- distributed based on the weight of each element.</p>
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.LinearLayout}</li>
-<li>{@link android.widget.TextView}</li>
-</ul>
-
-
diff --git a/docs/html/guide/tutorials/views/hello-listview.jd b/docs/html/guide/tutorials/views/hello-listview.jd
deleted file mode 100644
index d90005b..0000000
--- a/docs/html/guide/tutorials/views/hello-listview.jd
+++ /dev/null
@@ -1,90 +0,0 @@
-page.title=Hello, ListView
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>A {@link android.widget.ListView} is a View that shows items in a vertically scrolling list. The items are
- acquired from a {@link android.widget.ListAdapter}.</p>
-
-
-<ol>
- <li>Start a new project/ListActivity called HelloListView.</li>
- <li>Open the HelloListView Java file. Make the class extend ListActivity (instead of Activity).
- <pre>public class HelloListView extends ListActivity {</pre>
- </li>
- <li>Insert the following for the <code>onCreate()</code> method:
-<pre>
-@Override
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setListAdapter(new ArrayAdapter<String>(this,
- android.R.layout.simple_list_item_1, COUNTRIES));
- getListView().setTextFilterEnabled(true);
-}
-</pre>
- <p>Notice that we don't need to load a layout (at least, not in this case, because we're using
- the whole screen for our list). Instead, we just call <code>setListAdapter()</code> (which automatically
- adds a ListView to the ListActivity), and provide it with an ArrayAdapter that binds a
- <code>simple_list_item_1</code> layout item to each entry in the <code>COUNTRIES</code>
- array (added next). The next line of code adds a text filter to the ListView, so that when the user
- begins typing, the list will filter the entire view to display only the items that match the entry.</p>
- </li>
- <li>Following the <code>onCreate()</code> method, add the String array:
-<pre>
- static final String[] COUNTRIES = new String[] {
- "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
- "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",
- "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan",
- "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
- "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
- "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory",
- "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi",
- "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde",
- "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
- "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
- "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic",
- "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic",
- "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea",
- "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland",
- "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia",
- "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar",
- "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau",
- "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary",
- "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica",
- "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos",
- "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg",
- "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands",
- "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova",
- "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia",
- "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand",
- "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas",
- "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru",
- "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar",
- "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena",
- "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon",
- "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal",
- "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands",
- "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea",
- "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden",
- "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas",
- "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey",
- "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda",
- "Ukraine", "United Arab Emirates", "United Kingdom",
- "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan",
- "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara",
- "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
- };
-</pre>
-</li>
-<li> Run it.</li>
-</ol>
-<p>You can scroll the list, or type to filter it. You should see something like this:</p>
-<img src="images/hello-listview.png" width="150px" />
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.ListView}</li>
- <li>{@link android.widget.ListAdapter}</li>
-</ul>
-
diff --git a/docs/html/guide/tutorials/views/hello-mapview.jd b/docs/html/guide/tutorials/views/hello-mapview.jd
deleted file mode 100644
index 5217b6b..0000000
--- a/docs/html/guide/tutorials/views/hello-mapview.jd
+++ /dev/null
@@ -1,245 +0,0 @@
-page.title=Hello, MapView
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<div class="special">
-<p>This tutorial requires that you have the Google Maps external library
-installed in your SDK environment. By default the Android SDK includes the
-Google APIs add-on, which in turn includes the Maps external library. If you
-don't have the Google APIs SDK add-on, you can download it from this
-location:</p>
-
-<p style="margin-left:2em;"><a
-href="http://code.google.com/android/add-ons/google-apis">http://code.google.com/android/add-ons/google-apis</a></p>
-
-<p>The Google APIs add-on requires Android 1.5 SDK or later release. After
-installing the add-on in your SDK, set your project properties to use a <strong>Google
-APIs</strong> build target. See the instructions for setting a build
-target in <a href="{@docRoot}guide/developing/eclipse-adt.html">Developing in
-Eclipse with ADT</a> or <a
-href="{@docRoot}guide/developing/other-ide.html">Developing in Other IDEs</a>,
-as appropriate for your environment. </p>
-
-<p>You will also need to use the android tool to set up an AVD that uses the
-Google APIs deployment target. See <a
-href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a> for
-more information. Once you have set up your environment, you will be able to
-build and run the project described in this tutorial</a></p>
-
-</div>
-
-<p>A MapView allows you to create your own map-viewing Activity.
-First, we'll create a simple Activity that can view and navigate a map. Then we will add some overlay items.</p>
-
-<ol>
- <li>Start a new project/Activity called HelloMapView.
-
- <li>Because we're using the Google Maps library,
- which is not a part of the standard Android library, we need to
- declare it in the Android Manifest. Open the AndroidManifest.xml
- file and add the following as a child of the <code><application></code> element:
-
- <pre><uses-library android:name="com.google.android.maps" /></pre>
- </li>
- <li>We also need access to the internet in order to retrieve the Google Maps tiles,
- so the application must request the {@link android.Manifest.permission#INTERNET INTERNET} permissions.
- In the manifest file, add the following as a child of the <code><manifest></code> element:
- <pre><uses-permission android:name="android.permission.INTERNET" /></pre>
- </li>
- <li>Now open the main layout file for your project. Define a layout with a com.google.android.maps.MapView
- inside a android.widget.RelativeLayout:
-
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/mainlayout"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
-
- <com.google.android.maps.MapView
- android:id="@+id/mapview"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:clickable="true"
- android:apiKey="<em>Your Maps API Key</em>"
- />
-
-</RelativeLayout>
-</pre>
- <p>The <code>clickable</code> attribute defines whether you want to allow user-interaction with the map.
- In this case, we set it "true" so that the user can navigate.</p>
-
- <p>The <code>apiKey</code> attribute holds the Google Maps API Key that proves your application and signer
- certificate has been registered with the Google Maps service. Because MapView uses Google Maps data, this key is required
- in order to receive the map data, even while you are developing. Registration is free and it only takes a couple
- minutes to register your certificate and receive a Maps API Key. For instructions on getting a key, read
- <a href="http://code.google.com/android/add-ons/google-apis/mapkey.html">Obtaining a Maps API Key</a>.
- (For the purpose of this tutorial, you should register with the fingerprint of the SDK debug certificate.)
- Once you've acquired the Maps API Key, insert it for the <code>apiKey</code> value.</p></li>
-
- <li>Now open the HelloMapView.java file. For this Activity, we're going to extend the special sub-class of
- Activity called MapActivity, so change the class declaration to extend
- MapActivity, instead of Activity:</p>
-
- <pre>public class HelloMapView extends MapActivity {</pre>
-
- <li>The <code>isRouteDisplayed()</code> method is required, so add it inside the class:
-<pre>
-@Override
-protected boolean isRouteDisplayed() {
- return false;
-}
-</pre>
-<p>You can actually run this now, but all it does is allow you to pan around the map.</p>
-
- <li>Now go back to the HelloMapView class. We'll now retrieve the ZoomControls object from
- the MapView and add it to our new layout element. First, at the top of the HelloMapView,
- instantiate handles for the MapView and LinearLayout, plus a ZoomControl object:
-<pre>
-LinearLayout linearLayout;
-MapView mapView;
-</pre>
-
- <li>Then initialize each of these in <code>onCreate()</code>. We'll capture the LinearLayout and
- MapView through their layout resources. Then get the ZoomControls from the MapView::
-<pre>
-mapView = (MapView) findViewById(R.id.mapview);
-mapView.setBuiltInZoomControls(true);
-</pre>
-
- <p>By using the built-in zoom control provided by MapView, we don't have to do any of the work
- required to actually perform the zoom operations. The controls will appear whenever the user
- touches the map, then disappear after a few moments of inactivity.</p></li>
-
- <li>Run it.</li>
-</ol>
-
-<hr/>
-
-<p>So, we now have full interaction controls. All well and good, but what we really want our map
-for is custom markers and layovers. Let's add some Overlay
-objects to our map. To do this, we're going to
-implement the ItemizedOverlay
-class, which can manage a whole set of Overlay items for us.</p>
-
-<ol>
- <li>Create a new Java class named HelloItemizedOverlay that implements ItemizedOverlay.
-
- <p>When using Eclipse, right-click the package name in the Eclipse Package Explorer, and select New > Class. Fill-in
- the Name field as <em>HelloItemizedOverlay</em>. For the Superclass, enter
- <em>com.google.android.maps.ItemizedOverlay</em>. Click the checkbox for <em>Constructors from
- superclass</em>. Click Finish.</p></li>
-
- <li> First thing, we need an OverlayItem ArrayList, in which we'll put each of the OverlayItem
- objects we want on our map. Add this at the top of the HelloItemizedOverlay class:
-
- <pre>private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();</pre></li>
-
- <li>All the constructor does is define the default marker to be used on each of the OverlayItems.
- In order for the Drawable to actually get drawn, it must have its bounds defined. And we want the
- center-point at the bottom of the image to be the point at which it's attached to the map
- coordinates. We handle all this with the boundCenterBottom() method. Wrap this around our
- defaultMarker, so the super constructor call looks like this:
-
- <pre>super(boundCenterBottom(defaultMarker));</pre></li>
-
- <li>In order to add new OverlayItems to our ArrayList, we need a new public method. We'll handle
- this with the following method:
-
-<pre>
-public void addOverlay(OverlayItem overlay) {
- mOverlays.add(overlay);
- populate();
-}</pre>
-
- <p>Each time we add a new OverlayItem, we must call <code>populate()</code>, which will read each of out
- OverlayItems and prepare them to be drawn.</p></li>
-
- <li>In order for the <code>populate()</code> method to read each OverlayItem, it will make a request to
- <code>createItem(int)</code>. We must define this method to properly read from our ArrayList. Replace the
- existing contents of the createItem method with a <code>get()</code> call to our ArrayList:
-
-<pre>
-@Override
-protected OverlayItem createItem(int i) {
- return mOverlays.get(i);
-}
-</pre></li>
-
- <li>We're also required to override the <code>size()</code> method. Replace the existing contents of the
- method with a size request to our ArrayList:
-
- <pre>return mOverlays.size();</pre></li>
-</ol>
-
-
-<p>That's it for the HelloItemizedOverlay class. We're now ready to use it.</p>
-
-<hr/>
-<p>Go back to the HelloMapView
-class. We'll start by creating one OverlayItem, adding to an instance of our HelloItemizedOverlay,
-and then adding this to the MapView.</p>
-
-<img src="images/androidmarker.png" align="right" />
-<p>First, we need the image that we'll use for our map overlay. Here, we'll use the Android on the
-right as our marker. Drag this image (or your own) to the res/drawable/ directory of your project workspace.</p>
-
-<p>Now we're ready to work in the HelloMapView:</p>
-
-<ol>
- <li>First we need some more types. Add the following at the top of the HelloMapView class:
-
-<pre>
-List<Overlay> mapOverlays;
-Drawable drawable;
-HelloItemizedOverlay itemizedOverlay;</pre></li>
-
- <li>Now pick up where we left off in the <code>onCreate()</code> method. Instantiate the
- new fields:
-
-<pre>
-mapOverlays = mapView.getOverlays();
-drawable = this.getResources().getDrawable(R.drawable.androidmarker);
-itemizedoverlay = new HelloItemizedOverlay(drawable);</pre>
-
- <p>All overlay elements on a map are held by the MapView, so when we want to add some, we must
- first retrieve the List with <code>getOverlays()</code> methods. We instantiate the Drawable, which will
- be used as our map marker, by using our Context resources to get the Drawable we placed in
- the res/drawable/ directory (androidmarker.png). Our HelloItemizedOverlay takes the Drawable in order to set the
- default marker.</p></li>
-
- <li>Now let's make our first OverlayItem by creating a GeoPoint
- that defines our map coordinates, then pass it to a new OverlayItem:
-
-<pre>
-GeoPoint point = new GeoPoint(19240000,-99120000);
-OverlayItem overlayitem = new OverlayItem(point, "", "");</pre>
-
- <p>GeoPoint coordinates are based in microdegrees (degrees * 1e6). The OverlayItem takes this
- GeoPoint and two strings. Here, we won't concern ourselves with the strings, which can display
- text when we click our marker, because we haven't yet written the click handler for the OverlayItem.</p></li>
-
- <li>All that's left is for us to add this OverlayItem to our collection in the HelloItemizedOverlay,
- and add this to the List of Overlay objects retrieved from the MapView:
-
-<pre>
-itemizedoverlay.addOverlay(overlayitem);
-mapOverlays.add(itemizedoverlay);</pre></li>
-
- <li>Run it!</li>
-</ol>
-
-<p>We've sent our droid to Mexico City. Hola, Mundo!</p>
-<p>You should see the following:</p>
-<img src="images/hello-mapview.png" width="150px" />
-
-<p>Because we created our ItemizedOverlay class with an ArrayList, we can continue adding new
-OverlayItems. Try adding another one. Before the <code>addOverlay()</code> method is called, add these lines:</p>
-<pre>
-GeoPoint point2 = new GeoPoint(35410000, 139460000);
-OverlayItem overlayitem2 = new OverlayItem(point2, "", "");
-</pre>
-<p>Run it again... We've sent a new droid to Tokyo. Sekai, konichiwa!</p>
-
diff --git a/docs/html/guide/tutorials/views/hello-relativelayout.jd b/docs/html/guide/tutorials/views/hello-relativelayout.jd
deleted file mode 100644
index 1b91537..0000000
--- a/docs/html/guide/tutorials/views/hello-relativelayout.jd
+++ /dev/null
@@ -1,75 +0,0 @@
-page.title=Hello, RelativeLayout
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>A {@link android.widget.RelativeLayout} is a ViewGroup that allows you to layout child elements
-in positions relative to the parent or siblings elements.</p>
-
-<ol>
- <li>Start a new project/Activity called HelloRelativeLayout.</li>
- <li>Open the layout file. Make it like so:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
- <TextView
- android:id="@+id/label"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Type here:"/>
-
- <EditText
- android:id="@+id/entry"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@android:drawable/editbox_background"
- android:layout_below="@id/label"/>
-
- <Button
- android:id="@+id/ok"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/entry"
- android:layout_alignParentRight="true"
- android:layout_marginLeft="10dip"
- android:text="OK" />
-
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toLeftOf="@id/ok"
- android:layout_alignTop="@id/ok"
- android:text="Cancel" />
-
-</RelativeLayout>
-</pre>
-<p>Pay attention to each of the additional <code>layout_*</code> attributes (besides the
-usual width and height, which are required for all elements). When using relative layout,
-we use attributes like <code>layout_below</code> and <code>layout_toLeftOf</code> to describe
-how we'd like to position each View. Naturally, these are different relative positions, and the
-value of the attribute is the id of the element we want the position relative to.</p>
-</li>
-<li>Make sure your Activity loads this layout in the <code>onCreate()</code> method:</p>
-<pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-}
-</pre>
-<p><code>R.layout.main</code> refers to the <code>main.xml</code> layout file.</p>
-</li>
-<li>Run it.</li>
-</ol>
-<p>You should see the following:</p>
-<img src="images/hello-relativelayout.png" width="150px" />
-
-<h3>Resources</h3>
-<ul>
- <li>{@link android.widget.RelativeLayout}</li>
- <li>{@link android.widget.TextView}</li>
- <li>{@link android.widget.EditText}</li>
- <li>{@link android.widget.Button}</li>
-</ul>
diff --git a/docs/html/guide/tutorials/views/hello-spinner.jd b/docs/html/guide/tutorials/views/hello-spinner.jd
deleted file mode 100644
index 3a04214..0000000
--- a/docs/html/guide/tutorials/views/hello-spinner.jd
+++ /dev/null
@@ -1,106 +0,0 @@
-page.title=Hello, Spinner
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>A {@link android.widget.Spinner} is a widget that allows the user to select an item from a group.
-It is similar to a dropdown list and will allow scrolling when the
-list exceeds the available vertical space on the screen.</p>
-
-
-<ol>
- <li>Start a new project/Activity called HelloSpinner.</li>
- <li>Open the layout file.
- Make it like so:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:padding="10dip"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="10dip"
- android:text="Please select a planet:"
- />
-
- <Spinner
- android:id="@+id/spinner"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:drawSelectorOnTop="true"
- android:prompt="@string/planet_prompt"
- />
-
-</LinearLayout>
-</pre>
- <p>Notice that the Spinner's <code>android:prompt</code> is a string resource. In
- this case, Android does not allow it to be a string, it must be a reference to a resource.
- So...</p>
-</li>
-
-<li>Open the strings.xml file in res/values/ and add the following <code><string></code>
-element inside the <code><resources></code> element:
-<pre>
-<string name="planet_prompt">Choose a planet</string>
-</pre>
-</li>
-
-<li>Create a new XML file in res/values/ called arrays.xml. Insert the following:
-<pre>
-<resources>
-
- <string-array name="planets">
- <item>Mercury</item>
- <item>Venus</item>
- <item>Earth</item>
- <item>Mars</item>
- <item>Jupiter</item>
- <item>Saturn</item>
- <item>Uranus</item>
- <item>Neptune</item>
- </string-array>
-
-</resources>
-</pre>
- <p>This is the list of items (planets) that the user can select from in the Spinner widget.</p>
-</li>
-
-<li>Now open the HelloSpinner.java file. Insert the following code into the HelloSpinner class:
-<pre>
-@Override
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- Spinner s = (Spinner) findViewById(R.id.spinner);
- ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
- this, R.array.planets, android.R.layout.simple_spinner_item);
- adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- s.setAdapter(adapter);
-}
-</pre>
- <p>That's it. We start by creating a Spinner from our layout. We then create an {@link android.widget.ArrayAdapter}
- that binds each element of our string array to a layout view—we pass <code>createFromResource</code> our Context,
- the array of selectable items and the type of layout we'd like each one bound to. We then call
- <code>setDropDownViewResource()</code> to define the type of layout in which to present the
- entire collection. Finally, we set this Adapter to associate with our Spinner,
- so the string items have a place to go.</p>
-</li>
-
-<li>Now run it.</li>
-</ol>
-<p>It should look like this:</p>
-<img src="images/hello-spinner.png" width="150px" />
-
-
-<h3>Resources</h3>
-<ul>
- <li>{@link android.R.layout}</li>
- <li>{@link android.widget.ArrayAdapter}</li>
- <li>{@link android.widget.Spinner}</li>
-</ul>
-
diff --git a/docs/html/guide/tutorials/views/hello-tablelayout.jd b/docs/html/guide/tutorials/views/hello-tablelayout.jd
deleted file mode 100644
index 83d6f5d..0000000
--- a/docs/html/guide/tutorials/views/hello-tablelayout.jd
+++ /dev/null
@@ -1,118 +0,0 @@
-page.title=Hello, TableLayout
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>A {@link android.widget.TableLayout} is a ViewGroup that
-will lay child View elements into rows and columns.</p>
-
-
-<ol>
- <li>Start a new project/Activity called HelloTableLayout.</li>
- <li>Open the layout file.
- Make it like so:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:stretchColumns="1">
-
- <TableRow>
- <TextView
- android:layout_column="1"
- android:text="Open..."
- android:padding="3dip" />
- <TextView
- android:text="Ctrl-O"
- android:gravity="right"
- android:padding="3dip" />
- </TableRow>
-
- <TableRow>
- <TextView
- android:layout_column="1"
- android:text="Save..."
- android:padding="3dip" />
- <TextView
- android:text="Ctrl-S"
- android:gravity="right"
- android:padding="3dip" />
- </TableRow>
-
- <TableRow>
- <TextView
- android:layout_column="1"
- android:text="Save As..."
- android:padding="3dip" />
- <TextView
- android:text="Ctrl-Shift-S"
- android:gravity="right"
- android:padding="3dip" />
- </TableRow>
-
- <View
- android:layout_height="2dip"
- android:background="#FF909090" />
-
- <TableRow>
- <TextView
- android:text="X"
- android:padding="3dip" />
- <TextView
- android:text="Import..."
- android:padding="3dip" />
- </TableRow>
-
- <TableRow>
- <TextView
- android:text="X"
- android:padding="3dip" />
- <TextView
- android:text="Export..."
- android:padding="3dip" />
- <TextView
- android:text="Ctrl-E"
- android:gravity="right"
- android:padding="3dip" />
- </TableRow>
-
- <View
- android:layout_height="2dip"
- android:background="#FF909090" />
-
- <TableRow>
- <TextView
- android:layout_column="1"
- android:text="Quit"
- android:padding="3dip" />
- </TableRow>
-</TableLayout>
-</pre>
-<p>Notice how this resembles the structure of an HTML table. <code>TableLayout</code> is like the
-<code>table</code> element; <code>TableRow</code> is like a <code>tr</code> element; but for our cells like
-the html <code>td</code> element, we can use any kind of View. Here, we use <code>TextView</code> for the cells.</p>
-
-</li>
-<li>Make sure your Activity loads this layout in the <code>onCreate()</code> method:
-<pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-}
-</pre>
-<p><code>R.layout.main</code> refers to the <code>main.xml</code> layout file.</p>
-</li>
-<li>Run it.</li>
-</ol>
-<p>You should see the following:</p>
-<img src="images/hello-tablelayout.png" width="150px" />
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.TableLayout}</li>
- <li>{@link android.widget.TableRow}</li>
- <li>{@link android.widget.TextView}</li>
-</ul>
-
-
diff --git a/docs/html/guide/tutorials/views/hello-tabwidget.jd b/docs/html/guide/tutorials/views/hello-tabwidget.jd
deleted file mode 100644
index 98dddf53..0000000
--- a/docs/html/guide/tutorials/views/hello-tabwidget.jd
+++ /dev/null
@@ -1,124 +0,0 @@
-page.title=Hello, TabWidget
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>A {@link android.widget.TabWidget} offers the ability to easily draw an interface that uses
-tabs to navigate between different views.</p>
-
-<ol>
- <li>Start a new project/Activity called HelloTabWidget.</li>
- <li>Open the layout file and make it like so:</li>
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@android:id/tabhost"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <TabWidget
- android:id="@android:id/tabs"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
- <FrameLayout
- android:id="@android:id/tabcontent"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <TextView
- android:id="@+id/textview1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:text="this is a tab" />
- <TextView
- android:id="@+id/textview2"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:text="this is another tab" />
- <TextView
- android:id="@+id/textview3"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:text="this is a third tab" />
- </FrameLayout>
- </LinearLayout>
-</TabHost>
-</pre>
- <p>Here, we've created a {@link android.widget.TabHost} that contains the entire layout of the Activity.
- A TabHost requires two descendant elements: a {@link android.widget.TabWidget} and a {@link android.widget.FrameLayout}.
- In order to properly layout these elements, we've put them inside a vertical {@link android.widget.LinearLayout}.
- The FrameLayout is where we keep the content that will change with each tab. Each child in the FrameLayout will
- be associated with a different tab.
- In this case, each tab simply shows a different {@link android.widget.TextView} with some text. </p>
- <p>Notice that the TabWidget and the FrameLayout elements have specific <code>android</code> namespace IDs. These are necessary
- so that the TabHost can automatically retrieve references to them, populate the TabWidget with the tabs that we'll define
- in our code, and swap the views in the FrameLayout. We've also defined our own IDs for each TextView, which we'll use to
- associate each tab with the view that it should reveal.</p>
- <p>Of course, you can
- make these child views as large as complex as you'd like — instead of the TextView elements,
- you could start with other layout views and build a unique layout hierarchy for each tab.</p>
- </li>
- <li>Now we'll add our code. Open HelloTabWidget.java and make it a <code>TabActivity</code>.
- <p>By default, Eclipse creates a class that extends <code>Activity</code>. Change it to
- extend <code>TabActivity</code>:</p>
- <pre>
-public class HelloTabWidget extends TabActivity {
-</pre>
- </li>
- <li>Now fill in the the <code>onCreate</code> method like this:
- <pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- mTabHost = getTabHost();
-
- mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator("TAB 1").setContent(R.id.textview1));
- mTabHost.addTab(mTabHost.newTabSpec("tab_test2").setIndicator("TAB 2").setContent(R.id.textview2));
- mTabHost.addTab(mTabHost.newTabSpec("tab_test3").setIndicator("TAB 3").setContent(R.id.textview3));
-
- mTabHost.setCurrentTab(0);
-}
-</pre>
- <p>As usual, we start by setting our layout.</p>
- <p>We then call the TabActivity method <code>getTabHost()</code>,
- which returns us a reference to the TabHost we created in our layout. Upon our TabHost, we call <code>addTab()</code>
- for each of the tabs that we want to add to the TabWidget. Each time we call this, we pass a
- {@link android.widget.TabHost.TabSpec} that we build on the fly, and with it, chain together two necessary methods:
- <code>setIndicator()</code> to set the text for the tab button, and <code>setContent()</code> to define
- which View we want to associate with the tab and reveal when pressed. Our indicator is just a text string and
- our content is an ID reference to the TextView elements we inserted in the FrameLayout.</p>
- <p>At the end, we call <code>setCurrentTab()</code> to define which tab should be opened by default. The tabs
- are saved like a zero-based array, so to open the first tab, we pass zero (<var>0</var>).</p>
- </li>
- <li>To clean-up the presentation a bit more, let's remove the window title that appears at the top of the layout.
- Android includes a theme that removes that title for us. To add it, open the Android Manifest file and add
- the <var>NoTitleBar</var> theme to the <code><application></code> tag. It should end up like this:
- <pre>
-<application android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar">
-</pre>
- </li>
- <li>That's it. Run your application.</li>
-
-</ol>
-
-
-<p>Your application should look like this:</p>
-<img src="images/hello-tabwidget.png" width="150px" />
-
-<div class="special"><p>You can include icons in your tabs by passing a
-{@link android.graphics.drawable.Drawable} when you call <code>setIndicator()</code>. Here's an example
-that uses a Drawable created from an image in the project resources:</p>
-<pre>setIndicator("TAB 1", getResources().getDrawable(R.drawable.tab_icon))</pre>
-</div>
-
-<h3>References</h3>
-<ul>
-<li>{@link android.widget.TabWidget}</li>
-<li>{@link android.widget.TabHost}</li>
-<li>{@link android.widget.TabHost.TabSpec}</li>
-<li>{@link android.widget.FrameLayout}</li>
-</ul>
-
diff --git a/docs/html/guide/tutorials/views/hello-timepicker.jd b/docs/html/guide/tutorials/views/hello-timepicker.jd
deleted file mode 100644
index 1a6c8f9..0000000
--- a/docs/html/guide/tutorials/views/hello-timepicker.jd
+++ /dev/null
@@ -1,159 +0,0 @@
-page.title=Hello, TimePicker
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>A {@link android.widget.TimePicker} is a widget that allows the
-user to select the time by hour, minute and AM or PM.</p>
-
-
-<ol>
- <li>Start a new project/Activity called HelloTimePicker.</li>
- <li>Open the layout file and make it like so:
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView android:id="@+id/timeDisplay"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text=""/>
-
- <Button android:id="@+id/pickTime"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Change the time"/>
-
-</LinearLayout>
-</pre>
- <p>For the layout, we're using a vertical LinearLayout, with a {@link android.widget.TextView} that
- will display the time and a {@link android.widget.Button} that will initiate the
- {@link android.widget.TimePicker} dialog.
- With this layout, the TextView will sit above the Button.
- The text value in the TextView is set empty, as it will be filled by our Activity
- with the current time.</p>
- </li>
-
- <li>Open HelloTimePicker.java. Insert the following to the HelloTimePicker class:
-<pre>
-private TextView mTimeDisplay;
-private Button mPickTime;
-
-private int mHour;
-private int mMinute;
-
-static final int TIME_DIALOG_ID = 0;
-
-@Override
-protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- // capture our View elements
- mTimeDisplay = (TextView) findViewById(R.id.timeDisplay);
- mPickTime = (Button) findViewById(R.id.pickTime);
-
- // add a click listener to the button
- mPickTime.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- showDialog(TIME_DIALOG_ID);
- }
- });
-
- // get the current time
- final Calendar c = Calendar.getInstance();
- mHour = c.get(Calendar.HOUR_OF_DAY);
- mMinute = c.get(Calendar.MINUTE);
-
- // display the current date
- updateDisplay();
-}
-</pre>
-<p class="note"><strong>Tip:</strong> Press Ctrl(or Cmd) + Shift + O to import all needed packages.</p>
- <p>We start by instantiating variables for our View elements and time fields.
- The <code>TIME_DIALOG_ID</code> is a static integer that uniquely identifies the dialog. In the
- <code>onCreate()</code> method, we get prepared by setting the layout and capturing the View elements.
- We then set an on-click listener for the Button, so that when it is clicked, it will
- show our TimePicker dialog. The <code>showDialog()</code> method will perform a callback
- to our Activity. (We'll define this callback in the next section.) We then create an
- instance of {@link java.util.Calendar} and get the current hour and minute. Finally, we call
- <code>updateDisplay()</code>—our own method that will fill the TextView with the time.</p>
-</li>
-
-<li>After the <code>onCreate()</code> method, add the <code>onCreateDialog()</code> callback method:
-<pre>
-@Override
-protected Dialog onCreateDialog(int id) {
- switch (id) {
- case TIME_DIALOG_ID:
- return new TimePickerDialog(this,
- mTimeSetListener, mHour, mMinute, false);
- }
- return null;
-}
-</pre>
- <p>This is passed the identifier we gave <code>showDialog()</code> and initializes
- the TimePicker to the time we retrieved from our Calendar instance. It will be called by
- <code>showDialog()</code>.</p>
-</li>
-
-<li>Now add our <code>updateDisplay()</code> method:
-<pre>
-// updates the time we display in the TextView
-private void updateDisplay() {
- mTimeDisplay.setText(
- new StringBuilder()
- .append(pad(mHour)).append(":")
- .append(pad(mMinute)));
-}
-</pre>
- <p>This simply takes our member fields for the time and inserts them in
- the <code>mTimeDisplay</code> TextView. Note that we call a new method, <code>pad()</code>,
- on the hour and minute. (We'll create this method in the last step.)</p>
-</li>
-
-<li>Next, add a listener to be called when the time is reset:
-<pre>
-// the callback received when the user "sets" the time in the dialog
-private TimePickerDialog.OnTimeSetListener mTimeSetListener =
- new TimePickerDialog.OnTimeSetListener() {
- public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
- mHour = hourOfDay;
- mMinute = minute;
- updateDisplay();
- }
- };
-</pre>
- <p>Now when the user is done setting the time (clicks the "Set" button), we update our member fields with
- the new time and update our TextView.</p>
-</li>
-<li>Finally, add the <code>pad()</code> method that we called from the <code>updateDisplay()</code>:
-<pre>
-private static String pad(int c) {
- if (c >= 10)
- return String.valueOf(c);
- else
- return "0" + String.valueOf(c);
-}
-</pre>
- <p>This method returns the appropriate String representation of the hour or minute.
- It will prefix a zero to the number if it's a single digit.
- </p>
-</li>
-
-<li>Now run it.</li>
-</ol>
-<p>When you press the "Change the time" button, you should see the following:</p>
-<img src="images/hello-timepicker.png" width="150px" />
-
-<h3>References</h3>
-<ol>
- <li>{@link android.widget.TimePicker}</li>
- <li>{@link android.widget.Button}</li>
- <li>{@link android.widget.TextView}</li>
- <li>{@link java.util.Calendar}</li>
-</ol>
-
diff --git a/docs/html/guide/tutorials/views/hello-webview.jd b/docs/html/guide/tutorials/views/hello-webview.jd
deleted file mode 100644
index a927b04..0000000
--- a/docs/html/guide/tutorials/views/hello-webview.jd
+++ /dev/null
@@ -1,118 +0,0 @@
-page.title=Hello, WebView
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>A {@link android.webkit.WebView} allows you to create your own web browser Activity. In this tutorial,
-we'll create a simple Activity that can view web pages.</p>
-
-<ol>
- <li>Create a new project/Activity called HelloWebView.</li>
- <li>Open the layout file. Insert a WebView so it looks like so:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical">
-
- <WebView
- android:id="@+id/webview"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- />
-
-</LinearLayout>
-</pre></li>
-
- <li>Now open the HelloWebView.java file.
- At the top of the class, instantiate a WebView object:
-<pre>WebView webview;</pre>
- <p> Then add the following at the end of the <code>onCreate()</code> method:</p>
-<pre>
-webview = (WebView) findViewById(R.id.webview);
-webview.getSettings().setJavaScriptEnabled(true);
-webview.loadUrl("http://www.google.com");
-</pre>
-
- <p>This captures the WebView we created in our layout, then requests a
- {@link android.webkit.WebSettings} object and enables JavaScript.
- Then we load a URL.</p></li>
-
- <li>Because we're accessing the internet, we need to add the appropriate
- permissions to the Android manifest file. So open the AndroidManifest.xml file
- and, add the following as a child of the <code><manifest></code> element:
-
- <pre><uses-permission android:name="android.permission.INTERNET" /></pre></li>
-
- <li>Now run it.</li>
-</ol>
-<p> You now have the world's simplest web page viewer.
- It's not quite a browser yet. It only loads the page we've requested.</p>
-
-<hr/>
-
-<p>We can load a page, but as soon as we click a link, the default Android web browser
-handles the Intent, instead of our own WebView handling the action. So now we'll
-override the {@link android.webkit.WebViewClient} to enable us to handle our own URL loading.</p>
-
-<ol>
- <li>In the HelloAndroid Activity, add this nested private class:
-<pre>
-private class HelloWebViewClient extends WebViewClient {
- @Override
- public boolean shouldOverrideUrlLoading(WebView view, String url) {
- view.loadUrl(url);
- return true;
- }
-}</pre></li>
-
- <li>Now, in the <code>onCreate()</code> method, set an instance of the <code>HelloWebViewClient</code>
- as our WebViewClient:
- <pre>webview.setWebViewClient(new HelloWebViewClient());</pre>
-
- <p>This line should immediately follow the initialization of our WebView object.</p>
- <p>What we've done is create a WebViewClient that will load any URL selected in our
-WebView in the same WebView. You can see this in the <code>shouldOverrideUrlLoading()</code>
-method, above—it is passed the current WebView and the URL, so all we do
-is load the URL in the given view. Returning <var>true</var> says that we've handled the URL
-ourselves and the event should not bubble-up.</p>
- <p>If you try it again, new pages will now load in the HelloWebView Activity. However, you'll notice that
-we can't navigate back. We need to handle the back button
-on the device, so that it will return to the previous page, rather than exit the application.</p>
- </li>
-
- <li>To handle the back button key press, add the following method inside the HelloWebView
-Activity:
-<pre>
-@Override
-public boolean onKeyDown(int keyCode, KeyEvent event) {
- if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) {
- webview.goBack();
- return true;
- }
- return super.onKeyDown(keyCode, event);
-}</pre>
- <p>The condition uses a {@link android.view.KeyEvent} to check
- whether the key pressed is the BACK button and whether the
- WebView is actually capable of navigating back (if it has a history). If both are
- <em>not</em> true, then we send the event up the chain (and the Activity will close).
- But if both <em>are</em> true, then we call <code>goBack()</code>,
- which will navigate back one step in the history. We then return true to indicate
- that we've handled the event.</p>
-</li>
-</ol>
-<p>When you open the application, it should look like this:</p>
-<img src="images/hello-webview.png" width="150px" />
-
-<h3>Resource</h3>
-<ul>
-<li>{@link android.webkit.WebView}</li>
-<li>{@link android.webkit.WebViewClient}</li>
-<li>{@link android.view.KeyEvent}</li>
-</ul>
-
-
-
-
-
diff --git a/docs/html/guide/tutorials/views/images/android.png b/docs/html/guide/tutorials/views/images/android.png
deleted file mode 100755
index 39a1ac7..0000000
--- a/docs/html/guide/tutorials/views/images/android.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/androidmarker.png b/docs/html/guide/tutorials/views/images/androidmarker.png
deleted file mode 100755
index 8c43d46..0000000
--- a/docs/html/guide/tutorials/views/images/androidmarker.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-autocomplete.png b/docs/html/guide/tutorials/views/images/hello-autocomplete.png
deleted file mode 100755
index e1fd80d..0000000
--- a/docs/html/guide/tutorials/views/images/hello-autocomplete.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-datepicker.png b/docs/html/guide/tutorials/views/images/hello-datepicker.png
deleted file mode 100755
index 2075066..0000000
--- a/docs/html/guide/tutorials/views/images/hello-datepicker.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-formstuff.png b/docs/html/guide/tutorials/views/images/hello-formstuff.png
deleted file mode 100755
index 3b4bf54..0000000
--- a/docs/html/guide/tutorials/views/images/hello-formstuff.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-listview.png b/docs/html/guide/tutorials/views/images/hello-listview.png
deleted file mode 100755
index a1cf7aa..0000000
--- a/docs/html/guide/tutorials/views/images/hello-listview.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-mapview.png b/docs/html/guide/tutorials/views/images/hello-mapview.png
deleted file mode 100755
index 0956760..0000000
--- a/docs/html/guide/tutorials/views/images/hello-mapview.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-spinner.png b/docs/html/guide/tutorials/views/images/hello-spinner.png
deleted file mode 100755
index 42e2a91..0000000
--- a/docs/html/guide/tutorials/views/images/hello-spinner.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-tabwidget.png b/docs/html/guide/tutorials/views/images/hello-tabwidget.png
deleted file mode 100644
index 6a52356..0000000
--- a/docs/html/guide/tutorials/views/images/hello-tabwidget.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-timepicker.png b/docs/html/guide/tutorials/views/images/hello-timepicker.png
deleted file mode 100755
index bd5a1ee..0000000
--- a/docs/html/guide/tutorials/views/images/hello-timepicker.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/views/images/hello-webview.png b/docs/html/guide/tutorials/views/images/hello-webview.png
deleted file mode 100755
index 283ce7d..0000000
--- a/docs/html/guide/tutorials/views/images/hello-webview.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/guide/tutorials/views/index.html b/docs/html/guide/tutorials/views/index.html
deleted file mode 100644
index 41d6796..0000000
--- a/docs/html/guide/tutorials/views/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=http://developer.android.com/resources/tutorials/views/index.html">
-<title>Redirecting...</title>
-</head>
-<body>
-<p>You should have been redirected. Please <a
-href="http://developer.android.com/resources/tutorials/views/index.html">click here</a>.</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/guide/webapps/debugging.jd b/docs/html/guide/webapps/debugging.jd
index c0dce48..1eef1ae 100644
--- a/docs/html/guide/webapps/debugging.jd
+++ b/docs/html/guide/webapps/debugging.jd
@@ -18,7 +18,7 @@
<h2>See also</h2>
<ol>
- <li><a href="{@docRoot}guide/developing/debugging/index.html">Debugging</a></li>
+ <li><a href="{@docRoot}tools/debugging/index.html">Debugging</a></li>
</ol>
</div>
@@ -43,10 +43,10 @@
those written using JavaScript {@code console} APIs.</p>
<p>To run logcat and view messages, execute
{@code adb logcat} from your Android SDK {@code tools/} directory, or, from DDMS, select
-<strong>Device > Run logcat</strong>. When using the <a href="{@docRoot}sdk/eclipse-adt.html">ADT
+<strong>Device > Run logcat</strong>. When using the <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT
plugin for Eclipse</a>, you can also view logcat messages by opening the Logcat view, available from
<strong>Window > Show View > Other > Android > Logcat</strong>.</p>
- <p>See <a href="{@docRoot}guide/developing/debugging/debugging-log.html">Debugging</a>
+ <p>See <a href="{@docRoot}tools/debugging/debugging-log.html">Debugging</a>
for more information about <codelogcat</code>.</p>
</div>
</div>
diff --git a/docs/html/guide/webapps/index.jd b/docs/html/guide/webapps/index.jd
index 069290a..df7ddbe 100644
--- a/docs/html/guide/webapps/index.jd
+++ b/docs/html/guide/webapps/index.jd
@@ -1,71 +1,16 @@
-page.title=Web Apps Overview
+page.title=Web Apps
+page.landing=true
+page.landing.intro=Android has always been about connectivity and providing a great web browsing experience, so building your app with web technologies can be a great opportunity. Not only can you build an app on the web and still optimize your designs for Android's various screen sizes and densities, but you can also embed web-based content into your Android app using WebView.
+page.landing.image=
+
@jd:body
-<div class="figure" style="width:327px">
- <img src="{@docRoot}images/webapps/webapps.png" alt="" />
- <p class="img-caption"><strong>Figure 1.</strong> You can make your web content available to
-users in two ways: in a traditional web browser and in an Android application, by
-including a WebView in the layout.</p>
-</div>
+<div class="landing-docs">
-<p>There are essentially two ways to deliver an application on Android: as a
-client-side application (developed using the Android SDK and installed on user devices as an {@code
-.apk}) or as a web application (developed using web standards and accessed through a web
-browser—there's nothing to install on user devices).</p>
+ <div class="col-6">
+ </div>
-<p>The approach you choose for your application could depend on several factors, but Android makes
-the decision to develop a web application easier by providing:</p>
-<ul>
- <li>Support for viewport properties that allow you to properly size your web application
-based on the screen size</li>
- <li>CSS and JavaScript features that allow you to provide different styles and images
-based on the screen's pixel density (screen resolution)</li>
-</ul>
+ <div class="col-6">
+ </div>
-<p>Thus, your decision to develop a web application for Android can exclude consideration for
-screen support, because it's already easy to make your web pages look good on all types of screens
-powered by Android.</p>
-
-<p>Another great feature of Android is that you don't have to build your application purely on
-the client or purely on the web. You can mix the two together by developing a client-side Android
-application that embeds some web pages (using a {@link android.webkit.WebView} in your Android
-application layout). Figure 1 visualizes how you can provide access to your web pages from either
-a web browser or your Android application. However, you shouldn't develop an Android
-application simply as a means to launch your web site. Rather, the web pages you embed in your
-Android application should be designed especially for that environment. You can even define an
-interface between your Android application and your web pages that allows JavaScript in the web
-pages to call upon APIs in your Android application—providing Android APIs to your web-based
-application.</p>
-
-<p>Since Android 1.0, {@link android.webkit.WebView} has been available for Android
-applications to embed web content in their layout and bind JavaScript to Android APIs. After
-Android added support for more screen densities (adding support for high and low-density
-screens), Android 2.0 added features to the WebKit framework to allow web pages to specify
-viewport properties and query the screen density in order to modify styles
-and image assets, as mentioned above. Because these features are a part of Android's WebKit
-framework, both the Android Browser (the default web browser provided with the platform) and
-{@link android.webkit.WebView} support the same viewport and screen density features.</p>
-
-<p>To develop a web application for Android-powered devices, you should read the
-following documents:</p>
-
-<dl>
- <dt><a href="{@docRoot}guide/webapps/targeting.html"><strong>Targeting Screens from Web
-Apps</strong></a></dt>
- <dd>How to properly size your web app on Android-powered devices and support
-multiple screen densities. The information in this document is important if you're building a web
-application that you at least expect to be available on Android-powered devices (which you should
-assume for anything you publish on the web), but especially if you're targeting mobile devices
-or using {@link android.webkit.WebView}.</dd>
- <dt><a href="{@docRoot}guide/webapps/webview.html"><strong>Building Web Apps in
-WebView</strong></a></dt>
- <dd>How to embed web pages into your Android application using {@link android.webkit.WebView} and
-bind JavaScript to Android APIs.</dd>
- <dt><a href="{@docRoot}guide/webapps/debugging.html"><strong>Debugging Web Apps</strong></a></dt>
- <dd>How to debug web apps using JavaScript Console APIs.</dd>
- <dt><a href="{@docRoot}guide/webapps/best-practices.html"><strong>Best Practices for Web
-Apps</strong></a></dt>
- <dd>A list of practices you should follow, in order to provide an effective web application on
-Android-powered devices.</dd>
-</dl>
-
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/webapps/overview.jd b/docs/html/guide/webapps/overview.jd
new file mode 100644
index 0000000..069290a
--- /dev/null
+++ b/docs/html/guide/webapps/overview.jd
@@ -0,0 +1,71 @@
+page.title=Web Apps Overview
+@jd:body
+
+<div class="figure" style="width:327px">
+ <img src="{@docRoot}images/webapps/webapps.png" alt="" />
+ <p class="img-caption"><strong>Figure 1.</strong> You can make your web content available to
+users in two ways: in a traditional web browser and in an Android application, by
+including a WebView in the layout.</p>
+</div>
+
+<p>There are essentially two ways to deliver an application on Android: as a
+client-side application (developed using the Android SDK and installed on user devices as an {@code
+.apk}) or as a web application (developed using web standards and accessed through a web
+browser—there's nothing to install on user devices).</p>
+
+<p>The approach you choose for your application could depend on several factors, but Android makes
+the decision to develop a web application easier by providing:</p>
+<ul>
+ <li>Support for viewport properties that allow you to properly size your web application
+based on the screen size</li>
+ <li>CSS and JavaScript features that allow you to provide different styles and images
+based on the screen's pixel density (screen resolution)</li>
+</ul>
+
+<p>Thus, your decision to develop a web application for Android can exclude consideration for
+screen support, because it's already easy to make your web pages look good on all types of screens
+powered by Android.</p>
+
+<p>Another great feature of Android is that you don't have to build your application purely on
+the client or purely on the web. You can mix the two together by developing a client-side Android
+application that embeds some web pages (using a {@link android.webkit.WebView} in your Android
+application layout). Figure 1 visualizes how you can provide access to your web pages from either
+a web browser or your Android application. However, you shouldn't develop an Android
+application simply as a means to launch your web site. Rather, the web pages you embed in your
+Android application should be designed especially for that environment. You can even define an
+interface between your Android application and your web pages that allows JavaScript in the web
+pages to call upon APIs in your Android application—providing Android APIs to your web-based
+application.</p>
+
+<p>Since Android 1.0, {@link android.webkit.WebView} has been available for Android
+applications to embed web content in their layout and bind JavaScript to Android APIs. After
+Android added support for more screen densities (adding support for high and low-density
+screens), Android 2.0 added features to the WebKit framework to allow web pages to specify
+viewport properties and query the screen density in order to modify styles
+and image assets, as mentioned above. Because these features are a part of Android's WebKit
+framework, both the Android Browser (the default web browser provided with the platform) and
+{@link android.webkit.WebView} support the same viewport and screen density features.</p>
+
+<p>To develop a web application for Android-powered devices, you should read the
+following documents:</p>
+
+<dl>
+ <dt><a href="{@docRoot}guide/webapps/targeting.html"><strong>Targeting Screens from Web
+Apps</strong></a></dt>
+ <dd>How to properly size your web app on Android-powered devices and support
+multiple screen densities. The information in this document is important if you're building a web
+application that you at least expect to be available on Android-powered devices (which you should
+assume for anything you publish on the web), but especially if you're targeting mobile devices
+or using {@link android.webkit.WebView}.</dd>
+ <dt><a href="{@docRoot}guide/webapps/webview.html"><strong>Building Web Apps in
+WebView</strong></a></dt>
+ <dd>How to embed web pages into your Android application using {@link android.webkit.WebView} and
+bind JavaScript to Android APIs.</dd>
+ <dt><a href="{@docRoot}guide/webapps/debugging.html"><strong>Debugging Web Apps</strong></a></dt>
+ <dd>How to debug web apps using JavaScript Console APIs.</dd>
+ <dt><a href="{@docRoot}guide/webapps/best-practices.html"><strong>Best Practices for Web
+Apps</strong></a></dt>
+ <dd>A list of practices you should follow, in order to provide an effective web application on
+Android-powered devices.</dd>
+</dl>
+
diff --git a/docs/html/images/about/growth-chart.png b/docs/html/images/about/growth-chart.png
new file mode 100644
index 0000000..fee4e09
--- /dev/null
+++ b/docs/html/images/about/growth-chart.png
Binary files differ
diff --git a/docs/html/images/activity_fragment_lifecycle.png b/docs/html/images/activity_fragment_lifecycle.png
index bab9579..c447774 100644
--- a/docs/html/images/activity_fragment_lifecycle.png
+++ b/docs/html/images/activity_fragment_lifecycle.png
Binary files differ
diff --git a/docs/html/images/activity_lifecycle.png b/docs/html/images/activity_lifecycle.png
index 357349c..879f51f 100644
--- a/docs/html/images/activity_lifecycle.png
+++ b/docs/html/images/activity_lifecycle.png
Binary files differ
diff --git a/docs/html/images/android-logo.png b/docs/html/images/android-logo.png
new file mode 100644
index 0000000..d72fed1
--- /dev/null
+++ b/docs/html/images/android-logo.png
Binary files differ
diff --git a/docs/html/images/billing_subscription_flow.png b/docs/html/images/billing_subscription_flow.png
new file mode 100644
index 0000000..a293228
--- /dev/null
+++ b/docs/html/images/billing_subscription_flow.png
Binary files differ
diff --git a/docs/html/images/brand/android_app_on_play_logo_large.png b/docs/html/images/brand/android_app_on_play_logo_large.png
new file mode 100644
index 0000000..a46bf35
--- /dev/null
+++ b/docs/html/images/brand/android_app_on_play_logo_large.png
Binary files differ
diff --git a/docs/html/images/brand/android_app_on_play_logo_small.png b/docs/html/images/brand/android_app_on_play_logo_small.png
new file mode 100644
index 0000000..2d8ef52
--- /dev/null
+++ b/docs/html/images/brand/android_app_on_play_logo_small.png
Binary files differ
diff --git a/docs/html/images/brand/droid.gif b/docs/html/images/brand/droid.gif
new file mode 100644
index 0000000..7c7b941
--- /dev/null
+++ b/docs/html/images/brand/droid.gif
Binary files differ
diff --git a/docs/html/images/brand/get_it_on_play_logo_large.png b/docs/html/images/brand/get_it_on_play_logo_large.png
new file mode 100644
index 0000000..8b48767f
--- /dev/null
+++ b/docs/html/images/brand/get_it_on_play_logo_large.png
Binary files differ
diff --git a/docs/html/images/brand/get_it_on_play_logo_small.png b/docs/html/images/brand/get_it_on_play_logo_small.png
new file mode 100644
index 0000000..1fcbec8
--- /dev/null
+++ b/docs/html/images/brand/get_it_on_play_logo_small.png
Binary files differ
diff --git a/docs/html/images/brand/google_play_logo_450.png b/docs/html/images/brand/google_play_logo_450.png
new file mode 100644
index 0000000..59a1fcf
--- /dev/null
+++ b/docs/html/images/brand/google_play_logo_450.png
Binary files differ
diff --git a/docs/html/images/brand/learnmore.gif b/docs/html/images/brand/learnmore.gif
new file mode 100644
index 0000000..70a8e6b
--- /dev/null
+++ b/docs/html/images/brand/learnmore.gif
Binary files differ
diff --git a/docs/html/images/brand/logo_android.gif b/docs/html/images/brand/logo_android.gif
new file mode 100644
index 0000000..169c764
--- /dev/null
+++ b/docs/html/images/brand/logo_android.gif
Binary files differ
diff --git a/docs/html/images/brand/mediaplayer.gif b/docs/html/images/brand/mediaplayer.gif
new file mode 100644
index 0000000..860d110
--- /dev/null
+++ b/docs/html/images/brand/mediaplayer.gif
Binary files differ
diff --git a/docs/html/images/brand/norad.gif b/docs/html/images/brand/norad.gif
new file mode 100644
index 0000000..d8707bd
--- /dev/null
+++ b/docs/html/images/brand/norad.gif
Binary files differ
diff --git a/docs/html/images/dac-design-icon.png b/docs/html/images/dac-design-icon.png
new file mode 100644
index 0000000..245f0801
--- /dev/null
+++ b/docs/html/images/dac-design-icon.png
Binary files differ
diff --git a/docs/html/images/debugging-tall.png b/docs/html/images/debugging-tall.png
new file mode 100644
index 0000000..d29c4d1
--- /dev/null
+++ b/docs/html/images/debugging-tall.png
Binary files differ
diff --git a/docs/html/images/develop-placeholder.png b/docs/html/images/develop-placeholder.png
new file mode 100644
index 0000000..35a8767
--- /dev/null
+++ b/docs/html/images/develop-placeholder.png
Binary files differ
diff --git a/docs/html/images/develop/app_components.png b/docs/html/images/develop/app_components.png
new file mode 100644
index 0000000..0e3460d
--- /dev/null
+++ b/docs/html/images/develop/app_components.png
Binary files differ
diff --git a/docs/html/images/develop/auth-code.png b/docs/html/images/develop/auth-code.png
new file mode 100644
index 0000000..6dfabf9
--- /dev/null
+++ b/docs/html/images/develop/auth-code.png
Binary files differ
diff --git a/docs/html/images/develop/connectivity.png b/docs/html/images/develop/connectivity.png
new file mode 100644
index 0000000..2c9dadb
--- /dev/null
+++ b/docs/html/images/develop/connectivity.png
Binary files differ
diff --git a/docs/html/images/develop/marquee-play.png b/docs/html/images/develop/marquee-play.png
new file mode 100644
index 0000000..de8802d
--- /dev/null
+++ b/docs/html/images/develop/marquee-play.png
Binary files differ
diff --git a/docs/html/images/develop/resources.png b/docs/html/images/develop/resources.png
new file mode 100644
index 0000000..f6cbf5d
--- /dev/null
+++ b/docs/html/images/develop/resources.png
Binary files differ
diff --git a/docs/html/images/distribute/feature-market.png b/docs/html/images/distribute/feature-market.png
new file mode 100644
index 0000000..e9d3abf
--- /dev/null
+++ b/docs/html/images/distribute/feature-market.png
Binary files differ
diff --git a/docs/html/images/distribute/feature-monetize.png b/docs/html/images/distribute/feature-monetize.png
new file mode 100644
index 0000000..4b1b509
--- /dev/null
+++ b/docs/html/images/distribute/feature-monetize.png
Binary files differ
diff --git a/docs/html/images/distribute/feature-register.png b/docs/html/images/distribute/feature-register.png
new file mode 100644
index 0000000..ad387bf
--- /dev/null
+++ b/docs/html/images/distribute/feature-register.png
Binary files differ
diff --git a/docs/html/images/distribute/marquee-play.png b/docs/html/images/distribute/marquee-play.png
new file mode 100644
index 0000000..1aa4823
--- /dev/null
+++ b/docs/html/images/distribute/marquee-play.png
Binary files differ
diff --git a/docs/html/images/editorschoice_ann.png b/docs/html/images/editorschoice_ann.png
new file mode 100644
index 0000000..c4f2c06
--- /dev/null
+++ b/docs/html/images/editorschoice_ann.png
Binary files differ
diff --git a/docs/html/images/fragment_lifecycle.png b/docs/html/images/fragment_lifecycle.png
index d207db4..fcaa63b 100644
--- a/docs/html/images/fragment_lifecycle.png
+++ b/docs/html/images/fragment_lifecycle.png
Binary files differ
diff --git a/docs/html/images/fundamentals/diagram_backstack.png b/docs/html/images/fundamentals/diagram_backstack.png
index bdb6893..5ddadcb 100644
--- a/docs/html/images/fundamentals/diagram_backstack.png
+++ b/docs/html/images/fundamentals/diagram_backstack.png
Binary files differ
diff --git a/docs/html/images/fundamentals/diagram_backstack_singletask_multiactivity.png b/docs/html/images/fundamentals/diagram_backstack_singletask_multiactivity.png
index aab324d..b9e5ed4 100644
--- a/docs/html/images/fundamentals/diagram_backstack_singletask_multiactivity.png
+++ b/docs/html/images/fundamentals/diagram_backstack_singletask_multiactivity.png
Binary files differ
diff --git a/docs/html/images/fundamentals/diagram_multiple_instances.png b/docs/html/images/fundamentals/diagram_multiple_instances.png
index 64b476f..606f540 100644
--- a/docs/html/images/fundamentals/diagram_multiple_instances.png
+++ b/docs/html/images/fundamentals/diagram_multiple_instances.png
Binary files differ
diff --git a/docs/html/images/fundamentals/diagram_multitasking.png b/docs/html/images/fundamentals/diagram_multitasking.png
index e219599..ffe5c65 100644
--- a/docs/html/images/fundamentals/diagram_multitasking.png
+++ b/docs/html/images/fundamentals/diagram_multitasking.png
Binary files differ
diff --git a/docs/html/images/fundamentals/fragments.png b/docs/html/images/fundamentals/fragments.png
index bf986b1..cb7204b 100644
--- a/docs/html/images/fundamentals/fragments.png
+++ b/docs/html/images/fundamentals/fragments.png
Binary files differ
diff --git a/docs/html/images/fundamentals/restore_instance.png b/docs/html/images/fundamentals/restore_instance.png
index 57a95ec..698b83a 100644
--- a/docs/html/images/fundamentals/restore_instance.png
+++ b/docs/html/images/fundamentals/restore_instance.png
Binary files differ
diff --git a/docs/html/images/fundamentals/service_binding_tree_lifecycle.png b/docs/html/images/fundamentals/service_binding_tree_lifecycle.png
index 5265216..8b826f6 100644
--- a/docs/html/images/fundamentals/service_binding_tree_lifecycle.png
+++ b/docs/html/images/fundamentals/service_binding_tree_lifecycle.png
Binary files differ
diff --git a/docs/html/images/gp-apps-home.png b/docs/html/images/gp-apps-home.png
new file mode 100644
index 0000000..851f722
--- /dev/null
+++ b/docs/html/images/gp-apps-home.png
Binary files differ
diff --git a/docs/html/images/gp-buyer-currency.png b/docs/html/images/gp-buyer-currency.png
new file mode 100644
index 0000000..51b8108
--- /dev/null
+++ b/docs/html/images/gp-buyer-currency.png
Binary files differ
diff --git a/docs/html/images/gp-collectibles.png b/docs/html/images/gp-collectibles.png
new file mode 100644
index 0000000..a63cd50
--- /dev/null
+++ b/docs/html/images/gp-collectibles.png
Binary files differ
diff --git a/docs/html/images/gp-dc-countries.png b/docs/html/images/gp-dc-countries.png
new file mode 100644
index 0000000..00d0d5e
--- /dev/null
+++ b/docs/html/images/gp-dc-countries.png
Binary files differ
diff --git a/docs/html/images/gp-dc-details.png b/docs/html/images/gp-dc-details.png
new file mode 100644
index 0000000..567567e
--- /dev/null
+++ b/docs/html/images/gp-dc-details.png
Binary files differ
diff --git a/docs/html/images/gp-dc-home.png b/docs/html/images/gp-dc-home.png
new file mode 100644
index 0000000..381d0db
--- /dev/null
+++ b/docs/html/images/gp-dc-home.png
Binary files differ
diff --git a/docs/html/images/gp-dc-profile.png b/docs/html/images/gp-dc-profile.png
new file mode 100644
index 0000000..e526369
--- /dev/null
+++ b/docs/html/images/gp-dc-profile.png
Binary files differ
diff --git a/docs/html/images/gp-dc-reviews.png b/docs/html/images/gp-dc-reviews.png
new file mode 100644
index 0000000..cab175a
--- /dev/null
+++ b/docs/html/images/gp-dc-reviews.png
Binary files differ
diff --git a/docs/html/images/gp-dc-stats-mini.png b/docs/html/images/gp-dc-stats-mini.png
new file mode 100644
index 0000000..d29a270
--- /dev/null
+++ b/docs/html/images/gp-dc-stats-mini.png
Binary files differ
diff --git a/docs/html/images/gp-dc-stats.png b/docs/html/images/gp-dc-stats.png
new file mode 100644
index 0000000..06f88e5
--- /dev/null
+++ b/docs/html/images/gp-dc-stats.png
Binary files differ
diff --git a/docs/html/images/gp-details-pages-magicpiano.png b/docs/html/images/gp-details-pages-magicpiano.png
new file mode 100644
index 0000000..4bb1962
--- /dev/null
+++ b/docs/html/images/gp-details-pages-magicpiano.png
Binary files differ
diff --git a/docs/html/images/gp-details-ww-purchase.png b/docs/html/images/gp-details-ww-purchase.png
new file mode 100644
index 0000000..46df443
--- /dev/null
+++ b/docs/html/images/gp-details-ww-purchase.png
Binary files differ
diff --git a/docs/html/images/gp-details-ww.png b/docs/html/images/gp-details-ww.png
new file mode 100644
index 0000000..ccc522c
--- /dev/null
+++ b/docs/html/images/gp-details-ww.png
Binary files differ
diff --git a/docs/html/images/gp-devconsole-home.png b/docs/html/images/gp-devconsole-home.png
new file mode 100644
index 0000000..1d758fd
--- /dev/null
+++ b/docs/html/images/gp-devconsole-home.png
Binary files differ
diff --git a/docs/html/images/gp-device.png b/docs/html/images/gp-device.png
new file mode 100644
index 0000000..86e46e5
--- /dev/null
+++ b/docs/html/images/gp-device.png
Binary files differ
diff --git a/docs/html/images/gp-games-home.png b/docs/html/images/gp-games-home.png
new file mode 100644
index 0000000..81b7f7a
--- /dev/null
+++ b/docs/html/images/gp-games-home.png
Binary files differ
diff --git a/docs/html/images/gp-growth-downloads.png b/docs/html/images/gp-growth-downloads.png
new file mode 100644
index 0000000..4a4b194
--- /dev/null
+++ b/docs/html/images/gp-growth-downloads.png
Binary files differ
diff --git a/docs/html/images/gp-rating-web.png b/docs/html/images/gp-rating-web.png
new file mode 100644
index 0000000..0885826
--- /dev/null
+++ b/docs/html/images/gp-rating-web.png
Binary files differ
diff --git a/docs/html/images/gp-sendto.png b/docs/html/images/gp-sendto.png
new file mode 100644
index 0000000..7409c14
--- /dev/null
+++ b/docs/html/images/gp-sendto.png
Binary files differ
diff --git a/docs/html/images/gp-subs.png b/docs/html/images/gp-subs.png
new file mode 100644
index 0000000..9b3a7df
--- /dev/null
+++ b/docs/html/images/gp-subs.png
Binary files differ
diff --git a/docs/html/images/gp-supported-dev-requirements.png b/docs/html/images/gp-supported-dev-requirements.png
new file mode 100644
index 0000000..d84f34e
--- /dev/null
+++ b/docs/html/images/gp-supported-dev-requirements.png
Binary files differ
diff --git a/docs/html/images/gp-tab.png b/docs/html/images/gp-tab.png
new file mode 100644
index 0000000..4673d21
--- /dev/null
+++ b/docs/html/images/gp-tab.png
Binary files differ
diff --git a/docs/html/images/gp-top-new-paid.png b/docs/html/images/gp-top-new-paid.png
new file mode 100644
index 0000000..d98d6ca
--- /dev/null
+++ b/docs/html/images/gp-top-new-paid.png
Binary files differ
diff --git a/docs/html/images/gpp-cat-feature280-photo.png b/docs/html/images/gpp-cat-feature280-photo.png
new file mode 100644
index 0000000..ae2749b
--- /dev/null
+++ b/docs/html/images/gpp-cat-feature280-photo.png
Binary files differ
diff --git a/docs/html/images/gpp-cat-feature280-puzzle.png b/docs/html/images/gpp-cat-feature280-puzzle.png
new file mode 100644
index 0000000..db203c6
--- /dev/null
+++ b/docs/html/images/gpp-cat-feature280-puzzle.png
Binary files differ
diff --git a/docs/html/images/gpp-cat-feature280-sports.png b/docs/html/images/gpp-cat-feature280-sports.png
new file mode 100644
index 0000000..dcd70aa
--- /dev/null
+++ b/docs/html/images/gpp-cat-feature280-sports.png
Binary files differ
diff --git a/docs/html/images/home-marquee.jpg b/docs/html/images/home-marquee.jpg
new file mode 100644
index 0000000..94d83d7
--- /dev/null
+++ b/docs/html/images/home-marquee.jpg
Binary files differ
diff --git a/docs/html/images/home/design.png b/docs/html/images/home/design.png
new file mode 100644
index 0000000..bbaa767
--- /dev/null
+++ b/docs/html/images/home/design.png
Binary files differ
diff --git a/docs/html/images/home/developers_live.png b/docs/html/images/home/developers_live.png
new file mode 100644
index 0000000..13dbb5c
--- /dev/null
+++ b/docs/html/images/home/developers_live.png
Binary files differ
diff --git a/docs/html/images/home/google-io.png b/docs/html/images/home/google-io.png
new file mode 100644
index 0000000..d21a24d
--- /dev/null
+++ b/docs/html/images/home/google-io.png
Binary files differ
diff --git a/docs/html/images/home/google-play.png b/docs/html/images/home/google-play.png
new file mode 100644
index 0000000..2032154
--- /dev/null
+++ b/docs/html/images/home/google-play.png
Binary files differ
diff --git a/docs/html/images/home/ics-android.png b/docs/html/images/home/ics-android.png
new file mode 100644
index 0000000..f4c3b5b
--- /dev/null
+++ b/docs/html/images/home/ics-android.png
Binary files differ
diff --git a/docs/html/images/layoutparams.png b/docs/html/images/layoutparams.png
index d99625e..ac31e44 100644
--- a/docs/html/images/layoutparams.png
+++ b/docs/html/images/layoutparams.png
Binary files differ
diff --git a/docs/html/images/market/version-codes.png b/docs/html/images/market/version-codes.png
index c0c9858..aa4fd41 100644
--- a/docs/html/images/market/version-codes.png
+++ b/docs/html/images/market/version-codes.png
Binary files differ
diff --git a/docs/html/images/opengl/ccw-square.png b/docs/html/images/opengl/ccw-square.png
new file mode 100644
index 0000000..010def9
--- /dev/null
+++ b/docs/html/images/opengl/ccw-square.png
Binary files differ
diff --git a/docs/html/images/opengl/ccw-winding.png b/docs/html/images/opengl/ccw-winding.png
new file mode 100644
index 0000000..a7ece31
--- /dev/null
+++ b/docs/html/images/opengl/ccw-winding.png
Binary files differ
diff --git a/docs/html/images/opengl/coordinates.png b/docs/html/images/opengl/coordinates.png
index 7180cd5..7a02cdd 100644
--- a/docs/html/images/opengl/coordinates.png
+++ b/docs/html/images/opengl/coordinates.png
Binary files differ
diff --git a/docs/html/images/opengl/helloopengl-es10-1.png b/docs/html/images/opengl/helloopengl-es10-1.png
deleted file mode 100644
index 9aa2376..0000000
--- a/docs/html/images/opengl/helloopengl-es10-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/images/opengl/helloopengl-es10-2.png b/docs/html/images/opengl/helloopengl-es10-2.png
deleted file mode 100644
index cdfd9c705..0000000
--- a/docs/html/images/opengl/helloopengl-es10-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/images/opengl/helloopengl-es20-1.png b/docs/html/images/opengl/helloopengl-es20-1.png
deleted file mode 100644
index 1f76c22..0000000
--- a/docs/html/images/opengl/helloopengl-es20-1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/images/opengl/helloopengl-es20-2.png b/docs/html/images/opengl/helloopengl-es20-2.png
deleted file mode 100644
index 0fbbe60..0000000
--- a/docs/html/images/opengl/helloopengl-es20-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/images/opengl/ogl-triangle-projected.png b/docs/html/images/opengl/ogl-triangle-projected.png
new file mode 100644
index 0000000..d10bbdc
--- /dev/null
+++ b/docs/html/images/opengl/ogl-triangle-projected.png
Binary files differ
diff --git a/docs/html/images/opengl/ogl-triangle-touch.png b/docs/html/images/opengl/ogl-triangle-touch.png
new file mode 100644
index 0000000..35177a4
--- /dev/null
+++ b/docs/html/images/opengl/ogl-triangle-touch.png
Binary files differ
diff --git a/docs/html/images/opengl/ogl-triangle.png b/docs/html/images/opengl/ogl-triangle.png
new file mode 100644
index 0000000..3d4a385
--- /dev/null
+++ b/docs/html/images/opengl/ogl-triangle.png
Binary files differ
diff --git a/docs/html/images/play_tableft.png b/docs/html/images/play_tableft.png
new file mode 100644
index 0000000..14740cb
--- /dev/null
+++ b/docs/html/images/play_tableft.png
Binary files differ
diff --git a/docs/html/images/providers/ContactsDataFlow.png b/docs/html/images/providers/ContactsDataFlow.png
new file mode 100644
index 0000000..403afc7
--- /dev/null
+++ b/docs/html/images/providers/ContactsDataFlow.png
Binary files differ
diff --git a/docs/html/images/providers/contacts_structure.png b/docs/html/images/providers/contacts_structure.png
new file mode 100644
index 0000000..3cdc5de
--- /dev/null
+++ b/docs/html/images/providers/contacts_structure.png
Binary files differ
diff --git a/docs/html/images/providers/contacts_tables.png b/docs/html/images/providers/contacts_tables.png
new file mode 100644
index 0000000..c449948
--- /dev/null
+++ b/docs/html/images/providers/contacts_tables.png
Binary files differ
diff --git a/docs/html/images/providers/data_columns.png b/docs/html/images/providers/data_columns.png
new file mode 100644
index 0000000..6e9d90e
--- /dev/null
+++ b/docs/html/images/providers/data_columns.png
Binary files differ
diff --git a/docs/html/images/publishing/publishing_unknown_sources.png b/docs/html/images/publishing/publishing_unknown_sources.png
deleted file mode 100755
index ad310a1..0000000
--- a/docs/html/images/publishing/publishing_unknown_sources.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/images/publishing/publishing_unknown_sources_sm.png b/docs/html/images/publishing/publishing_unknown_sources_sm.png
new file mode 100644
index 0000000..34cba2a
--- /dev/null
+++ b/docs/html/images/publishing/publishing_unknown_sources_sm.png
Binary files differ
diff --git a/docs/html/images/publishing/publishing_via_email.png b/docs/html/images/publishing/publishing_via_email.png
index 54c64bd..d367747 100755
--- a/docs/html/images/publishing/publishing_via_email.png
+++ b/docs/html/images/publishing/publishing_via_email.png
Binary files differ
diff --git a/docs/html/images/resources/res-selection-flowchart.png b/docs/html/images/resources/res-selection-flowchart.png
index 5de7688..149f4dc 100644
--- a/docs/html/images/resources/res-selection-flowchart.png
+++ b/docs/html/images/resources/res-selection-flowchart.png
Binary files differ
diff --git a/docs/html/images/resources/resource_devices_diagram1.png b/docs/html/images/resources/resource_devices_diagram1.png
index 0b3c856..e2f515f 100644
--- a/docs/html/images/resources/resource_devices_diagram1.png
+++ b/docs/html/images/resources/resource_devices_diagram1.png
Binary files differ
diff --git a/docs/html/images/resources/resource_devices_diagram2.png b/docs/html/images/resources/resource_devices_diagram2.png
index d32a781..f0a3886 100644
--- a/docs/html/images/resources/resource_devices_diagram2.png
+++ b/docs/html/images/resources/resource_devices_diagram2.png
Binary files differ
diff --git a/docs/html/images/robot-sdk.png b/docs/html/images/robot-sdk.png
new file mode 100644
index 0000000..962d4d5
--- /dev/null
+++ b/docs/html/images/robot-sdk.png
Binary files differ
diff --git a/docs/html/images/robot-tiny.png b/docs/html/images/robot-tiny.png
new file mode 100644
index 0000000..f925062
--- /dev/null
+++ b/docs/html/images/robot-tiny.png
Binary files differ
diff --git a/docs/html/images/screens_support/screens-densities.png b/docs/html/images/screens_support/screens-densities.png
index edbd1e3..3220ecf 100644
--- a/docs/html/images/screens_support/screens-densities.png
+++ b/docs/html/images/screens_support/screens-densities.png
Binary files differ
diff --git a/docs/html/images/screens_support/screens-ranges.png b/docs/html/images/screens_support/screens-ranges.png
index d8a0ffa..c6a0677 100644
--- a/docs/html/images/screens_support/screens-ranges.png
+++ b/docs/html/images/screens_support/screens-ranges.png
Binary files differ
diff --git a/docs/html/images/sdk-cube.png b/docs/html/images/sdk-cube.png
new file mode 100644
index 0000000..58b43ae
--- /dev/null
+++ b/docs/html/images/sdk-cube.png
Binary files differ
diff --git a/docs/html/images/service_lifecycle.png b/docs/html/images/service_lifecycle.png
index 7ab96d7..413bf56 100644
--- a/docs/html/images/service_lifecycle.png
+++ b/docs/html/images/service_lifecycle.png
Binary files differ
diff --git a/docs/html/images/tools-home.png b/docs/html/images/tools-home.png
new file mode 100644
index 0000000..291a361
--- /dev/null
+++ b/docs/html/images/tools-home.png
Binary files differ
diff --git a/docs/html/images/topdev_ann.png b/docs/html/images/topdev_ann.png
new file mode 100644
index 0000000..9564387
--- /dev/null
+++ b/docs/html/images/topdev_ann.png
Binary files differ
diff --git a/docs/html/images/training/basics/basic-lifecycle-create.png b/docs/html/images/training/basics/basic-lifecycle-create.png
index 01d7328..d6c66fc 100644
--- a/docs/html/images/training/basics/basic-lifecycle-create.png
+++ b/docs/html/images/training/basics/basic-lifecycle-create.png
Binary files differ
diff --git a/docs/html/images/training/basics/basic-lifecycle-paused.png b/docs/html/images/training/basics/basic-lifecycle-paused.png
index fcb8bd2..1b81c07 100644
--- a/docs/html/images/training/basics/basic-lifecycle-paused.png
+++ b/docs/html/images/training/basics/basic-lifecycle-paused.png
Binary files differ
diff --git a/docs/html/images/training/basics/basic-lifecycle-savestate.png b/docs/html/images/training/basics/basic-lifecycle-savestate.png
index d74f1ba..9ea9484 100644
--- a/docs/html/images/training/basics/basic-lifecycle-savestate.png
+++ b/docs/html/images/training/basics/basic-lifecycle-savestate.png
Binary files differ
diff --git a/docs/html/images/training/basics/basic-lifecycle-stopped.png b/docs/html/images/training/basics/basic-lifecycle-stopped.png
index 26c22ee..6f45fcc 100644
--- a/docs/html/images/training/basics/basic-lifecycle-stopped.png
+++ b/docs/html/images/training/basics/basic-lifecycle-stopped.png
Binary files differ
diff --git a/docs/html/images/training/basics/basic-lifecycle.png b/docs/html/images/training/basics/basic-lifecycle.png
index 61eb422..f991787 100644
--- a/docs/html/images/training/basics/basic-lifecycle.png
+++ b/docs/html/images/training/basics/basic-lifecycle.png
Binary files differ
diff --git a/docs/html/images/training/basics/network-settings1.png b/docs/html/images/training/basics/network-settings1.png
new file mode 100644
index 0000000..9eaf207d
--- /dev/null
+++ b/docs/html/images/training/basics/network-settings1.png
Binary files differ
diff --git a/docs/html/images/training/basics/network-settings2.png b/docs/html/images/training/basics/network-settings2.png
new file mode 100644
index 0000000..5f4dc63
--- /dev/null
+++ b/docs/html/images/training/basics/network-settings2.png
Binary files differ
diff --git a/docs/html/images/ui/button-types.png b/docs/html/images/ui/button-types.png
new file mode 100644
index 0000000..dcb083f
--- /dev/null
+++ b/docs/html/images/ui/button-types.png
Binary files differ
diff --git a/docs/html/images/ui/buttons-holo.png b/docs/html/images/ui/buttons-holo.png
new file mode 100644
index 0000000..16e2fd2
--- /dev/null
+++ b/docs/html/images/ui/buttons-holo.png
Binary files differ
diff --git a/docs/html/images/ui/checkboxes.png b/docs/html/images/ui/checkboxes.png
new file mode 100644
index 0000000..8878fb13
--- /dev/null
+++ b/docs/html/images/ui/checkboxes.png
Binary files differ
diff --git a/docs/html/images/ui/edittext-actionlabel.png b/docs/html/images/ui/edittext-actionlabel.png
new file mode 100644
index 0000000..a0e9fe9
--- /dev/null
+++ b/docs/html/images/ui/edittext-actionlabel.png
Binary files differ
diff --git a/docs/html/images/ui/edittext-actionsend.png b/docs/html/images/ui/edittext-actionsend.png
new file mode 100644
index 0000000..63ccbd1
--- /dev/null
+++ b/docs/html/images/ui/edittext-actionsend.png
Binary files differ
diff --git a/docs/html/images/ui/edittext-autocomplete.png b/docs/html/images/ui/edittext-autocomplete.png
new file mode 100644
index 0000000..c29091a
--- /dev/null
+++ b/docs/html/images/ui/edittext-autocomplete.png
Binary files differ
diff --git a/docs/html/images/ui/edittext-email.png b/docs/html/images/ui/edittext-email.png
new file mode 100644
index 0000000..26f6136
--- /dev/null
+++ b/docs/html/images/ui/edittext-email.png
Binary files differ
diff --git a/docs/html/images/ui/edittext-noextract.png b/docs/html/images/ui/edittext-noextract.png
new file mode 100644
index 0000000..b459283
--- /dev/null
+++ b/docs/html/images/ui/edittext-noextract.png
Binary files differ
diff --git a/docs/html/images/ui/edittext-phone.png b/docs/html/images/ui/edittext-phone.png
new file mode 100644
index 0000000..45177d3
--- /dev/null
+++ b/docs/html/images/ui/edittext-phone.png
Binary files differ
diff --git a/docs/html/images/ui/edittext-text-next.png b/docs/html/images/ui/edittext-text-next.png
new file mode 100644
index 0000000..ef5ff1d
--- /dev/null
+++ b/docs/html/images/ui/edittext-text-next.png
Binary files differ
diff --git a/docs/html/images/ui/edittext-text.png b/docs/html/images/ui/edittext-text.png
new file mode 100644
index 0000000..599dcec
--- /dev/null
+++ b/docs/html/images/ui/edittext-text.png
Binary files differ
diff --git a/docs/html/images/ui/edittext.png b/docs/html/images/ui/edittext.png
new file mode 100644
index 0000000..d4bcaaa
--- /dev/null
+++ b/docs/html/images/ui/edittext.png
Binary files differ
diff --git a/docs/html/images/ui/gridlayout-small.png b/docs/html/images/ui/gridlayout-small.png
new file mode 100644
index 0000000..935b481
--- /dev/null
+++ b/docs/html/images/ui/gridlayout-small.png
Binary files differ
diff --git a/docs/html/images/ui/gridlayout.png b/docs/html/images/ui/gridlayout.png
new file mode 100644
index 0000000..12ae414
--- /dev/null
+++ b/docs/html/images/ui/gridlayout.png
Binary files differ
diff --git a/docs/html/images/ui/gridview-small.png b/docs/html/images/ui/gridview-small.png
new file mode 100644
index 0000000..104a4d4
--- /dev/null
+++ b/docs/html/images/ui/gridview-small.png
Binary files differ
diff --git a/docs/html/images/ui/gridview.png b/docs/html/images/ui/gridview.png
new file mode 100644
index 0000000..a780df3
--- /dev/null
+++ b/docs/html/images/ui/gridview.png
Binary files differ
diff --git a/docs/html/images/ui/linearlayout-small.png b/docs/html/images/ui/linearlayout-small.png
new file mode 100644
index 0000000..5d929e2
--- /dev/null
+++ b/docs/html/images/ui/linearlayout-small.png
Binary files differ
diff --git a/docs/html/images/ui/linearlayout.png b/docs/html/images/ui/linearlayout.png
new file mode 100644
index 0000000..392cc11
--- /dev/null
+++ b/docs/html/images/ui/linearlayout.png
Binary files differ
diff --git a/docs/html/images/ui/listview-small.png b/docs/html/images/ui/listview-small.png
new file mode 100644
index 0000000..97eba89
--- /dev/null
+++ b/docs/html/images/ui/listview-small.png
Binary files differ
diff --git a/docs/html/images/ui/listview.png b/docs/html/images/ui/listview.png
new file mode 100644
index 0000000..456ed0c
--- /dev/null
+++ b/docs/html/images/ui/listview.png
Binary files differ
diff --git a/docs/html/images/ui/pickers.png b/docs/html/images/ui/pickers.png
new file mode 100644
index 0000000..e446fab
--- /dev/null
+++ b/docs/html/images/ui/pickers.png
Binary files differ
diff --git a/docs/html/images/ui/radiobuttons.png b/docs/html/images/ui/radiobuttons.png
new file mode 100644
index 0000000..8f6b22a
--- /dev/null
+++ b/docs/html/images/ui/radiobuttons.png
Binary files differ
diff --git a/docs/html/images/ui/relativelayout-small.png b/docs/html/images/ui/relativelayout-small.png
new file mode 100644
index 0000000..c531e9a
--- /dev/null
+++ b/docs/html/images/ui/relativelayout-small.png
Binary files differ
diff --git a/docs/html/images/ui/relativelayout.png b/docs/html/images/ui/relativelayout.png
new file mode 100644
index 0000000..72c06ae1
--- /dev/null
+++ b/docs/html/images/ui/relativelayout.png
Binary files differ
diff --git a/docs/html/images/ui/sample-linearlayout.png b/docs/html/images/ui/sample-linearlayout.png
new file mode 100644
index 0000000..c4beb93a
--- /dev/null
+++ b/docs/html/images/ui/sample-linearlayout.png
Binary files differ
diff --git a/docs/html/images/ui/sample-relativelayout.png b/docs/html/images/ui/sample-relativelayout.png
new file mode 100644
index 0000000..d9ea30e
--- /dev/null
+++ b/docs/html/images/ui/sample-relativelayout.png
Binary files differ
diff --git a/docs/html/images/ui/spinner.png b/docs/html/images/ui/spinner.png
new file mode 100644
index 0000000..79ee4e4
--- /dev/null
+++ b/docs/html/images/ui/spinner.png
Binary files differ
diff --git a/docs/html/images/ui/switch.png b/docs/html/images/ui/switch.png
new file mode 100644
index 0000000..e8d8014
--- /dev/null
+++ b/docs/html/images/ui/switch.png
Binary files differ
diff --git a/docs/html/images/ui/tabs-small.png b/docs/html/images/ui/tabs-small.png
new file mode 100644
index 0000000..622f1e7
--- /dev/null
+++ b/docs/html/images/ui/tabs-small.png
Binary files differ
diff --git a/docs/html/images/ui/tabs.png b/docs/html/images/ui/tabs.png
new file mode 100644
index 0000000..da9d4b6
--- /dev/null
+++ b/docs/html/images/ui/tabs.png
Binary files differ
diff --git a/docs/html/images/ui/togglebutton.png b/docs/html/images/ui/togglebutton.png
new file mode 100644
index 0000000..a69b3fe
--- /dev/null
+++ b/docs/html/images/ui/togglebutton.png
Binary files differ
diff --git a/docs/html/images/ui/ui-controls.png b/docs/html/images/ui/ui-controls.png
new file mode 100644
index 0000000..13534d3
--- /dev/null
+++ b/docs/html/images/ui/ui-controls.png
Binary files differ
diff --git a/docs/html/images/ui/ui_index.png b/docs/html/images/ui/ui_index.png
new file mode 100644
index 0000000..3cc82c2
--- /dev/null
+++ b/docs/html/images/ui/ui_index.png
Binary files differ
diff --git a/docs/html/images/ui/webview-small.png b/docs/html/images/ui/webview-small.png
new file mode 100644
index 0000000..4c32432
--- /dev/null
+++ b/docs/html/images/ui/webview-small.png
Binary files differ
diff --git a/docs/html/images/ui/webview.png b/docs/html/images/ui/webview.png
new file mode 100644
index 0000000..12cef58
--- /dev/null
+++ b/docs/html/images/ui/webview.png
Binary files differ
diff --git a/docs/html/images/viewgroup.png b/docs/html/images/viewgroup.png
index 2c86ddb..fa07799 100644
--- a/docs/html/images/viewgroup.png
+++ b/docs/html/images/viewgroup.png
Binary files differ
diff --git a/docs/html/images/webapps/webapps.png b/docs/html/images/webapps/webapps.png
index 6ad6205..ff499cf 100644
--- a/docs/html/images/webapps/webapps.png
+++ b/docs/html/images/webapps/webapps.png
Binary files differ
diff --git a/docs/html/index.jd b/docs/html/index.jd
index d3203bb..58bfd04 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -1,218 +1,70 @@
-home=true
+fullpage=true
+no_footer_links=true
+carousel=true
page.metaDescription=The official site for Android developers. Provides the Android SDK and documentation for app developers and designers.
@jd:body
-<div id="mainBodyFixed">
- <div id="mainBodyLeft">
- <div id="homeMiddle">
- <div id="topAnnouncement">
- <div id="homeTitle">
- <h2>Developer Announcements</h2>
- </div><!-- end homeTitle -->
- <div id="announcement-block">
- <!-- total max width is 520px -->
- <img src="{@docRoot}images/home/play_logo.png"
-alt="Google Play" width="120px" style="padding:10px 52px"/>
- <div id="announcement" style="width:275px">
- <p>Introducing <strong>Google Play</strong>: An integrated digital content destination where
-users buy and enjoy all of their favorite content in one place. It's the new destination for
-Android apps!</p>
- <p><a href="http://android-developers.blogspot.com/2012/03/introducing-google-play.html">Read more »</a></p>
- </div> <!-- end annoucement -->
- </div> <!-- end annoucement-block -->
- </div><!-- end topAnnouncement -->
- <div id="carouselMain" style="height:205px"> <!-- this height can be
- adjusted based on the content height -->
+<div class="wrap">
+ <!-- Slideshow -->
+ <div class="slideshow-container slideshow-home col-16">
+ <a href="" class="slideshow-prev">Prev</a>
+ <a href="" class="slideshow-next">Next</a>
+ <div class="frame">
+ <ul>
+ <li class="item carousel-home">
+ <div class="content-left col-10">
+ <img src="{@docRoot}images/home/design.png" style="margin-top:30px">
+ </div>
+ <div class="content-right col-6">
+ <h1>Make your Android apps<br>look great</h1>
+ <p>New templates in the design guide make it easier than ever to design apps
+that are beautiful and easy to use.</p>
+ <a href="/design/index.html" class="button">Learn More</a>
+ </div>
+ </li>
+ <li class="item carousel-home">
+ <div class="content-left col-10">
+ <img src="/images/home/google-io.png">
</div>
- <div class="clearer"></div>
- <div id="carouselWheel">
- <div class="app-list-container" align="center">
- <a href="javascript:{}" id="arrow-left" onclick="" class="arrow-left-off"></a>
- <div id="list-clip">
- <div style="left: 0px;" id="app-list">
- <!-- populated by buildCarousel() -->
- </div>
- </div><!-- end list-clip -->
- <a href="javascript:{ page_right(); }" id="arrow-right" onclick="" class="arrow-right-on"></a>
- <div class="clearer"></div>
- </div><!-- end app-list container -->
- </div><!-- end carouselWheel -->
- </div><!-- end homeMiddle -->
+ <div class="content-right col-6">
+ <h1>Watch Android at Google I/O!</h1>
+ <p>See the keynote and more than 40 Android developer sessions streamed live from Moscone Center in San Francisco. <div style="margin-top:-22px;">Begins June 27, 9AM PDT (UTC-7).</span></p>
+ <a href="https://developers.google.com/events/io/sessions#android"
+class="button">See the Android Sessions</a>
+ </div>
+ </li>
+ <li class="item carousel-home">
+ <div class="content-left col-10">
+ <img src="/images/home/google-play.png"
+ style="margin-top:50px">
+ </div>
+ <div class="content-right col-6">
+ <h1>Publish your apps<br>in Google Play</h1>
+ <p>The most visited store in the world for Android apps. Cloud-connected and always synced, it's never been easier for users to find and download your apps.</p>
- <div style="clear:both"> </div>
- </div><!-- end mainBodyLeft -->
-
- <div id="mainBodyRight">
- <table id="rightColumn">
- <tr>
- <td class="imageCell"><a href="{@docRoot}sdk/index.html"><img src="{@docRoot}assets/images/icon_download.jpg" style="padding:0" /></a></td>
- <td>
- <h2 class="green">Download</h2>
- <p>The Android SDK has the tools, sample code, and docs you need to create great apps.</p>
- <p><a href="{@docRoot}sdk/index.html">Learn more »</a></p>
- </td>
- </tr>
-
-
- <tr>
- <td colspan="2"><div class="seperator"> </div></td>
- </tr>
- <tr>
- <td class="imageCell"><a href="{@docRoot}design/index.html"><img src="{@docRoot}assets/images/icon_design.png" style="padding:5px" /></a></td>
- <td>
- <h2 class="green">Design</h2>
- <p>Learn about principles, building blocks, and patterns for creating world-class Android user interfaces.</p>
- <p><a href="{@docRoot}design/index.html">Learn more »</a></p>
- </td>
- </tr>
-
- <tr>
- <td colspan="2"><div class="seperator"> </div></td>
- </tr>
- <tr>
- <td class="imageCell"><a href="http://play.google.com/apps/publish"><img src="{@docRoot}assets/images/icon_play.png" style="padding:0" /></a></td>
- <td>
- <h2 class="green">Publish</h2>
- <p>Google Play is an open service that lets you distribute your apps to devices.</p>
- <p><a href="http://play.google.com/apps/publish">Learn more »</a></p>
- </td>
- </tr>
-
- <tr>
- <td colspan="2"><div class="seperator"> </div></td>
- </tr>
- <tr>
- <td class="imageCell"><a
-href="{@docRoot}resources/dashboard/platform-versions.html"><img
-src="{@docRoot}images/icon_dashboard.png" style="padding:0" /></a></td>
- <td>
- <h2 class="green">Target Devices</h2>
- <p>The Device Dashboard
-provides information about deployed Android devices to
-help you target suitable device configurations as you build and update your
-apps.</p>
- <p><a
-href="{@docRoot}resources/dashboard/platform-versions.html">Learn more »</a></p>
- </td>
- </tr>
-
- </table>
- </div>
- </div>
-
-<!--[if lte IE 6]>
- <style>
- #arrow-left {
- margin:0 0 0 5px;
- }
- #arrow-right {
- margin-left:0;
- }
- .app-list-container {
- margin: 37px 0 0 23px;
- }
- div#list-clip {
- width:468px;
- }
- </style>
-<![endif]-->
-
-<script type="text/javascript">
-
-// * -- carousel dictionary -- * //
- /* layout: imgLeft, imgRight, imgTop
- icon: image for carousel entry. cropped (height:70px, width:90px)
- name: string for carousel entry
- img: image for bulletin post. cropped (height: 170, width:230px)
- title: header for bulletin (optional, insert "" value to skip
- desc: the bulletin post. must include html tags.
- */
-
- var droidList = {
- 'sdk': {
- 'layout':"imgLeft",
- 'icon':"sdk-small.png",
- 'name':"Android 4.0.3",
- 'img':"ics-android.png",
- 'title':"Android 4.0.3",
- 'desc': "<p>Android 4.0.3 is an update to the Ice Cream Sandwich release that adds a "
-+ "handful of new features for users and developers. Check out the <a "
-+ "href='http://developer.android.com/sdk/android-4.0-highlights.html'>Platform Highlights</a> "
-+ "for an overview of all features in Android 4.0.x.</p>"
-+ "<p>For information about API changes in 4.0.3 (API level 15), read the "
-+ "<a href='{@docRoot}sdk/android-4.0.3.html'>platform notes</a> and <a "
-+ "href='{@docRoot}sdk/api_diff/15/changes.html'>diff report</a>. If you're new to Android, "
-+ "get started with the <a href='/sdk/index.html'>SDK starter package</a>.</p>"
- },
+ <a href="{@docRoot}distribute/index.html" class="button">Learn More</a>
+ </div>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <!-- /End slideshow -->
- 'plus': {
- 'layout':"imgLeft",
- 'icon':"google-plus-small.png",
- 'name':"Google+ Page",
- 'img':"google-plus.png",
- 'title':"Android Developers on Google+",
- 'desc': "<p>We now have a Google+ page for <a "
-+ "href='https://plus.google.com/108967384991768947849'>+Android Developers</a>. "
-+ "We'll use it to host Hangouts for developers, talk about the latest releases, "
-+ "development and design tips, and much more.</p>"
-+ "<div style='margin:.7em 0 0 0'><g:plus href='https://plus.google.com/108967384991768947849' "
-+ "size=\"smallbadge\" width=\"275\"></g:plus></div>"
- },
+
+
+</div>
+<div class="wrap" style="padding-bottom:20px">
+ <!-- Section links -->
+ <div class="home-sections">
+ <ul>
+ <li><a href="{@docRoot}about/index.html">About Android</a></li>
+ <li><a href="{@docRoot}sdk/index.html">Get the SDK</a></li>
+ <li><a href="http://source.android.com">Open Source</a></li>
+ <li><a href="{@docRoot}support.html">Support</a></li>
+ <li class="last"><a href="{@docRoot}legal.html">Legal</a></li>
+ </ul>
+ </div>
+ <!-- /Section links -->
+</div>
- 'tv': {
- 'layout':"imgLeft",
- 'icon':"GTV_icon_small.png",
- 'name':"Google TV",
- 'img':"GTV_icon_large.png",
- 'title':"Google TV!",
- 'desc': "<p>Build something big. By big, we mean <em>worthy-of-the-living-room</em> big.</p>"
- + " <p>Google TV brings the power of Android"
- + " and Google Chrome to television."
- + " The average American watches five hours of TV per day. Give them the apps"
- + " to update their status, listen to music, watch web videos, and more.</p>"
- + "<p><a href='http://code.google.com/tv'>Develop for Google TV »</a></p>"
- },
-
-/*
- 'devphone': {
- 'layout':"imgLeft",
- 'icon':"devphone-small.png",
- 'name':"Dev Phones",
- 'img':"devphone-large.png",
- 'title':"Android Dev Phones",
- 'desc': "<p>Run and debug your Android applications directly on one of these "
- + "devices. Modify and rebuild the Android operating system, and flash it onto "
- + "the phone. The Android Dev Phones are carrier-independent, and available for "
- + "purchase by developers through their Google Play publisher accounts.</p><p> "
- + "<a href='http://play.google.com/apps/publish'>Visit Google Play "
- + "to learn more »</a></p>"
- },
- */
-
- 'mapskey': {
- 'layout':"imgLeft",
- 'icon':"maps-small.png",
- 'name':"Maps API Key",
- 'img':"maps-large.png",
- 'title':"Maps API Key",
- 'desc':"<p>If you're writing an Android application that uses Google Maps (with MapView), you must register your application to obtain a Maps API Key. Without the key, your maps application will not work on Android devices. Obtaining a key requires just a couple of steps.</p><p><a href='http://code.google.com/android/add-ons/google-apis/maps-overview.html'>Learn more »</a></p>"
- }
-
- }
-</script>
-<script type="text/javascript" src="{@docRoot}assets/carousel.js"></script>
-<script type="text/javascript">
- initCarousel("plus");
-</script>
-
-<script type="text/javascript" src="https://plus.google.com/108967384991768947849"
-rel="publisher"></script>
-<script type="text/javascript">
-window.___gcfg = {lang: 'en'};
-(function()
-{var po = document.createElement("script");
-po.type = "text/javascript"; po.async = true;po.src = "https://apis.google.com/js/plusone.js";
-var s = document.getElementsByTagName("script")[0];
-s.parentNode.insertBefore(po, s);
-})();</script>
diff --git a/docs/html/intl/es/training/monitoring-device-state/battery-monitoring.jd b/docs/html/intl/es/training/monitoring-device-state/battery-monitoring.jd
new file mode 100644
index 0000000..08a42dd
--- /dev/null
+++ b/docs/html/intl/es/training/monitoring-device-state/battery-monitoring.jd
@@ -0,0 +1,120 @@
+page.title=Cómo controlar el nivel de batería y el estado de carga
+parent.title=Cómo optimizar la duración de la batería
+parent.link=index.html
+
+trainingnavtop=true
+next.title=Cómo determinar y controlar el tipo de conector y el estado de la conexión
+next.link=docking-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>En esta sección puedes aprender:</h2>
+<ol>
+ <li><a href="#DetermineChargeState">Cómo determinar el estado de carga actual</a></li>
+ <li><a href="#MonitorChargeState">Cómo supervisar los cambios en el estado de carga</a></li>
+ <li><a href="#CurrentLevel">Cómo determinar el nivel de batería actual</a></li>
+ <li><a href="#MonitorLevel">Cómo supervisar cambios importantes en el nivel de batería</a></li>
+</ol>
+
+<h2>También puedes consultar:</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intentos y filtros de intentos</a>
+</ul>
+
+</div>
+</div>
+
+<p>Al modificar la frecuencia de las actualizaciones en segundo plano para reducir el efecto de las mismas en la duración de la batería, te recomendamos que comiences por comprobar el estado de carga y el nivel actual de la batería.</p>
+
+<p>El impacto derivado de actualizar aplicaciones en la duración de la batería varía en función del nivel de batería y del estado de carga del dispositivo, mientras que es insignificante cuando este está conectado a la corriente. Por ello, en la mayoría de los casos, puedes maximizar la frecuencia de actualización cuando el dispositivo esté conectado a un cargador. Por el contrario, si el dispositivo está en proceso de descarga, disminuir la frecuencia de actualización te permitirá aumentar la duración de la batería.</p>
+
+<p>Del mismo modo, puedes comprobar el nivel de carga de la batería y reducir la frecuencia de las actualizaciones o incluso detenerlas cuando la batería esté a punto de agotarse.</p>
+
+
+<h2 id="DetermineChargeState">Cómo determinar el estado de carga actual</h2>
+
+<p>En primer lugar, te recomendamos que determines el estado de carga actual. {@link android.os.BatteryManager} envía los detalles de carga y de la batería en un {@link android.content.Intent} persistente que incluye el estado de carga.</p>
+
+<p>Se trata de un intento persistente, por lo que no es necesario registrar un {@link android.content.BroadcastReceiver}. Para ello, solo tienes que ejecutar {@code registerReceiver} transmitiendo {@code null} como el receptor (como se muestra en el siguiente fragmento). A continuación, se devuelve el intento de estado actual de la batería. Puedes transmitir un objeto {@link android.content.BroadcastReceiver} real, pero hablaremos sobre las actualizaciones en otra sección, por lo que no es necesario ahora.</p>
+
+<pre>IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
+Intent batteryStatus = context.registerReceiver(null, ifilter);</pre>
+
+<p>Puedes extraer el estado de carga actual y, si el dispositivo está cargando, puedes saber también si se está usando un cargador de corriente alterna o USB:<p>
+
+<pre>// Are we charging / charged?
+int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
+boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
+ status == BatteryManager.BATTERY_STATUS_FULL;
+
+// How are we charging?
+int chargePlug = battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+boolean usbCharge = chargePlug == BATTERY_PLUGGED_USB;
+boolean acCharge = chargePlug == BATTERY_PLUGGED_AC;</pre>
+
+<p>Normalmente, debes maximizar la frecuencia de las actualizaciones en segundo plano si el dispositivo está conectado a un cargador de corriente alterna, disminuir esa frecuencia si se utiliza un cargador USB y reducirla aún más si la batería se está descargando.</p>
+
+
+<h2 id="MonitorChargeState">Cómo supervisar los cambios en el estado de carga</h2>
+
+<p>Modificar el estado de carga es tan fácil como conectar el dispositivo a un enchufe o USB. Por ello, es importante que supervises el estado de carga por si se producen cambios y modifiques la frecuencia de actualización según corresponda.</p>
+
+<p>{@link android.os.BatteryManager} emite una acción siempre que el dispositivo se conecta o desconecta de la corriente. Es importante recibir estos eventos aunque la aplicación no esté en ejecución (especialmente porque estos eventos pueden afectar a la frecuencia con la que inicias tu aplicación para actualizarla en segundo plano), por lo que debes registrar un {@link android.content.BroadcastReceiver} en tu archivo de manifiesto para detectar ambos eventos definiendo {@link android.content.Intent#ACTION_POWER_CONNECTED} y {@link android.content.Intent#ACTION_POWER_DISCONNECTED} en un filtro de intentos.</p>
+
+<pre><receiver android:name=".PowerConnectionReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
+ <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
+ </intent-filter>
+</receiver></pre>
+
+<p>En la implementación de {@link android.content.BroadcastReceiver} asociada, puedes extraer el método y el estado de carga actual como se describe en el paso anterior.</p>
+
+<pre>public class PowerConnectionReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
+ boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
+ status == BatteryManager.BATTERY_STATUS_FULL;
+
+ int chargePlug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+ boolean usbCharge = chargePlug == BATTERY_PLUGGED_USB;
+ boolean acCharge = chargePlug == BATTERY_PLUGGED_AC;
+ }
+}</pre>
+
+
+<h2 id="CurrentLevel">Cómo determinar el nivel de batería actual</h2>
+
+<p>En algunos casos, también es útil determinar el nivel de batería actual. Puedes disminuir la frecuencia de las actualizaciones en segundo plano si el nivel de carga de la batería es inferior a un valor determinado.</p>
+
+<p>Puedes consultar la carga actual de la batería extrayendo el nivel actual de la batería y subir a partir del intento de estado de batería, como se muestra a continuación:</p>
+
+<pre>int level = battery.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
+int scale = battery.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
+
+float batteryPct = level / (float)scale;</pre>
+
+
+<h2 id="MonitorLevel">Cómo supervisar cambios importantes en el nivel de batería</h2>
+
+<p>No puedes controlar el estado de la batería de forma continua fácilmente, pero tampoco es necesario.</p>
+
+<p>En términos generales, el impacto sobre la batería derivado de controlar continuamente el nivel de batería es mayor que el comportamiento habitual de la aplicación. Por ello, te recomendamos que supervises únicamente los cambios en el nivel de batería más significativos, especialmente cuando el dispositivo tenga poca batería o acabe de cargarse.</p>
+
+<p>El fragmento de manifiesto que aparece a continuación se ha extraído del elemento de filtro de intento de un receptor de emisión. El receptor detecta {@link android.content.Intent#ACTION_BATTERY_LOW} y {@link android.content.Intent#ACTION_BATTERY_OKAY} y se activa cuando el nivel de batería del dispositivo es bajo o cuando se sale de un estado bajo de batería.</p>
+
+<pre><receiver android:name=".BatteryLevelReceiver">
+<intent-filter>
+ <action android:name="android.intent.action.ACTION_BATTERY_LOW"/>
+ <action android:name="android.intent.action.ACTION_BATTERY_OKAY"/>
+ </intent-filter>
+</receiver></pre>
+
+<p>Cuando la batería esté a punto de agotarse, te recomendamos que inhabilites las actualizaciones en segundo plano. Si el teléfono se apaga antes de poder utilizar las aplicaciones, no importa que tengan los datos actualizados.</p>
+
+<p>En muchos casos, el hecho de cargar un dispositivo coincide con la acción de utilizar un conector. En la próxima sección, hablaremos sobre cómo determinar el estado de conexión actual y cómo supervisar los cambios que se produzcan al conectar el dispositivo.</p>
+
diff --git a/docs/html/intl/es/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html/intl/es/training/monitoring-device-state/connectivity-monitoring.jd
new file mode 100644
index 0000000..2a5ff12
--- /dev/null
+++ b/docs/html/intl/es/training/monitoring-device-state/connectivity-monitoring.jd
@@ -0,0 +1,70 @@
+page.title=Cómo determinar y controlar el estado de la conectividad
+parent.title=Cómo optimizar la duración de la batería
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=Cómo determinar y controlar el tipo de conector y el estado de la conexión
+previous.link=docking-monitoring.html
+next.title=Cómo manipular los receptores de emisión bajo demanda
+next.link=manifest-receivers.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>En esta sección puedes aprender:</h2>
+<ol>
+ <li><a href="#DetermineConnection">Cómo determinar si tienes conexión a Internet</a></li>
+ <li><a href="#DetermineType">Cómo determinar el tipo de conexión a Internet</a></li>
+ <li><a href="#MonitorChanges">Cómo supervisar los cambios en la conectividad</a></li>
+</ol>
+
+
+<h2>También puedes consultar:</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intentos y filtros de intentos</a>
+</ul>
+
+</div>
+</div>
+
+<p>Algunos de los usos más comunes para las alarmas con repetición y los servicios en segundo plano es programar actualizaciones regulares de los datos de aplicaciones a partir de recursos de Internet, almacenar datos en la memoria caché o ejecutar descargas a largo plazo. Sin embargo, si no estás conectado a Internet o la conexión es demasiado débil para completar la descarga, ¿para qué activar el dispositivo y programar la actualización?</p>
+
+<p>Puedes utilizar {@link android.net.ConnectivityManager} para comprobar si estás conectado a Internet y, en ese caso, el tipo de conexión que estás utilizando.</p>
+
+
+<h2 id="DetermineConnection">Cómo determinar si tienes conexión a Internet</h2>
+
+<p>No es necesario programar una actualización basada en un recurso de Internet si no estás conectado. En el fragmento que aparece a continuación, se muestra cómo utilizar {@link android.net.ConnectivityManager} para consultar la red activa y determinar si hay conexión a Internet.</p>
+
+<pre>ConnectivityManager cm =
+ (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
+
+NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
+boolean isConnected = activeNetwork.isConnectedOrConnecting();</pre>
+
+
+<h2 id="DetermineType">Cómo determinar el tipo de conexión a Internet</h2>
+
+<p>También puedes determinar el tipo de conexión a Internet que hay disponible.</p>
+
+<p>El dispositivo se puede conectar a Internet a través de conexiones Ethernet, Wi-Fi, WiMAX y de datos móviles. Al consultar el tipo de red activa, como se muestra a continuación, puedes modificar la frecuencia de actualización en función del ancho de banda disponible.</p>
+
+<pre>boolean isWiFi = activeNetwork.getType() == ConnectivityManager.TYPE_WIFI;</pre>
+
+<p>El coste de las conexiones de datos móviles suele ser superior al de las conexiones Wi-Fi, por lo que en la mayoría de los casos, la frecuencia de actualización de tu aplicación debería ser menor si utilizas conexiones móviles. Del mismo modo, las descargas grandes deberían cancelarse hasta que estés conectado a una red Wi-Fi.</p>
+
+<p>Cuando hayas inhabilitado las actualizaciones, es importante que detectes si se hay cambios en la conectividad para poder reanudarlas cuando se haya establecido una conexión a Internet.</p>
+
+
+<h2 id="MonitorChanges">Cómo supervisar los cambios en la conectividad</h2>
+
+<p>{@link android.net.ConnectivityManager} emite la acción {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION} ({@code "android.net.conn.CONNECTIVITY_CHANGE"}) cuando se han modificado los detalles de la conectividad. Puedes registrar un receptor de emisión en el archivo de manifiesto para detectar estos cambios y reanudar (o cancelar) las actualizaciones en segundo plano según corresponda.</p>
+
+<pre><action android:name="android.net.conn.CONNECTIVITY_CHANGE"/></pre>
+
+<p>Los cambios en la conectividad de un dispositivo pueden ser muy frecuentes (esta emisión se activa siempre que cambias de una conexión de datos móviles a una conexión Wi-Fi). Como resultado, te recomendamos que supervises esta emisión únicamente cuando hayas cancelado anteriormente las actualizaciones o las descargas para reanudarlas. Normalmente, basta con comprobar la conexión a Internet antes de iniciar una actualización y, si no hay ninguna, cancelar el resto de actualizaciones hasta que se restablezca la conexión.</p>
+
+<p>Esta técnica requiere que alternes receptores de emisión que hayas declarado en el archivo de manifiesto, que se describe en la próxima sección.</p>
diff --git a/docs/html/intl/es/training/monitoring-device-state/docking-monitoring.jd b/docs/html/intl/es/training/monitoring-device-state/docking-monitoring.jd
new file mode 100644
index 0000000..d612281
--- /dev/null
+++ b/docs/html/intl/es/training/monitoring-device-state/docking-monitoring.jd
@@ -0,0 +1,74 @@
+page.title=Cómo determinar y controlar el tipo de conector y el estado de la conexión
+parent.title=Cómo optimizar la duración de la batería
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Cómo controlar el nivel de batería y el estado de carga
+previous.link=battery-monitoring.html
+next.title=Cómo determinar y controlar el estado de la conectividad
+next.link=connectivity-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>En esta sección puedes aprender:</h2>
+<ol>
+ <li><a href="#CurrentDockState">Cómo solicitar el foco de audio</a></li>
+ <li><a href="#DockType">Cómo determinar el tipo de conector actual</a></li>
+ <li><a href="#MonitorDockState">Cómo supervisar los cambios en el tipo de conector o en el estado del mismo</a></li>
+</ol>
+
+
+<h2>También puedes consultar:</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intentos y filtros de intentos</a>
+</ul>
+
+</div>
+</div>
+
+<p>Los dispositivos Android se pueden conectar a distintos tipos de conectores. Por ejemplo, se puede utilizar conectores para coche o domésticos y tanto digitales como analógicos. Normalmente, el estado del conector está vinculado al estado de carga, ya que muchos conectores cargan el dispositivo mientras está conectado.</p>
+
+<p>El modo en el que el estado del conector del teléfono afecta a la frecuencia de actualización depende de tu aplicación. Puedes aumentar la frecuencia de actualización de una aplicación sobre noticias cuando el dispositivo esté conectado a un conector de escritorio o inhabilitar las actualizaciones completamente si está conectado a un conector de coche. Por el contrario, puedes maximizar las actualizaciones si el dispositivo está conectado a un conector de coche y tu servicio en segundo plano se actualiza con el estado del tráfico.</p>
+
+<p>El estado del conector se emite también como un {@link android.content.Intent} persistente, lo que te permite consultar si el dispositivo está conectado o no y, si lo está, determinar el tipo de conector.</p>
+
+
+<h2 id="CurrentDockState">Cómo determinar el estado de conexión actual</h2>
+
+<p>La información sobre el estado del conector se incluye como información adicional en una emisión persistente de la acción {@link android.content.Intent#ACTION_DOCK_EVENT}. Por ello, no es necesario registrar un {@link android.content.BroadcastReceiver}. Solo tienes que ejecutar {@link android.content.Context#registerReceiver registerReceiver()} transmitiendo {@code null} como el receptor de emisión, como se muestra en el fragmento de código que aparece a continuación.</p>
+
+<pre>IntentFilter ifilter = new IntentFilter(Intent.ACTION_DOCK_EVENT);
+Intent dockStatus = context.registerReceiver(null, ifilter);</pre>
+
+<p>Puedes extraer el estado actual de la conexión de la información adicional de {@code EXTRA_DOCK_STATE}:<p>
+
+<pre>int dockState = battery.getIntExtra(EXTRA_DOCK_STATE, -1);
+boolean isDocked = dockState != Intent.EXTRA_DOCK_STATE_UNDOCKED;</pre>
+
+
+<h2 id="DockType">Cómo determinar el tipo de conector actual</h2>
+
+<p>Si un dispositivo está insertado en un conector, se puede conectar a cualquiera de estos cuatro tipos de conectores:
+<ul><li>coche,</li>
+<li>escritorio,</li>
+<li>escritorio de gama baja (analógico),</li>
+<li>escritorio de gama alta (digital).</li></ul></p>
+
+<p>Ten en cuenta que las últimas dos opciones se introdujeron en Android únicamente en el nivel 11 del API. Por ello, te recomendamos que compruebes las tres opciones solo cuando te interese más el tipo de conector que si se trata de un conector digital o analógico:</p>
+
+<pre>boolean isCar = dockState == EXTRA_DOCK_STATE_CAR;
+boolean isDesk = dockState == EXTRA_DOCK_STATE_DESK ||
+ dockState == EXTRA_DOCK_STATE_LE_DESK ||
+ dockState == EXTRA_DOCK_STATE_HE_DESK;</pre>
+
+
+<h2 id="MonitorDockState">Cómo supervisar los cambios en el tipo de conector o en el estado del mismo</h2>
+
+<p>Cuando el dispositivo está conectado a un conector o desconectado del mismo, se emite la acción {@link android.content.Intent#ACTION_DOCK_EVENT}. Para controlar los cambios que se produzcan en el estado del conector del dispositivo, solo tienes que registrar un receptor de emisión en el archivo de manifiesto de la aplicación, como se muestra en el fragmento que aparece a continuación:</p>
+
+<pre><action android:name="android.intent.action.ACTION_DOCK_EVENT"/></pre>
+
+<p>Puedes extraer el estado y el tipo de conector en la implementación del receptor con las mismas técnicas que se han descrito en el paso anterior.</p>
diff --git a/docs/html/intl/es/training/monitoring-device-state/index.jd b/docs/html/intl/es/training/monitoring-device-state/index.jd
new file mode 100644
index 0000000..bf6b1c1
--- /dev/null
+++ b/docs/html/intl/es/training/monitoring-device-state/index.jd
@@ -0,0 +1,49 @@
+page.title=Cómo optimizar la duración de la batería
+
+trainingnavtop=true
+startpage=true
+next.title=Cómo controlar el nivel de batería y el estado de carga
+next.link=battery-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Dependencias y requisitos previos</h2>
+<ul>
+ <li>Android 2.0 (nivel 5 del API) o superior</li>
+ <li>Experiencia con <a href="{@docRoot}guide/components/intents-filters.html">Intentos y filtros de intentos</a></li>
+</ul>
+
+<h2>También puedes consultar:</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/services.html">Servicios</a>
+</ul>
+
+</div>
+</div>
+
+<p>Uno de los objetivos de tu aplicación debe ser limitar su impacto en la duración de la batería del dispositivo en el que esté instalada. Después de leer estas secciones, podrás desarrollar aplicaciones que optimizarán el uso de la batería en función del estado del dispositivo en el que estén instaladas.</p>
+
+<p>Al tomar medidas como inhabilitar las actualizaciones de servicios en segundo plano o disminuir la frecuencia de dichas actualizaciones cuando el nivel de batería sea bajo, puedes garantizar que se minimice el impacto de tu aplicación en la duración de la batería sin afectar a la experiencia del usuario.</p>
+
+<h2>Secciones</h2>
+
+<!-- Create a list of the lessons in this class along with a short description of each lesson.
+These should be short and to the point. It should be clear from reading the summary whether someone
+will want to jump to a lesson or not.-->
+
+<dl>
+ <dt><b><a href="battery-monitoring.html">Cómo controlar el nivel de batería y el estado de carga</a></b></dt>
+ <dd>Obtén más información sobre cómo determinar y controlar el nivel de batería actual y los cambios en el estado de carga para modificar la frecuencia de actualizaciones en segundo plano de tu aplicación.</dd>
+
+ <dt><b><a href="docking-monitoring.html">Cómo determinar y controlar el tipo de conector y el estado de la conexión</a></b></dt>
+ <dd>La frecuencia de actualización óptima puede variar en función de cómo se utilice el dispositivo en el que está instalada la aplicación. Obtén más información sobre cómo determinar y controlar cuándo el dispositivo está conectado a algún sistema de acoplamiento u otra conexión.</dd>
+
+ <dt><b><a href="connectivity-monitoring.html">Cómo determinar y controlar el estado de la conectividad</a></b></dt>
+ <dd>Si no tienes conexión a Internet, no puedes actualizar tu aplicación a partir de una fuente online. Obtén más información sobre cómo comprobar el estado de la conectividad para modificar la frecuencia de actualización en segundo plano de tu aplicación. También puedes obtener más información sobre cómo comprobar la conectividad móvil o Wi-Fi antes de iniciar operaciones que requieran un nivel elevado de ancho de banda.</dd>
+
+ <dt><b><a href="manifest-receivers.html">Cómo manipular los receptores de emisión bajo demanda</a></b></dt>
+ <dd>Los receptores de emisión que declaras en el archivo de manifiesto se pueden alternar durante la ejecución para inhabilitar los que no son necesarios debido al estado actual del dispositivo. Obtén más información sobre cómo alternar y superponer receptores de cambio de estado para mejorar el rendimiento y cómo posponer acciones hasta que el dispositivo se encuentre en un estado concreto.</dd>
+</dl>
\ No newline at end of file
diff --git a/docs/html/intl/es/training/monitoring-device-state/manifest-receivers.jd b/docs/html/intl/es/training/monitoring-device-state/manifest-receivers.jd
new file mode 100644
index 0000000..a90468e
--- /dev/null
+++ b/docs/html/intl/es/training/monitoring-device-state/manifest-receivers.jd
@@ -0,0 +1,50 @@
+page.title=Cómo manipular los receptores de emisión bajo demanda
+parent.title=Cómo optimizar la duración de la batería
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=Cómo determinar y controlar el estado de la conectividad
+previous.link=connectivity-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>En esta sección puedes aprender:</h2>
+<ol>
+ <li><a href="#ToggleReceivers">Cómo alternar y superponer receptores de cambio de estado para mejorar el rendimiento</a></li>
+</ol>
+
+
+<h2>También puedes consultar:</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intentos y filtros de intentos</a>
+</ul>
+
+</div>
+</div>
+
+<p>La forma más sencilla de controlar los cambios en el estado del dispositivo es crear un {@link android.content.BroadcastReceiver} para cada estado que vayas a controlar y registrar cada uno de ellos en el archivo de manifiesto de tu aplicación. A continuación, en cada uno de esos receptores solo tienes que volver a programar las alarmas recurrentes en función del estado actual del dispositivo.</p>
+
+<p>Un efecto secundario de este método es que tu aplicación activará el dispositivo siempre que uno de los receptores se active (probablemente, con más frecuencia de la necesaria).</p>
+
+<p>Te recomendamos que inhabilites o habilites los receptores de emisión en el momento de la ejecución. De este modo, puedes utilizar los receptores que hayas declarado en el archivo de manifiesto como alarmas pasivas que se activan mediante los eventos del sistema solo cuando es necesario.</p>
+
+
+<h2 id="ToggleReceivers">Cómo alternar y superponer receptores de cambio de estado para mejorar el rendimiento </h2>
+
+<p>Se puede utilizar el {@link android.content.pm.PackageManager} para alternar el estado habilitado en cualquier componente definido en el archivo de manifiesto, incluidos los receptores de emisión que quieras habilitar o inhabilitar, como se muestra en el fragmento que aparece a continuación:</p>
+
+<pre>ComponentName receiver = new ComponentName(context, myReceiver.class);
+
+PackageManager pm = context.getPackageManager();
+
+pm.setComponentEnabledSetting(receiver,
+ PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
+ PackageManager.DONT_KILL_APP)</pre>
+
+<p>Al utilizar esta técnica, si determinas que la conectividad se ha perdido, puedes inhabilitar todos los receptores excepto el receptor de cambio de conectividad. Por el contrario, cuando estés conectado, puedes dejar de detectar cambios de conectividad y solo comprobar si tienes conexión antes de realizar una actualización y de volver a programar una alarma de actualización recurrente.</p>
+
+<p>Puedes utilizar la misma técnica para posponer una descarga que requiera un nivel de ancho de banda superior para completarse. Solo tienes que habilitar un receptor de emisión que detecte los cambios de conectividad y que inicie la descarga solo cuando estés conectado a una red Wi-Fi.</p>
diff --git a/docs/html/intl/es/training/multiscreen/adaptui.jd b/docs/html/intl/es/training/multiscreen/adaptui.jd
new file mode 100644
index 0000000..61f0735
--- /dev/null
+++ b/docs/html/intl/es/training/multiscreen/adaptui.jd
@@ -0,0 +1,212 @@
+page.title=Cómo implementar interfaces de usuario adaptables
+parent.title=Cómo diseñar aplicaciones para varias pantallas
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Cómo admitir varias densidades de pantalla
+previous.link=screendensities.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>En esta sección puedes aprender:</h2>
+
+<ol>
+ <li><a href="#TaskDetermineCurLayout">Cómo determinar el diseño actual</a></li>
+ <li><a href="#TaskReactToLayout">Cómo reaccionar en función del diseño actual</a></li>
+ <li><a href="#TaskReuseFrag">Cómo volver a utilizar fragmentos en otras actividades</a></li>
+ <li><a href="#TaskHandleConfigChanges">Cómo gestionar los cambios en la configuración de la pantalla</a></li>
+</ol>
+
+<h2>También puedes consultar:</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">Cómo admitir tablets y dispositivos móviles</a></li>
+</ul>
+
+<h2>¡Pruébalo!</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Descargar la aplicación de ejemplo</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+
+</div>
+</div>
+
+<p>En función del diseño actual de tu aplicación, la interfaz puede variar. Por ejemplo, si tu aplicación está en modo de panel dual, haz clic en un elemento del panel izquierdo para que aparezca en el panel de la derecha. Asimismo, si está en modo de panel único, el contenido debería aparecer por sí mismo (en otra actividad).</p>
+
+
+<h2 id="TaskDetermineCurLayout">Cómo determinar el diseño actual</h2>
+
+<p>Dado que la implementación de cada diseño variará en cierta medida, probablemente una de las primeras cosas que tendrás que hacer será determinar el diseño que el usuario puede ver en ese momento. Por ejemplo, puedes determinar si el usuario utiliza el modo de "panel único" o de "panel dual". Para ello, puedes consultar si una vista determinada existe y es visible:</p>
+
+<pre class="prettyprint">
+public class NewsReaderActivity extends FragmentActivity {
+ boolean mIsDualPane;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main_layout);
+
+ View articleView = findViewById(R.id.article);
+ mIsDualPane = articleView != null &&
+ articleView.getVisibility() == View.VISIBLE;
+ }
+}
+</pre>
+
+<p>Ten en cuenta que este código consulta la disponibilidad del panel del "artículo", lo que es mucho más flexible que incluir una consulta para un diseño determinado.</p>
+
+<p>Otro ejemplo de cómo puedes adaptar la existencia de diferentes componentes es comprobar su disponibilidad antes de realizar una operación relacionada con los mismos. Por ejemplo, en la aplicación de ejemplo News Reader, hay un botón que abre un menú, pero ese botón solo aparece en las versiones anteriores a Android 3.0 (porque <PH>{@link android.app.ActionBar}</PH> en el nivel 11 del API y en niveles superiores). Por tanto, para añadir el detector de eventos para este botón, puedes hacer lo siguiente:</p>
+
+<pre class="prettyprint">
+Button catButton = (Button) findViewById(R.id.categorybutton);
+OnClickListener listener = /* create your listener here */;
+if (catButton != null) {
+ catButton.setOnClickListener(listener);
+}
+</pre>
+
+
+<h2 id="TaskReactToLayout">Cómo reaccionar en función del diseño actual</h2>
+
+<p>El resultado de algunas acciones puede variar en función del diseño actual. Por ejemplo, en el ejemplo de News Reader, al hacer clic en un encabezado de la lista se abrirá el artículo del panel situado a la derecha si la interfaz de usuario está en modo de panel dual, pero se iniciará una actividad independiente si esta está en modo de panel único:</p>
+
+<pre>
+@Override
+public void onHeadlineSelected(int index) {
+ mArtIndex = index;
+ if (mIsDualPane) {
+ /* display article on the right pane */
+ mArticleFragment.displayArticle(mCurrentCat.getArticle(index));
+ } else {
+ /* start a separate activity */
+ Intent intent = new Intent(this, ArticleActivity.class);
+ intent.putExtra("catIndex", mCatIndex);
+ intent.putExtra("artIndex", index);
+ startActivity(intent);
+ }
+}
+</pre>
+
+<p>De igual modo, si la aplicación está en modo de panel dual, debe configurar la barra de acción con pestañas para la navegación, mientras que si la aplicación está en modo de panel único, debe configurar la navegación con un widget giratorio. Por tanto, el código debe comprobar también cuál es el caso adecuado:</p>
+
+<pre>
+final String CATEGORIES[] = { "Top Stories", "Politics", "Economy", "Technology" };
+
+public void onCreate(Bundle savedInstanceState) {
+ ....
+ if (mIsDualPane) {
+ /* use tabs for navigation */
+ actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_TABS);
+ int i;
+ for (i = 0; i < CATEGORIES.length; i++) {
+ actionBar.addTab(actionBar.newTab().setText(
+ CATEGORIES[i]).setTabListener(handler));
+ }
+ actionBar.setSelectedNavigationItem(selTab);
+ }
+ else {
+ /* use list navigation (spinner) */
+ actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_LIST);
+ SpinnerAdapter adap = new ArrayAdapter<String>(this,
+ R.layout.headline_item, CATEGORIES);
+ actionBar.setListNavigationCallbacks(adap, handler);
+ }
+}
+</pre>
+
+
+<h2 id="TaskReuseFrag">Cómo volver a utilizar fragmentos en otras actividades</h2>
+
+<p>Un patrón recurrente a la hora de diseñar para distintas pantallas es utilizar una parte de la interfaz que se implementa como un panel en algunas configuraciones de pantalla y como actividad independiente en otras. Por ejemplo, en el ejemplo de News Reader, el texto del artículo de noticias se presenta en el panel de la derecha en las pantallas grandes, pero es una actividad independiente en las pantallas más pequeñas.</p>
+
+<p>En otros casos similares, puedes evitar la duplicación de código reutilizando la misma <PH>{@link android.app.Fragment}</PH> en distintas actividades. Por ejemplo, <code>ArticleFragment</code> se utiliza en el diseño de panel dual:</p>
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+
+<p>A continuación, se vuelve a utilizar (sin diseño) en el diseño de actividad para pantallas más pequeñas (<code>ArticleActivity</code>):</p>
+
+<pre>
+ArticleFragment frag = new ArticleFragment();
+getSupportFragmentManager().beginTransaction().add(android.R.id.content, frag).commit();
+</pre>
+
+<p>Evidentemente, esto tiene el mismo efecto que declarar el fragmento en un diseño XML. Sin embargo, en este caso, un diseño XML sería un trabajo innecesario porque el fragmento del artículo es el único componente de esta actividad.</p>
+
+<p>Un punto muy importante que debes tener en cuenta al diseñar tus fragmentos es no crear un acoplamiento fuerte para una actividad determinada. Para ello, normalmente puedes definir una interfaz que resuma todas las formas en las que tiene que interactuar el fragmento con su actividad principal y, a continuación, la actividad principal implementa esa interfaz:</p>
+
+<p>Por ejemplo, ese es precisamente el objetivo del <code>HeadlinesFragment</code> de la aplicación News Reader:</p>
+
+<pre>
+public class HeadlinesFragment extends ListFragment {
+ ...
+ OnHeadlineSelectedListener mHeadlineSelectedListener = null;
+
+ /* Must be implemented by host activity */
+ public interface OnHeadlineSelectedListener {
+ public void onHeadlineSelected(int index);
+ }
+ ...
+
+ public void setOnHeadlineSelectedListener(OnHeadlineSelectedListener listener) {
+ mHeadlineSelectedListener = listener;
+ }
+}
+</pre>
+
+<p>A continuación, cuando el usuario selecciona un encabezado, el fragmento notifica el detector especificado por la actividad principal (en lugar de notificar una actividad predefinida específica):</p>
+
+<pre>
+public class HeadlinesFragment extends ListFragment {
+ ...
+ @Override
+ public void onItemClick(AdapterView<?> parent,
+ View view, int position, long id) {
+ if (null != mHeadlineSelectedListener) {
+ mHeadlineSelectedListener.onHeadlineSelected(position);
+ }
+ }
+ ...
+}
+</pre>
+
+<p>Si quieres obtener más información sobre esta técnica, puedes consultar la guía sobre <a
+href="{@docRoot}guide/practices/tablets-and-handsets.html">Cómo admitir tablets y dispositivos móviles</a>.</p>
+
+
+<h2 id="TaskHandleConfigChanges">Cómo gestionar los cambios en la configuración de la pantalla</h2>
+
+<p>Si utilizas actividades independientes para implementar partes individuales de tu interfaz, debes tener en cuenta que es posible que tengas que reaccionar ante determinados cambios en la configuración (como un cambio de rotación) para mantener la homogeneidad de tu interfaz.</p>
+
+<p>Por ejemplo, en un tablet de 7" que utilice Android 3.0 o una versión superior, el ejemplo de News Reader utiliza una actividad independiente para mostrar el artículo de noticias en el modo vertical, pero utiliza el diseño de panel dual en el modo horizontal.</p>
+
+<p>Esto significa que cuando el usuario utiliza el modo vertical y está consultando un artículo, tienes que detectar que la orientación ha cambiado al modo horizontal y reaccionar de forma adecuada finalizando la actividad. A continuación, debes volver a la actividad principal para que el contenido pueda mostrarse en el diseño de panel dual:</p>
+
+<pre>
+public class ArticleActivity extends FragmentActivity {
+ int mCatIndex, mArtIndex;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mCatIndex = getIntent().getExtras().getInt("catIndex", 0);
+ mArtIndex = getIntent().getExtras().getInt("artIndex", 0);
+
+ // If should be in two-pane mode, finish to return to main activity
+ if (getResources().getBoolean(R.bool.has_two_panes)) {
+ finish();
+ return;
+ }
+ ...
+}
+</pre>
+
+
diff --git a/docs/html/intl/es/training/multiscreen/index.jd b/docs/html/intl/es/training/multiscreen/index.jd
new file mode 100644
index 0000000..0a1461b
--- /dev/null
+++ b/docs/html/intl/es/training/multiscreen/index.jd
@@ -0,0 +1,63 @@
+page.title=Cómo diseñar aplicaciones para varias pantallas
+trainingnavtop=true
+startpage=true
+next.title=Cómo admitir varios tamaños de pantalla
+next.link=screensizes.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Dependencias y requisitos previos</h2>
+
+<ul>
+ <li>Android 1.6 o superior (Android 2.1 o superior para la aplicación de ejemplo)</li>
+ <li>Conocimiento básico de <a
+href="http://developer.android.com/guide/components/activities.html">Actividades</a> y <a href="http://developer.android.com/guide/components/fragments.html">Fragmentos</a></li>
+ <li>Experiencia en el desarrollo de una <a
+href="http://developer.android.com/guide/topics/ui/index.html">Interfaz de usuario</a> de Android</li>
+ <li>Algunas funciones requieren el uso de la <a
+href="{@docRoot}tools/extras/support-library.html">biblioteca de compatibilidad</a></li>
+</ul>
+
+<h2>También puedes consultar:</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">Cómo admitir varias pantallas</a></li>
+</ul>
+
+<h2>¡Pruébalo!</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Descargar la aplicación de ejemplo</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>Android se utiliza en cientos de dispositivos con diferentes tamaños de pantalla, desde pequeños teléfonos hasta enormes televisores. Por ello, es importante que diseñes tu aplicación para que sea compatible con todos los tamaños de pantalla y esté disponible para el mayor número de usuarios posible.</p>
+
+<p>Sin embargo, no es suficiente con que tu aplicación sea compatible con diferentes dispositivos. Cada tamaño de pantalla ofrece diferentes posibilidades y retos para la interacción del usuario. Por ello, para satisfacer completamente a tus usuarios e impresionarlos, tu aplicación debe ir más allá de simplemente <em>admitir</em> varias pantallas: debe <em>optimizar</em> la experiencia de usuario para cada configuración de pantalla.</p>
+
+<p>En esta sección se explica cómo implementar una interfaz de usuario que esté optimizada para diferentes configuraciones de pantalla.</p>
+
+<p>El código que aparece en cada sección se ha extraído de una aplicación de ejemplo para explicar las prácticas recomendadas a la hora de optimizar tu aplicación para varias pantallas. Puedes descargar el ejemplo (situado a la derecha) y utilizarlo como fuente de código reutilizable para tu propia aplicación.</p>
+
+<p class="note"><strong>Nota:</strong> en esta sección y en el ejemplo correspondiente, se utiliza la <a
+href="{@docRoot}tools/extras/support-library.html">biblioteca de compatibilidad</a> para poder usar las API de <PH>{@link android.app.Fragment}</PH> en versiones anteriores a Android 3.0. Debes descargar y la biblioteca y añadirla a tu aplicación para poder utilizar todas las API que se indican en esta sección.</p>
+
+
+<h2>Secciones</h2>
+
+<dl>
+ <dt><b><a href="screensizes.html">Cómo admitir varios tamaños de pantalla</a></b></dt>
+ <dd>En esta sección se explica cómo crear diseños que se adapten a diferentes tamaños de pantalla (mediante dimensiones flexibles para vistas, <PH>{@link android.widget.RelativeLayout}</PH>, calificadores de orientación y tamaño de pantalla, filtros de alias y mapas de bits de la clase NinePatch).</dd>
+
+ <dt><b><a href="screendensities.html">Cómo admitir varias densidades de pantalla</a></b></dt>
+ <dd>En esta sección se explica cómo admitir pantallas con diferentes densidades de píxeles (mediante píxeles independientes de la densidad y mapas de bits adecuados a cada densidad).</dd>
+
+ <dt><b><a href="adaptui.html">Cómo implementar interfaces de usuario adaptables</a></b></dt>
+ <dd>En esta sección se explica cómo implementar tu interfaz de usuario para que se adapte a varias combinaciones de densidad o de tamaño de pantalla (detección de tiempo de ejecución del diseño activo, cómo reaccionar en función del diseño actual y cómo administrar los cambios en la configuración de la pantalla).</dd>
+</dl>
diff --git a/docs/html/intl/es/training/multiscreen/screendensities.jd b/docs/html/intl/es/training/multiscreen/screendensities.jd
new file mode 100644
index 0000000..0edb89f
--- /dev/null
+++ b/docs/html/intl/es/training/multiscreen/screendensities.jd
@@ -0,0 +1,100 @@
+page.title=Cómo admitir varias densidades de pantalla
+parent.title=Cómo diseñar aplicaciones para varias pantallas
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Cómo admitir varios tamaños de pantalla
+previous.link=screensizes.html
+next.title=Cómo implementar interfaces de usuario adaptables
+next.link=adaptui.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>En esta sección puedes aprender:</h2>
+<ol>
+ <li><a href="#TaskUseDP">Cómo utilizar píxeles independientes de la densidad</a></li>
+ <li><a href="#TaskProvideAltBmp">Cómo proporcionar mapas de bits alternativos</a></li>
+</ol>
+
+<h2>También puedes consultar:</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">Cómo admitir varias pantallas</a></li>
+ <li><a href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">Directrices para diseñar iconos</a></li>
+</ul>
+
+<h2>¡Pruébalo!</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Descargar la aplicación de ejemplo</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+
+</div>
+</div>
+
+<p>En esta sección se explica cómo proporcionar diferentes recursos y utilizar unidades de medida de resolución independiente para admitir diferentes densidades de pantalla.</p>
+
+<h2 id="TaskUseDP">Cómo utilizar píxeles independientes de la densidad</h2>
+
+<p>Un error común que debes evitar al crear tus diseños es utilizar píxeles absolutos para definir distancias o tamaños. Definir dimensiones de diseño mediante píxeles es problemático porque cada pantalla tiene densidades de píxeles diferentes, por lo que es posible que el mismo número de píxeles corresponda a varios tamaños físicos en distintos dispositivos. Por tanto, al especificar dimensiones, debes utilizar siempre unidades <code>dp</code> o <code>sp</code>. <code>dp</code> es un píxel independiente de la densidad que corresponde al tamaño físico de un píxel a 160 dpi. <code>sp</code> es la misma unidad de base, pero aumentada en función del tamaño de letra preferido por el usuario (se trata de un píxel independiente de la escala). Por tanto, debes utilizar esta unidad de medida para definir el tamaño de letra (pero no para tamaños de diseños).</p>
+
+<p>Por ejemplo, al especificar un espacio entre dos vistas, debes utilizar <code>dp</code> en lugar de <code>px</code>:</p>
+
+<pre>
+<Button android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/clickme"
+ android:layout_marginTop="20dp" />
+</pre>
+
+<p>Al especificar el tamaño de letra, debes usar siempre <code>sp</code>:</p>
+
+<pre>
+<TextView android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="20sp" />
+</pre>
+
+
+<h2 id="TaskProvideAltBmp">Cómo proporcionar mapas de bits alternativos</h2>
+
+<p>Dado que Android se ejecuta en dispositivos con diferentes densidades de pantalla, siempre debes proporcionar tus recursos de mapas de bits adaptados a los conjuntos de densidades generalizados: baja, media, alta y muy alta. De este modo, podrás conseguir un rendimiento y una calidad gráfica óptimos en todas las densidades de pantalla.</p>
+
+<p>Para generar estas imágenes, debes empezar con tu recurso genérico en formato vectorial y generar las imágenes para cada densidad con la siguiente escala de tamaños:</p>
+
+<p><ul>
+ <li><code>xhdpi</code>: 2,0
+ <li><code>hdpi</code>: 1,5
+ <li><code>mdpi</code>: 1.0 (base)
+ <li><code>ldpi</code>: 0,75
+</ul></p>
+
+<p>Esto significa que si generas una imagen de 200 x 200 para dispositivos <code>xhdpi</code>, debes generar el mismo recurso en 150 x 150 para <code>hdpi</code>, en 100 x 100 para <code>mdpi</code> y, por último, una imagen de 75 x 75 para dispositivos <code>ldpi</code>.</p>
+
+<p>A continuación, sitúa los archivos de imagen generados en el subdirectorio adecuado en <code>res/</code> y el sistema seleccionará el archivo correspondiente automáticamente en función de la densidad de la pantalla del dispositivo en el que se esté ejecutando la aplicación:</p>
+
+<pre class="classic no-pretty-print">
+MyProject/
+ res/
+ drawable-xhdpi/
+ awesomeimage.png
+ drawable-hdpi/
+ awesomeimage.png
+ drawable-mdpi/
+ awesomeimage.png
+ drawable-ldpi/
+ awesomeimage.png
+</pre>
+
+<p>Por tanto, cada vez que hagas referencia a <code>@drawable/awesomeimage</code>, el sistema seleccionará el mapa de bits adecuado en función de los puntos por pulgada de la pantalla.</p>
+
+<p>Para consultar más sugerencias y directrices sobre cómo crear recursos de iconos para tu aplicación, consulta la sección <a
+href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">Directrices para diseñar iconos</a>.</p>
+
diff --git a/docs/html/intl/es/training/multiscreen/screensizes.jd b/docs/html/intl/es/training/multiscreen/screensizes.jd
new file mode 100644
index 0000000..9a971d1
--- /dev/null
+++ b/docs/html/intl/es/training/multiscreen/screensizes.jd
@@ -0,0 +1,279 @@
+page.title=Cómo admitir varios tamaños de pantalla
+parent.title=Cómo diseñar aplicaciones para varias pantallas
+parent.link=index.html
+
+trainingnavtop=true
+next.title=Cómo admitir varias densidades de pantalla
+next.link=screendensities.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>En esta sección puedes aprender:</h2>
+<ol>
+ <li><a href="#TaskUseWrapMatchPar">Cómo utilizar los valores "wrap_content" y "match_parent"</a></li>
+ <li><a href="#TaskUseRelativeLayout">Cómo utilizar RelativeLayout</a></li>
+ <li><a href="#TaskUseSizeQuali">Cómo utilizar calificadores de tamaño</a></li>
+ <li><a href="#TaskUseSWQuali">Cómo utilizar el calificador de ancho más pequeño</a></li>
+ <li><a href="#TaskUseAliasFilters">Cómo utilizar alias de diseño</a></li>
+ <li><a href="#TaskUseOriQuali">Cómo utilizar calificadores de orientación</a></li>
+ <li><a href="#TaskUse9Patch">Cómo utilizar mapas de bits de la clase NinePatch</a></li>
+</ol>
+
+<h2>También puedes consultar:</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">Cómo admitir varias pantallas</a></li>
+</ul>
+
+<h2>¡Pruébalo!</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Descargar la aplicación de ejemplo</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>En esta sección se explica cómo admitir varios tamaños de pantalla. Para ello, sigue estos pasos:</p>
+<ul>
+ <li>Asegúrate de que el diseño se haya ajustado correctamente al tamaño de la pantalla.</li>
+ <li>Configura la pantalla con el diseño de interfaz adecuado.</li>
+ <li>Asegúrate de aplicar el diseño adecuado a la pantalla correspondiente.</li>
+ <li>Utiliza el mapa de bits con la escala adecuada.</li>
+</ul>
+
+
+<h2 id="TaskUseWrapMatchPar">Cómo utilizar los valores "wrap_content" y "match_parent"</h2>
+
+<p>Para garantizar que el diseño es flexible y que se adapta a varios tamaños de pantalla, debes utilizar los valores <code>"wrap_content"</code> y <code>"match_parent"</code> para la altura y el ancho de algunos componentes de la vista. Si utilizas <code>"wrap_content"</code>, el ancho o la altura de la vista se establece en el tamaño mínimo necesario para adaptar el contenido a esta vista, mientras que <code>"match_parent"</code> (también conocido como <code>"fill_parent"</code> antes del nivel 8 del API) provoca que el componente se amplíe hasta coincidir con el tamaño de la vista principal.</p>
+
+<p>Al utilizar los valores de tamaño <code>"wrap_content"</code> y <code>"match_parent"</code> en lugar de los tamaños predefinidos, las vistas pueden utilizar únicamente el espacio requerido para esa vista o ampliarse hasta rellenar el espacio disponible respectivamente. Por ejemplo:</p>
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane_with_bar.xml all}
+
+<p>Observa cómo se utilizan en el ejemplo los valores <code>"wrap_content"</code> y <code>"match_parent"</code> para los tamaños de los componentes en lugar de dimensiones específicas. Esto permite que el diseño se adapte correctamente a diferentes tamaños y orientaciones de la pantalla.</p>
+
+<p>Por ejemplo, esta es la apariencia del diseño en modo horizontal y vertical. Ten en cuenta que los tamaños de los componentes se adaptan automáticamente a la altura y al ancho:</p>
+
+<img src="{@docRoot}images/training/layout-hvga.png" />
+<p class="img-caption"><strong>Figura 1.</strong> La aplicación de ejemplo News Reader en modo vertical (izquierda) y horizontal (derecha)</p>
+
+
+<h2 id="TaskUseRelativeLayout">Cómo utilizar RelativeLayout</h2>
+
+<p>Puedes crear diseños de un cierto nivel de complejidad con instancias anidadas de <PH>{@link android.widget.LinearLayout}</PH> y combinaciones de los valores de tamaño <code>"wrap_content"</code> y <code>"match_parent"</code>. Sin embargo, <PH>{@link android.widget.LinearLayout}</PH> no te permite controlar con precisión las relaciones espaciales de las vistas secundarias; las vistas de <PH>{@link android.widget.LinearLayout}</PH> simplemente se alinean en paralelo. Si quieres orientar las vistas secundarias de una forma que no sea una línea recta, a menudo la mejor solución es utilizar <PH>{@link android.widget.RelativeLayout}</PH>que te permite especificar el diseño según las relaciones espaciales entre los componentes. Por ejemplo, puedes alinear una vista secundaria en el lateral izquierdo y otra vista en el lateral derecho de la pantalla.</p>
+
+<p>Por ejemplo:</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:id="@+id/label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Type here:"/>
+ <EditText
+ android:id="@+id/entry"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/label"/>
+ <Button
+ android:id="@+id/ok"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/entry"
+ android:layout_alignParentRight="true"
+ android:layout_marginLeft="10dp"
+ android:text="OK" />
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toLeftOf="@id/ok"
+ android:layout_alignTop="@id/ok"
+ android:text="Cancel" />
+</RelativeLayout>
+</pre>
+
+<p>La figura 2 indica cómo se muestra este diseño en una pantalla QVGA.</p>
+
+<img src="{@docRoot}images/training/relativelayout1.png" />
+<p class="img-caption"><strong>Figura 2.</strong> Captura de pantalla de una pantalla QVGA (pantalla pequeña)</p>
+
+<p>La figura 3 indica cómo se muestra este diseño en una pantalla más grande.</p>
+
+<img src="{@docRoot}images/training/relativelayout2.png" />
+<p class="img-caption"><strong>Figura 3.</strong> Captura de pantalla de una pantalla WSVGA (pantalla grande)</p>
+
+<p>Ten en cuenta que aunque el tamaño de los componentes es diferente, las relaciones espaciales se mantienen según se ha especificado con <PH>{@link android.widget.RelativeLayout.LayoutParams}</PH>.</p>
+
+
+<h2 id="TaskUseSizeQuali">Cómo utilizar calificadores de tamaño</h2>
+
+<p>Hay mucha diferencia entre un diseño flexible y un diseño relativo como el que se ha utilizado en las secciones anteriores. Aunque ambos diseños se adaptan a diferentes pantalla estirando el espacio dentro de los componentes y alrededor de los mismos, puede que no ofrezcan la mejor experiencia de usuario para cada tamaño de pantalla. Por tanto, tu aplicación no solo debe implementar los diseños flexibles, sino que también debe ofrecer varios diseños alternativos para diferentes configuraciones de pantalla. Para ello, se utilizan <a href="http://developer.android.com/guide/practices/screens_support.html#qualifiers">calificadores de configuración</a>, que permiten que el tiempo de ejecución seleccione el recurso adecuado en función de la configuración actual del dispositivo (por ejemplo, un diseño diferente para diferentes tamaños de pantalla).</p>
+
+<p>Por ejemplo, muchas aplicaciones implementan el patrón de "panel dual" para pantallas grandes (la aplicación mostraría una lista de elementos en un panel y el contenido en otro panel). Aunque los tablets y las televisiones son lo suficientemente grandes como para que los dos paneles aparezcan simultáneamente en la pantalla, las pantallas de los teléfonos tienen que mostrarlos por separado. Para implementar estos diseños, puedes utilizar los siguientes archivos:</p>
+
+<ul>
+ <li><code>res/layout/main.xml</code>, diseño de panel único (predeterminado):
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+</li>
+ <li><code>res/layout-large/main.xml</code>, diseño de panel dual:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+</li>
+</ul>
+
+<p>Observa el calificador <code>large</code> en el nombre de directorio del segundo diseño. Este diseño se seleccionará en dispositivos con pantallas clasificadas como grandes (por ejemplo, tablets de 7" y superiores). El otro diseño (sin calificadores) se seleccionará en el caso de dispositivos más pequeños.</p>
+
+
+<h2 id="TaskUseSWQuali">Cómo utilizar el calificador de ancho mínimo</h2>
+
+<p>Una de las dificultades a las que se enfrentaron los desarrolladores con los dispositivos Android anteriores a la versión 3.2 fue el contenedor de tamaño de pantalla "grande". Algunos ejemplos de este tipo de dispositivo son el tablet Dell Streak, el tablet Galaxy Tab original y los tablets de 7" en general. Sin embargo, es posible que muchas aplicaciones quieran mostrar varios diseños para diferentes dispositivos de esta categoría (por ejemplo, para dispositivos de 5" y de 7"), aunque todos estos dispositivos se consideren de pantalla grande. Por esta razón, Android introdujo el calificador de "ancho mínimo" (entre otros) en Android 3.2.</p>
+
+<p>Este calificador te permite mostrar contenido en pantallas que tengan un ancho mínimo determinado en píxeles independientes de la densidad. Por ejemplo, el tablet típico de 7" tiene un ancho mínimo de 600 dp, por lo que si quieres que la interfaz de usuario sea de panel dual en esta pantalla (y una única lista en pantallas más pequeñas), puedes utilizar los mismos dos diseños de la sección anterior para los diseños de panel único y de panel dual, solo que en lugar de utilizar el calificador de tamaño <code>large</code>, debes utilizar <code>sw600dp</code> para indicar que el diseño de panel dual se utiliza con las pantallas cuyo ancho mínimo sea de 600 dp:</p>
+
+<ul>
+ <li><code>res/layout/main.xml</code>, diseño de panel único (predeterminado):
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+</li>
+ <li><code>res/layout-sw600dp/main.xml</code>, diseño de panel dual:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+</li>
+</ul>
+
+<p>Esto significa que los dispositivos cuyo ancho mínimo sea igual o superior a 600 dp utilizarán el diseño <code>layout-sw600dp/main.xml</code> (panel dual), mientras que las pantallas más pequeñas utilizarán el diseño <code>layout/main.xml</code> (panel único).</p>
+
+<p>No obstante, esto no funcionará en los dispositivos anteriores a Android 3.2 porque no reconocen <code>sw600dp</code> como calificador de tamaño, por lo que también tendrás que seguir utilizando el calificador <code>large</code>. Por tanto, debes tener un archivo con el nombre <code>res/layout-large/main.xml</code> idéntico a <code>res/layout-sw600dp/main.xml</code>. En la siguiente sección, obtendrás información sobre una técnica que te permite evitar que se dupliquen los archivos de diseños.</p>
+
+
+<h2 id="TaskUseAliasFilters">Cómo utilizar alias de diseño</h2>
+
+<p>El calificador de ancho mínimo solo está disponible en Android 3.2 o superior. Por tanto, tendrás que seguir utilizando los contenedores de tamaño abstractos (pequeño, normal, grande y extragrande) para que sean compatibles con versiones anteriores. Por ejemplo, si quieres que tu interfaz de usuario sea de panel único en teléfonos pero multipanel en tablets de 7", televisiones y otros dispositivos grandes, tendrás que utilizar los siguientes archivos:</p>
+
+<p><ul>
+<li><code>res/layout/main.xml:</code> diseño de panel único,</li>
+<li><code>res/layout-large:</code> diseño multipanel,</li>
+<li><code>res/layout-sw600dp:</code> diseño multipanel.</li>
+</ul></p>
+
+<p>Los dos últimos archivos son idénticos porque uno de ellos se utilizará con dispositivos Android 3.2 y el otro con tablets y televisiones que utilicen versiones anteriores de Android.</p>
+
+<p>Para evitar la duplicación del mismo archivo para tablets y televisiones (así como todos los problemas que esto conlleva), puedes utilizar archivos alias. Por ejemplo, puedes establecer los siguientes diseños:</p>
+
+<ul>
+<li><code>res/layout/main.xml</code>: diseño de panel único,</li>
+<li><code>res/layout/main_twopanes.xml</code>: diseño de panel dual.</li>
+</ul>
+
+<p>Añade estos dos archivos:</p>
+
+<p><ul>
+<li><code>res/values-large/layout.xml</code>:
+<pre>
+<resources>
+ <item name="main" type="layout">@layout/main_twopanes</item>
+</resources>
+</pre>
+</li>
+
+<li><code>res/values-sw600dp/layout.xml</code>:
+<pre>
+<resources>
+ <item name="main" type="layout">@layout/main_twopanes</item>
+</resources>
+</pre>
+
+</li>
+</ul></p>
+
+<p>Estos dos últimos archivos tienen el mismo contenido, pero en realidad no definen el diseño. Solo configuran <PH>{@code main}</PH> para que sea un alias de <PH>{@code main_twopanes}</PH>. Como los archivos tienen selectores <code>large</code> y <code>sw600dp</code>, se aplican a tablets y a televisiones independientemente de la versión de Android (las televisiones y los tablets anteriores a la versión 3.2 utilizarán
+<PH>{@code large}</PH>y las televisiones y los tablets posteriores a la versión 3.2 utilizarán <code>sw600dp</code>).</p>
+
+
+<h2 id="TaskUseOriQuali">Cómo utilizar calificadores de orientación</h2>
+
+<p>Aunque algunos diseños se pueden utilizar tanto en modo horizontal como vertical, la mayoría de ellos pueden beneficiarse de los ajustes. A continuación, se indica cómo se comporta el diseño según cada tamaño y orientación de la pantalla en la aplicación de ejemplo News Reader:</p>
+
+<p><ul>
+<li><b>pantalla pequeña, vertical:</b> panel único con logotipo,</li>
+<li><b>pantalla pequeña, horizontal:</b> panel único con logotipo,</li>
+<li><b>tablet de 7", vertical:</b> panel único con barra de acciones,</li>
+<li><b>tablet de 7", horizontal:</b> panel dual ancho con barra de acciones,</li>
+<li><b>tablet de 10", vertical:</b> panel dual estrecho con barra de acciones,</li>
+<li><b>tablet de 10", horizontal:</b> panel dual ancho con barra de acciones,</li>
+<li><b>televisión, horizontal:</b> panel dual ancho con barra de acciones.</li>
+</ul></p>
+
+<p>Cada uno de estos diseños se establecen en un archivo XML en el directorio <code>res/layout/</code>. Para definir posteriormente las diferentes configuraciones de pantalla, la aplicación utiliza alias de diseño para asignarlos a cada configuración:</p>
+
+<p><code>res/layout/onepane.xml:</code></p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+
+<p><code>res/layout/onepane_with_bar.xml:</code></p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane_with_bar.xml all}
+
+<p><code>res/layout/twopanes.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+
+<p><code>res/layout/twopanes_narrow.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes_narrow.xml all}
+
+<p>Una vez que se hayan definido todos los diseños posibles, solo se debe asignar el diseño adecuado a cada configuración a través de calificadores de configuración. Ahora ya puedes utilizar la técnica de los alias de diseño:</p>
+
+<p><code>res/values/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values/layouts.xml all}
+
+<p><code>res/values-sw600dp-land/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-land/layouts.xml
+all}
+
+<p><code>res/values-sw600dp-port/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-port/layouts.xml
+all}
+
+<p><code>res/values-large-land/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-land/layouts.xml all}
+
+<p><code>res/values-large-port/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-port/layouts.xml all}
+
+
+
+<h2 id="TaskUse9Patch">Cómo utilizar mapas de bits de la clase NinePatch</h2>
+
+<p>Admitir diferentes tamaños de pantalla normalmente implica que las fuentes de imagen también deben poder adaptarse a varios tamaños. Por ejemplo, un fondo de botón debe adaptarse a cualquier forma de botón a la que se aplique.</p>
+
+<p>Si utilizas imágenes sencillas en componentes que pueden cambiar de tamaño, observarás rápidamente que los resultados no es que sean precisamente impresionantes, ya que las imágenes se estirarán o estrecharán. La solución es utilizar mapas de bits de la clase NinePatch, que son archivos PNG con un formato especial que indican las áreas que se pueden y no se pueden estirar.</p>
+
+<p>Por tanto, al diseñar mapas de bits que se vayan a utilizar en componentes con tamaño variable, utiliza siempre mapas de bits de la clase NinePatch. Para convertir un mapa de bits en uno de la clase NinePatch, puedes empezar con una imagen normal (consulta la figura 4, que se ha ampliado cuatro veces para obtener una mayor claridad).</p>
+
+<img src="{@docRoot}images/training/button.png" />
+<p class="img-caption"><strong>Figura 4.</strong> <code>button.png</code></p>
+
+<p>A continuación, puedes pasar a la utilidad <ode
+href="{@docRoot}tools/help/draw9patch.html"><code>draw9patch</code></a> del SDK (que se localiza en el directorio <code>tools/</code>) en la que puedes marcar las áreas que se deben estirar dibujando píxeles a lo largo de los bordes superior e izquierdo. También puedes marcar el área que debe incluir el contenido dibujando píxeles a lo largo de los bordes inferior y derecho, como se muestra en la figura 5.</p>
+
+<img src="{@docRoot}images/training/button_with_marks.png" />
+<p class="img-caption"><strong>Figura 5.</strong> <code>button.9.png</code></p>
+
+<p>Observa los píxeles de color negro situados junto a los bordes. Los que aparecen en los bordes superior e izquierdo indican los lugares en los que se puede estirar la imagen, mientras que los que aparecen en los bordes inferior y derecho indican dónde se debe situar el contenido.</p>
+
+<p>Además, observa la extensión <code>.9.png</code>. Debes utilizar esta extensión, ya que, de este modo, el marco detecta que se trata de una imagen de la clase NinePatch, en lugar de una imagen PNG normal.</p>
+
+<p>Cuando aplicas este fondo a un componente (definiendo <code>android:background="@drawable/button"</code>), el marco estira la imagen de forma adecuada para adaptarla al botón, como se muestra en varios tamaños de la figura 6.</p>
+
+<img src="{@docRoot}images/training/buttons_stretched.png" />
+<p class="img-caption"><strong>Figura 6.</strong> Botón que utiliza la clase NinePatch <code>button.9.png</code> en varios tamaños</p>
+
diff --git a/docs/html/intl/ja/guide/developing/eclipse-adt.jd b/docs/html/intl/ja/guide/developing/eclipse-adt.jd
index 397c006..2cd6949 100644
--- a/docs/html/intl/ja/guide/developing/eclipse-adt.jd
+++ b/docs/html/intl/ja/guide/developing/eclipse-adt.jd
@@ -29,8 +29,8 @@
<li>プロジェクトを、ユーザーに配布可能な署名済みの APK 形式でエクスポートすることもできます。</li>
</ul>
-<p>ADT を組み込んだ Eclipse 総合開発環境で Android アプリケーションの開発を始めるには、最初に Eclipse 総合開発環境をダウンロードしてから、ADT プラグインをダウンロードしてインストールする必要があります。そのためには、<a href="{@docRoot}sdk/eclipse-adt.html#installing">Eclipse 用 ADT プラグインのインストール</a>に記載されている手順どおりに操作します。</p>
-<p>バージョン 0.9 より前の ADT を使用してアプリケーションを既に開発中の場合は、必ず最新バージョンにアップグレードしてから続行してください。<a href="{@docRoot}sdk/eclipse-adt.html#updating">Eclipse ADT プラグインをアップデート</a>するためのガイドをご覧ください。</p>
+<p>ADT を組み込んだ Eclipse 総合開発環境で Android アプリケーションの開発を始めるには、最初に Eclipse 総合開発環境をダウンロードしてから、ADT プラグインをダウンロードしてインストールする必要があります。そのためには、<a href="{@docRoot}tools/sdk/eclipse-adt.html#installing">Eclipse 用 ADT プラグインのインストール</a>に記載されている手順どおりに操作します。</p>
+<p>バージョン 0.9 より前の ADT を使用してアプリケーションを既に開発中の場合は、必ず最新バージョンにアップグレードしてから続行してください。<a href="{@docRoot}tools/sdk/eclipse-adt.html#updating">Eclipse ADT プラグインをアップデート</a>するためのガイドをご覧ください。</p>
<p class="note"><strong>注:</strong> このガイドでは、ADT プラグインの最新バージョンを使用していることを前提としています。説明の大半は、以前のバージョンにも当てはまりますが、以前のバージョンを使用している場合は、このドキュメントのオンライン版ではなく、SDK パッケージに付属された資料内の同ドキュメントをご覧ください。</p>
@@ -84,9 +84,9 @@
<h2 id="Running">アプリケーションの実行</h2>
-<p>注意してください。<em></em>アプリケーションを Android エミュレータで実行する前に、Android 仮想デバイス(AVD)を作成する<strong>必要があります</strong>。AVD では、エミュレータで使用する Android プラットフォームを指定します。詳しくは <a href="{@docRoot}guide/developing/tools/avd.html">Android 仮想デバイス</a> のドキュメントをご覧ください。ただし、すぐにアプリケーションを実行したい場合は、次の簡単な手順に従って AVD を作成してください。</p>
+<p>注意してください。<em></em>アプリケーションを Android エミュレータで実行する前に、Android 仮想デバイス(AVD)を作成する<strong>必要があります</strong>。AVD では、エミュレータで使用する Android プラットフォームを指定します。詳しくは <a href="{@docRoot}tools/avd.html">Android 仮想デバイス</a> のドキュメントをご覧ください。ただし、すぐにアプリケーションを実行したい場合は、次の簡単な手順に従って AVD を作成してください。</p>
-<p>携帯端末の実機でのみアプリケーションを実行する場合は、AVD は必要ありません。この場合のアプリケーションの実行について詳しくは、<a href="{@docRoot}guide/developing/device.html">Developing On a Device</a> をご覧ください。</p>
+<p>携帯端末の実機でのみアプリケーションを実行する場合は、AVD は必要ありません。この場合のアプリケーションの実行について詳しくは、<a href="{@docRoot}tools/device.html">Developing On a Device</a> をご覧ください。</p>
<h3 id="CreatingAnAvd">AVD の作成</h3>
@@ -119,7 +119,7 @@
<p>これで AVD が作成できました。次のセクションでは、エミュレータでアプリケーションを起動する際に、AVD がどのように使用されるかについて説明します。</p>
-<p>AVD の作成と管理について詳しくは、<a href="{@docRoot}guide/developing/tools/avd.html">Android 仮想デバイス</a> のドキュメントをご覧ください。</p>
+<p>AVD の作成と管理について詳しくは、<a href="{@docRoot}tools/avd.html">Android 仮想デバイス</a> のドキュメントをご覧ください。</p>
<h3 id="RunningYourApplication">アプリケーションの実行</h3>
@@ -193,7 +193,7 @@
<p>Android アプリケーションの開発を始めると、Android アプリケーションをシステムがエミュレータや実機にインストールする前に、どの Android アプリケーションにもデジタル署名が必要であることがわかります。署名には、デバッグ キーを使用する方法(エミュレータや開発用端末ですぐにテストする場合)と、非公開キーを使用する方法(アプリケーションを配布する場合)の 2 つがあります。</p>
<p>ADT プラグインでは、アプリケーションをエミュレータや開発用端末にインストールする前に、.apk ファイルがデバッグ キーを使用して署名されるので、開発を早めることができます。つまり、独自の非公開キーを生成する必要がなく、Eclipse からアプリケーションをすぐに実行できます。Keytool に ADT がアクセスできれば、デベロッパーが特に操作する必要はありません。ただし、アプリケーションを公開する場合は、SDK ツールが生成するデバッグ キーではなく、独自の非公開キーを使用してアプリケーションに署名する<strong>必要があります</strong>。</p>
-<p><a href="{@docRoot}guide/publishing/app-signing.html">アプリケーションへの署名</a>をご覧ください。Android でのアプリケーションへの署名と、Android アプリケーション デベロッパーにとっての署名の意味について説明しています。このドキュメントには、ADT のエクスポート ウィザードを使用してアプリケーションをエクスポートし、署名するためのガイドも含まれています。</p>
+<p><a href="{@docRoot}tools/publishing/app-signing.html">アプリケーションへの署名</a>をご覧ください。Android でのアプリケーションへの署名と、Android アプリケーション デベロッパーにとっての署名の意味について説明しています。このドキュメントには、ADT のエクスポート ウィザードを使用してアプリケーションをエクスポートし、署名するためのガイドも含まれています。</p>
<h2 id="Tips">Eclipse のヒント </h2>
@@ -224,7 +224,7 @@
<h3>DDMS の手動による実行</h3>
-<p>ADT プラグインを使用するデバッグをおすすめしますが、手動で DDMS を実行し、ポート 8700 でデバッグするように Eclipse を設定することができます(<strong>注:</strong> 最初に必ず <a href="{@docRoot}guide/developing/tools/ddms.html">DDMS</a> を起動してください)。 </p>
+<p>ADT プラグインを使用するデバッグをおすすめしますが、手動で DDMS を実行し、ポート 8700 でデバッグするように Eclipse を設定することができます(<strong>注:</strong> 最初に必ず <a href="{@docRoot}tools/ddms.html">DDMS</a> を起動してください)。 </p>
<!-- TODO: clean this up and expand it to cover more wizards and features
<h3>ADT Wizards</h3>
diff --git a/docs/html/intl/ja/guide/developing/other-ide.jd b/docs/html/intl/ja/guide/developing/other-ide.jd
index ba82c18..cbffee3 100644
--- a/docs/html/intl/ja/guide/developing/other-ide.jd
+++ b/docs/html/intl/ja/guide/developing/other-ide.jd
@@ -19,9 +19,9 @@
<h2>関連項目</h2>
<ol>
- <li><a href="{@docRoot}guide/developing/tools/othertools.html#android">android ツール</a></li>
- <li><a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a></li>
- <li><a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a></li>
+ <li><a href="{@docRoot}tools/othertools.html#android">android ツール</a></li>
+ <li><a href="{@docRoot}tools/help/emulator.html">Android Emulator</a></li>
+ <li><a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a></li>
</ol>
</div>
</div>
@@ -36,11 +36,11 @@
<p>Eclipse 以外の統合開発環境やエディタで開発する際には、次の Android SDK ツールについて知っておく必要があります:</p>
<dl>
- <dt><a href="{@docRoot}guide/developing/tools/othertools.html#android">android</a></dt>
+ <dt><a href="{@docRoot}tools/othertools.html#android">android</a></dt>
<dd>Android プロジェクトの作成/更新、AVD の作成/移動/削除のために使用します。</dd>
- <dt><a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a></dt>
+ <dt><a href="{@docRoot}tools/help/emulator.html">Android Emulator</a></dt>
<dd>Android のエミュレーション プラットフォームで Android アプリケーションを実行するために使用します。</dd>
- <dt><a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a></dt>
+ <dt><a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a></dt>
<dd>エミュレータまたは接続先の端末とのインターフェースとして使用します(アプリケーションのインストール、端末のシェル、コマンドの実行などに使用)。
</dd>
</dl>
@@ -109,7 +109,7 @@
<li><code>tests/</code> - テスト用に、上記のすべての複製が含まれます。</li>
</ul>
-<p>プロジェクトを作成すると、開発を始める準備ができます。開発のために、プロジェクト フォルダをどこにでも移動できますが、アプリケーションをエミュレータに送信するために(方法については後述します)、SDK の <code>tools/</code> ディレクトリにある <a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a>(adb)を使用する必要があります。そのためにプロジェクト ソリューションと <code>tools/</code> フォルダ間でアクセスする必要があります。</p>
+<p>プロジェクトを作成すると、開発を始める準備ができます。開発のために、プロジェクト フォルダをどこにでも移動できますが、アプリケーションをエミュレータに送信するために(方法については後述します)、SDK の <code>tools/</code> ディレクトリにある <a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a>(adb)を使用する必要があります。そのためにプロジェクト ソリューションと <code>tools/</code> フォルダ間でアクセスする必要があります。</p>
<p class="warning"><strong>注:</strong> SDK ディレクトリは移動させないでください。移動するとビルド スクリプトが機能しなくなります(ビルド スクリプトをもう一度機能させるには、手動でスクリプトを更新して、SDK の新しいロケーションを反映させる必要があります)。</p>
@@ -140,7 +140,7 @@
<p>Android のビルド ツールを使用すると、ビルド時にデバッグキーを使用して .apk ファイルに自動的に署名できるので、スムーズな開発が可能です。つまり、独自の非公開キーを生成しなくても、アプリケーションをコンパイルして、エミュレータにインストールすることができます。ただし、アプリケーションを公開する場合は、SDK ツールが生成したデバッグ キーではなく、独自の非公開キーを使用してアプリケーションに署名する<strong>必要があります</strong>。 </p>
-<p><a href="{@docRoot}guide/publishing/app-signing.html">アプリケーションへの署名</a>をご覧ください。Android でのアプリケーションへの署名と、Android アプリケーション デベロッパーにとっての署名の意味について説明しています。</p>
+<p><a href="{@docRoot}tools/publishing/app-signing.html">アプリケーションへの署名</a>をご覧ください。Android でのアプリケーションへの署名と、Android アプリケーション デベロッパーにとっての署名の意味について説明しています。</p>
@@ -150,7 +150,7 @@
<p>デバッグ モードとリリース モードのどちらでビルドしているかに関係なく、プロジェクトをコンパイルし、ビルドするには Ant ツールが必要です。これにより、エミュレータや端末にインストールする .apk ファイルが作成されます。デバッグ モードでビルドすると、.apk ファイルは SDK ツールによりデバッグ キーを使用して自動的に署名されるので、インストールの準備がすぐに整います(ただし、エミュレータまたは接続された開発用端末上にのみインストールできます)。リリース モードでビルドされた .apk ファイルは署名されないので、Keytool と Jarsigner を使って、独自の非公開キーで手動で署名する必要があります。<em></em></p>
-<p><a href="{@docRoot}guide/publishing/app-signing.html">アプリケーションへの署名</a>の内容をよく理解する必要があります。また、アプリケーションをリリースしてエンドユーザーと共有することを計画している場合は非常に重要です。「アプリケーションへの署名」では、非公開キーを生成し、それを使用して .apk ファイルに署名する手順について説明しています。ただし、開発を始めたばかりであれば、デバッグ モードでビルドすることにより、エミュレータまたは独自の開発用端末でアプリケーションをすぐに実行できます。</p>
+<p><a href="{@docRoot}tools/publishing/app-signing.html">アプリケーションへの署名</a>の内容をよく理解する必要があります。また、アプリケーションをリリースしてエンドユーザーと共有することを計画している場合は非常に重要です。「アプリケーションへの署名」では、非公開キーを生成し、それを使用して .apk ファイルに署名する手順について説明しています。ただし、開発を始めたばかりであれば、デバッグ モードでビルドすることにより、エミュレータまたは独自の開発用端末でアプリケーションをすぐに実行できます。</p>
<p>Ant をお持ちでない場合は、<a href="http://ant.apache.org/">Apache Ant ホームページ</a>から入手してください。Ant をインストールして、必ず実行可能パスに置きます。Ant を実行する前に、「JAVA_HOME」環境変数を宣言して JDK のインストールパスを指定する必要があります。</p>
@@ -191,7 +191,7 @@
</li>
</ol>
-<p>リリース モードではアプリケーションを署名せずにビルドを行います。このため、アプリケーションをエンドユーザーに配布するためには、次に非公開キーを使用して署名を行う必要があります。この手順を行う方法については、<a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Application</a>をご覧ください。</p>
+<p>リリース モードではアプリケーションを署名せずにビルドを行います。このため、アプリケーションをエンドユーザーに配布するためには、次に非公開キーを使用して署名を行う必要があります。この手順を行う方法については、<a href="{@docRoot}tools/publishing/app-signing.html">Signing Your Application</a>をご覧ください。</p>
<p>非公開キーを使用してアプリケーションに署名すると、アプリケーションをエミュレータや端末にインストールできるようになります。これについては次の<a href="#Running">アプリケーションの実行</a>のセクションで説明します。次の方法でウェブ サーバーから端末にインストールすることもできます。署名した APK をウェブサイトにアップロードし、Android ウェブブラウザでその .apk の URL を読み込んでアプリケーションをダウンロードし、インストールを開始します(端末上では、[設定] > [アプリケーション] を選択し、[提供元不明のアプリ] をオンにする必要があります)。<em></em></p>
@@ -200,7 +200,7 @@
<p>端末のハードウェア以外でアプリケーションを実行する場合は、アプリケーションのインストール先となるエミュレータを起動する必要があります。Android エミュレータのインスタンスは、特有の端末構成に合わせて設定された、特定の Android プラットフォームを実行しています。このプラットフォームと構成は、Android 仮想デバイス(AVD)で定義されます。そのためエミュレータを起動する前に、AVD を定義しなくてはいけません。</p>
-<p>端末ハードウェアでアプリケーションを実行する場合は、代わりに、<a href="{@docRoot}guide/developing/device.html">端末のでの開発</a> をご覧ください。</p>
+<p>端末ハードウェアでアプリケーションを実行する場合は、代わりに、<a href="{@docRoot}tools/device.html">端末のでの開発</a> をご覧ください。</p>
<ol>
<li><strong>AVD の作成</strong>
@@ -253,9 +253,9 @@
<p>上記で使用したツールについて詳しくは、次のドキュメントをご覧ください:</p>
<ul>
- <li><a href="{@docRoot}guide/developing/tools/othertools.html#android">android ツール</a></li>
- <li><a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a></li>
- <li><a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a> (ADB)</li>
+ <li><a href="{@docRoot}tools/othertools.html#android">android ツール</a></li>
+ <li><a href="{@docRoot}tools/help/emulator.html">Android Emulator</a></li>
+ <li><a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a> (ADB)</li>
</ul>
@@ -265,7 +265,7 @@
<p>Eclipse プラグインを使用すると、デバッガへの接続は自動化されます。しかし他の総合開発環境でも、デバッグ ポートをリッスンしてデバッグ情報を受信するように設定することができます:</p>
<ol>
- <li>総合開発環境とエミュレータ間のポート転送サービスとして機能する <strong><a href="{@docRoot}guide/developing/tools/ddms.html">Dalvik Debug Monitor Server(DDMS)</a>ツールを起動します。</strong></li>
+ <li>総合開発環境とエミュレータ間のポート転送サービスとして機能する <strong><a href="{@docRoot}tools/ddms.html">Dalvik Debug Monitor Server(DDMS)</a>ツールを起動します。</strong></li>
<li><strong>エミュレータでオプションのデバッグ構成を設定します</strong>。設定には、デバッガ接続まで Activity のアプリケーション起動をブロックするオプションなどが含まれます。エミュレータでの CPU 使用率や画面の更新率の表示のように、これらのデバッグ用オプションの多くは DDMS がなくても使用できます。</li>
<li><strong>総合開発環境を設定して、デバッグ用にポート 8700 に接続します。</strong><a href="{@docRoot}guide/developing/debug-tasks.html#ide-debug-port">総合開発環境を設定してデバッグ ポートに接続する</a> をご覧ください。 </li>
</ol>
diff --git a/docs/html/intl/ja/guide/index.jd b/docs/html/intl/ja/guide/index.jd
index 5d35e0a..69b9eca 100644
--- a/docs/html/intl/ja/guide/index.jd
+++ b/docs/html/intl/ja/guide/index.jd
@@ -18,7 +18,7 @@
<dd>Android とは何か、基本機能、アプリケーションとの関係など、Android の基本事項について紹介します。</dd>
<dt><b>フレームワーク トピック</b></dt>
-<dd>Android のフレームワークと API の各部分について説明します。フレームワークの概要については、<a href="{@docRoot}guide/topics/fundamentals.html">アプリケーションの基礎</a>を最初にご覧ください。次に、ユーザー インターフェースの設計やリソースの設定、データの保存、権限の利用など、それぞれのトピックを必要に応じて参照してください。</dd>
+<dd>Android のフレームワークと API の各部分について説明します。フレームワークの概要については、<a href="{@docRoot}guide/components/fundamentals.html">アプリケーションの基礎</a>を最初にご覧ください。次に、ユーザー インターフェースの設計やリソースの設定、データの保存、権限の利用など、それぞれのトピックを必要に応じて参照してください。</dd>
<dt><b>開発</b></dt>
<dd>Android の開発とデバッグ用ツールの使用方法、結果のテスト方法について説明します。</dd>
@@ -41,7 +41,7 @@
</p>
<p>
-SDK のダウンロード後は、まずはじめにデベロッパー ガイドを参照してください。コードを実際に見てみることから始めたい場合は、簡単な <a href="{@docRoot}resources/tutorials/hello-world.html">Hello World</a> チュートリアルを参照してください。Android プラットフォーム向けに作成された標準的な「Hello, World」アプリケーションについて説明しています。<a href="{@docRoot}guide/topics/fundamentals.html">アプリケーションの基礎</a>ドキュメントは、アプリケーション フレームワークを理解したいユーザーに最適な出発点となります。
+SDK のダウンロード後は、まずはじめにデベロッパー ガイドを参照してください。コードを実際に見てみることから始めたい場合は、簡単な <a href="{@docRoot}training/basics/firstapp/index.html">Building Your First App</a> チュートリアルを参照してください。Android プラットフォーム向けに作成された標準的な「Hello, World」アプリケーションについて説明しています。<a href="{@docRoot}guide/components/fundamentals.html">アプリケーションの基礎</a>ドキュメントは、アプリケーション フレームワークを理解したいユーザーに最適な出発点となります。
</p>
diff --git a/docs/html/intl/ja/guide/publishing/app-signing.jd b/docs/html/intl/ja/guide/publishing/app-signing.jd
index 710591d..2d2acfa 100644
--- a/docs/html/intl/ja/guide/publishing/app-signing.jd
+++ b/docs/html/intl/ja/guide/publishing/app-signing.jd
@@ -35,8 +35,8 @@
<h2>関連項目</h2>
<ol>
-<li><a href="{@docRoot}guide/publishing/versioning.html">アプリケーションのバージョニング</a></li>
-<li><a href="{@docRoot}guide/publishing/preparing.html">公開の準備</a></li>
+<li><a href="{@docRoot}tools/publishing/versioning.html">アプリケーションのバージョニング</a></li>
+<li><a href="{@docRoot}tools/publishing/preparing.html">公開の準備</a></li>
</ol>
</div>
diff --git a/docs/html/intl/ja/guide/publishing/preparing.jd b/docs/html/intl/ja/guide/publishing/preparing.jd
index e232f3b..c7a2950 100644
--- a/docs/html/intl/ja/guide/publishing/preparing.jd
+++ b/docs/html/intl/ja/guide/publishing/preparing.jd
@@ -21,9 +21,9 @@
</p>
<p>アプリケーションを Android マーケットに公開する場合は、アプリケーションの具体的な準備要件について <a
-href="{@docRoot}guide/publishing/publishing.html#market">Android マーケットでの公開</a> もご覧ください。 </p>
+href="{@docRoot}tools/publishing/publishing.html#market">Android マーケットでの公開</a> もご覧ください。 </p>
-<p>アプリケーションを公開する方法の一般的な情報については、<a href="{@docRoot}guide/publishing/publishing.html">Publishing Your Applications</a> のドキュメントをご覧ください。 </p>
+<p>アプリケーションを公開する方法の一般的な情報については、<a href="{@docRoot}tools/publishing/publishing.html">Publishing Your Applications</a> のドキュメントをご覧ください。 </p>
<div class="special">
@@ -56,7 +56,7 @@
<h3 id="test">1. アプリケーションを実際のデバイスで徹底的にテストする</h3>
-<p>アプリケーションをできる限り広範に徹底的にテストすることが重要です。この作業を支援するため、Android では多数のテスト用クラスとツールを用意しています。{@link android.app.Instrumentation Instrumentation} を使用して JUnit およびその他のテスト ケースを実行できます。また、<a href="{@docRoot}guide/developing/tools/monkey.html">UI/Application Exerciser Monkey</a> などのテスティング ツールを使用できます。 </p>
+<p>アプリケーションをできる限り広範に徹底的にテストすることが重要です。この作業を支援するため、Android では多数のテスト用クラスとツールを用意しています。{@link android.app.Instrumentation Instrumentation} を使用して JUnit およびその他のテスト ケースを実行できます。また、<a href="{@docRoot}tools/help/monkey.html">UI/Application Exerciser Monkey</a> などのテスティング ツールを使用できます。 </p>
<ul>
<li>ユーザーがアプリケーションを正常に実行できるようにするため、アプリケーションが実行されると予想されるタイプの携帯端末の実機を入手してください。実際のデバイスで、実際のネットワーク条件の下でアプリケーションをテストします。アプリケーションを実際のデバイスでテストすることは非常に重要です。これによって、作成したユーザー インターフェース要素のサイズが正しく(特にタッチスクリーン UI の場合)、アプリケーションのパフォーマンスと電池効率が適正であることを確認できるからです。</li>
@@ -96,13 +96,13 @@
<p>これまでにリリースしたバージョンがある場合、最新のアプリケーションのバージョン番号を旧バージョンから増加させる必要があります。アプリケーションのマニフェスト ファイルの <code><manifest></code> 要素の <code>android:versionCode</code> と <code>android:versionName</code> 属性の両方を適切な値を使用して増加する必要があります。 </p>
-<p>アプリケーションのバージョン情報を定義する方法は、<a href="{@docRoot}guide/publishing/versioning.html">Versioning Your Applications</a>をご覧ください。</p>
+<p>アプリケーションのバージョン情報を定義する方法は、<a href="{@docRoot}tools/publishing/versioning.html">Versioning Your Applications</a>をご覧ください。</p>
<h3 id="cryptokey">6. 適切な暗号化キーを取得する</h3>
<p>ここまで準備作業をすべて読んで実行していれば、アプリケーションはコンパイルされ、署名の準備ができています。.apk の内部では、アプリケーションは適切にバージョン管理されており、上記のように余分なファイルや非公開データは削除されています。 </p>
-<p>アプリケーションに署名する前に、適切な非公開キーがあることを確認する必要があります。非公開キーを取得(または生成)する方法については、<a href="{@docRoot}guide/publishing/app-signing.html#cert">適切な非公開キーの取得</a>をご覧ください。</p>
+<p>アプリケーションに署名する前に、適切な非公開キーがあることを確認する必要があります。非公開キーを取得(または生成)する方法については、<a href="{@docRoot}tools/publishing/app-signing.html#cert">適切な非公開キーの取得</a>をご覧ください。</p>
<p>適切な非公開キーを取得(または生成)したら、キーを使用して次の手順を実行します:</p>
@@ -136,7 +136,7 @@
</ol>
<p>署名と非公開キーについては、<a
-href="{@docRoot}guide/publishing/app-signing.html">アプリケーションへの署名</a>をご覧ください。</p>
+href="{@docRoot}tools/publishing/app-signing.html">アプリケーションへの署名</a>をご覧ください。</p>
<h2 id="compile">アプリケーションのコンパイル</h2>
@@ -147,7 +147,7 @@
<h3 id="signapp">8. アプリケーションに署名する</h3>
-<p>非公開キーを使用してアプリケーションに署名します。アプリケーションに正しく署名することは、非常に重要です。詳細は、<a href="{@docRoot}guide/publishing/app-signing.html">アプリケーションへの署名</a>をご覧ください。 </p>
+<p>非公開キーを使用してアプリケーションに署名します。アプリケーションに正しく署名することは、非常に重要です。詳細は、<a href="{@docRoot}tools/publishing/app-signing.html">アプリケーションへの署名</a>をご覧ください。 </p>
<h3 id="testapp">9. コンパイルして署名したアプリケーションのテスト</h3>
diff --git a/docs/html/intl/ja/guide/publishing/versioning.jd b/docs/html/intl/ja/guide/publishing/versioning.jd
index bf86016..1928610 100644
--- a/docs/html/intl/ja/guide/publishing/versioning.jd
+++ b/docs/html/intl/ja/guide/publishing/versioning.jd
@@ -24,8 +24,8 @@
<h2>関連項目</h2>
<ol>
-<li><a href="{@docRoot}guide/publishing/preparing.html">公開の準備</a></li>
-<li><a href="{@docRoot}guide/publishing/publishing.html#market">Android マーケットでの公開</a></li>
+<li><a href="{@docRoot}tools/publishing/preparing.html">公開の準備</a></li>
+<li><a href="{@docRoot}tools/publishing/publishing.html#market">Android マーケットでの公開</a></li>
<li><a href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a></li>
</ol>
@@ -97,4 +97,4 @@
<p>アプリケーションに最小プラットフォーム バージョンを指定するには、<code><uses-sdk></code> 要素を <code><manifest></code> の子として追加し、<code>android:minSdkVersion</code> を属性として定義します。 </p>
-<p>詳細は、<a href="{@docRoot}sdk/android-1.1.html">Android System Image 1.1 Version Notes</a> もご覧ください。</p>
+<p>詳細は、<a href="{@docRoot}about/versions/android-1.1.html">Android System Image 1.1 Version Notes</a> もご覧ください。</p>
diff --git a/docs/html/intl/ja/guide/topics/fundamentals.jd b/docs/html/intl/ja/guide/topics/fundamentals.jd
index d329a8c..025cf53 100644
--- a/docs/html/intl/ja/guide/topics/fundamentals.jd
+++ b/docs/html/intl/ja/guide/topics/fundamentals.jd
@@ -47,7 +47,7 @@
</div>
<p>
-Android アプリケーションはすべて Java プログラミング言語で記述します。コンパイル済みの Java コード(およびそのアプリケーションに必要なすべてのデータやリソース ファイル)は、<a href="{@docRoot}guide/developing/tools/aapt.html"><code>aapt</code> ツール</a>を使用して Android パッケージにバンドルします。Android パッケージは、拡張子が {@code .apk} のアーカイブ ファイルです。<i></i>ユーザーは、このファイルをデバイスにダウンロードして利用します。つまり、Android パッケージは、アプリケーションをモバイル デバイスに配布およびインストールするための媒体として機能します。1 つの {@code .apk} ファイルに含まれているすべてのコードが、1 つのアプリケーションと見なされます。<i></i>
+Android アプリケーションはすべて Java プログラミング言語で記述します。コンパイル済みの Java コード(およびそのアプリケーションに必要なすべてのデータやリソース ファイル)は、<a href="{@docRoot}tools/aapt.html"><code>aapt</code> ツール</a>を使用して Android パッケージにバンドルします。Android パッケージは、拡張子が {@code .apk} のアーカイブ ファイルです。<i></i>ユーザーは、このファイルをデバイスにダウンロードして利用します。つまり、Android パッケージは、アプリケーションをモバイル デバイスに配布およびインストールするための媒体として機能します。1 つの {@code .apk} ファイルに含まれているすべてのコードが、1 つのアプリケーションと見なされます。<i></i>
</p>
<p>
@@ -185,7 +185,7 @@
</ul>
<p>
-インテント メッセージについて詳しくは、<a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a> をご覧ください。
+インテント メッセージについて詳しくは、<a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a> をご覧ください。
</p>
@@ -293,7 +293,7 @@
</p>
<p>
-インテント フィルタについて詳しくは、<a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a> をご覧ください。
+インテント フィルタについて詳しくは、<a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a> をご覧ください。
</p>
@@ -526,7 +526,7 @@
</p>
<p>
-このメカニズムを簡単に説明すると次のようになります。まず、シンプルなインターフェース定義言語(IDL)を使用して、実装したい RPC インターフェースを宣言します。<code><a href="{@docRoot}guide/developing/tools/aidl.html">aidl</a></code> ツールにより、RPC インターフェースの宣言から Java インターフェース定義が生成されます。この定義は、ローカルとリモートの両方のプロセスで使用する必要があります。定義には、次の図に示すように 2 つの内部クラスが含まれています:
+このメカニズムを簡単に説明すると次のようになります。まず、シンプルなインターフェース定義言語(IDL)を使用して、実装したい RPC インターフェースを宣言します。<code><a href="{@docRoot}tools/aidl.html">aidl</a></code> ツールにより、RPC インターフェースの宣言から Java インターフェース定義が生成されます。この定義は、ローカルとリモートの両方のプロセスで使用する必要があります。定義には、次の図に示すように 2 つの内部クラスが含まれています:
</p>
<p style="margin-left: 2em">
@@ -560,7 +560,7 @@
</ul>
<p>
-ここでは、説明を簡単にするため、RPC メカニズムの細かい点は省略しています。詳しくは、<a href="{@docRoot}guide/developing/tools/aidl.html">Designing a Remote Interface Using AIDL</a>、および {@link android.os.IBinder IBinder} クラスの説明をご覧ください。
+ここでは、説明を簡単にするため、RPC メカニズムの細かい点は省略しています。詳しくは、<a href="{@docRoot}tools/aidl.html">Designing a Remote Interface Using AIDL</a>、および {@link android.os.IBinder IBinder} クラスの説明をご覧ください。
</p>
diff --git a/docs/html/intl/ja/guide/tutorials/hello-world.jd b/docs/html/intl/ja/guide/tutorials/hello-world.jd
index 647c828..c69f5da 100644
--- a/docs/html/intl/ja/guide/tutorials/hello-world.jd
+++ b/docs/html/intl/ja/guide/tutorials/hello-world.jd
@@ -20,13 +20,13 @@
<p>Eclipse を使用していない場合でも問題ありません。<a href="{@docRoot}guide/developing/other-ide.html">Developing in Other IDEs</a>に慣れてから、このチュートリアルに戻り、Eclipse に関する部分以外を参考にしてください。</p>
-<p>開始する前に、最新の SDK がインストールされている必要があります。また、Eclipse を使用する場合には、ADT プラグインもインストールされている必要があります。これらのプログラムがインストールされていない場合は、「<a href="{@docRoot}sdk/installing.html">Installing the Android SDK</a>」を参考にインストールを実行して、完了後にこのチュートリアルに戻ってください。</p>
+<p>開始する前に、最新の SDK がインストールされている必要があります。また、Eclipse を使用する場合には、ADT プラグインもインストールされている必要があります。これらのプログラムがインストールされていない場合は、「<a href="{@docRoot}sdk/installing/index.html">Installing the Android SDK</a>」を参考にインストールを実行して、完了後にこのチュートリアルに戻ってください。</p>
<h2 id="avd">AVD の作成</h2>
<div class="sidebox-wrapper">
<div class="sidebox">
- <p>AVD の使用方法と使用可能なオプションについて詳しくは、<a href="{@docRoot}guide/developing/tools/avd.html">Android 仮想デバイス</a> のドキュメントを参照してください。</p>
+ <p>AVD の使用方法と使用可能なオプションについて詳しくは、<a href="{@docRoot}tools/avd.html">Android 仮想デバイス</a> のドキュメントを参照してください。</p>
</div>
</div>
@@ -288,7 +288,7 @@
<p class="note"><strong>ヒント:</strong> ショートカット キー<strong>Ctrl+F11</strong>(Mac では <strong>コマンド+Shift+F11</strong>)を使用して、現在表示されているアプリケーションを実行することができます。</p>
-<p>ここからは、デバッグの基礎知識と、他の総合開発環境に関する補足情報について説明します。さらに詳しく学習したい場合は、「<a href="{@docRoot}guide/topics/fundamentals.html">アプリケーションの基礎</a>」を参照してください。Android アプリケーションが動作するためのすべての要素について説明しています。また、「<a href="{@docRoot}guide/index.html">デベロッパー ガイド</a>」の導入ページを参照して、<em>デベロッパー ガイド</em> ドキュメントの概要を確認してください。</p>
+<p>ここからは、デバッグの基礎知識と、他の総合開発環境に関する補足情報について説明します。さらに詳しく学習したい場合は、「<a href="{@docRoot}guide/components/fundamentals.html">アプリケーションの基礎</a>」を参照してください。Android アプリケーションが動作するためのすべての要素について説明しています。また、「<a href="{@docRoot}guide/index.html">デベロッパー ガイド</a>」の導入ページを参照して、<em>デベロッパー ガイド</em> ドキュメントの概要を確認してください。</p>
<div class="special">
@@ -357,7 +357,7 @@
<p>Eclipse を使用していない場合(普段から使用している総合開発環境がある場合や、シンプルにテキスト エディタやコマンド ライン ツールを使用している場合など)は、Eclipse プラグインを利用することはできません。しかし心配は無用です。Eclipse を使用していないからといって何らかの機能が失われることはありません。</p>
- <p>Android Plugin for Eclipse は、単に Android SDK に含まれるツール セットをまとめたものに過ぎません(エミュレータ、aapt、adb、ddms などの個別のツールについては、<a href="{@docRoot}guide/developing/tools/index.html">こちらで別途説明</a>しています)。このため、これらのツールを別のツール、たとえば「Ant」のビルド ファイルなどでまとめることも可能です。</p>
+ <p>Android Plugin for Eclipse は、単に Android SDK に含まれるツール セットをまとめたものに過ぎません(エミュレータ、aapt、adb、ddms などの個別のツールについては、<a href="{@docRoot}tools/index.html">こちらで別途説明</a>しています)。このため、これらのツールを別のツール、たとえば「Ant」のビルド ファイルなどでまとめることも可能です。</p>
<p>Android SDK には、「android」という名前のツールが含まれています。このツールを使用すると、作成するプロジェクトのソース コードとディレクトリ スタブすべて、および Ant と互換性のある <code>build.xml</code> ファイルを作成することができます。これにより、プロジェクトをコマンド ラインで作成したり、普段使用している総合開発環境と統合したりすることができます。</p>
diff --git a/docs/html/intl/ja/index.jd b/docs/html/intl/ja/index.jd
index fbbd88f..ac36f90 100644
--- a/docs/html/intl/ja/index.jd
+++ b/docs/html/intl/ja/index.jd
@@ -148,7 +148,7 @@
'name':"Dev Phone 1",
'img':"devphone-large.png",
'title':"Android Dev Phone 1",
- 'desc': "<p>この携帯電話を使用することで、開発した Android アプリケーションの実行とデバッグを行うことができます。Android オペレーティングシステムを変更してからリビルドし、携帯電話に書き込むことができます。Android Dev Phone 1 は携帯通信会社に依存しておらず、<a href='http://play.google.com/apps/publish'>Android マーケット</a>に登録済みのデベロッパーなら誰でも購入可能です。</p><p><a href='/guide/developing/device.html#dev-phone-1'>Android Dev Phone 1 の詳細»</a></p>"
+ 'desc': "<p>この携帯電話を使用することで、開発した Android アプリケーションの実行とデバッグを行うことができます。Android オペレーティングシステムを変更してからリビルドし、携帯電話に書き込むことができます。Android Dev Phone 1 は携帯通信会社に依存しておらず、<a href='http://play.google.com/apps/publish'>Android マーケット</a>に登録済みのデベロッパーなら誰でも購入可能です。</p><p><a href='/tools/device.html#dev-phone-1'>Android Dev Phone 1 の詳細»</a></p>"
}
}
diff --git a/docs/html/intl/ja/resources/tutorials/hello-world.jd b/docs/html/intl/ja/resources/tutorials/hello-world.jd
index 0cda2fb..e0ef9e6 100644
--- a/docs/html/intl/ja/resources/tutorials/hello-world.jd
+++ b/docs/html/intl/ja/resources/tutorials/hello-world.jd
@@ -20,13 +20,13 @@
<p>Eclipse を使用していない場合でも問題ありません。<a href="{@docRoot}guide/developing/other-ide.html">Developing in Other IDEs</a>に慣れてから、このチュートリアルに戻り、Eclipse に関する部分以外を参考にしてください。</p>
-<p>開始する前に、最新の SDK がインストールされている必要があります。また、Eclipse を使用する場合には、ADT プラグインもインストールされている必要があります。これらのプログラムがインストールされていない場合は、「<a href="{@docRoot}sdk/installing.html">Installing the Android SDK</a>」を参考にインストールを実行して、完了後にこのチュートリアルに戻ってください。</p>
+<p>開始する前に、最新の SDK がインストールされている必要があります。また、Eclipse を使用する場合には、ADT プラグインもインストールされている必要があります。これらのプログラムがインストールされていない場合は、「<a href="{@docRoot}sdk/installing/index.html">Installing the Android SDK</a>」を参考にインストールを実行して、完了後にこのチュートリアルに戻ってください。</p>
<h2 id="avd">AVD の作成</h2>
<div class="sidebox-wrapper">
<div class="sidebox">
- <p>AVD の使用方法と使用可能なオプションについて詳しくは、<a href="{@docRoot}guide/developing/tools/avd.html">Android 仮想デバイス</a> のドキュメントを参照してください。</p>
+ <p>AVD の使用方法と使用可能なオプションについて詳しくは、<a href="{@docRoot}tools/avd.html">Android 仮想デバイス</a> のドキュメントを参照してください。</p>
</div>
</div>
@@ -289,7 +289,7 @@
<p class="note"><strong>ヒント:</strong> ショートカット キー<strong>Ctrl+F11</strong>(Mac では <strong>コマンド+Shift+F11</strong>)を使用して、現在表示されているアプリケーションを実行することができます。</p>
-<p>ここからは、デバッグの基礎知識と、他の総合開発環境に関する補足情報について説明します。さらに詳しく学習したい場合は、「<a href="{@docRoot}guide/topics/fundamentals.html">アプリケーションの基礎</a>」を参照してください。Android アプリケーションが動作するためのすべての要素について説明しています。また、「<a href="{@docRoot}guide/index.html">デベロッパー ガイド</a>」の導入ページを参照して、<em>デベロッパー ガイド</em> ドキュメントの概要を確認してください。</p>
+<p>ここからは、デバッグの基礎知識と、他の総合開発環境に関する補足情報について説明します。さらに詳しく学習したい場合は、「<a href="{@docRoot}guide/components/fundamentals.html">アプリケーションの基礎</a>」を参照してください。Android アプリケーションが動作するためのすべての要素について説明しています。また、「<a href="{@docRoot}guide/index.html">デベロッパー ガイド</a>」の導入ページを参照して、<em>デベロッパー ガイド</em> ドキュメントの概要を確認してください。</p>
<div class="special">
@@ -358,7 +358,7 @@
<p>Eclipse を使用していない場合(普段から使用している総合開発環境がある場合や、シンプルにテキスト エディタやコマンド ライン ツールを使用している場合など)は、Eclipse プラグインを利用することはできません。しかし心配は無用です。Eclipse を使用していないからといって何らかの機能が失われることはありません。</p>
- <p>Android Plugin for Eclipse は、単に Android SDK に含まれるツール セットをまとめたものに過ぎません(エミュレータ、aapt、adb、ddms などの個別のツールについては、<a href="{@docRoot}guide/developing/tools/index.html">こちらで別途説明</a>しています)。このため、これらのツールを別のツール、たとえば「Ant」のビルド ファイルなどでまとめることも可能です。</p>
+ <p>Android Plugin for Eclipse は、単に Android SDK に含まれるツール セットをまとめたものに過ぎません(エミュレータ、aapt、adb、ddms などの個別のツールについては、<a href="{@docRoot}tools/index.html">こちらで別途説明</a>しています)。このため、これらのツールを別のツール、たとえば「Ant」のビルド ファイルなどでまとめることも可能です。</p>
<p>Android SDK には、「android」という名前のツールが含まれています。このツールを使用すると、作成するプロジェクトのソース コードとディレクトリ スタブすべて、および Ant と互換性のある <code>build.xml</code> ファイルを作成することができます。これにより、プロジェクトをコマンド ラインで作成したり、普段使用している総合開発環境と統合したりすることができます。</p>
diff --git a/docs/html/intl/ja/sdk/1.5_r2/installing.jd b/docs/html/intl/ja/sdk/1.5_r2/installing.jd
index 789fc26..bd464c6 100644
--- a/docs/html/intl/ja/sdk/1.5_r2/installing.jd
+++ b/docs/html/intl/ja/sdk/1.5_r2/installing.jd
@@ -29,7 +29,7 @@
<p>システム上に展開した SDK ディレクトリの名前とパスをメモしておきましょう。Android プラグインの設定時や、SDK ツールの使用時にこの SDK ディレクトリを参照する必要があります。</p>
-<p>SDK のプライマリディレクトリである <code>tools</code> のパスを、システム PATH に追加することをおすすめします。<code>tools/</code> プライマリディレクトリは、SDK フォルダのルートにあります。<code>tools</code> をパスに追加すると、Android Debug Bridge(adb)やその他のコマンド ライン <a href="{@docRoot}guide/developing/tools/index.html">ツール</a>を、ツールの格納されたディレクトの完全なパスを指定せずに実行できるようになります。 </p>
+<p>SDK のプライマリディレクトリである <code>tools</code> のパスを、システム PATH に追加することをおすすめします。<code>tools/</code> プライマリディレクトリは、SDK フォルダのルートにあります。<code>tools</code> をパスに追加すると、Android Debug Bridge(adb)やその他のコマンド ライン <a href="{@docRoot}tools/index.html">ツール</a>を、ツールの格納されたディレクトの完全なパスを指定せずに実行できるようになります。 </p>
<ul>
<li>Linux 上では <code>~/.bash_profile</code> ファイルまたは <code>~/.bashrc</code> ファイルを編集します。PATH 環境変数を設定している行を探し、その行に <code>tools/</code> ディレクトリへの完全なパスを追加します。PATH を設定する行が無い場合は、次の行を追加します:</li>
@@ -150,7 +150,7 @@
<li><a href="{@docRoot}guide/index.html">デベロッパー ガイド</a>と、ガイドに説明されている情報の種類を参照します。</li>
<li>Android をプラットフォームとして紹介している <a
href="{@docRoot}guide/basics/what-is-android.html">Android とは</a>を読みます。</li>
- <li><a href="{@docRoot}guide/topics/fundamentals.html">アプリケーションの基礎</a>を参照して、Android フレームワークとそこでのアプリケーションの実行方法について学びます。</li>
+ <li><a href="{@docRoot}guide/components/fundamentals.html">アプリケーションの基礎</a>を参照して、Android フレームワークとそこでのアプリケーションの実行方法について学びます。</li>
<li>[<a
href="{@docRoot}reference/packages.html">リファレンス</a>] タブの Android Framework API の仕様を参照します。</li>
</ul>
@@ -158,7 +158,7 @@
<p><strong>SDK の探索</strong></p>
<ul>
<li>利用可能な<a
- href="{@docRoot}guide/developing/tools/index.html">開発ツール</a>の概要を把握します。</li>
+ href="{@docRoot}tools/index.html">開発ツール</a>の概要を把握します。</li>
<li><a
href="{@docRoot}guide/developing/eclipse-adt.html">Eclipse/ADT</a> または<a href="{@docRoot}guide/developing/other-ide.html">別の IDE</a> での開発方法を参照します。
</li>
@@ -166,7 +166,7 @@
<p><strong>サンプル コードの参照</strong></p>
<ul>
- <li><a href="{@docRoot}resources/tutorials/hello-world.html">Hello World アプリケーション</a>を構築します(特に Eclipse ユーザーにおすすめです)。</li>
+ <li><a href="{@docRoot}training/basics/firstapp/index.html">Hello World アプリケーション</a>を構築します(特に Eclipse ユーザーにおすすめです)。</li>
<li><a href="{@docRoot}resources/tutorials/notepad/index.html">Notepad チュートリアル</a>に沿って Android アプリケーションを完全に構築します。 </li>
<li><code><em><sdk></em>/platforms/<em><platfrom></em>/samples</code> に収められている他のサンプル アプリケーションのいずれかを新しいプロジェクトとして作成し、自分の開発環境でコンパイルし、実行します。</li>
</ul>
diff --git a/docs/html/intl/ja/sdk/1.5_r3/installing.jd b/docs/html/intl/ja/sdk/1.5_r3/installing.jd
index 789fc26..bd464c6 100644
--- a/docs/html/intl/ja/sdk/1.5_r3/installing.jd
+++ b/docs/html/intl/ja/sdk/1.5_r3/installing.jd
@@ -29,7 +29,7 @@
<p>システム上に展開した SDK ディレクトリの名前とパスをメモしておきましょう。Android プラグインの設定時や、SDK ツールの使用時にこの SDK ディレクトリを参照する必要があります。</p>
-<p>SDK のプライマリディレクトリである <code>tools</code> のパスを、システム PATH に追加することをおすすめします。<code>tools/</code> プライマリディレクトリは、SDK フォルダのルートにあります。<code>tools</code> をパスに追加すると、Android Debug Bridge(adb)やその他のコマンド ライン <a href="{@docRoot}guide/developing/tools/index.html">ツール</a>を、ツールの格納されたディレクトの完全なパスを指定せずに実行できるようになります。 </p>
+<p>SDK のプライマリディレクトリである <code>tools</code> のパスを、システム PATH に追加することをおすすめします。<code>tools/</code> プライマリディレクトリは、SDK フォルダのルートにあります。<code>tools</code> をパスに追加すると、Android Debug Bridge(adb)やその他のコマンド ライン <a href="{@docRoot}tools/index.html">ツール</a>を、ツールの格納されたディレクトの完全なパスを指定せずに実行できるようになります。 </p>
<ul>
<li>Linux 上では <code>~/.bash_profile</code> ファイルまたは <code>~/.bashrc</code> ファイルを編集します。PATH 環境変数を設定している行を探し、その行に <code>tools/</code> ディレクトリへの完全なパスを追加します。PATH を設定する行が無い場合は、次の行を追加します:</li>
@@ -150,7 +150,7 @@
<li><a href="{@docRoot}guide/index.html">デベロッパー ガイド</a>と、ガイドに説明されている情報の種類を参照します。</li>
<li>Android をプラットフォームとして紹介している <a
href="{@docRoot}guide/basics/what-is-android.html">Android とは</a>を読みます。</li>
- <li><a href="{@docRoot}guide/topics/fundamentals.html">アプリケーションの基礎</a>を参照して、Android フレームワークとそこでのアプリケーションの実行方法について学びます。</li>
+ <li><a href="{@docRoot}guide/components/fundamentals.html">アプリケーションの基礎</a>を参照して、Android フレームワークとそこでのアプリケーションの実行方法について学びます。</li>
<li>[<a
href="{@docRoot}reference/packages.html">リファレンス</a>] タブの Android Framework API の仕様を参照します。</li>
</ul>
@@ -158,7 +158,7 @@
<p><strong>SDK の探索</strong></p>
<ul>
<li>利用可能な<a
- href="{@docRoot}guide/developing/tools/index.html">開発ツール</a>の概要を把握します。</li>
+ href="{@docRoot}tools/index.html">開発ツール</a>の概要を把握します。</li>
<li><a
href="{@docRoot}guide/developing/eclipse-adt.html">Eclipse/ADT</a> または<a href="{@docRoot}guide/developing/other-ide.html">別の IDE</a> での開発方法を参照します。
</li>
@@ -166,7 +166,7 @@
<p><strong>サンプル コードの参照</strong></p>
<ul>
- <li><a href="{@docRoot}resources/tutorials/hello-world.html">Hello World アプリケーション</a>を構築します(特に Eclipse ユーザーにおすすめです)。</li>
+ <li><a href="{@docRoot}training/basics/firstapp/index.html">Hello World アプリケーション</a>を構築します(特に Eclipse ユーザーにおすすめです)。</li>
<li><a href="{@docRoot}resources/tutorials/notepad/index.html">Notepad チュートリアル</a>に沿って Android アプリケーションを完全に構築します。 </li>
<li><code><em><sdk></em>/platforms/<em><platfrom></em>/samples</code> に収められている他のサンプル アプリケーションのいずれかを新しいプロジェクトとして作成し、自分の開発環境でコンパイルし、実行します。</li>
</ul>
diff --git a/docs/html/intl/ja/training/monitoring-device-state/battery-monitoring.jd b/docs/html/intl/ja/training/monitoring-device-state/battery-monitoring.jd
new file mode 100644
index 0000000..c4aafe4
--- /dev/null
+++ b/docs/html/intl/ja/training/monitoring-device-state/battery-monitoring.jd
@@ -0,0 +1,120 @@
+page.title=電池残量と充電状態の監視
+parent.title=電池消費量の最適化
+parent.link=index.html
+
+trainingnavtop=true
+next.title=ホルダーの装着状態とタイプの特定と監視
+next.link=docking-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>このレッスンの内容</h2>
+<ol>
+ <li><a href="#DetermineChargeState">現在の充電状態を特定する</a></li>
+ <li><a href="#MonitorChargeState">充電状態の変化を監視する</a></li>
+ <li><a href="#CurrentLevel">現在の電池残量を特定する</a></li>
+ <li><a href="#MonitorLevel">電池残量の大きな変化を監視する</a></li>
+</ol>
+
+<h2>関連項目</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">インテントとインテント フィルタ</a>
+</ul>
+
+</div>
+</div>
+
+<p>バックグラウンド更新が電池消費量に及ぼす影響を抑えるために更新の頻度を変更するには、初めに現在の電池残量と充電状態を調べることをおすすめします。</p>
+
+<p>アプリの更新が電池消費量に及ぼす影響の度合いは、端末の電池残量と充電状態によって異なります。AC 電源から端末を充電しているときは、更新の実行による影響はごくわずかなので、ほとんどの場合は、端末が AC 電源に接続されている限り、更新頻度を最大にして差し支えありません。逆に、端末が電池で駆動しているときは、更新頻度を下げると電池消費量を抑えることができます。</p>
+
+<p>同様に、電池残量を調べると、残量がごくわずかであるときに更新頻度を下げたり、場合によっては停止させたりすることができます。</p>
+
+
+<h2 id="DetermineChargeState">現在の充電状態を特定する</h2>
+
+<p>初めに、現在の充電状態を特定します。{@link android.os.BatteryManager} によって電池と充電状態に関するすべての詳細情報が sticky {@link android.content.Intent} としてブロードキャストされますが、この中に充電状態が格納されています。</p>
+
+<p>これは sticky インテントであるため、{@link android.content.BroadcastReceiver} を登録する必要はありません。{@code registerReceiver} を呼び出し、{@code null} をレシーバとして渡すだけで(次のコード例を参照)、現在の電池状態のインテントが返されます。ここで実際の {@link android.content.BroadcastReceiver} オブジェクトを渡すこともできますが、このレッスンでは後で更新についての処理を行うので、これは必要ありません。</p>
+
+<pre>IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
+Intent batteryStatus = context.registerReceiver(null, ifilter);</pre>
+
+<p>現在の充電状態に加えて、充電中の場合は USB 経由か AC 充電器経由かを調べることもできます。<p>
+
+<pre>// Are we charging / charged?
+int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
+boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
+ status == BatteryManager.BATTERY_STATUS_FULL;
+
+// How are we charging?
+int chargePlug = battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+boolean usbCharge = chargePlug == BATTERY_PLUGGED_USB;
+boolean acCharge = chargePlug == BATTERY_PLUGGED_AC;</pre>
+
+<p>一般的には、端末が AC 充電器に接続されているときはバックグラウンド更新の頻度を最大にし、USB 経由で充電中のときは頻度を下げ、電池で駆動中のときはさらに頻度を下げます。</p>
+
+
+<h2 id="MonitorChargeState">充電状態の変化を監視する</h2>
+
+<p>充電状態は、端末が充電器に接続されたときにすぐに変化するので、充電状態の変化を監視し、その変化に応じて更新の頻度を変更することが重要です。</p>
+
+<p>{@link android.os.BatteryManager} は、端末が電源に接続されたときや接続が解除されたときに、アクションをブロードキャストします。このようなイベントは、アプリが実行中でないときでも受信することが重要です。特にそのイベントが、アプリのバックグラウンド更新を開始するためにアプリを起動させる頻度に影響するものである場合です。したがって、{@link android.content.BroadcastReceiver} をアプリのマニフェスト内で登録し、両方のイベントを受信するために {@link android.content.Intent#ACTION_POWER_CONNECTED} と {@link android.content.Intent#ACTION_POWER_DISCONNECTED} をインテント フィルタ内で定義します。</p>
+
+<pre><receiver android:name=".PowerConnectionReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
+ <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
+ </intent-filter>
+</receiver></pre>
+
+<p>関連付けられている {@link android.content.BroadcastReceiver} 実装の中で、前のステップで説明したように、現在の充電状態と充電方法を抽出します。</p>
+
+<pre>public class PowerConnectionReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
+ boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
+ status == BatteryManager.BATTERY_STATUS_FULL;
+
+ int chargePlug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+ boolean usbCharge = chargePlug == BATTERY_PLUGGED_USB;
+ boolean acCharge = chargePlug == BATTERY_PLUGGED_AC;
+ }
+}</pre>
+
+
+<h2 id="CurrentLevel">現在の電池残量を特定する</h2>
+
+<p>状況によっては、現在の電池残量がわかると便利なことがあります。たとえば、電池残量が所定のレベルを下回った場合にアプリのバックグラウンド更新の頻度を下げることができます。</p>
+
+<p>現在の電池残量を調べるには、次に示すように、電池状態のインテントから現在の電池残量と最大量を抽出します。</p>
+
+<pre>int level = battery.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
+int scale = battery.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
+
+float batteryPct = level / (float)scale;</pre>
+
+
+<h2 id="MonitorLevel">電池残量の大きな変化を監視する</h2>
+
+<p>電池状態を継続的に監視することは簡単ではありませんが、その必要もありません。</p>
+
+<p>一般的に、電池残量を継続的に監視するほうが、電池への影響はアプリの通常の動作によるものよりも大きくなるため、電池残量の大きな変化のみを監視することをおすすめします。特に、端末が電池残量低下状態に入ったときや、その状態が解消されたときです。</p>
+
+<p>次に示すマニフェストの断片は、ブロードキャスト レシーバの中にあるインテント フィルタ要素からの抜粋です。このレシーバは、端末が電池残量低下状態に入ったときや、その状態が解消されたときに呼び出されます。そのために、{@link android.content.Intent#ACTION_BATTERY_LOW} と {@link android.content.Intent#ACTION_BATTERY_OKAY} を受信します。</p>
+
+<pre><receiver android:name=".BatteryLevelReceiver">
+<intent-filter>
+ <action android:name="android.intent.action.ACTION_BATTERY_LOW"/>
+ <action android:name="android.intent.action.ACTION_BATTERY_OKAY"/>
+ </intent-filter>
+</receiver></pre>
+
+<p>一般的に、電池残量がごくわずかになったときはアプリのバックグラウンド更新をすべて停止することをおすすめします。データがいくら新しくても、端末自体の電源が切れてしまったのではデータを活用できません。</p>
+
+<p>多くの場合、端末の充電という動作が開始するのは、端末がホルダーにセットされるのと同時です。次のレッスンでは、現在のホルダーの状態を特定し、端末のホルダー装着状態の変化を監視する方法を紹介します。</p>
+
diff --git a/docs/html/intl/ja/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html/intl/ja/training/monitoring-device-state/connectivity-monitoring.jd
new file mode 100644
index 0000000..82b0c6b
--- /dev/null
+++ b/docs/html/intl/ja/training/monitoring-device-state/connectivity-monitoring.jd
@@ -0,0 +1,70 @@
+page.title=接続状態の特定と監視
+parent.title=電池消費量の最適化
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=ホルダーの装着状態とタイプの特定と監視
+previous.link=docking-monitoring.html
+next.title=オンデマンドでのブロードキャスト レシーバ操作
+next.link=manifest-receivers.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>このレッスンの内容</h2>
+<ol>
+ <li><a href="#DetermineConnection">インターネット接続の有無を特定する</a></li>
+ <li><a href="#DetermineType">インターネット接続のタイプを特定する</a></li>
+ <li><a href="#MonitorChanges">接続状態の変化を監視する</a></li>
+</ol>
+
+
+<h2>関連項目</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">インテントとインテント フィルタ</a>
+</ul>
+
+</div>
+</div>
+
+<p>反復アラームとバックグラウンド サービスの用途のうち代表的なものとしては、インターネット リソースからアプリのデータを定期的に更新するためのスケジュール設定や、データのキャッシュへの格納、長時間に及ぶダウンロードの実行などがあります。しかし、インターネットに接続されていないときや、速度が低すぎるためにダウンロードを完了できない場合にまで、更新をスケジューリングするために端末をスリープ状態から復帰させる必要があるでしょうか。</p>
+
+<p>{@link android.net.ConnectivityManager} を使用すると、端末が実際にインターネットに接続されているかどうかと、接続されている場合の接続タイプを調べることができます。</p>
+
+
+<h2 id="DetermineConnection">インターネット接続の有無を特定する</h2>
+
+<p>端末がインターネットに接続されていない場合は、インターネット リソースに基づく更新をスケジューリングする必要性はありません。次のスニペットは、{@link android.net.ConnectivityManager} を使用してアクティブなネットワークを問い合わせて、インターネットに接続しているかどうかを特定する方法を示すものです。</p>
+
+<pre>ConnectivityManager cm =
+ (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
+
+NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
+boolean isConnected = activeNetwork.isConnectedOrConnecting();</pre>
+
+
+<h2 id="DetermineType">インターネット接続のタイプを特定する</h2>
+
+<p>現在使用可能なインターネット接続のタイプも調べることができます。</p>
+
+<p>端末の接続のタイプとしては、モバイル データ、WiMAX、Wi-Fi、イーサネットがあります。次に示すように、アクティブなネットワークのタイプを問い合わせると、使用可能な帯域幅に合わせて更新頻度を変更することができます。</p>
+
+<pre>boolean isWiFi = activeNetwork.getType() == ConnectivityManager.TYPE_WIFI;</pre>
+
+<p>モバイル データ接続のコストは Wi-Fi 接続を大きく上回る傾向があるため、端末がモバイル接続しているときはアプリの更新頻度を下げるのが一般的です。同様に、大量のデータをダウンロードするときは、Wi-Fi 接続されるまで停止するとよいでしょう。</p>
+
+<p>更新を停止した場合は、接続状態の変化を受信することが重要です。インターネット接続が確立されたら更新を再開できるようにするためです。</p>
+
+
+<h2 id="MonitorChanges">接続状態の変化を監視する</h2>
+
+<p>接続状態の詳細が変化すると、{@link android.net.ConnectivityManager} によって {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION}({@code "android.net.conn.CONNECTIVITY_CHANGE"})アクションがブロードキャストされます。アプリのマニフェスト内でブロードキャスト レシーバを登録し、このような変化を検出することで、それに応じてアプリのバックグラウンド更新を再開(または停止)することができます。</p>
+
+<pre><action android:name="android.net.conn.CONNECTIVITY_CHANGE"/></pre>
+
+<p>端末の接続状態の変化は、きわめて頻繁になることもあります。このブロードキャストは、モバイル データ接続と Wi-Fi 接続とが切り替わるたびに発行されるからです。したがって、このブロードキャストの監視は、更新やダウンロードを停止した後に再開すべきかどうかを判断するために限って行うことをおすすめします。一般的には、更新を開始する前にインターネット接続の有無を調べれば十分です。インターネットに接続していない場合は、再び接続されるまでの間、更新を停止します。</p>
+
+<p>このようにするには、マニフェスト内で宣言したブロードキャスト レシーバのオンとオフを切り替える必要があります。これについて、次のレッスンで説明します。</p>
diff --git a/docs/html/intl/ja/training/monitoring-device-state/docking-monitoring.jd b/docs/html/intl/ja/training/monitoring-device-state/docking-monitoring.jd
new file mode 100644
index 0000000..9c0e054
--- /dev/null
+++ b/docs/html/intl/ja/training/monitoring-device-state/docking-monitoring.jd
@@ -0,0 +1,74 @@
+page.title=ホルダーの装着状態とタイプの特定と監視
+parent.title=電池消費量の最適化
+parent.link=index.html
+
+trainingnavtop=true
+previous.title= 電池残量と充電状態の監視
+previous.link=battery-monitoring.html
+next.title= 接続状態の特定と監視
+next.link=connectivity-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>このレッスンの内容</h2>
+<ol>
+ <li><a href="#CurrentDockState">オーディオ フォーカスをリクエストする</a></li>
+ <li><a href="#DockType">現在のホルダーのタイプを特定する</a></li>
+ <li><a href="#MonitorDockState">ホルダーの装着状態またはタイプの変化を監視する</a></li>
+</ol>
+
+
+<h2>関連項目</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">インテントとインテント フィルタ</a>
+</ul>
+
+</div>
+</div>
+
+<p>Android 搭載端末を装着できるホルダーの種類には、さまざまなものがあります。たとえば、車載用や家庭用のホルダーがあり、デジタルかアナログかという区別もあります。ホルダー装着状態は一般的に、充電状態と密接にリンクしています。多くのホルダーは、装着されている端末に電力を供給しているからです。</p>
+
+<p>端末のホルダー装着状態が更新の頻度にどのように影響するかは、アプリによって異なります。たとえば、スポーツ センター アプリなら、卓上ホルダー装着時には更新頻度を上げ、カー ホルダー装着時には更新を完全に停止するとよいでしょう。逆に、カー ホルダー装着時に更新頻度を最大にするケースとしては、バックグラウンド サービスによって道路交通状況を更新する場合が考えられます。</p>
+
+<p>ホルダー装着状態も sticky {@link android.content.Intent} としてブロードキャストされるので、端末がホルダーに装着されているかどうかと、装着されている場合のホルダーのタイプを問い合わせることができます。</p>
+
+
+<h2 id="CurrentDockState">現在のホルダー装着状態を特定する</h2>
+
+<p>ホルダー装着状態の詳細は、{@link android.content.Intent#ACTION_DOCK_EVENT} アクションの sticky ブロードキャストにエクストラとして含まれています。これは sticky であるため、{@link android.content.BroadcastReceiver} を登録する必要はありません。次のコード例に示すように、{@link android.content.Context#registerReceiver registerReceiver()} を呼び出し、{@code null} をブロードキャスト レシーバとして渡します。</p>
+
+<pre>IntentFilter ifilter = new IntentFilter(Intent.ACTION_DOCK_EVENT);
+Intent dockStatus = context.registerReceiver(null, ifilter);</pre>
+
+<p>現在のホルダー装着状態は、次のように {@code EXTRA_DOCK_STATE} エクストラから抽出します。<p>
+
+<pre>int dockState = battery.getIntExtra(EXTRA_DOCK_STATE, -1);
+boolean isDocked = dockState != Intent.EXTRA_DOCK_STATE_UNDOCKED;</pre>
+
+
+<h2 id="DockType">現在のホルダーのタイプを特定する</h2>
+
+<p>端末がホルダーに装着されている場合のホルダーのタイプは、次の 4 つのいずれかです。
+<ul><li>カー</li>
+<li>卓上</li>
+<li>ローエンド(アナログ)卓上</li>
+<li>ハイエンド(デジタル)卓上</li></ul></p>
+
+<p>最後の 2 つは、Android API レベル 11 で追加されたものです。したがって、ホルダーのタイプだけがわかればよく、デジタルとアナログの区別は問わないという場合は、次のように 3 つすべてについて調べるとよいでしょう。</p>
+
+<pre>boolean isCar = dockState == EXTRA_DOCK_STATE_CAR;
+boolean isDesk = dockState == EXTRA_DOCK_STATE_DESK ||
+ dockState == EXTRA_DOCK_STATE_LE_DESK ||
+ dockState == EXTRA_DOCK_STATE_HE_DESK;</pre>
+
+
+<h2 id="MonitorDockState">ホルダーの装着状態またはタイプの変化を監視する</h2>
+
+<p>端末がホルダーに装着されたり、装着が解除されたりするたびに、{@link android.content.Intent#ACTION_DOCK_EVENT} アクションがブロードキャストされます。端末のホルダー装着状態の変化を監視するには、次のコード例に示すように、アプリのマニフェスト内でブロードキャスト レシーバを登録します。</p>
+
+<pre><action android:name="android.intent.action.ACTION_DOCK_EVENT"/></pre>
+
+<p>レシーバ実装の中でホルダーのタイプと状態を抽出する方法は、前のステップで使用したものと同じです。</p>
diff --git a/docs/html/intl/ja/training/monitoring-device-state/index.jd b/docs/html/intl/ja/training/monitoring-device-state/index.jd
new file mode 100644
index 0000000..07897b1
--- /dev/null
+++ b/docs/html/intl/ja/training/monitoring-device-state/index.jd
@@ -0,0 +1,49 @@
+page.title=電池消費量の最適化
+
+trainingnavtop=true
+startpage=true
+next.title=電池残量と充電状態の監視
+next.link=battery-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>依存関係と前提条件</h2>
+<ul>
+ <li>Android 2.0(API レベル 5)以上</li>
+ <li>「<a href="{@docRoot}guide/components/intents-filters.html">インテントとインテント フィルタ</a>」を読み終えていること</li>
+</ul>
+
+<h2>関連項目</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/services.html">サービス</a>
+</ul>
+
+</div>
+</div>
+
+<p>アプリを開発するときは、ホスト端末の電池消費量への影響を抑えるよう心がける必要があります。このクラスを修了すると、開発するアプリの中でホスト端末の状態を監視し、それに基づいて機能や動作を変更することができるようになります。</p>
+
+<p>接続が失われたときはバックグラウンド サービスの更新を停止する、電池残量が低下したときは更新の頻度を下げるといった対策を講じることにより、ユーザー エクスペリエンスを損なうことなく、アプリが電池消費量に及ぼす影響を最小限に抑えることができます。</p>
+
+<h2>レッスン</h2>
+
+<!-- Create a list of the lessons in this class along with a short description of each lesson.
+These should be short and to the point. It should be clear from reading the summary whether someone
+will want to jump to a lesson or not.-->
+
+<dl>
+ <dt><b><a href="battery-monitoring.html">電池残量と充電状態の監視</a></b></dt>
+ <dd>アプリの更新頻度を変更するために現在の電池残量や充電状態の変化を特定および監視する方法を学習します。</dd>
+
+ <dt><b><a href="docking-monitoring.html">ホルダーの装着状態とタイプの特定と監視</a></b></dt>
+ <dd>最適な更新頻度は、ホスト端末がどのように使用されているかによって異なります。ホルダーの装着状態とタイプに応じてアプリの動作を変更するために、これらを特定および監視する方法を学習します。</dd>
+
+ <dt><b><a href="connectivity-monitoring.html">接続状態の特定と監視</a></b></dt>
+ <dd>インターネットに接続していないときは、オンライン ソースからアプリを更新することはできません。接続状態を調べ、それに応じてバックグラウンド更新の頻度を変更する方法を学習します。また、大量の帯域幅を消費する処理を開始する前に接続が Wi-Fi かモバイル データかを調べる方法も学習します。</dd>
+
+ <dt><b><a href="manifest-receivers.html">オンデマンドでのブロードキャスト レシーバ操作</a></b></dt>
+ <dd>マニフェスト内で宣言したブロードキャスト レシーバのオンとオフを実行時に切り替えます。端末の状態に応じて、不要なレシーバを無効にすることができます。効率を上げるために、状態変化レシーバのオンとオフを切り替える方法や、端末が特定の状態になるまでアクションを延期する方法を学習します。</dd>
+</dl>
\ No newline at end of file
diff --git a/docs/html/intl/ja/training/monitoring-device-state/manifest-receivers.jd b/docs/html/intl/ja/training/monitoring-device-state/manifest-receivers.jd
new file mode 100644
index 0000000..7635d9f
--- /dev/null
+++ b/docs/html/intl/ja/training/monitoring-device-state/manifest-receivers.jd
@@ -0,0 +1,50 @@
+page.title=オンデマンドでのブロードキャスト レシーバ操作
+parent.title=電池消費量の最適化
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=接続状態の特定と監視
+previous.link=connectivity-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>このレッスンの内容</h2>
+<ol>
+ <li><a href="#ToggleReceivers">効率を上げるために状態変化レシーバのオンとオフを切り替える</a></li>
+</ol>
+
+
+<h2>関連項目</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">インテントとインテント フィルタ</a>
+</ul>
+
+</div>
+</div>
+
+<p>端末の状態変化を監視する最も単純な方法は、監視対象とする状態ごとに {@link android.content.BroadcastReceiver} を作成し、それぞれをアプリのマニフェスト内で登録するというものです。これらの各レシーバ内で、端末の現在の状態に基づいて反復アラームのスケジュールを再設定します。</p>
+
+<p>この方法のデメリットは、これらのレシーバのいずれかがトリガされるたびに端末がスリープから復帰することですが、このことは必要以上に頻繁に発生する可能性があります。</p>
+
+<p>これよりも良い方法は、実行時にブロードキャスト レシーバをオンまたはオフにするというものです。このようにすれば、マニフェスト内で宣言したレシーバを受動的アラームとして使用できます。つまり、このアラームは、必要なときにだけシステム イベントによって呼び出されます。</p>
+
+
+<h2 id="ToggleReceivers">効率を上げるために状態変化レシーバのオンとオフを切り替える </h2>
+
+<p>{@link android.content.pm.PackageManager} を使用すると、マニフェスト内で定義されているコンポーネントの有効化状態を切り替えることができます。このコンポーネントにはブロードキャスト レシーバも該当するので、次に示すようにオンとオフを切り替えることができます。</p>
+
+<pre>ComponentName receiver = new ComponentName(context, myReceiver.class);
+
+PackageManager pm = context.getPackageManager();
+
+pm.setComponentEnabledSetting(receiver,
+ PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
+ PackageManager.DONT_KILL_APP)</pre>
+
+<p>この手法を使用すれば、接続が失われたことが判明した場合に、接続状態変化レシーバ以外のレシーバをすべて無効にすることができます。逆に、接続が確立された後は、接続状態変化の受信を停止します。オンラインかどうかを調べるのは、更新を実行する直前や、反復更新アラームのスケジュール再設定の直前だけで十分です。</p>
+
+<p>同じ手法を使用して、大量の帯域幅を必要とするダウンロードを延期することもできます。それには、接続状態の変化をリッスンするブロードキャスト レシーバを有効にしておき、端末が Wi-Fi に接続されたらダウンロードを開始します。</p>
diff --git a/docs/html/intl/ja/training/multiscreen/adaptui.jd b/docs/html/intl/ja/training/multiscreen/adaptui.jd
new file mode 100644
index 0000000..8b1e6ac
--- /dev/null
+++ b/docs/html/intl/ja/training/multiscreen/adaptui.jd
@@ -0,0 +1,212 @@
+page.title=順応性のある UI フローの実装
+parent.title=複数画面のデザイン
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=さまざまな画面密度のサポート
+previous.link=screendensities.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>このレッスンでの学習内容</h2>
+
+<ol>
+ <li><a href="#TaskDetermineCurLayout">現在のレイアウトを判別する</a></li>
+ <li><a href="#TaskReactToLayout">現在のレイアウトに合わせて応答する</a></li>
+ <li><a href="#TaskReuseFrag">他のアクティビティのフラグメントを再利用する</a></li>
+ <li><a href="#TaskHandleConfigChanges">画面設定の変更を処理する</a></li>
+</ol>
+
+<h2>関連ドキュメント</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">タブレットと携帯端末のサポート</a></li>
+</ul>
+
+<h2>試してみる</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">サンプル アプリのダウンロード</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+
+</div>
+</div>
+
+<p>アプリが現在表示しているレイアウトによって、UI フローが異なる可能性があります。たとえば、アプリがデュアルペイン モードであれば、左ペインのアイテムをクリックすると、単に右ペインにコンテンツが表示されるだけですが、シングルペイン モードであれば、コンテンツは(別のアクティビティ内の)コンテンツ専用のペインに表示される必要があります。</p>
+
+
+<h2 id="TaskDetermineCurLayout">現在のレイアウトを判別する</h2>
+
+<p>レイアウトによって実装が多少異なるので、まず、ユーザーが現在どのようなレイアウトを表示しているかを判別する必要があります。たとえば、ユーザーが表示しているレイアウトが「シングルペイン」モードなのか、「デュアルペイン」モードなのかを確認する必要があります。それは、以下のようなコードで、ある特定のビューが存在し、かつ可視になっているかを照会することで可能です:</p>
+
+<pre class="prettyprint">
+public class NewsReaderActivity extends FragmentActivity {
+ boolean mIsDualPane;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main_layout);
+
+ View articleView = findViewById(R.id.article);
+ mIsDualPane = articleView != null &&
+ articleView.getVisibility() == View.VISIBLE;
+ }
+}
+</pre>
+
+<p>このコードにおいて「article」ペインが使用可能かどうかを照会している点に注目してください。特定のレイアウトの照会をハードコーディングするよりもはるかに柔軟性があります。</p>
+
+<p>その他にも、さまざまなコンポーネントでも対応できる方法として、コンポーネントを操作する前に使用可能かどうかを確認する方法もあります。たとえば、News Reader サンプル アプリでは、メニューを開くボタンがありますが、このボタンは Android 3.0 よりも古いバージョンで動作しているときにしか表示されません(この機能は、API レベル 11 以上の <PH>{@link android.app.ActionBar}</PH> で提供されるため)。そこで、以下のようなコードを追加して、このボタンのイベント リスナーを追加します:</p>
+
+<pre class="prettyprint">
+Button catButton = (Button) findViewById(R.id.categorybutton);
+OnClickListener listener = /* create your listener here */;
+if (catButton != null) {
+ catButton.setOnClickListener(listener);
+}
+</pre>
+
+
+<h2 id="TaskReactToLayout">現在のレイアウトに合わせて応答する</h2>
+
+<p>現在のレイアウトによって、一部のアクションの結果が異なる可能性があります。たとえば、News Reader サンプルでは、見出しリストで見出しをクリックしたとき、デュアルペイン モードの UI の場合は右ペインに記事が表示されますが、シングルペインの UI の場合は別のアクティビティが起動します:</p>
+
+<pre>
+@Override
+public void onHeadlineSelected(int index) {
+ mArtIndex = index;
+ if (mIsDualPane) {
+ /* display article on the right pane */
+ mArticleFragment.displayArticle(mCurrentCat.getArticle(index));
+ } else {
+ /* start a separate activity */
+ Intent intent = new Intent(this, ArticleActivity.class);
+ intent.putExtra("catIndex", mCatIndex);
+ intent.putExtra("artIndex", index);
+ startActivity(intent);
+ }
+}
+</pre>
+
+<p>同様に、アプリがデュアルペイン モードの場合は、ナビ用タブでアクション バーを設定し、一方、シングルペイン モードの場合は、スピナー ウィジェットでナビを設定することになります。したがって、コードでは以下のようにどちらのケースが適切かを調べることも必要です:</p>
+
+<pre>
+final String CATEGORIES[] = { "トップ ニュース 政治", "政治", "経済", "Technology" };
+
+public void onCreate(Bundle savedInstanceState) {
+ ....
+ if (mIsDualPane) {
+ /* use tabs for navigation */
+ actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_TABS);
+ int i;
+ for (i = 0; i < CATEGORIES.length; i++) {
+ actionBar.addTab(actionBar.newTab().setText(
+ CATEGORIES[i]).setTabListener(handler));
+ }
+ actionBar.setSelectedNavigationItem(selTab);
+ }
+ else {
+ /* use list navigation (spinner) */
+ actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_LIST);
+ SpinnerAdapter adap = new ArrayAdapter<String>(this,
+ R.layout.headline_item, CATEGORIES);
+ actionBar.setListNavigationCallbacks(adap, handler);
+ }
+}
+</pre>
+
+
+<h2 id="TaskReuseFrag">他のアクティビティのフラグメントを再利用する</h2>
+
+<p>複数の画面に対応するように設計する場合、あるパターンが繰り返されますが、そうしたパターンは、ある画面設定ではペインとして、別の画面設定では別のアクティビティとして実装されるインターフェースの一部に存在します。たとえば、News Reader サンプルでは、ラージ画面の場合はニュース記事のテキストが右ペインに表示されますが、それよりも小さい画面の場合は別のアクティビティになります。</p>
+
+<p>このような場合、通常、複数のアクティビティで同じ <PH>{@link android.app.Fragment}</PH> サブクラスを再利用することでコードの重複を回避できます。たとえば、<code>ArticleFragment</code> は以下のようにデュアルペイン レイアウトで使用されます:</p>
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+
+<p>また、より小さな画面向けのアクティビティ レイアウト内では(レイアウトを使用せずに)再利用されます(<code>ArticleActivity</code>):</p>
+
+<pre>
+ArticleFragment frag = new ArticleFragment();
+getSupportFragmentManager().beginTransaction().add(android.R.id.content, frag).commit();
+</pre>
+
+<p>当然、これは XML レイアウトでフラグメントを宣言するのと同じ効果がありますが、この場合は、XML レイアウトは必要ありません。このアクティビティのコンポーネントは記事フラグメントしかないからです。</p>
+
+<p>フラグメントを設計する際に注意すべき非常に重要なポイントの 1 つとして、特定のアクティビティに対して強い結合を作成しないことがあります。通常、これは、フラグメントが自分のホスト アクティビティとやり取りするのに必要なあらゆる手段を抽象化したインターフェースを定義し、さらに、そのインターフェースをホスト アクティビティに実装することで可能になります:</p>
+
+<p>たとえば、News Reader アプリの <code>HeadlinesFragment</code> は、まさにそのようになっています:</p>
+
+<pre>
+public class HeadlinesFragment extends ListFragment {
+ ...
+ OnHeadlineSelectedListener mHeadlineSelectedListener = null;
+
+ /* Must be implemented by host activity */
+ public interface OnHeadlineSelectedListener {
+ public void onHeadlineSelected(int index);
+ }
+ ...
+
+ public void setOnHeadlineSelectedListener(OnHeadlineSelectedListener listener) {
+ mHeadlineSelectedListener = listener;
+ }
+}
+</pre>
+
+<p>これにより、ユーザーが見出しを選択すると、フラグメントは以下のように(特定のハードコーディングされたアクティビティに通知するのではなく)ホスト アクティビティが指定したリスナーに通知します:</p>
+
+<pre>
+public class HeadlinesFragment extends ListFragment {
+ ...
+ @Override
+ public void onItemClick(AdapterView<?> parent,
+ View view, int position, long id) {
+ if (null != mHeadlineSelectedListener) {
+ mHeadlineSelectedListener.onHeadlineSelected(position);
+ }
+ }
+ ...
+}
+</pre>
+
+<p>このテクニックについては、<a
+href="{@docRoot}guide/practices/tablets-and-handsets.html">タブレットと携帯端末のサポート</a>で詳しく説明されています。</p>
+
+
+<h2 id="TaskHandleConfigChanges">画面設定の変更を処理する</h2>
+
+<p>インターフェースの各パーツを実装するのに個別のアクティビティを使用している場合、インターフェースの一貫性を維持するために、(向きの変更などの)特定の設定変更に対応できるように注意する必要があります。</p>
+
+<p>たとえば、Android 3.0 以上が動作する一般的な 7 インチ タブレットでは、News Reader サンプルがニュース記事を表示する場合、縦表示では個別のアクティビティを使用しますが、横表示では 2 ペイン レイアウトを使用します。</p>
+
+<p>つまり、縦表示のときに記事閲覧用アクティビティが画面上にある場合、画面の向きが横方向に変わったことを検出したら、コンテンツを 2 ペイン レイアウトで表示するために、そのアクティビティを終了してメインのアクティビティに戻り、適切に応答しなければなりません:</p>
+
+<pre>
+public class ArticleActivity extends FragmentActivity {
+ int mCatIndex, mArtIndex;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mCatIndex = getIntent().getExtras().getInt("catIndex", 0);
+ mArtIndex = getIntent().getExtras().getInt("artIndex", 0);
+
+ // If should be in two-pane mode, finish to return to main activity
+ if (getResources().getBoolean(R.bool.has_two_panes)) {
+ finish();
+ return;
+ }
+ ...
+}
+</pre>
+
+
diff --git a/docs/html/intl/ja/training/multiscreen/index.jd b/docs/html/intl/ja/training/multiscreen/index.jd
new file mode 100644
index 0000000..ff84f8a
--- /dev/null
+++ b/docs/html/intl/ja/training/multiscreen/index.jd
@@ -0,0 +1,64 @@
+page.title=複数画面のデザイン
+
+trainingnavtop=true
+startpage=true
+next.title=さまざまな画面サイズのサポート
+next.link=screensizes.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>必要な知識と前提条件</h2>
+
+<ul>
+ <li>Android 1.6 以上(サンプル アプリを使用するには 2.1 以上)</li>
+ <li><a
+href="http://developer.android.com/guide/components/activities.html">アクティビティ</a>と<a href="http://developer.android.com/guide/components/fragments.html">フラグメント</a>の基礎知識</li>
+ <li>Android <a
+href="http://developer.android.com/guide/topics/ui/index.html">ユーザー インターフェース</a>の開発経験</li>
+ <li><a
+href="{@docRoot}tools/extras/support-library.html">サポート ライブラリ</a>の利用(一部の機能で必要)</li>
+</ul>
+
+<h2>関連ドキュメント</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">複数画面のサポート</a></li>
+</ul>
+
+<h2>試してみる</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">サンプル アプリのダウンロード</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>Android は、小さな携帯電話から大きなテレビまで、画面サイズも種類もさまざまなデバイスに搭載できます。そのため、できる限り多くのユーザーが使用できるように、すべての画面サイズに対応できるようアプリを設計することが重要になります。</p>
+
+<p>しかし、さまざまな種類のデバイスに対応できるだけでは十分ではありません。画面サイズによって、ユーザーが操作できることが決まってくるため、本当にユーザーを満足させてよい印象を持ってもらうためには、アプリが単に複数の画面をサポートするだけでは不十分です: 画面設定ごとにユーザー エクスペリエンスを最適化する必要があります。<em></em><em></em></p>
+
+<p>このクラスは、いくつかの画面設定に合わせて最適化されたユーザー インターフェースを実装する方法を提供します。</p>
+
+<p>各レッスンで紹介されているコードは、複数の画面に合わせて最適化する際、ベスト プラクティスとなるサンプル アプリから抜粋したものです。このサンプルを(右側から)ダウンロードして、再利用可能なコードのソースとしてご自分のアプリに使用することができます。</p>
+
+<p class="note"><strong>注:</strong> このクラスと関連サンプルでは、<a
+href="{@docRoot}tools/extras/support-library.html">サポート ライブラリ</a>を使用します。理由は、Android 3.0 未満のバージョンで <PH>{@link android.app.Fragment}</PH> API を使用するためです。このクラスのすべての API を使用するには、ライブラリをダウンロードして、アプリに追加する必要があります。</p>
+
+
+<h2>レッスン</h2>
+
+<dl>
+ <dt><b><a href="screensizes.html">さまざまな画面サイズのサポート</a></b></dt>
+ <dd>このレッスンでは、さまざまな画面サイズに適したレイアウトを(柔軟なビュー サイズ、 <PH>{@link android.widget.RelativeLayout}</PH>、画面サイズと画面の向きの修飾子、エイリアス フィルタ、ナインパッチ ビットマップを使用して)設計する方法について学習します。</dd>
+
+ <dt><b><a href="screendensities.html">さまざまな画面密度のサポート</a></b></dt>
+ <dd>このレッスンでは、(密度非依存ピクセルを使用し、各密度に適したビットマップを提供して)ピクセル密度が異なる画面をサポートする方法について学習します。</dd>
+
+ <dt><b><a href="adaptui.html">順応性のある UI フローの実装</a></b></dt>
+ <dd>このレッスンでは、いくつかの画面サイズ/密度の組み合わせに適した方法(実行時にアクティブなレイアウトを検出する方法、現在のレイアウトに合わせて応答する方法、画面設定の変更を処理する方法)で UI を実装する方法について学習します。</dd>
+</dl>
diff --git a/docs/html/intl/ja/training/multiscreen/screendensities.jd b/docs/html/intl/ja/training/multiscreen/screendensities.jd
new file mode 100644
index 0000000..3482d5c
--- /dev/null
+++ b/docs/html/intl/ja/training/multiscreen/screendensities.jd
@@ -0,0 +1,100 @@
+page.title=さまざまな画面密度のサポート
+parent.title=複数画面のデザイン
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=さまざまな画面サイズのサポート
+previous.link=screensizes.html
+next.title=順応性のある UI フローの実装
+next.link=adaptui.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>このレッスンでの学習内容</h2>
+<ol>
+ <li><a href="#TaskUseDP">密度非依存ピクセルを使用する</a></li>
+ <li><a href="#TaskProvideAltBmp">代替ビットマップを生成する</a></li>
+</ol>
+
+<h2>関連ドキュメント</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">複数画面のサポート</a></li>
+ <li><a href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">アイコン設計のガイドライン</a></li>
+</ul>
+
+<h2>試してみる</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">サンプル アプリのダウンロード</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+
+</div>
+</div>
+
+<p>このレッスンでは、異なるリソースを生成し、かつ解像度非依存単位を使用して、異なる画面密度をサポートする方法について学習します。</p>
+
+<h2 id="TaskUseDP">密度非依存ピクセルを使用する</h2>
+
+<p>レイアウトを設計する際に回避すべきよくある落とし穴の 1 つとして、絶対ピクセルを使用して距離やサイズを定義することがあります。ピクセルを使用してレイアウトのサイズを定義すると、画面によってピクセル密度が異なるため、問題が起こります。したがって、同じピクセル数では、デバイスが異なる場合に物理サイズが異なる可能性があります。そのため、サイズを指定する場合は、常に <code>dp</code> 単位や <code>sp</code> 単位を使用します。<code>dp</code> とは、1 ピクセルの物理サイズが 160 dpi に相当する密度非依存ピクセルです。<code>sp</code> も基本単位は同じですが、ユーザーの優先テキスト サイズによってサイズが決まるので(スケール非依存ピクセル)、テキスト サイズを定義する際にはこの単位を使用する必要があります(ただし、レイアウト サイズには絶対に使用しないこと)。</p>
+
+<p>たとえば、2 つのビューの間にスペースを挿入する場合は、<code>px</code> ではなくて <code>dp</code> を使用します:</p>
+
+<pre>
+<Button android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/clickme"
+ android:layout_marginTop="20dp" />
+</pre>
+
+<p>テキスト サイズを指定する場合は、常に <code>sp</code> を使用します:</p>
+
+<pre>
+<TextView android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="20sp" />
+</pre>
+
+
+<h2 id="TaskProvideAltBmp">代替ビットマップを生成する</h2>
+
+<p>Android は、画面密度がさまざまなデバイスで動作するため、それぞれの汎用密度バケット(低密度、中密度、高密度、超高密度)に合わせてビットマップ リソースを生成する必要があります。そうすることで、すべての画面密度で画質とパフォーマンスが向上します。</p>
+
+<p>これらの画像を生成するには、ベクター形式の未加工リソースから、次のサイズ スケールを使用して密度別に画像を生成する必要があります:</p>
+
+<p><ul>
+ <li><code>xhdpi</code>: 2.0
+ <li><code>hdpi</code>: 1.5
+ <li><code>mdpi</code>: 1.0(基準)
+ <li><code>ldpi</code>: 0.75
+</ul></p>
+
+<p>つまり、200×200 画像(<code>xhdpi</code> デバイス用)を生成する場合、同じリソースを 150×150 画像(<code>hdpi</code> デバイス用)、100×100 画像(<code>mdpi</code> デバイス用)、75×75(<code>ldpi</code> デバイス用)でも生成する必要があります。</p>
+
+<p>さらに、生成した画像を <code>res/</code> 下の適切なサブディレクトリに配置することで、アプリが動作するデバイスの画面密度に基づいて、自動的に適切な画像が表示されます:</p>
+
+<pre class="classic no-pretty-print">
+MyProject/
+ res/
+ drawable-xhdpi/
+ awesomeimage.png
+ drawable-hdpi/
+ awesomeimage.png
+ drawable-mdpi/
+ awesomeimage.png
+ drawable-ldpi/
+ awesomeimage.png
+</pre>
+
+<p>また、<code>@drawable/awesomeimage</code> を参照する場合は常に画面の dpi に基づいて、適切なビットマップが選択されます。</p>
+
+<p>アプリ用のアイコン アセットを作成するためのヒントとガイドラインについては、<a
+href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">アイコン設計のガイドライン</a>をご覧ください。</p>
+
diff --git a/docs/html/intl/ja/training/multiscreen/screensizes.jd b/docs/html/intl/ja/training/multiscreen/screensizes.jd
new file mode 100644
index 0000000..3655a33
--- /dev/null
+++ b/docs/html/intl/ja/training/multiscreen/screensizes.jd
@@ -0,0 +1,279 @@
+page.title=さまざまな画面サイズのサポート
+parent.title=複数画面のデザイン
+parent.link=index.html
+
+trainingnavtop=true
+next.title=さまざまな画面密度のサポート
+next.link=screendensities.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>このレッスンでの学習内容</h2>
+<ol>
+ <li><a href="#TaskUseWrapMatchPar">「wrap_content」と「match_parent」を使用する</a></li>
+ <li><a href="#TaskUseRelativeLayout">RelativeLayout を使用する</a></li>
+ <li><a href="#TaskUseSizeQuali">サイズ修飾子を使用する</a></li>
+ <li><a href="#TaskUseSWQuali">最小幅修飾子を使用する</a></li>
+ <li><a href="#TaskUseAliasFilters">レイアウト エイリアスを使用する</a></li>
+ <li><a href="#TaskUseOriQuali">画面の向きの修飾子を使用する</a></li>
+ <li><a href="#TaskUse9Patch">ナインパッチ ビットマップを使用する</a></li>
+</ol>
+
+<h2>関連ドキュメント</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">複数画面のサポート</a></li>
+</ul>
+
+<h2>試してみる</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">サンプル アプリのダウンロード</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>このレッスンでは、異なる画面サイズを以下のような方法でサポートする方法について学習します:</p>
+<ul>
+ <li>画面に収まるようにレイアウト サイズを適切に変更する</li>
+ <li>画面設定に基づいて適切な UI レイアウトを表示する</li>
+ <li>適切な画面に適切なレイアウトを適用する</li>
+ <li>適切にサイズ調整したビットマップを表示する</li>
+</ul>
+
+
+<h2 id="TaskUseWrapMatchPar">「wrap_content」と「match_parent」を使用する</h2>
+
+<p>レイアウトをさまざまな画面サイズに柔軟に対応させるには、一部のビュー コンポーネントの幅と高さに <code>"wrap_content"</code> と <code>"match_parent"</code> を使用する必要があります。<code>"wrap_content"</code> を使用すると、ビューの幅や高さがそのビュー内にコンテンツが収まるのに必要な最小サイズに設定されます。一方、<code>"match_parent"</code>(API レベル 8 より前の名称は <code>"fill_parent"</code>)を使用すると、コンポーネントがその親ビューのサイズに一致するまで拡大されます。</p>
+
+<p>ハードコーディングされたサイズの代わりに <code>"wrap_content"</code> と <code>"match_parent"</code> を使用することで、ビューはそれぞれ、そのビューに必要なスペースだけを使用したり、空きスペースを埋めるまで拡大したりします。次に例を示します:</p>
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane_with_bar.xml all}
+
+<p>このサンプルでは、特定のサイズではない <code>"wrap_content"</code> と <code>"match_parent"</code> をコンポーネント サイズにどのように使用しているかに注目してください。こうすることで、異なる画面のサイズと向きにレイアウトを正しく対応させることができます。</p>
+
+<p>たとえば、このレイアウトを縦表示と横表示で表示したときの見え方を以下に示します。コンポーネントのサイズが幅と高さに自動的に適合している点に注目してください:</p>
+
+<img src="{@docRoot}images/training/layout-hvga.png" />
+<p class="img-caption"><strong>図 1.</strong> News Reader サンプル アプリの縦表示(左)と横表示(右)</p>
+
+
+<h2 id="TaskUseRelativeLayout">RelativeLayout を使用する</h2>
+
+<p>ネストされた <PH>{@link android.widget.LinearLayout} インスタンスや、</PH> <code>"wrap_content"</code> と <code>"match_parent"</code> のサイズの組み合わせを使用すると、かなり複雑なレイアウトを作成できます。しかし、 <PH>{@link android.widget.LinearLayout}</PH> では、子ビューの空間的な位置関係を正確に制御することはできません。 <PH>{@link android.widget.LinearLayout} のビューは、</PH> 単に一列に並ぶだけです。子ビューに対して直線以外のさまざまな配置を実現する必要がある場合は、 <PH>{@link android.widget.RelativeLayout}</PH>を使用することでうまくいくことがよくあります。たとえば、1 つの子ビューを画面の左側に配置し、もう 1 つの子ビューを右側に配置できます。</p>
+
+<p>次に例を示します:</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:id="@+id/label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Type here:"/>
+ <EditText
+ android:id="@+id/entry"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/label"/>
+ <Button
+ android:id="@+id/ok"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/entry"
+ android:layout_alignParentRight="true"
+ android:layout_marginLeft="10dp"
+ android:text="OK" />
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toLeftOf="@id/ok"
+ android:layout_alignTop="@id/ok"
+ android:text="Cancel" />
+</RelativeLayout>
+</pre>
+
+<p>図 2 は、このレイアウトの QVGA 画面での見え方を示しています。</p>
+
+<img src="{@docRoot}images/training/relativelayout1.png" />
+<p class="img-caption"><strong>図 2.</strong> QVGA 画面(スモール画面)のスクリーンショット</p>
+
+<p>図 3 は、このレイアウトのラージ画面での見え方を示しています。</p>
+
+<img src="{@docRoot}images/training/relativelayout2.png" />
+<p class="img-caption"><strong>図 3.</strong> WSVGA 画面(ラージ画面)のスクリーンショット</p>
+
+<p>コンポーネントのサイズが変更されても、 <PH>{@link android.widget.RelativeLayout.LayoutParams}</PH>で指定されたとおりに空間的な位置関係が維持されていることがわかります。</p>
+
+
+<h2 id="TaskUseSizeQuali">サイズ修飾子を使用する</h2>
+
+<p>柔軟なレイアウトや相対的なレイアウトから得られる恩恵は、前のセクションで説明したことくらいです。これらのレイアウトはコンポーネントの内部や周囲のスペースを引き延ばすことでさまざまな画面に対応しますが、それぞれの画面サイズに合った最高のユーザー エクスペリエンスを実現していない可能性があります。したがって、アプリでは、柔軟なレイアウトの実装だけではなく、さまざまな画面設定に合わせた複数の代替レイアウトも必要になります。これは、<a href="http://developer.android.com/guide/practices/screens_support.html#qualifiers">設定修飾子</a>を使用することで実現可能です。設定修飾子により、ランタイムが現在のデバイスの設定に基づいて適切なリソース(画面サイズ別のレイアウト デザインなど)を自動的に選択できます。</p>
+
+<p>たとえば、多くのアプリでは、ラージ画面用に「2 ペイン」パターンを実装しています(一方のペインに項目リスト、もう一方のペインにそのコンテンツを表示することが可能です)。タブレットやテレビは両方のペインを同時に表示できるほど十分に大きい画面ですが、携帯端末の画面では 2 つのペインを別々に表示する必要があります。そのようなレイアウトを実装するには、次のようなファイルが必要になります:</p>
+
+<ul>
+ <li><code>res/layout/main.xml</code>、シングルペイン(デフォルト)レイアウト:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+</li>
+ <li><code>res/layout-large/main.xml</code>、2 ペイン レイアウト:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+</li>
+</ul>
+
+<p>2 番目のレイアウトのディレクトリ名の <code>large</code> 修飾子に注目してください。このレイアウトは、ラージ(7 インチ以上のタブレットなど)と分類された画面のデバイスで選択されます。それよりも小さいデバイスでは、その他のレイアウト(修飾子なし)が選択されます。</p>
+
+
+<h2 id="TaskUseSWQuali">最小幅修飾子を使用する</h2>
+
+<p>Android 3.2 未満のデバイスでデベロッパーが抱えていた問題の 1 つに、Dell Streak、初代 Galaxy Tab、7 インチ タブレット全般を含む、「ラージ」画面サイズの分類があります。しかし、多くのアプリでは、すべて「ラージ」画面と見なされたとしても、このカテゴリ内のデバイスのサイズに合わせて異なるレイアウト(5 インチと 7 インチのデバイス用など)を表示したい場合があります。そこで、Android 3.2 では「最小幅」修飾子などが導入されました。</p>
+
+<p>最小幅修飾子を使用すると、dp で指定した特定の最小幅の画面を対象とすることができます。たとえば、一般的な 7 インチ タブレットは最小幅が 600 dp なので、これらの画面の UI で 2 つのペイン(ただし、それよりも小さい画面ではシングル リスト)を表示したい場合は、前のセクションで説明した 2 つのレイアウトをシングルペイン レイアウト用と 2 ペイン レイアウト用としてそのまま利用できます。ただし、<code>large</code> サイズ修飾子の代わりに、<code>sw600dp</code> を使用して、最小幅が 600 dp の画面では 2 ペイン レイアウトになるよう指定します:</p>
+
+<ul>
+ <li><code>res/layout/main.xml</code>、シングルペイン(デフォルト)レイアウト:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+</li>
+ <li><code>res/layout-sw600dp/main.xml</code>、2 ペイン レイアウト:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+</li>
+</ul>
+
+<p>つまり、最小幅が 600dp 以上のデバイスでは <code>layout-sw600dp/main.xml</code>(2 ペイン)レイアウトが選択され、それよりも小さい画面では <code>layout/main.xml</code>(シングルペイン)レイアウトが選択されるということです。</p>
+
+<p>ただし、Android 3.2 未満のデバイスではこの修飾子は機能しません。これは <code>sw600dp</code> をサイズ修飾子として認識できないためです。したがって、引き続き <code>large</code> 修飾子も使用する必要があります。そこで、<code>res/layout-sw600dp/main.xml</code> と同じ内容の <code>res/layout-large/main.xml</code> という名前のファイルも必要になります。次のセクションでは、このようにレイアウト ファイルの重複を避けるためのテクニックについて学習します。</p>
+
+
+<h2 id="TaskUseAliasFilters">レイアウト エイリアスを使用する</h2>
+
+<p>最小幅修飾子は、Android 3.2 以上でしか利用できません。したがって、旧バージョンとの互換性を維持するために、あいまいなサイズ分類(small、normal、large、xlarge)も併用することが必要です。たとえば、携帯端末ではシングルペイン UI、7 インチ タブレットやテレビなどの大きなデバイスではマルチペイン UI を表示するよう UI を設計する場合、以下のようなファイルが必要になります:</p>
+
+<p><ul>
+<li><code>res/layout/main.xml:</code> シングルペイン レイアウト</li>
+<li><code>res/layout-large:</code> マルチペイン レイアウト</li>
+<li><code>res/layout-sw600dp:</code> マルチペイン レイアウト</li>
+</ul></p>
+
+<p>最後の 2 つのファイルは同じものです。一方は Android 3.2 デバイス用で、もう一方は旧バージョンの Android を搭載したタブレットとテレビ用です。</p>
+
+<p>このようにタブレット/テレビ用として同じファイルを使用することで起こる重複(さらに、その結果メンテナンスが困難になる状況)を避けるために、エイリアス ファイルを使用できます。たとえば、次のようなレイアウトを定義できます:</p>
+
+<ul>
+<li><code>res/layout/main.xml</code>、シングルペイン レイアウト</li>
+<li><code>res/layout/main_twopanes.xml</code>、2 ペイン レイアウト</li>
+</ul>
+
+<p>さらに、次の 2 つのファイルを追加します:</p>
+
+<p><ul>
+<li><code>res/values-large/layout.xml</code>:
+<pre>
+<resources>
+ <item name="main" type="layout">@layout/main_twopanes</item>
+</resources>
+</pre>
+</li>
+
+<li><code>res/values-sw600dp/layout.xml</code>:
+<pre>
+<resources>
+ <item name="main" type="layout">@layout/main_twopanes</item>
+</resources>
+</pre>
+
+</li>
+</ul></p>
+
+<p>最後の 2 つのファイルの内容は同じですが、実際のレイアウトは定義していません。これらのファイルは、単に <PH>{@code main}</PH> を <PH>{@code main_twopanes}</PH>へのエイリアスになるように設定しただけです。これらのファイルには <code>large</code> と <code>sw600dp</code> セレクタが含まれているので、Android のバージョンに関係なく(
+<PH>Android 3.2 未満のタブレット/テレビは {@code large} に一致し、</PH>Android 3.2 以上のタブレット/テレビは <code>sw600dp</code> に一致します)タブレット/テレビに適用されます。</p>
+
+
+<h2 id="TaskUseOriQuali">画面の向きの修飾子を使用する</h2>
+
+<p>横表示と縦表示が両方とも正しく表示されるレイアウトもありますが、ほとんどのレイアウトは調整が必要になります。以下に、News Reader サンプル アプリの各画面のサイズと向きでレイアウトがどのように表示されるかを示します:</p>
+
+<p><ul>
+<li><b>スモール画面、縦表示:</b> シングル ペイン、ロゴ付き</li>
+<li><b>スモール画面、横表示:</b> シングル ペイン、ロゴ付き</li>
+<li><b>7 インチ タブレット、縦表示:</b> シングル ペイン、アクション バー付き</li>
+<li><b>7 インチ タブレット、横表示:</b> デュアル ペイン、ワイド、アクション バー付き</li>
+<li><b>10 インチ タブレット、縦表示:</b> デュアル ペイン、ナロー、アクション バー付き</li>
+<li><b>10 インチ タブレット、横表示:</b> デュアル ペイン、ワイド、アクション バー付き</li>
+<li><b>テレビ、横表示:</b> デュアル ペイン、ワイド、アクション バー付き</li>
+</ul></p>
+
+<p>これらの各レイアウトは、<code>res/layout/</code> ディレクトリ内の XML ファイルに定義されています。各レイアウトをさまざまな画面設定に割り当てるには、アプリでレイアウト エイリアスを使用して、各設定に対応付けます:</p>
+
+<p><code>res/layout/onepane.xml:</code></p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+
+<p><code>res/layout/onepane_with_bar.xml:</code></p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane_with_bar.xml all}
+
+<p><code>res/layout/twopanes.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+
+<p><code>res/layout/twopanes_narrow.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes_narrow.xml all}
+
+<p>これで、考えられるすべてのレイアウトが定義されました。あとは、設定修飾子を使用して、適切なレイアウトを各設定にマッピングするだけです。そのためには、以下のようなレイアウト エイリアス テクニックを使用することができます:</p>
+
+<p><code>res/values/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values/layouts.xml all}
+
+<p><code>res/values-sw600dp-land/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-land/layouts.xml
+all}
+
+<p><code>res/values-sw600dp-port/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-port/layouts.xml
+all}
+
+<p><code>res/values-large-land/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-land/layouts.xml all}
+
+<p><code>res/values-large-port/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-port/layouts.xml all}
+
+
+
+<h2 id="TaskUse9Patch">ナインパッチ ビットマップを使用する</h2>
+
+<p>異なる画面サイズをサポートするには、画像リソースも異なるサイズに対応できないといけません。たとえば、ボタンの背景は、適用されるボタンの形状が異なってもサイズが合わなければいけません。</p>
+
+<p>サイズ変更可能なコンポーネントでシンプルな画像を使用すると、ランタイムによって画像が一様に拡大縮小されるので、いくぶん期待はずれの結果になることがすぐにわかります。これは、ナインパッチ ビットマップを使用することで解決します。ナインパッチ ビットマップとは、拡大可能な領域と拡大不可能な領域が指定された特殊なフォーマットの PNG ファイルです。</p>
+
+<p>そのため、サイズが変化するコンポーネントで使用するビットマップをデザインする場合は、常にナインパッチを使用してください。ビットマップをナインパッチに変換するには、まず、通常の画像を用意します(図 4: わかりやすく 4 倍に拡大しています)。</p>
+
+<img src="{@docRoot}images/training/button.png" />
+<p class="img-caption"><strong>図 4.</strong> <code>button.png</code></p>
+
+<p>次に、 <ode
+href="{@docRoot}tools/help/draw9patch.html">SDK の <code>draw9patch</code></a> ユーティリティ(<code>tools/</code> ディレクトリにあります)からナインパッチを実行して、左境界線と上境界線上にピクセル(ドット)を描くことで拡大する領域にマークを付けます。また、右境界線と下境界線上にピクセルを描くことで、コンテンツを入れる領域をマークできます(図 5)。</p>
+
+<img src="{@docRoot}images/training/button_with_marks.png" />
+<p class="img-caption"><strong>図 5.</strong> <code>button.9.png</code></p>
+
+<p>境界線上に黒いピクセルがあることに注目してください。左境界線と上境界線上のものは画像を拡大できる領域で、右境界線と下境界線上のものはコンテンツを配置する領域を示しています。</p>
+
+<p>さらに、<code>.9.png</code> という拡張子にも注目してください。この拡張子は必ず使用してください。そうすることで、通常の PNG 画像ではなく、ナインパッチ画像であることがフレームワークによって検出されます。</p>
+
+<p>この背景を(<code>android:background="@drawable/button"</code> を設定して)コンポーネントに適用すると、ボタンのサイズに合わせて適切に画像が拡大します(図 6 のさまざまなサイズを参照)。</p>
+
+<img src="{@docRoot}images/training/buttons_stretched.png" />
+<p class="img-caption"><strong>図 6</strong><code>button.9.png</code> ナインパッチを使用したさまざまなサイズのボタン</p>
+
diff --git a/docs/html/intl/ko/training/monitoring-device-state/battery-monitoring.jd b/docs/html/intl/ko/training/monitoring-device-state/battery-monitoring.jd
new file mode 100644
index 0000000..2eacccf
--- /dev/null
+++ b/docs/html/intl/ko/training/monitoring-device-state/battery-monitoring.jd
@@ -0,0 +1,120 @@
+page.title=배터리 수준 및 충전 상태 모니터링
+parent.title=배터리 수명 최적화
+parent.link=index.html
+
+trainingnavtop=true
+next.title=도킹 상태와 유형 확인 및 모니터링
+next.link=docking-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>강의 목표</h2>
+<ol>
+ <li><a href="#DetermineChargeState">현재 충전 상태 확인</a></li>
+ <li><a href="#MonitorChargeState">충전 상태 변경사항 모니터링</a></li>
+ <li><a href="#CurrentLevel">현재 배터리 수준 확인</a></li>
+ <li><a href="#MonitorLevel">배터리 수준 중요 변경사항 모니터링</a></li>
+</ol>
+
+<h2>참고자료</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">인텐트 및 인텐트 필터</a>
+</ul>
+
+</div>
+</div>
+
+<p>백그라운드 업데이트가 배터리 수명에 미치는 영향을 줄이기 위하여 백그라운드 업데이트 빈도수를 변경하는 경우, 현재 배터리 수준과 충전 상태부터 확인하는 것이 좋습니다.</p>
+
+<p>애플리케이션 업데이트 수행이 배터리 수명에 미치는 영향은 배터리 수준 및 기기의 충전 상태에 따라 다릅니다. 기기를 AC 충전기로 충전하는 동안 업데이트 수행이 미치는 영향은 무시해도 좋습니다. 따라서 기기가 범용 충전기에 연결되어 있을 때는 대부분 새로고침 빈도를 최대화할 수 있습니다. 반대로 기기가 충전 중이 아니라면, 업데이트 빈도를 줄이는 것이 배터리 수명 연장에 도움이 됩니다.</p>
+
+<p>마찬가지로 배터리가 거의 방전된 경우, 업데이트 빈도를 줄이거나 중단할 수 있습니다.</p>
+
+
+<h2 id="DetermineChargeState">현재 충전 상태 확인</h2>
+
+<p>먼저 현재 충전 상태를 확인하는 것부터 시작합니다. {@link android.os.BatteryManager}는 배터리 충전 상태 등 충전 정보를 스티키 {@link android.content.Intent}를 통해 브로드캐스트합니다.</p>
+
+<p>스티키 인텐트이므로 {@link android.content.BroadcastReceiver}를 등록할 필요가 없으며 아래 코드 상의 리시버와 같이 간단히 {@code registerReceiver}을(를) 호출하여 {@code null}에 제출하면 현재 배터리 상태가 담긴 인텐트가 반환됩니다. 여기에 실제 {@link android.content.BroadcastReceiver} 개체 사용할 수 있으나, 이후 섹션에서 업데이트를 다루게 되므로 그럴 필요는 없습니다.</p>
+
+<pre>IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
+Intent batteryStatus = context.registerReceiver(null, ifilter);</pre>
+
+<p>현재 충전 상태와 어떤 충전기(USB 또는 AC 전원)로 충전하는지 추출할 수 있습니다.<p>
+
+<pre>// Are we charging / charged?
+int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
+boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
+ status == BatteryManager.BATTERY_STATUS_FULL;
+
+// How are we charging?
+int chargePlug = battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+boolean usbCharge = chargePlug == BATTERY_PLUGGED_USB;
+boolean acCharge = chargePlug == BATTERY_PLUGGED_AC;</pre>
+
+<p>일반적으로 기기가 AC 충전기에 연결된 경우 백그라운드 업데이트 빈도를 최대화합니다. USB를 통해 충전하는 경우 업데이트 빈도를 낮춥니다. 배터리가 방전 중이라면 빈도를 더 많이 낮추도록 합니다.</p>
+
+
+<h2 id="MonitorChargeState">충전 상태 변경사항 모니터링</h2>
+
+<p>충전 상태는 수시로 변하므로 충전 상태의 변경사항을 확인하고 이에 따라 업데이트 주기를 변경하는 것이 중요합니다.</p>
+
+<p>{@link android.os.BatteryManager}는 기기가 전원에 연결되어 있는지 여부와 관계없이 언제나 액션을 브로드캐스트합니다. 앱이 실행되지 않는 동안에도 이벤트를 수신하는 것이 중요합니다. 특히 백그라운드 업데이트를 실행하기 위해 앱을 시작하는 빈도수에 이벤트가 영향을 주기 때문입니다. 따라서 두 이벤트를 수신하려면 매니페스트에서 {@link android.content.BroadcastReceiver}를 등록하여 인텐트 필터 내에 {@link android.content.Intent#ACTION_POWER_CONNECTED}와 {@link android.content.Intent#ACTION_POWER_DISCONNECTED}를 정의해야 합니다.</p>
+
+<pre><receiver android:name=".PowerConnectionReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
+ <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
+ </intent-filter>
+</receiver></pre>
+
+<p>다음의 {@link android.content.BroadcastReceiver} 구현에서 이전 단계에서 설명한 대로 현재 충전 상태와 방법을 알아낼 수 있습니다.</p>
+
+<pre>public class PowerConnectionReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
+ boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
+ status == BatteryManager.BATTERY_STATUS_FULL;
+
+ int chargePlug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+ boolean usbCharge = chargePlug == BATTERY_PLUGGED_USB;
+ boolean acCharge = chargePlug == BATTERY_PLUGGED_AC;
+ }
+}</pre>
+
+
+<h2 id="CurrentLevel">현재 배터리 수준 확인</h2>
+
+<p>현재 배터리 수준을 확인하는 것이 유용한 경우도 있습니다. 배터리 충전이 수준 이하인 경우 백그라운드 업데이트 빈도를 줄일 수 있습니다.</p>
+
+<p>다음은 배터리 상태 정보가 담긴 인텐트에서 현재 배터리 수준 및 충전 상태를 추출하는 방법입니다.</p>
+
+<pre>int level = battery.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
+int scale = battery.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
+
+float batteryPct = level / (float)scale;</pre>
+
+
+<h2 id="MonitorLevel">배터리 수준 중요 변경사항 모니터링</h2>
+
+<p>배터리 상태를 지속적으로 확인하는 것은 쉽지 않지만, 꼭 그럴 필요도 없습니다.</p>
+
+<p>배터리 수준을 지속적으로 모니터링하는 것은 앱의 다른 작업보다 배터리에 더 큰 영향을 미칩니다. 따라서 기기가 배터리 전원 부족 상태가 되거나 이를 벗어날 때 등 중요한 변경사항만 확인하는 것이 좋습니다.</p>
+
+<p>다음 코드는 매니페스트의 브로드캐스트 리시버 내의 인텐트 필터를 보여줍니다. 배터리가 얼마 남지 않거나{@link android.content.Intent#ACTION_BATTERY_LOW} 배터리 상태가 회복되었을 때{@link android.content.Intent#ACTION_BATTERY_OKAY} 전달되는 메시지를 수신할 수 있습니다.</p>
+
+<pre><receiver android:name=".BatteryLevelReceiver">
+<intent-filter>
+ <action android:name="android.intent.action.ACTION_BATTERY_LOW"/>
+ <action android:name="android.intent.action.ACTION_BATTERY_OKAY"/>
+ </intent-filter>
+</receiver></pre>
+
+<p>배터리 충전 상태가 매우 낮은 경우 백그라운드 업데이트를 사용하지 않는 것이 좋습니다. 전화기가 꺼져버리면 최신 데이터를 제공하는 것이 의미가 없기 때문입니다.</p>
+
+<p>기기를 충전하는 것은 곧 기기를 도크에 집어넣는 것과 같은 경우가 많습니다. 다음 강의는 현재 도크 상태를 확인하고 기기 도킹의 변경사항을 모니터링하는 방법을 보여줍니다.</p>
+
diff --git a/docs/html/intl/ko/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html/intl/ko/training/monitoring-device-state/connectivity-monitoring.jd
new file mode 100644
index 0000000..5666b98
--- /dev/null
+++ b/docs/html/intl/ko/training/monitoring-device-state/connectivity-monitoring.jd
@@ -0,0 +1,70 @@
+page.title=연결 상태 확인 및 모니터링
+parent.title=배터리 수명 최적화
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=도킹 상태와 유형 확인 및 모니터링
+previous.link=docking-monitoring.html
+next.title=온디맨드로 브로드캐스트 수신기 조작
+next.link=manifest-receivers.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>강의 목표</h2>
+<ol>
+ <li><a href="#DetermineConnection">인터넷에 연결되어 있는지 확인</a></li>
+ <li><a href="#DetermineType">인터넷 연결 유형 확인</a></li>
+ <li><a href="#MonitorChanges">연결 변경사항 모니터링</a></li>
+</ol>
+
+
+<h2>참고자료</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">인텐트 및 인텐트 필터</a>
+</ul>
+
+</div>
+</div>
+
+<p>반복 알람과 백그라운드 서비스는 일반적으로 인터넷 리소스 및 캐시 데이터로부터 애플리케이션의 업데이트를 예약하거나 긴 시간이 필요한 다운로드를 실행하는 데 사용됩니다. 하지만 인터넷에 연결되어 있지 않거나 연결이 매우 느려 다운로드를 완료하지 못한다면 업데이트 예약을 해도 소용이 없겠죠?</p>
+
+<p>인터넷에 연결되었는지, 어떤 연결 방식인지를 확인하기 위하여 {@link android.net.ConnectivityManager}를 사용할 수 있습니다.</p>
+
+
+<h2 id="DetermineConnection">인터넷에 연결되어 있는지 확인</h2>
+
+<p>인터넷에 연결되어 있지 않는 경우 인터넷 리소스를 기반으로 한 업데이트 예약을 할 필요가 없습니다. 다음은 활성 네트워크를 쿼리하고 인터넷이 연결되어 있는지 확인하기 위한 {@link android.net.ConnectivityManager} 사용법을 보여줍니다.</p>
+
+<pre>ConnectivityManager cm =
+ (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
+
+NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
+boolean isConnected = activeNetwork.isConnectedOrConnecting();</pre>
+
+
+<h2 id="DetermineType">인터넷 연결 유형 확인</h2>
+
+<p>현재 사용할 수 있는 인터넷 연결 유형을 확인할 수도 있습니다.</p>
+
+<p>연결은 모바일 데이터, WiMAZ, Wi-Fi 및 이더넷 연결을 통해 제공될 수 있습니다. 아래와 같이 활성 네트워크의 유형을 쿼리하면, 사용 가능한 대역폭에 따라 업데이트 빈도를 변경할 수 있습니다.</p>
+
+<pre>boolean isWiFi = activeNetwork.getType() == ConnectivityManager.TYPE_WIFI;</pre>
+
+<p>모바일 데이터 비용은 Wi-Fi보다 높은 경향이 있으므로, 모바일 연결인 경우 앱의 업데이트 빈도를 줄여야 합니다. 마찬가지로 Wi-Fi로 연결되기까지 큰 용량의 다운로드는 일시 중지해야 합니다.</p>
+
+<p>업데이트를 비활성화한 경우, 인터넷 연결이 재개되면 업데이트를 다시 시작하기 위해 연결 변경사항을 알고 있는 것이 중요합니다.</p>
+
+
+<h2 id="MonitorChanges">연결 변경사항 모니터링</h2>
+
+<p>연결 정보가 변경될 때마다 {@link android.net.ConnectivityManager}는 {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION}({@code "android.net.conn.CONNECTIVITY_CHANGE"}) 액션을 브로드캐스트합니다. 변경사항을 수신하거나 적절히 백그라운드 업데이트를 다시 시작 또는 일시 중지하기 위해 매니페스트에서 브로드캐스트 리시버를 등록할 수 있습니다.</p>
+
+<pre><action android:name="android.net.conn.CONNECTIVITY_CHANGE"/></pre>
+
+<p>연결 정보는 수시로 변경될 수 있습니다. 모바일과 Wi-Fi 간에 이동할 때마다 브로드캐스트가 실행됩니다. 따라서 업데이트나 다운로드를 일시 중지한 경우에만 브로드캐스트를 확인하는 것이 좋습니다. 업데이트를 시작하기 전이나 이전에 업데이트를 일시 중지했던 경우에만 확인하는 것으로 충분합니다.</p>
+
+<p>이 기술은 다음 강의에서 설명하는 매니페스트에서 선언한 브로드캐스트 리시버의 전환이 필요합니다.</p>
diff --git a/docs/html/intl/ko/training/monitoring-device-state/docking-monitoring.jd b/docs/html/intl/ko/training/monitoring-device-state/docking-monitoring.jd
new file mode 100644
index 0000000..0cd61a0
--- /dev/null
+++ b/docs/html/intl/ko/training/monitoring-device-state/docking-monitoring.jd
@@ -0,0 +1,74 @@
+page.title=도킹 상태와 유형 확인 및 모니터링
+parent.title=배터리 수명 최적화
+parent.link=index.html
+
+trainingnavtop=true
+previous.title= 배터리 수준 및 충전 상태 모니터링
+previous.link=battery-monitoring.html
+next.title= 연결 상태 확인 및 모니터링
+next.link=connectivity-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>강의 목표</h2>
+<ol>
+ <li><a href="#CurrentDockState">오디오 포커스 요청</a></li>
+ <li><a href="#DockType">현재 도크 유형 확인</a></li>
+ <li><a href="#MonitorDockState">도크 상태 또는 유형 변경사항 모니터링</a></li>
+</ol>
+
+
+<h2>참고자료</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">인텐트 및 인텐트 필터</a>
+</ul>
+
+</div>
+</div>
+
+<p>Android 기기는 여러 종류의 도크로 도킹될 수 있습니다. 여기에는 카폰 또는 홈 도크와 디지털 및 아날로그 도크가 포함됩니다. 많은 도크가 도킹된 기기에 전기를 공급하므로 일반적으로 충전 상태와 도크 상태는 밀접한 관련이 있습니다.</p>
+
+<p>전화의 도크 상태가 업데이트 빈도에 어떻게 영향을 미치는지는 앱에 따라 다릅니다. 스포츠 센터 앱이라면 데스크톱 도크에서 업데이트 빈도를 높이고 카폰 도크에 연결된 경우 업데이트를 완전히 사용 중지해도 좋습니다. 반대로 교통 상황을 제공하는 앱이라면 카폰 도크에서 업데이트를 최대화해도 좋습니다.</p>
+
+<p>도크 상태는 스티키 {@link android.content.Intent}로 브로드캐스트되어 기기가 도킹되었는지 여부와 도킹되었다면 어떤 종류의 도크인지 알아낼 수 있습니다. </p>
+
+
+<h2 id="CurrentDockState">현재 도킹 상태 확인</h2>
+
+<p>도크 상태의 세부사항은 {@link android.content.Intent#ACTION_DOCK_EVENT} 액션의 스티키 브로드캐스트 내에 추가로 포함됩니다. 스티키 브로드캐스트이므로 {@link android.content.BroadcastReceiver}를 등록할 필요가 없습니다. 다음 스니펫에 표시된 브로드캐스트 수신기와 같이 간단히 {@link android.content.Context#registerReceiver registerReceiver()}를 호출하여 {@code null}에 제출할 수 있습니다. </p>
+
+<pre>IntentFilter ifilter = new IntentFilter(Intent.ACTION_DOCK_EVENT);
+Intent dockStatus = context.registerReceiver(null, ifilter);</pre>
+
+<p>{@code EXTRA_DOCK_STATE} 추가로부터 현재 도킹 상태를 추출할 수 있습니다.<p>
+
+<pre>int dockState = battery.getIntExtra(EXTRA_DOCK_STATE, -1);
+boolean isDocked = dockState != Intent.EXTRA_DOCK_STATE_UNDOCKED;</pre>
+
+
+<h2 id="DockType">현재 도크 유형 확인</h2>
+
+<p>4가지 유형의 도크가 있습니다.
+<ul><li>카폰</li>
+<li>데스크</li>
+<li>저가형(아날로그) 데스크</li>
+<li>고가형(디지털) 데스크</li></ul></p>
+
+<p>마지막 두 가지 옵션은 API 수준 11의 Android에만 제공되어 있으므로, 디지털 또는 아날로그에 상관하지 않고 관심 있는 세 가지 도크 유형에 대해 확인하는 것이 좋습니다.</p>
+
+<pre>boolean isCar = dockState == EXTRA_DOCK_STATE_CAR;
+boolean isDesk = dockState == EXTRA_DOCK_STATE_DESK ||
+ dockState == EXTRA_DOCK_STATE_LE_DESK ||
+ dockState == EXTRA_DOCK_STATE_HE_DESK;</pre>
+
+
+<h2 id="MonitorDockState">도크 상태 또는 유형 변경사항 모니터링</h2>
+
+<p>도킹 상태가 바뀌면 {@link android.content.Intent#ACTION_DOCK_EVENT} 액션이 브로드캐스트됩니다. 기기의 도크 상태 변경사항을 모니터링하려면 아래에 표시된 대로 애플리케이션 매니페스트에서 브로드캐스트 리시버를 등록하세요.</p>
+
+<pre><action android:name="android.intent.action.ACTION_DOCK_EVENT"/></pre>
+
+<p>이전 단계에서 설명한 기술을 사용하여 리시버 구현에서 도크 유형 및 상태를 추출할 수 있습니다.</p>
diff --git a/docs/html/intl/ko/training/monitoring-device-state/index.jd b/docs/html/intl/ko/training/monitoring-device-state/index.jd
new file mode 100644
index 0000000..f96e2e1
--- /dev/null
+++ b/docs/html/intl/ko/training/monitoring-device-state/index.jd
@@ -0,0 +1,49 @@
+page.title=배터리 수명 최적화
+
+trainingnavtop=true
+startpage=true
+next.title=배터리 수준 및 충전 상태 모니터링
+next.link=battery-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>요구사항과 선행조건</h2>
+<ul>
+ <li>Android 2.0(API 수준 5) 또는 이상</li>
+ <li> <a href="{@docRoot}guide/components/intents-filters.html">인텐트 및 인텐트 필터</a> 사용 경험</li>
+</ul>
+
+<h2>참고자료</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/services.html">서비스</a>
+</ul>
+
+</div>
+</div>
+
+<p>좋은 앱은 호스트 기기의 배터리 수명에 미치는 영향이 미미해야 합니다. 강의를 통해 호스트 기기의 상태에 따라 기능과 동작을 수정하는 것을 모니터링하는 앱을 구축할 수 있게 됩니다.</p>
+
+<p>연결이 끊겼을 때 백그라운드 서비스 업데이트를 사용 중지하거나, 배터리 수준이 낮을 때 업데이트 빈도를 줄이는 조치를 취하여, 사용자 환경을 손상시키지 않고 배터리 수명에 미치는 영향을 최소화할 수 있습니다.</p>
+
+<h2>강의</h2>
+
+<!-- Create a list of the lessons in this class along with a short description of each lesson.
+These should be short and to the point. It should be clear from reading the summary whether someone
+will want to jump to a lesson or not.-->
+
+<dl>
+ <dt><b><a href="battery-monitoring.html">배터리 수준 및 충전 상태 모니터링</a></b></dt>
+ <dd>충전 상태에서 현재 배터리 수준 및 변경사항을 확인 및 모니터링하여 앱의 업데이트 빈도를 변경하는 법을 알아보세요.</dd>
+
+ <dt><b><a href="docking-monitoring.html">도킹 상태와 유형 확인 및 모니터링</a></b></dt>
+ <dd>최적의 새로고침 빈도는 호스트 기기의 사용 방법에 따라 달라질 수 있습니다. 앱의 동작에 영향을 미치는 도킹 상태와 도크 유형을 확인 및 모니터링하는 방법을 알아보세요.</dd>
+
+ <dt><b><a href="connectivity-monitoring.html">연결 상태 확인 및 모니터링</a></b></dt>
+ <dd>인터넷 연결 없이 온라인 소스를 통해 앱을 업데이트할 수 없습니다. 연결 상태를 확인하여 백그라운드 업데이트 빈도를 변경하는 방법을 알아보세요. 고대역폭 작업을 시작하기 전에 Wi-Fi 또는 모바일 연결을 확인하는 방법도 알 수 있습니다.</dd>
+
+ <dt><b><a href="manifest-receivers.html">온디맨드로 브로드캐스트 수신기 조작</a></b></dt>
+ <dd>매니페스트 내에 선언했던 브로드캐스트 리시버는 현재 기기 상태에서 필요 없는 것을 사용 중지하도록 런타임 때 전환될 수 있습니다. 기기가 특정 상태에 도달할 때까지 상태 변화 리시버 및 지연 액션을 전환 및 단계적으로 연결하여 효율성을 향상하는 법을 알아보세요.</dd>
+</dl>
\ No newline at end of file
diff --git a/docs/html/intl/ko/training/monitoring-device-state/manifest-receivers.jd b/docs/html/intl/ko/training/monitoring-device-state/manifest-receivers.jd
new file mode 100644
index 0000000..c5c311b
--- /dev/null
+++ b/docs/html/intl/ko/training/monitoring-device-state/manifest-receivers.jd
@@ -0,0 +1,50 @@
+page.title=온디맨드로 브로드캐스트 수신기 조작
+parent.title=배터리 수명 최적화
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=연결 상태 확인 및 모니터링
+previous.link=connectivity-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>강의 목표</h2>
+<ol>
+ <li><a href="#ToggleReceivers">효율성 향상을 위한 상태 변화 리시버의 전환 및 단계적 연결</a></li>
+</ol>
+
+
+<h2>참고자료</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">인텐트 및 인텐트 필터</a>
+</ul>
+
+</div>
+</div>
+
+<p>기기 상태 변경을 모니터링하는 가장 간단한 방법은 모니터링하는 각 상태에 대해 {@link android.content.BroadcastReceiver}를 만들어 각각을 애플리케이션 매니페스트에 등록하는 것입니다. 그러면 각 리시버 내에서 현재 기기 상태를 기반으로 반복 알람의 일정을 간단히 변경할 수 있습니다.</p>
+
+<p>이 방법의 부작용은 리시버 중 하나라도 실행되면 매번 앱이 기기의 절전 모드를 해제시킨다는 것입니다.</p>
+
+<p>더 나은 방법은 런타임 때 브로드캐스트 리시버를 사용 중지 또는 사용하도록 설정하는 것입니다. 이렇게 하면 매니페스트에 선언한 리시버를 필요할 때만 시스템 이벤트에 의해 실행되는 수동적인 알람으로 사용할 수 있습니다.</p>
+
+
+<h2 id="ToggleReceivers">효율성 향상을 위한 상태 변화 수신기의 전환 및 단계적 연결 </h2>
+
+<p>{@link android.content.pm.PackageManager}를 사용하여 아래에서 표시된 대로 모든 사용 또는 사용 중지하기 원하는 브로드캐스트 리시버를 포함하여 매니페스트 내에 정의된 모든 요소의 사용 가능 상태를 전환할 수 있습니다.</p>
+
+<pre>ComponentName receiver = new ComponentName(context, myReceiver.class);
+
+PackageManager pm = context.getPackageManager();
+
+pm.setComponentEnabledSetting(receiver,
+ PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
+ PackageManager.DONT_KILL_APP)</pre>
+
+<p>이 방법을 사용하면 연결이 없음을 확인한 경우 연결 변경 리시버를 제외한 모든 리시버를 사용 중지할 수 있습니다. 반대로 한 번 연결되면 연결 변경사항의 수신을 중지할 수 있으며, 업데이트를 수행하고 반복 업데이트 알람의 일정을 변경하기 전에 온라인 상태인지만 간단히 확인할 수 있습니다.</p>
+
+<p>높은 대역폭을 요구하는 다운로드를 중지시키는 데 동일한 기술을 사용할 수 있습니다. 연결 변경을 수신하는 브로드캐스트 리시버를 사용하도록 설정하고 반드시 Wi-Fi에 연결한 후에 다운로드를 시작하도록 합니다.</p>
diff --git a/docs/html/intl/ko/training/multiscreen/adaptui.jd b/docs/html/intl/ko/training/multiscreen/adaptui.jd
new file mode 100644
index 0000000..cb7b66c
--- /dev/null
+++ b/docs/html/intl/ko/training/multiscreen/adaptui.jd
@@ -0,0 +1,212 @@
+page.title=조정형 UI 플로우 구현
+parent.title=다양한 화면 지원
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=다양한 화면 밀도 지원
+previous.link=screendensities.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>강의 목표</h2>
+
+<ol>
+ <li><a href="#TaskDetermineCurLayout">현재 레이아웃 확인</a></li>
+ <li><a href="#TaskReactToLayout">현재 레이아웃에 대한 대응</a></li>
+ <li><a href="#TaskReuseFrag">다른 액티비티에 프래그먼트 재사용</a></li>
+ <li><a href="#TaskHandleConfigChanges">화면 구성 변경의 처리</a></li>
+</ol>
+
+<h2>참고자료</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">태블릿 및 휴대전화 지원</a></li>
+</ul>
+
+<h2>다운로드 </h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">샘플 앱 다운로드</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+
+</div>
+</div>
+
+<p>현재 애플리케이션이 표시하는 레이아웃에 따라 UI 플로가 달라질 수 있습니다. 예를 들어 애플리케이션이 이중 창 모드로 되어 있는 경우에는 왼쪽 창에 있는 항목을 클릭하면 오른쪽 창에 콘텐츠가 표시되고, 단일 창 모드로 되어 있는 경우에는 콘텐츠가 해당 창에 표시됩니다(다른 액티비티에서).</p>
+
+
+<h2 id="TaskDetermineCurLayout">현재 레이아웃 확인</h2>
+
+<p>각 레이아웃을 구현하는 방식이 약간씩 다르므로 가장 먼저 해야 할 일은 현재 사용자에게 어떤 레이아웃이 표시되는지 확인하는 것입니다. 예를 들어, 사용자가 '단일 창' 모드에 있는지 혹은 '이중 창' 모드에 있는지 파악할 수 있습니다. 이는 특정 뷰가 존재하고 그 뷰가 표시되는지 조회하면 됩니다.</p>
+
+<pre class="prettyprint">
+public class NewsReaderActivity extends FragmentActivity {
+ boolean mIsDualPane;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main_layout);
+
+ View articleView = findViewById(R.id.article);
+ mIsDualPane = articleView != null &&
+ articleView.getVisibility() == View.VISIBLE;
+ }
+}
+</pre>
+
+<p>이 코드는 'article' 창을 사용할 수 있는지 여부를 조회하며 이러한 방식이 특정 레이아웃에 대한 조회를 하드코딩하는 것보다 훨씬 유연한 방식입니다.</p>
+
+<p>다른 구성요소의 존재 여부에 맞게 앱을 조정하는 또 다른 방법은 구성요소에 대한 작업을 수행하기 전에 해당 구성요소를 사용할 수 있는지 확인하는 것입니다. 예를 들어 뉴스 리더 샘플 앱의 경우, 메뉴를 여는 버튼이 있긴 하지만 이 버튼은 Android 3.0 이전 버전에서 실행되는 경우에만 존재합니다(API 수준 11 이상에서 <PH>{@link android.app.ActionBar}</PH> 가 그 기능을 대신하기 때문). 따라서 이 버튼에 대한 이벤트 리스너를 추가하기 위해 다음과 같이 할 수 있습니다.</p>
+
+<pre class="prettyprint">
+Button catButton = (Button) findViewById(R.id.categorybutton);
+OnClickListener listener = /* create your listener here */;
+if (catButton != null) {
+ catButton.setOnClickListener(listener);
+}
+</pre>
+
+
+<h2 id="TaskReactToLayout">현재 레이아웃에 대한 대응</h2>
+
+<p>현재 레이아웃에 따라 일부 액션의 결과가 달라질 수 있습니다. 예를 들어 뉴스 리더 샘플의 헤드라인 목록에서 헤드라인을 클릭하면 UI가 이중 창 모드인 경우에는 기사가 오른쪽 창에서 열리지만, UI가 단일 창 모드인 경우에는 별도의 액티비티가 실행됩니다.</p>
+
+<pre>
+@Override
+public void onHeadlineSelected(int index) {
+ mArtIndex = index;
+ if (mIsDualPane) {
+ /* display article on the right pane */
+ mArticleFragment.displayArticle(mCurrentCat.getArticle(index));
+ } else {
+ /* start a separate activity */
+ Intent intent = new Intent(this, ArticleActivity.class);
+ intent.putExtra("catIndex", mCatIndex);
+ intent.putExtra("artIndex", index);
+ startActivity(intent);
+ }
+}
+</pre>
+
+<p>마찬가지로, 앱이 이중 창 모드인 경우에는 탐색용 탭이 포함된 작업 표시줄이 설정되지만, 앱이 단일 창 모드인 경우에는 스피너 위젯이 포함된 탐색 메뉴가 설정됩니다. 따라서 어떤 경우가 적합한지도 코드에서 확인해야 합니다.</p>
+
+<pre>
+final String CATEGORIES[] = { "Top Stories", "Politics", "Economy", "Technology" };
+
+public void onCreate(Bundle savedInstanceState) {
+ ....
+ if (mIsDualPane) {
+ /* use tabs for navigation */
+ actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_TABS);
+ int i;
+ for (i = 0; i < CATEGORIES.length; i++) {
+ actionBar.addTab(actionBar.newTab().setText(
+ CATEGORIES[i]).setTabListener(handler));
+ }
+ actionBar.setSelectedNavigationItem(selTab);
+ }
+ else {
+ /* use list navigation (spinner) */
+ actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_LIST);
+ SpinnerAdapter adap = new ArrayAdapter<String>(this,
+ R.layout.headline_item, CATEGORIES);
+ actionBar.setListNavigationCallbacks(adap, handler);
+ }
+}
+</pre>
+
+
+<h2 id="TaskReuseFrag">다른 액티비티에 프래그먼트 재사용</h2>
+
+<p>다양한 화면의 디자인에 반복되는 패턴에는 일부 화면 구성에서는 창으로 구현되고 다른 화면 구성에서는 별도의 액티비티로 구현되는 인터페이스가 일부 있습니다. 예를 들어 뉴스 리더 샘플에서 뉴스 기사 텍스트가 큰 화면에서는 오른쪽 창에 표시되지만 작은 화면에서는 별도의 액티비티입니다.</p>
+
+<p>이러한 경우 일반적으로 동일한 <PH>{@link android.app.Fragment}</PH> 하위 클래스를 여러 액티비티에 재사용하여 코드 중복을 피할 수 있습니다. 예를 들어 <code>ArticleFragment</code>는 이중 창 레이아웃에서 사용되며 </p>
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+
+<p>작은 화면의 액티비티 레이아웃에 레이아웃 없이 재사용됩니다(<code>ArticleActivity</code>).</p>
+
+<pre>
+ArticleFragment frag = new ArticleFragment();
+getSupportFragmentManager().beginTransaction().add(android.R.id.content, frag).commit();
+</pre>
+
+<p>당연히 이는 XML 레이아웃에서 프래그먼트(fragment)를 명시하는 것과 같은 효과가 있지만 이 경우에는 아티클 프래그먼트가 이 액티비티의 유일한 구성요소이기 때문에 XML 레이아웃은 불필요한 작업이 됩니다.</p>
+
+<p>프래그먼트를 디자인할 때 염두에 두어야 할 매우 중요한 점 한 가지는 특정 액티비티에 대한 강한 커플링을 만들지 말아야 한다는 점입니다. 이렇게 하려면 일반적으로 프래그먼트가 호스트 액티비티와 상호작용해야 하는 모든 방식을 추상화하는 인터페이스를 정의하면 됩니다. 그러면 호스트 액티비티가 해당 인터페이스를 구현합니다.</p>
+
+<p>예를 들어 뉴스 리더 앱의 <code>HeadlinesFragment</code>가 정확하게 그 일을 해 줍니다.</p>
+
+<pre>
+public class HeadlinesFragment extends ListFragment {
+ ...
+ OnHeadlineSelectedListener mHeadlineSelectedListener = null;
+
+ /* Must be implemented by host activity */
+ public interface OnHeadlineSelectedListener {
+ public void onHeadlineSelected(int index);
+ }
+ ...
+
+ public void setOnHeadlineSelectedListener(OnHeadlineSelectedListener listener) {
+ mHeadlineSelectedListener = listener;
+ }
+}
+</pre>
+
+<p>그런 다음 사용자가 헤드라인을 선택하면 프래그먼트가 하드코딩된 특정 액티비티를 알리지 않고 호스트 액티비티가 지정한 리스너를 알립니다.</p>
+
+<pre>
+public class HeadlinesFragment extends ListFragment {
+ ...
+ @Override
+ public void onItemClick(AdapterView<?> parent,
+ View view, int position, long id) {
+ if (null != mHeadlineSelectedListener) {
+ mHeadlineSelectedListener.onHeadlineSelected(position);
+ }
+ }
+ ...
+}
+</pre>
+
+<p>이 기술은 <a
+href="{@docRoot}guide/practices/tablets-and-handsets.html">태블릿 및 휴대전화 지원</a> 가이드에서 자세히 설명되어 있습니다.</p>
+
+
+<h2 id="TaskHandleConfigChanges">화면 구성 변경 처리</h2>
+
+<p>인터페이스 중 일부를 구현하는데 별도의 액티비티를 사용 중인 경우 인터페이스의 일관성을 유지하기 위해 특정 구성의 변경(예: 화면 전환)에 대응해야 합니다.</p>
+
+<p>예를 들어 Android 3.0 이상을 실행하는 일반적인 7인치 태블릿에서 뉴스 리더 샘플은 세로 모드에서 실행될 때에는 뉴스 기사를 표시하는 데 별도의 액티비티를 사용하지만 가로모드에서는 이중 창(two-pane) 레이아웃을 사용합니다.</p>
+
+<p>즉 사용자가 세로 모드에 있고 기사를 보기 위한 액티비티가 화면에 있는 경우, 방향이 가로로 바뀌었음을 감지하고, 액티비티를 종료한 다음 주요 액티비티로 돌아감으로써 콘텐츠가 이중 창 레이아웃에서 표시되도록 적절하게 대응해야 합니다.</p>
+
+<pre>
+public class ArticleActivity extends FragmentActivity {
+ int mCatIndex, mArtIndex;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mCatIndex = getIntent().getExtras().getInt("catIndex", 0);
+ mArtIndex = getIntent().getExtras().getInt("artIndex", 0);
+
+ // If should be in two-pane mode, finish to return to main activity
+ if (getResources().getBoolean(R.bool.has_two_panes)) {
+ finish();
+ return;
+ }
+ ...
+}
+</pre>
+
+
diff --git a/docs/html/intl/ko/training/multiscreen/index.jd b/docs/html/intl/ko/training/multiscreen/index.jd
new file mode 100644
index 0000000..d9e09b0
--- /dev/null
+++ b/docs/html/intl/ko/training/multiscreen/index.jd
@@ -0,0 +1,64 @@
+page.title=다양한 화면 지원
+
+trainingnavtop=true
+startpage=true
+next.title=다양한 화면 크기 지원
+next.link=screensizes.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>요구사항과 선행조건</h2>
+
+<ul>
+ <li>Android 1.6 이상(샘플 앱의 경우 2.1 이상)</li>
+ <li><a
+href="http://developer.android.com/guide/components/activities.html">액티비티</a> 및 <a href="http://developer.android.com/guide/components/fragments.html">프래그먼트</a>에 대한 기본 지식</li>
+ <li>Android <a
+href="http://developer.android.com/guide/topics/ui/index.html"> 사용자 인터페이스</a> 구축 경험</li>
+ <li><a
+href="{@docRoot}tools/extras/support-library.html">호환성 라이브러리</a>를 사용해야 하는 여러 기능</li>
+</ul>
+
+<h2>참고자료</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">다양한 화면 지원</a></li>
+</ul>
+
+<h2>다운로드 </h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">샘플 앱 다운로드</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>Android는 소형 휴대전화에서부터 대형 TV에 이르기까지 다양한 화면 크기의 수많은 기기 유형을 지원합니다. 따라서 애플리케이션이 모든 화면 크기와 호환되어 최대한 많은 사용자가 사용할 수 있도록 디자인하는 것이 중요합니다.</p>
+
+<p>하지만 다양한 기기 유형과 호환되는 것만으로는 충분하지 않습니다. 각 화면 크기에 따라 사용자 상호작용에 유리한 점과 불리한 점이 다릅니다. 따라서 사용자에게 만족을 주고 깊은 인상을 심어주려면 애플리케이션이 단지 여러 화면을 <em>지원</em>하는 데 그치지 않고 화면 구성별로 사용자 환경을 <em>최적화</em>해야 합니다.</p>
+
+<p>이번 강의에서는 여러 화면 구성에 최적화된 사용자 인터페이스를 구현하는 방법을 설명합니다.</p>
+
+<p>각 강의에서 사용되는 코드는 여러 화면에 대한 최적화의 모범 사례를 보여주는 샘플 애플리케이션에서 가져온 것입니다. 샘플(오른쪽)을 다운로드하여 본인의 애플리케이션에 코드로 재사용할 수 있습니다. </p>
+
+<p class="note"><strong>참고:</strong> 이 강의 및 강의와 관련된 샘플은 <a
+href="{@docRoot}tools/extras/support-library.html">호환성 라이브러리</a>를 사용하며 이는 Android 3.0 이하 버전에서 <PH>{@link android.app.Fragment}</PH> API를 사용하기 위해서입니다. 이 강의에서 API를 모두 사용하려면 라이브러리를 다운로드하여 애플리케이션에 추가해야 합니다.</p>
+
+
+<h2>강의</h2>
+
+<dl>
+ <dt><b><a href="screensizes.html">다양한 화면 크기 지원</a></b></dt>
+ <dd>이 강의에서는 여러 다양한 화면 크기에 조정되는 레이아웃을 디자인하는 방법(유연한 보기 크기, <PH>{@link android.widget.RelativeLayout}</PH>, 화면 크기 및 방향 한정자, 별칭 필터 및 나인-패치 비트맵 사용하기)을 안내합니다.</dd>
+
+ <dt><b><a href="screendensities.html">다양한 화면 밀도 지원</a></b></dt>
+ <dd>이 강의에서는 다양한 픽셀 밀도를 가진 화면을 지원하는 방법(밀도 독립형 픽셀(density-independent pixel) 사용하기 및 밀도별로 적합한 비트맵 제공하기)을 설명합니다.</dd>
+
+ <dt><b><a href="adaptui.html">조정형 UI 플로우 구현</a></b></dt>
+ <dd>이 강의에서는 여러 화면 크기/밀도 조합에 조정되도록 UI 플로우를 구현하는 방법(활성 레이아웃의 런타임 감지, 현재 레이아웃에 따른 대응, 화면 구성 변경 처리)을 설명합니다.</dd>
+</dl>
diff --git a/docs/html/intl/ko/training/multiscreen/screendensities.jd b/docs/html/intl/ko/training/multiscreen/screendensities.jd
new file mode 100644
index 0000000..5d6e2f3
--- /dev/null
+++ b/docs/html/intl/ko/training/multiscreen/screendensities.jd
@@ -0,0 +1,100 @@
+page.title=다양한 화면 밀도 지원
+parent.title=다양한 화면 지원
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=다양한 화면 크기 지원
+previous.link=screensizes.html
+next.title=조정형 UI 플로우 구현
+next.link=adaptui.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>강의 목표</h2>
+<ol>
+ <li><a href="#TaskUseDP">DIP(Density Independent Pixel) 사용</a></li>
+ <li><a href="#TaskProvideAltBmp">대체 비트맵 제공</a></li>
+</ol>
+
+<h2>참고자료</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">여러 화면 지원</a></li>
+ <li><a href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">아이콘 디자인 가이드라인</a></li>
+</ul>
+
+<h2>다운로드 </h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">샘플 앱 다운로드</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+
+</div>
+</div>
+
+<p>이 강의에서는 다양한 리소스를 제공하고 해상도 독립형(resolution-independent) 측정 단위를 사용함으로써 다양한 화면 밀도를 지원하는 방법을 설명합니다.</p>
+
+<h2 id="TaskUseDP">DIP(Density Independent Pixel) 사용</h2>
+
+<p>레이아웃을 디자인할 때 범하기 쉬운 실수 중 하나는 절대 픽셀(absolute pixel)을 사용하여 거리나 크기를 정의하는 것입니다. 각 화면은 픽셀 밀도가 서로 다른데 레이아웃 크기를 픽셀로 정의하면 동일한 픽셀 수치가 다른 기기에서 다른 물리적 크기와 대응할 수 있어 문제가 됩니다. 따라서 크기를 지정할 때에는 항상 <code>dp</code> 또는 <code>sp</code> 단위를 사용하시기 바랍니다. <code>dp</code>는 160dpi에서 픽셀의 물리적 크기에 대응하는 밀도 독립형 픽셀(Density Independent Pixel)입니다. <code>sp</code>는 동일한 기본 단위이지만 사용자의 기본 텍스트 크기에 따라 확대/축소될 수 있으므로(배율 독립형 픽셀(Scale Independent Pixel)임) 텍스트 크기를 정의할 때 이 측정 단위를 사용해야 합니다(레이아웃 크기에 사용해서는 안됨).</p>
+
+<p>예를 들어 두 개의 보기 사이에 여백을 지정할 때 <code>px</code>가 아닌 <code>dp</code>를 사용합니다.</p>
+
+<pre>
+<Button android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/clickme"
+ android:layout_marginTop="20dp" />
+</pre>
+
+<p>텍스트 크기를 지정할 때에는 항상 <code>sp</code>를 사용합니다.</p>
+
+<pre>
+<TextView android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="20sp" />
+</pre>
+
+
+<h2 id="TaskProvideAltBmp">대체 비트맵 제공</h2>
+
+<p>Android는 화면 밀도가 다양한 기기에서 실행되므로 각각의 일반화된 밀도 종류(저, 중, 고 및 초고 밀도)에 맞춤화된 비트맵 리소스를 제공해야 합니다. 이렇게 하면 모든 화면 밀도에서 좋은 그래픽 품질 및 성능을 얻는데 도움이 됩니다.</p>
+
+<p>이러한 이미지를 생성하려면 벡터 형식의 원본 리소스부터 시작해야 하며 다음 크기 배율을 사용하여 각 밀도에 사용할 이미지를 생성해야 합니다.</p>
+
+<p><ul>
+ <li><code>xhdpi</code>: 2.0
+ <li><code>hdpi</code>: 1.5
+ <li><code>mdpi</code>: 1.0 (기선)
+ <li><code>ldpi</code>: 0.75
+</ul></p>
+
+<p>즉 <code>xhdpi</code> 기기에 대해 200x200 이미지를 생성하는 경우 <code>hdpi</code> 기기에 대해 동일한 리소스를 150x150으로 생성해야 하며 <code>mdpi</code> 기기에 대해서는 100x100, <code>ldpi</code> 기기에 대해서는 75x75으로 동일한 리소스를 생성해야 합니다.</p>
+
+<p>그런 다음 생성된 이미지 파일을 <code>res/</code> 아래의 적절한 하위 디렉토리에 배치하면 시스템에서 애플리케이션이 실행되는 기기의 화면 밀도에 따라 정확한 이미지 파일을 자동으로 선택합니다.</p>
+
+<pre class="classic no-pretty-print">
+MyProject/
+ res/
+ drawable-xhdpi/
+ awesomeimage.png
+ drawable-hdpi/
+ awesomeimage.png
+ drawable-mdpi/
+ awesomeimage.png
+ drawable-ldpi/
+ awesomeimage.png
+</pre>
+
+<p>그런 다음 언제든지 <code>@drawable/awesomeimage</code>를 참조하면 시스템이 화면의 dpi에 따라 적합한 비트맵을 선택합니다.</p>
+
+<p>애플리케이션에 사용할 아이콘 저작물 제작에 대한 자세한 도움말 및 가이드라인은 <a
+href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">아이콘 디자인 가이드라인</a>을 참조하세요.</p>
+
diff --git a/docs/html/intl/ko/training/multiscreen/screensizes.jd b/docs/html/intl/ko/training/multiscreen/screensizes.jd
new file mode 100644
index 0000000..f2e77a6
--- /dev/null
+++ b/docs/html/intl/ko/training/multiscreen/screensizes.jd
@@ -0,0 +1,279 @@
+page.title=다양한 화면 크기 지원
+parent.title=다양한 화면 지원
+parent.link=index.html
+
+trainingnavtop=true
+next.title=다양한 화면 밀도 지원
+next.link=screendensities.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>강의 목표</h2>
+<ol>
+ <li><a href="#TaskUseWrapMatchPar">'wrap_content' 및 'match_parent' 사용</a></li>
+ <li><a href="#TaskUseRelativeLayout">RelativeLayout 사용</a></li>
+ <li><a href="#TaskUseSizeQuali">크기 한정자 사용</a></li>
+ <li><a href="#TaskUseSWQuali">최소 너비 한정자 사용</a></li>
+ <li><a href="#TaskUseAliasFilters">레이아웃 별칭 사용</a></li>
+ <li><a href="#TaskUseOriQuali">방향 한정자 사용</a></li>
+ <li><a href="#TaskUse9Patch">나인-패치 비트맵 사용</a></li>
+</ol>
+
+<h2>참고자료</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">다양한 화면 지원</a></li>
+</ul>
+
+<h2>다운로드 </h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">샘플 앱 다운로드</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>이 강의에서는 다양한 화면 크기를 지원하는 방법을 설명합니다.</p>
+<ul>
+ <li>화면에 맞게 레이아웃 크기 조정</li>
+ <li>화면 구성에 따라 적합한 UI 레이아웃 제공</li>
+ <li>올바른 화면에 올바른 레이아웃 적용</li>
+ <li>정확하게 확대되는 비트맵 제공</li>
+</ul>
+
+
+<h2 id="TaskUseWrapMatchPar">'wrap_content' 및 'match_parent' 사용</h2>
+
+<p>레이아웃이 다양한 화면 크기에 따라 유연하게 조정되도록 하려면 일부 뷰 구성요소의 너비와 높이에 <code>"wrap_content"</code> 및 <code>"match_parent"</code>를 사용해야 합니다. <code>"wrap_content"</code>를 사용하면 뷰의 너비와 높이가 해당 뷰 내에 콘텐츠가 들어가는데 필요한 최소 크기로 설정되는 반면, <code>"match_parent"</code>(API 수준 8 이전에는 <code>"fill_parent"</code>라고도 함)를 사용하면 구성요소가 확장되어 부모뷰의 크기와 일치하게 됩니다.</p>
+
+<p>하드코딩된 크기 대신 <code>"wrap_content"</code> 크기 값을 사용하면 뷰가 해당 뷰에 필요한 여백만을 사용하며 <code>"match_parent"</code> 크기 값을 사용하면 뷰가 확대되어 사용 가능한 여백을 채웁니다. 예를 들면 다음과 같습니다.</p>
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane_with_bar.xml all}
+
+<p>샘플에서 구성요소 크기에 특정 크기가 아닌 <code>"wrap_content"</code> 및 <code>"match_parent"</code>가 사용된 것을 눈여겨 보시기 바랍니다. 이렇게 하면 레이아웃이 다양한 화면 크기 및 방향에 맞게 조정됩니다.</p>
+
+<p>예를 들어 세로 및 가로 모드에서 레이아웃은 다음과 같이 표시됩니다. 구성요소의 크기가 너비와 높이에 맞게 자동으로 조정됩니다.</p>
+
+<img src="{@docRoot}images/training/layout-hvga.png" />
+<p class="img-caption"><strong>그림 1.</strong> 세로 모드(왼쪽) 및 가로 모드(오른쪽)에서의 뉴스 리더 샘플 앱</p>
+
+
+<h2 id="TaskUseRelativeLayout">RelativeLayout 사용</h2>
+
+<p>비교적 복잡한 레이아웃을 만들려면 <PH>{@link android.widget.LinearLayout}의 중첩 인스턴스와</PH> <code>"wrap_content"</code> 및 <code>"match_parent"</code> 크기의 조합을 사용합니다. 하지만 <PH>{@link android.widget.LinearLayout}</PH> 을 사용하면 자식뷰의 여백 관계를 정확하게 제어할 수 없으며 <PH>{@link android.widget.LinearLayout}</PH> 단순히 나란하게 표시됩니다. 자식뷰를 일직선이 아닌 다양한 방향으로 표시해야 하는 경우 구성요소 사이의 여백 관계를 중심으로 레이아웃을 지정할 수 있는 <PH>{@link android.widget.RelativeLayout}</PH>을 사용하는 것이 더 좋은 방법일 수 있습니다. 예를 들어 화면 왼쪽에 하나의 자식뷰를, 오른쪽에 다른 자식뷰를 정렬할 수 있습니다.</p>
+
+<p>예를 들면 다음과 같습니다.</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:id="@+id/label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Type here:"/>
+ <EditText
+ android:id="@+id/entry"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/label"/>
+ <Button
+ android:id="@+id/ok"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/entry"
+ android:layout_alignParentRight="true"
+ android:layout_marginLeft="10dp"
+ android:text="OK" />
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toLeftOf="@id/ok"
+ android:layout_alignTop="@id/ok"
+ android:text="Cancel" />
+</RelativeLayout>
+</pre>
+
+<p>그림 2는 이 레이아웃이 QVGA 화면에 어떻게 표시되는지 보여줍니다.</p>
+
+<img src="{@docRoot}images/training/relativelayout1.png" />
+<p class="img-caption"><strong>그림 2.</strong> QVGA 화면(작은 화면)의 스크린샷</p>
+
+<p>그림 3은 이 레이아웃이 큰 화면에서 어떻게 표시되는지 보여줍니다.</p>
+
+<img src="{@docRoot}images/training/relativelayout2.png" />
+<p class="img-caption"><strong>그림 3.</strong> WSVGA 화면(큰 화면)의 스크린샷</p>
+
+<p>구성요소의 크기가 변하더라도 여백 관계가 <PH>{@link android.widget.RelativeLayout.LayoutParams}</PH>.</p>
+
+
+<h2 id="TaskUseSizeQuali">크기 한정자 사용</h2>
+
+<p>이전 섹션에서 다룬 유연한 레이아웃이나 상대적 레이아웃으로는 한계가 있습니다. 이러한 레이아웃이 구성요소 내부 및 주위의 여백을 확장하여 다양한 화면에 맞게 조정되긴 하지만 화면 크기별로 최적의 사용자 환경을 제공하지는 못할 수 있습니다. 따라서 애플리케이션은 유연한 레이아웃을 구현할 뿐 아니라 다양한 화면 구성을 타겟팅할 수 있도록 다양한 대체 레이아웃을 제공해야 합니다. 그 방법은 런타임이 현재 기기의 구성에 따라 적합한 리소스(예: 화면 크기별로 다른 레이아웃 디자인)를 자동으로 선택하도록 해 주는 <a href="http://developer.android.com/guide/practices/screens_support.html#qualifiers">구성 한정자</a>를 사용하는 것입니다.</p>
+
+<p>예를 들어 많은 애플리케이션이 큰 화면에 '이중 창(two pane)' 패턴을 구현합니다(한 쪽 창에는 아이템의 목록을 표시하고 다른 창에는 콘텐츠를 표시). 태블릿 및 TV는 두 개의 창 모두가 화면에 동시에 들어갈 정도로 크지만 휴대전화 화면은 두 창을 따로 표시해야 합니다. 따라서 이러한 레이아웃을 구현하려면 다음 파일이 있어야 합니다.</p>
+
+<ul>
+ <li><code>res/layout/main.xml</code>, 단일 창(기본값) 레이아웃:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+</li>
+ <li><code>res/layout-large/main.xml</code>, 이중 창 레이아웃:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+</li>
+</ul>
+
+<p>두 번째 레이아웃의 디렉토리 이름에서 <code>large</code> 한정자를 눈여겨 보시기 바랍니다. 이 레이아웃은 대형(예: 7인치 태블릿 이상)으로 분류된 화면을 가진 기기에서 선택됩니다. 한정자가 없는 다른 레이아웃은 소형 기기에서 선택됩니다.</p>
+
+
+<h2 id="TaskUseSWQuali">최소 너비 한정자 사용</h2>
+
+<p>Android 3.2 이전 기기에서 개발자가 어려움을 느꼈던 문제 중의 하나는 Dell Streak, 최초의 Galaxy 탭 및 7인치 태블릿에 두루 사용되는 '큰' 화면 크기 빈이었습니다. 하지만 많은 애플리케이션은 화면이 '큰' 기기라 하더라도 이 카테고리(예: 5인치 및 7인치 기기)에 속하는 다양한 기기에 다양한 레이아웃을 표시하고 싶어 합니다. 이것이 Android에서 Android 3.2에 '최소 너비' 한정자를 도입한 이유입니다.</p>
+
+<p>최소 너비 한정자를 사용하면 dp 단위의 특정 최소 너비를 가진 화면을 타겟팅할 수 있습니다. 예를 들어 일반적인 7인치 태블릿에는 600dp라는 최소 너비가 있으므로 이러한 화면에서 두 개의 창에 UI를 사용(작은 화면에서는 단일 목록 사용) 하고 싶은 경우 단일 및 이중 창 레이아웃에 이전 섹션과 동일한 레이아웃을 사용하면 되지만, 이중 창 레이아웃은 최소 너비가 600dp인 화면에 사용한다는 것을 나타내기 위해서 <code>large</code> 크기 한정자 대신 <code>sw600dp</code>를 사용해야 합니다.</p>
+
+<ul>
+ <li><code>res/layout/main.xml</code>, 단일 창(기본값) 레이아웃:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+</li>
+ <li><code>res/layout-sw600dp/main.xml</code>, 이중 창 레이아웃:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+</li>
+</ul>
+
+<p>이는 최소 너비가 600dp 이상인 기기는 <code>layout-sw600dp/main.xml</code>(이중 창) 레이아웃을 선택하는 반면 소형 화면은 <code>layout/main.xml</code> (단일 창) 레이아웃을 선택한다는 것을 의미합니다.</p>
+
+<p>하지만 Android 3.2 이전 기기는 <code>sw600dp</code>를 크기 한정자로 인식하지 않기 때문에 최소 너비 한정자가 제대로 작동하지 않으며 따라서 <code>large</code> 한정자도 계속 사용해야 합니다. 따라서 <code>res/layout-large/main.xml</code>라는 이름의 파일이 있어야 하며 이 파일은 <code>res/layout-sw600dp/main.xml</code>과 동일한 파일입니다. 다음 섹션에서는 이런 식으로 레이아웃 파일이 중복되지 않게 하는 기술을 살펴보겠습니다.</p>
+
+
+<h2 id="TaskUseAliasFilters">레이아웃 별칭 사용</h2>
+
+<p>최소 너비 한정자는 Android 3.2 이상 버전에서만 사용할 수 있습니다. 따라서 이전 버전과 호환되도록 하려면 추상화 크기 빈(소형, 보통, 대형 및 초대형)을 계속 사용해야 합니다. 예를 들어 휴대전화에서는 단일 창 UI가 표시되고 7인치 태블릿, TV 및 기타 대형 기기에서는 다중 창 UI가 표시되도록 UI를 디자인하려면 다음 파일을 제공해야 합니다.</p>
+
+<p><ul>
+<li><code>res/layout/main.xml:</code> 단일 창 레이아웃</li>
+<li><code>res/layout-large:</code> 다중 창 레이아웃</li>
+<li><code>res/layout-sw600dp:</code> 다중 창 레이아웃</li>
+</ul></p>
+
+<p>마지막 두 개의 파일은 하나는 Android 3.2 기기와 일치하고 다른 하나는 이전 버전의 Android가 탑재된 태블릿 및 TV를 위한 것으로 서로 동일한 파일입니다.</p>
+
+<p>이 경우 별칭 파일을 사용하면 태블릿 및 TV용으로 동일한 파일이 중복되지 않도록 하고 이를 관리해야 하는 번거로움을 없앨 수 있습니다. 예를 들어 다음 레이아웃을 지정할 수 있습니다.</p>
+
+<ul>
+<li><code>res/layout/main.xml</code>, 단일 창 레이아웃</li>
+<li><code>res/layout/main_twopanes.xml</code>, 이중 창 레이아웃</li>
+</ul>
+
+<p>또한 다음 두 개의 파일을 추가합니다.</p>
+
+<p><ul>
+<li><code>res/values-large/layout.xml</code>:
+<pre>
+<resources>
+ <item name="main" type="layout">@layout/main_twopanes</item>
+</resources>
+</pre>
+</li>
+
+<li><code>res/values-sw600dp/layout.xml</code>:
+<pre>
+<resources>
+ <item name="main" type="layout">@layout/main_twopanes</item>
+</resources>
+</pre>
+
+</li>
+</ul></p>
+
+<p>뒤에 있는 두 개의 파일은 콘텐츠는 동일하지만 실제로 레이아웃을 지정하지는 않으며 단지 <PH>{@code main}</PH> 이 <PH>{@code main_twopanes}에 대한 별칭이 되도록 설정합니다.</PH> 이 파일에는 <code>large</code> 및 <code>sw600dp</code> 선택기가 있으므로 Android 버전에 관계없이 태블릿 및 TV에 적용됩니다(3.2 버전 이전의 태블릿 및 TV는
+<PH>{@code large}</PH>,3.2 이후 버전은 <code>sw600dp</code>와 일치).</p>
+
+
+<h2 id="TaskUseOriQuali">방향 한정자 사용</h2>
+
+<p>일부 레이아웃은 가로 및 세로 방향 모두에서 잘 작동하지만 대부분의 레이아웃은 조정을 통해 많은 이점을 누릴 수 있습니다. 다음은 뉴스 리더 샘플 앱에서 화면 크기와 방향별로 레이아웃이 어떻게 작동하는지 보여줍니다.</p>
+
+<p><ul>
+<li><b>소형 화면, 세로:</b> 단일 창, 로고 표시</li>
+<li><b>소형 화면, 가로:</b> 단일 창, 로고 표시</li>
+<li><b>7인치 태블릿, 세로:</b> 단일 창, 작업 표시줄 표시</li>
+<li><b>7인치 태블릿, 가로:</b> 이중 창, 와이드, 작업 표시줄 표시</li>
+<li><b>10인치 태블릿, 세로:</b> 이중 창, 내로우, 작업 표시줄 표시</li>
+<li><b>10인치 태블릿, 가로:</b> 이중 창, 와이드, 작업 표시줄 표시</li>
+<li><b>TV, 가로:</b> 이중 창, 와이드, 작업 표시줄 표시</li>
+</ul></p>
+
+<p>따라서 이러한 각 레이아웃은 <code>res/layout/</code> 디렉토리의 XML 파일에서 지정됩니다. 그러면 앱은 각 레이아웃을 다양한 화면 구성에 지정하기 위해 레이아웃 별칭을 사용해 레이아웃을 각 구성과 일치시킵니다.</p>
+
+<p><code>res/layout/onepane.xml:</code></p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+
+<p><code>res/layout/onepane_with_bar.xml:</code></p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane_with_bar.xml all}
+
+<p><code>res/layout/twopanes.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+
+<p><code>res/layout/twopanes_narrow.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes_narrow.xml all}
+
+<p>가능한 레이아웃을 모두 지정했으므로 구성 한정자를 사용하여 올바른 레이아웃을 각 구성에 매핑하기만 하면 되며 이는 레이아웃 별칭 기술을 사용하면 됩니다.</p>
+
+<p><code>res/values/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values/layouts.xml all}
+
+<p><code>res/values-sw600dp-land/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-land/layouts.xml
+all}
+
+<p><code>res/values-sw600dp-port/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-port/layouts.xml
+all}
+
+<p><code>res/values-large-land/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-land/layouts.xml all}
+
+<p><code>res/values-large-port/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-port/layouts.xml all}
+
+
+
+<h2 id="TaskUse9Patch">나인-패치 비트맵 사용</h2>
+
+<p>일반적으로 다양한 화면 크기를 지원하려면 이미지 리소스도 다양한 크기에 맞게 조정될 수 있어야 합니다. 예를 들어 버튼 배경은 버튼 배경이 적용되는 모든 버튼 모양과 맞아야 합니다.</p>
+
+<p>구성요소에 크기가 바뀔 수 있는 단순한 이미지를 사용하는 경우 런타임이 이미지를 균등하게 확대하거나 축소하기 때문에 기대에 미치지 못하는 결과가 나옵니다. 이에 대한 해결 방법은 확대될 수 있는 영역과 확대될 수 없는 영역을 나타내는 특별한 형식의 PNG 파일인 나인-패치 비트맵을 사용하는 것입니다.</p>
+
+<p>따라서 다양한 크기를 가진 구성요소에 사용할 비트맵을 디자인할 때에는 항상 나인-패치를 사용하시기 바랍니다. 비트맵을 나인-패치로 변환하려면 일반적인 이미지부터 시작합니다(그림 4, 명확하게 보이도록 4배 줌으로 표시).</p>
+
+<img src="{@docRoot}images/training/button.png" />
+<p class="img-caption"><strong>그림 4.</strong> <code>button.png</code></p>
+
+<p>그 다음 이 이미지에 <ode
+href="{@docRoot}tools/help/draw9patch.html">SDK의 <code>draw9patch</code></a> 유틸리티(<code>tools/</code> 디렉토리에 있음)를 실행합니다. 이 때 왼쪽 및 상단 테두리를 따라 픽셀을 그려 확대되어야 할 영역을 표시할 수 있습니다. 또한 오른쪽 및 하단 테두리를 따라 픽셀을 그려 콘텐츠가 들어가야 할 영역을 표시할 수 있으며 그 결과는 그림 5와 같습니다.</p>
+
+<img src="{@docRoot}images/training/button_with_marks.png" />
+<p class="img-caption"><strong>그림 5.</strong> <code>button.9.png</code></p>
+
+<p>테두리를 따라 있는 검은색 픽셀을 눈여겨 보시기 바랍니다. 상단 및 왼쪽 테두리의 픽셀은 이미지가 확대될 수 있는 영역을 나타내며 오른쪽 및 하단 테두리는 콘텐츠가 위치해야 하는 영역을 나타냅니다.</p>
+
+<p>또한 <code>.9.png</code> 확장자를 확인하시기 바랍니다. 프레임워크는 이 확장자를 통해 이미지가 일반적인 PNG 이미지가 아닌 나인-패치 이미지임을 감지할 수 있으므로 이 확장자를 사용해야 합니다.</p>
+
+<p><code>android:background="@drawable/button"</code>을 설정하여 이 배경을 구성요소에 적용하면 그림 6의 다양한 크기로 표시된 것처럼 프레임워크가 버튼의 크기를 수용할 수 있도록 이미지를 올바르게 확대합니다.</p>
+
+<img src="{@docRoot}images/training/buttons_stretched.png" />
+<p class="img-caption"><strong>그림 6.</strong> 다양한 크기에 <code>button.9.png</code> 나인-패치를 사용하는 버튼</p>
+
diff --git a/docs/html/intl/ru/training/monitoring-device-state/battery-monitoring.jd b/docs/html/intl/ru/training/monitoring-device-state/battery-monitoring.jd
new file mode 100644
index 0000000..26daf04
--- /dev/null
+++ b/docs/html/intl/ru/training/monitoring-device-state/battery-monitoring.jd
@@ -0,0 +1,120 @@
+page.title=Monitoring the Battery Level and Charging State
+parent.title=Optimizing Battery Life
+parent.link=index.html
+
+trainingnavtop=true
+next.title=Determining and Monitoring the Docking State and Type
+next.link=docking-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Содержание урока</h2>
+<ol>
+ <li><a href="#DetermineChargeState">Определение текущего состояния зарядки</a></li>
+ <li><a href="#MonitorChargeState">Отслеживание изменений состояния зарядки</a></li>
+ <li><a href="#CurrentLevel">Определение текущего уровня заряда батареи</a></li>
+ <li><a href="#MonitorLevel">Отслеживание существенных изменений уровня заряда батареи</a></li>
+</ol>
+
+<h2>Дополнительные материалы</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Намерения и фильтры намерений</a>
+</ul>
+
+</div>
+</div>
+
+<p>Если вы хотите изменить частоту фоновых обновлений, чтобы продлить время работы устройства от батареи, сначала рекомендуется проверить текущий уровень заряда и состояние зарядки.</p>
+
+<p>Именно от этих двух факторов зависит, как обновления повлияют на время работы устройства от батареи. Когда устройство подключено к сети переменного тока, приложение можно обновлять максимально часто, поскольку процесс обновления не будет сказываться на уровне заряда батареи. Если устройство не подключено к сети, следует воздержаться от обновлений, чтобы продлить время его работы от батареи.</p>
+
+<p>Если заряд батареи практически исчерпан, можно снизить частоту обновлений (вплоть до их полного прекращения).</p>
+
+
+<h2 id="DetermineChargeState">Определение текущего состояния зарядки</h2>
+
+<p>Начните с определения текущего состояния зарядки. {@link android.os.BatteryManager} передает все сведения о батарее и зарядке в закрепленном намерении {@link android.content.Intent}, которое содержит также информацию о состоянии зарядки.</p>
+
+<p>Поскольку это намерение является закрепленным, регистрировать {@link android.content.BroadcastReceiver} не нужно. Чтобы получить текущее состояние батареи в виде намерения, нужно вызвать {@code registerReceiver}, передав {@code null} в качестве приемника, как показано в коде ниже. Можно также передать фактический объект {@link android.content.BroadcastReceiver}, но это необязательно, поскольку обработка обновлений будет выполняться позднее.</p>
+
+<pre>IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
+Intent batteryStatus = context.registerReceiver(null, ifilter);</pre>
+
+<p>Можно извлечь данные как о текущем состоянии, так и об источнике зарядки (USB или сеть переменного тока), если устройство заряжается:<p>
+
+<pre>// Are we charging / charged?
+int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
+boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
+ status == BatteryManager.BATTERY_STATUS_FULL;
+
+// How are we charging?
+int chargePlug = battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+boolean usbCharge = chargePlug == BATTERY_PLUGGED_USB;
+boolean acCharge = chargePlug == BATTERY_PLUGGED_AC;</pre>
+
+<p>Как правило, если устройство подключено к сети переменного тока, фоновые обновления можно выполнять с максимальной частотой. Если устройство заряжается через USB, частоту можно несколько сократить, а если устройство не подключено к сети – сократить еще больше.</p>
+
+
+<h2 id="MonitorChargeState">Отслеживание изменений состояния зарядки</h2>
+
+<p>Состояние зарядки изменяется всякий раз, когда пользователь подключает устройство к источнику питания. Поскольку это случается довольно часто, важно отслеживать изменения этого состояния и соответствующим образом корректировать частоту обновления приложения.</p>
+
+<p>{@link android.os.BatteryManager} передает действие каждый раз, когда устройство подключается к источнику питания или отключается от него. Важно получать эти события, даже если приложение не работает. Они помогут, в частности, определить, как часто будет запускаться приложение для выполнения фоновых обновлений. Чтобы отслеживать их, зарегистрируйте {@link android.content.BroadcastReceiver} в манифесте, задав {@link android.content.Intent#ACTION_POWER_CONNECTED} и {@link android.content.Intent#ACTION_POWER_DISCONNECTED} в фильтре намерений.</p>
+
+<pre><receiver android:name=".PowerConnectionReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
+ <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
+ </intent-filter>
+</receiver></pre>
+
+<p>Соответствующая реализация {@link android.content.BroadcastReceiver} позволяет извлечь данные о текущем состоянии и способе зарядки, как описано в предыдущем шаге.</p>
+
+<pre>public class PowerConnectionReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
+ boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
+ status == BatteryManager.BATTERY_STATUS_FULL;
+
+ int chargePlug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+ boolean usbCharge = chargePlug == BATTERY_PLUGGED_USB;
+ boolean acCharge = chargePlug == BATTERY_PLUGGED_AC;
+ }
+}</pre>
+
+
+<h2 id="CurrentLevel">Определение текущего уровня заряда батареи</h2>
+
+<p>В некоторых случаях целесообразно определять текущий уровень заряда батареи. Если он ниже определенного значения, частоту фоновых обновлений следует уменьшить.</p>
+
+<p>Узнать, каков в настоящий момент заряд батареи, можно путем извлечения данных о текущем и максимальном уровне заряда из намерения состояния батареи, как показано в этом коде:</p>
+
+<pre>int level = battery.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
+int scale = battery.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
+
+float batteryPct = level / (float)scale;</pre>
+
+
+<h2 id="MonitorLevel">Отслеживание существенных изменений уровня заряда батареи</h2>
+
+<p>Отслеживать состояние батареи непрерывно не следует,</p>
+
+<p>поскольку при этом нагрузка на батарею будет значительно выше, чем при обычной работе приложения. Рекомендуется отслеживать только существенные изменения уровня заряда, в частности, переход устройства в состояние низкого заряда и обратно.</p>
+
+<p>Фрагмент манифеста, приведенный ниже, относится к фильтру намерений в приемнике широковещательных намерений. Приемник срабатывает, когда батарея устройства переходит в состояние низкого заряда или выходит из него. Для этого прослушиваются события {@link android.content.Intent#ACTION_BATTERY_LOW} и {@link android.content.Intent#ACTION_BATTERY_OKAY}.</p>
+
+<pre><receiver android:name=".BatteryLevelReceiver">
+<intent-filter>
+ <action android:name="android.intent.action.ACTION_BATTERY_LOW"/>
+ <action android:name="android.intent.action.ACTION_BATTERY_OKAY"/>
+ </intent-filter>
+</receiver></pre>
+
+<p>Общепринятой практикой является отключение всех фоновых обновлений, когда заряд батареи достигает критически низкого уровня. Будет уже неважно, насколько актуальны данные в вашем приложении, если телефон самопроизвольно выключится, прежде чем пользователь успеет их просмотреть.</p>
+
+<p>Во многих случаях начало зарядки устройства совпадает с моментом его установки в док-станцию. В следующем уроке описаны способы определения текущего состояния подключения устройства к док-станции и отслеживания изменений этого состояния.</p>
+
diff --git a/docs/html/intl/ru/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html/intl/ru/training/monitoring-device-state/connectivity-monitoring.jd
new file mode 100644
index 0000000..ca1a942
--- /dev/null
+++ b/docs/html/intl/ru/training/monitoring-device-state/connectivity-monitoring.jd
@@ -0,0 +1,70 @@
+page.title=Determining and Monitoring the Connectivity Status
+parent.title=Optimizing Battery Life
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=Determining and Monitoring the Docking State and Type
+previous.link=docking-monitoring.html
+next.title=Manipulating Broadcast Receivers On Demand
+next.link=manifest-receivers.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Содержание урока</h2>
+<ol>
+ <li><a href="#DetermineConnection">Определение наличия подключения к Интернету</a></li>
+ <li><a href="#DetermineType">Определение типа подключения к Интернету</a></li>
+ <li><a href="#MonitorChanges">Отслеживание изменения возможностей подключения</a></li>
+</ol>
+
+
+<h2>Дополнительные материалы</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Намерения и фильтры намерений</a>
+</ul>
+
+</div>
+</div>
+
+<p>Чаще всего повторяющиеся оповещения и фоновые службы используются для планового обновления приложения из Интернета, кэширования или загрузки больших объемов данных. Однако если подключение к Интернету не установлено или скорость соединения слишком низкая, выполнять загрузку не имеет смысла.</p>
+
+<p>Проверить наличие подключения к Интернету и его тип можно с помощью {@link android.net.ConnectivityManager}.</p>
+
+
+<h2 id="DetermineConnection">Определение наличия подключения к Интернету</h2>
+
+<p>Если подключение отсутствует, нет смысла планировать обновление из Интернета. В приведенном ниже коде показано, как использовать {@link android.net.ConnectivityManager} для отправки запросов об активной сети и определять возможности подключения.</p>
+
+<pre>ConnectivityManager cm =
+ (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
+
+NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
+boolean isConnected = activeNetwork.isConnectedOrConnecting();</pre>
+
+
+<h2 id="DetermineType">Определение типа подключения к Интернету</h2>
+
+<p>Также можно определить тип доступного в настоящий момент подключения к Интернету.</p>
+
+<p>Устройство может подключаться по сети мобильной связи, WiMAX, Wi-Fi и Ethernet. Получив ответ на запрос о типе активной сети, как показано ниже, можно изменить частоту обновлений на основе ее пропускной способности.</p>
+
+<pre>boolean isWiFi = activeNetwork.getType() == ConnectivityManager.TYPE_WIFI;</pre>
+
+<p>Стоимость передачи данных по мобильной сети, как правило, значительно выше, чем по сети Wi-Fi, поэтому частота обновлений в первом случае должна быть ниже. То же касается загрузки большого количества данных: ее следует отложить, пока не будет установлено подключение к сети Wi-Fi.</p>
+
+<p>Когда обновления отключены, необходимо отслеживать изменения доступных соединений, чтобы возобновить их сразу после подключения устройства к Интернету.</p>
+
+
+<h2 id="MonitorChanges">Отслеживание изменения возможностей подключения</h2>
+
+<p>{@link android.net.ConnectivityManager} передает действие {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION} ({@code "android.net.conn.CONNECTIVITY_CHANGE"}) при каждом изменении сведений о подключении. Зарегистрируйте в манифесте приемник широковещательных намерений, чтобы отслеживать эти изменения и запускать (или приостанавливать) фоновые обновления соответствующим образом.</p>
+
+<pre><action android:name="android.net.conn.CONNECTIVITY_CHANGE"/></pre>
+
+<p>Доступные соединения могут меняться очень часто – эта передача инициируется при каждом переключении между сетью мобильной связи и Wi-Fi. Ее рекомендуется отслеживать, только когда необходимо запускать ранее приостановленные обновления или загрузки. Как правило, достаточно проверить наличие подключения к Интернету перед запуском обновления и, если оно отсутствует, приостановить дальнейшие обновления до восстановления соединения.</p>
+
+<p>Для использования этого метода необходимо включать и отключать приемники широковещательных намерений, объявленные в манифесте. В следующем уроке описано, как это делать.</p>
diff --git a/docs/html/intl/ru/training/monitoring-device-state/docking-monitoring.jd b/docs/html/intl/ru/training/monitoring-device-state/docking-monitoring.jd
new file mode 100644
index 0000000..d94f357
--- /dev/null
+++ b/docs/html/intl/ru/training/monitoring-device-state/docking-monitoring.jd
@@ -0,0 +1,74 @@
+page.title=Determining and Monitoring the Docking State and Type
+parent.title=Optimizing Battery Life
+parent.link=index.html
+
+trainingnavtop=true
+previous.title= Monitoring the Battery Level and Charging State
+previous.link=battery-monitoring.html
+next.title= Determining and Monitoring the Connectivity Status
+next.link=connectivity-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Содержание урока</h2>
+<ol>
+ <li><a href="#CurrentDockState">Запрос аудиофокуса</a></li>
+ <li><a href="#DockType">Определение типа док-станции</a></li>
+ <li><a href="#MonitorDockState">Отслеживание изменений состояния подключения к док-станции и ее типа</a></li>
+</ol>
+
+
+<h2>Дополнительные материалы</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Намерения и фильтры намерений</a>
+</ul>
+
+</div>
+</div>
+
+<p>Устройства под управлением ОС Android можно подключать к нескольким типам док-станций: настольным, которые делятся на цифровые и аналоговые, и автомобильным. В большинстве случаев устройства заряжаются при подключении к док-станции, поэтому состояние подключения к док-станции часто связано с состоянием зарядки.</p>
+
+<p>Насколько состояние подключения к док-станции влияет на частоту обновления, зависит от конкретного приложения. Например, можно увеличить частоту обновлений приложения, показывающего спортивные новости, когда устройство подключено к настольной док-станции, и полностью отключить обновления при подключении к автомобильной. И наоборот, если используется приложение, которое в фоновом режиме загружает данные о дорожной обстановке, то при подключении устройства к автомобильной док-станции следует выполнять обновления максимально часто.</p>
+
+<p>Состояние подключения к док-станции также передается в виде закрепленного намерения {@link android.content.Intent}, что позволяет запрашивать сведения о наличии подключения к док-станции и ее типе.</p>
+
+
+<h2 id="CurrentDockState">Определение текущего состояния подключения к док-станции</h2>
+
+<p>Сведения о состоянии подключения к док-станции передаются в качестве дополнительных данных в закрепленном оповещении действия {@link android.content.Intent#ACTION_DOCK_EVENT}. Поскольку это закрепленное намерение, регистрировать {@link android.content.BroadcastReceiver} не требуется. Достаточно вызвать {@link android.content.Context#registerReceiver registerReceiver()}, передав {@code null} в качестве приемника широковещательных намерений, как показано в коде ниже.</p>
+
+<pre>IntentFilter ifilter = new IntentFilter(Intent.ACTION_DOCK_EVENT);
+Intent dockStatus = context.registerReceiver(null, ifilter);</pre>
+
+<p>Сведения о текущем состоянии подключения к док-станции можно извлечь из дополнительных данных {@code EXTRA_DOCK_STATE}:<p>
+
+<pre>int dockState = battery.getIntExtra(EXTRA_DOCK_STATE, -1);
+boolean isDocked = dockState != Intent.EXTRA_DOCK_STATE_UNDOCKED;</pre>
+
+
+<h2 id="DockType">Определение типа док-станции</h2>
+
+<p>Док-станция, к которой подключено устройство, может быть одного из четырех типов:
+<ul><li>автомобильная;</li>
+<li>настольная;</li>
+<li>настольная с минимальным набором функций (аналоговая);</li>
+<li>настольная с широким набором функций (цифровая).</li></ul></p>
+
+<p>Обратите внимание, что последние два типа поддерживаются только на уровне API 11, поэтому, даже если вас не интересует, является ли док-станция цифровой или аналоговой, а интересует только ее тип, рекомендуется выполнять проверку по всем трем типам:</p>
+
+<pre>boolean isCar = dockState == EXTRA_DOCK_STATE_CAR;
+boolean isDesk = dockState == EXTRA_DOCK_STATE_DESK ||
+ dockState == EXTRA_DOCK_STATE_LE_DESK ||
+ dockState == EXTRA_DOCK_STATE_HE_DESK;</pre>
+
+
+<h2 id="MonitorDockState">Отслеживание изменений состояния подключения к док-станции и ее типа</h2>
+
+<p>При каждом подключении устройства к док-станции или отключении от нее передается действие {@link android.content.Intent#ACTION_DOCK_EVENT}. Чтобы отслеживать состояние подключения к док-станции, достаточно зарегистрировать в манифесте приложения приемник широковещательных намерений, как показано ниже.</p>
+
+<pre><action android:name="android.intent.action.ACTION_DOCK_EVENT"/></pre>
+
+<p>Данные о типе док-станции и о состоянии подключения к ней можно извлечь внутри реализации приемника с помощью методов, описанных в предыдущем шаге.</p>
diff --git a/docs/html/intl/ru/training/monitoring-device-state/index.jd b/docs/html/intl/ru/training/monitoring-device-state/index.jd
new file mode 100644
index 0000000..c87d9af
--- /dev/null
+++ b/docs/html/intl/ru/training/monitoring-device-state/index.jd
@@ -0,0 +1,49 @@
+page.title=Optimizing Battery Life
+
+trainingnavtop=true
+startpage=true
+next.title=Monitoring the Battery Level and Charging State
+next.link=battery-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Требования</h2>
+<ul>
+ <li>Android 2.0 (API уровня 5) или более поздней версии</li>
+ <li>Опыт работы с <a href="{@docRoot}guide/components/intents-filters.html">намерениями и фильтрами намерений</a></li>
+</ul>
+
+<h2>Дополнительные материалы</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/services.html">Службы</a>
+</ul>
+
+</div>
+</div>
+
+<p>Качественное приложение должно оказывать минимальное влияние на время работы устройства от батареи. В этом уроке вы научитесь создавать приложения, способные изменять функционал и режим работы в зависимости от состояния устройства.</p>
+
+<p>Отключение обновления данных фоновых служб при потере подключения и снижение частоты обновления при низком заряде батареи позволяет снизить расход энергии и продлить работу устройства без подзарядки.</p>
+
+<h2>Уроки</h2>
+
+<!-- Create a list of the lessons in this class along with a short description of each lesson.
+These should be short and to the point. It should be clear from reading the summary whether someone
+will want to jump to a lesson or not.-->
+
+<dl>
+ <dt><b><a href="battery-monitoring.html">Отслеживание уровня заряда батареи и состояния зарядки</a></b></dt>
+ <dd>Вы узнаете, как изменять частоту обновления приложения, определяя и отслеживая текущий уровень заряда батареи и изменение состояния зарядки.</dd>
+
+ <dt><b><a href="docking-monitoring.html">Отслеживание состояния подключения к док-станции и определение ее типа</a></b></dt>
+ <dd>Оптимальная частота обновления зависит от способа использования устройства. Вы узнаете, как определять и отслеживать состояние подключения к док-станции и ее тип, чтобы соответствующим образом корректировать работу приложения.</dd>
+
+ <dt><b><a href="connectivity-monitoring.html">Определение и отслеживание состояния подключения</a></b></dt>
+ <dd>Приложение невозможно обновить через Интернет, если отсутствует подключение. Вы узнаете, как проверить состояние подключения, чтобы при необходимости изменить частоту фоновых обновлений. Также вы научитесь проверять наличие мобильного подключения или подключения по сети Wi-Fi перед началом операций, требующих передачи больших объемов данных.</dd>
+
+ <dt><b><a href="manifest-receivers.html">Операции с приемниками широковещательных намерений по запросу</a></b></dt>
+ <dd>Приемники широковещательных намерений, объявленные в манифесте, можно включать и отключать во время работы приложения. Это позволяет отключать ненужные приемники в зависимости от состояния устройства. Вы узнаете, как повысить эффективность путем включения, отключения или каскадирования приемников изменения состояния и как отложить действие до момента перехода устройства в заданное состояние.</dd>
+</dl>
\ No newline at end of file
diff --git a/docs/html/intl/ru/training/monitoring-device-state/manifest-receivers.jd b/docs/html/intl/ru/training/monitoring-device-state/manifest-receivers.jd
new file mode 100644
index 0000000..724ee93
--- /dev/null
+++ b/docs/html/intl/ru/training/monitoring-device-state/manifest-receivers.jd
@@ -0,0 +1,50 @@
+page.title=Manipulating Broadcast Receivers On Demand
+parent.title=Optimizing Battery Life
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=Determining and Monitoring the Connectivity Status
+previous.link=connectivity-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Содержание урока</h2>
+<ol>
+ <li><a href="#ToggleReceivers">Включение, отключение и каскадирование приемников изменения состояния для повышения эффективности</a></li>
+</ol>
+
+
+<h2>Дополнительные материалы</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Намерения и фильтры намерений</a>
+</ul>
+
+</div>
+</div>
+
+<p>Самый простой способ отслеживать изменения состояния устройства – создать приемники {@link android.content.BroadcastReceiver} для каждого отслеживаемого состояния и зарегистрировать их в манифесте приложения. Затем в каждом из этих приемников можно переопределять график повторяющихся оповещений в зависимости от текущего состояния устройства.</p>
+
+<p>Этот способ имеет недостатки: приложение активирует устройство при каждом запуске любого из этих приемников, что далеко не всегда оправданно.</p>
+
+<p>Оптимальный вариант – включать и выключать приемники широковещательных намерений во время работы приложения. Это позволяет использовать приемники, объявленные в манифесте, как пассивные оповещения, которые инициируются системными событиями только в случае необходимости.</p>
+
+
+<h2 id="ToggleReceivers">Включение, отключение и каскадирование приемников изменения состояния для повышения эффективности </h2>
+
+<p>{@link android.content.pm.PackageManager} позволяет включать и выключать любые компоненты, определенные в манифесте, в том числе все приемники широковещательных намерений:</p>
+
+<pre>ComponentName receiver = new ComponentName(context, myReceiver.class);
+
+PackageManager pm = context.getPackageManager();
+
+pm.setComponentEnabledSetting(receiver,
+ PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
+ PackageManager.DONT_KILL_APP)</pre>
+
+<p>При разрыве соединения этот метод позволяет выключить все приемники, кроме приемника изменения состояния подключения. И наоборот, когда подключение уже установлено, отслеживать изменения его состояния не требуется. Достаточно проверить наличие подключения к Интернету непосредственно перед обновлением или изменением графика оповещений о регулярном обновлении.</p>
+
+<p>Точно так же можно отложить загрузку, для выполнения которой требуется более высокая пропускная способность. Просто включите приемник широковещательных намерений, который будет отслеживать изменения возможности подключения и инициировать загрузку только после подключения к сети Wi-Fi.</p>
diff --git a/docs/html/intl/ru/training/multiscreen/adaptui.jd b/docs/html/intl/ru/training/multiscreen/adaptui.jd
new file mode 100644
index 0000000..490a64a
--- /dev/null
+++ b/docs/html/intl/ru/training/multiscreen/adaptui.jd
@@ -0,0 +1,212 @@
+page.title=Implementing Adaptative UI Flows
+parent.title=Designing for Multiple Screens
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Supporting Different Screen Densities
+previous.link=screendensities.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Содержание урока</h2>
+
+<ol>
+ <li><a href="#TaskDetermineCurLayout">Определение текущего макета</a></li>
+ <li><a href="#TaskReactToLayout">Дальнейшие действия в зависимости от текущего макета</a></li>
+ <li><a href="#TaskReuseFrag">Повторное использование фрагментов в других активностях</a></li>
+ <li><a href="#TaskHandleConfigChanges">Обработка изменений конфигурации экрана</a></li>
+</ol>
+
+<h2>Дополнительные материалы</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">Поддержка планшетных ПК и мобильных телефонов</a></li>
+</ul>
+
+<h2>Упражнение</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Загрузить учебное приложение</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+
+</div>
+</div>
+
+<p>Алгоритм пользовательского интерфейса зависит от макета, который в данный момент отображается. Например, если приложение работает в двухпанельном режиме, то при нажатии на элемент в левой панели содержание отобразится в правой. В однопанельном режиме содержание откроется отдельно (в другой активности).</p>
+
+
+<h2 id="TaskDetermineCurLayout">Определение текущего макета</h2>
+
+<p>Так как в реализации макетов существуют отличия, первое, что необходимо сделать, – определить, какой макет отображается в данный момент. Например, работает ли приложение в однопанельном или двухпанельном режиме. Для этого создадим запрос о том, существует ли данное представление и отображается ли оно в настоящий момент:</p>
+
+<pre class="prettyprint">
+public class NewsReaderActivity extends FragmentActivity {
+ boolean mIsDualPane;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main_layout);
+
+ View articleView = findViewById(R.id.article);
+ mIsDualPane = articleView != null &&
+ articleView.getVisibility() == View.VISIBLE;
+ }
+}
+</pre>
+
+<p>Обратите внимание: представленный выше код содержит запрос о том, доступна ли панель article, поскольку это удобнее, чем писать отдельные запросы для каждого макета.</p>
+
+<p>Кроме того, для работы с учетом существующих компонентов можно также проверять их доступность, прежде чем выполнять с ними какие-либо операции. Например, в учебном приложении News Reader есть кнопка, которая служит для доступа в меню, однако она отображается только в операционных системах Android версии ниже, чем 3.0, потому что в последующих версиях ее функцию выполняет элемент <PH>{@link android.app.ActionBar}</PH> на уровне API 11 и выше. Чтобы проверить наличие этой кнопки, добавим прослушиватель событий с помощью следующего кода:</p>
+
+<pre class="prettyprint">
+Button catButton = (Button) findViewById(R.id.categorybutton);
+OnClickListener listener = /* create your listener here */;
+if (catButton != null) {
+ catButton.setOnClickListener(listener);
+}
+</pre>
+
+
+<h2 id="TaskReactToLayout">Дальнейшие действия в зависимости от текущего макета</h2>
+
+<p>Результаты некоторых операций зависят от текущего макета. Например, если в приложении News Reader в двухпанельном режиме нажать на заголовок в списке, то статья откроется в правой панели. Если же интерфейс работает в однопанельном режиме, будет запущена отдельная активность:</p>
+
+<pre>
+@Override
+public void onHeadlineSelected(int index) {
+ mArtIndex = index;
+ if (mIsDualPane) {
+ /* display article on the right pane */
+ mArticleFragment.displayArticle(mCurrentCat.getArticle(index));
+ } else {
+ /* start a separate activity */
+ Intent intent = new Intent(this, ArticleActivity.class);
+ intent.putExtra("catIndex", mCatIndex);
+ intent.putExtra("artIndex", index);
+ startActivity(intent);
+ }
+}
+</pre>
+
+<p>Аналогично, в двухпанельном режиме должна отображаться панель действий с навигационными вкладками, а в однопанельном навигация должна быть реализована с помощью раскрывающегося списка. Приложение должно проверять, какой из этих вариантов следует использовать:</p>
+
+<pre>
+final String CATEGORIES[] = { "Лучшие статьи", "Политика", "Экономика", "Новости технологий" };
+
+public void onCreate(Bundle savedInstanceState) {
+ ....
+ if (mIsDualPane) {
+ /* use tabs for navigation */
+ actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_TABS);
+ int i;
+ for (i = 0; i < CATEGORIES.length; i++) {
+ actionBar.addTab(actionBar.newTab().setText(
+ CATEGORIES[i]).setTabListener(handler));
+ }
+ actionBar.setSelectedNavigationItem(selTab);
+ }
+ else {
+ /* use list navigation (spinner) */
+ actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_LIST);
+ SpinnerAdapter adap = new ArrayAdapter<String>(this,
+ R.layout.headline_item, CATEGORIES);
+ actionBar.setListNavigationCallbacks(adap, handler);
+ }
+}
+</pre>
+
+
+<h2 id="TaskReuseFrag">Повторное использование фрагментов в других активностях</h2>
+
+<p>Одним из примеров повторяющегося фрагмента является реализация части интерфейса как панели в одних конфигурациях и как отдельной активности в других. Например, если приложение News Reader работает на достаточно большом экране, текст новостной статьи отображается в правой панели, а если на маленьком, то он открывается в отдельной активности.</p>
+
+<p>В таких случаях следует повторно использовать подкласс <PH>{@link android.app.Fragment}</PH> в нескольких активностях. Например, в двухпанельном макете используется подкласс <code>ArticleFragment</code>:</p>
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+
+<p>Он же (без макета) используется при работе на маленьком экране (активность <code>ArticleActivity</code>):</p>
+
+<pre>
+ArticleFragment frag = new ArticleFragment();
+getSupportFragmentManager().beginTransaction().add(android.R.id.content, frag).commit();
+</pre>
+
+<p>Результат будет таким же, как если бы мы объявили фрагмент в макете XML, однако в этом случае макет XML не требуется, так как фрагмент article является единственным компонентом этой активности.</p>
+
+<p>При создании фрагментов важно не привязывать их строго к конкретной активности. Для этого можно определить интерфейс с абстрактным описанием всех необходимых способов взаимодействия фрагмента с активностью, в которой он содержится. Затем этот интерфейс нужно реализовать в самой активности.</p>
+
+<p>Например, именно так работает фрагмент <code>HeadlinesFragment</code> в приложении News Reader:</p>
+
+<pre>
+public class HeadlinesFragment extends ListFragment {
+ ...
+ OnHeadlineSelectedListener mHeadlineSelectedListener = null;
+
+ /* Must be implemented by host activity */
+ public interface OnHeadlineSelectedListener {
+ public void onHeadlineSelected(int index);
+ }
+ ...
+
+ public void setOnHeadlineSelectedListener(OnHeadlineSelectedListener listener) {
+ mHeadlineSelectedListener = listener;
+ }
+}
+</pre>
+
+<p>Затем, когда пользователь выбирает заголовок, фрагмент оповещает об этом не указанную в коде активность, а заданный ею прослушиватель:</p>
+
+<pre>
+public class HeadlinesFragment extends ListFragment {
+ ...
+ @Override
+ public void onItemClick(AdapterView<?> parent,
+ View view, int position, long id) {
+ if (null != mHeadlineSelectedListener) {
+ mHeadlineSelectedListener.onHeadlineSelected(position);
+ }
+ }
+ ...
+}
+</pre>
+
+<p>Этот метод рассматривается подробнее в разделе <a
+href="{@docRoot}guide/practices/tablets-and-handsets.html">Поддержка планшетных ПК и мобильных телефонов</a>.</p>
+
+
+<h2 id="TaskHandleConfigChanges">Обработка изменений конфигурации экрана</h2>
+
+<p>При реализации отдельных частей интерфейса с помощью разных активностей нужно учитывать, что интерфейс должен уметь реагировать на определенные изменения конфигурации, такие как поворот экрана.</p>
+
+<p>Например, на типичном планшетном ПК с размером экрана 7 дюймов под управлением ОС Android 3.0 или более поздней версии при вертикальной ориентации статья в приложении News Reader открывается с помощью отдельной активности, а при горизонтальной используется двухпанельный макет.</p>
+
+<p>Это означает, что если пользователь держит планшетный ПК вертикально и на экране запущена активность для просмотра статьи, приложение должно уметь определить, что ориентация была изменена на горизонтальную. Затем оно должно соответствующим образом отреагировать на изменение, то есть завершить эту активность и вернуться к основной активности, чтобы содержание отобразилось в двухпанельном макете:</p>
+
+<pre>
+public class ArticleActivity extends FragmentActivity {
+ int mCatIndex, mArtIndex;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mCatIndex = getIntent().getExtras().getInt("catIndex", 0);
+ mArtIndex = getIntent().getExtras().getInt("artIndex", 0);
+
+ // If should be in two-pane mode, finish to return to main activity
+ if (getResources().getBoolean(R.bool.has_two_panes)) {
+ finish();
+ return;
+ }
+ ...
+}
+</pre>
+
+
diff --git a/docs/html/intl/ru/training/multiscreen/index.jd b/docs/html/intl/ru/training/multiscreen/index.jd
new file mode 100644
index 0000000..023eaec
--- /dev/null
+++ b/docs/html/intl/ru/training/multiscreen/index.jd
@@ -0,0 +1,64 @@
+page.title=Designing for Multiple Screens
+
+trainingnavtop=true
+startpage=true
+next.title=Supporting Different Screen Sizes
+next.link=screensizes.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Требования</h2>
+
+<ul>
+ <li>Android 1.6 или более поздней версии (для запуска учебного приложения требуется версия 2.1 или более поздняя)</li>
+ <li>Начальные знания о компонентах <a
+href="http://developer.android.com/guide/components/activities.html">Activity</a> (активность) и <a href="http://developer.android.com/guide/components/fragments.html">Fragment</a> (фрагмент)</li>
+ <li>Опыт создания <a
+href="http://developer.android.com/guide/topics/ui/index.html">пользовательских интерфейсов</a> для Android</li>
+ <li>Некоторые функции требуют использования <a
+href="{@docRoot}tools/extras/support-library.html">вспомогательной библиотеки</a></li>
+</ul>
+
+<h2>Дополнительные материалы</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">Поддержка нескольких экранов</a></li>
+</ul>
+
+<h2>Упражнение</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Загрузить учебное приложение</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>На платформе Android работают устройства с самыми разными размерами экрана: от телефонов до телевизоров. Чтобы с вашим приложением могли работать как можно больше пользователей, оно должно корректно отображаться на всех этих устройствах.</p>
+
+<p>Однако совместимость с разными типами устройств – это еще не все. От размера экрана зависит, какие возможности будет иметь пользователь при работе с приложением. Чтобы пользователи действительно остались довольны вашим приложением, оно должно не просто <em>поддерживать</em> разные экраны, но и быть <em>оптимизировано</em> для каждого из них.</p>
+
+<p>Этот модуль посвящен реализации пользовательского интерфейса, оптимизированного для разных конфигураций экрана.</p>
+
+<p>Код, приведенный в каждом уроке, взят из учебного приложения, в котором демонстрируются способы оптимизации для разных экранов. Вы можете загрузить его (в правой части экрана) и использовать части кода в собственном приложении.</p>
+
+<p class="note"><strong>Примечание</strong>. В этом модуле и в учебном приложении используется <a
+href="{@docRoot}tools/extras/support-library.html">вспомогательная библиотека</a>, позволяющая работать с API <PH>{@link android.app.Fragment}</PH> в версиях до Android 3.0. Чтобы иметь возможность использовать все необходимые API, загрузите библиотеку и добавьте ее в свое приложение.</p>
+
+
+<h2>Уроки</h2>
+
+<dl>
+ <dt><b><a href="screensizes.html">Поддержка разных размеров экрана</a></b></dt>
+ <dd>В этом уроке рассказывается, как создать макет, который адаптируется к разным размерам экрана, используя масштабируемые представления, объекты <PH>{@link android.widget.RelativeLayout}</PH>, квалификаторы размера и ориентации, фильтры псевдонимов и растровые изображений формата nine-patch.</dd>
+
+ <dt><b><a href="screendensities.html">Поддержка разных разрешений экрана</a></b></dt>
+ <dd>В этом уроке рассказывается, как работать с экранами разного разрешения с помощью не зависящих от разрешения пикселей и как подготовить растровые изображения для каждого из них.</dd>
+
+ <dt><b><a href="adaptui.html">Реализация адаптируемых алгоритмов работы пользовательского интерфейса</a></b></dt>
+ <dd>В этом уроке рассказывается, как реализовать алгоритм работы интерфейса, адаптирующийся к размеру и разрешению экрана, то есть способный определять активный макет во время выполнения приложения, выбирать дальнейшие действия на основе текущего макета и обрабатывать изменения конфигурации экрана.</dd>
+</dl>
diff --git a/docs/html/intl/ru/training/multiscreen/screendensities.jd b/docs/html/intl/ru/training/multiscreen/screendensities.jd
new file mode 100644
index 0000000..cfd4724
--- /dev/null
+++ b/docs/html/intl/ru/training/multiscreen/screendensities.jd
@@ -0,0 +1,100 @@
+page.title=Supporting Different Densities
+parent.title=Designing for Multiple Screens
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Supporting Different Screen Sizes
+previous.link=screensizes.html
+next.title=Implementing Adaptative UI Flows
+next.link=adaptui.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Содержание урока</h2>
+<ol>
+ <li><a href="#TaskUseDP">Использование пикселей, не зависящих от разрешения</a></li>
+ <li><a href="#TaskProvideAltBmp">Предоставление альтернативных растровых изображений</a></li>
+</ol>
+
+<h2>Дополнительные материалы</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">Поддержка нескольких экранов</a></li>
+ <li><a href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">Рекомендации по созданию значков</a></li>
+</ul>
+
+<h2>Упражнение</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Загрузить учебное приложение</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+
+</div>
+</div>
+
+<p>В этом уроке рассказывается, как создать интерфейс, поддерживающий разные разрешения экрана, за счет использования разных ресурсов и не зависящих от разрешения единиц измерения.</p>
+
+<h2 id="TaskUseDP">Использование пикселей, не зависящих от разрешения</h2>
+
+<p>Разработчики часто допускают одну и ту же ошибку при создании макетов – указывают размеры и расстояния с помощью абсолютных значений в пикселях. Задавать размеры в пикселях не рекомендуется, поскольку из-за различной плотности пикселей на экранах разных устройств фактический размер макета будет неодинаков. Всегда задавайте размеры в единицах <code>dp</code> или <code>sp</code>. <code>dp</code> – это не зависящий от разрешения пиксель, равный физическому пикселю на экране с плотностью 160 точек/дюйм. <code>sp</code> является аналогичной единицей измерения, но масштабируется на основе выбранного пользователем размера текста, поэтому ее следует применять для указания величины шрифта, но не размера макета.</p>
+
+<p>Например, если вы задаете расстояние между двумя представлениями, рекомендуется использовать <code>dp</code>, а не <code>px</code>:</p>
+
+<pre>
+<Button android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/clickme"
+ android:layout_marginTop="20dp" />
+</pre>
+
+<p>Для определения размера шрифта всегда используйте <code>sp</code>:</p>
+
+<pre>
+<TextView android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="20sp" />
+</pre>
+
+
+<h2 id="TaskProvideAltBmp">Предоставление альтернативных растровых изображений</h2>
+
+<p>Так как платформа Android предназначена для устройств с разными разрешениями экрана, необходимо позаботиться о наличии растровых изображений для каждого из четырех обобщенных типов разрешения: низкого, среднего, высокого и очень высокого. Это обеспечит оптимальное сочетание качества графики и производительности на всех устройствах.</p>
+
+<p>На основе исходного векторного рисунка создайте растровые изображения для каждого из указанных разрешений согласно следующей шкале размеров:</p>
+
+<p><ul>
+ <li><code>xhdpi</code>: 2,0
+ <li><code>hdpi</code>: 1,5
+ <li><code>mdpi</code>: 1,0 (стандартный размер)
+ <li><code>ldpi</code>: 0,75
+</ul></p>
+
+<p>Это означает, что изображение, которое на устройствах с разрешением экрана <code>xhdpi</code> имеет размер 200 x 200, на устройствах <code>hdpi</code> должно иметь размер 150 x 150, на устройствах <code>mdpi</code> – 100 x 100, а на устройствах <code>ldpi</code> – 75 x 75.</p>
+
+<p>Поместите файлы изображений в соответствующие подкаталоги в папке <code>res/</code>, и система автоматически выберет подходящий в зависимости от разрешения экрана устройства, на котором выполняется приложение:</p>
+
+<pre class="classic no-pretty-print">
+MyProject/
+ res/
+ drawable-xhdpi/
+ awesomeimage.png
+ drawable-hdpi/
+ awesomeimage.png
+ drawable-mdpi/
+ awesomeimage.png
+ drawable-ldpi/
+ awesomeimage.png
+</pre>
+
+<p>При каждом обращении к файлу <code>@drawable/awesomeimage</code> система будет выбирать изображение, отвечающее разрешению экрана.</p>
+
+<p>Дополнительную информацию и советы можно найти в разделе <a
+href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">Рекомендации по созданию значков</a>.</p>
+
diff --git a/docs/html/intl/ru/training/multiscreen/screensizes.jd b/docs/html/intl/ru/training/multiscreen/screensizes.jd
new file mode 100644
index 0000000..9684d77
--- /dev/null
+++ b/docs/html/intl/ru/training/multiscreen/screensizes.jd
@@ -0,0 +1,279 @@
+page.title=Supporting Different Screen Sizes
+parent.title=Designing for Multiple Screens
+parent.link=index.html
+
+trainingnavtop=true
+next.title=Supporting Different Screen Densities
+next.link=screendensities.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Содержание урока</h2>
+<ol>
+ <li><a href="#TaskUseWrapMatchPar">Использование параметров wrap_content и match_parent</a></li>
+ <li><a href="#TaskUseRelativeLayout">Использование объекта RelativeLayout</a></li>
+ <li><a href="#TaskUseSizeQuali">Использование квалификаторов размера</a></li>
+ <li><a href="#TaskUseSWQuali">Использование квалификатора Smallest-width</a></li>
+ <li><a href="#TaskUseAliasFilters">Использование псевдонимов макетов</a></li>
+ <li><a href="#TaskUseOriQuali">Использование квалификаторов ориентации</a></li>
+ <li><a href="#TaskUse9Patch">Использование растровых изображений nine-patch</a></li>
+</ol>
+
+<h2>Дополнительные материалы</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">Поддержка нескольких экранов</a></li>
+</ul>
+
+<h2>Упражнение</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Загрузить учебное приложение</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>В этом уроке описаны следующие аспекты обеспечения совместимости интерфейса с разными экранами:</p>
+<ul>
+ <li>обеспечение способности макета адаптироваться к размеру экрана;</li>
+ <li>выбор макета интерфейса, отвечающего конфигурации экрана;</li>
+ <li>контроль правильности применяемого макета;</li>
+ <li>использование масштабируемых растровых изображений.</li>
+</ul>
+
+
+<h2 id="TaskUseWrapMatchPar">Использование параметров wrap_content и match_parent</h2>
+
+<p>Чтобы создать масштабируемый макет, способный адаптироваться к разным экранам, используйте в качестве значений ширины и высоты отдельных компонентов представления параметры <code>"wrap_content"</code> и <code>"match_parent"</code>. Если используется <code>"wrap_content"</code>, для ширины или высоты представления устанавливается минимальное значение, позволяющее уместить содержание на экран, а параметр <code>"match_parent"</code> (известный как <code>"fill_parent"</code> в API до 8 уровня) служит для растягивания компонента по размеру родительского представления.</p>
+
+<p>Если указать параметры <code>"wrap_content"</code> и <code>"match_parent"</code> вместо строго заданных размеров, в представлениях будет использоваться минимально необходимое место или они будут растягиваться на всю доступную длину и ширину соответственно. Например:</p>
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane_with_bar.xml all}
+
+<p>Обратите внимание на то, что в коде учебного приложения размеры компонентов заданы с помощью параметров <code>"wrap_content"</code> и <code>"match_parent"</code>. В результате макет правильно отображается на экранах разных размеров при разных ориентациях.</p>
+
+<p>Например, вот так он выглядит в вертикальной и горизонтальной ориентациях. Обратите внимание на то, как размеры компонентов автоматически адаптируются к длине и ширине:</p>
+
+<img src="{@docRoot}images/training/layout-hvga.png" />
+<p class="img-caption"><strong>Рисунок 1</strong>. Приложение News Reader при вертикальной (слева) и горизонтальной (справа) ориентации.</p>
+
+
+<h2 id="TaskUseRelativeLayout">Использование объекта RelativeLayout</h2>
+
+<p>С помощью вложенных экземпляров объекта <PH>{@link android.widget.LinearLayout}</PH> и параметров <code>"wrap_content"</code> и <code>"match_parent"</code> можно создавать достаточно сложные макеты. Однако <PH>{@link android.widget.LinearLayout}</PH> не дает возможности точно управлять взаимным расположением дочерних представлений: в <PH>{@link android.widget.LinearLayout}</PH> они просто помещаются в ряд друг за другом. Если необходимо расположить дочерние представления иным образом, используйте объект <PH>{@link android.widget.RelativeLayout}</PH>, позволяющий задать относительные позиции компонентов. Например, одно дочернее представление можно выровнять по левому краю экрана, а другое – по правому.</p>
+
+<p>Например:</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:id="@+id/label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Type here:"/>
+ <EditText
+ android:id="@+id/entry"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/label"/>
+ <Button
+ android:id="@+id/ok"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/entry"
+ android:layout_alignParentRight="true"
+ android:layout_marginLeft="10dp"
+ android:text="OK" />
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toLeftOf="@id/ok"
+ android:layout_alignTop="@id/ok"
+ android:text="Cancel" />
+</RelativeLayout>
+</pre>
+
+<p>На рис. 2 показано, как этот макет выглядит на экране QVGA.</p>
+
+<img src="{@docRoot}images/training/relativelayout1.png" />
+<p class="img-caption"><strong>Рисунок 2</strong>. Скриншот экрана QVGA (маленького размера).</p>
+
+<p>На рис. 3 показано, как он выглядит на экране с большей диагональю.</p>
+
+<img src="{@docRoot}images/training/relativelayout2.png" />
+<p class="img-caption"><strong>Рисунок 3</strong>. Скриншот экрана WSVGA (большего размера).</p>
+
+<p>Обратите внимание: несмотря на изменение размера компонентов их взаимное расположение остается прежним, так как оно задано объектом <PH>{@link android.widget.RelativeLayout.LayoutParams}</PH>.</p>
+
+
+<h2 id="TaskUseSizeQuali">Использование квалификаторов размера</h2>
+
+<p>Масштабируемые или относительные макеты, один из которых продемонстрирован выше, имеют свои ограничения. Хотя они позволяют создать интерфейс, способный адаптироваться к разным экранам за счет растягивания пространства внутри и вокруг компонентов, пользователю может оказаться не слишком удобно работать с таким интерфейсом. Поэтому в приложении должен использоваться не один масштабируемый макет, а несколько альтернативных вариантов для разных конфигураций экрана. Их можно создать с помощью <a href="http://developer.android.com/guide/practices/screens_support.html#qualifiers">квалификаторов конфигураций</a>, которые позволяют оперативно выбирать ресурсы, отвечающие текущим параметрам экрана (например, разные варианты макетов для экранов разных размеров).</p>
+
+<p>Многие приложения отображаются на больших экранах в двухпанельном режиме, при котором список элементов расположен в одной панели, а их содержание открывается в другой. Такой режим просмотра удобен на достаточно больших экранах планшетных ПК и телевизоров, однако на экране телефона эти панели следует отображать по отдельности. Для каждого режима просмотра нужно создать отдельный файл.</p>
+
+<ul>
+ <li><code>res/layout/main.xml</code>, однопанельный макет (по умолчанию):
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+</li>
+ <li><code>res/layout-large/main.xml</code>, двухпанельный макет:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+</li>
+</ul>
+
+<p>Обратите внимание, что во втором случае в названии каталога использован квалификатор <code>large</code>. Этот макет будет выбран на устройствах, экраны которых считаются большими (например, 7 дюймов и более). Первый макет (без квалификаторов) будет выбран для устройств с маленьким экраном.</p>
+
+
+<h2 id="TaskUseSWQuali">Использование квалификатора Smallest-width</h2>
+
+<p>Одной из проблем, с которой сталкивались разработчики приложений для устройств Android версий до 3.2, было слишком общее определение "большого" экрана. Это касалось устройств Dell Streak, первой модели Galaxy Tab и планшетных ПК с экраном размером 7 дюймов. Многие приложения требовалось по-разному отображать на разных устройствах (например, с 5- и 7-дюймовыми экранами), хотя они и относились к одной категории "больших" экранов. В Android версии 3.2 и более поздних доступен квалификатор Smallest-width.</p>
+
+<p>Он позволяет определять экраны с заданной минимальной шириной в dp. Например, типичный планшетный ПК с экраном 7 дюймов имеет минимальную ширину 600 dp, и если вы хотите, чтобы приложение работало на нем в двухпанельном режиме (а на меньших экранах в однопанельном), используйте два макета из предыдущего раздела, но вместо квалификатора размера <code>large</code> укажите <code>sw600dp</code>. В таком случае на экранах, минимальная ширина которых составляет 600 dp, будет использоваться двухпанельный макет.</p>
+
+<ul>
+ <li><code>res/layout/main.xml</code>, однопанельный макет (по умолчанию):
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+</li>
+ <li><code>res/layout-sw600dp/main.xml</code>, двухпанельный макет:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+</li>
+</ul>
+
+<p>Это означает, что на устройствах, минимальная ширина экрана которых не меньше 600 dp, будет выбран <code>layout-sw600dp/main.xml</code> (двухпанельный макет), а на экранах меньшего размера – <code>layout/main.xml</code> (однопанельный макет).</p>
+
+<p>Следует учесть, что на Android-устройствах до версии 3.2 квалификатор <code>sw600dp</code> не будет работать, поэтому для них по-прежнему нужно использовать <code>large</code>. Таким образом, вам потребуется еще один файл с названием <code>res/layout-large/main.xml</code>, идентичный файлу <code>res/layout-sw600dp/main.xml</code>. В следующем разделе вы познакомитесь с методом, который позволяет избежать дублирования таких файлов макета.</p>
+
+
+<h2 id="TaskUseAliasFilters">Использование псевдонимов макетов</h2>
+
+<p>Квалификатор Smallest-width работает только на устройствах Android 3.2 или более поздних версий. Для совместимости с более ранними устройствами по-прежнему следует использовать абстрактные размеры (small, normal, large и xlarge). Например, чтобы интерфейс открывался в однопанельном режиме на телефонах и в многопанельном на планшетных ПК с 7-дюймовым экраном, телевизорах и других крупных устройствах, подготовьте следующие файлы:</p>
+
+<p><ul>
+<li><code>res/layout/main.xml:</code> однопанельный макет;</li>
+<li><code>res/layout-large:</code> многопанельный макет;</li>
+<li><code>res/layout-sw600dp:</code> многопанельный макет.</li>
+</ul></p>
+
+<p>Последние два файла идентичны: один из них предназначен для устройств Android 3.2 и новее, а второй для более старых планшетных ПК и телевизоров на платформе Android.</p>
+
+<p>Чтобы не создавать дубликаты файлов и упростить процесс поддержки приложения, используйте псевдонимы. Например, можно определить следующие макеты:</p>
+
+<ul>
+<li><code>res/layout/main.xml</code> (однопанельный макет);</li>
+<li><code>res/layout/main_twopanes.xml</code> (двухпанельный макет).</li>
+</ul>
+
+<p>Затем добавьте следующие два файла:</p>
+
+<p><ul>
+<li><code>res/values-large/layout.xml</code>:
+<pre>
+<resources>
+ <item name="main" type="layout">@layout/main_twopanes</item>
+</resources>
+</pre>
+</li>
+
+<li><code>res/values-sw600dp/layout.xml</code>:
+<pre>
+<resources>
+ <item name="main" type="layout">@layout/main_twopanes</item>
+</resources>
+</pre>
+
+</li>
+</ul></p>
+
+<p>Содержание последних двух файлов одинаково, но сами по себе они не определяют макет. Они служат для того, чтобы назначить файл <PH>{@code main}</PH> в качестве псевдонима <PH>{@code main_twopanes}</PH>. Так как в них используются селекторы <code>large</code> и <code>sw600dp</code>, они применяются к планшетным ПК и телевизорам на платформе Android независимо от версии (для версий до 3.2 используется
+<PH>{@code large}</PH>, а для более новых – <code>sw600dp</code>).</p>
+
+
+<h2 id="TaskUseOriQuali">Использование квалификаторов ориентации</h2>
+
+<p>Хотя некоторые макеты одинаково хорошо смотрятся в вертикальной и горизонтальной ориентациях, в большинстве случаев интерфейс все же приходится адаптировать. Ниже показано, как изменяется макет в приложении News Reader в зависимости от размера и ориентации экрана.</p>
+
+<p><ul>
+<li><b>Маленький экран, вертикальная ориентация</b>: однопанельный вид с логотипом.</li>
+<li><b>Маленький экран, горизонтальная ориентация</b>: однопанельный вид с логотипом.</li>
+<li><b>Планшетный ПК с 7-дюймовым экраном, вертикальная ориентация</b>: однопанельный вид с панелью действий.</li>
+<li><b>Планшетный ПК с 7-дюймовым экраном, горизонтальная ориентация</b>: двухпанельный вид с панелью действий.</li>
+<li><b>Планшетный ПК с 10-дюймовым экраном, вертикальная ориентация</b>: двухпанельный вид (узкий вариант) с панелью действий.</li>
+<li><b>Планшетный ПК с 10-дюймовым экраном, горизонтальная ориентация</b>: двухпанельный вид (широкий вариант) с панелью действий.</li>
+<li><b>Телевизор, горизонтальная ориентация</b>: двухпанельный вид с панелью действий.</li>
+</ul></p>
+
+<p>Каждый из этих макетов определен в XML-файле в каталоге <code>res/layout/</code>. Чтобы сопоставить их с определенными конфигурациями экрана, в приложении используются псевдонимы:</p>
+
+<p><code>res/layout/onepane.xml:</code></p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+
+<p><code>res/layout/onepane_with_bar.xml:</code></p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane_with_bar.xml all}
+
+<p><code>res/layout/twopanes.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+
+<p><code>res/layout/twopanes_narrow.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes_narrow.xml all}
+
+<p>После того как все возможные макеты определены, остается сопоставить каждый из них с подходящей конфигурацией, используя квалификаторы конфигураций. Воспользуемся псевдонимами макетов:</p>
+
+<p><code>res/values/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values/layouts.xml all}
+
+<p><code>res/values-sw600dp-land/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-land/layouts.xml
+all}
+
+<p><code>res/values-sw600dp-port/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-port/layouts.xml
+all}
+
+<p><code>res/values-large-land/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-land/layouts.xml all}
+
+<p><code>res/values-large-port/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-port/layouts.xml all}
+
+
+
+<h2 id="TaskUse9Patch">Использование растровых изображений nine-patch</h2>
+
+<p>Чтобы интерфейс был совместим с экранами разных размеров, используемые в нем графические элементы также должны быть адаптированы соответствующим образом. Например, фон кнопки должен одинаково хорошо выглядеть независимо от ее формы.</p>
+
+<p>Если использовать для компонентов, размеры которых меняются, обычные изображения, то они будут равномерно сжиматься и растягиваться, и результат будет далек от идеального. Решением являются растровые изображения формата nine-patch – специальные PNG-файлы, содержащие информацию о том, какие области можно растягивать, а какие нет.</p>
+
+<p>Создавая растровые изображения для масштабируемых компонентов, обязательно используйте формат nine-patch. На рис. 4 показано обычное растровое изображение (увеличенное в 4 раза для наглядности), которое мы переведем в формат nine-patch.</p>
+
+<img src="{@docRoot}images/training/button.png" />
+<p class="img-caption"><strong>Рисунок 4</strong>. <code>button.png</code></p>
+
+<p>Откройте его с помощью утилиты <ode
+href="{@docRoot}tools/help/draw9patch.html"><code>draw9patch</code></a>, входящей в комплект разработчика (в каталоге <code>tools/</code>). Установите метки на левом и верхнем краях, чтобы ограничить области, которые можно растягивать. Можно также провести линию вдоль правого и нижнего краев, как показано на рис. 5, чтобы отметить области, в которых содержание должно быть зафиксировано.</p>
+
+<img src="{@docRoot}images/training/button_with_marks.png" />
+<p class="img-caption"><strong>Рисунок 5</strong>. <code>button.9.png</code></p>
+
+<p>Обратите внимание на черные пиксели по краям. Метки у верхней и левой границ обозначают те области, которые можно растягивать, а метки у правой и нижней границ – те, куда должно быть помещено содержание.</p>
+
+<p>Также обратите внимание на расширение <code>.9.png</code>. Оно должно быть задано именно в таком виде, чтобы система могла определить, что это формат nine-patch, а не обычный PNG-файл.</p>
+
+<p>При применении этого фона к компоненту (с помощью <code>android:background="@drawable/button"</code>) изображение будет растянуто по размеру кнопки, как показано на рис. 6.</p>
+
+<img src="{@docRoot}images/training/buttons_stretched.png" />
+<p class="img-caption"><strong>Рисунок 6</strong>. Кнопки разных размеров с файлом фона <code>button.9.png</code> в формате nine-patch.</p>
+
diff --git a/docs/html/intl/zh-CN/training/monitoring-device-state/battery-monitoring.jd b/docs/html/intl/zh-CN/training/monitoring-device-state/battery-monitoring.jd
new file mode 100644
index 0000000..0e1ccb7
--- /dev/null
+++ b/docs/html/intl/zh-CN/training/monitoring-device-state/battery-monitoring.jd
@@ -0,0 +1,120 @@
+page.title=监控电池电量和充电状态
+parent.title=优化电池使用时间
+parent.link=index.html
+
+trainingnavtop=true
+next.title=确定和监控基座对接状态和类型
+next.link=docking-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>本教程将指导您</h2>
+<ol>
+ <li><a href="#DetermineChargeState">确定当前的充电状态</a></li>
+ <li><a href="#MonitorChargeState">监控充电状态的变化</a></li>
+ <li><a href="#CurrentLevel">确定当前的电池电量</a></li>
+ <li><a href="#MonitorLevel">监控电池电量的显著变化</a></li>
+</ol>
+
+<h2>您还应参阅</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">intent 和 intent 过滤器</a>
+</ul>
+
+</div>
+</div>
+
+<p>如果您要更改后台更新频率,从而减少更新对电池使用时间的影响,最好先查看当前的电池电量和充电状态。</p>
+
+<p>对应用进行更新会影响电池使用时间,具体取决于设备的电池电量和充电状态。如果用户正在通过交流电源为设备充电,更新应用的影响就可以忽略不计。因此,在大多数情况下,只要设备连接了充电器,您就可以最大程度地提高刷新频率。相反,如果设备在消耗电池电量,那么降低更新频率就可以延长电池使用时间。</p>
+
+<p>同样,您也可以查看电池电量,如果电量即将耗尽,您就可以降低更新频率,甚至停止更新。</p>
+
+
+<h2 id="DetermineChargeState">确定当前的充电状态</h2>
+
+<p>请先确定当前的充电状态。{@link android.os.BatteryManager} 会通过一个包含充电状态的持续 {@link android.content.Intent} 广播所有的电池详情和充电详情。</p>
+
+<p>由于这是个持续 intent,因此您无需通过将传入 {@code null} 的 {@code registerReceiver} 作为接收器直接调用(如下一代码段所示)来注册 {@link android.content.BroadcastReceiver},系统会返回当前电池状态 intent。您可以在此处传入实际的 {@link android.content.BroadcastReceiver} 对象,不过我们会在下文中介绍如何处理更新,因此您不一定要执行此操作。</p>
+
+<pre>IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
+Intent batteryStatus = context.registerReceiver(null, ifilter);</pre>
+
+<p>如果设备正在充电,则您可以提取当前的充电状态和充电方式(无论是通过 USB 还是交流充电器),如下所示:<p>
+
+<pre>// Are we charging / charged?
+int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
+boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
+ status == BatteryManager.BATTERY_STATUS_FULL;
+
+// How are we charging?
+int chargePlug = battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+boolean usbCharge = chargePlug == BATTERY_PLUGGED_USB;
+boolean acCharge = chargePlug == BATTERY_PLUGGED_AC;</pre>
+
+<p>通常,如果设备连接了交流充电器,您就应最大程度地提高后台更新频率;如果设备通过 USB 充电,请降低更新频率;如果电池在耗电,请进一步降低更新频率。</p>
+
+
+<h2 id="MonitorChargeState">监控充电状态的变化</h2>
+
+<p>充电状态的改变就像设备连接电源那样容易,因此监控充电状态的变化并相应地调整刷新频率就很重要了。</p>
+
+<p>只要设备连接或断开电源,{@link android.os.BatteryManager} 就会广播相应的操作。即使您的应用没有运行,也请务必接收这些事件,尤其是当这些事件会影响您启动应用以执行后台更新的频率时。因此,您应该通过在 intent 过滤器中定义 {@link android.content.Intent#ACTION_POWER_CONNECTED} 和 {@link android.content.Intent#ACTION_POWER_DISCONNECTED},在清单中注册 {@link android.content.BroadcastReceiver} 来侦听这两个事件。</p>
+
+<pre><receiver android:name=".PowerConnectionReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
+ <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
+ </intent-filter>
+</receiver></pre>
+
+<p>在实施相关的 {@link android.content.BroadcastReceiver} 时,您可以按上一步骤所述提取当前的充电状态和充电方式。</p>
+
+<pre>public class PowerConnectionReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
+ boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
+ status == BatteryManager.BATTERY_STATUS_FULL;
+
+ int chargePlug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+ boolean usbCharge = chargePlug == BATTERY_PLUGGED_USB;
+ boolean acCharge = chargePlug == BATTERY_PLUGGED_AC;
+ }
+}</pre>
+
+
+<h2 id="CurrentLevel">确定当前的电池电量</h2>
+
+<p>在某些情况下,确定当前的电池电量会对您有所帮助。如果电池电量低于一定水平,您可以降低后台更新频率。</p>
+
+<p>您可以从电池状态 intent 中提取要了解的当前电池电量以及电池容量,具体如下所示:</p>
+
+<pre>int level = battery.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
+int scale = battery.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
+
+float batteryPct = level / (float)scale;</pre>
+
+
+<h2 id="MonitorLevel">监控电池电量的显著变化</h2>
+
+<p>您无法轻松地对电池状态进行持续监控,不过也无需这么做。</p>
+
+<p>一般来说,与应用的正常行为相比,持续监控电池电量会消耗更多电量。因此,比较合适的做法是只监控电池电量的显著变化(尤其是在设备进入或结束低电量状态的情况下)。</p>
+
+<p>以下清单代码段提取自广播接收器中的 intent 过滤器元素。通过侦听 {@link android.content.Intent#ACTION_BATTERY_LOW} 和 {@link android.content.Intent#ACTION_BATTERY_OKAY},只要设备的电池进入或结束低电量状态,系统就会触发接收器。</p>
+
+<pre><receiver android:name=".BatteryLevelReceiver">
+<intent-filter>
+ <action android:name="android.intent.action.ACTION_BATTERY_LOW"/>
+ <action android:name="android.intent.action.ACTION_BATTERY_OKAY"/>
+ </intent-filter>
+</receiver></pre>
+
+<p>如果电池电量极低,通常比较合适的做法是停用所有后台更新。如果您还没用上更新的数据,手机就自动关机了,那这些数据再新也没有意义。</p>
+
+<p>在很多情况下,将设备插入基座就可以为其充电。下一教程将向您介绍如何确定当前基座状态及如何监控设备对接的变化。</p>
+
diff --git a/docs/html/intl/zh-CN/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html/intl/zh-CN/training/monitoring-device-state/connectivity-monitoring.jd
new file mode 100644
index 0000000..8313e08
--- /dev/null
+++ b/docs/html/intl/zh-CN/training/monitoring-device-state/connectivity-monitoring.jd
@@ -0,0 +1,70 @@
+page.title=确定和监控网络连接状态
+parent.title=优化电池使用时间
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=确定和监控基座对接状态和类型
+previous.link=docking-monitoring.html
+next.title=根据需要操作广播接收器
+next.link=manifest-receivers.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>本教程将指导您</h2>
+<ol>
+ <li><a href="#DetermineConnection">确定是否已连接互联网</a></li>
+ <li><a href="#DetermineType">确定互联网连接的类型</a></li>
+ <li><a href="#MonitorChanges">监控连接情况的变化</a></li>
+</ol>
+
+
+<h2>您还应参阅</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">intent 和 intent 过滤器</a>
+</ul>
+
+</div>
+</div>
+
+<p>重复提醒和后台服务最常见的用途之一,就是为来自互联网资源的应用数据、缓存数据安排定期更新或执行长时间运行的下载任务。但是,如果您没有连接互联网,或因连接过慢而无法完成下载,那就根本没必要唤醒设备并安排更新了。</p>
+
+<p>您可以使用 {@link android.net.ConnectivityManager} 查看是否确实已连接互联网,如果已连接,您还可以了解当前的连接类型。</p>
+
+
+<h2 id="DetermineConnection">确定是否已连接互联网</h2>
+
+<p>如果设备未连接互联网,就没有必要根据互联网资源安排更新了。以下代码段说明如何使用 {@link android.net.ConnectivityManager} 查询有效网络并确定该网络是否已连接互联网。</p>
+
+<pre>ConnectivityManager cm =
+ (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
+
+NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
+boolean isConnected = activeNetwork.isConnectedOrConnecting();</pre>
+
+
+<h2 id="DetermineType">确定互联网连接的类型</h2>
+
+<p>您也可以确定当前可用的互联网连接的类型。</p>
+
+<p>通过移动数据、WiMAX、Wi-Fi 和以太网连接可提供设备连接。您可以查询有效网络的类型(具体如下所示),以便根据可用带宽调整刷新频率。</p>
+
+<pre>boolean isWiFi = activeNetwork.getType() == ConnectivityManager.TYPE_WIFI;</pre>
+
+<p>移动数据的费用往往比 Wi-Fi 高很多,因此在大多数情况下,如果您使用的是移动连接,就应降低应用更新频率。同样,在没有 Wi-Fi 连接的情况下,您就应暂停较大的下载任务。</p>
+
+<p>停用更新后,请务必侦听连接情况的变化,以便在建立互联网连接后恢复更新。</p>
+
+
+<h2 id="MonitorChanges">监控连接情况的变化</h2>
+
+<p>只要连接的具体情况发生变化,{@link android.net.ConnectivityManager} 就会广播 {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION} ({@code "android.net.conn.CONNECTIVITY_CHANGE"}) 操作。您可以在清单中注册广播接收器,以便侦听这些变化并相应地恢复(或暂停)后台更新。</p>
+
+<pre><action android:name="android.net.conn.CONNECTIVITY_CHANGE"/></pre>
+
+<p>设备连接情况的变化可能会非常频繁,只要您在移动数据和 Wi-Fi 之间相互切换,系统就会触发此广播。因此比较合适的做法是,仅当之前暂停了更新或下载时才监控此广播,以便恢复更新或下载。通常,您只需在开始更新前检查互联网连接情况即可,如果未连接互联网,请暂停后续更新,直到连接恢复。</p>
+
+<p>此技巧需要切换您在清单中声明的广播接收器,具体说明请见下一教程。</p>
diff --git a/docs/html/intl/zh-CN/training/monitoring-device-state/docking-monitoring.jd b/docs/html/intl/zh-CN/training/monitoring-device-state/docking-monitoring.jd
new file mode 100644
index 0000000..53b951d
--- /dev/null
+++ b/docs/html/intl/zh-CN/training/monitoring-device-state/docking-monitoring.jd
@@ -0,0 +1,74 @@
+page.title=确定和监控基座对接状态和类型
+parent.title=优化电池使用时间
+parent.link=index.html
+
+trainingnavtop=true
+previous.title= 监控电池电量和充电状态
+previous.link=battery-monitoring.html
+next.title= 确定和监控网络连接状态
+next.link=connectivity-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>本教程将指导您</h2>
+<ol>
+ <li><a href="#CurrentDockState">确定当前的基座状态</a></li>
+ <li><a href="#DockType">确定当前的基座类型</a></li>
+ <li><a href="#MonitorDockState">监控基座状态或类型的变化</a></li>
+</ol>
+
+
+<h2>您还应参阅</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">intent 和 intent 过滤器</a>
+</ul>
+
+</div>
+</div>
+
+<p>Android 设备支持几种不同类型的基座。这些类型包括车载或家用基座以及数字和模拟基座。许多基座可用于为插入的设备充电,因此基座状态通常与充电状态紧密相关。</p>
+
+<p>您可以根据手机的基座状态调整更新频率,具体取决于相关应用。如果设备插入的是桌面基座,您就可以提高体育中心类应用的更新频率;如果设备插入的是车载基座,您就可以完全停用此类更新。相反,如果设备插入的是车载基座且后台服务正在更新路况,您就可以最大程度地提高更新频率。</p>
+
+<p>系统是以持续 {@link android.content.Intent} 的形式广播基座状态的,这样您就可以查询设备是否插入了基座,如果已插入,您还可以查询基座类型。</p>
+
+
+<h2 id="CurrentDockState">确定当前的基座状态</h2>
+
+<p>基座状态详情是以附加信息的形式包含在 {@link android.content.Intent#ACTION_DOCK_EVENT} 操作的持续广播中的。由于这属于持续广播,因此您无需注册 {@link android.content.BroadcastReceiver}。您可以将传入 {@code null} 的 {@link android.content.Context#registerReceiver registerReceiver()} 作为广播接收器直接调用,具体如下一代码段所示。</p>
+
+<pre>IntentFilter ifilter = new IntentFilter(Intent.ACTION_DOCK_EVENT);
+Intent dockStatus = context.registerReceiver(null, ifilter);</pre>
+
+<p>您可以从 {@code EXTRA_DOCK_STATE} 附加信息中提取当前的基座对接状态:<p>
+
+<pre>int dockState = battery.getIntExtra(EXTRA_DOCK_STATE, -1);
+boolean isDocked = dockState != Intent.EXTRA_DOCK_STATE_UNDOCKED;</pre>
+
+
+<h2 id="DockType">确定当前的基座类型</h2>
+
+<p>用户可以将设备插入以下四种类型的基座:
+<ul><li>车载基座</li>
+<li>桌面基座</li>
+<li>低端(模拟)桌面基座</li>
+<li>高端(数字)桌面基座</li></ul></p>
+
+<p>请注意,后两种类型仅适用于 API 级别为 11 及以上的 Android,因此如果您只关注基座类型,而不在意基座究竟是数字的还是模拟的,那么比较合适的做法就是查看全部三种类型:</p>
+
+<pre>boolean isCar = dockState == EXTRA_DOCK_STATE_CAR;
+boolean isDesk = dockState == EXTRA_DOCK_STATE_DESK ||
+ dockState == EXTRA_DOCK_STATE_LE_DESK ||
+ dockState == EXTRA_DOCK_STATE_HE_DESK;</pre>
+
+
+<h2 id="MonitorDockState">监控基座状态或类型的变化</h2>
+
+<p>无论设备是否插入了基座,系统都会广播 {@link android.content.Intent#ACTION_DOCK_EVENT} 操作。要监控设备基座状态的变化,您只需在应用清单中注册广播接收器即可,具体如以下代码段所示:</p>
+
+<pre><action android:name="android.intent.action.ACTION_DOCK_EVENT"/></pre>
+
+<p>您可以使用上一步骤中所述的技术在接收器实施过程中提取基座的类型和状态。</p>
diff --git a/docs/html/intl/zh-CN/training/monitoring-device-state/index.jd b/docs/html/intl/zh-CN/training/monitoring-device-state/index.jd
new file mode 100644
index 0000000..aa10753
--- /dev/null
+++ b/docs/html/intl/zh-CN/training/monitoring-device-state/index.jd
@@ -0,0 +1,49 @@
+page.title=优化电池使用时间
+
+trainingnavtop=true
+startpage=true
+next.title=监控电池电量和充电状态
+next.link=battery-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>依存关系和前提条件</h2>
+<ul>
+ <li>Android 2.0(API 级别 5)或更高版本</li>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">intent 和 intent 过滤器</a>的使用经验</li>
+</ul>
+
+<h2>您还应参阅</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/services.html">服务</a>
+</ul>
+
+</div>
+</div>
+
+<p>为了打造一个优秀的应用,您应设法降低应用对电池使用时间的影响。阅读完本教程后,您就可以让自己构建的应用根据其所在设备的状态来监控和调整自身的功能和行为。</p>
+
+<p>要确保在不影响用户体验的情况下最大程度地降低应用对电池使用时间的影响,您可以采取一些措施,例如在网络连接断开时停用后台服务更新,或在电池电量较低时降低此类更新的频率。</p>
+
+<h2>教程</h2>
+
+<!-- Create a list of the lessons in this class along with a short description of each lesson.
+These should be short and to the point. It should be clear from reading the summary whether someone
+will want to jump to a lesson or not.-->
+
+<dl>
+ <dt><b><a href="battery-monitoring.html">监控电池电量和充电状态</a></b></dt>
+ <dd>了解如何通过确定和监控当前的电池电量和充电状态的变化来相应地调整应用的更新频率。</dd>
+
+ <dt><b><a href="docking-monitoring.html">确定和监控基座对接状态和类型</a></b></dt>
+ <dd>最佳刷新频率可能各有不同,具体取决于安装了相关应用的设备的使用方式。了解如何确定和监控所用基座的对接状态和类型,以便相应地调整应用的行为。</dd>
+
+ <dt><b><a href="connectivity-monitoring.html">确定和监控网络连接状态</a></b></dt>
+ <dd>如果没有互联网连接,您就无法通过在线来源更新应用。了解如何查看连接状态,以便相应地调整后台更新频率。您还可以了解如何在执行高带宽操作前查看 Wi-Fi 或移动连接的状态。</dd>
+
+ <dt><b><a href="manifest-receivers.html">根据需要操作广播接收器</a></b></dt>
+ <dd>您可以在运行时切换自己在清单中声明的广播接收器,以便根据当前设备状态停用不需要的接收器。了解如何在设备未处于特定状态的情况下切换和层叠状态变化接收器和延迟操作,以便提高效率。</dd>
+</dl>
\ No newline at end of file
diff --git a/docs/html/intl/zh-CN/training/monitoring-device-state/manifest-receivers.jd b/docs/html/intl/zh-CN/training/monitoring-device-state/manifest-receivers.jd
new file mode 100644
index 0000000..07c014f
--- /dev/null
+++ b/docs/html/intl/zh-CN/training/monitoring-device-state/manifest-receivers.jd
@@ -0,0 +1,50 @@
+page.title=根据需要操作广播接收器
+parent.title=优化电池使用时间
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=确定和监控网络连接状态
+previous.link=connectivity-monitoring.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>本教程将指导您</h2>
+<ol>
+ <li><a href="#ToggleReceivers">切换和层叠状态变化接收器以提高效率</a></li>
+</ol>
+
+
+<h2>您还应参阅</h2>
+<ul>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">intent 和 intent 过滤器</a>
+</ul>
+
+</div>
+</div>
+
+<p>监控设备状态变化的最简单方法就是,为您监控的每种状态创建 {@link android.content.BroadcastReceiver} 并在应用清单中逐一进行注册。然后,您只需根据当前设备状态在每个接收器中重新安排重复提醒即可。</p>
+
+<p>此方法的负面影响在于,只要系统触发了这些接收器中的任何一个,相关应用就会唤醒设备,其频率可能会远远超过所需的水平。</p>
+
+<p>更好的方法是在运行时停用或启用广播接收器。这样的话,您就可以将自己在清单中声明的接收器用作被动提醒,只有在需要时才会由系统事件触发。</p>
+
+
+<h2 id="ToggleReceivers">切换和层叠状态变化接收器以提高效率 </h2>
+
+<p>您可以使用 {@link android.content.pm.PackageManager} 切换清单中定义的任意组件的启用状态(包括您要启用或停用的任意广播接收器),具体如以下片段所示:</p>
+
+<pre>ComponentName receiver = new ComponentName(context, myReceiver.class);
+
+PackageManager pm = context.getPackageManager();
+
+pm.setComponentEnabledSetting(receiver,
+ PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
+ PackageManager.DONT_KILL_APP)</pre>
+
+<p>在使用此技巧时,如果您确定连接已断开,就可以停用除连接变化接收器外的所有接收器。相反,成功连接后,您就可以停止侦听连接变化,同时只需在执行更新和重新安排重复更新提醒前查看是否在线即可。</p>
+
+<p>您可以使用同样的方法来延迟需要较高带宽的下载任务。只有在连接 Wi-Fi 后,您才能直接启用用于侦听连接变化和启动下载任务的广播接收器。</p>
diff --git a/docs/html/intl/zh-CN/training/multiscreen/adaptui.jd b/docs/html/intl/zh-CN/training/multiscreen/adaptui.jd
new file mode 100644
index 0000000..89908fe
--- /dev/null
+++ b/docs/html/intl/zh-CN/training/multiscreen/adaptui.jd
@@ -0,0 +1,212 @@
+page.title=实施自适应用户界面流程
+parent.title=针对多种屏幕进行设计
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=支持各种屏幕密度
+previous.link=screendensities.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>本教程将指导您</h2>
+
+<ol>
+ <li><a href="#TaskDetermineCurLayout">确定当前布局</a></li>
+ <li><a href="#TaskReactToLayout">根据当前布局做出响应</a></li>
+ <li><a href="#TaskReuseFrag">重复使用其他活动中的片段</a></li>
+ <li><a href="#TaskHandleConfigChanges">处理屏幕配置变化</a></li>
+</ol>
+
+<h2>您还应参阅</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">支持平板电脑和手持设备</a></li>
+</ul>
+
+<h2>试试看</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">下载示例应用</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+
+</div>
+</div>
+
+<p>根据您的应用当前显示的布局,用户界面流程可能会有所不同。例如,如果您的应用处于双面板模式下,点击左侧面板上的项即可直接在右侧面板上显示相关内容;如果该应用处于单面板模式下,相关内容就应以其他活动的形式在同一面板上显示。</p>
+
+
+<h2 id="TaskDetermineCurLayout">确定当前布局</h2>
+
+<p>由于每种布局的实施都会稍有不同,因此您可能需要先确定当前向用户显示的布局。例如,您可以了解用户所处的是“单面板”模式还是“双面板”模式。要做到这一点,您可以查询指定视图是否存在以及是否已显示出来。</p>
+
+<pre class="prettyprint">
+public class NewsReaderActivity extends FragmentActivity {
+ boolean mIsDualPane;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main_layout);
+
+ View articleView = findViewById(R.id.article);
+ mIsDualPane = articleView != null &&
+ articleView.getVisibility() == View.VISIBLE;
+ }
+}
+</pre>
+
+<p>请注意,这段代码用于查询“报道”面板是否可用,与针对具体布局的硬编码查询相比,这段代码的灵活性要大得多。</p>
+
+<p>再举一个适应各种组件的存在情况的方法示例:在对这些组件执行操作前先查看它们是否可用。例如,新闻阅读器示例应用中有一个用于打开菜单的按钮,但只有在版本低于 3.0 的 Android 上运行该应用时,这个按钮才会存在,因为 API 级别 11 或更高级别中的 <PH>{@link android.app.ActionBar}</PH> 已取代了该按钮的功能。因此,您可以使用以下代码为此按钮添加事件侦听器:</p>
+
+<pre class="prettyprint">
+Button catButton = (Button) findViewById(R.id.categorybutton);
+OnClickListener listener = /* create your listener here */;
+if (catButton != null) {
+ catButton.setOnClickListener(listener);
+}
+</pre>
+
+
+<h2 id="TaskReactToLayout">根据当前布局做出响应</h2>
+
+<p>有些操作可能会因当前的具体布局而产生不同的结果。例如,在新闻阅读器示例中,如果用户界面处于双面板模式下,那么点击标题列表中的标题就会在右侧面板中打开相应报道;但如果用户界面处于单面板模式下,那么上述操作就会启动一个独立活动:</p>
+
+<pre>
+@Override
+public void onHeadlineSelected(int index) {
+ mArtIndex = index;
+ if (mIsDualPane) {
+ /* display article on the right pane */
+ mArticleFragment.displayArticle(mCurrentCat.getArticle(index));
+ } else {
+ /* start a separate activity */
+ Intent intent = new Intent(this, ArticleActivity.class);
+ intent.putExtra("catIndex", mCatIndex);
+ intent.putExtra("artIndex", index);
+ startActivity(intent);
+ }
+}
+</pre>
+
+<p>同样,如果该应用处于双面板模式下,就应设置带导航标签的操作栏;但如果该应用处于单面板模式下,就应使用旋转窗口小部件设置导航栏。因此您的代码还应确定哪种情况比较合适:</p>
+
+<pre>
+final String CATEGORIES[] = { "热门报道", "政治", "经济", "Technology" };
+
+public void onCreate(Bundle savedInstanceState) {
+ ....
+ if (mIsDualPane) {
+ /* use tabs for navigation */
+ actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_TABS);
+ int i;
+ for (i = 0; i < CATEGORIES.length; i++) {
+ actionBar.addTab(actionBar.newTab().setText(
+ CATEGORIES[i]).setTabListener(handler));
+ }
+ actionBar.setSelectedNavigationItem(selTab);
+ }
+ else {
+ /* use list navigation (spinner) */
+ actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_LIST);
+ SpinnerAdapter adap = new ArrayAdapter<String>(this,
+ R.layout.headline_item, CATEGORIES);
+ actionBar.setListNavigationCallbacks(adap, handler);
+ }
+}
+</pre>
+
+
+<h2 id="TaskReuseFrag">重复使用其他活动中的片段</h2>
+
+<p>多屏幕设计中的重复模式是指,对于某些屏幕配置,已实施界面的一部分会用作面板;但对于其他配置,这部分就会以独立活动的形式存在。例如,在新闻阅读器示例中,对于较大的屏幕,新闻报道文本会显示在右侧面板中;但对于较小的屏幕,这些文本就会以独立活动的形式存在。</p>
+
+<p>在类似情况下,您通常可以在多个活动中重复使用相同的 <PH>{@link android.app.Fragment}</PH> 子类以避免代码重复。例如,您在双面板布局中使用了 <code>ArticleFragment</code>:</p>
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+
+<p>然后又在小屏幕的活动布局中重复使用(无布局)了它 (<code>ArticleActivity</code>):</p>
+
+<pre>
+ArticleFragment frag = new ArticleFragment();
+getSupportFragmentManager().beginTransaction().add(android.R.id.content, frag).commit();
+</pre>
+
+<p>当然,这与在 XML 布局中声明片段的效果是一样的,但在这种情况下却没必要使用 XML 布局,因为报道片段是此活动中的唯一组件。</p>
+
+<p>请务必在设计片段时注意,不要针对具体活动创建强耦合。要做到这一点,您通常可以定义一个界面,该界面概括了相关片段与其主活动交互所需的全部方式,然后让主活动实施该界面:</p>
+
+<p>例如,新闻阅读器应用的 <code>HeadlinesFragment</code> 会精确执行以下代码:</p>
+
+<pre>
+public class HeadlinesFragment extends ListFragment {
+ ...
+ OnHeadlineSelectedListener mHeadlineSelectedListener = null;
+
+ /* Must be implemented by host activity */
+ public interface OnHeadlineSelectedListener {
+ public void onHeadlineSelected(int index);
+ }
+ ...
+
+ public void setOnHeadlineSelectedListener(OnHeadlineSelectedListener listener) {
+ mHeadlineSelectedListener = listener;
+ }
+}
+</pre>
+
+<p>然后,如果用户选择某个标题,相关片段就会通知由主活动指定的侦听器(而不是通知某个硬编码的具体活动):</p>
+
+<pre>
+public class HeadlinesFragment extends ListFragment {
+ ...
+ @Override
+ public void onItemClick(AdapterView<?> parent,
+ View view, int position, long id) {
+ if (null != mHeadlineSelectedListener) {
+ mHeadlineSelectedListener.onHeadlineSelected(position);
+ }
+ }
+ ...
+}
+</pre>
+
+<p><a
+href="{@docRoot}guide/practices/tablets-and-handsets.html">支持平板电脑和手持设备</a>的指南中进一步介绍了此技术。</p>
+
+
+<h2 id="TaskHandleConfigChanges">处理屏幕配置变化</h2>
+
+<p>如果您使用独立活动实施界面的独立部分,那么请注意,您可能需要对特定配置变化(例如屏幕方向的变化)做出响应,以便保持界面的一致性。</p>
+
+<p>例如,在运行 Android 3.0 或更高版本的标准 7 英寸平板电脑上,如果新闻阅读器示例应用运行在纵向模式下,就会在使用独立活动显示新闻报道;但如果该应用运行在横向模式下,就会使用双面板布局。</p>
+
+<p>也就是说,如果用户处于纵向模式下且屏幕上显示的是用于阅读报道的活动,那么您就需要在检测到屏幕方向变化(变成横向模式)后执行相应操作,即停止上述活动并返回主活动,以便在双面板布局中显示相关内容:</p>
+
+<pre>
+public class ArticleActivity extends FragmentActivity {
+ int mCatIndex, mArtIndex;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mCatIndex = getIntent().getExtras().getInt("catIndex", 0);
+ mArtIndex = getIntent().getExtras().getInt("artIndex", 0);
+
+ // If should be in two-pane mode, finish to return to main activity
+ if (getResources().getBoolean(R.bool.has_two_panes)) {
+ finish();
+ return;
+ }
+ ...
+}
+</pre>
+
+
diff --git a/docs/html/intl/zh-CN/training/multiscreen/index.jd b/docs/html/intl/zh-CN/training/multiscreen/index.jd
new file mode 100644
index 0000000..35c48e0
--- /dev/null
+++ b/docs/html/intl/zh-CN/training/multiscreen/index.jd
@@ -0,0 +1,64 @@
+page.title=针对多种屏幕进行设计
+
+trainingnavtop=true
+startpage=true
+next.title=支持各种屏幕尺寸
+next.link=screensizes.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>依存关系和前提条件</h2>
+
+<ul>
+ <li>Android 1.6 或更高版本(示例应用则需要 2.1 或更高版本)</li>
+ <li><a
+href="http://developer.android.com/guide/components/activities.html">活动</a>和<a href="http://developer.android.com/guide/components/fragments.html">片段</a>的基本知识</li>
+ <li>构建 Android <a
+href="http://developer.android.com/guide/topics/ui/index.html">用户界面</a>的经验</li>
+ <li>多个功能需要用到<a
+href="{@docRoot}tools/extras/support-library.html">支持库</a></li>
+</ul>
+
+<h2>您还应参阅</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">支持多种屏幕</a></li>
+</ul>
+
+<h2>试试看</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">下载示例应用</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>Android 支持数百种屏幕尺寸不同的设备,包括小型手机和大型电视机。因此,请务必将您的应用设计为与所有的屏幕尺寸兼容,以便让尽可能多的用户使用该应用。</p>
+
+<p>不过,与各种类型的设备兼容还远远不够。由于各种屏幕尺寸对用户互动产生的利弊有所不同,因此要真正满足用户需求并广获好评,您的应用不仅需要支持多种屏幕,还应针对各类屏幕配置的用户体验进行优化。<em></em><em></em></p>
+
+<p>本教程将向您介绍如何针对多种屏幕配置优化和实施相应的用户界面。</p>
+
+<p>各教程中都提及了一种来自一个示例应用的代码,该应用展示了关于针对多种分辨率进行优化的最佳实践。您可以在右侧下载该示例,并在自己的应用内重复使用其中的代码。</p>
+
+<p class="note"><strong>请注意</strong>:本教程和相关的示例使用了<a
+href="{@docRoot}tools/extras/support-library.html">支持库</a>,以便在 3.0 版以下的 Android 上使用 <PH>{@link android.app.Fragment}</PH> API。因此,您需要下载该库并将其添加到您的应用,才能使用本教程中涉及的所有 API。</p>
+
+
+<h2>教程</h2>
+
+<dl>
+ <dt><b><a href="screensizes.html">支持各种屏幕尺寸</a></b></dt>
+ <dd>本教程将向您介绍如何设计可适应多种屏幕尺寸的布局(使用灵活的视图尺寸、 <PH>{@link android.widget.RelativeLayout}</PH>、屏幕尺寸和屏幕方向限定符、别名过滤器以及自动拉伸位图)。</dd>
+
+ <dt><b><a href="screendensities.html">支持各种屏幕密度</a></b></dt>
+ <dd>本教程将向您介绍如何支持具有不同像素密度的屏幕(使用非密度制约像素并提供各种密度的相应位图)。</dd>
+
+ <dt><b><a href="adaptui.html">实施自适应用户界面流程</a></b></dt>
+ <dd>本教程将向您介绍如何以可适应多种屏幕尺寸/屏幕密度组合的方式实施用户界面流程(运行时对当前布局的检测,根据当前布局做出响应,处理屏幕配置变化)。</dd>
+</dl>
diff --git a/docs/html/intl/zh-CN/training/multiscreen/screendensities.jd b/docs/html/intl/zh-CN/training/multiscreen/screendensities.jd
new file mode 100644
index 0000000..cdb9b7f
--- /dev/null
+++ b/docs/html/intl/zh-CN/training/multiscreen/screendensities.jd
@@ -0,0 +1,100 @@
+page.title=支持各种屏幕密度
+parent.title=针对多种屏幕进行设计
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=支持各种屏幕尺寸
+previous.link=screensizes.html
+next.title=实施自适应用户界面流程
+next.link=adaptui.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>本教程将指导您</h2>
+<ol>
+ <li><a href="#TaskUseDP">使用非密度制约像素</a></li>
+ <li><a href="#TaskProvideAltBmp">提供备用位图</a></li>
+</ol>
+
+<h2>您还应参阅</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">支持多种屏幕</a></li>
+ <li><a href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">图标设计指南</a></li>
+</ul>
+
+<h2>试试看</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">下载示例应用</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+
+</div>
+</div>
+
+<p>本教程将向您介绍如何通过提供不同资源和使用独立于分辨率的测量单位来支持不同屏幕密度。</p>
+
+<h2 id="TaskUseDP">使用非密度制约像素</h2>
+
+<p>在设计布局时,大家经常会误使用绝对像素来定义距离或尺寸,您一定要避免犯这种错误。由于各种屏幕的像素密度都有所不同,因此相同数量的像素在不同设备上的实际大小也有所差异,这样使用像素定义布局尺寸就会产生问题。因此,请务必使用 <code>dp</code> 或 <code>sp</code> 单位指定尺寸。<code>dp</code> 是一种非密度制约像素,其尺寸与 160 dpi 像素的实际尺寸相同。<code>sp</code> 也是一种基本单位,但它可根据用户的偏好文字大小进行调整(即尺度独立性像素),因此您应将该测量单位用于定义文字大小(请勿用其定义布局尺寸)。</p>
+
+<p>例如,请使用 <code>dp</code>(而非 <code>px</code>)指定两个视图间的间距:</p>
+
+<pre>
+<Button android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/clickme"
+ android:layout_marginTop="20dp" />
+</pre>
+
+<p>请务必使用 <code>sp</code> 指定文字大小:</p>
+
+<pre>
+<TextView android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="20sp" />
+</pre>
+
+
+<h2 id="TaskProvideAltBmp">提供备用位图</h2>
+
+<p>由于 Android 可在具有各种屏幕密度的设备上运行,因此您提供的位图资源应始终可以满足各类普遍密度范围的要求:低密度、中等密度、高密度以及超高密度。这将有助于您的图形在所有屏幕密度上都能得到出色的质量和效果。</p>
+
+<p>要生成这些图片,您应先提取矢量格式的原始资源,然后根据以下尺寸范围针对各密度生成相应的图片。</p>
+
+<p><ul>
+ <li><code>xhdpi</code>:2.0
+ <li><code>hdpi</code>:1.5
+ <li><code>mdpi</code>:1.0(最低要求)
+ <li><code>ldpi</code>:0.75
+</ul></p>
+
+<p>也就是说,如果您为 <code>xhdpi</code> 设备生成了 200x200 尺寸的图片,就应该使用同一资源为 <code>hdpi</code>、<code>mdpi</code> 和 <code>ldpi</code> 设备分别生成 150x150、100x100 和 75x75 尺寸的图片。</p>
+
+<p>然后,将生成的图片文件放在 <code>res/</code> 下的相应子目录中(如下所示),系统就会根据运行您应用的设备的屏幕密度自动选择合适的图片:</p>
+
+<pre class="classic no-pretty-print">
+MyProject/
+ res/
+ drawable-xhdpi/
+ awesomeimage.png
+ drawable-hdpi/
+ awesomeimage.png
+ drawable-mdpi/
+ awesomeimage.png
+ drawable-ldpi/
+ awesomeimage.png
+</pre>
+
+<p>这样一来,无论您何时引用 <code>@drawable/awesomeimage</code>,系统都能根据相应屏幕的 dpi 选取合适的位图。</p>
+
+<p>有关为您的应用创建图标资产的更多提示和指南,请参阅<a
+href="{@docRoot}guide/practices/ui_guidelines/icon_design.html">图标设计指南</a>。</p>
+
diff --git a/docs/html/intl/zh-CN/training/multiscreen/screensizes.jd b/docs/html/intl/zh-CN/training/multiscreen/screensizes.jd
new file mode 100644
index 0000000..904d097
--- /dev/null
+++ b/docs/html/intl/zh-CN/training/multiscreen/screensizes.jd
@@ -0,0 +1,279 @@
+page.title=支持各种屏幕尺寸
+parent.title=针对多种屏幕进行设计
+parent.link=index.html
+
+trainingnavtop=true
+next.title=支持各种屏幕密度
+next.link=screendensities.html
+
+@jd:body
+
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>本教程将指导您</h2>
+<ol>
+ <li><a href="#TaskUseWrapMatchPar">使用“wrap_content”和“match_parent”</a></li>
+ <li><a href="#TaskUseRelativeLayout">使用相对布局</a></li>
+ <li><a href="#TaskUseSizeQuali">使用尺寸限定符</a></li>
+ <li><a href="#TaskUseSWQuali">使用最小宽度限定符</a></li>
+ <li><a href="#TaskUseAliasFilters">使用布局别名</a></li>
+ <li><a href="#TaskUseOriQuali">使用屏幕方向限定符</a></li>
+ <li><a href="#TaskUse9Patch">使用自动拉伸位图</a></li>
+</ol>
+
+<h2>您还应参阅</h2>
+
+<ul>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">支持多种屏幕</a></li>
+</ul>
+
+<h2>试试看</h2>
+
+<div class="download-box">
+<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">下载示例应用</a>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>此教程将向您介绍如何通过以下方法支持各种尺寸的屏幕:</p>
+<ul>
+ <li>确保系统可以适当地调整您布局的尺寸以便适应屏幕</li>
+ <li>根据屏幕配置提供合适的用户界面布局</li>
+ <li>确保正确的布局应用到了正确的屏幕上</li>
+ <li>提供可正确缩放的位图</li>
+</ul>
+
+
+<h2 id="TaskUseWrapMatchPar">使用“wrap_content”和“match_parent”</h2>
+
+<p>要确保布局的灵活性并适应各种尺寸的屏幕,您应使用 <code>"wrap_content"</code> 和 <code>"match_parent"</code> 控制某些视图组件的宽度和高度。如果您使用 <code>"wrap_content"</code>,系统就会将视图的宽度或高度设置成所需的最小尺寸以适应视图中的内容,而 <code>"match_parent"</code>(在低于 API 级别 8 的级别中称为 <code>"fill_parent"</code>)则会展开组件以匹配其父视图的尺寸。</p>
+
+<p>如果使用 <code>"wrap_content"</code> 和 <code>"match_parent"</code> 尺寸值而不是硬编码的尺寸,您的视图就会相应地仅使用自身所需的空间或展开以填满可用空间。例如:</p>
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane_with_bar.xml all}
+
+<p>请注意示例中使用 <code>"wrap_content"</code> 和 <code>"match_parent"</code> 控制组件尺寸的方法,而不是关注具体的尺寸。此方法可让布局正确适应各种屏幕尺寸和屏幕方向。</p>
+
+<p>此视图在纵向模式和横向模式下的显示效果如下所示。请注意,组件的尺寸会自动适应屏幕的高度和宽度:</p>
+
+<img src="{@docRoot}images/training/layout-hvga.png" />
+<p class="img-caption"><strong>图 1</strong>。纵向模式(左)和横向模式(右)下的新闻阅读器示例应用。</p>
+
+
+<h2 id="TaskUseRelativeLayout">使用相对布局</h2>
+
+<p>您可以使用 <PH>{@link android.widget.LinearLayout}</PH> 的嵌套实例并结合 <code>"wrap_content"</code> 和 <code>"match_parent"</code> 尺寸,以便构建相当复杂的布局。不过,您无法通过 <PH>{@link android.widget.LinearLayout}</PH> 精确控制子视图的特殊关系;系统会将 <PH>{@link android.widget.LinearLayout}</PH> 中的视图直接并排列出。如果您需要将子视图排列出各种效果而不是一条直线,通常更合适的解决方法是使用 <PH>{@link android.widget.RelativeLayout}</PH>,这样您就可以根据各组件之间的特殊关系指定布局了。例如,您可以将某个子视图对齐到屏幕左侧,同时将另一个视图对齐到屏幕右侧。</p>
+
+<p>例如:</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:id="@+id/label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Type here:"/>
+ <EditText
+ android:id="@+id/entry"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/label"/>
+ <Button
+ android:id="@+id/ok"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/entry"
+ android:layout_alignParentRight="true"
+ android:layout_marginLeft="10dp"
+ android:text="OK" />
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toLeftOf="@id/ok"
+ android:layout_alignTop="@id/ok"
+ android:text="Cancel" />
+</RelativeLayout>
+</pre>
+
+<p>图 2 展示的是此布局在 QVGA 屏幕上的显示效果。</p>
+
+<img src="{@docRoot}images/training/relativelayout1.png" />
+<p class="img-caption"><strong>图 2</strong>。QVGA 屏幕(小屏幕)上的截图。</p>
+
+<p>图 3 展示的是此布局在较大屏幕上的显示效果。</p>
+
+<img src="{@docRoot}images/training/relativelayout2.png" />
+<p class="img-caption"><strong>图 3</strong>。WSVGA 屏幕(大屏幕)上的截图。</p>
+
+<p>请注意,虽然组件的尺寸有所变化,但它们的空间关系仍会保留,具体由 <PH>{@link android.widget.RelativeLayout.LayoutParams}</PH> 指定。</p>
+
+
+<h2 id="TaskUseSizeQuali">使用尺寸限定符</h2>
+
+<p>上文所述的灵活布局或相对布局可以为您带来的优势就只有这么多了。虽然这些布局可以拉伸组件内外的空间以适应各种屏幕,但它们不一定能为每种屏幕都提供最佳的用户体验。因此,您的应用不仅应实施灵活布局,还应针对各种屏幕配置提供一些备用布局。要做到这一点,您可以使用<a href="http://developer.android.com/guide/practices/screens_support.html#qualifiers">配置限定符</a>,这样就可以在运行时根据当前的设备配置自动选择合适的资源了(例如根据各种屏幕尺寸选择不同的布局)。</p>
+
+<p>例如,很多应用会在较大的屏幕上实施“双面板”模式(相关应用可能会在一个面板上显示项目列表,并在另一面板上显示对应内容)。平板电脑和电视的屏幕已经大到可以同时容纳这两个面板了,但手机屏幕就需要分别显示。因此,您可以使用以下文件以便实施这些布局:</p>
+
+<ul>
+ <li><code>res/layout/main.xml</code>,单面板(默认)布局:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+</li>
+ <li><code>res/layout-large/main.xml</code>,双面板布局:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+</li>
+</ul>
+
+<p>请注意第二种布局名称目录中的 <code>large</code> 限定符。系统会在属于较大屏幕(例如 7 英寸或更大的平板电脑)的设备上选择此布局。系统会在较小的屏幕上选择其他布局(无限定符)。</p>
+
+
+<h2 id="TaskUseSWQuali">使用最小宽度限定符</h2>
+
+<p>在版本低于 3.2 的 Android 设备上,开发人员遇到的问题之一是“较大”屏幕的尺寸范围,该问题会影响戴尔 Streak、早期的 Galaxy Tab 以及大部分 7 英寸平板电脑。即使这些设备的屏幕属于“较大”的尺寸,但很多应用可能会针对此类别中的各种设备(例如 5 英寸和 7 英寸的设备)显示不同的布局。这就是 Android 3.2 版在引入其他限定符的同时引入“最小宽度”限定符的原因。</p>
+
+<p>最小宽度限定符可让您通过指定某个最小宽度(以 dp 为单位)来定位屏幕。例如,标准 7 英寸平板电脑的最小宽度为 600 dp,因此如果您要在此类屏幕上的用户界面中使用双面板(但在较小的屏幕上只显示列表),您可以使用上文中所述的单面板和双面板这两种布局,但您应使用 <code>sw600dp</code> 指明双面板布局仅适用于最小宽度为 600 dp 的屏幕,而不是使用 <code>large</code> 尺寸限定符:</p>
+
+<ul>
+ <li><code>res/layout/main.xml</code>,单面板(默认)布局:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+</li>
+ <li><code>res/layout-sw600dp/main.xml</code>,双面板布局:
+
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+</li>
+</ul>
+
+<p>也就是说,对于最小宽度大于等于 600 dp 的设备,系统会选择 <code>layout-sw600dp/main.xml</code>(双面板)布局,否则系统就会选择 <code>layout/main.xml</code>(单面板)布局。</p>
+
+<p>但 Android 版本低于 3.2 的设备不支持此技术,原因是这些设备无法将 <code>sw600dp</code> 识别为尺寸限定符,因此您仍需使用 <code>large</code> 限定符。这样一来,就会有一个名称为 <code>res/layout-large/main.xml</code> 的文件(与 <code>res/layout-sw600dp/main.xml</code> 一样)。您将在下一教程中了解到避免此类布局文件出现重复的技术。</p>
+
+
+<h2 id="TaskUseAliasFilters">使用布局别名</h2>
+
+<p>最小宽度限定符仅适用于 Android 3.2 及更高版本。因此,您仍需使用与较低版本兼容的概括尺寸范围(小、正常、大和特大)。例如,如果您要将用户界面设计成在手机上显示单面板,但在 7 英寸平板电脑、电视和其他较大的设备上显示多面板,请提供以下文件:</p>
+
+<p><ul>
+<li><code>res/layout/main.xml:</code> 单面板布局</li>
+<li><code>res/layout-large:</code> 多面板布局</li>
+<li><code>res/layout-sw600dp:</code> 多面板布局</li>
+</ul></p>
+
+<p>后两个文件是相同的,因为其中一个用于和 Android 3.2 设备匹配,而另一个则是为使用较低版本 Android 的平板电脑和电视准备的。</p>
+
+<p>要避免平板电脑和电视的文件出现重复(以及由此带来的维护问题),您可以使用别名文件。例如,您可以定义以下布局:</p>
+
+<ul>
+<li><code>res/layout/main.xml</code>,单面板布局</li>
+<li><code>res/layout/main_twopanes.xml</code>,双面板布局</li>
+</ul>
+
+<p>然后添加这两个文件:</p>
+
+<p><ul>
+<li><code>res/values-large/layout.xml</code>:
+<pre>
+<resources>
+ <item name="main" type="layout">@layout/main_twopanes</item>
+</resources>
+</pre>
+</li>
+
+<li><code>res/values-sw600dp/layout.xml</code>:
+<pre>
+<resources>
+ <item name="main" type="layout">@layout/main_twopanes</item>
+</resources>
+</pre>
+
+</li>
+</ul></p>
+
+<p>后两个文件的内容相同,但它们并未实际定义布局。它们只是将 <PH>{@code main}</PH> 设置成了 <PH>{@code main_twopanes}</PH> 的别名。由于这些文件包含 <code>large</code> 和 <code>sw600dp</code> 选择器,因此无论 Android 版本如何,系统都会将这些文件应用到平板电脑和电视上(版本低于 3.2 的平板电脑和电视会匹配
+<PH>{@code large}</PH>,版本低于 3.2 的平板电脑和电视则会匹配 <code>sw600dp</code>)。</p>
+
+
+<h2 id="TaskUseOriQuali">使用屏幕方向限定符</h2>
+
+<p>某些布局会同时支持横向模式和纵向模式,但您可以通过调整优化其中大部分布局的效果。在新闻阅读器示例应用中,每种屏幕尺寸和屏幕方向下的布局行为方式如下所示:</p>
+
+<p><ul>
+<li><b>小屏幕,纵向</b>:单面板,带徽标</li>
+<li><b>小屏幕,横向</b>:单面板,带徽标</li>
+<li><b>7 英寸平板电脑,纵向</b>:单面板,带操作栏</li>
+<li><b>7 英寸平板电脑,横向</b>:双面板,宽,带操作栏</li>
+<li><b>10 英寸平板电脑,纵向</b>:双面板,窄,带操作栏</li>
+<li><b>10 英寸平板电脑,横向</b>:双面板,宽,带操作栏</li>
+<li><b>电视,横向</b>:双面板,宽,带操作栏</li>
+</ul></p>
+
+<p>因此,这些布局中的每一种都定义在了 <code>res/layout/</code> 目录下的某个 XML 文件中。为了继续将每个布局分配给各种屏幕配置,该应用会使用布局别名将两者相匹配:</p>
+
+<p><code>res/layout/onepane.xml:</code></p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
+
+<p><code>res/layout/onepane_with_bar.xml:</code></p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane_with_bar.xml all}
+
+<p><code>res/layout/twopanes.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
+
+<p><code>res/layout/twopanes_narrow.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes_narrow.xml all}
+
+<p>既然您已定义了所有可能的布局,那就只需使用配置限定符将正确的布局映射到各种配置即可。您现在只需使用布局别名技术即可做到这一点:</p>
+
+<p><code>res/values/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values/layouts.xml all}
+
+<p><code>res/values-sw600dp-land/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-land/layouts.xml
+all}
+
+<p><code>res/values-sw600dp-port/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-port/layouts.xml
+all}
+
+<p><code>res/values-large-land/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-land/layouts.xml all}
+
+<p><code>res/values-large-port/layouts.xml</code>:</p>
+{@sample development/samples/training/multiscreen/newsreader/res/values-large-port/layouts.xml all}
+
+
+
+<h2 id="TaskUse9Patch">使用自动拉伸位图</h2>
+
+<p>支持各种屏幕尺寸通常意味着您的图片资源还必须能适应各种尺寸。例如,无论要应用到什么形状的按钮上,按钮背景都必须能适应。</p>
+
+<p>如果在可以更改尺寸的组件上使用了简单的图片,您很快就会发现显示效果多少有些不太理想,因为系统会在运行时平均地拉伸或收缩您的图片。解决方法为使用自动拉伸位图,这是一种格式特殊的 PNG 文件,其中会指明可以拉伸以及不可以拉伸的区域。</p>
+
+<p>因此,如果设计的是用于尺寸可变的组件上的位图,请务必使用自动拉伸技术。要将某个位图转换成自动拉伸位图,您可以先准备好普通图片(图 4,放大了 4 倍以便清楚显示)。</p>
+
+<img src="{@docRoot}images/training/button.png" />
+<p class="img-caption"><strong>图 4</strong>。<code>button.png</code></p>
+
+<p>然后通过 SDK 的 <ode
+href="{@docRoot}tools/help/draw9patch.html"><code>draw9patch</code></a> 实用工具(位于 <code>tools/</code> 目录中)运行该图片,您可以在该工具中绘制像素以标出要拉伸的区域以及左侧和顶部的边界。您还可以沿右侧和底部边界绘制像素以标出用于放置内容的区域,具体如图 5 所示。</p>
+
+<img src="{@docRoot}images/training/button_with_marks.png" />
+<p class="img-caption"><strong>图 5</strong>。<code>button.9.png</code></p>
+
+<p>请注意沿边界显示的黑色像素。顶部和左侧边界上的像素用于指定可以拉伸的图片区域,右侧和底部边界上的像素则用于指定放置内容的区域。</p>
+
+<p>另请注意 <code>.9.png</code> 的扩展名。您必须使用此扩展名,因为系统框架需要通过此扩展名确定相关图片是自动拉伸位图,而不是普通 PNG 图片。</p>
+
+<p>如果您将此背景应用到某个组件(通过设置 <code>android:background="@drawable/button"</code>),系统框架就会正确拉伸图片以适应按钮的尺寸,具体如图 6 中的各种尺寸所示。</p>
+
+<img src="{@docRoot}images/training/buttons_stretched.png" />
+<p class="img-caption"><strong>图 6</strong>。在各种尺寸下使用 <code>button.9.png</code> 自动拉伸位图的按钮。</p>
+
diff --git a/docs/html/legal.jd b/docs/html/legal.jd
new file mode 100644
index 0000000..575f016
--- /dev/null
+++ b/docs/html/legal.jd
@@ -0,0 +1,129 @@
+page.title=Legal Notice
+fullpage=1
+@jd:body
+
+<div class="wrap" style="width:940px;">
+
+<h1>Legal Notice</h1>
+
+<p>Android is an open platform that's freely available to you as an app developer. You can
+immediately download the Android SDK, develop apps, and distribute them to the world without any
+registration or fees.</p>
+
+<p>Android is developed by Google Inc. and the <a
+href="http://www.openhandsetalliance.com/">Open Handset Alliance</a>. We've made it available to you
+as a development platform pursuant to our commitment to openness, freedom, and innovation in
+mobile.</p>
+
+<p>To start developing apps for Android, <a
+href="{@docRoot}sdk/index.html">download the free Android SDK</a>.</p>
+
+
+
+<h2 id="Brands">Android Brands</h2>
+
+<p>The "Android" name and <img src="images/android-logo.png" alt="Android"
+style="margin:0;padding:0 2px;vertical-align:baseline" /> logo are trademarks of Google Inc.
+You may not use the logo or the logo's custom typeface.</p>
+
+<p>You may use the word "Android" in a product name only as a descriptor, such as "for Android"
+and the first instance should be followed by a TM symbol, "for Android™." In other
+messaging, the word "Android" may be used in text as a descriptor, as long as it is followed by a
+proper generic term (for example, "Android™ application"). Any use of the Android name
+must include footer attribution in your communications: "Android is a trademark of Google Inc."</p>
+
+<p>The Android Robot logo <img src="images/robot-tiny.png" alt=""
+style="margin:0;padding:0;vertical-align:baseline" /> can be used, reproduced, and modified freely
+in marketing communications. Our standard color value for print is PMS 376C. Our online hex color is
+#A4C639. The Android Robot logo is licensed under the terms of the <a
+href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attribution</a> license and any
+use of it must be attributed as such.</p>
+
+<p>For more information about Android brands, see the <a
+href="http://www.android.com/developers/branding.html">Android Branding Guidelines</a>.</p>
+
+
+
+<h2 id="WebSite">Web Site Content</h2>
+
+<p>We are pleased to license the Android documentation and sample code on this web site under terms
+that encourage you to take, modify, reuse, re-purpose, and remix the content as you see fit. The
+documentation content on this web site is made available to you as part of the <a
+href="http://source.android.com">Android Open Source Project</a>. This documentation, including any
+code shown in it, is licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache
+2.0 license</a>. All other content on this site, except the license documents themselves and as
+otherwise noted, is licensed under the <a
+href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attribution 2.5</a> license.
+</p>
+
+<p>For more information about licenses provided for the content of this web site and the
+restrictions for re-use, read the complete <a href="license.html">Content License</a>.</p>
+
+<p>Your use of this site is subject to <a href="http://www.google.com/policies/">Google's Privacy
+Policy & Terms of Service</a>.</p>
+
+
+
+<h2 id="Other">Other Android Services</h2>
+
+<p>Google provides other optional services for your Android apps that have their own legal terms and
+restrictions. Such services include:</p>
+
+<dl>
+ <dt>Eclipse Android Developer Tools Plugin</dt>
+ <dd>If you're developing apps with the Eclipse IDE, we offer a free plugin called the
+<a href="{@docRoot}tools/sdk/eclipse-adt.html">Android Developer Tools</a> (ADT) to speed up your
+development and debugging. Certain code within the ADT plugin and other packages available
+from the SDK Manager require that you agree to terms and conditions for use, reproduction and
+distribution upon installation.</dd>
+
+ <dt>Google Play</dt>
+ <dd>Google Play is a publicly available service through which you can distribute your apps for
+Android-powered devices. Google Play not only makes your app available to millions of devices, but
+also offers your app powerful services such as in-app billing and license verification. In order to
+distribute your apps on Google Play and use the associated services, you must agree to the Developer
+Distribution Agreement and acquire a valid Developer Account.
+ <p><a
+href="http://www.android.com/us/developer-distribution-agreement.html">Developer Distribution
+Agreement</a>, <a
+href="http://www.android.com/us/developer-content-policy.html#showlanguages">Developer Program
+Policies</a></p></dd>
+
+ <dt>Google Maps API</dt>
+ <dd>The Android Maps APIs are a collection of services (including, but not limited to, the
+MapView and MapActivity classes) that allow you to include
+maps, geocoding, geolocation, and other content from Google and its content providers in your
+Android
+apps. If you want to develop an Android app that displays Google Maps data, you must agree
+to the terms of service, register, and get an API Key. Registration is free.
+ <p><a
+href="https://developers.google.com/maps/documentation/android/maps-api-signup"
+>Google Maps Android API Key Signup</a>, <a href="http://m.google.com/legalnotices">Mobile Legal
+Notices</a></p>
+ </dd>
+
+ <dt>Android Cloud to Device Messaging</dt>
+ <dd>Android Cloud to Device Messaging (C2DM) is a service that helps you send data from
+your servers to your users' Android devices. The service provides a simple, lightweight
+mechanism that your servers can use to tell your Android app to contact your server directly to
+fetch updated app or user data. Before you can sign up for Android Cloud to Device Messaging, you
+must agree to the terms of a legal agreement between you and Google. Registration is free.
+ <p><a href="https://developers.google.com/android/c2dm/terms">Android Cloud to Device
+Messaging Terms of Service</a></p>
+ </dd>
+
+ <dt>Android Backup Service</dt>
+ <dd>Android Backup Service is integrated with Android's data backup framework to perform data
+backup and restore for most devices running Android 2.2 or greater, using Google servers and a
+backup transport on the device. Before you can sign up for Android Backup Service, you
+must agree to the terms of a legal agreement between you and Google. Registration is free.
+ <p><a href="https://developers.google.com/android/backup/terms">Android Backup Service
+Terms of Service</a></p>
+ </dd>
+</dl>
+
+<p>Any and all other services available for Android but not documented on <a
+href="http://developer.android.com">developer.android.com</a> are subject to their own terms, as
+documented on their respective web sites. </p>
+
+</div>
\ No newline at end of file
diff --git a/docs/html/license.jd b/docs/html/license.jd
index 83cd470..a9af038 100644
--- a/docs/html/license.jd
+++ b/docs/html/license.jd
@@ -1,15 +1,13 @@
page.title=Content License
-hide_license_footer=true
+fullpage=1
@jd:body
-<div id="mainBodyFluid">
-<h1>Content License</h1>
-
-<p>For the purposes of licensing, the content of this site is divided
+<div class="wrap" style="width:940px;">
+ <h1>Content License</h1>
+<p>For the purposes of licensing, the content of this web site is divided
into two categories:</p>
<ul>
- <li>Documentation content, found under the "Dev Guide" and "Reference"
- tabs, including both static content and content extracted from source
+ <li>Documentation content, including both static documentation and content extracted from source
code modules, as well as sample code, and </li>
<li>All other site content</li>
</ul>
@@ -31,6 +29,10 @@
covering the source code module will apply to the documentation
extracted from it. </p>
+<p>Third-party components of this site such as JavaScript libraries are included in the Android
+Open Source Project under the licenses specified by their authors. For information about these
+licenses, refer to the source files in the Android Open Source Project.</p>
+
<p>All other content on this site, except the license documents themselves
and as otherwise noted, is licensed under the <a
href="http://creativecommons.org/licenses/by/2.5/">Creative Commons
@@ -42,17 +44,18 @@
ask that you give proper <a href="#attribution">attribution</a>. </p>
-<h3 id="terms">Terms of Use</h3>
+<h2 id="terms">Terms of Use</h2>
<p>We are pleased to license the Android documentation and sample code under
terms that encourage you to take, modify, reuse, re-purpose, and remix the
-content as you see fit. Except as noted in the Restrictions section below, you
+content as you see fit. Except as noted in the <a href="#restrictions">Restrictions</a> section
+below, you
are free to use the documentation content in your own creations. For example,
you could quote the text in a book, cut-and-paste sections to your blog, record
it as an audiobook for the visually impaired, or even translate it. </p>
-<h3 id="restrictions">Restrictions</h3>
+<h2 id="restrictions">Restrictions</h2>
<ul>
<li>While the documentation itself is available to you under the Apache 2.0
@@ -60,9 +63,11 @@
included in that license.</li>
<li>Google's trademarks and other brand features (including the
-ANDROID stylized typeface logo) are not included in the license.
-Please see <a href="http://www.google.com/permissions/guidelines.html">
-Guidelines for Third Party Use of Google Brand Features</a> for
+<img src="images/android-logo.png" alt="Android"
+style="margin:0;padding:0 2px;vertical-align:baseline" /> stylized typeface logo) are not included
+in the license.
+Please see <a
+href="http://www.android.com/developers/branding.html">Android Branding Guidelines</a> for
information about this usage. </li>
<li>In some cases, a page may include content, such as an image, that is not
@@ -76,9 +81,8 @@
documentation is subject to the conditions detailed in the <a
href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 license</a>.</li>
</ul>
-</h3>
-<h3 id="attribution">Attribution</h3>
+<h2 id="attribution">Attribution</h2>
<p>
Proper attribution is required when you reuse or create modified
versions of content that appears on a page made available under the
@@ -95,49 +99,47 @@
are producing the work. There are several typical ways in which this
might apply:
</p>
-<h4>Exact Reproductions</h4>
+<h3>Exact Reproductions</h3>
<p>
If your online work <em>exactly reproduces</em> text or images from this
site, in whole or in part, please include a paragraph at the bottom
of your page that reads:
</p>
-<blockquote>
+<p style="margin-left:20px;font-style:italic">
Portions of this page are reproduced from work created and <a
href="http://code.google.com/policies.html">shared by the Android Open Source Project</a>
and used according to terms described in the <a
href="http://creativecommons.org/licenses/by/2.5/">Creative Commons
2.5 Attribution License</a>.
-</blockquote>
+</p>
<p>
Also, please link back to the original source page so that readers can
refer there for more information.
</p>
-<h4>Modified Versions</h4>
+<h3>Modified Versions</h3>
<p>
If your online work shows <em>modified</em> text or images based on
the content from this site, please include a paragraph at the bottom of
your page that reads:
</p>
-<blockquote>
+<p style="margin-left:20px;font-style:italic">
Portions of this page are modifications based on work created and <a
href="http://code.google.com/policies.html">shared by the Android Open
Source Project</a> and used according to terms described in the <a
href="http://creativecommons.org/licenses/by/2.5/">Creative Commons
2.5 Attribution License</a>.
-</blockquote>
+</p>
<p>
Again, please link back to the original source page so that readers can
refer there for more information. This is even more important when
the content has been modified.
</p>
-<h4>Other Media</h4>
+<h3>Other Media</h3>
<p>
If you produce non-hypertext works, such as books, audio, or
video, we ask that you make a best effort to include a spoken or
written attribution in the spirit of the messages above.
</p>
-</div>
-
-
+</div>
diff --git a/docs/html/live/index.jd b/docs/html/live/index.jd
index 3885725..9729727 100644
--- a/docs/html/live/index.jd
+++ b/docs/html/live/index.jd
@@ -1,7 +1,8 @@
page.title=Live
+fullpage=1
@jd:body
-<div id="mainBodyFixed" style="padding-left:2em;">
+<div class="wrap" style="width:940px;">
<h1>Android Developers Live</h1>
@@ -61,4 +62,4 @@
</div><!-- end mainBodyRight -->
</div><!-- interviewBlock -->
- </div><!-- end mainBodyFixed -->
+</div><!-- end mainBodyFixed -->
diff --git a/docs/html/mwc2010/index.html b/docs/html/mwc2010/index.html
deleted file mode 100644
index c91386f..0000000
--- a/docs/html/mwc2010/index.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-<head>
-<title>Redirecting...</title>
-<meta http-equiv="refresh" content="0;url=http://sites.google.com/site/androidmwc/home">
-</head>
-<body>
-</body>
-</html>
diff --git a/docs/html/offline.jd b/docs/html/offline.jd
index edd8eb0..73da779 100644
--- a/docs/html/offline.jd
+++ b/docs/html/offline.jd
@@ -23,13 +23,13 @@
<div id="qv">
<h2>Get Started</h2>
<ul>
- <li>Create a <a href="{@docRoot}resources/tutorials/hello-world.html">Hello World</a>
+ <li>Create a <a href="{@docRoot}training/basics/firstapp/index.html">Building Your First App</a>
application</li>
<li>Read <a href="{@docRoot}resources/browser.html?tag=sample">Sample Code</a>,
especially <a href="{@docRoot}resources/samples/ApiDemos/index.html">API Demos</a></li>
- <li>Read the <a href="{@docRoot}guide/topics/fundamentals/index.html">Application
+ <li>Read the <a href="{@docRoot}guide/components/index.html">Application
Fundamentals</a></li>
- <li>Read the <a href="{@docRoot}guide/developing/index.html">Introduction</a> for using the SDK
+ <li>Read the <a href="{@docRoot}tools/workflow/index.html">Introduction</a> for using the SDK
tools</li>
</ul>
</div>
@@ -37,7 +37,7 @@
<h3>If you've downloaded the Android SDK for the first time</h3>
-<p>Follow the guide to <a href="{@docRoot}sdk/installing.html">Installing the Android SDK</a>, which
+<p>Follow the guide to <a href="{@docRoot}sdk/installing/index.html">Installing the Android SDK</a>, which
will help you setup your development environment.</p>
<h3>If you've installed new SDK components using the Android SDK Manager</h3>
diff --git a/docs/html/resources/articles/avoiding-memory-leaks.jd b/docs/html/resources/articles/avoiding-memory-leaks.jd
deleted file mode 100644
index 395f590..0000000
--- a/docs/html/resources/articles/avoiding-memory-leaks.jd
+++ /dev/null
@@ -1,111 +0,0 @@
-page.title=Avoiding Memory Leaks
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-
-<p>Android applications are, at least on the T-Mobile G1, limited
-to 16 MB of heap. It's both a lot of memory for a phone and yet very
-little for what some developers want to achieve. Even if you do not
-plan on using all of this memory, you should use as little as possible
-to let other applications run without getting them killed. The more
-applications Android can keep in memory, the faster it will be for the
-user to switch between his apps. As part of my job, I ran into memory
-leaks issues in Android applications and they are most of the time due
-to the same mistake: keeping a long-lived reference to a
-{@link android.content.Context Context}.</p>
-
-<p>On Android, a <code>Context</code> is used for many operations
- but mostly to load and access resources. This is why all the widgets
-receive a <code>Context</code> parameter in their constructor. In a
-regular Android application, you usually have two kinds of
-<code>Context</code>, {@link android.app.Activity} and
-{@link android.app.Application}. It's usually the first one that
-the developer passes to classes and methods that need a <code>Context</code>:</p>
-
-<pre class="prettyprint">@Override
-protected void onCreate(Bundle state) {
- super.onCreate(state);
-
- TextView label = new TextView(this);
- label.setText("Leaks are bad");
-
- setContentView(label);
-}
-</pre>
-
-<p>This means that views have a reference to the entire activity and
-therefore to anything your activity is holding onto; usually the entire
-View hierarchy and all its resources. Therefore, if you leak the <code>Context</code>
-("leak" meaning you keep a reference to it thus preventing the GC from
-collecting it), you leak a lot of memory. Leaking an entire activity
-can be really easy if you're not careful.</p>
-
-<p>When the screen orientation changes the system will, by default,
-destroy the current activity and create a new one while preserving its
-state. In doing so, Android will reload the application's UI from the
-resources. Now imagine you wrote an application with a large bitmap
-that you don't want to load on every rotation. The easiest way to keep
-it around and not having to reload it on every rotation is to keep in a
-static field:</p>
-
-<pre class="prettyprint">private static Drawable sBackground;
-
-@Override
-protected void onCreate(Bundle state) {
- super.onCreate(state);
-
- TextView label = new TextView(this);
- label.setText("Leaks are bad");
-
- if (sBackground == null) {
- sBackground = getDrawable(R.drawable.large_bitmap);
- }
- label.setBackgroundDrawable(sBackground);
-
- setContentView(label);
-}
-</pre>
-
-<p>This code is very fast and also very wrong; it leaks the first activity
-created upon the first screen orientation change. When a
-{@link android.graphics.drawable.Drawable Drawable} is attached to a view, the view is set as a
-{@link android.graphics.drawable.Drawable#setCallback(android.graphics.drawable.Drawable.Callback) callback}
-on the drawable. In the code snippet above, this means the drawable has a
-reference to the <code>TextView</code> which itself has a reference to the
-activity (the <code>Context</code>) which in turns has references to
-pretty much anything (depending on your code.)</p>
-
-<p>This example is one of the simplest cases of leaking the
-<code>Context</code> and you can see how we worked around it in the
-<a href="http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=blob;f=src/com/android/launcher/LauncherModel.java;h=0ef2a806b767142b28b2ff3b37f21f4ca16c355d;hb=cupcake">Home screen's source code</a>
-(look for the <code>unbindDrawables()</code> method) by setting the stored
-drawables' callbacks to null when the activity is destroyed. Interestingly
-enough, there are cases where you can create a chain of leaked contexts,
-and they are bad. They make you run out of memory rather quickly.</p>
-
-<p>There are two easy ways to avoid context-related memory leaks. The most
-obvious one is to avoid escaping the context outside of its own scope. The
-example above showed the case of a static reference but inner classes and
-their implicit reference to the outer class can be equally dangerous. The
-second solution is to use the <code>Application</code> context. This
-context will live as long as your application is alive and does not depend
-on the activities life cycle. If you plan on keeping long-lived objects
-that need a context, remember the application object. You can obtain it
-easily by calling
-{@link android.content.Context#getApplicationContext() Context.getApplicationContext()}
-or {@link android.app.Activity#getApplication() Activity.getApplication()}.</p>
-
-<p>In summary, to avoid context-related memory leaks, remember the following:</p>
-<ul>
-<li>Do not keep long-lived references to a context-activity (a reference
-to an activity should have the same life cycle as the activity itself)</li>
-<li>Try using the context-application instead of a context-activity</li>
-<li>Avoid non-static inner classes in an activity if you don't control
-their life cycle, use a static inner class and make a weak reference to
-the activity inside. The solution to this issue is to use a static inner
-class with a {@link java.lang.ref.WeakReference WeakReference} to the
-outer class, as done in <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/view/ViewRoot.java;h=9d7a124cb01ab94bf53e34f6e5e8a07f81e2423c;hb=master">ViewRoot</a>
-and its W inner class for instance</li>
-<li>A garbage collector is not an insurance against memory leaks</li>
-</ul>
diff --git a/docs/html/resources/articles/backward-compatibility.jd b/docs/html/resources/articles/backward-compatibility.jd
deleted file mode 100644
index f96d587..0000000
--- a/docs/html/resources/articles/backward-compatibility.jd
+++ /dev/null
@@ -1,252 +0,0 @@
-page.title=Backward Compatibility for Applications
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a></li>
- </ol>
-
-</div>
-</div>
-
-<p>A variety of Android-powered devices are now available to consumers from carriers
-in geographies around the world. Across those devices, a range of Android
-platform versions are in use, some running the latest version of the platform,
-others running older versions. As a developer, you need to consider the approach
-to backward compatibility that you will take in your application — do you
-want to allow your application to run on all devices, or just those running the
-latest software? In some cases it will be useful to employ the newer APIs on
-devices that support them, while continuing to support older devices. </p>
-
-<h3>Setting the minSdkVersion</h3>
-<p>If the use of a new API is integral to the application — perhaps you
-need to record video using an API introduced in Android 1.5 (API Level 3)
-— you should add a <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><android:minSdkVersion></code></a>
- to the application's manifest, to ensure your app won't
-be installed on older devices. For example, if your application depends on an
-API introduced in API Level 3, you would specify "3" as the value of the minimum
-SDK version</a>:</p>
-
-<pre> <manifest>
- ...
- <uses-sdk android:minSdkVersion="3" />
- ...
- </manifest></pre>
-
-<p>However, if you want to add a useful but non-essential feature, such as
-popping up an on-screen keyboard even when a hardware keyboard is available, you
-can write your program in a way that allows it to use the newer features without
-failing on older devices.</p>
-
-<h3>Using reflection</h3>
-
-<p>Suppose there's a simple new call you want to use, like {@link
-android.os.Debug#dumpHprofData(java.lang.String)
-android.os.Debug.dumpHprofData(String filename)}. The {@link android.os.Debug}
-class has existed since Android 1.0, but the method is new in Anroid 1.5 (API
-Level 3). If you try to call it directly, your app will fail to run on devices
-running Android 1.1 or earlier.</p>
-
-<p>The simplest way to call the method is through reflection. This requires
-doing a one-time lookup and caching the result in a <code>Method</code> object.
-Using the method is a matter of calling <code>Method.invoke</code> and un-boxing
-the result. Consider the following:</p>
-
-<pre>public class Reflect {
- private static Method mDebug_dumpHprofData;
-
- static {
- initCompatibility();
- };
-
- private static void initCompatibility() {
- try {
- mDebug_dumpHprofData = Debug.class.getMethod(
- "dumpHprofData", new Class[] { String.class } );
- /* success, this is a newer device */
- } catch (NoSuchMethodException nsme) {
- /* failure, must be older device */
- }
- }
-
- private static void dumpHprofData(String fileName) throws IOException {
- try {
- mDebug_dumpHprofData.invoke(null, fileName);
- } catch (InvocationTargetException ite) {
- /* unpack original exception when possible */
- Throwable cause = ite.getCause();
- if (cause instanceof IOException) {
- throw (IOException) cause;
- } else if (cause instanceof RuntimeException) {
- throw (RuntimeException) cause;
- } else if (cause instanceof Error) {
- throw (Error) cause;
- } else {
- /* unexpected checked exception; wrap and re-throw */
- throw new RuntimeException(ite);
- }
- } catch (IllegalAccessException ie) {
- System.err.println("unexpected " + ie);
- }
- }
-
- public void fiddle() {
- if (mDebug_dumpHprofData != null) {
- /* feature is supported */
- try {
- dumpHprofData("/sdcard/dump.hprof");
- } catch (IOException ie) {
- System.err.println("dump failed!");
- }
- } else {
- /* feature not supported, do something else */
- System.out.println("dump not supported");
- }
- }
-}</pre>
-
-<p>This uses a static initializer to call <code>initCompatibility</code>,
-which does the method lookup. If that succeeds, it uses a private
-method with the same semantics as the original (arguments, return
-value, checked exceptions) to do the call. The return value (if it had
-one) and exception are unpacked and returned in a way that mimics the
-original. The <code>fiddle</code> method demonstrates how the
-application logic would choose to call the new API or do something
-different based on the presence of the new method.</p>
-
-<p>For each additional method you want to call, you would add an additional
-private <code>Method</code> field, field initializer, and call wrapper to the
-class.</p>
-
-<p>This approach becomes a bit more complex when the method is declared in a
-previously undefined class. It's also much slower to call
-<code>Method.invoke()</code> than it is to call the method directly. These
-issues can be mitigated by using a wrapper class.</p>
-
-<h3>Using a wrapper class</h3>
-
-<p>The idea is to create a class that wraps all of the new APIs exposed by a new
-or existing class. Each method in the wrapper class just calls through to the
-corresponding real method and returns the same result.</p>
-
-<p>If the target class and method exist, you get the same behavior you would get
-by calling the class directly, with a small amount of overhead from the
-additional method call. If the target class or method doesn't exist, the
-initialization of the wrapper class fails, and your application knows that it
-should avoid using the newer calls.</p>
-
-<p>Suppose this new class were added:</p><pre>public class NewClass {
- private static int mDiv = 1;
-
- private int mMult;
-
- public static void setGlobalDiv(int div) {
- mDiv = div;
- }
-
- public NewClass(int mult) {
- mMult = mult;
- }
-
- public int doStuff(int val) {
- return (val * mMult) / mDiv;
- }
-}</pre>
-
-<p>We would create a wrapper class for it:</p>
-
-<pre>class WrapNewClass {
- private NewClass mInstance;
-
- /* class initialization fails when this throws an exception */
- static {
- try {
- Class.forName("NewClass");
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /* calling here forces class initialization */
- public static void checkAvailable() {}
-
- public static void setGlobalDiv(int div) {
- NewClass.setGlobalDiv(div);
- }
-
- public WrapNewClass(int mult) {
- mInstance = new NewClass(mult);
- }
-
- public int doStuff(int val) {
- return mInstance.doStuff(val);
- }
-}</pre>
-
-<p>This has one method for each constructor and method in the original, plus a
-static initializer that tests for the presence of the new class. If the new
-class isn't available, initialization of <code>WrapNewClass</code> fails,
-ensuring that the wrapper class can't be used inadvertently. The
-<code>checkAvailable</code> method is used as a simple way to force class
-initialization. We use it like this:</p>
-
-<pre>public class MyApp {
- private static boolean mNewClassAvailable;
-
- /* establish whether the "new" class is available to us */
- static {
- try {
- WrapNewClass.checkAvailable();
- mNewClassAvailable = true;
- } catch (Throwable t) {
- mNewClassAvailable = false;
- }
- }
-
- public void diddle() {
- if (mNewClassAvailable) {
- WrapNewClass.setGlobalDiv(4);
- WrapNewClass wnc = new WrapNewClass(40);
- System.out.println("newer API is available - " + wnc.doStuff(10));
- } else {
- System.out.println("newer API not available");
- }
- }
-}</pre>
-
-<p>If the call to <code>checkAvailable</code> succeeds, we know the new class is
-part of the system. If it fails, we know the class isn't there, and adjust our
-expectations accordingly. It should be noted that the call to
-<code>checkAvailable</code> will fail before it even starts if the bytecode
-verifier decides that it doesn't want to accept a class that has references to a
-nonexistent class. The way this code is structured, the end result is the same
-whether the exception comes from the verifier or from the call to
-<code>Class.forName</code>.</p>
-
-<p>When wrapping an existing class that now has new methods, you only need to
-put the new methods in the wrapper class. Invoke the old methods directly. The
-static initializer in <code>WrapNewClass</code> would be augmented to do a
-one-time check with reflection.</p>
-
-<h3>Testing is key</h3>
-
-<p>You must test your application on every version of the Android framework that
-is expected to support it. By definition, the behavior of your application will
-be different on each. Remember the mantra: if you haven't tried it, it doesn't
-work.</p>
-
-<p>You can test for backward compatibility by running your application in an
-emulator that uses an older version of the platform. The Android SDK allows you
-to do this easily by creating "Android Virtual Devices" with different API
-levels. Once you create the AVDs, you can test your application with old and new
-versions of the system, perhaps running them side-by-side to see the
-differences. More information about emulator AVDs can be found in <a
-href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a> and
-from <code>emulator -help-virtual-device</code>.</p>
\ No newline at end of file
diff --git a/docs/html/resources/articles/can-i-use-this-intent.jd b/docs/html/resources/articles/can-i-use-this-intent.jd
deleted file mode 100644
index 7787d31e..0000000
--- a/docs/html/resources/articles/can-i-use-this-intent.jd
+++ /dev/null
@@ -1,71 +0,0 @@
-page.title=Can I Use this Intent?
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>Android offers a very powerful and yet easy-to-use message type called
-an <a href="{@docRoot}guide/topics/intents/intents-filters.html">intents</a>.
-You can use intents to turn applications into high-level libraries and
-make code modular and reusable. The Android Home screen and AnyCut
-applications, for instance, use intents extensively to create shortcuts. </p>
-
-<p>While it is nice to be able to make use of a loosely coupled
-API, there is no guarantee that the intent you send will be received by
-another application. This happens in particular with third-party apps, like
-<a href="http://code.google.com/p/apps-for-android/source/browse/trunk/Panoramio">Panoramio</a>
-and its RADAR intent.</p>
-
-<p>This article describes a technique you can use to find out whether the system
-contains any application capable of responding to the intent you want to use.
-The example below shows a helper method that queries the system package manager
-to determine whether there's an app that can respond to a specified intent. Your
-application can pass an intent to the method and then, for example, show or hide
-user options that the user would normally use to trigger the intent. </p>
-
-<pre class="prettyprint">/**
- * Indicates whether the specified action can be used as an intent. This
- * method queries the package manager for installed packages that can
- * respond to an intent with the specified action. If no suitable package is
- * found, this method returns false.
- *
- * @param context The application's environment.
- * @param action The Intent action to check for availability.
- *
- * @return True if an Intent with the specified action can be sent and
- * responded to, false otherwise.
- */
-public static boolean isIntentAvailable(Context context, String action) {
- final PackageManager packageManager = context.getPackageManager();
- final Intent intent = new Intent(action);
- List<ResolveInfo> list =
- packageManager.queryIntentActivities(intent,
- PackageManager.MATCH_DEFAULT_ONLY);
- return list.size() > 0;
-}
-</pre>
-
-<p>Here is how you could use the helper method:</p>
-
-<pre class="prettyprint">@Override
-public boolean onPrepareOptionsMenu(Menu menu) {
- final boolean scanAvailable = isIntentAvailable(this,
- "com.google.zxing.client.android.SCAN");
-
- MenuItem item;
- item = menu.findItem(R.id.menu_item_add);
- item.setEnabled(scanAvailable);
-
- return super.onPrepareOptionsMenu(menu);
-}
-</pre>
-
-<p>In this example, the menu is grayed out if the <em>Barcode Scanner</em>
-application is not installed. </p>
-
-<p>Another, simpler, way to do this is to catch the
-<code>ActivityNotFoundException</code> when calling <code>startActivity()</code>
-but it only lets you react to the problem, you cannot predict it and update the
-UI accordingly to prevent the user from doing something that won't work. The
-technique described here can also be used at startup time to ask the user
-whether he'd like to install the missing package, you can then simply redirect
-him to Google Play by using the appropriate URI.</p>
\ No newline at end of file
diff --git a/docs/html/resources/articles/contacts.jd b/docs/html/resources/articles/contacts.jd
deleted file mode 100644
index 374587b..0000000
--- a/docs/html/resources/articles/contacts.jd
+++ /dev/null
@@ -1,424 +0,0 @@
-page.title=Using the Contacts API
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>Starting from Android 2.0 (API Level 5), the Android platform provides an
-improved Contacts API for managing and integrating contacts from multiple
-accounts and from other data sources. To handle overlapping data from multiple
-sources, the contacts content provider aggregates similar contacts and presents
-them to users as a single entity. This article describes how to use the new API
-to manage contacts.</p>
-
-<p>The new Contacts API is defined in the
-{@link android.provider.ContactsContract android.provider.ContactsContract}
-and related classes. The older API is still supported, although deprecated.
-If you have an existing application that uses the older API,
-see <a href="#legacy">Considerations for legacy apps</a>, below, for ideas
-on how to support the Contacts API in your app.</p>
-
-<p>If you'd like to look at an applied example of how to use the new Contacts
-API, including how to support both the new and older API in a single app,
-please see the <a
-href="{@docRoot}resources/samples/BusinessCard/index.html">Business Card
-sample application</a>.</p>
-
-<h3>Data structure of Contacts</h3>
-
-<p>In the new Contacts API, data is laid out in three primary tables:
-<em>contacts</em>, <em>raw contacts</em>, and <em>data</em>, a structure that
-is slightly different from that used in the older API. The new structure
-allows the system to more easily store and manage information for a
-specific contact from multiple contacts sources. </p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center; width: 471px; height: 255px;" src="images/contacts-2.png" alt="" border="0">
-
-<ul>
-<li><code>Data</code> is a generic table that stores all of the data points
-associated with a raw contact. Each row stores data of a specific kind —
-for example name, photo, email addresses, phone numbers, and group memberships.
-Each row is tagged with a MIME type to identify what type of data it can
-contain, across the entire column. Columns are generic and the type of data they
-contain is determined by the kind of data stored in each row. For example, if a
-row's data kind is <code>Phone.CONTENT_ITEM_TYPE</code>, then the first column
-stores the phone number, but if the data kind is
-<code>Email.CONTENT_ITEM_TYPE</code>, then the column stores the email address.
-
-<p>The {@link android.provider.ContactsContract.CommonDataKinds ContactsContract.CommonDataKinds}
-class provides subclasses corresponding to common MIME types for contacts data.
-If needed, your application or other contacts sources can define additional MIME
-types for data rows. For more information about the Data table and examples of
-how to use it, see {@link android.provider.ContactsContract.Data android.provider.ContactsContract.Data}.</p></li>
-
-<li>A row in the <code>RawContacts</code> table represents the set of
-<code>Data</code> and other information describing a person and associated with
-a single contacts source. For example, a row might define the data associated
-with a person's Google or Exchange account or Facebook friend. For more
-information, see
-{@link android.provider.ContactsContract.RawContacts ContactsContract.RawContacts}.</p>
-
-<li>A row in the <code>Contacts</code> table represents an aggregate of one or
-more <code>RawContacts</code> describing the same person (or entity).
-
-<p>As mentioned above, the Contacts content provider automatically aggregates
-Raw Contacts into a single Contact entry, where possible, since common data
-fields (such as name or email address) are likely to be stored in each raw
-contact. Since the aggregation logic maintains the entries in the Contact rows,
-the entries can be read but should not be modified. See the section <a
-href="#aggregation">Aggregation of contacts</a>, below, for more details,
-including and information on how to
-control aggregation.</li>
-
-</ul>
-
-<p>When displaying contacts to users, applications should typically operate on
-the Contacts level, since it provides a unified, aggregated view of contacts
-from various underlying sources. </p>
-
-<h4>Example: Inserting a Phone Number</h4>
-
-<p>To insert a phone number using the new APIs you'll need the ID of the Raw
-Contact to attach the phone number to, then you'll need to create a Data
-row:</p>
-
-<pre>import android.provider.ContactsContract.CommonDataKinds.Phone;
-...
-ContentValues values = new ContentValues();
-values.put(Phone.RAW_CONTACT_ID, rawContactId);
-values.put(Phone.NUMBER, phoneNumber);
-values.put(Phone.TYPE, Phone.TYPE_MOBILE);
-Uri uri = getContentResolver().insert(Phone.CONTENT_URI, values);</pre>
-
-
-<h3 id="aggregation">Aggregation of contacts</h3>
-
-<p>When users sync contacts from multiple sources, several contacts might refer
-to the same person or entity, but with slightly different (or overlapping) data.
- For example, "Bob Parr" might be a user's co-worker and also his personal
-friend, so the user might have his contact information stored in both a
-corporate email account and a personal account. To provide a simplified view for
-the user, the system locates such overlapping contacts and combines them into a
-single, aggregate contact. </p>
-
-<p>The system automatically aggregates contacts by default. However, if needed,
-your application can control how the system handles aggregation or it can
-disable aggregation altogether, as described in the sections below.</p>
-
-<h4>Automatic aggregation</h4>
-
-<p>When a raw contact is added or modified, the system looks for matching
-(overlapping) raw contacts with which to aggregate it. It may not find any
-matching raw contacts, in which case it will create an aggregate contact that
-contains just the original raw contact. If it finds a single match, it creates a
-new contact that contains the two raw contacts. And it may even find multiple
-similar raw contacts, in which case it chooses the closest match. </p>
-
-<p>Two raw contacts are considered to be a match if at least one of these
-conditions is met:</p>
-
-<ul>
-<li>They have matching names.</li>
-<li>Their names consist of the same words but in different order
-(for example, "Bob Parr" and "Parr, Bob")</li>
-<li>One of them has a common short name for the other (for example,
-"Bob Parr" and "Robert Parr")</li>
-<li>One of them has just a first or last name and it matches the other
-raw contact. This rule is less reliable, so it only applies if the two
-raw contacts are also sharing some other data like a phone number, an
-email address or a nickname (for example, Helen ["elastigirl"] = Helen
-Parr ["elastigirl"])</li>
-<li>At least one of the two raw contacts is missing the name altogether
-and they are sharing a phone number, an email address or a nickname (for
-example, Bob Parr [incredible@android.com] = incredible@android.com).</li>
-</ul>
-
-<p>When comparing names, the system ignores upper/lower case differences
-(Bob=BOB=bob) and diacritical marks (Hélène=Helene). When comparing two
-phone numbers the system ignores special characters such as "*", "#",
-"(", ")", and whitespace. Also if the only difference between two numbers
-is that one has a country code and the other does not, then the system
-considers those to be a match (except for numbers in the Japan country code).</p>
-
-<p>Automatic aggregation is not permanent; any change of a constituent raw
-contact may create a new aggregate or break up an existing one.</p>
-
-<h4>Explicit aggregation</h4>
-
-<p>In some cases, the system's automatic aggregation may not meet the
-requirements of your application or sync adapter. There are two sets of APIs you
-can use to control aggregation explicitly: <em>aggregation modes</em> allow you
-to control automatic aggregation behaviors and <em>aggregation exceptions</em>
-allow you to override automated aggregation entirely.
-
-<p><strong>Aggregation modes</strong></p>
-
-<p>You can set an aggregation mode for each raw contact individually. To do so,
-add a mode constant as the value of the <code>AGGREGATION_MODE column</code> in
-the <code>RawContact</code> row. The mode constants available include: </p>
-
-<ul>
-<li><code>AGGREGATION_MODE_DEFAULT</code> — normal mode, automatic
-aggregation is allowed.</li>
-<li><code>AGGREGATION_MODE_DISABLED</code> — automatic aggregation is not
-allowed. The raw contact will not be aggregated.</li>
-<li><code>AGGREGATION_MODE_SUSPENDED</code> — automatic aggregation is
-deactivated. If the raw contact is already a part of an aggregated contact when
-aggregation mode changes to suspended, it will remain in the aggregate, even if
-it changes in such a way that it no longer matches the other raw contacts in the
-aggregate.</li>
-</ul>
-
-<p><strong>Aggregation exceptions</strong></p>
-
-<p>To keep two raw contacts unconditionally together or unconditionally apart,
-you can add a row to the
-{@link android.provider.ContactsContract.AggregationExceptions} table. Exceptions
-defined in the table override all automatic aggregation rules. </p>
-
-
-<h3>Loookup URI</h3>
-
-<p>The new Contacts API introduces the notion of a lookup key for a contact. If
-your application needs to maintain references to contacts, you should use lookup
-keys instead of the traditional row ids. You can acquire a lookup key from the
-contact itself, it is a column on the
-{@link android.provider.ContactsContract.Contacts} table. Once you have a lookup key,
-you can construct a URI in this way:</p>
-
-<pre>Uri lookupUri = Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI, lookupKey)</pre>
-
-<p>and use it like you would use a traditional content URI, for example: </p>
-
-<pre>Cursor c = getContentResolver().query(lookupUri, new String[]{Contacts.DISPLAY_NAME}, ...);
-try {
- c.moveToFirst();
- String displayName = c.getString(0);
-} finally {
- c.close();
-}</pre>
-
-<p>The reason for this complication is that regular contact row IDs are
-inherently volatile. Let's say your app stored a long ID of a contact. Then the
-user goes and manually joins the contact with some other contact. Now there is a
-single contact where there used to be two, and the stored long contact ID points
-nowhere.
-
-<p>The lookup key helps resolve the contact in this case. The key is a string
-that concatenates the server-side identities of the raw contacts. Your
-application can use that string to find a contact, regardless whether the raw
-contact is aggregated with others or not. </p>
-
-<p>If performance is a concern for your application, you might want to store
-both the lookup and the long ID of a contact and construct a lookup URI out of
-both IDs, as shown here:</p>
-
-<pre>Uri lookupUri = getLookupUri(contactId, lookupKey)</pre>
-
-<p>When both IDs are present in the URI, the system will try to use the long ID
-first. That is a very quick query. If the contact is not found, or if the one
-that is found has the wrong lookup key, the content provider will parse the
-lookup key and track down the constituent raw contacts. If your app
-bulk-processes contacts, you should maintain both IDs. If your app works with a
-single contact per user action, you probably don't need to bother with storing
-the long ID.</p>
-
-Android itself uses lookup URIs whenever there is a need to reference a contact,
-such as with shortcuts or Quick Contact, and also during editing or even viewing
-a contact. The latter case is less obvious — why would a contact ID change
-while we are simply viewing the contact? It could change because there might be
-a sync going in the background, and the contact might get automatically
-aggregated with another while being viewed.</p>
-
-<p>In summary: whenever you need to reference a contact, we recommend that you
-do so by its lookup URI.</p>
-
-
-<h3 id="legacy">Considerations for legacy applications</h3>
-
-<p>If you have an existing application that uses the older Contacts API,
-you should consider upgrading it to use the new API. You have four options: </p>
-
-<ul>
-<li>Leave it as-is and rely on the Contacts compatibility mode.</li>
-<li>Upgrade the app and discontinue support of pre-Android 2.0 platforms.</li>
-<li>Build a new version of the app for the new API, while keeping the old version available.</li>
-<li>Make the app use the right set of APIs depending on the platform where it is deployed. </li>
-</ul>
-
-<p>Let's consider these options one by one.</p>
-
-<h4>Using compatibility mode</h4>
-
-<p>Compatibility mode is the easiest option because you just leave the
-application as is, and it should run on Android 2.0 as long as it only uses
-public APIs. A couple examples of the use of non-public API include the use of
-explicit table names in nested queries and the use of columns that were not
-declared as public constants in the {@link android.provider.Contacts} class.
-</p>
-
-<p>Even if the application currently runs, you don't want to leave it like this
-for long. The main reason is that it will only have access to contacts from one
-account, namely the first Google account on the device. If the user opens other
-accounts in addition to or instead of a Google account, your application will
-not be able to access those contacts.</p>
-
-
-<h4>Upgrading to the new API and dropping support for older platforms</h4>
-
-<p>If your application will no longer target platforms older than
-Android 2.0, you can upgrade to the new API in this way:</p>
-
-<ul>
-<li>Replace all usages of {@link android.provider.Contacts} with calls to new
-API. After you are done, you should not see any deprecation warnings during
-application build. The new application will be able to take full advantage of
-multiple accounts and other new features of Android 2.0. </p>
-
-<li>In the application's manifest, update (or add) the
-<code>android:minSdkVersion</code> attribute to the
-<code><uses-sdk></code> element. To use the new Contacts API, you should
-set the value of the attribute to "5" (or higher, as appropriate). For more
-information about <code>android:minSdkVersion</code>, see the documentation for
-the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
-element. For more information about the value of the
-<code>minSdkVersion</code>, see <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a>.</li>
-</ul>
-
-<h4>Maintaining two applications</h4>
-
-<p>You may decide to have two different applications: one for pre-Android 2.0
-platforms and one for Android 2.0 and beyond. If so, here's what you'll need to do:</p>
-
-<ul>
- <li>Clone your existing app. </li>
- <li>Change the old application: </li>
- <ul>
- <li>At launch time, check the version of the SDK. The version of the SDK
-is available as {@link android.os.Build.VERSION#SDK android.os.Build.VERSION.SDK}.</li>
- <li>If the SDK version is greater or equal to 5 (Android 2.0), show a dialog
-suggesting to the user that it's time to go to Google Play and find a new version of
-the app. You can even provide a link to the new app on Google Play (see <a
-href="{@docRoot}guide/publishing/publishing.html#marketintent">Using Intents
-to Launch Google Play</a>). </li>
- </ul>
- <li>Change the new application:</li>
- <ul>
- <li>Replace all usages of the older Contacts API with calls to new API.
-The new application will be able to take full advantage of multiple accounts
-and other new features of Android 2.0. </li>
- <li>Modify that application's AndroidManifest.xml file: </li>
- <ul>
- <li>Give the application a new name and a new package name. Currently
-Google Play does not allow you to have two applications with the same
-name/package.</li>
- <li>Update (or add) the <code>android:minSdkVersion</code> attribute
-to the <code><uses-sdk></code> element. To use the new Contacts API,
-you should set the value of the attribute to "5" (or higher, as appropriate).</li>
- </ul>
- </ul>
- <li>Publish both apps on Google Play, the old app one as an upgrade and the
-other as new. Make sure to explain the difference between the apps in their
-descriptions.</li>
-</ul>
-
-<p>This plan has its disadvantages: </p>
-
-<ul>
-<li>The new application will not be able to read the old application's data.
-Application data can only be accessed by code living in the same package. So
-databases, shared preferences, and so on, will need to be populated from
-scratch.</li>
-<li>The upgrade process is too clunky for the user. Some users may choose
-to either stay with the crippled old version or uninstall altogether.</li>
-</ul>
-
-<h4>Supporting the old and new APIs in the same application</h4>
-
-<p>This is a bit tricky, but the result is worth the effort. You can
-build a single package that will work on any platform:</p>
-
-<p>Go through the existing application and factor out all access to
-{@link android.provider.Contacts} into one class, such as ContactAccessorOldApi.
-For example, if you have code like this:
-
-<pre> protected void pickContact() {
- startActivityForResult(new Intent(Intent.ACTION_PICK, People.CONTENT_URI), 0);
- }</pre>
-
-<p>it will change to:</p>
-
-
-<pre> private final ContactAccessorOldApi mContactAccessor = new ContactAccessorOldApi();
-
- void pickContact() {
- startActivityForResult(mContactAccessor.getContactPickerIntent(), 0);
- }</pre>
-
-<p>The corresponding method on ContactAccessorOldApi will look like this:</p>
-
-<pre> public Intent getContactPickerIntent() {
- return new Intent(Intent.ACTION_PICK, People.CONTENT_URI);
- }</pre>
-
-<p>Once you are done, you should see deprecation warnings coming only
-from ContactAccessorOldApi. </p>
-
-<p>Create a new abstract class ContactAccessor, make sure the abstract
-class has all method signatures from ContactAccessorOldApi. Make
-ContactAccessorOldApi extend ContactAccessor:</p>
-
-<pre> public abstract class ContactAccessor {
- public abstract Intent getContactPickerIntent();
- ...
- }</pre>
-
-<p>Create a new subclass of ContactAccessor, ContactAccessorNewApi and
-implement all methods using the new API:</p>
-
-<pre> public class ContactAccessorNewApi extends ContactAccessor {
- @Override
- public Intent getContactPickerIntent() {
- return new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI);
- }
- ...
- }</pre>
-
-<p>At this point, you have two implementations of the same API, one using the
-old API and another using the new API. Let's plug them in. Add this code to
-the ContactAccessor class:</p>
-
-<pre> private static ContactAccessor sInstance;
-
- public static ContactAccessor getInstance() {
- if (sInstance == null) {
- String className;
- int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
- if (sdkVersion < Build.VERSION_CODES.ECLAIR) {
- className = "ContactAccessorOldApi";
- } else {
- className = "ContactAccessorNewApi";
- }
- try {
- Class<? extends ContactAccessor> clazz =
- Class.forName(ContactAccessor.class.getPackage() + "." + className)
- .asSubclass(ContactAccessor.class);
- sInstance = clazz.newInstance();
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return sInstance;
- }</pre>
-
-<p>Now replace references to ContactsAccessorOldApi with references to
-ContactsAccessor:</p>
-
-<pre> private final ContactAccessor mContactAccessor = ContactAccessor.getInstance();</pre>
-
-<p>You are done! Now you will want to test on Android 2.0, 1.6 and 1.5.</p>
-
-<p>We hope you like the new features and APIs we've added to Contacts in
-Android 2.0, and we can't wait to see what cool things developers do with
-the new APIs.</p>
diff --git a/docs/html/resources/articles/creating-input-method.jd b/docs/html/resources/articles/creating-input-method.jd
deleted file mode 100644
index 84c2704..0000000
--- a/docs/html/resources/articles/creating-input-method.jd
+++ /dev/null
@@ -1,528 +0,0 @@
-page.title=Creating an Input Method
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-<h2>See also</h2>
-<ol>
- <li>
- <a href="{@docRoot}resources/articles/on-screen-inputs.html">Onscreen Input Methods</a>
- </li>
- <li>
- <a href="{@docRoot}resources/samples/SoftKeyboard/index.html">Soft Keyboard sample</a>
- </li>
-</ol>
-</div>
-</div>
-<p>
- An input method editor (IME) is a user control that enables users to enter text. Android
- provides an extensible input method framework that allows applications to provide users
- alternative input methods, such as on-screen keyboards or even speech input. Once installed,
- users can select which IME they want to use from the system settings and use it across the
- entire system; only one IME may be enabled at a time.
-</p>
-<p>
- To add an IME to the Android system, you create an Android application
- containing a class that extends {@link android.inputmethodservice.InputMethodService}. In
- addition, you usually create a "settings" activity that passes options to the IME
- service. You can also define a settings UI that's displayed as part of the system settings.
-</p>
-<p>This article covers the following:</p>
-<ul>
- <li>The IME lifecycle.</li>
- <li>Declaring IME components in the application manifest.</li>
- <li>The IME API.</li>
- <li>Designing an IME UI.</li>
- <li>Sending text from an IME to an application.</li>
- <li>Working with IME subtypes.</li>
-</ul>
-<p>
- If you haven't worked with IMEs before, you should read the introductory article
- <a href="{@docRoot}resources/articles/on-screen-inputs.html">Onscreen Input Methods</a> first.
- Also, the Soft Keyboard sample app included in the SDK contains sample code that you can modify
- to start building your own IME.
-</p>
-<h2 id="InputMethodLifecycle">The IME Lifecycle</h2>
-<p>
- The following diagram describes the life cycle of an IME:
-</p>
-<img src="{@docRoot}resources/articles/images/inputmethod_lifecycle_image.png" alt="" height="845"
- id="figure1" />
-<p class="img-caption">
- <strong>Figure 1.</strong> The life cycle of an IME.
-</p>
-<p>
- The following sections describe how to implement the UI and code associated with an IME that
- follows this lifecycle.
-</p>
-<h2 id="DefiningIME">Declaring IME Components in the Manifest</h2>
-<p>
- In the Android system, an IME is an Android application that contains a special IME service.
- The application's manifest file must declare the service, request the necessary permissions,
- provide an intent filter that matches the action <code>action.view.InputMethod</code>, and
- provide metadata that defines characteristics of the IME. In addition, to provide a settings
- interface that allows the user to modify the behavior of the IME, you can define a "settings"
- activity that can be launched from System Settings.
-</p>
-<p>
- The following snippet declares IME service. It requests the permission {@link
- android.Manifest.permission#BIND_INPUT_METHOD} to allow the service to connect the IME to
- the system, sets up an intent filter that matches the action
- <code>android.view.InputMethod</code>, and defines metadata for the IME:
-</p>
-<pre>
-<!-- Declares the input method service -->
- <service android:name="FastInputIME"
- android:label="@string/fast_input_label"
- android:permission="android.permission.BIND_INPUT_METHOD">
- <intent-filter>
- <action android:name="android.view.InputMethod" />
- </intent-filter>
- <meta-data android:name="android.view.im" android:resource="@xml/method" />
- </service>
-</pre>
-<p>
- This next snippet declares the settings activity for the IME. It has an intent filter for
- {@link android.content.Intent#ACTION_MAIN} that indicates this activity is the main entry point
- for the IME application:</p>
-<pre>
- <!-- Optional: an activity for controlling the IME settings -->
- <activity android:name="FastInputIMESettings"
- android:label="@string/fast_input_settings">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- </intent-filter>
- </activity>
-</pre>
-<p>
- You can also provide access to the IME's settings directly from its UI.
-</p>
-<h2 id="IMEAPI">The Input Method API</h2>
-<p>
- Classes specific to IMEs are found in the {@link android.inputmethodservice} and {@link
- android.view.inputmethod} packages. The {@link android.view.KeyEvent} class is important for
- handling keyboard characters.
-</p>
-<p>
- The central part of an IME is a service component, a class that extends
- {@link android.inputmethodservice.InputMethodService}. In addition to implementing the
- normal service lifecycle, this class has callbacks for providing your IME's UI, handling user
- input, and delivering text to the field that currently has focus. By default, the
- {@link android.inputmethodservice.InputMethodService} class provides most of the implementation
- for managing the state and visibility of the IME and communicating with the current
- input field.
-</p>
-<p>
- The following classes are also important:
-</p>
-<dl>
- <dt>{@link android.view.inputmethod.BaseInputConnection}</dt>
- <dd>
- Defines the communication channel from an {@link android.view.inputmethod.InputMethod}
- back to the application that is receiving its input. You use it to read text around the
- cursor, commit text to the text box, and send raw key events to the application.
- Applications should extend this class rather than implementing the base interface
- {@link android.view.inputmethod.InputConnection}.
- </dd>
- <dt>{@link android.inputmethodservice.KeyboardView}</dt>
- <dd>
- An extension of {@link android.view.View} that renders a keyboard and responds to user
- input events. The keyboard layout is specified by an instance of
- {@link android.inputmethodservice.Keyboard}, which you can define in an XML file.
- </dd>
-</dl>
-<h2 id="IMEUI">Designing the Input Method UI</h2>
-<p>
- There are two main visual elements for an IME: the <strong>input</strong> view and the
- <strong>candidates</strong> view. You only have to implement the elements that are relevant to
- the input method you're designing.
-</p>
-<h3 id="InputView">Input view</h3>
-<p>
- The input view is the UI where the user inputs text, in the form of keyclicks, handwriting or
- gestures. When the iIME is displayed for the first time, the system calls the
- {@link android.inputmethodservice.InputMethodService#onCreateInputView()} callback. In your
- implementation of this method, you create the layout you want to display in the IME
- window and return the layout to the system. This snippet is an example of implementing the
- {@link android.inputmethodservice.InputMethodService#onCreateInputView()} method:
-<pre>
- @Override
- public View onCreateInputView() {
- MyKeyboardView inputView =
- (MyKeyboardView) getLayoutInflater().inflate( R.layout.input, null);
-
- inputView.setOnKeyboardActionListener(this); inputView.setKeyboard(mLatinKeyboard);
-
- return mInputView;
- }
-</pre>
-<p>
- In this example, {@code MyKeyboardView} is an instance of a custom implementation of
- {@link android.inputmethodservice.KeyboardView} that renders a
- {@link android.inputmethodservice.Keyboard}. If you’re building a traditional QWERTY keyboard,
- see the <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample
- app for an example of how to extend the {@link android.inputmethodservice.KeyboardView} class.
-</p>
-<h3 id="CandidateView">Candidates view</h3>
-<p>
- The candidates view is the UI where the IME displays potential word corrections or
- suggestions for the user to select. In the IME lifecycle, the system calls
- {@link android.inputmethodservice.InputMethodService#onCreateCandidatesView()} when it's ready
- to display the candidate view. In your implementation of this method, return a layout that shows
- word suggestions, or return null if you don’t want to show anything (a null response is the
- default behavior, so you don’t have to implement this if you don’t provide suggestions).</p>
-<p>
- For an example implementation that provides user suggestions, see the
- <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample app.
-</p>
-<h3 id="DesignConsiderations">UI design considerations</h3>
-<p>
- This section describes some specific UI design considerations for IMEs.
-</p>
-<h4>Handling multiple screen sizes</h4>
-<p>
- The UI for your IME must be able to scale for different screen sizes, and it also
- must handle both landscape and portrait orientations. In non-fullscreen IME mode, leave
- sufficient space for the application to show the text field and any associated context, so that
- no more than half the screen is occupied by the IME. In fullscreen IME mode this is not an
- issue.
-</p>
-<h4>Handling different input types</h4>
-<p>
- Android text fields allow you to set a specific input type, such as free form text, numbers,
- URLs, email addresses, and search strings. When you implement a new IME, you need to
- detect the input type of each field and provide the appropriate interface for it. However, you
- don't have to set up your IME to check that the user entered text that's valid for the
- input type; that's the responsibility of the application that owns the text field.
-</p>
-<p>
- For example, here are screenshots of the interfaces that the Latin IME provided with the
- Android platform provides for text and phone number inputs:
-</p>
-<img src="{@docRoot}resources/articles/images/inputmethod_text_type_screenshot.png" alt=""
- height="142" id="figure2" />
-<img src="{@docRoot}resources/articles/images/inputmethod_numeric_type_screenshot.png" alt=""
- height="120" id="figure2a" />
-<p class="img-caption">
- <strong>Figure 2.</strong> Latin IME input types.
-</p>
-<p>
- When an input field receives focus and your IME starts, the system calls
- {@link android.inputmethodservice.InputMethodService#onStartInputView(EditorInfo, boolean)
- onStartInputView()}, passing in an {@link android.view.inputmethod.EditorInfo} object that
- contains details about the input type and other attributes of the text field. In this object,
- the {@link android.view.inputmethod.EditorInfo#inputType} field contains the text field's input
- type.
-</p>
-<p>
- The {@link android.view.inputmethod.EditorInfo#inputType} field is an <code>int</code>
- that contains bit patterns for various input type settings. To test it for the text field's
- input type, mask it with the constant {@link android.text.InputType#TYPE_MASK_CLASS}, like
- this:
-</p>
-<pre>
-inputType & InputType.TYPE_MASK_CLASS
-</pre>
-<p>
-The input type bit pattern can have one of several values, including:
-</p>
-<dl>
- <dt>{@link android.text.InputType#TYPE_CLASS_NUMBER}</dt>
- <dd>
- A text field for entering numbers. As illustrated in the previous screen shot, the
- Latin IME displays a number pad for fields of this type.
- </dd>
- <dt>{@link android.text.InputType#TYPE_CLASS_DATETIME}</dt>
- <dd>
- A text field for entering a date and time.
- </dd>
- <dt>{@link android.text.InputType#TYPE_CLASS_PHONE}</dt>
- <dd>
- A text field for entering telephone numbers.
- </dd>
- <dt>{@link android.text.InputType#TYPE_CLASS_TEXT}</dt>
- <dd>
- A text field for entering all supported characters.
- </dd>
-</dl>
-<p>
- These constants are described in more detail in the reference documentation for
- {@link android.text.InputType}.
-</p>
-<p>
- The {@link android.view.inputmethod.EditorInfo#inputType} field can contain other bits that
- indicate a variant of the text field type, such as:
-</p>
-<dl>
- <dt>{@link android.text.InputType#TYPE_TEXT_VARIATION_PASSWORD}</dt>
- <dd>
- A variant of {@link android.text.InputType#TYPE_CLASS_TEXT} for entering passwords. The
- input method will display dingbats instead of the actual text.
- </dd>
- <dt>{@link android.text.InputType#TYPE_TEXT_VARIATION_URI}</dt>
- <dd>
- A variant of {@link android.text.InputType#TYPE_CLASS_TEXT} for entering web URLs and
- other Uniform Resource Identifiers (URIs).
- </dd>
- <dt>{@link android.text.InputType#TYPE_TEXT_FLAG_AUTO_COMPLETE}</dt>
- <dd>
- A variant of {@link android.text.InputType#TYPE_CLASS_TEXT} for entering text that the
- application "auto-completes" from a dictionary, search, or other facility.
- </dd>
-</dl>
-<p>
- Remember to mask {@link android.view.inputmethod.EditorInfo#inputType} with the appropriate
- constant when you test for these variants. The available mask constants are listed in the
- reference documentation for {@link android.text.InputType}.
-</p>
-<p class="caution">
- <strong>Caution:</strong> In your own IME, make sure you handle text correctly when you send it
- to a password field. Hide the password in your UI both in the input view and in the candidates
- view. Also remember that you shouldn't store passwords on a device. To learn more, see the <a
- href="{@docRoot}guide/practices/security.html">Designing for Security</a> guide.
-</p>
-<h2 id="SendText">Sending Text to the Application</h2>
-<p>
- As the user inputs text with your IME, you can send text to the application by
- sending individual key events or by editing the text around the cursor in the application's text
- field. In either case, you use an instance of {@link android.view.inputmethod.InputConnection}
- to deliver the text. To get this instance, call
- {@link android.inputmethodservice.InputMethodService#getCurrentInputConnection
- InputMethodService.getCurrentInputConnection()}.
-</p>
-<h3 id="EditingCursor">Editing the text around the cursor</h3>
-<p>
- When you're handling the editing of existing text in a text field, some of the more useful
- methods in {@link android.view.inputmethod.BaseInputConnection} are:
-</p>
-<dl>
- <dt>
- {@link android.view.inputmethod.BaseInputConnection#getTextBeforeCursor(int, int)
- getTextBeforeCursor()}</dt>
- <dd>
- Returns a {@link java.lang.CharSequence} containing the number of requested characters
- before the current cursor position.
- </dd>
- <dt>
- {@link android.view.inputmethod.BaseInputConnection#getTextAfterCursor(int, int)
- getTextAfterCursor()}
- </dt>
- <dd>
- Returns a {@link java.lang.CharSequence} containing the number of requested characters
- following the current cursor position.
- </dd>
- <dt>
- {@link android.view.inputmethod.BaseInputConnection#deleteSurroundingText(int, int)
- deleteSurroundingText()}
- </dt>
- <dd>
- Deletes the specified number of characters before and following the current cursor
- position.
- </dd>
- <dt>
- {@link android.view.inputmethod.BaseInputConnection#commitText(CharSequence, int)
- commitText()}
- </dt>
- <dd>
- Commit a {@link java.lang.CharSequence} to the text field and set a new cursor
- position.
- </dd>
-</dl>
-<p>
- For example, the following snippet shows how to replace the text "Fell" to the left of the
- with the text "Hello!":
-</p>
-<pre>
- InputConnection ic = getCurrentInputConnection();
-
- ic.deleteSurroundingText(4, 0);
-
- ic.commitText("Hello", 1);
-
- ic.commitText("!", 1);
-</pre>
-<h3 id="ComposeThenCommit">Composing text before committing</h3>
-<p>
- If your IME does text prediction or requires multiple steps to compose a glyph or
- word, you can show the progress in the text field until the user commits the word, and then you
- can replace the partial composition with the completed text. You may give special treatment to
- the text by adding a "span" to it when you pass it to InputConnection#setComposingText().
-</p>
-<p>
- The following snippet shows how to show progress in a text field:
-</p>
-<pre>
- InputConnection ic = getCurrentInputConnection();
-
- ic.setComposingText("Composi", 1);
-...
-
- ic.setComposingText("Composin", 1);
-
-...
-
- ic.commitText("Composing ", 1);
-</pre>
-<p>
- The following screenshots show how this appears to the user:
-</p>
-<img src="{@docRoot}resources/articles/images/inputmethod_composing_text_1.png" alt="" height="54"
- id="figure3a" />
-<img src="{@docRoot}resources/articles/images/inputmethod_composing_text_2.png" alt="" height="53"
- id="figure3b" />
-<img src="{@docRoot}resources/articles/images/inputmethod_composing_text_3.png" alt="" height="31"
- id="figure3c" />
-<p class="img-caption">
- <strong>Figure 3.</strong> Composing text before committing.
-</p>
-<h3 id="HardwareKeyEvents">Intercepting hardware key events</h3>
-<p>
- Even though the input method window doesn't have explicit focus, it receives hardware key
- events first and can choose to consume them or forward them along to the application. For
- example, you may want to consume the directional keys to navigate within your UI for candidate
- selection during composition. You may also want to trap the back key to dismiss any popups
- originating from the input method window.</p>
-<p>
- To intercept hardware keys, override
- {@link android.inputmethodservice.InputMethodService#onKeyDown(int, KeyEvent) onKeyDown()}
- and {@link android.inputmethodservice.InputMethodService#onKeyUp(int, KeyEvent) onKeyUp()}.
- See the <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample
- app for an example.
-</p>
-<p>
- Remember to call the <code>super()</code> method for keys you don't want to handle yourself.
-</p>
-<h2 id="IMESubTypes">Creating an IME Subtype</h2>
-<p>
- Subtypes allow the IME to expose multiple input modes and languages supported by an IME. A
- subtype can represent:
-</p>
-<ul>
- <li>A locale such as en_US or fr_FR</li>
- <li>An input mode such as voice, keyboard, or handwriting</li>
- <li>
- Other input styles, forms, or properties specific to the IME, such as 10-key or qwerty
- keyboard layouts.
- </li>
-</ul>
-<p>
- Basically, the mode can be any text such as "keyboard", "voice", and so forth.
-</p>
-<p>A subtype can also expose a combination of these.</p>
-<p>
- Subtype information is used for an IME switcher dialog that's available from the notification
- bar and also for IME settings. The information also allows the framework to bring up a
- specific subtype of an IME directly. When you build an IME, use the subtype facility, because
- it helps the user identify and switch between different IME languages and modes.
-</p>
-<p>
- You define subtypes in one of the input method's XML resource files, using the
- <code><subtype></code> element. The following snippet defines an IME with two
- subtypes: a keyboard subtype for the US English locale, and another keyboard subtype for the
- French language locale for France:
-</p>
-<pre>
-<input-method xmlns:android="http://schemas.android.com/apk/res/android"
- android:settingsActivity="com.example.softkeyboard.Settings"
- android:icon="@drawable/ime_icon"
- <subtype android:name="@string/display_name_english_keyboard_ime"
- android:icon="@drawable/subtype_icon_english_keyboard_ime"
- android:imeSubtypeLanguage="en_US"
- android:imeSubtypeMode="keyboard"
- android:imeSubtypeExtraValue="somePrivateOption=true"
- />
- <subtype android:name="@string/display_name_french_keyboard_ime"
- android:icon="@drawable/subtype_icon_french_keyboard_ime"
- android:imeSubtypeLanguage="fr_FR"
- android:imeSubtypeMode="keyboard"
- android:imeSubtypeExtraValue="foobar=30,someInternalOption=false"
- />
- <subtype android:name="@string/display_name_german_keyboard_ime"
- ...
- />
-/>
-</pre>
-<p>
- To ensure that your subtypes are labeled correctly in the UI, use %s to get a subtype label
- that is the same as the subtype’s locale label. This is demonstrated in the next two snippets.
- The first snippet shows part of the input method's XML file:
-</p>
-<pre>
- <subtype
- android:label="@string/label_subtype_generic"
- android:imeSubtypeLocale="en_US"
- android:icon="@drawable/icon_en_us"
- android:imeSubtypeMode="keyboard" />
-</pre>
-<p>
- The next snippet is part of the IME's <code>strings.xml</code> file. The string
- resource <code>label_subtype_generic</code>, which is used by the input method UI definition to
- set the subtype's label, is defined as:
-</p>
-<pre>
-<string name="label_subtype_generic">%s</string>
-</pre>
-<p>
- This sets the subtype’s display name to “English (United States)” in any English language
- locale, or to the appropriate localization in other locales.
-</p>
-<h3 id="SubtypeProcessing">Choosing IME subtypes from the notification bar</h3>
-<p>
- The Android system manages all subtypes exposed by all IMEs. IME subtypes are
- treated as modes of the IME they belong to. In the notification bar, a user can select an
- available subtype for the currently-set IME, as shown in the following screenshot:
-</p>
-<img src="{@docRoot}resources/articles/images/inputmethod_subtype_notification.png" alt=""
- height="85" id="figure4" />
-<p class="img-caption">
- <strong>Figure 4.</strong> Choosing an IME subtype from the notification bar.
-</p>
-<img src="{@docRoot}resources/articles/images/inputmethod_subtype_preferences.png" alt=""
- height="165" id="figure5" />
-<p class="img-caption">
- <strong>Figure 5.</strong> Setting subtype preferences in System Settings.
-</p>
-<h3 id="SubtypeSettings">Choosing IME subtypes from System Settings</h3>
-<p>
- A user can control how subtypes are used in the “Language & input” settings panel in the
- System Settings area. In the Soft Keyboard sample, the file
- <code>InputMethodSettingsFragment.java</code> contains an implementation that
- facilitates a subtype enabler in the IME settings. Please refer to the SoftKeyboard sample in
- the Android SDK for more information about how to support Input Method Subtypes in your IME.
-</p>
-<img src="{@docRoot}resources/articles/images/inputmethod_subtype_settings.png" alt=""
- height="210" id="figure6" />
-<p class="img-caption">
- <strong>Figure 6.</strong> Choosing a language for the IME.
-</p>
-<h2 id="GeneralDesign">General IME Considerations</h2>
-<p>
- Here are some other things to consider as you're implementing your IME:
-</p>
-<ul>
-<li>
- Provide a way for users to set options directly from the IME's UI.
-</li>
-<li>
- Because multiple IMEs may be installed on the device, provide a way for the user to switch to a
- different IME directly from the input method UI.
-</li>
-<li>
- Bring up the IME's UI quickly. Preload or load on demand any large resources so that users
- see the IME as soon as they tap on a text field. Cache resources and views for subsequent
- invocations of the input method.
-</li>
-<li>
- Conversely, you should release large memory allocations soon after the input method window is
- hidden, so that applications can have sufficient memory to run. Consider using a delayed message
- to release resources if the IME is in a hidden state for a few seconds.
-</li>
-<li>
- Make sure that users can enter as many characters as possible for the language or locale
- associated with the IME. Remember that users may use punctuation in passwords or user
- names, so your IME has to provide many different characters to allow users to enter a
- password and get access to the device.
-</li>
-</ul>
diff --git a/docs/html/resources/articles/drawable-mutations.jd b/docs/html/resources/articles/drawable-mutations.jd
deleted file mode 100644
index c5818fc..0000000
--- a/docs/html/resources/articles/drawable-mutations.jd
+++ /dev/null
@@ -1,93 +0,0 @@
-page.title=Drawable Mutations
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>Android's drawables are extremely useful to easily build applications. A
-{@link android.graphics.drawable.Drawable Drawable} is a pluggable drawing
-container that is usually associated with a View. For instance, a
-{@link android.graphics.drawable.BitmapDrawable BitmapDrawable} is used to display
-images, a {@link android.graphics.drawable.ShapeDrawable ShapeDrawable} to draw
-shapes and gradients, and so on. You can even combine them to create complex
-renderings.</p>
-
-<p>Drawables allow you to easily customize the rendering of the widgets without
-subclassing them. As a matter of fact, they are so convenient that most of the
-default Android apps and widgets are built using drawables; there are about 700
-drawables used in the core Android framework. Because drawables are used so
-extensively throughout the system, Android optimizes them when they are loaded
-from resources. For instance, every time you create a
-{@link android.widget.Button Button}, a new drawable is loaded from the framework
-resources (<code>android.R.drawable.btn_default</code>). This means all buttons
-across all the apps use a different drawable instance as their background.
-However, all these drawables share a common state, called the "constant state."
-The content of this state varies according to the type of drawable you are
-using, but it usually contains all the properties that can be defined by a
-resource. In the case of a button, the constant state contains a bitmap image.
-This way, all buttons across all applications share the same bitmap, which saves
-a lot of memory.</p>
-
-<p>The following diagram shows what entities are
-created when you assign the same image resource as the background of
-two different views. As you can see, two drawables are created but they
-both share the same constant state, hence the same bitmap:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 307px; height: 400px;" src="images/shared_states.png" alt="" id="BLOGGER_PHOTO_ID_5331437883277472082" border="0">
-
-<p>This state sharing feature is great to avoid wasting memory but it can cause
-problems when you try to modify the properties of a drawable. Imagine an
-application with a list of books. Each book has a star next to its name, totally
-opaque when the user marks the book as a favorite, and translucent when the book
-is not a favorite. To achieve this effect, you would probably write the
-following code in your list adapter's <code>getView()</code> method:</p>
-
-<pre>Book book = ...;
-TextView listItem = ...;
-
-listItem.setText(book.getTitle());
-
-Drawable star = context.getResources().getDrawable(R.drawable.star);
-if (book.isFavorite()) {
- star.setAlpha(255); // opaque
-} else {
- star.setAlpha(70); // translucent
-}</pre>
-
-<p>Unfortunately, this piece of code yields a rather strange result:
-all of the drawables have the same opacity:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 267px; height: 400px;" src="images/all_drawables_changed.png" alt="" id="BLOGGER_PHOTO_ID_5331438978390342066" border="0">
-
-<p>This
-result is explained by the constant state. Even though we are getting a
-new drawable instance for each list item, the constant state remains
-the same and, in the case of BitmapDrawable, the opacity is part of the
-constant state. Thus, changing the opacity of one drawable instance
-changes the opacity of all the other instances. Even worse, working
-around this issue was not easy with Android 1.0 and 1.1.</p>
-
-<p>Android 1.5 and higher offers a very easy way to solve this issue
-with the new {@link android.graphics.drawable.Drawable#mutate()} method</a>.
-When you invoke this method on a drawable, the constant state of the
-drawable is duplicated to allow you to change any property without
-affecting other drawables. Note that bitmaps are still shared, even
-after mutating a drawable. The diagram below shows what happens when
-you invoke <code>mutate()</code> on a drawable:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 307px; height: 400px;" src="images/mutated_states.png" alt="" id="BLOGGER_PHOTO_ID_5331440144116345074" border="0">
-
-<p>Let's update our previous piece of code to make use of <code>mutate()</code>:</p>
-
-<pre>Drawable star = context.getResources().getDrawable(R.drawable.star);
-if (book.isFavorite()) {
- star.mutate().setAlpha(255); // opaque
-} else {
- star. mutate().setAlpha(70); // translucent
-}</pre>
-
-<p>For convenience, <code>mutate()</code>
-returns the drawable itself, which allows to chain method calls. It
-does not however create a new drawable instance. With this new piece of
-code, our application now behaves correctly:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 267px; height: 400px;" src="images/correct_drawables.png" alt="" id="BLOGGER_PHOTO_ID_5331440757515573842" border="0">
diff --git a/docs/html/resources/articles/faster-screen-orientation-change.jd b/docs/html/resources/articles/faster-screen-orientation-change.jd
deleted file mode 100644
index e7b73bf..0000000
--- a/docs/html/resources/articles/faster-screen-orientation-change.jd
+++ /dev/null
@@ -1,133 +0,0 @@
-page.title=Faster Screen Orientation Change
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime
-Changes</a></li>
- </ol>
-
-</div>
-</div>
-
-<p>Android is designed to run efficiently on a wide
-array of devices, with very different hardware configurations. Some
-devices, like the T-Mobile G1, can change their hardware configuration
-at runtime. For instance, when you open the keyboard, the screen change
-from the portrait orientation to the landscape orientation.
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>Using the alternate resources framework</h2>
-
-<p>The platform's support for loading orientation-specific
-resources at run time is based on the alternate resources framework.</p>
-
-<p>Providing orientation-specific resources is an important part of
-developing your app. If you are not familiar with resource directory qualifiers
-or how the platform uses them, please read
-<a href="{@docRoot}guide/topics/resources/resources-i18n.html#AlternateResources">
-Alternate Resources</a>.
-</div>
-</div>
-
-<p>To make
-Android app development easier, the Android system automatically handles
-configuration change events and restarts the current activity with the new
-configuration. This is the default behavior that lets you declare
-resources like layouts and drawables based on the orientation, screen
-size, locale, etc. </p>
-
-<p>While this behavior is really powerful, since your application adapts
-automatically to the device's configuration at runtime, it is sometimes
-confusing for new Android developers, who wonder why their activity is
-destroyed and recreated. </p>
-
-<p>Facing this "issue," some developers choose to handle configuration changes
-themselves which is, in general, a short-term solution that will only complicate
-their lives later. On the other hand, the system's automatic resource handling
-is a very efficient and easy way to adapt an application's user interface to
-various devices and devices configurations. It sometimes comes at a price,
-though.</p>
-
-<p>When your application displays a lot of data, or data that is expensive to fetch,
-the automatic destruction/creation of the activities can be lead to a
-painful user experience. Take the example of <a href="http://code.google.com/p/apps-for-android/source/browse/#git%2FPhotostream%2Fsrc%2Fcom%2Fgoogle%2Fandroid%2Fphotostream">Photostream</a>,
-a simple Flickr browsing application. After you launch the application and choose a Flickr account, the
-application downloads a set of 6 photos (on a T-Mobile G1) from the
-Flickr servers and displays them on screen. To improve the user
-experience, the application uses slightly different layouts and drawables in
-portrait and landscape modes and this is what the result looks like:</p>
-
-<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_9l0GmPwgCzk/SZoGyJyg6-I/AAAAAAAAACU/ItuVwhegPb8/s1600-h/photostream_landscape.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 214px;" src="images/photostream_landscape.png" alt="" id="BLOGGER_PHOTO_ID_5303558969873198050" border="0"></a></p>
-
-<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_9l0GmPwgCzk/SZoGx4I-QlI/AAAAAAAAACM/-GkZR5MUKhY/s1600-h/photostream_portrait.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 214px; height: 320px;" src="images/photostream_portrait.png" alt="" id="BLOGGER_PHOTO_ID_5303558965135557202" border="0"></a></p>
-
-<p>Photostream lets Android take care of the configuration change when the
-screen is rotated. However, can you imagine how painful it would be for the user
-to see all the images being downloaded again? The obvious solution to this
-problem is to temporarily cache the images. They could be cached on the SD card
-(if there's one), in the Application object, in a static field, etc. None of
-these techniques is adapted to the current situation: why should we bother
-caching the images when the screen is not rotated? Fortunately for us, Android
-offers a great API exactly for that purpose.</p>
-
-<p>The Activity class has a special method called
-{@link android.app.Activity#onRetainNonConfigurationInstance()}. This method
-can be used to pass an arbitrary object to <em>your future self</em> and Android
-is smart enough to call this method only when needed. In the case of Photostream,
-the application used this method
-to pass the downloaded images to the future activity on orientation change.
-The implementation can be summarized like so:</p>
-
-<pre class="prettyprint">@Override
-public Object onRetainNonConfigurationInstance() {
- final LoadedPhoto[] list = new LoadedPhoto[numberOfPhotos];
- keepPhotos(list);
- return list;
-}
-</pre>
-
-<p>In the new activity, in <code>onCreate()</code>, all you have to do to
-get your object back is to call {@link android.app.Activity#getLastNonConfigurationInstance()}.
-In Photostream, this method is invoked
-and if the returned value is not null, the grid is loaded with the list of
-photos from the previous activity:</p>
-
-<pre class="prettyprint">private void loadPhotos() {
- final Object data = getLastNonConfigurationInstance();
-
- // The activity is starting for the first time, load the photos from Flickr
- if (data == null) {
- mTask = new GetPhotoListTask().execute(mCurrentPage);
- } else {
- // The activity was destroyed/created automatically, populate the grid
- // of photos with the images loaded by the previous activity
- final LoadedPhoto[] photos = (LoadedPhoto[]) data;
- for (LoadedPhoto photo : photos) {
- addPhoto(photo);
- }
- }
-}
-</pre>
-
-<p>Be very careful with the object you pass through
-<code>onRetainNonConfigurationChange()</code>, though. If the object you
-pass is for some reason tied to the Activity/Context, <a
-href="http://www.curious-creature.org/2008/12/18/avoid-memory-leaks-on-android/">you will leak</a>
-all the views and resources of the activity. This means you should
-never pass a View, a Drawable, an Adapter, etc. Photostream for
-instance extracts the bitmaps from the drawables and pass the bitmaps
-only, not the drawables. Finally, remember that
-<code>onRetainNonConfigurationChange()</code> should be used only to retain
-data that is expensive to load. Otherwise, keep it simple and let Android
-do everything.</p>
-
-<p>Also read the guide to <a href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime
-Changes</a>.</p>
diff --git a/docs/html/resources/articles/future-proofing.jd b/docs/html/resources/articles/future-proofing.jd
deleted file mode 100644
index b8aeedf..0000000
--- a/docs/html/resources/articles/future-proofing.jd
+++ /dev/null
@@ -1,91 +0,0 @@
-page.title=Future-Proofing Your Apps
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>It's important to implement your application so that it will not break as new
-versions of the Android platform are loaded onto the users device. The list
-below is based on our observations of five ways that we've seen bad apps fail.
-You can think of these as "anti-patterns" (that is, techniques to avoid) for
-Android development.</p>
-
-<p>If your application uses any of the dubious techniques below, break out
-your IDE and duct tape, spackle, and patch up the app.</p>
-
-<p><b>Technique to Avoid, #1: Using Internal APIs</b></p>
-
-<p>Even
-though we've always strongly advised against doing so, some developers
-have chosen to use unsupported or internal APIs. For instance, many
-developers are using the internal brightness control and bluetooth
-toggle APIs that were present in 1.0 and 1.1. A bug -- which was
-fixed in Android 1.5 -- allowed apps to use those APIs without
-requesting permission. As a result, apps that used those APIs broke
-on 1.5. If you've used internal APIs in your apps, you need to update
-your apps to stop doing so. </p>
-
-<p><b>Technique to Avoid, #2: Directly Manipulating Settings</b></p>
-
-<p>Strictly speaking this one isn't evil, since this is a change in
-behavior that we made to Android itself. But we made it because some
-developers were doing naughty things: a number of apps were changing
-system settings silently without even notifying the user. For instance,
-some apps turn on GPS without asking the user, and others might turn on
-data roaming.</p>
-
-<p>As a result, applications can no longer directly
-manipulate the values of certain system Settings, even if they
-previously had permission to do so. For instance, apps can no longer
-directly turn on or off GPS. These apps won't crash, but the APIs in
-question now have no effect, and do nothing. Instead, apps will need to
-issue an Intent to launch the appropriate Settings configuration
-screen, so that the user can change these settings manually. For
-details, see the android.provider.Settings.Secure class, which you can
-find in the 1.5_pre SDK documentation (and later). Note that only
-Settings that were moved to the Settings.Secure class are affected.
-Other, less sensitive, settings will continue to have the same behavior
-as in Android 1.1.</p>
-
-<p><b>Technique to Avoid, #3: Going Overboard with Layouts</b></p>
-
-<p>Due to changes in the View rendering infrastructure, unreasonably deep
-(more than 10 or so) or broad (more than 30 total) View hierarchies in
-layouts are now likely to cause crashes. This was always a risk for
-excessively complex layouts, but you can think of Android 1.5 as being
-better than 1.1 at exposing this problem. Most developers won't need to
-worry about this, but if your app has very complicated layouts, you'll
-need to put it on a diet. You can simplify your layouts using the more
-advanced layout classes like FrameLayout and TableLayout.</p>
-
-<p><b>Technique to Avoid, #4: Bad Hardware Assumptions</b></p>
-
-<p>Android 1.5 includes support for soft keyboards, and there will soon be many
-devices that run Android but do not have physical keyboards. If your
-application assumes the presence of a physical keyboard (such as if you
-have created a custom View that sinks keypress events) you should make
-sure it degrades gracefully on devices that only have soft keyboards.
-For more information on this, keep on eye on this blog as we'll be
-posting more detailed information about handling the new soft keyboards.</p>
-
-<p><b>Technique to Avoid, #5: Incautious Rotations </b></p>
-
-<p>Devices running Android 1.5 and later can automatically rotate the screen,
-depending on how the user orients the device. Some 1.5 devices will do
-this by default, and on all others it can be turned on by the user.
-This can sometimes result in unpredictable behavior from applications
-that do their own reorientations (whether using the accelerometer, or
-something else.) This often happens when applications assume that the
-screen can only rotate if the physical keyboard is exposed; if the
-device lacks a physical keyboard, these apps do not expect to be
-reoriented, which is a coding error. Developers should be sure that
-their applications can gracefully handle being reoriented at any time.</p>
-
-<p>Also, apps that use the accelerometer directly to reorient themselves
-sometimes compete with the system doing the same thing, with odd
-results. And finally, some apps that use the accelerometer to detect
-things like shaking motions and that don't lock their orientation to
-portrait or landscape, often end up flipping back and forth between
-orientations. This can be irritating to the user. (You can lock your
-app's orientation to portrait or landscape using the
-<code>android:screenOrientation</code> attribute in the manifest file.)</p>
-
diff --git a/docs/html/resources/articles/gestures.jd b/docs/html/resources/articles/gestures.jd
deleted file mode 100644
index 5b8d760..0000000
--- a/docs/html/resources/articles/gestures.jd
+++ /dev/null
@@ -1,213 +0,0 @@
-page.title=Gestures
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>Touch screens are a great way to interact with applications on
-mobile devices. With a touch screen, users can easily tap, drag, fling,
-or slide to quickly perform actions in their favorite applications.
-For app developers. the Android framework makes it's easy to
-recognize simple actions, like a swipe, but it has been more
-difficult to handle complicated gestures, sometimes requiring
-developers to write a lot of code.</p>
-
-<p>That's why we introduced a new gestures API in Android 1.6. This API, located
-in the new package {@link android.gesture}, lets you store, load, draw, and
-recognize gestures. This article will show you how you can use the
-<code>android.gesture</code> API in your applications. Before going any further,
-you should <a
-href="http://code.google.com/p/apps-for-android/downloads/detail?name=
-GesturesDemos.zip&can=2&q=#makechanges">download the source code
-of the examples</a>.</p>
-
-<h3>Creating a gestures library</h3>
-
-<p>Android 1.6 and higher SDK platforms include a new application pre-installed
-on the emulator, called Gestures Builder. You can use this application to create
-a set of pre-defined gestures for your own application. It also serves as an
-example of how to let the user define his own gestures in your applications. You
-can find the source code of Gestures Builders in the samples directory of each
-SDK platform. In our example we will use Gestures Builder to generate a set of
-gestures for us (make sure to create an AVD with an SD card image to use
-Gestures Builder.) The screenshot below shows what the application looks like
-after adding a few gestures:</p>
-
-<img src="images/gestures_006.png" style="width: 320px; height: 480px;">
-
-<p>As you can see, a gesture is always associated with a name. That name is very
-important because it identifies each gesture within your application. The names
-do not have to be unique. Actually it can be very useful to have several
-gestures with the same name to increase the precision of the recognition. Every
-time you add or edit a gesture in the Gestures Builder, a file is generated on
-the emulator's SD card, <code>/sdcard/gestures</code>. This file contains the
-description of all the gestures, and you will need to package it inside your
-application inside the resources directory, in
-<code>/res/raw</code>.</p>
-
-<h3>Loading the gestures library</h3>
-
-<p>Now that you have a set of pre-defined gestures, you must load it inside your
-application. This can be achieved in several ways but the easiest is to use the
-<code>GestureLibraries</code> class:</p>
-
-<pre class="prettyprint">mLibrary = GestureLibraries.fromRawResource(this, R.raw.spells);
-if (!mLibrary.load()) {
- finish();
-}</pre>
-
-<p>In this example, the gesture library is loaded from the file
-<code>/res/raw/spells</code>. You can easily load libraries from other sources,
-like the SD card, which is very important if you want your application to be
-able to save the library; a library loaded from a raw resource is read-only and
-cannot be modified. The following diagram shows the structure of a library:</p>
-
-<img src="images/gestures_002.png" style="width: 600px; height: 512px;">
-
-<h3>Recognizing gestures</h3>
-
-<p>To start recognizing gestures in your application, all you have to do
-is add a <code>GestureOverlayView</code> to your XML layout:</p>
-
-<pre><android.gesture.GestureOverlayView
- android:id="@+id/gestures"
- android:layout_width="fill_parent"
- android:layout_height="0dip"
- android:layout_weight="1.0" /></pre>
-
-<p>Notice that the <code>GestureOverlayView</code>
-is not part of the usual android.widget package. Therefore, you must
-use its fully qualified name. A gesture overlay acts as a simple
-drawing board on which the user can draw his gestures. You can tweak
-several visual properties, like the color and the width of the stroke
-used to draw gestures, and register various listeners to follow what
-the user is doing. The most commonly used listener is
-<code>GestureOverlayView.OnGesturePerformedListener</code>,
-which fires whenever a user is done drawing a gesture:</p>
-
-<pre>GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures);
-gestures.addOnGesturePerformedListener(this);</pre>
-
-<p>When the listener fires, you can ask the <code>GestureLibrary</code>
-to try to recognize the gesture. In return, you will get a list of
-Prediction instances, each with a name - the same name you entered in
-the Gestures Builder - and a score. The list is sorted by descending
-scores; the higher the score, the more likely the associated gesture is
-the one the user intended to draw. The following code snippet
-demonstrates how to retrieve the name of the first prediction:</p>
-
-<pre>public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
- ArrayList<prediction> predictions = mLibrary.recognize(gesture);
-
- // We want at least one prediction
- if (predictions.size() > 0) {
- Prediction prediction = predictions.get(0);
- // We want at least some confidence in the result
- if (prediction.score > 1.0) {
- // Show the spell
- Toast.makeText(this, prediction.name, Toast.LENGTH_SHORT).show();
- }
- }
-}</pre>
-
-<p>In this example, the first prediction is taken into account only if it's
-score is greater than 1.0. The threshold you use is entirely up to you
-but know that scores lower than 1.0 are typically poor matches. And
-this is all the code you need to create a simple application that can
-recognize pre-defined gestures (see the source code of the project
-GesturesDemo):</p>
-
-<img src="images/gestures.png" style="width: 320px; height: 480px;">
-
-<h3>Gestures overlay</h3>
-
-<p>In the example above, the <code>GestureOverlayView</code> was used
-as a normal view, embedded inside a <code>LinearLayout</code>.
-However, as its name suggests, it can also be used as an overlay on top
-of other views. This can be useful to recognize gestures in a game or
-just anywhere in the UI of an application. In the second example,
-called GesturesListDemo, we'll create an overlay on top of a list of
-contacts. We start again in Gestures Builder to create a new set of
-pre-defined gestures:</p>
-
-<p><img src="images/gestures_005.png" style="width: 320px; height: 480px;"></p>
-
-<p>And here is what the XML layout looks like:</p>
-
-<pre><android.gesture.GestureOverlayView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/gestures"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
-
- android:gestureStrokeType="multiple"
- android:eventsInterceptionEnabled="true"
- android:orientation="vertical">
-
- <ListView
- android:id="@android:id/list"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
-
-</android.gesture.GestureOverlayView></pre>
-
-<p>In this application, the gestures view is an overlay on top of a regular
-ListView. The overlay also specifies a few properties that we did not
-need before:</p>
-
-<ul>
-<li><code>gestureStrokeType</code>: indicates
-whether we want to recognize gestures made of a single stroke or
-multiple strokes. Since one of our gestures is the "+" symbol, we need
-multiple strokes</li>
-<li><code>eventsInterceptionEnabled</code>: when
-set to true, this property tells the overlay to steal the events from
-its children as soon as it knows the user is really drawing a gesture.
-This is useful when there's a scrollable view under the overlay, to
-avoid scrolling the underlying child as the user draws his gesture </li>
-<li><code>orientation</code>:
-indicates the scroll orientation of the views underneath. In this case
-the list scrolls vertically, which means that any horizontal gestures
-(like <code>action_delete</code>) can immediately be recognized as a
-gesture. Gestures that start with a vertical stroke must contain at
-least one horizontal component to be recognized. In other words, a
-simple vertical line cannot be recognized as a gesture since it would
-conflict with the list's scrolling.</li>
-</ul>
-
-<p>The code used to load and set up the gestures library and overlay is exactly
-the same as before. The only difference is that we now check the name of the
-predictions to know what the user intended to do:</p>
-
-<pre>public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
- ArrayList<Prediction> predictions = mLibrary.recognize(gesture);
- if (predictions.size() > 0 && predictions.get(0).score > 1.0) {
- String action = predictions.get(0).name;
- if ("action_add".equals(action)) {
- Toast.makeText(this, "Adding a contact", Toast.LENGTH_SHORT).show();
- } else if ("action_delete".equals(action)) {
- Toast.makeText(this, "Removing a contact", Toast.LENGTH_SHORT).show();
- } else if ("action_refresh".equals(action)) {
- Toast.makeText(this, "Reloading contacts", Toast.LENGTH_SHORT).show();
- }
- }
-}</pre>
-
-<p>The user is now able to draw his gestures on top of the list without
-interfering with the scrolling:</p>
-
-<img src="images/gestures_004.png" style="width: 320px; height: 480px;">
-
-<p>The overlay even gives visual clues as to whether the gesture is considered
-valid for recognition. In the case of a vertical overlay, for instance,
-a single vertical stroke cannot be recognized as a gesture and is
-therefore drawn with a translucent color:</p>
-
-<img src="images/gestures_003.png" style="width: 320px; height: 480px;">
-
-<h3>It's your turn</h3>
-
-<p>Adding support for gestures in your application is easy and can be a valuable
-addition. The gestures API does not even have to be used to recognize complex
-shapes; it will work equally well to recognize simple swipes. We are very
-excited by the possibilities the gestures API offers, and we're eager to see
-what cool applications the community will create with it.</p>
diff --git a/docs/html/resources/articles/glsurfaceview.jd b/docs/html/resources/articles/glsurfaceview.jd
deleted file mode 100644
index 45407a9..0000000
--- a/docs/html/resources/articles/glsurfaceview.jd
+++ /dev/null
@@ -1,270 +0,0 @@
-page.title=Introducing GLSurfaceView
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-
-<p>The {@link android android.opengl.GLSurfaceView} class makes it
-easier for you to use OpenGL ES rendering in your applications by:</p>
-
-<ul>
-<li>Providing the glue code to connect OpenGL ES to the {@link
-android.view.View} system.</li>
-<li>Providing the glue code to make OpenGL ES work with the {@link
-android.app.Activity} life-cycle.</li>
-<li>Making it easy to choose an appropriate frame buffer pixel format.</li>
-<li>Creating and managing a separate rendering thread, to enable smooth
-animation.</li>
-<li>Providing easy-to-use debugging tools for tracing OpenGL ES API calls and
-checking for errors.</li>
-</ul>
-
-<p>GLSurfaceView is a good base for building an application that uses OpenGL ES
-for part or all of its rendering. A 2D or 3D action game would be a good
-candidate, as would a 2D or 3D data visualization application such as <a
-href="http://www.youtube.com/watch?v=4PRfVKzuUJ4&fmt=18" title="Google Maps
-StreetView">Google Maps StreetView</a>.</p>
-
-<h3>A simple GLSurfaceView application</h3>
-
-<p>Here's the source code to the simplest possible OpenGL ES application:</p>
-
-<pre>package com.example.android.apis.graphics;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.app.Activity;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-
-public class ClearActivity extends Activity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- mGLView = new GLSurfaceView(this);
- mGLView.setRenderer(new ClearRenderer());
- setContentView(mGLView);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- mGLView.onPause();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- mGLView.onResume();
- }
-
- private GLSurfaceView mGLView;
-}
-
-class ClearRenderer implements GLSurfaceView.Renderer {
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- // Do nothing special.
- }
-
- public void onSurfaceChanged(GL10 gl, int w, int h) {
- gl.glViewport(0, 0, w, h);
- }
-
- public void onDrawFrame(GL10 gl) {
- gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
- }
-}</pre>
-
-<p>This program doesn't do much: it clears the screen to black on every frame.
-But it is a complete OpenGL application that correctly implements the
-Android activity life-cycle. It pauses rendering when the activity is
-paused, and resumes it when the activity is resumed. You could use this
-application as the basis for non-interactive demonstration programs.
-Just add more OpenGL calls to the <code>ClearRenderer.onDrawFrame()</code> method.
-Notice that you don't even need to subclass the <code>GLSurfaceView</code> view.</p>
-
-<p>The {@link android.opengl.GLSurfaceView.Renderer} interface has three methods:</p>
-
-<ul>
-<li>The
-<code>onSurfaceCreated()</code> method is called at the start of rendering, and
-whenever the OpenGL ES drawing context has to be recreated. (The
-drawing context is typically lost and recreated when the activity is
-paused and resumed.) <code>OnSurfaceCreated()</code> is a good place to create
-long-lived OpenGL resources such as textures.</li>
-<li>The <code>onSurfaceChanged()</code>
-method is called when the surface changes size. It's a good place to
-set your OpenGL viewport. You may also want to set your camera here, if
-it's a fixed camera that doesn't move around the scene.</li>
-<li>The <code>onDrawFrame()</code> method is called every frame, and is
-responsible for drawing the scene. You would typically start by calling
-<code>glClear</code> to clear the framebuffer, followed by other OpenGL ES calls
-to draw the current scene.</li>
-</ul>
-
-<h3>How about user input?</h3>
-
-<p>If you want an interactive application (such as a game), you will typically
-subclass <code>GLSurfaceView</code>, because that's an easy way of obtaining
-input events. Here's a slightly longer example showing how to do that:</p>
-
-<pre>package com.google.android.ClearTest;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.app.Activity;
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-import android.view.MotionEvent;
-
-public class ClearActivity extends Activity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- mGLView = new ClearGLSurfaceView(this);
- setContentView(mGLView);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- mGLView.onPause();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- mGLView.onResume();
- }
-
- private GLSurfaceView mGLView;
-}
-
-class ClearGLSurfaceView extends GLSurfaceView {
- public ClearGLSurfaceView(Context context) {
- super(context);
- mRenderer = new ClearRenderer();
- setRenderer(mRenderer);
- }
-
- public boolean onTouchEvent(final MotionEvent event) {
- queueEvent(new Runnable(){
- public void run() {
- mRenderer.setColor(event.getX() / getWidth(),
- event.getY() / getHeight(), 1.0f);
- }});
- return true;
- }
-
- ClearRenderer mRenderer;
-}
-
-class ClearRenderer implements GLSurfaceView.Renderer {
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- // Do nothing special.
- }
-
- public void onSurfaceChanged(GL10 gl, int w, int h) {
- gl.glViewport(0, 0, w, h);
- }
-
- public void onDrawFrame(GL10 gl) {
- gl.glClearColor(mRed, mGreen, mBlue, 1.0f);
- gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
- }
-
- public void setColor(float r, float g, float b) {
- mRed = r;
- mGreen = g;
- mBlue = b;
- }
-
- private float mRed;
- private float mGreen;
- private float mBlue;
-}</pre>
-
-<p>This application clears the screen for every frame. When you tap on the
-screen, it sets the clear color based on the (x,y) coordinates of your touch
-event. Note the use of <code>queueEvent()</code> in
-<code>ClearGLSurfaceView.onTouchEvent()</code>. The <code>queueEvent()</code>
-method is used to safely communicate between the UI thread and the rendering
-thread. If you prefer, you can use some other Java cross-thread communication
-technique, such as synchronized methods on the <code>Renderer</code> class
-itself. However, queueing events is often the simplest way of dealing with
-cross-thread communication.</p>
-
-<h3>Other GLSurfaceView samples</h3>
-
-<p>Tired
-of just clearing the screen? You can find more interesting samples in
-the API Demos sample included in the Android SDK. All the OpenGL ES samples have been
-converted to use the <code>GLSurfaceView</code> view:</p>
-
-<ul>
-<li>GLSurfaceView - a spinning triangle</li>
-<li>Kube - a cube puzzle demo</li>
-<li>Translucent GLSurfaceView - shows how to display 3D graphics on a translucent background</li>
-<li>Textured Triangle - shows how to draw a textured 3D triangle</li>
-<li>Sprite Text - shows how to draw text into a texture and then composite it into a 3D scene</li>
-<li>Touch Rotate - shows how to rotate a 3D object in response to user input.</li>
-</ul>
-
-<h3>Choosing a surface</h3>
-
-<p><code>GLSurfaceView</code>
-helps you choose the type of surface to render to. Different Android
-devices support different types of surfaces, with no common subset.
-This makes it tricky problem to choose the best available surface on
-each device. </p>
-
-<p>By default, <code>GLSurfaceView</code> tries to find a surface that's as
-close as possible to a 16-bit RGB frame buffer with a 16-bit depth
-buffer. Depending upon your application's needs you may want to change
-this behavior. For example, the Translucent GLSurfaceView sample needs
-an Alpha channel in order to render translucent data. <code>GLSurfaceView</code>
-provides an overloaded <code>setEGLSurfaceChooser()</code> method to give
-you control over which surface type is chosen:</p>
-
-<dl>
-<dt><code>setEGLConfigChooser(boolean needDepth)</code></dt>
-<dd>Choose a config that's closest to R5G6B5 with or without a 16-bit framebuffer</dd>
-<dt><code>setEGLConfigChooser(int redSize, int greenSize,int blueSize,
-int alphaSize,int depthSize, int stencilSize)</code></dt>
-<dd>Choose the config with the fewest number of bits per pixel that has at least
-as many bits-per-channel as specified in the constructor.</dd>
-<dt><code>setEGLConfigChooser(EGLConfigChooser configChooser)</code></dt>
-<dd>Allow total control over choosing a configuration. You pass in your own
-implementation of <code>EGLConfigChooser</code>, which gets to inspect the
-device's capabilities and choose a configuration.</dd>
-</dl>
-
-<h3>Continuous rendering versus render-when-dirty</h3>
-
-<p>Most 3D applications, such as games or simulations, are continuously
-animated. But some 3D applications are more reactive: they wait passively until
-the user does something, and then react to it. For those types of applications,
-the default <code>GLSurfaceView</code> behavior of continuously redrawing the
-screen is a waste of time. If you are developing a reactive application, you can
-call <code>GLSurfaceView.setRenderMode(RENDERMODE_WHEN_DIRTY)</code>, which
-turns off the continuous animation. Then you call
-<code>GLSurfaceView.requestRender()</code> whenever you want to re-render.</p>
-
-<h3>Help With debugging</h3>
-
-<p><code>GLSurfaceView</code> has a handy built-in feature for debugging OpenGL ES
-applications: the <code>GLSurfaceView.setDebugFlags()</code> method can be used
-to enable logging and/or error checking your OpenGL ES calls. Call this method
-in your <code>GLSurfaceView</code>'s constructor, before calling
-<code>setRenderer()</code>:</p>
-
-<pre>public ClearGLSurfaceView(Context context) {
- super(context);
- // Turn on error-checking and logging
- setDebugFlags(DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS);
- mRenderer = new ClearRenderer();
- setRenderer(mRenderer);
-}</pre>
\ No newline at end of file
diff --git a/docs/html/resources/articles/images/File.png b/docs/html/resources/articles/images/File.png
deleted file mode 100644
index bc5a2b8..0000000
--- a/docs/html/resources/articles/images/File.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/File_002.png b/docs/html/resources/articles/images/File_002.png
deleted file mode 100644
index 39254b30..0000000
--- a/docs/html/resources/articles/images/File_002.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/JFlubber.png b/docs/html/resources/articles/images/JFlubber.png
deleted file mode 100644
index d95e32b..0000000
--- a/docs/html/resources/articles/images/JFlubber.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/WikiNotes.png b/docs/html/resources/articles/images/WikiNotes.png
deleted file mode 100644
index d52c4fc..0000000
--- a/docs/html/resources/articles/images/WikiNotes.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/all_drawables_changed.png b/docs/html/resources/articles/images/all_drawables_changed.png
deleted file mode 100644
index 04ec4a2..0000000
--- a/docs/html/resources/articles/images/all_drawables_changed.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/android.png b/docs/html/resources/articles/images/android.png
deleted file mode 100644
index 6dc88cc..0000000
--- a/docs/html/resources/articles/images/android.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/buttons.png b/docs/html/resources/articles/images/buttons.png
deleted file mode 100644
index 8c220b9..0000000
--- a/docs/html/resources/articles/images/buttons.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/contacts-2.png b/docs/html/resources/articles/images/contacts-2.png
deleted file mode 100644
index 02f28aa..0000000
--- a/docs/html/resources/articles/images/contacts-2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/contacts.png b/docs/html/resources/articles/images/contacts.png
deleted file mode 100644
index d8b067d..0000000
--- a/docs/html/resources/articles/images/contacts.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/correct_drawables.png b/docs/html/resources/articles/images/correct_drawables.png
deleted file mode 100644
index 516309b..0000000
--- a/docs/html/resources/articles/images/correct_drawables.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/ddms_allocation_tracker.png b/docs/html/resources/articles/images/ddms_allocation_tracker.png
deleted file mode 100644
index b9fa0a1..0000000
--- a/docs/html/resources/articles/images/ddms_allocation_tracker.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/ddms_allocation_trackerl.png b/docs/html/resources/articles/images/ddms_allocation_trackerl.png
deleted file mode 100644
index 5ac8d2a..0000000
--- a/docs/html/resources/articles/images/ddms_allocation_trackerl.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/device.png b/docs/html/resources/articles/images/device.png
deleted file mode 100644
index 186b960..0000000
--- a/docs/html/resources/articles/images/device.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/device_002.png b/docs/html/resources/articles/images/device_002.png
deleted file mode 100644
index 4bc3b0c..0000000
--- a/docs/html/resources/articles/images/device_002.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/gestures.png b/docs/html/resources/articles/images/gestures.png
deleted file mode 100644
index fe8f7cd..0000000
--- a/docs/html/resources/articles/images/gestures.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/gestures_002.png b/docs/html/resources/articles/images/gestures_002.png
deleted file mode 100644
index b20da98..0000000
--- a/docs/html/resources/articles/images/gestures_002.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/gestures_003.png b/docs/html/resources/articles/images/gestures_003.png
deleted file mode 100644
index a295939..0000000
--- a/docs/html/resources/articles/images/gestures_003.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/gestures_004.png b/docs/html/resources/articles/images/gestures_004.png
deleted file mode 100644
index 3fe5fb1..0000000
--- a/docs/html/resources/articles/images/gestures_004.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/gestures_005.png b/docs/html/resources/articles/images/gestures_005.png
deleted file mode 100644
index 3efc519..0000000
--- a/docs/html/resources/articles/images/gestures_005.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/gestures_006.png b/docs/html/resources/articles/images/gestures_006.png
deleted file mode 100644
index 399c31d..0000000
--- a/docs/html/resources/articles/images/gestures_006.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/grid.png b/docs/html/resources/articles/images/grid.png
deleted file mode 100644
index 4713de5..0000000
--- a/docs/html/resources/articles/images/grid.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/ime.png b/docs/html/resources/articles/images/ime.png
deleted file mode 100644
index 57f6df1..0000000
--- a/docs/html/resources/articles/images/ime.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/ime_002.png b/docs/html/resources/articles/images/ime_002.png
deleted file mode 100644
index 3ec00b2..0000000
--- a/docs/html/resources/articles/images/ime_002.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/ime_003.png b/docs/html/resources/articles/images/ime_003.png
deleted file mode 100644
index a3f57bb..0000000
--- a/docs/html/resources/articles/images/ime_003.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/ime_004.png b/docs/html/resources/articles/images/ime_004.png
deleted file mode 100644
index efeddf0..0000000
--- a/docs/html/resources/articles/images/ime_004.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/ime_005.png b/docs/html/resources/articles/images/ime_005.png
deleted file mode 100644
index a7394e0..0000000
--- a/docs/html/resources/articles/images/ime_005.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/ime_006.png b/docs/html/resources/articles/images/ime_006.png
deleted file mode 100644
index 0b55c79..0000000
--- a/docs/html/resources/articles/images/ime_006.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/layouts_comparison_small.png b/docs/html/resources/articles/images/layouts_comparison_small.png
deleted file mode 100644
index 0ba4cb8..0000000
--- a/docs/html/resources/articles/images/layouts_comparison_small.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/list01.png b/docs/html/resources/articles/images/list01.png
deleted file mode 100644
index e1b7fa8..0000000
--- a/docs/html/resources/articles/images/list01.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/list02.png b/docs/html/resources/articles/images/list02.png
deleted file mode 100644
index 7f72a3f..0000000
--- a/docs/html/resources/articles/images/list02.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/list_fade_1.png b/docs/html/resources/articles/images/list_fade_1.png
deleted file mode 100644
index 43013d6..0000000
--- a/docs/html/resources/articles/images/list_fade_1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/list_fade_2.png b/docs/html/resources/articles/images/list_fade_2.png
deleted file mode 100644
index 160d3ff..0000000
--- a/docs/html/resources/articles/images/list_fade_2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/list_fade_3.png b/docs/html/resources/articles/images/list_fade_3.png
deleted file mode 100644
index 70dca64..0000000
--- a/docs/html/resources/articles/images/list_fade_3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/list_fade_4.png b/docs/html/resources/articles/images/list_fade_4.png
deleted file mode 100644
index 7619fca..0000000
--- a/docs/html/resources/articles/images/list_fade_4.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/live_wallpapers_small.png b/docs/html/resources/articles/images/live_wallpapers_small.png
deleted file mode 100644
index 3b49b24..0000000
--- a/docs/html/resources/articles/images/live_wallpapers_small.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/merge1.jpg b/docs/html/resources/articles/images/merge1.jpg
deleted file mode 100644
index 114eed6..0000000
--- a/docs/html/resources/articles/images/merge1.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/merge2.png b/docs/html/resources/articles/images/merge2.png
deleted file mode 100644
index b4a8d4c..0000000
--- a/docs/html/resources/articles/images/merge2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/merge3.png b/docs/html/resources/articles/images/merge3.png
deleted file mode 100644
index 61ed983..0000000
--- a/docs/html/resources/articles/images/merge3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/merge4.jpg b/docs/html/resources/articles/images/merge4.jpg
deleted file mode 100644
index 17b6c20..0000000
--- a/docs/html/resources/articles/images/merge4.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/merge5.png b/docs/html/resources/articles/images/merge5.png
deleted file mode 100644
index 289f47e..0000000
--- a/docs/html/resources/articles/images/merge5.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/mutated_states.png b/docs/html/resources/articles/images/mutated_states.png
deleted file mode 100644
index 50518b6..0000000
--- a/docs/html/resources/articles/images/mutated_states.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/on-screen-inputs.png b/docs/html/resources/articles/images/on-screen-inputs.png
deleted file mode 100644
index b8b3cf7..0000000
--- a/docs/html/resources/articles/images/on-screen-inputs.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/on-screen-inputs_002.png b/docs/html/resources/articles/images/on-screen-inputs_002.png
deleted file mode 100644
index a5d21c7..0000000
--- a/docs/html/resources/articles/images/on-screen-inputs_002.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/on-screen-inputs_003.png b/docs/html/resources/articles/images/on-screen-inputs_003.png
deleted file mode 100644
index 81ee257..0000000
--- a/docs/html/resources/articles/images/on-screen-inputs_003.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/on-screen-inputs_004.png b/docs/html/resources/articles/images/on-screen-inputs_004.png
deleted file mode 100644
index 651b72a..0000000
--- a/docs/html/resources/articles/images/on-screen-inputs_004.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/on-screen-inputs_005.png b/docs/html/resources/articles/images/on-screen-inputs_005.png
deleted file mode 100644
index 75185ff..0000000
--- a/docs/html/resources/articles/images/on-screen-inputs_005.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/on-screen-inputs_006.png b/docs/html/resources/articles/images/on-screen-inputs_006.png
deleted file mode 100644
index b653d75..0000000
--- a/docs/html/resources/articles/images/on-screen-inputs_006.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/photostream_landscape.png b/docs/html/resources/articles/images/photostream_landscape.png
deleted file mode 100644
index ad4a0c5..0000000
--- a/docs/html/resources/articles/images/photostream_landscape.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/photostream_portrait.png b/docs/html/resources/articles/images/photostream_portrait.png
deleted file mode 100644
index 3794f63..0000000
--- a/docs/html/resources/articles/images/photostream_portrait.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/qsb.png b/docs/html/resources/articles/images/qsb.png
deleted file mode 100644
index 4e40af1..0000000
--- a/docs/html/resources/articles/images/qsb.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/qsb_002.png b/docs/html/resources/articles/images/qsb_002.png
deleted file mode 100644
index 8c2f772..0000000
--- a/docs/html/resources/articles/images/qsb_002.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/qsb_003.png b/docs/html/resources/articles/images/qsb_003.png
deleted file mode 100644
index 069b6cd..0000000
--- a/docs/html/resources/articles/images/qsb_003.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/relativelayout_1.png b/docs/html/resources/articles/images/relativelayout_1.png
deleted file mode 100644
index 3360ad8..0000000
--- a/docs/html/resources/articles/images/relativelayout_1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/relativelayout_2.png b/docs/html/resources/articles/images/relativelayout_2.png
deleted file mode 100644
index 8e71bb2..0000000
--- a/docs/html/resources/articles/images/relativelayout_2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/relativelayout_3.png b/docs/html/resources/articles/images/relativelayout_3.png
deleted file mode 100644
index 16a9767..0000000
--- a/docs/html/resources/articles/images/relativelayout_3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/relativelayout_wire_1.png b/docs/html/resources/articles/images/relativelayout_wire_1.png
deleted file mode 100644
index 9cb241d..0000000
--- a/docs/html/resources/articles/images/relativelayout_wire_1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/relativelayout_wire_2.png b/docs/html/resources/articles/images/relativelayout_wire_2.png
deleted file mode 100644
index 4243812..0000000
--- a/docs/html/resources/articles/images/relativelayout_wire_2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/relativelayout_wire_3.png b/docs/html/resources/articles/images/relativelayout_wire_3.png
deleted file mode 100644
index 04ce1ce..0000000
--- a/docs/html/resources/articles/images/relativelayout_wire_3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/search01.png b/docs/html/resources/articles/images/search01.png
deleted file mode 100644
index 4160a76..0000000
--- a/docs/html/resources/articles/images/search01.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/search02.png b/docs/html/resources/articles/images/search02.png
deleted file mode 100644
index 6300018..0000000
--- a/docs/html/resources/articles/images/search02.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/service-api-changes-starting-with_runningservices.png b/docs/html/resources/articles/images/service-api-changes-starting-with_runningservices.png
deleted file mode 100644
index e159fff..0000000
--- a/docs/html/resources/articles/images/service-api-changes-starting-with_runningservices.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/service-api-changes-starting-with_stopservice.png b/docs/html/resources/articles/images/service-api-changes-starting-with_stopservice.png
deleted file mode 100644
index cc8f0a2..0000000
--- a/docs/html/resources/articles/images/service-api-changes-starting-with_stopservice.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/shared_states.png b/docs/html/resources/articles/images/shared_states.png
deleted file mode 100644
index 81bec09..0000000
--- a/docs/html/resources/articles/images/shared_states.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/shelves2.png b/docs/html/resources/articles/images/shelves2.png
deleted file mode 100644
index 2de239f..0000000
--- a/docs/html/resources/articles/images/shelves2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/speech-input.png b/docs/html/resources/articles/images/speech-input.png
deleted file mode 100644
index 78fbc98..0000000
--- a/docs/html/resources/articles/images/speech-input.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/text_field.png b/docs/html/resources/articles/images/text_field.png
deleted file mode 100644
index b9dedec..0000000
--- a/docs/html/resources/articles/images/text_field.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/ui-1.6.png b/docs/html/resources/articles/images/ui-1.6.png
deleted file mode 100644
index bc5a2b8..0000000
--- a/docs/html/resources/articles/images/ui-1.6.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/ui-1.6_002.png b/docs/html/resources/articles/images/ui-1.6_002.png
deleted file mode 100644
index 39254b30..0000000
--- a/docs/html/resources/articles/images/ui-1.6_002.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/viewstub1.png b/docs/html/resources/articles/images/viewstub1.png
deleted file mode 100644
index 2de239f..0000000
--- a/docs/html/resources/articles/images/viewstub1.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/viewstub2.png b/docs/html/resources/articles/images/viewstub2.png
deleted file mode 100644
index 6e6feb9..0000000
--- a/docs/html/resources/articles/images/viewstub2.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/viewstub3.png b/docs/html/resources/articles/images/viewstub3.png
deleted file mode 100644
index 5e793e6..0000000
--- a/docs/html/resources/articles/images/viewstub3.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/viewstub4.png b/docs/html/resources/articles/images/viewstub4.png
deleted file mode 100644
index cffb9c6..0000000
--- a/docs/html/resources/articles/images/viewstub4.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/webview.png b/docs/html/resources/articles/images/webview.png
deleted file mode 100644
index 92472af..0000000
--- a/docs/html/resources/articles/images/webview.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/window_background.png b/docs/html/resources/articles/images/window_background.png
deleted file mode 100644
index 58f4f7e..0000000
--- a/docs/html/resources/articles/images/window_background.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/window_background_null.png b/docs/html/resources/articles/images/window_background_null.png
deleted file mode 100644
index 83f7b45..0000000
--- a/docs/html/resources/articles/images/window_background_null.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/images/window_background_root.png b/docs/html/resources/articles/images/window_background_root.png
deleted file mode 100644
index 95a47c0..0000000
--- a/docs/html/resources/articles/images/window_background_root.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/articles/index.jd b/docs/html/resources/articles/index.jd
deleted file mode 100644
index 2947e4a..0000000
--- a/docs/html/resources/articles/index.jd
+++ /dev/null
@@ -1,168 +0,0 @@
-page.title=Technical Articles
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/avoiding-memory-leaks.html">Avoiding Memory Leaks</a></dt>
- <dd>Mobile devices often have limited memory, and memory leaks can cause your application to waste this valuable resource without your knowledge. This article provides tips to help you avoid common causes of memory leaks on the Android platform.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/backward-compatibility.html">Backward Compatibility</a></dt>
- <dd>The Android platform strives to ensure backwards compatibility. However, sometimes you want to use new features which aren't supported on older platforms. This article discusses strategies for selectively using these features based on availability, allowing you to keep your applications portable across a wide range of devices.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/can-i-use-this-intent.html">Can I Use this Intent?</a></dt>
- <dd>Android offers a very powerful and yet easy-to-use message type called an intent. You can use intents to turn applications into high-level libraries and make code modular and reusable. While it is nice to be able to make use of a loosely coupled API, there is no guarantee that the intent you send will be received by another application. This article describes a technique you can use to find out whether the system contains any application capable of responding to the intent you want to use.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/creating-input-method.html">Creating an Input Method</a></dt>
- <dd>Input Method Editors (IMEs) provide the mechanism for entering text into text fields and other Views. Android devices come bundled with at least one IME, but users can install additional IMEs. This article covers the basics of developing an IME for the Android platform.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/drawable-mutations.html">Drawable Mutations</a></dt>
- <dd>Drawables are pluggable drawing containers that allow applications to display graphics. This article explains some common pitfalls when trying to modify the properties of multiple Drawables.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/faster-screen-orientation-change.html">Faster Screen Orientation Change</a></dt>
- <dd>When an Android device changes its orientation, the default behavior is to automatically restart the current activity with a new configuration. However, this can become a bottleneck in applications that access a large amount of external data. This article discusses how to gracefully handle this situation without resorting to manually processing configuration changes.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/future-proofing.html">Future-Proofing Your Apps</a></dt>
- <dd>A collection of common sense advice to help you ensure that your applications don't break when new versions of the Android platform are released.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/gestures.html">Gestures</a></dt>
- <dd>Touch screens allow users to perform gestures, such as tapping, dragging, flinging, or sliding, to perform various actions. The gestures API enables your application to recognize even complicated gestures with ease. This article explains how to integrate this API into an application.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/glsurfaceview.html">Introducing GLSurfaceView</a></dt>
- <dd>This article provides an overview of GLSurfaceView, a class that makes it easy to implement 2D or 3D OpenGL rendering inside of an Android application.</dd>
-</dl>
-<dl>
- <dt>
- <a href="{@docRoot}resources/articles/spell-checker-framework.jd">
- Using the Spell Checker Framework</a>
- </dt>
- <dd>
- This article describes how to use the Spell Checker Framework to check spelling in
- various ways in your application.
- </dd>
-</dl>
-<dl>
- <dt><a href="{@docRoot}resources/articles/layout-tricks-reuse.html">Layout Tricks: Creating Reusable UI Components</a></dt>
- <dd>Learn how to combine multiple standard UI widgets into a single high-level component, which can be reused throughout your application.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/layout-tricks-efficiency.html">Layout Tricks: Creating Efficient Layouts</a></dt>
- <dd>Learn how to optimize application layouts as this article walks you through converting a LinearLayout into a RelativeLayout, and analyzes the resulting implications on performance.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/layout-tricks-stubs.html">Layout Tricks: Using ViewStubs</a></dt>
- <dd>Learn about using ViewStubs inside an application's layout in order to inflate rarely used UI elements, without the performance implications which would otherwise be caused by using the <code><include></code> tag.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/layout-tricks-merge.html">Layout Tricks: Merging Layouts</a></dt>
- <dd>Learn how to use the <code><merge></code> tag in your XML layouts in order to avoid unnecessary levels of hierarchy within an application's view tree.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/listview-backgrounds.html">ListView Backgrounds: An Optimization</a></dt>
- <dd>ListViews are very popular widgets within the Android framework. This article describes some of the optimizations used by the ListView widget, and how to avoid some common issues that this causes when trying to use a custom background.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/live-folders.html">Live Folders</a></dt>
- <dd>Live Folders allow users to display any source of data on their home screen without launching an application. This article discusses how to export an application's data in a format suitable for display inside of a live folder.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/live-wallpapers.html">Live Wallpapers</a></dt>
- <dd>Live wallpapers are richer, animated, interactive backgrounds that users can display in their home screens. Learn how to create a live wallpaper and bundle it in an application that users can install on their devices.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/on-screen-inputs.html">Onscreen Input Methods</a></dt>
- <dd>The Input Method Framework (IMF) allows users to take advantage of on-screen input methods, such as software keyboards. This article provides an overview of Input Method Editors (IMEs) and how applications interact with them.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/painless-threading.html">Painless Threading</a></dt>
- <dd>This article discusses the threading model used by Android applications and how applications can ensure best UI performance by spawning worker threads to handle long-running operations, rather than handling them in the main thread. The article also explains the API that your application can use to interact with Android UI toolkit components running on the main thread and spawn managed worker threads.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/qsb.html">Quick Search Box</a></dt>
- <dd>Quick Search Box (QSB) is a powerful, system-wide search framework. QSB makes it possible for users to quickly and easily find what they're looking for, both on their devices and on the web. This article discusses how to work with the QSB framework to add new search results for an installed application.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/touch-mode.html">Touch Mode</a></dt>
- <dd>This article explains the touch mode, one of the most important principles of Android's UI toolkit. Whenever a user interacts with a device's touch screen, the system enters touch mode. While simple in concept, there are important implications touch mode that are often overlooked.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/track-mem.html">Tracking Memory Allocations</a></dt>
- <dd>This article discusses how to use the Allocation Tracker tool to observe memory allocations and avoid performance problems that would otherwise be caused by ignoring the effect of Dalvik's garbage collector.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/ui-1.5.html">UI Framework Changes in Android 1.5</a></dt>
- <dd>Explore the UI changes that were introduced in Android 1.5, compared with the UI provided in Android 1.0 and 1.1.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/ui-1.6.html">UI Framework Changes in Android 1.6</a></dt>
- <dd>Explore the UI changes that were introduced in Android 1.6, compared with the UI provided in Android 1.5. In particular, this article discusses changes to RelativeLayouts and click listeners.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/timed-ui-updates.html">Updating the UI from a Timer</a></dt>
- <dd>Learn about how to use Handlers as a more efficient replacement for java.util.Timer on the Android platform.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/tts.html">Using Text-to-Speech</a></dt>
- <dd>The text-to-speech API lets your application "speak" to users, in any of several languages. This article provides an overview of the TTS API and how you use to add speech capabilities to your application.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/tts.html">Using the Contacts API</a></dt>
- <dd>This article discusses the improved Contacts API introduced in Android 2.0 and how to use it to manage and integrate contacts from multiple accounts and data sources. The article also discusses techniques for using the new API on devices that support it, while maintaining backward compatibility with the old API on other devices. </dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/using-webviews.html">Using WebViews</a></dt>
- <dd>WebViews allow an application to dynamically display HTML and execute JavaScript, without relinquishing control to a separate browser application. This article introduces the WebView classes and provides a sample application that demonstrates its use.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/wikinotes-linkify.html">WikiNotes: Linkify your Text!</a></dt>
- <dd>This article introduces WikiNotes for Android, part of the Apps for Android project. It covers the use of Linkify to turn ordinary text views into richer, link-oriented content that causes Android intents to fire when a link is selected.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/wikinotes-intents.html">WikiNotes: Routing Intents</a></dt>
- <dd>This article illustrates how an application, in this case the WikiNotes sample app, can use intents to route various types of linked text to the application that handles that type of data. For example, an app can use intents to route a linked telephone number to a dialer app and a web URL to a browser.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/window-bg-speed.html">Window Backgrounds & UI Speed</a></dt>
- <dd>Some Android applications need to squeeze every bit of performance out of the UI toolkit and there are many ways to do so. In this article, you will discover how to speed up the drawing and the perceived startup time of your activities. Both of these techniques rely on a single feature, the window's background drawable.</dd>
-</dl>
-
-<dl>
- <dt><a href="{@docRoot}resources/articles/zipalign.html">Zipalign: an Easy Optimization</a></dt>
- <dd>The Android SDK includes a tool called zipalign that optimizes the way an application is packaged. Running zipalign against your application enables Android to interact with it more efficiently at run time and thus has the potential to make it and the overall system run faster. This article provides a high-level overview of the zipalign tool and its use.</dd>
-</dl>
diff --git a/docs/html/resources/articles/layout-tricks-efficiency.jd b/docs/html/resources/articles/layout-tricks-efficiency.jd
deleted file mode 100644
index 00b4147..0000000
--- a/docs/html/resources/articles/layout-tricks-efficiency.jd
+++ /dev/null
@@ -1,179 +0,0 @@
-page.title=Layout Tricks: Creating Efficient Layouts
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>The Android UI toolkit offers several layout managers that are
-rather easy to use and, most of the time, you only need the basic
-features of these layout managers to implement a user interface.</p>
-
-<p>Sticking to the basic features is unfortunately not the most efficient
-way to create user interfaces. A common example is the abuse of
-{@link android.widget.LinearLayout}, which leads to a proliferation of
-views in the view hierarchy. Every view — or worse, every layout
-manager — that you add to your application comes at a cost:
-initialization, layout and drawing become slower. The layout pass can be
-especially expensive when you nest several <code>LinearLayout</code>
-that use the {@link android.R.attr#layout_weight weight}
-parameter, which requires the child to be measured twice.</p>
-
-<p>Let's consider a very simple and common example of a layout: a list item
-with an icon on the left, a title at the top and an optional description
-underneath the title. Here is what such an item looks like:</p>
-
-<div style="text-align: center;"><img src="images/relativelayout_1.png" alt="Simple list item"></div>
-
-<p>To clearly understand how the views, one {@link android.widget.ImageView} and
-two {@link android.widget.TextView}, are positioned with respect to each other,
-here is the wireframe of the layout as captured by <a
-href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">HierarchyViewer</a
->:</p>
-
-<div style="text-align: center;"><img src="images/relativelayout_wire_1.png" alt="Wireframe of the simple list item"></div>
-
-<p>Implementing this layout is straightforward with <code>LinearLayout</code>.
-The item itself is a horizontal <code>LinearLayout</code> with an
-<code>ImageView</code> and a vertical <code>LinearLayout</code>, which contains
-the two <code>TextView</code>. Here's the source code of this layout:</p>
-
-<pre class="prettyprint"><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="?android:attr/listPreferredItemHeight"
-
- android:padding="6dip">
-
- <ImageView
- android:id="@+id/icon"
-
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_marginRight="6dip"
-
- android:src="@drawable/icon" />
-
- <LinearLayout
- android:orientation="vertical"
-
- android:layout_width="0dip"
- android:layout_weight="1"
- android:layout_height="fill_parent">
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="0dip"
- android:layout_weight="1"
-
- android:gravity="center_vertical"
- android:text="My Application" />
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="0dip"
- android:layout_weight="1"
-
- android:singleLine="true"
- android:ellipsize="marquee"
- android:text="Simple application that shows how to use RelativeLayout" />
-
- </LinearLayout>
-
-</LinearLayout></pre>
-
-<p>This layout works but can be wasteful if you instantiate it for every list
-item of a {@link android.widget.ListView}. The same layout can be rewritten
-using a single {@link android.widget.RelativeLayout}, thus saving one view, and
-even better one level in view hierarchy, per list item. The implementation of
-the layout with a <code>RelativeLayout</code> remains simple:</p>
-
-<pre class="prettyprint"><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="?android:attr/listPreferredItemHeight"
-
- android:padding="6dip">
-
- <ImageView
- android:id="@+id/icon"
-
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
-
- android:layout_alignParentTop="true"
- android:layout_alignParentBottom="true"
- android:layout_marginRight="6dip"
-
- android:src="@drawable/icon" />
-
- <TextView
- android:id="@+id/secondLine"
-
- android:layout_width="fill_parent"
- android:layout_height="26dip"
-
- android:layout_toRightOf="@id/icon"
- android:layout_alignParentBottom="true"
- android:layout_alignParentRight="true"
-
- android:singleLine="true"
- android:ellipsize="marquee"
- android:text="Simple application that shows how to use RelativeLayout" />
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
-
- android:layout_toRightOf="@id/icon"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:layout_above="@id/secondLine"
- android:layout_alignWithParentIfMissing="true"
-
- android:gravity="center_vertical"
- android:text="My Application" />
-
-</RelativeLayout></pre>
-
-<p>This new implementation behaves exactly the same way as the previous
-implementation, except in one case. The list item we want to display has two
-lines of text: the title and an <em>optional</em> description. When a
-description is not available for a given list item, the application would simply
-set the visibility of the second <code>TextView</code> to
-{@link android.view.View#GONE}. This works perfectly with the <code>LinearLayout</code>
-implementation but not with the <code>RelativeLayout</code> version:</p>
-
-<div style="text-align: center;"><img src="images/relativelayout_2.png" alt="RelativeLayout and description GONE"></div>
-<div style="text-align: center;"><img src="images/relativelayout_wire_2.png" alt="RelativeLayout and description GONE"></div>
-
-<p>In a <code>RelativeLayout</code>, views are aligned with their parent, with the
-<code>RelativeLayout</code> itself, or with other views. For instance, we declared that
-the description is aligned with the bottom of the <code>RelativeLayout</code> and
-that the title is positioned above the description and anchored to the
-parent's top. With the description GONE, RelativeLayout doesn't know
-where to position the title's bottom edge. To solve this problem, you
-can use a very special layout parameter called
-{@link android.R.attr#layout_alignWithParentIfMissing}.
-</p>
-
-<p>This boolean parameter simply tells RelativeLayout to use its own edges as
-anchors when a constraint target is missing. For instance, if you position a
-view to the right of a GONE view and set <code>alignWithParentIfMissing</code>
-to <code>true</code>, <code>RelativeLayout</code> will instead anchor the view
-to its left edge. In our case, using <code>alignWithParentIfMissing</code> will
-cause <code>RelativeLayout</code> to align the title's bottom with its own
-bottom. The result is the following:</p>
-
-<div style="text-align: center;"><img src="images/relativelayout_3.png" alt="RelativeLayout, description GONE and alignWithParentIfMissing"></div>
-<div style="text-align: center;"><img src="images/relativelayout_wire_3.png" alt="RelativeLayout, description GONE and alignWithParentIfMissing"></div>
-
-<p>The
-behavior of our layout is now perfect, even when the description is
-GONE. Even better, the hierarchy is simpler and because we are not
-using LinearLayout's weights it's also more efficient. The difference
-between the two implementations becomes obvious when comparing the view
-hierarchies in HierarchyViewer:</p>
-
-<div style="text-align: center;"><img src="images/layouts_comparison_small.png" alt="LinearLayout vs RelativeLayout"></div>
-
-<p>Again, the difference will be much more important when you use such a layout
-for every item in a ListView for instance. Hopefully this simple
-example showed you that getting to know your layouts is the best way to
-learn how to optimize your UI.</p>
diff --git a/docs/html/resources/articles/layout-tricks-merge.jd b/docs/html/resources/articles/layout-tricks-merge.jd
deleted file mode 100644
index 0ca0317..0000000
--- a/docs/html/resources/articles/layout-tricks-merge.jd
+++ /dev/null
@@ -1,202 +0,0 @@
-page.title=Layout Tricks: Merging Layouts
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>The articles showed you how to use the <code><include /></code> tag in XML layouts, to
-reuse and share your layout code. This article explains the <code><merge /></code> tag and how
-it complements the <code><include /></code> tag.</p>
-
-<p>The <code><merge /></code> tag was created for the purpose of
-optimizing Android layouts by reducing the number of levels in view trees. It's
-easier to understand the problem this tag solves by looking at an example. The
-following XML layout declares a layout that shows an image with its title on top
-of it. The structure is fairly simple; a {@link android.widget.FrameLayout} is
-used to stack a {@link android.widget.TextView} on top of an
-{@link android.widget.ImageView}:</p>
-
-<pre class="prettyprint"><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
- <ImageView
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
-
- android:scaleType="center"
- android:src="@drawable/golden_gate" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="20dip"
- android:layout_gravity="center_horizontal|bottom"
-
- android:padding="12dip"
-
- android:background="#AA000000"
- android:textColor="#ffffffff"
-
- android:text="Golden Gate" />
-
-</FrameLayout></pre>
-
-<p>This layout renders nicely and nothing seems wrong with it:</p>
-
-<div style="text-align: center;"><img src="images/merge1.jpg" alt="A FrameLayout is used to overlay a title on top of an image"></div>
-
-<p>Things get more interesting when you inspect the result with <a
-href="{@docRoot}guide/developing/debugging/debugging-ui.html#hierarchyViewer">HierarchyViewer</a>.
-If you look closely at the resulting tree, you will notice that the
-<code>FrameLayout</code> defined in our XML file (highlighted in blue below) is
-the sole child of another <code>FrameLayout</code>:</p>
-
-<div style="text-align: center;"><img src="images/merge2.png" alt="A layout with only one child of same dimensions can be removed"></div>
-
-<p>Since our <code>FrameLayout</code> has the same dimension as its parent, by
-the virtue of using the <code>fill_parent</code> constraints, and does not
-define any background, extra padding or a gravity, it is <em>totally
-useless</em>. We only made the UI more complex for no good reason. But how could
-we get rid of this <code>FrameLayout</code>? After all, XML documents require a
-root tag and tags in XML layouts always represent view instances.</p>
-
-<p>That's where the <code><merge /></code> tag comes in handy. When the
-{@link android.view.LayoutInflater} encounters this tag, it skips it and adds
-the <code><merge /></code> children to the <code><merge /></code>
-parent. Confused? Let's rewrite our previous XML layout by replacing the
-<code>FrameLayout</code> with <code><merge /></code>:</p>
-
-<pre class="prettyprint"><merge xmlns:android="http://schemas.android.com/apk/res/android">
-
- <ImageView
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
-
- android:scaleType="center"
- android:src="@drawable/golden_gate" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="20dip"
- android:layout_gravity="center_horizontal|bottom"
-
- android:padding="12dip"
-
- android:background="#AA000000"
- android:textColor="#ffffffff"
-
- android:text="Golden Gate" />
-
-</merge></pre>
-
-<p>With this new version, both the <code>TextView</code> and the
-<code>ImageView</code> will be added directly to the top-level
-<code>FrameLayout</code>. The result will be visually the same but the view
-hierarchy is simpler:</p>
-
-<div style="text-align: center;"><img src="images/merge3.png" alt="Optimized view hierarchy using the merge tag"></div>
-
-<p>Obviously, using <code><merge /></code> works in this case because the
-parent of an activity's content view is always a <code>FrameLayout</code>. You
-could not apply this trick if your layout was using a <code>LinearLayout</code>
-as its root tag for instance. The <code><merge /></code> can be useful in
-other situations though. For instance, it works perfectly when combined with the
-<code><include /></code> tag. You can also use <code><merge
-/></code> when you create a custom composite view. Let's see how we can use
-this tag to create a new view called <code>OkCancelBar</code> which simply shows
-two buttons with customizable labels. You can also <a
-href="http://progx.org/users/Gfx/android/MergeLayout.zip">download the complete
-source code of this example</a>. Here is the XML used to display this custom
-view on top of an image:</p>
-
-<pre class="prettyprint"><merge
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:okCancelBar="http://schemas.android.com/apk/res/com.example.android.merge">
-
- <ImageView
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
-
- android:scaleType="center"
- android:src="@drawable/golden_gate" />
-
- <com.example.android.merge.OkCancelBar
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
-
- android:paddingTop="8dip"
- android:gravity="center_horizontal"
-
- android:background="#AA000000"
-
- okCancelBar:okLabel="Save"
- okCancelBar:cancelLabel="Don't save" />
-
-</merge></pre>
-
-<p>This new layout produces the following result on a device:</p>
-
-<div style="text-align: center;"><img src="images/merge4.jpg" alt="Creating a custom view with the merge tag"></div>
-
-<p>The source code of <code>OkCancelBar</code> is very simple because the two
-buttons are defined in an external XML file, loaded using a
-<code>LayoutInflate</code>. As you can see in the following snippet, the XML
-layout <code>R.layout.okcancelbar</code> is inflated with the
-<code>OkCancelBar</code> as the parent:</p>
-
-<pre class="prettyprint">public class OkCancelBar extends LinearLayout {
- public OkCancelBar(Context context, AttributeSet attrs) {
- super(context, attrs);
- setOrientation(HORIZONTAL);
- setGravity(Gravity.CENTER);
- setWeightSum(1.0f);
-
- LayoutInflater.from(context).inflate(R.layout.okcancelbar, this, true);
-
- TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.OkCancelBar, 0, 0);
-
- String text = array.getString(R.styleable.OkCancelBar_okLabel);
- if (text == null) text = "Ok";
- ((Button) findViewById(R.id.okcancelbar_ok)).setText(text);
-
- text = array.getString(R.styleable.OkCancelBar_cancelLabel);
- if (text == null) text = "Cancel";
- ((Button) findViewById(R.id.okcancelbar_cancel)).setText(text);
-
- array.recycle();
- }
-}</pre>
-
-<p>The two buttons are defined in the following XML layout. As you can see, we
-use the <code><merge /></code> tag to add the two buttons directly to the
-<code>OkCancelBar</code>. Each button is included from the same external XML
-layout file to make them easier to maintain; we simply override their id:</p>
-
-<pre class="prettyprint"><merge xmlns:android="http://schemas.android.com/apk/res/android">
- <include
- layout="@layout/okcancelbar_button"
- android:id="@+id/okcancelbar_ok" />
-
- <include
- layout="@layout/okcancelbar_button"
- android:id="@+id/okcancelbar_cancel" />
-</merge></pre>
-
-<p>We have created a flexible and easy to maintain custom view that generates
-an efficient view hierarchy:</p>
-
-<div style="text-align: center;"><img src="images/merge5.png" alt="The resulting hierarchy is simple and efficient"></div>
-
-<p>The <code><merge /></code> tag is extremely useful and can do wonders
-in your code. However, it suffers from a couple of limitations:</p>
-
-<ul>
-<li><code><merge /></code> can only be used as the root tag of an XML layout</li>
-<li>When inflating a layout starting with a <code><merge /></code>, you <strong>must</strong>
-specify a parent <code>ViewGroup</code> and you must set <code>attachToRoot</code> to
-<code>true</code> (see the documentation for
-{@link android.view.LayoutInflater#inflate(int, android.view.ViewGroup, boolean)} method)</li>
-</ul>
-
diff --git a/docs/html/resources/articles/layout-tricks-reuse.jd b/docs/html/resources/articles/layout-tricks-reuse.jd
deleted file mode 100644
index 179c1d8..0000000
--- a/docs/html/resources/articles/layout-tricks-reuse.jd
+++ /dev/null
@@ -1,81 +0,0 @@
-page.title=Layout Tricks: Creating Reusable UI Components
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>The Android platform offers a wide variety of UI <em>widgets</em>, small
-visual construction blocks that you can glue together to present users with
-complex and useful interfaces. However applications often need higher-level
-visual <em>components</em>. To meet that need, and to do so efficiently, you can
-combine multiple standard widgets into a single, reusable component. </p>
-
-<p>For example, you could create a reusable component that contains a progress
-bar and a cancel button, a panel containing two buttons (positive and negative
-actions), a panel with an icon, a title and a description, and so on. You can
-create UI components easily by writing a custom <code>View</code>, but you can
-do it even more easily using only XML.</p>
-
-<p>In Android XML layout files, each tag is mapped to an actual class instance
-(the class is always a subclass of {@link android.view.View} The UI toolkit lets
-you also use three special tags that are not mapped to a <code>View</code>
-instance: <code><requestFocus /></code>, <code><merge /></code> and
-<code><include /></code>. This article shows how to use <code><include
-/></code> to create pure XML visual components. For information about how to
-use <code><merge /></code>, which can be particularly powerful when
-combined with <code><include /></code>see the <a
-href="{@docRoot}resources/articles/layout-tricks-merge.html">Merging Layouts</a>
-article. </p>
-
-<p>The <code><include /></code> element does exactly what its name
-suggests; it includes another XML layout. Using this tag is straightforward as
-shown in the following example, taken straight from <a
-href="http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=
-tree;h=refs/heads/master;hb=master">the source code of the Home application</a>
-that ships with Android:</p>
-
-<pre class="prettyprint"><com.android.launcher.Workspace
- android:id="@+id/workspace"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
-
- launcher:defaultScreen="1">
-
- <include android:id="@+id/cell1" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell2" layout="@layout/workspace_screen" />
- <include android:id="@+id/cell3" layout="@layout/workspace_screen" />
-
-</com.android.launcher.Workspace></pre>
-
-<p>In the <code><include /></code> only the <code>layout</code> attribute
-is required. This attribute, without the <code>android</code> namespace prefix,
-is a reference to the layout file you wish to include. In this example, the same
-layout is included three times in a row. This tag also lets you override a few
-attributes of the included layout. The above example shows that you can use
-<code>android:id</code> to specify the id of the root view of the included
-layout; it will also override the id of the included layout if one is defined.
-Similarly, you can override all the layout parameters. This means that any
-<code>android:layout_*</code> attribute can be used with the <code><include
-/></code> tag. Here is an example in
-which the same layout is included twice, but only the first one overrides the layout properties:</p>
-
-<pre>
-<!-- override the layout height and width -->
-<include layout="@layout/image_holder"
- android:layout_height="fill_parent"
- android:layout_width="fill_parent" />
-<!-- do not override layout dimensions; inherit them from image_holder -->
-<include layout="@layout/image_holder" />
-</pre>
-
-<p class="caution"><strong>Caution:</strong> If you want to override the layout dimensions,
-you must override both <code>android:layout_height</code> and
-<code>android:layout_width</code>—you cannot override only the height or only the width.
-If you override only one, it will not take effect. (Other layout properties, such as weight,
-are still inherited from the source layout.)</p>
-
-<p>This tag is particularly useful when you need to customize only part of your
-UI depending on the device's configuration. For instance, the main layout of
-your activity can be placed in the <code>layout/</code> directory and can
-include another layout which exists in two flavors, in <code>layout-land/</code>
-and <code>layout-port/</code>. This allows you to share most of the UI in
-portrait and landscape.</p>
\ No newline at end of file
diff --git a/docs/html/resources/articles/layout-tricks-stubs.jd b/docs/html/resources/articles/layout-tricks-stubs.jd
deleted file mode 100644
index 64f07f9..0000000
--- a/docs/html/resources/articles/layout-tricks-stubs.jd
+++ /dev/null
@@ -1,86 +0,0 @@
-page.title=Layout Tricks: Using ViewStubs
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>Sharing and reusing UI components is very easy with Android, thanks to the <a
-href="layout-tricks-reuse.html"><include /></a> tag. Sometimes it's so
-easy to create complex UI constructs that your UI ends up with a large number of
-views, some of which are rarely used. Thankfully, Android offers a very special
-widget called {@link android.view.ViewStub}, which brings you all the benefits
-of the <code><include /></code> without polluting your user interface with
-rarely used views.</p>
-
-<p>A <code>ViewStub</code> is a dumb and lightweight view. It has no dimension,
-it does not draw anything and does not participate in the layout in any way.
-This means that a <code>ViewStub</code> is very cheap to inflate and very cheap
-to keep in a view hierarchy. A <code>ViewStub</code> can be best described as a
-<em>lazy include</em>. The layout referenced by a <code>ViewStub</code> is
-inflated and added to the user interface only when you decide so.</p>
-
-<p>The following screenshot comes from the <a
-href="http://code.google.com/p/shelves">Shelves</a> application. The main purpose of
-the activity shown in the screenshot is to present the user with a browsable
-list of books:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center;" src="images/viewstub1.png" alt="" id="BLOGGER_PHOTO_ID_5314039375336055346" border="0">
-
-<p>The same activity is also used when the user adds or imports new books.
-During such an operation, Shelves shows extra bits of user interface.
-The screenshot below shows the progress bar and cancel button that
-appear at the bottom of the screen during an import:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center;" src="images/viewstub2.png" alt="" id="BLOGGER_PHOTO_ID_5314039800002559378" border="0">
-
-<p>Because importing books is not a common operation, at least when compared to
-browsing the list of books, the import panel is originally represented
-by a <code>ViewStub</code>:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center;" src="images/viewstub3.png" alt="" id="BLOGGER_PHOTO_ID_5314040334008167378" border="0">
-
-<p>When the user initiates the import process, the <code>ViewStub</code> is
-inflated and replaced by the content of the layout file it references:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center;" src="images/viewstub4.png" alt="" id="BLOGGER_PHOTO_ID_5314040638747834450" border="0">
-
-<p>To use a <code>ViewStub</code>, all you need is to specify an
-<code>android:id</code> attribute, to later inflate the stub, and an
-<code>android:layout</code> attribute, to reference what layout file
-to include and inflate. A stub lets you use a third attribute,
-<code>android:inflatedId</code>, which can be used to override the
-<code>id</code> of the root of the included file. Finally, the layout
-parameters specified on the stub will be applied to the roof of the
-included layout. Here is an example:</p>
-
-<pre class="prettyprint"><ViewStub
- android:id="@+id/stub_import"
- android:inflatedId="@+id/panel_import"
-
- android:layout="@layout/progress_overlay"
-
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom" /></pre>
-
-<p>When you are ready to inflate the stub, simply invoke the
-{@link android.view.ViewStub#inflate()} method. You can also simply change the
-visibility of the stub to {@link android.view.View#VISIBLE} or
-{@link android.view.View#INVISIBLE} and the stub will inflate. Note however that the
-<code>inflate()</code> method has the benefit of returning the root
-<code>View</code> of the inflate layout:</p>
-
-<pre class="prettyprint">((ViewStub) findViewById(R.id.stub_import)).setVisibility(View.VISIBLE);
-// or
-View importPanel = ((ViewStub) findViewById(R.id.stub_import)).inflate();</pre>
-
-<p>It is very important to remember that after the stub is inflated, the stub is
-<em>removed</em> from the view hierarchy. As such, it is unnecessary to keep a
-long-lived reference, for instance in an class instance field, to a
-<code>ViewStub</code>.</p>
-
-<p>A <code>ViewStub</code> is a great compromise between ease of programming and
-efficiency. Instead of inflating views manually and adding them at runtime to
-your view hierarchy, simply use a <code>ViewStub</code>. It's cheap and easy.
-The only drawback of <code>ViewStub</code> is that it currently does
-<em>not</em> support the <a href="layout-tricks-merge.html"><merge />
-tag</a>.</p>
diff --git a/docs/html/resources/articles/listview-backgrounds.jd b/docs/html/resources/articles/listview-backgrounds.jd
deleted file mode 100644
index c4037ba..0000000
--- a/docs/html/resources/articles/listview-backgrounds.jd
+++ /dev/null
@@ -1,88 +0,0 @@
-page.title=ListView Backgrounds: An Optimization
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>{@link android.widget.ListView} is one of Android's most widely used widgets.
-It is rather easy to use, very flexible, and incredibly powerful.
-<code>ListView</code> can also be difficult to understand at times.</p>
-
-<p>One of the most common issues with <code>ListView</code> happens when you try
-to use a custom background. By default, like many Android widgets,
-<code>ListView</code> has a transparent background which means that you can see
-through the default window's background, a very dark gray
-(<code>#FF191919</code> with the current <code>dark</code> theme.) Additionally,
-<code>ListView</code> enables the <em>fading edges</em> by default, as you can
-see at the top of the following screenshot — the first text item gradually
-fades to black. This technique is used throughout the system to indicate that
-the container can be scrolled.</p>
-
-<div style="text-align: center;"><img src="images/list_fade_1.png" alt="Android's default ListView"></div>
-
-<p>The fade effect is implemented using a combination of
-{@link android.graphics.Canvas#saveLayerAlpha(float, float, float, float, int, int) Canvas.saveLayerAlpha()}
-and the {@link android.graphics.PorterDuff.Mode#DST_OUT Porter-Duff Destination Out blending mode}. </p>
-
-<p>Unfortunately, things start to get ugly when you try to use a custom
-background on the <code>ListView</code> or when you change the window's
-background. The following two screenshots show what happens in an application
-when you change the window's background. The left image shows what the list
-looks like by default and the right image shows what the list looks like during
-a scroll initiated with a touch gesture:</p>
-
-<div style="text-align: center;">
-<img style="margin-right: 12px;" src="images/list_fade_2.png" alt="Dark fade">
-<img src="images/list_fade_3.png" alt="Dark list"></div>
-
-<p>This rendering issue is caused by an optimization of the Android framework
-enabled by default on all instances of <code>ListView</code>. I mentioned
-earlier that the fade effect is implemented using a Porter-Duff blending mode.
-This implementation works really well but is unfortunately very costly and can
-bring down drawing performance by quite a bit as it requires to capture a
-portion of the rendering in an offscreen bitmap and then requires extra blending
-(which implies readbacks from memory.)</p>
-
-<p>Since <code>ListView</code> is most of the time displayed on a solid
-background, there is no reason to go down that expensive route. That's why we
-introduced an optimization called the "cache color hint." The cache color hint
-is an RGB color set by default to the window's background color, that is #191919
-in Android's dark theme. When this hint is set, <code>ListView</code> (actually,
-its base class <code>View</code>) knows it will draw on a solid background and
-therefore replaces th expensive <code>saveLayerAlpha()/Porter-Duff</code>
-rendering with a simple gradient. This gradient goes from fully transparent to
-the cache color hint value and this is exactly what you see on the image above,
-with the dark gradient at the bottom of the list. However, this still does not
-explain why the entire list turns black during a scroll.</p>
-
-<p>As mentioned before, <code>ListView</code> has a transparent/translucent
-background by default, and so all default widgets in the Android UI toolkit.
-This implies that when <code>ListView</code> redraws its children, it has to
-blend the children with the window's background. Once again, this requires
-costly readbacks from memory that are particularly painful during a scroll or a
-fling when drawing happens dozen of times per second. </p>
-
-<p>To improve drawing performance during scrolling operations, the Android
-framework reuses the cache color hint. When this hint is set, the framework
-copies each child of the list in a <code>Bitmap</code> filled with the hint
-value (assuming that another optimization, called <em>scrolling cache</em>, is
-not turned off). <code>ListView</code> then blits these bitmaps directly on
-screen and because these bitmaps are known to be opaque, no blending is
-required. Also, since the default cache color hint is <code>#191919</code>, you
-get a dark background behind each item during a scroll.</p>
-
-<p>To fix this issue, all you have to do is either disable the cache color hint
-optimization, if you use a non-solid color background, or set the hint to the
-appropriate solid color value. You can do this from code (see
-{@link android.widget.AbsListView#setCacheColorHint(int)}) or preferably from
-XML, by using the <code>android:cacheColorHint</code> attribute. To disable the
-optimization, simply use the transparent color <code>#00000000</code>. The
-following screenshot shows a list with
-<code>android:cacheColorHint="#00000000"</code> set in the XML layout file:</p>
-
-<div style="text-align: center;"><img src="images/list_fade_4.png" alt="Fade on a custom background"></div>
-
-<p>As you can see, the fade works perfectly against the custom wooden
-background. The cache color hint feature is interesting because it
-shows how optimizations can make your life more difficult in
-some situations. In this particular case, however, the benefit of the
-default behavior outweighs the added complexity..</p>
diff --git a/docs/html/resources/articles/live-folders.jd b/docs/html/resources/articles/live-folders.jd
deleted file mode 100644
index aeab997..0000000
--- a/docs/html/resources/articles/live-folders.jd
+++ /dev/null
@@ -1,170 +0,0 @@
-page.title=Live Folders
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>Live folders, introduced in Android 1.5 (API Level 3), let you display any source of data
-on the Home screen without forcing the user to launch an application. A live
-folder is simply a real-time view of a {@link android.content.ContentProvider}.
-As such, a live folder can be used to display all of the user's contacts or
-bookmarks, email, playlists, an RSS feed, and so on. The possibilities are
-endless! </p>
-
-<p>The platform includes several standard folders for displaying contacts. For
-instance, the screenshot below shows the content of the live folders that
-displays all contacts with a phone number:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 267px; height: 400px;" src="images/contacts.png" alt="" id="BLOGGER_PHOTO_ID_5323287788220889218" border="0">
-
-<p>If a contacts sync happens in the background while the user is browsing this live
-folder, the user will see the change happen in real-time. Live folders are not
-only useful, but they are also easy to add to to your application and data.
-
-This articles shows how to add a live folder to an example application called
-Shelves. To better understand how live folders work, you can <a
-href="http://code.google.com/p/shelves">download the source code of the
-application</a> and modify it by following the instructions below.</p>
-
-<p>To give the user the option to create a new live folder for an application,
-you first need to create a new activity with an intent filter whose action is
-<code>android.intent.action.CREATE_LIVE_FOLDER</code>. To do so, simply open
-<code>AndroidManifest.xml</code> and add something similar to this:</p>
-
-<pre><activity
- android:name=".activity.BookShelfLiveFolder"
- android:label="BookShelf">
- <intent-filter>
- <action android:name="android.intent.action.CREATE_LIVE_FOLDER" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
-</activity></pre>
-
-<p>The label and icon of this activity are what the user will see on the Home
-screen when choosing a live folder to create:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 267px; height: 400px;" src="images/device_002.png" alt="" id="BLOGGER_PHOTO_ID_5323289217773103922" border="0">
-
-<p>Since you just need an intent filter, it is possible, and sometimes advised,
-to reuse an existing activity. In the case of Shelves, we will create a new
-activity, <code>org.curiouscreature.android.shelves.activity.BookShelfLiveFolder</code>.
-The role of this activity is to send an <code>Intent</code> result to Home
-containing the description of the live folder: its name, icon, display mode and
-content URI. The content URI is very important as it describes what
-<code>ContentProvider</code> will be used to populate the live folder. The code
-of the activity is very simple as you can see here:</p>
-
-<pre>public class BookShelfLiveFolder extends Activity {
- public static final Uri CONTENT_URI = Uri.parse("content://shelves/live_folders/books");
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- final Intent intent = getIntent();
- final String action = intent.getAction();
-
- if (LiveFolders.ACTION_CREATE_LIVE_FOLDER.equals(action)) {
- setResult(RESULT_OK, createLiveFolder(this, CONTENT_URI,
- "Books", R.drawable.ic_live_folder));
- } else {
- setResult(RESULT_CANCELED);
- }
-
- finish();
- }
-
- private static Intent createLiveFolder(Context context, Uri uri, String name, int icon) {
- final Intent intent = new Intent();
-
- intent.setData(uri);
- intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_NAME, name);
- intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON,
- Intent.ShortcutIconResource.fromContext(context, icon));
- intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_DISPLAY_MODE, LiveFolders.DISPLAY_MODE_LIST);
-
- return intent;
- }
-}</pre>
-
-<p>This activity, when invoked with the<code>ACTION_CREATE_LIVE_FOLDER</code>
-intent, returns an intent with a URI,
-<code>content://shelves/live_folders/books</code>, and three extras to describe
-the live folder. There are other extras and constants you can use and you should
-refer to the documentation of <code>android.provider.LiveFolders</code> for more
-details. When Home receives this intent, a new live folder is created on the
-user's desktop, with the name and icon you provided. Then, when the user clicks
-on the live folder to open it, Home queries the content provider referenced by
-the provided URI.</p>
-
-<p>Live folders' content providers must obey specific naming rules. The
-<code>Cursor</code> returned by the <code>query()</code> method must have at
-least two columns named <code>LiveFolders._ID</code> and
-<code>LiveFolders.NAME</code>. The first one is the unique identifier of each
-item in the live folder and the second one is the name of the item. There are
-other column names you can use to specify an icon, a description, the intent to
-associate with the item (fired when the user clicks that item), etc. Again,
-refer to the documentation of <code>android.provider.LiveFolders</code> for more
-details.</p><p>In our example, all we need to do is modify the existing provider
-in Shelves called
-<code>org.curiouscreature.android.shelves.provider.BooksProvider</code>. First,
-we need to modify the <code>URI_MATCHER</code> to recognize our
-<code>content://shelves/live_folders/books</code> content URI:</p>
-
-<pre>private static final int LIVE_FOLDER_BOOKS = 4;
-// ...
-URI_MATCHER.addURI(AUTHORITY, "live_folders/books", LIVE_FOLDER_BOOKS);</pre>
-
-<p>Then we need to create a new projection map for the cursor. A projection map
-can be used to "rename" columns. In our case, we will replace
-<code>BooksStore.Book._ID</code>, <code>BooksStore.Book.TITLE</code> and
-<code>BooksStore.Book.AUTHORS</code> with <code>LiveFolders._ID</code>,
-<code>LiveFolders.TITLE</code> and <code>LiveFolders.DESCRIPTION</code>:</p>
-
-<pre>private static final HashMap<string, string=""> LIVE_FOLDER_PROJECTION_MAP;
-static {
- LIVE_FOLDER_PROJECTION_MAP = new HashMap<string, string="">();
- LIVE_FOLDER_PROJECTION_MAP.put(LiveFolders._ID, BooksStore.Book._ID +
- " AS " + LiveFolders._ID);
- LIVE_FOLDER_PROJECTION_MAP.put(LiveFolders.NAME, BooksStore.Book.TITLE +
- " AS " + LiveFolders.NAME);
- LIVE_FOLDER_PROJECTION_MAP.put(LiveFolders.DESCRIPTION, BooksStore.Book.AUTHORS +
- " AS " + LiveFolders.DESCRIPTION);
-}</pre>
-
-<p>Because we are providing a title and a description for each row, Home will
-automatically display each item of the live folder with two lines of text.
-Finally, we implement the <code>query()</code> method by supplying our
-projection map to the SQL query builder:</p>
-
-<pre>public Cursor query(Uri uri, String[] projection, String selection,
- String[] selectionArgs, String sortOrder) {
-
- SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
-
- switch (URI_MATCHER.match(uri)) {
- // ...
- case LIVE_FOLDER_BOOKS:
- qb.setTables("books");
- qb.setProjectionMap(LIVE_FOLDER_PROJECTION_MAP);
- break;
- default:
- throw new IllegalArgumentException("Unknown URI " + uri);
- }
-
- SQLiteDatabase db = mOpenHelper.getReadableDatabase();
- Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, BooksStore.Book.DEFAULT_SORT_ORDER);
- c.setNotificationUri(getContext().getContentResolver(), uri);
-
- return c;
-}</pre>
-
-<p>You can now compile and deploy the application, go to the Home screen and
-try to add a live folder. You can add a books live folder to your Home screen
-and when you open it, see the list of all of your books, with their
-titles and authors, and all it took was a few lines of code:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 267px; height: 400px;" src="images/device.png" alt="" id="BLOGGER_PHOTO_ID_5323293545495859234" border="0"></p>
-
-<p>The live folders API is extremely simple and relies only on intents and
-content URI. If you want to see more examples of live folders
-implementation, you can read the source code of the <a href="http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=tree;h=refs/heads/cupcake;hb=cupcake">Contacts application</a> and of the <a href="http://android.git.kernel.org/?p=platform/packages/providers/ContactsProvider.git;a=tree;h=refs/heads/cupcake;hb=cupcake">Contacts provider</a>.</p><p>You can also download the result of our exercise, the <a href="http://jext.free.fr/CupcakeShelves.zip">modified version of Shelves with live folders support</a>.</p>
\ No newline at end of file
diff --git a/docs/html/resources/articles/live-wallpapers.jd b/docs/html/resources/articles/live-wallpapers.jd
deleted file mode 100644
index 0692a62..0000000
--- a/docs/html/resources/articles/live-wallpapers.jd
+++ /dev/null
@@ -1,102 +0,0 @@
-page.title=Live Wallpapers
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}resources/samples/CubeLiveWallpaper/index.html">Live Wallpaper
-sample</a></li>
- </ol>
-
-</div>
-</div>
-
-<p>Starting with Android 2.1 (API Level 7), users can now enjoy <em>live
-wallpapers</em> — richer, animated, interactive backgrounds — on
-their home screens. A live wallpaper is very similar to a normal Android
-application and has access to all the facilities of the platform: SGL (2D
-drawing), OpenGL (3D drawing), GPS, accelerometers, network access, etc. The
-live wallpapers included on Nexus One demonstrate the use of some of these APIs
-to create fun and interesting user experiences. For instance, the Grass
-wallpaper uses the phone's location to compute sunrise and sunset times in order
-to display the appropriate sky.</p>
-
-<img src="images/live_wallpapers_small.png" style="align:center" />
-
-<p>Creating your own live wallpaper is easy, especially if you have had
-previous experience with {@link android.view.SurfaceView} or {@link
-android.graphics.Canvas}.
-To learn how to create a live wallpaper, you should check out the <a
-href="../samples/CubeLiveWallpaper/index.html">CubeLiveWallpaper sample code</a>.</p>
-
-<p>In terms of implementation, a live wallpaper is very similar to a {@link android.app.Service}.
-The only difference is the addition of a new method, {@link
-android.service.wallpaper.WallpaperService#onCreateEngine()}, whose goal is to create a {@link
-android.service.wallpaper.WallpaperService.Engine}. The engine is responsible for
-handling the lifecycle and drawing of a wallpaper. The system provides a surface
-on which you can draw, just like you would with a {@link android.view.SurfaceView}.
-Drawing a wallpaper can be very expensive so you should optimize your code
-as much as possible to avoid using too much CPU, not only for battery life
-but also to avoid slowing down the rest of the system. That is also why the
-most important part of the lifecycle of a wallpaper is when it becomes visible, as indicated
-by a call to {@link android.service.wallpaper.WallpaperService.Engine#onVisibilityChanged
-onVisibilityChanged()}.
-When invisible, such as when the user launches an application that covers
-the home screen, a wallpaper must stop all activity.</p>
-
-<p>The engine can also implement several methods to interact with the user
-or the home application. For instance, if you want your wallpaper to scroll
-along when the user swipes from one home screen to another, you can use
-{@link android.service.wallpaper.WallpaperService.Engine#onOffsetsChanged
-onOffsetsChanged()}.
-To react to touch events, simply implement {@link
-android.service.wallpaper.WallpaperService.Engine#onTouchEvent onTouchEvent()}.
-Finally, applications can send arbitrary commands to the live wallpaper.
-Currently, only the standard home application sends commands to the
-{@link android.service.wallpaper.WallpaperService.Engine#onCommand onCommand()}
-method of the live wallpaper:</p>
-
-<ul>
-<li><code>android.wallpaper.tap</code>: When the user taps an empty space
-on the workspace. This command is interpreted by the Nexus and Water live
-wallpapers to make the wallpaper react to user interaction. For instance,
-if you tap an empty space on the Water live wallpaper, new ripples appear
-under your finger.</li>
-<li><code>android.home.drop</code>: When the user drops an icon or a widget
-on the workspace. This command is also interpreted by the Nexus and Water
-live wallpapers.</li>
-</ul>
-
-<p>If you are developing a live wallpaper, remember that the feature is
-supported only on Android 2.1 (API level 7) and higher versions of the platform.
-To ensure that your application can only be installed on devices that support
-live wallpapers, remember to add the following to the application's manifest
-before publishing to Google Play:</p>
-
-<ul>
-<li><code><uses-sdk android:minSdkVersion="7" /></code>, which indicates
-to Google Play and the platform that your application requires Android 2.1 or
-higher. For more information, see the <a href="{@docRoot}guide/appendix/api-levels.html">API
-Levels</a> and the documentation for the
-<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
-element.</li>
-<li><code><uses-feature android:name="android.software.live_wallpaper" /></code>,
-which tells Google Play that your application includes a live wallpaper
-Google Play uses this feature as a filter, when presenting users lists of
-available applications. When you declaring this feature, Google Play
-displays your application only to users whose devices support live wallpapers,
-while hiding it from other devices on which it would not be able to run. For
-more information, see the documentation for the
-<a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
-<uses-feature></a>
-element.</li>
-</ul>
-
-<p>Many great live wallpapers are already available on Google Play and
-we can't wait to see more!</p>
diff --git a/docs/html/resources/articles/multitasking-android-way.jd b/docs/html/resources/articles/multitasking-android-way.jd
deleted file mode 100644
index 0dc8627..0000000
--- a/docs/html/resources/articles/multitasking-android-way.jd
+++ /dev/null
@@ -1,103 +0,0 @@
-page.title=Multitasking the Android Way
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a></li>
- <li><a href="{@docRoot}guide/topics/fundamentals/services.html">Services</a></li>
- </ol>
-
- <h2>Key classes</h2>
- <ol>
- <li>{@link android.app.Service}</li>
- <li>{@link android.content.BroadcastReceiver}</li>
- </ol>
-
-</div>
-</div>
-
-<p>Android is fairly unique in the ways it allows multiple applications to run at the same time. Developers coming from a different platform may find the way it operates surprising. Understanding its behavior is important for designing applications that will work well and integrate seamlessly with the rest of the Android platform. This article covers the reasons for Android's multitasking design, its impact on how applications work, and how you can best take advantage of Android's unique features.</p>
-<h3>Design considerations</h3>
-<p>Mobile devices have technical limitations and user experience requirements not present in desktop or web systems. Here are the four key constraints we were working under as we designed Android's multitasking:</p>
-<ul>
- <li>
- <p>We did not want to require that users close applications when "done" with them. Such a usage pattern does not work well in a mobile environment, where usage tends to involve repeated brief contact with a wide variety of applications throughout the day.</p>
- </li>
- <li>
- <p>Mobile devices don't have the luxury of swap space, so have fairly hard limits on memory use. Robert Love has <a href="http://blog.rlove.org/2010/04/why-ipad-and-iphone-dont-support.html">a very good article</a> covering the topic.</p>
- </li>
- <li>
- <p>Application switching on a mobile device is extremely critical; we target significantly less than 1 second to launch a new application. This is especially important when the user is switching between a few applications, such as switching to look at a new SMS message while watching a video, and then returning to that video. A noticeable wait in such situations will quickly make users hate you.</p>
- </li>
- <li>
- <p>The available APIs must be sufficient for writing the built-in Google applications, as part of our "all applications are created equal" philosophy. This means background music playback, data syncing, GPS navigation, and application downloading must be implemented with the same APIs that are available to third party developers.</p>
- </li>
-</ul>
-<p>The first two requirements highlight an interesting conflict. We don't want users to worry about closing their apps, but rather make it appear that all of the applications are always running. At the same time, mobile devices have hard limits on memory use, so that a system will degrade or even start failing very quickly as it needs more RAM than is available; a desktop computer, with swap, in contrast will simply start slowing down as it needs to page RAM to its swap space. These competing constraints were a key motivation for Android's design.</p>
-<h3>When does an application "stop"?</h3>
-<p>A common misunderstanding about Android multitasking is the difference between a process and an application. In Android these are not tightly coupled entities: applications may seem present to the user without an actual process currently running the app; multiple applications may share processes, or one application may make use of multiple processes depending on its needs; the process(es) of an application may be kept around by Android even when that application is not actively doing something.</p>
-<p>The fact that you can see an application's process "running" does not mean the application is running or doing anything. It may simply be there because Android needed it at some point, and has decided that it would be best to keep it around in case it needs it again. Likewise, you may leave an application for a little bit and return to it from where you left off, and during that time Android may have needed to get rid of the process for other things.</p>
-<p>A key to how Android handles applications in this way is that processes don't shut down cleanly. When the user leaves an application, its process is kept around in the background, allowing it to continue working (for example downloading web pages) if needed, and come immediately to the foreground if the user returns to it. If a device never runs out of memory, then Android will keep all of these processes around, truly leaving all applications "running" all of the time.</p>
-<p>Of course, there is a limited amount of memory, and to accommodate this Android must decide when to get rid of processes that are not needed. This leads to Android's <a href="{@docRoot}guide/topics/fundamentals.html#proclife">process lifecycle</a>, the rules it uses to decide how important each process is and thus the next one that should be dropped. These rules are based on both how important a process is for the user's current experience, as well as how long it has been since the process was last needed by the user.</p>
-<p>Once Android determines that it needs to remove a process, it does this brutally, simply force-killing it. The kernel can then immediately reclaim all resources needed by the process, without relying on that application being well written and responsive to a polite request to exit. Allowing the kernel to immediately reclaim application resources makes it a lot easier to avoid serious out of memory situations.</p>
-<p>If a user later returns to an application that's been killed, Android needs a way to re-launch it in the same state as it was last seen, to preserve the "all applications are running all of the time" experience. This is done by keeping track of the parts of the application the user is aware of (the Activities), and re-starting them with information about the last state they were seen in. This last state is generated each time the user leaves that part of the application, not when it is killed, so that the kernel can later freely kill it without depending on the application to respond correctly at that point.</p>
-<p>In some ways, Android's process management can be seen as a form of swap space: application processes represent a certain amount of in-use memory; when memory is low, some processes can be killed (swapped out); when those processes are needed again, they can be re-started from their last saved state (swapped in).</p>
-<h3>Explicitly running in the background</h3>
-<p>So far, we have a way for applications to implicitly do work in the background, as long as the process doesn't get killed by Android as part of its regular memory management. This is fine for things like loading web pages in the background, but what about features with harder requirements? Background music playback, data synchronization, location tracking, alarm clocks, etc.</p>
-<p/>
-<p>For these tasks, the application needs a way to tell Android "I would explicitly like to run at this point." There are two main facilities available to applications for this, represented by two kinds of components they can publish in their manifest: <span style="font-style:italic;">broadcast receivers</span> and <span style="font-style:italic;">services</span>.</p>
-<h4>Broadcast Receivers</h4>
-<p>A BroadcastReceiver allows an application to run, for a brief amount of time, in the background as a result of something else happening. It can be used in many ways to build higher-level facilities: for example the AlarmManager allows an application to have a broadcast sent at a certain time in the future, and the LocationManager can send a broadcast when it detects interesting changes in location. Because information about the receiver is part of an application's manifest, Android can find and launch the application even if it isn't running; of course if it already has its process available in the background, the broadcast can very efficiently be directly dispatched to it.</p>
-<p>When handling a broadcast, the application is given a fixed set of time (currently 10 seconds) in which to do its work. If it doesn't complete in that time, the application is considered to be misbehaving, and its process immediately tossed into the background state to be killed for memory if needed.</p>
-<p>Broadcast receivers are great for doing small pieces of work in response to an external stimulus, such as posting a notification to the user after being sent a new GPS location report. They are very lightweight, since the application's process only needs to be around while actively receiving the broadcast. Because they are active for a deterministic amount of time, fairly strong guarantees can be made about not killing their process while running. However they are not appropriate for anything of indeterminate length, such as networking.</p>
-<h4>Services</h4>
-<p>A Service allows an application to implement longer-running background operations. There are actually a lot of other functions that services provide, but for the discussion here their fundamental purpose is for an application to say "hey I would like to continue running even while in the background, until I say I am done." An application controls when its service runs by explicitly starting and stopping the service.</p>
-<p>While services do provide a rich client-server model, its use is optional. Upon starting an application's services, Android simply instantiates the component in the application's process to provide its context. How it is used after that is up to the application: it can put all of the needed code inside of the service itself without interacting with other parts of the application, make calls on other singleton objects shared with other parts of the app, directly retrieve the Service instance from elsewhere if needed, or run it in another process and do a full-blown RPC protocol if that is desired.</p>
-<p>Process management for services is different than broadcast receivers, because an unbounded number of services can ask to be running for an unknown amount of time. There may not be enough RAM to have all of the requesting services run, so as a result no strong guarantees are made about being able to keep them running.</p>
-<p>If there is too little RAM, processes hosting services will be immediately killed like background processes are. However, if appropriate, Android will remember that these services wish to remain running, and restart their process at a later time when more RAM is available. For example, if the user goes to a web page that requires large amounts of RAM, Android may kill background service processes like sync until the browser's memory needs go down.</p>
-<p>Services can further negotiate this behavior by requesting they be considered "foreground." This places the service in a "please don't kill" state, but requires that it include a notification to the user about it actively running. This is useful for services such as background music playback or car navigation, which the user is actively aware of; when you're playing music and using the browser, you can always see the music-playing glyph in the status bar. Android won't try to kill these services, but as a trade-off, ensures the user knows about them and is able to explicitly stop them when desired.</p>
-<h3>The value of generic components</h3>
-<p>Android's generic broadcast receiver and service components allow developers to create a wide variety of efficient background operations, including things that were never originally considered. In Android 1.0 they were used to implement nearly all of the background behavior that the built-in and proprietary Google apps provided:</p>
-<ul>
- <li>
- Music playback runs in a service to allow it to continue operating after the user leaves the music application.
- </li>
- <li>
- The alarm clock schedules a broadcast receiver with the alarm manager, to go off at the next set alarm time.
- </li>
- <li>
- The calendar application likewise schedules an alarm to display or update its notification at the appropriate time for the next calendar event.
- </li>
- <li>
- Background file download is implemented a service that runs when there are any downloads to process.
- </li>
- <li>
- The e-mail application schedules an alarm to wake up a service at regular intervals that looks for and retrieves any new mail.
- </li>
- <li>
- The Google applications maintain a service to receive push notifications from the network; it in turn sends broadcasts to individual apps when it is told that they need to do things like synchronize contacts.</p>
- </li>
-</ul>
-<p>As the platform has evolved, these same basic components have been used to implement many of the major new developer features:
-<ul>
- <li>
- Input methods are implemented by developers as a Service component that Android manages and works with to display as the current IME.
- </li>
- <li>
- Application widgets are broadcast receivers that Android sends broadcasts to when it needs to interact with them. This allows app widgets to be quite lightweight, by not needing their application's process remain running.
- </li>
- <li>
- Accessibility features are implemented as services that Android keeps running while in use and sends appropriate information to about user interactions.
- </li>
- <li>
- Sync adapters introduced in Android 2.0 are services that are run in the background when a particular data sync needs to be performed.
- </li>
- <li>
- Live wallpapers are a service started by Android when selected by the user.
- </li>
-</ul>
diff --git a/docs/html/resources/articles/on-screen-inputs.jd b/docs/html/resources/articles/on-screen-inputs.jd
deleted file mode 100644
index 6a028c8..0000000
--- a/docs/html/resources/articles/on-screen-inputs.jd
+++ /dev/null
@@ -1,265 +0,0 @@
-page.title=Onscreen Input Methods
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}resources/articles/creating-input-method.html">Creating an Input
-Method</a></li>
- <li><a href="{@docRoot}resources/samples/SoftKeyboard/index.html">Soft Keyboard sample</a></li>
- </ol>
-
-</div>
-</div>
-
-
-<p>Starting from Android 1.5, the Android platform offers an Input Method
-Framework (IMF) that lets you create on-screen input methods such as software
-keyboards. This article provide an overview of what Android input method editors
-(IMEs) are and what an application needs to do to work well with them. The IMF
-is designed to support new classes of Android devices, such as those without
-hardware keyboards, so it is important that your application works well with the
-IMF and offers a great experience for users.</p>
-
-<h3>What is an input method?</h3>
-
-<p>The Android IMF is designed to support a variety of IMEs, including soft
-keyboard, hand-writing recognizers, and hard keyboard translators. Our focus,
-however, will be on soft keyboards, since this is the kind of input method that
-is currently part of the platform.</p>
-
-<p>A user will usually access the current IME by tapping on a text view to
-edit, as shown here in the home screen:</p>
-
-<img style="width: 320px; height: 480px; margin-right: 10px;" src="images/on-screen-inputs_004.png">
-<img style="width: 320px; height: 480px;" src="images/on-screen-inputs.png">
-
-<p>The soft keyboard is positioned at the bottom of the screen over the
-application's window. To organize the available space between the application
-and IME, we use a few approaches; the one shown here is called <em>pan and
-scan</em>, and simply involves scrolling the application window around so that
-the currently focused view is visible. This is the default mode, since it is the
-safest for existing applications.</p>
-
-<p>Most often the preferred screen layout is a <em>resize</em>, where the
-application's window is resized to be entirely visible. An example is shown
-here, when composing an e-mail message:</p>
-
-<img style="width: 320px; height: 480px; margin-right: 10px;" src="images/on-screen-inputs_005.png">
-<img style="width: 320px; height: 480px;" src="images/on-screen-inputs_003.png">
-
-<p>The size of the application window is changed so that none of it is hidden by
-the IME, allowing full access to both the application and IME. This of course
-only works for applications that have a resizeable area that can be reduced to
-make enough space, but the vertical space in this mode is actually no less than
-what is available in landscape orientation, so very often an application can
-already accommodate it.</p>
-
-<p>The final major mode is <em>fullscreen</em> or <em>extract</em>
-mode. This is used when the IME is too large to reasonably share space
-with the underlying application. With the standard IMEs, you will only
-encounter this situation when the screen is in a landscape orientation,
-although other IMEs are free to use it whenever they desire. In this
-case the application window is left as-is, and the IME simply displays
-fullscreen on top of it, as shown here:</p>
-
-<img style="width: 480px; height: 320px; margin-right: 10px; margin-bottom: 10px;" src="images/on-screen-inputs_006.png">
-<img style="width: 480px; height: 320px;" src="images/on-screen-inputs_002.png">
-
-<p>Because the IME is covering the application, it has its own editing area,
-which shows the text actually contained in the application. There are also some
-limited opportunities the application has to customize parts of the IME (the
-"done" button at the top and enter key label at the bottom) to improve the user
-experience.</p>
-
-<h3>Basic XML attributes for controlling IMEs</h3>
-
-<p>There are a number of things the system does to try to help existing
-applications work with IMEs as well as possible, such as:</p>
-
-<ul>
-<li>Use pan and scan mode by default, unless it can reasonably guess that
-resize mode will work by the existence of lists, scroll views, etc.</li>
-<li>Analyze the various existing TextView attributes to guess at the kind of
-content (numbers, plain text, etc) to help the soft keyboard display an
-appropriate key layout.</li>
-<li>Assign a few default actions to the fullscreen IME, such as "next field"
-and "done".</li>
-</ul>
-
-<p>There are also some simple things you can do in your application that will
-often greatly improve its user experience. Except where explicitly mentioned,
-these will work in any Android platform version, even those previous to Android
-1.5 (since they will simply ignore these new options).</p>
-
-<h4>Specifying each EditText control's input type</h4>
-
-<p>The most important thing for an application to do is to use the new
-<code>android:inputType</code>
-attribute on each <code>EditText</code>. The attribute provides much richer
-information
-about the text content. This attribute actually replaces many existing
-attributes (<code>android:</code><code>password</code>,
-<code>android:</code><code>singleLine</code>,
-<code>android:</code><code>numeric</code>,
-<code>android:</code><code>phoneNumber</code>,
-<code>android:</code><code>capitalize</code>,
-<code>android:</code><code>autoText</code>, and
-<code>android:</code><code>editable</code>). If you specify the older attributes
-and the new <code>android:inputType</code> attribute, the system uses
-<code>android:inputType</code> and ignores the others. </p>
-
-<p>The <code>android:inputType</code> attribute has three pieces:</p>
-
-<ul>
-<li>The <em>class</em> is the overall interpretation of characters. The
-currently supported classes are <code>text</code> (plain text),
-<code>number</code> (decimal number), <code>phone</code> (phone number), and
-<code>datetime</code> (a date or time).</li>
-<li>The <em>variation</em> is a further refinement on the class. In the
-attribute you will normally specify the class and variant together, with the
-class as a prefix. For example, <code>textEmailAddress</code> is a text field
-where the user will enter something that is an e-mail address (foo@bar.com) so
-the key layout will have an '@' character in easy access, and
-<code>numberSigned</code> is a numeric field with a sign. If only the class is
-specified, then you get the default/generic variant.</li>
-<li>Additional <em>flags</em> can be specified that supply further refinement.
-These flags are specific to a class. For example, some flags for the
-<code>text</code> class are <code>textCapSentences</code>,
-<code>textAutoCorrect</code>, and <code>textMultiline</code>.</li>
-</ul>
-
-<p>As an example, here is the new EditText for the IM application's message text view:</p>
-
-<pre> <EditText android:id="@+id/edtInput"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
- android:imeOptions="actionSend|flagNoEnterAction"
- android:maxLines="4"
- android:maxLength="2000"
- android:hint="@string/compose_hint"/></pre>
-
-<p>A full description of all of the input types can be found in the
-documentation. It is important to make use of the correct input types that are
-available, so that the soft keyboard can use the optimal keyboard layout for the
-text the user will be entering.</p>
-
-<h4>Enabling resize mode and other window features</h4>
-
-<p>The second most important thing for your app to do is to specify the overall
-behavior of your window in relation to the input method. The most visible aspect
-of this is controlling resize vs. pan and scan mode, but there are other things
-you can do as well to improve your user experience.</p>
-
-<p>You will usually control this behavior through the
-<code>android:windowSoftInputMode</code> attribute on each
-<code><activity></code> definition in your
-<code>AndroidManifest.xml</code>. Like the input type, there are a couple
-different pieces of data that can be specified here by combining them
-together:</p>
-
-<ul>
-<li>The window adjustment mode is specified with either
-<code>adjustResize</code> or <code>adjustPan</code>. It is highly recommended
-that you always specify one or the other.</li>
-<li>You can further control whether the IME will be shown automatically when
-your activity is displayed and other situations where the user moves to it. The
-system won't automatically show an IME by default, but in some cases it can be
-convenient for the user if an application enables this behavior. You can request
-this with <code>stateVisible</code>. There are also a number of other state
-options for finer-grained control that you can find in the documentation.</li>
-</ul>
-
-<p>A typical example of this field can be see in the edit contact activity,
-which ensures it is resized and automatically displays the IME for the user:</p>
-
-<pre> <activity name="EditContactActivity"
- android:windowSoftInputMode="stateVisible|adjustResize">
- ...
- </activity></pre>
-
-<p class="note"><strong>Note:</strong>Starting from Android 1.5 (API Level 3),
-the platform offers a new method,
-{@link android.view.Window#setSoftInputMode(int mode)},
-that non-Activity windows can use to control their behavior. Calling this method
-in your will make your application incompatible with previous versions of the
-Android platform.</p>
-
-<h4>Controlling the action buttons</h4>
-
-<p>The final customization we will look at is the "action" buttons in the IME.
-There are currently two types of actions:</p>
-
-<ul>
-<li>The enter key on a soft keyboard is typically bound to an action when not
-operating on a mult-line edit text. For example, on the G1 pressing the hard
-enter key will typically move to the next field or the application will
-intercept it to execute an action; with a soft keyboard, this overloading of the
-enter key remains, since the enter button just sends an enter key event.</li>
-<li>When in fullscreen mode, an IME may also put an additional action button to
-the right of the text being edited, giving the user quick access to a common
-application operation.</li>
-</ul>
-
-<p>These options are controlled with the <code>android:imeOptions</code>
-attribute on <code>TextView</code>. The value you supply here can be any
-combination of:</p>
-
-<ul>
-<li>One of the pre-defined action constants (<code>actionGo</code>,
-<code>actionSearch</code>, <code>actionSend</code>, <code>actionNext</code>,
-<code>actionDone</code>). If none of these are specified, the system will infer
-either <code>actionNext</code> or <code>actionDone</code> depending on whether
-there is a focusable field after this one; you can explicitly force no action
-with <code>actionNone</code>.</li>
-<li>The <code>flagNoEnterAction</code> option tells the IME that the action
-should <em>not</em> be available on the enter key, even if the text itself is
-not multi-line. This avoids having unrecoverable actions like (send) that can be
-accidentally touched by the user while typing.</li>
-<li>The <code>flagNoAccessoryAction</code> removes the action button from the
-text area, leaving more room for text.</li><li>The <code>flagNoExtractUi</code>
-completely removes the text area, allowing the application to be seen behind
-it.</li>
-</ul>
-
-<p>The previous IM application message view also provides an example of an
-interesting use of <code>imeOptions</code>, to specify the send action but not
-let it be shown on the enter key:</p>
-
-<pre>android:imeOptions="actionSend|flagNoEnterAction"</pre>
-
-<h3>APIs for controlling IMEs</h3>
-
-<p>For more advanced control over the IME, there are a variety of new APIs you
-can use. Unless special care is taken (such as by using reflection), using these
-APIs will cause your application to be incompatible with previous versions of
-Android, and you should make sure you specify
-<code>android:minSdkVersion="3"</code> in your manifest. For more information,
-see the documentation for the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a
-> manifest element.</p>
-
-<p>The primary API is the new <code>android.view.inputmethod.InputMethodManager</code> class, which you can retrieve with <code>Context.getSystemService()</code>.
-It allows you to interact with the global input method state, such as
-explicitly hiding or showing the current IME's input area.</p>
-
-<p>There are also new window flags controlling input method interaction, which you can control through the existing <code>Window.addFlags()</code> method and new <code>Window.setSoftInputMode()</code> method. The <code>PopupWindow</code>
-class has grown corresponding methods to control these options on its
-window. One thing in particular to be aware of is the new <code>WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM</code> constant, which is used to control whether a window is on top of or behind the current IME.</p>
-
-<p>Most of the interaction between an active IME and application is done through the <code>android.view.inputmethod.InputConnection</code>
-class. This is the API an application implement, which an IME calls to
-perform the appropriate edit operations on the application. You won't
-normally need to worry about this, since <code>TextView</code> provides its own implementation for itself.</p>
-
-<p>There are also a handful of new <code>View</code> APIs, the most important of these being<code> onCreateInputConnection()</code> which creates a new <code>InputConnection</code> for an IME (and fills in an <code>android.view.inputmethod.EditorInfo</code>
-structure with your input type, IME options, and other data); again,
-most developers won't need to worry about this, since TextView takes
-care of it for you.</p>
\ No newline at end of file
diff --git a/docs/html/resources/articles/painless-threading.jd b/docs/html/resources/articles/painless-threading.jd
deleted file mode 100644
index fea7ee2..0000000
--- a/docs/html/resources/articles/painless-threading.jd
+++ /dev/null
@@ -1,149 +0,0 @@
-page.title=Painless Threading
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>This article discusses the threading model used by Android applications and how applications can ensure best UI performance by spawning worker threads to handle long-running operations, rather than handling them in the main thread. The article also explains the API that your application can use to interact with Android UI toolkit components running on the main thread and spawn managed worker threads. </p>
-
-<h3>The UI thread</h3>
-
-<p>When an application is launched, the system creates a thread called
-"main" for the application. The main thread, also called the <em>UI
-thread</em>, is very important because it is in charge of dispatching the
-events to the appropriate widgets, including drawing events.
-It is also the thread where your application interacts with running
-components of the Android UI toolkit. </p>
-
-<p>For instance, if you touch the a button on screen, the UI thread dispatches
-the touch event to the widget, which in turn sets its pressed state and
-posts an invalidate request to the event queue. The UI thread dequeues
-the request and notifies the widget to redraw itself.</p>
-
-<p>This single-thread model can yield poor performance unless your application
-is implemented properly. Specifically, if everything is happening in a single
-thread, performing long operations such as network access or database
-queries on the UI thread will block the whole user interface. No event
-can be dispatched, including drawing events, while the long operation
-is underway. From the user's perspective, the application appears hung.
-Even worse, if the UI thread is blocked for more than a few seconds
-(about 5 seconds currently) the user is presented with the infamous "<a href="http://developer.android.com/guide/practices/design/responsiveness.html">application not responding</a>" (ANR) dialog.</p>
-
-<p>If you want to see how bad this can look, write a simple application
-with a button that invokes <code>Thread.sleep(2000)</code> in its
-<a href="http://developer.android.com/reference/android/view/View.OnClickListener.html">OnClickListener</a>.
-The button will remain in its pressed state for about 2 seconds before
-going back to its normal state. When this happens, it is very easy for
-the user to <em>perceive</em> the application as slow.</p>
-
-<p>To summarize, it's vital to the responsiveness of your application's UI to
-keep the UI thread unblocked. If you have long operations to perform, you should
-make sure to do them in extra threads (<em>background</em> or <em>worker</em>
-threads). </p>
-
-<p>Here's an example of a click listener downloading an image over the
-network and displaying it in an <a href="http://developer.android.com/reference/android/widget/ImageView.html">ImageView</a>:</p>
-
-<pre class="prettyprint">public void onClick(View v) {
- new Thread(new Runnable() {
- public void run() {
- Bitmap b = loadImageFromNetwork();
- mImageView.setImageBitmap(b);
- }
- }).start();
-}</pre>
-
-<p>At first, this code seems to be a good solution to your problem, as it does
-not block the UI thread. Unfortunately, it violates the single-threaded model
-for the UI: the Android UI toolkit is <em>not thread-safe</em> and must always
-be manipulated on the UI thread. In this piece of code above, the
-<code>ImageView</code> is manipulated on a worker thread, which can cause really
-weird problems. Tracking down and fixing such bugs can be difficult and
-time-consuming.</p>
-
-<p>Android offers several ways to access the UI
-thread from other threads. You may already be familiar with some of
-them but here is a comprehensive list:</p>
-
-<ul>
-<li>{@link android.app.Activity#runOnUiThread(java.lang.Runnable) Activity.runOnUiThread(Runnable)}</li>
-<li>{@link android.view.View#post(java.lang.Runnable) View.post(Runnable)}</li>
-<li>{@link android.view.View#postDelayed(java.lang.Runnable, long) View.postDelayed(Runnable, long)}</li>
-<li>{@link android.os.Handler}</li>
-</ul>
-
-<p>You can use any of these classes and methods to correct the previous code example:</p>
-
-<pre class="prettyprint">public void onClick(View v) {
- new Thread(new Runnable() {
- public void run() {
- final Bitmap b = loadImageFromNetwork();
- mImageView.post(new Runnable() {
- public void run() {
- mImageView.setImageBitmap(b);
- }
- });
- }
- }).start();
-}</pre>
-
-<p>Unfortunately,
-these classes and methods could also tend to make your code more complicated
-and more difficult to read. It becomes even worse when your implement
-complex operations that require frequent UI updates. </p>
-
-<p>To remedy this problem, Android 1.5 and later platforms offer a utility class
-called {@link android.os.AsyncTask}, that simplifies the creation of
-long-running tasks that need to communicate with the user interface.</p>
-
-<p>An <code>AsyncTask</code> equivalent is also available for applications that
-will run on Android 1.0 and 1.1. The name of the class is <a
-href="http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/
-curiouscreature/android/shelves/util/UserTask.java">UserTask</a>. It offers the
-exact same API and all you have to do is copy its source code in your
-application.</p>
-
-<p>The goal of <code>AsyncTask</code> is to take care of thread management for
-you. Our previous example can easily be rewritten with
-<code>AsyncTask</code>:</p>
-
-<pre class="prettyprint">public void onClick(View v) {
- new DownloadImageTask().execute("http://example.com/image.png");
-}
-
-private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
- protected Bitmap doInBackground(String... urls) {
- return loadImageFromNetwork(urls[0]);
- }
-
- protected void onPostExecute(Bitmap result) {
- mImageView.setImageBitmap(result);
- }
- }</pre>
-
-<p>As you can see, <code>AsyncTask</code> <em>must</em> be used by subclassing
-it. It is also very important to remember that an <code>AsyncTask</code>
-instance has to be created on the UI thread and can be executed only once. You
-can read the <a
-href="http://developer.android.com/reference/android/os/AsyncTask.html">
-AsyncTask documentation</a> for a full understanding on how to use this class,
-but here is a quick overview of how it works:</p>
-
-<ul>
-<li>You can specify the type, using generics, of the parameters, the progress values and the final value of the task</li>
-<li>The method <a href="http://developer.android.com/reference/android/os/AsyncTask.html#doInBackground%28Params...%29">doInBackground()</a> executes automatically on a worker thread</li>
-<li><a href="http://developer.android.com/reference/android/os/AsyncTask.html#onPreExecute%28%29">onPreExecute()</a>, <a href="http://developer.android.com/reference/android/os/AsyncTask.html#onPostExecute%28Result%29">onPostExecute()</a> and <a href="http://developer.android.com/reference/android/os/AsyncTask.html#onProgressUpdate%28Progress...%29">onProgressUpdate()</a> are all invoked on the UI thread</li>
-<li>The value returned by <a href="http://developer.android.com/reference/android/os/AsyncTask.html#doInBackground%28Params...%29">doInBackground()</a> is sent to <a href="http://developer.android.com/reference/android/os/AsyncTask.html#onPostExecute%28Result%29">onPostExecute()</a></li>
-<li>You can call <a href="http://developer.android.com/reference/android/os/AsyncTask.html#publishProgress%28Progress...%29">publishProgress()</a> at anytime in <a href="http://developer.android.com/reference/android/os/AsyncTask.html#doInBackground%28Params...%29">doInBackground()</a> to execute <a href="http://developer.android.com/reference/android/os/AsyncTask.html#onProgressUpdate%28Progress...%29">onProgressUpdate()</a> on the UI thread</li><li>You can cancel the task at any time, from any thread</li>
-</ul>
-
-<p>In addition to the official documentation, you can read several complex examples in the source code of Shelves (<a href="http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/curiouscreature/android/shelves/activity/ShelvesActivity.java">ShelvesActivity.java</a> and <a href="http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/curiouscreature/android/shelves/activity/AddBookActivity.java">AddBookActivity.java</a>) and Photostream (<a href="http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/LoginActivity.java">LoginActivity.java</a>, <a href="http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/PhotostreamActivity.java">PhotostreamActivity.java</a> and <a href="http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/ViewPhotoActivity.java">ViewPhotoActivity.java</a>). We highly recommend reading the source code of <a href="http://code.google.com/p/shelves/">Shelves</a> to see how to persist tasks across configuration changes and how to cancel them properly when the activity is destroyed.</p>
-
-<p>Regardless of whether or not you use <a href="http://developer.android.com/reference/android/os/AsyncTask.html">AsyncTask</a>,
-always remember these two rules about the single thread model: </p>
-
-<ol>
-<li>Do not block the UI thread, and
-<li>Make sure that you access the Android UI toolkit <em>only</em> on the UI thread.
-</ol>
-
-<p><code>AsyncTask</code> just makes it easier to do both of these things.</p>
diff --git a/docs/html/resources/articles/qsb.jd b/docs/html/resources/articles/qsb.jd
deleted file mode 100644
index 01fb115..0000000
--- a/docs/html/resources/articles/qsb.jd
+++ /dev/null
@@ -1,169 +0,0 @@
-page.title=Quick Search Box
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/topics/search/index.html">Search</a></li>
- <li><a href="{@docRoot}resources/samples/SearchableDictionary/index.html">Searchable Dictionary
-sample</a></li>
- </ol>
-
-</div>
-</div>
-
-<div class="figure" style="width:233px">
-<img src="images/qsb_002.png" alt="" height="350" />
-</div>
-
-<p>Starting with Android 1.6, the platform includes support for Quick Search
-Box (QSB), a powerful, system-wide search framework. Quick Search Box makes it
-possible for users to quickly and easily find what they're looking for, both on
-their devices and on the web. It suggests content on your device as you type,
-like apps, contacts, browser history, and music. It also offers results from the
-web search suggestions, local business listings, and other info from
-Google, such as stock quotes, weather, and flight status. All of this is
-available right from the home screen, by tapping on Quick Search Box.</p>
-
-<p>What
-we're most excited about with this new feature is the ability for you,
-the developers, to leverage the QSB framework to provide quicker and
-easier access to the content inside your apps. Your apps can provide
-search suggestions that will surface to users in QSB alongside other
-search results and suggestions. This makes it possible for users to
-access your application's content from outside your application—for
-example, from the home screen.</p>
-
-<p class="note"><strong>Note:</strong> The code fragments in this document are
-related to a sample app called <a
-href="{@docRoot}resources/samples/SearchableDictionary/index.html"
-title="Searchable Dictionary">Searchable Dictionary</a>. The app is
-available for Android 1.6 and later platforms.</p>
-
-<h3>The story before now: searching within your app</h3>
-
-<p>Platform releases versions previous to Android 1.6 already provided a mechanism
-that let you expose search and search suggestions in your app, as described in
-the docs for {@link android.app.SearchManager}. That mechanism has not changed
-and requires the following two things in your
-<code>AndroidManifest.xml</code>:</p>
-
-<p>1) In your <code><activity></code>, an intent filter, and a reference
-to a <code>searchable.xml</code> file (described below):</p>
-
-<pre class="prettyprint"><intent-filter>
- <action android:name="android.intent.action.SEARCH" />
- <category android:name="android.intent.category.DEFAULT" />
-</intent-filter>
-
-<meta-data android:name="android.app.searchable"
- android:resource="@xml/searchable" /></pre>
-
-<p>2) A content provider that can provide search suggestions according to the
-URIs and column formats specified by the
-<a href="{@docRoot}reference/android/app/SearchManager.html#Suggestions">Search Suggestions</a>
-section of the SearchManager docs:</p>
-
-<pre class="prettyprint"><!-- Provides search suggestions for words and their definitions. -->
-<provider android:name="DictionaryProvider"
- android:authorities="dictionary"
- android:syncable="false" /></pre>
-
-<p>In the <code>searchable.xml</code> file, you specify a few things about how
-you want the search system to present search for your app, including the
-authority of the content provider that provides suggestions for the user as they
-type. Here's an example of the <code>searchable.xml</code> of an Android app
-that provides search suggestions within its own activities:</p>
-
-<pre class="prettyprint"><searchable xmlns:android="http://schemas.android.com/apk/res/android"
- android:label="@string/search_label"
- android:searchSuggestAuthority="dictionary"
- android:searchSuggestIntentAction="android.intent.action.VIEW">
-</searchable></pre>
-
-<p>Note that the <code>android:searchSuggestAuthority</code> attribute refers to
-the authority of the content provider we declared in
-<code>AndroidManifest.xml</code>.</p>
-
-<p>For more details on this, see the
-<a href="{@docRoot}reference/android/app/SearchManager.html#SearchabilityMetadata">Searchability Metadata
-section</a> of the of the SearchManager docs.</p>
-
-<h3>Including your app in Quick Search Box</h3>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>Searchable Dictionary Sample App</h2>
-<p>Quick Search Box provides a really cool way to make it easier and faster for
-users to access your app's content. To help you get your app started with it,
-we've created a sample app that simply provides access to a small dictionary of
-words in QSB. The app is called Searchable Dictionary, and we encourage you to
-<a href="{@docRoot}resources/samples/SearchableDictionary/index.html">check it
-out</a>.</p>
-</div>
-</div>
-
-<p>In Android 1.6, we added a new attribute to the metadata for searchables:
-<code>android:includeInGlobalSearch</code>. By specifying this as
-<code>"true"</code> in your <code>searchable.xml</code>, you allow QSB to pick
-up your search suggestion content provider and include its suggestions along
-with the rest (if the user enables your suggestions from the system search
-settings).</p>
-
-<p>You should also specify a string value for
-<code>android:searchSettingsDescription</code>, which describes to users what
-sorts of suggestions your app provides in the system settings for search.</p>
-
-<pre class="prettyprint"><searchable xmlns:android="http://schemas.android.com/apk/res/android"
- android:label="@string/search_label"
- <span style="background: rgb(255, 255, 0) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">android:searchSettingsDescription="@string/settings_description"</span>
- <span style="background: rgb(255, 255, 0) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">android:includeInGlobalSearch="true"</span>
- android:searchSuggestAuthority="dictionary"
- android:searchSuggestIntentAction="android.intent.action.VIEW">
-</searchable></pre>
-
-<p>These new attributes are supported only in Android 1.6 and later.</p>
-
-<h3>What to expect</h3>
-
-<p>The
-first and most important thing to note is that when a user installs an
-app with a suggestion provider that participates in QSB, this new app
-will <em>not</em> be enabled for QSB by default. The user can choose
-to enable particular suggestion sources from the system settings for
-search (by going to "Search" > "Searchable items" in settings).</p>
-
-<p>You
-should consider how to handle this in your app. Perhaps show a notice
-that instructs the user to visit system settings and enable your app's
-suggestions.</p>
-
-<p>Once the user enables your searchable item, the
-app's suggestions will have a chance to show up in QSB, most likely
-under the "more results" section to begin with. As your app's
-suggestions are chosen more frequently, they can move up in the list.</p>
-
-<img src="images/qsb.png" style="width: 233px; height: 349.5px;">
-<img id="k0vw" src="images/qsb_003.png" style="width: 233px; height: 349.5px;">
-
-<h3>Shortcuts</h3>
-
-<p>One
-of our objectives with QSB is to make it faster for users to access the
-things they access most often. One way we've done this is by
-'shortcutting' some of the previously chosen search suggestions, so
-they will be shown immediately as the user starts typing, instead of
-waiting to query the content providers. Suggestions from your app may
-be chosen as shortcuts when the user clicks on them.</p>
-
-<p>For dynamic suggestions that may wish to change their content (or become invalid)
-in the future, you can provide a 'shortcut id'. This tells QSB to query
-your suggestion provider for up-to-date content for a suggestion after
-it has been displayed. For more details on how to manage shortcuts, see
-the Shortcuts section
-<a href="{@docRoot}reference/android/app/SearchManager.html#ExposingSearchSuggestionsToQuickSearchBox">within the SearchManager docs</a>.</p>
diff --git a/docs/html/resources/articles/service-api-changes-starting-with.jd b/docs/html/resources/articles/service-api-changes-starting-with.jd
deleted file mode 100644
index 7bafd81..0000000
--- a/docs/html/resources/articles/service-api-changes-starting-with.jd
+++ /dev/null
@@ -1,177 +0,0 @@
-page.title=Service API changes starting with Android 2.0
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/topics/fundamentals/services.html">Services</a></li>
- </ol>
-
- <h2>Key classes</h2>
- <ol>
- <li>{@link android.app.Service}</li>
- </ol>
-
-</div>
-</div>
-
-<p>Watching developers use the Android platform the last year has shown a number of trouble areas in the Service API as well as growing issues in the ways services operate. As a result, Android 2.0 introduced a number of changes and improvements in this area for both developers and users.</p>
-<p>The three main changes to be aware of are:</p>
-<ul>
- <li>Service.setForeground() is now deprecated and in 2.0 does nothing.</li>
- <li>There were many edge cases in the service lifecycle that made it very easy to accidentally leave a service running; new APIs in 2.0 make this much easier to deal with.</li>
- <li>Android 2.0 also introduces a new UI for end users to monitor and manage the running services on their device.</li>
-</ul>
-<h3>Background on services</h3>
-<p>Before going into the details of 2.0, it may be useful to go over a quick summary of services. The Service API in Android is one of the key mechanisms for applications to do work in the background. Due to the way Android is designed, once an application is no longer visible to the user it is generally considered expendable and a candidate to be killed by the system if it ever needs memory elsewhere. The main way applications get around this is by starting a Service component, which explicitly tells the system that they are doing some valuable work and would prefer that the system not kill their process if it doesn't truly need to.</p>
-<p>This is a very powerful facility but along with that power comes some responsibility: an actively running service is taking resources away from other things that can run (including inactive processes in the background that don't need to be initialized the next time the user visits them). It is thus important that developers take care when designing their services that they only run when truly needed and avoid any bugs where they may accidentally leave the service running for long durations.</p>
-<h3>Redesigning Service.setForeground()</h3>
-<p>During the final stabilization period of Android 1.6 we started to see more issues due to an increasing number of applications using the Service.setForeground() API when they shouldn't be. This is an API that we haven't advertised much because it should not be used by most applications and can be very hard on the system: it asks that the service's process be treated as in the foreground, essentially making it unkillable and thus more difficult for the system to recover from low memory situations.</p>
-<p>At that point in 1.6 it was too late to make any significant changes to the behavior here, but in 2.0 we have done so: Service.setForeground() now does nothing. The API was always intended to be something a service would do in conjunction with putting up an ongoing notification for the user; by saying you are in the foreground, the user should be "aware" that the service is running in some way and know how to stop it. Thus in place of the old API Andriod 2.0 introduces two new APIs that require a notification go along with being in the foreground:</p>
-<pre class="prettyprint">
-public final void startForeground(int id, Notification notification);
-public final void stopForeground(boolean removeNotification);
-</pre>
-<p>This also not coincidentally makes it much easier to manage the notification state along with the service, since the system can now guarantee that there is always a notification while the service is in the foreground, and that the notification goes away whenever the service does.</p>
-<p>Many developers will want to write a service that works on older platforms as well as 2.0 and later; this can be accomplished by using something like the following code to selectively call the new APIs when they are available.</p>
-<pre class="prettyprint">
-private static final Class[] mStartForegroundSignature = new Class[] {
- int.class, Notification.class};
-private static final Class[] mStopForegroundSignature = new Class[] {
- boolean.class};
-
-private NotificationManager mNM;
-private Method mStartForeground;
-private Method mStopForeground;
-private Object[] mStartForegroundArgs = new Object[2];
-private Object[] mStopForegroundArgs = new Object[1];
-
-@Override
-public void onCreate() {
- mNM = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
- try {
- mStartForeground = getClass().getMethod("startForeground",
- mStartForegroundSignature);
- mStopForeground = getClass().getMethod("stopForeground",
- mStopForegroundSignature);
- } catch (NoSuchMethodException e) {
- // Running on an older platform.
- mStartForeground = mStopForeground = null;
- }
-}
-
-/**
- * This is a wrapper around the new startForeground method, using the older
- * APIs if it is not available.
- */
-void startForegroundCompat(int id, Notification notification) {
- // If we have the new startForeground API, then use it.
- if (mStartForeground != null) {
- mStartForegroundArgs[0] = Integer.valueOf(id);
- mStartForegroundArgs[1] = notification;
- try {
- mStartForeground.invoke(this, mStartForegroundArgs);
- } catch (InvocationTargetException e) {
- // Should not happen.
- Log.w("MyApp", "Unable to invoke startForeground", e);
- } catch (IllegalAccessException e) {
- // Should not happen.
- Log.w("MyApp", "Unable to invoke startForeground", e);
- }
- return;
- }
-
- // Fall back on the old API.
- setForeground(true);
- mNM.notify(id, notification);
-}
-
-/**
- * This is a wrapper around the new stopForeground method, using the older
- * APIs if it is not available.
- */
-void stopForegroundCompat(int id) {
- // If we have the new stopForeground API, then use it.
- if (mStopForeground != null) {
- mStopForegroundArgs[0] = Boolean.TRUE;
- try {
- mStopForeground.invoke(this, mStopForegroundArgs);
- } catch (InvocationTargetException e) {
- // Should not happen.
- Log.w("MyApp", "Unable to invoke stopForeground", e);
- } catch (IllegalAccessException e) {
- // Should not happen.
- Log.w("MyApp", "Unable to invoke stopForeground", e);
- }
- return;
- }
-
- // Fall back on the old API. Note to cancel BEFORE changing the
- // foreground state, since we could be killed at that point.
- mNM.cancel(id);
- setForeground(false);
-}
-</pre>
-<h3>Service lifecycle changes</h3>
-<p>Another situation we were increasingly seeing in 1.6 was that, even ignoring the services that inappropriately make themselves foreground, we had a growing number of devices with a large number of services running in the background all fighting each other over the available memory.</p>
-<p>Part of this problem is services that are running more than they should or there simply being too much stuff trying to be done on the device. However, we also found many issues in the interaction between services and the platform that made it easy for an application to leave a service running even when it is trying to do the right thing. Consider this typical scenario:</p>
-<ol>
- <li>An application calls startService().</li>
- <li>That service gets onCreate(), onStart(), and then spawns a background thread to do some work.</li>
- <li>The system is tight on memory, so has to kill the currently running service.</li>
- <li>Later when memory is free, the service is restarted, and gets onCreate() called but not onStart() because there has not been another call to startService() with a new Intent command to send it.</li>
-</ol>
-<p>Now the service will sit there created, not realizing it used to be doing some work, and so not knowing it should stop itself at some point.</p>
-<p>To address this, in Android 2.0 Service.onStart() as been deprecated (though still exists and operates as it used to in previous versions of the platform). It is replaced with a new {@link android.app.Service#onStartCommand(android.content.Intent, int, int)} callback that allows the service to better control how the system should manage it. The key part here is a new result code returned by the function, telling the system what it should do with the service if its process is killed while it is running:</p>
-<ul>
- <li>{@link android.app.Service#START_STICKY} is basically the same as the previous behavior, where the service is left "started" and will later be restarted by the system. The only difference from previous versions of the platform is that it if it gets restarted because its process is killed, onStartCommand() will be called on the next instance of the service with a null Intent instead of not being called at all. Services that use this mode should always check for this case and deal with it appropriately.</li>
- <li>{@link android.app.Service#START_NOT_STICKY} says that, after returning from onStartCreated(), if the process is killed with no remaining start commands to deliver, then the service will be stopped instead of restarted. This makes a lot more sense for services that are intended to only run while executing commands sent to them. For example, a service may be started every 15 minutes from an alarm to poll some network state. If it gets killed while doing that work, it would be best to just let it be stopped and get started the next time the alarm fires.</li>
- <li>{@link android.app.Service#START_REDELIVER_INTENT} is like START_NOT_STICKY, except if the service's process is killed before it calls stopSelf() for a given intent, that intent will be re-delivered to it until it completes (unless after some number of more tries it still can't complete, at which point the system gives up). This is useful for services that are receiving commands of work to do, and want to make sure they do eventually complete the work for each command sent.</li>
-</ul>
-<p>For compatibility with existing applications, the default return code for applications that are targeting an earlier version of the platform is a special {@link android.app.Service#START_STICKY_COMPATIBILITY} code that provides the old behavior of not calling onStart() with a null intent. Once you start targeting API version 5 or later, the default mode is START_STICKY and you must be prepared to deal with onStart() or onStartCommand() being called with a null Intent.</p>
-<p>You can also easily write a Service that uses both the old and new APIs, depending on the platform. All you need to do is compile against the 2.0 SDK with this code:</p>
-<pre class="prettyprint">
-// This is the old onStart method that will be called on the pre-2.0
-// platform. On 2.0 or later we override onStartCommand() so this
-// method will not be called.
-@Override
-public void onStart(Intent intent, int startId) {
- handleStart(intent, startId);
-}
-
-@Override
-public int onStartCommand(Intent intent, int flags, int startId) {
- handleStart(intent, startId);
- return START_NOT_STICKY;
-}
-
-void handleStart(Intent intent, int startId) {
- // do work
-}
-</pre>
-<h3>New "running services" user interface</h3>
-<p>Our final issue to address is the case where there are simply too many service running in the amount of memory available on a device. This may be due to bugs or design flaws in installed applications, or the user simply trying to do too much. Historically users have had no visibility into what is going on at this level in the system, but it has become important to expose this, at least for lower-end devices, as the use of services has had an increasing impact on the user experience.</p>
-<p>To help address this, Android 2.0 introduces a new "Running Services" activity available from the Application system settings. When brought up, it looks something like this:</p>
-<img src="images/service-api-changes-starting-with_runningservices.png" width="192" height="320" alt="Running Services"/>
-<p>The main content is a list of all running services that may be of interest to the user, organized by the processes they run in. In the example here, we see three services:</p>
-<ul>
- <li><b>GTalkService</b> is part of the standard Google application suit; it is running in Google's "gapps" process, which currently consumes 6.8MB. It has been started for 3 hours 55 minutes, which on this device is the time from when it was first booted.</li>
- <li><b>ActivityService</b> is part of the Phonebook app, and its process consumes 4MB. This also has been running since boot.</li>
- <li><b>SoftKeyboard</b> is a third party input method. It has been running since I switched to it, about 4 minutes ago.</li>
-</ul>
-<p>The user can tap on any of these services to control it; for normal services that are running because they were explicitly started, this will present a dialog allowing the user to explicitly stop it:</p>
-<img src="images/service-api-changes-starting-with_stopservice.png" height="320" width="192" alt="Stop Service"/>
-<p>Some other services, like the input method, are running for other reasons. For these, tapping on the service will go to the corresponding UI to manage it (in this case the system's input settings).</p>
-<p>Finally, along the bottom of the screen are some obscure numbers. If you know how to interpret them, this gives you a lot of information on the memory status of your device:</p>
-<ul>
- <li><b>Avail: 38MB+114MB in 25</b> says that the device has 38MB of completely free (or likely used for unrequired caches) memory, and has another 114MB of available memory in 25 background processes it can kill at any time.</li>
- <li><b>Other: 32MB in 3</b> says that the device has 32MB of unavailable memory in 3 unkillable processes (that is, processes that are currently considered to be foreground and must be kept running)</li>
-</ul>
-<p>For most users, this new user interface should be a much more effective way to manage the background applications on their device than the existing "task killer" applications. In the vast majority of cases the reason for a slow running device is too many services trying to run. This prevents the system from being able to run any background processes (which speed up app switching), and ultimately can result in thrashing through the services when not even they can all be kept running. The Running Services UI is intended to provide very specific information about the services that are running, to help make a good decision about what should be stopped. It also does not use the API to force stop an application, which can unintentionally break applications in numerous ways.</p>
-<p>For developers, this is an important tool to ensure your services are well behaved. As you develop your app, be sure to keep an eye on Running Services to ensure that you are not accidentally leaving your services running when they shouldn't be. You should also now keep in mind that users may freely stop any of your services as they wish, without your control, and account for that.</p>
-<p>Android's Services are a very powerful tool, but one of the main and subtle ways that application developers can harm the overall experience a user has with their phone.</p>
diff --git a/docs/html/resources/articles/speech-input.jd b/docs/html/resources/articles/speech-input.jd
deleted file mode 100644
index 2f9cd69..0000000
--- a/docs/html/resources/articles/speech-input.jd
+++ /dev/null
@@ -1,94 +0,0 @@
-page.title=Speech Input
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p> People love their mobile phones because they can stay in touch wherever they
-are. That means not just talking, but e-mailing, texting, microblogging, and so
-on. </p>
-
-<p>Speech input adds another dimension to staying in touch.
-Google's Voice Search application, which is pre-installed on many Android devices
-and available on Google Play, provides powerful features like "search by voice"
-and Voice Actions like "Navigate to." Further
-enhancing the voice experience, Android 2.1 introduces a <a
-href="http://www.youtube.com/watch?v=laOlkD8LmZw">
-voice-enabled keyboard</a>, which makes it even easier
-to stay connected. Now you can dictate your message instead of typing it. Just
-tap the new microphone button on the keyboard, and you can speak in just about
-any context in which you would normally type. </p>
-
-<p> We believe speech can
-fundamentally change the mobile experience. We would like to invite every
-Android application developer to consider integrating speech input capabilities
-via the Android SDK. One of our favorite apps on Google Play that integrates
-speech input is <a href="http://www.handcent.com/">Handcent SMS</a>,
-because you can dictate a reply to any SMS with a
-quick tap on the SMS popup window. Here is Speech input integrated into
-Handcent SMS:</p>
-
-<img src="images/speech-input.png"/>
-
-
-<p> The Android SDK makes it easy to integrate speech input directly into your
-own application. Just copy and paste from this <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html">sample
-application</a> to get
-started. The sample application first verifies that the target device is able
-to recognize speech input:</p>
-<pre>
-// Check to see if a recognition activity is present
-PackageManager pm = getPackageManager();
-List<ResolveInfo> activities = pm.queryIntentActivities(
- new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
-if (activities.size() != 0) {
- speakButton.setOnClickListener(this);
-} else {
- speakButton.setEnabled(false);
- speakButton.setText("Recognizer not present");
-}
-</pre>
-<p>
-The sample application then uses {@link
-android.app.Activity#startActivityForResult(android.content.Intent, int)
-startActivityForResult()} to broadcast an intent that requests voice
-recognition, including an extra parameter that specifies one of two language
-models. The voice recognition application that handles the intent processes the
-voice input, then passes the recognized string back to your application by
-calling the {@link android.app.Activity#onActivityResult(int, int,
-android.content.Intent) onActivityResult()} callback. </p>
-
-
-<p>Android is an open platform, so your application can potentially make
-use of any speech recognition service on the device that's registered to receive
-a {@link android.speech.RecognizerIntent}. Google's Voice Search application,
-which is pre-installed on
-many Android devices, responds to a <em>RecognizerIntent</em> by displaying the
-"Speak
-now" dialog and streaming audio to Google's servers -- the same servers used
-when a user taps the microphone button on the search widget or the voice-enabled
-keyboard. You can check whether Voice Search is installed in
-<strong>Settings > Applications > Manage applications</strong>. </p>
-
-<p> One important tip: for speech input to be as accurate as possible, it's
-helpful to have an idea of what words are likely to be spoken. While a message
-like "Mom, I'm writing you this message with my voice!" might be appropriate for
-an email or SMS message, you're probably more likely to say something like
-"weather in Mountain View" if you're using Google Search. You can make sure your
-users have the best experience possible by requesting the appropriate
-<em>language model:</em> {@link
-android.speech.RecognizerIntent#LANGUAGE_MODEL_FREE_FORM free_form} for
-dictation, or {@link android.speech.RecognizerIntent#LANGUAGE_MODEL_WEB_SEARCH
-web_search} for shorter, search-like phrases. We developed the "free form"
-model to improve dictation accuracy for the voice keyboard,
-while the "web search" model is used when users want to search by voice. </p>
-
-<p> Google's servers support many languages for voice input, with more arriving
-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 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/articles/spell-checker-framework.jd b/docs/html/resources/articles/spell-checker-framework.jd
deleted file mode 100644
index 8d57b4e..0000000
--- a/docs/html/resources/articles/spell-checker-framework.jd
+++ /dev/null
@@ -1,236 +0,0 @@
-page.title=Using the Spell Checker Framework
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-<div id="qv-wrapper">
-<div id="qv">
-<h2>In This Document</h2>
-<ol>
- <li>
- <a href="#SpellCheckLifeCycle">Spell Check Lifecycle</a>
- </li>
- <li>
- <a href="#SpellCheckImplementation">Implementing a Spell Checker Service</a>
- </li>
- <li>
- <a href="#SpellCheckClient">Implementing a Spell Checker Client</a>
- </li>
-</ol>
- <h2>See also</h2>
- <ol>
- <li>
- <a href="{@docRoot}resources/samples/SpellChecker/SampleSpellCheckerService/index.html">
- Spell Checker Service</a> sample app
- </li>
- <li>
- <a href="{@docRoot}resources/samples/SpellChecker/HelloSpellChecker/index.html">
- Spell Checker Client</a> sample app
- </li>
- </ol>
-</div>
-</div>
-
-<p>
- The Android platform offers a spell checker framework that lets you implement
- and access spell checking in your application. The framework is one of the
- Text Service APIs offered by the Android platform.
-</p>
-<p>
- To use the framework in your app, you create a special type of Android service that
- generates a spell checker <strong>session</strong> object. Based on text you provide,
- the session object returns spelling suggestions generated by the spell checker.
-</p>
-<h2 id="SpellCheckLifeCycle">Spell Checker Lifecycle</h2>
-<p>
- The following diagram shows the lifecycle of the spell checker service:
-</p>
-<img src="{@docRoot}resources/articles/images/spellcheck_lifecycle.png" alt="" height="596"
- id="figure1" />
-<p class="img-caption">
- <strong>Figure 1.</strong> The spell checker service lifecycle.
-</p>
-<p>
- To initiate spell checking, your app starts its implementation of the spell checker
- service. Clients in your app, such as activities or individual UI elements, request a
- spell checker session from the service, then use the session to get suggestions for text.
- As a client terminates its operation, it closes its spell checker session. If necessary, your
- app can shut down the spell checker service at any time.
-</p>
-<h2 id="SpellCheckImplementation">Implementing a Spell Checker Service</h2>
-<p>
- To use the spell checker framework in your app, add a spell checker service component including
- the session object definition. You can also add to your app an optional activity that
- controls settings. You must also add an XML metadata file that describes
- the spell checker service, and add the appropriate elements to your manifest file.
-</p>
-<h3 id="SpellCheckCode">Spell checker classes</h3>
-<p>
- Define the service and session object with the following classes:
-</p>
-<dl>
- <dt>
- A subclass of {@link android.service.textservice.SpellCheckerService}
- </dt>
- <dd>
- The {@link android.service.textservice.SpellCheckerService} implements both the
- {@link android.app.Service} class and the spell checker framework interface. Within your
- subclass, you must implement the following method:
- <dl>
- <dt>{@link android.service.textservice.SpellCheckerService#createSession()}</dt>
- <dd>
- A factory method that returns a
- {@link android.service.textservice.SpellCheckerService.Session} object to a
- client that wants to do spell checking.
- </dd>
- </dl>
- <p>
- See the
- <a href="{@docRoot}resources/samples/SpellChecker/SampleSpellCheckerService/index.html">
- Spell Checker Service</a> sample app to learn more about implementing this class.
- </p>
- </dd>
- <dt>
- An implementation of {@link android.service.textservice.SpellCheckerService.Session}
- </dt>
- <dd>
- An object that the spell checker service provides to clients, to let them pass text to
- the spell checker and receive suggestions. Within this class, you must implement the
- following methods:
- <dl>
- <dt>
- {@link android.service.textservice.SpellCheckerService.Session#onCreate()}
- </dt>
- <dd>
- Called by the system in response to
- {@link android.service.textservice.SpellCheckerService#createSession()}. In this
- method, you can initialize the
- {@link android.service.textservice.SpellCheckerService.Session} object based on
- the current locale and so forth.
- </dd>
- <dt>
- {@link android.service.textservice.SpellCheckerService.Session#onGetSuggestions(TextInfo, int)
- onGetSuggestions()}
- </dt>
- <dd>
- Does the actual spell checking. This method returns an object containing
- suggestions for the text passed to it.
- </dd>
- </dl>
- <p>
- Optionally, you can implement
- {@link android.service.textservice.SpellCheckerService.Session#onCancel()}, which
- handles requests to cancel spell checking, or
-{@link android.service.textservice.SpellCheckerService.Session#onGetSuggestionsMultiple(TextInfo[], int, boolean)
-onGetSuggestionsMultiple()}, which handles batches of suggestion requests, or both.
- </p>
- <p>
- See the
- <a href="{@docRoot}resources/samples/SpellChecker/HelloSpellChecker/index.html">
- Spell Checker Client</a> sample app to learn more about implementing this class.
- </p>
- </dd>
-</dl>
-<p class="note">
- <strong>Note:</strong> You must implement all aspects of spell checking as asynchronous and
- thread-safe. A spell checker may be called simultaneously by different threads running on
- different cores. The {@link android.service.textservice.SpellCheckerService} and
- {@link android.service.textservice.SpellCheckerService.Session} take care of this
- automatically.
-</p>
-<h3 id="SpellCheckXML">Spell checker manifest and metadata</h3>
-<p>
- In addition to code, you need to provide the appropriate manifest file and a metadata file for
- the spell checker.
-</p>
-<p>
- The manifest file defines the application, the service, and the activity for controlling
- settings, as shown in the following snippet:
-</p>
-<pre>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.android.samplespellcheckerservice" >
- <application
- android:label="@string/app_name" >
- <service
- android:label="@string/app_name"
- android:name=".SampleSpellCheckerService"
- android:permission="android.permission.BIND_TEXT_SERVICE" >
- <intent-filter >
- <action android:name="android.service.textservice.SpellCheckerService" />
- </intent-filter>
-
- <meta-data
- android:name="android.view.textservice.scs"
- android:resource="@xml/spellchecker" />
- </service>
-
- <activity
- android:label="@string/sample_settings"
- android:name="SpellCheckerSettingsActivity" >
- <intent-filter >
- <action android:name="android.intent.action.MAIN" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
-</pre>
-<p>
- Notice that components that want to use the service must request the permission
- {@link android.Manifest.permission#BIND_TEXT_SERVICE} to ensure that only the system binds to
- the service. The service's definition also specifies the <code>spellchecker.xml</code> metadata
- file, which is described in the next section.
-</p>
-<p>
- The metadata file <code>spellchecker.xml</code> contains the following XML:
-</p>
-<pre>
-<spell-checker xmlns:android="http://schemas.android.com/apk/res/android"
- android:label="@string/spellchecker_name"
- android:settingsActivity="com.example.SpellCheckerSettingsActivity">
- <subtype
- android:label="@string/subtype_generic"
- android:subtypeLocale="en”
- />
- <subtype
- android:label="@string/subtype_generic"
- android:subtypeLocale="fr”
- />
-</spell-checker>
-</pre>
-<p>
- The metadata specifies the activity that the spell checker uses for controlling settings. It
- also defines subtypes for the spell checker; in this case, the subtypes define locales that
- the spell checker can handle.
-</p>
-
-
-<!-- Accessing the Spell Checker Service from a Client -->
-<h2 id="SpellCheckClient">Accessing the Spell Checker Service from a Client</h2>
-<p>
- Applications that use {@link android.widget.TextView} views automatically benefit from spell
- checking, because {@link android.widget.TextView} automatically uses a spell checker. The
- following screenshots show this:
-</p>
-<img src="{@docRoot}resources/articles/images/textview_spellcheck_screenshot_1.png" alt=""
- height="45" id="figure2a" />
-<br>
-<img src="{@docRoot}resources/articles/images/textview_spellcheck_screenshot_2.png" alt=""
- height="121" id="figure2b" />
-<p class="img-caption">
- <strong>Figure 2.</strong> Spell checking in TextView.
-</p>
-<p>
- However, you may want to interact directly with a spell checker service in other cases as well.
- The following diagram shows the flow of control for interacting with a spell checker service:
-</p>
-<img src="{@docRoot}resources/articles/images/spellcheck_client_flow.png" alt=""
- height="394" id="figure3" />
-<p class="img-caption">
- <strong>Figure 3.</strong> Interacting with a spell checker service.
-</p>
-<p>
- The <a href="{@docRoot}resources/samples/SpellChecker/HelloSpellChecker/index.html">
- Spell Checker Client</a> sample app shows how to interact with a spell checker service. The
- LatinIME input method editor in the Android Open Source Project also contains an example of
- spell checking.
-</p>
\ No newline at end of file
diff --git a/docs/html/resources/articles/timed-ui-updates.jd b/docs/html/resources/articles/timed-ui-updates.jd
deleted file mode 100644
index 7a0804f..0000000
--- a/docs/html/resources/articles/timed-ui-updates.jd
+++ /dev/null
@@ -1,151 +0,0 @@
-page.title=Updating the UI from a Timer
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<img style="margin: 1.5em; float: right;" src="images/JFlubber.png" alt="" id="BLOGGER_PHOTO_ID_5135098660116808706" border="0">
-
-<p><strong>Background</strong>: While developing my first useful
-(though small) application for Android, which was a port of an existing
-utility I use when podcasting, I needed a way of updating a clock
-displayed on the UI at regular intervals, but in a lightweight and CPU
-efficient way.</p>
-
-<p><strong>Problem</strong>: In the original application I used
-java.util.Timer to update the clock, but that class is not such a good
-choice on Android. Using a Timer introduces a new thread into the
-application for a relatively minor reason. Thinking in terms of mobile
-applications often means re-considering choices that you might make
-differently for a desktop application with relatively richer resources
-at its disposal. We would like to find a more efficient way of updating
-that clock.</p>
-
-<p><strong>The Application</strong>: The original application is a
-Java Swing and SE application. It is like a stopwatch with a lap timer
-that we use when recording podcasts; when you start the recording, you
-start the stopwatch. Then for every mistake that someone makes, you hit
-the flub button. At the end you can save out the bookmarked mistakes
-which can be loaded into the wonderful
-<a href="http://audacity.sourceforge.net/" title="Audacity">Audacity</a>
-audio editor as a labels track. You can then see where all of the mistakes
-are in the recording and edit them out.</p>
-
-<p>The article describing it is: <a href="http://www.developer.com/java/ent/print.php/3589961" title="http://www.developer.com/java/ent/print.php/3589961">http://www.developer.com/java/ent/print.php/3589961</a></p>
-
-<p>In the original version, the timer code looked like this:</p>
-
-<pre>class UpdateTimeTask extends TimerTask {
- public void run() {
- long millis = System.currentTimeMillis() - startTime;
- int seconds = (int) (millis / 1000);
- int minutes = seconds / 60;
- seconds = seconds % 60;
-
- timeLabel.setText(String.format("%d:%02d", minutes, seconds));
- }
-}</pre><p>And in the event listener to start this update, the following Timer() instance is used:
-</p><pre>if(startTime == 0L) {
- startTime = evt.getWhen();
- timer = new Timer();
- timer.schedule(new UpdateTimeTask(), 100, 200);
-}</pre>
-
-<p>In particular, note the 100, 200 parameters. The first parameter
-means wait 100 ms before running the clock update task the first time.
-The second means repeat every 200ms after that, until stopped. 200 ms
-should not be too noticeable if the second resolution happens to fall
-close to or on the update. If the resolution was a second, you could
-find the clock sometimes not updating for close to 2 seconds, or
-possibly skipping a second in the counting, it would look odd).</p>
-
-<p>When I ported the application to use the Android SDKs, this code
-actually compiled in Eclipse, but failed with a runtime error because
-the Timer() class was not available at runtime (fortunately, this was
-easy to figure out from the error messages). On a related note, the
-String.format method was also not available, so the eventual solution
-uses a quick hack to format the seconds nicely as you will see.</p>
-
-<p>Fortunately, the role of Timer can be replaced by the
-android.os.Handler class, with a few tweaks. To set it up from an event
-listener:</p>
-
-<pre>private Handler mHandler = new Handler();
-
-...
-
-OnClickListener mStartListener = new OnClickListener() {
- public void onClick(View v) {
- if (mStartTime == 0L) {
- mStartTime = System.currentTimeMillis();
- mHandler.removeCallbacks(mUpdateTimeTask);
- mHandler.postDelayed(mUpdateTimeTask, 100);
- }
- }
-};</pre>
-
-<p>A couple of things to take note of here. First, the event doesn't
-have a .getWhen() method on it, which we handily used to set the start
-time for the timer. Instead, we grab the System.currentTimeMillis().
-Also, the Handler.postDelayed() method only takes one time parameter,
-it doesn't have a "repeating" field. In this case we are saying to the
-Handler "call mUpdateTimeTask() after 100ms", a sort of fire and forget
-one time shot. We also remove any existing callbacks to the handler
-before adding the new handler, to make absolutely sure we don't get
-more callback events than we want.</p>
-
-<p>But we want it to repeat, until we tell it to stop. To do this, just
-put another postDelayed at the tail of the mUpdateTimeTask run()
-method. Note also that Handler requires an implementation of Runnable,
-so we change mUpdateTimeTask to implement that rather than extending
-TimerTask. The new clock updater, with all these changes, looks like
-this:</p>
-
-<pre>private Runnable mUpdateTimeTask = new Runnable() {
- public void run() {
- final long start = mStartTime;
- long millis = SystemClock.uptimeMillis() - start;
- int seconds = (int) (millis / 1000);
- int minutes = seconds / 60;
- seconds = seconds % 60;
-
- if (seconds < 10) {
- mTimeLabel.setText("" + minutes + ":0" + seconds);
- } else {
- mTimeLabel.setText("" + minutes + ":" + seconds);
- }
-
- mHandler.postAtTime(this,
- start + (((minutes * 60) + seconds + 1) * 1000));
- }
-};</pre>
-
-<p>and can be defined as a class member field.</p>
-
-<p>The if statement is just a way to make sure the label is set to
-10:06 instead of 10:6 when the seconds modulo 60 are less than 10
-(hopefully String.format() will eventually be available). At the end of
-the clock update, the task sets up another call to itself from the
-Handler, but instead of a hand-wavy 200ms before the update, we can
-schedule it to happen at a particular wall-clock time — the line: start
-+ (((minutes * 60) + seconds + 1) * 1000) does this.</p>
-
-<p>All we need now is a way to stop the timer when the stop button
-is pressed. Another button listener defined like this:</p>
-
-<pre>OnClickListener mStopListener = new OnClickListener() {
- public void onClick(View v) {
- mHandler.removeCallbacks(mUpdateTimeTask);
- }
-};</pre>
-
-<p>will make sure that the next callback is removed when the stop button
-is pressed, thus interrupting the tail iteration.</p>
-
-<p>Handler is actually a better choice than Timer for another reason
-too. The Handler runs the update code as a part of your main thread,
-avoiding the overhead of a second thread and also making for easy
-access to the View hierarchy used for the user interface. Just remember
-to keep such tasks small and light to avoid slowing down the user
-experience.</p>
-
-
diff --git a/docs/html/resources/articles/touch-mode.jd b/docs/html/resources/articles/touch-mode.jd
deleted file mode 100644
index 5eae9b9..0000000
--- a/docs/html/resources/articles/touch-mode.jd
+++ /dev/null
@@ -1,140 +0,0 @@
-page.title=Touch Mode
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>This article explains the <em>touch mode</em>, one of the most
-important principles of Android's UI toolkit.</p>
-
-<p>The touch mode is a state of the view hierarchy that depends solely on the
-user interaction with the phone. By itself, the touch mode is something very
-easy to understand as it simply indicates whether the last user interaction was
-performed with the touch screen. For example, if you are using an
-Android-powered device, selecting a widget with the trackball will take you out
-of touch mode; however, if you touch a button on the screen with your finger,
-you will enter touch mode. When the user is not in touch mode, we talk about the
-trackball mode, navigation mode or keyboard navigation, so do not be surprised
-if you encounter these terms. </p>
-
-<p>There is only one API directly related to touch mode,
-{@link android.view.View#isInTouchMode() View.isInTouchMode()}.</p>
-
-<p>Sounds easy enough, right? Oddly enough, touch mode is deceivingly simple and
-the consequences of entering touch mode are far greater than you might
-think. Let's look at some of the reasons why.</p>
-
-<h4>Touch Mode, Selection, and Focus</h4>
-
-<p>Designing a UI toolkit for mobile devices is difficult because of the various
-interaction mechanisms they provide. Some devices offer only 12 keys, some have
-a touch screen, some require a stylus, some have both a touch screen and a
-keyboard. Based on the hardware capabilities of the he user can interact with
-your application using different mechanisms, so we had to think very hard about
-all the possible issues that could arise. One issue led us to create the touch
-mode.</p>
-
-<p>Imagine a simple application, <a href="{@docRoot}resources/samples/index.html">ApiDemos</a>
-for example, that shows a list of text items. The user can freely
-navigate through the list using the trackball but also, alternatively, scroll
-and fling the list using the touch screen. The issue in this scenario is
-how to handle the selection properly when the user manipulates the list
-through the touch screen. </p>
-
-<p>In this case, if the user selects an item at the top of the list and then
-flings the list towards the bottom, what should happen to the selection? Should
-it remain on the item and scroll off the screen? What should happen if the user
-then decided to move the selection with the trackball? Or worse, what should
-happen if the user presses the trackball to act upon the currently selected
-item, which is not shown on screen anymore? </p>
-
-<p>After careful consideration, we decided to remove the selection altogether,
-when the user manipulates the UI through the touch screen.</p>
-
-<p>In touch mode, there is no focus and no selection. Any selected item in a
-list of in a grid becomes unselected as soon as the user enters touch
-mode. Similarly, any focused widgets become unfocused when the user
-enters touch mode. The image below illustrates what happens when the
-user touches a list after selecting an item with the trackball.</p>
-
-<img style="margin: 0px 7px;" src="images/list02.png" alt="" id="BLOGGER_PHOTO_ID_5272753165743060962" border="0">
-<img style="margin: 0px 7px;" src="images/list01.png" alt="" id="BLOGGER_PHOTO_ID_5272753357441963442" border="0">
-
-<p>To
-make things more natural for the user, the framework knows how to
-resurrect the selection/focus whenever the user leaves touch mode. For
-instance, in the example above, if the user were to use the trackball
-again, the selection would reappear on the previously-selected item.
-This is why some developers are confused when they create a custom view
-and start receiving key events only after moving the trackball once:
-their application is in touch mode, and they need to use the trackball
-to exit touch mode and resurrect the focus.</p>
-
-<p>The relationship between touch mode, selection, and focus means you must not
-rely on selection and/or focus to exist in your application. A very common
-problem with new Android developers is to rely on
-{@link android.widget.AdapterView#getSelectedItemPosition() ListView.getSelectedItemPosition()}.
-In touch mode, this method will return
-{@link android.widget.AdapterView#INVALID_POSITION INVALID_POSITION}.
- You should instead use click listeners (see
-{@link android.widget.AdapterView#setOnItemClickListener(android.widget.AdapterView.OnItemClickListener)})
-or the choice mode (see
-{@link android.widget.ListView#setChoiceMode(int)}).</p>
-
-<h4>Focusable in Touch Mode</h4>
-
-<p>In general, focus doesn't exist in touch mode. However, focus can exist in
-touch mode in a very special way called <em>focusable</em>. This special mode
-was created for widgets that receive text input, such as
-{@link android.widget.EditText} or, when filtering is enabled,
-{@link android.widget.ListView}. The focusable mode is what lets the user enter text
-inside a text field on the screen, without first selecting it with the trackball
-or their finger.</p>
-
-<p>When a user
-touches the screen, the application will enter touch mode if it wasn't
-in touch mode already. What happens during the transition to
-touch mode depends on what the user touched, and what currently has
-focus. If the user touches a widget that is focusable in touch
-mode, that widget will receive focus. Otherwise, any currently
-focused widget will not retain focus unless it is focusable in touch
-mode. For instance, in the picture below, when the user touches
-the screen, the input text field receives the focus.</p>
-
-<img style="margin: 0px 7px;" src="images/text_field.png" alt="" id="BLOGGER_PHOTO_ID_5272755475757779154" border="0">
-
-<p>Fousable in touch mode (see
-{@link android.view.View#setFocusableInTouchMode(boolean) View.setFocusableInTouchMode})
- is a property that you can set yourself, either from code or from XML.
-However, you should use it sparingly and only in very specific situations,
-because it breaks consistency with the normal behavior of the Android UI. A game
-is a good example of an application that could make good use of the focusable in
-touch mode property. MapView, if used in fullscreen as in Google Maps, is
-another good example of where you can use focusable in touch mode correctly.</p>
-
-<p>Below is another example of a focusable in touch mode widget. When the user
-taps an <code>AutoCompleteTextView</code> suggestion with his finger, the focus
-remains on the input text field:</p>
-
-<img style="margin: 0px 7px;" src="images/search01.png" alt="" id="BLOGGER_PHOTO_ID_5272756689821626962" border="0">
-<img style="margin: 0px 7px;" src="images/search02.png" alt="" id="BLOGGER_PHOTO_ID_5272756246104676754" border="0">
-
-<p>Developers new to Android often think that focusable in touch mode is the
-solution they need to "fix" the problem of "disappearing" selection/focus. We
-really encourage you to think very hard before using it. If used incorrectly, it
-can make your application behave differently from the rest of the system and
-simply throw off the user's habits. The Android framework contains all the tools
-you need to handle user interactions without using focusable in touch mode. For
-example, instead of trying to make <code>ListView</code> always keep its
-selection, simply use the appropriate choice mode, as shown in
-{@link android.widget.ListView#setChoiceMode(int)}.
-
-<h4>Touch Mode Cheat Sheet</h4>
-
-<p>Do:</p>
-<ul>
-<li>Remain consistent with the core applications</li><li>Use the appropriate feature if you need persistent selection (radio button, check box, the <code>ListView</code> choice mode, etc.)</li>
-<li>Use focusable in touch mode if you write a game</li>
-</ul>
-
-<p>Don't:</p>
-<ul><li>Do not try to keep the focus or selection in touch mode</li></ul>
diff --git a/docs/html/resources/articles/track-mem.jd b/docs/html/resources/articles/track-mem.jd
deleted file mode 100644
index c4184b5..0000000
--- a/docs/html/resources/articles/track-mem.jd
+++ /dev/null
@@ -1,64 +0,0 @@
-page.title=Tracking Memory Allocations
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>Writing efficient mobile applications is not always straightforward. In
-particular, Android applications rely on automatic memory management handled by
-Dalvik's garbage collector, which can sometimes cause performance issues if you
-are not careful with memory allocations.</p>
-
-<p>In a performance-sensitive code path, such as the layout or drawing method of
-a view or the logic code of a game, any allocation comes at a price. After too
-many allocations, the garbage collector will kick in and stop your application
-to let it free some memory. Most of the time, garbage collections happen fast
-enough for you not to notice. However, if a collection happens while you are
-scrolling through a list of items or while you are trying to defeat a foe in a
-game, you may suddenly see a drop in performance/responsiveness of the
-application. It's not unusual for a garbage collection to take 100 to 200 ms.
-For comparison, a smooth animation needs to draw each frame in 16 to 33 ms. If
-the animation is suddenly interrupted for 10 frames, you can be certain that
-your users will notice.</p>
-
-<p>Most of the time, garbage collection occurs because of tons of small,
-short-lived objects and some garbage collectors, like generational garbage
-collectors, can optimize the collection of these objects so that the application
-does not get interrupted too often. The Android garbage collector is
-unfortunately not able to perform such optimizations and the creation of
-short-lived objects in performance critical code paths is thus very costly for
-your application.</p>
-
-<p>To help you avoid frequent garbage collections, the Android SDK ships with a
-very useful tool called <em>allocation tracker</em>. This tool is part of DDMS,
-which you must have already used for debugging purposes. To start using the
-allocation tracker, you must first launch the standalone version of DDMS, which
-can be found in the <code>tools/</code> directory of the SDK. The version of
-DDMS included in the Eclipse plugin does not offer you ability to use the
-allocation tracker yet.</p>
-
-<p>Once DDMS is running, simply select your application process and then click
-the <em>Allocation Tracker</em> tab. In the new view, click <em>Start
-Tracking</em> and then use your application to make it execute the code paths
-you want to analyze. When you are ready, click <em>Get Allocations</em>. A list
-of allocated objects will be shown in the first table. By clicking on a line you
-can see, in the second table, the stack trace that led to the allocation. Not
-only you will know what type of object was allocated, but also in which thread,
-in which class, in which file and at which line. The following screenshot shows
-the allocations performed by <a
-href="http://code.google.com/p/shelves">Shelves</a> while scrolling a
-ListView.</p>
-
-<a href="images/ddms_allocation_trackerl.png">
-
-<img style="cursor:hand;width: 320px; height: 250px;" src="images/ddms_allocation_tracker.png" border="0" alt="" />
-</a>
-
-<p>Even though it is not necessary — and sometimes not possible — to
-remove all allocations for your performance critical code paths. the allocation
-tracker will help you identify important issues in your code. For instance, a
-common mistake I have seen in many applications is to create a new
-<code>Paint</code> object on every draw. Moving the paint into an instance field
-is a simple fix that helps performance a lot. I highly encourage you to peruse
-the <a href="http://source.android.com/">Android source code</a> to see how we
-reduce allocations in performance-critical code paths. You will also thus
-discover the APIs Android provide to help you reuse objects.</p>
diff --git a/docs/html/resources/articles/tts.jd b/docs/html/resources/articles/tts.jd
deleted file mode 100644
index 929d084..0000000
--- a/docs/html/resources/articles/tts.jd
+++ /dev/null
@@ -1,243 +0,0 @@
-page.title=Using Text-to-Speech
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>Starting with Android 1.6 (API Level 4), the Android platform includes a new
-Text-to-Speech (TTS) capability. Also known as "speech synthesis", TTS enables
-your Android device to "speak" text of different languages.</p>
-
-<p>Before we explain how to use the TTS API itself, let's first review a few
-aspects of the engine that will be important to your TTS-enabled application. We
-will then show how to make your Android application talk and how to configure
-the way it speaks.</p>
-
-<h3>Languages and resources</h3>
-
-<p>The TTS engine that ships with the Android platform supports a number of
-languages: English, French, German, Italian and Spanish. Also, depending on
-which side of the Atlantic you are on, American and British accents for English
-are both supported.</p>
-
-<p>The TTS engine needs to know which language to speak, as a word like "Paris",
-for example, is pronounced differently in French and English. So the voice and
-dictionary are language-specific resources that need to be loaded before the
-engine can start to speak.</p>
-
-<p>Although all Android-powered devices that support the TTS functionality ship
-with the engine, some devices have limited storage and may lack the
-language-specific resource files. If a user wants to install those resources,
-the TTS API enables an application to query the platform for the availability of
-language files and can initiate their download and installation. So upon
-creating your activity, a good first step is to check for the presence of the
-TTS resources with the corresponding intent:</p>
-
-<pre>Intent checkIntent = new Intent();
-checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
-startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);</pre>
-
-<p>A successful check will be marked by a <code>CHECK_VOICE_DATA_PASS</code>
-result code, indicating this device is ready to speak, after the creation of
-our
-{@link android.speech.tts.TextToSpeech} object. If not, we need to let the user
-know to install the data that's required for the device to become a
-multi-lingual talking machine! Downloading and installing the data is
-accomplished by firing off the ACTION_INSTALL_TTS_DATA intent, which will take
-the user to Google Play, and will let her/him initiate the download.
-Installation of the data will happen automatically once the download completes.
-Here is an example of what your implementation of
-<code>onActivityResult()</code> would look like:</p>
-
-<pre>private TextToSpeech mTts;
-protected void onActivityResult(
- int requestCode, int resultCode, Intent data) {
- if (requestCode == MY_DATA_CHECK_CODE) {
- if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
- // success, create the TTS instance
- mTts = new TextToSpeech(this, this);
- } else {
- // missing data, install it
- Intent installIntent = new Intent();
- installIntent.setAction(
- TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
- startActivity(installIntent);
- }
- }
-}</pre>
-
-<p>In the constructor of the <code>TextToSpeech</code> instance we pass a
-reference to the <code>Context</code> to be used (here the current Activity),
-and to an <code>OnInitListener</code> (here our Activity as well). This listener
-enables our application to be notified when the Text-To-Speech engine is fully
-loaded, so we can start configuring it and using it.</p>
-
-<h4>Languages and Locale</h4>
-
-<p>At Google I/O 2009, we showed an <a title="Google I/O 2009, TTS
-demonstration" href="http://www.youtube.com/watch?v=uX9nt8Cpdqg#t=6m17s"
-id="rnfd">example of TTS</a> where it was used to speak the result of a
-translation from and to one of the 5 languages the Android TTS engine currently
-supports. Loading a language is as simple as calling for instance:</p>
-
-<pre>mTts.setLanguage(Locale.US);</pre><p>to load and set the language to
-English, as spoken in the country "US". A locale is the preferred way to specify
-a language because it accounts for the fact that the same language can vary from
-one country to another. To query whether a specific Locale is supported, you can
-use <code>isLanguageAvailable()</code>, which returns the level of support for
-the given Locale. For instance the calls:</p>
-
-<pre>mTts.isLanguageAvailable(Locale.UK))
-mTts.isLanguageAvailable(Locale.FRANCE))
-mTts.isLanguageAvailable(new Locale("spa", "ESP")))</pre>
-
-<p>will return TextToSpeech.LANG_COUNTRY_AVAILABLE to indicate that the language
-AND country as described by the Locale parameter are supported (and the data is
-correctly installed). But the calls:</p>
-
-<pre>mTts.isLanguageAvailable(Locale.CANADA_FRENCH))
-mTts.isLanguageAvailable(new Locale("spa"))</pre>
-
-<p>will return <code>TextToSpeech.LANG_AVAILABLE</code>. In the first example,
-French is supported, but not the given country. And in the second, only the
-language was specified for the Locale, so that's what the match was made on.</p>
-
-<p>Also note that besides the <code>ACTION_CHECK_TTS_DATA</code> intent to check
-the availability of the TTS data, you can also use
-<code>isLanguageAvailable()</code> once you have created your
-<code>TextToSpeech</code> instance, which will return
-<code>TextToSpeech.LANG_MISSING_DATA</code> if the required resources are not
-installed for the queried language.</p>
-
-<p>Making the engine speak an Italian string while the engine is set to the
-French language will produce some pretty <i>interesting </i>results, but it will
-not exactly be something your user would understand So try to match the
-language of your application's content and the language that you loaded in your
-<code>TextToSpeech</code> instance. Also if you are using
-<code>Locale.getDefault()</code> to query the current Locale, make sure that at
-least the default language is supported.</p>
-
-<h3>Making your application speak</h3>
-
-<p>Now that our <code>TextToSpeech</code> instance is properly initialized and
-configured, we can start to make your application speak. The simplest way to do
-so is to use the <code>speak()</code> method. Let's iterate on the following
-example to make a talking alarm clock:</p>
-
-<pre>String myText1 = "Did you sleep well?";
-String myText2 = "I hope so, because it's time to wake up.";
-mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, null);
-mTts.speak(myText2, TextToSpeech.QUEUE_ADD, null);</pre>
-
-<p>The TTS engine manages a global queue of all the entries to synthesize, which
-are also known as "utterances". Each <code>TextToSpeech</code> instance can
-manage its own queue in order to control which utterance will interrupt the
-current one and which one is simply queued. Here the first <code>speak()</code>
-request would interrupt whatever was currently being synthesized: the queue is
-flushed and the new utterance is queued, which places it at the head of the
-queue. The second utterance is queued and will be played after
-<code>myText1</code> has completed.</p>
-
-<h4>Using optional parameters to change the playback stream type</h4>
-
-<p>On Android, each audio stream that is played is associated with one stream
-type, as defined in
-{@link android.media.AudioManager android.media.AudioManager}. For a talking
-alarm clock, we would like our text to be played on the
-<code>AudioManager.STREAM_ALARM</code> stream type so that it respects the alarm
-settings the user has chosen on the device. The last parameter of the speak()
-method allows you to pass to the TTS engine optional parameters, specified as
-key/value pairs in a HashMap. Let's use that mechanism to change the stream type
-of our utterances:</p>
-
-<pre>HashMap<String, String> myHashAlarm = new HashMap();
-myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_STREAM,
- String.valueOf(AudioManager.STREAM_ALARM));
-mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, myHashAlarm);
-mTts.speak(myText2, TextToSpeech.QUEUE_ADD, myHashAlarm);</pre>
-
-<h4>Using optional parameters for playback completion callbacks</h4>
-
-<p>Note that <code>speak()</code> calls are asynchronous, so they will return
-well before the text is done being synthesized and played by Android, regardless
-of the use of <code>QUEUE_FLUSH</code> or <code>QUEUE_ADD</code>. But you might
-need to know when a particular utterance is done playing. For instance you might
-want to start playing an annoying music after <code>myText2</code> has finished
-synthesizing (remember, we're trying to wake up the user). We will again use an
-optional parameter, this time to tag our utterance as one we want to identify.
-We also need to make sure our activity implements the
-<code>TextToSpeech.OnUtteranceCompletedListener</code> interface:</p>
-
-<pre>mTts.setOnUtteranceCompletedListener(this);
-myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_STREAM,
- String.valueOf(AudioManager.STREAM_ALARM));
-mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, myHashAlarm);
-myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID,
- "end of wakeup message ID");
-// myHashAlarm now contains two optional parameters
-mTts.speak(myText2, TextToSpeech.QUEUE_ADD, myHashAlarm);</pre>
-
-<p>And the Activity gets notified of the completion in the implementation
-of the listener:</p>
-
-<pre>public void onUtteranceCompleted(String uttId) {
- if (uttId == "end of wakeup message ID") {
- playAnnoyingMusic();
- }
-}</pre>
-
-<h4>File rendering and playback</h4>
-
-<p>While the <code>speak()</code> method is used to make Android speak the text
-right away, there are cases where you would want the result of the synthesis to
-be recorded in an audio file instead. This would be the case if, for instance,
-there is text your application will speak often; you could avoid the synthesis
-CPU-overhead by rendering only once to a file, and then playing back that audio
-file whenever needed. Just like for <code>speak()</code>, you can use an
-optional utterance identifier to be notified on the completion of the synthesis
-to the file:</p>
-
-<pre>HashMap<String, String> myHashRender = new HashMap();
-String wakeUpText = "Are you up yet?";
-String destFileName = "/sdcard/myAppCache/wakeUp.wav";
-myHashRender.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, wakeUpText);
-mTts.synthesizeToFile(wakuUpText, myHashRender, destFileName);</pre>
-
-<p>Once you are notified of the synthesis completion, you can play the output
-file just like any other audio resource with
-{@link android.media.MediaPlayer android.media.MediaPlayer}.</p>
-
-<p>But the <code>TextToSpeech</code> class offers other ways of associating
-audio resources with speech. So at this point we have a WAV file that contains
-the result of the synthesis of "Wake up" in the previously selected language. We
-can tell our TTS instance to associate the contents of the string "Wake up" with
-an audio resource, which can be accessed through its path, or through the
-package it's in, and its resource ID, using one of the two
-<code>addSpeech()</code> methods:</p>
-
-<pre>mTts.addSpeech(wakeUpText, destFileName);</pre>
-
-<p>This way any call to speak() for the same string content as
-<code>wakeUpText</code> will result in the playback of
-<code>destFileName</code>. If the file is missing, then speak will behave as if
-the audio file wasn't there, and will synthesize and play the given string. But
-you can also take advantage of that feature to provide an option to the user to
-customize how "Wake up" sounds, by recording their own version if they choose
-to. Regardless of where that audio file comes from, you can still use the same
-line in your Activity code to ask repeatedly "Are you up yet?":</p>
-
-<pre>mTts.speak(wakeUpText, TextToSpeech.QUEUE_ADD, myHashAlarm);</pre>
-
-<h4>When not in use...</h4><p>The text-to-speech functionality relies on a
-dedicated service shared across all applications that use that feature. When you
-are done using TTS, be a good citizen and tell it "you won't be needing its
-services anymore" by calling <code>mTts.shutdown()</code>, in your Activity
-<code>onDestroy()</code> method for instance.</p>
-
-<h3>Conclusion</h3>
-
-<p>Android now talks, and so can your apps. Remember that in order for
-synthesized speech to be intelligible, you need to match the language you select
-to that of the text to synthesize. Text-to-speech can help you push your app in
-new directions. Whether you use TTS to help users with disabilities, to enable
-the use of your application while looking away from the screen, or simply to
-make it cool, we hope you'll enjoy this new feature.</p>
\ No newline at end of file
diff --git a/docs/html/resources/articles/ui-1.5.jd b/docs/html/resources/articles/ui-1.5.jd
deleted file mode 100644
index 2edaa2e..0000000
--- a/docs/html/resources/articles/ui-1.5.jd
+++ /dev/null
@@ -1,50 +0,0 @@
-page.title=UI Framework Changes in Android 1.5
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-
-<p>Android 1.5 offers a different default look for
-the Android UI framework, in relation to Android 1.0 and 1.1. The
-screenshots below show the same activity (creating a new contact) on
-Android 1.1 and Android 1.5:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 277px;" src="images/android.png" alt="" id="BLOGGER_PHOTO_ID_5323141124169754690" border="0">
-
-<p>You
-can see in this example that the buttons and checkboxes have a new
-appearance. Even though these changes do not affect binary nor source
-compatibility, they might still break the UI of your apps. As part of
-the UI refresh, the minimum size of some of the widgets has changed.
-For instance, Android 1.1 buttons have a minimum size of 44x48 pixels
-whereas Android 1.5 buttons now have a minimum size of 24x48 pixels.
-The image below compares the sizes of Android 1.1 buttons with Android
-1.5 buttons:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 100px; height: 130px;" src="images/buttons.png" alt="" border="0">
-
-<p>If you rely on the button's minimum size, then the layout of your application
-may not be the same in Android 1.5 as it was in Android 1.1 because of this
-change. This would happen for instance if you created a grid of buttons using
-<code>LinearLayout</code> and relying on the minimum size yielded by
-<code>wrap_content</code> to align the buttons properly:</p>
-
-<img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 277px;" src="images/grid.png" alt="" id="BLOGGER_PHOTO_ID_5323147943613255250" border="0">
-
-<p>This layout could easily be fixed by using the
-<code>android:layout_weight</code> attribute or by replacing the
-<code>LinearLayout</code> containers with a <code>TableLayout</code>.</p>
-
-<p>This example is probably the worst-case UI issue you may encounter when
-running your application on Android 1.5. Other changes introduced in Android
-1.5, especially bug fixes in the layout views, may also impact your
-application—especially if it is relying on faulty/buggy behavior of the UI
-framework.</p>
-
-<p>If you encounter issues when running your application on Android 1.5, please
-join us on the <a href="{@docRoot}resources/community-groups.html">Android
-developer groups</a> or <a
-href="{@docRoot}resources/community-more.html">IRC</a> so that we and the
-Android community can help you fix your application.</p>
-
-<p>Happy coding!</p>
diff --git a/docs/html/resources/articles/ui-1.6.jd b/docs/html/resources/articles/ui-1.6.jd
deleted file mode 100644
index b3238e3..0000000
--- a/docs/html/resources/articles/ui-1.6.jd
+++ /dev/null
@@ -1,132 +0,0 @@
-page.title=UI Framework Changes in Android 1.6
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>Android 1.6 introduces numerous enhancements and bug fixes in the UI
-framework. This article highlights two improvements in particular: more flexible
-and robust RelativeLayout and easier click listeners. </p>
-
-<h3>More flexible, more robust RelativeLayout</h3>
-
-<p>RelativeLayout is the most versatile layout offered by the Android UI toolkit
-and can be successfully used to reduce the number of views created by your
-applications. This layout used to suffer from various bugs and limitations,
-sometimes making it difficult to use without having some knowledge of its
-implementation. To make your life easier, Android 1.6 comes with a revamped
-RelativeLayout. </p>
-
-<p>This new implementation not only fixes all known bugs in
-RelativeLayout but also addresses its major limitation: the
-fact that views had to be declared in a particular order. Consider the following
-XML layout:</p>
-
-<pre><?xml version="1.0" encoding="utf-8"?>
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="64dip"
- android:padding="6dip">
-
- <TextView
- android:id="@+id/band"
- android:layout_width="fill_parent"
- android:layout_height="26dip"
-
- android:layout_below="@+id/track"
- android:layout_alignLeft="@id/track"
- android:layout_alignParentBottom="true"
-
- android:gravity="top"
- android:text="The Airborne Toxic Event" />
-
- <TextView
- android:id="@id/track"
- android:layout_marginLeft="6dip"
- android:layout_width="fill_parent"
- android:layout_height="26dip"
-
- android:layout_toRightOf="@+id/artwork"
-
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:gravity="bottom"
- android:text="Sometime Around Midnight" />
-
- <ImageView
- android:id="@id/artwork"
- android:layout_width="56dip"
- android:layout_height="56dip"
- android:layout_gravity="center_vertical"
-
- android:src="@drawable/artwork" />
-
-</RelativeLayout></pre>
-
-<p>This code builds a very simple layout—an image on the left with two lines of
-text stacked vertically. This XML layout is perfectly fine and contains no
-errors. Unfortunately, Android 1.5's RelativeLayout is incapable of rendering it
-correctly, as shown in the screenshot below.</p>
-
-<img src="images/ui-1.6_002.png" style="width: 320px; height: 480px;">
-
-<p>The problem is that this layout uses forward references. For instance, the
-"band" TextView is positioned below the "track" TextView but "track" is declared
-after "band" and, in Android 1.5, RelativeLayout does not know how to handle
-this case. Now look at the exact same layout running on Android 1.6:</p>
-
-<img src="images/ui-1.6.png" style="width: 320px; height: 480px;">
-
-<p>As you can see Android 1.6 is now better able to handle forward reference.
-The result on screen is exactly what you would expect when writing the
-layout.</p>
-
-<h3>Easier click listeners</h3>
-
-<p>Setting up a click listener on a button is very common task, but
-it requires quite a bit of boilerplate code:</p>
-
-<pre>findViewById(R.id.myButton).setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- // Do stuff
- }
-});</pre>
-
-<p>One way to reduce the amount of boilerplate is to share a single click
-listener between several buttons. While this technique reduces the
-number of classes, it still requires a fair amount of code and it still
-requires giving each button an id in your XML layout file:</p>
-
-<pre>View.OnClickListener handler = View.OnClickListener() {
- public void onClick(View v) {
- switch (v.getId()) {
- case R.id.myButton: // doStuff
- break;
- case R.id.myOtherButton: // doStuff
- break;
- }
- }
-}
-
-findViewById(R.id.myButton).setOnClickListener(handler);
-findViewById(R.id.myOtherButton).setOnClickListener(handler);</pre>
-
-<p>With Android 1.6, none of this is necessary. All you have to do is
-declare a public method in your Activity to handle the click
-(the method <i>must</i> have one View argument):</p>
-
-<pre>class MyActivity extends Activity {
- public void myClickHandler(View target) {
- // Do stuff
- }
-}</pre>
-
-<p>And then reference this method from your XML layout:</p>
-
-<pre><Button android:onClick="myClickHandler" /></pre>
-
-<p>This new feature reduces both the amount of Java and XML you have to write,
-leaving you more time to concentrate on your application.</p>
-
-<p>The Android team is committed to helping you write applications in the
-easiest and most efficient way possible. We hope you find these improvements
-useful and we're excited to see your applications on Google Play.</p>
diff --git a/docs/html/resources/articles/using-webviews.jd b/docs/html/resources/articles/using-webviews.jd
deleted file mode 100644
index 3a2430b..0000000
--- a/docs/html/resources/articles/using-webviews.jd
+++ /dev/null
@@ -1,63 +0,0 @@
-page.title=Using WebViews
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>A small application called <a title="WebViewDemo"
-href="http://code.google.com/p/apps-for-android/source/browse/#svn/trunk/Samples
-/WebViewDemo">WebViewDemo</a> shows how you can add web content to your
-application. You can find it in the <a title="apps-for-android"
-href="http://code.google.com/p/apps-for-android/">apps-for-android</a> project.
-This application demonstrates how you can embed a {@link android.webkit.WebView}
-into an activity and also how you can have two way communication between your
-application and the web content. </p>
-
-<p>A
-WebView uses the same rendering and JavaScript engine as the browser,
-but it runs under the control of your application. The WebView can be
-full screen or you can mix it with other Views. The content for your
-WebView can come from anywhere. The WebView can download content from
-the web, or it can come from local files stored in your assets
-directory. The content can even be dynamically generated by your
-application code. For this example, the HTML comes from a local file
-called <a title="demo.html" href="http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/WebViewDemo/assets/demo.html">demo.html</a>.</p>
-
-<p>This application does not do very much: when you click on the
-android, he raises his arm.</p>
-
-<div style="text-align: center;"><img style="width: 322px; height: 482px;" src="images/webview.png"></div>
-
-<p>This
-could, of course, easily be accomplished with a little bit of
-JavaScript. Instead, though, WebViewDemo takes a slightly more
-complicated path to illustrate two very powerful features of WebView.</p>
-
-<p>First,
-JavaScript running inside the WebView can call out to code in your
-Activity. You can use this to have your JavaScript trigger actions like
-starting a new activity, or it can be used to fetch data from a
-database or {@link android.content.ContentProvider}. The API for this
-is very simple: just call the
-{@link android.webkit.WebView#addJavascriptInterface(java.lang.Object, java.lang.String) addJavascriptInterface()}
-method on your WebView. You pass an object whose methods you want to
-expose to JavaScript and the name to use when making calls. You can see
-the exact syntax in <a title="WebViewDemo.java"
-href="http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/
-WebViewDemo/src/com/google/android/webviewdemo/WebViewDemo.java">WebViewDemo.
-java</a>. Here we are making our DemoJavascriptInterface object available to
-JavaScript where it will be called "window.demo".</p>
-
-<p>Second, your Activity can invoke JavaScript methods. All you have to do
-is call the {@link android.webkit.WebView#loadUrl(java.lang.String) loadUrl}
-method with the appropriate JavaScript call:</p>
-
-<p><code style="padding-left: 25px;">mWebView.loadUrl("javascript:wave()");</code></p>
-
-<p>Our <a title="WebViewDemo"
-href="http://code.google.com/p/apps-for-android/source/browse/#svn/trunk/Samples
-/WebViewDemo">WebViewDemo</a> uses both techniques: when you click on the
-android, it calls out to the activity, which then turns around and calls back
-into the JavaScript. WebViews are very powerful, and they may be a valuable tool
-to help you build your application – especially if you already have a lot of
-HTML content. As it happens, we've used exactly this approach in some of the
-applications we've written.</p>
diff --git a/docs/html/resources/articles/wikinotes-intents.jd b/docs/html/resources/articles/wikinotes-intents.jd
deleted file mode 100644
index 78fe62e..0000000
--- a/docs/html/resources/articles/wikinotes-intents.jd
+++ /dev/null
@@ -1,257 +0,0 @@
-page.title=WikiNotes: Routing Intents
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-
-<p>In <a href="wikinotes-linkify.html">the Linkify! article</a>, we talked about
-using Linkify to turn wiki words (those that match a regular expression that we
-have defined) into a <code>content:</code> URI and defining a path to data that
-matched a note belonging to that wiki word. As an example, a matching word like
-<code>ToDoList</code> would be turned into a URI such as
-<code>content://com.google.android.wikinotes.db.wikinotes/wikinotes/ToDoList
-</code> and then acted upon using the VIEW action from the Linkify class.</p>
-
-<p>This article examines how the Android system takes this combination of
-<code>VIEW</code> action and <code>content:</code> URI and finds the correct
-activity to fire in order to do something with the data. It will also explain
-how the other default links created by Linkify, such as web URLs and telephone
-numbers, also result in the correct activity to handle that data type being
-fired. Finally, this article will start to examine the custom
-<code>ContentProvider</code> that has been created to handle WikiNotes data. The
-full description of the ContentProvider and what it does will span a couple more
-articles as well, because there is a lot to cover.</p>
-
-<h3>The Linkify-calls-intent Workflow</h3>
-
-<p>At a high level, the steps for Linkify to invoke an intent, and for the
-resulting activity (if any) to handle it, look like this:</p>
-
-<ol>
- <li>Linkify is invoked on a TextView to turn matching text patterns into Intent links.</li>
- <li>Linkify takes over monitoring for those Intent links being selected by the user.</li>
- <li>When the user selects a link, Linkify calls the VIEW action using the content: URI associated with the link.</li>
- <li>Android takes the content: URI that represents the data, and looks for a
-ContentProvider registered in the system that matches the URI.</li>
- <li>If a match is found, Android queries the ContentProvider using the URI,
-and asks what MIME type the data that will be returned from the URI is.</li>
- <li>Android then looks for an activity registered in the system with an
-intent-filter that matches both the VIEW action, and the MIME type for
-the data represented by the content: URI.</li>
- <li>Assuming a match is found, Linkify then invokes the intent for
-the URI, at which point the activity takes over, and is handed
-the content: URI.</li>
- <li>The activity can then use the URI to retrieve the data and act on
-it.</li>
-</ol>
-
-<p>This is actually a simpler process than it
-sounds, and it is quite lightweight as well. Perhaps a more
-understandable statement about how it works might be:</p>
-
-<p>Linkify is used to turn matching text into hot-links. When the user
-selects a hot-link, Android takes the data locator represented by the
-hot-link and looks for a data handler for that data locator. If it
-finds one, it asks for what type of data is returned for that locator.
-It then looks for something registered with the system that handles
-that type of data for the VIEW action, and starts it, including the
-data locator in the request.</p>
-
-<p>The real key here is the MIME type. MIME stands for <a
-href="http://en.wikipedia.org/wiki/MIME">Multipurpose Internet Mail
-Extensions</a> — a standard for sending attachments over email. The MIME
-type (which is the part Android uses) is a way of describing certain kinds of
-data. That type is then used to look for an Activity that can do something with
-that data type. In this way, ContentProviders and Activities (or other
-IntentReceivers) are decoupled, meaning that a given Content URI might have a
-different ContentProvider to handle it, but could still use the same MIME type
-meaning that the same activity could be called upon to handle the resulting
-data.</p>
-
-<h3>Linkify on a wiki word</h3>
-
-<p>Using the above workflow, let's take a look at exactly how the process
-works in WikiNotes for Android:</p>
-
-<p>First, Linkify is used to turn text matching the wiki word regular expression
-into a link that provides a Content URI for that wiki word, for example
-<code>content://com.google.android.wikinotes.db.wikinotes/wikinotes/ToDoList</code>.</p>
-
-<p>When the user clicks on the wiki word link, Linkify invokes the VIEW
-action on the Content URI. At this point, the Android system takes over
-getting the Intent request to the correct activity.</p>
-
-<p>Next, Android looks for a ContentProvider that has been registered
-with the system to handle URIs matching our Content URI format.</p>
-
-<p>In our case, we have a definition inside
-<a href="http://code.google.com/p/apps-for-android/source/browse/trunk/WikiNotes/AndroidManifest.xml">our application's AndroidManifest.xml</a>
-file that reads:</p>
-
-<pre><provider name="com.google.android.wikinotes.db.WikiNotesProvider"
- android:authorities="com.google.android.wikinotes.db.wikinotes" /></pre>
-
-<p>This establishes that we have a ContentProvider defined in our application
-that provides the "root authority":
-<code>com.google.android.wikinotes.db.wikinotes</code>. This is the first part
-of the Content URI that we create for a wiki word link. Root Authority is just
-another way of thinking about a descriptor that is registered with Android to
-allow requests for certain URLs to be routed to the correct class.</p>
-
-<p>So, the whole definition is that a class called
-<code>com.google.android.wikinotes.db.WikiNotesProvider</code> is registered
-with the system as able to handle the
-<code>com.google.android.wikinotes.db.wikinotes</code> root authority (i.e. URIs
-starting with that identifier).</p>
-
-<p>From here, Android takes the rest of the URI and presents it to that
-ContentProvider. If you look at the
-<a href="http://code.google.com/p/apps-for-android/source/browse/trunk/WikiNotes/src/com/google/android/wikinotes/db/WikiNotesProvider.java">WikiNotesProvider
-class</a> and scroll to the very bottom, in the static block there, you can see
-the pattern definitions to match the rest of the URL.</p>
-
-<p>In particular, take a look at the two lines:</p>
-
-<pre>URI_MATCHER.addURI(WikiNote.WIKINOTES_AUTHORITY, "wikinotes", NOTES);
-URI_MATCHER.addURI(WikiNote.WIKINOTES_AUTHORITY, "wikinotes/*", NOTE_NAME);</pre>
-
-<p>These are the definitions of URIs that our ContentProvider recognizes and can
-handle. The first recognizes a full URI of
-<code>content://com.google.android.wikinotes.db.wikinotes/wikinotes</code> and
-associates that with a constant called NOTES. This is used elsewhere in the
-ContentProvider to provide a list of all of the wiki notes in the database when
-the URI is requested.</p>
-
-<p>The second line uses a wildcard — '*' — to match a request of the
-form that Linkify will create, e.g.
-<code>content://com.google.android.wikinotes.db.wikinotes/wikinotes/ToDoList
-</code>. In this example, the * matches the ToDoList part of the URI and is
-available to the handler of the request, so that it can fish out the matching
-note for ToDoList and return it as the data. This also associates that match
-with a constant called NOTE_NAME, which again is used as an identifier elsewhere
-in the ContentProvider.</p>
-
-<p>The other matches in this static block are related to forms of
-searching that have been implemented in the WikiNotes for Android
-application, and will be covered in later articles. Likewise, how the
-data is obtained from this matching pattern will be the subject of the
-next article.</p>
-
-<p>For right now we are concerned with the MIME type for the URI. This is
-defined in the <code>getType()</code> method also in the
-<a href="http://code.google.com/p/apps-for-android/source/browse/trunk/WikiNotes/src/com/google/android/wikinotes/db/WikiNotesProvider.java">WikiNotesProvider
-class</a> (about halfway through the file). Take a quick look at this. The key
-parts for now are:</p>
-
-<pre>case NOTES:
- return "vnd.android.cursor.<b>dir</b>/vnd.google.wikinote";</pre>
-
-<p>and</p>
-
-<pre>case NOTE_NAME:
- return "vnd.android.cursor.<b>item</b>/vnd.google.wikinote";</pre>
-
-<p>These are the same constant names we defined in our pattern
-matchers. In the first case, that of the all notes URI, the MIME type
-returned is <code>vnd.android.cursor.dir/vnd.google.wikinote</code>
-which is like saying an Android list (dir) of Google wiki notes (the
-vnd bit is MIME-speak for "vendor specific definition"). Likewise, in
-the case of a NOTE_NAME match, the MIME type returned is
-<code>vnd.android.cursor.item/vnd.google.wikinote</code> which is
-like saying an Android item of Google wiki notes.</p>
-
-<p>Note that if you define your own MIME data types like this, the
-<code>vnd.android.cursor.dir</code> and <code>vnd.android.cursor.item</code>
-categories should be retained, since they have meaning to the Android
-system, but the actual item types should be changed to reflect your
-particular data type.</p>
-
-<p>So far Android has been able to find a ContentProvider that handles
-the Content URI supplied by the Linkify Intent call, and has queried
-the ContentProvider to find out the MIME types for that URI. The final
-step is to find an activity that can handle the VIEW action for that
-MIME type. Take a look in the the
-<a href="http://code.google.com/p/apps-for-android/source/browse/trunk/WikiNotes/AndroidManifest.xml">AndroidManifest.xml file</a>
-again. Inside the WikiNotes activity definition, you will see:</p>
-
-<pre><intent-filter>
- <action name="android.intent.action.VIEW"/>
- <category name="android.intent.category.DEFAULT"/>
- <category name="android.intent.category.BROWSABLE"/>
- <data mimetype="vnd.android.cursor.item/vnd.google.wikinote"/>
-</intent-filter></pre>
-
-<p>This is the correct combination of matches for the VIEW action on a
-WikiNote type that is requested from the LINKIFY class. The DEFAULT
-category indicates that the WikiNotes activity should be treated as a
-default handler (a primary choice) for this kind of data, and the
-BROWSABLE category means it can be invoked from a "browser", in this
-case the marked-up Linkified text.</p>
-
-<p>Using this information, Android can match up the VIEW action request
-for the WikiNotes data type with the WikiNotes activity, and can then
-use the WikiNotes activity to handle the request.</p>
-
-<h3>Why do it like this?</h3>
-
-<p>It's quite a trip through the system, and there is a lot to absorb
-here, but this is one of the main reasons I wanted to write WikiNotes
-in the first place. If you follow and understand the steps here, you'll
-have a good grasp of the whole Intents mechanism in Android, and how it
-helps loosely coupled activities cooperate to get things done.</p>
-
-<p>In this case, we could have found another way to detect wiki words
-based on a regular expression, and maybe written our own handler to
-intercept clicks within the TextView and dig out the right data and
-display it. This would seem to accomplish the same functionality just
-as easily as using intents, so what is the advantage to using the full
-Intents mechanism?</p>
-
-<p>In fact there are several advantages:</p>
-
-<p>The most obvious is that because we are using the standard Intent
-based approach, we are not limited to just linking and navigating to
-other wiki notes. We get similar behavior to a number of other data
-types as well. For example, a telephone number or web URL in a wiki
-note will be marked up by Linkify, and using this same mechanism (VIEW
-action on the linked data type) the browser or dialer activities will
-be automatically fired.</p>
-
-<p>It also means that each operation on a wiki note can be treated as a
-separate life cycle by our activity. We are not dealing with swapping
-data in and out of an existing activity - each activity works on a
-particular wiki note and that's all you have to worry about.</p>
-
-<p>Another advantage is that we now have a public activity to handle
-VIEW actions in WikiNotes no matter where the request comes from.
-Another application could request to view a wiki note (perhaps without
-even knowing what kind of data it is) and our activity could start up
-and handle it.</p>
-
-<p>The backstack is automatically maintained for you too. As you
-forward navigate through WikiNotes, Android maintains the history of
-notes visited, and so when you hit the back button you go back to the
-last note you were on. All this is free because we rely on the Android
-intents mechanism.</p>
-
-<p>Finally, if you run WikiNotes for Android and then start DDMS to
-take a look at the Activity threads in the WikiNotes application while
-it is running, you can see that despite what you might think, letting
-Android manage the navigation is very efficient. Create a few linked
-notes, as many links deep as you like, and then follow them. If you
-follow links hundreds of notes deep, you will still only see a handful
-of WikiNotes activities. Android is managing the activities, closing
-the older ones as necessary and using the life cycle to swap data in
-and out.</p>
-
-<h3>Next Time</h3>
-
-<p>This was a long article, but necessarily so. It demonstrates the
-importance of the Intents mechanism and to reinforce the notion that it
-should be used whenever possible for forward navigation, even within a
-single application. Illustrating this is one of the primary reasons I
-wrote WikiNotes for Android in the first place.</p>
-
-<p>In the next article we will look deeper into the ContentProvider and
-examine how it turns a Content URI into a row (or several rows) of data
-that can be used by an activity.</p>
diff --git a/docs/html/resources/articles/wikinotes-linkify.jd b/docs/html/resources/articles/wikinotes-linkify.jd
deleted file mode 100644
index fb49f86..0000000
--- a/docs/html/resources/articles/wikinotes-linkify.jd
+++ /dev/null
@@ -1,115 +0,0 @@
-page.title=WikiNotes: Linkify your Text!
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<img style="margin-left: 1.5em; margin-bottom:1.5em; float: right;"
-src="images/WikiNotes.png" alt="Linkify example" border="0">
-
-<p>This article introduces <a
-href="http://android-developers.blogspot.com/2008/03/announcing-apps-for-android
-.html">WikiNotes for Android</a>, part of the <a
-href="http://code.google.com/p/apps-for-android/">Apps for Android</a>
-project. It covers the use of Linkify to turn ordinary text views
-into richer, link-oriented content that causes Android intents to fire
-when a link is selected.</p>
-
-<p><strong>Linkify</strong>: The {@link android.text.util.Linkify} class in the
-framework is perfect for creating a wiki note pad. It lets you specify a <a
-title="regular expression"
-href="http://en.wikipedia.org/wiki/Regular_expression">regular expression
-»</a>
-to match, and a scheme to prepend. The scheme is a string that, when
-the matched text is added, forms a Content URI to allow the correct
-data to be looked up.</p>
-
-<p>For example, in our case we want to look for a regular expression match for a
-WikiWord (that is, a word with <a title="word with camel case"
-href="http://en.wikipedia.org/wiki/CamelCase">camel case »</a> and no
-spaces). Linkify can then turn this into a Content URI — something like
-<code>content://com.google.android.wikinotes.db.wikinotes/wikinotes/WikiWord</code>,
-which can then be used to locate the correct wiki page from a
-{@link android.content.ContentProvider}.</p>
-
-<p>As a bonus, the Linkify class also defines several default matches,
-in particular it is able to turn web URLs, email addresses and
-telephone numbers into active links which fire Android intents
-automatically.</p>
-
-<p>Linkify can be passed any TextView in your application, and will
-take care of creating the links and enabling their "clickability" for
-you.</p>
-
-<p><strong>Default Linkify</strong>: Using the set of default active
-link options is very straightforward. Simply pass it a handle to a
-TextView with content in it, and the <code>Linkify.ALL</code> flag:</p>
-
-<pre>TextView noteView = (TextView) findViewById(R.id.noteview);
-noteView.setText(someContent);
-Linkify.addLinks(noteView, Linkify.ALL);</pre>
-
-<p>and that's it. The <code>Linkify.ALL</code> flag applies all of the predefined
-link actions, and the TextView will be immediately updated with a set
-of active links which, if you select them, fire default intents for the
-actions (e.g. a web URL will start the browser with that URL, a
-telephone number will bring up the phone dialer with that number ready
-to call, etc.).</p>
-
-<p><strong>Custom Linkify</strong>: So what about our WikiWord? There is no
-pre-defined action for that, so it needs to be defined and associated with a
-scheme.</p>
-
-<p>The first task is to define a regular expression that matches the kind of
-WikiWords we want to find. The regex in this case is:</p>
-
-<pre>\b[A-Z]+[a-z0-9]+[A-Z][A-Za-z0-9]+\b</pre>
-
-<p>Obvious, no? Well actually this is equivalent to the following
-description: "Starting with a word boundary (the \b) find at least one
-upper case letter, followed by at least one lower case letter or a
-numeric digit, followed by another upper case letter, and then any mix
-of upper case, lower case or numeric until the next word boundary (the
-final \b)". Regular expressions are not very pretty, but they are an
-extremely concise and accurate way of specifying a search pattern.</p>
-
-<p>We also need to tell Linkify what to do with a match to the
-WikiWord. Linkify will automatically append whatever is matched to a
-scheme that is supplied to it, so for the sake of argument let's assume
-we have a {@link android.content.ContentProvider} that matches the
-following content URI:</p>
-
-<pre>content://com.google.android.wikinotes.db.wikinotes/wikinotes/WikiWord</pre>
-
-<p>The WikiWord part will be appended by Linkify when it finds a match, so we
-just need the part before that as our scheme.</p>
-
-<p>Now that we have these two things, we use Linkify to connect them up:</p>
-
-<pre>Pattern wikiWordMatcher = Pattern.compile("\\b[A-Z]+[a-z0-9]+[A-Z][A-Za-z0-9]+\\b");
-String wikiViewURL = "content://com.google.android.wikinotes.db.wikinotes/wikinotes/";
-Linkify.addLinks(noteView, wikiWordMatcher, wikiViewURL);</pre>
-
-<p>Note that the \b's had to be escaped with double backslashes for the Java
-Pattern.compile line.</p>
-
-<p>Linkify can be used multiple times on the same view to add more
-links, so using this after the Default Linkify call means that the
-existing active links will be maintained and the new WikiWords will be
-added. You could define more Linkify actions and keep applying them to
-the same TextView if you wanted to.</p>
-
-<p>Now, if we have a WikiWord in the TextView, let's say
-<code>MyToDoList</code>, Linkify will turn it into an active link with the
-content URI:</p>
-
-<pre>content://com.google.android.wikinotes.db.wikinotes/wikinotes/MyToDoList</pre>
-
-<p>and if you click on it, Android will fire the default intent for that content
-URI.</p>
-
-<p>For this to all work, you will need a ContentProvider that
-understands that Content URI, and you will need a default activity
-capable of doing something with the resulting data. I plan to cover
-these in future blog entries (and soon). In fact, the whole Wiki Note
-Pad application is currently undergoing some clean up and review, and
-will then hopefully be released as a sample application.</p>
diff --git a/docs/html/resources/articles/window-bg-speed.jd b/docs/html/resources/articles/window-bg-speed.jd
deleted file mode 100644
index c5e5e90..0000000
--- a/docs/html/resources/articles/window-bg-speed.jd
+++ /dev/null
@@ -1,127 +0,0 @@
-page.title=Window Backgrounds & UI Speed
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>Some Android applications require to squeeze every bit of performance out of
-the UI toolkit and there are many ways to do so. In this article, you will
-discover how to speed up the drawing and the <em>perceived</em> startup time of
-your activities. Both these techniques rely on a single feature, the window's
-background drawable.</p>
-
-<p>The term <em>window background</em> is a bit misleading, however. When you
-setup your user interface by calling <code>setContentView()</code> on an
-{@link android.app.Activity}, Android adds your views to the <code>Activity</code>'s
-window. The window however does not contain only your views, but a few others
-created for you. The most important one is, in the current implementation used
-on the T-Mobile G1, the <code>DecorView</code>, highlighted in the view
-hierarchy below:</p>
-
-<div style="text-align: center;"><img src="images/window_background_root.png" alt="A typical Android view hierarchy"></div>
-
-<p>The <code>DecorView</code> is the view that actually holds the
-window's background drawable. Calling
-{@link android.view.Window#setBackgroundDrawable(android.graphics.drawable.Drawable) getWindow().setBackgroundDrawable()}
-from your <code>Activity</code> changes the background of the window by changing
-the <code>DecorView</code>'s background drawable. As mentioned before, this
-setup is very specific to the current implementation of Android and can change
-in a future version or even on another device.</p>
-
-<p>If you are using the standard Android themes, a default background drawable
-is set on your activities. The standard theme currently used on the T-Mobile G1
-uses for instance a {@link android.graphics.drawable.ColorDrawable}. For most
-applications, this background drawable works just fine and can be left alone. It
-can however impacts your application's drawing performance. Let's take the
-example of an application that always draws a full screen opaque picture:</p>
-
-<div style="text-align: center;"><img src="images/window_background.png" alt="An opaque user interface doesn't need a window background"></div>
-
-<p>You can see on this screenshot that the window's background is invisible,
-entirely covered by an <code>ImageView</code>. This application is setup to
-redraw as fast as it can and draws at about 44 frames per second, or 22
-milliseconds per frame (<strong>note:</strong> the number of frames per second
-used in this article were obtained on a T-Mobile G1 with my finger on the screen
-so as to reduce the drawing speed which would otherwise be capped at 60 fps.) An
-easy way to make such an application draw faster is to <em>remove</em> the
-background drawable. Since the user interface is entirely opaque, drawing the
-background is simply wasteful. Removing the background improves the performance
-quite nicely:</p>
-
-<div style="text-align: center;"><img src="images/window_background_null.png" alt="Remove the background for faster drawing"></div>
-
-<p>In this new version of the application, the drawing speed went up to 51
-frames per second, or 19 milliseconds per frame. The difference of 3
-milliseconds per is easily explained by the speed of the memory bus on the
-T-Mobile G1: it is exactly the time it takes to move the equivalent of a
-screenful of pixels on the bus. The difference could be even greater if the
-default background was using a more expensive drawable.</p>
-
-<p>Removing the window's background can be achieved very easily by using
-a custom theme. To do so, first create a file called
-<code>res/values/theme.xml</code> containing the following:</p>
-
-<pre class="prettyprint"><resources>
- <style name="Theme.NoBackground" parent="android:Theme">
- <item name="android:windowBackground">@null</item>
- </style>
-</resources></pre>
-
-<p>You then need to apply the theme to your activity by adding the attribute
-<code>android:theme="@style/Theme.NoBackground"</code> to your
-<code><activity /></code> or <code><application /></code> tag. This
-trick comes in very handy for any app that uses a <code>MapView</code>, a
-<code>WebView</code> or any other full screen opaque view.</p>
-
-<p><strong>Opaque views and Android</strong>: this optimization is currently
-necessary because the Android UI toolkit is not smart enough to prevent the
-drawing of views hidden by opaque children. The main reason why this
-optimization was not implemented is simply because there are usually very few
-opaque views in Android applications. This is however something that I
-definitely plan on implementing as soon as possible and I can only apologize for
-not having been able to do this earlier.</p><p>Using a theme to change the
-window's background is also a fantastic way to improve the <em>perceived</em>
-startup performance of some of your activities. This particular trick can only
-be applied to activities that use a custom background, like a texture or a logo.
-The <a href="http://code.google.com/p/shelves">Shelves</a> application is a good
-example:</p>
-
-<div style="text-align: center;"><img src="images/shelves2.png" alt="Textured backgrounds are good candidates for window's background"></div>
-
-<p>If this application simply set the wooden background in the XML layout or in
-<code>onCreate()</code> the user would see the application startup with the
-default theme and its dark background. The wooden texture would only appear
-after the inflation of the content view and the first layout/drawing pass. This
-causes a jarring effect and gives the user the impression that the application
-takes time to load (which can actually be the case.) Instead, the application
-defines the wooden background in a theme, picked up by the system as soon as the
-application starts. The user never sees the default theme and gets the
-impression that the application is up and running right away. To limit the
-memory and disk usage, the background is a tiled texture defined in
-<code>res/drawable/background_shelf.xml</code>:</p>
-
-<pre class="prettyprint"><bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/shelf_panel"
- android:tileMode="repeat" /></pre><p>This drawable is simply referenced by the theme:</p>
-
-<pre class="prettyprint"><resources>
- <style name="Theme.Shelves" parent="android:Theme">
- <item name="android:windowBackground">@drawable/background_shelf</item>
- <item name="android:windowNoTitle">true</item>
- </style>
-</resources></pre>
-
-<p>The same exact trick is used in the <em>Google Maps application that ships
-with the T-Mobile G1. When the application is launched, the user immediately
-sees the loading tiles of <code>MapView</code>. This is only a trick, the theme
-is simply using a tiled background that looks exactly like the loading tiles of
-<code>MapView</code>.</em></p>
-
-<p>Sometimes the best tricks are also the simplest, so the next time you create
-an activity with an opaque UI or a custom background, remember to change the
-window's background.</p>
-
-<p><a href="http://progx.org/users/Gfx/android/WindowBackground">Download the source code of the first example</a>.</p>
-
-<p><a href="http://code.google.com/p/shelves/">Download the source code of Shelves</a>.</p>
-
-
diff --git a/docs/html/resources/articles/zipalign.jd b/docs/html/resources/articles/zipalign.jd
deleted file mode 100644
index d3c68a6..0000000
--- a/docs/html/resources/articles/zipalign.jd
+++ /dev/null
@@ -1,100 +0,0 @@
-page.title=Zipalign: an Easy Optimization
-parent.title=Articles
-parent.link=../browser.html?tag=article
-@jd:body
-
-<p>The Android SDK includes a tool called <a
-href="{@docRoot}guide/developing/tools/zipalign.html"><code>zipalign</code></a>
-that optimizes the way an application is packaged. Running zipalign against your
-application enables Android to interact it more efficiently at run time and thus
-has the potential to make it and the overall system run faster. We strongly
-encourage you to use <code>zipalign</code> on both new and already published
-applications and to make the optimized version available — even if your
-application targets a previous version of Android. This article describes how
-<code>zipalign</code> helps performance and how to use it to optimize your
-app.</p>
-
-<p>In Android, data files stored in each application's apk are accessed by
-multiple processes: the installer reads the manifest to handle the
-permissions associated with that application; the Home application
-reads resources to get the application's name and icon; the system
-server reads resources for a variety of reasons (e.g. to display that
-application's notifications); and last but not least, the resource
-files are obviously used by the application itself.</p>
-
-<p>The resource-handling code in Android can efficiently access resources when
-they're aligned on 4-byte boundaries by memory-mapping them. But for resources
-that are not aligned (that is, when <code>zipalign</code> hasn't been run on an
-apk), it has to fall back to explicitly reading them — which is slower and
-consumes additional memory.</p>
-
-<p>For an application developer, this fallback mechanism is very
-convenient. It provides a lot of flexibility by allowing for several
-different development methods, including those that don't include
-aligning resources as part of their normal flow.</p>
-
-<p>Unfortunately, for users the situation is reversed — reading resources
-from unaligned apks is slow and takes a lot of memory. In the best case, the
-only visible result is that both the Home application and the unaligned
-application launch slower than they otherwise should. In the worst case,
-installing several applications with unaligned resources increases memory
-pressure, thus causing the system to thrash around by having to constantly start
-and kill processes. The user ends up with a slow device with a poor battery
-life.</p>
-
-<p>Luckily, it's very easy for you to align the resources in your application:</p>
-
-<ul>
-<li>Using ADT:</li>
-<li style="list-style-type: none; list-style-image: none; list-style-position: outside;">
-<ul>
-<li>The ADT plugin for Eclipse (starting from version 0.9.3) will automatically
-align release application packages if the export wizard is used to create them.
-To use the wizard, right click the project and choose "Android Tools" >
-"Export Signed Application Package..." It can also be accessed from the first
-page of the <code>AndroidManifest.xml</code> editor.</li>
-</ul>
-</li>
-<li>Using Ant:</li><li style="list-style-type: none; list-style-image: none; list-style-position: outside;">
-
-<ul>
-<li>The <em>Ant</em> build script (starting from Android 1.6) can align
-application packages. Targets for older versions of the Android platform are not
-aligned by the <em>Ant</em> build script and need to be manually aligned.</li>
-<li>Starting from the Android 1.6 SDK, Ant aligns and signs packages automatically,
-when building in debug mode.</li>
-<li>In release mode, Ant aligns packages only if it has enough
-information to sign the packages, since aligning has to happen after signing. In
-order to be able to sign packages, and therefore to align them, <em>Ant</em>
-needs to know the location of the keystore and the name of the key in
-<code>ant.properties</code>. The name of the properties are
-<code>key.store</code> and <code>key.alias</code> respectively. If those
-properties are present, the signing tool will prompt to enter the store/key
-passwords during the build, and the script will sign and then align the apk
-file. If the properties are missing, the release package will not be signed, and
-therefore will not get aligned either.</li>
-</ul>
-</li>
-<li>Manually:</li>
-<li style="list-style-type: none; list-style-image: none; list-style-position: outside;">
-<ul>
-<li>In order to manually align a package, <code>zipalign</code>
-is in the <code>tools/</code> folder of Android 1.6 and later SDKs. You can use
-it to align application packages targeting any version of Android. You should run
-it only after signing the apk file, using the following command:
-<br><code>zipalign -v 4 source.apk destination.apk</code></li>
-</ul>
-</li>
-<li>Verifying alignment:</li>
-<li style="list-style-type: none; list-style-image: none; list-style-position: outside;">
-<ul>
-<li>The following command verifies that a package is aligned:<br><code>zipalign -c -v 4 application.apk</code>
-</li>
-</ul>
-</li>
-</ul>
-
-<p>We encourage you manually run <code>zipalign</code>
-on your currently published applications and to make the newly aligned
-versions available to users. Also, don't forget to align any new
-applications going forward!</p>
diff --git a/docs/html/resources/browser.jd b/docs/html/resources/browser.jd
deleted file mode 100644
index 8a08769..0000000
--- a/docs/html/resources/browser.jd
+++ /dev/null
@@ -1,49 +0,0 @@
-page.title=Technical Resources
-@jd:body
-
-<style type="text/css">
- {@literal @import} "{@docRoot}assets/android-developer-resource-browser.css";
-</style>
-
-<script type="text/javascript" src="{@docRoot}assets/android-developer-resource-browser.js"></script>
-<script type="text/javascript" src="{@docRoot}assets/microtemplate.js"></script>
-
-<div>
- <p style="display: none; float: right">Filter: <input id="resource-browser-keyword-filter"/></p>
- <p id="resource-browser-search-params">Showing all technical resources:</p>
-</div>
-
-<noscript>
- <p class="note"><strong>Error:</strong>
- You must have JavaScript enabled to view this page. Resources are also
- available offline in the SDK.
- </p>
-</noscript>
-
-<div id="resource-browser-results">
- <div class="no-results">No results.</div>
-</div>
-
-<script type="text/html" id="tmpl_resource_browser_result">
-<div class="result">
- <h3>
- <% if ('external' in tagsHash) { %><strong>External: </strong> <% } %>
- <a href="<%= path %>"><%= title.en %></a>
- <% if ('new' in tagsHash) { %><span class="new">new!</span> <% } %>
- </h3>
- <p class="resource-meta"><%
- var __g = ['', ''];
- if ('article' in tagsHash) {
- __g = ['Article', 'about'];
- } else if ('tutorial' in tagsHash) {
- __g = ['Tutorial', 'on'];
- } else if ('sample' in tagsHash) {
- __g = ['Sample', 'for'];
- } else if ('video' in tagsHash) {
- __g = ['Video', 'about'];
- }
- %>
- <%= __g[0] %><% if (topicsHtml) { %> <%= __g[1] %><% } %> <%= topicsHtml %></p>
- <p><%= description.en %></p>
-</div>
-</script>
diff --git a/docs/html/resources/community-groups.jd b/docs/html/resources/community-groups.jd
deleted file mode 100644
index 6bd347c..0000000
--- a/docs/html/resources/community-groups.jd
+++ /dev/null
@@ -1,120 +0,0 @@
-community=true
-page.title=Developer Forums
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#StackOverflow">Android on Stack Overflow</a></li>
- <li><a href="#MailingLists">Mailing lists</a>
- <ol>
- <li><a href="#BeforeYouPost">Before you post</a></li>
- <li><a href="#UsingEmail">Using email with the mailing lists</a></li>
- <li><a href="#ApplicationDeveloperLists">Application developer mailing lists</a></li>
- </ol></li>
- <li><a href="#PlayHelp">Google Play Help Forum</a></li>
- </ol>
-
-</div>
-</div>
-
-<p>Welcome to the Android developers community! We're glad you're here and invite you to participate in discussions with other Android application developers on topics that interest you.</p>
-
-<p>The lists on this page are primarily for discussion about Android application development. If you are seeking discussion about Android source code (not application development), then please refer to the <a href="http://source.android.com/community">Open Source Project Mailing lists</a>.</p>
-
-<h2 id="StackOverflow">Stack Overflow</h2>
-
-<p><a href="http://stackoverflow.com">Stack Overflow</a> is a collaboratively edited question and answer site for programmers. It's a great place to ask technical questions about developing and maintaining Android applications. The site is especially useful for asking questions with definite answers, but can also be used for discussing best practices.</p>
-
-<p>On the site, questions and answers relating to Android use the <a href="http://stackoverflow.com/questions/tagged/android">'android' tag</a>. You can look for Android topics by adding '<code>[android]</code>' to your search query, or by visiting the tag page at:</p>
-
-<p style="margin-left: 2em"><a href="http://stackoverflow.com/questions/tagged/android">http://stackoverflow.com/questions/tagged/android</a></p>
-
-<p>If you want to ask a question on Stack Overflow, you can use <a href="http://stackoverflow.com/questions/ask">this form</a>. Before submitting the form, make sure to add the 'android' tag so that other Android developers will be able to find your question. As always, before submitting a new question, take a look at the existing topics to see whether another developer has already asked or answered the question.</p>
-
-<p>If you are getting started with Android development, Stack Overflow may be a great location to ask questions about general Java programming or setting up the Eclipse development environment. Simply tag your questions with the <a href="http://stackoverflow.com/questions/tagged/java">Java</a> or <a href="http://stackoverflow.com/questions/tagged/eclipse">Eclipse</a> tags in these cases.</p>
-
-
-<h2 id="MailingLists">Mailing lists</h2>
-
-<p>There are a number of mailing lists, powered by <a href="http://groups.google.com">Google Groups</a>, available for discussing Android application development.</p>
-
-
-<h3 id="BeforeYouPost">Before you post</h3>
-<p>Before writing a post, please try the following:</p>
-
-<ol>
-
-<li>Look through the support information available in the 'More' section of this tab. You may find the answer to your question in the <a href="{@docRoot}resources/faq/commontasks.html">Common Tasks</a>, <a href="{@docRoot}resources/faq/troubleshooting.html">Troubleshooting Tips</a>, or <a href="{@docRoot}resources/faq/index.html">FAQs</a> sections.</li>
-<li>Type in keywords of your questions in the main Android site's search bar (such as the one above). This search encompasses all previous discussions, across all groups, as well as the full contents of the site, documentation, and blogs. Chances are good that somebody has run into the same issue before.</li>
- </li>
-</ol>
-
-<p>If you can't find your answer, then we encourage you to address the community.
-As you write your post, please do the following:
-<ol>
-<li><strong>Read
-the <a href="http://source.android.com/community/groups-charter.html">mailing list charter</a></strong> that covers the community guidelines.
-</li>
-<li><strong>Select the most appropriate mailing list for your question</strong>. There are several different lists for
-developers, described below.</li>
-<li>
- <strong>Be very clear</strong> about your question
-in the subject -- it helps everyone, both those trying to answer your
-question as well as those who may be looking for information in the
-future.</li>
-<li><strong>Give plenty of details</strong> in your post to
-help others understand your problem. Code or log snippets, as well as
-pointers to screenshots, may also be helpful. For a great guide to
-phrasing your questions, read <a href="http://www.catb.org/%7Eesr/faqs/smart-questions.html">How To Ask Questions The Smart Way</a>.
- </li>
-</ol>
-
-
-<h3 id="UsingEmail">Using email with the mailing lists</h3>
-<p>Instead of using the <a href="http://groups.google.com/">Google Groups</a> site, you can use your email client of choice to participate in the mailing lists.</p>
-<p>To subscribe to a group without using the Google Groups site, use the link under "subscribe via email" in the lists above.</p>
-<p>To set up how you receive mailing list postings by email:</p>
-
-<ol><li>Sign into the group via the Google Groups site. For example, for the android-framework group you would visit <a href="http://groups.google.com/group/android-framework">http://groups.google.com/group/android-framework</a>.</li>
-<li>Click "Edit my membership" on the right side.</li>
-<li>Under "How do you want to read this group?" select one of the email options.</li>
-</ol>
-
-
-<h3 id="ApplicationDeveloperLists">Application developer mailing lists</h3>
-<ul>
-<li><strong><a href="http://groups.google.com/group/android-developers">android-developers</a></strong>
-(<a href="http://groups.google.com/group/android-developers/subscribe">subscribe</a>)<br>
-You're now an experienced Android application developer. You've grasped the basics of Android app development, you're comfortable using the SDK, now you want to move to advanced topics. Get help here with troubleshooting applications, advice on implementation, and strategies for improving your application's performance and user experience. This is the not the right place to discuss user issues (use android-discuss for that) or beginner questions with the Android SDK (use android-beginners for that).
-</li>
-
-<li><strong><a href="http://groups.google.com/group/android-discuss">android-discuss</a></strong>
-(<a href="http://groups.google.com/group/android-discuss/subscribe">subscribe</a>)<br>
-The "water cooler" of Android discussion. You can discuss just about anything Android-related here, ideas for the Android platform, announcements about your applications, discussions about Android devices, community resources... As long as your discussion is related to Android, it's on-topic here. However, if you have a discussion here that could belong on another list, you are probably not reaching all of your target audience here and may want to consider shifting to a more targeted list.
-</li>
-
-<li><strong><a href="http://groups.google.com/group/android-ndk">android-ndk</a></strong>
-(<a href="http://groups.google.com/group/android-ndk/subscribe">subscribe</a>)<br>
-A place for discussing the Android NDK and topics related to using native code in Android applications.
-</li>
-
-<li><strong><a href="http://groups.google.com/group/android-security-discuss">android-security-discuss</a></strong>
-(<a href="http://groups.google.com/group/android-security-discuss/subscribe">subscribe</a>)<br>
-A place for open discussion on secure development, emerging security concerns, and best practices for and by android developers. Please don't disclose vulnerabilities directly on this list, you'd be putting all Android users at risk.
-</li>
-
-<li><strong><a href="http://groups.google.com/group/android-security-announce">android-security-announce</a></strong>
-(<a href="http://groups.google.com/group/android-security-announce/subscribe">subscribe</a>)<br>
-A low-volume group for security-related announcements by the Android Security Team.
-</li>
-</ul>
-
-
-<h2 id="PlayHelp">Google Play Help Forum</h2>
-
-<p>The <a href="http://support.google.com/googleplay">Google Play Help Forum</a> is a web-based discussion forum where you can ask questions or report issues relating to Google Play.</p>
-
-<p style="margin-left: 2em"><a href="http://support.google.com/googleplay">http://support.google.com/googleplay</a></p>
diff --git a/docs/html/resources/community-more.jd b/docs/html/resources/community-more.jd
deleted file mode 100644
index 3089d45..0000000
--- a/docs/html/resources/community-more.jd
+++ /dev/null
@@ -1,71 +0,0 @@
-community=true
-page.title=IRC, G+, Twitter
-@jd:body
-
-<p>In addition to the <a href="community-groups.html">Android developer forums</a>, you can participate in the Android developer community through IRC and you can follow us on Twitter. </p>
-
-<h3 id="irc">IRC</h3>
-
-<p>Several IRC channels are available for discussions about developing Android applications.</p>
-
-<table>
-<tr>
- <th>Channel</th><th>Host</th><th>Description</th>
-</tr>
-<tr>
- <td>#android</td>
- <td>irc.freenode.net</td>
- <td>General discussion about Android (and Android development).</td>
-</tr>
-<tr>
- <td>#android-dev</td>
- <td>irc.freenode.net</td>
- <td>Discussion focused on developing Android apps.</td>
-</tr>
-</table>
-
-<p>If you haven't used IRC before, check <a
-href="http://en.wikipedia.org/wiki/List_of_IRC_clients">http://en.wikipedia.org/wiki/
-List_of_IRC_clients »</a> for a helpful list of IRC clients. Alternatively, you could also use
-this <a href="http://webchat.freenode.net/?channels=android-dev">web interface »</a>, which
-does not require any installation, to join discussions on the Android IRC channels. </p>
-
-<p>Here are some tips for using IRC:</h4>
-
-<ul>
-<li>Set your nickname before you join the channel.</li>
-<li>Registering your nickname prevents others from using your nickname or impersonating you later:
-<pre class="no-pretty-print" style="width:50%;">/nick <yournickname>
-/msg nickserv register <password> <email></pre>
-<p>Afterwards, when you connect, you'll need to supply a password:</p>
-<pre class="no-pretty-print" style="width:50%;">/connect irc.freenode.net
-/nick <yournickname>
-/msg nickserv identify <password>
-/join #android-dev</pre>
-</li>
-</ul>
-
-
-<h3 id="gplus">Google+</h3>
-<p>We use a Google+ page to host Hangouts for developers, talk about the latest
-releases, development and design tips, and much more.</p>
-
-<div style='margin-top:1em'><g:plus href='https://plus.google.com/108967384991768947849'
-size='badge'></g:plus></div>
-
-
-<h3 id="twitter">Twitter</h3>
-<p>You can follow us on Twitter at this account:</p>
-
-<p style="margin-left:2em;"><a href="http://twitter.com/androiddev">http://twitter.com/androiddev</a></p>
-
-<script type="text/javascript" src="https://plus.google.com/108967384991768947849"
-rel="publisher"></script>
-<script type="text/javascript">
-window.___gcfg = {lang: 'en'};
-(function()
-{var po = document.createElement("script");
-po.type = "text/javascript"; po.async = true;po.src = "https://apis.google.com/js/plusone.js";
-var s = document.getElementsByTagName("script")[0];
-s.parentNode.insertBefore(po, s);
-})();</script>
\ No newline at end of file
diff --git a/docs/html/resources/dashboard/opengl.jd b/docs/html/resources/dashboard/opengl.jd
deleted file mode 100644
index 4c55522..0000000
--- a/docs/html/resources/dashboard/opengl.jd
+++ /dev/null
@@ -1,79 +0,0 @@
-page.title=OpenGL ES Versions
-@jd:body
-
-<style type="text/css">
-
-div.dashboard-panel {
- max-width:1000px;
- margin:0 0 2em 0;
- padding:20px 20px 0 20px;
- border:1px solid #d3ecf5;
- border-radius:7px;
- -moz-border-radius:7px;
- -webkit-border-radius:7px;
- background-color: #DAF3FC;
- box-shadow:2px 3px 1px #eee;
- -moz-box-shadow:2px 3px 1px #eee;
- -webkit-box-shadow:2px 3px 1px #eee;
- overflow:hidden;
-}
-#jd-content div.dashboard-panel img {
- margin:0 20px 20px 0;
- padding:0;
- border:1px solid #ccc;
- float:left;
-}
-#jd-content div.dashboard-panel table {
- margin:0 0 20px 0;
- float:left;
- background-color:#fff;
-}
-div.dashboard-panel p {
- clear:left;
-}
-div.dashboard-panel th {
- white-space:nowrap;
-}
-</style>
-
-<p>This page provides data about the relative number of active devices that support a particular
-version of OpenGL ES. Note that support for one particular version of OpenGL ES also implies
-support for any lower version (for example, support for version 2.0 also implies support for
-1.1).</p>
-
-<p>To declare which version of OpenGL ES your application requires, you should use the {@code
-android:glEsVersion} attribute of the <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
-element. You can also use the <a
-href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html">{@code
-<supports-gl-texture>}</a> element to declare the GL compression formats that your application
-uses.</p>
-
-<p class="note"><strong>Note:</strong> This data is based on the number
-of Android devices that have accessed Google Play within a 7-day period
-ending on the data collection date noted below.</p>
-
-
-<div class="dashboard-panel">
-
-<img alt="" width="400" height="250"
-src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=GL%201.1%20only|GL%202.0%20%26%201.1&chd=t%3A11.9,88.1" />
-
-<table>
-<tr>
-<th scope="col">OpenGL ES Version</th>
-<th scope="col">Distribution</th>
-</tr>
-<tr>
-<td>1.1 only</th>
-<td>11.9%</td>
-</tr>
-<tr>
-<td>2.0 & 1.1</th>
-<td>88.1%</td>
-</tr>
-</table>
-
-<p><em>Data collected during a 7-day period ending on April 2, 2012</em></p>
-</div>
-
diff --git a/docs/html/resources/dashboard/platform-versions.jd b/docs/html/resources/dashboard/platform-versions.jd
deleted file mode 100644
index 2cbbe99..0000000
--- a/docs/html/resources/dashboard/platform-versions.jd
+++ /dev/null
@@ -1,117 +0,0 @@
-page.title=Platform Versions
-@jd:body
-
-<style type="text/css">
-
-div.dashboard-panel {
- max-width:1000px;
- margin:0 0 2em 0;
- padding:20px 20px 0 20px;
- border:1px solid #d3ecf5;
- border-radius:7px;
- -moz-border-radius:7px;
- -webkit-border-radius:7px;
- background-color: #DAF3FC;
- box-shadow:2px 3px 1px #eee;
- -moz-box-shadow:2px 3px 1px #eee;
- -webkit-box-shadow:2px 3px 1px #eee;
- overflow:hidden;
-}
-#jd-content div.dashboard-panel img {
- margin:0 20px 20px 0;
- padding:0;
- border:1px solid #ccc;
- float:left;
-}
-#jd-content div.dashboard-panel table {
- margin:0 0 20px 0;
- float:left;
- background-color:#fff;
-}
-div.dashboard-panel p {
- clear:left;
-}
-div.dashboard-panel th {
- white-space:nowrap;
-}
-</style>
-
-<p>This page provides data about the relative number of active devices
-running a given version of the Android platform. This can help you
-understand the landscape of device distribution and decide how to prioritize
-the development of your application features for the devices currently in
-the hands of users. For information about how to target your application to devices based on
-platform version, see <a href="{@docRoot}guide/appendix/api-levels.html">API Levels</a>.</p>
-
-
-<h3 id="Current">Current Distribution</h3>
-
-<p>The following pie chart and table is based on the number of Android devices that have accessed
-Google Play within a 14-day period ending on the data collection date noted below.</p>
-
-<div class="dashboard-panel">
-
-<img alt="" height="250" width="470"
-src="http://chart.apis.google.com/chart?&cht=p&chs=460x250&chd=t:0.3,0.7,6.0,23.1,0.5,63.2,0.1,1.0,2.2,0.5,2.4&chl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3|Android%202.3.3|Android%203.0|Android%203.1|Android%203.2|Android%204.0|Android%204.0.3&chco=c4df9b,6fad0c" />
-
-<table>
-<tr>
- <th>Platform</th>
- <th>Codename</th>
- <th>API Level</th>
- <th>Distribution</th>
-</tr>
-<tr><td><a href="{@docRoot}sdk/android-1.5.html">Android 1.5</a></td><td>Cupcake</td> <td>3</td><td>0.3%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-1.6.html">Android 1.6</a></td><td>Donut</td> <td>4</td><td>0.7%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-2.1.html">Android 2.1</a></td><td>Eclair</td> <td>7</td><td>6.0%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-2.2.html">Android 2.2</a></td><td>Froyo</td> <td>8</td><td>23.1%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-2.3.html">Android 2.3 -<br/>
- Android 2.3.2</a></td><td rowspan="2">Gingerbread</td> <td>9</td><td>0.5%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-2.3.3.html">Android 2.3.3 -<br/>
- Android 2.3.7</a></td><!-- Gingerbread --> <td>10</td><td>63.2%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-3.0.html">Android 3.0</a></td>
- <td rowspan="3">Honeycomb</td> <td>11</td><td>0.1%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-3.1.html">Android 3.1</a></td><!-- Honeycomb --><td>12</td><td>1.0%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-3.2.html">Android 3.2</a></td><!-- Honeycomb --><td>13</td><td>2.2%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-4.0.html">Android 4.0 -<br/>
- Android 4.0.2</a></td>
- <td rowspan="2">Ice Cream Sandwich</td><td>14</td><td>0.5%</td></tr>
-<tr><td><a href="{@docRoot}sdk/android-4.0.3.html">Android 4.0.3</a></td><!-- ICS --><td>15</td><td>2.4%</td></tr>
-</table>
-
-<p><em>Data collected during a 14-day period ending on April 2, 2012</em></p>
-<!--
-<p style="font-size:.9em">* <em>Other: 0.1% of devices running obsolete versions</em></p>
--->
-</div><!-- end dashboard-panel -->
-
-
-<h3 id="Historical">Historical Distribution</h3>
-
-<p>The following stacked line graph provides a history of the relative number of
-active Android devices running different versions of the Android platform. It also provides a
-valuable perspective of how many devices your application is compatible with, based on the
-platform version.</p>
-
-<p>Notice that the platform versions are stacked on top of each other with the oldest active
-version at the top. This format indicates the total percent of active devices that are compatible
-with a given version of Android. For example, if you develop your application for
-the version that is at the very top of the chart, then your application is
-compatible with 100% of active devices (and all future versions), because all Android APIs are
-forward compatible. Or, if you develop your application for a version lower on the chart,
-then it is currently compatible with the percentage of devices indicated on the y-axis, where the
-line for that version meets the y-axis on the right.</p>
-
-<p>Each dataset in the timeline is based on the number of Android devices that accessed
-Google Play within a 14-day period ending on the date indicated on the x-axis.</p>
-
-<div class="dashboard-panel">
-
-<img alt="" height="250" width="660" style="padding:5px;background:#fff"
-src="http://chart.apis.google.com/chart?&cht=lc&chs=660x250&chxt=x,x,y,r&chxr=0,0,12|1,0,12|2,0,100|3,0,100&chxl=0%3A%7C10/01%7C10/15%7C11/01%7C11/15%7C12/01%7C12/15%7C01/01%7C01/15%7C02/01%7C02/15%7C03/01%7C03/15%7C04/01%7C1%3A%7C2011%7C%7C%7C%7C%7C%7C2012%7C%7C%7C%7C%7C%7C2012%7C2%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25%7C3%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25&chxp=0,0,1,2,3,4,5,6,7,8,9,10,11,12&chxtc=0,5&chd=t:97.7,97.6,97.5,99.4,99.4,99.2,98.9,98.8,99.2,98.9,98.9,99.0,98.8|96.6,96.6,96.5,98.6,98.6,98.5,98.3,98.2,98.6,98.4,98.4,98.6,98.5|95.1,95.4,95.2,97.2,97.3,97.3,97.2,97.2,97.6,97.5,97.6,97.8,97.8|83.3,84.4,84.6,87.0,87.7,88.1,88.7,89.2,89.9,90.3,90.8,91.4,91.8|37.8,40.8,43.5,48.4,52.4,55.2,58.2,60.1,62.0,63.7,65.2,66.8,68.6|0.0,0.0,0.0,2.0,2.3,2.6,3.5,3.6,4.0,4.1,4.3,4.6,5.5|0.0,0.0,0.0,1.0,1.2,1.3,2.0,2.2,2.6,3.0,3.2,3.5,4.5|0.0,0.0,0.0,0.0,0.0,0.0,0.3,0.4,0.7,0.8,1.1,1.3,2.3&chm=b,c3df9b,0,1,0|b,b8dc82,1,2,0|tAndroid%202.1,608920,2,0,15,,t::-5|b,addb67,2,3,0|tAndroid%202.2,517617,3,0,15,,t::-5|b,a3db4b,3,4,0|tAndroid%202.3.3,426210,4,0,15,,t::-5|b,98dc2e,4,5,0|b,8cd41b,5,6,0|b,7ec113,6,7,0|B,6fad0c,7,8,0&chg=7,25&chdl=Android%201.5|Android%201.6|Android%202.1|Android%202.2|Android%202.3.3|Android%203.1|Android%203.2|Android%204.0.3&chco=add274,a2d15a,97d13e,8bcb28,7dba1e,6ea715,5f920e,507d08" />
-
-<p><em>Last historical dataset collected during a 14-day period ending on April 2, 2012</em></p>
-
-
-</div><!-- end dashboard-panel -->
-
diff --git a/docs/html/resources/dashboard/screens.jd b/docs/html/resources/dashboard/screens.jd
deleted file mode 100644
index e5c79a1..0000000
--- a/docs/html/resources/dashboard/screens.jd
+++ /dev/null
@@ -1,101 +0,0 @@
-page.title=Screen Sizes and Densities
-@jd:body
-
-<style type="text/css">
-
-div.dashboard-panel {
- max-width:1000px;
- margin:0 0 2em 0;
- padding:20px 20px 0 20px;
- border:1px solid #d3ecf5;
- border-radius:7px;
- -moz-border-radius:7px;
- -webkit-border-radius:7px;
- background-color: #DAF3FC;
- box-shadow:2px 3px 1px #eee;
- -moz-box-shadow:2px 3px 1px #eee;
- -webkit-box-shadow:2px 3px 1px #eee;
- overflow:hidden;
-}
-#jd-content div.dashboard-panel img {
- margin:0 20px 20px 0;
- padding:0;
- border:1px solid #ccc;
- float:left;
-}
-#jd-content div.dashboard-panel table {
- margin:0 0 20px 0;
- float:left;
- background-color:#fff;
-}
-div.dashboard-panel p {
- clear:left;
-}
-div.dashboard-panel th {
- white-space:nowrap;
-}
-</style>
-
-<p> This page provides data about the relative number of active devices that have a particular
-screen configuration, defined by a combination of screen size and density. To simplify the way that
-you design your user interfaces for different screen configurations, Android divides the range of
-actual screen sizes and densities into:</p>
-
-<ul>
-<li>A set of four generalized <strong>sizes</strong>: <em>small</em>, <em>normal</em>,
-<em>large</em>, and <em>xlarge</em></em></li>
-<li>A set of four generalized <strong>densities</strong>: <em>ldpi</em> (low), <em>mdpi</em>
-(medium), <em>hdpi</em> (high), and <em>xhdpi</em> (extra high)</li>
-</ul>
-
-<p>For information about how you can support multiple screen configurations in your
-application, see <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
-
-<p class="note"><strong>Note:</strong> This data is based on the number
-of Android devices that have accessed Google Play within a 7-day period
-ending on the data collection date noted below.</p>
-
-
-<div class="dashboard-panel">
-
-<img alt="" width="400" height="250"
-src="http://chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b,6fad0c&chl=Xlarge%20/%20mdpi|Large%20/%20ldpi|Large%20/%20mdpi|Normal%20/%20hdpi|Normal%20/%20ldpi|Normal%20/%20mdpi|Normal%20/%20xhdpi|Small%20/%20hdpi|Small%20/%20ldpi&chd=t%3A5.8,0.2,2.3,64.6,0.7,19.6,2.4,2.5,1.9" />
-
-<table>
-<tr>
-<th></th>
-<th scope="col">ldpi</th>
-<th scope="col">mdpi</th>
-<th scope="col">hdpi</th>
-<th scope="col">xhdpi</th>
-</tr>
-<tr><th scope="row">small</th>
-<td>1.9%</td> <!-- small/ldpi -->
-<td></td> <!-- small/mdpi -->
-<td>2.5%</td> <!-- small/hdpi -->
-<td></td> <!-- small/xhdpi -->
-</tr>
-<tr><th scope="row">normal</th>
-<td>0.7%</td> <!-- normal/ldpi -->
-<td>19.6%</td> <!-- normal/mdpi -->
-<td>64.6%</td> <!-- normal/hdpi -->
-<td>2.4%</td> <!-- normal/xhdpi -->
-</tr>
-<tr><th scope="row">large</th>
-<td>0.2%</td> <!-- large/ldpi -->
-<td>2.3%</td> <!-- large/mdpi -->
-<td></td> <!-- large/hdpi -->
-<td></td> <!-- large/xhdpi -->
-</tr>
-<tr><th scope="row">xlarge</th>
-<td></td> <!-- xlarge/ldpi -->
-<td>5.8%</td> <!-- xlarge/mdpi -->
-<td></td> <!-- xlarge/hdpi -->
-<td></td> <!-- xlarge/xhdpi -->
-</tr>
-</table>
-
-<p><em>Data collected during a 7-day period ending on April 2, 2012</em></p>
-</div>
-
diff --git a/docs/html/resources/samples/images/ActionBarCompat1.png b/docs/html/resources/images/ActionBarCompat1.png
similarity index 100%
rename from docs/html/resources/samples/images/ActionBarCompat1.png
rename to docs/html/resources/images/ActionBarCompat1.png
Binary files differ
diff --git a/docs/html/resources/samples/images/ActionBarCompat2.png b/docs/html/resources/images/ActionBarCompat2.png
similarity index 100%
rename from docs/html/resources/samples/images/ActionBarCompat2.png
rename to docs/html/resources/images/ActionBarCompat2.png
Binary files differ
diff --git a/docs/html/resources/samples/images/BluetoothChat1.png b/docs/html/resources/images/BluetoothChat1.png
similarity index 100%
rename from docs/html/resources/samples/images/BluetoothChat1.png
rename to docs/html/resources/images/BluetoothChat1.png
Binary files differ
diff --git a/docs/html/resources/samples/images/BluetoothChat2.png b/docs/html/resources/images/BluetoothChat2.png
similarity index 100%
rename from docs/html/resources/samples/images/BluetoothChat2.png
rename to docs/html/resources/images/BluetoothChat2.png
Binary files differ
diff --git a/docs/html/resources/samples/images/BluetoothHDP.png b/docs/html/resources/images/BluetoothHDP.png
similarity index 100%
rename from docs/html/resources/samples/images/BluetoothHDP.png
rename to docs/html/resources/images/BluetoothHDP.png
Binary files differ
diff --git a/docs/html/resources/samples/images/BusinessCard1.png b/docs/html/resources/images/BusinessCard1.png
similarity index 100%
rename from docs/html/resources/samples/images/BusinessCard1.png
rename to docs/html/resources/images/BusinessCard1.png
Binary files differ
diff --git a/docs/html/resources/samples/images/BusinessCard2.png b/docs/html/resources/images/BusinessCard2.png
similarity index 100%
rename from docs/html/resources/samples/images/BusinessCard2.png
rename to docs/html/resources/images/BusinessCard2.png
Binary files differ
diff --git a/docs/html/resources/samples/images/ContactManager1.png b/docs/html/resources/images/ContactManager1.png
similarity index 100%
rename from docs/html/resources/samples/images/ContactManager1.png
rename to docs/html/resources/images/ContactManager1.png
Binary files differ
diff --git a/docs/html/resources/samples/images/ContactManager2.png b/docs/html/resources/images/ContactManager2.png
similarity index 100%
rename from docs/html/resources/samples/images/ContactManager2.png
rename to docs/html/resources/images/ContactManager2.png
Binary files differ
diff --git a/docs/html/resources/samples/images/CubeLiveWallpaper1.png b/docs/html/resources/images/CubeLiveWallpaper1.png
similarity index 100%
rename from docs/html/resources/samples/images/CubeLiveWallpaper1.png
rename to docs/html/resources/images/CubeLiveWallpaper1.png
Binary files differ
diff --git a/docs/html/resources/samples/images/CubeLiveWallpaper3.png b/docs/html/resources/images/CubeLiveWallpaper3.png
similarity index 100%
rename from docs/html/resources/samples/images/CubeLiveWallpaper3.png
rename to docs/html/resources/images/CubeLiveWallpaper3.png
Binary files differ
diff --git a/docs/html/resources/samples/images/HomeSample.png b/docs/html/resources/images/HomeSample.png
similarity index 100%
rename from docs/html/resources/samples/images/HomeSample.png
rename to docs/html/resources/images/HomeSample.png
Binary files differ
diff --git a/docs/html/resources/samples/images/JetBoy.png b/docs/html/resources/images/JetBoy.png
similarity index 100%
rename from docs/html/resources/samples/images/JetBoy.png
rename to docs/html/resources/images/JetBoy.png
Binary files differ
diff --git a/docs/html/resources/samples/images/KeyChainDemo1.png b/docs/html/resources/images/KeyChainDemo1.png
similarity index 100%
rename from docs/html/resources/samples/images/KeyChainDemo1.png
rename to docs/html/resources/images/KeyChainDemo1.png
Binary files differ
diff --git a/docs/html/resources/samples/images/KeyChainDemo2.png b/docs/html/resources/images/KeyChainDemo2.png
similarity index 100%
rename from docs/html/resources/samples/images/KeyChainDemo2.png
rename to docs/html/resources/images/KeyChainDemo2.png
Binary files differ
diff --git a/docs/html/resources/samples/images/KeyChainDemo3.png b/docs/html/resources/images/KeyChainDemo3.png
similarity index 100%
rename from docs/html/resources/samples/images/KeyChainDemo3.png
rename to docs/html/resources/images/KeyChainDemo3.png
Binary files differ
diff --git a/docs/html/resources/samples/images/KeyChainDemo4.png b/docs/html/resources/images/KeyChainDemo4.png
similarity index 100%
rename from docs/html/resources/samples/images/KeyChainDemo4.png
rename to docs/html/resources/images/KeyChainDemo4.png
Binary files differ
diff --git a/docs/html/resources/samples/images/MultiResolution.png b/docs/html/resources/images/MultiResolution.png
similarity index 100%
rename from docs/html/resources/samples/images/MultiResolution.png
rename to docs/html/resources/images/MultiResolution.png
Binary files differ
diff --git a/docs/html/resources/samples/images/NewsReader.png b/docs/html/resources/images/NewsReader.png
similarity index 100%
rename from docs/html/resources/samples/images/NewsReader.png
rename to docs/html/resources/images/NewsReader.png
Binary files differ
diff --git a/docs/html/resources/samples/images/NfcDemo.png b/docs/html/resources/images/NfcDemo.png
similarity index 100%
rename from docs/html/resources/samples/images/NfcDemo.png
rename to docs/html/resources/images/NfcDemo.png
Binary files differ
diff --git a/docs/html/resources/samples/images/SampleSyncAdapter1.png b/docs/html/resources/images/SampleSyncAdapter1.png
similarity index 100%
rename from docs/html/resources/samples/images/SampleSyncAdapter1.png
rename to docs/html/resources/images/SampleSyncAdapter1.png
Binary files differ
diff --git a/docs/html/resources/samples/images/SampleSyncAdapter2.png b/docs/html/resources/images/SampleSyncAdapter2.png
similarity index 100%
rename from docs/html/resources/samples/images/SampleSyncAdapter2.png
rename to docs/html/resources/images/SampleSyncAdapter2.png
Binary files differ
diff --git a/docs/html/resources/samples/images/SampleSyncAdapter3.png b/docs/html/resources/images/SampleSyncAdapter3.png
similarity index 100%
rename from docs/html/resources/samples/images/SampleSyncAdapter3.png
rename to docs/html/resources/images/SampleSyncAdapter3.png
Binary files differ
diff --git a/docs/html/resources/samples/images/SearchableDictionary1.png b/docs/html/resources/images/SearchableDictionary1.png
similarity index 100%
rename from docs/html/resources/samples/images/SearchableDictionary1.png
rename to docs/html/resources/images/SearchableDictionary1.png
Binary files differ
diff --git a/docs/html/resources/samples/images/SearchableDictionary2.png b/docs/html/resources/images/SearchableDictionary2.png
similarity index 100%
rename from docs/html/resources/samples/images/SearchableDictionary2.png
rename to docs/html/resources/images/SearchableDictionary2.png
Binary files differ
diff --git a/docs/html/resources/samples/images/SipDemo.png b/docs/html/resources/images/SipDemo.png
similarity index 100%
rename from docs/html/resources/samples/images/SipDemo.png
rename to docs/html/resources/images/SipDemo.png
Binary files differ
diff --git a/docs/html/resources/samples/images/Snake.png b/docs/html/resources/images/Snake.png
similarity index 100%
rename from docs/html/resources/samples/images/Snake.png
rename to docs/html/resources/images/Snake.png
Binary files differ
diff --git a/docs/html/resources/samples/images/SoftKeyboard.png b/docs/html/resources/images/SoftKeyboard.png
similarity index 100%
rename from docs/html/resources/samples/images/SoftKeyboard.png
rename to docs/html/resources/images/SoftKeyboard.png
Binary files differ
diff --git a/docs/html/resources/samples/images/SpinnerTest1.png b/docs/html/resources/images/SpinnerTest1.png
similarity index 100%
rename from docs/html/resources/samples/images/SpinnerTest1.png
rename to docs/html/resources/images/SpinnerTest1.png
Binary files differ
diff --git a/docs/html/resources/samples/images/SpinnerTest2.png b/docs/html/resources/images/SpinnerTest2.png
similarity index 100%
rename from docs/html/resources/samples/images/SpinnerTest2.png
rename to docs/html/resources/images/SpinnerTest2.png
Binary files differ
diff --git a/docs/html/resources/samples/images/StackWidget.png b/docs/html/resources/images/StackWidget.png
similarity index 100%
rename from docs/html/resources/samples/images/StackWidget.png
rename to docs/html/resources/images/StackWidget.png
Binary files differ
diff --git a/docs/html/resources/samples/images/TicTacToeLib.png b/docs/html/resources/images/TicTacToeLib.png
similarity index 100%
rename from docs/html/resources/samples/images/TicTacToeLib.png
rename to docs/html/resources/images/TicTacToeLib.png
Binary files differ
diff --git a/docs/html/resources/samples/images/TicTacToeMain.png b/docs/html/resources/images/TicTacToeMain.png
similarity index 100%
rename from docs/html/resources/samples/images/TicTacToeMain.png
rename to docs/html/resources/images/TicTacToeMain.png
Binary files differ
diff --git a/docs/html/resources/samples/images/VoicemailProviderDemo.png b/docs/html/resources/images/VoicemailProviderDemo.png
similarity index 100%
rename from docs/html/resources/samples/images/VoicemailProviderDemo.png
rename to docs/html/resources/images/VoicemailProviderDemo.png
Binary files differ
diff --git a/docs/html/resources/samples/images/WeatherListWidget.png b/docs/html/resources/images/WeatherListWidget.png
similarity index 100%
rename from docs/html/resources/samples/images/WeatherListWidget.png
rename to docs/html/resources/images/WeatherListWidget.png
Binary files differ
diff --git a/docs/html/resources/samples/images/WifiDirect.png b/docs/html/resources/images/WifiDirect.png
similarity index 100%
rename from docs/html/resources/samples/images/WifiDirect.png
rename to docs/html/resources/images/WifiDirect.png
Binary files differ
diff --git a/docs/html/resources/samples/images/Wiktionary.png b/docs/html/resources/images/Wiktionary.png
similarity index 100%
rename from docs/html/resources/samples/images/Wiktionary.png
rename to docs/html/resources/images/Wiktionary.png
Binary files differ
diff --git a/docs/html/resources/samples/images/WiktionarySimple.png b/docs/html/resources/images/WiktionarySimple.png
similarity index 100%
rename from docs/html/resources/samples/images/WiktionarySimple.png
rename to docs/html/resources/images/WiktionarySimple.png
Binary files differ
diff --git a/docs/html/resources/samples/images/XmlPhotosAdapter.png b/docs/html/resources/images/XmlPhotosAdapter.png
similarity index 100%
rename from docs/html/resources/samples/images/XmlPhotosAdapter.png
rename to docs/html/resources/images/XmlPhotosAdapter.png
Binary files differ
diff --git a/docs/html/resources/samples/images/XmlRssReader.png b/docs/html/resources/images/XmlRssReader.png
similarity index 100%
rename from docs/html/resources/samples/images/XmlRssReader.png
rename to docs/html/resources/images/XmlRssReader.png
Binary files differ
diff --git a/docs/html/resources/samples/images/hcgallery-phone1.png b/docs/html/resources/images/hcgallery-phone1.png
similarity index 100%
rename from docs/html/resources/samples/images/hcgallery-phone1.png
rename to docs/html/resources/images/hcgallery-phone1.png
Binary files differ
diff --git a/docs/html/resources/samples/images/hcgallery-phone2.png b/docs/html/resources/images/hcgallery-phone2.png
similarity index 100%
rename from docs/html/resources/samples/images/hcgallery-phone2.png
rename to docs/html/resources/images/hcgallery-phone2.png
Binary files differ
diff --git a/docs/html/resources/samples/images/hcgallery.png b/docs/html/resources/images/hcgallery.png
similarity index 100%
rename from docs/html/resources/samples/images/hcgallery.png
rename to docs/html/resources/images/hcgallery.png
Binary files differ
diff --git a/docs/html/resources/samples/images/randommusicplayer.png b/docs/html/resources/images/randommusicplayer.png
similarity index 100%
rename from docs/html/resources/samples/images/randommusicplayer.png
rename to docs/html/resources/images/randommusicplayer.png
Binary files differ
diff --git a/docs/html/resources/samples/images/sample_lunarlander.png b/docs/html/resources/images/sample_lunarlander.png
similarity index 100%
rename from docs/html/resources/samples/images/sample_lunarlander.png
rename to docs/html/resources/images/sample_lunarlander.png
Binary files differ
diff --git a/docs/html/resources/samples/images/sample_note.png b/docs/html/resources/images/sample_note.png
similarity index 100%
rename from docs/html/resources/samples/images/sample_note.png
rename to docs/html/resources/images/sample_note.png
Binary files differ
diff --git a/docs/html/resources/samples/images/sample_notepad.png b/docs/html/resources/images/sample_notepad.png
similarity index 100%
rename from docs/html/resources/samples/images/sample_notepad.png
rename to docs/html/resources/images/sample_notepad.png
Binary files differ
diff --git a/docs/html/resources/samples/images/sample_notepadtest_junit.png b/docs/html/resources/images/sample_notepadtest_junit.png
similarity index 100%
rename from docs/html/resources/samples/images/sample_notepadtest_junit.png
rename to docs/html/resources/images/sample_notepadtest_junit.png
Binary files differ
diff --git a/docs/html/resources/samples/images/vpn-confirmation.png b/docs/html/resources/images/vpn-confirmation.png
similarity index 100%
rename from docs/html/resources/samples/images/vpn-confirmation.png
rename to docs/html/resources/images/vpn-confirmation.png
Binary files differ
diff --git a/docs/html/resources/index.jd b/docs/html/resources/index.jd
deleted file mode 100644
index 9055868..0000000
--- a/docs/html/resources/index.jd
+++ /dev/null
@@ -1,90 +0,0 @@
-page.title=Developer Resources
-@jd:body
-
-<style type="text/css">
- #resource-list-table td {
- border: 0;
- padding: 0 24px;
- width: 33%;
- max-width: 250px;
- border-right: 1px solid #ddd;
- }
-
- #resource-list-table td.last {
- border-right: 0;
- padding-right: 0;
- }
-</style>
-
-<p>
-This section provides articles, tutorials, sample code, and other
-information to help you quickly implement the features you want in your
-application. To return to this page later, just click the "Resources"
-tab while any Resources page is loaded.
-</p>
-
-<h2>Technical Resources</h2>
-
-<table id="resource-list-table">
-<tr>
- <td>
- <a href="{@docRoot}resources/browser.html?tag=sample">
- <img src="{@docRoot}assets/images/resource-big-sample.png"/>
- </a>
- <h3><a href="{@docRoot}resources/browser.html?tag=sample">
- Sample Code
- </a></h3>
- <p>Fully-functioning sample applications that you can build and run
- to learn about how Android works. Feel free to reuse any of the code or
- techniques in the samples.</p>
- </td>
- <td>
- <a href="{@docRoot}resources/browser.html?tag=article">
- <img src="{@docRoot}assets/images/resource-big-article.png"/>
- </a>
- <h3><a href="{@docRoot}resources/browser.html?tag=article">
- Articles
- </a></h3>
- <p>Focused discussions about Android development subjects, including
- optimizations, tips, interesting implementations, "how-tos",
- and so on.</p>
- </td>
- <td>
- <a href="{@docRoot}resources/browser.html?tag=tutorial">
- <img src="{@docRoot}assets/images/resource-big-tutorial.png"/>
- </a>
- <h3><a href="{@docRoot}resources/browser.html?tag=tutorial">
- Tutorials
- </a></h3>
- <p>Step-by-step instructions demonstrating how to build an Android application
- that has the specific features you want.</p>
- </td>
- <!-- <td class="last">
- <a href="{@docRoot}resources/browser.html?tag=video">
- <img src="{@docRoot}assets/images/resource-big-video.png"/>
- </a>
- <h3><a href="{@docRoot}resources/browser.html?tag=video">
- Videos & Screencasts
- </a></h3>
- <p>Videos and presentation slides from developer events, along with
- screencasts to walk you through common Android development
- workflows.</p>
- </td> -->
-</tr>
-</table>
-
-<h2>Other Resources</h2>
-
-<dl>
-<dt><b>Community</b></dt>
-<dd>Links to the Android discussion groups and information about other ways to
-collaborate with other developers. </dd>
-
-<dt><b>Device Dashboard</b></dt>
-<dd>Device distribution data, grouped by various dimensions such as screen size
-and Android platform version. </dd>
-
-<dt><b>More</b></dt>
-<dd>Quick development tips, troubleshooting information, and frequently asked
-questions (FAQs). </dd>
-</dl>
diff --git a/docs/html/resources/resources-data.js b/docs/html/resources/resources-data.js
deleted file mode 100644
index fb4225d..0000000
--- a/docs/html/resources/resources-data.js
+++ /dev/null
@@ -1,946 +0,0 @@
-var ANDROID_TAGS = {
- type: {
- 'article': 'Article',
- 'tutorial': 'Tutorial',
- 'sample': 'Sample',
- 'video': 'Video',
- 'library': 'Code Library'
- },
- topic: {
- 'accessibility': 'Accessibility',
- 'accountsync': 'Accounts & Sync',
- 'bestpractice': 'Best Practices',
- 'communication': 'Communication',
- 'compatibility': 'Compatibility',
- 'data': 'Data Access',
- 'drawing': 'Canvas Drawing',
- 'gamedev': 'Game Development',
- 'gl': 'OpenGL ES',
- 'input': 'Input Methods',
- 'intent': 'Intents',
- 'layout': 'Layouts/Views',
- 'media': 'Multimedia',
- 'multitasking': 'Multi-tasking',
- 'newfeature': 'New Features',
- 'performance': 'Performance',
- 'search': 'Search',
- 'testing': 'Testing',
- 'ui': 'User Interface',
- 'web': 'Web Content',
- 'widgets': 'App Widgets'
- },
- misc: {
- 'external': 'External',
- 'new': 'New',
- 'updated': 'Updated'
- }
-};
-
-var ANDROID_RESOURCES = [
-
-//////////////////////////
-/// TECHNICAL ARTICLES ///
-//////////////////////////
-
- {
- tags: ['article', 'performance', 'bestpractice'],
- path: 'articles/avoiding-memory-leaks.html',
- title: {
- en: 'Avoiding Memory Leaks'
- },
- description: {
- en: 'Mobile devices often have limited memory, and memory leaks can cause your application to waste this valuable resource without your knowledge. This article provides tips to help you avoid common causes of memory leaks on the Android platform.'
- }
- },
- {
- tags: ['article', 'compatibility'],
- path: 'articles/backward-compatibility.html',
- title: {
- en: 'Backward Compatibility'
- },
- description: {
- en: 'The Android platform strives to ensure backwards compatibility. However, sometimes you want to use new features which aren\'t supported on older platforms. This article discusses strategies for selectively using these features based on availability, allowing you to keep your applications portable across a wide range of devices.'
- }
- },
- {
- tags: ['article', 'intent'],
- path: 'articles/can-i-use-this-intent.html',
- title: {
- en: 'Can I Use this Intent?'
- },
- description: {
- en: 'Android offers a very powerful and yet easy-to-use message type called an intent. You can use intents to turn applications into high-level libraries and make code modular and reusable. While it is nice to be able to make use of a loosely coupled API, there is no guarantee that the intent you send will be received by another application. This article describes a technique you can use to find out whether the system contains any application capable of responding to the intent you want to use.'
- }
- },
- {
- tags: ['article', 'input'],
- path: 'articles/creating-input-method.html',
- title: {
- en: 'Creating an Input Method'
- },
- description: {
- en: 'Input Method Editors (IMEs) provide the mechanism for entering text into text fields and other Views. Android devices come bundled with at least one IME, but users can install additional IMEs. This article covers the basics of developing an IME for the Android platform.'
- }
- },
- {
- tags: ['article', 'drawing', 'ui'],
- path: 'articles/drawable-mutations.html',
- title: {
- en: 'Drawable Mutations'
- },
- description: {
- en: 'Drawables are pluggable drawing containers that allow applications to display graphics. This article explains some common pitfalls when trying to modify the properties of multiple Drawables.'
- }
- },
- {
- tags: ['article', 'bestpractice', 'ui'],
- path: 'articles/faster-screen-orientation-change.html',
- title: {
- en: 'Faster Screen Orientation Change'
- },
- description: {
- en: 'When an Android device changes its orientation, the default behavior is to automatically restart the current activity with a new configuration. However, this can become a bottleneck in applications that access a large amount of external data. This article discusses how to gracefully handle this situation without resorting to manually processing configuration changes.'
- }
- },
- {
- tags: ['article', 'compatibility'],
- path: 'articles/future-proofing.html',
- title: {
- en: 'Future-Proofing Your Apps'
- },
- description: {
- en: 'A collection of common sense advice to help you ensure that your applications don\'t break when new versions of the Android platform are released.'
- }
- },
- {
- tags: ['article', 'input'],
- path: 'articles/gestures.html',
- title: {
- en: 'Gestures'
- },
- description: {
- en: 'Touch screens allow users to perform gestures, such as tapping, dragging, flinging, or sliding, to perform various actions. The gestures API enables your application to recognize even complicated gestures with ease. This article explains how to integrate this API into an application.'
- }
- },
- {
- tags: ['article', 'gamedev', 'gl'],
- path: 'articles/glsurfaceview.html',
- title: {
- en: 'Introducing GLSurfaceView'
- },
- description: {
- en: 'This article provides an overview of GLSurfaceView, a class that makes it easy to implement 2D or 3D OpenGL rendering inside of an Android application.'
- }
- },
- {
- tags: ['article', 'ui', 'layout'],
- path: 'articles/layout-tricks-reuse.html',
- title: {
- en: 'Layout Tricks: Creating Reusable UI Components'
- },
- description: {
- en: 'Learn how to combine multiple standard UI widgets into a single high-level component, which can be reused throughout your application.'
- }
- },
- {
- tags: ['article', 'layout', 'ui', 'performance', 'bestpractice'],
- path: 'articles/layout-tricks-efficiency.html',
- title: {
- en: 'Layout Tricks: Creating Efficient Layouts'
- },
- description: {
- en: 'Learn how to optimize application layouts as this article walks you through converting a LinearLayout into a RelativeLayout, and analyzes the resulting implications on performance.'
- }
- },
- {
- tags: ['article', 'layout', 'ui', 'performance', 'bestpractice'],
- path: 'articles/layout-tricks-stubs.html',
- title: {
- en: 'Layout Tricks: Using ViewStubs'
- },
- description: {
- en: 'Learn about using ViewStubs inside an application\'s layout in order to inflate rarely used UI elements, without the performance implications which would otherwise be caused by using the <code><include></code> tag.'
- }
- },
- {
- tags: ['article', 'layout', 'ui', 'performance', 'bestpractice'],
- path: 'articles/layout-tricks-merge.html',
- title: {
- en: 'Layout Tricks: Merging Layouts'
- },
- description: {
- en: 'Learn how to use the <code><merge></code> tag in your XML layouts in order to avoid unnecessary levels of hierarchy within an application\'s view tree.'
- }
- },
- {
- tags: ['article', 'ui', 'performance'],
- path: 'articles/listview-backgrounds.html',
- title: {
- en: 'ListView Backgrounds: An Optimization'
- },
- description: {
- en: 'ListViews are very popular widgets within the Android framework. This article describes some of the optimizations used by the ListView widget, and how to avoid some common issues that this causes when trying to use a custom background.'
- }
- },
- {
- tags: ['article', 'ui'],
- path: 'articles/live-folders.html',
- title: {
- en: 'Live Folders'
- },
- description: {
- en: 'Live Folders allow users to display any source of data on their home screen without launching an application. This article discusses how to export an application\'s data in a format suitable for display inside of a live folder.'
- }
- },
- {
- tags: ['article', 'ui'],
- path: 'articles/live-wallpapers.html',
- title: {
- en: 'Live Wallpapers'
- },
- description: {
- en: 'Live wallpapers are richer, animated, interactive backgrounds that users can display in their home screens. Learn how to create a live wallpaper and bundle it in an application that users can install on their devices.'
- }
- },
- {
- tags: ['article', 'bestpractice', 'multitasking'],
- path: 'articles/multitasking-android-way.html',
- title: {
- en: 'Multitasking the Android Way'
- },
- description: {
- en: 'This article describes best practices and user experience guidelines for multi-tasking on Android.'
- }
- },
- {
- tags: ['article', 'input'],
- path: 'articles/on-screen-inputs.html',
- title: {
- en: 'Onscreen Input Methods'
- },
- description: {
- en: 'The Input Method Framework (IMF) allows users to take advantage of on-screen input methods, such as software keyboards. This article provides an overview of Input Method Editors (IMEs) and how applications interact with them.'
- }
- },
- {
- tags: ['article', 'performance', 'bestpractice'],
- path: 'articles/painless-threading.html',
- title: {
- en: 'Painless Threading'
- },
- description: {
- en: 'This article discusses the threading model used by Android applications and how applications can ensure best UI performance by spawning worker threads to handle long-running operations, rather than handling them in the main thread. The article also explains the API that your application can use to interact with Android UI toolkit components running on the main thread and spawn managed worker threads.'
- }
- },
- {
- tags: ['article', 'ui', 'search'],
- path: 'articles/qsb.html',
- title: {
- en: 'Quick Search Box'
- },
- description: {
- en: 'Quick Search Box (QSB) is a powerful, system-wide search framework. QSB makes it possible for users to quickly and easily find what they\'re looking for, both on their devices and on the web. This article discusses how to work with the QSB framework to add new search results for an installed application.'
- }
- },
- {
- tags: ['article', 'input', 'search', 'ui'],
- path: 'articles/speech-input.html',
- title: {
- en: 'Speech Input'
- },
- description: {
- en: 'This articles describes the basics of integrating speech recognition into Android applications.'
- }
- },
- {
- tags: ['article', 'compatibility', 'multitasking'],
- path: 'articles/service-api-changes-starting-with.html',
- title: {
- en: 'Service API changes starting with Android 2.0'
- },
- description: {
- en: 'This article describes the changes and improvements to services introduced in Android 2.0, as well as strategies for compatibility with older versions of the platform.'
- }
- },
- {
- tags: ['article', 'input', 'ui'],
- path: 'articles/spell-checker-framework.html',
- title: {
- en: 'The Android Spell Checker Framework'
- },
- description: {
- en: 'This article describes the Android spell checker framework and how to use to implement spell checking in applications.'
- }
- },
-
- {
- tags: ['article', 'ui'],
- path: 'articles/touch-mode.html',
- title: {
- en: 'Touch Mode'
- },
- description: {
- en: 'This article explains the touch mode, one of the most important principles of Android\'s UI toolkit. Whenever a user interacts with a device\'s touch screen, the system enters touch mode. While simple in concept, there are important implications touch mode that are often overlooked.'
- }
- },
- {
- tags: ['article', 'performance', 'bestpractice'],
- path: 'articles/track-mem.html',
- title: {
- en: 'Tracking Memory Allocations'
- },
- description: {
- en: 'This article discusses how to use the Allocation Tracker tool to observe memory allocations and avoid performance problems that would otherwise be caused by ignoring the effect of Dalvik\'s garbage collector.'
- }
- },
- {
- tags: ['article'],
- path: 'articles/ui-1.5.html',
- title: {
- en: 'UI Framework Changes in Android 1.5'
- },
- description: {
- en: 'Explore the UI changes that were introduced in Android 1.5, compared with the UI provided in Android 1.0 and 1.1.'
- }
- },
- {
- tags: ['article'],
- path: 'articles/ui-1.6.html',
- title: {
- en: 'UI Framework Changes in Android 1.6'
- },
- description: {
- en: 'Explore the UI changes that were introduced in Android 1.6, compared with the UI provided in Android 1.5. In particular, this article discusses changes to RelativeLayouts and click listeners.'
- }
- },
- {
- tags: ['article', 'ui', 'bestpractice'],
- path: 'articles/timed-ui-updates.html',
- title: {
- en: 'Updating the UI from a Timer'
- },
- description: {
- en: 'Learn about how to use Handlers as a more efficient replacement for java.util.Timer on the Android platform.'
- }
- },
- {
- tags: ['article', 'ui', 'accessibility'],
- path: 'articles/tts.html',
- title: {
- en: 'Using Text-to-Speech'
- },
- description: {
- en: 'The text-to-speech API lets your application "speak" to users, in any of several languages. This article provides an overview of the TTS API and how you use to add speech capabilities to your application.'
- }
- },
- {
- 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: {
- en: 'Using WebViews'
- },
- description: {
- en: 'WebViews allow an application to dynamically display HTML and execute JavaScript, without relinquishing control to a separate browser application. This article introduces the WebView classes and provides a sample application that demonstrates its use.'
- }
- },
- {
- tags: ['article', 'ui'],
- path: 'articles/wikinotes-linkify.html',
- title: {
- en: 'WikiNotes: Linkify your Text!'
- },
- description: {
- en: 'This article introduces WikiNotes for Android, part of the Apps for Android project. It covers the use of Linkify to turn ordinary text views into richer, link-oriented content that causes Android intents to fire when a link is selected.'
- }
- },
- {
- tags: ['article', 'intent'],
- path: 'articles/wikinotes-intents.html',
- title: {
- en: 'WikiNotes: Routing Intents'
- },
- description: {
- en: 'This article illustrates how an application, in this case the WikiNotes sample app, can use intents to route various types of linked text to the application that handles that type of data. For example, an app can use intents to route a linked telephone number to a dialer app and a web URL to a browser.'
- }
- },
- {
- tags: ['article', 'ui', 'performance'],
- path: 'articles/window-bg-speed.html',
- title: {
- en: 'Window Backgrounds & UI Speed'
- },
- description: {
- en: 'Some Android applications need to squeeze every bit of performance out of the UI toolkit and there are many ways to do so. In this article, you will discover how to speed up the drawing and the perceived startup time of your activities. Both of these techniques rely on a single feature, the window\'s background drawable.'
- }
- },
- {
- tags: ['article', 'performance', 'bestpractice'],
- path: 'articles/zipalign.html',
- title: {
- en: 'Zipalign: an Easy Optimization'
- },
- description: {
- en: 'The Android SDK includes a tool called zipalign that optimizes the way an application is packaged. Running zipalign against your application enables Android to interact with it more efficiently at run time and thus has the potential to make it and the overall system run faster. This article provides a high-level overview of the zipalign tool and its use.'
- }
- },
-
-///////////////////
-/// SAMPLE CODE ///
-///////////////////
-
- {
- tags: ['sample'],
- path: 'samples/AccelerometerPlay/index.html',
- title: {
- en: 'Accelerometer Play'
- },
- description: {
- en: 'An example of using the accelerometer to integrate the device\'s acceleration to a position using the Verlet method. This is illustrated with a very simple particle system comprised of a few iron balls freely moving on an inclined wooden table. The inclination of the virtual table is controlled by the device\'s accelerometer.'
- }
- },
- {
- tags: ['sample', 'new', 'ui', 'compatibility', 'newfeature'],
- path: 'samples/ActionBarCompat/index.html',
- title: {
- en: 'Action Bar Compatibility'
- },
- description: {
- en: 'Shows how to use the action bar on both pre-API 11 and API 11+ devices, maximizing code re-use.'
- }
- },
- {
- tags: ['sample', 'new'],
- path: 'samples/AndroidBeamDemo/index.html',
- title: {
- en: 'Android Beam Demo'
- },
- description: {
- en: 'An example of how to use the Android Beam feature to send messages between two Android-powered devices (API level 14 or later) that support NFC.'
- }
- },
- {
- tags: ['sample', 'layout', 'ui', 'updated'],
- path: 'samples/ApiDemos/index.html',
- title: {
- en: 'API Demos'
- },
- description: {
- en: 'A variety of small applications that demonstrate an extensive collection of framework topics.'
- }
- },
- {
- tags: ['sample', 'layout', 'ui', 'fragment', 'loader'],
- path: 'samples/Support4Demos/index.html',
- title: {
- en: 'API 4+ Support Demos'
- },
- description: {
- en: 'A variety of small applications that demonstrate the use of the helper classes in the Android API 4+ Support Library (classes which work down to API level 4 or version 1.6 of the platform).'
- }
- },
- {
- tags: ['sample', 'layout', 'ui'],
- path: 'samples/Support13Demos/index.html',
- title: {
- en: 'API 13+ Support Demos'
- },
- description: {
- en: 'A variety of small applications that demonstrate the use of the helper classes in the Android API 13+ Support Library (classes which work down to API level 13 or version 3.2 of the platform).'
- }
- },
- {
- tags: ['sample', 'data', 'newfeature', 'accountsync'],
- path: 'samples/BackupRestore/index.html',
- title: {
- en: 'Backup and Restore'
- },
- description: {
- en: 'Illustrates a few different approaches that an application developer can take when integrating with the Android Backup Manager using the BackupAgent API introduced in Android 2.2.'
- }
- },
- {
- tags: ['sample', 'communication'],
- path: 'samples/BluetoothChat/index.html',
- title: {
- en: 'Bluetooth Chat'
- },
- description: {
- en: 'An application for two-way text messaging over Bluetooth.'
- }
- },
- {
- tags: ['sample', 'communication', 'new'],
- path: 'samples/BluetoothHDP/index.html',
- title: {
- en: 'Bluetooth HDP Demo'
- },
- description: {
- en: 'A sample application that demonstrates how to communicate with a Bluetooth Health Device Profile (HDP) device.'
- }
- },
- {
- tags: ['sample', 'accountsync'],
- path: 'samples/BusinessCard/index.html',
- title: {
- en: 'BusinessCard'
- },
- description: {
- en: 'An application that demonstrates how to launch the built-in contact picker from within an activity. This sample also uses reflection to ensure that the correct version of the contacts API is used, depending on which API level the application is running under.'
- }
- },
- {
- tags: ['sample', 'accountsync'],
- path: 'samples/ContactManager/index.html',
- title: {
- en: 'Contact Manager'
- },
- description: {
- en: 'An application that demonstrates how to query the system contacts provider using the <code>ContactsContract</code> API, as well as insert contacts into a specific account.'
- }
- },
- {
- tags: ['sample', 'ui'],
- path: 'samples/CubeLiveWallpaper/index.html',
- title: {
- en: 'Cube Live Wallpaper'
- },
- description: {
- en: 'An application that demonstrates how to create a live wallpaper and bundle it in an application that users can install on their devices.'
- }
- },
- {
- tags: ['sample', 'new'],
- path: 'samples/training/device-management-policy/index.html',
- title: {
- en: 'Device Policy Management'
- },
- description: {
- en: 'This is a security-aware sample application that demonstrates the enforcement of device administration policies on Android 2.2 or above platforms.'
- }
- },
- {
- tags: ['sample'],
- path: 'samples/Home/index.html',
- title: {
- en: 'Home'
- },
- description: {
- en: 'A home screen replacement application.'
- }
- },
- {
- tags: ['sample', 'updated', 'newfeature', 'ui'],
- path: 'samples/HoneycombGallery/index.html',
- title: {
- en: 'Honeycomb Gallery'
- },
- description: {
- 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.'
- }
- },
- {
- tags: ['sample', 'gamedev', 'media'],
- path: 'samples/JetBoy/index.html',
- title: {
- en: 'JetBoy'
- },
- description: {
- en: 'A game that demonstrates the SONiVOX JET interactive music technology, with <code><a href="/reference/android/media/JetPlayer.html">JetPlayer</a></code>.'
- }
- },
- {
- tags: ['sample', 'new'],
- path: 'samples/KeyChainDemo/index.html',
- title: {
- en: 'KeyChain Demo'
- },
- description: {
- en: 'A demo application to demonstrate how to use KeyChain APIs.'
- }
- },
- {
- tags: ['sample', 'gamedev', 'media'],
- path: 'samples/LunarLander/index.html',
- title: {
- en: 'Lunar Lander'
- },
- description: {
- en: 'A classic Lunar Lander game.'
- }
- },
- {
- tags: ['sample', 'new'],
- path: 'samples/training/ads-and-ux/index.html',
- title: {
- en: 'Mobile Advertisement Integration'
- },
- description: {
- en: 'This sample demonstrates the integration of a mobile ad SDK with your application.'
- }
- },
- {
- tags: ['sample', 'ui', 'bestpractice', 'layout'],
- path: 'samples/MultiResolution/index.html',
- title: {
- en: 'Multiple Resolutions'
- },
- description: {
- en: 'A sample application that shows how to use resource directory qualifiers to provide different resources for different screen configurations.'
- }
- },
- {
- tags: ['sample', 'new', 'bestpractices'],
- path: 'samples/newsreader/index.html',
- title: {
- en: 'News Reader'
- },
- description: {
- en: 'A sample app demonstrating best practices to support multiple screen sizes and densities.'
- }
- },
- {
- tags: ['sample', 'data'],
- path: 'samples/NFCDemo/index.html',
- title: {
- en: 'NFC Demo'
- },
- description: {
- en: 'An application for reading NFC Forum Type 2 Tags using the NFC APIs'
- }
- },
- {
- tags: ['sample', 'data'],
- path: 'samples/NotePad/index.html',
- title: {
- en: 'Note Pad'
- },
- description: {
- en: 'An application for saving notes. Similar (but not identical) to the <a href="/resources/tutorials/notepad/index.html">Notepad tutorial</a>.'
- }
- },
- {
- tags: ['sample', 'media', 'updated'],
- path: 'samples/RandomMusicPlayer/index.html',
- title: {
- en: 'Random Music Player'
- },
- description: {
- en: 'Demonstrates how to write a multimedia application that plays music from the device and from URLs. It manages media playback from a service and can play music in the background, respecting audio focus changes. Also shows how to use the new Remote Control APIs in API level 14.'
- }
- },
- {
- tags: ['sample', 'newfeature', 'performance', 'gamedev', 'gl', 'updated'],
- path: 'samples/RenderScript/index.html',
- title: {
- en: 'RenderScript'
- },
- description: {
- en: 'A set of samples that demonstrate how to use various features of the RenderScript APIs.'
- }
- },
- {
- tags: ['sample', 'input', 'new'],
- path: 'samples/SpellChecker/SampleSpellCheckerService/index.html',
- title: {
- en: 'Spell Checker Service'
- },
- description: {
- en: 'An example spell checker service, using the <a href="'+toRoot+'reference/android/service/textservice/SpellCheckerService.html"><code>SpellCheckerService</code></a>.'
- }
- },
- {
- tags: ['sample', 'input', 'new'],
- path: 'samples/SpellChecker/HelloSpellChecker/index.html',
- title: {
- en: 'Spell Checker Client'
- },
- description: {
- en: 'An example spell checker client, using the <a href="'+toRoot+'reference/android/view/textservice/TextServicesManager.html"><code>TextServicesManager</code></a> and <a href="'+toRoot+'reference/android/view/textservice/SpellCheckerSession.html"><code>SpellCheckerSession</code></a>.'
- }
- },
- {
- tags: ['sample', 'accountsync', 'updated'],
- path: 'samples/SampleSyncAdapter/index.html',
- title: {
- en: 'SampleSyncAdapter'
- },
- description: {
- en: 'Demonstrates how an application can communicate with a cloud-based service and synchronize its data with data stored locally in a content provider. The sample uses two related parts of the Android framework — the account manager and the synchronization manager (through a sync adapter).'
- }
- },
- {
- tags: ['sample', 'ui', 'search'],
- path: 'samples/SearchableDictionary/index.html',
- title: {
- en: 'Searchable Dictionary v2'
- },
- description: {
- en: 'A sample application that demonstrates Android\'s search framework, including how to provide search suggestions for Quick Search Box.'
- }
- },
- {
- tags: ['sample'],
- path: 'samples/SipDemo/index.html',
- title: {
- en: 'SIP Demo'
- },
- description: {
- en: 'A demo application highlighting how to make internet-based calls with the SIP API.'
- }
- },
- {
- tags: ['sample', 'layout', 'ui'],
- path: 'samples/Snake/index.html',
- title: {
- en: 'Snake'
- },
- description: {
- en: 'An implementation of the classic game "Snake."'
- }
- },
- {
- tags: ['sample', 'input'],
- path: 'samples/SoftKeyboard/index.html',
- title: {
- en: 'Soft Keyboard'
- },
- description: {
- en: 'An example of writing an input method for a software keyboard.'
- }
- },
- {
- tags: ['sample', 'testing'],
- path: 'samples/Spinner/index.html',
- title: {
- en: 'Spinner'
- },
- description: {
- en: 'A simple application that serves as an application under test for the SpinnerTest example.'
- }
- },
- {
- tags: ['sample', 'testing'],
- path: 'samples/SpinnerTest/index.html',
- title: {
- en: 'SpinnerTest'
- },
- description: {
- en: 'The test application for the Activity Testing tutorial. It tests the Spinner example application.'
- }
- },
- {
- tags: ['sample', 'newfeature', 'widgets'],
- path: 'samples/StackWidget/index.html',
- title: {
- en: 'StackView Widget'
- },
- description: {
- en: 'Demonstrates how to create a simple collection widget containing a StackView.'
- }
- },
- {
- tags: ['sample', 'newfeature'],
- path: 'samples/TicTacToeLib/index.html',
- title: {
- en: 'TicTacToeLib'
- },
- description: {
- en: 'An example of an Android library project, a type of project that lets you store and manage shared code and resources in one place, then make them available to your other Android applications.'
- }
- },
- {
- tags: ['sample', 'newfeature',],
- path: 'samples/TicTacToeMain/index.html',
- title: {
- en: 'TicTacToeMain'
- },
- description: {
- en: 'Demonstrates how an application can make use of shared code and resources stored in an Android library project.'
- }
- },
- {
- tags: ['sample', 'communication', 'new'],
- path: 'samples/ToyVpn/index.html',
- title: {
- en: 'Toy VPN Client'
- },
- description: {
- en: 'A sample application that illustrates the creation of a custom VPN client.'
- }
- },
- {
- tags: ['sample', 'newfeature'],
- path: 'samples/USB/index.html',
- title: {
- en: 'USB'
- },
- description: {
- en: 'A set of samples that demonstrate how to use various features of the USB APIs.'
- }
- },
- {
- tags: ['sample', 'data', 'new'],
- path: 'samples/VoicemailProviderDemo/index.html',
- title: {
- en: 'Voicemail Provider'
- },
- description: {
- en: 'A sample application to demonstrate how to use voicemail content provider APIs in Android 4.0.'
- }
- },
- {
- tags: ['sample','newfeature', 'new'],
- path: 'samples/WiFiDirectDemo/index.html',
- title: {
- en: 'Wi-Fi Direct Demo'
- },
- description: {
- en: 'A demo application to demonstrate how to use Wi-Fi Direct APIs.'
- }
- },
- {
- tags: ['sample', 'ui', 'widgets'],
- path: 'samples/Wiktionary/index.html',
- title: {
- en: 'Wiktionary'
- },
- description: {
- en: 'An example of creating interactive widgets for display on the Android home screen.'
- }
- },
- {
- tags: ['sample', 'ui', 'widgets'],
- path: 'samples/WiktionarySimple/index.html',
- title: {
- en: 'Wiktionary (Simplified)'
- },
- description: {
- en: 'A simple Android home screen widgets example.'
- }
- },
- {
- tags: ['sample', 'widgets', 'newfeature'],
- path: 'samples/WeatherListWidget/index.html',
- title: {
- en: 'Weather List Widget'
- },
- description: {
- en: 'A more complex collection-widget example which uses a ContentProvider as its data source.'
- }
- },
- {
- tags: ['sample', 'layout'],
- path: 'samples/XmlAdapters/index.html',
- title: {
- en: 'XML Adapters'
- },
- description: {
- en: 'Binding data to views using XML Adapters examples.'
- }
- },
- {
- tags: ['sample', 'new', 'accessibility'],
- path: 'samples/TtsEngine/index.html',
- title: {
- en: 'Text To Speech Engine'
- },
- description: {
- en: 'An example Text To Speech engine written using the Android text to speech engine API in Android 4.0.'
- }
- },
-
-/////////////////
-/// TUTORIALS ///
-/////////////////
-
- {
- tags: ['tutorial'],
- path: 'tutorials/hello-world.html',
- title: {
- en: 'Hello World'
- },
- description: {
- en: 'Beginning basic application development with the Android SDK.'
- }
- },
- {
- tags: ['tutorial', 'ui', 'layout'],
- path: 'tutorials/views/index.html',
- title: {
- en: 'Hello Views'
- },
- description: {
- en: 'A walk-through of the various types of layouts and views available in the Android SDK.'
- }
- },
- {
- tags: ['tutorial', 'ui', 'bestpractice'],
- path: 'tutorials/localization/index.html',
- title: {
- en: 'Hello Localization'
- },
- description: {
- en: 'The basics of localizing your applications for multiple languages and locales.'
- }
- },
- {
- tags: ['tutorial', 'data'],
- path: 'tutorials/notepad/index.html',
- title: {
- en: 'Notepad Tutorial'
- },
- description: {
- en: 'A multi-part tutorial discussing intermediate-level concepts such as data access.'
- }
- },
- {
- tags: ['tutorial', 'gl'],
- path: 'tutorials/opengl/opengl-es10.html',
- title: {
- en: 'OpenGL ES 1.0'
- },
- description: {
- en: 'The basics of implementing an application using the OpenGL ES 1.0 APIs.'
- }
- },
- {
- tags: ['tutorial', 'gl'],
- path: 'tutorials/opengl/opengl-es20.html',
- title: {
- en: 'OpenGL ES 2.0'
- },
- description: {
- en: 'The basics of implementing an application using the OpenGL ES 2.0 APIs.'
- }
- },
- {
- tags: ['tutorial', 'testing'],
- path: 'tutorials/testing/helloandroid_test.html',
- title: {
- en: 'Hello Testing'
- },
- description: {
- en: 'A basic introduction to the Android testing framework.'
- }
- },
- {
- tags: ['tutorial', 'testing'],
- path: 'tutorials/testing/activity_test.html',
- title: {
- en: 'Activity Testing'
- },
- description: {
- en: 'A more advanced demonstration of the Android testing framework and tools.'
- }
- }
-];
diff --git a/docs/html/resources/resources_toc.cs b/docs/html/resources/resources_toc.cs
deleted file mode 100644
index 9752d99..0000000
--- a/docs/html/resources/resources_toc.cs
+++ /dev/null
@@ -1,687 +0,0 @@
-<ul>
- <li>
- <span class="heading">
- <span class="en">Basic Training</span>
- </span>
- <ul>
-
- <li><a href="<?cs var:toroot ?>training/index.html">
- <span class="en">Orientation</span>
- </a>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/basics/firstapp/index.html">
- <span class="en">Building Your First App<span class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/basics/firstapp/creating-project.html">
- <span class="en">Creating an Android Project</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/firstapp/running-app.html">
- <span class="en">Running Your Application</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/firstapp/building-ui.html">
- <span class="en">Building a Simple User Interface</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/firstapp/starting-activity.html">
- <span class="en">Starting Another Activity</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/index.html">
- <span class="en">Managing the Activity Lifecycle<span class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/starting.html">
- <span class="en">Starting an Activity</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/pausing.html">
- <span class="en">Pausing and Resuming an Activity</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/stopping.html">
- <span class="en">Stopping and Restarting an Activity</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/recreating.html">
- <span class="en">Recreating an Activity</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/basics/supporting-devices/index.html">
- <span class="en">Supporting Different Devices<span class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/languages.html">
- <span class="en">Supporting Different Languages</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/screens.html">
- <span class="en">Supporting Different Screens</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/platforms.html">
- <span class="en">Supporting Different Platform Versions</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/basics/fragments/index.html">
- <span class="en">Building a Dynamic UI with Fragments<span class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/basics/fragments/support-lib.html">
- <span class="en">Using the Support Library</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/fragments/creating.html">
- <span class="en">Creating a Fragment</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/fragments/fragment-ui.html">
- <span class="en">Building a Flexible UI</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/fragments/communicating.html">
- <span class="en">Communicating with Other Fragments</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/basics/intents/index.html">
- <span class="en">Interacting with Other Apps<span class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/basics/intents/sending.html">
- <span class="en">Sending the User to Another App</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/intents/result.html">
- <span class="en">Getting a Result from the Activity</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/intents/filters.html">
- <span class="en">Allowing Other Apps to Start Your Activity</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/basics/location/index.html">
- <span class="en">Making Your App Location Aware<span class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/basics/location/locationmanager.html">
- <span class="en">Using the Location Manager</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/location/currentlocation.html">
- <span class="en">Obtaining the Current Location</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/location/geocoding.html">
- <span class="en">Displaying a Location Address</span>
- </a>
- </li>
- </ul>
- </li>
-
- </ul>
- </li>
-
-
- <li>
- <span class="heading">
- <span class="en">Advanced Training</span>
- </span>
- <ul>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/multiscreen/index.html">
- <span class="en">Designing for Multiple Screens</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/multiscreen/screensizes.html">
- <span class="en">Supporting Different Screen Sizes</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/multiscreen/screendensities.html">
- <span class="en">Supporting Different Screen Densities</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/multiscreen/adaptui.html">
- <span class="en">Implementing Adaptive UI Flows</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/improving-layouts/index.html">
- <span class="en">Improving Layout Performance</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/improving-layouts/optimizing-layout.html">
- <span class="en">Optimizing Layout Hierarchies</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/improving-layouts/reusing-layouts.html">
- <span class="en">Re-using Layouts with <include/></span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/improving-layouts/loading-ondemand.html">
- <span class="en">Loading Views On Demand</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/improving-layouts/smooth-scrolling.html">
- <span class="en">Making ListView Scrolling Smooth</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/managing-audio/index.html">
- <span class="en">Managing Audio Playback</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/managing-audio/volume-playback.html">
- <span class="en">Controlling Your App’s Volume and Playback</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/managing-audio/audio-focus.html">
- <span class="en">Managing Audio Focus</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/managing-audio/audio-output.html">
- <span class="en">Dealing with Audio Output Hardware</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/monitoring-device-state/index.html">
- <span class="en">Optimizing Battery Life</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/monitoring-device-state/battery-monitoring.html">
- <span class="en">Monitoring the Battery Level and Charging State</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/monitoring-device-state/docking-monitoring.html">
- <span class="en">Determining and Monitoring the Docking State and Type</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/monitoring-device-state/connectivity-monitoring.html">
- <span class="en">Determining and Monitoring the Connectivity Status</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/monitoring-device-state/manifest-receivers.html">
- <span class="en">Manipulating Broadcast Receivers On Demand</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/efficient-downloads/index.html">
- <span class="en">Transferring Data Without Draining the Battery<span
-class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/efficient-downloads/efficient-network-access.html">
- <span class="en">Optimizing Downloads for Efficient Network Access</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/efficient-downloads/regular_updates.html">
- <span class="en">Minimizing the Effect of Regular Updates</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/efficient-downloads/redundant_redundant.html">
- <span class="en">Redundant Downloads are Redundant</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/efficient-downloads/connectivity_patterns.html">
- <span class="en">Modifying Patterns Based on the Connectivity Type</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/cloudsync/index.html">
- <span class="en">Syncing to the Cloud<span class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/cloudsync/aesync.html">
- <span class="en">Syncing with App Engine</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/cloudsync/backupapi.html">
- <span class="en">Using the Backup API</span>
- </a>
- </li>
- </ul>
- </li>
-
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/search/index.html">
- <span class="en">Adding Search Functionality<span class="new"> new!</span></span>
- </a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/search/setup.html">
- <span class="en">Setting up the Search Interface</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/search/search.html">
- <span class="en">Storing and Searching for Data</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/search/backward-compat.html">
- <span class="en">Remaining Backward Compatible</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/id-auth/index.html">
- <span class="en">Remembering Users</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/id-auth/identify.html">
- <span class="en">Remembering Your User</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/id-auth/authenticate.html">
- <span class="en">Authenticating to OAuth2 Services</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/id-auth/custom_auth.html">
- <span class="en">Creating a Custom Account Type</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/sharing/index.html">
- <span class="en">Sharing Content</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/sharing/send.html">
- <span class="en">Sending Content to Other Apps</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/sharing/receive.html">
- <span class="en">Receiving Content from Other Apps</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/sharing/shareaction.html">
- <span class="en">Adding an Easy Share Action</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/camera/index.html">
- <span class="en">Capturing Photos</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/camera/photobasics.html">
- <span class="en">Taking Photos Simply</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/camera/videobasics.html">
- <span class="en">Recording Videos Simply</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/camera/cameradirect.html">
- <span class="en">Controlling the Camera</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/multiple-apks/index.html">
- <span class="en">Maintaining Multiple APKs</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/multiple-apks/api.html">
- <span class="en">Creating Multiple APKs for Different API Levels</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/multiple-apks/screensize.html">
- <span class="en">Creating Multiple APKs for Different Screen Sizes</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/multiple-apks/texture.html">
- <span class="en">Creating Multiple APKs for Different GL Textures</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/multiple-apks/multiple.html">
- <span class="en">Creating Multiple APKs with 2+ Dimensions</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/backward-compatible-ui/index.html">
- <span class="en">Creating Backward-Compatible UIs<span class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/abstracting.html">
- <span class="en">Abstracting the New APIs</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/new-implementation.html">
- <span class="en">Proxying to the New APIs</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/older-implementation.html">
- <span class="en">Creating an Implementation with Older APIs</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/using-component.html">
- <span class="en">Using the Version-Aware Component</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/enterprise/index.html">
- <span class="en">Developing for Enterprise</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/enterprise/device-management-policy.html">
- <span class="en">Enhancing Security with Device Management Policies</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/monetization/index.html">
- <span class="en">Monetizing Your App</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/monetization/ads-and-ux.html">
- <span class="en">Advertising without Compromising User Experience</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/design-navigation/index.html">
- <span class="en">Designing Effective Navigation</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/design-navigation/screen-planning.html">
- <span class="en">Planning Screens and Their Relationships</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/design-navigation/multiple-sizes.html">
- <span class="en">Planning for Multiple Touchscreen Sizes</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/design-navigation/descendant-lateral.html">
- <span class="en">Providing Descendant and Lateral Navigation</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/design-navigation/ancestral-temporal.html">
- <span class="en">Providing Ancestral and Temporal Navigation</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/design-navigation/wireframing.html">
- <span class="en">Putting it All Together: Wireframing the Example App</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/implementing-navigation/index.html">
- <span class="en">Implementing Effective Navigation<span class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/implementing-navigation/lateral.html">
- <span class="en">Implementing Lateral Navigation</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/implementing-navigation/ancestral.html">
- <span class="en">Implementing Ancestral Navigation</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/implementing-navigation/temporal.html">
- <span class="en">Implementing Temporal Navigation</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/implementing-navigation/descendant.html">
- <span class="en">Implementing Descendant Navigation</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/tv/index.html">
- <span class="en">Designing for TV<span class="new"> new!</span></span>
- </a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/tv/optimizing-layouts-tv.html">
- <span class="en">Optimizing Layouts for TV</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/tv/optimizing-navigation-tv.html">
- <span class="en">Optimizing Navigation for TV</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/tv/unsupported-features-tv.html">
- <span class="en">Handling Features Not Supported on TV</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/displaying-bitmaps/index.html">
- <span class="en">Displaying Bitmaps Efficiently<span class="new"> new!</span></span>
- </a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/load-bitmap.html">
- <span class="en">Loading Large Bitmaps Efficiently</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/process-bitmap.html">
- <span class="en">Processing Bitmaps Off the UI Thread</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/cache-bitmap.html">
- <span class="en">Caching Bitmaps</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/display-bitmap.html">
- <span class="en">Displaying Bitmaps in Your UI</span>
- </a></li>
- </ul>
- </li>
-
-
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>training/accessibility/index.html">
- <span class="en">Implementing Accessibility<span class="new"> new!</span></span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/accessibility/accessible-app.html">
- <span class="en">Developing Accessible Applications</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/accessibility/service.html">
- <span class="en">Developing Accessibility Services</span>
- </a>
- </li>
- </ul>
- </li>
-
- </ul>
- </li>
-
-
-
-
- <li>
- <span class="heading">
- <span class="en">Technical Resources</span>
- </span>
- <ul>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>resources/browser.html?tag=sample">
- <span class="en">Sample Code</span>
- <span class="de" style="display:none">Beispielcode</span>
- <span class="es" style="display:none">Código de ejemplo</span>
- <span class="fr" style="display:none">Exemple de code</span>
- <span class="it" style="display:none">Codice di esempio</span>
- <span class="ja" style="display:none">サンプル コード</span>
- <span class="zh-CN" style="display:none"></span>
- <span class="zh-TW" style="display:none"></span>
- </a></div>
- <ul id="devdoc-nav-sample-list">
- <li><a href="<?cs var:toroot ?>resources/samples/get.html">
- <span class="en">Getting the Samples</span>
- </a></li>
- </ul>
- </li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>resources/browser.html?tag=article">
- <span class="en">Articles</span>
- </a></div>
- <ul id="devdoc-nav-article-list">
- </ul>
- </li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>resources/browser.html?tag=tutorial">
- <span class="en">Tutorials</span>
- <span class="de" style="display:none">Lernprogramme</span>
- <span class="es" style="display:none">Tutoriales</span>
- <span class="fr" style="display:none">Didacticiels</span>
- <span class="it" style="display:none">Esercitazioni</span>
- <span class="ja" style="display:none">チュートリアル</span>
- <span class="zh-CN" style="display:none"></span>
- <span class="zh-TW" style="display:none"></span>
- </a></div>
- <ul id="devdoc-nav-tutorial-list">
- </ul>
- </li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>resources/topics.html">
- <span class="en">Topics</span>
- </a></div>
- <ul id="devdoc-nav-topic-list">
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <span class="heading">
- <span class="en">Community</span>
- <span style="display:none" class="de"></span>
- <span style="display:none" class="es">Comunidad</span>
- <span style="display:none" class="fr">Communauté</span>
- <span style="display:none" class="it"></span>
- <span style="display:none" class="ja">コミュニティ</span>
- <span style="display:none" class="zh-CN">社区</span>
- <span style="display:none" class="zh-TW">社群</span>
- </span>
- <ul>
- <li><a href="<?cs var:toroot ?>resources/community-groups.html">
- <span class="en">Developer Forums</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/community-more.html">
- <span class="en">IRC, G+, Twitter</span>
- </a></li>
- </ul>
- </li>
-<?cs
- if:android.whichdoc == "online" ?>
- <li>
- <span class="heading">
- <span class="en">Device Dashboard</span>
- </span>
- <ul>
- <li><a href="<?cs var:toroot ?>resources/dashboard/platform-versions.html">
- <span class="en">Platform Versions</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/dashboard/screens.html">
- <span class="en">Screen Sizes & Densities</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/dashboard/opengl.html">
- <span class="en">OpenGL ES Versions</span>
- </a></li>
- </ul>
- </li><?cs
- /if
-?>
-
- <li>
- <span class="heading">
- <span class="en">More</span>
- </span>
- <ul>
- <li><a href="<?cs var:toroot ?>resources/faq/commontasks.html">
- <span class="en">Common Tasks </span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/faq/troubleshooting.html">
- <span class="en">Troubleshooting Tips</span>
- </a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>resources/faq/index.html">
- <span class="en">FAQs</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>resources/faq/framework.html">
- <span class="en">App Framework FAQ</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/faq/licensingandoss.html">
- <span class="en">Licensing FAQ</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/faq/security.html">
- <span class="en">Security FAQ</span>
- </a></li>
- </ul>
- </li>
- </ul>
- </li>
-</ul>
-
-<script type="text/javascript">
-<!--
- buildToggleLists();
- changeNavLang(getLangPref());
-//-->
-</script>
diff --git a/docs/html/resources/samples/get.jd b/docs/html/resources/samples/get.jd
deleted file mode 100644
index 751965f..0000000
--- a/docs/html/resources/samples/get.jd
+++ /dev/null
@@ -1,92 +0,0 @@
-page.title=Getting the Samples
-parent.title=Sample Code
-parent.link=../browser.html?tag=sample
-
-@jd:body
-
-<p>Sometimes, the best way to learn how things are done is to look at some
-code.</p>
-
-<p>To help you get started quickly, the Android SDK includes a variety of sample
-code and tutorials that illustrate key concepts and techniques of Android
-application development. For example, the samples show the structure of the
-manifest file and the use of activities, services, resources,
-intents, content providers, and permissions. They also show how to add
-specialized capabilities to your apps, such as Bluetooth and Contacts
-integration, multiple screens support, Live Wallpaper, and more. </p>
-
-<p>The SDK provides the samples both as source code and as browseable HTML, as
-described in the sections below. All of the samples included in the SDK are
-licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache
-2.0 license</a>, so feel free to use any of the code in your own applications as
-needed!</p>
-
-<h3 id="downloading">Downloading the Sample Code</h3>
-
-<p>The SDK sample code is available to you as a set of downloadable SDK
-components, each of which contains the samples for a specific Android platform
-version. Once you have installed the SDK, you can download one or more samples
-component(s) into your SDK environment using the Android SDK Manager
-tool, which is pre-installed in the SDK. </p>
-
-<p>To download the samples, launch the Android SDK Manager tool and
-select one of the samples components from the <strong>Available
-Packages</strong> panel, for example "Samples for SDK API 7". Select
-<strong>Install Selected</strong>, verify and accept the download, then select
-<strong>Install Accepted</strong> to download the component into your SDK. If
-you aren't familiar with the Android SDK Manager and how to launch or
-use it, please read the <a href="{@docRoot}sdk/adding-components.html">Adding
-SDK Components</a> document. </p>
-
-<p>When the download is complete, you can find the samples sources on your
-computer in this location:</p>
-
-<p style="margin-left:2em">
-<code><em><sdk></em>/samples/android-<<em>level</em>>/</code>
-</p>
-
-<p>You can easily create new Android projects with the downloaded samples, modify them
-if you'd like, and then run them on an emulator or device. </p>
-
-<p>For example, if you are developing in Eclipse with the ADT Plugin, you can
-create a project for the "API Demos" sample app by starting a new Android
-Project, selecting "Create project from existing source", and then browsing to
-the <code><em><sdk></em>/samples/android-<<em>level</em>>/ApiDemos</code>
-directory (the <code>samples</code> directory for the platform version you are
-using).</p>
-
-<p>If you are not working in Eclipse, you can create a project for the API Demos
-sample using the <code>android</code> tool, by executing this command:</p>
-
-<pre class="no-pretty-print">
-android update project -s -n API Demos -t <em><target_ID></em> -p <<em>path</em>></em>samples/android-<<em>level</em>>/ApiDemos/
-</pre>
-
-<h3 id="browsing">Browsing the Sample Code</h3>
-
-<p>For your convenience, the SDK provides browseable source code for the latest
-versions of the samples. You can use your browser to navigate through the
-structure of each sample and look at the source code in each of its files. </p>
-
-<p>To browse the samples, go to the <a
-href="{@docRoot}resources/samples/index.html">List of Sample Apps</a> first.
-From there you can read a short summary of each sample application and what
-types of concepts, features, or APIs it includes. Then, use the links provided
-to move through the directories and files of each sample. The browseable source
-is generated from the same source code that is downloadable through the Android
-SDK Manager, as described above. </p>
-
-<p>The browseable samples files are available online, at the Android Developers
-site only and are not included in the downloadable offline documentation.
-Note that, although samples for several platform versions are available for
-download, only the samples for the latest platform version are browseable online.
-</p>
-
-
-<h3 id="more">More Sample Code</h3>
-
-<p>If you are looking for more sample code, check out
-<a href="http://code.google.com/p/apps-for-android/">apps-for-android</a>, a
-collection of open source applications that demonstrate various Android APIs.</p>
-
-
diff --git a/docs/html/resources/samples/index.jd b/docs/html/resources/samples/index.jd
deleted file mode 100644
index acb80e82..0000000
--- a/docs/html/resources/samples/index.jd
+++ /dev/null
@@ -1,11 +0,0 @@
-page.title=List of Sample Apps
-@jd:body
-
-<script type="text/javascript">
- window.location = toRoot + "resources/browser.html?tag=sample";
-</script>
-
-<p><strong>This document has moved. Please go to <a
-href="http://developer.android.com/resources/browser.html?tag=sample">List of Sample
-Apps</a>.</strong></p>
-
diff --git a/docs/html/resources/topics.jd b/docs/html/resources/topics.jd
deleted file mode 100644
index b5960ff..0000000
--- a/docs/html/resources/topics.jd
+++ /dev/null
@@ -1,72 +0,0 @@
-page.title=Technical Resource Topics
-@jd:body
-
-<style type="text/css">
- #resource-topic-table td {
- border: 0;
- padding: 0;
- margin: 0;
- padding-left: 1em;
- width: 18em;
- }
-
- #resource-topic-table ul {
- padding: 0;
- margin: 0;
- }
-
- #resource-topic-table li {
- list-style: none;
- margin: 0;
- padding: 0;
- }
-</style>
-
-<p>
-You can browse the list of technical resources by topic by clicking on the
-links below. Over time, as more topics are added, they will be added to the
-list below.
-</p>
-
-<noscript>
- <p class="note"><strong>Error:</strong>
- You must have JavaScript enabled to view this page. Resources are also
- available offline in the SDK.
- </p>
-</noscript>
-
-<table id="resource-topic-table">
- <tr></tr>
-</table>
-
-<script type="text/javascript">
-<!--
-(function() {
- var topics = [];
- for (var topic in ANDROID_TAGS['topic']) {
- topics.push({name:topic,title:ANDROID_TAGS['topic'][topic]});
- }
- topics.sort(function(x,y){ return (x.title < y.title) ? -1 : 1; });
- var topicParent = null;
- for (var i = 0; i < topics.length; i++) {
- if (topicParent == null || i % 10 == 0) {
- // create a new column
- topicParent = $('ul', $('<td><ul>').appendTo('#resource-topic-table tr'));
- }
-
- topicParent.append(
- $('<li>').append(
- $('<h3>').append(
- $('<a>')
- .attr('href', toRoot + "resources/browser.html?tag=" + topics[i].name)
- .append($('<span>')
- .addClass('en')
- .html(topics[i].title)
- )
- )
- )
- );
- }
-})();
-//-->
-</script>
\ No newline at end of file
diff --git a/docs/html/resources/tutorials/hello-world.jd b/docs/html/resources/tutorials/hello-world.jd
deleted file mode 100644
index 70ba06c..0000000
--- a/docs/html/resources/tutorials/hello-world.jd
+++ /dev/null
@@ -1,607 +0,0 @@
-page.title=Hello, World
-parent.title=Tutorials
-parent.link=../browser.html?tag=tutorial
-@jd:body
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#platform">Install a Platform</a></li>
- <li><a href="#avd">Create an AVD</a></li>
- <li><a href="#create">Create the Project</a></li>
- <li><a href="#ui">Construct the UI</a></li>
- <li><a href="#run">Run the Code</a></li>
- <li><a href="#upgrading">Upgrade the UI to an XML Layout</a></li>
- <li><a href="#debugging">Debug Your Project</a></li>
- <li><a href="#noeclipse">Creating the Project Without Eclipse</a></li>
- </ol>
- </div>
-</div>
-
-<p>As a developer, you know that the first impression of a development framework is how easy it is
-to write "Hello, World." Well, on Android, it's pretty easy. It's particularly easy if you're using
-Eclipse as your IDE, because we've provided a great plugin that handles your project creation and
-management to greatly speed up your development cycles.</p>
-
-<p>This tutorial assumes that you're using Eclipse. If you're using the command line, see
-<a href="{@docRoot}guide/developing/building/building-cmdline.html">Building and Running from the
-Command Line</a>. You can then return to this tutorial and ignore anything about Eclipse.</p>
-
-<p>Before you start, you should already have the SDK installed, and if you're
-using Eclipse, you should have installed the ADT plugin as well. If you have not
-installed these, see <a href="{@docRoot}sdk/installing.html">Installing the
-Android SDK</a> and return here when you've completed the installation.</p>
-
-<h2 id="platform">Install a Platform</h2>
-
-<p>To run the Hello World application, you need to install at least one Android
-platform in your SDK environment. If you have not already performed this step,
-you need to do it now.</p>
-
-<p>To install a platform in Eclipse:</p>
-
-<ol>
-
- <li>In the Android SDK Manager, choose <strong>Available
-Packages</strong> in the left panel.</li>
-
-<li>In the right panel, expand the Android Repository list to display
-the components available for installation.</li>
-
- <li>Select at least one platform to install, and click <strong>Install
-Selected</strong>. If you aren't sure which platform to install, use the latest
-version.</li>
-</ol>
-
-<h2 id="avd">Create an AVD</h2>
-
-<div class="sidebox-wrapper">
- <div class="sidebox">
- <p>To learn more about how to use AVDs and the options
- available to you, see <a href="{@docRoot}guide/developing/devices/index.html">Managing
- Virtual Devices</a>.</p>
- </div>
-</div>
-
-<p>In this tutorial, you will run your application in the Android Emulator.
-Before you can launch the emulator, you must create an
-Android Virtual Device (AVD). An AVD defines the system image and
-device settings used by the emulator.</p>
-
-
-
-<p>To create an AVD:</p>
-<ol>
- <li>In Eclipse, select <strong>Window > AVD Manager</strong>.</li>
- <li>Select <strong>Virtual Devices</strong> in the left panel.</li>
-
- <li>Click <strong>New...</strong>.
- <p>The <strong>Create New AVD</strong> dialog appears.</p>
- </li>
- <li>Type the name of the AVD, such as "my_avd".</li>
- <li>Choose a target.
- <p>The target is the platform (that is, the version of the Android SDK, such as 2.3.3) you want
- to run on the emulator. For this tutorial, choose the latest platform that you have installed
- and ignore the rest of the fields.</p>
- </li>
- <li>Click <strong>Create AVD</strong>.</li>
-</ol>
-<h2 id="create">Create a New Android Project</h2>
-
-<p>After you've created an AVD you can move to the next step and start a new Android project in
-Eclipse.</p>
-
-<ol>
- <li>In Eclipse, select <strong>File > New > Project...</strong>.
- <p>If the ADT
- Plugin for Eclipse has been successfully installed, the resulting dialog
- should have a folder labeled "Android" which should contain
- "Android Project". (After you create one or more Android projects, an entry for
- "Android XML File" will also be available.)</p>
- </li>
-
- <li>Select "Android Project" and click <strong>Next</strong>.<br/>
- <a href="images/hello_world_0.png"><img src="images/hello_world_0.png" style="height:230px" alt="" /></a>
- </li>
-
- <li>Fill in the project details with the following values:
- <ul>
- <li><em>Project name:</em> HelloAndroid</li>
- <li><em>Build Target:</em> Select a platform version that is equal to or lower than the
- target you chose for your AVD.</li>
- <li><em>Application name:</em> Hello, Android</li>
- <li><em>Package name:</em> com.example.helloandroid (or your own private namespace)</li>
- <li><em>Create Activity:</em> HelloAndroid</li>
- </ul>
- <p>Click <strong>Finish</strong>.</p>
-
- <a href="images/hello_world_1.png"><img src="images/hello_world_1.png" style="height:400px" alt="" /></a>
-
- <p>Here is a description of each field:</p>
-
- <dl>
- <dt><em>Project Name</em></dt>
- <dd>This is the Eclipse project name — the name of the directory
- that contains the project files.</dd>
- <dt><em>Build Target</em></dt>
- <dd>This is the version of the Android SDK that you're using to build your
- application. For example, if you choose Android 2.1, your application will be
- compiled against the Android 2.1 platform library. The target you choose here
- does not have to match the target you chose for your AVD; however, the target must
- be equal to or lower than the target you chose for your AVD. Android
- applications are forward-compatible, which means an application will run on the
- platform against which it is built as well as all platforms that are released in the
- future. For example, an application that is built against the 2.1 platform library
- will run normally on an AVD or device that is running the 2.3.3. The reverse is not
- true.</dd>
- <dt><em>Application Name</em></dt>
- <dd>This is the human-readable title for your application — the name that
- appears on the Android device.</dd>
- <dt><em>Package Name</em></dt>
- <dd>This is the package namespace (following the same rules as for
- packages in the Java programming language) that you want all your source code to
- reside under. This also sets the package name under which the stub
- Activity is generated.
- <p>Your package name must be unique across
- all packages installed on the Android system; for this reason, it's
- important to use a standard domain-style package for your
- applications. The example above uses the "com.example" namespace, which is
- a namespace reserved for example documentation —
- when you develop your own applications, you should use a namespace that's
- appropriate to your organization or entity.</p></dd>
- <dt><em>Create Activity</em></dt>
- <dd>This is the name for the class stub that is generated by the plugin.
- This is a subclass of Android's {@link android.app.Activity} class. An
- Activity is simply a class that can run and do work. It can create a UI if it
- chooses, but it doesn't need to. As the checkbox suggests, this is optional, but an
- Activity is almost always used as the basis for an application.</dd>
- <dt><em>Min SDK Version</em></dt>
- <dd>This value specifies the minimum API Level on which your application will run.
- The <em>Min SDK Version</em> should be the same as the <em>Build Target</em> you
- chose. For example, if the <em>Build Target</em> is Android 2.1, then the <em>Min
- SDK Version</em> should be 7 or lower (it can never be higher than 7). For more
- information, see
- <a href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a>.
- </dd>
- </dl>
-
- <p><em>Other fields</em>: The checkbox for "Use default location" allows you to change
- the location on disk where the project's files are generated and stored.</p>
- </li>
-</ol>
-
-<p>Your Android project is now ready. It should be visible in the Package Explorer on the left. Open
-the <code>HelloAndroid.java</code> file, located inside <em>HelloAndroid > src >
-com.example.helloandroid</em>). It should look like this:</p>
-
-<pre>
-package com.example.helloandroid;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class HelloAndroid extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- }
-}</pre>
-
-<p>Notice that the class is based on the {@link android.app.Activity} class. An Activity is a
-single application entity that is used to perform actions. An application may have many separate
-activities, but the user interacts with them one at a time. The
-{@link android.app.Activity#onCreate(Bundle) onCreate()} method
-is called by the Android system when your Activity starts —
-it is where you should perform all initialization and UI setup. An activity is not required to
-have a user interface, but usually does.</p>
-
-<p>Now let's modify some code! </p>
-
-
-<h2 id="ui">Construct the UI</h2>
-
-<p>Take a look at the revised code below and then make the same changes to your HelloAndroid class.
-The bold items are lines that have been added.</p>
-
-<pre>
-package com.example.helloandroid;
-
-import android.app.Activity;
-import android.os.Bundle;
-<strong>import android.widget.TextView;</strong>
-
-public class HelloAndroid extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- <strong>TextView tv = new TextView(this);
- tv.setText("Hello, Android");
- setContentView(tv);</strong>
- }
-}</pre>
-
-<p class="note"><strong>Tip:</strong> An easy way to add import packages to your project is
-to press <strong>Ctrl-Shift-O</strong> (<strong>Cmd-Shift-O</strong>, on Mac). This is an Eclipse
-shortcut that identifies missing packages based on your code and adds them for you. You may have
-to expand the <code>import</code> statements in your code for this to work.</p>
-
-<p>An Android user interface is composed of hierarchies of objects called
-Views. A {@link android.view.View} is a drawable object used as an element in your UI layout,
-such as a button, image, or (in this case) a text label. Each of these objects is a subclass
-of the View class and the subclass that handles text is {@link android.widget.TextView}.</p>
-
-<p>In this change, you create a TextView with the class constructor, which accepts
-an Android {@link android.content.Context} instance as its parameter. A
-Context is a handle to the system; it provides services like
-resolving resources, obtaining access to databases and preferences, and so
-on. The Activity class inherits from Context, and because your
-HelloAndroid class is a subclass of Activity, it is also a Context. So, you can
-pass <code>this</code> as your Context reference to the TextView.</p>
-
-<p>Next, you define the text content with
-{@link android.widget.TextView#setText(CharSequence) setText()}.</p>
-
-<p>Finally, you pass the TextView to
-{@link android.app.Activity#setContentView(View) setContentView()} in order to
-display it as the content for the Activity UI. If your Activity doesn't
-call this method, then no UI is present and the system will display a blank
-screen.</p>
-
-<p>There it is — "Hello, World" in Android! The next step, of course, is
-to see it running.</p>
-
-
-<h2 id="run">Run the Application</h2>
-
-<p>The Eclipse plugin makes it easy to run your applications:</p>
-
-<ol>
- <li>Select <strong>Run > Run</strong>.</li>
- <li>Select "Android Application".</li>
-</ol>
-
-<div class="sidebox-wrapper">
- <div class="sidebox">
- <p>To learn more about creating and editing run configurations in Eclipse, refer to
- <a href="{@docRoot}guide/developing/eclipse-adt.html#RunConfig">Developing In Eclipse,
- with ADT</a>.</p>
- </div>
-</div>
-
-<p>The Eclipse plugin automatically creates a new run configuration for your project
-and then launches the Android Emulator. Depending on your environment, the Android
-emulator might take several minutes to boot fully, so please be patient. When the
-emulator is booted, the Eclipse plugin installs your application
-and launches the default Activity. You should now see something like this:</p>
-
- <a href="images/hello_world_5.png"><img src="images/hello_world_5.png" style="height:230px" alt="" /></a>
-
-<p>The "Hello, Android" you see in the grey bar is actually the application title. The Eclipse plugin
-creates this automatically (the string is defined in the <code>res/values/strings.xml</code> file and referenced
-by your <code>AndroidManifest.xml</code> file). The text below the title is the actual text that you have
-created in the TextView object.</p>
-
-<p>That concludes the basic "Hello World" tutorial, but you should continue reading for some more
-valuable information about developing Android applications.</p>
-
-
-<h2 id="upgrading">Upgrade the UI to an XML Layout</h2>
-
-<p>The "Hello, World" example you just completed uses what is called a "programmatic"
-UI layout. This means that you constructed and built your application's UI
-directly in source code. If you've done much UI programming, you're
-probably familiar with how brittle that approach can sometimes be: small
-changes in layout can result in big source-code headaches. It's also
-easy to forget to properly connect Views together, which can result in errors in
-your layout and wasted time debugging your code.</p>
-
-<p>That's why Android provides an alternate UI construction model: XML-based
-layout files. The easiest way to explain this concept is to show an
-example. Here's an XML layout file that is identical in behavior to the
-programmatically-constructed example:</p>
-
-<pre><?xml version="1.0" encoding="utf-8"?>
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/textview"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:text="@string/hello"/></pre>
-
-<p>The general structure of an Android XML layout file is simple: it's a tree
-of XML elements, wherein each node is the name of a View class
-(this example, however, is just one View element). You can use the
-name of any class that extends {@link android.view.View} as an element in your XML layouts,
-including custom View classes you define in your own code. This
-structure makes it easy to quickly build up UIs, using a more simple
-structure and syntax than you would use in a programmatic layout. This model is inspired
-by the web development model, wherein you can separate the presentation of your
-application (its UI) from the application logic used to fetch and fill in data.</p>
-
-<p>In the above XML example, there's just one View element: the <code>TextView</code>,
-which has five XML attributes. Here's a summary of what they mean:</p>
-
-<table>
- <tbody>
- <tr>
- <th>
- Attribute
- </th>
- <th>
- Meaning
- </th>
- </tr>
- <tr>
- <td>
- <code>xmlns:android</code>
- </td>
- <td>
- This is an XML namespace declaration that tells the Android tools that you are going to refer to common attributes defined in the Android namespace. The outermost tag in every Android layout file must have this attribute.<br>
- </td>
- </tr>
- <tr>
- <td>
- <code>android:id</code>
- </td>
- <td>
- This attribute assigns a unique identifier to the <code>TextView</code> element.
- You can use the assigned ID to reference this View from your source code or from other
- XML resource declarations.
- </td>
- </tr>
- <tr>
- <td>
- <code>android:layout_width</code>
- </td>
- <td>
- This attribute defines how much of the available width on the screen this View should consume.
- In this case, it's the only View so you want it to take up the entire screen, which is what a value of "fill_parent" means.<br>
- </td>
- </tr>
- <tr>
- <td>
- <code>android:layout_height</code>
- </td>
- <td>
- This is just like android:layout_width, except that it refers to available screen height.
- </td>
- </tr>
- <tr>
- <td>
- <code>android:text</code>
- </td>
- <td>
- This sets the text that the TextView should display. In this example, you use a string
- resource instead of a hard-coded string value.
- The <em>hello</em> string is defined in the <em>res/values/strings.xml</em> file. This is the
- recommended practice for inserting strings to your application, because it makes the localization
- of your application to other languages graceful, without need to hard-code changes to the layout file.
- For more information, see <a href="{@docRoot}guide/topics/resources/resources-i18n.html">Resources
- and Internationalization</a>.
- </td>
- </tr>
- </tbody>
-</table>
-
-
-<p>These XML layout files belong in the <code>res/layout/</code> directory of your project. The "res" is
-short for "resources" and the directory contains all the non-code assets that
-your application requires. In addition to layout files, resources also include assets
-such as images, sounds, and localized strings.</p>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <h2>Landscape layout</h2>
- <p>When you want a different design for landscape, put your layout XML file
- inside /res/layout-land. Android will automatically look here when the layout changes.
- Without this special landscape layout defined, Android will stretch the default layout.</p>
-</div>
-</div>
-
-<p>The Eclipse plugin automatically creates one of these layout files for you: main.xml.
-In the "Hello World" application you just completed, this file was ignored and you created a
-layout programmatically. This was meant to teach you more
-about the Android framework, but you should almost always define your layout
-in an XML file instead of in your code.
-The following procedures will instruct you how to change your
-existing application to use an XML layout.</p>
-
-<ol>
- <li>In the Eclipse Package Explorer, expand the
-<code>/res/layout/</code> folder and open <code>main.xml</code> (once opened, you might need to click
-the "main.xml" tab at the bottom of the window to see the XML source). Replace the contents with
-the following XML:
-
-<pre><?xml version="1.0" encoding="utf-8"?>
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/textview"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:text="@string/hello"/></pre>
-<p>Save the file.</p>
-</li>
-
-<li>Inside the <code>res/values/</code> folder, open <code>strings.xml</code>.
-This is where you should save all default text strings for your user interface. If you're using Eclipse, then
-ADT will have started you with two strings, <em>hello</em> and <em>app_name</em>.
-Revise <em>hello</em> to something else. Perhaps "Hello, Android! I am a string resource!"
-The entire file should now look like this:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string name="hello">Hello, Android! I am a string resource!</string>
- <string name="app_name">Hello, Android</string>
-</resources>
-</pre>
-</li>
-
-<li>Now open and modify your <code>HelloAndroid</code> class and use the
-XML layout. Edit the file to look like this:
-<pre>
-package com.example.helloandroid;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class HelloAndroid extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- }
-}</pre>
-
-<p>When you make this change, type it by hand to try the
-code-completion feature. As you begin typing "R.layout.main" the plugin will offer you
-suggestions. You'll find that it helps in a lot of situations.</p>
-
-<p>Instead of passing <code>setContentView()</code> a View object, you give it a reference
-to the layout resource.
-The resource is identified as <code>R.layout.main</code>, which is actually a compiled object representation of
-the layout defined in <code>/res/layout/main.xml</code>. The Eclipse plugin automatically creates this reference for
-you inside the project's R.java class. If you're not using Eclipse, then the R.java class will be generated for you
-when you run Ant to build the application. (More about the R class in a moment.)</p>
-</li>
-</ol>
-
-<p>Now re-run your application — because you've created a launch configuration, all
-you need to do is click the green arrow icon to run, or select
-<strong>Run > Run History > Android Activity</strong>. Other than the change to the TextView
-string, the application looks the same. After all, the point was to show that the two different
-layout approaches produce identical results.</p>
-
-<p class="note"><strong>Note:</strong> You may have to unlock the screen on the emulator to see
-your application — just as you would unlock the screen on a device. If you have problems
-running the emulator, see <a href="{@docRoot}guide/developing/devices/emulator.html">Using the
-Android Emulator</a>.</p>
-
-<p>Continue reading for an introduction
-to debugging and a little more information on using other IDEs. When you're ready to learn more,
-read <a href="{@docRoot}guide/topics/fundamentals.html">Application
-Fundamentals</a> for an introduction to all the elements that make Android applications work.
-Also refer to the <a href="{@docRoot}guide/index.html">Developer's Guide</a>
-introduction page for an overview of the <em>Dev Guide</em> documentation.</p>
-
-
-<div class="special">
-<h3>R class</h3>
-<p>In Eclipse, open the file named <code>R.java</code> (in the <code>gen/</code> [Generated Java Files] folder).
-It should look something like this:</p>
-
-<pre>
-package com.example.helloandroid;
-
-public final class R {
- public static final class attr {
- }
- public static final class drawable {
- public static final int icon=0x7f020000;
- }
- public static final class id {
- public static final int textview=0x7f050000;
- }
- public static final class layout {
- public static final int main=0x7f030000;
- }
- public static final class string {
- public static final int app_name=0x7f040001;
- public static final int hello=0x7f040000;
- }
-}
-</pre>
-
-<p>A project's <code>R.java</code> file is an index into all the resources defined in the
-file. You use this class in your source code as a sort of short-hand
-way to refer to resources you've included in your project. This is
-particularly powerful with the code-completion features of IDEs like Eclipse
-because it lets you quickly and interactively locate the specific reference
-you're looking for.</p>
-
-<p>It's possible yours looks slightly different than this (perhaps the hexadecimal values are
-different).
-For now, notice the inner class named "layout", and its
-member field "main". The Eclipse plugin noticed the XML
-layout file named main.xml and generated a class for it here. As you add other
-resources to your project (such as strings in the <code>res/values/string.xml</code> file or drawables inside
-the <code>res/drawable/</code> directory) you'll see <code>R.java</code> change to keep up.</p>
-<p>When not using Eclipse, this class file will be generated for you at build time (with the Ant tool).</p>
-<p><em>You should never edit this file by hand.</em></p>
-</div>
-
-<h2 id="debugging">Debug Your Project</h2>
-
-<p>The Android Plugin for Eclipse also has excellent integration with the Eclipse
-debugger. To demonstrate this, introduce a bug into
-your code. Change your HelloAndroid source code to look like this:</p>
-
-<pre>
-package com.example.helloandroid;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class HelloAndroid extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- Object o = null;
- o.toString();
- setContentView(R.layout.main);
- }
-}</pre>
-
-<p>This change simply introduces a NullPointerException into your code. If
-you run your application again, you'll eventually see this:</p>
-
- <a href="images/hello_world_8.png"><img src="images/hello_world_8.png" style="height:230px" alt="" /></a>
-
-<p>Press "Force Quit" to terminate the application and close the emulator window.</p>
-
-<p>To find out more about the error, set a breakpoint in your source code
-on the line <code>Object o = null;</code> (double-click on the marker bar next to the source code line). Then select <strong>Run > Debug History > Hello,
-Android</strong> from the menu to enter debug mode. Your app will restart in the
-emulator, but this time it will suspend when it reaches the breakpoint you
-set. You can then step through the code in Eclipse's Debug Perspective,
-just as you would for any other application.</p>
-
- <a href="images/hello_world_9.png"><img src="images/hello_world_9.png" style="height:230px" alt="" /></a>
-
-
-<h2 id="noeclipse">Creating the Project without Eclipse</h2>
-
- <p>If you don't use Eclipse (such as if you prefer another IDE, or simply use text
- editors and command line tools) then the Eclipse plugin can't help you.
- Don't worry though — you don't lose any functionality just because you don't
- use Eclipse.</p>
-
- <p>The Android Plugin for Eclipse is really just a wrapper around a set of tools
- included with the Android SDK. (These tools, like the emulator, aapt, adb,
- ddms, and others are <a href="{@docRoot}guide/developing/tools/index.html">documented elsewhere.</a>)
- Thus, it's possible to
- wrap those tools with another tool, such as an 'ant' build file.</p>
-
- <p>The Android SDK includes a tool named "android" that can be
- used to create all the source code and directory stubs for your project, as well
- as an ant-compatible <code>build.xml</code> file. This allows you to build your project
- from the command line, or integrate it with the IDE of your choice.</p>
-
- <p>For example, to create a HelloAndroid project similar to the one created
- in Eclipse, use this command:</p>
-
- <pre>
-android create project \
- --package com.example.helloandroid \
- --activity HelloAndroid \
- --target 2 \
- --path <em><path-to-your-project></em>/HelloAndroid
-</pre>
-
- <p>This creates the required folders and files for the project at the location
- defined by the <em>path</em>.</p>
-
- <p>For more information on how to use the SDK tools to create and build projects, please read
-<a href="{@docRoot}guide/developing/other-ide.html">Developing in Other IDEs</a>.</p>
\ No newline at end of file
diff --git a/docs/html/resources/tutorials/index.html b/docs/html/resources/tutorials/index.html
deleted file mode 100644
index 4881acf..0000000
--- a/docs/html/resources/tutorials/index.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=../index.html">
-</head>
-<body>
-<a href="../index.html">click here</a> if you are not redirected.
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/html/resources/tutorials/localization/index.jd b/docs/html/resources/tutorials/localization/index.jd
deleted file mode 100755
index de4433b..0000000
--- a/docs/html/resources/tutorials/localization/index.jd
+++ /dev/null
@@ -1,595 +0,0 @@
-page.title=Hello, L10N
-parent.title=Tutorials
-parent.link=../../browser.html?tag=tutorial
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#unlocalized">Create an Unlocalized App</a>
- <ol>
- <li><a href="#create">Create the Project and Layout</a></li>
- <li><a href="#default">Create Default Resources</a></li>
- </ol>
- </li>
- <li><a href="#run">Run the Unlocalized App</a></li>
- <li><a href="#plan">Plan the Localization</a></li>
- <li><a href="#localize">Localize the App</a>
- <ol>
- <li><a href="#localize_strings">Localize the Strings</a></li>
- <li><a href="#localize_images">Localize the Images</a></li>
- </ol>
- </li>
- <li><a href="#test_localized">Run and Test the Localized App</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
-<li>{@link android.widget.Button}</li>
-<li>{@link android.widget.TextView}</li>
-<li>{@link android.app.AlertDialog}</li>
-</ol>
- </div>
-</div>
-
-<p>In this tutorial, we will create a Hello, L10N application that uses the
-Android framework to selectively load resources. Then we will localize the
-application by adding resources to the <code>res/</code> directory. </p>
-
-<p>This tutorial uses the practices described in the <a
-href="{@docRoot}guide/topics/resources/localization.html">Localization</a>
-document. </p>
-
-
-<h2 id="unlocalized">Create an Unlocalized Application</h2>
-
-<p>The first version of the Hello, L10N application will use only the default
-resource directories (<code>res/drawable</code>, <code>res/layout</code>, and
-<code>res/values</code>). These resources are not localized — they are the
-graphics, layout, and strings that we expect the application to use most often.
-When a user runs the application in the default locale, or in a locale that the
-application does not specifically support, the application will load resources
-from these default directories.</p>
-
-<p>The application consists of a simple user interface that displays two
-{@link android.widget.TextView} objects and a {@link android.widget.Button} image with a
- background image of a national flag. When clicked, the button displays an
-{@link android.app.AlertDialog} object that shows additional text. </p>
-
-<h3 id="create">Create the Project and Layout</h3>
-
-<p>For this application, the default language will be British English and the
-default location the United Kingdom. </p>
-
-<ol>
- <li>Start a new project and Activity called "HelloL10N." If you are
-using Eclipse, fill out these values in the New Android Project wizard:
- <ul>
- <li><em>Project name:</em> HelloL10N</li>
- <li><em>Application name:</em> Hello, L10N</li>
- <li><em>Package name:</em> com.example.hellol10n (or your own private
-namespace)</li>
- <li><em>Create Activity:</em> HelloL10N</li>
- <li><em>Min SDK Version:</em> 3</li>
- </ul>
- <p>The basic project contains a <code>res/</code> directory with
-subdirectories for the three most common types of resources: graphics
-(<code>res/drawable/</code>), layouts (<code>res/layout/</code>) and strings
-(<code>res/values/</code>). Most of the localization work you do later in this
-tutorial will involve adding more subdirectories to the <code>res/</code>
-directory.</p>
- <img src="{@docRoot}images/hello_l10n/plain_project.png" alt="plain project" width="194"
-height="229">
- </li>
- <li>Open the <code>res/layout/main.xml</code> file and replace it with the
-following code:
- <pre><?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
-<TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:text="@string/text_a"
- />
-<TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:text="@string/text_b"
- />
-<Button
- android:id="@+id/flag_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- />
-</LinearLayout>
- </pre>
-
- <p>The LinearLayout has two {@link android.widget.TextView} objects that will
-display localized text and one {@link android.widget.Button} that shows a flag.
-</p>
- </li>
-</ol>
-
-<h3 id="default">Create Default Resources</h3>
-
-<p>The layout refers to resources that need to be defined. </p>
-
-<ol>
- <li>Create default text strings. To do this, open the <code>res/values/strings.xml</code> file and replace it with the following code:<br>
- <pre><?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string name="app_name">Hello, L10N</string>
- <string name="text_a">Shall I compare thee to a summer"'"s day?</string>
- <string name="text_b">Thou art more lovely and more temperate.</string>
- <string name="dialog_title">No Localisation</string>
- <string name="dialog_text">This dialog box"'"s strings are not localised. For every locale, the text here will come from values/strings.xml.</string>
-</resources></pre>
-
- <p>This code provides British English text for each string that the application
-will use. When we localize this application, we will provide alternate text in
-German, French, and Japanese for some of the strings.</p>
- </li>
- <li>Add a default flag graphic to the <code>res/drawable</code> folder by
-saving <a href="../../../images/hello_l10n/flag.png">flag.png</a> as
-<code>res/drawable/flag.png</code>. When the application is not localized, it
-will show a British flag.<br>
-
- </li>
- <li>Open HelloL10N.java (in the <code>src/</code> directory) and add the
-following code inside the <code>onCreate()</code> method (after
-<code>setContentView</code>).
-
- <pre>// assign flag.png to the button, loading correct flag image for current locale
-Button b;
-(b = (Button)findViewById(R.id.flag_button)).setBackgroundDrawable(this.getResources().getDrawable(R.drawable.flag));
-
-// build dialog box to display when user clicks the flag
-AlertDialog.Builder builder = new AlertDialog.Builder(this);
-builder.setMessage(R.string.dialog_text)
- .setCancelable(false)
- .setTitle(R.string.dialog_title)
- .setPositiveButton("Done", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- dialog.dismiss();
- }
- });
-final AlertDialog alert = builder.create();
-
-// set click listener on the flag to show the dialog box
-b.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- alert.show();
- }
- });</pre>
-
- <p class="note"><strong>Tip:</strong> In Eclipse, use
-<strong>Ctrl-Shift-O</strong> (<strong>Cmd-Shift-O</strong>, on Mac) to find and
-add missing import packages to your project, then save the HelloL10N.java
-file.</p>
-
- <p>The code that you added does the following:</p>
-
- <ul>
- <li>It assigns the correct flag icon to the button.
- For now, no resources are defined other than the default, so this code
-will always assign the contents of <code>res/drawable/flag.png</code> (the
-British flag) as the flag icon, no matter what the locale. Once we add more
-flags for different locales, this code will sometimes assign a different flag.
-</li>
- <li>It creates an {@link android.app.AlertDialog} object and sets a click listener so that when the
-user clicks the button, the AlertDialog will display.
- We will not localize the dialog text;
-the AlertDialog will always display the <code>dialog_text</code> that is located
-within <code>res/values/strings.xml</code>. </li>
- </ul>
-
- </li>
-</ol>
-
-<p>The project structure now looks like this:</p>
-
- <img src="{@docRoot}images/hello_l10n/nonlocalized_project.png" alt="nonlocalized" width="394"
-height="320">
-
-<p class="note"><strong>Tip:</strong> If you will want to run the application on
-a device and not just on an emulator, open <code>AndroidManifest.xml</code> and
-add <code>android:debuggable="true"</code> inside the
-<code><application></code> element. For information about setting up the
-device itself so it can run applications from your system, see <a
-href="{@docRoot}guide/developing/device.html">Developing on a Device</a>.</p>
-
-
-<h2 id="run">Run the Unlocalized Application</h2>
-
-<p>Save the project and run the application to see how it works. No matter what
-locale your device or emulator is set to, the application runs the same way. It
-should look something like this:</p>
-
-<table border="0" cellspacing="0" cellpadding="30">
- <tr>
- <th scope="col">The unlocalized application, running in any locale:</th>
- <th scope="col">After clicking the flag, in any locale:</th>
- </tr>
- <tr>
- <td valign="top"><img src="{@docRoot}images/hello_l10n/nonlocalized_screenshot1.png"
-alt="nonlocalized" width="321" height="366"></td>
- <td><img src="{@docRoot}images/hello_l10n/nonlocalized_screenshot2.png" alt="nonlocalized2"
-width="321" height="366"></td>
- </tr>
-</table>
-<h2 id="plan">Plan the Localization</h2>
-<p>The first step in localizing an application is to plan how the application
-will render differently in different locales. In this application, the default
-locale will be the United Kingdom. We will add some locale-specific information
-for Germany, France, Canada, Japan, and the United States. Table 1 shows the
-plan for how the application will appear in different locales.</p>
-
-<p class="caption">Table 1</p>
-
-<table border="0" cellspacing="0" cellpadding="10">
- <tr>
- <th scope="col" valign="bottom">Region /<br />
- Language</th>
- <th scope="col">United Kingdom</th>
- <th scope="col">Germany</th>
- <th scope="col">France</th>
- <th scope="col">Canada</th>
- <th scope="col">Japan</th>
- <th scope="col">United States</th>
- <th scope="col">Other Location</th>
- </tr>
- <tr>
- <th scope="row"><br>
- English</th>
- <td> British English text; British flag <em>(default)</em></td>
- <td><em>-</em></td>
- <td><em>-</em></td>
- <td> British English text; Canadian flag</td>
- <td>-</td>
- <td> British English text; U.S. flag</td>
- <td> British English text; British flag <em>(default)</em></td>
- </tr>
- <tr>
- <th scope="row">German</th>
- <td>-</td>
- <td>German text for <code>app_name</code>, <code>text_a</code> and
-<code>text_b</code>; German flag</td>
- <td>-</td>
- <td>-</td>
- <td>-</td>
- <td>-</td>
- <td>German text for <code>app_name</code>, <code>text_a</code> and
-<code>text_b</code>; British flag</td>
- </tr>
- <tr>
- <th scope="row">French</th>
- <td>-</td>
- <td>-</td>
- <td>French text for <code>app_name</code>, <code>text_a</code> and
-<code>text_b</code>; French flag</td>
- <td>French text for <code>app_name</code>, <code>text_a</code> and
-<code>text_b</code>; Canadian flag</td>
- <td>-</td>
- <td>-</td>
- <td>French text for <code>app_name</code>, <code>text_a</code> and
-<code>text_b</code>; British flag</td>
- </tr>
- <tr>
- <th scope="row">Japanese</th>
- <td>-</td>
- <td>-</td>
- <td>-</td>
- <td>-</td>
- <td>Japanese text for <code>text_a</code> and <code>text_b</code>; Japanese
-flag</td>
- <td>-</td>
- <td>Japanese text for <code>text_a</code> and <code>text_b</code>; British
-flag</td>
- </tr>
- <tr>
- <th scope="row">Other Language</th>
- <td>-</td>
- <td>-</td>
- <td>-</td>
- <td>-</td>
- <td>-</td>
- <td>-</td>
- <td> British English text; British flag <em>(default)</em></td>
- </tr>
-</table>
-
-<p class="note"> Note that other behaviors are possible; for example, the
-application could support Canadian English or U.S. English text. But given the
-small amount of text involved, adding more versions of English would not make
-this application more useful.</p>
-
-<p>As shown in the table above, the plan calls for five flag icons in addition
-to the British flag that is already in the <code>res/drawable/</code> folder. It
-also calls for three sets of text strings other than the text that is in
-<code>res/values/strings.xml</code>.</p>
-
-<p>Table 2 shows where the needed text strings and flag icons will go, and
-specifies which ones will be loaded for which locales. (For more about the
-locale codes, <em></em>see <a
-href="{@docRoot}guide/topics/resources/resources-i18n.html#AlternateResources">
-Alternate Resources</a>.)</p>
-<p class="caption" id="table2">Table 2</p>
-
-<table border="1" cellspacing="0" cellpadding="5">
- <tr>
- <th scope="col">Locale Code</th>
- <th scope="col">Language / Country</th>
- <th scope="col">Location of strings.xml</th>
- <th scope="col">Location of flag.png</th>
- </tr>
- <tr>
- <td><em>Default</em></td>
- <td>English / United Kingdom</td>
- <td>res/values/</td>
- <td>res/drawable/</td>
- </tr>
- <tr>
- <td>de-rDE</td>
- <td>German / Germany</td>
- <td>res/values-de/</td>
- <td>res/drawable-de-rDE/</td>
- </tr>
- <tr>
- <td>fr-rFR</td>
- <td>French / France</td>
- <td>res/values-fr/</td>
- <td>res/drawable-fr-rFR/</td>
- </tr>
- <tr>
- <td>fr-rCA</td>
- <td>French / Canada</td>
- <td>res/values-fr/</td>
- <td>res/drawable-fr-rCA/</td>
- </tr>
- <tr>
- <td>en-rCA</td>
- <td>English / Canada</td>
- <td><em>(res/values/)</em></td>
- <td>res/drawable-en-rCA/</td>
- </tr>
- <tr>
- <td>ja-rJP</td>
- <td>Japanese / Japan</td>
- <td>res/values-ja/</td>
- <td>res/drawable-ja-rJP/</td>
- </tr>
- <tr>
- <td>en-rUS</td>
- <td>English / United States</td>
- <td><em>(res/values/)</em></td>
- <td>res/drawable-en-rUS/</td>
- </tr>
-</table>
-
-<p class="note"><strong>Tip: </strong>A folder qualifer cannot specify a region
-without a language. Having a folder named <code>res/drawable-rCA/</code>,
-for example, will prevent the application from compiling. </p>
-
-<p>At run time, the application will select a set of resources to load based on the locale
-that is set in the user's device. In cases where no locale-specific resources
-are available, the application will fall back on the defaults. </p>
-
-<p>For example, assume that the device's language is set to German and its
-location to Switzerland. Because this application does not have a
-<code>res/drawable-de-rCH/</code> directory with a <code>flag.png</code> file in it, the system
-will fall back on the default, which is the UK flag located in
-<code>res/drawable/flag.png</code>. The language used will be German. Showing a
-British flag to German speakers in Switzerland is not ideal, but for now we will
-just leave the behavior as it is. There are several ways you could improve this
-application's behavior if you wanted to:</p>
-
-<ul>
- <li>Use a generic default icon. In this application, it might be something
-that represents Shakespeare. </li>
- <li>Create a <code>res/drawable-de/</code> folder that includes an icon that
-the application will use whenever the language is set to German but the location
-is not Germany. </li>
-</ul>
-
-
-<h2 id="localize">Localize the Application</h2>
-
-<h3 id="localize_strings">Localize the Strings</h3>
-
-<p>The application requires three more <code>strings.xml</code> files, one
-each for German, French, and Japanese. To create these resource files within
-Eclipse:</p>
-
-<ol>
-<li>Select <strong>File</strong> > <strong>New</strong> > <strong>Android
-XML File</strong> to open the New Android XML File wizard. You can also open
-the wizard by clicking its icon in the toolbar:<br />
-<img src="{@docRoot}images/hello_l10n/xml_file_wizard_shortcut.png"
-alt="file_wizard_shortcut" width="297"
-height="90" style="margin:15px"></li>
- <li>Select L10N for the Project field, and type <code>strings.xml</code> into
-the File field. In the left-hand list, select Language, then click the right arrow.<br>
-<img src="{@docRoot}images/hello_l10n/xml_wizard1.png" alt="res_file_copy" width="335"
-height="406" style="margin:15px"></li>
- <li>Type <code>de</code> in the Language box and click Finish.<br>
- <img src="{@docRoot}images/hello_l10n/xml_wizard2.png" alt="res_file_copy" width="306"
-height="179">
-<p>A new file, <code>res/values-de/strings.xml</code>, now appears among the project
-files.</p></li>
-<li>Repeat the steps twice more, for the language codes <code>fr</code> and
- <code>ja</code>.
-Now the project includes these new skeleton files: <br />
- <code>res/<strong>values-de</strong>/strings.xml</code><br />
- <code>res/<strong>values-fr</strong>/strings.xml</code><br />
- <code>res/<strong>values-ja</strong>/strings.xml</code><br />
- </li>
- <li>Add localized text to the new files. To do
-this, open the <code>res/values-<em><qualifier></em>/strings.xml</code> files and
-replace the code as follows:</li>
-</ol>
-
-<table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <th scope="col">File</th>
- <th scope="col">Replace the contents with the following code:</th>
- </tr>
- <tr>
- <td><code>res/values-de/strings.xml</code></td>
- <td><pre><?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string name="app_name">Hallo, Lokalisierung</string>
- <string name="text_a">Soll ich dich einem Sommertag vergleichen,</string>
- <string name="text_b">Der du viel lieblicher und sanfter bist?</string>
-</resources></pre></td>
- </tr>
- <tr>
- <td><code>res/values-fr/strings.xml</code></td>
- <td><pre><?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string name="app_name">Bonjour, Localisation</string>
- <string name="text_a">Irai-je te comparer au jour d'été?</string>
- <string name="text_b">Tu es plus tendre et bien plus tempéré.</string>
-</resources> </pre></td>
- </tr>
- <tr>
- <td><code>res/values-ja/strings.xml</code></td>
- <td>
-<pre><?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string name="text_a">あなたをなにかにたとえるとしたら夏の一日でしょうか?</string>
- <string name="text_b">だがあなたはもっと美しく、もっとおだやかです。</string>
-</resources></pre></td>
- </tr>
-</table>
-
-<p class="note"><b>Tip:</b> In the
-<code>values-<em><qualifier></em>/strings.xml</code> files, you only need to
-include text for strings that are different from the default strings. For
-example, when the application runs on a device that is configured for Japanese,
-the plan is for <code>text_a</code> and <code>text_b</code> to be in Japanese
-while all the other text is in English, so
-<code>res/values-ja/strings.xml</code> only needs to include <code>text_a</code>
-and <code>text_b</code>.</p>
-
-<h3 id="localize_images">Localize the Images</h3>
-
-<p>As shown in <a href="#table2">Table 2</a>, the application needs six more
-drawable folders, each containing a <code>flag.png</code> icon. Add the needed
-icons and folders to your project:</p>
-
-<ol>
- <li>Save this <a href="../../../images/hello_l10n/drawable-de-rDE/flag.png">German flag icon</a>
-as <code>res/drawable-de-rDE/flag.png</code> in the application's project
-workspace.
- <p>For example:</p>
- <ol>
- <li>Click the link to open the flag image.</li>
- <li>Save the image in
-<code><em>your-workspace</em>/HelloL10N/res/drawable-de-rDE/</code> .</li>
- </ol>
- </li>
- <li>Save this <a href="../../../images/hello_l10n/drawable-fr-rFR/flag.png">French flag icon</a>
-as <code>res/drawable-fr-rFR/flag.png</code> in the application's project
-workspace. </li>
- <li>Save this <a href="../../../images/hello_l10n/drawable-fr-rCA/flag.png">Canadian flag icon</a>
-as <code>res/drawable-fr-rCA/flag.png</code> in the project workspace. </li>
- <li>Save the <a href="../../../images/hello_l10n/drawable-en-rCA/flag.png">Canadian flag icon</a>
-again, this time as <code>res/drawable-en-rCA/flag.png</code> in the project
-workspace. (Why not have just <em>one</em> folder that contains the Canadian
-flag? Because a folder qualifer cannot specify a region without a language.
-You cannot have a folder named <code>drawable-rCA/</code>; instead you must
-create two separate folders, one for each of the Canadian languages represented
-in the application.)</li>
- <li>Save this <a href="../../../images/hello_l10n/drawable-ja-rJP/flag.png">Japanese flag icon</a>
-as <code>res/drawable-ja-rJP/flag.png</code> in the project workspace. </li>
- <li>Save this <a href="../../../images/hello_l10n/drawable-en-rUS/flag.png">United States flag
-icon</a> as <code>res/drawable-en-rUS/flag.png</code> in the project workspace.
- </li>
-</ol>
-
-<p>If you are using Eclipse, refresh the project (F5). The new
-<code>res/drawable-<em><qualifier></em>/</code> folders should appear in the
-project view. </p>
-
-
-<h2 id="test_localized">Run and Test the Localized Application</h2>
-
-<p>Once you've added the localized string and image resources, you are ready to
- run the application and test its handling of them. To change the locale
- on a device or in the emulator, use the Settings
-application (Home > Menu > Settings > Locale & text > Select
-locale). Depending on how a device was configured, it might not offer any
-alternate locales via the Settings application, or might offer only a few. The
-emulator, on the other hand, will offer a selection of all the locales that are
-available in the Android system image. </p>
-
-<p>To set the emulator to a locale that is not available in the system image,
-use the Custom Locale application, which is available in the Application
-tab:</p>
-
-<p><img src="{@docRoot}images/hello_l10n/custom_locale_app.png" alt="custom locale app" width="163"
-height="158" style="margin-left:15px"></p>
-
-<p>To switch to a new locale, long-press a locale name:</p>
-
-<p><img src="{@docRoot}images/hello_l10n/using_custom_locale.png" alt="using custom locale"
-width="512" height="299" style="margin-left:15px"></p>
-
-<p>For a list of locales available on different versions of the Android platform,
-refer to the platform notes documents, listed under "Downloadable SDK Components"
-in the "SDK" tab. For example, <a
-href="{@docRoot}sdk/android-2.0.html#locs">Android 2.0 locales</a>.</p>
-
-<p>Run the application for each of the expected locales, plus one unexpected
-locale. Here are some of the results you should see:</p>
-
-<table border="0" cellspacing="0" cellpadding="05">
- <tr>
- <th scope="col">Locale</th>
- <th scope="col">Opening screen of application</th>
- </tr>
- <tr>
- <td>German / Germany
- <br />Specifically supported by the Hello, L10N application.</td>
- <td><img src="{@docRoot}images/hello_l10n/german_screenshot.png" alt="custom locale app"
-width="321" height="175" align="right"
-style="margin-left:10px;margin-right:20px"></td>
- </tr>
- <tr>
- <td>French / Canada
- <br />Specifically supported by the Hello, L10N application.</td>
- <td><img src="{@docRoot}images/hello_l10n/frenchCA_screenshot.png" alt="custom locale app"
-width="321" height="175" align="right"
-style="margin-left:10px;margin-right:20px"></td>
- </tr>
- <tr>
- <td>German / Switzerland
- <br />Only the language is specifically supported by
-the Hello, L10N application.</td>
- <td><img src="{@docRoot}images/hello_l10n/germanCH_screenshot.png" alt="custom locale app"
-width="321" height="175" align="right"
-style="margin-left:10px;margin-right:20px">`</td>
- </tr>
- <tr>
- <td>Japanese
- <br />Specifically supported by the Hello, L10N application.
- </td>
- <td><img src="{@docRoot}images/hello_l10n/japanese_screenshot.png" alt="custom locale app"
-width="321" height="220" align="right"
-style="margin-left:10px;margin-right:20px">`</td>
- </tr>
- <tr>
- <td>Romansh / Switzerland (custom locale <code>rm_CH</code>)
- <br />Not specifically supported by the Hello, L10N
-application, so the application uses the default resources.</td>
- <td><img src="{@docRoot}images/hello_l10n/romanshCH_screenshot.png" alt="custom locale app"
-width="321" height="175" align="right"
-style="margin-left:10px;margin-right:20px"></td>
- </tr>
-</table>
diff --git a/docs/html/resources/tutorials/notepad/index.jd b/docs/html/resources/tutorials/notepad/index.jd
index dd92184..1f37c41 100644
--- a/docs/html/resources/tutorials/notepad/index.jd
+++ b/docs/html/resources/tutorials/notepad/index.jd
@@ -44,11 +44,11 @@
<p>The tutorial assumes that you have some familiarity with basic Android
application concepts and terminology. If you are not, you
-should read <a href="{@docRoot}guide/topics/fundamentals.html">Application
+should read <a href="{@docRoot}guide/components/fundamentals.html">Application
Fundamentals</a> before continuing. </p>
<p>This tutorial also builds on the introductory information provided in the
-<a href="{@docRoot}resources/tutorials/hello-world.html">Hello World</a>
+<a href="{@docRoot}training/basics/firstapp/index.html">Building Your First App</a>
tutorial, which explains how to set up your Eclipse environment
for building Android applications. We recommend you complete the Hello World
tutorial before starting this one.</p>
diff --git a/docs/html/resources/tutorials/notepad/notepad-ex1.jd b/docs/html/resources/tutorials/notepad/notepad-ex1.jd
index cf7765e..13ab0a6 100644
--- a/docs/html/resources/tutorials/notepad/notepad-ex1.jd
+++ b/docs/html/resources/tutorials/notepad/notepad-ex1.jd
@@ -33,7 +33,7 @@
<p><code>Notepadv1</code> is a project that is provided as a starting point. It
takes care of some of the boilerplate work that you have already seen if you
- followed the <a href="{@docRoot}resources/tutorials/hello-world.html">Hello,
+ followed the <a href="{@docRoot}training/basics/firstapp/index.html">Hello,
World</a> tutorial.</p>
<ol>
diff --git a/docs/html/resources/tutorials/notepad/notepad-ex3.jd b/docs/html/resources/tutorials/notepad/notepad-ex3.jd
index 557738e..e31ecda 100644
--- a/docs/html/resources/tutorials/notepad/notepad-ex3.jd
+++ b/docs/html/resources/tutorials/notepad/notepad-ex3.jd
@@ -204,7 +204,7 @@
state it was in when it was killed.</p>
<p>
Activities have a <a
-href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">well-defined life
+href="{@docRoot}guide/components/activities.html#Lifecycle">well-defined life
cycle</a>.
Lifecycle events can happen even if you are not handing off control to
another Activity explicitly. For example, perhaps a call comes in to the
diff --git a/docs/html/resources/tutorials/notepad/notepad-extra-credit.jd b/docs/html/resources/tutorials/notepad/notepad-extra-credit.jd
index 0d59b56..d5fd771 100644
--- a/docs/html/resources/tutorials/notepad/notepad-extra-credit.jd
+++ b/docs/html/resources/tutorials/notepad/notepad-extra-credit.jd
@@ -65,6 +65,6 @@
<p>The Android Eclipse plugin not only offers excellent debugging support for
your application development, but also superb profiling support. You can also
-try using <a href="{@docRoot}guide/developing/tools/traceview.html">Traceview</a> to profile your application. If your application is running too slow, this can help you
+try using <a href="{@docRoot}tools/help/traceview.html">Traceview</a> to profile your application. If your application is running too slow, this can help you
find the bottlenecks and fix them.</p>
diff --git a/docs/html/resources/tutorials/opengl/opengl-es10.jd b/docs/html/resources/tutorials/opengl/opengl-es10.jd
deleted file mode 100644
index 2b44620..0000000
--- a/docs/html/resources/tutorials/opengl/opengl-es10.jd
+++ /dev/null
@@ -1,532 +0,0 @@
-page.title=OpenGL ES 1.0
-parent.title=Tutorials
-parent.link=../../browser.html?tag=tutorial
-@jd:body
-
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#creating">Create an Activity with GLSurfaceView</a></li>
- <li>
- <a href="#drawing">Draw a Shape on GLSurfaceView</a>
- <ol>
- <li><a href="#define-triangle">Define a Triangle</a></li>
- <li><a href="#draw-triangle">Draw the Triangle</a></li>
- </ol>
- </li>
- <li><a href="#projection-and-views">Apply Projection and Camera Views</a></li>
- <li><a href="#motion">Add Motion</a></li>
- <li><a href="#touch">Respond to Touch Events</a></li>
- </ol>
- <h2 id="code-samples-list">Related Samples</h2>
- <ol>
- <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-index.html">API Demos - graphics</a></li>
- <li><a
- href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-GLSurfaceViewActivity.html">OpenGL ES 1.0 Sample</a></li>
- <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-TouchRotateActivity.html">TouchRotateActivity</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/topics/graphics/opengl.html">3D with OpenGL</a></li>
- <li><a href="{@docRoot}resources/tutorials/opengl/opengl-es20.html">OpenGL
-ES 2.0</a></li>
- </ol>
- </div>
- </div>
-
-<p>This tutorial shows you how to create a simple Android application that uses the OpenGL ES 1.0
-API to perform some basic graphics operations. You'll learn how to:</p>
-
-<ul>
- <li>Create an activity using {@link android.opengl.GLSurfaceView} and {@link
-android.opengl.GLSurfaceView.Renderer}</li>
- <li>Create and draw a graphic object</li>
- <li>Define a projection to correct for screen geometry</li>
- <li>Define a camera view</li>
- <li>Rotate a graphic object</li>
- <li>Make graphics touch-interactive</li>
-</ul>
-
-<p>The Android framework supports both the OpenGL ES 1.0/1.1 and OpenGL ES 2.0 APIs. You should
-carefully consider which version of the OpenGL ES API (1.0/1.1 or 2.0) is most appropriate for your
-needs. For more information, see
-<a href="{@docRoot}guide/topics/graphics/opengl.html#choosing-version">Choosing an OpenGL API
-Version</a>. If you would prefer to use OpenGL ES 2.0, see the <a
-href="{@docRoot}resources/tutorials/opengl/opengl-es20.html">OpenGL ES 2.0 tutorial</a>.</p>
-
-<p>Before you start, you should understand how to create a basic Android application. If you do not
-know how to create an app, follow the <a href="{@docRoot}resources/tutorials/hello-world.html">Hello
-World Tutorial</a> to familiarize yourself with the process.</p>
-
-<h2 id="creating">Create an Activity with GLSurfaceView</h2>
-
-<p>To get started using OpenGL, you must implement both a {@link android.opengl.GLSurfaceView} and a
-{@link android.opengl.GLSurfaceView.Renderer}. The {@link android.opengl.GLSurfaceView} is the main
-view type for applications that use OpenGL and the {@link android.opengl.GLSurfaceView.Renderer}
-controls what is drawn within that view. (For more information about these classes, see the <a
-href="{@docRoot}guide/topics/graphics/opengl.html">3D with OpenGL</a> document.)</p>
-
-<p>To create an activity using {@code GLSurfaceView}:</p>
-
-<ol>
- <li>Start a new Android project that targets Android 1.6 (API Level 4) or higher.
- </li>
- <li>Name the project <strong>HelloOpenGLES10</strong> and make sure it includes an activity called
-{@code HelloOpenGLES10}.
- </li>
- <li>Modify the {@code HelloOpenGLES10} class as follows:
-<pre>
-package com.example.android.apis.graphics;
-
-import android.app.Activity;
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-
-public class HelloOpenGLES10 extends Activity {
-
- private GLSurfaceView mGLView;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- // Create a GLSurfaceView instance and set it
- // as the ContentView for this Activity.
- mGLView = new HelloOpenGLES10SurfaceView(this);
- setContentView(mGLView);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- // The following call pauses the rendering thread.
- // If your OpenGL application is memory intensive,
- // you should consider de-allocating objects that
- // consume significant memory here.
- mGLView.onPause();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- // The following call resumes a paused rendering thread.
- // If you de-allocated graphic objects for onPause()
- // this is a good place to re-allocate them.
- mGLView.onResume();
- }
-}
-
-class HelloOpenGLES10SurfaceView extends GLSurfaceView {
-
- public HelloOpenGLES10SurfaceView(Context context){
- super(context);
-
- // Set the Renderer for drawing on the GLSurfaceView
- setRenderer(new HelloOpenGLES10Renderer());
- }
-}
-</pre>
- <p class="note"><strong>Note:</strong> You will get a compile error for the {@code
-HelloOpenGLES10Renderer} class reference. That's expected; you will fix this error in the next step.
- </p>
-
- <p>As shown above, this activity uses a single {@link android.opengl.GLSurfaceView} for its
-view. Notice that this activity implements crucial lifecycle callbacks for pausing and resuming its
-work.</p>
-
- <p>The {@code HelloOpenGLES10SurfaceView} class in this example code above is just a thin wrapper
-for an instance of {@link android.opengl.GLSurfaceView} and is not strictly necessary for this
-example. However, if you want your application to monitor and respond to touch screen
-events—and we are guessing you do—you must extend {@link android.opengl.GLSurfaceView}
-to add touch event listeners, which you will learn how to do in the <a href="#touch">Reponding to
-Touch Events</a> section.</p>
-
- <p>In order to draw graphics in the {@link android.opengl.GLSurfaceView}, you must define an
-implementation of {@link android.opengl.GLSurfaceView.Renderer}. In the next step, you create
-a renderer class to complete this OpenGL application.</p>
- </li>
-
- <li>Create a new file for the following class {@code HelloOpenGLES10Renderer}, which implements
-the {@link android.opengl.GLSurfaceView.Renderer} interface:
-
-<pre>
-package com.example.android.apis.graphics;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.opengl.GLSurfaceView;
-
-public class HelloOpenGLES10Renderer implements GLSurfaceView.Renderer {
-
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
- // Set the background frame color
- gl.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
- }
-
- public void onDrawFrame(GL10 gl) {
- // Redraw background color
- gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
- }
-
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- gl.glViewport(0, 0, width, height);
- }
-
-}
-</pre>
- <p>This minimal implementation of {@link android.opengl.GLSurfaceView.Renderer} provides the
-code structure needed to use OpenGL drawing methods:
-<ul>
- <li>{@link
- android.opengl.GLSurfaceView.Renderer#onSurfaceCreated(javax.microedition.khronos.opengles.GL10,
- javax.microedition.khronos.egl.EGLConfig) onSurfaceCreated()} is called once to set up the
-{@link android.opengl.GLSurfaceView}
-environment.</li>
- <li>{@link
- android.opengl.GLSurfaceView.Renderer#onDrawFrame(javax.microedition.khronos.opengles.GL10)
- onDrawFrame()} is called for each redraw of the {@link
-android.opengl.GLSurfaceView}.</li>
- <li>{@link
- android.opengl.GLSurfaceView.Renderer#onSurfaceChanged(javax.microedition.khronos.opengles.GL10,
- int, int) onSurfaceChanged()} is called if the geometry of the {@link
-android.opengl.GLSurfaceView} changes, for example when the device's screen orientation
-changes.</li>
-</ul>
- </p>
- <p>For more information about these methods, see the <a
-href="{@docRoot}guide/topics/graphics/opengl.html">3D with OpenGL</a> document.
-</p>
- </li>
-</ol>
-
-<p>The code example above creates a simple Android application that displays a grey screen using
-OpenGL ES 1.0 calls. While this application does not do anything very interesting, by creating these
-classes, you have layed the foundation needed to start drawing graphic elements with OpenGL ES
-1.0.</p>
-
-<p>If you are familiar with the OpenGL ES APIs, these classes should give you enough information
-to use the OpenGL ES 1.0 API and create graphics. However, if you need a bit more help getting
-started with OpenGL, head on to the next sections for a few more hints.</p>
-
-<h2 id="drawing">Draw a Shape on GLSurfaceView</h2>
-
-<p>Once you have implemented a {@link android.opengl.GLSurfaceView.Renderer}, the next step is to
-draw something with it. This section shows you how to define and draw a triangle.</p>
-
-<h3 id="define-triangle">Define a Triangle</h3>
-
-<p>OpenGL allows you to define objects using coordinates in three-dimensional space. So, before you
- can draw a triangle, you must define its coordinates. In OpenGL, the typical way to do this is to
- define a vertex array for the coordinates.</p>
-
-<p>By default, OpenGL ES assumes a coordinate system where [0,0,0] (X,Y,Z) specifies the center of
- the {@link android.opengl.GLSurfaceView} frame, [1,1,0] is the top right corner of the frame and
-[-1,-1,0] is bottom left corner of the frame.</p>
-
-<p>To define a vertex array for a triangle:</p>
-
-<ol>
- <li>In your {@code HelloOpenGLES10Renderer} class, add new member variable to contain the
-vertices of a triangle shape:
-<pre>
- private FloatBuffer triangleVB;
-</pre>
- </li>
-
- <li>Create a method, {@code initShapes()} which populates this member variable:
-<pre>
- private void initShapes(){
-
- float triangleCoords[] = {
- // X, Y, Z
- -0.5f, -0.25f, 0,
- 0.5f, -0.25f, 0,
- 0.0f, 0.559016994f, 0
- };
-
- // initialize vertex Buffer for triangle
- ByteBuffer vbb = ByteBuffer.allocateDirect(
- // (# of coordinate values * 4 bytes per float)
- triangleCoords.length * 4);
- vbb.order(ByteOrder.nativeOrder());// use the device hardware's native byte order
- triangleVB = vbb.asFloatBuffer(); // create a floating point buffer from the ByteBuffer
- triangleVB.put(triangleCoords); // add the coordinates to the FloatBuffer
- triangleVB.position(0); // set the buffer to read the first coordinate
-
- }
-</pre>
- <p>This method defines a two-dimensional triangle with three equal sides.</p>
- </li>
- <li>Modify your {@code onSurfaceCreated()} method to initialize your triangle:
- <pre>
- public void onSurfaceCreated(GL10 gl, EGLConfig config) {
-
- // Set the background frame color
- gl.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
-
- // initialize the triangle vertex array
- initShapes();
- }
-</pre>
- <p class="caution"><strong>Caution:</strong> Shapes and other static objects should be initialized
- once in your {@code onSurfaceCreated()} method for best performance. Avoid initializing the
- new objects in {@code onDrawFrame()}, as this causes the system to re-create the objects
- for every frame redraw and slows down your application.
- </p>
- </li>
-
-</ol>
-
-<p>You have now defined a triangle shape, but if you run the application, nothing appears. What?!
-You also have to tell OpenGL to draw the triangle, which you'll do in the next section.
-</p>
-
-
-<h3 id="draw-triangle">Draw the Triangle</h3>
-
-<p>Before you can draw your triangle, you must tell OpenGL that you are using vertex arrays. After
-that setup step, you can call the drawing APIs to display the triangle.</p>
-
-<p>To draw the triangle:</p>
-
-<ol>
- <li>Add the {@code glEnableClientState()} method to the end of {@code onSurfaceCreated()} to
-enable vertex arrays.
-<pre>
- // Enable use of vertex arrays
- gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
-</pre>
- <p>At this point, you are ready to draw the triangle object in the OpenGL view.</p>
- </li>
-
- <li>Add the following code to the end of your {@code onDrawFrame()} method to draw the triangle.
-<pre>
- // Draw the triangle
- gl.glColor4f(0.63671875f, 0.76953125f, 0.22265625f, 0.0f);
- gl.glVertexPointer(3, GL10.GL_FLOAT, 0, triangleVB);
- gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 3);
-</pre>
- </li>
- <li id="squashed-triangle">Run the app! Your application should look something like this:
- </li>
-</ol>
-
-<img src="{@docRoot}images/opengl/helloopengl-es10-1.png">
-<p class="img-caption">
- <strong>Figure 1.</strong> Triangle drawn without a projection or camera view.
-</p>
-
-<p>There are a few problems with this example. First of all, it is not going to impress your
-friends. Secondly, the triangle is a bit squashed and changes shape when you change the screen
-orientation of the device. The reason the shape is skewed is due to the fact that the object is
-being rendered in a frame which is not perfectly square. You'll fix that problem using a projection
-and camera view in the next section.</p>
-
-<p>Lastly, because the triangle is stationary, the system is redrawing the object repeatedly in
-exactly the same place, which is not the most efficient use of the OpenGL graphics pipeline. In the
-<a href="#motion">Add Motion</a> section, you'll make this shape rotate and justify
-this use of processing power.</p>
-
-<h2 id="projection-and-views">Apply Projection and Camera View</h2>
-
-<p>One of the basic problems in displaying graphics is that Android device displays are typically
-not square and, by default, OpenGL happily maps a perfectly square, uniform coordinate
-system onto your typically non-square screen. To solve this problem, you can apply an OpenGL
-projection mode and camera view (eye point) to transform the coordinates of your graphic objects
-so they have the correct proportions on any display. For more information about OpenGL coordinate
-mapping, see <a href="{@docRoot}guide/topics/graphics/opengl.html#coordinate-mapping">Mapping
-Coordinates for Drawn Objects</a>.</p>
-
-<p>To apply projection and camera view transformations to your triangle:
-</p>
-<ol>
- <li>Modify your {@code onSurfaceChanged()} method to enable {@link
- javax.microedition.khronos.opengles.GL10#GL_PROJECTION GL10.GL_PROJECTION} mode, calculate the
- screen ratio and apply the ratio as a transformation of the object coordinates.
-<pre>
- public void onSurfaceChanged(GL10 gl, int width, int height) {
- gl.glViewport(0, 0, width, height);
-
- // make adjustments for screen ratio
- float ratio = (float) width / height;
- gl.glMatrixMode(GL10.GL_PROJECTION); // set matrix to projection mode
- gl.glLoadIdentity(); // reset the matrix to its default state
- gl.glFrustumf(-ratio, ratio, -1, 1, 3, 7); // apply the projection matrix
- }
-</pre>
- </li>
-
- <li>Next, modify your {@code onDrawFrame()} method to apply the {@link
-javax.microedition.khronos.opengles.GL10#GL_MODELVIEW GL_MODELVIEW} mode and set
-a view point using {@link android.opengl.GLU#gluLookAt(javax.microedition.khronos.opengles.GL10,
-float, float, float, float, float, float, float, float, float) GLU.gluLookAt()}.
-<pre>
- public void onDrawFrame(GL10 gl) {
- // Redraw background color
- gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
-
- // Set GL_MODELVIEW transformation mode
- gl.glMatrixMode(GL10.GL_MODELVIEW);
- gl.glLoadIdentity(); // reset the matrix to its default state
-
- // When using GL_MODELVIEW, you must set the view point
- GLU.gluLookAt(gl, 0, 0, -5, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
-
- // Draw the triangle
- ...
- }
-</pre>
- </li>
- <li>Run the updated application and you should see something like this:</li>
-</ol>
-
-<img src="{@docRoot}images/opengl/helloopengl-es10-2.png">
-<p class="img-caption">
- <strong>Figure 2.</strong> Triangle drawn with a projection and camera view applied.
-</p>
-
-<p>Now that you have applied this transformation, the triangle has three equal sides, instead of the
-<a href="#squashed-triangle">squashed triangle</a> in the earlier version.</p>
-
-<h2 id="motion">Add Motion</h2>
-
-<p>While it may be an interesting exercise to create static graphic objects with OpenGL ES, chances
-are you want at least <em>some</em> of your objects to move. In this section, you'll add motion to
-your triangle by rotating it.</p>
-
-<p>To add rotation to your triangle:</p>
-<ol>
- <li>Modify your {@code onDrawFrame()} method to rotate the triangle object:
-<pre>
- public void onDrawFrame(GL10 gl) {
- ...
- // When using GL_MODELVIEW, you must set the view point
- GLU.gluLookAt(gl, 0, 0, -5, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
-
- // Create a rotation for the triangle
- long time = SystemClock.uptimeMillis() % 4000L;
- float angle = 0.090f * ((int) time);
- gl.glRotatef(angle, 0.0f, 0.0f, 1.0f);
-
- // Draw the triangle
- ...
- }
-</pre>
- </li>
- <li>Run the application and your triangle should rotate around its center.</li>
-</ol>
-
-
-<h2 id="touch">Respond to Touch Events</h2>
-<p>Making objects move according to a preset program like the rotating triangle is useful for
-getting some attention, but what if you want to have users interact with your OpenGL graphics? In
-this section, you'll learn how listen for touch events to let users interact with objects in your
-{@code HelloOpenGLES10SurfaceView}.</p>
-
-<p>The key to making your OpenGL application touch interactive is expanding your implementation of
-{@link android.opengl.GLSurfaceView} to override the {@link
-android.view.View#onTouchEvent(android.view.MotionEvent) onTouchEvent()} to listen for touch events.
-Before you do that, however, you'll modify the renderer class to expose the rotation angle of the
-triangle. Afterwards, you'll modify the {@code HelloOpenGLES10SurfaceView} to process touch events
-and pass that data to your renderer.</p>
-
-<p>To make your triangle rotate in response to touch events:</p>
-
-<ol>
- <li>Modify your {@code HelloOpenGLES10Renderer} class to include a new, public member so that
-your {@code HelloOpenGLES10SurfaceView} class is able to pass new rotation values your renderer:
-<pre>
- public float mAngle;
-</pre>
- </li>
- <li>In your {@code onDrawFrame()} method, comment out the code that generates an angle and
-replace the {@code angle} variable with {@code mAngle}.
-<pre>
- // Create a rotation for the triangle (Boring! Comment this out:)
- // long time = SystemClock.uptimeMillis() % 4000L;
- // float angle = 0.090f * ((int) time);
-
- // Use the mAngle member as the rotation value
- gl.glRotatef(mAngle, 0.0f, 0.0f, 1.0f);
-</pre>
- </li>
- <li>In your {@code HelloOpenGLES10SurfaceView} class, add the following member variables.
-<pre>
- private final float TOUCH_SCALE_FACTOR = 180.0f / 320;
- private HelloOpenGLES10Renderer mRenderer;
- private float mPreviousX;
- private float mPreviousY;
-</pre>
- </li>
- <li>In the constructor method for {@code HelloOpenGLES10SurfaceView}, set the {@code mRenderer}
-member so you have a handle to pass in rotation input and set the render mode to {@link
-android.opengl.GLSurfaceView#RENDERMODE_WHEN_DIRTY}.
-<pre>
- public HelloOpenGLES10SurfaceView(Context context){
- super(context);
- // set the mRenderer member
- mRenderer = new HelloOpenGLES10Renderer();
- setRenderer(mRenderer);
-
- // Render the view only when there is a change
- setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
- }
-</pre>
- </li>
- <li>In your {@code HelloOpenGLES10SurfaceView} class, override the {@link
-android.view.View#onTouchEvent(android.view.MotionEvent) onTouchEvent()} method to listen for touch
-events and pass them to your renderer.
-<pre>
- @Override
- public boolean onTouchEvent(MotionEvent e) {
- // MotionEvent reports input details from the touch screen
- // and other input controls. In this case, you are only
- // interested in events where the touch position changed.
-
- float x = e.getX();
- float y = e.getY();
-
- switch (e.getAction()) {
- case MotionEvent.ACTION_MOVE:
-
- float dx = x - mPreviousX;
- float dy = y - mPreviousY;
-
- // reverse direction of rotation above the mid-line
- if (y > getHeight() / 2) {
- dx = dx * -1 ;
- }
-
- // reverse direction of rotation to left of the mid-line
- if (x < getWidth() / 2) {
- dy = dy * -1 ;
- }
-
- mRenderer.mAngle += (dx + dy) * TOUCH_SCALE_FACTOR;
- requestRender();
- }
-
- mPreviousX = x;
- mPreviousY = y;
- return true;
- }
-</pre>
- <p class="note"><strong>Note:</strong> Touch events return pixel coordinates which <em>are not the
-same</em> as OpenGL coordinates. Touch coordinate [0,0] is the bottom-left of the screen and the
-highest value [max_X, max_Y] is the top-right corner of the screen. To match touch events to OpenGL
-graphic objects, you must translate touch coordinates into OpenGL coordinates.</p>
- </li>
- <li>Run the application and drag your finger or cursor around the screen to rotate the
-triangle.</li>
-</ol>
-<p>For another example of OpenGL touch event functionality, see <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-TouchRotateActivity.html">TouchRotateActivity</a>.</p>
\ No newline at end of file
diff --git a/docs/html/resources/tutorials/opengl/opengl-es20.jd b/docs/html/resources/tutorials/opengl/opengl-es20.jd
deleted file mode 100644
index dd23dbf..0000000
--- a/docs/html/resources/tutorials/opengl/opengl-es20.jd
+++ /dev/null
@@ -1,652 +0,0 @@
-page.title=OpenGL ES 2.0
-parent.title=Tutorials
-parent.link=../../browser.html?tag=tutorial
-@jd:body
-
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#creating">Create an Activity with GLSurfaceView</a></li>
- <li>
- <a href="#drawing">Draw a Shape on GLSurfaceView</a>
- <ol>
- <li><a href="#define-triangle">Define a Triangle</a></li>
- <li><a href="#draw-triangle">Draw the Triangle</a></li>
- </ol>
- </li>
- <li><a href="#projection-and-views">Apply Projection and Camera Views</a></li>
- <li><a href="#motion">Add Motion</a></li>
- <li><a href="#touch">Respond to Touch Events</a></li>
- </ol>
- <h2 id="code-samples-list">Related Samples</h2>
- <ol>
- <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-index.html">API Demos - graphics</a></li>
- <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-GLES20Activity.html">OpenGL ES 2.0 Sample</a></li>
- <li><a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-TouchRotateActivity.html">TouchRotateActivity</a></li>
- </ol>
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/topics/graphics/opengl.html">3D with OpenGL</a></li>
- <li><a href="{@docRoot}resources/tutorials/opengl/opengl-es10.html">OpenGL
-ES 1.0</a></li>
- </ol>
- </div>
- </div>
-
-<p>This tutorial shows you how to create a simple Android application that uses the OpenGL ES 2.0
-API to perform some basic graphics operations. You'll learn how to:</p>
-
-<ul>
- <li>Create an activity using {@link android.opengl.GLSurfaceView} and {@link
-android.opengl.GLSurfaceView.Renderer}</li>
- <li>Create and draw a graphic object</li>
- <li>Define a projection to correct for screen geometry</li>
- <li>Define a camera view</li>
- <li>Rotate a graphic object</li>
- <li>Make graphics touch interactive</li>
-</ul>
-
-<p>The Android framework supports both the OpenGL ES 1.0/1.1 and OpenGL ES 2.0 APIs. You should
-carefully consider which version of the OpenGL ES API (1.0/1.1 or 2.0) is most appropriate for your
-needs. For more information, see
-<a href="{@docRoot}guide/topics/graphics/opengl.html#choosing-version">Choosing an OpenGL API
-Version</a>. If you would prefer to use OpenGL ES 1.0, see the <a
-href="{@docRoot}resources/tutorials/opengl/opengl-es10.html">OpenGL ES 1.0 tutorial</a>.</p>
-
-<p>Before you start, you should understand how to create a basic Android application. If you do not
-know how to create an app, follow the <a href="{@docRoot}resources/tutorials/hello-world.html">Hello
-World Tutorial</a> to familiarize yourself with the process.</p>
-
-<p class="caution"><strong>Caution:</strong> OpenGL ES 2.0 <em>is currently not supported</em> by
-the Android Emulator. You must have a physical test device running Android 2.2 (API Level 8) or
-higher in order to run and test the example code in this tutorial.</p>
-
-<h2 id="creating">Create an Activity with GLSurfaceView</h2>
-
-<p>To get started using OpenGL, you must implement both a {@link android.opengl.GLSurfaceView} and a
-{@link android.opengl.GLSurfaceView.Renderer}. The {@link android.opengl.GLSurfaceView} is the main
-view type for applications that use OpenGL and the {@link android.opengl.GLSurfaceView.Renderer}
-controls what is drawn within that view. (For more information about these classes, see the <a
-href="{@docRoot}guide/topics/graphics/opengl.html">3D with OpenGL</a> document.)</p>
-
-<p>To create an activity using {@code GLSurfaceView}:</p>
-
-<ol>
- <li>Start a new Android project that targets Android 2.2 (API Level 8) or higher.
- </li>
- <li>Name the project <strong>HelloOpenGLES20</strong> and make sure it includes an activity called
-{@code HelloOpenGLES20}.
- </li>
- <li>Modify the {@code HelloOpenGLES20} class as follows:
-<pre>
-package com.example.android.apis.graphics;
-
-import android.app.Activity;
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-
-public class HelloOpenGLES20 extends Activity {
-
- private GLSurfaceView mGLView;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- // Create a GLSurfaceView instance and set it
- // as the ContentView for this Activity
- mGLView = new HelloOpenGLES20SurfaceView(this);
- setContentView(mGLView);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- // The following call pauses the rendering thread.
- // If your OpenGL application is memory intensive,
- // you should consider de-allocating objects that
- // consume significant memory here.
- mGLView.onPause();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- // The following call resumes a paused rendering thread.
- // If you de-allocated graphic objects for onPause()
- // this is a good place to re-allocate them.
- mGLView.onResume();
- }
-}
-
-class HelloOpenGLES20SurfaceView extends GLSurfaceView {
-
- public HelloOpenGLES20SurfaceView(Context context){
- super(context);
-
- // Create an OpenGL ES 2.0 context.
- setEGLContextClientVersion(2);
- // Set the Renderer for drawing on the GLSurfaceView
- setRenderer(new HelloOpenGLES20Renderer());
- }
-}
-</pre>
- <p class="note"><strong>Note:</strong> You will get a compile error for the {@code
-HelloOpenGLES20Renderer} class reference. That's expected; you will fix this error in the next step.
- </p>
-
- <p>As shown above, this activity uses a single {@link android.opengl.GLSurfaceView} for its
-view. Notice that this activity implements crucial lifecycle callbacks for pausing and resuming its
-work.</p>
-
- <p>The {@code HelloOpenGLES20SurfaceView} class in this example code above is just a thin wrapper
-for an instance of {@link android.opengl.GLSurfaceView} and is not strictly necessary for this
-example. However, if you want your application to monitor and respond to touch screen
-events—and we are guessing you do—you must extend {@link android.opengl.GLSurfaceView}
-to add touch event listeners, which you will learn how to do in the <a href="#touch">Reponding to
-Touch Events</a> section.</p>
-
- <p>In order to draw graphics in the {@link android.opengl.GLSurfaceView}, you must define an
-implementation of {@link android.opengl.GLSurfaceView.Renderer}. In the next step, you create
-a renderer class to complete this OpenGL application.</p>
- </li>
-
- <li>Create a new file for the following class {@code HelloOpenGLES20Renderer}, which implements
-the {@link android.opengl.GLSurfaceView.Renderer} interface:
-
-<pre>
-package com.example.android.apis.graphics;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.opengl.GLES20;
-import android.opengl.GLSurfaceView;
-
-public class HelloOpenGLES20Renderer implements GLSurfaceView.Renderer {
-
- public void onSurfaceCreated(GL10 unused, EGLConfig config) {
-
- // Set the background frame color
- GLES20.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
- }
-
- public void onDrawFrame(GL10 unused) {
-
- // Redraw background color
- GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
- }
-
- public void onSurfaceChanged(GL10 unused, int width, int height) {
- GLES20.glViewport(0, 0, width, height);
- }
-
-}
-</pre>
- <p>This minimal implementation of {@link android.opengl.GLSurfaceView.Renderer} provides the
-code structure needed to use OpenGL drawing methods:
-<ul>
- <li>{@link
- android.opengl.GLSurfaceView.Renderer#onSurfaceCreated(javax.microedition.khronos.opengles.GL10,
- javax.microedition.khronos.egl.EGLConfig) onSurfaceCreated()} is called once to set up the
-{@link android.opengl.GLSurfaceView}
-environment.</li>
- <li>{@link
- android.opengl.GLSurfaceView.Renderer#onDrawFrame(javax.microedition.khronos.opengles.GL10)
- onDrawFrame()} is called for each redraw of the {@link
-android.opengl.GLSurfaceView}.</li>
- <li>{@link
- android.opengl.GLSurfaceView.Renderer#onSurfaceChanged(javax.microedition.khronos.opengles.GL10,
- int, int) onSurfaceChanged()} is called if the geometry of the {@link
-android.opengl.GLSurfaceView} changes, for example when the device's screen orientation
-changes.</li>
-</ul>
- </p>
- <p>For more information about these methods, see the <a
-href="{@docRoot}guide/topics/graphics/opengl.html">3D with OpenGL</a> document.
-</p>
- </li>
-</ol>
-
-<p>The code example above creates a simple Android application that displays a grey screen using
-OpenGL ES 2.0 calls. While this application does not do anything very interesting, by creating these
-classes, you have layed the foundation needed to start drawing graphic elements with OpenGL ES
-2.0.</p>
-
-<p>If you are familiar with the OpenGL ES APIs, these classes should give you enough information
-to use the OpenGL ES 2.0 API and create graphics. However, if you need a bit more help getting
-started with OpenGL, head on to the next sections for a few more hints.</p>
-
-<p class="note"><strong>Note:</strong> If your application requires OpenGL 2.0, make sure you
-declare this in your manifest:</p>
-<pre>
- <!-- Tell the system this app requires OpenGL ES 2.0. -->
- <uses-feature android:glEsVersion="0x00020000" android:required="true" />
-</pre>
-<p>For more information, see <a
-href="{@docRoot}guide/topics/graphics/opengl.html#manifest">OpenGL manifest declarations</a> in the
-<em>3D with OpenGL</em> document.</p>
-
-
-<h2 id="drawing">Draw a Shape on GLSurfaceView</h2>
-
-<p>Once you have implemented a {@link android.opengl.GLSurfaceView.Renderer}, the next step is to
-draw something with it. This section shows you how to define and draw a triangle.</p>
-
-<h3 id="define-triangle">Define a Triangle</h3>
-
-<p>OpenGL allows you to define objects using coordinates in three-dimensional space. So, before you
- can draw a triangle, you must define its coordinates. In OpenGL, the typical way to do this is to
- define a vertex array for the coordinates.</p>
-
-<p>By default, OpenGL ES assumes a coordinate system where [0,0,0] (X,Y,Z) specifies the center of
- the {@link android.opengl.GLSurfaceView} frame, [1,1,0] is the top-right corner of the frame and
-[-1,-1,0] is bottom-left corner of the frame.</p>
-
-<p>To define a vertex array for a triangle:</p>
-
-<ol>
- <li>In your {@code HelloOpenGLES20Renderer} class, add new member variable to contain the
-vertices of a triangle shape:
-<pre>
- private FloatBuffer triangleVB;
-</pre>
- </li>
-
- <li>Create a method, {@code initShapes()} which populates this member variable:
-<pre>
- private void initShapes(){
-
- float triangleCoords[] = {
- // X, Y, Z
- -0.5f, -0.25f, 0,
- 0.5f, -0.25f, 0,
- 0.0f, 0.559016994f, 0
- };
-
- // initialize vertex Buffer for triangle
- ByteBuffer vbb = ByteBuffer.allocateDirect(
- // (# of coordinate values * 4 bytes per float)
- triangleCoords.length * 4);
- vbb.order(ByteOrder.nativeOrder());// use the device hardware's native byte order
- triangleVB = vbb.asFloatBuffer(); // create a floating point buffer from the ByteBuffer
- triangleVB.put(triangleCoords); // add the coordinates to the FloatBuffer
- triangleVB.position(0); // set the buffer to read the first coordinate
-
- }
-</pre>
- <p>This method defines a two-dimensional triangle shape with three equal sides.</p>
- </li>
- <li>Modify your {@code onSurfaceCreated()} method to initialize your triangle:
-<pre>
- public void onSurfaceCreated(GL10 unused, EGLConfig config) {
-
- // Set the background frame color
- GLES20.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
-
- // initialize the triangle vertex array
- initShapes();
- }
-</pre>
- <p class="caution"><strong>Caution:</strong> Shapes and other static objects should be initialized
- once in your {@code onSurfaceCreated()} method for best performance. Avoid initializing the
- new objects in {@code onDrawFrame()}, as this causes the system to re-create the objects
- for every frame redraw and slows down your application.
- </p>
- </li>
-
-</ol>
-
-<p>You have now defined a triangle shape, but if you run the application, nothing appears. What?!
-You also have to tell OpenGL to draw the triangle, which you'll do in the next section.
-</p>
-
-
-<h3 id="draw-triangle">Draw the Triangle</h3>
-
-<p>The OpenGL ES 2.0 requires a bit more code than OpenGL ES 1.0/1.1 in order to draw objects. In
-this section, you'll create vertex and fragment shaders, a shader loader, apply the shaders, enable
-the use of vertex arrays for your triangle and, finally, draw it on screen.</p>
-
-<p>To draw the triangle:</p>
-
-<ol>
- <li>In your {@code HelloOpenGLES20Renderer} class, define a vertex shader and a fragment
-shader. Shader code is defined as a string which is compiled and run by the OpenGL ES 2.0 rendering
-engine.
-<pre>
- private final String vertexShaderCode =
- "attribute vec4 vPosition; \n" +
- "void main(){ \n" +
- " gl_Position = vPosition; \n" +
- "} \n";
-
- private final String fragmentShaderCode =
- "precision mediump float; \n" +
- "void main(){ \n" +
- " gl_FragColor = vec4 (0.63671875, 0.76953125, 0.22265625, 1.0); \n" +
- "} \n";
-</pre>
- <p>The vertex shader controls how OpenGL positions and draws the vertices of shapes in space.
-The fragment shader controls what OpenGL draws <em>between</em> the vertices of shapes.</p>
- </li>
- <li>In your {@code HelloOpenGLES20Renderer} class, create a method for loading the shaders.
-<pre>
- private int loadShader(int type, String shaderCode){
-
- // create a vertex shader type (GLES20.GL_VERTEX_SHADER)
- // or a fragment shader type (GLES20.GL_FRAGMENT_SHADER)
- int shader = GLES20.glCreateShader(type);
-
- // add the source code to the shader and compile it
- GLES20.glShaderSource(shader, shaderCode);
- GLES20.glCompileShader(shader);
-
- return shader;
- }
-</pre>
- </li>
-
- <li>Add the following members to your {@code HelloOpenGLES20Renderer} class for an OpenGL
-Program and the positioning control for your triangle.
-<pre>
- private int mProgram;
- private int maPositionHandle;
-</pre>
- <p>In OpenGL ES 2.0, you attach vertex and fragment shaders to a <em>Program</em> and then
-apply the program to the OpenGL graphics pipeline.</p>
- </li>
-
- <li>Add the following code to the end of your {@code onSurfaceCreated()} method to load the
-shaders and attach them to an OpenGL Program.
-<pre>
- int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexShaderCode);
- int fragmentShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentShaderCode);
-
- mProgram = GLES20.glCreateProgram(); // create empty OpenGL Program
- GLES20.glAttachShader(mProgram, vertexShader); // add the vertex shader to program
- GLES20.glAttachShader(mProgram, fragmentShader); // add the fragment shader to program
- GLES20.glLinkProgram(mProgram); // creates OpenGL program executables
-
- // get handle to the vertex shader's vPosition member
- maPositionHandle = GLES20.glGetAttribLocation(mProgram, "vPosition");
-</pre>
- <p>At this point, you are ready to draw the triangle object in the OpenGL view.</p>
- </li>
-
- <li>Add the following code to the end of your {@code onDrawFrame()} method apply the OpenGL
-program you created, load the triangle object and draw the triangle.
-<pre>
- // Add program to OpenGL environment
- GLES20.glUseProgram(mProgram);
-
- // Prepare the triangle data
- GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false, 12, triangleVB);
- GLES20.glEnableVertexAttribArray(maPositionHandle);
-
- // Draw the triangle
- GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 3);
-</pre>
- </li>
- <li id="squashed-triangle">Run the app! Your application should look something like this:
- </li>
-</ol>
-
-<img src="{@docRoot}images/opengl/helloopengl-es20-1.png">
-<p class="img-caption">
- <strong>Figure 1.</strong> Triangle drawn without a projection or camera view.
-</p>
-
-<p>There are a few problems with this example. First of all, it is not going to impress your
-friends. Secondly, the triangle is a bit squashed and changes shape when you change the screen
-orientation of the device. The reason the shape is skewed is due to the fact that the object is
-being rendered in a frame which is not perfectly square. You'll fix that problem using a projection
-and camera view in the next section.</p>
-
-<p>Lastly, because the triangle is stationary, the system is redrawing the object repeatedly in
-exactly the same place, which is not the most efficient use of the OpenGL graphics pipeline. In the
-<a href="#motion">Add Motion</a> section, you'll make this shape rotate and justify
-this use of processing power.</p>
-
-<h2 id="projection-and-views">Apply Projection and Camera View</h2>
-
-<p>One of the basic problems in displaying graphics is that Android device displays are typically
-not square and, by default, OpenGL happily maps a perfectly square, uniform coordinate
-system onto your typically non-square screen. To solve this problem, you can apply an OpenGL
-projection mode and camera view (eye point) to transform the coordinates of your graphic objects
-so they have the correct proportions on any display. For more information about OpenGL coordinate
-mapping, see <a href="{@docRoot}guide/topics/graphics/opengl.html#coordinate-mapping">Mapping
-Coordinates for Drawn Objects</a>.</p>
-
-<p>To apply projection and camera view transformations to your triangle:
-</p>
-<ol>
- <li>Add the following members to your {@code HelloOpenGLES20Renderer} class.
-<pre>
- private int muMVPMatrixHandle;
- private float[] mMVPMatrix = new float[16];
- private float[] mMMatrix = new float[16];
- private float[] mVMatrix = new float[16];
- private float[] mProjMatrix = new float[16];
-</pre>
- </li>
- <li>Modify your {@code vertexShaderCode} string to add a variable for a model view
-projection matrix.
-<pre>
- private final String vertexShaderCode =
- // This matrix member variable provides a hook to manipulate
- // the coordinates of the objects that use this vertex shader
- "uniform mat4 uMVPMatrix; \n" +
-
- "attribute vec4 vPosition; \n" +
- "void main(){ \n" +
-
- // the matrix must be included as a modifier of gl_Position
- " gl_Position = uMVPMatrix * vPosition; \n" +
-
- "} \n";
-</pre>
- </li>
- <li>Modify the {@code onSurfaceChanged()} method to calculate the device screen ratio and
-create a projection matrix.
-<pre>
- public void onSurfaceChanged(GL10 unused, int width, int height) {
- GLES20.glViewport(0, 0, width, height);
-
- float ratio = (float) width / height;
-
- // this projection matrix is applied to object coodinates
- // in the onDrawFrame() method
- Matrix.frustumM(mProjMatrix, 0, -ratio, ratio, -1, 1, 3, 7);
- }
-</pre>
- </li>
- <li>Add the following code to the end of your {@code onSurfaceChanged()} method to
-reference the {@code uMVPMatrix} shader matrix variable you added in step 2.
-<pre>
- muMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uMVPMatrix");
-</pre>
- </li>
- <li>Add the following code to the end of your {@code onSurfaceChanged()} method to define
-a camera view matrix.
-<pre>
- Matrix.setLookAtM(mVMatrix, 0, 0, 0, -3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
-</pre>
- </li>
- <li>Finally, modify your {@code onDrawFrame()} method to combine the projection and
-camera view matrices and then apply the combined transformation to the OpenGL rendering pipeline.
-<pre>
- public void onDrawFrame(GL10 unused) {
- ...
- // Apply a ModelView Projection transformation
- Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mVMatrix, 0);
- GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mMVPMatrix, 0);
-
- // Draw the triangle
- ...
- }
-</pre>
- </li>
- <li>Run the updated application and you should see something like this:</li>
-</ol>
-
-<img src="{@docRoot}images/opengl/helloopengl-es20-2.png">
-<p class="img-caption">
- <strong>Figure 2.</strong> Triangle drawn with a projection and camera view applied.
-</p>
-
-<p>Now that you have applied this transformation, the triangle has three equal sides, instead of the
-<a href="#squashed-triangle">squashed triangle</a> in the earlier version.</p>
-
-<h2 id="motion">Add Motion</h2>
-
-<p>While it may be an interesting exercise to create static graphic objects with OpenGL ES, chances
-are you want at least <em>some</em> of your objects to move. In this section, you'll add motion to
-your triangle by rotating it.</p>
-
-<p>To add rotation to your triangle:</p>
-<ol>
- <li>Add an additional tranformation matrix member to your {@code HelloOpenGLES20Renderer}
-class.
- <pre>
- private float[] mMMatrix = new float[16];
- </pre>
- </li>
- <li>Modify your {@code onDrawFrame()} method to rotate the triangle object.
-<pre>
- public void onDrawFrame(GL10 gl) {
- ...
-
- // Create a rotation for the triangle
- long time = SystemClock.uptimeMillis() % 4000L;
- float angle = 0.090f * ((int) time);
- Matrix.setRotateM(mMMatrix, 0, angle, 0, 0, 1.0f);
- Matrix.multiplyMM(mMVPMatrix, 0, mVMatrix, 0, mMMatrix, 0);
- Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mMVPMatrix, 0);
-
- // Apply a ModelView Projection transformation
- GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mMVPMatrix, 0);
-
- // Draw the triangle
- ...
- }
-</pre>
- </li>
- <li>Run the application and your triangle should rotate around its center.</li>
-</ol>
-
-
-<h2 id="touch">Respond to Touch Events</h2>
-<p>Making objects move according to a preset program like the rotating triangle is useful for
-getting some attention, but what if you want to have users interact with your OpenGL graphics? In
-this section, you'll learn how listen for touch events to let users interact with objects in your
-{@code HelloOpenGLES20SurfaceView}.</p>
-
-<p>The key to making your OpenGL application touch interactive is expanding your implementation of
-{@link android.opengl.GLSurfaceView} to override the {@link
-android.view.View#onTouchEvent(android.view.MotionEvent) onTouchEvent()} to listen for touch events.
-Before you do that, however, you'll modify the renderer class to expose the rotation angle of the
-triangle. Afterwards, you'll modify the {@code HelloOpenGLES20SurfaceView} to process touch events
-and pass that data to your renderer.</p>
-
-<p>To make your triangle rotate in response to touch events:</p>
-
-<ol>
- <li>Modify your {@code HelloOpenGLES20Renderer} class to include a new, public member so that
-your {@code HelloOpenGLES10SurfaceView} class is able to pass new rotation values your renderer:
-<pre>
- public float mAngle;
-</pre>
- </li>
- <li>In your {@code onDrawFrame()} method, comment out the code that generates an angle and
-replace the {@code angle} variable with {@code mAngle}.
-<pre>
- // Create a rotation for the triangle (Boring! Comment this out:)
- // long time = SystemClock.uptimeMillis() % 4000L;
- // float angle = 0.090f * ((int) time);
-
- // Use the mAngle member as the rotation value
- Matrix.setRotateM(mMMatrix, 0, mAngle, 0, 0, 1.0f);
-</pre>
- </li>
- <li>In your {@code HelloOpenGLES20SurfaceView} class, add the following member variables.
-<pre>
- private final float TOUCH_SCALE_FACTOR = 180.0f / 320;
- private HelloOpenGLES20Renderer mRenderer;
- private float mPreviousX;
- private float mPreviousY;
-</pre>
- </li>
- <li>In the constructor method for {@code HelloOpenGLES20SurfaceView}, set the {@code mRenderer}
-member so you have a handle to pass in rotation input and set the render mode to {@link
-android.opengl.GLSurfaceView#RENDERMODE_WHEN_DIRTY}.<pre>
- public HelloOpenGLES20SurfaceView(Context context){
- super(context);
- // Create an OpenGL ES 2.0 context.
- setEGLContextClientVersion(2);
-
- // set the mRenderer member
- mRenderer = new HelloOpenGLES20Renderer();
- setRenderer(mRenderer);
-
- // Render the view only when there is a change
- setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
- }
-</pre>
- </li>
- <li>In your {@code HelloOpenGLES20SurfaceView} class, override the {@link
-android.view.View#onTouchEvent(android.view.MotionEvent) onTouchEvent()} method to listen for touch
-events and pass them to your renderer.
-<pre>
- @Override
- public boolean onTouchEvent(MotionEvent e) {
- // MotionEvent reports input details from the touch screen
- // and other input controls. In this case, you are only
- // interested in events where the touch position changed.
-
- float x = e.getX();
- float y = e.getY();
-
- switch (e.getAction()) {
- case MotionEvent.ACTION_MOVE:
-
- float dx = x - mPreviousX;
- float dy = y - mPreviousY;
-
- // reverse direction of rotation above the mid-line
- if (y > getHeight() / 2) {
- dx = dx * -1 ;
- }
-
- // reverse direction of rotation to left of the mid-line
- if (x < getWidth() / 2) {
- dy = dy * -1 ;
- }
-
- mRenderer.mAngle += (dx + dy) * TOUCH_SCALE_FACTOR;
- requestRender();
- }
-
- mPreviousX = x;
- mPreviousY = y;
- return true;
- }
-</pre>
- <p class="note"><strong>Note:</strong> Touch events return pixel coordinates which <em>are not the
-same</em> as OpenGL coordinates. Touch coordinate [0,0] is the bottom-left of the screen and the
-highest value [max_X, max_Y] is the top-right corner of the screen. To match touch events to OpenGL
-graphic objects, you must translate touch coordinates into OpenGL coordinates.</p>
- </li>
- <li>Run the application and drag your finger or cursor around the screen to rotate the
-triangle.</li>
-</ol>
-<p>For another example of OpenGL touch event functionality, see <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/
-TouchRotateActivity.html">TouchRotateActivity</a>.</p>
\ No newline at end of file
diff --git a/docs/html/resources/tutorials/testing/activity_test.jd b/docs/html/resources/tutorials/testing/activity_test.jd
deleted file mode 100644
index f88b768..0000000
--- a/docs/html/resources/tutorials/testing/activity_test.jd
+++ /dev/null
@@ -1,1381 +0,0 @@
-page.title=Activity Testing
-parent.title=Tutorials
-parent.link=../../browser.html?tag=tutorial
-@jd:body
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li>
- <a href="#Prerequisites">Prerequisites</a>
- </li>
- <li>
- <a href="#DownloadCode">Installing the Tutorial Sample Code</a>
- </li>
- <li>
- <a href="#SetupEmulator">Setting Up the Emulator</a>
- </li>
- <li>
- <a href="#SetupProjects">Setting Up the Projects</a>
- </li>
- <li>
- <a href="#CreateTestCaseClass">Creating the Test Case Class</a>
- <ol>
- <li>
- <a href="#AddTestCaseClass">Adding the test case class file</a>
- </li>
- <li>
- <a href="#AddConstructor">Adding the test case constructor</a>
- </li>
- <li>
- <a href="#AddSetupMethod">Adding the setup method</a>
- </li>
- <li>
- <a href="#AddPreConditionsTest">Adding an initial conditions test</a>
- </li>
- <li>
- <a href="#AddUITest">Adding a UI test</a>
- </li>
- <li>
- <a href="#StateManagementTests">Adding state management tests</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#RunTests">Running the Tests and Seeing the Results</a>
- </li>
- <li>
- <a href="#TestFailure">Forcing Some Tests to Fail</a>
- </li>
- <li>
- <a href="#NextSteps">Next Steps</a>
- </li>
-</ol>
-<h2 id="#Appendix">Appendix</h2>
-<ol>
- <li>
- <a href="#InstallCompletedTestApp">Installing the Completed Test Application Java File</a>
- </li>
- <li>
- <a href="#EditorCommandLine">For Users Not Developing In Eclipse</a>
- </li>
-</ol>
-<h2>Related Tutorials</h2>
-<ol>
- <li>
- <a href="{@docRoot}resources/tutorials/testing/helloandroid_test.html">Hello, Testing</a>
- </li>
-</ol>
-<h2>See Also</h2>
-<ol>
- <li>
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Android Applications</a>
- </li>
- <li>
- {@link android.test.ActivityInstrumentationTestCase2}
- </li>
- <li>
- {@link junit.framework.Assert}
- </li>
- <li>
- {@link android.test.InstrumentationTestRunner}
- </li>
-</ol>
-</div>
-</div>
-<p>
- Android includes powerful tools for testing applications. The tools extend JUnit with additional features, provide convenience classes for mock Android system objects, and use
- instrumentation to give you control over your main application while you are testing it. The entire Android testing environment is discussed in the document
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Android Applications</a>.
-</p>
-<p>
- This tutorial demonstrates the Android testing tools by presenting a simple Android application and then leading you step-by-step through the creation of a test application for it.
- The test application demonstrates these key points:
-</p>
- <ul>
- <li>
- An Android test is itself an Android application that is linked to the application under test by entries in its <code>AndroidManifest.xml</code> file.
- </li>
- <li>
- Instead of Android components, an Android test application contains one or more test cases. Each of these is a separate class definition.
- </li>
- <li>
- Android test case classes extend the JUnit {@link junit.framework.TestCase} class.
- </li>
- <li>
- Android test case classes for activities extend JUnit and also connect you to the application under test with instrumentation. You can send keystroke or touch events directly to the UI.
- </li>
- <li>
- You choose an Android test case class based on the type of component (application, activity, content provider, or service) you are testing.
- </li>
- <li>
- Additional test tools in Eclipse/ADT provide integrated support for creating test applications, running them, and viewing the results.
- </li>
- </ul>
-<p>
- The test application contains methods that perform the following tests:
-</p>
- <ul>
- <li>
- Initial conditions test. Tests that the application under test initializes correctly. This is also a unit test of the application's
- {@link android.app.Activity#onCreate(android.os.Bundle) onCreate()} method. Testing initial conditions also provides a confidence measure for subsequent tests.
- </li>
- <li>
- UI test. Tests that the main UI operation works correctly. This test demonstrates the instrumentation features available in activity testing.
- It shows that you can automate UI tests by sending key events from the test application to the main application.
- </li>
- <li>
- State management tests. Test the application's code for saving state. This test demonstrates the instrumentation features of the test runner, which
- are available for testing any component.
- </li>
- </ul>
-<h2 id="Prerequisites">Prerequisites</h2>
-<p>
- The instructions and code in this tutorial depend on the following:
-</p>
- <ul>
- <li>
- Basic knowledge of Android programming. If you haven't yet written an Android application, do the
- <a href="{@docRoot}resources/tutorials/hello-world.html">Hello, World</a> tutorial. If you
- want to learn more about Spinner, the application under test, then you might want to visit the
- <a href="{@docRoot}resources/tutorials/views/hello-spinner.html">Hello Views > Spinner</a> example.
- </li>
- <li>
- Some familiarity with the Android testing framework and concepts. If you haven't explored
- Android testing yet, start by reading the Developer Guide topic <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Android Applications</a>
- or following the <a href="{@docRoot}resources/tutorials/testing/helloandroid_test.html">
- Hello, Testing</a> tutorial.
- </li>
- <li>
- Eclipse with ADT. This tutorial describes how to set up and run a test application using
- Eclipse with ADT. If you haven't yet installed Eclipse and the ADT plugin,
- follow the steps in <a href="{@docRoot}sdk/installing.html">Installing the SDK</a>
- to install them before continuing. If you are not developing in Eclipse, you will
- find instructions for setting up and running the test application in the
- <a href="#EditorCommandLine">appendix</a> of this document.
- </li>
- <li>
- Android 1.5 platform (API Level 3) or higher. You must have the Android 1.5 platform
- (API Level 3) or higher installed in your SDK, because this tutorial uses APIs that
- were introduced in that version.
- <p>
- If you are not sure which platforms are installed in your SDK,
- open the Android SDK and AVD Manager and check in the
- <strong>Installed Packages</strong> panel.
- If aren't sure how to download a platform into your SDK,
- read <a href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a>.
- </p>
- </li>
- </ul>
-<h2 id="DownloadCode">Installing the Tutorial Sample Code</h2>
-<p>
- During this tutorial, you will be working with sample code that is provided as part
- of the downloadable Samples component of the SDK. Specifically, you will be working
- with a pair of related sample applications — an application under test and a test
- application:
-</p>
- <ul>
- <li>
- Spinner is the application under test. This tutorial focuses on the
- common situation of writing tests for an application that already exists, so the main
- application is provided to you.
- </li>
- <li>
- SpinnerTest is the test application. In the tutorial, you create this application
- step-by-step. If you want to run quickly through the tutorial,
- you can install the completed SpinnerTest application first, and then follow the
- text. You may get more from the tutorial, however, if you create the test application
- as you go. The instructions for installing the completed test application are in the
- section <a href="#InstallCompletedTestApp">Installing the Completed Test Application Java File</a>.
- </li>
- </ul>
-<p>
- The sample applications are provided in the SDK component named
- "Samples for SDK API 8" and in later versions of the Samples.
-</p>
-<p>
- To get started with the tutorial, first use the Android SDK and AVD manager to install an
- appropriate version of the Samples:
-</p>
-<ol>
- <li>
- In Eclipse, select <strong>Window</strong> > <strong>Android SDK and AVD Manager</strong>.
- </li>
- <li>
- Open the <strong>Installed Packages</strong> panel and check whether
- "Samples for SDK API 8" (or higher version) is listed.
- If so, skip to the next section,
- <a href="#SetupProjects">Setting Up the Projects</a>, to get started with the tutorial.
- Otherwise, continue with the next step.
- </li>
- <li>
- Open the <strong>Available Packages</strong> panel.
- </li>
- <li>
- Select the "Samples for SDK API 8" component and click <strong>Install Selected</strong>.
- </li>
- <li>
- Verify and accept the component and then click <strong>Install Accepted</strong>.
- The Samples component will now be installed into your SDK.
- </li>
-</ol>
-<p>
- When the installation is complete, the applications in the
- Samples component are stored at this location on your computer:
-</p>
-<p style="margin-left:2em">
- <code><<em>sdk</em>>/samples/android-8/</code>
-</p>
-<p>
- For general information about the Samples, see
- <a href="{@docRoot}resources/samples/get.html">Getting the Samples</a>
-</p>
-<p class="note">
- <strong>Note:</strong> Although the sample code for this tutorial is provided in the
- "Samples for SDK API 8" component, that does not imply that you need to build or
- run the application against the corresponding platform (Android 2.2).
- The API level referenced in the Samples component name indicates only the origin branch from
- which the samples were built.
-</p>
-<h2 id="SetupEmulator">Setting Up the Emulator</h2>
-<p>
- In this tutorial, you will use the Android emulator to run applications. The emulator needs
- an Android Virtual Device (AVD) with an API level equal to or higher than the one you set for the projects in the previous step.
- To find out how to check this and create the right AVD if necessary,
- see <a href="{@docRoot}guide/developing/devices/managing-avds.html">Creating an AVD</a>.
-</p>
-<p>
- As a test of the AVD and emulator, run the SpinnerActivity application in Eclipse with ADT. When it starts,
- click the large downward-pointing arrow to the right of the spinner text. You see the spinner expand and display the title "Select a planet" at the top.
- Click one of the other planets. The spinner closes, and your selection appears below it on the screen.
-</p>
-<h2 id="SetupProjects">Setting Up the Projects</h2>
-<p>
- When you are ready to get started with the tutorial, begin by setting up Eclipse projects for
- both Spinner (the application under test) and SpinnerTest (the test application).
-</p>
-<p>
- You'll be using the Spinner application as-is, without modification, so you'll be loading it
- into Eclipse as a new Android project from existing source. In the process, you'll be
- creating a new test project associated with Spinner that will contain the SpinnerTest
- application. The SpinnerTest application will be completely new and you'll be
- using the code examples in this tutorial to add test classes and tests to it.
-</p>
-<p>
- To install the Spinner app in a new Android project from existing source, following these steps:
-</p>
-<ol>
- <li>
- In Eclipse, select <strong>File</strong> > <strong>New</strong> > <strong>Project</strong> > <strong>Android</strong> > <strong>Android Project</strong>,
- then click Next. The <strong>New Android Project</strong> dialog appears.
- </li>
- <li>
- In the <em>Project name</em> text box, enter "SpinnerActivity". The <em>Properties</em> area is filled in automatically.
- </li>
- <li>
- In the <em>Contents</em> area, set "Create project from existing source".
- </li>
- <li>
- For <em>Location</em>, click <strong>Browse</strong>, navigate to the directory <code><SDK_path>/samples/android-8/Spinner</code>,
- then click Open. The directory name <code><SDK_path>/samples/android-8/Spinner</code> now appears in the <em>Location</em> text box.
- </li>
- <li>
- In the <em>Build Target</em> area, set a API level of 3 or higher. If you are already developing with a particular target, and it is API level 3 or higher, then use that target.
- </li>
- <li>
- In the <em>Properties</em> area, in the <em>Min SDK Version:</em>, enter "3".
- </li>
- <li>
- You should now see these values:
- <ul>
- <li><em>Project Name:</em> "SpinnerActivity"</li>
- <li><em>Create project from existing source:</em> set</li>
- <li><em>Location:</em> "<code><SDK_path>/samples/android-8/Spinner</code>"</li>
- <li><em>Build Target:</em> "API level of 3 or higher" (<em>Target Name</em> "Android 1.5 or higher")</li>
- <li><em>Package name:</em> (disabled, set to "<code>com.android.example.spinner</code>")</li>
- <li><em>Create Activity:</em> (disabled, set to ".SpinnerActivity")</li>
- <li><em>Min SDK Version:</em> "3"</li>
- </ul>
- <p>
- The following screenshot summarizes these values:
- </p>
- <a href="{@docRoot}images/testing/eclipse_new_android_project_complete_callouts.png">
- <img src="{@docRoot}images/testing/eclipse_new_android_project_complete_callouts.png" alt="New Android Project dialog with filled-in values" style="height:230px"/>
- </a>
-
- </li>
-</ol>
-<p>
- To create a new test project for the SpinnerTest application, follow these steps:
-</p>
-<ol>
- <li>
- Click Next. The <strong>New Android Test Project</strong> dialog appears.
- </li>
- <li>
- Set "Create a Test Project".
- </li>
- <li>
- Leave the other values unchanged. The result should be:
- <ul>
- <li><em>Create a Test Project:</em> checked</li>
- <li><em>Test Project Name:</em> "SpinnerActivityTest"</li>
- <li><em>Use default location:</em> checked (this should contain the directory name "<code>workspace/SpinnerActivityTest</code>").</li>
- <li><em>Build Target:</em> Use the same API level you used in the previous step.</li>
- <li><em>Application name:</em> "SpinnerActivityTest"</li>
- <li><em>Package name:</em> "<code>com.android.example.spinner.test</code>"</li>
- <li><em>Min SDK Version:</em> "3"</li>
- </ul>
- <p>
- The following screenshot summarizes these values:
- </p>
- <a href="{@docRoot}images/testing/eclipse_new_android_testproject_complete_callouts.png">
- <img src="{@docRoot}images/testing/eclipse_new_android_testproject_complete_callouts.png" alt="New Android Test Project dialog with filled-in values" style="height:230px"/>
- </a>
- </li>
- <li>
- Click Finish. Entries for SpinnerActivity and SpinnerActivityTest should appear in the
- <strong>Package Explorer</strong>.
- <p class="note">
- <strong>Note:</strong> If you set <em>Build Target</em> to an API level higher than "3", you will see the warning
- "The API level for the selected SDK target does not match the Min SDK version". You do not need to change the API level or the Min SDK version.
- The message tells you that you are building the projects with one particular API level, but specifying that a lower API level is required. This may
- occur if you have chosen not to install the optional earlier API levels.
- </p>
- <p>
- If you see errors listed in the <strong>Problems</strong> pane at the bottom of the Eclipse window, or if a red error marker appears next to
- the entry for SpinnerActivity in the Package Explorer, highlight the SpinnerActivity entry and then select
- <strong>Project</strong> > <strong>Clean</strong>. This should fix any errors.
- </p>
- </li>
-</ol>
-<p>
- You now have the application under test in the SpinnerActivity project,
- and an empty test project in SpinnerActivityTest. You may
- notice that the two projects are in different directories, but Eclipse with
- ADT handles this automatically. You should have no problem in either building or running them.
-</p>
-<p>
- Notice that Eclipse and ADT have already done some initial setup for your test application.
- Expand the SpinnerActivityTest project, and notice that it already has an
- Android manifest file <code>AndroidManifest.xml</code>.
- Eclipse with ADT created this when you added the test project.
- Also, the test application is already set up to use instrumentation. You can see this
- by examining <code>AndroidManifest.xml</code>.
- Open it, then at the bottom of the center pane click <strong>AndroidManifest.xml</strong>
- to display the XML contents:
-</p>
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.example.spinner.test"
- android:versionCode="1"
- android:versionName="1.0">
- <uses-sdk android:minSdkVersion="3" />
- <instrumentation
- android:targetPackage="com.android.example.spinner"
- android:name="android.test.InstrumentationTestRunner" />
- <application android:icon="@drawable/icon" android:label="@string/app_name">
- <uses-library android:name="android.test.runner" />
- ...
- </application>
-</manifest>
-</pre>
-<p>
- Notice the <code><instrumentation></code> element. The attribute
- <code>android:targetPackage="com.android.example.spinner"</code> tells Android that the
- application under test is defined in the Android package
- <code>com.android.example.spinner</code>. Android now knows to use that
- package's <code>AndroidManifest.xml</code> file to launch the application under test.
- The <code><instrumentation></code> element also contains the attribute
- <code>android:name="android.test.InstrumentationTestRunner"</code>, which tells Android
- instrumentation to run the test application with Android's instrumentation-enabled test runner.
-</p>
-<h2 id="CreateTestCaseClass">Creating the Test Case Class</h2>
-
-<p>
- You now have a test project SpinnerActivityTest, and the basic structure of a test
- application also called SpinnerActivityTest. The basic structure includes all the files and
- directories you need to build and run a test application, except for the class that
- contains your tests (the test case class).
-</p>
-<p>
- The next step is to define the test case class. In this tutorial, you'll be creating a
- test case class that includes:
-</p>
-<ul>
- <li>
- Test setup. This use of the JUnit {@link junit.framework.TestCase#setUp() setUp()}
- method demonstrates some of the tasks you might perform before running an Android test.
- </li>
- <li>
- Testing initial conditions. This test demonstrates a good testing technique.
- It also demonstrates that with Android instrumentation you can look at the application
- under test <em>before</em> the main activity starts. The test checks that the application's
- important objects have been initialized.
- If the test fails, you then know that any other tests against the application are
- unreliable, since the application was running in an incorrect state.
- <p class="note">
- <strong>Note:</strong> The purpose of testing initial conditions is not the same as
- using <code>setUp()</code>. The JUnit {@link junit.framework.TestCase#setUp()} runs once
- before <strong>each test method</strong>, and its purpose is to create a clean test
- environment. The initial conditions test runs once, and its purpose is to verify that the
- application under test is ready to be tested.
- </p>
- </li>
- <li>
- Testing the UI. This test shows how to control the main application's UI
- with instrumentation, a powerful automation feature of Android testing.
- </li>
- <li>
- Testing state management. This test shows some techniques for testing how
- well the application maintains state in the Android environment. Remember that to
- provide a satisfactory user experience, your application must never lose its current state,
- even if it's interrupted by a phone call or destroyed because of memory constraints.
- The Android activity lifecycle provides ways to maintain state, and the
- <code>SpinnerActivity</code> application uses them. The test shows the techniques for
- verifying that they work.
- </li>
-</ul>
-<p>
- Android tests are contained in a special type of Android application that contains one or more test class definitions. Each of these contains
- one or more test methods that do the actual tests. In this tutorial, you will first add a test case class, and then add tests to it.
-</p>
-<p>
- You first choose an Android test case class to extend. You choose from the base test case classes according to the Android component you are testing and the types of tests you are doing.
- In this tutorial, the application under test has a single simple activity, so the test case class will be for an Activity component. Android offers several, but the one that tests in
- the most realistic environment is {@link android.test.ActivityInstrumentationTestCase2}, so you will use it as the base class. Like all activity test case classes,
- <code>ActivityInstrumentationTestCase2</code> offers convenience methods for interacting directly with the UI of the application under test.
-</p>
-<h3 id="AddTestCaseClass">Adding the test case class file</h3>
-<p>
- To add <code>ActivityInstrumentationTestCase2</code> as the base test case class, follow these steps:
-</p>
-<ol>
- <li>
- In the Package Explorer, expand the test project SpinnerActivityTest if it is not open already.
- </li>
- <li>
- Within SpinnerActivityTest, expand the <code>src/</code> folder and then the package marker for
- <code>com.android.example.spinner.test</code>. Right-click on the package name and select <strong>New</strong> > <strong>Class</strong>:<br/>
- <a href="{@docRoot}images/testing/spinner_create_test_class_callouts.png">
- <img alt="Menu for creating a new class in the test application" src="{@docRoot}images/testing/spinner_create_test_class_callouts.png" style="height:230px"/>
- </a>
- <p>
- The <strong>New Java Class</strong> wizard appears:
- </p>
- <a href="{@docRoot}images/testing/spinnertest_new_class_callouts.png">
- <img alt="New Java Class wizard dialog" src="{@docRoot}images/testing/spinnertest_new_class_callouts.png" style="height:230px"/>
- </a>
- </li>
- <li>
- In the wizard, enter the following:
- <ul>
- <li>
- <em>Name:</em> "SpinnerActivityTest". This becomes the name of your test class.
- </li>
- <li>
- <em>Superclass:</em> "<code>android.test.ActivityInstrumentationTestCase2<SpinnerActivity></code>". The superclass is parameterized, so
- you have to provide it your main application's class name.
- </li>
- </ul>
- <p>
- Do not change any of the other settings. Click Finish.
- </p>
- </li>
- <li>
- You now have a new file <code>SpinnerActivityTest.java</code> in the project.
- </li>
- <li>
- To resolve the reference to SpinnerActivity, add the following import:
-<pre>
-import com.android.example.spinner.SpinnerActivity;
-</pre>
- </li>
-</ol>
-<h3 id="AddConstructor">Adding the test case constructor</h3>
- <p>
- To ensure that the test application is instantiated correctly, you must set up a constructor that the test
- runner will call when it instantiates your test class. This constructor has no parameters, and its sole
- purpose is to pass information to the superclass's default constructor. To set up this constructor, enter the
- following code in the class:
- </p>
-<pre>
- public SpinnerActivityTest() {
- super("com.android.example.spinner", SpinnerActivity.class);
- } // end of SpinnerActivityTest constructor definition
-</pre>
-<p>
- This calls the superclass constructor with the Android package name (<code>com.android.example.spinner</code>)and main activity's class
- (<code>SpinnerActivity.class</code>) for the application under test. Android uses this information to find the application and activity to test.
-</p>
-<p>
- You are now ready to add tests, by adding test methods to the class.
-</p>
-<h3 id="AddSetupMethod">Adding the setup method</h3>
-<p>
- The <code>setUp()</code> method is invoked before every test. You use it to initialize variables and clean up from previous tests. You can also use
- the JUnit {@link junit.framework.TestCase#tearDown() tearDown()} method, which runs <strong>after</strong> every test method. The tutorial does not use it.
-</p>
-<p>
- The method you are going to add does the following:
-</p>
-<ul>
- <li>
- <code>super.setUp()</code>. Invokes the superclass constructor for <code>setUp()</code>, which is required by JUnit.
- </li>
- <li>
- Calls {@link android.test.ActivityInstrumentationTestCase2#setActivityInitialTouchMode(boolean) setActivityInitialTouchMode(false)}.
- This turns off <strong>touch mode</strong> in the device or emulator. If any of your test methods send key events to the application,
- you must turn off touch mode <em>before</em> you start any activities; otherwise, the call is ignored.
- </li>
- <li>
- Stores references to system objects. Retrieves and stores a reference to the activity under test, the <code>Spinner</code>
- widget used by the activity, the <code>SpinnerAdapter</code> that backs the widget, and the string value of the selection that is
- set when the application is first installed. These objects are used in the state management test. The methods invoked are:
- <ul>
- <li>
- {@link android.test.ActivityInstrumentationTestCase2#getActivity()}. Gets a reference to the activity under test (<code>SpinnerActivity</code>).
- This call also starts the activity if it is not already running.
- </li>
- <li>
- {@link android.app.Activity#findViewById(int)}. Gets a reference to the <code>Spinner</code> widget of the application under test.
- </li>
- <li>
- {@link android.widget.AbsSpinner#getAdapter()}. Gets a reference to the adapter (an array of strings) backing the spinner.
- </li>
- </ul>
- </li>
-</ul>
-<p>
- Add this code to the definition of <code>SpinnerActivityTest</code>, after the constructor definition:
-</p>
-<pre>
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- setActivityInitialTouchMode(false);
-
- mActivity = getActivity();
-
- mSpinner =
- (Spinner) mActivity.findViewById(
- com.android.example.spinner.R.id.Spinner01
- );
-
- mPlanetData = mSpinner.getAdapter();
-
- } // end of setUp() method definition
-</pre>
-<p>
- Add these members to the test case class:
-</p>
-<pre>
- private SpinnerActivity mActivity;
- private Spinner mSpinner;
- private SpinnerAdapter mPlanetData;
-</pre>
-<p>
- Add these imports:
-</p>
-<pre>
-import android.widget.Spinner;
-import android.widget.SpinnerAdapter;
-</pre>
-<p>
- You now have the the complete <code>setUp()</code> method.
-</p>
-<h3 id="AddPreConditionsTest">Adding an initial conditions test</h3>
-<p>
- The initial conditions test verifies that the application under test is initialized correctly. It is an illustration of the types of tests you can run, so it is not comprehensive.
- It verifies the following:
-</p>
-<ul>
- <li>
- The item select listener is initialized. This listener is called when a selection is made from the spinner.
- </li>
- <li>
- The adapter that provides values to the spinner is initialized.
- </li>
- <li>
- The adapter contains the right number of entries.
- </li>
-</ul>
-<p>
- The actual initialization of the application under test is done in <code>setUp()</code>, which the test runner calls automatically before every test. The verifications are
- done with JUnit {@link junit.framework.Assert} calls. As a useful convention, the method name is <code>testPreConditions()</code>:
-</p>
-<pre>
- public void testPreConditions() {
- assertTrue(mSpinner.getOnItemSelectedListener() != null);
- assertTrue(mPlanetData != null);
- assertEquals(mPlanetData.getCount(),ADAPTER_COUNT);
- } // end of testPreConditions() method definition
-</pre>
-<p>
- Add this member:
-</p>
-<pre>
- public static final int ADAPTER_COUNT = 9;
-</pre>
-<h3 id="AddUITest">Adding a UI test</h3>
-<p>
- Now create a UI test that selects an item from the <code>Spinner</code> widget. The test sends key events to the UI with key events.
- The test confirms that the selection matches the result you expect.
-</p>
-<p>
- This test demonstrates the power of using instrumentation in Android testing. Only an instrumentation-based test class allows you to send key events (or touch events)
- to the application under test. With instrumentation, you can test your UI without having to take screenshots, record the screen, or do human-controlled testing.
-</p>
-<p>
- To work with the spinner, the test has to request focus for it and then set it to a known position. The test uses {@link android.view.View#requestFocus() requestFocus()} and
- {@link android.widget.AbsSpinner#setSelection(int) setSelection()} to do this. Both of these methods interact with a View in the application under test, so you have to call them
- in a special way.
-</p>
-<p>
- Code in a test application that interacts with a View of the application under test must run in the main application's thread, also
- known as the <em>UI thread</em>. To do this, you use the {@link android.app.Activity#runOnUiThread(java.lang.Runnable) Activity.runOnUiThread()}
- method. You pass the code to <code>runOnUiThread()</code>in an anonymous {@link java.lang.Runnable Runnable} object. To set
- the Java statements in the <code>Runnable</code> object, you override the object's {@link java.lang.Runnable#run()} method.
-</p>
-<p>
- To send key events to the UI of the application under test, you use the <a href="{@docRoot}reference/android/test/InstrumentationTestCase.html#sendKeys(int...)">sendKeys</a>() method.
- This method does not have to run on the UI thread, since Android uses instrumentation to pass the key events to the application under test.
-</p>
-<p>
- The last part of the test compares the selection made by sending the key events to a pre-determined value. This tests that the spinner is working as intended.
-</p>
-<p>
- The following sections show you how to add the code for this test.
-</p>
-<ol>
- <li>
- Get focus and set selection. Create a new method <code>public void testSpinnerUI()</code>. Add
- code to to request focus for the spinner and set its position to default or initial position, "Earth". This code is run on the UI thread of
- the application under test:
-<pre>
- public void testSpinnerUI() {
-
- mActivity.runOnUiThread(
- new Runnable() {
- public void run() {
- mSpinner.requestFocus();
- mSpinner.setSelection(INITIAL_POSITION);
- } // end of run() method definition
- } // end of anonymous Runnable object instantiation
- ); // end of invocation of runOnUiThread
-</pre>
- <p>
- Add the following member to the test case class.
- </p>
-<pre>
- public static final int INITIAL_POSITION = 0;
-</pre>
- </li>
- <li>
- Make a selection. Send key events to the spinner to select one of the items. To do this, open the spinner by
- "clicking" the center keypad button (sending a DPAD_CENTER key event) and then clicking (sending) the down arrow keypad button five times. Finally,
- click the center keypad button again to highlight the desired item. Add the following code:
-<pre>
- this.sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
- for (int i = 1; i <= TEST_POSITION; i++) {
- this.sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
- } // end of for loop
-
- this.sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
-</pre>
- <p>
- Add the following member to the test case class:
- </p>
-<pre>
- public static final int TEST_POSITION = 5;
-</pre>
- <p>
- This sets the final position of the spinner to "Saturn" (the spinner's backing adapter is 0-based).
- </p>
- </li>
- <li>
- Check the result. Query the current state of the spinner, and compare its current selection to the expected value.
- Call the method {@link android.widget.AdapterView#getSelectedItemPosition() getSelectedItemPosition()} to find out the current selection position, and then
- {@link android.widget.AdapterView#getItemAtPosition(int) getItemAtPosition()} to get the object corresponding to that position (casting it to a String). Assert that
- this string value matches the expected value of "Saturn":
-<pre>
- mPos = mSpinner.getSelectedItemPosition();
- mSelection = (String)mSpinner.getItemAtPosition(mPos);
- TextView resultView =
- (TextView) mActivity.findViewById(
- com.android.example.spinner.R.id.SpinnerResult
- );
-
- String resultText = (String) resultView.getText();
-
- assertEquals(resultText,mSelection);
-
- } // end of testSpinnerUI() method definition
-</pre>
-<p>
- Add the following members to the test case class:
-</p>
-<pre>
- private String mSelection;
- private int mPos;
-</pre>
- <p>
- Add the following imports to the test case class:
- </p>
-<pre>
- import android.view.KeyEvent;
- import android.widget.TextView;
-</pre>
- </li>
-</ol>
-<p>
- Pause here to run the tests you have. The procedure for running a test application is different
- from running a regular Android application. You run a test application as an Android JUnit
- application. To see how to do this, see <a href="#RunTests">Running the Tests and Seeing the Results</a>.
-</p>
-<p>
- Eventually, you will see the <code>SpinnerActivity</code> application start, and the test
- application controlling it by sending it key events. You will also see a new
- <strong>JUnit</strong> view in the Explorer pane, showing the results of the
- test. The JUnit view is documented in a following section,
- <a href="#RunTests">Running the Test and Seeing the Results</a>.
-</p>
-<h3 id="StateManagementTests">Adding state management tests</h3>
-<p>
- You now write two tests that verify that SpinnerActivity maintains its state when it is paused or terminated.
- The state, in this case, is the current selection in the spinner. When users make a selection,
- pause or terminate the application, and then resume or restart it, they should see
- the same selection.
-</p>
-<p>
- Maintaining state is an important feature of an application. Users may switch from the current
- application temporarily to answer the phone, and then switch back. Android may decide to
- terminate and restart an activity to change the screen orientation, or terminate an unused
- activity to regain storage. In each case, users are best served by having the UI return to its
- previous state (except where the logic of the application dictates otherwise).
-</p>
-<p>
- SpinnerActivity manages its state in these ways:
-</p>
- <ul>
- <li>
- Activity is hidden. When the spinner screen (the activity) is running but hidden by some other screen, it
- stores the spinner's position and value in a form that persists while the application is running.
- </li>
- <li>
- Application is terminated. When the activity is terminated, it stores the spinner's position and value in
- a permanent form. The activity can read the position and value when it restarts, and restore the spinner to its previous state.
- </li>
- <li>
- Activity re-appears. When the user returns to the spinner screen, the previous selection is restored.
- </li>
- <li>
- Application is restarted. When the user starts the application again, the previous selection is restored.
- </li>
- </ul>
-<p class="note">
- <strong>Note:</strong> An application can manage its state in other ways as well, but these are
- not covered in this tutorial.
-</p>
-<p>
- When an activity is hidden, it is <strong>paused</strong>. When it re-appears, it
- <strong>resumes</strong>. Recognizing that these are key points in an activity's life cycle,
- the Activity class provides two callback methods {@link android.app.Activity#onPause()} and
- {@link android.app.Activity#onResume()} for handling pauses and resumes.
- SpinnerActivity uses them for code that saves and restores state.
-</p>
-<p>
- <strong>Note:</strong> If you would like to learn more about the difference between losing
- focus/pausing and killing an application,
- read about the <a href="{@docRoot}guide/topics/fundamentals/activities.html#Lifecycle">activity
-lifecycle</a>.
-</p>
-<p>
- The first test verifies that the spinner selection is maintained after the entire application is shut down and then restarted. The test uses instrumentation to
- set the spinner's variables outside of the UI. It then terminates the activity by calling {@link android.app.Activity#finish() Activity.finish()}, and restarts it
- using the instrumentation method {@link android.test.ActivityInstrumentationTestCase2#getActivity()}. The test then asserts that the current spinner state matches
- the test values.
-</p>
-<p>
- The second test verifies that the spinner selection is maintained after the activity is paused and then resumed. The test uses instrumentation to
- set the spinner's variables outside of the UI and then force calls to the <code>onPause()</code> and <code>onResume()</code> methods. The test then
- asserts that the current spinner state matches the test values.
-</p>
-<p>
- Notice that these tests make limited assumptions about the mechanism by which the activity manages state. The tests use the activity's getters and
- setters to control the spinner. The first test also knows that hiding an activity calls <code>onPause()</code>, and bringing it back to the foreground
- calls <code>onResume()</code>. Other than this, the tests treat the activity as a "black box".
-</p>
-<p>
- To add the code for testing state management across shutdown and restart, follow these steps:
-</p>
- <ol>
- <li>
- Add the test method <code>testStateDestroy()</code>, then
- set the spinner selection to a test value:
-<pre>
- public void testStateDestroy() {
- mActivity.setSpinnerPosition(TEST_STATE_DESTROY_POSITION);
- mActivity.setSpinnerSelection(TEST_STATE_DESTROY_SELECTION);
-</pre>
- </li>
- <li>
- Terminate the activity and restart it:
-<pre>
- mActivity.finish();
- mActivity = this.getActivity();
-</pre>
- </li>
- <li>
- Get the current spinner settings from the activity:
-<pre>
- int currentPosition = mActivity.getSpinnerPosition();
- String currentSelection = mActivity.getSpinnerSelection();
-</pre>
- </li>
- <li>
- Test the current settings against the test values:
-<pre>
- assertEquals(TEST_STATE_DESTROY_POSITION, currentPosition);
- assertEquals(TEST_STATE_DESTROY_SELECTION, currentSelection);
- } // end of testStateDestroy() method definition
-</pre>
-<p>
- Add the following members to the test case class:
-<pre>
- public static final int TEST_STATE_DESTROY_POSITION = 2;
- public static final String TEST_STATE_DESTROY_SELECTION = "Earth";
-</pre>
- </li>
- </ol>
-<p>
- To add the code for testing state management across a pause and resume, follow these steps:
-</p>
-<ol>
- <li>
- Add the test method <code>testStatePause()</code>:
-<pre>
- @UiThreadTest
- public void testStatePause() {
-</pre>
- <p>
- The <code>@UiThreadTest</code> annotation tells Android to build this method so that it runs
- on the UI thread. This allows the method to change the state of the spinner widget in the
- application under test. This use of <code>@UiThreadTest</code> shows that, if necessary, you
- can run an entire method on the UI thread.
- </p>
- </li>
- <li>
- Set up instrumentation. Get the instrumentation object
- that is controlling the application under test. This is used later to
- invoke the <code>onPause()</code> and <code>onResume()</code> methods:
-<pre>
- Instrumentation mInstr = this.getInstrumentation();
-</pre>
- </li>
- <li>
- Set the spinner selection to a test value:
-<pre>
- mActivity.setSpinnerPosition(TEST_STATE_PAUSE_POSITION);
- mActivity.setSpinnerSelection(TEST_STATE_PAUSE_SELECTION);
-</pre>
- </li>
- <li>
- Use instrumentation to call the Activity's <code>onPause()</code>:
-<pre>
- mInstr.callActivityOnPause(mActivity);
-</pre>
- <p>
- Under test, the activity is waiting for input. The invocation of
- {@link android.app.Instrumentation#callActivityOnPause(android.app.Activity)}
- performs a call directly to the activity's <code>onPause()</code> instead
- of manipulating the activity's UI to force it into a paused state.
- </p>
- </li>
- <li>
- Force the spinner to a different selection:
-<pre>
- mActivity.setSpinnerPosition(0);
- mActivity.setSpinnerSelection("");
-</pre>
- <p>
- This ensures that resuming the activity actually restores the
- spinner's state rather than simply leaving it as it was.
- </p>
- </li>
- <li>
- Use instrumentation to call the Activity's <code>onResume()</code>:
-<pre>
- mInstr.callActivityOnResume(mActivity);
-</pre>
- <p>
- Invoking {@link android.app.Instrumentation#callActivityOnResume(android.app.Activity)}
- affects the activity in a way similar to <code>callActivityOnPause</code>. The
- activity's <code>onResume()</code> method is invoked instead of manipulating the
- activity's UI to force it to resume.
- </p>
- </li>
- <li>
- Get the current state of the spinner:
-<pre>
- int currentPosition = mActivity.getSpinnerPosition();
- String currentSelection = mActivity.getSpinnerSelection();
-</pre>
- </li>
- <li>
- Test the current spinner state against the test values:
-<pre>
- assertEquals(TEST_STATE_PAUSE_POSITION,currentPosition);
- assertEquals(TEST_STATE_PAUSE_SELECTION,currentSelection);
- } // end of testStatePause() method definition
-</pre>
- <p>
- Add the following members to the test case class:
- </p>
-<pre>
- public static final int TEST_STATE_PAUSE_POSITION = 4;
- public static final String TEST_STATE_PAUSE_SELECTION = "Jupiter";
-</pre>
- </li>
- <li>
- Add the following imports:
-<pre>
- import android.app.Instrumentation;
- import android.test.UiThreadTest;
-</pre>
- </li>
-</ol>
-<h2 id="RunTests">Running the Tests and Seeing the Results</h2>
- <p>
- The most simple way to run the <code>SpinnerActivityTest</code> test case is to run it directly from the Package Explorer.
- </p>
- <p>
- To run the <code>SpinnerActivityTest</code> test, follow these steps:
-</p>
- <ol>
- <li>
- In the Package Explorer, right-click the project SpinnerActivityTest at the top level, and then
- select <strong>Run As</strong> > <strong>Android JUnit Test</strong>:<br/>
- <a href="{@docRoot}images/testing/spinnertest_runas_menu_callouts.png">
- <img alt="Menu to run a test as an Android JUnit test" src="{@docRoot}images/testing/spinnertest_runas_menu_callouts.png" style="height:230px">
- </a>
- </li>
- <li>
- You will see the emulator start. When the unlock option is displayed (its appearance depends on the API level you specified for the AVD),
- unlock the home screen.
- </li>
- <li>
- The test application starts. You see a new tab for the <strong>JUnit</strong> view, next to the Package Explorer tab:<br/>
- <a href="{@docRoot}images/testing/spinnertest_junit_panel.png">
- <img alt="The JUnit window" src="{@docRoot}images/testing/spinnertest_junit_panel.png" style="height:230px">
- </a>
- </li>
-</ol>
-<p>
- This view contains two sub-panes. The top pane summarizes the tests that were run, and the bottom pane shows failure traces for
- highlighted tests.
-</p>
-<p>
- At the conclusion of a successful test run, this is the view's appearance:<br/>
- <a href="{@docRoot}images/testing/spinnertest_junit_success.png">
- <img src="{@docRoot}images/testing/spinnertest_junit_success.png" alt="JUnit test run success" style="height:230px"/>
- </a>
-</p>
-<p>
- The upper pane summarizes the test:
-</p>
- <ul>
- <li>
- Total time elapsed for the test application(labeled <em>Finished after <x> seconds</em>).
- </li>
- <li>
- Number of runs (<em>Runs:</em>) - the number of tests in the entire test class.
- </li>
- <li>
- Number of errors (<em>Errors:</em>) - the number of program errors and exceptions encountered during
- the test run.
- </li>
- <li>
- Number of failures (<em>Failures:</em>) - the number of test failures encountered during the test
- run. This is the number of assertion failures. A test can fail even if the program does not encounter an error.
- </li>
- <li>
- A progress bar. The progress bar extends from left to right as the tests run.
- <p>
- If all the tests succeed, the bar remains green. If a test fails, the bar turns from green to red.
- </p>
- </li>
- <li>
- A test method summary. Below the bar, you see a line for each class in the test application. To look at the results for the individual
- methods in a test, click the arrow at the left to expand the line. You see the name of each test method. To the
- right of the name, you see the time taken by the test. You can look at the test's code
- by double-clicking its name.
- </li>
- </ul>
-<p>
- The lower pane contains the failure trace. If all the tests are successful, this pane is empty. If some tests fail,
- then if you highlight a failed test in the upper pane, the lower view contains a stack trace for the test. This is
- demonstrated in the next section.
-</p>
-<p class="note">
- <strong>Note:</strong> If you run the test application and nothing seems to happen, look for
- the JUnit view. If you do not see it, you may have run the test application
- as a regular Android application.
- Remember that you need to run it as an Android <strong>JUnit</strong>
- application.
-</p>
-<h2 id="TestFailure">Forcing Some Tests to Fail</h2>
-<p>
- A test is as useful when it fails as when it succeeds. This section shows what happens in Eclipse with ADT when a test fails. You
- can quickly see that a test class has failed, find the method or methods that failed, and then use a failure trace to find
- the exact problem.
-</p>
-<p>
- The example application SpinnerActivity that you downloaded passes all the tests in the test application SpinnerActivityTest.
- To force the test to fail, you must modify the example application. You change a line of setup code in the application under test. This
- causes the <code>testPreConditions()</code> and <code>testTextView()</code> test methods to fail.
-</p>
-<p>
- To force the tests to fail, follow these steps:
-</p>
-<ol>
- <li>
- In Eclipse with ADT, go to the SpinnerActivity project and open the file <code>SpinnerActivity.java</code>.
- </li>
- <li>
- At the top of <code>SpinnerActivity.java</code>, at the end of the <code>onCreate()</code> method, find the following line:
-<pre>
- // mySpinner.setOnItemSelectedListener(null);
-</pre>
- <p>Remove the forward slash characters at the beginning of the line to
- uncomment the line. This sets the listener callback to null:
- </p>
-<pre>
- mySpinner.setOnItemSelectedListener(null);
-</pre>
- </li>
- <li>
- The <code>testPreConditions()</code> method in <code>SpinnerActivityTest</code> contains the following test:
- <code>assertTrue(mSpinner.getOnItemSelectedListener() != null);</code>. This test asserts that the listener callback is <em>not</em> null.
- Since you have modified the application under test, this assertion now fails.
- </li>
- <li>
- Run the test, as described in the previous section <a href="#RunTests">Running the Tests and Seeing the Results</a>.
- </li>
-</ol>
-<p>
- The JUnit view is either created or updated with the results of the test. Now, however, the progress bar is red,
- the number of failures is 2, and small "x" icons appear in the list icons next to the testPreConditions and
- TestSpinnerUI tests. This indicates that the tests have failed. The display is similar to this:<br/>
- <a href="{@docRoot}images/testing/spinnertest_junit_panel_fail_callouts.png">
- <img src="{@docRoot}images/testing/spinnertest_junit_panel_fail_callouts.png" alt="The JUnit Failure window" style="height:230px"/>
- </a>
-</p>
-<p>
- You now want to look at the failures to see exactly where they occurred.
-</p>
-<p>
- To examine the failures, follow these steps:
-</p>
-<ol>
- <li>
- Click the testPreconditions entry. In the lower pane entitled <strong>Failure Trace</strong>,
- you see a stack trace of the calls that led to the failure. This trace is similar to the following screenshot:<br/>
- <a href="{@docRoot}images/testing/spinnertest_junit_panel_failtrace_callouts.png">
- <img src="{@docRoot}images/testing/spinnertest_junit_panel_failtrace_callouts.png" alt="The JUnit failure trace" style="height:230px"/>
- </a>
- </li>
- <li>
- The first line of the trace tells you the error. In this case, a JUnit assertion failed. To look at the
- assertion in the test code, double-click the next line (the first line of the trace). In the center pane
- a new tabbed window opens, containing the code for the test application <code>SpinnerActivityTest</code>. The failed assertion
- is highlighted in the middle of the window.
- </li>
-</ol>
-<p>
- The assertion failed because you modified the main application to set the <code>getOnItemSelectedListener</code> callback to <code>null</code>.
-</p>
-<p>
- You can look at the failure in <code>testTextView</code> if you want. Remember, though, that <code>testPreConditions</code> is meant to verify the
- initial setup of the application under test. If testPreConditions() fails, then succeeding tests can't be trusted. The best strategy to follow is to
- fix the problem and re-run all the tests.
-</p>
-<p>
- Remember to go back to <code>SpinnerActivity.java</code> and re-comment the line you uncommented in an earlier step.
-</p>
-<p>
- You have now completed the tutorial.
-</p>
-<h2 id="NextSteps">Next Steps</h2>
-<p>
- This example test application has shown you how to create a test project and link it to
- the application you want to test, how to choose and add a test case class, how to write
- UI and state management tests, and how to run the tests against the application under
- test. Now that you are familiar with the basics of testing Android applications, here
- are some suggested next steps:
-</p>
-<p>
- <strong>Learn more about testing on Android</strong>
-</p>
-<ul>
- <li>
- If you haven't done so already, read the
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Android Applications</a>
- document in the <em>Dev Guide</em>. It provides an overview of how testing on Android
- works. If you are just getting started with Android testing, reading that document will
- help you understand the tools available to you, so that you can develop effective
- tests.
- </li>
-</ul>
-<p>
- <strong>Review the main Android test case classes</strong>
-</p>
-<ul>
- <li>
- {@link android.test.ActivityInstrumentationTestCase2}
- </li>
- <li>
- {@link android.test.ActivityUnitTestCase}
- </li>
- <li>
- {@link android.test.ProviderTestCase2}
- </li>
- <li>
- {@link android.test.ServiceTestCase}
- </li>
-</ul>
-<p>
- <strong>Learn more about the assert and utility classes</strong>
-</p>
-<ul>
- <li>
- {@link junit.framework.Assert}, the JUnit Assert class.
- </li>
- <li>
- {@link android.test.MoreAsserts}, additional Android assert methods.
- </li>
- <li>
- {@link android.test.ViewAsserts}, useful assertion methods for testing Views.
- </li>
- <li>
- {@link android.test.TouchUtils}, utility methods for simulating touch events in an Activity.
- </li>
-</ul>
-<p>
- <strong>Learn about instrumentation and the instrumented test runner</strong>
-</p>
-<ul>
- <li>
- {@link android.app.Instrumentation}, the base instrumentation class.
- </li>
- <li>
- {@link android.test.InstrumentationTestCase}, the base instrumentation test case.
- </li>
- <li>
- {@link android.test.InstrumentationTestRunner}, the standard Android test runner.
- </li>
-</ul>
-<h2 id="Appendix">Appendix</h2>
-<h3 id="InstallCompletedTestApp">Installing the Completed Test Application Java File</h3>
-<p>
- The recommended approach to this tutorial is to follow the instructions step-by-step and
- write the test code as you go. However, if you want to do this tutorial quickly,
- you can install the entire Java file for the test application into the test project.
-</p>
-<p>
- To do this, you first create a test project with the necessary structure and files by using
- the automated tools in Eclipse. Then you exit Eclipse and copy the test application's Java file
- from the SpinnerTest sample project into your test project. The SpinnerTest sample project is
- part of the Samples component of the SDK.
-</p>
-<p>
- The result is a complete test application, ready to run against the Spinner sample application.
-</p>
-<p>
- To install the test application Java file, follow these steps:
-</p>
-<ol>
- <li>
- Set up the projects for the application under test and the test application, as described
- in the section section <a href="#SetupProjects">Setting Up the Projects</a>.
- </li>
- <li>
- Set up the emulator, as described in the section <a href="#SetupEmulator">Setting Up the Emulator</a>.
- </li>
- <li>
- Add the test case class, as described in the section <a href="#AddTestCaseClass">Adding the test case class file</a>.
- </li>
- <li>
- Close Eclipse with ADT.
- </li>
- <li>
- Copy the file <code><SDK_path>/samples/android-8/SpinnerTest/src/com/android/example/spinner/test/SpinnerActivityTest.java</code>
- to the directory <code>workspace/SpinnerActivityTest/src/com/android/example/spinner/test/</code>.
- </li>
- <li>
- Restart Eclipse with ADT.
- </li>
- <li>
- In Eclipse with ADT, re-build the project <code>SpinnerActivityTest</code> by selecting it in the Package Explorer, right-clicking,
- and selecting <em>Project</em> > <em>Clean</em>.
- </li>
- <li>
- The complete, working test application should now be in the <code>SpinnerActivityTest</code> project.
- </li>
-</ol>
-<p>
- You can now continue with the tutorial, starting at the section <a href="#AddConstructor">Adding the test case constructor</a> and
- following along in the text.
-</p>
-<h3 id="EditorCommandLine">For Users Not Developing In Eclipse</h3>
-<p>
- If you are not developing in Eclipse, you can still do this tutorial. Android provides tools for
- creating test applications using a code editor and command-line tools. You use the following tools:
-</p>
-<ul>
- <li>
- <a href="{@docRoot}guide/developing/tools/adb.html">adb</a> - Installs and uninstalls applications and test applications to a device or the emulator. You
- also use this tool to run the test application from the command line.
- </li>
- <li>
- <a href="{@docRoot}guide/developing/tools/android.html">android</a> - Manages projects and test projects. This tool also manages AVDs and Android platforms.
- </li>
-</ul>
- <p>
- You use the <code>emulator</code> tool to run the emulator from the command line.
- </p>
- <p>
- Here are the general steps for doing this tutorial using an editor and the command line:
- </p>
-<ol>
- <li>
- As described in the section <a href="#DownloadCode">Installing the Tutorial Sample Code</a>, get the sample code. You will then
- have a directory <code><SDK_path>/samples/android-8</code>, containing (among others) the directories <code>Spinner</code>
- and <code>SpinnerTest</code>:
- <ul>
- <li>
- <code>Spinner</code> contains the main application, also known as the <strong>application under test</strong>. This tutorial focuses on the
- common situation of writing tests for an application that already exists, so the main application is provided to you.
- </li>
- <li>
- <code>SpinnerTest</code> contains all the code for the test application. If you want to run quickly through the tutorial, you can
- install the test code and then follow the text. You may get more from the tutorial, however, if you write the code as you go. The instructions
- for installing the test code are in the section <a href="#InstallCompletedTestApp">Appendix: Installing the Completed Test Application</a>.
- </li>
- </ul>
- </li>
- <li>
- Navigate to the directory <code><SDK_path>/samples/android-8</code>.
- </li>
- <li>
- Create a new Android application project using <code>android create project</code>:
-<pre>
-$ android create project -t <APItarget> -k com.android.example.spinner -a SpinnerActivity -n SpinnerActivity -p Spinner
-</pre>
- <p>
- The value of <code><APItarget></code> should be "3" (API level 3) or higher. If you are already developing with a particular API level, and it is
- higher than 3, then use that API level.
- </p>
- <p>
- This a new Android project <code>SpinnerActivity</code> in the existing <code>Spinner</code> directory. The existing source and
- resource files are not touched, but the <code>android</code> tool adds the necessary build files.
- </p>
- </li>
- <li>
- Create a new Android test project using <code>android create test-project</code>:
-<pre>
-$ android create test-project -m ../Spinner -n SpinnerActivityTest -p SpinnerActivityTest
-</pre>
- <p>
- This will create a new Android test project in the <em>new</em> directory <code>SpinnerActivityTest</code>. You do this
- so that the solution to the tutorial that is in <code>SpinnerTest</code> is left untouched. If you want to use the solution
- code instead of entering it as you read through the tutorial, refer to the section
- <a href="#InstallCompletedTestApp">Appendix: Installing the Completed Test Application</a>.
- </p>
- <p class="Note">
- <strong>Note:</strong> Running <code>android create test-project</code> will automatically create
- the file <code>AndroidManifest.xml</code> with the correct <code><instrumentation></code> element.
- </p>
- </li>
- <li>
- Build the sample application. If you are building with Ant, then it is easiest to use the command <code>ant debug</code> to build a debug version, since the SDK comes
- with a debug signing key. The result will be the file <code>Spinner/bin/SpinnerActivity-debug.apk</code>.
- You can install this to your device or emulator. Attach your device or start the emulator if you haven't already, and run the command:
-<pre>
-$ adb install Spinner/bin/SpinnerActivity-debug.apk
-</pre>
- </li>
- <li>
- To create the test application, create a file <code>SpinnerActivityTest.java</code> in the directory
- <code>SpinnerActivityTest/src/com/android/example/spinner/test/</code>.
- </li>
- <li>
- Follow the tutorial, starting with the section <a href="#CreateTestCaseClass">Creating the Test Case Class</a>. When you are prompted to
- run the sample application, go the the Launcher screen in your device or emulator and select SpinnerActivity.
- When you are prompted to run the test application, return here to continue with the following instructions.
- </li>
- <li>
- Build the test application. If you are building with Ant, then it is easiest to use the command <code>ant debug</code> to build a
- debug version, since the SDK comes with a debug signing key. The result will be the Android file
- <code>SpinnerActivityTest/bin/SpinnerActivityTest-debug.apk</code>. You can install this to your device or emulator.
- Attach your device or start the emulator if you haven't already, and run the command:
-<pre>
-$ adb install SpinnerActivityTest/bin/SpinnerActivityTest-debug.apk
-</pre>
- </li>
- <li>
- In your device or emulator, check that both the main application <code>SpinnerActivity</code> and the test application
- <code>SpinnerActivityTest</code> are installed.
- </li>
- <li>
- To run the test application, enter the following at the command line:
-<pre>
-$ adb shell am instrument -w com.android.example.spinner.test/android.test.InstrumentationTestRunner
- </pre>
- </li>
-</ol>
-<p>
- The result of a successful test looks like this:
-</p>
-<pre>
-com.android.example.spinner.test.SpinnerActivityTest:....
-Test results for InstrumentationTestRunner=....
-Time: 10.098
-OK (4 tests)
-</pre>
-<p>
- If you force the test to fail, as described in the previous section <a href="#TestFailure">Forcing Some Tests to Fail</a>, then
- the output looks like this:
-</p>
-<pre>
-com.android.example.spinner.test.SpinnerActivityTest:
-Failure in testPreConditions:
-junit.framework.AssertionFailedError
- at com.android.example.spinner.test.SpinnerActivityTest.testPreConditions(SpinnerActivityTest.java:104)
- at java.lang.reflect.Method.invokeNative(Native Method)
- at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:205)
- at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:195)
- at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:175)
- at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
- at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
- at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)
- at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
-Failure in testSpinnerUI:
-junit.framework.ComparisonFailure: expected:<Result> but was:<Saturn>
- at com.android.example.spinner.test.SpinnerActivityTest.testSpinnerUI(SpinnerActivityTest.java:153)
- at java.lang.reflect.Method.invokeNative(Native Method)
- at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:205)
- at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:195)
- at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:175)
- at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
- at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
- at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)
- at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
-..
-Test results for InstrumentationTestRunner=.F.F..
-Time: 9.377
-FAILURES!!!
-Tests run: 4, Failures: 2, Errors: 0
-</pre>
diff --git a/docs/html/resources/tutorials/testing/helloandroid_test.jd b/docs/html/resources/tutorials/testing/helloandroid_test.jd
deleted file mode 100644
index 4d949c8..0000000
--- a/docs/html/resources/tutorials/testing/helloandroid_test.jd
+++ /dev/null
@@ -1,508 +0,0 @@
-page.title=Hello, Testing
-parent.title=Tutorials
-parent.link=../../browser.html?tag=tutorial
-@jd:body
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol>
- <li>
- <a href="#CreateTestProject">Creating the Test Project</a>
- </li>
- <li>
- <a href="#CreateTestClass">Creating the Test Case Class</a>
- <ol>
- <li>
- <a href="#CreateTestCaseClassFile">Adding the test case class file</a>
- </li>
- <li>
- <a href="#CreateConstructor">Adding the test case constructor</a>
- </li>
- <li>
- <a href="#CreateSetUp">Adding a setup method</a>
- </li>
- <li>
- <a href="#CreatePreConditions">Adding a preconditions test</a>
- </li>
- <li>
- <a href="#CreateText">Adding a unit test</a>
- </li>
- <li>
- <a href="#CompleteTest">The finished test case class</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#RunTest">Running the Tests and Seeing the Results</a>
- </li>
- <li>
- <a href="#NextSteps">Next Steps</a>
- </li>
- </ol>
-<h2>Related Tutorials</h2>
-<ol>
- <li>
- <a href="{@docRoot}resources/tutorials/hello-world.html">Hello, World</a>
- </li>
- <li>
- <a href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity Testing</a>
- </li>
-</ol>
-<h2>See Also</h2>
-<ol>
- <li>
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Android Applications</a>
- </li>
- <li>
- {@link android.test.ActivityInstrumentationTestCase2}
- </li>
- <li>
- {@link android.test.InstrumentationTestRunner}
- </li>
-</ol>
-
-</div>
-</div>
-<p>
- Android offers a powerful but easy-to-use testing framework that is well integrated with the SDK tools. Because writing
- tests is an important part of any development effort, this tutorial introduces the basics of testing and helps you get started testing quickly.
-
- To keep things simple, this tutorial builds on the <a href="{@docRoot}resources/tutorials/hello-world.html">Hello World</a> tutorial, which you may have already completed.
- It guides you through the process of setting up a test project, adding a test, and running the test against the Hello World application, all from inside the Eclipse environment.
- Of course, when you are done with this tutorial, you will want to create a test project for your own app and add various types of tests to it.
-</p>
-<p>
- If you'd like to read an overview of the test and instrumentation framework and the core test case classes available, look at
- the <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Android Applications</a> topic.
- If you prefer a more advanced testing tutorial, try the
- <a href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity Testing</a> tutorial.
-</p>
-<h2 id="Prerequisites">Prerequisites</h2>
- <p>
- This tutorial and its code depend on the Hello World tutorial. If you haven't completed that tutorial already,
- do so now. You will learn the fundamentals of Android application development, and you will
- have an Android application that is ready to be tested. The tutorial guides you through the
- setup of an Android test project using the ADT Plugin for Eclipse and other SDK tools.
- You will need an SDK development platform that is version 1.5
- (API level 3) or higher.
- </p>
- <p>
- If you aren't developing in Eclipse with ADT or you would like to run tests directly from the
- command line, please see the topic <a href="{@docRoot}guide/developing/testing/testing_otheride.html">Testing in Other IDEs</a>
- for instructions.
- </p>
-<h2 id="CreateTestProject">Creating the Test Project</h2>
-<p>
- In the Hello World tutorial you created Android application project called
- HelloAndroid. A test of an Android application is also an Android
- application, and you create it within an Eclipse project. The Eclipse with ADT
- <strong>New Android Test Project</strong> dialog creates a new test project and the
- framework of a new test application at the same time.
-</p>
-<p>
- To create the test project and test application framework in Eclipse with ADT, follow these steps
-</p>
- <ol>
- <li>
- In Eclipse, select <strong>New</strong> > <strong>Project</strong> > <strong>Android</strong> > <strong>Android Test Project</strong>.
- <p>
- <a href="{@docRoot}images/testing/hwtest_new_test_project_menu.png">
- <img alt="New Android Test Project menu" src="{@docRoot}images/testing/hwtest_new_test_project_menu.png" style="height:230px"/>
- </a>
- </p>
- <p>
- The New Android Test Project dialog appears.
- </p>
- </li>
- <li>
- Set the following values:
- <ul>
- <li>
- <em>Test Project Name:</em> "HelloAndroidTest"
- </li>
- <li>
- <em>Test Target:</em> Set "An existing Android project", click Browse, and then
- select "HelloAndroid" from the list of projects.
- </li>
- <li>
- <em>Build Target:</em> Set a target whose platform is Android 1.5 or above.
- </li>
- <li>
- <em>Application name:</em> "HelloAndroidTest"
- </li>
- <li>
- <em>Package name:</em> "<code>com.example.helloandroid.test</code>"
- </li>
- </ul>
- <p>
- The dialog should now look like this:
- </p>
- <a href="{@docRoot}images/testing/hwtest_new_test_project_dialog_complete_callouts.png">
- <img alt="New Android Test Project dialog with entries" src="{@docRoot}images/testing/hwtest_new_test_project_dialog_complete_callouts.png" style="height:230px"/>
- </a>
- </li>
- <li>
- Click Finish. The new project appears in the Package Explorer.
- </li>
- </ol>
-<h2 id="CreateTestClass">Creating the Test Case Class</h2>
-<p>
- You now have a test project HelloAndroidTest, and the basic structure of a test application
- also called HelloAndroidTest. The basic structure includes all the files and directories you
- need to build and run a test application, <em>except for</em> the class that contains
- your tests (the <strong>test case class</strong>).
-</p>
-<p>
- The next step is to define the test case class. In this tutorial, you define a test case class
- that extends one of Android's test case classes designed for Activities. The class contains
- definitions for four methods:
-</p>
- <ol>
- <li>
- <code>HelloAndroidTest</code>: This defines the constructor for the class. It is
- required by the Android testing framework.
- </li>
- <li>
- <code>setUp()</code>: This overrides the JUnit <code>setUp()</code> method. You use
- it to initialize the environment before each test runs.
- </li>
- <li>
- <code>testPreconditions()</code>: This defines a small test that ensures the Hello, Android
- application starts up correctly.
- </li>
- <li>
- <code>testText()</code>: This tests that what is displayed on the screen is the
- same as what is contained in the application's string resources. It is an example of
- a real unit test you would perform against an application's UI.
- </li>
- </ol>
-<p>
- The following sections contain the code for the test case class and its methods.
-</p>
-
-<h3 id="CreateTestCaseClassFile">Adding the test case class file</h3>
-<p>
- To add the Java file for the test case class, follow these steps
-</p>
- <ol>
- <li>
- In Eclipse, open the HelloAndroidTest project if it is not already open.
- </li>
- <li>
- Within HelloAndroidTest, expand the <code>src/</code> folder and
- then find the package icon for <code>com.example.helloandroid.test</code>.
- Right-click on the package icon and select <strong>New</strong> > <strong>Class</strong>:
- <p>
- <a href="{@docRoot}images/testing/hwtest_create_test_class_menu_callouts.png">
- <img alt="Menu for creating a new class in the test application" src="{@docRoot}images/testing/hwtest_create_test_class_menu_callouts.png" style="height:230px"/>
- </a>
- </p>
- <p>
- The New Java Class dialog appears.
- </p>
- </li>
- <li>
- In the dialog, enter the following:
- <ul>
- <li>
- <em>Name:</em> "HelloAndroidTest". This becomes the name of your test class.
- </li>
- <li>
- <em>Superclass:</em> "<code>android.test.ActivityInstrumentationTestCase2<HelloAndroid></code>".
- The superclass is parameterized by an Activity class name.
- <p>
- The dialog should now look like this:
- </p>
- <a href="{@docRoot}images/testing/hwtest_new_test_class_dialog_complete_callouts.png">
- <img alt="New Java Class dialog with entries" src="{@docRoot}images/testing/hwtest_new_test_class_dialog_complete_callouts.png" style="height:230px"/>
- </a>
- </li>
- </ul>
- <p>
- Do not change any of the other settings. Click Finish.
- </p>
- </li>
- <li>
- You now have a new file <code>HelloAndroidTest.java</code> in the project.
- This file contains the class <code>HelloAndroidTest</code>,
- which extends the Activity test case class
- <code>ActivityInstrumentationTestCase2<T></code>. You parameterize the
- class with <code>HelloAndroid</code>, which is the class name of the activity under test.
- </li>
- <li>
- Open <code>HelloAndroidTest.java</code>. It should look like this:
-<pre class="prettyprint">
-package com.example.helloandroid.test;
-
-import android.test.ActivityInstrumentationTestCase2;
-
-public class HelloAndroidTest extends ActivityInstrumentationTestCase2<HelloAndroid> {
-}
-</pre>
- </li>
- <li>
- The test case class depends on the <code>HelloAndroid</code> class, which is not
- yet imported. To import the class, add the following line just before the current
- <code>import</code> statement:
-<pre class="prettyprint">
-import com.example.helloandroid.HelloAndroid;
-</pre>
- </li>
- </ol>
-<h3 id="CreateConstructor">Adding the test case constructor</h3>
-<p>
- The test case class constructor is used by the Android testing framework when you run the test.
- It calls the super constructor with parameters that tell the framework what Android application
- should be tested.
-</p>
-<p>
- Add the following constructor method immediately after the class definition:
-</p>
-<pre class="prettyprint">
- public HelloAndroidTest() {
- super("com.example.helloandroid", HelloAndroid.class);
- }
-</pre>
-<p>
- Save the file <code>HelloAndroidTest.java</code>.
-</p>
-<h3 id="CreateSetUp">Adding a setup method</h3>
-<p>
- The <code>setUp()</code> method overrides the JUnit {@link junit.framework.TestCase#setUp() setUp()}
- method, which the Android testing framework calls prior to running each test method. You use
- <code>setUp()</code> to initialize variables and prepare the test environment. For this
- test case, the <code>setUp()</code> method starts the Hello, Android application,
- retrieves the text being displayed on the screen, and retrieves the text string in the
- resource file.
-</p>
-<p>
- First, add the following code immediately after the constructor method:
-</p>
-<pre class="prettyprint">
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- mActivity = this.getActivity();
- mView = (TextView) mActivity.findViewById(com.example.helloandroid.R.id.textview);
- resourceString = mActivity.getString(com.example.helloandroid.R.string.hello);
- }
-</pre>
-<p>
- For this code to work, you must also add some class members and another import statement. To
- add the class members, add the following code immediately after the class definition:
-</p>
-<pre class="prettyprint">
- private HelloAndroid mActivity;
- private TextView mView;
- private String resourceString;
-</pre>
-<p>
- To add the import statement, add the following statement just after the import for
- <code>android.test.ActivityInstrumentationTestCase2</code>:
-</p>
-<pre class="prettyprint">
- import android.widget.TextView;
-</pre>
-<h3 id="CreatePreConditions">Adding a preconditions test</h3>
-<p>
- A preconditions test checks the initial application conditions prior to executing other tests.
- It's similar to <code>setUp()</code>, but with less overhead, since it only runs once.
-</p>
-<p>
- Although a preconditions test can check for a variety of different conditions,
- in this application it only needs to check whether the application under test is
- initialized properly and the target TextView exists.
- To do this, it calls the inherited
- {@link junit.framework.Assert#assertNotNull(Object) assertNotNull()}
- method, passing a reference to the TextView.
- The test succeeds only if the object reference is not null.
-</p>
-<pre class="prettyprint">
- public void testPreconditions() {
- assertNotNull(mView);
- }
-</pre>
-<h3 id="CreateText">Adding a unit test</h3>
-<p>
- Now add a simple unit test to the test case class.
- The method <code>testText()</code> will call a
- {@link junit.framework.Assert JUnit Assert}
- method to check whether the target TextView is displaying the expected text.
-</p>
-<p>
- For this example, the test expects that the TextView is
- displaying the string resource that was originally declared for it in HelloAndroid's
- <code>main.xml</code> file, referred to by the resource ID <code>hello</code>.
- The call to
- {@link junit.framework.Assert#assertEquals(String, String) assertEquals(String,String)}
- compares the expected value, read directly from the <code>hello</code>string resource,
- to the text displayed by the TextView, obtained from the
- TextView's <code>getText()</code> method. The test succeeds only if the strings match.
-</p>
-<p>
- To add this test, add the following code
- immediately after the <code>testPreconditions()</code> method:
-</p>
-<pre class="prettyprint">
- public void testText() {
- assertEquals(resourceString,(String)mView.getText());
- }
-</pre>
-<h3 id="CompleteTest">The finished test case class</h3>
-<p>
- You have now finished writing the test. This is what the complete test case class
- should look like:
-</p>
-<pre class="prettyprint">
-package com.example.helloandroid.test;
-
-import com.example.helloandroid.HelloAndroid;
-import android.test.ActivityInstrumentationTestCase2;
-import android.widget.TextView;
-
-public class HelloAndroidTest extends ActivityInstrumentationTestCase2<HelloAndroid> {
- private HelloAndroid mActivity; // the activity under test
- private TextView mView; // the activity's TextView (the only view)
- private String resourceString;
-
- public HelloAndroidTest() {
- super("com.example.helloandroid", HelloAndroid.class);
- }
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- mActivity = this.getActivity();
- mView = (TextView) mActivity.findViewById(com.example.helloandroid.R.id.textview);
- resourceString = mActivity.getString(com.example.helloandroid.R.string.hello);
- }
- public void testPreconditions() {
- assertNotNull(mView);
- }
- public void testText() {
- assertEquals(resourceString,(String)mView.getText());
- }
-}
-</pre>
-<h2 id="RunTest">Running the Tests and Seeing the Results</h2>
-<p>
- You can now run the tests you've created against the Hello, Android application. In Eclipse with
- ADT, you run a test application as an <strong>Android JUnit test</strong> rather than a regular
- Android application.
-</p>
-<p>
- To run the test application as an Android JUnit test, in the Package Explorer right-click
- the HelloAndroidTest project and select <strong>Run As</strong> > <strong>Android JUnit Test</strong>
-</p>
- <a href="{@docRoot}images/testing/hwtest_runas_menu_callouts.png">
- <img alt="Menu to run Hello, World as an Android JUnit test"
- src="{@docRoot}images/testing/hwtest_runas_menu_callouts.png" style="height:230px">
- </a>
-<p>
- The ADT plugin then launches the test application and the application
- under test on a the target emulator or device. When both applications are running,
- the testing framework runs the tests and reports the results in the JUnit view of Eclipse,
- which appears by default as a tab next to the Package Explorer.
-</p>
-<p>
- As shown below, the JUnit view shows test results in two separate panes:
- an upper pane summarizes the tests that were run and a lower pane reports the failure traces
- for the tests. In this case, the tests in this example have run successfully, so there is no
- failure reported in the view:
-</p>
- <a href="{@docRoot}images/testing/hwtest_junit_success.png">
- <img src="{@docRoot}images/testing/hwtest_junit_success.png"
- alt="JUnit test run success" style="height:230px"/>
- </a>
-<p>
- The upper pane summarizes the test:
-</p>
- <ul>
- <li>
- "Finished after <em>x</em> seconds": How long the test took to run.
- </li>
- <li>
- "Runs": The number of tests run.
- </li>
- <li>
- "Errors:": The number of program errors and exceptions encountered during
- the test run.
- </li>
- <li>
- "Failures:": The number of assertion failures encountered during the
- test run.
- </li>
- <li>
- A progress bar. The progress bar extends from left to right as the tests run.
- <p>
- If all the tests succeed, the bar remains green.
- If a test fails, the bar turns from green to red.
- </p>
- </li>
- <li>
- A test method summary. Below the bar, you see a line for each class in the
- test application, labeled by its fully-qualified class name.
- To look at the results for the individual methods in a test case class,
- click the arrow at the left of the class to expand the line.
- You see the name of each test method. To the right of the method name, you see the
- time needed to run that method. You can look at the method's code by
- double-clicking its name.
- </li>
- </ul>
- <p>
- The lower pane contains the failure trace. If all the tests are successful,
- this pane is empty. If some tests fail, then if you select a failed test in the
- upper pane, the lower view contains a stack trace for the test.
- </p>
-<h2 id="NextSteps">Next Steps</h2>
-<p>
- This simple example test application has shown you how to create a test project,
- create a test class and test cases, and then run the tests against a target application.
- Now that you are familiar with these fundamentals, here are some suggested next steps:
-</p>
-<p>
- <strong>Learn more about testing on Android</strong>
-</p>
-<ul>
- <li>
- The
- <a href="{@docRoot}guide/topics/testing/testing_android.html">Testing Android Applications</a>
- document in the <em>Dev Guide</em> provides an overview of how testing on Android works.
- If you are just getting started with Android testing, reading that document will
- help you understand the tools available to you, so that you can develop effective
- tests.
- </li>
-</ul>
-<p>
- <strong>Learn more about the testing classes available in Android</strong>
-</p>
-<ul>
- <li>
- For an overview of the types of testing classes you can use,
- browse through the reference documentation for
- {@link android.test.ActivityInstrumentationTestCase2},
- {@link android.test.ProviderTestCase2},
- {@link android.test.ServiceTestCase}, and
- {@link junit.framework.Assert}.
- </li>
-</ul>
-<p>
- <strong>Explore the Android instrumentation framework</strong>
-</p>
-<ul>
- <li>
- The {@link android.test.InstrumentationTestRunner} class contains the code that Android uses
- to run tests against an application. The {@link android.test.InstrumentationTestCase} class
- is the base class for test case classes that use additional instrumentation features.
- </li>
-</ul>
-<p>
- <strong>Follow the Activity Testing tutorial</strong>
-</p>
-<ul>
- <li>
- The <a href="{@docRoot}resources/tutorials/testing/activity_test.html">Activity Testing</a>
- tutorial is an excellent follow-up to this tutorial.
- It guides you through a more complex testing scenario that you develop against a
- more realistic application.
- </li>
-</ul>
diff --git a/docs/html/resources/tutorials/views/hello-autocomplete.jd b/docs/html/resources/tutorials/views/hello-autocomplete.jd
deleted file mode 100644
index e26683d..0000000
--- a/docs/html/resources/tutorials/views/hello-autocomplete.jd
+++ /dev/null
@@ -1,173 +0,0 @@
-page.title=Auto Complete
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>To create a text entry widget that provides auto-complete suggestions, use
-the {@link android.widget.AutoCompleteTextView} widget. Suggestions are received from a
-collection of strings associated with the widget through an {@link
-android.widget.ArrayAdapter}.</p>
-
-<p>In this tutorial, you will create a {@link android.widget.AutoCompleteTextView} widget that
-provides suggestions for a country name.</p>
-
-
-<ol>
- <li>Start a new project named <em>HelloAutoComplete</em>.</li>
- <li>Create an XML file named <code>list_item.xml</code> and save it inside the
-<code>res/layout/</code> folder. Edit the file to look like this:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:padding="10dp"
- android:textSize="16sp"
- android:textColor="#000">
-</TextView>
-</pre>
- <p>This file defines a simple {@link android.widget.TextView} that will be used for each
-item that appears in the list of suggestions.</p>
- </li>
- <li>Open the <code>res/layout/main.xml</code> file and insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:padding="5dp">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Country" />
- <AutoCompleteTextView android:id="@+id/autocomplete_country"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="5dp"/>
-</LinearLayout>
-</pre>
- <p>The {@link android.widget.TextView} is a label that introduces the {@link
-android.widget.AutoCompleteTextView} widget.
-</li>
-
-<li>Open <code>HelloAutoComplete.java</code> and insert the following code for the {@link
-android.app.Activity#onCreate(Bundle) onCreate()} method:
-<pre>
-@Override
-protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_country);
- ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_item, COUNTRIES);
- textView.setAdapter(adapter);
-}
-</pre>
-
-<p>After the content view is set to the <code>main.xml</code> layout, the {@link
-android.widget.AutoCompleteTextView} widget is captured from the layout with {@link
-android.app.Activity#findViewById(int)}. A new {@link
-android.widget.ArrayAdapter} is then initialized to bind the <code>list_item.xml</code> layout
-to each list item in the <code>COUNTRIES</code> string array (defined in the next step).
-Finally, {@link android.widget.AutoCompleteTextView#setAdapter(T) setAdapter()} is called to
-associate the {@link android.widget.ArrayAdapter} with the
-{@link android.widget.AutoCompleteTextView} widget so that the string array will populate
-the list of suggestions.</p>
-</li>
-
-<li>Inside the <code>HelloAutoComplete</code> class, add the string array:
-<pre>
-static final String[] COUNTRIES = new String[] {
- "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
- "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",
- "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan",
- "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
- "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
- "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory",
- "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi",
- "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde",
- "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
- "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
- "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic",
- "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic",
- "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea",
- "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland",
- "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia",
- "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar",
- "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau",
- "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary",
- "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica",
- "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos",
- "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg",
- "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands",
- "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova",
- "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia",
- "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand",
- "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas",
- "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru",
- "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar",
- "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena",
- "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon",
- "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal",
- "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands",
- "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea",
- "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden",
- "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas",
- "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey",
- "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda",
- "Ukraine", "United Arab Emirates", "United Kingdom",
- "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan",
- "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara",
- "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
-};
-</pre>
-<p>This is the list of suggestions that will be provided in a drop-down list when the user types into
-the {@link android.widget.AutoCompleteTextView} widget.</p>
-</li>
-
-<li>Run the application.</li>
-</ol>
-<p>As you type, you should see something like this:</p>
-<img src="images/hello-autocomplete.png" width="150px" />
-
-
-<h2>More Information</h2>
-
-<p>Note that using a hard-coded string array is not a recommended design practice because your
-application code should focus on behavior, not content. Application content such as strings
-should be externalized from the code in order to make modifications to the content easier and
-facilitate localization of the content. The hard-coded strings are used in this tutorial only to
-make it simple and focus on the {@link android.widget.AutoCompleteTextView} widget.
-Instead, your application should declare such string arrays in an XML file. This can be done
-with a {@code <string-array<} resource in your project {@code res/values/strings.xml} file.
-For example:</p>
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string-array name="countries_array">
- <item>Bahrain</item>
- <item>Bangladesh</item>
- <item>Barbados</item>
- <item>Belarus</item>
- <item>Belgium</item>
- <item>Belize</item>
- <item>Benin</item>
- </string-array>
-</resources>
-</pre>
-<p>To use these resource strings for the {@link android.widget.ArrayAdapter}, replace the original
-{@link android.widget.ArrayAdapter} constructor line with the following:</p>
-<pre>
-String[] countries = getResources().getStringArray(R.array.countries_array);
-ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_item, countries);
-</pre>
-
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.ArrayAdapter}</li>
- <li>{@link android.widget.AutoCompleteTextView}</li>
-</ul>
-
-
diff --git a/docs/html/resources/tutorials/views/hello-datepicker.jd b/docs/html/resources/tutorials/views/hello-datepicker.jd
deleted file mode 100644
index c50d650..0000000
--- a/docs/html/resources/tutorials/views/hello-datepicker.jd
+++ /dev/null
@@ -1,173 +0,0 @@
-page.title=Date Picker
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>To provide a widget for selecting a date, use the {@link android.widget.DatePicker}
-widget, which allows the user to select the month, day, and year, in a familiar interface.</p>
-
-<p>In this tutorial, you'll create a {@link android.app.DatePickerDialog}, which presents the
-date picker in a floating dialog box at the press of a button. When the date is set by
-the user, a {@link android.widget.TextView} will update with the new date.</p>
-
-<ol>
- <li>Start a new project named <em>HelloDatePicker</em>.</li>
- <li>Open the <code>res/layout/main.xml</code> file and insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical">
- <TextView android:id="@+id/dateDisplay"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text=""/>
- <Button android:id="@+id/pickDate"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Change the date"/>
-</LinearLayout>
-</pre>
- <p>This creates a basic {@link android.widget.LinearLayout} with a {@link android.widget.TextView}
- that will display the date and a {@link android.widget.Button} that will open the {@link
- android.app.DatePickerDialog}.</p>
- </li>
-
- <li>Open <code>HelloDatePicker.java</code> and add the following members to the class:
-<pre>
- private TextView mDateDisplay;
- private Button mPickDate;
- private int mYear;
- private int mMonth;
- private int mDay;
-
- static final int DATE_DIALOG_ID = 0;
-</pre>
- <p>The first group of members define variables for the layout {@link android.view.View}s and the
-date items. The <code>DATE_DIALOG_ID</code> is a static integer that uniquely identifies the {@link
-android.app.Dialog} that will display the date picker.</p>
- </li>
-
- <li>Now add the following code for the {@link android.app.Activity#onCreate(Bundle) onCreate()}
-method:
-<pre>
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- // capture our View elements
- mDateDisplay = (TextView) findViewById(R.id.dateDisplay);
- mPickDate = (Button) findViewById(R.id.pickDate);
-
- // add a click listener to the button
- mPickDate.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- showDialog(DATE_DIALOG_ID);
- }
- });
-
- // get the current date
- final Calendar c = Calendar.getInstance();
- mYear = c.get(Calendar.YEAR);
- mMonth = c.get(Calendar.MONTH);
- mDay = c.get(Calendar.DAY_OF_MONTH);
-
- // display the current date (this method is below)
- updateDisplay();
- }
-</pre>
-
-<p>First, the content is set to the <code>main.xml</code> layout. Then the {@link
-android.widget.TextView} and {@link android.widget.Button} elements are captured from the layout
-with {@link android.app.Activity#findViewById(int)}. A
-new {@link android.view.View.OnClickListener} is created for the
-{@link android.widget.Button}, so that when it is clicked, it
-will call {@link android.app.Activity#showDialog(int)}, passing the unique integer ID for
-the date picker dialog. Using {@link android.app.Activity#showDialog(int)} allows the {@link
-android.app.Activity} to manage the life-cycle of the dialog and will call the {@link
-android.app.Activity#onCreateDialog(int)} callback method to request the {@link android.app.Dialog}
-that should be displayed (which you'll
-define later). After the on-click listener is set, a new {@link java.util.Calendar} is created
-and the current year, month and day are acquired. Finally, the private
-<code>updateDisplay()</code> method is called in order to fill the {@link android.widget.TextView}
-with the current date.</p>
-</li>
-
-<li>Add the <code>updateDisplay()</code> method:
-<pre>
- // updates the date in the TextView
- private void updateDisplay() {
- mDateDisplay.setText(
- new StringBuilder()
- // Month is 0 based so add 1
- .append(mMonth + 1).append("-")
- .append(mDay).append("-")
- .append(mYear).append(" "));
- }
-</pre>
-<p>This method uses the member date values declared for the class to write the date to the layout's
-{@link android.widget.TextView}, {@code mDateDisplay}, which was also declared and initialized
-above.</p>
-</li>
-
-<li>Initialize a new {@link android.app.DatePickerDialog.OnDateSetListener} as a member of the
-<code>HelloDatePicker</code> class:
-<pre>
- // the callback received when the user "sets" the date in the dialog
- private DatePickerDialog.OnDateSetListener mDateSetListener =
- new DatePickerDialog.OnDateSetListener() {
-
- public void onDateSet(DatePicker view, int year,
- int monthOfYear, int dayOfMonth) {
- mYear = year;
- mMonth = monthOfYear;
- mDay = dayOfMonth;
- updateDisplay();
- }
- };
-</pre>
-<p>The {@link android.app.DatePickerDialog.OnDateSetListener} listens for when the user
-has set the date (by clicking the "Set" button). At that time, the {@link
-android.app.DatePickerDialog.OnDateSetListener#onDateSet(DatePicker,int,int,int) onDateSet()}
-callback method is called, which is defined to update the {@code mYear}, {@code mMonth}, and
-{@code mDay} member fields with the new date then call the private <code>updateDisplay()</code>
-method to update the {@link android.widget.TextView}.</p>
-</li>
-
-<li>Now add the {@link android.app.Activity#onCreateDialog(int)} callback method to the {@code
-HelloDatePicker} class:
-<pre>
-@Override
-protected Dialog onCreateDialog(int id) {
- switch (id) {
- case DATE_DIALOG_ID:
- return new DatePickerDialog(this,
- mDateSetListener,
- mYear, mMonth, mDay);
- }
- return null;
-}
-</pre>
-<p>This is an {@link android.app.Activity} callback method that is passed the integer ID given to
-{@link android.app.Activity#showDialog(int)} (which is called by the button's {@link
-android.view.View.OnClickListener}). When the ID matches the switch case defined here, a {@link
-android.app.DatePickerDialog} is instantiated with the {@link
-android.app.DatePickerDialog.OnDateSetListener} created in the previous
-step, along with the date variables to initialize the widget date.</p>
-</li>
-
-<li>Run the application.</li>
-</ol>
-<p>When you press the "Change the date" button, you should see the following:</p>
-<img src="images/hello-datepicker.png" width="150px" />
-
-<h3>References</h3>
-<ul>
-<li>{@link android.app.DatePickerDialog}</li>
-<li>{@link android.app.DatePickerDialog.OnDateSetListener}</li>
-<li>{@link android.widget.Button}</li>
-<li>{@link android.widget.TextView}</li>
-<li>{@link java.util.Calendar}</li>
-</ul>
-
diff --git a/docs/html/resources/tutorials/views/hello-formstuff.jd b/docs/html/resources/tutorials/views/hello-formstuff.jd
deleted file mode 100644
index 1ddd1df..0000000
--- a/docs/html/resources/tutorials/views/hello-formstuff.jd
+++ /dev/null
@@ -1,400 +0,0 @@
-page.title=Form Stuff
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>This tutorial introduces a variety of widgets that are useful when creating forms, such as
-image buttons, text fields, checkboxes and radio buttons.</p>
-
-
-<ol>
- <li>Start a new project named <em>HelloFormStuff</em>.</li>
- <li>Your <code>res/layout/main.xml</code> file should already have a basic {@link
-android.widget.LinearLayout}:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
-</LinearLayout>
-</pre>
- <p>For each widget you want to add, just put the respective View inside this {@link
-android.widget.LinearLayout}.</p>
- </li>
-</ol>
-<p>Each section below also assumes that your <code>HelloFormStuff</code> Activity has the following
-default implementation of the {@link android.app.Activity#onCreate(Bundle) onCreate()} method:</p>
-<pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-}
-</pre>
-
-<p>Now select which kind of form widget you'd like to create:</p>
-<ul>
- <li><a href="#CustomButton">Custom Button</a></li>
- <li><a href="#EditText">Edit Text</a></li>
- <li><a href="#Checkbox">Checkbox</a></li>
- <li><a href="#RadioButtons">Radio Buttons</a></li>
- <li><a href="#ToggleButton">Toggle Button</a></li>
- <li><a href="#RatingBar">Rating Bar</a></li>
-</ul>
-
-
-
-<h2 id="CustomButton">Custom Button</h2>
-
-<p>In this section, you will create a button with a custom image instead of text, using the {@link
-android.widget.Button} widget and an XML file that defines three different images to use for the
-different button states. When the button is pressed, a short message will be displayed.</p>
-
-<img src="images/android_pressed.png" style="float:right;" title="android_pressed.png"/>
-<img src="images/android_focused.png" style="float:right;clear:right;" title="android_focused.png"/>
-<img src="images/android_normal.png" style="float:right;clear:right;" title="android_normal.png"/>
-<ol>
- <li>Copy the images on the right into the <code>res/drawable/</code> directory of
-your project. These will be used for the different button states.</li>
- <li>Create a new file in the <code>res/drawable/</code> directory named
-<code>android_button.xml</code>.
-Insert the following XML:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@drawable/android_pressed"
- android:state_pressed="true" />
- <item android:drawable="@drawable/android_focused"
- android:state_focused="true" />
- <item android:drawable="@drawable/android_normal" />
-</selector>
-</pre>
- <p>This defines a single drawable resource, which will change its image based on the current
-state of the button. The first <code><item></code> defines
-<code>android_pressed.png</code> as the image when the button is pressed (it's been
-activated); the second <code><item></code> defines <code>android_focused.png</code> as the image
-when the button is focused (when the button is highlighted using the trackball or directional
-pad); and the third <code><item></code> defines <code>android_normal.png</code> as the image
-for the normal state (when neither pressed nor focused). This XML file now represents a single
-drawable resource and when referenced by a {@link android.widget.Button} for its background,
-the image displayed will change based on these three states.</p>
- <p class="note"><strong>Note:</strong> The order of the <code><item></code> elements is
-important. When this drawable is referenced, the <code><item></code>s are traversed in-order to
-determine which one is appropriate for the current button state. Because the "normal" image is last,
-it is only applied when the conditions <code>android:state_pressed</code> and
-<code>android:state_focused</code> have both evaluated false.</li>
- <li>Open the <code>res/layout/main.xml</code> file and add the {@link
-android.widget.Button} element:
-<pre>
- <Button
- android:id="@+id/button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="10dp"
- android:background="@drawable/android_button"
- android:onClick="onButtonClicked"/>
-</pre>
- <p>The <code>android:background</code> attribute specifies the drawable resource to use for the
-button background (which, when saved at <code>res/drawable/android.xml</code>, is
-referenced as <code>@drawable/android</code>). This replaces the normal background image
-applied by the system with the drawable created above, which changes its image based on
-the button state.</p>
- <p>The attribute <code>android:onClick</code> specifies the name of a method in your activity
-that the system should call when the user clicks the button. You'll create that method next.</p>
-</li>
-
-<li>To make the button do something when pressed, add the following
-method inside your {@link android.app.Activity} class:
-<pre>
-public void onButtonClicked(View v) {
- // Do something when the button is clicked
- Toast.makeText(HelloFormStuff.this, "Button clicked", Toast.LENGTH_SHORT).show();
-}
-</pre>
-<p>When you specify this kind of method, which is used in your layout file with the {@code
-android:onClick} attribute, the method must be <code>public</code>, have a <code>void</code> return
-value, and accept a single {@code android.view.View} parameter. When the system calls this method,
-it passes the {@code android.view.View} that was clicked.</p>
-</li>
-<li>Now run the application.</li>
-</ol>
-
-
-
-<h2 id="EditText">Edit Text</h2>
-
-<p>In this section, you will create a text field for user input, using the {@link
-android.widget.EditText} widget. Once text has been entered into the field, the "Enter" key will
-display the text in a toast message.</p>
-
-<ol>
- <li>Open the <code>res/layout/main.xml</code> file and add the {@link android.widget.EditText}
-element (inside the {@link android.widget.LinearLayout}):
-<pre>
- <EditText
- android:id="@+id/edittext"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"/>
-</pre>
-</li>
-<li>To do something with the text that the user types, add the following code
-to the end of the {@link android.app.Activity#onCreate(Bundle) onCreate()} method:
-<pre>
-final EditText edittext = (EditText) findViewById(R.id.edittext);
-edittext.setOnKeyListener(new OnKeyListener() {
- public boolean onKey(View v, int keyCode, KeyEvent event) {
- // If the event is a key-down event on the "enter" button
- if ((event.getAction() == KeyEvent.ACTION_DOWN) &&
- (keyCode == KeyEvent.KEYCODE_ENTER)) {
- // Perform action on key press
- Toast.makeText(HelloFormStuff.this, edittext.getText(), Toast.LENGTH_SHORT).show();
- return true;
- }
- return false;
- }
-});
-</pre>
-<p>This captures the {@link android.widget.EditText} element from the layout and adds an {@link
-android.view.View.OnKeyListener}. The {@link android.view.View.OnKeyListener} must implement the
-{@link android.view.View.OnKeyListener#onKey(View,int,KeyEvent)} method, which
-defines the action to be made when a key is pressed while the widget has focus. In this case, the
-method is defined to listen for the Enter key (when pressed down), then pop up a {@link
-android.widget.Toast} message with the text that has been entered. The {@link
-android.view.View.OnKeyListener#onKey(View,int,KeyEvent)} method should always return
-<code>true</code> if the event has been handled, so that the event doesn't bubble-up (which would
-result in a carriage return in the text field).</p>
-</li>
-<li>Run the application.</li>
-</ol>
-
-
-
-<h2 id="Checkbox">Checkbox</h2>
-
-<p>In this section, you will create a checkbox for selecting items, using the {@link
-android.widget.CheckBox} widget. When the checkbox is pressed, a toast message will
-indicate the current state of the checkbox.</p>
-
-<ol>
- <li>Open the <code>res/layout/main.xml</code> file and add the {@link android.widget.CheckBox}
-element (inside the {@link android.widget.LinearLayout}):
-<pre>
- <CheckBox android:id="@+id/checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="check it out"
- android:onClick="onCheckboxClicked"/>
-</pre>
- <p>The attribute <code>android:onClick</code> specifies the name of a method in your activity
-that the system should call when the user clicks the check box. You'll create that method next.</p>
-</li>
-<li>To do something when the state is changed, add the following method inside your {@link
-android.app.Activity} class:</p>
-
-<pre>
-public void onCheckboxClicked(View v) {
- // Perform action on clicks, depending on whether it's now checked
- if (((CheckBox) v).isChecked()) {
- Toast.makeText(HelloFormStuff.this, "Selected", Toast.LENGTH_SHORT).show();
- } else {
- Toast.makeText(HelloFormStuff.this, "Not selected", Toast.LENGTH_SHORT).show();
- }
-}
-</pre>
-
-<p>When you specify this kind of method, which is used in your layout file with the {@code
-android:onClick}
-attribute, the method must be <code>public</code>, have a <code>void</code> return value, and
-accept a single {@code android.view.View} parameter. When the system calls this method, it
-passes the {@code android.view.View} that was clicked. In this example, the {@code
-android.view.View} is cast to a {@link android.widget.CheckBox} to determine whether the widget
-has been checked or unchecked. The {@link android.widget.CheckBox} widget
-handles its own state changes, so you only need to query the current state.</p>
-</li>
-<li>Run it.</li>
-</ol>
-<p class="note"><strong>Tip:</strong> If you need to change the state
-yourself (such as when loading a saved {@link android.preference.CheckBoxPreference}),
-use the {@link android.widget.CompoundButton#setChecked(boolean)} or {@link
-android.widget.CompoundButton#toggle()} method.</p>
-
-
-
-<h2 id="RadioButtons">Radio Buttons</h2>
-
-<p>In this section, you will create two mutually-exclusive radio buttons (enabling one disables
-the other), using the {@link android.widget.RadioGroup} and {@link android.widget.RadioButton}
-widgets. When either radio button is pressed, a toast message will be displayed.</p>
-
-<ol>
- <li>Open the <code>res/layout/main.xml</code> file and add two {@link
-android.widget.RadioButton}s, nested in a {@link android.widget.RadioGroup} (inside the {@link
-android.widget.LinearLayout}):
-<pre>
- <RadioGroup
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
- <RadioButton android:id="@+id/radio_red"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Red"
- android:onClick="onRadioButtonClicked"/>
- <RadioButton android:id="@+id/radio_blue"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Blue"
- android:onClick="onRadioButtonClicked"/>
- </RadioGroup>
-</pre>
-<p>It's important that the {@link android.widget.RadioButton}s are grouped together by the {@link
-android.widget.RadioGroup} element so that no more than one can be selected at a time. This logic
-is automatically handled by the Android system. When one {@link android.widget.RadioButton} within
-a group is selected, all others are automatically deselected.</p>
- <p>The attribute <code>android:onClick</code> specifies the name of a method in your activity
-that the system should call when the user clicks the radio button. You'll create that method
-next.</p>
-</li>
-
-<li>To do something when each {@link android.widget.RadioButton} is selected, add the following
-method inside your {@link android.app.Activity} class:</p>
-
-<pre>
-public void onRadioButtonClicked(View v) {
- // Perform action on clicks
- RadioButton rb = (RadioButton) v;
- Toast.makeText(HelloFormStuff.this, rb.getText(), Toast.LENGTH_SHORT).show();
-}
-</pre>
-
-<p>When you specify this kind of method, which is used in your layout file with the {@code
-android:onClick}
-attribute, the method must be <code>public</code>, have a <code>void</code> return value, and
-accept a single {@code android.view.View} parameter. When the system calls this method, it
-passes the {@code android.view.View} that was clicked.</p>
-<p>Because each {@link android.widget.RadioButton} widget is grouped into a {@link
-android.widget.RadioGroup}, each widget handles its own state changes when a new button is
-selected.</p>
-</li>
-<li>Run the application.</li>
-</ol>
-
-<p class="note"><strong>Tip:</strong> If you need to change the state
-yourself (such as when loading a saved {@link android.preference.CheckBoxPreference}),
-use the {@link android.widget.CompoundButton#setChecked(boolean)} or {@link
-android.widget.CompoundButton#toggle()} method.</p>
-
-
-
-<h2 id="ToggleButton">Toggle Button</h2>
-
-<p>In this section, you'll create a button used specifically for toggling between two
-states, using the {@link android.widget.ToggleButton} widget. This widget is an excellent
-alternative to radio buttons if you have two simple states that are mutually exclusive ("on" and
-"off", for example).</p>
-
-<ol>
- <li>Open the <code>res/layout/main.xml</code> file and add the {@link android.widget.ToggleButton}
-element (inside the {@link android.widget.LinearLayout}):
-<pre>
- <ToggleButton android:id="@+id/togglebutton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textOn="Vibrate on"
- android:textOff="Vibrate off"
- android:onClick="onToggleClicked"/>
-</pre>
- <p>The attributes <code>android:textOn</code> and <code>android:textOff</code> specify the text
-for the button when the button has been toggled on or off. The default values are "ON" and
-"OFF".</p>
- <p>The attribute <code>android:onClick</code> specifies the name of a method in your activity
-that the system should call when the user clicks the button. You'll create that method next.</p>
-</li>
-<li>To do something when the user clicks the button, add the following
-method inside your {@link android.app.Activity} class:</p>
-
-<pre>
-public void onToggleClicked(View v) {
- // Perform action on clicks
- if (((ToggleButton) v).isChecked()) {
- Toast.makeText(HelloFormStuff.this, "Toggle on", Toast.LENGTH_SHORT).show();
- } else {
- Toast.makeText(HelloFormStuff.this, "Toggle off", Toast.LENGTH_SHORT).show();
- }
-}
-</pre>
-
-<p>When you specify this kind of method, which is used in your layout file with the {@code
-android:onClick}
-attribute, the method must be <code>public</code>, have a <code>void</code> return value, and
-accept a single {@code android.view.View} parameter. When the system calls this method, it
-passes the {@code android.view.View} that was clicked.</p>
-<p>In this example, the callback
-method checks the new state of the button, then shows a {@link android.widget.Toast} message that
-indicates the current state.</p>
-
-<p>Notice that the {@link android.widget.ToggleButton} handles its own state change between checked
-and unchecked, so you just ask which it is.</p>
-<li>Run the application.</li>
-</ol>
-
-<p class="note"><strong>Tip:</strong> If you need to change the state
-yourself (such as when loading a saved {@link android.preference.CheckBoxPreference}),
-use the {@link android.widget.CompoundButton#setChecked(boolean)} or {@link
-android.widget.CompoundButton#toggle()} method.</p>
-
-
-
-
-<h2 id="RatingBar">Rating Bar</h2>
-
-<p>In this section, you'll create a widget that allows the user to provide a rating,
-with the {@link android.widget.RatingBar} widget.</p>
-
-<ol>
- <li>Open the <code>res/layout/main.xml</code> file and add the {@link android.widget.RatingBar}
-element (inside the {@link android.widget.LinearLayout}):
-<pre>
- <RatingBar android:id="@+id/ratingbar"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:numStars="5"
- android:stepSize="1.0"/>
-</pre>
- <p>The <code>android:numStars</code> attribute defines how many stars to display for the rating
-bar. The <code>android:stepSize</code> attribute defines the granularity for each
-star (for example, a value of <code>0.5</code> would allow half-star ratings). </p>
-</li>
-<li>To do something when a new rating has been set, add the following code
-to the end of the {@link android.app.Activity#onCreate(Bundle) onCreate()} method:
-<pre>
-final RatingBar ratingbar = (RatingBar) findViewById(R.id.ratingbar);
-ratingbar.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
- public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
- Toast.makeText(HelloFormStuff.this, "New Rating: " + rating, Toast.LENGTH_SHORT).show();
- }
-});
-</pre>
-<p>This captures the {@link android.widget.RatingBar} widget from the layout with {@link
-android.app.Activity#findViewById(int)} and then sets an {@link
-android.widget.RatingBar.OnRatingBarChangeListener}. The {@link
-android.widget.RatingBar.OnRatingBarChangeListener#onRatingChanged(RatingBar,float,boolean)
-onRatingChanged()} callback method then defines the action to perform when the user sets a rating.
-In this case, a simple {@link android.widget.Toast} message displays the new rating.</p>
-
-<li>Run the application.</li>
-</ol>
-
-<p>If you've added all the form widgets above, your application should look like this:</p>
-<img src="images/hello-formstuff.png" width="150px" />
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.ImageButton}</li>
- <li>{@link android.widget.EditText}</li>
- <li>{@link android.widget.CheckBox}</li>
- <li>{@link android.widget.RadioButton}</li>
- <li>{@link android.widget.ToggleButton}</li>
- <li>{@link android.widget.RatingBar}</li>
-</ul>
-
diff --git a/docs/html/resources/tutorials/views/hello-gallery.jd b/docs/html/resources/tutorials/views/hello-gallery.jd
deleted file mode 100644
index 5f2ed32..0000000
--- a/docs/html/resources/tutorials/views/hello-gallery.jd
+++ /dev/null
@@ -1,171 +0,0 @@
-page.title=Gallery
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>{@link android.widget.Gallery} is a layout widget used to display items in a
-horizontally scrolling list and positions the current selection at the center of the view.</p>
-
-<p>In this tutorial, you'll create a gallery of photos and then display a toast message each time a
-gallery item is selected.</p>
-
-
-<ol>
- <li>Start a new project named <em>HelloGallery</em>.</li>
- <li>Find some photos you'd like to use, or use these <a
-href="{@docRoot}shareables/sample_images.zip">sample images</a>. Save the images into the project's
-<code>res/drawable/</code> directory.</li>
- <li>Open the <code>res/layout/main.xml</code> file and insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/gallery"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
-/>
-</pre>
- </li>
-
-<li>Open the <code>HelloGallery.java</code> file and insert the following code for the
-{@link android.app.Activity#onCreate(Bundle) onCreate()} method:
-<pre>
-@Override
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- Gallery gallery = (Gallery) findViewById(R.id.gallery);
- gallery.setAdapter(new ImageAdapter(this));
-
- gallery.setOnItemClickListener(new OnItemClickListener() {
- public void onItemClick(AdapterView parent, View v, int position, long id) {
- Toast.makeText(HelloGallery.this, "" + position, Toast.LENGTH_SHORT).show();
- }
- });
-}
-</pre>
- <p>This starts by setting the {@code main.xml} layout as the content view and then capturing the
-{@link android.widget.Gallery} from
-the layout with {@link
-android.app.Activity#findViewById(int)}. A custom {@link android.widget.BaseAdapter} called
-<code>ImageAdapter</code> is
-instantiated and applied to the {@link android.widget.Gallery} with {@link
-android.widget.AdapterView#setAdapter(T) setAdapter()}. (The <code>ImageAdapter</code> class is
-defined next.)
-Then an anonymous {@link android.widget.AdapterView.OnItemClickListener} is instantiated. The
-{@link android.widget.AdapterView.OnItemClickListener#onItemClick(AdapterView,View,int,long)}
-callback method receives the {@link android.widget.AdapterView} where the click occurred, the
-specific {@link android.view.View} that received the click, the
-position of the {@link android.view.View} clicked (zero-based), and the row ID of the item clicked
-(if applicable). In this example, all that's needed is the position of the click to show a {@link
-android.widget.Toast} message that says the position of the item, using
-{@link android.widget.Toast#makeText(Context,CharSequence,int)} and {@link
-android.widget.Toast#show()} (in a real world scenario, this ID could be used to get the full sized
-image for some other task).
-</p>
-</li>
- <li>Create a new XML file in the <code>res/values/</code> directory named <code>attrs.xml</code>.
-Insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <declare-styleable name="HelloGallery">
- <attr name="android:galleryItemBackground" />
- </declare-styleable>
-</resources>
-</pre>
- <p>This is a custom styleable resource that can be applied to a layout. In this case, it will be
-applied to the individual items placed into the {@link android.widget.Gallery} widget. The
-<code><attr></code> element defines a specific attribute for the styleable, and in this case, it
-refers to an existing platform attribute, {@link android.R.attr#galleryItemBackground}, which
-defines a border styling for gallery items. In the next step, you'll
-see how this attribute is referenced and then later applied to each item in the gallery.</p>
- </li>
-
- <li>Go back to the <code>HelloGallery.java</code> file. After the {@link
- android.app.Activity#onCreate(Bundle)} method, define the custom <code>ImageAdapter</code> class:
-<pre>
-public class ImageAdapter extends BaseAdapter {
- int mGalleryItemBackground;
- private Context mContext;
-
- private Integer[] mImageIds = {
- R.drawable.sample_1,
- R.drawable.sample_2,
- R.drawable.sample_3,
- R.drawable.sample_4,
- R.drawable.sample_5,
- R.drawable.sample_6,
- R.drawable.sample_7
- };
-
- public ImageAdapter(Context c) {
- mContext = c;
- TypedArray attr = mContext.obtainStyledAttributes(R.styleable.HelloGallery);
- mGalleryItemBackground = attr.getResourceId(
- R.styleable.HelloGallery_android_galleryItemBackground, 0);
- attr.recycle();
- }
-
- public int getCount() {
- return mImageIds.length;
- }
-
- public Object getItem(int position) {
- return position;
- }
-
- public long getItemId(int position) {
- return position;
- }
-
- public View getView(int position, View convertView, ViewGroup parent) {
- ImageView imageView = new ImageView(mContext);
-
- imageView.setImageResource(mImageIds[position]);
- imageView.setLayoutParams(new Gallery.LayoutParams(150, 100));
- imageView.setScaleType(ImageView.ScaleType.FIT_XY);
- imageView.setBackgroundResource(mGalleryItemBackground);
-
- return imageView;
- }
-}
-</pre>
-<p>First, there are a few member variables, including an array of IDs that reference
-the images saved in the drawable resources directory ({@code res/drawable/}).</p>
-<p>Next is the class constructor, where the {@link android.content.Context} for an {@code
-ImageAdapter} instance is defined and the styleable
-resource defined in the last step is acquired and saved to a local field. At the end of the
-constructor, {@link android.content.res.TypedArray#recycle()} is called on the {@link
-android.content.res.TypedArray} so it can be re-used by the system.</p>
-<p>The methods {@link android.widget.Adapter#getCount()}, {@link
-android.widget.Adapter#getItem(int)}, and {@link android.widget.Adapter#getItemId(int)} are methods
-that must be implemented for simple queries on the {@link android.widget.Adapter}.
-The {@link android.widget.Adapter#getView(int,View,ViewGroup) method does the
-work to apply an image to an {@link android.widget.ImageView} that will be embedded in the
-{@link android.widget.Gallery}. In this method, the member {@link android.content.Context} is used
-to create a new {@link android.widget.ImageView}. The {@link android.widget.ImageView} is prepared
-by applying an image from the local array of drawable resources, setting the {@link
-android.widget.Gallery.LayoutParams} height and width for the image, setting the scale to fit the
-{@link android.widget.ImageView} dimensions, and then finally setting the background to use the
-styleable attribute acquired in the constructor.</p>
-
-<p>See {@link android.widget.ImageView.ScaleType} for other image scaling options.</p>
-</li>
-
-<li>Run the application.</li>
-</ol>
-
-<p>You should see something like this:</p>
-<img src="images/hello-gallery.png" width="150px" />
-
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.BaseAdapter}</li>
- <li>{@link android.widget.Gallery}</li>
- <li>{@link android.widget.ImageView}</li>
- <li>{@link android.widget.AdapterView.OnItemClickListener}</li>
-</ul>
-
-
diff --git a/docs/html/resources/tutorials/views/hello-gridview.jd b/docs/html/resources/tutorials/views/hello-gridview.jd
deleted file mode 100644
index 03bfc54..0000000
--- a/docs/html/resources/tutorials/views/hello-gridview.jd
+++ /dev/null
@@ -1,182 +0,0 @@
-page.title=Grid View
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>{@link android.widget.GridView} is a {@link android.view.ViewGroup} that displays items in a
-two-dimensional,
-scrollable grid. The grid items are automatically inserted to the layout using a {@link
-android.widget.ListAdapter}.</p>
-
-<p>In this tutorial, you'll create a grid of image thumbnails. When an item is selected, a
-toast message will display the position of the image.</p>
-
-
-<ol>
- <li>Start a new project named <em>HelloGridView</em>.</li>
- <li>Find some photos you'd like to use, or <a
-href="{@docRoot}shareables/sample_images.zip">download these sample images</a>. Save the image files
-into the project's
-<code>res/drawable/</code> directory.</li>
- <li>Open the <code>res/layout/main.xml</code> file and insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<GridView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/gridview"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:columnWidth="90dp"
- android:numColumns="auto_fit"
- android:verticalSpacing="10dp"
- android:horizontalSpacing="10dp"
- android:stretchMode="columnWidth"
- android:gravity="center"
-/>
-</pre>
- <p>This {@link android.widget.GridView} will fill the entire screen. The attributes are rather
-self explanatory. For more information about valid attributes, see the {@link
-android.widget.GridView} reference.</p>
-</li>
- <li>Open <code>HelloGridView.java</code> and insert the following code for the
-{@link android.app.Activity#onCreate(Bundle) onCreate()} method:
-<pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- GridView gridview = (GridView) findViewById(R.id.gridview);
- gridview.setAdapter(new ImageAdapter(this));
-
- gridview.setOnItemClickListener(new OnItemClickListener() {
- public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
- Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show();
- }
- });
-}
-</pre>
- <p>After the {@code main.xml} layout is set for the content view, the
-{@link android.widget.GridView} is captured from the layout with {@link
-android.app.Activity#findViewById(int)}. The {@link
-android.widget.GridView#setAdapter(T) setAdapter()} method then sets a custom adapter ({@code
-ImageAdapter}) as the source for all items to be displayed in the grid. The {@code ImageAdapter} is
-created in the next step.</p>
-<p>To do something when an item in the grid is clicked, the {@link
-android.widget.AdapterView#setOnItemClickListener(OnItemClickListener) setOnItemClickListener()}
-method is passed a new {@link android.widget.AdapterView.OnItemClickListener}. This anonymous
-instance defines the {@link
-android.widget.AdapterView.OnItemClickListener#onItemClick(AdapterView,View,int,long)
-onItemClick()} callback method to show a {@link android.widget.Toast} that displays the index
-position (zero-based) of the selected item (in a real world scenario, the position could be used to
-get the full sized
-image for some other task).</p>
-
-</li>
-<li>Create a new class called <code>ImageAdapter</code> that extends {@link
-android.widget.BaseAdapter}:
-<pre>
-public class ImageAdapter extends BaseAdapter {
- private Context mContext;
-
- public ImageAdapter(Context c) {
- mContext = c;
- }
-
- public int getCount() {
- return mThumbIds.length;
- }
-
- public Object getItem(int position) {
- return null;
- }
-
- public long getItemId(int position) {
- return 0;
- }
-
- // 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
- imageView = new ImageView(mContext);
- imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
- imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
- imageView.setPadding(8, 8, 8, 8);
- } else {
- imageView = (ImageView) convertView;
- }
-
- imageView.setImageResource(mThumbIds[position]);
- return imageView;
- }
-
- // references to our images
- private Integer[] mThumbIds = {
- R.drawable.sample_2, R.drawable.sample_3,
- R.drawable.sample_4, R.drawable.sample_5,
- R.drawable.sample_6, R.drawable.sample_7,
- R.drawable.sample_0, R.drawable.sample_1,
- R.drawable.sample_2, R.drawable.sample_3,
- R.drawable.sample_4, R.drawable.sample_5,
- R.drawable.sample_6, R.drawable.sample_7,
- R.drawable.sample_0, R.drawable.sample_1,
- R.drawable.sample_2, R.drawable.sample_3,
- R.drawable.sample_4, R.drawable.sample_5,
- R.drawable.sample_6, R.drawable.sample_7
- };
-}
-</pre>
-<p>First, this implements some required methods inherited from {@link
-android.widget.BaseAdapter}. The constructor and {@link
-android.widget.Adapter#getCount()} are self-explanatory. Normally, {@link
-android.widget.Adapter#getItem(int)} should return the actual object at the specified position in
-the adapter, but it's ignored for this example. Likewise, {@link
-android.widget.Adapter#getItemId(int)} should return the row id of the item, but it's not
-needed here.</p>
-
-<p>The first method necessary is {@link android.widget.Adapter#getView(int,View,ViewGroup)
-getView()}. This method creates a new {@link android.view.View} for each image added to the {@code
-ImageAdapter}. When this is called, a {@link android.view.View} is passed in, which is normally a
-recycled object (at least after this has been called once), so there's a check to see if the
-object is null. If it <em>is</em> null, an {@link android.widget.ImageView} is instantiated and
-configured with desired properties for the image presentation:</p>
-<ul>
- <li>{@link android.view.View#setLayoutParams(ViewGroup.LayoutParams)} sets
-the height and width for the View—this ensures that, no matter the size of the drawable, each
-image is resized and cropped to fit in these dimensions, as appropriate.</li>
- <li>{@link android.widget.ImageView#setScaleType(ImageView.ScaleType)} declares that images should
-be cropped toward the center (if necessary).</li>
- <li>{@link android.widget.ImageView#setPadding(int,int,int,int)} defines the padding for all
-sides. (Note that, if the images have different aspect-ratios, then less
-padding will cause for more cropping of the image if it does not match
-the dimensions given to the ImageView.)</li>
-</ul>
-
-<p>If the {@link android.view.View} passed to {@link
-android.widget.Adapter#getView(int,View,ViewGroup) getView()} is <em>not</em> null, then the local
-{@link android.widget.ImageView} is initialized with the recycled {@link android.view.View}
-object.</p>
-
-<p>At the end of the {@link android.widget.Adapter#getView(int,View,ViewGroup) getView()} method,
-the {@code
-position} integer passed into the method is used to select an image from the {@code mThumbIds}
-array, which is set as the image resource for the {@link android.widget.ImageView}.</p>
-<p>All that's left is to define the {@code mThumbIds} array of drawable resources.</p>
-</li>
-<li>Run the application.</li>
-</ol>
-<p>Your grid layout should look something like this:</p>
-<img src="images/hello-gridview.png" width="150px" />
-
-<p>Try experimenting with the behaviors of the {@link android.widget.GridView} and {@link
-android.widget.ImageView} elements by adjusting their properties. For example, instead of using
-{@link android.view.View#setLayoutParams(ViewGroup.LayoutParams)}, try using
-{@link android.widget.ImageView#setAdjustViewBounds(boolean)}. </p>
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.GridView}</li>
- <li>{@link android.widget.ImageView}</li>
- <li>{@link android.widget.BaseAdapter}</li>
- <li>{@link android.widget.AdapterView.OnItemClickListener}</li>
-</ul>
-
diff --git a/docs/html/resources/tutorials/views/hello-linearlayout.jd b/docs/html/resources/tutorials/views/hello-linearlayout.jd
deleted file mode 100644
index 8e072b1..0000000
--- a/docs/html/resources/tutorials/views/hello-linearlayout.jd
+++ /dev/null
@@ -1,133 +0,0 @@
-page.title=Linear Layout
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>{@link android.widget.LinearLayout} is a {@link android.view.ViewGroup} that displays child
-{@link android.view.View} elements in a linear direction, either vertically or horizontally.</p>
-
-<p>You should be careful about over-using the {@link android.widget.LinearLayout}. If you begin
-nesting multiple {@link android.widget.LinearLayout}s, you may want to consider using a {@link
-android.widget.RelativeLayout} instead.</p>
-
-<ol>
- <li>Start a new project named <em>HelloLinearLayout</em>.</li>
- <li>Open the <code>res/layout/main.xml</code> file and insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_weight="1">
- <TextView
- android:text="red"
- android:gravity="center_horizontal"
- android:background="#aa0000"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_weight="1"/>
- <TextView
- android:text="green"
- android:gravity="center_horizontal"
- android:background="#00aa00"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_weight="1"/>
- <TextView
- android:text="blue"
- android:gravity="center_horizontal"
- android:background="#0000aa"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_weight="1"/>
- <TextView
- android:text="yellow"
- android:gravity="center_horizontal"
- android:background="#aaaa00"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_weight="1"/>
- </LinearLayout>
-
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_weight="1">
- <TextView
- android:text="row one"
- android:textSize="15pt"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"/>
- <TextView
- android:text="row two"
- android:textSize="15pt"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"/>
- <TextView
- android:text="row three"
- android:textSize="15pt"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"/>
- <TextView
- android:text="row four"
- android:textSize="15pt"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"/>
- </LinearLayout>
-
-</LinearLayout>
-</pre>
-
-<p>Carefully inspect this XML. There is a root {@link android.widget.LinearLayout} that defines
-its orientation to be vertical—all child {@link android.view.View}s (of which it has two) will
-be stacked vertically. The first child is
-another {@link android.widget.LinearLayout} that uses a horizontal orientation and the second child
-is a {@link android.widget.LinearLayout} that uses a vertical orientation. Each of these nested
-{@link android.widget.LinearLayout}s contain several {@link android.widget.TextView} elements, which
-are oriented with each other in the manner defined by their parent {@link
-android.widget.LinearLayout}.</p>
-</li>
-<li>Now open <code>HelloLinearLayout.java</code> and be sure it loads the
-<code>res/layout/main.xml</code> layout in the
-{@link android.app.Activity#onCreate(Bundle) onCreate()} method:</p>
-<pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-}
-</pre>
-<p>The {@link android.app.Activity#setContentView(int)} method loads the
-layout file for the {@link android.app.Activity}, specified by the resource
-ID — <code>R.layout.main</code> refers to the <code>res/layout/main.xml</code> layout
-file.</p>
-</li>
-<li>Run the application.</li>
-</ol>
-<p>You should see the following:</p>
-<img src="images/hello-linearlayout.png" width="150px" />
-
-<p>Notice how the XML attributes define each View's behavior. Try
-experimenting with different values for <code>android:layout_weight</code> to see how the screen
-real estate is distributed based on the weight of each element. See the <a
-href="{@docRoot}guide/topics/ui/layout-objects.html#linearlayout">Common Layout Objects</a>
-document for more about how {@link android.widget.LinearLayout} handles the
-<code>android:layout_weight</code> attribute.</p>
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.LinearLayout}</li>
- <li>{@link android.widget.TextView}</li>
-</ul>
-
-
diff --git a/docs/html/resources/tutorials/views/hello-listview.jd b/docs/html/resources/tutorials/views/hello-listview.jd
deleted file mode 100644
index 194258e..0000000
--- a/docs/html/resources/tutorials/views/hello-listview.jd
+++ /dev/null
@@ -1,170 +0,0 @@
-page.title=List View
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>{@link android.widget.ListView} is a {@link android.view.ViewGroup} that creates a list of
-scrollable items. The list items are automatically inserted to the list using a {@link
-android.widget.ListAdapter}.</p>
-
-<p>In this tutorial, you'll create a scrollable list of country names that are read from a string array.
-When a list item is selected, a toast message will display the position of the item in the list.</p>
-
-<ol>
- <li>Start a new project named <em>HelloListView</em>.</li>
- <li>Create an XML file named <code>list_item.xml</code> and save it inside the
-<code>res/layout/</code> folder. Insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:padding="10dp"
- android:textSize="16sp" >
-</TextView>
-</pre>
- <p>This file defines the layout for each item that will be placed in the {@link
-android.widget.ListView}.</p>
- </li>
-
- <li>Open the <code>HelloListView.java</code> and make the class extend {@link
-android.app.ListActivity} (instead of {@link android.app.Activity}):
- <pre>public class HelloListView extends ListActivity {</pre>
- </li>
- <li>Insert the following code for the {@link android.app.Activity#onCreate(Bundle) onCreate()}
-method:
-<pre>
-@Override
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, COUNTRIES));
-
- ListView lv = getListView();
- lv.setTextFilterEnabled(true);
-
- lv.setOnItemClickListener(new OnItemClickListener() {
- public void onItemClick(AdapterView<?> parent, View view,
- int position, long id) {
- // When clicked, show a toast with the TextView text
- Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
- Toast.LENGTH_SHORT).show();
- }
- });
-}
-</pre>
-<p>Notice that this does not load a layout file for the Activity (which you usually do with {@link
-android.app.Activity#setContentView(int)}). Instead, {@link
-android.app.ListActivity#setListAdapter(ListAdapter)} automatically
-adds a {@link android.widget.ListView} to fill the entire screen of the {@link
-android.app.ListActivity}. This method takes an {@link android.widget.ArrayAdapter}, which
-manages the array of list items that will be placed into the {@link android.widget.ListView}. The
-{@link android.widget.ArrayAdapter} constructor takes the application {@link
-android.content.Context}, the
-layout description for each list item (created in
-the previous step), and a {@link java.util.List} of objects to insert in the {@link
-android.widget.ListView} (defined next).</p>
-
-<p>The {@link android.widget.ListView#setTextFilterEnabled(boolean)} method turns on text filtering
-for the {@link android.widget.ListView}, so that when the user begins typing, the list will be
-filtered.</p>
-
-<p>The {@link android.widget.ListView#setOnItemClickListener(OnItemClickListener)} method defines
-the on-click listener for each item. When an item in the {@link android.widget.ListView} is clicked,
-the {@link android.widget.AdapterView.OnItemClickListener#onItemClick(AdapterView,View,int,long)
-onItemClick()} method is called and a {@link android.widget.Toast} message is displayed, using the
-text from the clicked item.</p>
-
-<p class="note"><strong>Tip:</strong> You can use list item designs provided by the platform
-instead of defining your own layout file for the {@link android.widget.ListAdapter}. For example,
-try using <code>android.R.layout.simple_list_item_1</code> instead of
-<code>R.layout.list_item</code>.</p>
-</li>
-
-<li>After the {@link android.app.Activity#onCreate(Bundle) onCreate()} method, add the string
-array:
-<pre>
- static final String[] COUNTRIES = new String[] {
- "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
- "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",
- "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan",
- "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
- "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
- "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory",
- "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi",
- "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde",
- "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
- "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
- "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic",
- "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic",
- "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea",
- "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland",
- "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia",
- "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar",
- "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau",
- "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary",
- "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica",
- "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos",
- "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg",
- "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands",
- "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova",
- "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia",
- "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand",
- "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas",
- "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru",
- "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar",
- "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena",
- "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon",
- "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal",
- "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands",
- "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea",
- "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden",
- "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas",
- "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey",
- "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda",
- "Ukraine", "United Arab Emirates", "United Kingdom",
- "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan",
- "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara",
- "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
- };
-</pre>
- <p>This is the array of strings that will be placed into the {@link android.widget.ListView}.</p>
-</li>
-<li>Run the application.</li>
-</ol>
-<p>You can scroll the list, or type to filter it, then click an item to see a message. You
-should see something like this:</p>
-<img src="images/hello-listview.png" width="150px" />
-
-<p>Note that using a hard-coded string array is not the best design practice. One is
-used in this tutorial for simplicity, in order to demonstrate the {@link
-android.widget.ListView} widget. The better practice is to reference a string array
-defined by an external resource, such as with a {@code <string-array>}
-resource in your project {@code res/values/strings.xml} file. For example:</p>
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string-array name="countries_array">
- <item>Bahrain</item>
- <item>Bangladesh</item>
- <item>Barbados</item>
- <item>Belarus</item>
- <item>Belgium</item>
- <item>Belize</item>
- <item>Benin</item>
- </string-array>
-</resources>
-</pre>
-<p>To use these resource strings for the {@link android.widget.ArrayAdapter}, replace the original
-{@link android.app.ListActivity#setListAdapter(ListAdapter)} line with the following:</p>
-<pre>
-String[] countries = getResources().getStringArray(R.array.countries_array);
-setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, countries));
-</pre>
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.ListView}</li>
- <li>{@link android.widget.ListAdapter}</li>
-</ul>
-
diff --git a/docs/html/resources/tutorials/views/hello-mapview.jd b/docs/html/resources/tutorials/views/hello-mapview.jd
deleted file mode 100644
index 7a0bedf..0000000
--- a/docs/html/resources/tutorials/views/hello-mapview.jd
+++ /dev/null
@@ -1,303 +0,0 @@
-page.title=Google Map View
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>Using the Google Maps library, you can create your own map-viewing Activity. In this
-tutorial, you'll create a simple map application in two parts. In Part 1, you'll create an app that
-shows a map the user can pan and zoom. In Part 2, you'll add overlay items that mark
-points of interest.</p>
-
-<div class="special">
-<p>This tutorial requires that you have the external Google Maps library
-installed in your SDK environment. The Maps library is included with the Google APIs
-add-on, which you can install using the Android SDK and
-AVD Manager. To learn how, see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>.</p>
-
-<p>After installing the Google APIs add-on in your SDK, set your project properties to use the build
-target called "Google APIs by Google Inc.". See the instructions for setting a build
-target in <a href="{@docRoot}guide/developing/projects/projects-eclipse.html#CreatingAProject">
-Creating and Managing Projects in Eclipse</a> or <a
-href="{@docRoot}guide/developing/projects/projects-cmdline.html#CreatingAProject">
-Creating and Managing Projects on the Command Line</a>, as appropriate for your environment.</p>
-
-<p>You will also need to set up a new AVD that uses the same Google APIs deployment target. See <a
-href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a> for
-more information.</p>
-
-<p>For reference material, see the <a
-href="http://code.google.com/android/add-ons/google-apis/reference/index.html">Google Maps
-library documentation</a>.</p>
-
-</div>
-
-<h2>Part 1: Creating a Map Activity</h2>
-
-<ol>
- <li>Start a new project named <em>HelloGoogleMaps</em>.</li>
-
- <li>Because the Maps library is not a part of the standard Android library, you must
- declare it in the Android Manifest. Open the <code>AndroidManifest.xml</code>
- file and add the following as a child of the <code><application></code> element:
- <pre><uses-library android:name="com.google.android.maps" /></pre>
- </li>
-
- <li>You also need access to the Internet in order to retrieve map tiles,
- so you must also request the {@link android.Manifest.permission#INTERNET} permission.
- In the manifest file, add the following as a child of the <code><manifest></code> element:
- <pre><uses-permission android:name="android.permission.INTERNET" /></pre>
- </li>
-
- <li>While you're in the manifest, give the map some more space by getting rid of the title bar
-with the "NoTitleBar" theme:
-<pre>
-<activity android:name=".HelloGoogleMaps" android:label="@string/app_name"
- <strong>android:theme="@android:style/Theme.NoTitleBar"</strong>>
-</pre>
- </li>
-
-
- <li>Open the <code>res/layout/main.xml</code> file and add a single
- {@code com.google.android.maps.MapView} as the root node:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<com.google.android.maps.MapView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/mapview"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:clickable="true"
- android:apiKey="<em>Your Maps API Key goes here</em>"
-/>
-</pre>
- <p>The <code>android:clickable</code> attribute defines whether you want to allow
- user-interaction with the map. If this is "false" then touching the map does nothing.</p>
-
- <p>The <code>android:apiKey</code> attribute holds the Maps API Key for your
- application, which proves your application and signer certificate has been registered with the
- Maps service. This is required in order to receive the map data, even while you are
- developing. Registration to the service is free and it only takes a couple
- minutes to register your certificate and get a Maps API Key.</p>
- <p>Go now to get a key. For instructions, read
- <a href="http://code.google.com/android/add-ons/google-apis/mapkey.html">Obtaining a Maps API
- Key</a>. For the purpose of this tutorial, you should <a
- href="http://code.google.com/android/add-ons/google-apis/mapkey.html#getdebugfingerprint">register
- with the SDK debug certificate</a>, which will only be valid while your application is signed
- with the debug key (once you sign with your private key, you will need a new API key).
- When you get your key, insert it for the value of <code>android:apiKey</code>.</p>
- </li>
-
- <li>Now open the <code>HelloGoogleMaps.java</code> file. For this Activity, extend
- {@code MapActivity} (instead of {@code android.app.Activity}):</p>
-
- <pre>public class HelloGoogleMaps extends MapActivity {</pre>
- <p>This is a special sub-class of {@link android.app.Activity}, provided by the Maps
- library, which provides important map capabilities.</p>
-
- <li>Inside every {@code MapActivity}, the <code>isRouteDisplayed()</code> method is required, so
- override this method:
-<pre>
-@Override
-protected boolean isRouteDisplayed() {
- return false;
-}
-</pre>
-<p>This method is required for some accounting from the Maps service to see if you're currently
-displaying any route information. In this case, you're not, so return false.</p>
-</li>
-
-<li>Now add the standard {@link android.app.Activity#onCreate(Bundle) onCreate()} callback method
-to the class:
-<pre>
-@Override
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-}
-</pre>
-<p>This loads the layout file created above. In fact, this is now a workable application that will
-display map tiles and allow the user to pan around the map. But there's no ability to zoom.
-Fortunately, there's a very simple zoom feature built into the {@code MapView} class, which you can
-summon with {@code setBuiltInZoomControls(boolean)}. Do this at the end of the {@link
-android.app.Activity#onCreate(Bundle) onCreate()} method:</p>
-<pre>
- MapView mapView = (MapView) findViewById(R.id.mapview);
- mapView.setBuiltInZoomControls(true);
-</pre>
-</li>
-<li>That's all there is to it. Run the application. (Remember, you must have an <a
-href="{@docRoot}guide/developing/devices/index.html">AVD</a> configured to use the Google APIs
-target, or be using a development device that includes the Maps library.)</li>
-</ol>
-
-<h2>Part 2: Adding Overlay Items</h2>
-
-<p>So, now you have a map, but in many cases you'll also want to create your own map
-markers and lay-overs. That's what you'll do now. In order to do so, you must implement the
-{@code ItemizedOverlay} class, which can manage a whole set of {@code Overlay} (which are the
-individual items placed on the map).</p>
-
-<ol>
- <li>Create a new Java class named <code>HelloItemizedOverlay</code> that implements
- {@code ItemizedOverlay}.
-
- <p>When using Eclipse, right-click the package name in the Eclipse Package Explorer, and
- select <strong>New > Class</strong>. Fill-in
- the Name field as <em>HelloItemizedOverlay</em>. For the Superclass, enter
- "com.google.android.maps.ItemizedOverlay". Click the checkbox for <em>Constructors from
- superclass</em>. Click Finish.</p></li>
-
- <li>First, you need an <code>OverlayItem</code> {@link java.util.ArrayList}, in which you'll put
- each of the <code>OverlayItem</code> objects you want on the map. Add this at the top of the
- <code>HelloItemizedOverlay</code> class:
-
- <pre>private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();</pre>
- </li>
-
- <li>Now define the <code>HelloItemizedOverlay</code> constructors. The constructor must
- define the default marker for each of the {@code OverlayItem}s. In order for the {@link
- android.graphics.drawable.Drawable} to actually get drawn, it must have its bounds defined. Most
- commonly, you want the center-point at the bottom of the image to be the point at which it's
- attached to the map coordinates. This is handled for you with the {@code boundCenterBottom()}
- method. Wrap this around our defaultMarker, so the super constructor call looks like this:
-<pre>
-public HelloItemizedOverlay(Drawable defaultMarker) {
- super(boundCenterBottom(defaultMarker));
-}
-</pre>
- </li>
-
- <li>In order to add new {@code OverlayItem}s to the ArrayList, you need a new method:
-<pre>
-public void addOverlay(OverlayItem overlay) {
- mOverlays.add(overlay);
- populate();
-}</pre>
- <p>Each time you add a new {@code OverlayItem} to the ArrayList, you must call
- <code>populate()</code> for the {@code ItemizedOverlay}, which will read each of the
- {@code OverlayItem}s and prepare them to be drawn.</p>
- </li>
-
- <li>When the <code>populate()</code> method executes, it will call <code>createItem(int)</code> in
- the {@code ItemizedOverlay} to retrieve each {@code OverlayItem}. You must override this method to
- properly read from the ArrayList and return the {@code OverlayItem} from the position specified
- by the given integer. Your override method should look like this:
-
-<pre>
-@Override
-protected OverlayItem createItem(int i) {
- return mOverlays.get(i);
-}
-</pre>
- </li>
-
- <li>You must also override the <code>size()</code> method to return the current number of
- items in the ArrayList:
-<pre>
-@Override
-public int size() {
- return mOverlays.size();
-}
-</pre>
- </li>
-
- <li>Now set up the ability to handle touch events on the overlay items. First, you're
- going to need a reference to the application {@link android.content.Context} as a member of
- this class. So add {@code Context mContext} as a class member, then initialize it with a
- new class constructor:
-<pre>
-public HelloItemizedOverlay(Drawable defaultMarker, Context context) {
- super(boundCenterBottom(defaultMarker));
- mContext = context;
-}
-</pre>
- <p>This passes the {@code defaultMarker} up to the default constructor to bound its coordinates
- and then initialize {@code mContext} with the given {@link android.content.Context}.</p>
-
- <p>Then override the {@code onTap(int)} callback method, which will handle the event
- when an item is tapped by the user:</p>
-<pre>
-@Override
-protected boolean onTap(int index) {
- OverlayItem item = mOverlays.get(index);
- AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);
- dialog.setTitle(item.getTitle());
- dialog.setMessage(item.getSnippet());
- dialog.show();
- return true;
-}
-</pre>
- <p>This uses the member {@code android.content.Context} to create a new {@link
-android.app.AlertDialog.Builder} and uses the tapped {@code OverlayItem}'s title and snippet for
-the dialog's title and message text. (You'll see the {@code OverlayItem} title and snippet defined
-when you create it below.)</p>
- </li>
-
-</ol>
-
-<p>You're now done with the <code>HelloItemizedOverlay</code> class and can start using it
-to add items on the map.</p>
-
-<p>Go back to the <code>HelloGoogleMaps</code> class. In the following procedure, you'll create an
-{@code OverlayItem} and add it to an instance of the <code>HelloItemizedOverlay</code> class, then
-add the <code>HelloItemizedOverlay</code> to the <code>MapView</code> using a {@code GeoPoint}
-to define its coordinates on the map.</p>
-
-<img src="images/androidmarker.png" align="right" />
-<ol>
- <li>First, you need the image for the map overlay. If you don't have one handy, use the Android on
- the right. Drag this image (or your own) into the <code>res/drawable/</code> directory of your
- project.</li>
-
- <li>At the end of your existing {@code onCreate()} method, instantiate :
-
-<pre>
-List<Overlay> mapOverlays = mapView.getOverlays();
-Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);
-HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable, this);</pre>
-
- <p>All overlay elements on a map are held by the {@code MapView}, so when you want to add some,
- you have to get a list from the <code>getOverlays()</code> method. Then instantiate the {@link
- android.graphics.drawable.Drawable} used for the map marker, which was saved in the {@code
- res/drawable/} directory. The constructor for {@code HelloItemizedOverlay} (your custom {@code
- ItemizedOverlay}) takes the Drawable in order to set the default marker for all overlay
- items.</p>
- </li>
-
- <li>Now create a {@code GeoPoint} that defines the map coordinates for the first overlay item,
- and pass it to a new {@code OverlayItem}:
-<pre>
-GeoPoint point = new GeoPoint(19240000,-99120000);
-OverlayItem overlayitem = new OverlayItem(point, "Hola, Mundo!", "I'm in Mexico City!");
-</pre>
-
- <p>{@code GeoPoint} coordinates are specified in microdegrees (<code>degrees * 1e6</code>). The
- {@code OverlayItem} constructor accepts the {@code GeoPoint} location, a string for the
- item's title, and a string for the item's snippet text, respectively.</p>
- </li>
-
- <li>All that's left is to add this {@code OverlayItem} to your collection in the
- {@code HelloItemizedOverlay} instance, then add the {@code HelloItemizedOverlay} to the MapView:
-<pre>
-itemizedoverlay.addOverlay(overlayitem);
-mapOverlays.add(itemizedoverlay);
-</pre>
- </li>
-
- <li>Now run the application.</li>
-</ol>
-
-<p>You should see the following:</p>
-<img src="images/hello-mapview.png" width="150px" />
-<p>When you tap the overlay item, you'll see the dialog appear.</p>
-
-<p>Because the {@code ItemizedOverlay} class uses an {@code java.util.ArrayList} for all of the
-{@code OverlayItem}s, it's easy to add more. Try adding another one. Before the
-<code>addOverlay()</code> method is called, add these lines:</p>
-<pre>
-GeoPoint point2 = new GeoPoint(35410000, 139460000);
-OverlayItem overlayitem2 = new OverlayItem(point2, "Sekai, konichiwa!", "I'm in Japan!");
-</pre>
-<p>Run the application again. (You probably need to move the map to find the new overlay item.)</p>
-
diff --git a/docs/html/resources/tutorials/views/hello-relativelayout.jd b/docs/html/resources/tutorials/views/hello-relativelayout.jd
deleted file mode 100644
index adc1179..0000000
--- a/docs/html/resources/tutorials/views/hello-relativelayout.jd
+++ /dev/null
@@ -1,89 +0,0 @@
-page.title=Relative Layout
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>{@link android.widget.RelativeLayout} is a {@link android.view.ViewGroup} that displays
-child {@link android.view.View} elements in relative positions. The position of a {@link
-android.view.View} can be specified as relative to sibling elements (such as to the left-of or below
-a given element) or in positions relative to the {@link android.widget.RelativeLayout} area (such as
-aligned to the bottom, left of center).</p>
-
-<p>A {@link android.widget.RelativeLayout} is a very powerful utility for designing a user
-interface because it can eliminate nested {@link android.view.ViewGroup}s. If you find
-yourself using several nested {@link android.widget.LinearLayout} groups, you may be able to
-replace them with a single {@link android.widget.RelativeLayout}.</p>
-
-<ol>
- <li>Start a new project named <em>HelloRelativeLayout</em>.</li>
- <li>Open the <code>res/layout/main.xml</code> file and insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <TextView
- android:id="@+id/label"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Type here:"/>
- <EditText
- android:id="@+id/entry"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@android:drawable/editbox_background"
- android:layout_below="@id/label"/>
- <Button
- android:id="@+id/ok"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/entry"
- android:layout_alignParentRight="true"
- android:layout_marginLeft="10dip"
- android:text="OK" />
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toLeftOf="@id/ok"
- android:layout_alignTop="@id/ok"
- android:text="Cancel" />
-</RelativeLayout>
-</pre>
-<p>Notice each of the <code>android:layout_*</code> attributes, such as <code>layout_below</code>,
-<code>layout_alignParentRight</code>, and <code>layout_toLeftOf</code>. When using a {@link
-android.widget.RelativeLayout}, you can use these attributes to describe
-how you want to position each {@link android.view.View}. Each one of these attributes define a
-different kind
-of relative position. Some attributes use the resource ID of a sibling {@link android.view.View}
-to define its own relative position. For example, the last {@link android.widget.Button} is
-defined to lie to the left-of and aligned-with-the-top-of the {@link android.view.View}
-identified by the ID <code>ok</code> (which is the previous {@link android.widget.Button}).</p>
-<p>All of the available layout attributes are defined in {@link
-android.widget.RelativeLayout.LayoutParams}.</p>
-</li>
-<li>Make sure you load this layout in the
-{@link android.app.Activity#onCreate(Bundle) onCreate()} method:</p>
-<pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-}
-</pre>
-<p>The {@link android.app.Activity#setContentView(int)} method loads the
-layout file for the {@link android.app.Activity}, specified by the resource
-ID — <code>R.layout.main</code> refers to the <code>res/layout/main.xml</code> layout
-file.</p>
-</li>
-<li>Run the application.</li>
-</ol>
-<p>You should see the following layout:</p>
-<img src="images/hello-relativelayout.png" width="150px" />
-
-<h3>Resources</h3>
-<ul>
- <li>{@link android.widget.RelativeLayout}</li>
- <li>{@link android.widget.RelativeLayout.LayoutParams}</li>
- <li>{@link android.widget.TextView}</li>
- <li>{@link android.widget.EditText}</li>
- <li>{@link android.widget.Button}</li>
-</ul>
diff --git a/docs/html/resources/tutorials/views/hello-spinner.jd b/docs/html/resources/tutorials/views/hello-spinner.jd
deleted file mode 100644
index e9dc20f..0000000
--- a/docs/html/resources/tutorials/views/hello-spinner.jd
+++ /dev/null
@@ -1,149 +0,0 @@
-page.title=Spinner
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>{@link android.widget.Spinner} is a widget similar to a drop-down list for selecting items.</p>
-
-<p>In this tutorial, you'll create
-a simple spinner widget that displays a list of planets. When one is selected, a toast message
-will display the selected item.</p>
-
-<ol>
- <li>Start a new project named <em>HelloSpinner</em>.</li>
- <li>Open the <code>res/layout/main.xml</code> file and insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:padding="10dip"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="10dip"
- android:text="@string/planet_prompt"
- />
- <Spinner
- android:id="@+id/spinner"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:prompt="@string/planet_prompt"
- />
-</LinearLayout>
-</pre>
- <p>Notice that the {@link android.widget.TextView}'s <code>android:text</code> attribute and the
-{@link android.widget.Spinner}'s <code>android:prompt</code> attribute both reference the same
-string resource. This text behaves as a title for the widget. When applied to the {@link
-android.widget.Spinner}, the title text will appear
-in the selection dialog that appears upon selecting the widget.</p>
-</li>
-
-<li>Create a <code>strings.xml</code> file in <code>res/values/</code> and edit the file to look
-like this:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string name="planet_prompt">Choose a planet</string>
- <string-array name="planets_array">
- <item>Mercury</item>
- <item>Venus</item>
- <item>Earth</item>
- <item>Mars</item>
- <item>Jupiter</item>
- <item>Saturn</item>
- <item>Uranus</item>
- <item>Neptune</item>
- </string-array>
-</resources>
-</pre>
- <p>The {@code <string>} element defines the title string referenced by the {@link
-android.widget.TextView} and {@link android.widget.Spinner} in the layout above. The {@code
-<string-array} element defines the list of strings that will be displayed as the list in
-the {@link android.widget.Spinner} widget.</p>
-</li>
-
-<li>Now open the <code>HelloSpinner.java</code> file and insert the following code for the {@link
-android.app.Activity#onCreate(Bundle) onCreate()} method:
-<pre>
-@Override
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- Spinner spinner = (Spinner) findViewById(R.id.spinner);
- ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
- this, R.array.planets_array, android.R.layout.simple_spinner_item);
- adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- spinner.setAdapter(adapter);
-}
-</pre>
- <p>After the {@code main.xml} layout is set as the content view, the {@link
-android.widget.Spinner} widget is captured from the layout with {@link
-android.app.Activity#findViewById(int)}. The {@link
-android.widget.ArrayAdapter#createFromResource(Context,int,int) createFromResource()} method then
-creates a new {@link android.widget.ArrayAdapter}, which binds each item in the string array
-to the initial appearance for the {@link android.widget.Spinner} (which is how each item will
-appear in the spinner when selected). The {@code
-R.array.planets_array} ID references the {@code string-array} defined above and the
-{@code android.R.layout.simple_spinner_item} ID references a layout for the standard spinner
-appearance, defined by the platform. Then {@link
-android.widget.ArrayAdapter#setDropDownViewResource(int)} is called to define the appearance for
-each item when the widget is opened ({@code simple_spinner_dropdown_item} is
-another standard layout defined by the platform). Finally, the {@link android.widget.ArrayAdapter}
-is set to associate all of its items with the {@link android.widget.Spinner} by calling {@link
-android.widget.AdapterView#setAdapter(T)}.</p>
-</li>
-
-<li>Now create a nested class that implements {@link
-android.widget.AdapterView.OnItemSelectedListener}. This will provide a callback method that will
-notify your application when an item has been selected from the {@link
-android.widget.Spinner}. Here's what this class should look like:
-<pre>
-public class MyOnItemSelectedListener implements OnItemSelectedListener {
-
- public void onItemSelected(AdapterView<?> parent,
- View view, int pos, long id) {
- Toast.makeText(parent.getContext(), "The planet is " +
- parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();
- }
-
- public void onNothingSelected(AdapterView<?> parent) {
- // Do nothing.
- }
-}
-</pre>
-<p>The {@link android.widget.AdapterView.OnItemSelectedListener} requires the {@link
-android.widget.AdapterView.OnItemSelectedListener#onItemSelected(AdapterView,View,int,long)
-onItemSelected()} and {@link
-android.widget.AdapterView.OnItemSelectedListener#onNothingSelected(AdapterView)
-onNothingSelected()} callback methods. The former is called when an item from the {@link
-android.widget.AdapterView} is selected, in which case, a short {@link android.widget.Toast}
-message displays the selected text; and the latter is called when a selection disappears from the
-{@link android.widget.AdapterView}, which doesn't happen in this case, so it's ignored.</p>
-</li>
-
-<li>Now the {@code MyOnItemSelectedListener} needs to be applied to the {@link
-android.widget.Spinner}. Go back to the {@link android.app.Activity#onCreate(Bundle) onCreate()}
-method and add the following line to the end:
-<pre>
- spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());
-</pre>
-<p>This creates a new anonymous instance of the {@code MyOnItemSelectedListener} and sets it as the
-listener for the {@link android.widget.Spinner}.</p>
-</li>
-
-<li>Run the application.</li>
-</ol>
-<p>It should look like this:</p>
-<img src="images/hello-spinner.png" width="150px" />
-
-
-<h3>Resources</h3>
-<ul>
- <li>{@link android.R.layout}</li>
- <li>{@link android.widget.ArrayAdapter}</li>
- <li>{@link android.widget.Spinner}</li>
-</ul>
-
diff --git a/docs/html/resources/tutorials/views/hello-tablelayout.jd b/docs/html/resources/tutorials/views/hello-tablelayout.jd
deleted file mode 100644
index c8c5982..0000000
--- a/docs/html/resources/tutorials/views/hello-tablelayout.jd
+++ /dev/null
@@ -1,124 +0,0 @@
-page.title=Table Layout
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-
-<p>{@link android.widget.TableLayout} is a {@link android.view.ViewGroup} that
-displays child {@link android.view.View} elements in rows and columns.</p>
-
-<ol>
- <li>Start a new project named <em>HelloTableLayout</em>.</li>
- <li>Open the <code>res/layout/main.xml</code> file and insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:stretchColumns="1">
-
- <TableRow>
- <TextView
- android:layout_column="1"
- android:text="Open..."
- android:padding="3dip" />
- <TextView
- android:text="Ctrl-O"
- android:gravity="right"
- android:padding="3dip" />
- </TableRow>
-
- <TableRow>
- <TextView
- android:layout_column="1"
- android:text="Save..."
- android:padding="3dip" />
- <TextView
- android:text="Ctrl-S"
- android:gravity="right"
- android:padding="3dip" />
- </TableRow>
-
- <TableRow>
- <TextView
- android:layout_column="1"
- android:text="Save As..."
- android:padding="3dip" />
- <TextView
- android:text="Ctrl-Shift-S"
- android:gravity="right"
- android:padding="3dip" />
- </TableRow>
-
- <View
- android:layout_height="2dip"
- android:background="#FF909090" />
-
- <TableRow>
- <TextView
- android:text="X"
- android:padding="3dip" />
- <TextView
- android:text="Import..."
- android:padding="3dip" />
- </TableRow>
-
- <TableRow>
- <TextView
- android:text="X"
- android:padding="3dip" />
- <TextView
- android:text="Export..."
- android:padding="3dip" />
- <TextView
- android:text="Ctrl-E"
- android:gravity="right"
- android:padding="3dip" />
- </TableRow>
-
- <View
- android:layout_height="2dip"
- android:background="#FF909090" />
-
- <TableRow>
- <TextView
- android:layout_column="1"
- android:text="Quit"
- android:padding="3dip" />
- </TableRow>
-</TableLayout>
-</pre>
-<p>Notice how this resembles the structure of an HTML table. The {@link android.widget.TableLayout}
-element is like the HTML <code><table></code> element; {@link android.widget.TableRow} is like
-a <code>><tr>></code> element;
-but for the cells, you can use any kind of {@link android.view.View} element. In this example, a
-{@link android.widget.TextView} is used for each cell. In between some of the rows, there is also a
-basic {@link android.view.View}, which is used to draw a horizontal line.</p>
-
-</li>
-<li>Make sure your <em>HelloTableLayout</em> Activity loads this layout in the
-{@link android.app.Activity#onCreate(Bundle) onCreate()} method:
-<pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-}
-</pre>
-<p>The {@link android.app.Activity#setContentView(int)} method loads the
-layout file for the {@link android.app.Activity}, specified by the resource
-ID — <code>R.layout.main</code> refers to the <code>res/layout/main.xml</code> layout
-file.</p>
-</li>
-<li>Run the application.</li>
-</ol>
-<p>You should see the following:</p>
-<img src="images/hello-tablelayout.png" width="150px" />
-
-<h3>References</h3>
-<ul>
- <li>{@link android.widget.TableLayout}</li>
- <li>{@link android.widget.TableRow}</li>
- <li>{@link android.widget.TextView}</li>
-</ul>
-
-
diff --git a/docs/html/resources/tutorials/views/hello-tabwidget.jd b/docs/html/resources/tutorials/views/hello-tabwidget.jd
deleted file mode 100644
index 9bafd84..0000000
--- a/docs/html/resources/tutorials/views/hello-tabwidget.jd
+++ /dev/null
@@ -1,210 +0,0 @@
-page.title=Tab Layout
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>To create a tabbed UI, you need to use a {@link android.widget.TabHost} and a {@link
-android.widget.TabWidget}. The {@link android.widget.TabHost} must be the root node for the layout,
-which contains both the {@link android.widget.TabWidget} for displaying the tabs and a {@link
-android.widget.FrameLayout} for displaying the tab content.</p>
-
-<p>You can implement your tab content in one of two ways: use the tabs to swap
-{@link android.view.View}s within the same {@link android.app.Activity}, or use the tabs to change
-between entirely separate activities. Which method you want for your application will depend on your
-demands, but if each tab provides a distinct user activity, then it probably makes sense to use
-a separate {@link android.app.Activity} for each tab, so that you can better manage the application
-in discrete groups, rather than one massive application and layout.</p>
-
-<p>In this tutorial, you'll create a tabbed UI that uses a separate {@link
-android.app.Activity} for each tab.</p>
-
-<ol>
- <li>Start a new project named <em>HelloTabWidget</em>.</li>
- <li>First, create three separate {@link android.app.Activity} classes in your project:
-<code>ArtistsActivity</code>, <code>AlbumsActivity</code>, and <code>SongsActivity</code>. These
-will each represent a separate tab. For now, make each one display a simple message using a {@link
-android.widget.TextView}. For example:
-<pre>
-public class ArtistsActivity extends Activity {
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- TextView textview = new TextView(this);
- textview.setText("This is the Artists tab");
- setContentView(textview);
- }
-}
-</pre>
- <p>Notice that this doesn't use a layout file. Just create a {@link
-android.widget.TextView}, give it some text and set that as the content. Duplicate this for
-each of the three activities, and add the corresponding <code><activity/></code> tags to the Android Manifest file.</p>
-
- <li>You need an icon for each of your tabs. For each icon, you should create two versions: one
-for when the tab is selected and one for when it is unselected. The
-general design recommendation is for the selected icon to be a dark color (grey), and the
-unselected icon to be a light color (white). (See the <a
-href="{@docRoot}guide/practices/ui_guidelines/icon_design.html#tabstructure">Icon Design
-Guidelines</a>.) For example:
- <p>
- <img src="images/ic_tab_artists_white.png" title="unselected tab icon" alt="" />
- <img src="images/ic_tab_artists_grey.png" title="selected tab icon" alt="" />
- </p>
- <p>For this tutorial, you can copy these images and use them for all three tabs. (When you
-create tabs in your own application, you should create customized tab icons.)</p>
- <p>Now create a <a
-href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList">state-list drawable</a>
-that specifies which image to use for each tab state:</p>
- <ol>
- <li>Save the icon images in your project <code>res/drawable/</code> directory.</li>
- <li>Create a new XML file in <code>res/drawable/</code>
-named <code>ic_tab_artists.xml</code> and insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <!-- When selected, use grey -->
- <item android:drawable="@drawable/ic_tab_artists_grey"
- android:state_selected="true" />
- <!-- When not selected, use white-->
- <item android:drawable="@drawable/ic_tab_artists_white" />
-</selector>
-</pre>
- <p>This is a <a
-href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList">state-list drawable</a>,
-which you will apply as the tab image. When the tab state changes, the tab icon will
-automatically switch between the images defined here.</p>
- </li>
- </ol>
- </li>
-
- <li>Open the <code>res/layout/main.xml</code> file and insert the following:
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@android:id/tabhost"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:padding="5dp">
- <TabWidget
- android:id="@android:id/tabs"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
- <FrameLayout
- android:id="@android:id/tabcontent"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:padding="5dp" />
- </LinearLayout>
-</TabHost>
-</pre>
- <p>This is the layout that will display the tabs and provide navigation between each {@link
- android.app.Activity} created above.</p>
- <p>The {@link android.widget.TabHost} requires that a {@link android.widget.TabWidget} and a
-{@link android.widget.FrameLayout} both live somewhere within it. To position the {@link
-android.widget.TabWidget} and {@link android.widget.FrameLayout} vertically, a {@link
-android.widget.LinearLayout} is used. The {@link android.widget.FrameLayout} is where the content
-for each tab goes, which is empty now because the {@link android.widget.TabHost} will automatically
-embed each {@link android.app.Activity} within it.</p>
- <p>Notice that the {@link android.widget.TabWidget} and the {@link android.widget.FrameLayout}
- elements have the IDs {@code tabs} and {@code tabcontent}, respectively. These names
- must be used so that the {@link android.widget.TabHost} can retrieve references to each of
- them. It expects exactly these names.</p>
- </li>
-
- <li>Now open <code>HelloTabWidget.java</code> and make it extend {@link
- android.app.TabActivity}:</p>
-<pre>
-public class HelloTabWidget extends TabActivity {
-</pre>
- </li>
- <li>Use the following code for the {@link android.app.Activity#onCreate(Bundle) onCreate()}
- method:
-<pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- Resources res = getResources(); // Resource object to get Drawables
- TabHost tabHost = getTabHost(); // The activity TabHost
- TabHost.TabSpec spec; // Resusable TabSpec for each tab
- Intent intent; // Reusable Intent for each tab
-
- // Create an Intent to launch an Activity for the tab (to be reused)
- intent = new Intent().setClass(this, ArtistsActivity.class);
-
- // Initialize a TabSpec for each tab and add it to the TabHost
- spec = tabHost.newTabSpec("artists").setIndicator("Artists",
- res.getDrawable(R.drawable.ic_tab_artists))
- .setContent(intent);
- tabHost.addTab(spec);
-
- // Do the same for the other tabs
- intent = new Intent().setClass(this, AlbumsActivity.class);
- spec = tabHost.newTabSpec("albums").setIndicator("Albums",
- res.getDrawable(R.drawable.ic_tab_albums))
- .setContent(intent);
- tabHost.addTab(spec);
-
- intent = new Intent().setClass(this, SongsActivity.class);
- spec = tabHost.newTabSpec("songs").setIndicator("Songs",
- res.getDrawable(R.drawable.ic_tab_songs))
- .setContent(intent);
- tabHost.addTab(spec);
-
- tabHost.setCurrentTab(2);
-}
-</pre>
- <p>This sets up each tab with their text and icon, and assigns each one an {@link
-android.app.Activity}.</p>
- <p>A reference to the {@link android.widget.TabHost} is first captured with {@link
-android.app.TabActivity#getTabHost()}. Then, for
-each tab, a {@link android.widget.TabHost.TabSpec} is created to define the tab properties. The
-{@link android.widget.TabHost#newTabSpec(String)} method creates a new {@link
-android.widget.TabHost.TabSpec} identified by the given string tag. For each
-{@link android.widget.TabHost.TabSpec}, {@link
-android.widget.TabHost.TabSpec#setIndicator(CharSequence,Drawable)} is called to set the text and
-icon for the tab, and {@link android.widget.TabHost.TabSpec#setContent(Intent)} is called to specify
-the {@link android.content.Intent} to open the appropriate {@link android.app.Activity}. Each
-{@link android.widget.TabHost.TabSpec} is then added to the {@link android.widget.TabHost} by
-calling {@link android.widget.TabHost#addTab(TabHost.TabSpec)}.</p>
-
- <p>At the very end, {@link
- android.widget.TabHost#setCurrentTab(int)} opens the tab to be displayed by default, specified
- by the index position of the tab.</p>
-
- <p>Notice that not once was the {@link android.widget.TabWidget} object referenced. This is
- because a {@link android.widget.TabWidget} must always be a child of a {@link
- android.widget.TabHost}, which is what you use for almost all interaction with the tabs. So when
- a tab is added to the {@link android.widget.TabHost}, it's automatically added to the child
- {@link android.widget.TabWidget}.</p>
- </li>
-
- <li>Now open the Android Manifest file and add the <code>NoTitleBar</code> theme to the
-<em>HelloTabWidget</em>'s
- <code><activity></code> tag. This will remove the default application title from the top
- of the layout, leaving more space for the tabs, which effectively operate as their own titles.
- The <code><activity></code> tag should look like this:
-<pre>
-<activity android:name=".HelloTabWidget" android:label="@string/app_name"
- android:theme="@android:style/Theme.NoTitleBar">
-</pre>
- </li>
-
- <li>Run the application.</li>
-</ol>
-
-
-<p>Your application should look like this (though your icons may be different):</p>
-<img src="images/hello-tabwidget.png" width="150px" />
-
-<h3>References</h3>
-<ul>
-<li>{@link android.widget.TabWidget}</li>
-<li>{@link android.widget.TabHost}</li>
-<li>{@link android.widget.TabHost.TabSpec}</li>
-<li>{@link android.widget.FrameLayout}</li>
-</ul>
-
diff --git a/docs/html/resources/tutorials/views/hello-timepicker.jd b/docs/html/resources/tutorials/views/hello-timepicker.jd
deleted file mode 100644
index cf16c8e..0000000
--- a/docs/html/resources/tutorials/views/hello-timepicker.jd
+++ /dev/null
@@ -1,167 +0,0 @@
-page.title=Time Picker
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>To provide a widget for selecting a time, use the {@link android.widget.TimePicker}
-widget, which allows the user to select the hour and minute in a familiar interface.</p>
-
-<p>In this tutorial, you'll create a {@link android.app.TimePickerDialog}, which presents the
-time picker in a floating dialog box at the press of a button. When the time is set by
-the user, a {@link android.widget.TextView} will update with the new date.</p>
-
-<ol>
- <li>Start a new project named <em>HelloTimePicker</em>.</li>
- <li>Open the <code>res/layout/main.xml</code> file and insert the following:
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical">
- <TextView android:id="@+id/timeDisplay"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text=""/>
- <Button android:id="@+id/pickTime"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Change the time"/>
-</LinearLayout>
-</pre>
-<p>This is a basic {@link android.widget.LinearLayout} with a {@link android.widget.TextView}
-that will display the time and a {@link android.widget.Button} that will open the {@link
-android.app.TimePickerDialog}.</p>
- </li>
-
- <li>Open <code>HelloTimePicker.java</code> and insert the following class members:
-<pre>
- private TextView mTimeDisplay;
- private Button mPickTime;
-
- private int mHour;
- private int mMinute;
-
- static final int TIME_DIALOG_ID = 0;
-</pre>
-<p>This declares variables for the layout elements and time fields.
-The <code>TIME_DIALOG_ID</code> is a static integer that uniquely identifies the dialog.</p>
- </li>
- <li>Now insert the following code for the {@link android.app.Activity#onCreate(Bundle) onCreate()}
-method:
-<pre>
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- // capture our View elements
- mTimeDisplay = (TextView) findViewById(R.id.timeDisplay);
- mPickTime = (Button) findViewById(R.id.pickTime);
-
- // add a click listener to the button
- mPickTime.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- showDialog(TIME_DIALOG_ID);
- }
- });
-
- // get the current time
- final Calendar c = Calendar.getInstance();
- mHour = c.get(Calendar.HOUR_OF_DAY);
- mMinute = c.get(Calendar.MINUTE);
-
- // display the current date
- updateDisplay();
- }
-</pre>
-
-<p>First, the content is set to the <code>main.xml</code> layout and then the {@link
-android.widget.TextView} and {@link android.widget.Button} are captured with {@link
-android.app.Activity#findViewById(int)}.
-Then an {@link android.view.View.OnClickListener} is created for the {@link android.widget.Button},
-so that when clicked, it will call {@link
-android.app.Activity#showDialog(int)}, passing the unique integer ID for the time picker
-dialog. Using {@link android.app.Activity#showDialog(int)} allows the {@link
-android.app.Activity} to manage the life-cycle of the dialog and will call the {@link
-android.app.Activity#onCreateDialog(int)} callback method to request the {@link android.app.Dialog}
-that should be displayed (which you'll define later). After the on-click listener is set, a new
-{@link java.util.Calendar} is created to get the current hour and minute. Finally, the
-private <code>updateDisplay()</code> method is called in order to fill the {@link
-android.widget.TextView} with the current time.</p>
-</li>
-
-<li>Add the <code>updateDisplay()</code> and <code>pad()</code> methods:
-<pre>
-// updates the time we display in the TextView
-private void updateDisplay() {
- mTimeDisplay.setText(
- new StringBuilder()
- .append(pad(mHour)).append(":")
- .append(pad(mMinute)));
-}
-
-private static String pad(int c) {
- if (c >= 10)
- return String.valueOf(c);
- else
- return "0" + String.valueOf(c);
-}
-</pre>
-<p>The <code>updateDisplay()</code> method uses the member fields for the time and inserts them in
-the <code>mTimeDisplay</code> {@link android.widget.TextView}. The <code>pad()</code> method returns
-the appropriate string representation of the hour or minute—it will prefix a zero to the
-number if it's a single digit.</p>
-</li>
-
-<li>Add a class member for a {@link android.app.TimePickerDialog.OnTimeSetListener} that will be
-called when the user sets a new time:
-<pre>
-// the callback received when the user "sets" the time in the dialog
-private TimePickerDialog.OnTimeSetListener mTimeSetListener =
- new TimePickerDialog.OnTimeSetListener() {
- public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
- mHour = hourOfDay;
- mMinute = minute;
- updateDisplay();
- }
- };
-</pre>
-<p>When the user is done setting the time (clicks the "Set" button), the
-<code>onTimeSet()</code> method is called and it updates the member fields with
-the new time and updates the layout's {@link android.widget.TextView}.</p>
-</li>
-
-<li>Add the {@link android.app.Activity#onCreateDialog(int)} callback method:
-<pre>
-@Override
-protected Dialog onCreateDialog(int id) {
- switch (id) {
- case TIME_DIALOG_ID:
- return new TimePickerDialog(this,
- mTimeSetListener, mHour, mMinute, false);
- }
- return null;
-}
-</pre>
-<p>This is an {@link android.app.Activity} callback that is passed the identifier you passed to
-{@link android.app.Activity#showDialog(int)}, in the {@link android.widget.Button}'s on-click
-listener. When the ID matches, this initializes the {@link android.app.TimePickerDialog} with the
-member variables initialized at the end of <code>onCreate()</code> and the {@link
-android.app.TimePickerDialog.OnTimeSetListener} created in the previous step.</p>
-</li>
-
-<li>Run the application.</li>
-</ol>
-<p>When you press the "Change the time" button, you should see the following:</p>
-<img src="images/hello-timepicker.png" width="150px" />
-
-<h3>References</h3>
-<ol>
- <li>{@link android.widget.TimePicker}</li>
- <li>{@link android.app.TimePickerDialog.OnTimeSetListener}</li>
- <li>{@link android.widget.Button}</li>
- <li>{@link android.widget.TextView}</li>
- <li>{@link java.util.Calendar}</li>
-</ol>
-
diff --git a/docs/html/resources/tutorials/views/hello-webview.jd b/docs/html/resources/tutorials/views/hello-webview.jd
deleted file mode 100644
index f6a6a71..0000000
--- a/docs/html/resources/tutorials/views/hello-webview.jd
+++ /dev/null
@@ -1,131 +0,0 @@
-page.title=Web View
-parent.title=Hello, Views
-parent.link=index.html
-@jd:body
-
-<p>{@link android.webkit.WebView} allows you to create your own window for viewing web pages (or even
-develop a complete browser). In this tutorial, you'll create a simple {@link android.app.Activity}
-that can view and navigate web pages.</p>
-
-<ol>
- <li>Create a new project named <em>HelloWebView</em>.</li>
- <li>Open the <code>res/layout/main.xml</code> file and insert the following:
-<pre>
-<?xml version="1.0" encoding="utf-8"?>
-<WebView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/webview"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
-/>
-</pre>
- </li>
-
- <li>Now open the <code>HelloWebView.java</code> file.
- At the top of the class, declare a {@link android.webkit.WebView} object:
-<pre>WebView mWebView;</pre>
- <p>Then use the following code for the {@link android.app.Activity#onCreate(Bundle) onCreate()}
- method:</p>
-<pre>
-public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- mWebView = (WebView) findViewById(R.id.webview);
- mWebView.getSettings().setJavaScriptEnabled(true);
- mWebView.loadUrl("http://www.google.com");
-}
-</pre>
- <p>This initializes the member {@link android.webkit.WebView} with the one from the
- {@link android.app.Activity} layout; requests a {@link android.webkit.WebSettings} object with
- {@link android.webkit.WebView#getSettings()}; and enables JavaScript for the {@link
- android.webkit.WebView} with {@link android.webkit.WebSettings#setJavaScriptEnabled(boolean)}.
- Finally, an initial web page is loaded with {@link
- android.webkit.WebView#loadUrl(String)}.</p>
- </li>
-
- <li>Because this application needs access to the Internet, you need to add the appropriate
- permissions to the Android manifest file. Open the <code>AndroidManifest.xml</code> file
- and add the following as a child of the <code><manifest></code> element:
-
- <pre><uses-permission android:name="android.permission.INTERNET" /></pre></li>
-
- <li>While you're in the manifest, give some more space for web pages by removing the title
- bar, with the "NoTitleBar" theme:
-<pre>
-<activity android:name=".HelloWebView" android:label="@string/app_name"
- <strong>android:theme="@android:style/Theme.NoTitleBar"</strong>>
-</pre>
- </li>
-
- <li>Now run the application.
- <p>You now have a simplest web page viewer.
- It's not quite a browser yet because as soon as you click a link, the default Android Browser
- handles the Intent to view a web page, because this {@link android.app.Activity} isn't
- technically enabled to do so. Instead of adding an intent filter to view web pages, you can
- override the {@link android.webkit.WebViewClient} class and enable this {@link
- android.app.Activity} to handle its own URL requests.</p>
- </li>
-
- <li>In the <code>HelloAndroid</code> Activity, add this nested class:
-<pre>
-private class HelloWebViewClient extends WebViewClient {
- @Override
- public boolean shouldOverrideUrlLoading(WebView view, String url) {
- view.loadUrl(url);
- return true;
- }
-}
-</pre>
- </li>
- <li>Then towards the end of the {@link android.app.Activity#onCreate(Bundle)} method, set an
- instance of the <code>HelloWebViewClient</code> as the {@link android.webkit.WebViewClient}:
- <pre>mWebView.setWebViewClient(new HelloWebViewClient());</pre>
-
- <p>This line can go anywhere following the initialization of the {@link
- android.webkit.WebView} object.</p>
- <p>This creates a {@link android.webkit.WebViewClient} that will load any URL selected from this
- {@link android.webkit.WebView} into the same {@link android.webkit.WebView}. The
- {@link android.webkit.WebViewClient#shouldOverrideUrlLoading(WebView,String)} method is passed
-the current {@link android.webkit.WebView} and the URL requested, so all it needs to do is load
-the URL in the given view. Returning <code>true</code> says that the method has handled the URL
-and the event should not propagate (in which case, an Intent would be created that's handled by
-the Browser application).</p>
- <p>If you run the application again, new pages will now load in this Activity.
- However, you can't navigate back to previous pages. To do this, you need to handle the BACK
- button on the device, so that it will return to the previous page, rather than exit the
- application.</p>
- </li>
-
- <li>To handle the BACK button key press, add the following method inside the
- <code>HelloWebView</code> Activity:
-<pre>
-@Override
-public boolean onKeyDown(int keyCode, KeyEvent event) {
- if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
- mWebView.goBack();
- return true;
- }
- return super.onKeyDown(keyCode, event);
-}
-</pre>
- <p>This {@link android.app.Activity#onKeyDown(int,KeyEvent)} callback method will be called
- anytime a button is pressed while in the Activity. The condition inside uses the {@link
- android.view.KeyEvent} to check whether the key pressed is the BACK button and whether the
- {@link android.webkit.WebView} is actually capable of navigating back (if it has a history). If
- both are true, then the {@link android.webkit.WebView#goBack()} method is called,
- which will navigate back one step in the {@link android.webkit.WebView}
- history.Returning <code>true</code> indicates that the event has been handled. If this condition
- is not met, then the event is sent back to the system.</p>
-</li>
-<li>Run the application again. You'll now be able to follow links and navigate back through the
-page history.</li>
-</ol>
-<p>When you open the application, it should look like this:</p>
-<img src="images/hello-webview.png" width="150px" />
-
-<h3>Resource</h3>
-<ul>
-<li>{@link android.webkit.WebView}</li>
-<li>{@link android.webkit.WebViewClient}</li>
-<li>{@link android.view.KeyEvent}</li>
-</ul>
diff --git a/docs/html/resources/tutorials/views/images/android.png b/docs/html/resources/tutorials/views/images/android.png
deleted file mode 100755
index 39a1ac7..0000000
--- a/docs/html/resources/tutorials/views/images/android.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/androidmarker.png b/docs/html/resources/tutorials/views/images/androidmarker.png
deleted file mode 100755
index 8c43d46..0000000
--- a/docs/html/resources/tutorials/views/images/androidmarker.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-autocomplete.png b/docs/html/resources/tutorials/views/images/hello-autocomplete.png
deleted file mode 100644
index 0b3e680..0000000
--- a/docs/html/resources/tutorials/views/images/hello-autocomplete.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-datepicker.png b/docs/html/resources/tutorials/views/images/hello-datepicker.png
deleted file mode 100755
index 2075066..0000000
--- a/docs/html/resources/tutorials/views/images/hello-datepicker.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-formstuff.png b/docs/html/resources/tutorials/views/images/hello-formstuff.png
deleted file mode 100644
index 949319f..0000000
--- a/docs/html/resources/tutorials/views/images/hello-formstuff.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-gallery.png b/docs/html/resources/tutorials/views/images/hello-gallery.png
deleted file mode 100755
index 22d1eaf..0000000
--- a/docs/html/resources/tutorials/views/images/hello-gallery.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-gridview.png b/docs/html/resources/tutorials/views/images/hello-gridview.png
deleted file mode 100755
index 2def0df..0000000
--- a/docs/html/resources/tutorials/views/images/hello-gridview.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-linearlayout.png b/docs/html/resources/tutorials/views/images/hello-linearlayout.png
deleted file mode 100755
index dfef819..0000000
--- a/docs/html/resources/tutorials/views/images/hello-linearlayout.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-relativelayout.png b/docs/html/resources/tutorials/views/images/hello-relativelayout.png
deleted file mode 100755
index ec4d9d4..0000000
--- a/docs/html/resources/tutorials/views/images/hello-relativelayout.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-spinner.png b/docs/html/resources/tutorials/views/images/hello-spinner.png
deleted file mode 100755
index 42e2a91..0000000
--- a/docs/html/resources/tutorials/views/images/hello-spinner.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-tablelayout.png b/docs/html/resources/tutorials/views/images/hello-tablelayout.png
deleted file mode 100755
index 3d80e7f..0000000
--- a/docs/html/resources/tutorials/views/images/hello-tablelayout.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/images/hello-timepicker.png b/docs/html/resources/tutorials/views/images/hello-timepicker.png
deleted file mode 100755
index bd5a1ee..0000000
--- a/docs/html/resources/tutorials/views/images/hello-timepicker.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/resources/tutorials/views/index.jd b/docs/html/resources/tutorials/views/index.jd
deleted file mode 100644
index bba8330..0000000
--- a/docs/html/resources/tutorials/views/index.jd
+++ /dev/null
@@ -1,121 +0,0 @@
-page.title=Hello, Views
-parent.title=Tutorials
-parent.link=../../browser.html?tag=tutorial
-@jd:body
-
-<style>
-.view {float:left; margin:10px; font-size:120%; font-weight:bold;}
-#jd-content .view img {border:1px solid black; margin:8px 0 0 0; padding:5px;}
-</style>
-
-<p>This is a collection of "Hello World"-style tutorials designed
-to get you started quickly with common Android layouts and widgets.</p>
-
-<p>A certain amount of knowledge is assumed for these tutorials. Before you start,
-you should have completed the <a href="{@docRoot}resources/tutorials/hello-world.html">Hello,
-World</a> tutorial—it will teach you several things about basic
-Android development. More specifically, you should know:</p>
-<ul>
- <li>How to create an Android project and run it</li>
- <li>The basic structure of an Android project (resource files, layout files, etc.)</li>
- <li>The basic components of an {@link android.app.Activity}</li>
-</ul>
-
-<p class="note"><strong>Note:</strong> In order to make these tutorials as simple as possible,
-some code may not conform to best practices for coding Android applications. In particular,
-hard-coded strings are used in places, when the better practice is to reference strings from a
-<code>res/values/strings.xml</code> resource file.</p>
-
-<p class="note"><strong>Tip:</strong> After you have pasted sample code into an Eclipse project,
-press <strong>Ctrl (or Cmd) + Shift + O</strong> to import the required packages.</p>
-
-<h2>Layouts</h2>
-
-<div class="view">
-<a href="hello-linearlayout.html">Linear Layout</a><br/>
-<a href="hello-linearlayout.html"><img src="images/hello-linearlayout.png" height="285" width="200"
-/></a>
-</div>
-
-<div class="view">
-<a href="hello-relativelayout.html">Relative Layout</a><br/>
-<a href="hello-relativelayout.html"><img src="images/hello-relativelayout.png" height="285"
-width="200" /></a>
-</div>
-
-<div class="view">
-<a href="hello-tablelayout.html">Table Layout</a><br/>
-<a href="hello-tablelayout.html"><img src="images/hello-tablelayout.png" height="285" width="200"
-/></a>
-</div>
-
-<div class="view">
-<a href="hello-gridview.html">Grid View</a><br/>
-<a href="hello-gridview.html"><img src="images/hello-gridview.png" height="285" width="200" /></a>
-</div>
-
-<div class="view">
-<a href="hello-tabwidget.html">Tab Layout</a><br/>
-<a href="hello-tabwidget.html"><img src="images/hello-tabwidget.png" height="285" width="200" /></a>
-</div>
-
-<div class="view">
-<a href="hello-listview.html">List View</a><br/>
-<a href="hello-listview.html"><img src="images/hello-listview.png" height="285" width="200" /></a>
-</div>
-
-<p style="clear:left"> </p>
-
-<h2>Widgets & Other Views</h2>
-
-<div class="view">
-<a href="hello-datepicker.html">Date Picker</a><br/>
-<a href="hello-datepicker.html"><img src="images/hello-datepicker.png" height="285" width="200"
-/></a>
-</div>
-
-<div class="view">
-<a href="hello-timepicker.html">Time Picker</a><br/>
-<a href="hello-timepicker.html"><img src="images/hello-timepicker.png" height="285" width="200"
-/></a>
-</div>
-
-<div class="view">
-<a href="hello-formstuff.html">Form Stuff</a><br/>
-<a href="hello-formstuff.html"><img src="images/hello-formstuff.png" height="285" width="200" /></a>
-</div>
-
-<div class="view">
-<a href="hello-spinner.html">Spinner</a><br/>
-<a href="hello-spinner.html"><img src="images/hello-spinner.png" height="285" width="200" /></a>
-</div>
-
-<div class="view">
-<a href="hello-autocomplete.html">Auto Complete</a><br/>
-<a href="hello-autocomplete.html"><img src="images/hello-autocomplete.png" height="285" width="200"
-/></a>
-</div>
-
-<div class="view">
-<a href="hello-gallery.html">Gallery</a><br/>
-<a href="hello-gallery.html"><img src="images/hello-gallery.png" height="285" width="200" /></a>
-</div>
-
-<div class="view">
-<a href="hello-mapview.html">Google Map View</a><br/>
-<a href="hello-mapview.html"><img src="images/hello-mapview.png" height="285" width="200" /></a>
-</div>
-
-<div class="view">
-<a href="hello-webview.html">Web View</a><br/>
-<a href="hello-webview.html"><img src="images/hello-webview.png" height="285" width="200" /></a>
-</div>
-
-
-<p class="note" style="clear:left">
-There are plenty more layouts and widgets available. See the {@link android.view.View} class
-for more on View layouts, and the {@link android.widget widget package}
-for more useful widgets. And for more raw code samples, visit the
-<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/index.html">Api
-Demos</a>.</p>
-
diff --git a/docs/html/sdk/OLD_RELEASENOTES.jd b/docs/html/sdk/OLD_RELEASENOTES.jd
index 7751681..6865db2 100644
--- a/docs/html/sdk/OLD_RELEASENOTES.jd
+++ b/docs/html/sdk/OLD_RELEASENOTES.jd
@@ -173,9 +173,9 @@
<p>The SDK includes several new development tools, such as</p>
<ul>
- <li><a href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">HierarchyViewer</a> is a visual tool for inspecting and debugging your user interfaces and layout. </li>
- <li><a href="{@docRoot}guide/developing/tools/draw9patch.html">Draw 9-patch</a> allows you to easily create a NinePatch graphic using a WYSIWYG editor. </li>
- <li>The <a href="{@docRoot}guide/developing/tools/monkey.html">UI/Application Exerciser Monkey</a> generates pseudo-random system and user events, for testing your application. </li>
+ <li><a href="{@docRoot}tools/help/hierarchy-viewer.html">HierarchyViewer</a> is a visual tool for inspecting and debugging your user interfaces and layout. </li>
+ <li><a href="{@docRoot}tools/help/draw9patch.html">Draw 9-patch</a> allows you to easily create a NinePatch graphic using a WYSIWYG editor. </li>
+ <li>The <a href="{@docRoot}tools/help/monkey.html">UI/Application Exerciser Monkey</a> generates pseudo-random system and user events, for testing your application. </li>
</ul>
<p>
<b>Application Signing</b>
@@ -326,7 +326,7 @@
<h4>traceview</h4>
<ul>
- <li>The <a href="{@docRoot}guide/developing/tools/traceview.html">traceview</a> tool is now included in the SDK.</li>
+ <li>The <a href="{@docRoot}tools/help/traceview.html">traceview</a> tool is now included in the SDK.</li>
</ul>
<h3>Resolved Issues</h3>
@@ -387,13 +387,13 @@
<ul>
<li>Now provides support for emulating inbound SMS messages. The ADT plugin and DDMS provide integrated access to
this capability. For more information about how to emulate inbound SMS from the console,
-see <a href="{@docRoot}guide/developing/tools/emulator.html#sms">SMS Emulation</a>. </li>
+see <a href="{@docRoot}tools/help/emulator.html#sms">SMS Emulation</a>. </li>
</ul>
<h4>Emulator</h4>
<ul><li>The default emulator skin has been changed to HVGA-P from QVGA-L. For information
about emulator skins and how to load a specific skin when starting the emulator, see
-<a href="{@docRoot}guide/developing/tools/emulator.html#skins">Using Emulator Skins</a>.</li>
+<a href="{@docRoot}tools/help/emulator.html#skins">Using Emulator Skins</a>.</li>
</ul>
<h3>Resolved Issues</h3>
diff --git a/docs/html/sdk/RELEASENOTES.jd b/docs/html/sdk/RELEASENOTES.jd
index 91eb57f..c7ece42 100644
--- a/docs/html/sdk/RELEASENOTES.jd
+++ b/docs/html/sdk/RELEASENOTES.jd
@@ -37,15 +37,15 @@
<ul>
<li>Notes for the Android 2.0.1 platform are in the <a
-href="{@docRoot}sdk/android-2.0.1.html">Android 2.0.1, Release 1</a> document. </li>
+href="{@docRoot}about/versions/android-2.0.1.html">Android 2.0.1, Release 1</a> document. </li>
<li>You can find information about tools changes in the <a
-href="{@docRoot}sdk/tools-notes.html#notes">SDK Tools</a> and <a
-href="{@docRoot}sdk/eclipse-adt.html#notes">ADT Plugin for Eclipse</a>.</li>
+href="{@docRoot}tools/sdk/tools-notes.html#notes">SDK Tools</a> and <a
+href="{@docRoot}tools/sdk/eclipse-adt.html#notes">ADT Plugin for Eclipse</a>.</li>
</ul>
<p>To get started with the SDK, review the Quick Start summary on the <a
href="{@docRoot}sdk/index.html">Android SDK download page</a> or read <a
-href="{@docRoot}sdk/installing.html">Installing the SDK</a> for detailed
+href="{@docRoot}sdk/installing/index.html">Installing the SDK</a> for detailed
installation instructions. </p>
@@ -64,7 +64,7 @@
skins. </li>
<li>Android SDK and AVD Manager, a graphical UI to let you manage your
SDK and AVD environments more easily. The tool lets you create and manage
-your <a href="{@docRoot}guide/developing/devices/managing-avds.html">Android Virtual
+your <a href="{@docRoot}tools/devices/managing-avds.html">Android Virtual
Devices</a> and download new SDK packages (such as platform versions and
add-ons) into your environment.</li>
<li>Improved support for test packages in New Project Wizard</li>
@@ -72,7 +72,7 @@
capability that lets you display only the parts of the API that are actually
available to your application, based on the <code>android:minSdkVersion</code>
value the application declares in its manifest. For more information, see
-<a href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a></li>
+<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">Android API Levels</a></li>
</ul>
<p>For details about the Android platforms included in the SDK — including
@@ -109,7 +109,7 @@
<p>The new version of ADT is downloadable from the usual remote update site or
is separately downloadable as a .zip archive. For instructions on how to
download the plugin, please see <a
-href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin for Eclipse</a>. </p>
+href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin for Eclipse</a>. </p>
<h3>Android SDK and AVD Manager</h3>
@@ -222,7 +222,7 @@
density for each skin, to create any combination of resolution/density (WVGA
with medium density, for instance). To do so, use the <code>android</code> tool
command line to create a new AVD that uses a custom hardware configuration. See
-<a href="{@docRoot}guide/developing/devices/managing-avds.html#createavd">Creating an
+<a href="{@docRoot}tools/devices/managing-avds.html#createavd">Creating an
AVD</a> for more information.</p>
<h3>Other Notes and Resolved Issues</h3>
@@ -330,7 +330,7 @@
Android 1.5). The tools are updated to let you deploy your application
on any platform in the SDK, which helps you ensure forward-compatibility and,
if applicable, backward-compatibility.</li>
- <li>Introduces <a href="{@docRoot}guide/developing/devices/managing-avds.html">Android
+ <li>Introduces <a href="{@docRoot}tools/devices/managing-avds.html">Android
Virtual Devices</a> — (AVD) configurations of options that you
run in the emulator to better model actual devices. Each AVD gets its
own dedicated storage area, making it much easier to work with multiple emulators
@@ -352,7 +352,7 @@
<p>For details about the Android platforms included in the SDK — including
bug fixes, features, and API changes — please read the <a
-href="{@docRoot}sdk/android-1.5.html">Android 1.5 version notes</a>.</p>
+href="{@docRoot}about/versions/android-1.5.html">Android 1.5 version notes</a>.</p>
<h3>Installation and Upgrade Notes</h3>
@@ -407,7 +407,7 @@
available to use.</p>
<p>For more information about AVDs, see <a
-href="{@docRoot}guide/developing/devices/index.html">Creating and Managing Virtual Devices</a>
+href="{@docRoot}tools/devices/index.html">Creating and Managing Virtual Devices</a>
<h3>Other Notes</h3>
@@ -491,7 +491,7 @@
<p>For details about the Android 1.1 system image included in the SDK —
including bug fixes, features, and API changes — please read the <a
-href="{@docRoot}sdk/android-1.1.html">Android 1.1 version notes</a>.</p>
+href="{@docRoot}about/versions/android-1.1.html">Android 1.1 version notes</a>.</p>
<h3>App Versioning for Android 1.1</h3>
@@ -545,7 +545,7 @@
Plugin for Eclipse is <strong>0.8.0</strong>. If you are using a
previous version of ADT, you should update to the latest version for use
with this SDK. For information about how to update your ADT plugin, see
-<a href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin for Eclipse</a>.</p>
+<a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin for Eclipse</a>.</p>
<h3>Installation and Upgrade Notes</h3>
@@ -585,7 +585,7 @@
<p>The USB driver files are located in the
<code><SDK>/usb_driver</code> directory. For details and
installation instructions, see <a
-href="{@docRoot}guide/developing/device.html#setting-up">Connecting Hardware Devices</a>.</p>
+href="{@docRoot}tools/device.html#setting-up">Connecting Hardware Devices</a>.</p>
</p>
<h3>Resolved Issues, Changes</h3>
@@ -650,7 +650,7 @@
Development Tools (ADT) Plugin for Eclipse is <strong>0.8.0</strong>. If you are
using a previous version of ADT, you should update to the latest version for use
with this SDK. For information about how to update your ADT plugin, see <a
-href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin for Eclipse</a>.</p>
+href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin for Eclipse</a>.</p>
<h3>Other Notes</h3>
diff --git a/docs/html/sdk/adding-components.jd b/docs/html/sdk/adding-components.jd
deleted file mode 100644
index 599b2a8..0000000
--- a/docs/html/sdk/adding-components.jd
+++ /dev/null
@@ -1,209 +0,0 @@
-page.title=Adding SDK Packages
-@jd:body
-
-
-<div id="qv-wrapper">
-<div id="qv">
-<h2>Quickview</h2>
-<ul>
- <li>Use the Android SDK Manager to
- set up your SDK and keep it up-to-date.</li>
-</ul>
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#launching">Launching the Android SDK Manager</a>
- <li><a href="#InstallingComponents">Installing SDK Packages</a>
- <li><a href="#UpdatingComponents">Updating SDK Packages</a>
- <li><a href="#dependencies">Package Dependencies</a></li>
- <li><a href="#AddingSites">Adding New Sites</a></li>
- <li><a href="#troubleshooting">Troubleshooting</a></li>
-</ol>
-</div>
-</div>
-
-<p>Adding and updating packages in your Android SDK is fast and easy. To add or
-update the individual SDK packages that you need, use the <em>Android SDK
-Manager</em> (included in the SDK Tools).</p>
-
-<p>It only takes a couple of clicks to install individual versions of the
-Android platform, new development tools, new documentation, and SDK add-ons. The
-new SDK packages are automatically installed into your existing SDK directory,
-so you don't need to update your development environment to specify a new SDK
-location.</p>
-
-<p>If you're setting up your Android SDK for the first time,
-see <a href="{@docRoot}sdk/installing.html#components">Installing the SDK</a> for information about
-what packages to install.</p>
-
-<p class="note"><strong>Note:</strong> If you develop in Eclipse, you might also need
-to update your ADT plugin when you update your development tools. See the revisions listed in the
-<a href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin for Eclipse</a> document.</p>
-
-<img src="{@docRoot}images/sdk_manager_packages.png" alt="" />
-<p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager's
-<strong>Available Packages</strong> panel, which shows the SDK packages that are
-available for you to download into your environment. </p>
-</div>
-
-<h2 id="launching">Launching the Android SDK Manager</h2>
-
-<p>The Android SDK Manager is the tool that you use to install and
-upgrade SDK packages in your development environment. </p>
-
-<p>You can launch the Android SDK Manager in one of the following ways.</p>
-
-<h4>Launching from Eclipse/ADT</h4>
-
-<p>If you are developing in Eclipse and have already installed the ADT Plugin,
-follow these steps to access the Android SDK Manager tool:</p>
-
-<ol>
-<li>Open Eclipse</li>
-<li>Select <strong>Window</strong> > <strong>Android SDK
-Manager</strong>.</li>
-</ol>
-
-<h4>Launching from the SDK Manager script (Windows only)</h4>
-
-<p>For Windows only, the SDK includes a script that invokes the Android SDK Manager. To launch the
-tool using the script, double-click {@code SDK
-Manager.exe} at the root of the the SDK directory.</p>
-
-<h4>Launching from a command line</h4>
-
-<p>In all development environments, follow these steps to access the Android SDK Manager tool from
-the command line: </p>
-
-<ol>
-<li>Navigate to the <code><<em>sdk</em>>/tools/</code> directory.</li>
-<li>Execute the {@code android} tool command with no options.
- <pre style="width:400px">$ android</pre></li>
-</ol>
-
-
-<h2 id="InstallingComponents">Installing SDK Packages</h2>
-
-<p class="caution"><strong>Caution:</strong> Before you install SDK packages,
-we recommend that you disable any antivirus software that may be running on
-your computer. There are cases in which antivirus software on Windows is known to interfere with the
-installation process, so we suggest you disable your antivirus until installation is
-complete.</p>
-
-<p>Follow these steps to install new SDK packages in your environment:</p>
-
-<ol>
- <li>Launch the Android SDK Manager as described in the section above.</li>
- <li>Select <strong>Available Packages</strong> in the left panel.
- This will reveal all of the packages that are currently available for download
- from the SDK repository.</li>
- <li>Select the package(s) you'd like to install and click <strong>Install
- Selected</strong>. (If you aren't sure which packages to select, read <a
- href="installing.html#which">Recommended Packages</a>.)</li>
- <li>Verify and accept the packages you want (ensure each one is selected with a green
-checkmark) and click <strong>Install</strong>. The packages will now be installed into
-your existing Android SDK directories.</li>
-</ol>
-
-<p>New platforms are automatically saved into the
-<code><sdk>/platforms/</code> directory of your SDK;
-new add-ons are saved in the <code><sdk>/add-ons/</code>
-directory; samples are saved in the
-<code><sdk>/samples/android-<level>/</code>;
-and new documentation is saved in the existing
-<code><sdk>/docs/</code> directory (old docs are replaced).</p>
-
-
-<h2 id="UpdatingComponents">Updating SDK Packages</h2>
-
-<p>From time to time, new revisions of existing SDK packages are released and
-made available to you through the SDK repository. In most cases, if you have those
-packages installed in your environment, you will want
-to download the new revisions as soon as possible. </p>
-
-<p>You can learn about the release of new revisions in two ways: </p>
-
-<ul>
-<li>You can watch for updates listed in the "SDK" tab of the Android Developers
-site, in the "Downloadable SDK Packages" section. </li>
-<li>You can watch for updates listed in the <strong>Available Packages</strong>
-panel of the Android SDK Manager. </li>
-</ul>
-
-<p>When you see that a new revision is available, you can use the Android SDK Manager to quickly
-download it to your environment. Follow the same
-procedure as given in <a href="#InstallingComponents">Installing SDK Packages</a>, above. The new
-package is installed in place of the old, but without impacting your
-applications. </p>
-
-<p class="note"><strong>Tip:</strong>
-Use the "Display updates only" checkbox to show only the packages
-you do not have.</p>
-
-
-<h2 id="dependencies">SDK Package Dependencies</h2>
-
-<p>In some cases, an SDK package may require a specific minimum revision of
-another package or SDK tool. Where such dependencies exist, they are
-documented in the revision notes for each package, available from the links in
-the "Downloadable SDK packages" section at left.</p>
-
-<p>For example, there may be a dependency between the ADT Plugin for Eclipse and
-the SDK Tools package. When you install the SDK Tools
-package, you should also upgrade to the required version of ADT (if you
-are developing in Eclipse). In this case, the major version number for your ADT plugin should
-always match the revision number of your SDK Tools (for example, ADT 8.x requires SDK Tools r8).
-</p>
-
-<p>Also make sure that, each time you install a new version of the Android platform, you have
-the latest version of the SDK Platform-tools package. The SDK Platform-tools contain
-tools that are backward compatible with all versions of the Android platform and are
-often updated to support new features in the latest version of the Android platform.</p>
-
-<p>The development tools will notify you with debug warnings if there is dependency that you need to
-address. The Android SDK Manager also enforces dependencies by requiring that you download any
-packages that are needed by those you have selected.</p>
-
-
-<h2 id="AddingSites">Adding New Sites</h2>
-
-<p>By default, <strong>Available Packages</strong> displays packages available from the
-<em>Android Repository</em> and <em>Third party Add-ons</em>. You can add other sites that host
-their own Android SDK add-ons, then download the SDK add-ons
-from those sites.</p>
-
-<p>For example, a mobile carrier or device manufacturer might offer additional
-API libraries that are supported by their own Android-powered devices. In order
-to develop using their libraries, you must install their Android SDK add-on, if it's not already
-available under <em>Third party Add-ons</em>. </p>
-
-<p>If a carrier or device manufacturer has hosted an SDK add-on repository file
-on their web site, follow these steps to add their site to the Android SDK
-Manager:</p>
-
-<ol>
- <li>Select <strong>Available Packages</strong> in the left panel.</li>
- <li>Click <strong>Add Add-on Site</strong> and enter the URL of the
-{@code repository.xml} file. Click <strong>OK</strong>.</li>
-</ol>
-<p>Any SDK packages available from the site will now be listed under a new item named
-<strong>User Add-ons</strong>.</p>
-
-
-<h2 id="troubleshooting">Troubleshooting</h2>
-
-<p><strong>Problems connecting to the SDK repository</strong></p>
-
-<p>If you are using the Android SDK Manager to download packages and are encountering
-connection problems, try connecting over http, rather than https. To switch the
-protocol used by the Android SDK Manager, follow these steps: </p>
-
-<ol>
- <li>With the Android SDK Manager window open, select "Settings" in the
- left pane. </li>
- <li>On the right, in the "Misc" section, check the checkbox labeled "Force
- https://... sources to be fetched using http://..." </li>
- <li>Click <strong>Save & Apply</strong>.</li>
-</ol>
-
-
diff --git a/docs/html/sdk/android-1.5.jd b/docs/html/sdk/android-1.5.jd
deleted file mode 100644
index 9ed798c..0000000
--- a/docs/html/sdk/android-1.5.jd
+++ /dev/null
@@ -1,375 +0,0 @@
-page.title=Android 1.5 Platform
-sdk.platform.version=1.5
-sdk.platform.apiLevel=3
-sdk.platform.majorMinor=major
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#features">Platform Highlights</a></li>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#api">Framework API Changes</a>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-
- </ol>
- </li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-<h2>See Also</h2>
-<ol>
- <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>
-<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release
-deployable to Android-powered handsets starting in May 2009.
-The release includes new features for users and developers, as well as changes
-in the Android framework API. </p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK. The downloadable platform includes a
-fully compliant Android library and system image, as well as a set of emulator
-skins, sample applications, and more. The downloadable platform is fully
-compliant and includes no external libraries. </p>
-
-<p>To get started developing or testing against the Android
-{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
-download the platform into your Android 1.6 or later SDK. For more information,
-see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>.</p>
-
-
-<h2 id="features">Platform Highlights</h2>
-
-<p>For a list of new user features and platform highlights, see the <a
-href="http://developer.android.com/sdk/android-{@sdkPlatformVersion}-highlights.html">Android
-{@sdkPlatformVersion} Platform Highlights</a> document.</p>
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
-revision number. To determine what revision(s) of the Android
-{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
-the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
- padding: .25em 1em 0em 1em;
- margin-bottom: 0;
-}
-.toggleme {
- padding: 1em 1em 0 2em;
- line-height:1em;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleme a {
- text-decoration:underline;
-}
-.toggleable.closed .toggleme {
- display:none;
-}
-#jd-content .toggle-img {
- margin:0;
-}
-</style>
-
-<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" />
- Android 1.5, Revision 4</a> <em>(May 2010)</em></a>
- <div class="toggleme">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r6 or higher.</p>
-</dd>
-
-<dt>Tools:</dt>
-<dd>
-<ul>
-<li>Adds support for library projects in the Ant build system.</li>
-<li>Fixes test project build in the Ant build system.</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" />
- Android 1.5, Revision 3</a> <em>(July 2009)</em></a>
- <div class="toggleme">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r3 or higher.</p>
-</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" />
- Android 1.5, Revision 2</a> <em>(May 2009)</em></a>
- <div class="toggleme">
-<p>Not available as an SDK component — please use Android 1.5, r3 instead. </p>
- </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" />
- Android 1.5, Revision 1</a> <em>(April 2009)</em></a>
- <div class="toggleme">
-<p>Not available as an SDK component — please use Android 1.5, r3 instead. </p>
- </div>
-</div>
-
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
-the framework API. The Android {@sdkPlatformVersion} API
-is assigned an integer identifier —
-<strong>{@sdkPlatformApiLevel}</strong> — that is
-stored in the system itself. This identifier, called the "API Level", allows the
-system to correctly determine whether an application is compatible with
-the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your
-application, you need to set the proper value, "{@sdkPlatformApiLevel}", in the
-<code>android:minSdkVersion</code> attributes of the <code><uses-sdk></code>
-element in your application's manifest. </p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-
-<h2 id="api">Framework API Changes</h2>
-
-<p>The sections below provide information about the application framework API provided by the Android {@sdkPlatformVersion} platform. </p>
-
-<h3>UI framework</h3>
- <ul>
- <li>Framework for easier background/UI thread interaction</li>
- <li>New {@link android.widget.SlidingDrawer SlidingDrawer} widget</li>
- <li>New {@link android.widget.HorizontalScrollView HorizontalScrollview} widget</li>
- </ul>
-
-<h3>AppWidget framework</h3>
- <ul>
- <li>APIs for creating secure home screen {@link android.appwidget
-AppWidgets}. For information about how to use AppWidgets, see the Developer's
-Guide <a href="{@docRoot}guide/topics/appwidgets/index.html">AppWidgets</a>
-documentation. Also see <a
-href="http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html">
-Introducing home screen widgets and the AppWidget
-framework</a> on the Android Developer's Blog.</li>
- <li>APIs for populating {@link android.provider.LiveFolders Live Folders}
- with custom content.</li>
- </ul>
-
-<h3>Media framework</h3>
- <ul>
- <li>Raw audio recording and playback APIs</li>
- <li>Interactive MIDI playback engine</li>
- <li>Video recording APIs for developers (3GP format)</li>
- <li>Video and photo sharing Intents</li>
- <li>Media search Intent</li>
- </ul>
-
-<h3>Input Method framework </h3>
- <ul>
- <li>{@link android.inputmethodservice.InputMethodService Input Method
- Service} framework</li>
- <li>Text-prediction engine</li>
- <li>Ability to provide downloadable IMEs to users</li>
- </ul>
-
-<h3>Application-defined hardware requirements</h3>
-
-<p>Applications can now use a new element in their manifest files, <a
-href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><code><uses-configuration></code></a>
- to indicate to the Android system what hardware features
-they require in order to function properly. For example, an application might
-use the element to specify that it requires a physical keyboard or a particular
-navigation device, such as a trackball. Prior to installing the application, the
-Android system checks the attributes defined for the
-<code><uses-configuration></code> element and allows the installation to
-continue only if the required hardware is present.</p>
-
-<h3>Speech recognition framework</h3>
- <ul>
- <li>Support for using speech recognition libraries via Intent. See {@link
-android.speech.RecognizerIntent RecognizerIntent}.</li>
- </ul>
-
-<h3>Miscellaneous API additions</h3>
- <ul>
- <li>LocationManager - Applications can get location change updates via
- Intent</li>
- <li>WebView - Touch start/end/move/cancel DOM event support</li>
- <li>Redesigned {@link android.hardware.SensorManager Sensor Manager
- APIs}</li>
- <li>GLSurfaceView - convenience framework for creating OpenGL
- applications</li>
- <li>Broadcast Intent for app update install succeeded - for smoother app
- upgrade experience</li>
- </ul>
-
-
-<h3 id="api-diff">API differences report</h3>
-
-<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
-the previous version, see the <a href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report</a>.</p>
-
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
- <ul>
- <li>Alarm Clock</li>
- <li>Browser</li>
- <li>Calculator</li>
- <li>Camcorder</li>
- <li>Camera</li>
- <li>Contacts</li>
- <li>Custom Locale (developer app)</li>
- <li>Dev Tools (developer app)</li>
- </ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
- <ul>
- <li>Dialer</li>
- <li>Email</li>
- <li>Gallery</li>
- <li>IME for Japanese text input</li>
- <li>Messaging</li>
- <li>Music</li>
- <li>Settings</li>
- <li>Spare Parts (developer app)</li>
- </ul>
-</td>
-</tr>
-</table>
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable platform provides a variety of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em>
-locale descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-<li>Czech (cs_CZ)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>English, US (en_US)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>French, France (fr_FR)</li>
-<li>French, Belgium (fr_BE)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Polish (pl_PL)</li>
-<li>Russian (ru_RU)</li>
-<li>Spanish (es_ES)</li>
-</td>
-</tr>
-</table>
-
-<p>Localized UI strings match the locales that are accessible
-through Settings.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes a set of emulator skins that you can use for modeling your application in different screen sizes and resolutions. The emulator skins are: </p>
-
-<ul>
- <li>
- QVGA-P (240x320, low density, small screen)
- </li>
- <li>
- QVGA-L (320x480, low density, small screen)
- </li>
- <li>
- HVGA (320x480, medium density, normal screen)
- </li>
- <li>
- HVGA-P (320x480, medium density, normal screen)
- </li>
- <li>
- HVGA-L (320x480, medium density, normal screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays and functions properly on all Android-powered devices, see <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
diff --git a/docs/html/sdk/android-1.6-highlights.jd b/docs/html/sdk/android-1.6-highlights.jd
deleted file mode 100644
index f0a50fb..0000000
--- a/docs/html/sdk/android-1.6-highlights.jd
+++ /dev/null
@@ -1,213 +0,0 @@
-page.title=Android 1.6 Platform Highlights
-sdk.date=September 2009
-
-@jd:body
-
-
-<style type="text/css">
-#jd-content div.screenshot,
-#jd-content div.video {
- float:right;
- clear:right;
- padding:15px 70px;
- font-size:.9em;
- font-weight:bold;
- line-height:1.7em;
-}
-#jd-content div.video {
- padding-top:0;
- margin-top:-15px;
-}
-#jd-content div.screenshot img {
- margin:0;
-}
-</style>
-
-<div class="video">
-<object width="278" height="180">
-<param name="movie" value="http://www.youtube.com/v/MBRFkLKRwFw&hl=en&fs=1&"></param>
-<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
-<embed src="http://www.youtube.com/v/MBRFkLKRwFw&hl=en&fs=1&" type="application/x-shockwave-flash"
-allowscriptaccess="always" allowfullscreen="true" width="278" height="180"></embed>
-</object>
-</div>
-
-
-<p>The Android 1.6 platform introduces new features for users and developers.
-This page provides an overview of some new features and technologies.</p>
-
-<ul>
- <li><a href="#UserFeatures">New User Features</a></li>
- <li><a href="#GooglePlayUpdates">Google Play Updates</a></li>
- <li><a href="#PlatformTechnologies">New Platform Technologies</a></li>
-</ul>
-
-
-
-<h2 id="UserFeatures" style="clear:right">New User Features</h2>
-
-<!-- screenshots float right -->
-
-<div class="screenshot">
-<img src="images/search.png" class="screenshot" alt="" /><br/>
-Quick Search Box
-</div>
-
-<div class="screenshot">
-<img src="images/camera.png" class="screenshot" alt="" /><br/>
-New Camera/Camcorder UI
-</div>
-
-<div class="screenshot">
-<img src="images/battery.png" class="screenshot" alt="" /><br/>
-Battery Usage Indicator
-</div>
-
-
-<h3 id="QuickSearchBox">Quick Search Box for Android</h3>
-
-<p>Android 1.6 includes a redesigned search framework that provides a quick,
-effective, and consistent way for users to search across multiple sources—such as
-browser bookmarks & history, contacts, and the web—directly from
-the home screen.</p>
-
-<p>The system constantly learns which search results are more relevant based on what is
-clicked. So popular contacts or apps that have previously been picked will bubble up to
-the top when a user types the first few letters of a relevant query.</p>
-
-<p>The search framework also provides developers a way to easily expose relevant
-content from their applications in Quick Search Box.</p>
-
-<h3 id="Camera">Camera, Camcorder, and Gallery</h3>
-
-<p>An updated user interface provides an integrated camera, camcorder, and gallery experience.
-Users can quickly toggle between still and video capture modes. Additionally, the gallery
-enables users to select multiple photos for deletion.</p>
-
-<p>Android 1.6 also provides a much faster camera experience.
-Compared to the previous release, launching the camera is now 39% faster,
-and there is a 28% improvement in the time from completing one shot to the next.</p>
-
-
-<h3 id="VPN">VPN, 802.1x</h3>
-
-<p>A new Virtual Private Network (VPN) control panel in Settings allows users
-to configure and connect to the following types of VPNs:</p>
-
-<ul>
- <li>L2TP/IPSEC pre-shared key based VPN</li>
- <li>L2TP/IPsec certificate based VPN</li>
- <li>L2TP only VPN</li>
- <li>PPTP only VPN</li>
-</ul>
-
-
-<h3 id="Battery">Battery usage indicator</h3>
-
-<p>A new battery usage screen lets users see which apps and services are consuming
-battery power. If the user determines that a particular service or application is
-using too much power, they can take action to save the battery by
-adjusting settings, stopping the application, or uninstalling the application.</p>
-
-
-<h3 id="A11y">Accessibility</h3>
-
-<p>Users will be able to download new accessibility services built
-on the new accessibility framework and enable them in Settings.</p>
-
-
-
-
-<h2 id="GooglePlayUpdates" style="clear:right">Google Play Updates</h2>
-
-<div class="screenshot" style="margin-top:-35px">
-<img src="images/market.png" class="screenshot" alt="" /><br/>
-New Google Play UI
-</div>
-
-<p>For devices with Google Play, the latest version improves the overall user experience and makes
-it easier for users to discover great apps and games from developers.</p>
-
-<ul>
- <li>At the homescreen, users can choose among <em>Apps</em>, <em>Games</em>, and <em>Downloads</em>.</li>
- <li>Inside a category, users can explore titles that are <em>Top paid</em>, <em>Top free</em>, and <em>Just in</em>.</li>
- <li>For each title, users can now see screenshots submitted by developers in addition to
- reviews from other users.</li>
-</ul>
-
-
-
-
-<h2 id="PlatformTechnologies" style="clear:right">New Platform Technologies</h2>
-
-<h3 id="SearchFramework">Expanded Search Framework</h3>
-
-<p>The Android search framework has been redesigned and expanded to provide
-third-party applications the opportunity to surface
-content from their applications in Quick Search Box, the global search tool.
-To do this, developers will need to make their app "searchable" and provide
-suggestions in response to user queries.
-To enable application search suggestions, users simply select each application from which
-they'd like to receive suggestions, under Searchable items in the Search settings.</p>
-
-
-<h3 id="TTS">Text-to-speech engine</h3>
-
-<p>Android 1.6 features a multi-lingual speech synthesis engine called Pico.
-It allows any Android application to "speak" a string of text with an accent that matches the language.
-The engine supports the following languages: English (American and British accents), French,
-Italian, German and Spanish. If you're using a T-Mobile G1 or Dream device, you'll need to download the
-SpeechSynthesis Data Installer from Google Play, which includes the "voices" needed by the
-text-to-speech engine.</p>
-
-
-<h3 id="Gestures">Gestures</h3>
-
-<p>A new gestures framework provides application developers with a framework for creating, storing,
-loading, and recognizing gestures and associating them with specific actions.</p>
-
-<p>Developers can use the new GestureBuilder tool included in the Android 1.6 SDK to generate libraries
-of gestures to include with their application.</p>
-
-
-<h3 id="A11y">Accessibility</h3>
-
-<p>Android 1.6 provides a new accessibility framework.
-With this framework, developers can create accessibility plugins that respond to user input,
-such as making a sound when a new window is shown, vibrating when navigating to the top of
-a list, and providing spoken feedback.</p>
-
-
-<h3 id="Screens">Expanded support for screen densities and resolutions</h3>
-
-<p>Android 1.6 adds screen support that enables applications to be rendered properly on different
-display resolutions and densities. Developers can also specify the types of screens supported by their
-application.</p>
-
-
-<h3 id="CDMA">Telephony support for CDMA</h3>
-
-<p>Android 1.6 includes support for CDMA in the telephony stack.</p>
-
-
-<h3 id="OpenCore">New version of OpenCore</h3>
-
-<p>Android 1.6 includes the updated OpenCore 2 media engine, which has:</p>
-
-<ul>
- <li>Support for OpenMAX encoders</li>
- <li>Support for additional audio codecs in AuthorEngine</li>
- <li>Improved buffering model supports shared buffers allocated in the decoder</li>
-</ul>
-
-<h3 id="LinuxKernel">2.6.29 Linux kernel</h3>
-
-<p>Android 1.6 upgrades the Linux kernel from 2.6.27 to 2.6.29.</p>
-
-
-<h3 id="DeveloperAPIs">New Framework APIs</h3>
-
-<p>For a detailed overview of new APIs, see the
-<a href="{@docRoot}sdk/android-1.6.html#api-changes">Version Notes</a>.
-For a complete report of all API changes, see the
-<a href="{@docRoot}sdk/api_diff/4/changes.html">API Differences Report</a>.
diff --git a/docs/html/sdk/android-1.6.jd b/docs/html/sdk/android-1.6.jd
deleted file mode 100644
index a01a5f6..0000000
--- a/docs/html/sdk/android-1.6.jd
+++ /dev/null
@@ -1,505 +0,0 @@
-page.title=Android 1.6 Platform
-sdk.platform.version=1.6
-sdk.platform.apiLevel=4
-sdk.platform.majorMinor=minor
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#features">Platform Highlights</a></li>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#api">Framework API Changes</a>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-
- </ol>
- </li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-<h2>See Also</h2>
-<ol>
- <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>
-<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release
-deployable to Android-powered handsets since October 2009.
-The platform includes new features for users and developers, as well as changes
-in the Android framework API. </p>
-
-<p>For developers, a new release of the Android {@sdkPlatformVersion} platform
-is available as a downloadable component for the Android SDK. The platform
-— Android 1.6 r2 — includes a fully compliant Android library and
-system image, as well as a set of emulator skins, sample applications, and minor
-development updates. The downloadable platform is fully compliant (API Level 4)
-and includes no external libraries.</p>
-
-<p>To get started developing or testing against the Android
-{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
-download the latest Android 1.6 platform into your Android 1.6 or later SDK. For
-more information, see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>.</p>
-
-
-<h2 id="features">Platform Highlights</h2>
-
-<p>For a list of new user features and platform highlights, see the <a
-href="http://developer.android.com/sdk/android-{@sdkPlatformVersion}-highlights.html">Android
-{@sdkPlatformVersion} Platform Highlights</a> document.</p>
-
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
-revision number. To determine what revision(s) of the Android
-{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
-the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
- padding: .25em 1em 0em 1em;
- margin-bottom: 0;
-}
-.toggleme {
- padding: 1em 1em 0 2em;
- line-height:1em;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleme a {
- text-decoration:underline;
-}
-.toggleable.closed .toggleme {
- display:none;
-}
-#jd-content .toggle-img {
- margin:0;
-}
-</style>
-
-<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" />
- Android 1.6, Revision 3</a> <em>(May 2010)</em></a>
- <div class="toggleme">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r6 or higher.</p>
-</dd>
-<dt>Tools:</dt>
-<dd>
-<ul>
-<li>Adds support for library projects in the Ant build system.</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" />
- Android 1.6, Revision 2</a> <em>(December 2009)</em></a>
- <div class="toggleme">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r4 or higher.</p>
-</dd>
-
-<dt>API related:</dt>
-<dd>
-<ul>
-<li>Properly exposes CDMA-related constants in <code><a href="{@docRoot}reference/android/telephony/TelephonyManager.html">android.telephony.TelephonyManager</a></code>: <code>DATA_ACTIVITY_DORMANT</code>,
-<code>PHONE_TYPE_CDMA</code>, <code>NETWORK_TYPE_CDMA</code>,
-<code>NETWORK_TYPE_EVDO_0</code>, <code>NETWORK_TYPE_EVDO_A</code>, and
-<code>NETWORK_TYPE_1xRTT</code>.</li>
-</ul>
-</dd>
-<dt>System image:</dt>
-<dd>
-<ul>
-<li>Fixes bug so that Bitmap's density is now propagated through Parcelable.</li>
-<li>Fixes NinePatchDrawable to properly scale its reported padding for compatibility mode.</li>
-<li>Fixes TextView to properly compute styled font metrics based on the screen density.</li>
-<li>Updates kernel to 2.6.29, to match kernel on commercially
-available Android-powered devices.</li>
-</ul>
-</dd>
-<dt>Tools:</dt>
-<dd>
-<ul>
-<li>Adds new Ant build system with support for Emma instrumentation projects
-(code coverage).</li>
-<li>Fixes emulator skins to properly emulate d-pad in landscape mode.</li>
-<li>Fixes density rendering in the layout editor in ADT.</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" />
- Android 1.6, Revision 1</a> <em>(September 2009)</em></a>
- <div class="toggleme">
-<dl>
-<dt>Dependencies</dt>
-<dd>
-<p>Requires SDK Tools r3 or higher.</p>
-</dd>
-</dl>
- </div>
-</div>
-
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
-the framework API. The Android {@sdkPlatformVersion} API
-is assigned an integer identifier —
-<strong>{@sdkPlatformApiLevel}</strong> — that is
-stored in the system itself. This identifier, called the "API Level", allows the
-system to correctly determine whether an application is compatible with
-the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your
-application, you need to set the proper value, "{@sdkPlatformApiLevel}", in the
-<code>android:minSdkVersion</code> attributes of the <code><uses-sdk></code>
-element in your application's manifest. </p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-
-<h2 id="api">Framework API Changes</h2>
-
-<p>The sections below provide information about the application framework API provided by the Android {@sdkPlatformVersion} platform. </p>
-
-<h3 id="UIFramework">UI framework</h3>
- <ul>
- <li>New classes in {@link android.view.animation}
- to control the behavior of animations:
- <ul>
- <li><code>AnticipateInterpolator</code></li>
- <li><code>AnticipateOvershootInterpolator</code></li>
- <li><code>BounceInterpolator</code></li>
- <li><code>OvershootInterpolator</code></li>
- </ul>
- </li>
- <li>New XML attribute <code>android:onClick</code> to specify a View's
-<a href="/reference/android/view/View.OnClickListener.html">View.OnClickListener</a>
-from a layout file.
- </li>
- <li>New support for dealing with varying screen densities. Density
-information is associated with Bitmap and Canvas for performing the
-correct scaling. The framework will automatically scale bitmaps and
-nine-patches based on the density the resource was found under and the
-density of the screen, etc.
- </li><p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need to
-set the proper value, "{@sdkPlatformApiLevel}", in the attributes of the <code><uses-sdk></code>
-element in your application's manifest. </p>
- </ul>
-
-<h3>Search framework</h3>
- <ul>
- <li>Applications can now expose relevant content to users as search
-suggestions in the Quick Search Box, a new device-wide search capability that is
-accessible from the home screen. To support this, the search framework adds new
-attributes to the searchable metadata file. For complete information, see the
-{@link android.app.SearchManager SearchManager} documentation.
- </li>
- </ul>
-
-<h3>Accessibility framework</h3>
- <ul>
- <li>New {@link android.view.accessibility android.accessibility} package
-that includes classes for capturing accessibility events and forwarding them to
-an {@link android.accessibilityservice AccessibilityService} handler. </li>
- <li>New {@link android.accessibilityservice AccessibilityService} package
-that lets your application track user events and provide visual, audible, or
-haptic feedback to the user. </li>
- </ul>
-
-<h3>Gesture input</h3>
- <ul>
- <li>New {@link android.gesture gesture} API for creating, recognizing,
-loading, and saving gestures.</li>
- </ul>
-
-<h3>Text-to-speech</h3>
- <ul>
- <li>New {@link android.speech.tts android.speech.tts} package provides
-classes for synthesizing speech from text, for immediate playback or to create a
-sound file.</li>
- </ul>
-
-<h3>Graphics</h3>
- <ul>
- <li>Classes in {@link android.graphics android.graphics} now support scaling
-for different screen densities.</li>
- </ul>
-
-<h3>Telephony</h3>
- <ul>
- <li>New {@link android.telephony.SmsManager SmsManager} and other classes
-for sending and receiving SMS messages.</li>
- </ul>
-
-<h3>Utilities</h3>
- <ul>
- <li>New {@link android.util.DisplayMetrics DisplayMetrics} fields for
-determining the density of the current device screen.</li>
- </ul>
-
-<h3 id="AndroidManifest">Android Manifest elements</h3>
-
- <ul>
- <li>New <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
- <supports-screens>}</a> element lets you specify the device screen sizes that your
- application is designed and tested to support, where "size" is a combination
- of resolution and density. If your application is run on a device whose screen
- size is not specified in the <code><supports-screen></code> element, the system
- displays the application in <em>compatibility mode</em>, which performs best-effort scaling
- of the application UI to match the resolution and density of the screen.
-
- <p>The attributes available for defining an application's screen support are:
-
- <ul>
-
- <li><code>smallScreen</code>: Boolean value that indicates whether the
- application is designed to run on devices with small screens.
- Examples: QVGA low density; VGA high density.
- </li>
- <li><code>normalScreens</code>: Boolean value that indicates whether
- the application is designed to run on devices with normal screens.
- Examples: WQVGA low density; HVGA medium density; WVGA high density.
- </li>
- <li><code>largeScreens</code>: Boolean value that indicates whether
- the application is designed to run on devices with significantly
- larger screens, such that special care may be required on
- the application's part to make proper use of the screen area.
- Examples: VGA medium density; WVGA medium density.
- </li>
- <li><code>anyDensity</code>: Boolean value that indicates whether
- the application can accommodate any screen density.
- </li>
- <li><code>resizable</code>: Boolean value that indicates whether
- the application can expand its layout to fit slightly larger screens.
- </li>
- </ul>
- </p>
- </li>
-
- <li>New <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
- element lets an application specify hardware (or other)
- features that it requires to function normally. When an application
- specifies such features, the system allows the application to be installed only
- on devices that offer the required features. The element supports these
- attributes:
- <ul>
- <li><code>name</code>: The name of the feature required by the application. Currently accepts
- "android.hardware.camera" and "android.hardware.camera.autofocus" values, which specify that a
- camera and camera autofocus are required, respectively.</li>
- <li><code>glEsVersion</code>: Indicates the minimum version of OpenGL ES required.</li>
- </ul>
- </li>
- <li>New attributes for the
- <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element:
- <ul>
- <li><code>targetSdkVersion</code>: Indicates the API Level that the application is targeting.
- It is able to run on older versions (down to minSdkVersion), but was explicitly tested to
- work with the version specified here. Specifying this version allows the platform to
- disable compatibility code that is not required or enable newer features that are not
- available to older applications. </li>
- <li><code>maxSdkVersion</code>: Indicates the maximum API Level on which an application is
- designed to run. <strong>Important:</strong> Please read the <a
- href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
- documentation before using this attribute. </li>
- </ul>
- </li>
-
- </li>
- </ul>
-
-<h3>New permissions</h3>
-
- <ul>
- <li>{@link android.Manifest.permission#CHANGE_WIFI_MULTICAST_STATE
- CHANGE_WIFI_MULTICAST_STATE}: Allows applications to enter Wi-Fi
- Multicast mode.
- </li>
- <li>{@link android.Manifest.permission#GLOBAL_SEARCH}: Allows the
- global search system to access the data of a specified content provider.
- </li>
- <li>{@link android.Manifest.permission#INSTALL_LOCATION_PROVIDER INSTALL_LOCATION_PROVIDER}:
- Allows an application to install a location provider into the Location Manager.
- </li>
- <li>{@link android.Manifest.permission#READ_HISTORY_BOOKMARKS READ_HISTORY_BOOKMARKS}:
- Allows an application to read (but not write) the user's browsing history
- and bookmarks.
- </li>
- <li>{@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS WRITE_HISTORY_BOOKMARKS}:
- Allows an application to write (but not read) the user's browsing history
- and bookmarks.
- </li>
- <li>{@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE WRITE_EXTERNAL_STORAGE}:
- Allows an application to write to external storage. Applications using API Level 3
- and lower will be implicitly granted this permission (and this will be visible to
- the user); Applications using API Level 4 or higher must explicitly request this
- permission.
- </li>
- </ul>
-
-
-<h3 id="api-diff">API differences report</h3>
-
-<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
-the previous version, see the <a href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report</a>.</p>
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
- <ul>
- <li>Alarm Clock</li>
- <li>Browser</li>
- <li>Calculator</li>
- <li>Camcorder</li>
- <li>Camera</li>
- <li>Contacts</li>
- <li>Custom Locale (developer app)</li>
- <li>Dev Tools (developer app)</li>
- <li>Dialer</li>
- </ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
- <ul>
- <li>Email</li>
- <li>Gallery</li>
- <li>Gestures Builder</li>
- <li>IME for Japanese text input</li>
- <li>Messaging</li>
- <li>Music</li>
- <li>Settings</li>
- <li>Spare Parts (developer app)</li>
- </ul>
-</td>
-</tr>
-</table>
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable platform provides a variety of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em>
-locale descriptor).</p>
-
-<table style="border:0;margin-bottom:0;padding-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-<li>Czech (cs_CZ)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>English, US (en_US)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>French, France (fr_FR)</li>
-<li>French, Belgium (fr_BE)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Polish (pl_PL)</li>
-<li>Russian (ru_RU)</li>
-<li>Spanish (es_ES)</li>
-</td>
-</tr>
-</table>
-
-<p>Localized UI strings match the locales that are accessible
-through Settings.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes a set of emulator skins that you can
-use for modeling your application in different screen sizes and resolutions.
-The emulator skins are: </p>
-
-<ul>
- <li>
- QVGA (240x320, low density, small screen)
- </li>
- <li>
- HVGA (320x480, medium density, normal screen)
- </li>
- <li>
- WVGA800 (480x800, high density, normal screen)
- </li>
- <li>
- WVGA854 (480x854 high density, normal screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays and functions properly on all Android-powered devices, see <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
diff --git a/docs/html/sdk/android-2.0-highlights.jd b/docs/html/sdk/android-2.0-highlights.jd
deleted file mode 100644
index d4d13fc..0000000
--- a/docs/html/sdk/android-2.0-highlights.jd
+++ /dev/null
@@ -1,201 +0,0 @@
-page.title=Android 2.0 Platform Highlights
-sdk.date=October 2009
-
-@jd:body
-
-
-<style type="text/css">
-#jd-content div.screenshot,
-#jd-content div.video {
- float:right;
- clear:right;
- padding:15px 60px;
- font-size:.9em;
- font-weight:bold;
- line-height:1.7em;
-}
-#jd-content div.video {
- padding-top:0;
- margin-top:-15px;
-}
-#jd-content div.screenshot.second {
- clear:none;
- padding:15px 0 15px 60px;
-}
-#jd-content div.screenshot img {
- margin:0;
- border:1px solid #ccc;
-}
-</style>
-
-<div class="video">
-<object width="278 height="180">
-<param name="movie" value="http://www.youtube.com/v/opZ69P-0Jbc&hl=en&fs=1&"></param>
-<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
-<embed src="http://www.youtube.com/v/opZ69P-0Jbc&hl=en&fs=1&" type="application/x-shockwave-flash"
-allowscriptaccess="always" allowfullscreen="true" width="278" height="180"></embed>
-</object>
-</div>
-
-
-<p>The Android 2.0 platform introduces many new and exciting features for
-users and developers. This document provides a glimpse at some of the new features
-and technologies in Android 2.0.</p>
-
-<ul>
- <li><a href="#UserFeatures">New User Features</a></li>
- <li><a href="#PlatformTechnologies">New Platform Technologies</a></li>
-</ul>
-
-
-
-<h2 id="UserFeatures" style="clear:right">New User Features</h2>
-
-<!-- screenshots float right -->
-
-<div class="screenshot">
- <img src="images/2.0/quick-connect.png" class="screenshot" alt="" /><br/>
- Quick Contact for Android
-</div>
-
-<div class="screenshot second">
- <img src="images/2.0/multiple-accounts.png" class="screenshot" alt="" /><br/>
- Multiple Accounts
-</div>
-
-<div class="screenshot">
- <img src="images/2.0/mms-search.png" class="screenshot" alt="" /><br/>
- Messaging Search
-</div>
-
-<div class="screenshot second">
- <img src="images/2.0/email-inbox.png" class="screenshot" alt="" /><br/>
- Email Combined Inbox
-</div>
-
-<div class="screenshot">
- <img src="images/2.0/camera-modes.png" class="screenshot" alt="" /><br/>
- Camera Modes
-</div>
-
-
-
-<h3 id="Contacts">Contacts and accounts</h3>
-
-<ul>
- <li>Multiple accounts can be added to a device for email and contact
-synchronization, including Exchange accounts. (Handset manufacturers can
-choose whether to include Exchange support in their devices.)</li>
- <li>Developers can create sync adapters that provide synchronization with
-additional data sources.</li>
- <li>Quick Contact for Android provides instant access to
-a contact's information and communication modes. For example, a user can tap a
-contact photo and select to call, SMS, or email the person. Other applications
-such as Email, Messaging, and Calendar can also reveal the Quick Contact widget
-when you touch a contact photo or status icon.</li>
-</ul>
-
-
-<!--
-<ul>
- <li>Sync support for contacts from multiple data sources including Exchange.
- Handset manufacturers can choose whether or not to include Exchange support
- in their devices.</li>
- <li>New way to hover on a person to see more info and select communication
- mode (for example, phone, SMS, email).</li>
-</ul>
--->
-
-<h3 id="Email">Email</h3>
-
-<ul>
- <li>Exchange support.</li>
- <li>Combined inbox to browse email from multiple accounts in one page.</li>
-</ul>
-
-
-<h3 id="Messaging">Messaging</h3>
-
-<ul>
- <li>Search functionality for all saved SMS and MMS messages.</li>
- <li>Auto delete the oldest messages
- in a conversation when a defined limit is reached.</li>
-</ul>
-
-
-<h3 id="Camera">Camera</h3>
-
-<ul>
- <li>Built-in flash support</li>
- <li>Digital zoom</li>
- <li>Scene mode</li>
- <li>White balance</li>
- <li>Color effect</li>
- <li>Macro focus</li>
-</ul>
-
-<h3 id="Keyboard">Android virtual keyboard</h3>
-
-<ul>
- <li>An improved keyboard layout to makes it easier to hit the correct characters
- and improve typing speed.</li>
- <li>The framework's multi-touch support ensures that key presses aren't missed
- while typing rapidly with two fingers.</li>
- <li>A smarter dictionary learns from word usage and automatically includes
- contact names as suggestions.</li>
-</ul>
-
-
-<h3 id="Browser">Browser</h3>
-
-<ul>
- <li>Refreshed UI with actionable browser URL bar enables users to directly
- tap the address bar for instant searches and navigation.</li>
- <li>Bookmarks with web page thumbnails.</li>
- <li>Support for double-tap zoom.</li>
- <li>Support for HTML5:</p>
- <ul>
- <li>Database API support, for client-side databases using SQL.</li>
- <li>Application cache support, for offline applications.</li>
- <li>Geolocation API support, to provide location information about the device.</li>
- <li>{@code <video>} tag support in fullscreen mode.</li>
- </ul>
- </li>
-</ul>
-
-
-<h3 id="Calendar">Calendar</h3>
-<ul>
- <li>Agenda view provides infinite scrolling.</li>
- <li>Events indicate the attending status for each invitee.</li>
- <li>Invite new guests to events.</li>
-</ul>
-
-
-<h2 id="PlatformTechnologies" style="clear:right">New Platform Technologies</h2>
-
-<h3 id="MediaFramework">Media Framework</h3>
-
-<p>Revamped graphics architecture for improved performance that enables better
-hardware acceleration.</p>
-
-
-<h3 id="Bluetooth">Bluetooth</h3>
-
-<ul>
- <li>Bluetooth 2.1</li>
- <li>New BT profiles: Object Push Profile (OPP) and Phone Book Access Profile (PBAP)</li>
-</ul>
-
-
-<h3 id="DeveloperAPIs">New Framework APIs</h3>
-
-<p>Android 2.0 includes several new developer APIs.
-For an overview of new APIs, see the
-<a href="{@docRoot}sdk/android-2.0.html#api">Android 2.0 version notes</a>.</p>
-
-<p>For a complete report of all API changes, see the
-<a href="{@docRoot}sdk/api_diff/5/changes.html">API Differences Report</a>.</p>
-
-
-
diff --git a/docs/html/sdk/android-2.0.1.jd b/docs/html/sdk/android-2.0.1.jd
deleted file mode 100644
index 0c8afb6..0000000
--- a/docs/html/sdk/android-2.0.1.jd
+++ /dev/null
@@ -1,361 +0,0 @@
-page.title=Android 2.0.1, Release 1
-sdk.platform.version=2.0.1
-sdk.platform.apiLevel=6
-sdk.platform.majorMinor=minor
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#features">Platform Highlights</a></li>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
- <li><a href="#dev-features">Developer Features</a></li>
- <li><a href="#api">Framework API</a>
- <ol>
- <li><a href="#api-level">API level</a></li>
- <li><a href="#api-changes">API changes summary</a></li>
- <li><a href="#behavior-changes">Behavior changes</a></li>
- <li><a href="#bug-fixes">Bug fixes</a></li>
- <li><a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-differences report »</a> </li>
- </ol>
- </li>
- </ol>
-
- <h2>See Also</h2>
- <ol>
- <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
- </ol>
-
-</div>
-</div>
-
-<p>
-
-<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release
-deployable to Android-powered handsets starting in December 2009.
-This release includes minor API
-changes, bug fixes and framework behavioral changes. For information on changes
-and fixes, see the <a href="#api">Framework API</a> section.</p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK. The downloadable platform includes a
-fully compliant Android library and system image, as well as a set of emulator
-skins, sample applications, and more. The downloadable platform
-includes no external libraries. </p>
-
-<p>To get started developing or testing against the Android
-{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
-download the platform into your Android 1.6 or later SDK. For more information,
-see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>.</p>
-
-
-<h2 id="features">Platform Highlights</h2>
-
-<p>For a list of new user features and platform highlights, see the <a
-href="http://developer.android.com/sdk/android-2.0-highlights.html">Android
-2.0 Platform Highlights</a> document.</p>
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
-revision number. To determine what revision(s) of the Android
-{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
-the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
-padding: .25em 1em;
-}
-.toggleme {
- padding: 1em 1em 0 2em;
- line-height:1em;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleable.closed .toggleme {
- display:none;
-}
-#jd-content .toggle-img {
- margin:0;
-}
-</style>
-
-<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" />
- Android 2.0.1, Revision 1</a> <em>(December 2009)</em></a>
- <div class="toggleme">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r4 or higher.</p>
-</dd>
-</dl>
- </div>
-</div>
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
- <ul>
- <li>Alarm Clock</li>
- <li>Browser</li>
- <li>Calculator</li>
- <li>Camcorder</li>
- <li>Camera</li>
- <li>Contacts</li>
- <li>Custom Locale (developer app)</li>
- <li>Dev Tools (developer app)</li>
- <li>Dialer</li>
- </ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
- <ul>
- <li>Email</li>
- <li>Gallery</li>
- <li>Gestures Builder</li>
- <li>IME for Japanese text input</li>
- <li>Messaging</li>
- <li>Music</li>
- <li>Settings</li>
- <li>Spare Parts (developer app)</li>
- </ul>
-</td>
-</tr>
-</table>
-
-<p><span class="new">New with 2.0.1</span> The Dev Tools app now
-includes a "Sync Tester" application to provide quick and easy testing of
-third-party sync adapters.</p>
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable platform provides a variety of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
-descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-<li>Czech (cs_CZ)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>English, US (en_US)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>French, France (fr_FR)</li>
-<li>French, Belgium (fr_BE)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Polish (pl_PL)</li>
-<li>Russian (ru_RU)</li>
-<li>Spanish (es_ES)</li>
-</td>
-</tr>
-</table>
-
-<p>Localized UI strings match the locales that are accessible
-through Settings.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes a set of emulator skins that you can use for modeling your application in different screen sizes and resolutions. The emulator skins are: </p>
-
-<ul>
- <li>
- QVGA (240x320, low density, small screen)
- </li>
- <li>
- WQVGA (240x400, low density, normal screen)
- </li>
- <li>
- FWQVGA (240x432, low density, normal screen)
- </li>
- <li>
- HVGA (320x480, medium density, normal screen)
- </li>
- <li>
- WVGA800 (480x800, high density, normal screen)
- </li>
- <li>
- WVGA854 (480x854 high density, normal screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays and functions properly on all Android-powered devices, see <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
-
-<h2 id="dev-features">Developer Features</h2>
-
-<p>The sections below provide information about new developer features offered by the downloadable Android 2.0 platform component.</p>
-
-<h3 id="ant">Ant Support</h3>
-
-<ul>
-<li>Debug- and release-mode application signing. Release-mode signing includes integrated support for <code>zipalign</code> optimization. For more information, see <a href="{@docRoot}guide/publishing/app-signing.html#releasecompile">Signing Your Applications</a>.</li>
-
-<li>Adds new Ant build system with support for Emma instrumentation projects (code coverage).</li>
-</ul>
-
-<h2 id="api">Framework API</h2>
-
-<p>The sections below provide information about changes made to the application
-framework API provided by the Android {@sdkPlatformVersion} platform. Note,
-however, that Android 2.0.1 is a minor release to Android 2.0, so for more
-information about the changes made to in Android 2.0, please refer to the
-<a href="{@docRoot}sdk/android-2.0.html#api">Android 2.0 version notes</a>.</p>
-
-
-<h3 id="api-level">API level</h3>
-
-<p>The Android {@sdkPlatformVersion} platform delivers an updated version of the framework
-API. The Android {@sdkPlatformVersion} API
-is assigned an integer identifier — <strong>{@sdkPlatformApiLevel}</strong> — that is
-stored in the system itself. This identifier, called the "API Level", allows the
-system to correctly determine whether an application is compatible with
-the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need to
-set the proper value, "{@sdkPlatformApiLevel}", in the attributes of the <code><uses-sdk></code>
-element in your application's manifest. </p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-
-<h3 id="api-changes">API changes summary</h3>
-
-<p>The following is a summary of changes to the framework APIs.</p>
-
-<ul>
-<li>New {@code quickContactBadgeStyle*} attributes that let
-applications apply necessary styles to the {@link
-android.widget.QuickContactBadge} widget.</li>
-
-<li>Remove support for the {@link
-android.content.Intent#ACTION_CONFIGURATION_CHANGED} broadcast when declared as
-a filter in the manifest. To receive this broadcast, an application must
-do so from the application at run-time, with {@link
-android.content.Context#registerReceiver(BroadcastReceiver, IntentFilter)}.</li>
-</ul>
-
-<h3 id="behavior-changes">Behavior changes</h3>
-
-<p>The following is a summary of changes that affect the behavior of some
-framework APIs but do not add or remove API functionality.</p>
-
-<h4>Bluetooth</h4>
-
-<p>Changes to the values returned by {@link
-android.bluetooth.BluetoothAdapter#ACTION_REQUEST_ENABLE} and
-{@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_DISCOVERABLE}:</p>
-
-<ul>
-<li>{@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_ENABLE} now
-returns {@link android.app.Activity#RESULT_OK} if Bluetooth was successfully
-enabled and {@link android.app.Activity#RESULT_CANCELED} if the user rejected
-the request to enable Bluetooth, rather than 0 and -1 (or -2),
-respectively.</li>
-
-<li>{@link android.bluetooth.BluetoothAdapter#ACTION_REQUEST_DISCOVERABLE}
-now returns {@link android.app.Activity#RESULT_CANCELED} if the user rejected
-the request to enable discoverability or if Bluetooth is not enabled, rather
-than -1 and -2, respectively.</li>
-</ul>
-
-<h4>Contacts</h4>
-
-<p>The {@link android.content.Intent#ACTION_INSERT} Intent now returns {@link
-android.app.Activity#RESULT_CANCELED} in cases where the contact was not
-persisted (for example, if the save was trimmed to a no-op).</p>
-
-
-<h3 id="bug-fixes">Bug fixes</h3>
-
-<p>The following is a summary of bug fixes that affect some framework APIs.</p>
-
-<h4>Resources</h4>
-
-<p>The framework now correctly selects application resources in project
-folders that use the API Level qualifier. For example, {@code drawable-v4/} is a
-folder of drawable resources for API Level 4 (or higher) devices. This version
-matching did not work properly and has been fixed.</p>
-
-<h4>Contacts</h4>
-
-<p>The {@link android.content.Intent#ACTION_INSERT} Intent now returns the
-appropriate kind of URI when the request is made using the (now
-deprecated) {@link android.provider.Contacts} APIs.</p>
-
-<h4>Other Framework fixes</h4>
-
-<ul>
-<li>{@link android.app.Activity#getCallingPackage()} now properly reports the
-package name, rather than the process name.</li>
-</ul>
-
-
-<h3 id="api-diff">API differences report</h3>
-
-<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
-API Level 5, see the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report</a>. There are very few API changes in API Level 6,
-so you might also be interested in reviewing the <a
-href="{@docRoot}sdk/api_diff/5/changes.html">API
-differences between 4 and 5</a>.</p>
-
diff --git a/docs/html/sdk/android-2.0.jd b/docs/html/sdk/android-2.0.jd
deleted file mode 100644
index 2c31923..0000000
--- a/docs/html/sdk/android-2.0.jd
+++ /dev/null
@@ -1,384 +0,0 @@
-page.title=Android 2.0, Release 1
-sdk.platform.version=2.0
-sdk.platform.apiLevel=5
-sdk.platform.majorMinor=major
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#features">Platform Highlights</a></li>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
- <li><a href="#dev-features">Developer Features</a></li>
- <li><a href="#api">Framework API</a>
- <ol>
- <li><a href="#api-level">API level</a></li>
- <li><a href="#api-changes">API changes summary</a></li>
- <li><a href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API differences report »</a> </li>
- </ol></li>
- </ol>
-
- <h2>See Also</h2>
- <ol>
- <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
- </ol>
-
-</div>
-</div>
-
-<p>
-<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release
-deployable to Android-powered handsets starting in November 2009.
-The release includes new features for users and developers, as well as changes
-in the Android framework API. </p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK. The downloadable platform includes a
-fully compliant Android library and system image, as well as a set of emulator
-skins, sample applications, and more. The downloadable platform is fully
-compliant and includes no external libraries. </p>
-
-<p>To get started developing or testing against the Android
-{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
-download the platform into your SDK. For more information,
-see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>.</p>
-
-
-<h2 id="features">Platform Highlights</h2>
-
-<p>For a list of new user features and platform highlights, see the <a
-href="http://developer.android.com/sdk/android-{@sdkPlatformVersion}-highlights.html">Android
-{@sdkPlatformVersion} Platform Highlights</a> document.</p>
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
-revision number. To determine what revision(s) of the Android
-{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
-the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
-padding: .25em 1em;
-}
-.toggleme {
- padding: 1em 1em 0 2em;
- line-height:1em;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleable.closed .toggleme {
- display:none;
-}
-#jd-content .toggle-img {
- margin:0;
-}
-</style>
-
-<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" />
- Android 2.0, Revision 1</a> <em>(October 2009)</em></a>
- <div class="toggleme">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r3 or higher.</p>
-</dd>
-</dl>
- </div>
-</div>
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
- <ul>
- <li>Alarm Clock</li>
- <li>Browser</li>
- <li>Calculator</li>
- <li>Camcorder</li>
- <li>Camera</li>
- <li>Contacts</li>
- <li>Custom Locale (developer app)</li>
- <li>Dev Tools (developer app)</li>
- <li>Dialer</li>
- </ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
- <ul>
- <li>Email</li>
- <li>Gallery</li>
- <li>Gestures Builder</li>
- <li>IME for Japanese text input</li>
- <li>Messaging</li>
- <li>Music</li>
- <li>Settings</li>
- <li>Spare Parts (developer app)</li>
- </ul>
-</td>
-</tr>
-</table>
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable platform provides a variety of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
-descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-<li>Czech (cs_CZ)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>English, US (en_US)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>French, France (fr_FR)</li>
-<li>French, Belgium (fr_BE)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Polish (pl_PL)</li>
-<li>Russian (ru_RU)</li>
-<li>Spanish (es_ES)</li>
-</td>
-</tr>
-</table>
-
-<p>Localized UI strings match the locales that are accessible
-through Settings.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes a set of emulator skins that you can use for modeling your application in different screen sizes and resolutions. The emulator skins are: </p>
-
-<ul>
- <li>
- QVGA (240x320, low density, small screen)
- </li>
- <li>
- WQVGA (240x400, low density, normal screen)
- </li>
- <li>
- FWQVGA (240x432, low density, normal screen)
- </li>
- <li>
- HVGA (320x480, medium density, normal screen)
- </li>
- <li>
- WVGA800 (480x800, high density, normal screen)
- </li>
- <li>
- WVGA854 (480x854 high density, normal screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays and functions properly on all Android-powered devices, see <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
-
-<h2 id="dev-features">Developer Features</h2>
-
-<p>The sections below provide information about new developer features offered by the downloadable Android 2.0 platform component.</p>
-
-<h3 id="ant">Ant Support</h3>
-
-<ul>
-<li>Debug- and release-mode application signing. Release-mode signing includes integrated support for <code>zipalign</code> optimization. For more information, see <a href="{@docRoot}guide/publishing/app-signing.html#releasecompile">Signing Your Applications</a>.</li>
-
-<li>Adds new Ant build system with support for Emma instrumentation projects (code coverage).</li>
-</ul>
-
-<h2 id="api">Framework API</h2>
-
-<p>The sections below provide information about the application framework API provided by the Android {@sdkPlatformVersion} platform. </p>
-
-
-<h3 id="api-level">API level</h3>
-
-<p>The Android {@sdkPlatformVersion} platform delivers an updated version of the framework
-API. As with previous versions, the Android {@sdkPlatformVersion} API
-is assigned an integer identifier — <strong>{@sdkPlatformApiLevel}</strong> — that is
-stored in the system itself. This identifier, called the "API Level", allows the
-system to correctly determine whether an application is compatible with
-the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need to
-set the proper value, "{@sdkPlatformApiLevel}", in the attributes of the <code><uses-sdk></code>
-element in your application's manifest. </p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-
-<h3 id="api-changes">API changes summary</h3>
-
-<h4>Bluetooth</h4>
-<ul>
-<li>Turn on/off Bluetooth</li>
-<li>Device and service discovery</li>
-<li>Connect to a remote device using RFCOMM and send/receive data</li>
-<li>Advertise RFCOMM services and listen for incoming RFCOMM connection</li>
-</ul>
-
-<h4>Sync adapters </h4>
-<ul>
-<li>New APIs for sync adapters to connect to any backend</li>
-</ul>
-
-<h4>Account Manager</h4>
-<ul>
-<li>Centralized account manager API to securely store and access auth tokens/passwords </li>
-</ul>
-
-<h4>Contacts</h4>
-<ul>
-<li>New contacts APIs that allow for data from multiple accounts</li>
-<li>New Quick Contact framework APIs enable developers to create contact badges in their app. Clicking on the badge opens a window with a list of ways to contact the person with one click.</li>
-</ul>
-
-<h4>WebView</h4>
-<ul>
-<li>Deprecated classes: UrlInterceptHandler, Plugin, PluginData, PluginList, UrlInterceptRegistry.</li>
-</ul>
-
-<h4>Camera</h4>
-<ul>
-<li>New parameters for color effect, scene mode, flash mode, focus mode, white balance, rotation, and other settings.</li>
-<li>New ZoomCallback interface to perform actions when the zoom level has changed.</li>
-</ul>
-
-<h4>Media</h4>
-<ul>
-<li>MediaScanner now generates thumbnails for all images when they are inserted into MediaStore.</li>
-<li>New Thumbnail API for retrieving image and video thumbnails on demand.</li>
-</ul>
-
-<h4>Other Framework</h4>
-<ul>
-<li>New system themes in android.R.style to easily display activities on top of the current system wallpaper or keep the previous activity visible in the background. </li>
-<li>New WallpaperManager API replaces and extends the wallpaper APIs that were previously in Context, to allow applications to request and set the system wallpaper.</li>
-<li>New Service APIs to help applications correctly handle Service life-cycle, in particular low memory situations where a Service may be killed while it is running.
- <ul>
- <li>Service.setForeground() has been deprecated and now effectively performs no operation. This is replaced with a new API, startForeground(), that helps (and requires) associating an ongoing notification with the foreground state.</li>
- </ul>
-</li>
-<li>MotionEvent can now report simultaneous-touch information for devices that support it. Up to three pointers can be tracked simultaneously. </li>
-<li>KeyEvent has new key dispatching APIs, to help implement action-on-up and long press behavior, as well a new mechanism to cancel key presses (for virtual keys).</li>
-<li>WindowManager.LayoutParams has new constants that allow a window to wake up the screen when it is displayed and show the window even if the screen is locked. This allows applications to more cleanly implement things like alarm clocks that should wake the device.</li>
-<li>New Intent APIs that broadcast the docking state of the device and allow applications to launch special activities when the device is placed in a desktop or car dock.</li>
-</ul>
-
-<h4>Key events executed on key-up</h4>
-
-<p>Android 2.0 is designed to run on devices that use virtual keys for HOME,
-MENU, BACK, and SEARCH, rather than physical keys. To support the best user
-experience on those devices, the Android platform now executes these buttons at
-key-up, for a key-down/key-up pair, rather than key-down. This helps prevent
-accidental button events and lets the user press the button area and then drag
-out of it without generating an event. </p>
-
-<p>This change in behavior should only affect your application if it is
-intercepting button events and taking an action on key-down, rather than on
-key-up. Especially if your application is intercepting the BACK key, you should
-make sure that your application is handling the key events properly. </p>
-
-<p>In general, intercepting the BACK key in an application is not recommended,
-however, if your application is doing so and it invokes some action on
-key-down, rather than key-up, you should modify your code. </p>
-
-<p>If your application will use APIs introduced in Android 2.0 (API Level 5),
-you can take advantage of new APIs for managing key-event pairs:</p>
-
-<ul>
-<li>If you are intercepting the BACK key in an activity or dialog, just
-implement the new {@link android.app.Activity#onBackPressed()} method. </li>
-<li>If you are intercepting the BACK key in a view, you should track the key
-event on key-down (through the new {@link android.view.KeyEvent#startTracking}
-method), then invoke the action at key up. Here's a pattern you can use:</li>
-
-<pre> public boolean onKeyDown(int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK
- && event.getRepeatCount() == 0) {
- event.startTracking();
- return true;
- }
- return super.onKeyDown(keyCode, event);
- }
-
- public boolean onKeyUp(int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK && event.isTracking()
- && !event.isCanceled()) {
- // *** DO ACTION HERE ***
- return true;
- }
- return super.onKeyUp(keyCode, event);
- }</pre>
-
-</ul>
-
-<p>If you want to update a legacy application so that its handling of the BACK
-key works properly for both Android 2.0 and older platform versions, you
-can use an approach similar to that shown above. Your code can catch the
-target button event on key-down, set a flag to track the key event, and
-then also catch the event on key-up, executing the desired action if the tracking
-flag is set. You'll also want to watch for focus changes and clear the tracking
-flag when gaining/losing focus.</p>
-
-<h3 id="api-diff">API differences report</h3>
-
-<p>For a detailed view of API changes in Android {@sdkPlatformVersion} (API Level {@sdkPlatformApiLevel}), as compared to
-the previous version, see the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API Differences Report</a>.</p>
-
diff --git a/docs/html/sdk/android-2.1.jd b/docs/html/sdk/android-2.1.jd
deleted file mode 100644
index 1ee833c..0000000
--- a/docs/html/sdk/android-2.1.jd
+++ /dev/null
@@ -1,373 +0,0 @@
-page.title=Android 2.1 Platform
-sdk.platform.version=2.1
-sdk.platform.apiLevel=7
-sdk.platform.majorMinor=minor
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#features">Platform Highlights</a></li>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#api">Framework API Changes</a>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-
- </ol>
- </li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-<h2>See Also</h2>
-<ol>
- <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>
-<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release
-deployable to Android-powered handsets starting in January 2010.
-This release includes new API
-changes and bug fixes. For information on changes, see the <a href="#api">Framework API</a>
-section.</p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK. The downloadable platform includes a
-fully compliant Android library and system image, as well as a set of emulator
-skins, sample applications, and more. The downloadable platform
-includes no external libraries. </p>
-
-<p>To get started developing or testing against the Android
-{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
-download the platform into your SDK. For more information,
-see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>.</p>
-
-
-<h2 id="features">Platform Highlights</h2>
-
-<p>Android {@sdkPlatformVersion} does not add significant user features, see the <a
-href="http://developer.android.com/sdk/android-2.0-highlights.html">Android
-2.0 Platform Highlights</a> document for the latest user features.</p>
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
-revision number. To determine what revision(s) of the Android
-{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
-the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
-
-<div class="toggle-content opened" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 3</a> <em>(July 2011)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r12</a> or
-higher.</p>
-</dd>
-<dt>Notes:</dt>
-<dd>
-<p>Improvements to the platform's rendering library to support the visual layout editor in the ADT
-Eclipse plugin. This revision allows for more drawing features in ADT and fixes several
-bugs in the previous rendering library. It also unlocks several editor features that were added in
-ADT 12.</p>
-</dd>
-</dl>
-
-</div>
-</div>
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 2</a> <em>(May 2010)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r6 or higher.</p>
-</dd>
-
-<dt>Tools:</dt>
-<dd>
-<ul>
-<li>Adds support for library projects in the Ant build system.</li>
-<li>Adds improved layout rendering in ADT’s visual layout editor.</li>
-</ul>
-</dd>
-
-</dl>
- </div>
-</div>
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 1</a> <em>(January 2010)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r4 or higher.</p>
-</dd>
-</dl>
- </div>
-</div>
-
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
-the framework API. The Android {@sdkPlatformVersion} API
-is assigned an integer identifier —
-<strong>{@sdkPlatformApiLevel}</strong> — that is
-stored in the system itself. This identifier, called the "API Level", allows the
-system to correctly determine whether an application is compatible with
-the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your
-application, you need to set the proper value, "{@sdkPlatformApiLevel}", in the
-<code>android:minSdkVersion</code> attributes of the <code><uses-sdk></code>
-element in your application's manifest. </p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-
-<h2 id="api">Framework API Changes</h2>
-
-<p>The sections below provide information about changes made to the application
-framework API provided by the Android {@sdkPlatformVersion} platform.</p>
-
-<h3>Live Wallpapers</h3>
-
-<p>The following additions provide APIs for you to develop animated wallpapers:</p>
-<ul>
-<li>New {@link android.service.wallpaper} package.</li>
-<li>New {@link android.app.WallpaperInfo} class.</li>
-<li>Updated {@link android.app.WallpaperManager}.</li>
-</ul>
-
-<p>Additionally, if your application uses or provides Live Wallpapers, you must
-remember to add a <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></code></a>
- element to the application's manifest, declaring the attribute
-<code>android:name="android.software.live_wallpaper"</code>. For example:</p>
-
-<pre class="no-pretty-print">
-<uses-feature android:name="android.software.live_wallpaper" />
-</pre>
-
-<p>When you've published your application, Google Play checks for the
-presence of this element and uses it as a filter, ensuring that your application
-is not made available to users whose devices do not support Live Wallpapers.
-</p>
-
-<h3>Telephony</h3>
-
-<ul>
-<li>New {@link android.telephony.SignalStrength} class provides information
-about the device's current network signal. This can be acquired from the
-new {@link
-android.telephony.PhoneStateListener#onSignalStrengthsChanged(SignalStrength)}
-callback.</li>
-
-<li>New {@link
-android.telephony.PhoneStateListener#onDataConnectionStateChanged(int,int)}
-callback.</li>
-</ul>
-
-<h3>Views</h3>
-
-<ul>
-<li>New {@link android.view.View} methods {@link android.view.View#isOpaque()}
-and {@link android.view.View#onDrawScrollBars(Canvas)}.</li>
-
-<li>New {@link android.widget.RemoteViews} methods {@link
-android.widget.RemoteViews#addView(int,RemoteViews)} and {@link
-android.widget.RemoteViews#removeAllViews(int)}.</li>
-
-<li>New {@link android.view.ViewGroup} methods {@link
-android.view.ViewGroup#isChildrenDrawingOrderEnabled()} and {@link
-android.view.ViewGroup#setChildrenDrawingOrderEnabled(boolean)}.</li>
-</ul>
-
-<h3>WebKit</h3>
-
-<ul>
-<li>New {@link android.webkit.WebStorage} methods to manipulate web
-storage databases.</li>
-
-<li>New {@link android.webkit.GeolocationPermissions} methods to
-get Geolocation permissions from, and set them on the WebView.</li>
-
-<li>New {@link android.webkit.WebSettings} methods to manage settings for
-app cache, web storage, and zooming based on screen density.</li>
-
-<li>New {@link android.webkit.WebChromeClient} methods for handling video,
-browsing history, custom Views, app cache limits, and more.</li>
-</ul>
-
-</ul>
-
-<!--
-<h3 id="behavior-changes">Behavior changes</h3>
-
-<h3 id="bug-fixes">Bug fixes</h3>
--->
-
-<h3 id="api-diff">API differences report</h3>
-
-<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
-Level {@sdkPlatformApiLevel}), as compared to API Level 6, see the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report</a>.</p>
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
- <ul>
- <li>Alarm Clock</li>
- <li>Browser</li>
- <li>Calculator</li>
- <li>Camera</li>
- <li>Contacts</li>
- <li>Custom Locale (developer app)</li>
- <li>Dev Tools (developer app)</li>
- <li>Email</li>
- </ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
- <ul>
-
- <li>Gallery</li>
- <li>IMEs for Japanese, Chinese, and Latin text input</li>
- <li>Messaging</li>
- <li>Music</li>
- <li>Phone</li>
- <li>Settings</li>
- <li>Spare Parts (developer app)</li>
- </ul>
-</td>
-</tr>
-</table>
-
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable platform provides a variety of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
-descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-<li>Czech (cs_CZ)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>English, US (en_US)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>French, France (fr_FR)</li>
-<li>French, Belgium (fr_BE)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Polish (pl_PL)</li>
-<li>Russian (ru_RU)</li>
-<li>Spanish (es_ES)</li>
-</td>
-</tr>
-</table>
-
-<p>Localized UI strings match the locales that are accessible
-through Settings.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes a set of emulator skins that you can use
-for modeling your application in different screen sizes and resolutions. The
-emulator skins are:</p>
-
-<ul>
- <li>
- QVGA (240x320, low density, small screen)
- </li>
- <li>
- WQVGA (240x400, low density, normal screen)
- </li>
- <li>
- FWQVGA (240x432, low density, normal screen)
- </li>
- <li>
- HVGA (320x480, medium density, normal screen)
- </li>
- <li>
- WVGA800 (480x800, high density, normal screen)
- </li>
- <li>
- WVGA854 (480x854 high density, normal screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays
-and functions properly on all Android-powered devices, see <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
diff --git a/docs/html/sdk/android-2.2.jd b/docs/html/sdk/android-2.2.jd
deleted file mode 100644
index c22220c..0000000
--- a/docs/html/sdk/android-2.2.jd
+++ /dev/null
@@ -1,470 +0,0 @@
-page.title=Android 2.2 Platform
-sdk.platform.version=2.2
-sdk.platform.apiLevel=8
-sdk.platform.majorMinor=minor
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#features">Platform Highlights</a></li>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#api">Framework API Changes</a>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-
- </ol>
- </li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-<h2>See Also</h2>
-<ol>
- <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>
-<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release including user
-features, developer features, API changes, and bug
-fixes. For information on developer features and API changes, see the
-<a href="#api">Framework API</a> section.</p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK. The downloadable platform includes a
-fully compliant Android library and system image, as well as a set of emulator
-skins, sample applications, and more. The downloadable platform
-includes no external libraries. </p>
-
-<p>To get started developing or testing against the Android
-{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
-download the platform into your SDK. For more information,
-see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>. If you are new to Android, <a
-href="{@docRoot}sdk/index.html">download the SDK Starter Package</a>
-first.</p>
-
-
-<h2 id="features">Platform Highlights</h2>
-
-<p>For a list of new user features and platform highlights, see the <a
-href="http://developer.android.com/sdk/android-2.2-highlights.html">Android
-2.2 Platform Highlights</a> document.</p>
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
-revision number. To determine what revision(s) of the Android
-{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
-the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
-
-<div class="toggle-content opened" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 3</a> <em>(July 2011)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r12</a> or
-higher.</p>
-</dd>
-<dt>Notes:</dt>
-<dd>
-<p>Improvements to the platform's rendering library to support the visual layout editor in the ADT
-Eclipse plugin. This revision allows for more drawing features in ADT and fixes several
-bugs in the previous rendering library. It also unlocks several editor features that were added in
-ADT 12.</p>
-</dd>
-</dl>
-
-</div>
-</div>
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 2</a> <em>(July 2010)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r6 or higher.</p>
-</dd>
-
-<dt>System Image:</dt>
-<dd>
-<ul>
-<li>Adds default Search Widget.</li>
-<li>Includes proper provisioning for the platform's Backup Manager. For more information about how to use the Backup Manager, see <a href="{@docRoot}guide/topics/data/backup.html">Data Backup</a>.</li>
-<li>Updates the Android 2.2 system image to FRF91.</li>
-</ul>
-</dd>
-
-</dl>
- </div>
-</div>
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 1</a> <em>(May 2010)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r6 or higher.</p>
-</dd>
-
-<dt>Tools:</dt>
-<dd>
-<p>Adds support for building with Android library projects. See <a href="tools-notes.html">SDK Tools, r6</a> for information.</p>
-</dd>
-
-</dl>
- </div>
-</div>
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
-the framework API. The Android {@sdkPlatformVersion} API
-is assigned an integer identifier —
-<strong>{@sdkPlatformApiLevel}</strong> — that is
-stored in the system itself. This identifier, called the "API Level", allows the
-system to correctly determine whether an application is compatible with
-the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your
-application, you need to set the proper value, "{@sdkPlatformApiLevel}", in the
-<code>android:minSdkVersion</code> attributes of the <code><uses-sdk></code>
-element in your application's manifest. </p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-
-<h2 id="api">Framework API Changes</h2>
-
-<p>The sections below provide information about changes made to the application
-framework API provided by the Android {@sdkPlatformVersion} platform.</p>
-
-<h3 id="install-loc">App installation on external storage media</h3>
-
-<p>The Android platform now allows applications to request installation onto the
-device's external storage media (such as the SD card), as an alternative to
-installation onto the device's internal memory. </p>
-
-<p>Application developers can express the preferred installation location for
-their applications by means of a new attribute of <code><manifest></code>
-in the manifest file, <a
-href="{@docRoot}guide/topics/manifest/manifest-element.html#install"><code>
-android:installLocation</code></a>. The attribute supports three values:
-<code>"internalOnly"</code>, <code>"preferExternal"</code>, and
-<code>"auto"</code>. At install time, the system checks the value of
-<code>android:installLocation</code> and installs the application
-<code>.apk</code> according to the preferred location, if possible. If the
-application has requested external installation, the system installs it into a
-private, encrypted partition in the external media. Once an application .apk is
-installed externally, the system lets the user change the storage location of
-the .apk and move it onto the device's internal memory if needed (and vice
-versa), through Manage Applications in the user settings.</p>
-
-<p>By default, the system installs all applications onto the device's internal
-memory, except for those that explicitly request external installation. This
-means that the system will always install legacy applications onto internal
-memory, since they do not have access to the
-<code>android:installLocation</code> attribute. However, it is possible to
-configure and compile a legacy application such that it is installed internally
-on older versions of the platform and externally on Android 2.2 and later
-platforms, if necessary. </p>
-
-<p>Note that requesting installation onto the device's external media is not
-suitable for all applications, particularly because the external media may be
-removable and unmounting/remounting may disrupt the user experience and system
-settings.</p>
-
-<p>For more information about setting a preferred install location for your
-application, including a discussion of what types of applications should and
-should not request external installation, please read the <a
-href="{@docRoot}guide/appendix/install-location.html">App Install Location</a>
-document. </p>
-
-<h3 id="backup-manager">Data backup</h3>
-
-<p>The platform now provides a generalized backup service that
-applications can use to backup and restore user data, to ensure that users can
-maintain their data when switching devices or reinstalling the application. The
-Backup Manager handles the work of transporting the application data to and from
-the backup storage area in the cloud. The Backup Manager can store any type of
-data, from arbitrary data to files, and manages backup and restore operations
-in an atomic manner. For more information, see <a
-href="{@docRoot}guide/topics/data/backup.html">Data Backup</a>.</p>
-
-<h3>Graphics</h3>
-
-<ul>
-<li>New OpenGL ES 2.0 APIs in {@link android.opengl.GLES20 android.opengl.GLES20}.</li>
-<li>New {@link android.opengl.ETC1}, {@link android.opengl.ETC1Util}, and {@link android.opengl.ETC1Util.ETC1Texture} classes and utility methods for using ETC1 for texture compression.</li>
-<li>New {@link android.graphics.ImageFormat} class.</li>
-<li>New {@link android.graphics.YuvImage YUV image format API} to enable compression from YUV to JPEG and manipulation of YUV data.</li>
-</ul>
-
-<h3>Media</h3>
-
-<ul>
-<li>New APIs in {@link android.media.AudioManager android.media.AudioManager} for managing audio focus, transport control, transient loss of audio focus, ducking.</li>
-<li>New broadcast intent for routing audio to SCO — {@link android.media.AudioManager#ACTION_SCO_AUDIO_STATE_CHANGED} with extras indicating new state.</li>
-<li>New APIs in {@link android.media.SoundPool} to detect completion of sound-loading.</li>
-<li>New APIs in {@link android.media.SoundPool} for auto pause and resume.</li>
-<li>New APIs in {@link android.media.MediaRecorder} for specifying audio settings for number of channels, encoding and sampling rates, sampling rate.</li>
-<li>New APIs for adding files to the media database, so that they are automatically scanned. See {@link android.media.MediaScannerConnection#scanFile(Context, String[], String[], OnScanCompletedListener) MediaScannerConnection.scanFile} and {@link android.media.MediaScannerConnection.OnScanCompletedListener MediaScannerConnection.OnScanCompletedListener}.</li>
-</ul>
-
-<h3>Speech recognition and third-party recognition engines</h3>
-
-<ul>
-<li>The platform provides new speech-recognition APIs that allow applications to have a richer interaction with the available voice recognizer. For example, the APIs are sufficient to integrate voice recognition deeply into an IME.</li>
-<li>The platform also provides a {@link android.speech.RecognitionService} base class that lets third-party developers create plug-in recognition engines. </li>
-<li>New {@link android.speech.RecognitionListener} interface to receive callbacks.</li>
-<li>New {@link android.speech.RecognizerIntent} extras that let a requester app specify details as preferred language, minimum length in milliseconds, and so on.</li>
-</ul>
-
-<h3>Camera and camcorder</h3>
-
-<ul>
-<li>Changes to camera preview API to improve efficieny of preview pipeline. </li>
-<li>New display orientation for camera (it can now work in portrait orientation).</li>
-<li>New APIs in {@link android.hardware.Camera android.hardware.Camera} for managing zoom level.</li>
-<li>New APIs {@link android.hardware.Camera.Parameters android.hardware.Camera.Parameters} for querying and setting device camera settings such as focal length, exposure, zoom level, view angle, and others.</li>
-<li>New {@link android.media.ThumbnailUtils thumbnail} utility for video and image thumbnails.</li>
-<li>New {@link android.media.CamcorderProfile} and {@link android.media.CamcorderProfile} classes enable apps to determine device hardware camera capablities.</li>
-<li>New support in {@link android.media.ExifInterface android.media.ExifInterface} for retrieving GPS and focal length.</li>
-</ul>
-
-<h3>Device policy manager</h3>
-
-<p>New device policy management APIs allow developers to write "device
-administrator" applications that can control security features of the device,
-such as the minimum password strength, data wipe, and so on. Users can select
-the administrators that are enabled on their devices. For more information, see
-the {@link android.app.admin android.app.admin} classees or the example
-application code in <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html">DeviceAdminSample.java</a>.</p>
-
-<h3>UI Framework</h3>
-
-<ul>
-<li>New UI modes "car mode" and "night mode" and {@link android.app.UiModeManager} let applications adjust their application UI for specific user modes. </li>
-<li>New {@link android.view.ScaleGestureDetector} that lets Views detect and handle transformation gestures that involve more than one pointer (multitouch) using the supplied MotionEvents. </li>
-<li>Improvements in the way that multitouch events are reported in {@link android.view.MotionEvent} objects.</li>
-<li>The layout attribute <code>fill_parent</code> is renamed to <code>match_parent</code>. This affects both XML and Java code (see {@link android.view.ViewGroup.LayoutParams}). Note that the platform will continue to honor uses of <code>fill_parent</code> in legacy applications. </li>
-<li>New layout attributes {@link android.R.attr#tabStripEnabled}, {@link android.R.attr#tabStripRight}, and {@link android.R.attr#tabStripLeft} let developers customize the bottom strip of TabWidgets.</li>
-<li>Better support for managed dialogs in Activity.</li>
-</ul>
-
-<h3>Accounts and sync</h3>
-
-<ul>
-<li>New method {@link android.content.ContentResolver#addPeriodicSync(Account, String, Bundle, long) AddPeriodicSync()} lets you schedule a periodic sync with a specific account, authority, and extras at the given frequency.</li>
-</ul>
-
-<h3>New manifest elements and attributes</h3>
-
-<ul>
-<li>For specifying the application's preferred install location (see <a href="#install-loc">App Installation on External Storage Media</a>, above):
-
-<ul>
- <li>New <code>android:installLocation</code> attribute of the <code><manifest></code> element. Specifies the default install location defined by an application.</li>
-</ul>
-</li>
-
-<li>For managing user data backup (see <a href="#backup-manager">Backup manager</a>, above, for more information):
-
-<ul>
- <li> New <code>android:backupAgent</code> attribute of the
-<code><application></code> element. Specifies the component name of the
-BackupAgent subclass provided by the application to handle backup/restore
-operations, if any.</li>
- <li> New <code>android:restoreAnyVersion</code> attribute of the
-<code><application></code> element. Boolean value that indicates whether
-the application is prepared to attempt a restore of any backed-up dataset, even
-if the backup is apparently from a newer version of the application than is
-currently installed on the device.</li>
-</ul>
-</li>
-
-<li>For managing the platform's JIT compiler:
-
-<ul>
-<li>New <code>android:vmSafeMode</code> attribute of the <code><application></code> element. Boolean value that specifies whether to disable JIT compiler optimizations when running the application.</li>
-</ul>
-</li>
-</ul>
-
-<h3>Permissions</h3>
-
-<ul>
-<li><code>android.permission.BIND_DEVICE_ADMIN</code> — Any device administration broadcast receiver must require this permission, to ensure that only the system can interact with it.</li>
-<li><code>android.permission.KILL_BACKGROUND_PROCESSES</code> — Allows an application to call {@link android.app.ActivityManager#killBackgroundProcesses(String)}.
-<li><code>android.permission.BIND_WALLPAPER</code> — Any {@link android.service.wallpaper.WallpaperService} must require this permission, to ensure that only the system can interact with it.</li>
-<li><code>android.permission.SET_TIME</code> — Allows an application to set the system time.</li>
-</ul>
-
-<h3 id="api-diff">API differences report</h3>
-
-<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
-Level {@sdkPlatformApiLevel}), see the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report</a>.</p>
-
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
- <ul>
- <li>Alarm Clock</li>
- <li>Browser</li>
- <li>Calculator</li>
- <li>Camera</li>
- <li>Contacts</li>
- <li>Custom Locale (developer app)</li>
- <li>Dev Tools (developer app)</li>
- <li>Email</li>
- </ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
- <ul>
-
- <li>Gallery</li>
- <li>IMEs for Japanese, Chinese, and Latin text input</li>
- <li>Messaging</li>
- <li>Music</li>
- <li>Phone</li>
- <li>Settings</li>
- <li>Spare Parts (developer app)</li>
- </ul>
-</td>
-</tr>
-</table>
-
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable platform provides a variety of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
-descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-<li>Czech (cs_CZ)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>English, US (en_US)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>French, France (fr_FR)</li>
-<li>French, Belgium (fr_BE)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Polish (pl_PL)</li>
-<li>Russian (ru_RU)</li>
-<li>Spanish (es_ES)</li>
-</td>
-</tr>
-</table>
-
-<p>Localized UI strings match the locales that are accessible
-through Settings.</p>
-
-<p class="note"><strong>Note:</strong> Android supports more locales than are listed above. However,
-the entire collection of locale strings cannot fit on a single system image, so the above list is
-only what's included in the system image for the SDK. All of Android's supported locales are
-available in the <a href="http://source.android.com/">Android Open Source Project</a>.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes a set of emulator skins that you can use
-for modeling your application in different screen sizes and resolutions. The
-emulator skins are:</p>
-
-<ul>
- <li>
- QVGA (240x320, low density, small screen)
- </li>
- <li>
- WQVGA (240x400, low density, normal screen)
- </li>
- <li>
- FWQVGA (240x432, low density, normal screen)
- </li>
- <li>
- HVGA (320x480, medium density, normal screen)
- </li>
- <li>
- WVGA800 (480x800, high density, normal screen)
- </li>
- <li>
- WVGA854 (480x854 high density, normal screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays
-and functions properly on all Android-powered devices, see <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
diff --git a/docs/html/sdk/android-2.3-highlights.jd b/docs/html/sdk/android-2.3-highlights.jd
deleted file mode 100644
index b076b3d..0000000
--- a/docs/html/sdk/android-2.3-highlights.jd
+++ /dev/null
@@ -1,446 +0,0 @@
-page.title=Android 2.3 Platform Highlights
-
-@jd:body
-
-
-<style type="text/css">
-#jd-content {
- max-width:1200px;
-}
-#jd-content div.screenshot {
- float:left;
- clear:left;
- padding:15px 30px 15px 0;
-}
-#jd-content div.video {
- float:right;
- padding:0 60px 40px;
- margin-top:-15px;
-}
-#jd-content table.columns {
- margin:0 0 1em 0;
-}
-#jd-content table.columns td {
- padding:0;
-}
-#jd-content table.columns td+td {
- padding:0 2em;
-}
-#jd-content table.columns td img {
- margin:0;
-}
-#jd-content table.columns td+td>*:first-child {
- margin-top:-2em;
-}
-.green {
- color:#8db529;
- font-weight:bold;
-}
-</style>
-
-<div class="video">
-<object width="278" height="180">
-<param name="movie" value="http://www.youtube.com/v/Jx3pdWBlZ34?hl=en&fs=1"></param>
-<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess"
-value="always"></param>
-<embed src="http://www.youtube.com/v/Jx3pdWBlZ34?hl=en&fs=1" type="application/x-shockwave-flash"
-allowscriptaccess="always" allowfullscreen="true" width="278" height="180"></embed>
-</object>
-</div>
-
-<p>The Android 2.3 platform introduces many new and exciting features for
-users and developers. This document provides a glimpse at some of the new features
-and technologies in Android 2.3. For detailed information about the new developer APIs, see the <a
-href="android-2.3.html">Android 2.3 version notes</a>.</p>
-
-<ul>
- <li><a href="#UserFeatures">New User Features</a></li>
- <li><a href="#DeveloperApis">New Developer Features</a></li>
- <li><a href="#PlatformTechnologies">New Platform Technologies</a></li>
-</ul>
-
-
-<h2 id="UserFeatures" style="clear:right">New User Features</h2>
-
-<div>
-<img style="float:right;padding-bottom:2em;" src="images/2.3/home-menu.png" alt="" height="280" />
-<img style="float:right;padding-bottom:2em;" src="images/2.3/home-plain.png" alt="" height="280" />
-
-<h3>UI refinements for simplicity and speed</h3>
-
-<p>The user interface is refined in many ways across the system, making it
-easier to learn, faster to use, and more power-efficient. A simplified
-visual theme of colors against black brings vividness and contrast to the
-notification bar, menus, and other parts of the UI. Changes in menus and
-settings make it easier for the user to navigate and control the features
-of the system and device. </p>
-
-<h3>Faster, more intuitive text input</h3>
-
-<p>The Android soft keyboard is redesigned and optimized for faster text input
-and editing. The keys themselves are reshaped and repositioned for improved
-targeting, making them easier to see and press accurately, even at high speeds.
-The keyboard also displays the current character and dictionary suggestions in a
-larger, more vivid style that is easier to read.</p>
-
-<p>The keyboard adds the capability to correct entered words from suggestions in
-the dictionary. As the user selects a word already entered, the keyboard
-displays suggestions that the user can choose from, to replace the selection.
-The user can also switch to voice input mode to replace the selection. Smart
-suggestions let the user accept a suggestion and then return to correct it
-later, if needed, from the original set of suggestions.</p>
-
-<p>New multitouch key-chording lets the user quickly enter numbers and symbols
-by pressing Shift+<<em>letter</em>> and ?123+<<em>symbol</em>>,
-without needing to manually switch input modes. From certain keys, users can
-also access a popup menu of accented characters, numbers, and symbols by holding
-the key and sliding to select a character.</p>
-</div>
-
-<div style="padding-top:1em;">
-<div style="margin-right:1em;float:left;"><img src="images/2.3/onetouch.png" alt="" height="260" /></div>
-<div style="padding-right:2em;float:left;"><img src="images/2.3/selection.png" alt="" height="160" /></div>
-
-
-<h3>One-touch word selection and copy/paste</h3>
-
-<p>When entering text or viewing a web page, the user can quickly select a word
-by press-hold, then copy to the clipboard and paste. Pressing on a word enters a
-free-selection mode — the user can adjust the selection area as needed by
-dragging a set of bounding arrows to new positions, then copy the bounded area
-by pressing anywhere in the selection area. For text entry, the user can
-slide-press to enter a cursor mode, then reposition the cursor easily and
-accurately by dragging the cursor arrow. With both the selection and cursor
-modes, no use of a trackball is needed.</p>
-
-</div>
-
-<div style="clear:left">
-<div style="padding-right:2em;float:right;"><img src="images/2.3/running.png" alt="" height="280" /></div>
-<div style="padding-left:1em;float:right;"><img src="images/2.3/power.png" alt="" height="280" /></div>
-
-<h3>Improved power management </h3>
-
-<p>The Android system takes a more active role in managing apps that are keeping
-the device awake for too long or that are consuming CPU while running in the
-background. By managing such apps — closing them if appropriate —
-the system helps ensure best possible performance and maximum battery life.</p>
-
-<p>The system also gives the user more visibility over the power being consumed
-by system components and running apps. The Application settings provides an
-accurate overview of how the battery is being used, with details of the usage
-and relative power consumed by each component or application.</p>
-
-<h3>Control over applications</h3>
-
-<p>A shortcut to the Manage Applications control now appears in the Options Menu
-in the Home screen and Launcher, making it much easier to check and manage
-application activity. Once the user enters Manage Applications, a new Running
-tab displays a list of active applications and the storage and memory being used
-by each. The user can read further details about each application and if
-necessary stop an application or report feedback to its developer. </p>
-</div>
-
-<h3>New ways of communicating, organizing</h3>
-
-<p>An updated set of standard applications lets the user take new approaches to
-managing information and relationships. </p>
-
-<div style="padding-top:1em;">
-<div style="padding-right:1.5em;float:left;"><img src="images/2.3/sipcall.png" alt="" height="190" align="left"/><br>
-<img src="images/2.3/ffc.png" alt="" height="190" align="left" style="margin-bottom:1.5em;margin-top:.75em;"/><div></div>
-</div>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Internet calling</strong></p>
-
-<p>The user can make voice calls over the internet to other users who have SIP
-accounts. The user can add an internet calling number (a SIP address) to any
-Contact and can initiate a call from Quick Contact or Dialer. To use internet
-calling, the user must create an account at the SIP provider of their choice
-— SIP accounts are not provided as part of the internet calling feature.
-Additionally, support for the platform's SIP and internet calling features on
-specific devices is determined by their manufacturers and associated carriers.
-</p>
-
-<div style="padding-right:1.5em;float:right;;"><img src="images/2.3/nfc.png" alt="" height="190" /> </div>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Near-field communications</strong></p>
-
-<p>An NFC Reader application lets the user read and interact with near-field
-communication (NFC) tags. For example, the user can “touch” or “swipe” an NFC
-tag that might be embedded in a poster, sticker, or advertisement, then act on
-the data read from the tag. A typical use would be to read a tag at a
-restaurant, store, or event and then rate or register by jumping to a web site
-whose URL is included in the tag data. NFC communication relies on wireless
-technology in the device hardware, so support for the platform's NFC features on
-specific devices is determined by their manufacturers.
-</p>
-</div>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Downloads management</strong></p>
-
-<p>The Downloads application gives the user easy access to any file downloaded from
-the browser, email, or another application. Downloads is built on an completely new
-download manager facility in the system that any other applications can use, to
-more easily manage and store their downloads.</p>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Camera</strong></p>
-
-<p>The application now lets the user access multiple cameras on the device,
-including a front-facing camera, if available. </p>
-
-
-<h2 id="DeveloperApis" style="clear:both">New Developer Features</h2>
-
-<p>Android 2.3 delivers a variety of features and APIs that
-let developers bring new types of applications to the Android
-platform.</p>
-
- <ul>
-<li><a href="#gaming">Enhancements for gaming</a></li>
-<li><a href="#communication">New forms of communication</a></li>
-<li><a href="#multimedia">Rich multimedia</a></li>
-</ul>
-
-<h3 id="gaming">Enhancements for gaming</h3>
-
-<p style="margin-top:.75em;margin-bottom:.75em;"><strong>Performance</strong></p>
-
-<p>Android 2.3 includes a variety of improvements across the system that make
-common operations faster and more efficient for all applications. Of particular
-interest to game developers are:</p>
-
-<ul>
-<li>Concurrent garbage collector — The Dalivik VM introduces a new,
-concurrent garbage collector that minimizes application pauses, helping to
-ensure smoother animation and increased responsiveness in games and similar
-applications. </li>
-<li>Faster event distribution — The plaform now handles touch and keyboard
-events faster and more efficiently, minimizing CPU utilization during event
-distribution. The changes improve responsiveness for all applications, but
-especially benefit games that use touch events in combination with 3D graphics
-or other CPU-intensive operations. </li>
-<li>Updated video drivers — The platform uses updated third-party video
-drivers that improve the efficiency of OpenGL ES operations, for faster overall
-3D graphics performance. </li>
-</ul>
-
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Native input and
-sensor events</strong></p>
-
-<p>Applications that use native code can now receive and process input and
-sensor events directly in their native code, which dramatically improves
-efficiency and responsiveness. </p>
-
-<p>Native libraries exposed by the platform let applications handle the same
-types of input events as those available through the framework. Applications
-can receive events from all supported sensor types and can enable/disable
-specific sensors and manage event delivery rate and queueing. </p>
-
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Gyroscope and other
-new sensors, for improved 3D motion processing</strong></p>
-
-<p>Android 2.3 adds API support for several new sensor types, including
-gyroscope, rotation vector, linear acceleration, gravity, and barometer sensors.
-Applications can use the new sensors in combination with any other sensors
-available on the device, to track three-dimensional device motion and
-orientation change with high precision and accuracy. For example, a game
-application could use readings from a gyroscope and accelerometer on the device
-to recognize complex user gestures and motions, such as tilt, spin, thrust, and
-slice. </p>
-
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Open API for native
-audio</strong></p>
-
-<p>The platform provides a software implementation of <a
-href="http://www.khronos.org/opensles/">Khronos OpenSL ES</a>, a standard API
-that gives applications access to powerful audio controls and effects from
-native code. Applications can use the API to manage audio devices and control
-audio input, output, and processing directly from native code.</p>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Native graphics
-management</strong></p>
-
-<p>The platform provides an interface to its <a
-href="http://www.khronos.org/egl/">Khronos EGL</a> library, which lets
-applications manage graphics contexts and create and manage OpenGL ES textures
-and surfaces from native code.</p>
-
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Native access to
-Activity lifecycle, window management</strong></p>
-
-<p>Native applications can declare a new type of Activity class,
-<code>NativeActivity</code> whose lifecycle callbacks are implemented directly
-in native code. The <code>NativeActivity</code> and its underlying native code
-run in the system just as do other Activities — they run in the
-application's system process and execute on the application's main UI thread,
-and they receive the same lifecycle callbacks as do other Activities. </p>
-
-<p>The platform also exposes native APIs for managing windows, including the
-ability to lock/unlock the pixel buffer to draw directly into it. Through the
-API, applications can obtain a native window object associated with a framework
-Surface object and interact with it directly in native code.</p>
-
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Native access to
-assets, storage</strong></p>
-
-<p>Applications can now access a native Asset Manager API to retrieve
-application assets directly from native code without needing to go through JNI.
-If the assets are compressed, the platform does streaming decompression as the
-application reads the asset data. There is no longer a limit on the size of
-compressed <code>.apk</code> assets that can be read.</p>
-
-<p>Additionally, applications can access a native Storage Manager API to work
-directly with OBB files downloaded and managed by the system. Note that although
-platform support for OBB is available in Android 2.3, development tools for
-creating and managing OBB files will not be available until early 2011.</p>
-
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Robust native
-development environment</strong></p>
-
-<p>The Android NDK (r5 or higher) provides a complete set of tools, toolchains,
-and libraries for developing applications that use the rich native environment
-offered by the Android 2.3 platform. For more information or to download the
-NDK, please see the <a
-href="http://developer.android.com/sdk/ndk/index.html">Android NDK</a>
-page. </p>
-
-
-<h3 id="communication">New forms of communication</h3>
-
-<p style="margin-top:.75em;margin-bottom:.75em;"><strong>Internet
-telephony</strong></p>
-
-<p>Developers can now add SIP-based internet telephony features to their
-applications. Android 2.3 includes a full SIP protocol stack and integrated call
-management services that let applications easily set up outgoing and incoming
-voice calls, without having to manage sessions, transport-level communication,
-or audio record or playback directly. </p>
-
-<p>Support for the platform's SIP and internet calling features on specific
-devices is determined by their manufacturers and associated carriers.</p>
-
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Near Field
-Communications (NFC)</strong></p>
-
-<p>The platform's support for Near Field Communications (NFC) lets developers
-get started creating a whole new class of applications for Android. Developers
-can create new applications that offer proximity-based information and services
-to users, organizations, merchants, and advertisers. </p>
-
-<p>Using the NFC API,
-applications can read and respond to NFC tags “discovered” as the user “touches” an
-NFC-enabled device to elements embedded in stickers, smart posters, and even
-other devices. When a tag of interest is collected, applications can respond to
-the tag, read messages from it, and then store the messages, prompting
-the user as needed. </p>
-
-<p>Starting from Android 2.3.3, applications can also write to tags and
-set up peer-to-peer connections with other NFC devices.</p>
-
-<p>NFC communication relies on wireless technology in the device hardware, so
-support for the platform's NFC features on specific devices is determined by
-their manufacturers.</p>
-
-
-<h3 id="multimedia">Rich multimedia</h3>
-
-<p style="margin-top:.75em;margin-bottom:.75em;"><strong>Mixable audio
-effects</strong></p>
-
-<p>A new audio effects API lets developers easily create rich audio environments
-by adding equalization, bass boost, headphone virtualization (widened
-soundstage), and reverb to audio tracks and sounds. Developers can mix multiple
-audio effects in a local track or apply effects globally, across multiple
-tracks.</p>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Support for new media
-formats</strong></p>
-
-<p>The platform now offers built-in support for the VP8 open video compression
-format and the WebM open container format. The platform also adds support for
-AAC encoding and AMR wideband encoding (in software), so that applications can
-capture higher quality audio than narrowband. </p>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Access to multiple
-cameras</strong></p>
-
-<p>The Camera API now lets developers access any cameras that are available on a
-device, including a front-facing camera. Applications can query the platform for
-the number of cameras on the device and their types and characteristics, then
-open the camera needed. For example, a video chat application might want to access a
-front-facing camera that offers lower-resolution, while a photo application
-might prefer a back-facing camera that offers higher-resolution.</p>
-
-
-<h2 id="PlatformTechnologies">New Platform Technologies</h2>
-
-<h3>Media Framework</h3>
-
-<ul>
-<li>New media framework fully replaces OpenCore, maintaining all previous
-codec/container support for encoding and decoding.</li>
-<li>Integrated support for the VP8 open video compression format and the WebM
-open container format</li>
-<li>Adds AAC encoding and AMR wideband encoding</li>
-</ul>
-
-<h3>Linux Kernel </h3>
-<ul>
-<li>Upgraded to 2.6.35</li>
-</ul>
-
-<h3>Networking</h3>
-<ul>
-<li>SIP stack, configurable by device manufacturer
-<li>Support for Near Field Communications (NFC), configurable by device manufacturer</li>
-<li>Updated BlueZ stack</li>
-</ul>
-
-<h3>Dalvik runtime</h3>
-
-<ul>
-<li>Dalvik VM:
-<ul>
-<li>Concurrent garbage collector (target sub-3ms pauses)</li>
-<li>Adds further JIT (code-generation) optimizations</li>
-<li>Improved code verification</li>
-<li>StrictMode debugging, for identifying performance and memory issues</li>
-</ul>
-</li>
-
-
-<li>Core libraries:
-<ul>
- <li>Expanded I18N support (full worldwide encodings, more locales)
- <li>Faster Formatter and number formatting. For example, float formatting is 2.5x faster.</li>
- <li>HTTP responses are gzipped by default. XML and JSON API response sizes may be reduced by 60% or more.</li>
- <li>New collections and utilities APIs</li>
- <li>Improved network APIs</li>
- <li>Improved file read and write controls</li>
- <li>Updated JDBC</li>
-</ul>
-</li>
-
-<li>Updates from upstream projects:
- <ul>
- <li>OpenSSL 1.0.0a</li>
- <li>BouncyCastle 1.45</li>
- <li>ICU 4.4</li>
- <li>zlib 1.2.5</li>
- </ul>
-</li>
-
-
-</ul>
-
-<p>For more information about the new developer APIs, see the <a
-href="android-2.3.html">Android 2.3 version notes</a> and the <a
-href="{@docRoot}sdk/api_diff/9/changes.html">API Differences Report</a>.</p>
diff --git a/docs/html/sdk/android-2.3.3.jd b/docs/html/sdk/android-2.3.3.jd
deleted file mode 100644
index 405c063..0000000
--- a/docs/html/sdk/android-2.3.3.jd
+++ /dev/null
@@ -1,419 +0,0 @@
-page.title=Android 2.3.3 Platform
-sdk.platform.version=2.3.3
-sdk.platform.apiLevel=10
-
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#api">API Overview</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-<h2>See Also</h2>
-<ol>
- <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>
-<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>Android 2.3.3 is a small feature release that adds several improvements
-and APIs to the Android 2.3 platform.</p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK. The downloadable platform includes
-an Android library and system image, as well as a set of emulator
-skins and more. The downloadable platform
-includes no external libraries.</p>
-
-<p>To get started developing or testing against Android
-{@sdkPlatformVersion}, use the Android SDK Manager to
-download the platform into your SDK. For more information,
-see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>. If you are new to Android, <a
-href="{@docRoot}sdk/index.html">download the SDK Starter Package</a>
-first.</p>
-
-<p>For a high-level introduction to Android 2.3, see the <a
-href="{@docRoot}sdk/android-2.3-highlights.html">Platform Highlights</a>.</p>
-
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
-revision number. To determine what revision(s) of the Android
-{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
-the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
-
-<div class="toggle-content opened" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 2</a> <em>(July 2011)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r12</a> or
-higher.</p>
-</dd>
-<dt>Notes:</dt>
-<dd>
-<p>Improvements to the platform's rendering library to support the visual layout editor in the ADT
-Eclipse plugin. This revision allows for more drawing features in ADT and fixes several
-bugs in the previous rendering library. It also unlocks several editor features that were added in
-ADT 12.</p>
-</dd>
-</dl>
-
-</div>
-</div>
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 1</a> <em>(February 2011)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r9 or higher.</p>
-</dd>
-</dl>
-
-</div>
-</div>
-
-
-<h2 id="api">API Overview</h2>
-
-<p>The sections below provide a technical overview of what's new for developers
-in {@sdkPlatformVersion}, including new features and changes in the framework
-API since the previous version.</p>
-
-<h3 id="nfc">Near Field Communications (NFC)</h3>
-
-<p>Android 2.3.3 provides improved and extended support for NFC, to allow
-applications to interact with more types of tags in new ways.</p>
-
-<p>A new, comprehensive set of APIs give applications read and write access
-to a wider range of standard tag technologies, including:</p>
-
-<ul>
-<li>NFC-A (ISO 14443-3A)</li>
-<li>NFC-B (ISO 14443-3B)</li>
-<li>NFC-F (JIS 6319-4)</li>
-<li>NFC-V (ISO 15693)</li>
-<li>ISO-DEP (ISO 14443-4)</li>
-<li>MIFARE Classic</li>
-<li>MIFARE Ultralight</li>
-<li>NFC Forum NDEF tags</li>
-</ul>
-
-<p>The platform also provides a limited peer-to-peer communication protocol
-and API. Foreground Activities can use the API to register an NDEF
-message that will get pushed to other NFC devices when they connect.</p>
-
-<p>Advanced tag dispatching now gives applications more control over how and
-when they are launched, when an NFC tag is discovered. Previously, the platform
-used a single-step intent dispatch to notify interested applications that a tag
-was discovered. The platform now uses a four-step process that enables the
-foreground application to take control of a tag event before it is passed to any
-other applications (<code>android.nfc.NfcAdapter.enableForegroundDispatch()</code>).
-
-The new dispatch process also lets apps listen for specific tag content and
-tag technologies, based on two new intent actions —
-<code>android.nfc.action.NDEF_DISCOVERED</code> and
-<code>android.nfc.action.TECH_DISCOVERED</code>.</p>
-
-<p>The NFC API is available in the {@link android.nfc} and
-{@link android.nfc.tech} packages. The key classes are: </p>
-
-<ul>
-<li>{@link android.nfc.NfcAdapter}, which represents the NFC hardware on the device.</li>
-<li>{@link android.nfc.NdefMessage}, which represents an NDEF data message,
-the standard format in which "records" carrying data are transmitted between
-devices and tags. An NDEF message certain many NDEF records of different types.
-Applications can receive these messages from
-{@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED NDEF_DISCOVERED},
-{@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED TECH_DISCOVERED}, or
-{@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED TAG_DISCOVERED} Intents.</li>
-<li>{@link android.nfc.NdefRecord}, delivered in an
-{@link android.nfc.NdefMessage}, which describes the type of data being shared
-and carries the data itself.</li>
-<li>{@link android.nfc.Tag}, which represents a tag scanned by the device.
-Multiple types of tags are supported, based on the underlying tag
-technology.</li>
-<li>{@link android.nfc.tech.TagTechnology}, an interface that gives applications
-access to tag properties and I/O operations based on the technologies present
-in the tag. For a full list of tag technologies supported in Android 2.3.3, see
-{@link android.nfc.tech}.</li>
-</ul>
-
-<p>NFC communication relies on wireless technology in the device hardware, and
-is not present in all Android devices. Android devices that do not support
-NFC will return a null object when
-{@link android.nfc.NfcAdapter#getDefaultAdapter(android.content.Context)
-getDefaultAdapter(Context)} is called, and
-<code>context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC)</code>
-will return <code>false</code>. The NFC API is always present, however, regardless of
-underlying hardware support.</p>
-
-<p>To use the NFC API, applications must request permission from the user by
-declaring <code><uses-permission
-android:name="android.permission.NFC"></code> in their manifest files.</p>
-
-<p>Additionally, developers can request filtering on Google Play, such that
-their applications are not discoverable to users whose devices do not support
-NFC. To request filtering, add
-<code><uses-feature android:name="android.hardware.nfc"
-android:required="true"></code> to the application's manifest.</p>
-
-<p class="note">To look at sample code for NFC, see
-<a href="{@docRoot}resources/samples/NFCDemo/index.html">NFCDemo app</a>, <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/TechFilter.html">filtering by tag technology</a></li>, <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/ForegroundDispatch.html">using foreground dispatch</a>, and <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/ForegroundNdefPush.html">foreground NDEF push (P2P)</a>.</p>
-
-<h3 id="bluetooth">Bluetooth</h3>
-
-<p>Android 2.3.3 adds platform and API support for Bluetooth nonsecure socket
-connections. This lets applications communicate with simple devices that may not
-offer a UI for authentication. See
-{@link android.bluetooth.BluetoothDevice#createInsecureRfcommSocketToServiceRecord(java.util.UUID)} and
-{@link android.bluetooth.BluetoothAdapter#listenUsingInsecureRfcommWithServiceRecord(java.lang.String, java.util.UUID)}
-for more information. </p>
-
-<h3 id="graphics">Graphics</h3>
-
-<ul>
-<li>A new {@link android.graphics.BitmapRegionDecoder} class lets applications
-decode a rectangle region from an image. The API is particularly useful when an
-original image is large and and the application only need parts of the image.
-</li>
-<li>A new {@link
-android.graphics.BitmapFactory.Options#inPreferQualityOverSpeed} field in {@link
-android.graphics.BitmapFactory.Options} allows applications to use a more accurate
-but slightly slower IDCT method in JPEG decode. This in turn improves the
-quality of the reconstructed image.</li>
-</ul>
-
-
-<h3 id="media">Media framework</h3>
-
-<ul>
-<li>A new {@link android.media.MediaMetadataRetriever} class provides a unified
-interface for retrieving frame and metadata from an input media file.</li>
-<li>{@link android.media.MediaRecorder.AudioEncoder} and {@link
-android.media.MediaRecorder.OutputFormat} include new fields for specifying AMR
-Wideband and AAC formats. </li>
-</ul>
-
-
-<h3 id="speech">Speech recognition</h3>
-
-<p>The speech-recognition API includes new constants to let you manage voice
-search results in new ways. Although the new constants are not needed for normal
-use of speech recognition, you could use them to offer a different view of voice
-search results in your application. For information, see {@link
-android.speech.RecognizerResultsIntent}.</p>
-
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
-the framework API. The Android {@sdkPlatformVersion} API
-is assigned an integer identifier —
-<strong>{@sdkPlatformApiLevel}</strong> — that is
-stored in the system itself. This identifier, called the "API Level", allows the
-system to correctly determine whether an application is compatible with
-the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
-you need compile the application against the Android library that is provided in
-the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
-also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
-attribute to the <code><uses-sdk></code> element in the application's
-manifest. If your application is designed to run only on Android 2.3 and higher,
-declaring the attribute prevents the application from being installed on earlier
-versions of the platform.</p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Browser</li>
-<li>Calculator</li>
-<li>Camera</li>
-<li>Clock</li>
-<li>Contacts</li>
-<li>Cusom Locale</li>
-<li>Dev Tools</li>
-<li>Downloads</li>
-<li>Email</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<ul>
-<li>Gallery</li>
-<li>IMEs for Japanese, Chinese, and Latin text input</li>
-<li>Messaging</li>
-<li>Music</li>
-<li>Phone</li>
-<li>Search</li>
-<li>Settings</li>
-<li>Spare Parts (developer app)</li>
-<li>Speech Recorder</li>
-</ul>
-</td>
-</tr>
-</table>
-
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable SDK platform provides a variety of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
-descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Arabic, Egypt (ar_EG)</li>
-<li>Arabic, Israel (ar_IL)</li>
-<li>Bulgarian, Bulgaria (bg_BG)</li>
-<li>Catalan, Spain (ca_ES)</li>
-<li>Czech, Czech Republic (cs_CZ)</li>
-<li>Danish, Denmark(da_DK)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Greek, Greece (el_GR)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Ireland (en_IE)</li>
-<li>English, India (en_IN)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>English, US (en_US)</li>
-<li>English, South Africa (en_ZA)</li>
-<li>Spanish (es_ES)</li>
-<li>Spanish, US (es_US)</li>
-<li>Finnish, Finland (fi_FI)</li>
-<li>French, Belgium (fr_BE)</li>
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>French, France (fr_FR)</li>
-<li>Hebrew, Israel (he_IL)</li>
-<li>Hindi, India (hi_IN)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>Croatian, Croatia (hr_HR)</li>
-<li>Hungarian, Hungary (hu_HU)</li>
-<li>Indonesian, Indonesia (id_ID)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Lithuanian, Lithuania (lt_LT)</li>
-<li>Latvian, Latvia (lv_LV)</li>
-<li>Norwegian-Bokmol, Norway(nb_NO)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Polish (pl_PL)</li>
-<li>Portuguese, Brazil (pt_BR)</li>
-<li>Portuguese, Portugal (pt_PT)</li>
-<li>Romanian, Romania (ro_RO)</li>
-<li>Russian (ru_RU)</li></li>
-<li>Slovak, Slovakia (sk_SK)</li>
-<li>Slovenian, Slovenia (sl_SI)</li>
-<li>Serbian (sr_RS)</li>
-<li>Swedish, Sweden (sv_SE)</li>
-<li>Thai, Thailand (th_TH)</li>
-<li>Tagalog, Philippines (tl_PH)</li>
-<li>Turkish, Turkey (tr_TR)</li>
-<li>Ukrainian, Ukraine (uk_UA)</li>
-<li>Vietnamese, Vietnam (vi_VN)</li>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-</td>
-</tr>
-</table>
-
-<p class="note"><strong>Note:</strong> The Android platform may support more
-locales than are included in the SDK system image. All of the supported locales
-are available in the <a href="http://source.android.com/">Android Open Source
-Project</a>.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes a set of emulator skins that you can use
-for modeling your application in different screen sizes and resolutions. The
-emulator skins are:</p>
-
-<ul>
- <li>
- QVGA (240x320, low density, small screen)
- </li>
- <li>
- WQVGA400 (240x400, low density, normal screen)
- </li>
- <li>
- WQVGA432 (240x432, low density, normal screen)
- </li>
- <li>
- HVGA (320x480, medium density, normal screen)
- </li>
- <li>
- WVGA800 (480x800, high density, normal screen)
- </li>
- <li>
- WVGA854 (480x854 high density, normal screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays
-and functions properly on all Android-powered devices, see <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
diff --git a/docs/html/sdk/android-2.3.4.jd b/docs/html/sdk/android-2.3.4.jd
deleted file mode 100644
index 4bfdabd..0000000
--- a/docs/html/sdk/android-2.3.4.jd
+++ /dev/null
@@ -1,381 +0,0 @@
-page.title=Android 2.3.4 Platform
-sdk.platform.version=2.3.4
-sdk.platform.apiLevel=10
-
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#api">API Overview</a></li>
- <li><a href="#openaccessory">Open Accessory Library</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-<h2>See Also</h2>
-<ol>
- <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>
-<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>Android 2.3.4 is a maintenance release that adds several bug fixes and patches
-to the Android 2.3 platform, without any API changes from Android 2.3.3. Additionally,
-Android 2.3.4 brings support for the Open Accessory API to mobile devices,
-through the optional <a href="#usb">Open Accessory Library</a>. </p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform and the Open
-Accessory Library are available together in the latest version of the Google
-APIs Add-On, a downloadable component for the Android SDK.</p>
-
-<p>To get started developing or testing against Android {@sdkPlatformVersion},
-use the Android SDK Manager to download the latest version of the Google APIs
-Add-On into your SDK. For more information, see <a
-href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>. If you
-are new to Android, <a href="{@docRoot}sdk/index.html">download the SDK Starter
-Package</a> first.</p>
-
-<p>For a high-level introduction to Android 2.3, see the <a
-href="{@docRoot}sdk/android-2.3-highlights.html">Platform Highlights</a>.</p>
-
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
-revision number. To determine what revision(s) of the Android
-{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
-the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
- padding: .25em 1em 0em 1em;
- margin-bottom: 0;
-}
-.toggleme {
- padding: 1em 1em 0 2em;
- line-height:1em;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleme a {
- text-decoration:underline;
-}
-.toggleable.closed .toggleme {
- display:none;
-}
-#jd-content .toggle-img {
- margin:0;
-}
-</style>
-
-<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" />
- Android {@sdkPlatformVersion}, Revision 1</a> <em>(May 2011)</em></a>
- <div class="toggleme">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r11 or higher.</p>
-</dd>
-
-</dl>
- </div>
-</div>
-
-
-<h2 id="api">API Overview</h2>
-
-<p>Android 2.3.4 provides the same framework API to applications as Android 2.3.3
-(API level 10). For a summary of the API, see the
-<a href="{@docRoot}sdk/android-2.3.3.html">Android 2.3.3 version notes</a>.</p>
-
-
-<h2 id="openaccessory">Open Accessory Library</h2>
-
-<p><em>Open Accessory</em> is a new capability for integrating
-connected peripherals with applications running on the platform. The capability
-is based on a USB (Universal Serial Bus) stack built into the platform and an
-API exposed to applications. Peripherals that attach to Android-powered devices
-as accessories connect as USB hosts. </p>
-
-<p>Open Accessory is introduced in <a
-href="{@docRoot}sdk/android-3.1.html#usb">Android 3.1</a> (API level 12), but is
-made available to devices running Android 2.3.4 by means of an optional external
-library, the Open Accessory Library. The library exposes a framework API that
-lets applications discover, communicate with, and manage a variety of device
-types connected over USB. It also provides the implementation of the API against
-parts of the Android platform that are not directly exposed to applications in
-Android 2.3.4.</p>
-
-<p>The Open Accessory Library is optional on any given device. Device
-manufacturers may choose whether to include the Open Accessory Library in their
-products or exclude it. The library is forward-compatible with Android 3.1, so
-applications developed against Android 2.3.4 will run properly on devices
-running Android 3.1, if those devices support USB accessories. </p>
-
-<p>The API provided by the Open Accessory Library is based on the Open Accessory
-API provided in Android 3.1. In most areas, you can use the same techniques and
-APIs. However, developing for the Open Accessory Library on Android 2.3.4 differs
-from the standard USB API in these ways:
-
-<ul>
-<li>Obtaining a {@link android.hardware.usb.UsbManager} object — To obtain
-a {@link android.hardware.usb.UsbManager} object when using the add-on library,
-use the helper method <code>getInstance()</code> rather than {@link
-android.content.Context#getSystemService(java.lang.String) getSystemService()}
-For example:
-
-<pre>UsbManager manager = UsbManager.getInstance(this);</pre></li>
-
-<li>Obtaining a {@link android.hardware.usb.UsbAccessory} from a filtered intent
-— When you filter for a connected device or accessory with an intent
-filter, the {@link android.hardware.usb.UsbAccessory} object is contained
-inside the intent that is passed to your application. If you are using the
-add-on library, you can get the {@link android.hardware.usb.UsbAccessory} object
-in the following manner:
-
-<pre>UsbAccessory accessory = UsbManager.getAccessory(intent)</pre></li>
-
-<li>No USB host support — Android 2.3.4 and the Open Accessory Library do
-not support USB host mode (for example, through {@link
-android.hardware.usb.UsbDevice}), although USB host mode is supported in Android
-3.1. An Android-powered device running Android 2.3.4 can not function as a USB
-host. The library enables the Android-powered device to function as
-a peripheral only, with the connected accessory functioning as USB host
-(through {@link android.hardware.usb.UsbAccessory}).</li>
-</ul>
-
-<p>To develop apps using the Open Accessory Library, you need:</p>
-
-<ul>
-<li>The latest version of the Android SDK tools</li>
-<li>The latest version of the Google APIs add-on, which includes the library
-itself (for linking)</li>
-<li>An actual hardware device running Android 2.3.4 (or Android 3.1) with USB
-accessories support, for runtime testing against connected devices</li>
-</ul>
-
-<p>For a full discussion of how to develop applications that interact with USB
-accessories, please see the related <a
-href="{@docRoot}guide/topics/usb/index.html">developer documentation</a>.</p>
-
-<p>Additionally, developers can request filtering on Google Play, such that
-their applications are not available to users whose devices do not provide the
-appropriate accessory support. To request filtering, add the element below
-to the application manifest:</p>
-
-<pre><uses-feature
- android:name="android.hardware.usb.accessory"
- android:required="true"></pre>
-
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android 2.3.4 platform does <em>not</em> increment the API level —
-it uses the same API level as Android 2.3.3, API level 10.
-
-<p>To use APIs introduced in API level 10 in your application,
-you need compile the application against the Android library that is provided in
-the latest version of the Google APIs Add-On, which also includes the Open
-Accessory Library.</p>
-
-<p>Depending on your needs, you might
-also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
-attribute to the <code><uses-sdk></code> element in the application's
-manifest. If your application is designed to run only on Android 2.3.3 and higher,
-declaring the attribute prevents the application from being installed on earlier
-versions of the platform.</p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Browser</li>
-<li>Calculator</li>
-<li>Camera</li>
-<li>Clock</li>
-<li>Contacts</li>
-<li>Custom Locale</li>
-<li>Dev Tools</li>
-<li>Downloads</li>
-<li>Email</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<ul>
-<li>Gallery</li>
-<li>IMEs for Japanese, Chinese, and Latin text input</li>
-<li>Messaging</li>
-<li>Music</li>
-<li>Phone</li>
-<li>Search</li>
-<li>Settings</li>
-<li>Spare Parts (developer app)</li>
-<li>Speech Recorder</li>
-</ul>
-</td>
-</tr>
-</table>
-
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable SDK platform provides a variety of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
-descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Arabic, Egypt (ar_EG)</li>
-<li>Arabic, Israel (ar_IL)</li>
-<li>Bulgarian, Bulgaria (bg_BG)</li>
-<li>Catalan, Spain (ca_ES)</li>
-<li>Czech, Czech Republic (cs_CZ)</li>
-<li>Danish, Denmark(da_DK)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Greek, Greece (el_GR)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Ireland (en_IE)</li>
-<li>English, India (en_IN)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>English, US (en_US)</li>
-<li>English, South Africa (en_ZA)</li>
-<li>Spanish (es_ES)</li>
-<li>Spanish, US (es_US)</li>
-<li>Finnish, Finland (fi_FI)</li>
-<li>French, Belgium (fr_BE)</li>
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>French, France (fr_FR)</li>
-<li>Hebrew, Israel (he_IL)</li>
-<li>Hindi, India (hi_IN)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<ul>
-<li>Croatian, Croatia (hr_HR)</li>
-<li>Hungarian, Hungary (hu_HU)</li>
-<li>Indonesian, Indonesia (id_ID)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Lithuanian, Lithuania (lt_LT)</li>
-<li>Latvian, Latvia (lv_LV)</li>
-<li>Norwegian-Bokmol, Norway(nb_NO)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Polish (pl_PL)</li>
-<li>Portuguese, Brazil (pt_BR)</li>
-<li>Portuguese, Portugal (pt_PT)</li>
-<li>Romanian, Romania (ro_RO)</li>
-<li>Russian (ru_RU)</li></li>
-<li>Slovak, Slovakia (sk_SK)</li>
-<li>Slovenian, Slovenia (sl_SI)</li>
-<li>Serbian (sr_RS)</li>
-<li>Swedish, Sweden (sv_SE)</li>
-<li>Thai, Thailand (th_TH)</li>
-<li>Tagalog, Philippines (tl_PH)</li>
-<li>Turkish, Turkey (tr_TR)</li>
-<li>Ukrainian, Ukraine (uk_UA)</li>
-<li>Vietnamese, Vietnam (vi_VN)</li>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-</ul>
-</td>
-</tr>
-</table>
-
-<p class="note"><strong>Note:</strong> The Android platform may support more
-locales than are included in the SDK system image. All of the supported locales
-are available in the <a href="http://source.android.com/">Android Open Source
-Project</a>.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes a set of emulator skins that you can use
-for modeling your application in different screen sizes and resolutions. The
-emulator skins are:</p>
-
-<ul>
- <li>
- QVGA (240x320, low density, small screen)
- </li>
- <li>
- WQVGA400 (240x400, low density, normal screen)
- </li>
- <li>
- WQVGA432 (240x432, low density, normal screen)
- </li>
- <li>
- HVGA (320x480, medium density, normal screen)
- </li>
- <li>
- WVGA800 (480x800, high density, normal screen)
- </li>
- <li>
- WVGA854 (480x854 high density, normal screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays
-and functions properly on all Android-powered devices, see <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
diff --git a/docs/html/sdk/android-2.3.jd b/docs/html/sdk/android-2.3.jd
deleted file mode 100644
index b466913..0000000
--- a/docs/html/sdk/android-2.3.jd
+++ /dev/null
@@ -1,942 +0,0 @@
-page.title=Android 2.3 Platform
-sdk.platform.version=2.3
-sdk.platform.apiLevel=9
-
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#api">API Overview</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-<h2>See Also</h2>
-<ol>
- <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>
-<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK. The downloadable platform includes
-an Android library and system image, as well as a set of emulator
-skins and more. The downloadable platform
-includes no external libraries.</p>
-
-<p>To get started developing or testing against Android
-{@sdkPlatformVersion}, use the Android SDK Manager to
-download the platform into your SDK. For more information,
-see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>. If you are new to Android, <a
-href="{@docRoot}sdk/index.html">download the SDK Starter Package</a>
-first.</p>
-
-<p>For a high-level introduction to Android {@sdkPlatformVersion}, see the <a
-href="{@docRoot}sdk/android-{@sdkPlatformVersion}-highlights.html">Platform Highlights</a>.</p>
-
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
-revision number. To determine what revision(s) of the Android
-{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
-the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
- padding: .25em 1em 0em 1em;
- margin-bottom: 0;
-}
-.toggleme {
- padding: 1em 1em 0 2em;
- line-height:1em;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleme a {
- text-decoration:underline;
-}
-.toggleable.closed .toggleme {
- display:none;
-}
-#jd-content .toggle-img {
- margin:0;
-}
-</style>
-
-<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" />
- Android {@sdkPlatformVersion}, Revision 1</a> <em>(December 2010)</em></a>
- <div class="toggleme">
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires SDK Tools r8 or higher.</p>
-</dd>
-
-</dl>
- </div>
-</div>
-
-<h2 id="api">API Overview</h2>
-
-<p>The sections below provide a technical overview of what's new for developers
-in {@sdkPlatformVersion}, including new features and changes in the framework
-API since the previous version.</p>
-
-
-<h3 id="sip">SIP-based VoIP</h3>
-
-<p>The platform now includes a SIP protocol stack and framework API that lets
-developers build internet telephony applications. Using the API, applications can offer
-voice calling features without having to manage sessions, transport-level
-communication, or audio — these are handled
-transparently by the platform's SIP API and services.</p>
-
-<p>The SIP API is available in the {@link android.net.sip android.net.sip}
-package. The key class is {@link android.net.sip.SipManager}, which applications
-use to set up and manage SIP profiles, then initiate audio calls and receive
-audio calls. Once an audio call is established, applications can mute calls,
-turn on speaker mode, send DTMF tones, and more. Applications can also use the
-{@link android.net.sip.SipManager} to create generic SIP connections.</p>
-
-<p>The platform’s underlying SIP stack and services are available on devices at
-the discretion of the manufacturer and associated carrier. For this reason,
-applications should use the {@link android.net.sip.SipManager#isApiSupported
-isApiSupported()} method to check whether SIP support is available, before
-exposing calling functionality to users. </p>
-
-<p>To use the SIP API, applications must request permission from the user by
-declaring <code><uses-permission
-android:name="android.permission.INTERNET"></code> and <code><uses-permission
-android:name="android.permission.USE_SIP"></code> in their manifest files.</p>
-
-<p>Additionally, developers can request filtering on Google Play, such that
-their applications are not discoverable to users whose devices do not include
-the platform’s SIP stack and services. To request filtering, add <code><uses-feature
-android:name="android.software.sip"
-android:required="true"></code> and <code><uses-feature
-android:name="android.software.sip.voip"></code> to the application manifest.</p>
-
-<p class="note">To look at a sample application that uses the SIP API, see <a
-href="{@docRoot}resources/samples/SipDemo/index.html">SIP Demo</a>.</p>
-
-<h3 id="nfc">Near Field Communications (NFC)</h3>
-
-<p>Android 2.3 includes an NFC stack and framework API that lets developers
-read NDEF tags that are discovered as a user touches an NFC-enabled device
-to tag elements embedded in stickers, smart posters, and even other devices.</p>
-
-<p>The platform provides the underlying NFC services that work with the device
-hardware to discover tags when they come into range. On discovering a tag, the
-platform notifies applications by broadcasting an Intent, appending the tag's
-NDEF messages to the Intent as extras. Applications can create Intent filters to
-recognize and handle targeted tags and messages. For example, after receiving a
-tag by Intent, applications extract the NDEF messages, store them, alert the
-user, or handle them in other ways. </p>
-
-<p>The NFC API is available in the {@link android.nfc} package. The key classes are: </p>
-
-<ul><li>{@link android.nfc.NfcAdapter}, which represents the NFC hardware on the device.</li>
-<li>{@link android.nfc.NdefMessage}, which represents an NDEF data message,
-the standard format in which "records" carrying data are transmitted between
-devices and tags. Applications can receive these messages from {@link
-android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}</code> Intents.</li>
-<li>{@link android.nfc.NdefRecord}, delivered in an
-{@link android.nfc.NdefMessage}, which describes the type of data being shared and
-carries the data itself.</li>
-</ul>
-
-<p>NFC communication relies on wireless technology in the device hardware, so
-support for the platform's NFC features on specific devices is determined by
-their manufacturers. To determine the NFC support on the current device,
-applications can call {@link android.nfc.NfcAdapter#isEnabled isEnabled()} to
-query the {@link android.nfc.NfcAdapter}. The NFC API is always present,
-however, regardless of underlying hardware support.</p>
-
-<p>To use the NFC API, applications must request permission from the user by
-declaring <code><uses-permission
-android:name="android.permission.NFC"></code> in their manifest files.</p>
-
-<p>Additionally, developers can request filtering on Google Play, such that
-their applications are not discoverable to users whose devices do not support
-NFC. To request filtering, add
-<code><uses-feature android:name="android.hardware.nfc"
-android:required="true"></code> to the application's manifest.</p>
-
-<p class="note">To look at a sample application that uses the NFC API, see
-<a href="{@docRoot}resources/samples/NFCDemo/index.html">NFCDemo</a>.</p>
-
-<h3 id="sensors">Gyroscope and other sensors</h3>
-
-<p>Android 2.3 adds platform and API support for several new sensor reading
-types — gyroscope, rotation vector, linear acceleration, gravity, and barometer.
-Developers can use the new sensor readings to create applications that respond
-quickly and smoothly to precise changes in device position and motion. The
-Sensor API reports gyroscope and other sensor changes to interested
-applications, whether they are running on the application framework or in native
-code. </p>
-
-<p>Note that the specific set of hardware sensors available on any given device
-varies at the discretion of the device manufacturer. </p>
-
-<p>Developers can request filtering on Google Play, such that their
-applications are not discoverable to users whose devices do not offer a
-gyroscope sensor. To do so, add <code><uses-feature
-android:name="android.hardware.sensor.gyroscope"
-android:required="true"></code> to the application manifest.</p>
-
-<p>For API details, see {@link android.hardware.Sensor}.</p>
-
-
-<h3 id="cameras">Multiple cameras support</h3>
-
-<p>Applications can now make use of any cameras that are available on a device,
-for either photo or video capture. The {@link android.hardware.Camera} lets
-applications query for the number of cameras available and the unique
-characteristics of each. </p>
-
-<ul>
-<li>New {@link android.hardware.Camera.CameraInfo} class stores a camera's
-positional characteristics (orientation, front-facing or back-facing).</li>
-<li>New {@link android.hardware.Camera#getNumberOfCameras()} and {@link
-android.hardware.Camera#getCameraInfo(int,CameraInfo) getCameraInfo()} methods in the {@link
-android.hardware.Camera} class let applications query for the cameras available
-and open the camera that they need.</li>
-<li>New {@link android.media.CamcorderProfile#get get()} method lets
-applications retrieve a {@link android.media.CamcorderProfile} for a specific camera. </li>
-<li>New {@link android.media.CameraProfile#getJpegEncodingQualityParameter(int, int)
-getJpegEncodingQualityParameter()} lets applications obtain the still-image
-capture quality level for a specific camera.</li>
-</ul>
-
-<p class="note">To look at sample code for accessing a front-facing camera, see <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html">CameraPreview.java</a>
-in the ApiDemos sample application.</p>
-
-<p>The Camera API also adds: </p>
-<ul>
-<li>New parameters for cameras, including focus distance, focus mode, and
-preview fps maximum/minimum. New {@link
-android.hardware.Camera.Parameters#getFocusDistances(float[])
-getFocusDistances()}, {@link
-android.hardware.Camera.Parameters#getPreviewFpsRange(int[])
-getPreviewFpsRange()}, and {@link
-android.hardware.Camera.Parameters#getSupportedPreviewFpsRange()
-getSupportedPreviewFpsRange()} for getting camera parameters, as well as {@link
-android.hardware.Camera.Parameters#setPreviewFpsRange(int, int)
-setPreviewFpsRange()} for setting preview framerate. </li>
-</ul>
-
-<h3 id="media">Mixable audio effects</h3>
-
-<p>The platform's media framework adds support for new per-track or global audio effects,
-including bass boost, headphone virtualization, equalization, and reverb.</p>
-<ul>
-<li>New {@link android.media.audiofx android.media.audiofx} package provides the
-API to access audio effects.</li>
-<li>New {@link android.media.audiofx.AudioEffect AudioEffect} is the base class
-for controlling audio effects provided by the Android audio framework.
-<li>New audio session ID that lets an application associate a set of audio
-effects with an instance of {@link android.media.AudioTrack} or {@link
-android.media.MediaPlayer}.</li>
-<li>New {@link android.media.AudioTrack#AudioTrack(int, int, int, int, int, int,
-int) AudioTrack} class constructor that lets you create an {@link
-android.media.AudioTrack} with a specific session ID. New {@link
-android.media.AudioTrack#attachAuxEffect(int) attachAuxEffect()}, {@link
-android.media.AudioTrack#getAudioSessionId() getAudioSessionId()}, and {@link
-android.media.AudioTrack#setAuxEffectSendLevel(float) setAuxEffectSendLevel()}
-methods.</li>
-<li>New {@link android.media.MediaPlayer#attachAuxEffect(int)
-attachAuxEffect()}, {@link android.media.MediaPlayer#getAudioSessionId()
-getAudioSessionId()}, {@link android.media.MediaPlayer#setAudioSessionId(int)
-setAudioSessionId(int)}, and {@link
-android.media.MediaPlayer#setAuxEffectSendLevel(float) setAuxEffectSendLevel()}
-methods and supporting types.</li>
-</ul>
-
-<p class="note">To look at sample code for audio effects, see
-<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.html">AudioFxDemo.java</a>
-in the ApiDemos sample application.</p>
-
-<p>The media framework also adds:</p>
-<ul>
-<li>New support for altitude tag in EXIF metadata for JPEG files. New method
-{@link android.media.ExifInterface#getAltitude(double) getAltitude()} method to
-retrieve the value of the EXIF altitude tag.</li>
-<li>New {@link android.media.MediaRecorder#setOrientationHint(int)
-setOrientationHint()} method lets an application tell {@link
-android.media.MediaRecorder} of the orientation during video capture.</li>
-</ul>
-
-<h3 id="download">Download manager</h3>
-
-<p>The platform includes a new {@link android.app.DownloadManager} system service
-that handles long-running HTTP downloads. Applications can request that a URI be
-downloaded to a particular destination file. The <code>DownloadManager</code>
-will conduct the download in the background, taking care of HTTP interactions
-and retrying downloads after failures or across connectivity changes and system
-reboots. </p>
-<ul>
-<li>Applications can obtain an instance of the {@link android.app.DownloadManager}
-class by calling {@link
-android.content.Context#getSystemService(String)} and passing
-{@link android.content.Context#DOWNLOAD_SERVICE}. Applications that request
-downloads through this API should register a broadcast receiver for {@link
-android.app.DownloadManager#ACTION_NOTIFICATION_CLICKED}, to appropriately
-handle when the user clicks on a running download in a notification or from the
-Downloads UI.</li>
-<li>The {@link android.app.DownloadManager.Request} class lets an
-application provide all the information necessary to request a new download,
-such as request URI and download destination. A request URI is the only required
-parameter. Note that the default download destination is a shared volume where
-the system can delete your file if it needs to reclaim space for system use. For
-persistent storage of a download, specify a download destination on external
-storage (see {@link
-android.app.DownloadManager.Request#setDestinationUri(Uri)}).</li>
-<li>The {@link android.app.DownloadManager.Query} class provides methods that let
-an application query for and filter active downloads.</li>
-</ul>
-
-<h3 id="strictmode">StrictMode</h3>
-
-<p>To help developers monitor and improve the performance of their applications,
-the platform offers a new system facility called {@link android.os.StrictMode}.
-When implemented in an application, StrictMode catches and notifies the
-developer of accidental disk or network activity that could degrade application
-performance, such as activity taking place on the application's main thread
-(where UI operations are received and animations are also taking place).
-Developers can evaluate the network and disk usages issues raised in StrictMode
-and correct them if needed, keeping the main thread more responsive and
-preventing ANR dialogs from being shown to users.
-
-<ul>
-<li>{@link android.os.StrictMode} is the core class and is the main integration
-point with the system and VM. The class provides convenience methods for
-managing the thread and VM policies that apply to the instance.</li>
-<li>{@link android.os.StrictMode.ThreadPolicy} and {@link
-android.os.StrictMode.VmPolicy} hold the policies that you define and apply to
-thread and VM instances.</li>
-</ul>
-
-<p>For more information about how to use StrictMode to optimize your
-application, see the class documentation and sample code at {@link
-android.os.StrictMode android.os.StrictMode}.</p>
-
-<h3 id="ui">UI Framework</h3>
-
-<ul>
-<li>Support for overscroll
-<ul>
-<li>New support for overscroll in Views and Widgets. In Views, applications can
-enable/disable overscroll for a given view, set the overscoll mode, control the
-overscroll distance, and handle the results of overscrolling. </li>
-<li>In Widgets, applications can control overscroll characteristics such as
-animation, springback, and overscroll distance. For more information, see {@link
-android.view.View android.view.View} and {@link android.widget.OverScroller
-android.widget.OverScroller}. </li>
-<li>{@link android.view.ViewConfiguration} also provides methods {@link
-android.view.ViewConfiguration#getScaledOverflingDistance()} and {@link
-android.view.ViewConfiguration#getScaledOverscrollDistance()}.</li>
-<li>New <code>overScrollMode</code>, <code>overScrollFooter</code>, and
-<code>overScrollHeader</code> attributes for <code><ListView></code> elements,
-for controlling overscroll behavior.</li>
-</ul>
-</li>
-
-<li>Support for touch filtering
-<ul>
-<li>New support for touch filtering, which lets an application improve the
-security of Views that provide access to sensitive functionality. For example,
-touch filtering is appropriate to ensure the security of user actions such as
-granting a permission request, making a purchase, or clicking on an
-advertisement. For details, see the <a
-href="{@docRoot}reference/android/view/View.html#Security">View class
-documentation</a>.</li>
-<li>New <code>filterTouchesWhenObscured</code> attribute for view elements,
-which declares whether to filter touches when the view's window is obscured by
-another visible window. When set to <code>"true"</code>, the view will not
-receive touches whenever a toast, dialog or other window appears above the
-view's window. Refer to <a
-href="{@docRoot}reference/android/view/View.html#Security">View security
-documentation</a> for details.</li>
-</ul>
-
-<p class="note">To look at sample code for touch filtering, see
-<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/SecureView.html">SecureView.java</a>
-in the ApiDemos sample application.</p>
-</li>
-
-<li>Improved event management
-<ul>
-<li>New base class for input events, {@link android.view.InputEvent}. The class
-provides methods that let applications determine the meaning of the event, such
-as by querying for the InputDevice from which the event orginated. The {@link
-android.view.KeyEvent} and {@link android.view.MotionEvent} are subclasses of
-{@link android.view.InputEvent}.</li>
-<li>New base class for input devices, {@link android.view.InputDevice}. The
-class stores information about the capabilities of a particular input device and
-provides methods that let applications determine how to interpret events from an
-input device.</li>
-</ul>
-</li>
-
-<li>Improved motion events
-<ul>
-<li>The {@link android.view.MotionEvent} API is extended to include "pointer ID"
-information, which lets applications to keep track of individual fingers as they
-move up and down. The class adds a variety of methods that let an application
-work efficiently with motion events.</li>
-<li>The input system now has logic to generate motion events with the new
-pointer ID information, synthesizing identifiers as new pointers are down. The
-system tracks multiple pointer IDs separately during a motion event, and
-ensures proper continuity of pointers by evaluating at the distance
-between the last and next set of pointers.</li>
-</ul>
-</li>
-
-<li>Text selection controls
-<ul>
-<li>A new <code>setComposingRegion</code> method lets an application mark a
-region of text as composing text, maintaining the current styling. A
-<code>getSelectedText</code> method returns the selected text to the
-application. The methods are available in {@link
-android.view.inputmethod.BaseInputConnection}, {@link
-android.view.inputmethod.InputConnection}, and {@link
-android.view.inputmethod.InputConnectionWrapper}.</li>
-<li>New <code>textSelectHandle</code>, <code>textSelectHandleLeft</code>,
-<code>textSelectHandleRight</code>, and <code>textSelectHandleWindowStyle</code>
-attributes for <code><TextView></code>, for referencing drawables that will be
-used to display text-selection anchors and the style for the containing
-window.</li>
-</ul>
-</li>
-
-<li>Activity controls
-<ul>
-<li>{@link android.content.pm.ActivityInfo} adds new constants for managing
-Activity orientation:
-{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_FULL_SENSOR},
-{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_REVERSE_LANDSCAPE},
-{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_REVERSE_PORTRAIT},
-{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_SENSOR_LANDSCAPE},
-and
-{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_SENSOR_PORTRAIT}.
-</li>
-<li>New constant {@link
-android.app.ActivityManager.RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE} for
-the {@link android.app.ActivityManager.RunningAppProcessInfo#importance} field
-in {@link android.app.ActivityManager.RunningAppProcessInfo}. The value
-indicates that a specific process is running something that is considered to be
-actively perceptible to the user. An example would be an application performing
-background music playback.</li>
-<li>The Activity.setPersistent(boolean) method to mark an
-Activity as persistent is now deprecated and the implementation is a no-op.</li>
-</ul>
-</li>
-
-<li>Notification text and icon styles
-<ul>
-<li>New {@link android.R.style#TextAppearance_StatusBar_EventContent
-TextAppearance.StatusBar.EventContent},
-{@link android.R.style#TextAppearance_StatusBar_EventContent_Title
-TextAppearance.StatusBar.EventContent.Title},
-{@link android.R.style#TextAppearance_StatusBar_Icon
-TextAppearance.StatusBar.Icon}, and
-{@link android.R.style#TextAppearance_StatusBar_Title
-TextAppearance.StatusBar.Title} for managing
-notification style.</li>
-</ul>
-</li>
-
-<li>WebView
-<ul>
-<li>New {@link
-android.webkit.WebSettings#setUseWebViewBackgroundForOverscrollBackground(
-boolean) setUseWebViewBackgroundForOverscrollBackground()} method lets a {@link
-android.webkit.WebView} specify whether to use its own background for the
-overscroll background. </li>
-</ul>
-</li>
-</ul>
-
-<h3 id="extralargescreens">Extra Large Screens</h3>
-
-<p>The platform now supports extra large screen sizes, such as those that might
-be found on tablet devices. Developers can indicate that their applications are
-designed to support extra large screen sizes by adding a <code><supports
-screens ... android:xlargeScreens="true"></code> element to their manifest
-files. Applications can use a new resource qualifier, <code>xlarge</code>, to
-tag resources that are specific to extra large screens. For
-details on how to support extra large and other screen sizes, see <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
-
-<h3 id="graphics">Graphics</h3>
-
-<ul>
-<li>Adds remaining OpenGL ES 2.0 methods {@link
-android.opengl.GLES20#glDrawElements(int, int, int, int) glDrawElements()} and
-{@link android.opengl.GLES20#glVertexAttribPointer(int, int, int, boolean, int,
-int) glVertexAttribPointer()} in the {@link android.opengl.GLES20
-android.opengl.GLES20} class.</li>
-<li>Adds support for {@link android.graphics.ImageFormat#YV12} pixel format, a
-planar 4:2:0 YCrCb format.</li>
-</ul>
-
-<h3 id="providers">Content Providers</h3>
-
-<ul>
-<li>New {@link android.provider.AlarmClock} provider class for setting an alarm
-or handling an alarm. The provider contains a <code>ACTION_SET_ALARM</code> Intent
-action and extras that can be used to start an Activity to set a new alarm in an
-alarm clock application. Applications that wish to receive the
-<code>SET_ALARM</code> Intent should create an activity that requires the
-the SET_ALARM permission. Applications that wish to create a new
-alarm should use {@link
-android.content.Context#startActivity(android.content.Intent)
-Context.startActivity()}, so that the user has the option of choosing
-which alarm clock application to use.</li>
-
-<li>{@link android.provider.MediaStore} supports a new Intent action, {@link
-android.provider.MediaStore#INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH
-PLAY_FROM_SEARCH}, that lets an application search for music media and
-automatically play content from the result when possible. For example, an
-application could fire this Intent as the result of a voice recognition command
-to listen to music.</li>
-<li>{@link android.provider.MediaStore} also adds a new {@link
-android.provider.MediaStore#MEDIA_IGNORE_FILENAME} flag that tells the media
-scanner to ignore media in the containing directory and its subdirectories.
-Developers can use this to avoid having graphics appear in the Gallery and
-likewise prevent application sounds and music from showing up in the Music
-app.</li>
-
-<li>The {@link android.provider.Settings} provider adds the new Activity actions
-{@link android.provider.Settings#ACTION_APPLICATION_DETAILS_SETTINGS
-APPLICATION_DETAILS_SETTINGS} and {@link
-android.provider.Settings#ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS
-MANAGE_ALL_APPLICATIONS_SETTINGS}, which let an application show the details
-screen for a specific application or show the Manage Applications screen. </li>
-
-<li>The {@link android.provider.ContactsContract} provider adds the {@link
-android.provider.ContactsContract.CommonDataKinds.SipAddress} data kind, for
-storing a contact's SIP (Internet telephony) address. </li>
-</ul>
-
-<h3 id="location">Location</h3>
-
-<ul>
-<li>The {@link android.location.LocationManager} now tracks application
-requests that result in wake locks or wifi locks according to
-{@link android.os.WorkSource}, a system-managed class that identifies the
-application.
-<p>The <code>LocationManager</code> keeps track
-of all clients requesting periodic updates, and tells its providers
-about them as a <code>WorkSource</code> parameter, when setting their minimum
-update times.
-The network location provider uses <code>WorkSource</code> to track the
-wake and wifi locks initiated by an application and adds it to the application's
-battery usage reported in Manage Applications. </p></li>
-<li>The {@link android.location.LocationManager} adds several new methods that
-let an Activity register to receive periodic or one-time location updates based
-on specified criteria (see below).</li>
-<li>A new {@link android.location.Criteria} class lets an application specify a
-set of criteria for selecting a location provider. For example, providers may be
-ordered according to accuracy, power usage, ability to report altitude, speed,
-and bearing, and monetary cost. </li>
-</ul>
-
-<h3 id="storage">Storage</h3>
-
-<ul>
-<li>Android 2.3 adds a new {@link android.os.storage.StorageManager} that
-supports OBB (Opaque Binary Blob) files. Although platform support for OBB is
-available in Android 2.3, development tools for creating and managing OBB files
-will not be availble until early 2011.</li>
-<li>The Android 2.3 platform adds official support for devices that do not
-include SD cards (although it provides virtual SD Card partition, when no
-physical SD card is available). A convenience method, {@link
-android.os.Environment#isExternalStorageRemovable()}, lets applications
-determine whether a physical SD card is present.</li>
-</ul>
-
-<h3 id="packagemanager">Package Manager</h3>
-
-<ul>
-<li>New constants for declaring hardware and software features. See the list in
-the <a href="#feature_constants">New Feature Constants</a> section, below.</li>
-<li>{@link android.content.pm.PackageInfo} adds new {@link
-android.content.pm.PackageInfo#firstInstallTime} and {@link
-android.content.pm.PackageInfo#lastUpdateTime} fields that store the time of the
-package installation and last update. </li>
-<li>New {@link
-android.content.pm.PackageManager#getProviderInfo(android.content.ComponentName,
-int) getProviderInfo()} method for retrieving all of the information known about
-a particular content provider class.</li>
-</ul>
-
-<h3 id="telephony">Telephony</h3>
-
-<ul>
-<li>The {@link android.telephony.TelephonyManager} adds the constant {@link
-android.telephony.TelephonyManager#NETWORK_TYPE_EVDO_B} for specifying the CDMA
-EVDO Rev B network type.</li>
-<li>New {@link android.telephony.gsm.GsmCellLocation#getPsc()} method returns
-the primary scrambling code of the serving cell on a UMTS network.</li>
-</ul>
-
-<h3 id="native">Native access to Activity lifecycle, windows</h3>
-
-<p>Android 2.3 exposes a broad set of APIs to applications that use native
-code. Framework classes of interest to such applications include: </p>
-
-<ul>
-<li>{@link android.app.NativeActivity} is a new type of Activity class, whose
-lifecycle callbacks are implemented directly in native code. A
-<code>NativeActivity</code> and its underlying native code run in the system
-just as do other Activities — specifically they run in the Android
-application's system process and execute on the application's main UI thread,
-and they receive the same lifecycle callbacks as do other Activities. </li>
-<li>New {@link android.view.InputQueue} class and callback interface lets native
-code manage event queueing. </li>
-<li>New {@link android.view.SurfaceHolder.Callback2} interface lets native code
-manage a {@link android.view.SurfaceHolder}. </li>
-<li>New {@link
-android.view.Window#takeInputQueue(android.view.InputQueue.Callback)
-takeInputQueue} and {@link
-android.view.Window#takeSurface(android.view.SurfaceHolder.Callback2)
-takeSurface()} methods in {@link android.view.Window} let native code manage
-events and surfaces.</li>
-</ul>
-
-<p>For full information on working with native code or to download the NDK,
-see the <a href="{@docRoot}sdk/ndk/index.html">Android NDK</a> page.</p>
-
-
-<h3 id="dalvik">Dalvik Runtime</h3>
-
-<ul>
-<li>{@link dalvik.system dalvik.system}
-removes several classes that were previously deprecated.</li>
-<li>Dalvik core libraries:
-<ul>
- <li>New collections: {@link java.util.ArrayDeque}, {@link java.util.NavigableMap},
- {@link java.util.concurrent.ConcurrentSkipListMap},
- {@link java.util.concurrent.LinkedBlockingDeque}</li>
- <li>New {@link java.util.Arrays} utilities: <code>binarySearch()</code>,
- <code>copyOf()</code>, <code>copyOfRange()</code>, and others.</li>
- <li>{@link java.net.CookieManager} for {@link java.net.HttpURLConnection}.</li>
- <li>More complete network APIs: {@link java.net.InterfaceAddress},
- {@link java.net.NetworkInterface} and {@link java.net.IDN}</li>
- <li>{@link java.io.File} read and write controls</li>
- <li>{@link java.lang.String#isEmpty() String.isEmpty()}</li>
- <li>{@link java.text.Normalizer} and {@link java.text.Normalizer.Form}</li>
- <li>Improved {@link javax.net.ssl} server sockets.</li>
-</ul>
-</li>
-</ul>
-
-<h3 id="manifest">New manifest elements and attributes</h3>
-
-<ul>
-<li>New <code>xlargeScreens</code> attribute for <a
-href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
-<supports-screens>}</a>
-element, to indicate whether the application supports
-extra large screen form-factors. For details, see <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</li>
-<li>New values for <code>android:screenOrientation</code> attribute of
-<code><activity></code> element:
-<ul>
-<li><code>"reverseLandscape"</code> — The Activity would like to have the
-screen in landscape orientation, turned in the opposite direction from normal
-landscape.</li>
-<li><code>"reversePortrait"</code> — The Activity would like to have the
-screen in portrait orientation, turned in the opposite direction from normal
-portrait.</li>
-<li><code>"sensorLandscape"</code> — The Activity would like to have the
-screen in landscape orientation, but can use the sensor to change which
-direction the screen is facing.</li>
-<li><code>"sensorPortrait"</code> — The Activity would like to have the
-screen in portrait orientation, but can use the sensor to change which direction
-the screen is facing.</li>
-<li><code>"fullSensor"</code> — Orientation is determined by a physical
-orientation sensor: the display will rotate based on how the user moves the
-device. This allows any of the 4 possible rotations, regardless of what the
-device will normally do (for example some devices won't normally use 180 degree
-rotation).</li>
-</ul>
-</li>
-</ul>
-
-<h3 id="permissions">New Permissions</h3>
-
-<ul>
-<li><code>com.android.permission.SET_ALARM</code> — Allows an application
-to broadcast an Intent to set an alarm for the user. An Activity that handles
-the {@link android.provider.AlarmClock#ACTION_SET_ALARM SET_ALARM} Intent action
-should require this permission.</li>
-<li><code>android.permission.USE_SIP</code> — Allows an application to use
-the {@link android.net.sip SIP API} to make or receive internet calls.
-<li><code>android.permission.NFC</code> — Allows an application to use the
-{@link android.nfc NFC API} to read NFC tags.</li>
-</ul>
-
-<h3 id="feature_constants">New Feature Constants</h3>
-
-<p>The platform adds several new hardware features that developers can declare
-in their application manifests as being required by their applications. This
-lets developers control how their application is filtered, when published on
-Google Play. </p>
-
-<ul>
-<li>{@link android.content.pm.PackageManager#FEATURE_AUDIO_LOW_LATENCY
-android.hardware.audio.low_latency} — The application uses a low-latency
-audio pipeline on the device and is sensitive to delays or lag in sound input or
-output.</li>
-<li>{@link android.content.pm.PackageManager#FEATURE_CAMERA_FRONT
-android.hardware.camera.front} — The application uses a front-facing
-camera on the device.</li>
-<li>{@link android.content.pm.PackageManager#FEATURE_NFC android.hardware.nfc}
-— The application uses NFC radio features in the device.</li>
-<li>{@link android.content.pm.PackageManager#FEATURE_SENSOR_BAROMETER
-android.hardware.sensor.barometer} — The application uses the device's
-barometer.</li>
-<li>{@link android.content.pm.PackageManager#FEATURE_SENSOR_GYROSCOPE
-android.hardware.sensor.gyroscope} — The application uses the device's
-gyroscope sensor.</li>
-<li>{@link android.content.pm.PackageManager#FEATURE_SIP android.software.sip}
-— The application uses the SIP API on the device.</li>
-<li>{@link android.content.pm.PackageManager#FEATURE_SIP_VOIP
-android.software.sip.voip} — The application uses a SIP-based VoIP
-service on the device.</li>
-<li>{@link
-android.content.pm.PackageManager#FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND
-android.hardware.touchscreen.multitouch.jazzhand} — The application uses
-advanced multipoint multitouch capabilities on the device screen, for tracking
-five or more points fully independently.</li>
-</ul>
-
-<p>For full information about how to declare features and use them for
-filtering, see the documentation for <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></code></a>.</p>
-
-<h3 id="api-diff">API differences report</h3>
-
-<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
-Level {@sdkPlatformApiLevel}), see the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report</a>.</p>
-
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
-the framework API. The Android {@sdkPlatformVersion} API
-is assigned an integer identifier —
-<strong>{@sdkPlatformApiLevel}</strong> — that is
-stored in the system itself. This identifier, called the "API Level", allows the
-system to correctly determine whether an application is compatible with
-the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
-you need compile the application against the Android library that is provided in
-the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
-also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
-attribute to the <code><uses-sdk></code> element in the application's
-manifest. If your application is designed to run only on Android 2.3 and higher,
-declaring the attribute prevents the application from being installed on earlier
-versions of the platform.</p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Browser</li>
-<li>Calculator</li>
-<li>Camera</li>
-<li>Clock</li>
-<li>Contacts</li>
-<li>Cusom Locale</li>
-<li>Dev Tools</li>
-<li>Downloads</li>
-<li>Email</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<ul>
-<li>Gallery</li>
-<li>IMEs for Japanese, Chinese, and Latin text input</li>
-<li>Messaging</li>
-<li>Music</li>
-<li>Phone</li>
-<li>Search</li>
-<li>Settings</li>
-<li>Spare Parts (developer app)</li>
-<li>Speech Recorder</li>
-</ul>
-</td>
-</tr>
-</table>
-
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable SDK platform provides a variety of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android {@sdkPlatformVersion} system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
-descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Arabic, Egypt (ar_EG)</li>
-<li>Arabic, Israel (ar_IL)</li>
-<li>Bulgarian, Bulgaria (bg_BG)</li>
-<li>Catalan, Spain (ca_ES)</li>
-<li>Czech, Czech Republic (cs_CZ)</li>
-<li>Danish, Denmark(da_DK)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Greek, Greece (el_GR)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Ireland (en_IE)</li>
-<li>English, India (en_IN)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>English, US (en_US)</li>
-<li>English, South Africa (en_ZA)</li>
-<li>Spanish (es_ES)</li>
-<li>Spanish, US (es_US)</li>
-<li>Finnish, Finland (fi_FI)</li>
-<li>French, Belgium (fr_BE)</li>
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>French, France (fr_FR)</li>
-<li>Hebrew, Israel (he_IL)</li>
-<li>Hindi, India (hi_IN)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>Croatian, Croatia (hr_HR)</li>
-<li>Hungarian, Hungary (hu_HU)</li>
-<li>Indonesian, Indonesia (id_ID)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Lithuanian, Lithuania (lt_LT)</li>
-<li>Latvian, Latvia (lv_LV)</li>
-<li>Norwegian-Bokmol, Norway(nb_NO)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Polish (pl_PL)</li>
-<li>Portuguese, Brazil (pt_BR)</li>
-<li>Portuguese, Portugal (pt_PT)</li>
-<li>Romanian, Romania (ro_RO)</li>
-<li>Russian (ru_RU)</li></li>
-<li>Slovak, Slovakia (sk_SK)</li>
-<li>Slovenian, Slovenia (sl_SI)</li>
-<li>Serbian (sr_RS)</li>
-<li>Swedish, Sweden (sv_SE)</li>
-<li>Thai, Thailand (th_TH)</li>
-<li>Tagalog, Philippines (tl_PH)</li>
-<li>Turkish, Turkey (tr_TR)</li>
-<li>Ukrainian, Ukraine (uk_UA)</li>
-<li>Vietnamese, Vietnam (vi_VN)</li>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-</td>
-</tr>
-</table>
-
-<p class="note"><strong>Note:</strong> The Android platform may support more
-locales than are included in the SDK system image. All of the supported locales
-are available in the <a href="http://source.android.com/">Android Open Source
-Project</a>.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes a set of emulator skins that you can use
-for modeling your application in different screen sizes and resolutions. The
-emulator skins are:</p>
-
-<ul>
- <li>
- QVGA (240x320, low density, small screen)
- </li>
- <li>
- WQVGA400 (240x400, low density, normal screen)
- </li>
- <li>
- WQVGA432 (240x432, low density, normal screen)
- </li>
- <li>
- HVGA (320x480, medium density, normal screen)
- </li>
- <li>
- WVGA800 (480x800, high density, normal screen)
- </li>
- <li>
- WVGA854 (480x854 high density, normal screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays
-and functions properly on all Android-powered devices, see <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
diff --git a/docs/html/sdk/android-3.0-highlights.jd b/docs/html/sdk/android-3.0-highlights.jd
deleted file mode 100644
index 33897de..0000000
--- a/docs/html/sdk/android-3.0-highlights.jd
+++ /dev/null
@@ -1,263 +0,0 @@
-page.title=Android 3.0 Platform Highlights
-
-@jd:body
-
-
-<style type="text/css">
-#jd-content {
- max-width:1200px;
-}
-#jd-content div.screenshot {
- float:left;
- clear:left;
- padding:15px 30px 15px 0;
-}
-#jd-content div.video {
- float:right;
- padding:0 60px 40px;
- margin-top:-15px;
-}
-#jd-content table.columns {
- margin:0 0 1em 0;
-}
-#jd-content table.columns td {
- padding:0;
-}
-#jd-content table.columns td+td {
- padding:0 2em;
-}
-#jd-content table.columns td img {
- margin:0;
-}
-#jd-content table.columns td+td>*:first-child {
- margin-top:-2em;
-}
-.green {
- color:#8db529;
- font-weight:bold;
-}
-</style>
-
-
-<p>Welcome to Android 3.0!</p>
-
-<p>The Android 3.0 platform introduces many new and exciting features for users and developers.
-This document provides a glimpse of some of the new features and technologies, as delivered in
-Android 3.0. For a more detailed look at new developer APIs, see the <a
-href="{@docRoot}sdk/android-3.0.html">Android 3.0 Platform</a> document.</p>
-
-<ul>
- <li><a href="#UserFeatures">New User Features</a></li>
- <li><a href="#DeveloperApis">New Developer Features</a></li>
-</ul>
-
-<h2 id="UserFeatures" style="clear:right">New User Features</h2>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;margin-left:1em;float:right;padding-top:2em;"><a href="images/3.0/home_hero1_full.png" target="_android"><img src="images/3.0/home_hero1.png" alt="" height="280" /></a></div>
-
-<h3>New UI designed from the ground up for tablets</h3>
-
-<p>Android 3.0 is a new version of the Android platform that is specifically optimized for devices with larger screen sizes, particularly tablets. It introduces a brand new, truly virtual and “holographic” UI design, as well as an elegant, content-focused interaction model.</p>
-
-<p>Android 3.0 builds on the things people love most about Android — refined multitasking, rich notifications, Home screen customization, widgets, and more — and transforms them with a vibrant, 3D experience and deeper interactivity, making them familiar but even better than before.</p>
-
-<p>The new UI brings fresh paradigms for interaction, navigation, and customization and makes them available to all applications — even those built for earlier versions of the platform. Applications written for Android 3.0 are able to use an extended set of UI objects, powerful graphics, and media capabilities to engage users in new ways.</p>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>System Bar, for global status and notifications</strong></p>
-
-<p>Across the system and in all applications, users have quick access to notifications, system status, and soft navigation buttons in a System Bar, available at the bottom of the screen. The System Bar is always present and is a key touchpoint for users, but in a new "lights out mode" can also be dimmed for full-screen viewing, such as for videos.</p>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Action Bar, for application control</strong></p>
-
-<p>In every application, users have access to contextual options, navigation, widgets, or other types of content in an Action Bar, displayed at the top of the screen. The Action Bar is always present when an application is in use, although its content, theme, and other properties are managed by the application rather than the system. The Action Bar is another key touchpoint for users, especially with action items and an overflow dropdown menu, which users frequently access in a similar manner in most applications. </p>
-
-</div>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:right;margin-left:1em;"><a href="images/3.0/homescreen_cust_port_full.png" target="_android"><img src="images/3.0/homescreen_cust_port.png" alt="" height="280" /></a></div>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Customizable Home screens</strong></p>
-
-<p>Five customizable Home screens give users instant access to all parts of the system from any context. Each screen offers a large grid that maintains spatial arrangement in all orientations. Users can select and manipulate Home screen widgets, app shortcuts, and wallpapers using a dedicated visual layout mode. Visual cues and drop shadows improve visibility when adjusting the layout of shortcuts and widgets. Each Home screen also offers a familiar launcher for access to all installed applications, as well as a Search box for universal search of apps, contacts, media files, web content, and more.</p>
-
-</div>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1.5em;float:left;"><a href="images/3.0/tasks_full.png" target="_android"><img src="images/3.0/tasks.png" alt="" height="280" /></a>
-
-<!--<p style="font-size:90%">Figure</p> --></div>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Recent Apps, for easy visual multitasking</strong></p>
-
-<p>Multitasking is a key strength of Android and it is central to the Android 3.0 experience. As users launch applications to handle various tasks, they can use the Recent Apps list in the System Bar to see the tasks underway and quickly jump from one application context to another. To help users rapidly identify the task associated with each app, the list shows a snapshot of its actual state when the user last viewed it.</p>
-
-</div>
-
-
-<h3>Redesigned keyboard</h3>
-
-<p>The Android soft keyboard is redesigned to make entering text fast and accurate on larger screen sizes. The keys are reshaped and repositioned for improved targeting, and new keys have been added, such as a Tab key, to provide richer and more efficient text input. Users can touch-hold keys to access menus of special characters and switch text/voice input modes from a button in the System Bar.</p>
-
-<div style="padding-top:1em;">
-<div style="margin-right:1em;float:right;"><a href="images/3.0/copy_full.png" target="_android"><img src="images/3.0/copy.png" alt="" height="180" /></a></div>
-
-
-<h3>Improved text selection, copy and paste</h3>
-
-<p>When entering or viewing text, a new UI lets users quickly select a word by press-hold and then adjust the selection area as needed by dragging a set of bounding arrows to new positions. Users can then select an action from the Action Bar, such as copy to the clipboard, share, paste, web search, or find. </p>
-
-
-<h3>New connectivity options</h3>
-
-<p>Android 3.0 includes new connectivity features that add versatility and convenience for users. Built-in support for Media/Picture Transfer Protocol lets users instantly sync media files with a USB-connected camera or desktop computer, without needing to mount a USB mass-storage device. Users can also connect full keyboards over either USB or Bluetooth, for a familiar text-input environment. For improved wi-fi connectivity, a new combo scan reduces scan times across bands and filters. New support for Bluetooth tethering means that more types of devices can share the network connection of an Android-powered device.</p>
-
-
-<h3>Updated set of standard apps</h3>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:right;;padding-top:0em;margin-left:1em;"><a href="images/3.0/browser_full.png" target="_android"><img src="images/3.0/browser.png" alt="" height="200" /></a><br>
-<a href="images/3.0/camera_full.png" target="_android"><img src="images/3.0/camera.png" alt="" height="200" /></a></div>
-
-<p>The Android 3.0 platform includes an updated set of standard applications that are designed for use on larger screen devices. The sections below highlight some of the new features. </p>
-
-<strong>Browser</strong></p>
-
-<p>The browser includes new features that let users navigate and organize more efficiently. Multiple tabs replace browser windows and a new “incognito” mode allows anonymous browsing. Bookmarks and history are presented and managed in a single unified view. Users can now choose to automatically sign into Google sites on the browser with a supplied account and sync bookmarks with Google Chrome. New multitouch support is now available to JavaScript and plugins. Users can enjoy a better browsing experience at non-mobile sites through an improved zoom and viewport model, overflow scrolling, support for fixed positioning, and more.</p>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Camera and Gallery</strong></p>
-
-<p>The Camera application has been redesigned to take advantage of a larger screen for quick access to exposure, focus, flash, zoom, front-facing camera, and more. To let users capture scenes in new ways, it adds built-in support for time-lapse video recording. The Gallery application lets users view albums and other collections in full-screen mode, with easy access to thumbnails for other photos in the collection. </p>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Contacts</strong></p>
-
-<p>The Contacts app uses a new two-pane UI and Fast Scroll to let users easily organize and locate contacts. The application offers improved formatting of international phone numbers as user types, based on home country and an international number parsing library. Contact information is presented in a card-like UI, making it easier for users to read and edit contacts.</p>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Email</strong></p>
-
-<p>The Email application uses a new two-pane UI to make viewing and organizing messages more efficient. The app lets users select one or more messages, then select an action from the Action Bar, such as moving them to a folder. Users can sync attachments for later viewing and keep track of email using a home screen Widget.</p>
-
-</div>
-
-
-<h2 id="DeveloperApis" style="clear:both">New Developer Features</h2>
-
-<p>The Android 3.0 platform is designed specially to meet the unique needs of applications on devices with larger screen sizes. It offers all of the tools developers need to create incredible visual and interaction experiences on these devices.</p>
-
- <ul>
-<li><a href="#ui">New UI framework for creating great tablet apps</a></li>
-<li><a href="#graphics">High-performance 2D and 3D graphics</a></li>
-<li><a href="#multicore">Support for multicore processor architectures</a></li>
-<li><a href="#multimedia">Rich multimedia and connectivity</a></li>
-<li><a href="#enterprise">Enhancements for enterprise</a></li>
-<li><a href="#compatibility">Compatibility with existing apps</a></li>
-</ul>
-
-<h3 id="ui">New UI Framework for creating great tablet apps</h3>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:right;margin-left:1em;"><a href="images/3.0/contacts_full.png" target="_android"><img src="images/3.0/contacts.png" alt="" height="200" /></a></div>
-
-
-<p style="margin-top:.75em;margin-bottom:.75em;"><strong>Activity fragments, for greater control of content and design flexibility</strong></p>
-
-<p>Starting with Android 3.0, developers can break the Activities of their applications into subcomponents called Fragments, then combine them in a variety of ways to create a richer, more interactive experience. For example, an application can use a set of Fragments to create a true multipane UI, with the user being able to interact with each pane independently. Fragments can be added, removed, replaced, and animated inside an Activity dynamically, and they are modular and reusable across multiple Activities. Because they are modular, Fragments also offer an efficient way for developers to write applications that can run properly on both larger screen as well as smaller screen devices.</p>
-
-</div>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Redesigned UI widgets</strong></p>
-
-<p>Android 3.0 offers an updated set of UI widgets that developers can use to quickly add new types of content to their applications. The new UI widgets are redesigned for use on larger screens such as tablets and incorporate the new holographic UI theme. Several new widget types are available, including a 3D stack, search box, a date/time picker, number picker, calendar, popup menu, and others. Most of the redesigned UI widgets can now be used as remote views in application widgets displayed on the home screen. Applications written for earlier versions can inherit the new Widget designs and themes.</p>
-
-
-<div style="padding-top:0em;">
-<div style="margin-right:1.5em;float:left;margin-left:0em;"><a href="images/3.0/widgets.png" target="_android"><img src="images/3.0/widgets.png" alt="" height="200" target="_android" /></a></div>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Expanded Home screen widgets</strong></p>
-
-<p>Home screen widgets are popular with users because they offer fast access to application-specific data directly from the home screen. Android 3.0 lets developers take home screen widgets to the next level, offering more types of content and new modes of interaction with users. Developers can now use more standard UI widget types home screen widgets, including widgets that let users flip through collections of content as 3D stacks, grids, or lists. Users can interact with the home screen widgets in new ways, such as by using touch gestures to scroll and flip the content displayed in a widget. </p>
-
-</div>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Persistent Action Bar</strong></p>
-
-<p>The platform provides each application with its own instance of the Action Bar at the top of the screen, which the application can use to give the user quick access to contextual options, widgets, status, navigation, and more. The application can also customize the display theme of its Action Bar instance. The Action Bar lets developers expose more features of their applications to users in a familiar location, while also unifying the experience of using an application that spans multiple Activities or states.</p>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Richer notifications</strong></p>
-
-<p>Notifications are a key part of the Android user experience because they let applications show key updates and status information to users in real time. Android 3.0 extends this capability, letting developers include richer content and control more properties. A new builder class lets developers quickly create notifications that include large and small icons, a title, a priority flag, and any properties already available in previous versions. Notifications can offer more types of content by building on the expanded set of UI Widgets that are now available as remote Views.</p>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:right;margin-left:1em;"><a href="images/3.0/mail_drag_full.png" target="_android"><img src="images/3.0/mail_drag.png" alt="" height="200" style="padding-top:1em;"/></a></div>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Multiselect, clipboard, and drag-and-drop</strong></p>
-
-<p>The platform offers convenient new interaction modes that developers can use. For managing collections of items in lists or grids, developers can offer a new multiselect mode that lets users choose multiple items for an action. Developers can also use a new system-wide Clipboard to let users easily copy any type of data into and out of their applications. To make it easier for users to manage and organize files, developers can now add drag-and-drop interaction through a DragEvent framework.</p>
-
-</div>
-
-
-<h3 id="graphics">High-performance 2D and 3D graphics</h3>
-
-<p style="margin-top:.75em;margin-bottom:.75em;"><strong>New animation framework</strong></p>
-
-<p>The platform includes a flexible new animation framework that lets developers easily animate the properties of UI elements such as Views, Widgets, Fragments, Drawables, or any arbitrary object. Animations can create fades or movement between states, loop an animated image or an existing animation, change colors, and much more. Adding animation to UI elements can add visual interest to an application and refine the user experience, to keep users engaged.</p>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Hardware-accelerated 2D graphics</strong></p>
-
-<p>Android 3.0 offers a new hardware-accelerated OpenGL renderer that gives a performance boost to many common graphics operations for applications running in the Android framework. When the renderer is enabled, most operations in Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera are accelerated. Developers can control how hardware-acceleration is applied at every level, from enabling it globally in an application to enabling it in specific Activities and Views inside the application.</p>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Renderscript 3D graphics engine</strong></p>
-
-<p>Renderscript is a runtime 3D framework that provides both an API for building 3D scenes as well as a special, platform-independent shader language for maximum performance. Using Renderscript, you can accelerate graphics operations and data processing. Renderscript is an ideal way to create high-performance 3D effects for applications, wallpapers, carousels, and more.</p>
-
-
-<h3 id="multicore">Support for multicore processor architectures</h3>
-
-<p>Android 3.0 is the first version of the platform designed to run on either single or multicore processor architectures. A variety of changes in the Dalvik VM, Bionic library, and elsewhere add support for symmetric multiprocessing in multicore environments. These optimizations can benefit all applications, even those that are single-threaded. For example, with two active cores, a single-threaded application might still see a performance boost if the Dalvik garbage collector runs on the second core. The system will arrange for this automatically.</p>
-
-
-<h3 id="multimedia">Rich multimedia and connectivity</h3>
-
-<p style="margin-top:.75em;margin-bottom:.75em;"><strong>HTTP Live streaming</strong></p>
-
-<p>Applications can now pass an M3U playlist URL to the media framework to begin an HTTP Live streaming session. The media framework supports most of the HTTP Live streaming specification, including adaptive bit rate.</p>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Pluggable DRM framework</strong></p>
-
-<p>Android 3.0 includes an extensible DRM framework that lets applications manage protected content according to a variety of DRM mechanisms that may be available on the device. For application developers, the framework API offers an consistent, unified API that simplifies the management of protected content, regardless of the underlying DRM engines. </p>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>Digital media file transfer</strong></p>
-
-<p>The platform includes built-in support for Media/Picture Transfer Protocol (MTP/PTP) over USB, which lets users easily transfer any type of media files between devices and to a host computer. Developers can build on this support, creating applications that let users create or manage media files that they may want to transfer or share across devices. </p>
-
-<p style="margin-top:1.25em;margin-bottom:.75em;"><strong>More types of connectivity</strong></p>
-
-<p>The platform offers new connectivity that developers can build on. API support for Bluetooth A2DP and HSP profiles lets applications query Bluetooth profiles for connected devices, audio state, and more, then notify the user. For example, a music application can check connectivity and status and let the user know that music is playing through a stereo headset. Applications can also register to receive system broadcasts of pre-defined vendor-specific AT commands, such as Platronics Xevent. For example, an application could receive broadcasts that indicate a connected device's battery level and could notify the user or take other action as needed. Applications can also take advantage of the platform's new support for full keyboards connected by USB or Bluetooth. </p>
-
-
-<h3 id="enterprise">Enhancements for enterprise</h3>
-
-<p>In Android 3.0, developers of device administration applications can support new types of policies, including policies for encrypted storage, password expiration, password history, and password complex characters required. </p>
-
-<h3 id="compatibility">Compatibility with existing apps</h3>
-
-<p>Android 3.0 brings a new UI designed for tablets and other larger screen devices, but it also is fully compatible with applications developed for earlier versions of the platform, or for smaller screen sizes. Existing applications can seamlessly participate in the new holographic UI theme without code changes, by adding a single attribute in their manifest files. The platform emulates the Menu key, which is replaced by the overflow menu in the Action Bar in the new UI. Developers wanting to take fuller advantage of larger screen sizes can also create dedicated layouts and assets for larger screens and add them to their existing applications.</p>
-
-
-<h2>More information</h2>
-
-<div class="video">
-<object width="278" height="180">
-<param name="movie" value="http://www.youtube.com/v/hPUGNCIozp0?hl=en&fs=1"></param>
-<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess"
-value="always"></param>
-<embed src="http://www.youtube.com/v/hPUGNCIozp0?hl=en&fs=1" type="application/x-shockwave-flash"
-allowscriptaccess="always" allowfullscreen="true" width="278" height="180"></embed>
-</object>
-</div>
-
-<p>For more information about the new developer APIs, see the <a
-href="{@docRoot}sdk/android-3.0.html">Android 3.0 Platform</a> document.</p>
-
-<p>For a video overview of platform features, see the Android 3.0 Sneak Peek. </p>
diff --git a/docs/html/sdk/android-3.0.jd b/docs/html/sdk/android-3.0.jd
deleted file mode 100644
index 3acb358..0000000
--- a/docs/html/sdk/android-3.0.jd
+++ /dev/null
@@ -1,1186 +0,0 @@
-page.title=Android 3.0 Platform
-sdk.platform.version=3.0
-sdk.platform.apiLevel=11
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#api">API Overview</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/11/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-<h2>See Also</h2>
-<ol>
- <li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets and
-Handsets</a></li>
-</ol>
-
-</div>
-</div>
-
-
-<p><em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a downloadable
-component for the Android SDK. The downloadable platform includes an Android library and system
-image, as well as a set of emulator skins and more. The downloadable platform includes no external
-libraries.</p>
-
-<p>To get started developing or testing against Android {@sdkPlatformVersion}, use the Android SDK
-Manager to download the platform into your SDK. For more information, see <a
-href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a>. If you are new to Android, <a
-href="{@docRoot}sdk/index.html">download the SDK Starter Package</a> first.</p>
-
-<p>For a high-level introduction to Android {@sdkPlatformVersion}, see the <a
-href="{@docRoot}sdk/android-{@sdkPlatformVersion}-highlights.html">Platform
-Highlights</a>.</p>
-
-<p class="note"><strong>Note:</strong>
-If you've already published an Android application, please test and optimize your application on
-Android 3.0 as soon as possible. You should do so to be sure your application provides the best
-experience possible on the latest Android-powered devices. For information about what you can do,
-read <a href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets and
-Handsets</a>.</p>
-
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>To determine what revision of the Android {@sdkPlatformVersion} platform you have installed,
-refer to the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
-
-
-
-<div class="toggle-content opened" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 2</a> <em>(July 2011)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r12</a> or
-higher.</p>
-</dd>
-<dt>Notes:</dt>
-<dd>
-<p>Improvements to the platform's rendering library to support the visual layout editor in the ADT
-Eclipse plugin. This revision allows for more drawing features in ADT and fixes several
-bugs in the previous rendering library. It also unlocks several editor features that were added in
-ADT 12.</p>
-</dd>
-</dl>
-
-</div>
-</div>
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 1</a> <em>(February 2011)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r10</a> or higher.</p>
-</dd>
-</dl>
-
-</div>
-</div>
-
-
-
-<h2 id="#api">API Overview</h2>
-
-<p>The sections below provide a technical overview of what's new for developers in Android 3.0,
-including new features and changes in the framework API since the previous version.</p>
-
-
-
-
-
-<h3>Fragments</h3>
-
-<p>A fragment is a new framework component that allows you to separate distinct elements of an
-activity into self-contained modules that define their own UI and lifecycle. To create a
-fragment, you must extend the {@link android.app.Fragment} class and implement several lifecycle
-callback methods, similar to an {@link android.app.Activity}. You can then combine multiple
-fragments in a single activity to build a multi-pane UI in which each
-pane manages its own lifecycle and user inputs.</p>
-
-<p>You can also use a fragment without providing a UI and instead use the fragment as a worker
-for the activity, such as to manage the progress of a download that occurs only while the
-activity is running.</p>
-
-<p>Additionally:</p>
-
-<ul>
- <li>Fragments are self-contained and you can reuse them in multiple activities</li>
- <li>You can add, remove, replace and animate fragments inside the activity</li>
- <li>You can add fragments to a back stack managed by the activity, preserving the state of
-fragments as they are changed and allowing the user to navigate backward through the different
-states</li>
- <li>By <a
-href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">providing
-alternative layouts</a>, you can mix and match fragments, based
-on the screen size and orientation</li>
- <li>Fragments have direct access to their container activity and can contribute items to the
-activity's Action Bar (discussed next)</li>
-</ul>
-
-<p>To manage the fragments in your activity, you must use the {@link
-android.app.FragmentManager}, which provides several APIs for interacting with fragments, such
-as finding fragments in the activity and popping fragments off the back stack to restore their
-previous state.</p>
-
-<p>To perform a transaction, such as add or remove a fragment, you must create a {@link
-android.app.FragmentTransaction}. You can then call methods such as {@link
-android.app.FragmentTransaction#add add()} {@link android.app.FragmentTransaction#remove
-remove()}, or {@link android.app.FragmentTransaction#replace replace()}. Once you've applied all
-the changes you want to perform for the transaction, you must call {@link
-android.app.FragmentTransaction#commit commit()} and the system applies the fragment transaction to
-the activity.</p>
-
-<p>For more information about using fragments, read the <a
-href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a> documentation. Several
-samples are also available in the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#Fragment">
-API Demos</a> application.</p>
-
-
-
-
-<h3>Action Bar</h3>
-
-<p>The Action Bar is a replacement for the traditional title bar at the top of the activity window.
-It includes the application logo in the left corner and provides a new interface for items in the
-<a href="{@docRoot}guide/topics/ui/menus.html#options-menu">Options Menu</a>. Additionally, the
-Action Bar allows you to:</p>
-
-<ul>
- <li>Add menu items directly in the Action Bar—as "action items."
- <p>In your XML declaration for the menu item, include the {@code
-android:showAsAction} attribute with a value of {@code "ifRoom"}. When there's enough room, the menu
-item appears directly in the Action Bar. Otherwise, the item is placed in the
-overflow menu, revealed by the menu icon on the right side of the Action Bar.</p></li>
-
- <li>Replace an action item with a widget (such as a search box)—creating an
-"action view."
- <p>In the XML declaration for the menu item, add the {@code android:actionViewLayout} attribute
-with a layout resource or the {@code android:actionViewClass} attribute with the class name of a
-widget. (You must also declare the {@code android:showAsAction} attribute so that the item appears
-in the Action Bar.) If there's not enough room in the Action Bar and the item appears in the
-overflow menu, it behaves like a regular menu item and does not show the widget.</p></li>
-
- <li>Add an action to the application logo and replace it with a custom logo
- <p>The application logo is automatically assigned the {@code android.R.id.home} ID,
-which the system delivers to your activity's {@link android.app.Activity#onOptionsItemSelected
-onOptionsItemSelected()} callback when touched. Simply respond to this ID in your callback
-method to perform an action such as go to your application's "home" activity.</p>
- <p>To replace the icon with a logo, specify your application logo in the manifest file with the
-<a href="{@docRoot}guide/topics/manifest/application-element.html#logo">{@code android:logo}</a>
-attribute, then call {@link android.app.ActionBar#setDisplayUseLogoEnabled
-setDisplayUseLogoEnabled(true)} in your activity.</p></li>
-
- <li>Add breadcrumbs to navigate backward through the back stack of fragments</li>
- <li>Add tabs or a drop-down list to navigate through fragments</li>
- <li>Customize the Action Bar with themes and backgrounds</li>
-</ul>
-
-<p>The Action Bar is standard for all applications that use the new holographic theme, which is
-also standard when you set either the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
-android:minSdkVersion}</a> or <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
-android:targetSdkVersion}</a> to {@code "11"}.</p>
-
-<p>For more information about the Action Bar, read the <a
-href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> documentation. Several
-samples are also available in the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#ActionBar">
-API Demos</a> application.</p>
-
-
-
-
-<h3>System clipboard</h3>
-
-<p>Applications can now copy and paste data (beyond mere text) to and from the system-wide
-clipboard. Clipped data can be plain text, a URI, or an intent.</p>
-
-<p>By providing the system access to the data you want the user to copy, through a content provider,
-the user can copy complex content (such as an image or data structure) from your application and
-paste it into another application that supports that type of content.</p>
-
-<p>To start using the clipboard, get the global {@link android.content.ClipboardManager} object
-by calling {@link android.content.Context#getSystemService getSystemService(CLIPBOARD_SERVICE)}.</p>
-
-<p>To copy an item to the clipboard, you need to create a new {@link
-android.content.ClipData} object, which holds one or more {@link android.content.ClipData.Item}
-objects, each describing a single entity. To create a {@link android.content.ClipData} object
-containing just one {@link android.content.ClipData.Item}, you can use one of the helper methods,
-such as {@link android.content.ClipData#newPlainText newPlainText()}, {@link
-android.content.ClipData#newUri newUri()}, and {@link android.content.ClipData#newIntent
-newIntent()}, which each return a {@link android.content.ClipData} object pre-loaded with the
-{@link android.content.ClipData.Item} you provide.</p>
-
-<p>To add the {@link android.content.ClipData} to the clipboard, pass it to {@link
-android.content.ClipboardManager#setPrimaryClip setPrimaryClip()} for your instance of {@link
-android.content.ClipboardManager}.</p>
-
-<p>You can then read a file from the clipboard (in order to paste it) by calling {@link
-android.content.ClipboardManager#getPrimaryClip()} on the {@link
-android.content.ClipboardManager}. Handling the {@link android.content.ClipData} you receive can
-be complicated and you need to be sure you can actually handle the data type in the clipboard
-before attempting to paste it.</p>
-
-<p>The clipboard holds only one piece of clipped data (a {@link android.content.ClipData}
-object) at a time, but one {@link android.content.ClipData} can contain multiple {@link
-android.content.ClipData.Item}s.</p>
-
-<p>For more information, read the <a href="{@docRoot}guide/topics/clipboard/copy-paste.html">Copy
-and Paste</a> documentation. You can also see a simple implementation of copy and paste in the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/content/ClipboardSample.html">API Demos</a>
-and a more complete implementation in the <a
-href="{@docRoot}resources/samples/NotePad/index.html">Note Pad</a> application.</p>
-
-
-
-
-<h3>Drag and drop</h3>
-
-<p>New APIs simplify drag and drop operations in your application's user interface. A drag
-operation is the transfer of some kind of data—carried in a {@link android.content.ClipData}
-object—from one place to another. The start and end point for the drag operation is a {@link
-android.view.View}, so the APIs that directly handle the drag and drop operations are
-in the {@link android.view.View} class.</p>
-
-<p>A drag and drop operation has a lifecycle that's defined by several drag actions—each
-defined by a {@link android.view.DragEvent} object—such as {@link
-android.view.DragEvent#ACTION_DRAG_STARTED}, {@link android.view.DragEvent#ACTION_DRAG_ENTERED}, and
-{@link android.view.DragEvent#ACTION_DROP}. Each view that wants to participate in a drag
-operation can listen for these actions.</p>
-
-<p>To begin dragging content in your activity, call {@link android.view.View#startDrag startDrag()}
-on a {@link android.view.View}, providing a {@link android.content.ClipData} object that represents
-the data to drag, a {@link android.view.View.DragShadowBuilder} to facilitate the "shadow"
-that users see under their fingers while dragging, and an {@link java.lang.Object} that can share
-information about the drag object with views that may receive the object.</p>
-
-<p>To accept a drag object in a {@link android.view.View} (receive the "drop"), register the view
-with an {@link android.view.View.OnDragListener OnDragListener} by calling {@link
-android.view.View#setOnDragListener setOnDragListener()}. When a drag event occurs on the view, the
-system calls {@link android.view.View.OnDragListener#onDrag onDrag()} for the {@link
-android.view.View.OnDragListener OnDragListener}, which receives a {@link android.view.DragEvent}
-describing the type of drag action has occurred (such as {@link
-android.view.DragEvent#ACTION_DRAG_STARTED}, {@link android.view.DragEvent#ACTION_DRAG_ENTERED}, and
-{@link android.view.DragEvent#ACTION_DROP}). During a drag, the system repeatedly calls {@link
-android.view.View.OnDragListener#onDrag onDrag()} for the view underneath the drag, to deliver a
-stream of drag events. The receiving view can inquire the event type delivered to {@link
-android.view.View#onDragEvent onDragEvent()} by calling {@link android.view.DragEvent#getAction
-getAction()} on the {@link android.view.DragEvent}.</p>
-
-<p class="note"><strong>Note:</strong> Although a drag event may carry a {@link
-android.content.ClipData} object, this is not related to the system clipboard. A drag and drop
-operation should never put the dragged data in the system clipboard.</p>
-
-<p>For more information, read the <a href="{@docRoot}guide/topics/ui/drag-drop.html">Dragging and
-Dropping</a> documentation. You can also see an implementation of drag and drop in the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/DragAndDropDemo.html">
-API Demos</a> application and the <a
-href="{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a>
-application.</p>
-
-
-
-<h3>App widgets</h3>
-
-<p>Android 3.0 supports several new widget classes for more interactive app widgets on the users
-Home screen, including: {@link android.widget.GridView}, {@link android.widget.ListView}, {@link
-android.widget.StackView}, {@link android.widget.ViewFlipper}, and {@link
-android.widget.AdapterViewFlipper}.</p>
-
-<p>More importantly, you can use the new {@link android.widget.RemoteViewsService} to create app
-widgets with collections, using widgets such as {@link android.widget.GridView}, {@link
-android.widget.ListView}, and {@link android.widget.StackView} that are backed by remote data,
-such as from a content provider.</p>
-
-<p>The {@link android.appwidget.AppWidgetProviderInfo} class (defined in XML with an {@code
-<appwidget-provider>} element) also supports two new fields: {@link
-android.appwidget.AppWidgetProviderInfo#autoAdvanceViewId} and {@link
-android.appwidget.AppWidgetProviderInfo#previewImage}. The {@link
-android.appwidget.AppWidgetProviderInfo#autoAdvanceViewId} field lets you specify the view ID of the
-app widget subview that should be auto-advanced by the app widget’s host. The
-{@link android.appwidget.AppWidgetProviderInfo#previewImage} field specifies a preview of what the
-app widget looks like and is shown to the user from the widget picker. If this field is not
-supplied, the app widget's icon is used for the preview.</p>
-
-<p>To help create a preview image for your app widget (to specify in the {@link
-android.appwidget.AppWidgetProviderInfo#previewImage} field), the Android emulator includes an
-application called "Widget Preview." To create a preview image, launch this application, select the
-app widget for your application and set it up how you'd like your preview image to appear, then save
-it and place it in your application's drawable resources.</p>
-
-<p>You can see an implementation of the new app widget features in the <a
-href="{@docRoot}resources/samples/StackWidget/index.html">StackView App Widget</a> and <a
-href="{@docRoot}resources/samples/WeatherListWidget/index.html">Weather List Widget</a>
-applications.</p>
-
-
-
-<h3>Status bar notifications</h3>
-
-<p>The {@link android.app.Notification} APIs have been extended to support more content-rich status
-bar notifications, plus a new {@link android.app.Notification.Builder} class allows you to easily
-create {@link android.app.Notification} objects.</p>
-<p>New features include:</p>
-<ul>
- <li>Support for a large icon in the notification, using {@link
-android.app.Notification.Builder#setLargeIcon setLargeIcon()}. This is usually for
-social applications to show the contact photo of the person who is the source of the
-notification or for media apps to show an album thumbnail.</li>
- <li>Support for custom layouts in the status bar ticker, using {@link
-android.app.Notification.Builder#setTicker(CharSequence,RemoteViews) setTicker()}.</li>
- <li>Support for custom notification layouts to include buttons with {@link
-android.app.PendingIntent}s, for more interactive notification widgets. For example, a
-notification can control music playback without starting an activity.</li>
-</ul>
-
-
-
-<h3>Content loaders</h3>
-
-<p>New framework APIs facilitate asynchronous loading of data using the {@link
-android.content.Loader} class. You can use it in combination with UI components such as views and
-fragments to dynamically load data from worker threads. The {@link
-android.content.CursorLoader} subclass is specially designed to help you do so for data backed by
-a {@link android.content.ContentProvider}.</p>
-
-<p>All you need to do is implement the {@link android.app.LoaderManager.LoaderCallbacks
-LoaderCallbacks} interface to receive callbacks when a new loader is requested or the data has
-changed, then call {@link android.app.LoaderManager#initLoader initLoader()} to initialize the
-loader for your activity or fragment.</p>
-
-<p>For more information, read the <a
-href="{@docRoot}guide/topics/fundamentals/loaders.html">Loaders</a> documentation. You can also see
-example code using loaders in the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderCursor.html">LoaderCursor</a>
-and <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/LoaderThrottle.html">
-LoaderThrottle</a> samples.</p>
-
-
-
-<h3>Bluetooth A2DP and headset APIs</h3>
-
-<p>Android now includes APIs for applications to verify the state of connected Bluetooth A2DP and
-headset profile devices. For example, applications can identify when a Bluetooth headset is
-connected for listening to music and notify the user as appropriate. Applications can also receive
-broadcasts for vendor specific AT commands and notify the user about the state of the connected
-device, such as when the connected device's battery is low.</p>
-
-<p>You can initialize the respective {@link android.bluetooth.BluetoothProfile} by calling {@link
-android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()} with either the {@link
-android.bluetooth.BluetoothProfile#A2DP} or {@link android.bluetooth.BluetoothProfile#HEADSET}
-profile constant and a {@link android.bluetooth.BluetoothProfile.ServiceListener} to receive
-callbacks when the Bluetooth client is connected or disconnected.</p>
-
-
-
-
-<h3 id="animation">Animation framework</h3>
-
-<p>An all new flexible animation framework allows you to animate arbitrary properties of any object
-(View, Drawable, Fragment, Object, or anything else). It allows you to define several aspects of an
-animation, such as:</p>
-<ul>
- <li>Duration</li>
- <li>Repeat amount and behavior</li>
- <li>Type of time interpolation</li>
- <li>Animator sets to play animations together, sequentially, or after specified delays</li>
- <li>Frame refresh delay</li>
-</ul>
-
- <p>You can define these animation aspects, and others, for an object's int, float, and hexadecimal
-color values, by default. That is, when an object has a property field for one of these types, you
-can change its value over time to affect an animation. To animate any other type of value, you tell
-the system how to calculate the values for that given type, by implementing the {@link
-android.animation.TypeEvaluator} interface.</p>
-
-<p>There are two animators you can use to animate the values of a property: {@link
-android.animation.ValueAnimator} and {@link android.animation.ObjectAnimator}. The {@link
-android.animation.ValueAnimator} computes the animation values, but is not aware of the specific
-object or property that is animated as a result. It simply performs the calculations, and you must
-listen for the updates and process the data with your own logic. The {@link
-android.animation.ObjectAnimator} is a subclass of {@link android.animation.ValueAnimator} and
-allows you to set the object and property to animate, and it handles all animation work.
-That is, you give the {@link android.animation.ObjectAnimator} the object to animate, the
-property of the object to change over time, and a set of values to apply to the property over
-time, then start the animation.</p>
-
-<p>Additionally, the {@link android.animation.LayoutTransition} class enables automatic transition
-animations for changes you make to your activity layout. To enable transitions for part of the
-layout, create a {@link android.animation.LayoutTransition} object and set it on
-any {@link android.view.ViewGroup} by calling {@link
-android.view.ViewGroup#setLayoutTransition setLayoutTransition()}. This causes default
-animations to run whenever items are added to or removed from the group. To specify custom
-animations, call {@link android.animation.LayoutTransition#setAnimator setAnimator()} on the {@link
-android.animation.LayoutTransition} and provide a custom {@link android.animation.Animator},
-such as a {@link android.animation.ValueAnimator} or {@link android.animation.ObjectAnimator}
-discussed above.</p>
-
-<p>For more information, see the <a
-href="{@docRoot}guide/topics/graphics/animation.html">Property Animation</a> documentation. You can
-also see several samples using the animation APIs in the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/animation/index.html">API
-Demos</a> application.</p>
-
-
-
-
-<h3>Extended UI framework</h3>
-
-<ul>
-
- <li><b>Multiple-choice selection for ListView and GridView</b>
-
-<p>New {@link android.widget.AbsListView#CHOICE_MODE_MULTIPLE_MODAL} mode for {@link
-android.widget.AbsListView#setChoiceMode setChoiceMode()} allows users to select multiple items
-from a {@link android.widget.ListView} or {@link android.widget.GridView}. When used in
-conjunction with the Action Bar, users can select multiple items and then select the action to
-perform from a list of options in the Action Bar (which has transformed into a Multi-choice
-Action Mode).</p>
-
-<p>To enable multiple-choice selection, call {@link
-android.widget.AbsListView#setChoiceMode setChoiceMode(CHOICE_MODE_MULTIPLE_MODAL)} and register a
-{@link android.widget.AbsListView.MultiChoiceModeListener MultiChoiceModeListener} with {@link
-android.widget.AbsListView#setMultiChoiceModeListener setMultiChoiceModeListener()}.</p>
-
-<p>When the user performs a long-press on an item, the Action Bar switches to the Multi-choice
-Action Mode. The system notifies the {@link android.widget.AbsListView.MultiChoiceModeListener
-MultiChoiceModeListener} when items are selected by calling {@link
-android.widget.AbsListView.MultiChoiceModeListener#onItemCheckedStateChanged
-onItemCheckedStateChanged()}.</p>
-
-<p>For an example of multiple-choice selection, see the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/List15.html">List15.
-java</a>
-class in the API Demos sample application.</p>
- </li>
-
-
- <li><b>New APIs to transform views</b>
-
- <p>New APIs allow you to easily apply 2D and 3D transformations to views in your activity
-layout. New transformations are made possible with a set of object properties that define the view's
-layout position, orientation, transparency and more.</p>
- <p>New methods to set the view properties include: {@link android.view.View#setAlpha
-setAlpha()}, {@link
-android.view.View#setBottom setBottom()}, {@link android.view.View#setLeft setLeft()}, {@link
-android.view.View#setRight setRight()}, {@link android.view.View#setBottom setBottom()}, {@link
-android.view.View#setPivotX setPivotX()}, {@link android.view.View#setPivotY setPivotY()}, {@link
-android.view.View#setRotationX setRotationX()}, {@link android.view.View#setRotationY
-setRotationY()}, {@link android.view.View#setScaleX setScaleX()}, {@link android.view.View#setScaleY
-setScaleY()}, {@link android.view.View#setAlpha setAlpha()}, and others.</p>
-
- <p>Some methods also have a corresponding XML attribute that you can specify in your layout
-file, to apply a default transformation. Available attributes include: {@code translationX}, {@code
-translationY}, {@code rotation},
-{@code rotationX}, {@code rotationY}, {@code scaleX}, {@code scaleY}, {@code transformPivotX},
-{@code transformPivotY}, and {@code alpha}.</p>
-
- <p>Using some of these new view properties in combination with the new <a
-href="#animation">animation framework</a> (discussed
-above), you can easily apply some fancy animations to your views. For example, to rotate a
-view on its y-axis, supply {@link android.animation.ObjectAnimator} with the {@link
-android.view.View}, the "rotationY" property, and the start and end values:</p>
-<pre>
-ObjectAnimator animator = ObjectAnimator.ofFloat(myView, "rotationY", 0, 360);
-animator.setDuration(2000);
-animator.start();
-</pre>
- </li>
-
-
- <li><b>New holographic themes</b>
-
- <p>The standard system widgets and overall look have been redesigned and incorporate a new
-"holographic" user interface theme. The system applies the new theme
-using the standard <a href="{@docRoot}guide/topics/ui/themes.html">style and theme</a> system.</p>
-
-<p>Any application that targets the Android 3.0 platform—by setting either the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code android:minSdkVersion}</a>
-or <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
-android:targetSdkVersion}</a> value to {@code "11"}—inherits the holographic theme by default.
-However, if your application also applies its own theme, then your theme will override the
-holographic theme, unless you update your styles to inherit the holographic theme.</p>
-
-<p>To apply the holographic theme to individual activities or to inherit them in your own theme
-definitions, use one of several new {@link android.R.style#Theme_Holo Theme.Holo}
-themes. If your application is compatible with version of Android lower than 3.0 and applies
-custom themes, then you should <a
-href="{@docRoot}guide/topics/ui/themes.html#SelectATheme">select a theme based on platform
-version</a>.</p>
-
- </li>
-
-
- <li><b>New widgets</b>
-
- <ul>
- <li>{@link android.widget.AdapterViewAnimator}
- <p>Base class for an {@link android.widget.AdapterView} that performs animations when switching
- between its views.</p></li>
-
- <li>{@link android.widget.AdapterViewFlipper}
- <p>Simple {@link android.widget.ViewAnimator} that animates between two or more views that have
- been added to it. Only one child is shown at a time. If requested, it can automatically flip
- between
- each child at a regular interval.</p></li>
-
- <li>{@link android.widget.CalendarView}
- <p>Allows users to select dates from a calendar by touching the date and can scroll or fling the
-calendar to a desired date. You can configure the range of dates available in the widget.</p></li>
-
- <li>{@link android.widget.ListPopupWindow}
- <p>Anchors itself to a host view and displays a list of choices, such as for a list of
- suggestions when typing into an {@link android.widget.EditText} view.</p></li>
-
- <li>{@link android.widget.NumberPicker}
- <p>Enables the user to select a number from a predefined range. The widget presents an input
-field and up and down buttons for selecting a number. Touching the input field allows the user to
-scroll through values or touch again to directly edit the current value. It also allows you to map
-positions to strings, so that the corresponding string is displayed instead of the index
-position.</p></li>
-
- <li>{@link android.widget.PopupMenu}
- <p>Displays a {@link android.view.Menu} in a modal popup window that's anchored to a view. The
-popup appears below the anchor view if there is room, or above it if there is not. If the IME (soft
-keyboard) is visible, the popup does not overlap the IME it until the user touches the
-menu.</p></li>
-
- <li>{@link android.widget.SearchView}
- <p>Provides a search box that you can configure to deliver search queries to a specified
-activity and display search suggestions (in the same manner as the traditional search dialog). This
-widget is particularly useful for offering a search widget in the Action Bar. For more information,
-see <a href="{@docRoot}guide/topics/search/search-dialog.html">Creating a Search Interface.</p></li>
-
- <li>{@link android.widget.StackView}
- <p>A view that displays its children in a 3D stack and allows users to swipe through
- views like a rolodex.</p></li>
-
- </ul>
- </li>
-
-</ul>
-
-
-
-<h3>Graphics</h3>
-
-<ul>
- <li><b>Hardware accelerated 2D graphics</b>
-
-<p>You can now enable the OpenGL renderer for your application by setting {@code
-android:hardwareAccelerated="true"} in your manifest element's <a
-href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
-element or for individual <a
-href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a>
-elements.</p>
-
-<p>This flag helps applications by making them draw faster. This results in smoother animations,
-smoother scrolling, and overall better performance and response to user interaction.</p></li>
-
-
- <li><b>View support for hardware and software layers</b>
-
- <p>By default, a {@link android.view.View} has no layer specified. You can specify that the
-view be backed by either a hardware or software layer, specified by values {@link
-android.view.View#LAYER_TYPE_HARDWARE} and {@link android.view.View#LAYER_TYPE_SOFTWARE}, using
-{@link android.view.View#setLayerType setLayerType()} or the <a
-href="{@docRoot}reference/android/view/View.html#attr_android:layerType">{@code layerType}</a>
-attribute.</p>
- <p>A hardware layer is backed by a hardware specific texture (generally Frame Buffer Objects or
-FBO on OpenGL hardware) and causes the view to be rendered using Android's hardware rendering
-pipeline, but only if hardware acceleration is turned on for the view hierarchy. When hardware
-acceleration is turned off, hardware layers behave exactly as software layers.</p>
- <p>A software layer is backed by a bitmap and causes the view to be rendered using Android's
-software rendering pipeline, even if hardware acceleration is enabled. Software layers should be
-avoided when the affected view tree updates often. Every update will require to re-render the
-software layer, which can potentially be slow.</p>
- <p>For more information, see the {@link android.view.View#LAYER_TYPE_HARDWARE} and {@link
-android.view.View#LAYER_TYPE_SOFTWARE} documentation.</p>
- </li>
-
-
- <li><b>Renderscript 3D graphics engine</b>
-
-<p>Renderscript is a runtime 3D framework that provides both an API for building 3D scenes as well
-as a special, platform-independent shader language for maximum performance. Using Renderscript, you
-can accelerate graphics operations and data processing. Renderscript is an ideal way to create
-high-performance 3D effects for applications, wallpapers, carousels, and more.</p>
-<p>For more information, see the <a
-href="{@docRoot}guide/topics/graphics/renderscript.html">3D Rendering and Computation with
-Renderscript</a> documentation.</p></li>
-</ul>
-
-
-
-
-<h3>Media</h3>
-
-
-<ul>
-
- <li><b>Time lapse video</b>
-
-<p>Camcorder APIs now support the ability to record time lapse video. The {@link
-android.media.MediaRecorder#setCaptureRate setCaptureRate()} sets the rate at which frames
-should be captured.</p></li>
-
- <li><b>Texture support for image streams</b>
-
-<p>New {@link android.graphics.SurfaceTexture} allows you to capture an image stream as an OpenGL ES
-texture. By calling {@link android.hardware.Camera#setPreviewTexture setPreviewTexture()} for your
-{@link android.hardware.Camera} instance, you can specify the {@link
-android.graphics.SurfaceTexture} upon which to draw video playback or preview frames from the
-camera.</p></li>
-
- <li><b>HTTP Live streaming</b>
-
-<p>Applications can now pass an M3U playlist URL to the media framework to begin an HTTP Live
-streaming session. The media framework supports most of the HTTP Live streaming specification,
-including adaptive bit rate. See the <a
-href="{@docRoot}guide/appendix/media-formats.html">Supported Media Formats</a> document for
-more information.</p></li>
-
- <li><b>EXIF data</b>
-
-<p>The {@link android.media.ExifInterface} includes new fields for photo aperture, ISO, and exposure
-time.</p></li>
-
- <li><b>Camcorder profiles</b>
-
-<p>New {@link android.media.CamcorderProfile#hasProfile hasProfile()} method and several video
-quality profiles (such as {@link android.media.CamcorderProfile#QUALITY_1080P}, {@link
-android.media.CamcorderProfile#QUALITY_720P}, {@link
-android.media.CamcorderProfile#QUALITY_CIF}, and others) allow you to determine camcorder
-quality options.</p></li>
-
- <li><b>Digital media file transfer</b>
-
-<p>The platform includes built-in support for Media/Picture Transfer Protocol (MTP/PTP) over USB,
-which lets users easily transfer any type of media files between devices and to a host computer.
-Developers can build on this support, creating applications that let users create or manage rich
-media files that they may want to transfer or share across devices. </p></li>
-
- <li><b>Digital rights management (DRM)</b>
-
-<p>New extensible digital rights management (DRM) framework for checking and enforcing digital
-rights. It's implemented in two architectural layers:</p>
-<ul>
- <li>A DRM framework API, which is exposed to applications and runs through the Dalvik VM for
-standard applications.</li>
- <li>A native code DRM manager that implements the framework API and exposes an interface for DRM
-plug-ins to handle rights management and decryption for various DRM schemes.</li>
-</ul>
-
-<p>For application developers, the framework offers an abstract, unified API that simplifies the
-management of protected content. The API hides the complexity of DRM operations and allows a
-consistent operation mode for both protected and unprotected content, and across a variety of DRM
-schemes.</p>
-
-<p>For device manufacturers, content owners, and Internet digital media providers the DRM
-framework?s plugin API provides a means of adding support for a DRM scheme of choice into the
-Android system, for secure enforcement of content protection.</p>
-
-<p>The preview release does not provide any native DRM plug-ins for checking and enforcing digital
-rights. However, device manufacturers may ship DRM plug-ins with their devices.</p>
-
-<p>You can find all of the DRM APIs in the {@link android.drm} package.</p></li>
-
-</ul>
-
-
-
-<h3>Keyboard support</h3>
-
-<ul>
-<li>Support for Control, Meta, Caps Lock, Num Lock and Scroll Lock modifiers. For more information,
-see {@link android.view.KeyEvent#META_CTRL_ON} and related fields.</li>
-
-<li>Support for full desktop-style keyboards, including support for keys such as Escape, Home, End,
-Delete and others. You can determine whether key events are coming from a full keyboard by
-querying {@link android.view.KeyCharacterMap#getKeyboardType()} and checking for {@link
-android.view.KeyCharacterMap#FULL KeyCharacterMap.FULL}</li>
-
-<li>{@link android.widget.TextView} now supports keyboard-based cut, copy, paste, and select-all,
-using the key combinations Ctrl+X, Ctrl+C, Ctrl+V, and Ctrl+A. It also supports PageUp/PageDown,
-Home/End, and keyboard-based text selection.</li>
-
-<li>{@link android.view.KeyEvent} adds several new methods to make it easier to check the key
-modifier state correctly and consistently. See {@link android.view.KeyEvent#hasModifiers(int)},
-{@link android.view.KeyEvent#hasNoModifiers()},
-{@link android.view.KeyEvent#metaStateHasModifiers(int,int) metaStateHasModifiers()},
-{@link android.view.KeyEvent#metaStateHasNoModifiers(int) metaStateHasNoModifiers()}.</li>
-
-<li>Applications can implement custom keyboard shortcuts by subclassing {@link
-android.app.Activity}, {@link android.app.Dialog}, or {@link android.view.View} and implementing
-{@link android.app.Activity#onKeyShortcut onKeyShortcut()}. The framework calls this method
-whenever a key is combined with Ctrl key. When creating an <a
-href="{@docRoot}guide/topics/ui/menus.html#options-menu">Options Menu</a>, you can register keyboard
-shortcuts by setting either the {@code android:alphabeticShortcut} or {@code
-android:numericShortcut} attribute for each <a
-href="{@docRoot}guide/topics/resources/menu-resource.html#item-element">{@code <item>}</a>
-element (or with {@link android.view.MenuItem#setShortcut setShortcut()}).</li>
-
-<li>Android 3.0 includes a new "virtual keyboard" device with the id {@link
-android.view.KeyCharacterMap#VIRTUAL_KEYBOARD KeyCharacterMap.VIRTUAL_KEYBOARD}. The virtual
-keyboard has a desktop-style US key map which is useful for synthesizing key events for testing
-input.</li>
-
-</ul>
-
-
-
-
-<h3>Split touch events</h3>
-
-<p>Previously, only a single view could accept touch events at one time. Android 3.0
-adds support for splitting touch events across views and even windows, so different views can accept
-simultaneous touch events.</p>
-
-<p>Split touch events is enabled by default when an application targets
-Android 3.0. That is, when the application has set either the <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code android:minSdkVersion}</a>
-or <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
-android:targetSdkVersion}</a> attribute's value to {@code "11"}.</p>
-
-<p>However, the following properties allow you to disable split touch events across views inside
-specific view groups and across windows.</p>
-
-<ul>
-<li>The {@link android.R.attr#splitMotionEvents android:splitMotionEvents} attribute for view groups
-allows you to disable split touch events that occur between child views in a layout. For example:
-<pre>
-<LinearLayout android:splitMotionEvents="false" ... >
- ...
-</LinearLayout>
-</pre>
-<p>This way, child views in the linear layout cannot split touch events—only one view can
-receive touch events at a time.</p>
-</li>
-
-<li>The {@link android.R.attr#windowEnableSplitTouch android:windowEnableSplitTouch} style property
-allows you to disable split touch events across windows, by applying it to a theme for the activity
-or entire application. For example:
-<pre>
-<style name="NoSplitMotionEvents" parent="android:Theme.Holo">
- <item name="android:windowEnableSplitTouch">false</item>
- ...
-</style>
-</pre>
-<p>When this theme is applied to an <a
-href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> or <a
-href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>,
-only touch events within the current activity window are accepted. For example, by disabling split
-touch events across windows, the system bar cannot receive touch events at the same time as the
-activity. This does <em>not</em> affect whether views inside the activity can split touch
-events—by default, the activity can still split touch events across views.</p>
-
-<p>For more information about creating a theme, read <a
-href="{@docRoot}guide/topics/ui/themes.html">Applying Styles and Themes</a>.</p>
-</li>
-</ul>
-
-
-
-<h3>WebKit</h3>
-
-<ul>
- <li>New {@link android.webkit.WebViewFragment} class to create a fragment composed of a
-{@link android.webkit.WebView}.</li>
- <li>New {@link android.webkit.WebSettings} methods:
- <ul>
- <li>{@link
-android.webkit.WebSettings#setDisplayZoomControls setDisplayZoomControls()} allows you to hide
-the on-screen zoom controls while still allowing the user to zoom with finger gestures ({@link
-android.webkit.WebSettings#setBuiltInZoomControls setBuiltInZoomControls()} must be set
-{@code true}).</li>
- <li>New {@link android.webkit.WebSettings} method, {@link
-android.webkit.WebSettings#setEnableSmoothTransition setEnableSmoothTransition()}, allows you
-to enable smooth transitions when panning and zooming. When enabled, WebView will choose a solution
-to maximize the performance (for example, the WebView's content may not update during the
-transition).</li>
- </ul>
- <li>New {@link android.webkit.WebView} methods:
- <ul>
- <li>{@link android.webkit.WebView#onPause onPause()} callback, to pause any processing
-associated with the WebView when it becomes hidden. This is useful to reduce unnecessary CPU or
-network traffic when the WebView is not in the foreground.</li>
- <li>{@link android.webkit.WebView#onResume onResume()} callback, to resume processing
-associated with the WebView, which was paused during {@link android.webkit.WebView#onPause
-onPause()}.</li>
- <li>{@link android.webkit.WebView#saveWebArchive saveWebArchive()} allows you to save the
-current view as a web archive on the device.</li>
- <li>{@link android.webkit.WebView#showFindDialog showFindDialog()} initiates a text search in
-the current view.</li>
- </ul>
- </li>
-</ul>
-
-
-
-<h3>Browser</h3>
-
-<p>The Browser application adds the following features to support web applications:</p>
-
-<ul>
- <li><b>Media capture</b>
- <p>As defined by the <a href="http://dev.w3.org/2009/dap/camera/">HTML Media Capture</a>
-specification, the Browser allows web applications to access audio, image and video capture
-capabilities of the device. For example, the following HTML provides an input for the user to
-capture a photo to upload:</p>
-<pre>
-<input type="file" accept="image/*;capture=camera" />
-</pre>
-<p>Or by excluding the {@code capture=camera} parameter, the user can choose to either capture a
-new image with the camera or select one from the device (such as from the Gallery application).</p>
- </li>
-
- <li><b>Device Orientation</b>
- <p>As defined by the <a
-href="http://dev.w3.org/geo/api/spec-source-orientation.html">Device Orientation Event</a>
-specification, the Browser allows web applications to listen to DOM events that provide information
-about the physical orientation and motion of the device.</p>
- <p>The device orientation is expressed with the x, y, and z axes, in degrees and motion is
-expressed with acceleration and rotation rate data. A web page can register for orientation
-events by calling {@code window.addEventListener} with event type {@code "deviceorientation"}
-and register for motion events by registering the {@code "devicemotion"} event type.</p>
- </li>
-
- <li><b>CSS 3D Transforms</b>
- <p>As defined by the <a href="http://www.w3.org/TR/css3-3d-transforms/">CSS 3D Transform
-Module</a> specification, the Browser allows elements rendered by CSS to be transformed in three
-dimensions.</p>
- </li>
-</ul>
-
-
-
-<h3>JSON utilities</h3>
-
-<p>New classes, {@link android.util.JsonReader} and {@link android.util.JsonWriter}, help you
-read and write JSON streams. The new APIs complement the {@link org.json} classes, which manipulate
-a document in memory.</p>
-
-<p>You can create an instance of {@link android.util.JsonReader} by calling
-its constructor method and passing the {@link java.io.InputStreamReader} that feeds the JSON string.
-Then begin reading an object by calling {@link android.util.JsonReader#beginObject()}, read a
-key name with {@link android.util.JsonReader#nextName()}, read the value using methods
-respective to the type, such as {@link android.util.JsonReader#nextString()} and {@link
-android.util.JsonReader#nextInt()}, and continue doing so while {@link
-android.util.JsonReader#hasNext()} is true.</p>
-
-<p>You can create an instance of {@link android.util.JsonWriter} by calling its constructor and
-passing the appropriate {@link java.io.OutputStreamWriter}. Then write the JSON data in a manner
-similar to the reader, using {@link android.util.JsonWriter#name name()} to add a property name
-and an appropriate {@link android.util.JsonWriter#value value()} method to add the respective
-value.</p>
-
-<p>These classes are strict by default. The {@link android.util.JsonReader#setLenient setLenient()}
-method in each class configures them to be more liberal in what they accept. This lenient
-parse mode is also compatible with the {@link org.json}'s default parser.</p>
-
-
-
-
-<h3>New feature constants</h3>
-
-<p>The <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
-manfest element should be used to inform external entities (such as Google Play) of the set of
-hardware and software features on which your application depends. In this release, Android adds the
-following new constants that applications can declare with this element:</p>
-
-<ul>
- <li>{@link android.content.pm.PackageManager#FEATURE_FAKETOUCH "android.hardware.faketouch"}
- <p>When declared, this indicates that the application is compatible with a device that offers an
-emulated touchscreen (or better). A device that offers an emulated touchscreen provides a user input
-system that can emulate a subset of touchscreen
-capabilities. An example of such an input system is a mouse or remote control that drives an
-on-screen cursor. Such input systems support basic touch events like click down, click up, and drag.
-However, more complicated input types (such as gestures, flings, etc.) may be more difficult or
-impossible on faketouch devices (and multitouch gestures are definitely not possible).</p>
- <p>If your application does <em>not</em> require complicated gestures and you do
-<em>not</em> want your application filtered from devices with an emulated touchscreen, you
-should declare {@link
-android.content.pm.PackageManager#FEATURE_FAKETOUCH "android.hardware.faketouch"} with a <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
-element. This way, your application will be available to the greatest number of device types,
-including those that provide only an emulated touchscreen input.</p>
- <p>All devices that include a touchscreen also support {@link
-android.content.pm.PackageManager#FEATURE_FAKETOUCH "android.hardware.faketouch"}, because
-touchscreen capabilities are a superset of faketouch capabilities. Thus, unless you actually require
-a touchscreen, you should add a <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
-element for faketouch.</p>
- </li>
-</ul>
-
-
-
-
-<h3>New permissions</h3>
-
-<ul>
- <li>{@link android.Manifest.permission#BIND_REMOTEVIEWS
-"android.permission.BIND_REMOTEVIEWS"}
- <p>This must be declared as a required permission in the <a
-href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> manifest
-element for an implementation of {@link android.widget.RemoteViewsService}. For example, when
-creating an App Widget that uses {@link android.widget.RemoteViewsService} to populate a
-collection view, the manifest entry may look like this:</p>
-<pre>
-<service android:name=".widget.WidgetService"
- android:exported="false"
- android:permission="android.permission.BIND_REMOTEVIEWS" />
-</pre>
-</ul>
-
-
-
-<h3>New platform technologies</h3>
-
-<ul>
-<li><strong>Storage</strong>
- <ul>
- <li>ext4 file system support to enable onboard eMMC storage.</li>
- <li>FUSE file system to support MTP devices.</li>
- <li>USB host mode support to support keyboards and USB hubs.</li>
- <li>Support for MTP/PTP </li>
- </ul>
-</li>
-
-<li><strong>Linux Kernel</strong>
- <ul>
- <li>Upgraded to 2.6.36</li>
- </ul>
-</li>
-
-<li><strong>Dalvik VM</strong>
- <ul>
- <li>New code to support and optimize for SMP</li>
- <li>Various improvements to the JIT infrastructure</li>
- <li>Garbage collector improvements:
- <ul>
- <li>Tuned for SMP</li>
- <li>Support for larger heap sizes</li>
- <li>Unified handling for bitmaps and byte buffers</li>
- </ul>
- </li>
- </ul>
-</li>
-
-<li><strong>Dalvik Core Libraries</strong>
- <ul>
- <li>New, much faster implementation of NIO (modern I/O library)</li>
- <li>Improved exception messages</li>
- <li>Correctness and performance fixes throughout</li>
- </ul>
-</li>
-</ul>
-
-
-
-<h3 id="api-diff">API differences report</h3>
-
-<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API Level
-{@sdkPlatformApiLevel}), see the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API Differences Report</a>.</p>
-
-
-
-
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
-the framework API. The Android {@sdkPlatformVersion} API
-is assigned an integer identifier —
-<strong>{@sdkPlatformApiLevel}</strong> — that is
-stored in the system itself. This identifier, called the "API Level", allows the
-system to correctly determine whether an application is compatible with
-the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
-you need compile the application against the Android library that is provided in
-the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
-also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
-attribute to the <code><uses-sdk></code> element in the application's
-manifest. If your application is designed to run only on Android 2.3 and higher,
-declaring the attribute prevents the application from being installed on earlier
-versions of the platform.</p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>API Demos</li>
-<li>Browser</li>
-<li>Calculator</li>
-<li>Camera</li>
-<li>Clock</li>
-<li>Contacts</li>
-<li>Custom Locale</li>
-<li>Dev Tools</li>
-<li>Downloads</li>
-<li>Email</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<ul>
-<li>Gallery</li>
-<li>Gestures Builder</li>
-<li>Messaging</li>
-<li>Music</li>
-<li>Search</li>
-<li>Settings</li>
-<li>Spare Parts</li>
-<li>Speech Recorder</li>
-<li>Widget Preview</li>
-</ul>
-</td>
-</tr>
-</table>
-
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable SDK platform provides a variety of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android 3.0 system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
-descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Arabic, Egypt (ar_EG)</li>
-<li>Arabic, Israel (ar_IL)</li>
-<li>Bulgarian, Bulgaria (bg_BG)</li>
-<li>Catalan, Spain (ca_ES)</li>
-<li>Czech, Czech Republic (cs_CZ)</li>
-<li>Danish, Denmark(da_DK)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Greek, Greece (el_GR)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Ireland (en_IE)</li>
-<li>English, India (en_IN)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>English, US (en_US)</li>
-<li>English, South Africa (en_ZA)</li>
-<li>Spanish (es_ES)</li>
-<li>Spanish, US (es_US)</li>
-<li>Finnish, Finland (fi_FI)</li>
-<li>French, Belgium (fr_BE)</li>
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>French, France (fr_FR)</li>
-<li>Hebrew, Israel (he_IL)</li>
-<li>Hindi, India (hi_IN)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>Croatian, Croatia (hr_HR)</li>
-<li>Hungarian, Hungary (hu_HU)</li>
-<li>Indonesian, Indonesia (id_ID)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Lithuanian, Lithuania (lt_LT)</li>
-<li>Latvian, Latvia (lv_LV)</li>
-<li>Norwegian bokmål, Norway (nb_NO)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Polish (pl_PL)</li>
-<li>Portuguese, Brazil (pt_BR)</li>
-<li>Portuguese, Portugal (pt_PT)</li>
-<li>Romanian, Romania (ro_RO)</li>
-<li>Russian (ru_RU)</li></li>
-<li>Slovak, Slovakia (sk_SK)</li>
-<li>Slovenian, Slovenia (sl_SI)</li>
-<li>Serbian (sr_RS)</li>
-<li>Swedish, Sweden (sv_SE)</li>
-<li>Thai, Thailand (th_TH)</li>
-<li>Tagalog, Philippines (tl_PH)</li>
-<li>Turkish, Turkey (tr_TR)</li>
-<li>Ukrainian, Ukraine (uk_UA)</li>
-<li>Vietnamese, Vietnam (vi_VN)</li>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-</td>
-</tr>
-</table>
-
-<p class="note"><strong>Note:</strong> The Android platform may support more
-locales than are included in the SDK system image. All of the supported locales
-are available in the <a href="http://source.android.com/">Android Open Source
-Project</a>.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes the following emulator skin:</p>
-
-<ul>
- <li>
- WXGA (1280x800, medium density, xlarge screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays
-and functions properly on all Android-powered devices, see <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
\ No newline at end of file
diff --git a/docs/html/sdk/android-3.1-highlights.jd b/docs/html/sdk/android-3.1-highlights.jd
deleted file mode 100644
index 88bc1ee..0000000
--- a/docs/html/sdk/android-3.1-highlights.jd
+++ /dev/null
@@ -1,380 +0,0 @@
-page.title=Android 3.1 Platform Highlights
-
-@jd:body
-
-
-<style type="text/css">
-#jd-content {
- max-width:1200px;
-}
-#jd-content div.screenshot {
- float:left;
- clear:left;
- padding:15px 30px 15px 0;
-}
-#jd-content div.video {
- float:right;
- padding:0 60px 40px;
- margin-top:-15px;
-}
-#jd-content table.columns {
- margin:0 0 1em 0;
-}
-#jd-content table.columns td {
- padding:0;
-}
-#jd-content table.columns td+td {
- padding:0 2em;
-}
-#jd-content table.columns td img {
- margin:0;
-}
-#jd-content table.columns td+td>*:first-child {
- margin-top:-2em;
-}
-.green {
- color:#8db529;
- font-weight:bold;
-}
-</style>
-
-<p>Welcome to Android 3.1!</p>
-
-<p>Android 3.1 is an incremental platform release that refines many of the
-features introduced in Android 3.0. It builds on the same tablet-optimized UI
-and features offered in Android 3.0 and adds several new capabilities for
-users and developers. This document provides an overview of the new features and
-technologies introduced in Android 3.1. For a more detailed look at new
-developer APIs, see the <a href="{@docRoot}sdk/android-3.1.html">API
-Overview</a> document.</p>
-
-<p>For a high-level introduction to Android 3.0, please see the <a
-href="{@docRoot}sdk/android-3.0-highlights.html">Android 3.0 Platform
-Highlights</a>.</p>
-
-<ul>
- <li><a href="#UserFeatures">New User Features</a></li>
- <li><a href="#DeveloperApis">New Developer Features</a></li>
-</ul>
-
-<h2 id="UserFeatures" style="clear:right">New User Features</h2>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;margin-left:1em;float:right;padding-top:2em;"><a href="images/3.1/home_full.png" target="_android"><img src="images/3.1/home.png" alt="" height="280" /></a>
-<div style="padding-left:1.25em;padding-bottom:1.25em;width:450px;font-size:.9em"><strong>Figure 1.</strong> An Android 3.1 Home screen.</div>
-</div>
-
-<h3>UI refinements</h3>
-
-<p>The Android 3.1 platform adds a variety of refinements to make the user
-interface more intuitive and more efficient to use.</p>
-
-<p>UI transitions are improved throughout the system and across the standard
-apps. The Launcher animation is optimized for faster, smoother transition to and
-from the Apps list. Adjustments in color, positioning, and text make UI elements
-easier to see, understand, and use. Accessibility is improved with consistent
-audible feedback throughout the UI and a new setting to let users customize the
-touch-hold interval to meet their needs.</p>
-
-<p>Navigation to and from the five home screens is now easier — touching
-the Home button in the system bar now takes you to the home screen most recently
-used. Settings offers an improved view of internal storage,
-showing the storage used by a larger set of file types. </p>
-
-<h3 id="accessories">Connectivity for USB accessories</h3>
-
-<p>Android 3.1 adds broad platform support for a variety of USB-connected
-peripherals and accessories. Users can attach many types of input devices
-(keyboards, mice, game controllers) and digital cameras. Applications can build
-on the platform’s USB support to extend connectivity to almost any type of USB
-device.</p>
-
-<p>The platform also adds new support for USB accessories — external
-hardware devices designed to attach to Android-powered devices as USB hosts. When an
-accessory is attached, the framework will look for a corresponding application
-and offer to launch it for the user. The accessory can also present a URL
-to the user, for downloading an appropriate application if one is not already
-installed. Users can interact with the application to control powered accessories such
-as robotics controllers; docking stations; diagnostic and musical equipment;
-kiosks; card readers; and much more.</p>
-
-<p>The platform’s USB capabilities rely on components in device hardware, so
-support for USB on specific devices may vary and is determined by device
-manufacturers.</p>
-
-<div style="padding-top:0em;">
-<div style="margin-right:.8em;float:left;width:200px;"><img src="{@docRoot}sdk/images/3.1/tasks.png" alt="" />
-<div style="padding-left:1em;padding-bottom:1em;xwidth:auto;font-size:.9em"><strong>Figure 2.</strong> The Recent Apps menu is now expandable and scrollable.</div>
-</div>
-
-<h3 id="recentapps">Expanded Recent Apps list</h3>
-
-<p>For improved multitasking and instant visual access to a much larger number
-of apps, the Recent Apps list is now expandable. Users can now scroll the list
-of recent apps vertically to see thumbnail images all of the tasks in progress
-and recently used apps, then touch a thumbnail to jump back into that task.</p>
-
-<h3 id="resizewidgets">Resizeable Home screen widgets</h3>
-
-<p>For more flexible Home screen customization, users can now resize their Home
-screen widgets using drag bars provided by the system. Users can expand widgets
-both horizontally and/or vertically to include more content, where supported by
-each widget.</p>
-
-
-<h3 id="keyboards">Support for external keyboards
-and pointing devices</h3>
-
-<p>Users can now attach almost any type of external keyboard or mouse to their
-Android-powered devices, to create a familiar environment and work more
-efficiently. One or more input devices can be attached to the system simultaneously
-over USB and/or Bluetooth HID, in any combination. No special configuration or
-driver is needed, in most cases. When multiple devices are connected, users can
-conveniently manage the active keyboard and IME using the keyboard settings that
-are available from the System bar.</p>
-
-<p>For pointing devices, the platform supports most types of mouse with a single
-button and optionally a scroll wheel, as well as similar devices such as
-trackballs. When these are connected, users can interact with the UI using
-point, select, drag, scroll, hover, and other standard actions.</p>
-
-<h3 id="joysticks">Support for joysticks and gamepads</h3>
-
-<p>To make the platform even better for gaming, Android 3.1 adds support for
-most PC joysticks and gamepads that are connected over USB or Bluetooth HID.</p>
-
-<p>For example, users can connect PlayStation<sup>®</sup>3 and Xbox 360<sup>®</sup>
-game controllers over USB (but not Bluetooth), Logitech Dual Action™ gamepads and
-flight sticks, or a car racing controller. Game controllers that use proprietary
-networking or pairing are not supported by default, but in general, the platform
-supports most PC-connectible joysticks and gamepads.</p>
-
-<h3 id="wifi">Robust Wi-Fi networking</h3>
-
-<p>Android 3.1 adds robust Wi-Fi features, to make sure that users and their
-apps can take full advantage of higher-speed Wi-Fi access at home, at work, and
-while away.</p>
-
-<p>A new high-performance Wi-Fi lock lets applications maintain
-high-performance Wi-Fi connections even when the device screen is off. Users can
-take advantage of this to play continuous streamed music, video, and voice
-services for long periods, even when the device is otherwise idle and the screen
-is off. </p>
-
-<p>Users can now configure an HTTP proxy for each individual Wi-Fi access
-point, by touch-hold of the access point in Settings. The browser uses the HTTP
-proxy when communicating with the network over the access point and other apps
-may also choose to do so. The platform also provides backup and restore of the
-user-defined IP and proxy settings.</p>
-<p>The platform adds support for Preferred Network Offload (PNO), a background
-scanning capability that conserves battery power savings in cases where Wi-Fi
-needs to be available continuously for long periods of time.</p>
-
-<h3 id="apps">Updated set of standard apps</h3>
-
-<p>The Android 3.1 platform includes an updated set of standard applications
-that are optimized for use on larger screen devices. The sections below
-highlight some of the new features.</p>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:right;margin-left:1em;margin-top:1.5em;margin-bottom:0;padding-bottom:0;"><img src="{@docRoot}sdk/images/3.1/controls.png" alt="" height="280px" />
-<div style="padding-left:1.25em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"><strong>Figure 3.</strong> Quick Controls menu in the Browser.</div>
-</div>
-</div>
-
-<p><strong>Browser</strong></p>
-
-<p>The Browser app includes a variety of new features and UI improvements that
-make viewing web content simpler, faster, and more convenient.</p>
-
-<p>The Quick Controls UI, accessible from Browser Settings, is extended and
-redesigned. Users can now use the controls to view thumbnails of open tabs and
-close the active tab, as well as access the overflow menu for instant access to
-Settings and other controls.</p>
-
-<p>To ensure a consistent viewing experience, the Browser extends it's support
-for popular web standards such as CSS 3D, animations, and CSS fixed
-positioning to all sites, mobile or desktop. It also adds support for embedded
-playback of HTML5 video content. To make it easier to manage favorite
-content, users can now save a web page locally for offline viewing, including
-all styling and images. For convenience when visiting Google sites, an improved
-auto-login UI lets users sign in quickly and manage access when multiple users
-are sharing a device.</p>
-
-<p>For best performance, the Browser adds support for plugins that use hardware
-accelerated rendering. Page zoom performance is also dramatically improved,
-making it faster to navigate and view web pages.</p>
-
-<p><strong>Gallery</strong></p>
-
-<p>The Gallery app now supports Picture Transfer Protocol (PTP), so that users
-can connect their cameras over USB and import their pictures to Gallery with a
-single touch. The app also copies the pictures to local storage and provides an
-indicator to let users see how much space is available.</p>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:left;margin-left:0em;"><img src="{@docRoot}sdk/images/3.1/resizeable.png" alt="" width="170" target="_android" style="margin-bottom:0;" />
-<div style="padding-left:1.4em;padding-bottom:1em;width:180px;font-size:.9em"><strong>Figure
-4.</strong> Home screen widgets can now be resized.</div></div>
-
-<p><strong>Calendar</strong></p>
-
-<p>Calendar grids are larger, for better readability and more accurate
-touch-targeting. Additionally, users can create a larger viewing area for grids
-by hiding the calendar list controls. Controls in the date picker are
-redesigned, making them easier to see and use.</li>
-</ul>
-
-<p><strong>Contacts</strong></p>
-
-<p>The Contacts app now lets you locate contacts more easily using full text
-search. Search returns matching results from all fields that are stored for a
-contact.
-</p>
-
-<p><strong>Email</strong></p>
-
-<p>When replying or forwarding an HTML message, The Email app now sends both
-plain text and HTML bodies as a multi-part mime message. This ensures that the
-message will be formatted properly for all recipients. Folder prefixes for IMAP
-accounts are now easier to define and manage. To conserve battery power and
-minimize cell data usage, the application now prefetches email from the server
-only when the device is connected to a Wi-Fi access point. </p>
-
-<p>An updated Home screen widget give users quick access to more email. Users
-can touch Email icon at the top of the widget to cycle through labels such as
-Inbox, Unread, and Starred. The widget itself is now resizable, both
-horizontally and vertically.</p>
-
-<h3 id="enterprise">Enterprise support</h3>
-
-<p>Users can now configure an HTTP proxy for each connected Wi-Fi access point.
-This lets administrators work with users to set a proxy hostname, port, and any
-bypass subdomains. This proxy configuration is automatically used by the Browser
-when the Wi-Fi access point is connected, and may optionally be used by other
-apps. The proxy and IP configuration is now backed up and restored across system
-updates and resets.</p>
-
-<p>To meet the needs of tablet users, the platform now allows a "encrypted
-storage card" device policy to be accepted on devices with emulated storage
-cards and encrypted primary storage.</p>
-
-
-<h2 id="DeveloperApis" style="clear:both">New Developer Features</h2>
-
-<p>The Android 3.1 platform adds refinements and new capabilities that
-developers can build on, to create powerful and engaging application experiences
-on tablets and other large-screen devices. </p>
-
-<h3 id="accessory">Open Accessory API for rich interaction with
-peripherals</h3>
-
-<p>Android 3.1 introduces a new API for integrating hardware accessories with
-applications running on the platform. The API provides a way to interact across
-a wide range of peripherals, from robotics controllers to musical equipment,
-exercise bicycles, and more.</p>
-
-<p>The API is based on a new USB (Universal Serial Bus) stack and services
-that are built into the platform. The platform provides services for discovering
-and identifying connected hardware, as well as for notifying interested
-applications that the hardware is available.</p>
-
-<p>When a user plugs in a USB accessory, the platform receives
-identifying information such as product name, accessory type, manufacturer, and
-version. The platform sets up communication with the accessory and uses its
-information to notify and launch a targeted app, if one is available. Optionally,
-an accessory can provide a URL that lets users find and download an
-app that works with the accessory. These discovery features make
-first-time setup easier for the user and ensure that an appropriate application
-is available for interacting with the connected hardware. </p>
-
-<p>For application developers and accessory manufacturers, accessory mode offers
-many new ways to engage users and build powerful interaction experiences with
-connected hardware.</p>
-
-<p>To learn more about how to develop applications that interact with
-accessories, see the <a href="{@docRoot}guide/topics/usb/accessory.html">USB
-Accessory</a> documentation.</p>
-
-<h3 id="host">USB host API</h3>
-
-<p>Android 3.1 provides built-in platform support for USB host mode and exposes
-an API that lets applications manage connected peripherals. On devices that
-support host mode, applications can use the API to identify and communicate with
-connected devices such as audio devices. input devices, communications devices,
-hubs, cameras, and more.</p>
-
-<p>To learn more about how to develop applications that interact with
-USB devices, see the <a href="{@docRoot}guide/topics/usb/host.html">USB
-Host</a> documentation.</p>
-
-<h3 id="inputdevices">Input from mice, joysticks, and gamepads</h3>
-
-<p>Android 3.1 extends the input event system to support a variety of new input
-sources and motion events, across all views and windows. Developers can build on
-these capabilities to let users interact with their applications using mice,
-trackballs, joysticks, gamepads, and other devices, in addition to keyboards and
-touchscreens.</p>
-
-<p>For mouse and trackball input, the platform supports two new motion event
-actions: scroll (horizontal or vertical) such as from a scrollwheel; and hover,
-which reports the location of the mouse when no buttons are pressed.
-Applications can handle these events in any way needed.</p>
-
-<p>For joysticks and gamepads, the platform provides a large number of motion
-axes that applications can use from a given input source, such as X, Y, Hat X,
-Hat Y, rotation, throttle, pressure, size, touch, tool, orientation, and others.
-Developers can also define custom axes if needed, to capture motion in
-additional ways. The platform provides motion events to applications as a batch,
-and applications can query the details of the movements included in the batch,
-for more efficient and precise handling of events.</p>
-
-<p>Applications can query for the list of connected input devices and the motion
-ranges (axes) supported by each device. Applications can also handle multiple
-input and motion events from a single input device. For example, an application
-can use mouse and joystick and mouse event sources from a single input
-device.</p>
-
-<h3 id="resizewidgetsapp">Resizable Home screen widgets</h3>
-
-<p>Developers can now create Home screen widgets that users can resize
-horizontally, vertically, or both. By simply adding an attribute to the
-declaration of a widget, the widget becomes resizable horizontally, vertically,
-or both. This lets users customize the display of the widget content and display
-more of it on their Home screens.</p>
-
-<h3 id="mtp">MTP API for integrating with external cameras</h3>
-
-<p>In Android 3.1, a new MTP (Media Transfer Protocol) API lets developers write
-apps that interact directly with connected cameras and other PTP devices. The
-new API makes it easy for applications to receive notifications when devices are
-attached and removed, manage files and storage on those devices, and transfer
-files and metadata to and from them. The MTP API implements the PTP (Picture
-Transfer Protocol) subset of the MTP specification.</p>
-
-<h3 id="rtp">RTP API, for control over audio streaming sessions</h3>
-
-<p>Android 3.1 exposes an API to its built-in RTP (Real-time Transport Protocol)
-stack, which applications can use to directly manage on-demand or interactive
-data streaming. In particular, apps that provide VOIP, push-to-talk,
-conferencing, and audio streaming can use the API to initiate sessions and
-transmit or receive data streams over any available network.</p>
-
-<h3 id="performance">Performance optimizations</h3>
-
-<p>Android 3.1 includes a variety of performance optimizations that help make
-applications faster and more responsive. Some of the optimizations include:</p>
-
-<ul>
-<li>A new LRU cache class lets applications benefit from efficient caching.
-Applications can use the class to reduce the time spent computing or downloading
-data from the network, while maintaining a sensible memory footprint for the
-cached data.</li>
-<li>The UI framework now supports partial invalidates in hardware-accelerated
-Views, which makes drawing operations in those Views more efficient.</li>
-<li>A new graphics method, {@link android.graphics.Bitmap#setHasAlpha(boolean)
-setHasAlpha()}, allows apps to hint that a given bitmap is opaque. This provides
-an extra performance boost for some types of blits and is especially useful for
-applications that use ARGB_8888 bitmaps.</li>
-</ul>
-
diff --git a/docs/html/sdk/android-3.1.jd b/docs/html/sdk/android-3.1.jd
deleted file mode 100644
index 7ec7e33..0000000
--- a/docs/html/sdk/android-3.1.jd
+++ /dev/null
@@ -1,1106 +0,0 @@
-page.title=Android 3.1 Platform
-sdk.platform.version=3.1
-sdk.platform.apiLevel=12
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#api">API Overview</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/12/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-<h2>See Also</h2>
-<ol>
- <li><a href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing
-Apps for Android 3.x</a></li>
-</ol>
-
-</div>
-</div>
-
-
-<p><em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK. The downloadable platform includes
-an Android library and system image, as well as a set of emulator skins and
-more. The downloadable platform includes no external libraries.</p>
-
-<p>To get started developing or testing against Android {@sdkPlatformVersion},
-use the Android SDK Manager to download the platform into your SDK. For more
-information, see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>. If you are new to Android, <a
-href="{@docRoot}sdk/index.html">download the SDK Starter Package</a> first.</p>
-
-<p>For a high-level introduction to Android {@sdkPlatformVersion}, see the <a
-href="{@docRoot}sdk/android-{@sdkPlatformVersion}-highlights.html">Platform
-Highlights</a>.</p>
-
-<p class="note"><strong>Reminder:</strong> If you've already published an
-Android application, please test and optimize your application on Android 3.0
-and Android 3.1 as soon as possible. You should do so to be sure your
-application provides the best experience possible on the latest Android-powered
-devices. For information about what you can do, read <a
-href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing Apps for
-Android 3.0</a>.</p>
-
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>To determine what revision of the Android {@sdkPlatformVersion} platform you
-have installed, refer to the "Installed Packages" listing in the Android SDK and
-AVD Manager.</p>
-
-
-<div class="toggle-content opened" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 3</a> <em>(July 2011)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r12</a> or
-higher.</p>
-</dd>
-<dt>Notes:</dt>
-<dd>
-<p>Improvements to the platform's rendering library to support the visual layout editor in the ADT
-Eclipse plugin. This revision allows for more drawing features in ADT and fixes several
-bugs in the previous rendering library. It also unlocks several editor features that were added in
-ADT 12.</p>
-</dd>
-</dl>
-
-</div>
-</div>
-
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 2</a> <em>(May 2011)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r11</a> or
-higher.</p>
-</dd>
-<dt>Notes:</dt>
-<dd>
-<p>Fixes an issue with the visual layout editor rendering library that prevented Android 3.1 from
-running in ADT.</p>
-</dd>
-</dl>
-
-</div>
-</div>
-
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
-<p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 1</a> <em>(May 2011)</em>
-</a></p>
-
-<div class="toggle-content-toggleme" style="padding-left:2em;">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>Requires <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r11</a> or
-higher.</p>
-</dd>
-</dl>
-
-</div>
-</div>
-
-
-<h2 id="#api" style="margin-top:1.5em;">API Overview</h2>
-
-<p>The sections below provide a technical overview of what's new for developers
-in Android 3.1, including new features and changes in the framework API since
-the previous version.</p>
-
-<h3 id="usb">USB APIs</h3>
-
-<p>Android 3.1 introduces powerful new APIs for
-integrating connected peripherals with applications running on the platform.
-The APIs are based on a USB (Universal Serial Bus) stack and services that are
-built into the platform, including support for both USB host and device
-interactions. Using the APIs, developers can create applications that are able to
-discover, communicate with, and manage a variety of device types connected over
-USB. </p>
-
-<p>The stack and APIs distinguish two basic types of USB hardware, based on
-whether the Android-powered device is acting as host or the external hardware
-is acting as host: </p>
-
-<ul>
-<li>A <em>USB device</em> is a piece of connected hardware that depends on the
-Android-powered device to serve as host. For example, most input devices, mice,
-and joysticks are USB devices, as are many cameras, hubs, and so on.</li>
-<li>A <em>USB accessory</em> is a piece of connected hardware that has a USB
-host controller, provides power, and is designed to communicate with
-Android-powered devices over USB, A variety of peripherals can connect as
-accessories, from robotics controllers to musical equipment, exercise bicycles,
-and more.</li>
-</ul>
-
-<p>For both types — USB devices and USB accessories — the
-platform's USB APIs support discovery by intent broadcast when attached or
-detached, as well as standard interfaces, endpoints, and transfer modes
-(control, bulk, and interrupt).</p>
-
-<p>The USB APIs are available in the package {@link android.hardware.usb}. The
-central class is {@link android.hardware.usb.UsbManager}, which provides
-helper methods for identifying and communicating with
-both USB devices and USB accessories. Applications can acquire an instance of
-{@link android.hardware.usb.UsbManager} and then query for the list of attached
-devices or accessories and then communicate with or manage them.
-{@link android.hardware.usb.UsbManager} also declares intent actions that the
-system broadcasts, to announce when a USB device or accessory is attached or
-detached.</p>
-
-<p>Other classes include:</p>
-
-<ul>
-<li>{@link android.hardware.usb.UsbDevice}, a class representing external
-hardware connected as a USB device (with the Android-powered device acting as
-host).</li>
-<li>{@link android.hardware.usb.UsbAccessory}, representing external hardware
-connected as the USB host (with the Android-powered device acting as a USB
-device).</li>
-<li>{@link android.hardware.usb.UsbInterface} and {@link
-android.hardware.usb.UsbEndpoint}, which provide access to standard USB
-interfaces and endpoints for a device.</li>
-<li>{@link android.hardware.usb.UsbDeviceConnection} and {@link
-android.hardware.usb.UsbRequest}, for sending and receiving data and control
-messages to or from a USB device, sychronously and asynchronously.
-<li>{@link android.hardware.usb.UsbConstants}, which provides constants for
-declaring endpoint types, device classes, and so on.</li>
-</ul>
-
-<p>Note that although the USB stack is built into the platform, actual support
-for USB host and open accessory modes on specific devices is determined by
-their manufacturers. In particular, host mode relies on appropriate USB
-controller hardware in the Android-powered device. </p>
-
-<p>Additionally, developers can request filtering on Google Play, such that
-their applications are not availabe to users whose devices do not provide the
-appropriate USB support. To request filtering, add one or both of the elements
-below to the application manifest, as appropriate: </p>
-
-<ul>
-<li>If the application should only be visible to devices that support USB
-host mode (connection of USB devices), declare this element:
- <p style="margin-left:1.5em;"><code><uses-feature
- android:name="android.hardware.usb.host"
- android:required="true"></code></p>
-</li>
-<li>If the application should only be visible to devices that support USB
-accessories (connection of USB hosts), declare this element:
- <p style="margin-left:1.5em;"><code><uses-feature
- android:name="android.hardware.usb.accessory"
- android:required="true"></code></p>
-</li>
-</ul>
-
-<p>For complete information about how to develop applications that interact with
-USB accessories, please see the
-<a href="{@docRoot}guide/topics/usb/index.html">developer documentation</a>.</p>
-
-<p class="note">To look at sample applications that use the USB host API, see <a
-href="{@docRoot}resources/samples/USB/AdbTest/index.html">ADB Test</a> and <a
-href="{@docRoot}resources/samples/USB/MissileLauncher/index.html">Missile
-Launcher</a></p>
-
-<h3>MTP/PTP API</h3>
-
-<p>Android 3.1 exposes a new MTP API that lets applications interact directly
-with connected cameras and other PTP devices. The new API makes it easy for an
-application to receive notifications when devices are attached and removed,
-manage files and storage on those devices, and transfer files and metadata to
-and from them. The MTP API implements the PTP (Picture Transfer Protocol) subset
-of the MTP (Media Transfer Protocol) specification.</p>
-
-<p>The MTP API is available in the {@link android.mtp} package and provides
-these classes: </p>
-
-<ul>
- <li>The {@link android.mtp.MtpDevice} encapsulates an MTP device that is
-connected over the USB host bus. An application can instantiate an object of
-this type and then use its methods to get information about the device and
-objects stored on it, as well as opening the connection and transferring data.
-Some of the methods include:
- <ul>
- <li>{@link android.mtp.MtpDevice#getObjectHandles(int, int, int)
-getObjectHandles()} returns a list of handles for all objects on the device that
-match a specified format and parent. To get information about an object, an
-application can pass a handle to {@link android.mtp.MtpDevice#getObjectInfo(int)
-getObjectInfo()}.</li>
- <li>{@link android.mtp.MtpDevice#importFile(int, java.lang.String)
-importFile()} lets an application copy data for an object to a file in external
-storage. This call may block for an arbitrary amount of time depending on the
-size of the data and speed of the devices, so should be made from a spearate
-thread.</li>
- <li>{@link
-android.mtp.MtpDevice#open(android.hardware.usb.UsbDeviceConnection) open()}
-lets an application open a connected MTP/PTP device. </li>
- <li>{@link android.mtp.MtpDevice#getThumbnail(int) getThumbnail()} returns
-the thumbnail of the object as a byte array. </li>
- </ul>
- </li>
- <li>{@link android.mtp.MtpStorageInfo} holds information about about a storage
-unit on an MTP device, corresponding to the StorageInfo Dataset described in
-section 5.2.2 of the MTP specification. Methods in the class let an application
-get a storage unit’s description string, free space, maximum storage capacity,
-storage ID, and volume identifier.</li>
- <li>{@link android.mtp.MtpDeviceInfo} holds information about an MTP device
-corresponding to the DeviceInfo Dataset described in section 5.1.1 of the MTP
-specification. Methods in the class let applications get a device’s
-manufacturer, model, serial number, and version.</li>
- <li>{@link android.mtp.MtpObjectInfo} holds information about an object stored
-on an MTP device, corresponding to the ObjectInfo Dataset described in section
-5.3.1 of the MTP specification. Methods in the class let applications get an
-object’s size, data format, association type, creation date, and thumbnail
-information.</li>
- <li>{@link android.mtp.MtpConstants} provides constants for declaring MTP file
-format codes, association type, and protection status.</li>
-</ul>
-
-<h3 id="motionevents">Support for new input devices and motion events</h3>
-
-<p>Android 3.1 extends the input subsystem to support new input devices and new
-types of motion events, across all views and windows. Developers can build on
-these capabilities to let users interact with their applications using mice,
-trackballs, joysticks, gamepads, and other devices, in addition to keyboards and
-touchscreens. </p>
-
-<p>For handling mouse, scrollwheel, and trackball input, the platform supports
-two new motion event actions:</p>
-<ul>
-<li>{@link android.view.MotionEvent#ACTION_SCROLL}, which describes the pointer
-location at which a non-touch scroll motion, such as from a mouse scroll wheel,
-took place. In the MotionEvent, the value of the {@link
-android.view.MotionEvent#AXIS_HSCROLL} and {@link
-android.view.MotionEvent#AXIS_VSCROLL} axes specify the relative scroll
-movement. </li>
-<li>{@link android.view.MotionEvent#ACTION_HOVER_MOVE}, reports the current
-position of the mouse when no buttons are pressed, as well as any intermediate
-points since the last <code>HOVER_MOVE</code> event. Hover enter and exit
-notifications are not yet supported.</li>
-</ul>
-
-<p>To support joysticks and gamepads, the {@link android.view.InputDevice} class
-includes these new input device sources:</p>
-<ul>
-<li>{@link android.view.InputDevice#SOURCE_CLASS_JOYSTICK} — the source
-device has joystick axes.</li>
-<li>{@link android.view.InputDevice#SOURCE_CLASS_BUTTON} — the source
-device has buttons or keys.</li>
-<li>{@link android.view.InputDevice#SOURCE_GAMEPAD} — the source device
-has gamepad buttons such as {@link android.view.KeyEvent#KEYCODE_BUTTON_A}
-or {@link android.view.KeyEvent#KEYCODE_BUTTON_B}. Implies
-{@link android.view.InputDevice#SOURCE_CLASS_BUTTON}</li>
-<li>{@link android.view.InputDevice#SOURCE_JOYSTICK} — the source device
-has joystick axes. Implies SOURCE_CLASS_JOYSTICK.</li>
-</ul>
-
-<p>To describe motion events from these new sources, as well as those from mice
-and trackballs, the platform now defines axis codes on {@link
-android.view.MotionEvent}, similar to how it defines key codes on {@link
-android.view.KeyEvent}. New axis codes for joysticks
-and game controllers include
-{@link android.view.MotionEvent#AXIS_HAT_X}, {@link
-android.view.MotionEvent#AXIS_HAT_Y}, {@link
-android.view.MotionEvent#AXIS_RTRIGGER}, {@link
-android.view.MotionEvent#AXIS_ORIENTATION}, {@link
-android.view.MotionEvent#AXIS_THROTTLE}, and many others.
-Existing {@link android.view.MotionEvent} axes are represented by {@link
-android.view.MotionEvent#AXIS_X}, {@link android.view.MotionEvent#AXIS_Y},
-{@link android.view.MotionEvent#AXIS_PRESSURE}, {@link
-android.view.MotionEvent#AXIS_SIZE}, {@link
-android.view.MotionEvent#AXIS_TOUCH_MAJOR}, {@link
-android.view.MotionEvent#AXIS_TOUCH_MINOR}, {@link
-android.view.MotionEvent#AXIS_TOOL_MAJOR}, {@link
-android.view.MotionEvent#AXIS_TOOL_MINOR}, and {@link
-android.view.MotionEvent#AXIS_ORIENTATION}.</p>
-
-<p>Additionally, {@link android.view.MotionEvent} defines a number of generic
-axis codes that are used when the framework does not know how to map a
-particular axis. Specific devices can use the generic axis codes to pass custom
-motion data to applications. For a full list of axes and their intended
-interpretations, see the {@link android.view.MotionEvent} class documentation.
-</p>
-
-<p>The platform provides motion events to applications in batches, so a single
-event may contain a current position and multiple so-called historical movements.
-Applications should use {@link android.view.MotionEvent#getHistorySize()} to get
-the number of historical samples, then retrieve and process all historical
-samples in order using {@link
-android.view.MotionEvent#getHistoricalAxisValue(int, int, int)
-getHistoricalAxisValue()}. After that, applications should process the current
-sample using {@link android.view.MotionEvent#getAxisValue(int) getAxisValue()}.
-</p>
-
-<p>Some axes can be retrieved using special accessor methods. For example,
-instead of calling {@link android.view.MotionEvent#getAxisValue(int)
-getAxisValue()}, applications can call {@link android.view.MotionEvent#getX(int)
-getX()}. Axes that have built-in accessors include {@link
-android.view.MotionEvent#AXIS_X}, {@link android.view.MotionEvent#AXIS_Y},
-{@link android.view.MotionEvent#AXIS_PRESSURE}, {@link
-android.view.MotionEvent#AXIS_SIZE}, {@link
-android.view.MotionEvent#AXIS_TOUCH_MAJOR}, {@link
-android.view.MotionEvent#AXIS_TOUCH_MINOR}, {@link
-android.view.MotionEvent#AXIS_TOOL_MAJOR}, {@link
-android.view.MotionEvent#AXIS_TOOL_MINOR}, and {@link
-android.view.MotionEvent#AXIS_ORIENTATION}.</p>
-
-<p>Each input device has a unique, system-assigned ID and may also provide
-multiple sources. When a device provides multiple sources, more than one source
-can provide axis data using the same axis. For example, a touch event coming
-from the touch source uses the X axis for screen position data, while a joystick
-event coming from the joystick source will use the X axis for the stick position
-instead. For this reason, it's important for applications to interpret axis
-values according to the source from which they originate. When handling a motion
-event, applications should use methods on the {@link android.view.InputDevice}
-class to determine the axes supported by a device or source. Specifically,
-applications can use {@link android.view.InputDevice#getMotionRanges()
-getMotionRanges()} to query for all axes of a device or all axes of a given
-source of the device. In both cases, the range information for axes returned in
-the {@link android.view.InputDevice.MotionRange} object specifies the source for
-each axis value.</p>
-
-<p>Finally, since the motion events from joysticks, gamepads, mice, and
-trackballs are not touch events, the platform adds a new callback method for
-passing them to a {@link android.view.View} as "generic" motion events.
-Specifically, it reports the non-touch motion events to
-{@link android.view.View}s through a call to {@link
-android.view.View#onGenericMotionEvent(android.view.MotionEvent)
-onGenericMotionEvent()}, rather than to {@link
-android.view.View#onTouchEvent(android.view.MotionEvent)
-onTouchEvent()}.</p>
-
-<p>The platform dispatches generic motion events differently, depending on the
-event source class. {@link android.view.InputDevice#SOURCE_CLASS_POINTER} events
-go to the {@link android.view.View} under the pointer, similar to how touch
-events work. All others go to the currently focused {@link android.view.View}.
-For example, this means a {@link android.view.View} must take focus in order to
-receive joystick events. If needed, applications can handle these events at the
-level of Activity or Dialog by implementing {@link
-android.view.View#onGenericMotionEvent(android.view.MotionEvent)
-onGenericMotionEvent()} there instead.</p>
-
-<p class="note">To look at a sample application that uses joystick motion
-events, see <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/GameControllerInput.html">GameControllerInput</a>
-and <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/GameView.html">GameView</a>.</p>
-
-<h3>RTP API</h3>
-
-<p>Android 3.1 exposes an API to its built-in RTP (Real-time Transport Protocol)
-stack, which applications can use to manage on-demand or interactive data
-streaming. In particular, apps that provide VOIP, push-to-talk, conferencing,
-and audio streaming can use the API to initiate sessions and transmit or receive
-data streams over any available network.</p>
-
-<p>The RTP API is available in the {@link android.net.rtp} package. Classes
-include: </p>
-<ul>
-<li>{@link android.net.rtp.RtpStream}, the base class of streams that send and
-receive network packets with media payloads over RTP.</li>
-<li>{@link android.net.rtp.AudioStream}, a subclass of {@link
-android.net.rtp.RtpStream} that carries audio payloads over RTP.</li>
-<li>{@link android.net.rtp.AudioGroup}, a local audio hub for managing and
-mixing the device speaker, microphone, and {@link android.net.rtp.AudioStream}.</li>
-<li>{@link android.net.rtp.AudioCodec}, which holds a collection of codecs that
-you define for an {@link android.net.rtp.AudioStream}.</li>
-</ul>
-
-<p>To support audio conferencing and similar usages, an application instantiates
-two classes as endpoints for the stream:</p>
-
-<ul>
-<li>{@link android.net.rtp.AudioStream} specifies a remote endpoint and consists
-of network mapping and a configured {@link android.net.rtp.AudioCodec}.</li>
-<li>{@link android.net.rtp.AudioGroup} represents the local endpoint for one
-or more {@link android.net.rtp.AudioStream}s. The {@link android.net.rtp.AudioGroup} mixes
-all the {@link android.net.rtp.AudioStream}s and optionally interacts with the device
-speaker and the microphone at the same time.</li>
-</ul>
-
-<p>The simplest usage involves a single remote endpoint and local endpoint.
-For more complex usages, please refer to the limitations described for
-{@link android.net.rtp.AudioGroup}.</p>
-
-<p>To use the RTP API, applications must request permission from the user by
-declaring <code><uses-permission
-android:name="android.permission.INTERNET"></code>
-in their manifest files. To acquire the device microphone, the <code><uses-permission
-android:name="android.permission.RECORD_AUDIO"></code> permission is also required.</p>
-
-<h3 id="resizewidgets">Resizable app widgets</h3>
-
-<p>Starting in Android 3.1, developers can make their homescreen widgets
-resizeable — horizontally, vertically, or on both axes. Users touch-hold a
-widget to show its resize handles, then drag the horizontal and/or vertical
-handles to change the size on the layout grid. </p>
-
-<p>Developers can make any Home screen widget resizeable by defining a
-<code>resizeMode</code> attribute in the widget's {@link
-android.appwidget.AppWidgetProviderInfo} metadata. Values for the
-<code>resizeMode</code> attribute include "horizontal", "vertical", and "none".
-To declare a widget as resizeable horizontally and vertically, supply the value
-"horizontal|vertical".
-
-<p>Here's an example: </p>
-
-<pre><appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
- android:minWidth="294dp"
- android:minHeight="72dp"
- android:updatePeriodMillis="86400000"
- android:previewImage="@drawable/preview"
- android:initialLayout="@layout/example_appwidget"
- android:configure="com.example.android.ExampleAppWidgetConfigure"
- android:resizeMode="horizontal|vertical" >
-</appwidget-provider></pre>
-
-<p>For more information about Home screen widgets, see the <a
-href="{@docRoot}guide/topics/appwidgets/index.html">App Widgets</a>
-documentation.</p>
-
-<h3 id="animation" style="margin-top:1.25em;">Animation framework</h3>
-
-<ul>
-<li>New ViewPropertyAnimator class
- <ul>
- <li>A new {@link android.view.ViewPropertyAnimator} class provides a
-convenient
-way for developers to animate select properties on {@link android.view.View} objects. The class
-automaties and optimizes the animation of the properties and makes it easier to
-manage multiple simulataneous animations on a {@link android.view.View} object.
-<p>Using the {@link android.view.ViewPropertyAnimator} is straightforward. To animate properties for
-a {@link android.view.View}, call {@link android.view.View#animate()} to
-construct a {@link android.view.ViewPropertyAnimator} object for that {@link android.view.View}. Use the
-methods on the {@link android.view.ViewPropertyAnimator} to specify what property to
-animate and how to animate it. For example, to fade the {@link android.view.View} to transparent,
-call <code>alpha(0);</code>. The {@link android.view.ViewPropertyAnimator} object
-handles the details of configuring the underlying {@link
-android.animation.Animator} class and starting it, then rendering the
-animation.</p></li>
- </ul>
-</li>
-<li>Animation background color
- <ul>
- <li>New {@link android.view.animation.Animation#getBackgroundColor()} and
- {@link android.view.animation.Animation#setBackgroundColor(int)} methods let
- you get/set the background color behind animations, for window animations
-only. Currently the background must be black, with any desired alpha level.</li>
- </ul>
-</li>
-<li>Getting animated fraction from <code>ViewAnimator</code>
- <ul>
- <li>A new {@link android.animation.ValueAnimator#getAnimatedFraction()}
-method
-lets you get the current animation fraction — the elapsed/interpolated
-fraction used in the most recent frame update — from a {@link
-android.animation.ValueAnimator}.</li>
- </ul>
-</li>
-</ul>
-
-<h3 "ui">UI framework</h3>
-<ul>
-<li>Forced rendering of a layer
- <ul>
- <li>A new {@link android.view.View#buildLayer()} method lets an application
-force a View's layer to be created and the View rendered into it immediately.
-For example, an application could use this method to render a View into its
-layer before starting an animation. If the View is complex, rendering it into
-the layer before starting the animation will avoid skipping frames.</li>
- </ul>
-</li>
-<li>Camera distance
- <ul>
- <li>Applications can use a new method
-{@link android.view.View#setCameraDistance(float)} to set the distance from the
-camera
-to a View. This gives applications improved control over 3D transformations of
-the View, such as rotations. </li>
- </ul>
-</li>
-<li>Getting a calendar view from a DatePicker
- <ul>
- <li>A new {@link android.widget.DatePicker#getCalendarView()} method
- lets you get a {@link android.widget.CalendarView} from a {@link
-android.widget.DatePicker}
- instance.</li>
- </ul>
-</li>
-<li>Getting callbacks when views are detached
- <ul>
- <li>A new {@link android.view.View.OnAttachStateChangeListener} lets you
-receive
-callbacks when a View is attached or detached from its window. Use {@link
-android.view.View#addOnAttachStateChangeListener(android.view.View.OnAttachStateChangeListener) addOnAttachStateChangeListener()}
-to add a listener and {@link
-android.view.View#removeOnAttachStateChangeListener(android.view.View.OnAttachStateChangeListener) addOnAttachStateChangeListener()} to remove it.</li>
- </ul>
-</li>
-<li>Fragment breadcrumb listener, new onInflate() signature
- <ul>
- <li>A new method, {@link
-android.app.FragmentBreadCrumbs#setOnBreadCrumbClickListener(android.app.FragmentBreadCrumbs.OnBreadCrumbClickListener) setOnBreadCrumbClickListener()},
-provides a hook to let
-applications intercept fragment-breadcrumb clicks and take any action needed
-before going to the backstack entry or fragment that was clicked. </li>
- <li>In the {@link android.app.Fragment} class, {@link
-android.app.Fragment#onInflate(android.util.AttributeSet, android.os.Bundle)
-onInflate(attrs, savedInstanceState)} is deprecated. Please use {@link
-android.app.Fragment#onInflate(android.app.Activity, android.util.AttributeSet,
-android.os.Bundle) onInflate(activity, attrs, savedInstanceState)} instead.</li>
- </ul>
-</li>
-<li>Display search result in new tab
- <ul>
- <li>An {@link android.app.SearchManager#EXTRA_NEW_SEARCH} data key for {@link
-android.content.Intent#ACTION_WEB_SEARCH} intents lets you open a search in a
-new browser tab, rather than in an existing one.</li>
- </ul>
-</li>
-
-<li>Drawable text cursor
- <ul>
-<li>You can now specify a drawable to use as the text cursor using the new
-resource attribute {@link android.R.attr#textCursorDrawable}.</li>
- </ul>
-</li>
-<li>Setting displayed child in remote views
- <ul>
- <li>A new convenience method, {@link
-android.widget.RemoteViews#setDisplayedChild(int, int) setDisplayedChild(viewId,
-childIndex)}, is available in {@link android.widget.RemoteViews} subclasses, to
-let you set the child displayed in {@link android.widget.ViewAnimator} and
-{@link android.widget.AdapterViewAnimator} subclasses such as {@link
-android.widget.AdapterViewFlipper}, {@link android.widget.StackView}, {@link
-android.widget.ViewFlipper}, and {@link android.widget.ViewSwitcher}.</li>
- </ul>
-</li>
-<li>Generic keys for gamepads and other input devices
- <ul>
- <li>{@link android.view.KeyEvent} adds a range of generic keycodes to
- accommodate gamepad buttons. The class also adds
- {@link android.view.KeyEvent#isGamepadButton(int)} and several other
- helper methods for working with keycodes.</li>
- </ul>
-</li>
-</ul>
-
-<h3 id="graphics" style="margin-top:1.3em;">Graphics</h3>
-
-<ul>
-<li>Helpers for managing bitmaps
- <ul>
- <li>{@link android.graphics.Bitmap#setHasAlpha(boolean)} lets an app indicate that
-all of the pixels in a Bitmap are known to be opaque (false) or that some of the
-pixels may contain non-opaque alpha values (true). Note, for some configs (such
-as RGB_565) this call is ignored, since it does not support per-pixel alpha
-values. This is meant as a drawing hint, as in some cases a bitmap that is known
-to be opaque can take a faster drawing case than one that may have non-opaque
-per-pixel alpha values. </li>
- <li>{@link android.graphics.Bitmap#getByteCount()} gets a Bitmap's size in
-bytes.</li>
- <li>{@link android.graphics.Bitmap#getGenerationId()} lets an application find
-out whether a Bitmap has been modified, such as for caching.</li>
- <li>{@link android.graphics.Bitmap#sameAs(android.graphics.Bitmap)} determines
-whether a given Bitmap differs from the current Bitmap, in dimension,
-configuration, or pixel data. </li>
- </ul>
-</li>
-<li>Setting camera location and rotation
- <ul>
- <li>{@link android.graphics.Camera} adds two new methods {@link
-android.graphics.Camera#rotate(float, float, float) rotate()} and {@link
-android.graphics.Camera#setLocation(float, float, float) setLocation()} for
-control of the
-camera's location, for 3D transformations.</li>
-</ul>
-</li>
-</ul>
-
-<h3 id="network" style="margin-top:1.25em;">Network</h3>
-
-<ul>
-<li>High-performance Wi-Fi lock
- <ul>
- <li>A new high-performance Wi-Fi lock lets applications maintain
-high-performance Wi-Fi connections even when the device screen is off.
-Applications that stream music, video, or voice for long periods can acquire the
-high-performance Wi-Fi lock to ensure streaming performance even when the screen
-is off. Because it uses more power, applications should acquire the
-high-performance Wi-Fi when there is a need for a long-running active
-connection.
-<p>To create a high-performance lock, pass {@link
-android.net.wifi.WifiManager#WIFI_MODE_FULL_HIGH_PERF} as the lock mode in a
-call to {@link android.net.wifi.WifiManager#createWifiLock(int,
-java.lang.String) createWifiLock()}.</p></li>
- </ul>
-</li>
-<li>More traffic stats
- <ul>
- <li>Applications can now access statistics about more types of network usage
-using new methods in {@link android.net.TrafficStats}. Applications can use the
-methods to get UDP stats, packet count, TCP transmit/receive payload bytes and
-segments for a given UID.</li>
- </ul>
-</li>
-<li>SIP auth username
- <ul>
- <li>Applications can now get and set the SIP auth username for a profile
-using
-the new methods {@link android.net.sip.SipProfile#getAuthUserName()
-getAuthUserName()} and {@link
-android.net.sip.SipProfile.Builder#setAuthUserName(java.lang.String)
-setAuthUserName()}.</li>
- </ul>
-</li>
-</ul>
-
-
-<h3 id="download" style="margin-top:1.25em;">Download Manager</h3>
-<ul>
-<li>Handling of completed downloads
- <ul>
- <li>Applications can now initiate downloads that notify users only on
-completion. To initiate this type of download, applications pass {@link
-android.app.DownloadManager.Request#VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION}
-in the {@link
-android.app.DownloadManager.Request#setNotificationVisibility(int)
-setNotificationVisibility()} method of
-the a request object.</li>
- <li>A new method, {@link
-android.app.DownloadManager#addCompletedDownload(java.lang.String,
-java.lang.String, boolean, java.lang.String, java.lang.String, long, boolean)
-addCompletedDownload()}, lets an application add a file to the
-downloads database, so that it can be managed by the Downloads application.</li>
- </ul>
-</li>
-<li>Show downloads sorted by size
- <ul>
- <li>Applications can start the Downloads application in sort-by-size mode by
-adding the new extra {@link
-android.app.DownloadManager#INTENT_EXTRAS_SORT_BY_SIZE} to an {@link
-android.app.DownloadManager#ACTION_VIEW_DOWNLOADS} intent.</li>
- </ul>
-</li>
-</ul>
-
-<h3 id="ime" style="margin-top:1.25em;">IME framework</h3>
-
-<ul>
-<li>Getting an input method's extra value key
- <ul><li>The {@link android.view.inputmethod.InputMethodSubtype} adds the
-method
-{@link
-android.view.inputmethod.InputMethodSubtype#containsExtraValueKey(java.lang.String) containsExtraValueKey()} to check whether an ExtraValue string is stored
-for the subtype and
-the method {@link
-android.view.inputmethod.InputMethodSubtype#getExtraValueOf(java.lang.String)
-getExtraValueOf()} to extract a specific key value from the ExtraValue hashmap.
-</li>
- </ul>
-</li>
-</ul>
-
-<h3 id="media" style="margin-top:1.25em;">Media</h3>
-
-<ul>
-<li>New streaming audio formats
- <ul>
- <li>The media framework adds built-in support for raw ADTS AAC content, for
-improved streaming audio, as well as support for FLAC audio, for highest quality
-(lossless) compressed audio content. See the <a
-href="{@docRoot}guide/appendix/media-formats.html">Supported Media Formats</a>
-document for more information.</p></li>
- </ul>
-</li>
-</ul>
-
-<h3 id="launchcontrols" style="margin-top:1.25em;">Launch controls on stopped
-applications</h3>
-
-<p>Starting from Android 3.1, the system's package manager keeps track of
-applications that are in a stopped state and provides a means of controlling
-their launch from background processes and other applications.</p>
-
-<p>Note that an application's stopped state is not the same as an Activity's
-stopped state. The system manages those two stopped states separately.</p>
-
-<p>The platform defines two new intent flags that let a sender specify
-whether the Intent should be allowed to activate components in stopped
-application.</p>
-
-<ul>
-<li>{@link android.content.Intent#FLAG_INCLUDE_STOPPED_PACKAGES} —
-Include intent filters of stopped applications in the list of potential targets
-to resolve against. </li>
-<li>{@link android.content.Intent#FLAG_EXCLUDE_STOPPED_PACKAGES} —
-Exclude intent filters of stopped applications from the list of potential
-targets.</li>
-</ul>
-
-<p>When neither or both of these flags is defined in an intent, the default
-behavior is to include filters of stopped applications in the list of
-potential targets.</p>
-
-<p>Note that the system adds {@link
-android.content.Intent#FLAG_EXCLUDE_STOPPED_PACKAGES} <em>to all broadcast
-intents</em>. It does this to prevent broadcasts from background services from
-inadvertently or unnecessarily launching components of stoppped applications.
-A background service or application can override this behavior by adding the
-{@link android.content.Intent#FLAG_INCLUDE_STOPPED_PACKAGES} flag to broadcast
-intents that should be allowed to activate stopped applications.</p>
-
-<p>Applications are in a stopped state when they are first installed but are not
-yet launched and when they are manually stopped by the user (in Manage
-Applications).</p>
-
-<h3 id="installnotification">Notification of application first launch and upgrade</h3>
-
-<p>The platform adds improved notification of application first launch and
-upgrades through two new intent actions:</p>
-
-<ul>
-<li>{@link android.content.Intent#ACTION_PACKAGE_FIRST_LAUNCH} — Sent to
-the installer package of an application when that application is first launched
-(that is, the first time it is moved out of a stopped state). The data
-contains the name of the package. </li>
-
-<li>{@link android.content.Intent#ACTION_MY_PACKAGE_REPLACED} — Notifies
-an application that it was updated, with a new version was installed over
-an existing version. This is only sent to the application that was replaced. It
-does not contain any additional data. To receive it, declare an intent filter
-for this action. You can use the intent to trigger code that helps get your
-application back in proper running shape after an upgrade.
-
-<p>This intent is sent directly to the application, but only if the application
-was upgraded while it was in started state (not in a stopped state).</p></li>
-
-</ul>
-
-<h3 id="other">Core utilities</h3>
-
-<ul>
-<li>LRU cache
- <ul>
- <li>A new {@link android.util.LruCache} class lets your applications benefit
-from efficient caching. Applications can use the class to reduce the time spent
-computing or downloading data from the network, while maintaining a sensible
-memory footprint for the cached data.{@link android.util.LruCache} is a cache
-that holds strong references to a limited number of values. Each time a value is
-accessed, it is moved to the head of a queue. When a value is added to a full
-cache, the value at the end of that queue is evicted and may become eligible for
-garbage collection.</li>
- </ul>
-</li>
-<li>File descriptor as <code>int</code>
- <ul>
- <li>You can now get the native file descriptor int for a {@link
-android.os.ParcelFileDescriptor} using either of the new methods {@link
-android.os.ParcelFileDescriptor#getFd()} or {@link
-android.os.ParcelFileDescriptor#detachFd()}. </li>
- </ul>
-</li>
-</ul>
-
-
-
-
-
-
-<h3 id="webkit" style="margin-top:1.25em;">WebKit</h3>
-
-<ul>
-
-<li>File scheme cookies
- <ul>
- <li>The {@link android.webkit.CookieManager} now supports cookies that use
-the
-<code>file:</code> URI scheme. You can use {@link
-android.webkit.CookieManager#setAcceptFileSchemeCookies(boolean)
-setAcceptFileSchemeCookies()} to
-enable/disable support for file scheme cookies, before constructing an instance
-of <code>WebView</code> or <code>CookieManager</code>. In a
-<code>CookieManager</code> instance, you can check whether file scheme cookies
-is enabled by calling {@link
-android.webkit.CookieManager#allowFileSchemeCookies()}.</li>
- </ul>
-</li>
-<li>Notification of login request
- <ul>
- <li>To support the browser autologin features introduced in Android 3.0, the
-new
-method {@link
-android.webkit.WebViewClient#onReceivedLoginRequest(android.webkit.WebView,java.lang.String, java.lang.String, java.lang.String) onReceivedLoginRequest()}
-notifies the host
-application that an autologin request for the user was processed. </li>
- </ul>
-</li>
-<li>Removed classes and interfaces
- <ul>
- <li>Several classes and interfaces were removed from the public API, after
-previously being in deprecated state. See the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report</a> for more information.</p></li>
- </ul>
- </li>
-</ul>
-
-
-
-<h3 id="browser" style="margin-top:1.25em;">Browser</h3>
-
-<p>The Browser application adds the following features to support web
-applications:</p>
-
-<ul>
-<li>Support for inline playback of video embedded in HTML5
-<code><video></code> tag. Playback is hardware-accelerated where possible.
-</li>
-<li>Layer support for fixed position elements for all sites (mobile and
-desktop).</li>
-</ul>
-
-
-
-
-
-<h3 id="features">New feature constants</h3>
-
-<p>The platform adds new hardware feature constants that developers can declare
-in their application manifests, to inform external entities such as Google
-Play of the application's requirement for new hardware capabilities supported
-in this version of the platform. Developers declare these and other feature
-constants in <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
-<uses-feature>}</a> manifest elements.
-
-<ul>
- <li>{@link android.content.pm.PackageManager#FEATURE_USB_ACCESSORY
-android.hardware.usb.accessory} — The application uses the <a href="#usb">USB
-API</a> to communicate with external hardware devices connected over USB and
-function as hosts.</li>
- <li>{@link android.content.pm.PackageManager#FEATURE_USB_HOST
-android.hardware.usb.host} — The application uses the <a href="#usb">USB API</a>
-to communicate with external hardware devices connected over USB and function as
-devices.</li>
-</ul>
-
-<p>Google Play filters applications based on features declared in <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
-<uses-feature>}</a> manifest elements. For more information about
-declaring features in an application manifest, read <a
-href="{@docRoot}guide/appendix/market-filters.html">Google Play
-Filters</a>.</p>
-
-
-
-<h3 id="api-diff">API Differences Report</h3>
-
-<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
-Level
-{@sdkPlatformApiLevel}), see the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report</a>.</p>
-
-
-
-
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
-the framework API. The Android {@sdkPlatformVersion} API
-is assigned an integer identifier —
-<strong>{@sdkPlatformApiLevel}</strong> — that is
-stored in the system itself. This identifier, called the "API Level", allows the
-system to correctly determine whether an application is compatible with
-the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
-you need compile the application against the Android library that is provided in
-the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you
-might
-also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
-attribute to the <code><uses-sdk></code> element in the application's
-manifest.</p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>API Demos</li>
-<li>Browser</li>
-<li>Calculator</li>
-<li>Camera</li>
-<li>Clock</li>
-<li>Contacts</li>
-<li>Custom Locale</li>
-<li>Dev Tools</li>
-<li>Downloads</li>
-<li>Email</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<ul>
-<li>Gallery</li>
-<li>Gestures Builder</li>
-<li>Messaging</li>
-<li>Music</li>
-<li>Search</li>
-<li>Settings</li>
-<li>Spare Parts</li>
-<li>Speech Recorder</li>
-<li>Widget Preview</li>
-</ul>
-</td>
-</tr>
-</table>
-
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable SDK platform provides a variety
-of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android 3.0 system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
-descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Arabic, Egypt (ar_EG)</li>
-<li>Arabic, Israel (ar_IL)</li>
-<li>Bulgarian, Bulgaria (bg_BG)</li>
-<li>Catalan, Spain (ca_ES)</li>
-<li>Czech, Czech Republic (cs_CZ)</li>
-<li>Danish, Denmark(da_DK)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Greek, Greece (el_GR)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Ireland (en_IE)</li>
-<li>English, India (en_IN)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>English, US (en_US)</li>
-<li>English, South Africa (en_ZA)</li>
-<li>Spanish (es_ES)</li>
-<li>Spanish, US (es_US)</li>
-<li>Finnish, Finland (fi_FI)</li>
-<li>French, Belgium (fr_BE)</li>
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>French, France (fr_FR)</li>
-<li>Hebrew, Israel (he_IL)</li>
-<li>Hindi, India (hi_IN)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>Croatian, Croatia (hr_HR)</li>
-<li>Hungarian, Hungary (hu_HU)</li>
-<li>Indonesian, Indonesia (id_ID)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Lithuanian, Lithuania (lt_LT)</li>
-<li>Latvian, Latvia (lv_LV)</li>
-<li>Norwegian bokmål, Norway (nb_NO)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Polish (pl_PL)</li>
-<li>Portuguese, Brazil (pt_BR)</li>
-<li>Portuguese, Portugal (pt_PT)</li>
-<li>Romanian, Romania (ro_RO)</li>
-<li>Russian (ru_RU)</li></li>
-<li>Slovak, Slovakia (sk_SK)</li>
-<li>Slovenian, Slovenia (sl_SI)</li>
-<li>Serbian (sr_RS)</li>
-<li>Swedish, Sweden (sv_SE)</li>
-<li>Thai, Thailand (th_TH)</li>
-<li>Tagalog, Philippines (tl_PH)</li>
-<li>Turkish, Turkey (tr_TR)</li>
-<li>Ukrainian, Ukraine (uk_UA)</li>
-<li>Vietnamese, Vietnam (vi_VN)</li>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-</td>
-</tr>
-</table>
-
-<p class="note"><strong>Note:</strong> The Android platform may support more
-locales than are included in the SDK system image. All of the supported locales
-are available in the <a href="http://source.android.com/">Android Open Source
-Project</a>.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes the following emulator skin:</p>
-
-<ul>
- <li>
- WXGA (1280x800, medium density, xlarge screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays
-and functions properly on all Android-powered devices, see <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
\ No newline at end of file
diff --git a/docs/html/sdk/android-3.2.jd b/docs/html/sdk/android-3.2.jd
deleted file mode 100644
index 27df22c..0000000
--- a/docs/html/sdk/android-3.2.jd
+++ /dev/null
@@ -1,741 +0,0 @@
-page.title=Android 3.2 Platform
-sdk.platform.version=3.2
-sdk.platform.apiLevel=13
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#highlights">Highlights</a></li>
- <li><a href="#api">API Overview</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/13/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-<h2>See Also</h2>
-<ol>
- <li><a href="{@docRoot}guide/practices/screens_support.html">Supporting
- Multiple Screens</a></li>
- <li><a href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing
-Apps for Android 3.x</a></li>
-</ol>
-
-</div>
-</div>
-
-
-<p><em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>Welcome to Android 3.2!</p>
-
-<p>Android 3.2 is an incremental platform release that adds new
-capabilities for users and developers. The sections below provide an overview
-of the new features and developer APIs.</p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK. The downloadable platform includes
-an Android library and system image, as well as a set of emulator skins and
-more. The downloadable platform includes no external libraries.</p>
-
-<p>To get started developing or testing against Android {@sdkPlatformVersion},
-use the Android SDK Manager to download the platform into your SDK. For more
-information, see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>. If you are new to Android, <a
-href="{@docRoot}sdk/index.html">download the SDK Starter Package</a> first.</p>
-
-<p class="note"><strong>Reminder:</strong> If you've already published an
-Android application, please test and optimize your application on Android 3.2 as
-soon as possible. You should do so to be sure your application provides the best
-experience possible on the latest Android-powered devices. For information about
-what you can do, read <a
-href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing Apps for
-Android 3.x</a>.</p>
-
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>To determine what revision of the Android {@sdkPlatformVersion} platform you
-have installed, refer to the "Installed Packages" listing in the Android SDK and
-AVD Manager.</p>
-
-
-<div class="toggle-content opened" style="padding-left:1em;">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 1</a> <em>(July 2011)</em>
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em;">
-
-<dl>
-<dt>Initial release. SDK Tools r12 or higher is recommended.</dt>
-</dl>
-
- </div>
-</div>
-
-<h2 id="highlights" style="margin-top:1.5em;">Platform Highlights</h2>
-
-<h3>New user features</h3>
-
-<ul>
-<li><strong>Optimizations for a wider range of tablets</strong>
-
-<p>Android 3.2 includes a variety of optimizations across the system
-to ensure a great user experience on a wider range of tablet devices.</p></li>
-
-<li><strong>Compatibility zoom for fixed-sized apps</strong>
-
-<p>Android 3.2 introduces a new <em>compatibility zoom</em> mode that gives
-users a new way to view fixed-sized apps on larger devices. The new mode provides a
-pixel-scaled alternative to the standard UI stretching for apps that are not
-designed to run on larger screen sizes, such as on tablets. The new mode is
-accessible to users from a menu icon in the system bar, for apps that need
-compatibility support.</p></li>
-
-<li><strong>Media sync from SD card</strong>
-<p>On devices that support an SD card, users can now load media files directly
-from the SD card to apps that use them. A system facility makes the files
-accessible to apps from the system media store.</p></li>
-</ul>
-
-
-<h3>New developer features</h3>
-
-<ul>
-<li><strong>Extended API for managing screens support</strong>
-
-<p>Android 3.2 introduces extensions to the platform's screen support API to
-give developers additional ways to manage application UI across the range of
-Android-powered devices. The API includes new resource qualifiers and new
-manifest attributes that give you more precise control over how your
-apps are displayed on different sizes, rather than relying on generalized
-size categories.</p>
-
-<p>To ensure the best possible display for fixed-sized apps and apps with limited
-support for various screen sizes, the platform also provides a new zoom
-compatibility mode that renders the UI on a smaller screen area, then scales it
-up to fill the space available on the display. For more information about the
-screen support API and the controls it provides, see the sections below. </p></li>
-</ul>
-
-
-<h2 id="api">API Overview</h2>
-
-<h3 id="usb">Screens Support APIs</h3>
-
-<p>Android 3.2 introduces new screens support APIs that give you more
-control over how their applications are displayed across different screen sizes.
-The API builds on the existing screens-support API, including the platform's
-generalized screen density model, but extends it with the ability to precisely
-target specific screen ranges by their dimensions, measured in
-density-independent pixel units (such as 600dp or 720dp wide), rather than
-by their generalized screen sizes (such as large or xlarge)</p>
-
-<p>When designing an application's UI, you can still rely on the platform to
-provide density abstraction, which means that applications do not need to
-compensate for the differences in actual pixel density across devices. You
-can design the application UI according to the amount of horizontal or vertical
-space available. The platform expresses the amount of space available using three new
-characteristics: <em>smallestWidth</em>, <em>width</em>, and
-<em>height</em>.</p>
-
-<ul>
-<li>A screen's <em>smallestWidth</em> is its fundamental minimum size,
-measured in density-independent pixel ("dp") units. Of the screen's height or
-width, it is the shorter of the two. For a screen in portrait orientation, the
-smallestWidth is normally based on its width, while in landscape orientation it is based
-on its height. In all cases, the smallestWidth is derived from a fixed characteristic of the
-screen and the value does not change, regardless of orientation. The smallestWidth
-is important for applications because it represents the shortest possible width
-in which the application UI will need to be drawn, not including screen areas
-reserved by the system.
-</li>
-
-<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
-and portrait. </li>
-
-</ul>
-
-<p>The new screens support API is designed to let you manage application UI
-according to the smallestWidth of the current screen. You can also manage the
-UI according to current width or height, as needed. For those purposes, the API
-provides these tools:</p>
-
-<ul>
-<li>New resource qualifiers for targeting layouts and other resources to a
-minimum smallestWidth, width, or height, and</li>
-<li>New manifest attributes, for specifying the app's maximum
-screen compatibility range</li>
-</ul>
-
-<p>Additionally, applications can still query the system and manage UI and
-resource loading at runtime, as in the previous versions of the platform.</p>
-
-<p>Since the new API lets you target screens more directly through smallestWidth,
-width, and height, it's helpful to understand the typical
-characteristics of the different screen types. The table below provides some
-examples, measured in "dp" units. </p>
-
-<p class="caption"><strong>Table 1.</strong> Typical devices, with density
-and size in dp.</p>
-
-<table>
-<tr>
-<th>Type</th>
-<th>Density (generalized)</th>
-<th>Dimensions (dp)</th>
-<th>smallestWidth (dp)</th>
-</tr>
-<tr>
-<td>Baseline phone</td>
-<td>mdpi</td>
-<td>320x480</td>
-<td>320</td>
-</td>
-<tr>
-<td>Small tablet/large phone</td>
-<td>mdpi</td>
-<td>480x800</td>
-<td>480</td>
-</tr>
-<tr>
-<td>7-inch tablet</td>
-<td>mdpi</td>
-<td>600x1024</td>
-<td>600</td>
-</tr>
-<tr>
-<td>10-inch tablet</td>
-<td>mdpi</td>
-<td>800x1280</td>
-<td>800</td>
-</tr>
-</table>
-
-<p>The sections below provide more information about the new screen qualifiers
-and manifest attributes. For complete information about how to use the screen
-support API, see <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
-
-<h4>New resource qualifiers for screens support</h4>
-
-<p>The new resource qualifiers in Android 3.2 let you better target your layouts
-for ranges of screen sizes. Using the qualifiers, you can create resource
-configurations designed for a specific minimum smallestWidth, current width, or
-current height, measured in density-independent pixels.</p>
-
-<p>The new qualifiers are:</p>
-<ul>
-<li><code>swNNNdp</code> — Specifies the minimum smallestWidth on which
-the resource should be used, measured in "dp" units. As mentioned above, a
-screen's smallestWidth is constant, regardless of orientation. Examples:
-<code>sw320dp</code>, <code>sw720dp</code>, <code>sw720dp</code>.</li>
-
-<li><code>wNNNdp</code> and <code>hNNNdp</code> — Specifies the minimum
-width or height on which the resource should be used, measured in "dp" units. As
-mentioned above, a screen's width and height are relative to the orientation of
-the screen and change whenever the orientation changes. Examples:
-<code>w320dp</code>, <code>w720dp</code>, <code>h1024dp</code>.</p></li>
-</ul>
-
-<p>You can also create multiple overlapping resource configurations if needed.
-For example, you could tag some resources for use on any screen wider than 480
-dp, others for wider than 600 dp, and others for wider than 720 dp. When
-multiple resource configurations are qualified for a given screen, the system
-selects the configuration that is the closest match. For precise control over
-which resources are loaded on a given screen, you can tag resources with one
-qualifier or combine several new or existing qualifiers.
-
-<p>Based on the typical dimensions listed earlier, here are some examples of how
-you could use the new qualifiers:</p>
-
-<pre class="classic prettyprint">res/layout/main_activity.xml # For phones
-res/layout-sw600dp/main_activity.xml # For 7” tablets
-res/layout-sw720dp/main_activity.xml # For 10” tablets
-res/layout-w600dp/main_activity.xml # Multi-pane when enough width
-res/layout-sw600dp-w720dp/main_activity.xml # For large width</pre>
-
-<p>Older versions of the platform will ignore the new qualifiers, so you can
-mix them as needed to ensure that your app looks great on any device. Here
-are some examples:</p>
-
-<pre class="classic prettyprint">res/layout/main_activity.xml # For phones
-res/layout-xlarge/main_activity.xml # For pre-3.2 tablets
-res/layout-sw600dp/main_activity.xml # For 3.2 and up tablets</pre>
-
-<p>For complete information about how to use the new qualifiers, see <a href="{@docRoot}guide/practices/screens_support.html#NewQualifiers">Using new
-size qualifiers</a>.</p>
-
-<h4>New manifest attributes for screen-size compatibility</h4>
-
-<p>The framework offers a new set of <a
-href="{@docRoot}"><code><supports-screens></code></a> manifest attributes that let
-you manage your app's support for different screen sizess.
-Specifically, you can specify the largest and smallest screens on which your app
-is designed to run, as well as the largest screen on which it is designed run
-without needing the system's new <a href="{@docRoot}guide/practices/screen-compat-mode.html">screen
-compatibility mode</a>. Like the resource qualifiers described above, the new
-manifest attributes specify the range of screens that the application supports,
-as specified by the smallestWidth. </p>
-
-<p>The new manifest attributes for screen support are: </p>
-
-<ul>
-<li><code>android:compatibleWidthLimitDp="<em>numDp"</em></code> — This
-attribute lets you specify the maximum smallestWidth on which the application
-can run without needing compatibility mode. If the current screen is larger than
-the value specified, the system displays the application in normal mode but
-allows the user to optionally switch to compatibility mode through a setting in
-the system bar.</li>
-
-<li><code>android:largestWidthLimitDp="<em>numDp</em>"</code> — This
-attribute lets you specify the maximum smallestWidth on which the application
-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:requiresSmallestWidthDp="<em>numDp"</em></code> — 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
-from being installed and run.</li>
-</ul>
-
-<p class="note"><strong>Note:</strong> Google Play does not currently filter
-apps based on any of the attributes above. Support for filtering will be
-added in a later platform release. Applications that require
-filtering based on screen size can use the existing <code><supports-screens></code>
-attributes.</p>
-
-<p>For complete information about how to use the new attributes, see <a href="{@docRoot}guide/practices/screens_support.html#DeclaringScreenSizeSupport">Declaring
-screen size support</a>.</p>
-
-<h4>Screen compatibility mode</h4>
-
-<p>Android 3.2 provides a new screen compatibility mode for applications
-explicitly declaring that they do not support screens as large as the one on
-which they are running. This new "zoom" mode is a pixel-scaled — it
-renders the application in a smaller screen area and then scales the pixels to
-fill the current screen.</p>
-
-<p>By default, the system offers screen compatibility mode as an user option, for apps
-that require it. Users can turn the zoom mode on and off using a control available
-in the system bar. </p>
-
-<p>Because the new screen compatibility mode may not be appropriate for all
-applications, the platform allows the application to disable it using manifest
-attributes. When disabled by the app, the system does not offer "zoom" compatibility
-mode as an option for users when the app is running.</p>
-
-<p class="note"><strong>Note:</strong> For important information about how
-to control compatibility mode in your applications, please review the <a
-href="http://android-developers.blogspot.com/2011/07/new-mode-for-apps-on-large-
-screens.html">New Mode for Apps on Large Screens</a> article on the Android
-Developers Blog. </p>
-
-<h4>New screen density for 720p televisions and similar devices</h4>
-
-<p>To meet the needs of applications running on 720p televisions or similar with
-moderate density screens, Android 3.2 introduces a new generalized density,
-<code>tvdpi</code>, with an approximate dpi of 213. Applications can query for
-the new density in {@link android.util.DisplayMetrics#densityDpi} and can use
-the new <code>tvdpi</code> qualifier to tag resources for televisions and
-similar devices. For example:</p>
-
-<pre class="classic prettyprint">res/drawable-tvdpi/my_icon.png # Bitmap for tv density</pre>
-
-<p>In general, applications should not need to work with this density. For situations
-where output is needed for a 720p screen, the UI elements can be scaled
-automatically by the platform.</p>
-
-
-<h3 id="ui" style="margin-top:1.25em;">UI framework</h3>
-<ul>
-<li>Fragments
- <ul>
- <li>New {@link android.app.Fragment.SavedState} class holds the state
- information retrieved from a fragment instance through
- {@link android.app.FragmentManager#saveFragmentInstanceState(android.app.Fragment) saveFragmentInstanceState()}.</li>
- <li>New method {@link android.app.FragmentManager#saveFragmentInstanceState(android.app.Fragment) saveFragmentInstanceState()}
- saves the current instance state of
- the given Fragment. The state can be used later when creating a new instance
- of the Fragment that matches the current state.</li>
- <li>New method {@link android.app.Fragment#setInitialSavedState(SavedState) setInitialSavedState()}
- sets the initial saved state for a Fragment when first constructed.</li>
- <li>New {@link android.app.Fragment#onViewCreated(android.view.View, android.os.Bundle)
- onViewCreated()} callback method notifies the Fragment that
- {@link android.app.Fragment#onCreateView(LayoutInflater, ViewGroup, Bundle) onCreateView()}
- has returned, but before any saved state has been restored in to the View.</li>
- <li>{@link android.app.Fragment#isDetached()} method determines whether
- the Fragment has been explicitly detached from the UI.</li>
- <li>New {@link android.app.FragmentTransaction#attach(android.app.Fragment) attach()}
- and {@link android.app.FragmentTransaction#detach(android.app.Fragment) detach()}
- methods let an application re-attach or detach fragments in the UI.</li>
- <li>A new {@link android.app.FragmentTransaction#setCustomAnimations(int, int, int, int)
- setCustomAnimations()} overload method lets you set specific animation
- resources to run for enter/exit operations and specifically when
- popping the back stack. The existing implementation does not account
- for the different behavior of fragments when popping the back stack.</li>
- </ul>
-</li>
-<li>Screen size information in ActivityInfo and ApplicationInfo
- <ul>
- <li>{@link android.content.pm.ActivityInfo} adds {@link android.content.pm.ActivityInfo#CONFIG_SCREEN_SIZE}
- and {@link android.content.pm.ActivityInfo#CONFIG_SMALLEST_SCREEN_SIZE} as bit masks
- in {@link android.R.attr#configChanges}. The bits indicate whether an Activity can
- itself handle the screen size and smallest screen size.</li>
- <li>{@link android.content.pm.ApplicationInfo} adds
- {@link android.content.pm.ApplicationInfo#largestWidthLimitDp}, {@link android.content.pm.ApplicationInfo#compatibleWidthLimitDp},
- and {@link android.content.pm.ApplicationInfo#requiresSmallestWidthDp} fields,
- derived from the corresponding <code><supports-screens></code> attributes
- in the application manifest file.</li>
- </ul>
-</li>
-<li>Helpers for getting display size from WindowManager
- <ul>
- <li>New methods {@link android.view.Display#getSize(android.graphics.Point)
- getSize()} and {@link android.view.Display#getRectSize(android.graphics.Rect)
- getRectSize()} let applications get the raw size of the display.</li>
- </ul>
-</li>
-<li>New public "holographic" styles
- <ul>
- <li>The platform now exposes a variety of public "holographic" styles
- for text, actionbar widgets and tabs, and more. See
- {@link android.R.style} for a full list.</li>
- </ul>
-</li>
-<li>{@link android.app.LocalActivityManager}, {@link android.app.ActivityGroup}, and
- {@link android.app.LocalActivityManager} are now deprecated
- <ul>
- <li>New applications should use Fragments instead of these classes. To
- continue to run on older versions of the platform, you can use the v4 Support
- Library (compatibility library), available in the Android SDK. The v4 Support
- Library provides a version of the Fragment API that is compatible down to
- Android 1.6 (API level 4).
- <li>For apps developing against Android 3.0 (API level
- 11) or higher, tabs are typically presented in the UI using the new
- {@link android.app.ActionBar#newTab() ActionBar.newTab()} and related APIs
- for placing tabs within their action bar area.</p></li>
- </ul>
-</li>
-</ul>
-
-<h3 id="media" style="margin-top:1em;">Media framework</h3>
-<ul>
- <li>Applications that use the platform's media provider ({@link
- android.provider.MediaStore}) can now read media data directly from the
- removeable SD card, where supported by the device. Applications can also
- interact with the SD card files directly, using the MTP API. </li>
-
-</ul>
-<h3 id="graphics" style="margin-top:1.25em;">Graphics</h3>
-<ul>
-<li>Parcelable utilities in Point and PointF
- <ul>
- <li>{@link android.graphics.Point} and {@link android.graphics.PointF}
- classes now include the {@link android.os.Parcelable} interface and utility methods {@link
- android.graphics.Point#describeContents()}, {@link
- android.graphics.Point#readFromParcel(android.os.Parcel) readFromParcel()}, and {@link
- android.graphics.Point#writeToParcel(android.os.Parcel, int) writeToParcel()}.</li>
- </ul>
-</li>
-</ul>
-
-
-<h3 id="ime" style="margin-top:1.25em;">IME framework</h3>
-<ul>
- <li>New {@link android.view.KeyEvent#getModifiers()} method for
- retrieving the current state of the modifier keys.</li>
-</ul>
-
-
-<h3 id="usb" style="margin-top:1.25em;">USB framework</h3>
-<ul>
- <li>New {@link
- android.hardware.usb.UsbDeviceConnection#getRawDescriptors()} method for
- retrieving the raw USB descriptors for the device. You can use the
- method to access descriptors not supported directly via the higher
- level APIs.</li>
-</ul>
-
-
-<h3 id="network" style="margin-top:1.25em;">Network</h3>
-<ul>
-<li>Network type constants
- <ul>
- <li>{@link android.net.ConnectivityManager} adds the constants {@link
- android.net.ConnectivityManager#TYPE_ETHERNET} and {@link
- android.net.ConnectivityManager#TYPE_BLUETOOTH}.</li>
- </ul>
-</li>
-</ul>
-
-
-<h3 id="telephony" style="margin-top:1.25em;">Telephony</h3>
-<ul>
- <li>New {@link android.telephony.TelephonyManager#NETWORK_TYPE_HSPAP} network type constant.</li>
-</ul>
-
-<h3 id="other" style="margin-top:1.25em;">Core utilities</h3>
-<ul>
-<li>Parcelable utilities
- <ul>
- <li>New interface {@link android.os.Parcelable.ClassLoaderCreator} allows
- the application to receive the ClassLoader in which the object is being created.</li>
- <li>New {@link android.os.ParcelFileDescriptor#adoptFd(int) adoptFd}, {@link
- android.os.ParcelFileDescriptor#dup(java.io.FileDescriptor) dup()}, and {@link
- android.os.ParcelFileDescriptor#fromFd(int) fromFd()} for managing
- {@link android.os.ParcelFileDescriptor} objects.</li>
- </ul>
-</li>
-<li>Binder and IBinder
- <ul>
- <li>New method {@link android.os.Binder#dumpAsync(java.io.FileDescriptor, java.lang.String[]) dumpAsync()}
- in {@link android.os.Binder} and {@link android.os.IBinder} let applications
- dump to a specified file, ensuring that the target executes asynchronously.</li>
- <li>New {@link android.os.IBinder} protocol transaction code {@link
- android.os.IBinder#TWEET_TRANSACTION} lets applications send a tweet
- to the target object.</li>
- </ul>
-</li>
-</ul>
-
-
-
-
-<h3 id="features">New feature constants</h3>
-
-<p>The platform adds new hardware feature constants that you can declare
-in their application manifests, to inform external entities such as Google
-Play of required hardware and software capabilities. You declare these
-and other feature constants in <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
-<uses-feature>}</a> manifest elements.
-
-<p>Google Play filters applications based on their <code><uses-feature></code> attributes, to ensure that they are available only to devices on which their requirements are met. </p>
-
-<ul>
-<li>Feature constants for landscape or portrait requirements
-
-<p>Android 3.2 introduces new feature constants that let applications specify whether they require display in landscape orientation, portrait orientation, or both. Declaring these constants indicates that the application must not be installed on a device that doesn't offer the associated orientation. Conversely, if one or both of the constants are not declared, it indicates that the application does not have a preference for the undeclared orientations and may be installed on a device that doesn't offer them. </p>
-
-<ul>
- <li>{@link android.content.pm.PackageManager#FEATURE_SCREEN_LANDSCAPE
-android.hardware.screen.landscape} — The application requires display in
-landscape orientation.</li>
- <li>{@link android.content.pm.PackageManager#FEATURE_SCREEN_PORTRAIT
-android.hardware.screen.portrait} — The application requires display in
-portrait orientation.</li>
-</ul>
-
-<p>A typical application that functions properly in both landscape and portrait orientations would not normally need to declare an orientation requirement. Rather, an application designed primarily for one orientation, such as an app designed for a television, could declare one of the constants to ensure that it isn't available to devices that don't provide that orientation.</p>
-
-<p>If any of activities declared in the manifest request that they run in a specific orientation,
-using the <a href="{@docRoot}guide/topics/manifest/activity-element.html#screen">{@code
-android:screenOrientation}</a> attribute, then this also declares that the application
-requires that orientation.</p>
-
-</li>
-<li>Other feature constants
-
-<ul>
- <li>{@link android.content.pm.PackageManager#FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT
-android.hardware.faketouch.multitouch.distinct} — The application requires support for emulated mulitouch input with distinct tracking of two or more points.</li>
-
- <li>{@link android.content.pm.PackageManager#FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND
-android.hardware.faketouch.multitouch.jazzhand} — The application requires support for emulated mulitouch input with distinct tracking of five or more points.</li>
-</ul>
-
-</li>
-</ul>
-
-
-<h3 id="api-diff">API Differences Report</h3>
-
-<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
-Level
-{@sdkPlatformApiLevel}), see the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
-Differences Report</a>.</p>
-
-
-
-
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
-the framework API. The Android {@sdkPlatformVersion} API
-is assigned an integer identifier —
-<strong>{@sdkPlatformApiLevel}</strong> — that is
-stored in the system itself. This identifier, called the "API Level", allows the
-system to correctly determine whether an application is compatible with
-the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
-you need compile the application against the Android library that is provided in
-the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you
-might
-also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
-attribute to the <code><uses-sdk></code> element in the application's
-manifest.</p>
-
-<p>For more information about how to use API Level, see the <a
-href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
-
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>API Demos</li>
-<li>Browser</li>
-<li>Calculator</li>
-<li>Camera</li>
-<li>Clock</li>
-<li>Contacts</li>
-<li>Custom Locale</li>
-<li>Dev Tools</li>
-<li>Downloads</li>
-<li>Email</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<ul>
-<li>Gallery</li>
-<li>Gestures Builder</li>
-<li>Messaging</li>
-<li>Music</li>
-<li>Search</li>
-<li>Settings</li>
-<li>Spare Parts</li>
-<li>Speech Recorder</li>
-<li>Widget Preview</li>
-</ul>
-</td>
-</tr>
-</table>
-
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable SDK platform provides a variety
-of
-built-in locales. In some cases, region-specific strings are available for the
-locales. In other cases, a default version of the language is used. The
-languages that are available in the Android 3.0 system
-image are listed below (with <em>language</em>_<em>country/region</em> locale
-descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Arabic, Egypt (ar_EG)</li>
-<li>Arabic, Israel (ar_IL)</li>
-<li>Bulgarian, Bulgaria (bg_BG)</li>
-<li>Catalan, Spain (ca_ES)</li>
-<li>Czech, Czech Republic (cs_CZ)</li>
-<li>Danish, Denmark(da_DK)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Greek, Greece (el_GR)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Ireland (en_IE)</li>
-<li>English, India (en_IN)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>English, US (en_US)</li>
-<li>English, Zimbabwe (en_ZA)</li>
-<li>Spanish (es_ES)</li>
-<li>Spanish, US (es_US)</li>
-<li>Finnish, Finland (fi_FI)</li>
-<li>French, Belgium (fr_BE)</li>
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>French, France (fr_FR)</li>
-<li>Hebrew, Israel (he_IL)</li>
-<li>Hindi, India (hi_IN)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>Croatian, Croatia (hr_HR)</li>
-<li>Hungarian, Hungary (hu_HU)</li>
-<li>Indonesian, Indonesia (id_ID)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Lithuanian, Lithuania (lt_LT)</li>
-<li>Latvian, Latvia (lv_LV)</li>
-<li>Norwegian bokmål, Norway (nb_NO)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Polish (pl_PL)</li>
-<li>Portuguese, Brazil (pt_BR)</li>
-<li>Portuguese, Portugal (pt_PT)</li>
-<li>Romanian, Romania (ro_RO)</li>
-<li>Russian (ru_RU)</li></li>
-<li>Slovak, Slovakia (sk_SK)</li>
-<li>Slovenian, Slovenia (sl_SI)</li>
-<li>Serbian (sr_RS)</li>
-<li>Swedish, Sweden (sv_SE)</li>
-<li>Thai, Thailand (th_TH)</li>
-<li>Tagalog, Philippines (tl_PH)</li>
-<li>Turkish, Turkey (tr_TR)</li>
-<li>Ukrainian, Ukraine (uk_UA)</li>
-<li>Vietnamese, Vietnam (vi_VN)</li>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-</td>
-</tr>
-</table>
-
-<p class="note"><strong>Note:</strong> The Android platform may support more
-locales than are included in the SDK system image. All of the supported locales
-are available in the <a href="http://source.android.com/">Android Open Source
-Project</a>.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes the following emulator skin:</p>
-
-<ul>
- <li>
- WXGA (1280x800, medium density, xlarge screen)
- </li>
-</ul>
-
-<p>For more information about how to develop an application that displays
-and functions properly on all Android-powered devices, see <a
-href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a>.</p>
diff --git a/docs/html/sdk/android-4.0-highlights.jd b/docs/html/sdk/android-4.0-highlights.jd
deleted file mode 100644
index 98f467d..0000000
--- a/docs/html/sdk/android-4.0-highlights.jd
+++ /dev/null
@@ -1,1009 +0,0 @@
-page.title=Android 4.0 Platform Highlights
-
-@jd:body
-
-
-<style type="text/css">
-#jd-content {
- max-width:1024px;
-}
-#jd-content div.screenshot {
- float:left;
- clear:left;
- padding:15px 30px 15px 0;
-}
-#jd-content div.video {
- float:right;
- padding:0 0 40px 60px;
- margin-top:-30px;
-}
-#jd-content table.columns {
- margin:0 0 1em 0;
-}
-#jd-content table.columns td {
- padding:0;
-}
-#jd-content table.columns td+td {
- padding:0 2em;
-}
-#jd-content table.columns td img {
- margin:0;
-}
-#jd-content table.columns td+td>*:first-child {
- margin-top:-2em;
-}
-.green {
- color:#8db529;
- font-weight:bold;
-}
-</style>
-
-<div class="video">
-<iframe width="380" height="223" src="http://www.youtube.com/embed/-F_ke3rxopc?hd=1" frameborder="0"
-allowfullscreen></iframe>
-</div>
-
-<p>Welcome to Android 4.0!</p>
-
-<p>Android 4.0 delivers a refined, unified UI for phones and tablets and
-introduces innovative features for users and developers. This document provides
-a glimpse of the many new features and technologies that make Android 4.0
-simple, beautiful, and beyond smart. <!--For technical details about
-new developer APIs described below, see the <a
-href="{@docRoot}sdk/android-4.0.html">Android 4.0 API Overview</a>
-document.--></p>
-
-<ul>
- <li><a href="#UserFeatures">Android 4.0 for Users</a></li>
- <li><a href="#DeveloperApis">Android 4.0 for Developers</a></li>
-</ul>
-
-<h2 id="UserFeatures" style="clear:right">Android 4.0 for Users</h2>
-
-<div style="padding-bottom:0em;">
-<a href="{@docRoot}sdk/images/4.0/home-lg.png" target="_android"><img style="float:right;xborder:1px solid #ddd;border-radius: 5px;" src="{@docRoot}sdk/images/4.0/home.png" alt="" height="300" width="180" /></a>
-<a href="{@docRoot}sdk/images/4.0/lock-lg.png" target="_android"><img style="float:right;border:1px solid #ddd;border-radius: 5px;" src="{@docRoot}sdk/images/4.0/lock.png" alt="" height="300" width="180" /></a>
-</div>
-
-
-<h3 id="simple" style="color:#172861">Simple, beautiful, beyond smart</h3>
-
-<p>Android 4.0 builds on the things people love most about Android — easy
-multitasking, rich notifications, customizable home screens, resizable widgets,
-and deep interactivity — and adds powerful new ways of communicating and
-sharing.</p>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Refined, evolved UI</strong></p>
-
-<p>Focused on bringing the power of Android to the surface, Android 4.0 makes
-<strong>common actions more visible</strong> and lets users navigate with
-simple, intuitive gestures. Refined <strong>animations</strong> and feedback
-throughout the system make interactions engaging and interesting. An entirely
-<strong>new typeface</strong> optimized for high-resolution screens improves
-readability and brings a polished, modern feel to the user interface.</p>
-
-<p>Virtual buttons in the System Bar let users navigate instantly to Back, Home,
-and Recent Apps. The <strong>System Bar</strong> and virtual buttons are present
-across all apps, but can be dimmed by applications for full-screen viewing.
-Users can access each application's contextual options in the <strong>Action
-Bar</strong>, displayed at the top (and sometimes also at the bottom) of the
-screen.</p>
-
-<p><strong>Multitasking</strong> is a key strength of Android and it's made even
-easier and more visual on Android 4.0. The Recent Apps button lets users jump
-instantly from one task to another using the list in the System Bar. The list
-pops up to show thumbnail images of apps used recently — tapping a
-thumbnail switches to the app.</p>
-
-<div style="padding-top:0em;">
-<div style="margin-right:.5em;float:left;width:182px;padding-top:.5em;">
-<a href="{@docRoot}sdk/images/4.0/tasks-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/tasks.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<div style="padding-left:1em;padding-bottom:1em;font-size:.9em;padding-right:1em;">The Recent Apps list makes multitasking simple.</div>
-<a href="{@docRoot}sdk/images/4.0/lock-camera-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/lock-camera.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<div style="padding-left:1em;padding-bottom:1em;font-size:.9em;padding-right:1.75em;">Jump to the camera or see notifications without unlocking.</div>
-<a href="{@docRoot}sdk/images/4.0/contact-call-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/contact-call.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
-<!--<a href="{@docRoot}sdk/images/4.0/quick-response-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/quick-responses-new.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>-->
-<div style="padding-left:1em;padding-bottom:.5em;font-size:.9em;padding-right:1.75em;">For incoming calls, you can respond instantly by text.</div>
-</div>
-</div>
-
-<p>Rich and interactive <strong>notifications</strong> let users keep in
-constant touch with incoming messages, play music tracks, see real-time updates
-from apps, and much more. On smaller-screen devices, notifications appear at the
-top of the screen, while on larger-screen devices they appear in the System
-Bar.</p>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:right;margin-left:1em;margin-top:.5em;margin-bottom:0;padding-bottom:0;width:326px">
-<a href="{@docRoot}sdk/images/4.0/allapps-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/allapps.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<a href="{@docRoot}sdk/images/4.0/calendar-widget-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/calendar-widget.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<div style="padding-left:1em;padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure 3.</strong>-->The All Apps launcher (left) and resizable widgets (right) give you apps and rich content from the home screen.</div>
-</div>
-</div>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Home screen folders and
-favorites tray</strong></p>
-
-<p>New home screen <strong>folders</strong> offer a new way for users to group
-their apps and shortcuts logically, just by dragging one onto another. Also,
-in All Apps launcher, users can now simply <strong>drag an app</strong> to get
-information about it or immediately uninstall it, or disable a pre-installed app.</p>
-
-<p>On smaller-screen devices, the home screen now includes a customizable
-<strong>favorites tray</strong> visible from all home screens. Users can drag
-apps, shortcuts, folders, and other priority items in or out of the favorites
-tray for instant access from any home screen.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Resizable
-widgets</strong></p>
-
-<p>Home screens in Android 4.0 are designed to be content-rich and customizable.
-Users can do much more than add shortcuts — they can embed live
-application content directly through interactive <strong>widgets</strong>.
-Widgets let users check email, flip through a calendar, play music, check social
-streams, and more — right from the home screen, without having to launch
-apps. Widgets are resizable, so users can expand them to show more content or
-shrink them to save space.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>New lock screen
-actions</strong></p>
-
-<p>The lock screens now let users do more without unlocking. From the slide lock
-screen, users can <strong>jump directly to the camera</strong> for a picture or
-<strong>pull down the notifications window</strong> to check for messages. When
-listening to music, users can even manage music tracks and see album art. </p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Quick responses for
-incoming calls</strong></p>
-
-<p>When an incoming call arrives, users can now quickly <strong>respond by text
-message</strong>, without needing to pick up the call or unlock the device. On
-the incoming call screen, users simply slide a control to see a list of text
-responses and then tap to send and end the call. Users can add their own
-responses and manage the list from the Settings app.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Swipe to dismiss
-notifications, tasks, and browser tabs</strong></p>
-
-<p>Android 4.0 makes managing notifications, recent apps, and browser tabs even
-easier. Users can now dismiss individual notifications, apps from the Recent
-Apps list, and browser tabs with a simple swipe of a finger. </p>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:right;margin-left:1em;margin-top:1.5em;margin-bottom:0;padding-bottom:0;width:200px">
-<a href="{@docRoot}sdk/images/4.0/text-replace-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/text-replace.png" alt="" width="190" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure 3.</strong>-->A spell-checker lets you find errors and fix them faster. </div>
-<a href="{@docRoot}sdk/images/4.0/tts-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/tts.png" alt="" width="190" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em">A powerful voice input engine lets you dictate continously.</div>
-</div>
-</div>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Improved text input and
-spell-checking</strong></p>
-
-<p>The soft keyboard in Android 4.0 makes text input even faster and more
-accurate. Error correction and word suggestion are improved through a new set of
-default dictionaries and more accurate heuristics for handling cases such as
-double-typed characters, skipped letters, and omitted spaces. Word suggestion
-is also improved and the suggestion strip is simplified to show only three
-words at a time.</p>
-
-<p>To fix misspelled words more easily, Android 4.0 adds a
-<strong>spell-checker</strong> that locates and underlines errors and suggests
-replacement words. With one tap, users can choose from multiple spelling
-suggestions, delete a word, or add it to the dictionary. Users can even tap to
-see replacement suggestions for words that are spelled correctly. For
-specialized features or additional languages, users can now download and install
-third-party dictionaries, spell-checkers, and other text services.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Powerful voice input
-engine</strong></p>
-
-<p>Android 4.0 introduces a powerful new voice input engine that offers a
-continuous "open microphone" experience and streaming voice recognition. The new
-voice input engine lets users dictate the text they want, for as long as they
-want, using the language they want. Users can <strong>speak continously</strong> for a prolonged
-time, even pausing for intervals if needed, and dictate punctuation to create
-correct sentences. As the voice input engine enters text, it underlines possible
-dictation errors in gray. After dictating, users can tap the underlined words to
-quickly replace them from a list of suggestions.</p>
-
-<div style="padding-top:0em;">
-<div style="margsin-right:.8em;float:left;width:350px;padding-top:1em;">
-<a href="{@docRoot}sdk/images/4.0/usage-all-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/usage-all.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<a href="{@docRoot}sdk/images/4.0/usage-maps-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/usage-maps.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<div style="padding-left:1em;padding-bottom:1em;font-size:.9em;padding-right:1.75em;"><!--<strong>Figure 3.</strong>--> Data usage controls let you monitor total usage by network type and application and then set limits if needed.</div>
-</div>
-</div>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Control over network
-data</strong></p>
-
-<p>Mobile devices can make extensive use of network data for streaming content,
-synchronizing data, downloading apps, and more. To meet the needs of users with
-<strong>tiered or metered data plans</strong>, Android 4.0 adds new controls for
-managing network data usage.</p>
-
-<p>In the Settings app, colorful charts show the total data usage on each
-network type (mobile or Wi-Fi), as well as amount of data used by each running
-application. Based on their data plans, users can optionally set warning levels
-or hard limits on data usage or disable mobile data altogether. Users can also
-manage the background data used by individual applications as needed.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Designed for
-accessibility</strong></p>
-
-<p>A variety of new features greatly enhance the accessibility of Android 4.0
-for blind or visually impaired users. Most important is a new
-<strong>explore-by-touch mode</strong> that lets users navigate without having
-to see the screen. Touching the screen once triggers audible feedback that
-identifies the UI component below; a second touch in the same component
-activates it with a full touch event. The new mode is especially important to
-support users on new devices that use virtual buttons in the System Bar, rather
-than dedicated hardware buttons or trackballs. Also, standard apps are updated
-to offer an improved accessibility experience. The <strong>Browser</strong>
-supports a script-based screen reader for reading favorite web content and
-navigating sites. For improved readability, users can also increase the default
-font size used across the system.</p>
-
-<p>The accessibility experience begins at first setup — a simple
-<strong>touch gesture</strong> during setup (clockwise square from upper left)
-activates all accessibility features and loads a setup tutorial. Once
-accessibility features are active, everything visible on the screen can be
-spoken aloud by the standard screen reader.</p>
-
-
-<h3 id="comms" style="color:#172861">Communication and sharing</h3>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:right;margin-left:.5em;margin-top:1.5em;margin-bottom:0;padding-bottom:0;width:490px">
-<!--<img src="{@docRoot}sdk/images/4.0/contact-call.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" />-->
-<a href="{@docRoot}sdk/images/4.0/contact-faves-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/contact-faves.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
-<a href="{@docRoot}sdk/images/4.0/contact-connect-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/contact-connect.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
-<a href="{@docRoot}sdk/images/4.0/contact-email-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/contact-email.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;padding:0" /></a>
-
-<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure 3.</strong>-->Contacts and profiles are integrated across apps and social networks, for a consistent, personal experience everywhere — from incoming calls to emails.</div>
-</div>
-</div>
-
-<p>Designed for the way people live, Android 4.0 integrates rich social
-communication and sharing touchpoints across the system, making it easy to talk,
-email, text, and share.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>People and
-profiles</strong></p>
-
-<p>Throughout the system, a user’s social groups, profiles, and contacts are
-linked together and integrated for easy accessibility. At the center is a new
-<strong>People app</strong> that offers richer profile information, including a
-large profile picture, phone numbers, addresses and accounts, status updates,
-events, stream items, and a new button for connecting on integrated social networks. </p>
-
-<p>The user's own contact information is stored in a new <strong>"Me"
-profile</strong>, allowing easier sharing with apps and people. All of the
-user's integrated contacts are displayed in an easy to manage list, including
-controls over which contacts are shown from any integrated account or social
-network. Wherever the user navigates across the system, tapping a profile photo
-displays Quick Contacts, with large profile pictures, shortcuts to phone numbers,
-text messaging, and more. </p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Unified calendar, visual
-voicemail</strong></p>
-
-<p>To help organize appointments and events, an updated <strong>Calendar
-app</strong> brings together personal, work, school, and social agendas. With
-user permission, other applications can contribute events to the calendar and
-manage reminders, for an integrated view across multiple calendar providers. The
-app is redesigned to let users manage events more easily. Calendars are
-color-coded and users can <strong>swipe left or right</strong> to change dates
-and pinch to zoom in or out agendas. </p>
-
-<p>In the phone app, a new <strong>visual voicemail</strong> features integrates
-incoming messages, voice transcriptions, and audio files from one or more
-providers. Third-party applications can integrate with the Phone app to add
-their own voice messages, transcriptions, and more to the visual voicemail
-inbox. </p>
-
-<div style="padding-top:0em;">
-<div style="margsin-right:0em;float:left;width:282px;padding-top:1em;">
-<a href="{@docRoot}sdk/images/4.0/camera-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/camera.png" alt="" width="240" height="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<a href="{@docRoot}sdk/images/4.0/gallery-edit-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/gallery-edit.png" alt="" width="240" height="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<a href="{@docRoot}sdk/images/4.0/gallery-share-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/gallery-share.png" alt="" width="240" height="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<div style="padding-left:1em;padding-bottom:1em;font-size:.9em;padding-right:2.75em;">Capture the picture you want, edit, and share instantly. </div>
-</div>
-</div>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Rich and versatile camera
-capabilities</strong></p>
-
-<p>The Camera app includes many new features that let users capture special moments
-with great photos and videos. After capturing images, they can edit and share
-them easily with friends. </p>
-
-<p>When taking pictures, <strong>continuous focus</strong>, <strong>zero shutter
-lag exposure</strong>, and decreased shot-to-shot speed help capture clear,
-precise images. <strong>Stabilized image zoom</strong> lets users compose photos
-and video in the way they want, including while video is recording. For new
-flexibility and convenience while shooting video, users can now take
-<strong>snapshots at full video resolution</strong> just by tapping the screen
-as video continues to record.</p>
-
-<p>To make it easier to take great pictures of people, built-in <strong>face
-detection</strong> locates faces in the frame and automatically sets focus. For
-more control, users can <strong>tap to focus</strong> anywhere in the preview
-image. </p>
-
-<p>For capturing larger scenes, the Camera introduces a <strong>single-motion
-panorama</strong> mode. In this mode, the user starts an exposure and then
-slowly turns the Camera to encompass as wide a perspective as needed. The Camera
-assembles the full range of continuous imagery into a single panoramic
-photo.</p>
-
-<p>After taking a picture or video, users can quickly share it by email, text
-message, bluetooth, social networks, and more, just by tapping the thumbnail in
-the camera controls. </p>
-
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:right;margin-left:1em;padding-top:1em;margin-bottom:1em;padding-bottom:0;width:160px">
-<img src="{@docRoot}sdk/images/4.0/gallery-widget.png" alt="" width="144" style="border:1px solid #ddd;border-radius: 6px;" />
-<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em">A Photo Gallery widget on the home screen.</div>
-</div>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Redesigned Gallery app
-with photo editor</strong></p>
-
-<p>The Gallery app now makes it easier to manage, show, and share photos and
-videos. For managing collections, a <strong>redesigned album layout</strong>
-shows many more albums and offers larger thumbnails. There are many ways to sort
-albums, including by time, location, people, and tags. To help pictures look
-their best, the Gallery now includes a powerful <strong>photo editor</strong>.
-Users can crop and rotate pictures, set levels, remove red eyes, add effects,
-and much more. After retouching, users can select one or multiple pictures or
-videos to share instantly over email, text messaging, bluetooth, social
-networks, or other apps.</p>
-
-<p>An improved <strong>Picture Gallery widget</strong> lets users look at
-pictures directly on their home screen. The widget can display pictures from a
-selected album, shuffle pictures from all albums, or show a single image. After
-adding the widget to the home screen, users can flick through the photo stacks
-to locate the image they want, then tap to load it in Gallery. </p>
-
-<div style="padding-top:0em;clear:right;">
-<div style="margin-right:1em;float:right;margin-left:1em;padding-top:1em;margin-bottom:1em;padding-bottom:0;width:320px">
-<img src="{@docRoot}sdk/images/4.0/live-effects.png" alt="" width="297" style="border:1px solid #ddd;border-radius: 6px;" />
-<div style="padding-left:1em;padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em">Live Effects let you change backgrounds and use Silly Faces during video.</div>
-</div>
-</div>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Live Effects for transforming video</strong></p>
-
-<p>Live Effects is a collection of graphical transformations that add interest
-and fun to videos captured in the Camera app. For example, users can
-<strong>change the background</strong> behind them to any stock or custom image,
-for just the right setting when shooting videeo. Also available for video is
-Silly Faces, a set of morphing effects that use state-of-the-art face
-recognition and GPU filters to transform facial features. For example, you can
-use effects such as small eyes, big mouth, big nose, face squeeze, and more.
-Outside of the Camera app, Live Effects is available during video chat in the
-Google Talk app.</p>
-
-<div style="padding-top:0em;">
-<div style="margsin-right:.8em;float:left;width:186px;padding-top:1em;">
-<a href="{@docRoot}sdk/images/4.0/screenshot-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/screenshot.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"> Snapping a screenshot.</div>
-</div>
-</div>
-</div>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Sharing with screenshots</strong></p>
-
-<p>Users can now share what's on their screens more easily by taking
-screenshots. Hardware buttons let them snap a <strong>screenshot</strong> and
-store it locally. Afterward, they can view, edit, and share the screen shot in
-Gallery or a similar app.</p>
-
-
-<h3 id="cloud" style="color:#172861">Cloud-connected experience</h3>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:right;margin-left:1em;padding-top:1em;margin-bottom:0;padding-bottom:0;width:326px">
-<a href="{@docRoot}sdk/images/4.0/browser-tabs-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/browser-tabs.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<a href="{@docRoot}sdk/images/4.0/browser-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/browser.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<div style="padding-left:1em;padding-bottom:1.25em;margin-top:0;padding-top:0;font-size:.9em"><!--<strong>Figure 3.</strong>-->The Browser tabs menu <em>(left)</em> lets you quickly switch browser tabs. The options menu <em>(right)</em> gives you new ways to manage your browsing experience.</div>
-<img src="{@docRoot}sdk/images/4.0/bbench.png" alt="" width="310" />
-<div style="padding-left:1em;padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em">Benchmark comparisons of Android Browser.</div>
-</div>
-</div>
-
-<p>Android has always been cloud-connected, letting users browse the web and
-sync photos, apps, games, email, and contacts — wherever they are and
-across all of their devices. Android 4.0 adds new browsing and email
-capabilities to let users take even more with them and keep communication
-organized.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Powerful web
-browsing</strong></p>
-
-<p>The Android Browser offers an experience that’s as rich and convenient as a
-desktop browser. It lets users instantly sync and manage <strong>Google Chrome
-bookmarks</strong> from all of their accounts, jump to their favorite content
-faster, and even save it for reading later in case there's no network
-available.</p>
-
-<p>To get the most out of web content, users can now request full
-<strong>desktop versions</strong> of web sites, rather than their mobile
-versions. Users can set their preference for web sites separately for each
-<strong>browser tab</strong>. For longer content, users can save a copy for
-<strong>offline reading</strong>. To find and open saved pages, users can browse
-a visual list that’s included with browser bookmarks and history. For better
-readability and accessibility, users can increase the browser’s <strong>zoom
-levels</strong> and override the system default <strong>text sizes</strong>.</p>
-
-<p>Across all types of content, the Android Browser offers dramatically improved
-<strong>page rendering performance</strong> through updated versions of the
-WebKit core and the V8 Crankshaft compilation engine for JavaScript. In
-benchmarks run on a Nexus S device, the Android 4.0 browser showed an
-improvement of nearly 220% over the Android 2.3 browser in the V8 Benchmark
-Suite and more than 35% in the SunSpider 9.1 JavaScript Benchmark. When run on a
-Galaxy Nexus device, the Android 4.0 browser showed improvement of nearly 550%
-in the V8 benchmark and nearly 70% in the SunSpider benchmark.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Improved
-email</strong></p>
-
-<p>In Android 4.0, email is easier to send, read, and manage. For composing
-email, <strong>improved auto-completion</strong> of recipients helps with
-finding and adding frequent contacts more quickly. For easier input of frequent
-text, users can now create <strong>quick responses</strong> and store them in
-the app, then enter them from a convenient menu when composing. When replying to
-a message, users can now toggle the message to Reply All and Forward without
-changing screens.</p>
-
-<p>For easier browsing across accounts and labels, the app adds an
-<strong>integrated menu</strong> of accounts and recent labels. To help users
-locate and organize IMAP and Exchange email, the Email app now supports
-<strong>nested mail subfolders</strong>, each with synchronization rules. Users
-can also search across folders on the server, for faster results. </p>
-
-<p>For <strong>enterprises</strong>, the Email app supports EAS v14. It supports
-EAS certificate authentication, provides ABQ strings for device type and mode,
-and allows automatic sync to be disabled while roaming. Administrators can also
-limit attachment size or disable attachments.</p>
-
-<p>For keeping track of incoming email more easily, a <strong>resizable Email
-widget</strong> lets users flick through recent email right from the home
-screen, then jump into the Email app to compose or reply.</p>
-
-
-<div style="padding-top:0em;">
-<div style="margsin-right:.8em;float:left;width:186px;padding-top:1em;">
-<a href="{@docRoot}sdk/images/4.0/beam-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/beam.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<div style="padding-left:1em;padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em;padding-right:1.5em;">Android Beam lets users share what they are using with a single tap.</div>
-</div>
-</div>
-
-<h3 id="innovation" style="color:#172861">Innovation</h3>
-
-<p>Android is continously driving innovation forward, pushing the boundaries of
-communication and sharing with new capabilities and interactions.</p>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Android Beam for
-NFC-based sharing</strong></p>
-
-<p>Android Beam is an innovative, convenient feature for sharing across two
-NFC-enabled devices, It lets people instantly exchange favorite apps, contacts,
-music, videos — almost anything. It’s incredibly simple and convenient to
-use — there’s no menu to open, application to launch, or pairing needed.
-Just touch one Android-powered phone to another, then tap to send.</p>
-
-<p>For sharing apps, Android Beam pushes a link to the app's details page in
-Google Play. On the other device, the Google Play client app launches and loads the
-details page, for easy downloading of the app. Individual apps can build on
-Android Beam to add other types of interactions, such as passing game scores,
-initiating a multiplayer game or chat, and more.</p>
-
-<div style="padding-top:0em;">
-<div style="margin-right:1em;float:right;margin-left:1em;margin-top:.5em;margin-bottom:0;padding-bottom:0;width:160px">
-<a href="{@docRoot}sdk/images/4.0/face-unlock-lg.png" target="_android">
-<img src="{@docRoot}sdk/images/4.0/face-unlock.png" alt="" height="240" width="144" style="border:1px solid #ddd;border-radius: 6px;" /></a>
-<div style="padding-left:1em;padding-bottom:1em;margin-top:0;padding-top:0;font-size:.9em">Face recognition lets you unlock your phone with your face.</div>
-</div>
-</div>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Face Unlock</strong></p>
-
-<p>Android 4.0 introduces a completely new approach to securing a device, making
-each person's device even more personal — Face Unlock is a new screen-lock
-option that lets users unlock their devices with their faces. It takes advantage
-of the device front-facing camera and state-of-the-art facial recognition
-technology to register a face during setup and then to recognize it again when
-unlocking the device. Users just hold their devices in front of their faces to
-unlock, or use a backup PIN or pattern. </p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Wi-Fi Direct and Bluetooth HDP</strong></p>
-
-<p>Support for <strong>Wi-Fi Direct</strong> lets users connect directly to
-nearby peer devices over Wi-Fi, for more reliable, higher-speed communication.
-No internet connection or tethering is needed. Through third-party apps, users
-can connect to compatible devices to take advantage of new features such as
-instant sharing of files, photos, or other media; streaming video or audio from
-another device; or connecting to compatible printers or other devices.</p>
-
-<p>Android 4.0 also introduces built-in support for connecting to <strong>Bluetooth Health Device Profile (HDP)</strong> devices. With support from third-party apps, users can connect to wireless medical devices and sensors in hospitals, fitness centers, homes, and elsewhere.</p>
-
-
-<h2 id="DeveloperApis" style="clear:right">New Developer Features</h2>
-
-<!-- <ul>
-<li><a href="#ui-dev">Unified UI framework for phones, tablets, and more</a></li>
-<li><a href="#communication-dev">Communication and sharing</a></li>
-<li><a href="#media-dev">New media capabilities</a></li>
-<li><a href="#connectivity-dev">New types of connectivity</a></li>
-<li><a href="#uicomp-dev">New UI components and capabilities</a></li>
-<li><a href="input-dev">New input types and text services</a></li>
-<li><a href="#accessibility-dev">Enhanced accessibility APIs</a></li>
-<li><a href="#data-dev">Efficient network usage</a></li>
-<li><a href="#security-dev">Security for apps and content</a></li>
-<li><a href="#enterprise-dev">Enhancements for Enterprise</a></li>
-</ul>-->
-
-<h3 id="ui-dev">Unified UI framework for phones, tablets, and more</h3>
-
-<p>Android 4.0 brings a unified UI framework that lets developers create
-elegant, innovative apps for phones, tablets, and more. It includes all of the
-familiar Android 3.x interface elements and APIs — fragments, content
-loaders, Action Bar, rich notifications, resizable home screen widgets, and more
-— as well as new elements and APIs.</p>
-
-<p>For developers, the unified UI framework in Android 4.0 means new UI tools,
-consistent design practices, simplified code and resources, and streamlined
-development across the range of Android-powered devices.</p>
-
-<div class="sidebox-wrapper">
-<div class="sidebox" style="border-left:1px solid #22a5ca;background-color:#fff;">
- <h3>Key Android 3.x developer features, <br>now for phones too</h3>
-
-<p>Core UI</p>
-<ul>
-<li>Fragments and content loaders</li>
-<li>Resizeable home screen widgets</li>
-<li>Rich notifications</li>
-<li>Multi-selection, drag-drop, clipboard</li>
-<li>Improved screen-support API</li>
-<li>Hardware-accelerated 2D graphics</li>
-</ul>
-
-<p>Graphics and animation</p>
-<ul>
-<li>Property-based animation</li>
-<li>Renderscript 3D graphics</li>
-</ul>
-
-<p>Media and connectivity</p>
-<ul>
-<li>HTTP Live streaming</li>
-<li>Bluetooth A2DP and HSP devices</li>
-<li>Support for RTP</li>
-<li>MTP/PTP file transfer</li>
-<li>DRM framework</li>
-<li>Input from keyboard, mouse, gamepad, joystick</li>
-</ul>
-
-<p>Enterprise</p>
-<ul>
-<li>Full device encryption</li>
-<li>DPM policies for encrypted storage and passwords</li>
-</ul>
-</div>
-</div>
-
-<h3 id="communication-dev">Communication and sharing</h3>
-
-<p>Android 4.0 extends social and sharing features to any application on the
-device. Applications can integrate contacts, profile data, stream items,
-and calendar events from any of the user’s activities or social networks.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Social API</strong></p>
-
-<p>A shared social provider and API provide a new unified store for contacts,
-profile data, stream items, and photos. Any app or social network with user
-permission can contribute raw contacts and make them accessible to other apps
-and networks. Applications with user permission can also read profile data from
-the provider and display it in their applications.</p>
-
-<p>The social API lets applications store standard contact data as well as new
-types of content for any given contact, including large profile photos, stream
-items, and recent activity feedback. Recent activity feedback is a standard way for
-applications to “tag” a contact with common activity, such as when the user
-calls the contact or sends an email or SMS message. The social provider uses the
-recent activity feedback as a new signal in ranking, such as for name
-auto-complete, to keep the most relevant contacts ranked closest to the top.</p>
-
-<p>Applications can also let users set up a social connection to a contact from
-the People app. When the user touches Add Connection in a contact, the app
-sends a public intent that other apps can handle, displaying any UI needed
-to create the social connection.</p>
-
-<p>Building on the social API, developers can add powerful new interactions that
-span multiple social networks and contacts sources.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Calendar API</strong></p>
-
-<p>A shared calendar content provider and framework API make it easier for
-developers to add calendar services to their apps.</p>
-
-<p>With user permission, any application can add events to the shared database
-and manage dates, attendees, alerts, and reminders. Applications can also read
-entries from the database, including events contributed by other applications,
-and handle the display of event alerts and reminders. Using the calendar
-provider, applications can take advantage of event data sourced from a variety
-of apps and protocols, to offer innovative ways of viewing and managing a user’s
-events. Apps can also use calendar data to improve the relevance of their
-other content.</p>
-
-<p>For lighter-weight access to calendar services, the Calendar app defines a
-set of public Intents for creating, viewing, and editing events. Rather than
-needing to implement a calendar UI and integrate directly with the calendar
-provider, applications can simply broadcast calendar Intents. When the Calendar
-app receives the Intents, it launches the appropriate UI and stores any event
-data entered. Using calendar Intents, for example, apps can let users add events
-directly from lists, dialogs, or home screen widgets, such as for making
-restaurant reservations or booking time with friends.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Visual voicemail
-API</strong></p>
-
-<p>A shared Voicemail provider and API allow developers to build applications
-that contribute to a unified voicemail store. Voicemails are displayed and
-played in the call log tab of the platform’s Phone app.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Android Beam</strong></p>
-
-<p>Android Beam is an NFC-based feature that lets users instantly share
-information about the apps they are using, just by touching two NFC-enabled
-phones together. When the devices are in range — within a few centimeters
-— the system sets up an NFC connection and displays a sharing UI. To share
-whatever they are viewing with the other device, users just touch the screen.
-</p>
-
-<p>For developers, Android Beam is a new way of triggering almost any type of
-proximity-based interaction. For example, it can let users instantly exchange
-contacts, set up multiplayer gaming, join a chat or video call, share a photo or
-video, and more. The system provides the low-level NFC support and the sharing
-UI, while the foreground app provides lightweight data to transfer to the other
-device. Developers have complete control over the data that is shared and how it
-is handled, so almost any interaction is possible. For larger payloads,
-developers can even use Android Beam to initiate a connection and transfer the
-data over Bluetooth, without the need for user-visible pairing.</p>
-
-<p>Even if developers do not add custom interactions based on Android Beam they
-can still benefit from it being deeply integrated into Android. By default the
-system shares the app’s Google Play URL, so it’s easy for the user to
-download or purchase the app right away.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Modular sharing
-widget</strong></p>
-
-<p>The UI framework includes a new widget, ShareActionProvider, that lets
-developers quickly embed standard share functionality and UI in the Action Bar
-of their applications. Developers simply add ShareActionProvider to the menu and
-set an intent that describes the desired sharing action. The system handles the
-rest, building up the list of applications that can handle the share intent and
-dispatching the intent when the user chooses from the menu.</p>
-
-
-<h3 id="media-dev">New media capabilities</h3>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Low-level streaming
-multimedia</strong></p>
-
-<p>Android 4.0 provides a direct, efficient path for low-level streaming
-multimedia. The new path is ideal for applications that need to maintain
-complete control over media data before passing it to the platform for
-presentation. For example, media applications can now retrieve data from any
-source, apply proprietary encryption/decryption, and then send the data to the
-platform for display.</p>
-
-<p>Applications can now send processed data to the platform as a multiplexed
-stream of audio/video content in MPEG-2 transport stream format. The platform
-de-muxes, decodes, and renders the content. The audio track is rendered to the
-active audio device, while the video track is rendered to either a Surface or a
-SurfaceTexture. When rendering to a SurfaceTexture, the application can apply
-subsequent graphics effects to each frame using OpenGL.</p>
-
-<p>To support this low-level streaming, the platform introduces a new native API
-based on <a href="http://www.khronos.org/openmax/al/" target="_top">Khronos
-OpenMAX AL 1.0.1</a>. The API is implemented on the same underlying services as
-the platform’s existing OpenSL ES API, so developers can make use of both APIs
-together if needed. Tools support for low-level streaming multimedia will be
-available in an upcoming release of the Android NDK.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>New camera
-capabilities</strong></p>
-
-<p>Developers can take advantage of a variety of new camera features in Android
-4.0. ZSL exposure, continuous focus, and image zoom let apps capture better
-still and video images, including during video capture. Apps can even capture
-full-resolution snapshots while shooting video. Apps can now set custom metering
-regions in a camera preview, then manage white balance and exposure dynamically
-for those regions. For easier focusing and image processing, a face-detection
-service identifies and tracks faces in a preview and returns their screen
-coordinates.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Media effects for
-transforming images and video</strong></p>
-
-<p>A set of high-performance transformation filters let developers apply rich
-effects to any image passed as an OpenGL ES 2.0 texture. Developers can adjust
-color levels and brightness, change backgrounds, sharpen, crop, rotate, add lens
-distortion, and apply other effects. The transformations are processed by the
-GPU, so they are fast enough for processing image frames loaded from disk,
-camera, or video stream.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Audio remote
-controls</strong></p>
-
-<p>Android 4.0 adds a new audio remote control API that lets media applications
-integrate with playback controls that are displayed in a remote view. Media
-applications can integrate with a remote music playback control that’s built
-into in the platform’s lock screen, allowing users to control song selection and
-playback without having to unlock and navigate to the music app.</p>
-
-<p>Using the audio remote control API, any music or media app can register to
-receive media button events from the remote control and then manage play state
-accordingly. The application can also supply metadata to the remote control,
-such as album art or image, play state, track number and description, duration,
-genre, and more.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>New media codecs and
-containers</strong></p>
-
-<p>Android 4.0 adds support for additional media types and containers to give
-developers access to the formats they need. For high-quality compressed images,
-the media framework adds support for WebP content. For video, the framework now
-supports streaming VP8 content. For streaming multimedia, the framework supports
-HTTP Live streaming protocol version 3 and encoding of ADTS-contained AAC
-content. Additionally, developers can now use Matroska containers for Vorbis and
-VP8 content.</p>
-
-
-<h3 id="connectivity-dev">New types of connectivity</h3>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Wi-Fi Direct</strong></p>
-
-<p>Developers can use a framework API to discover and connect directly to nearby
-devices over a high-performance, secure Wi-Fi Direct connection. No internet
-connection or hotspot is needed.</p>
-
-<p>Wi-Fi Direct opens new opportunities for developers to add innovative
-features to their applications. Applications can use Wi-Fi Direct to share
-files, photos, or other media between devices or between a desktop computer and
-an Android-powered device. Applications could also use Wi-Fi Direct to stream
-media content from a peer device such as a digital television or audio player,
-connect a group of users for gaming, print files, and more.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Bluetooth Health Device
-Profile (HDP)</strong></p>
-
-<p>Developers can now build powerful medical applications that use Bluetooth to
-communicate with wireless devices and sensors in hospitals, fitness centers,
-homes, and elsewhere. Applications can collect and manage data from HDP source
-devices and transmit it to backend medical applications such as records systems,
-data analysis services, and others.</p>
-
-<p>Using a framework API, applications can use Bluetooth to discover nearby
-devices, establish reliable or streaming data channels, and manage data
-transmission. Applications can supply any IEEE 11073 Manager to retrieve and
-interpret health data from Continua-certified devices such as heart-rate
-monitors, blood meters, thermometers, and scales. </p>
-
-
-<h3 id="uicomp-dev">New UI components and capabilities</h3>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Layout
-enhancements</strong></p>
-
-<p>A new layout, GridLayout, improves the performance of Android applications by
-supporting flatter view hierarchies that are faster to layout and render.
-Because hierarchies are flatter, developers can also manage alignments between
-components that are visually related to each other even when they are not
-logically related, for precise control over application UI. GridLayout is also
-specifically designed to be configured by drag-and-drop design tools such as the
-ADT Plug-in for Eclipse.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>OpenGL ES texture
-views</strong></p>
-
-<p>A new TextureView object lets developers directly integrate OpenGL ES
-textures as rendering targets in a UI hierarchy. The object lets developers
-display and manipulate OpenGL ES rendering just as they would a normal view
-object in the hierarchy, including moving, transforming, and animating the view
-as needed. The TextureView object makes it easy for developers to embed camera
-preview, decoded video, OpenGL game scenes, and more. TextureView can be viewed
-as a more powerful version of the existing SurfaceView object, since it offers
-the same benefits of access to a GL rendering surface, with the added advantage
-of having that surface participate fully in the normal view hierarchy.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Hardware-accelerated 2D
-drawing</strong></p>
-
-<p>All Android-powered devices running Android 4.0 are required to support
-hardware-accelerated 2D drawing. Developers can take advantage of this to add
-great UI effects while maintaining optimal performance on high-resolution
-screens, even on phones. For example, developers can rely on accelerated
-scaling, rotation, and other 2D operations, as well as accelerated UI components
-such as TextureView and compositing modes such as filtering, blending, and
-opacity.</p>
-
-
-<h3 id="input-dev">New input types and text services</h3>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Stylus input, button
-support, hover events</strong></p>
-
-<p>Android 4.0 includes full support for stylus input events, including tilt and
-distance axes, pressure, and related motion event properties. To help
-applications distinguish motion events from different sources, the platform adds
-distinct tool types for stylus, finger, mouse, and eraser. For improved input
-from multi-button pointing devices, the platform now provides distinct primary,
-secondary, and tertiary buttons, as well as back and forward buttons.
-Hover-enter and hover-exit events are also added, for improved navigation and
-accessibility. Developers can build on these new input features to add powerful
-interactions to their apps, such as precise drawing and gesturing, handwriting
-and shape recognition, improved mouse input, and others.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Text services API for
-integrating spelling checkers</strong></p>
-
-<p>Android 4.0 lets applications query available text services such as
-dictionaries and spell checkers for word suggestions, corrections, and similar
-data. The text services are external to the active IME, so developers can create
-and distribute dictionaries and suggestion engines that plug into the platform.
-When an application receives results from a text service — for example,
-word suggestions — it can display them in a dedicated suggestion popup
-window directly inside the text view, rather than relying on the IME to display
-them. </p>
-
-
-<h3 id="accessibility-dev">Enhanced accessibility APIs</h3>
-
-<p>Android 4.0 adds new accessibility features and an enhanced API to let
-developers improve the user experience in their apps, especially on devices that
-don’t have hardware buttons. For accessibility services such as screen readers
-in particular, the platform offers new APIs to query window content, for easier
-navigation, better feedback, and richer user interfaces.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Accessibility
-API</strong></p>
-
-<p>To let applications manage interactions more effectively when accessibility
-features are enabled, the platform adds accessibility events for
-explore-by-touch mode, scrolling, and text selection. For these and other
-events, the platform can attach a new object called an accessibility record that
-provides extra information about the event context.</p>
-
-<p>Using the accessibility record and related APIs, applications can now access
-the view hierarchy associated with an event. Applications can query for key
-properties such as parent and child nodes, available states, supported actions,
-screen position, and more. Applications can also request changes to certain
-properties to help manage focus and selected state. For example, an
-accessibility service could use these new capabilities to add convenient
-features such as screen-search by text. </p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Text-to-speech
-API</strong></p>
-
-<p>A new framework API lets developers write text-to-speech engines and make
-them available to any app requesting TTS capabilities.</p>
-
-
-<h3 id="data-dev">Efficient network usage</h3>
-
-<p>In Android 4.0, users can see how much network data their running apps are
-using. They can also set limits on data usage by network type and disable
-background data usage for specific applications. In this context, developers
-need to design their apps to run efficiently and follow best practices for
-checking the network connection. Android 4.0 provides network APIs to let
-applications meet those goals.</p>
-
-<p>As users move between networks or set limits on network data, the platform
-lets applications query for connection type and availability. Developers can use
-this information to dynamically manage network requests to ensure the best
-experience for users. Developers can also build custom network and data-usage
-options into their apps, then expose them to users directly from Settings by
-means of a new system Intent.</p>
-
-
-<h3 id="security-dev">Security for apps and content</h3>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Secure management of
-credentials</strong></p>
-
-<p>Android 4.0 makes it easier for applications to manage authentication and
-secure sessions. A new keychain API and underlying encrypted storage let
-applications store and retrieve private keys and their corresponding certificate
-chains. Any application can use the keychain API to install and store user
-certificates and CAs securely.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Address Space Layout
-Randomization</strong></p>
-
-<p>Android 4.0 now provides address space layout randomization (ASLR) to help
-protect system and third party applications from exploitation due to
-memory-management issues.</p>
-
-
-<h3 id="enterprise-dev">Enhancements for Enterprise</h3>
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>VPN client
-API</strong></p>
-
-<p>Developers can now build or extend their own VPN solutions on the platform
-using a new VPN API and underlying secure credential storage. With user
-permission, applications can configure addresses and routing rules, process
-outgoing and incoming packets, and establish secure tunnels to a remote server.
-Enterprises can also take advantage of a standard VPN client built into the
-platform that provides access to L2TP and IPSec protocols.</p>
-
-
-<p style="margin-top:1em;margin-bottom:.75em;"><strong>Device policy management
-for camera</strong></p>
-
-<p>The platform adds a new policy control for administrators who manage devices
-using an installed Device Policy Manager. Administrators can now remotely
-disable the camera on a managed device for users working in sensitive
-environments.</p>
-
-
-
-
-
diff --git a/docs/html/sdk/android-4.0.3.jd b/docs/html/sdk/android-4.0.3.jd
deleted file mode 100644
index f6dbee0..0000000
--- a/docs/html/sdk/android-4.0.3.jd
+++ /dev/null
@@ -1,555 +0,0 @@
-page.title=Android 4.0.3 Platform
-sdk.platform.version=4.0.3
-sdk.platform.apiLevel=15
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#api">API Overview</a></li>
- <li><a href="#Honeycomb">Previous APIs</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/15/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-</div>
-</div>
-
-<p><em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>Android {@sdkPlatformVersion} is an incremental release of the Android 4.x
-(Ice Cream Sandwich) platform family. This release includes new features for
-users and developers, API changes, and various bug fixes.</p>
-
-<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK. The development platform includes a
-fully compliant Android library and system image as well as a set of emulator
-skins, sample applications, and more. The downloadable platform includes no
-external libraries.</p>
-
-<p>To start developing or testing against Android {@sdkPlatformVersion},
-use the Android SDK Manager to download the platform into your SDK. For more
-information, see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>. If you are new to Android, <a
-href="{@docRoot}sdk/index.html">download the SDK Starter Package</a> first.</p>
-
-<p>For a high-level overview of the new user and developer features, see the
-<a href="http://developer.android.com/sdk/android-4.0-highlights.html">Platform
-Highlights</a>.</p>
-
-
-<h2 id="relnotes">Development Platform Revisions</h2>
-
-<p>The sections below provide notes about successive revisions of the Android
-{@sdkPlatformVersion} development platform for the Android SDK, as denoted by
-revision number. To determine what revisions you have installed in your SDK
-environment, refer to the "Installed Packages" listing in the Android SDK
-Manager.</p>
-
-<p class="caution"><strong>Important:</strong> To download the new Android
-4.0.x system components from the Android SDK Manager, you must first update the
-SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
-the Android 4.0.x system components will not be available for download.</p>
-
-<div class="toggle-content opened" style="padding-left:1em;">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png"
-class="toggle-content-img" alt="" />
- Revision 3</a> <em>(March 2012)</em>
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em;">
-
- <p>Maintenance update. The system version is 4.0.4.</p>
- <p class="note"><strong>Note:</strong> This system image includes support for emulator
-hardware graphics acceleration when used with SDK Tools r17 or higher.
-(<a href="{@docRoot}guide/developing/devices/emulator.html#accel-graphics">more info</a>)</p>
- <dl>
- <dt>Dependencies:</dt>
- <dd>SDK Tools r17 or higher is required.</dd>
- </dl>
-
- </div>
-</div>
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- Revision 2</a> <em>(January 2012)</em>
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em;">
-
- <p>Maintenance update. The system version is 4.0.3.</p>
- <dl>
- <dt>Dependencies:</dt>
- <dd>SDK Tools r14 or higher is required.</dd>
- </dl>
-
- </div>
-</div>
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- Revision 1</a> <em>(December 2011)</em>
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em;">
-
- <p>Initial release. The system version is 4.0.3.</p>
- <dl>
- <dt>Dependencies:</dt>
- <dd>SDK Tools r14 or higher is required.</dd>
- </dl>
-
- </div>
-</div>
-
-<h2 id="api">API Overview</h2>
-
-<p>The sections below provide a technical overview of new APIs in Android 4.0.3.</p>
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- <strong>Table of Contents</strong>
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em;">
- <ol class="toc" style="margin-left:-1em">
- <li><a href="#contacts">Social stream API in Contacts Provider</a></li>
- <li><a href="#calendar">Calendar Provider</a></li>
- <li><a href="#widgets">Home screen widgets</a></li>
- <li><a href="#textservices">Spell-checking</a></li>
- <li><a href="#bluetooth">Bluetooth</a></li>
- <li><a href="#ui">UI toolkit</a></li>
- <li><a href="#accessibility">Accessibility</a></li>
- <li><a href="#tts">Text-to-speech</a></li>
- <li><a href="#database">Database</a></li>
- <li><a href="#intents">Intents</a></li>
- <li><a href="#camera">Camera</a></li>
- <li><a href="#permissions">Permissions</a></li>
- </ol>
- </div>
-</div>
-
-
-
-
-
-<h3 id="contacts">Social stream API in Contacts Provider</h3>
-
-<p>Applications that use social stream data such as status updates and check-ins
-can now sync that data with each of the user’s contacts, providing items in a
-stream along with photos for each.</p>
-
-<p>The database table that contains an individual contact’s social stream is
-defined by {@link android.provider.ContactsContract.StreamItems}, the Uri for
-which is nested within the {@link android.provider.ContactsContract.RawContacts}
-directory to which the stream items belong. Each social stream table includes
-several columns for metadata about each stream item, such as an icon
-representing the source (an avatar), a label for the item, the primary text
-content, comments about the item (such as responses from other people), and
-more. Photos associated with a stream are stored in another table, defined by
-{@link android.provider.ContactsContract.StreamItemPhotos}, which is available
-as a sub-directory of the {@link android.provider.ContactsContract.StreamItems}
-Uri.</p>
-
-<p>See {@link android.provider.ContactsContract.StreamItems} and
-{@link android.provider.ContactsContract.StreamItemPhotos} for more information.</p>
-
-<p>To read or write social stream items for a contact, an application must
-request permission from the user by declaring <code><uses-permission
-android:name="android.permission.READ_SOCIAL_STREAM"></code> and/or <code><uses-permission
-android:name="android.permission.WRITE_SOCIAL_STREAM"></code> in their manifest files.</p>
-
-<h3 id="calendar">Calendar Provider</h4>
-<ul>
-<li>Adds the class {@link android.provider.CalendarContract.Colors} to represent
-a color table in the <a href="{@docRoot}guide/topics/providers/calendar-provider.html">Calendar
-Provider</a>. The class provides fields for accessing
-colors available for a given account. Colors are referenced by
-{@link android.provider.CalendarContract.ColorsColumns#COLOR_KEY COLOR_KEY}
-which must be unique for a given account name/type. These values can only be
-updated by the sync adapter.</li>
-<li>Adds {@link android.provider.CalendarContract.CalendarColumns#ALLOWED_AVAILABILITY ALLOWED_AVAILABILITY}
-and
-{@link android.provider.CalendarContract.CalendarColumns#ALLOWED_ATTENDEE_TYPES ALLOWED_ATTENDEE_TYPES}
-for exchange/sync support.</li>
-<li>Adds {@link android.provider.CalendarContract.AttendeesColumns#TYPE_RESOURCE}
-(such as conference rooms) for attendees and
-{@link android.provider.CalendarContract.EventsColumns#AVAILABILITY_TENTATIVE},
-as well as {@link android.provider.CalendarContract.EventsColumns#EVENT_COLOR_KEY}
-for events.</li>
-</ul>
-
-<h3 id="widgets">Home screen widgets</h3>
-
-<p>Starting from Android 4.0, home screen widgets should no longer include their
-own padding. Instead, the system now automatically adds padding for each widget,
-based the characteristics of the current screen. This leads to a more uniform,
-consistent presentation of widgets in a grid. To assist applications that host
-home screen widgets, the platform provides a new method
-{@link android.appwidget.AppWidgetHostView#getDefaultPaddingForWidget(android.content.Context, android.content.ComponentName, android.graphics.Rect)
-getDefaultPaddingForWidget()}. Applications can call this method to get the
-system-defined padding and account for it when computing the number of cells to
-allocate to the widget.</p>
-
-<h3 id="textservices">Spell-checking</h3>
-
-<ul>
-<li>For apps that accessing spell-checker services, a new {@link
-android.view.textservice.SpellCheckerSession#cancel() cancel()} method cancels
-any pending and running spell-checker tasks in a session.</li>
-
-<li>For spell-checker services, a new suggestions flag,
-{@link android.view.textservice.SuggestionsInfo#RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS},
-lets the services distinguish higher-confidence suggestions from
-lower-confidence ones. For example, a spell-checker could set the flag if an
-input word is not in the user dictionary but has likely suggestions, or not set
-the flag if an input word is not in the dictionary and has suggestions that are
-likely to be less useful.
-
-<p>Apps connected to the spell-checker can use the {@link
-android.view.textservice.SuggestionsInfo#RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS}
-flag in combination with other suggestion attributes, as well as the {@link
-android.view.textservice.SuggestionsInfo#getSuggestionsAttributes()} and {@link
-android.view.textservice.SuggestionsInfo#getSuggestionsCount()} methods, to
-determine whether to mark input words as typos and offer suggestions.</p></li>
-
-<li>A new {@link android.text.style.SuggestionSpan#FLAG_AUTO_CORRECTION} style
-for text spans indicates that auto correction is about to be applied to a
-word/text that the user is typing/composing. This type of suggestion is rendered
-differently, to indicate the auto correction is happening.</li>
-</ul>
-
-<h3 id="bluetooth">Bluetooth</h3>
-<p>New public methods {@link
-android.bluetooth.BluetoothDevice#fetchUuidsWithSdp()} and {@link
-android.bluetooth.BluetoothDevice#getUuids()} let apps determine the features
-(UUIDs) supported by a remote device. In the case of {@link
-android.bluetooth.BluetoothDevice#fetchUuidsWithSdp()}, the system performs a
-service discovery on the remote device to get the UUIDs supported, then
-broadcasts the result in an {@link
-android.bluetooth.BluetoothDevice#ACTION_UUID} intent.</p>
-
-<h3 id="ui">UI toolkit</h3>
-
-<p>New methods {@link android.app.Fragment#setUserVisibleHint(boolean) setUserVisibleHint()} and
-{@link android.app.Fragment#getUserVisibleHint() getUserVisibleHint()} allow a
-fragment to set a hint of whether or not it is currently user-visible. The
-system defers the start of fragments that are not user-visible until the loaders
-for visible fragments have run. The visibility hint is "true" by default.</li>
-</p>
-
-<h3 id="graphics">Graphics</h3>
-
-<ul>
-<li>New method {@link android.graphics.SurfaceTexture#setDefaultBufferSize(int
-width, int height)} in {@link android.graphics.SurfaceTexture} sets the default size of the image
-buffers. This method may be used to set the image size when producing images
-with {@link android.graphics.Canvas} (via {@link
-android.view.Surface#lockCanvas}), or OpenGL ES (via an EGLSurface).</li>
-<li>Adds definitions for the enums of the GL_OES_EGL_image_external OpenGL ES extension —
-{@link android.opengl.GLES11Ext#GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES},
-{@link android.opengl.GLES11Ext#GL_SAMPLER_EXTERNAL_OES},
-{@link android.opengl.GLES11Ext#GL_TEXTURE_BINDING_EXTERNAL_OES}, and
-{@link android.opengl.GLES11Ext#GL_TEXTURE_EXTERNAL_OES}.</li>
-</ul>
-
-<h3 id="accessibility">Accessibility</h3>
-
-<ul>
-<li>Clients of {@link android.widget.RemoteViews} can now use the method {@link
-android.widget.RemoteViews#setContentDescription(int, java.lang.CharSequence)
-setContentDescription()} to set and get the content description of any View in
-the inflated layout.</li>
-
-<li>The methods {@link android.view.accessibility.AccessibilityRecord#getMaxScrollX()},
-{@link android.view.accessibility.AccessibilityRecord#getMaxScrollY()},
-{@link android.view.accessibility.AccessibilityRecord#setMaxScrollX(int) setMaxScrollX()}, and
-{@link android.view.accessibility.AccessibilityRecord#setMaxScrollY(int) setMaxScrollY()}
-allow apps to get and set the maximum scroll offset for an
-{@link android.view.accessibility.AccessibilityRecord} object.</li>
-
-<li>When touch-exploration mode is enabled, a new secure setting
-{@link android.provider.Settings.Secure#ACCESSIBILITY_SPEAK_PASSWORD}
-indicates whether the user requests the IME to speak text entered in password fields, even when
-a headset is not in use. By default, no password text is spoken unless a headset
-is in use.</li>
-</ul>
-
-<h3 id="tts">Text-to-speech</h3>
-
-<ul>
-<li>Adds the new method {@link
-android.speech.tts.TextToSpeech.Engine#getFeatures(java.util.Locale)
-getFeatures()}for querying and enabling network TTS support.
-<li>Adds a new listener class, {@link
-android.speech.tts.UtteranceProgressListener}, that engines can register to
-receive notification of speech-synthesis errors.</li>
-</ul>
-
-<h3 id="database">Database</h3>
-
-<ul>
-<li>A new {@link android.database.CrossProcessCursorWrapper} class lets content
-providers return results for a cross-process query more efficiently. The new
-class is a useful building block for wrapping cursors that will be sent to
-processes remotely. It can also transform normal {@link android.database.Cursor}
-objects into {@link android.database.CrossProcessCursor} objects
-transparently.
-
-<p>The {@link android.database.CrossProcessCursorWrapper} class fixes common
-performance issues and bugs that applications have encountered when
-implementing content providers.</p></li>
-
-<li>The {@link android.database.CursorWindow#CursorWindow(java.lang.String)}
-constructor now takes a name string as input. The system no longer distinguishes
-between local and remote cursor windows, so {@link
-android.database.CursorWindow#CursorWindow(boolean)} is now deprecated.</li>
-</ul>
-
-<h3 id="intents">Intents</h3>
-
-<p>Adds new categories for targeting common types of applications on the
-device, such as {@link android.content.Intent#CATEGORY_APP_BROWSER}, {@link
-android.content.Intent#CATEGORY_APP_CALENDAR}, {@link
-android.content.Intent#CATEGORY_APP_MAPS}, and more.</li>
-
-<h3 id="camera">Camera</h3>
-
-<ul>
-<li>{@link android.media.MediaMetadataRetriever} adds the new constant
-{@link android.media.MediaMetadataRetriever#METADATA_KEY_LOCATION} to let apps
-access retrieve location information for an image or video. </li>
-
-<li>{@link android.media.CamcorderProfile} adds the QVGA (320x240) resolution
-profiles. Quality level is represented by the
-{@link android.media.CamcorderProfile#QUALITY_QVGA}.and
-{@link android.media.CamcorderProfile#QUALITY_TIME_LAPSE_QVGA} constants.</li>
-
-<li>New methods {@link android.hardware.Camera.Parameters#setVideoStabilization(boolean) setVideoStabilization()},
-{@link android.hardware.Camera.Parameters#getVideoStabilization() setVideoStabilization()}, and {@link android.hardware.Camera.Parameters#isVideoStabilizationSupported() isVideoStabilizationSupported()}
-let you check and manage video stabilization for a {@link android.hardware.Camera}.</li>
-</ul>
-
-<h3 id="Permissions">Permissions</h3>
-
-<p>The following are new permissions:</p>
-<ul>
-<li>{@link android.Manifest.permission#READ_SOCIAL_STREAM} and
-{@link android.Manifest.permission#WRITE_SOCIAL_STREAM}: Allow a sync
-adapter to read and write social stream data to a contact in the shared
-Contacts Provider.</li>
-</ul>
-
-
-<div class="special" style="margin-top:2em">
-<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API Level
-{@sdkPlatformApiLevel}), see the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API Differences Report</a>.</p>
-</div>
-
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android {@sdkPlatformVersion} API is assigned an integer
-identifier—<strong>{@sdkPlatformApiLevel}</strong>—that is stored in the system itself.
-This identifier, called the "API level", allows the system to correctly determine whether an
-application is compatible with the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need compile the
-application against an Android platform that supports API level {@sdkPlatformApiLevel} or
-higher. Depending on your needs, you might also need to add an
-<code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code> attribute to the
-<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a>
-element.</p>
-
-<p>For more information, see the <a href="{@docRoot}guide/appendix/api-levels.html">API Levels</a>
-document. </p>
-
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>API Demos</li>
-<li>Browser</li>
-<li>Calculator</li>
-<li>Calendar</li>
-<li>Camera</li>
-<li>Clock</li>
-<li>Custom Locale</li>
-<li>Dev Tools</li>
-<li>Downloads</li>
-<li>Email</li>
-<li>Gallery</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<ul>
-<li>Gestures Builder</li>
-<li>Messaging</li>
-<li>Music</li>
-<li>People</li>
-<li>Phone</li>
-<li>Search</li>
-<li>Settings</li>
-<li>Speech Recorder</li>
-<li>Widget Preview</li>
-</ul>
-</td>
-</tr>
-</table>
-
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable SDK platform provides a variety of built-in
-locales. In some cases, region-specific strings are available for the locales. In other cases, a
-default version of the language is used. The languages that are available in the Android 3.0 system
-image are listed below (with <em>language</em>_<em>country/region</em> locale descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Arabic, Egypt (ar_EG)</li>
-<li>Arabic, Israel (ar_IL)</li>
-<li>Bulgarian, Bulgaria (bg_BG)</li>
-<li>Catalan, Spain (ca_ES)</li>
-<li>Czech, Czech Republic (cs_CZ)</li>
-<li>Danish, Denmark(da_DK)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Greek, Greece (el_GR)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Ireland (en_IE)</li>
-<li>English, India (en_IN)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>English, US (en_US)</li>
-<li>English, South Africa (en_ZA)</li>
-<li>Spanish (es_ES)</li>
-<li>Spanish, US (es_US)</li>
-<li>Finnish, Finland (fi_FI)</li>
-<li>French, Belgium (fr_BE)</li>
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>French, France (fr_FR)</li>
-<li>Hebrew, Israel (he_IL)</li>
-<li>Hindi, India (hi_IN)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>Croatian, Croatia (hr_HR)</li>
-<li>Hungarian, Hungary (hu_HU)</li>
-<li>Indonesian, Indonesia (id_ID)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Lithuanian, Lithuania (lt_LT)</li>
-<li>Latvian, Latvia (lv_LV)</li>
-<li>Norwegian bokmål, Norway (nb_NO)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Polish (pl_PL)</li>
-<li>Portuguese, Brazil (pt_BR)</li>
-<li>Portuguese, Portugal (pt_PT)</li>
-<li>Romanian, Romania (ro_RO)</li>
-<li>Russian (ru_RU)</li></li>
-<li>Slovak, Slovakia (sk_SK)</li>
-<li>Slovenian, Slovenia (sl_SI)</li>
-<li>Serbian (sr_RS)</li>
-<li>Swedish, Sweden (sv_SE)</li>
-<li>Thai, Thailand (th_TH)</li>
-<li>Tagalog, Philippines (tl_PH)</li>
-<li>Turkish, Turkey (tr_TR)</li>
-<li>Ukrainian, Ukraine (uk_UA)</li>
-<li>Vietnamese, Vietnam (vi_VN)</li>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-</td>
-</tr>
-</table>
-
-<p class="note"><strong>Note:</strong> The Android platform may support more
-locales than are included in the SDK system image. All of the supported locales
-are available in the <a href="http://source.android.com/">Android Open Source
-Project</a>.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes the following emulator skins:</p>
-
-<ul>
- <li>
- QVGA (240x320, low density, small screen)
- </li>
- <li>
- WQVGA400 (240x400, low density, normal screen)
- </li>
- <li>
- WQVGA432 (240x432, low density, normal screen)
- </li>
- <li>
- HVGA (320x480, medium density, normal screen)
- </li>
- <li>
- WVGA800 (480x800, high density, normal screen)
- </li>
- <li>
- WVGA854 (480x854 high density, normal screen)
- </li>
- <li>
- WXGA720 (1280x720, extra-high density, normal screen)
- </li>
- <li>
- WSVGA (1024x600, medium density, large screen)
- </li>
- <li>
- WXGA (1280x800, medium density, xlarge screen)
- </li>
-</ul>
-
-<p>To test your application on an emulator that represents the latest Android device, you can create
-an AVD with the new WXGA720 skin (it's an xhdpi, normal screen device). Note that the emulator
-currently doesn't support the new on-screen navigation bar for devices without hardware navigation
-buttons, so when using this skin, you must use keyboard keys <em>Home</em> for the Home button,
-<em>ESC</em> for the Back button, and <em>F2</em> or <em>Page-up</em> for the Menu button.</p>
-
-<p>However, due to performance issues in the emulator when running high-resolution screens such as
-the one for the WXGA720 skin, we recommend that you primarily use the traditional WVGA800 skin
-(hdpi, normal screen) to test your application.</p>
-
diff --git a/docs/html/sdk/android-4.0.jd b/docs/html/sdk/android-4.0.jd
deleted file mode 100644
index e3b13c8..0000000
--- a/docs/html/sdk/android-4.0.jd
+++ /dev/null
@@ -1,2059 +0,0 @@
-page.title=Android 4.0 Platform
-sdk.platform.version=4.0
-sdk.platform.apiLevel=14
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#relnotes">Revisions</a></li>
- <li><a href="#api">API Overview</a></li>
- <li><a href="#Honeycomb">Previous APIs</a></li>
- <li><a href="#api-level">API Level</a></li>
- <li><a href="#apps">Built-in Applications</a></li>
- <li><a href="#locs">Locales</a></li>
- <li><a href="#skins">Emulator Skins</a></li>
-</ol>
-
-<h2>Reference</h2>
-<ol>
-<li><a
-href="{@docRoot}sdk/api_diff/14/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
-</div>
-</div>
-
-
-<p><em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p>
-
-<p>Android 4.0 is a major platform release that adds a variety of new features for users and app
-developers. Besides all the new features and APIs discussed below, Android 4.0 is an important
-platform release because it brings the extensive set of APIs and Holographic themes from Android 3.x
-to smaller screens. As an app developer, you now have a single platform and unified API framework
-that enables you to develop and publish your application with a single APK that provides an
-optimized user experience for handsets, tablets, and more, when running the same version of
-Android—Android 4.0 (API level 14) or greater. </p>
-
-<p>The Android {@sdkPlatformVersion} platform is available as a
-downloadable component for the Android SDK so you can begin developing and testing your
-applications on Android 4.0 with the Android emulator. The downloadable platform includes
-an Android library and system image, as well as a set of emulator skins and
-more. The downloadable platform does not include any external libraries.</p>
-
-<p>To start developing or testing against Android {@sdkPlatformVersion},
-use the Android SDK Manager to download the platform into your SDK. For more
-information, see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
-Components</a>. If you are new to Android, <a
-href="{@docRoot}sdk/index.html">download the SDK Starter Package</a> first.</p>
-
-<p class="note"><strong>Reminder:</strong> If you've already published an
-Android application, please test your application on Android {@sdkPlatformVersion} as
-soon as possible to be sure your application provides the best
-experience possible on the latest Android-powered devices.</p>
-
-<p>For a high-level overview of the new user and developer features in Android 4.0, see the
-<a href="http://developer.android.com/sdk/android-4.0-highlights.html">Platform Highlights</a>.</p>
-
-
-
-<h2 id="relnotes">Revisions</h2>
-
-<p>To determine what revision of the Android {@sdkPlatformVersion} platform you
-have installed, refer to the "Installed Packages" listing in the Android SDK Manager.</p>
-
-<p class="caution"><strong>Important:</strong> To download the new Android
-4.0 system components from the Android SDK Manager, you must first update the
-SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
-the Android 4.0 system components will not be available for download.</p>
-
-<div class="toggle-content opened" style="padding-left:1em;">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 2</a> <em>(December 2011)</em>
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em;">
- <p>Maintenance update. The system version is 4.0.2.</p>
- <dl>
- <dt>Dependencies:</dt>
- <dd>SDK Tools r14 or higher is required.</dd>
- </dl>
- </div>
-</div>
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- Android {@sdkPlatformVersion}, Revision 1</a> <em>(October 2011)</em>
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em;">
- <p>Initial release. The system version is 4.0.1.</p>
- <dl>
- <dt>Dependencies:</dt>
- <dd>SDK Tools r14 or higher is required.</dd>
- </dl>
- </div>
-</div>
-
-
-<h2 id="api">API Overview</h2>
-
-<p>The sections below provide a technical overview of new APIs in Android 4.0.</p>
-
-<div class="toggle-content closed" style="padding-left:1em;">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png"
-class="toggle-content-img" alt="" />
- <strong>Table of Contents</strong>
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em;">
- <ol class="toc" style="margin-left:-1em">
- <li><a href="#Contacts">Social APIs in Contacts Provider</a></li>
- <li><a href="#Calendar">Calendar Provider</a></li>
- <li><a href="#Voicemail">Voicemail Provider</a></li>
- <li><a href="#Multimedia">Multimedia</a></li>
- <li><a href="#Camera">Camera</a></li>
- <li><a href="#AndroidBeam">Android Beam (NDEF Push with NFC)</a></li>
- <li><a href="#WiFiDirect">Wi-Fi Direct</a></li>
- <li><a href="#Bluetooth">Bluetooth Health Devices</a></li>
- <li><a href="#A11y">Accessibility</a></li>
- <li><a href="#SpellChecker">Spell Checker Services</a></li>
- <li><a href="#TTS">Text-to-speech Engines</a></li>
- <li><a href="#NetworkUsage">Network Usage</a></li>
- <li><a href="#RenderScript">RenderScript</a></li>
- <li><a href="#Enterprise">Enterprise</a></li>
- <li><a href="#Sensors">Device Sensors</a></li>
- <li><a href="#ActionBar">Action Bar</a></li>
- <li><a href="#UI">User Interface and Views</a></li>
- <li><a href="#Input">Input Framework</a></li>
- <li><a href="#Properties">Properties</a></li>
- <li><a href="#HwAccel">Hardware Acceleration</a></li>
- <li><a href="#Jni">JNI Changes</a></li>
- <li><a href="#WebKit">WebKit</a></li>
- <li><a href="#Permissions">Permissions</a></li>
- <li><a href="#DeviceFeatures">Device Features</a></li>
- </ol>
- </div>
-</div>
-
-
-
-
-
-<h3 id="Contacts">Social APIs in Contacts Provider</h3>
-
-<p>The contact APIs defined by the {@link android.provider.ContactsContract} provider have been
-extended to support new social-oriented features such as a personal profile for the device owner and
-the ability for users to invite individual contacts to social networks that are installed on the
-device.</p>
-
-
-<h4>User Profile</h4>
-
-<p>Android now includes a personal profile that represents the device owner, as defined by the
-{@link android.provider.ContactsContract.Profile} table. Social apps that maintain a user identity
-can contribute to the user's profile data by creating a new {@link
-android.provider.ContactsContract.RawContacts} entry within the {@link
-android.provider.ContactsContract.Profile}. That is, raw contacts that represent the device user do
-not belong in the traditional raw contacts table defined by the {@link
-android.provider.ContactsContract.RawContacts} Uri; instead, you must add a profile raw contact in
-the table at {@link android.provider.ContactsContract.Profile#CONTENT_RAW_CONTACTS_URI}. Raw
-contacts in this table are then aggregated into the single user-visible profile labeled "Me".</p>
-
-<p>Adding a new raw contact for the profile requires the {@link
-android.Manifest.permission#WRITE_PROFILE} permission. Likewise, in order to read from the profile
-table, you must request the {@link android.Manifest.permission#READ_PROFILE} permission. However,
-most apps should not need to read the user profile, even when contributing data to the
-profile. Reading the user profile is a sensitive permission and you should expect users to be
-skeptical of apps that request it.</p>
-
-
-<h4>Invite Intent</h4>
-
-<p>The {@link android.provider.ContactsContract.Intents#INVITE_CONTACT} intent action allows an app
-to invoke an action that indicates the user wants to add a contact to a social network. The app
-receiving the app uses it to invite the specified contact to that
-social network. Most apps will be on the receiving-end of this operation. For example, the
-built-in People app invokes the invite intent when the user selects "Add connection" for a specific
-social app that's listed in a person's contact details.</p>
-
-<p>To make your app visible as in the "Add connection" list, your app must provide a sync adapter to
-sync contact information from your social network. You must then indicate to the system that your
-app responds to the {@link android.provider.ContactsContract.Intents#INVITE_CONTACT} intent by
-adding the {@code inviteContactActivity} attribute to your app’s sync configuration file, with a
-fully-qualified name of the activity that the system should start when sending the invite intent.
-The activity that starts can then retrieve the URI for the contact in question from the intent’s
-data and perform the necessary work to invite that contact to the network or add the person to the
-user’s connections.</p>
-
-<p>See the <a href="{@docRoot}resources/samples/SampleSyncAdapter/index.html">Sample Sync
-Adapter</a> app for an example (specifically, see the <a
-href="{@docRoot}resources/samples/SampleSyncAdapter/res/xml-v14/contacts.html">contacts.xml</a>
-file).</p>
-
-
-<h4>Large photos</h4>
-
-<p>Android now supports high resolution photos for contacts. Now, when you push a photo into a
-contact record, the system processes it into both a 96x96 thumbnail (as it has previously) and a
-256x256 "display photo" that's stored in a new file-based photo store (the exact dimensions that the
-system chooses may vary in the future). You can add a large photo to a contact by putting a large
-photo in the usual {@link android.provider.ContactsContract.CommonDataKinds.Photo#PHOTO} column of a
-data row, which the system will then process into the appropriate thumbnail and display photo
-records.</p>
-
-
-<h4>Contact Usage Feedback</h4>
-
-<p>The new {@link android.provider.ContactsContract.DataUsageFeedback} APIs allow you to help track
-how often the user uses particular methods of contacting people, such as how often the user uses
-each phone number or e-mail address. This information helps improve the ranking for each contact
-method associated with each person and provide better suggestions for contacting each person.</p>
-
-
-
-
-
-<h3 id="Calendar">Calendar Provider</h3>
-
-<p>The new calendar APIs allow you to read, add, modify and delete calendars, events, attendees,
-reminders and alerts, which are stored in the Calendar Provider.</p>
-
-<p>A variety of apps and widgets can use these APIs to read and modify calendar events. However,
-some of the most compelling use cases are sync adapters that synchronize the user's calendar from
-other calendar services with the Calendar Provider, in order to offer a unified location for all the
-user's events. Google Calendar events, for example, are synchronized with the Calendar Provider by
-the Google Calendar Sync Adapter, allowing these events to be viewed with Android's built-in
-Calendar app.</p>
-
-<p>The data model for calendars and event-related information in the Calendar Provider is
-defined by {@link android.provider.CalendarContract}. All the user’s calendar data is stored in a
-number of tables defined by various subclasses of {@link android.provider.CalendarContract}:</p>
-
-<ul>
-<li>The {@link android.provider.CalendarContract.Calendars} table holds the calendar-specific
-information. Each row in this table contains the details for a single calendar, such as the name,
-color, sync information, and so on.</li>
-
-<li>The {@link android.provider.CalendarContract.Events} table holds event-specific information.
-Each row in this table contains the information for a single event, such as the
-event title, location, start time, end time, and so on. The event can occur one time or recur
-multiple times. Attendees, reminders, and extended properties are stored in separate tables and
-use the event’s {@code _ID} to link them with the event.</li>
-
-<li>The {@link android.provider.CalendarContract.Instances} table holds the start and end time for
-occurrences of an event. Each row in this table represents a single occurrence. For one-time events
-there is a one-to-one mapping of instances to events. For recurring events, multiple rows are
-automatically generated to correspond to the multiple occurrences of that event.</li>
-
-<li>The {@link android.provider.CalendarContract.Attendees} table holds the event attendee or guest
-information. Each row represents a single guest of an event. It specifies the type of guest the
-person is and the person’s response for the event.</li>
-
-<li>The {@link android.provider.CalendarContract.Reminders} table holds the alert/notification data.
-Each row represents a single alert for an event. An event can have multiple reminders. The number of
-reminders per event is specified in {@code MAX_REMINDERS}, which is set by the sync adapter that
-owns the given calendar. Reminders are specified in number-of-minutes before the event is
-scheduled and specify an alarm method such as to use an alert, email, or SMS to remind
-the user.</li>
-
-<li>The {@link android.provider.CalendarContract.ExtendedProperties} table hold opaque data fields
-used by the sync adapter. The provider takes no action with items in this table except to delete
-them when their related events are deleted.</li>
-</ul>
-
-<p>To access a user’s calendar data with the Calendar Provider, your application must request
-the {@link android.Manifest.permission#READ_CALENDAR} permission (for read access) and
-{@link android.Manifest.permission#WRITE_CALENDAR} (for write access).</p>
-
-
-<h4>Event intent</h4>
-
-<p>If all you want to do is add an event to the user’s calendar, you can use an {@link
-android.content.Intent#ACTION_INSERT} intent with the data defined by {@link
-android.provider.CalendarContract.Events#CONTENT_URI Events.CONTENT_URI} in order to start an
-activity in the Calendar app that creates new events. Using the intent does not require any
-permission and you can specify event details with the following extras:</p>
-
-<ul>
- <li>{@link android.provider.CalendarContract.EventsColumns#TITLE Events.TITLE}: Name for the
-event</li>
- <li>{@link
-android.provider.CalendarContract#EXTRA_EVENT_BEGIN_TIME CalendarContract.EXTRA_EVENT_BEGIN_TIME}:
-Event begin time in milliseconds from the
-epoch</li>
- <li>{@link
-android.provider.CalendarContract#EXTRA_EVENT_END_TIME CalendarContract.EXTRA_EVENT_END_TIME}: Event
-end time in milliseconds from the epoch</li>
- <li>{@link android.provider.CalendarContract.EventsColumns#EVENT_LOCATION Events.EVENT_LOCATION}:
-Location of the event</li>
- <li>{@link android.provider.CalendarContract.EventsColumns#DESCRIPTION Events.DESCRIPTION}: Event
-description</li>
- <li>{@link android.content.Intent#EXTRA_EMAIL Intent.EXTRA_EMAIL}: Email addresses of those to
-invite</li>
- <li>{@link android.provider.CalendarContract.EventsColumns#RRULE Events.RRULE}: The recurrence
-rule for the event</li>
- <li>{@link android.provider.CalendarContract.EventsColumns#ACCESS_LEVEL Events.ACCESS_LEVEL}:
-Whether the event is private or public</li>
- <li>{@link android.provider.CalendarContract.EventsColumns#AVAILABILITY Events.AVAILABILITY}:
-Whether the time period of this event allows for other events to be scheduled at the same time</li>
-</ul>
-
-
-
-
-<h3 id="Voicemail">Voicemail Provider</h3>
-
-<p>The new Voicemail Provider allows applications to add voicemails to the
-device, in order to present all the user's voicemails in a single visual presentation. For instance,
-it’s possible that a user has multiple voicemail sources, such as
-one from the phone’s service provider and others from VoIP or other alternative voice
-services. These apps can use the Voicemail Provider APIs to add their voicemails to the device. The
-built-in Phone application then presents all voicemails to the user in a unified presentation.
-Although the system’s Phone application is the only application that can read all the voicemails,
-each application that provides voicemails can read those that it has added to the system (but cannot
-read voicemails from other services).</p>
-
-<p>Because the APIs currently do not allow third-party apps to read all the voicemails from the
-system, the only third-party apps that should use the voicemail APIs are those that have voicemail
-to deliver to the user.</p>
-
-<p>The {@link android.provider.VoicemailContract} class defines the content provider for the
-Voicemail Provder. The subclasses {@link android.provider.VoicemailContract.Voicemails} and {@link
-android.provider.VoicemailContract.Status} provide tables in which apps can
-insert voicemail data for storage on the device. For an example of a voicemail provider app, see the
-<a href="{@docRoot}resources/samples/VoicemailProviderDemo/index.html">Voicemail Provider
-Demo</a>.</p>
-
-
-
-
-
-<h3 id="Multimedia">Multimedia</h3>
-
-<p>Android 4.0 adds several new APIs for applications that interact with media such as photos,
-videos, and music.</p>
-
-
-<h4>Media Effects</h4>
-
-<p>A new media effects framework allows you to apply a variety of visual effects to images and
-videos. For example, image effects allow you to easily fix red-eye, convert an image to grayscale,
-adjust brightness, adjust saturation, rotate an image, apply a fisheye effect, and much more. The
-system performs all effects processing on the GPU to obtain maximum performance.</p>
-
-<p>For maximum performance, effects are applied directly to OpenGL textures, so your application
-must have a valid OpenGL context before it can use the effects APIs. The textures to which you apply
-effects may be from bitmaps, videos or even the camera. However, there are certain restrictions that
-textures must meet:</p>
-<ol>
-<li>They must be bound to a {@link android.opengl.GLES20#GL_TEXTURE_2D} texture image</li>
-<li>They must contain at least one mipmap level</li>
-</ol>
-
-<p>An {@link android.media.effect.Effect} object defines a single media effect that you can apply to
-an image frame. The basic workflow to create an {@link android.media.effect.Effect} is:</p>
-
-<ol>
-<li>Call {@link android.media.effect.EffectContext#createWithCurrentGlContext
-EffectContext.createWithCurrentGlContext()} from your OpenGL ES 2.0 context.</li>
-<li>Use the returned {@link android.media.effect.EffectContext} to call {@link
-android.media.effect.EffectContext#getFactory EffectContext.getFactory()}, which returns an instance
-of {@link android.media.effect.EffectFactory}.</li>
-<li>Call {@link android.media.effect.EffectFactory#createEffect createEffect()}, passing it an
-effect name from @link android.media.effect.EffectFactory}, such as {@link
-android.media.effect.EffectFactory#EFFECT_FISHEYE} or {@link
-android.media.effect.EffectFactory#EFFECT_VIGNETTE}.</li>
-</ol>
-
-<p>You can adjust an effect’s parameters by calling {@link android.media.effect.Effect#setParameter
-setParameter()} and passing a parameter name and parameter value. Each type of effect accepts
-different parameters, which are documented with the effect name. For example, {@link
-android.media.effect.EffectFactory#EFFECT_FISHEYE} has one parameter for the {@code scale} of the
-distortion.</p>
-
-<p>To apply an effect on a texture, call {@link android.media.effect.Effect#apply apply()} on the
-{@link
-android.media.effect.Effect} and pass in the input texture, it’s width and height, and the output
-texture. The input texture must be bound to a {@link android.opengl.GLES20#GL_TEXTURE_2D} texture
-image (usually done by calling the {@link android.opengl.GLES20#glTexImage2D glTexImage2D()}
-function). You may provide multiple mipmap levels. If the output texture has not been bound to a
-texture image, it will be automatically bound by the effect as a {@link
-android.opengl.GLES20#GL_TEXTURE_2D} and with one mipmap level (0), which will have the same
-size as the input.</p>
-
-<p>All effects listed in {@link android.media.effect.EffectFactory} are guaranteed to be supported.
-However, some additional effects available from external libraries are not supported by all devices,
-so you must first check if the desired effect from the external library is supported by calling
-{@link android.media.effect.EffectFactory#isEffectSupported isEffectSupported()}.</p>
-
-
-<h4>Remote control client</h4>
-
-<p>The new {@link android.media.RemoteControlClient} allows media players to enable playback
-controls from remote control clients such as the device lock screen. Media players can also expose
-information about the media currently playing for display on the remote control, such as track
-information and album art.</p>
-
-<p>To enable remote control clients for your media player, instantiate a {@link
-android.media.RemoteControlClient} with its constructor, passing it a {@link
-android.app.PendingIntent} that broadcasts {@link
-android.content.Intent#ACTION_MEDIA_BUTTON}. The intent must also declare the explicit {@link
-android.content.BroadcastReceiver} component in your app that handles the {@link
-android.content.Intent#ACTION_MEDIA_BUTTON} event.</p>
-
-<p>To declare which media control inputs your player can handle, you must call {@link
-android.media.RemoteControlClient#setTransportControlFlags setTransportControlFlags()} on your
-{@link android.media.RemoteControlClient}, passing a set of {@code FLAG_KEY_MEDIA_*} flags, such as
-{@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_PREVIOUS} and {@link
-android.media.RemoteControlClient#FLAG_KEY_MEDIA_NEXT}.</p>
-
-<p>You must then register your {@link android.media.RemoteControlClient} by passing it to {@link
-android.media.AudioManager#registerRemoteControlClient MediaManager.registerRemoteControlClient()}.
-Once registered, the broadcast receiver you declared when you instantiated the {@link
-android.media.RemoteControlClient} will receive {@link android.content.Intent#ACTION_MEDIA_BUTTON}
-events when a button is pressed from a remote control. The intent you receive includes the {@link
-android.view.KeyEvent} for the media key pressed, which you can retrieve from the intent with {@link
-android.content.Intent#getParcelableExtra getParcelableExtra(Intent.EXTRA_KEY_EVENT)}.</p>
-
-<p>To display information on the remote control about the media playing, call {@link
-android.media.RemoteControlClient#editMetadata editMetaData()} and add metadata to the returned
-{@link android.media.RemoteControlClient.MetadataEditor}. You can supply a bitmap for media artwork,
-numerical information such as elapsed time, and text information such as the track title. For
-information on available keys see the {@code METADATA_KEY_*} flags in {@link
-android.media.MediaMetadataRetriever}.</p>
-
-<p>For a sample implementation, see the <a
-href="{@docRoot}resources/samples/RandomMusicPlayer/index.html">Random Music Player</a>, which
-provides compatibility logic such that it enables the remote control client on Android 4.0
-devices while continuing to support devices back to Android 2.1.</p>
-
-
-<h4>Media player</h4>
-
-<ul>
-<li>Streaming online media from {@link android.media.MediaPlayer} now requires the {@link
-android.Manifest.permission#INTERNET} permission. If you use {@link android.media.MediaPlayer} to
-play content from the Internet, be sure to add the {@link android.Manifest.permission#INTERNET}
-permission to your manifest or else your media playback will not work beginning with Android
-4.0.</li>
-
-<li>{@link android.media.MediaPlayer#setSurface(Surface) setSurface()} allows you define a {@link
-android.view.Surface} to behave as the video sink.</li>
-
-<li>{@link android.media.MediaPlayer#setDataSource(Context,Uri,Map) setDataSource()} allows you to
-send additional HTTP headers with your request, which can be useful for HTTP(S) live streaming</li>
-
-<li>HTTP(S) live streaming now respects HTTP cookies across requests</li>
-</ul>
-
-
-<h4>Media types</h4>
-
-<p>Android 4.0 adds support for:</p>
-<ul>
-<li>HTTP/HTTPS live streaming protocol version 3 </li>
-<li>ADTS raw AAC audio encoding</li>
-<li>WEBP images</li>
-<li>Matroska video</li>
-</ul>
-<p>For more info, see <a href="{@docRoot}guide/appendix/media-formats.html">Supported Media
-Formats</a>.</p>
-
-
-
-
-
-<h3 id="Camera">Camera</h3>
-
-<p>The {@link android.hardware.Camera} class now includes APIs for detecting faces and controlling
-focus and metering areas.</p>
-
-
-<h4>Face detection</h4>
-
-<p>Camera apps can now enhance their abilities with Android’s face detection APIs, which not
-only detect the face of a subject, but also specific facial features, such as the eyes and mouth.
-</p>
-
-<p>To detect faces in your camera application, you must register a {@link
-android.hardware.Camera.FaceDetectionListener} by calling {@link
-android.hardware.Camera#setFaceDetectionListener setFaceDetectionListener()}. You can then start
-your camera surface and start detecting faces by calling {@link
-android.hardware.Camera#startFaceDetection}.</p>
-
-<p>When the system detects one or more faces in the camera scene, it calls the {@link
-android.hardware.Camera.FaceDetectionListener#onFaceDetection onFaceDetection()} callback in your
-implementation of {@link android.hardware.Camera.FaceDetectionListener}, including an array of
-{@link android.hardware.Camera.Face} objects.</p>
-
-<p>An instance of the {@link android.hardware.Camera.Face} class provides various information about
-the face detected, including:</p>
-<ul>
-<li>A {@link android.graphics.Rect} that specifies the bounds of the face, relative to the camera's
-current field of view</li>
-<li>An integer betwen 1 and 100 that indicates how confident the system is that the object is a
-human face</li>
-<li>A unique ID so you can track multiple faces</li>
-<li>Several {@link android.graphics.Point} objects that indicate where the eyes and mouth are
-located</li>
-</ul>
-
-<p class="note"><strong>Note:</strong> Face detection may not be supported on some
-devices, so you should check by calling {@link
-android.hardware.Camera.Parameters#getMaxNumDetectedFaces()} and ensure the return
-value is greater than zero. Also, some devices may not support identification of eyes and mouth,
-in which case, those fields in the {@link android.hardware.Camera.Face} object will be null.</p>
-
-
-<h4>Focus and metering areas</h4>
-
-<p>Camera apps can now control the areas that the camera uses for focus and for metering white
-balance
-and auto-exposure. Both features use the new {@link android.hardware.Camera.Area} class to specify
-the region of the camera’s current view that should be focused or metered. An instance of the {@link
-android.hardware.Camera.Area} class defines the bounds of the area with a {@link
-android.graphics.Rect} and the area's weight—representing the level of importance of that
-area, relative to other areas in consideration—with an integer.</p>
-
-<p>Before setting either a focus area or metering area, you should first call {@link
-android.hardware.Camera.Parameters#getMaxNumFocusAreas} or {@link
-android.hardware.Camera.Parameters#getMaxNumMeteringAreas}, respectively. If these return zero, then
-the device does not support the corresponding feature.</p>
-
-<p>To specify the focus or metering areas to use, simply call {@link
-android.hardware.Camera.Parameters#setFocusAreas setFocusAreas()} or {@link
-android.hardware.Camera.Parameters#setMeteringAreas setMeteringAreas()}. Each take a {@link
-java.util.List} of {@link android.hardware.Camera.Area} objects that indicate the areas to consider
-for focus or metering. For example, you might implement a feature that allows the user to set the
-focus area by touching an area of the preview, which you then translate to an {@link
-android.hardware.Camera.Area} object and request that the camera focus on that area of the scene.
-The focus or exposure in that area will continually update as the scene in the area changes.</p>
-
-
-<h4>Continuous auto focus for photos</h4>
-
-<p>You can now enable continuous auto focusing (CAF) when taking photos. To enable CAF in your
-camera app, pass {@link android.hardware.Camera.Parameters#FOCUS_MODE_CONTINUOUS_PICTURE}
-to {@link android.hardware.Camera.Parameters#setFocusMode setFocusMode()}. When ready to capture
-a photo, call {@link android.hardware.Camera#autoFocus autoFocus()}. Your {@link
-android.hardware.Camera.AutoFocusCallback} immediately receives a callback to indicate whether
-focus was achieved. To resume CAF after receiving the callback, you must call {@link
-android.hardware.Camera#cancelAutoFocus()}.</p>
-
-<p class="note"><strong>Note:</strong> Continuous auto focus is also supported when capturing
-video, using {@link android.hardware.Camera.Parameters#FOCUS_MODE_CONTINUOUS_VIDEO}, which was
-added in API level 9.</p>
-
-
-<h4>Other camera features</h4>
-
-<ul>
-<li>While recording video, you can now call {@link android.hardware.Camera#takePicture
-takePicture()} to save a photo without interrupting the video session. Before doing so, you should
-call {@link android.hardware.Camera.Parameters#isVideoSnapshotSupported} to be sure the hardware
-supports it.</li>
-
-<li>You can now lock auto exposure and white balance with {@link
-android.hardware.Camera.Parameters#setAutoExposureLock setAutoExposureLock()} and {@link
-android.hardware.Camera.Parameters#setAutoWhiteBalanceLock setAutoWhiteBalanceLock()} to prevent
-these properties from changing.</li>
-
-<li>You can now call {@link android.hardware.Camera#setDisplayOrientation
-setDisplayOrientation()} while the camera preview is running. Previously, you could call this
-only before beginning the preview, but you can now change the orientation at any time.</li>
-</ul>
-
-
-<h4>Camera broadcast intents</h4>
-
-<ul>
-<li>{@link android.hardware.Camera#ACTION_NEW_PICTURE Camera.ACTION_NEW_PICTURE}:
-This indicates that the user has captured a new photo. The built-in Camera app invokes this
-broadcast after a photo is captured and third-party camera apps should also broadcast this intent
-after capturing a photo.</li>
-<li>{@link android.hardware.Camera#ACTION_NEW_VIDEO Camera.ACTION_NEW_VIDEO}:
-This indicates that the user has captured a new video. The built-in Camera app invokes this
-broadcast after a video is recorded and third-party camera apps should also broadcast this intent
-after capturing a video.</li>
-</ul>
-
-
-
-
-
-<h3 id="AndroidBeam">Android Beam (NDEF Push with NFC)</h3>
-
-<p>Android Beam is a new NFC feature that allows you to send NDEF messages from one device to
-another (a process also known as “NDEF Push"). The data transfer is initiated when two
-Android-powered devices that support Android Beam are in close proximity (about 4 cm), usually with
-their backs touching. The data inside the NDEF message can contain any data that you wish to share
-between devices. For example, the People app shares contacts, YouTube shares videos, and Browser
-shares URLs using Android Beam.</p>
-
-<p>To transmit data between devices using Android Beam, you need to create an {@link
-android.nfc.NdefMessage} that contains the information you want to share while your activity is in
-the foreground. You must then pass the {@link android.nfc.NdefMessage} to the system in one of two
-ways:</p>
-
-<ul>
-<li>Define a single {@link android.nfc.NdefMessage} to push while in the activity:
-<p>Call {@link android.nfc.NfcAdapter#setNdefPushMessage setNdefPushMessage()} at any time to set
-the message you want to send. For instance, you might call this method and pass it your {@link
-android.nfc.NdefMessage} during your activity’s {@link android.app.Activity#onCreate onCreate()}
-method. Then, whenever Android Beam is activated with another device while the activity is in the
-foreground, the system sends the {@link android.nfc.NdefMessage} to the other device.</p></li>
-
-<li>Define the {@link android.nfc.NdefMessage} to push at the time that Android Beam is initiated:
-<p>Implement {@link android.nfc.NfcAdapter.CreateNdefMessageCallback}, in which your
-implementation of the {@link
-android.nfc.NfcAdapter.CreateNdefMessageCallback#createNdefMessage createNdefMessage()}
-method returns the {@link android.nfc.NdefMessage} you want to send. Then pass the {@link
-android.nfc.NfcAdapter.CreateNdefMessageCallback} implementation to {@link
-android.nfc.NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback()}.</p>
-<p>In this case, when Android Beam is activated with another device while your activity is in the
-foreground, the system calls {@link
-android.nfc.NfcAdapter.CreateNdefMessageCallback#createNdefMessage createNdefMessage()} to retrieve
-the {@link android.nfc.NdefMessage} you want to send. This allows you to define the {@link
-android.nfc.NdefMessage} to deliver only once Android Beam is initiated, in case the contents
-of the message might vary throughout the life of the activity.</p></li>
-</ul>
-
-<p>In case you want to run some specific code once the system has successfully delivered your NDEF
-message to the other device, you can implement {@link
-android.nfc.NfcAdapter.OnNdefPushCompleteCallback} and set it with {@link
-android.nfc.NfcAdapter#setOnNdefPushCompleteCallback setNdefPushCompleteCallback()}. The system will
-then call {@link android.nfc.NfcAdapter.OnNdefPushCompleteCallback#onNdefPushComplete
-onNdefPushComplete()} when the message is delivered.</p>
-
-<p>On the receiving device, the system dispatches NDEF Push messages in a similar way to regular NFC
-tags. The system invokes an intent with the {@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED}
-action to start an activity, with either a URL or a MIME type set according to the first {@link
-android.nfc.NdefRecord} in the {@link android.nfc.NdefMessage}. For the activity you want to
-respond, you can declare intent filters for the URLs or MIME types your app cares about. For more
-information about Tag Dispatch see the <a
-href="{@docRoot}guide/topics/nfc/index.html#dispatch">NFC</a> developer guide.</p>
-
-<p>If you want your {@link android.nfc.NdefMessage} to carry a URI, you can now use the convenience
-method {@link android.nfc.NdefRecord#createUri createUri} to construct a new {@link
-android.nfc.NdefRecord} based on either a string or a {@link android.net.Uri} object. If the URI is
-a special format that you want your application to also receive during an Android Beam event, you
-should create an intent filter for your activity using the same URI scheme in order to receive the
-incoming NDEF message.</p>
-
-<p>You should also pass an “Android application record" with your {@link android.nfc.NdefMessage} in
-order to guarantee that your application handles the incoming NDEF message, even if other
-applications filter for the same intent action. You can create an Android application record by
-calling {@link android.nfc.NdefRecord#createApplicationRecord createApplicationRecord()}, passing it
-your application’s package name. When the other device receives the NDEF message with the
-application record and multiple applications contain activities that handle the specified intent,
-the system always delivers the message to the activity in your application (based on the matching
-application record). If the target device does not currently have your application installed, the
-system uses the Android application record to launch Google Play and take the user to the
-application in order to install it.</p>
-
-<p>If your application doesn’t use NFC APIs to perform NDEF Push messaging, then Android provides a
-default behavior: When your application is in the foreground on one device and Android Beam is
-invoked with another Android-powered device, then the other device receives an NDEF message with an
-Android application record that identifies your application. If the receiving device has the
-application installed, the system launches it; if it’s not installed, Google Play opens and takes
-the user to your application in order to install it.</p>
-
-<p>You can read more about Android Beam and other NFC features in the <a
-href="{@docRoot}guide/topics/nfc/nfc.html">NFC Basics</a> developer guide. For some example code
-using Android Beam, see the <a
-href="{@docRoot}resources/samples/AndroidBeamDemo/src/com/example/android/beam/Beam.html">Android
-Beam Demo</a>.</p>
-
-
-
-
-
-<h3 id="WiFiDirect">Wi-Fi Direct</h3>
-
-<p>Android now supports Wi-Fi Direct for peer-to-peer (P2P) connections between Android-powered
-devices and other device types without a hotspot or Internet connection. The Android framework
-provides a set of Wi-Fi P2P APIs that allow you to discover and connect to other devices when each
-device supports Wi-Fi Direct, then communicate over a speedy connection across distances much longer
-than a Bluetooth connection.</p>
-
-<p>A new package, {@link android.net.wifi.p2p}, contains all the APIs for performing peer-to-peer
-connections with Wi-Fi. The primary class you need to work with is {@link
-android.net.wifi.p2p.WifiP2pManager}, which you can acquire by calling {@link
-android.app.Activity#getSystemService getSystemService(WIFI_P2P_SERVICE)}. The {@link
-android.net.wifi.p2p.WifiP2pManager} includes APIs that allow you to:</p>
-<ul>
-<li>Initialize your application for P2P connections by calling {@link
-android.net.wifi.p2p.WifiP2pManager#initialize initialize()}</li>
-
-<li>Discover nearby devices by calling {@link android.net.wifi.p2p.WifiP2pManager#discoverPeers
-discoverPeers()}</li>
-
-<li>Start a P2P connection by calling {@link android.net.wifi.p2p.WifiP2pManager#connect
-connect()}</li>
-<li>And more</li>
-</ul>
-
-<p>Several other interfaces and classes are necessary as well, such as:</p>
-<ul>
-<li>The {@link android.net.wifi.p2p.WifiP2pManager.ActionListener} interface allows you to receive
-callbacks when an operation such as discovering peers or connecting to them succeeds or fails.</li>
-
-<li>{@link android.net.wifi.p2p.WifiP2pManager.PeerListListener} interface allows you to receive
-information about discovered peers. The callback provides a {@link
-android.net.wifi.p2p.WifiP2pDeviceList}, from which you can retrieve a {@link
-android.net.wifi.p2p.WifiP2pDevice} object for each device within range and get information such as
-the device name, address, device type, the WPS configurations the device supports, and more.</li>
-
-<li>The {@link android.net.wifi.p2p.WifiP2pManager.GroupInfoListener} interface allows you to
-receive information about a P2P group. The callback provides a {@link
-android.net.wifi.p2p.WifiP2pGroup} object, which provides group information such as the owner, the
-network name, and passphrase.</li>
-
-<li>{@link android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener} interface allows you to
-receive information about the current connection. The callback provides a {@link
-android.net.wifi.p2p.WifiP2pInfo} object, which has information such as whether a group has been
-formed and who is the group owner.</li>
-</ul>
-
-<p>In order to use the Wi-Fi P2P APIs, your app must request the following user permissions:</p>
-<ul>
-<li>{@link android.Manifest.permission#ACCESS_WIFI_STATE}</li>
-<li>{@link android.Manifest.permission#CHANGE_WIFI_STATE}</li>
-<li>{@link android.Manifest.permission#INTERNET} (although your app doesn’t technically connect
-to the Internet, communicating to Wi-Fi Direct peers with standard java sockets requires Internet
-permission).</li>
-</ul>
-
-<p>The Android system also broadcasts several different actions during certain Wi-Fi P2P events:</p>
-<ul>
-<li>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_CONNECTION_CHANGED_ACTION}: The P2P
-connection state has changed. This carries {@link
-android.net.wifi.p2p.WifiP2pManager#EXTRA_WIFI_P2P_INFO} with a {@link
-android.net.wifi.p2p.WifiP2pInfo} object and {@link
-android.net.wifi.p2p.WifiP2pManager#EXTRA_NETWORK_INFO} with a {@link android.net.NetworkInfo}
-object.</li>
-
-<li>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_CHANGED_ACTION}: The P2P state has
-changed between enabled and disabled. It carries {@link
-android.net.wifi.p2p.WifiP2pManager#EXTRA_WIFI_STATE} with either {@link
-android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_DISABLED} or {@link
-android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_ENABLED}</li>
-
-<li>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION}: The list of peer
-devices has changed.</li>
-
-<li>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_THIS_DEVICE_CHANGED_ACTION}: The details for
-this device have changed.</li>
-</ul>
-
-<p>See the {@link android.net.wifi.p2p.WifiP2pManager} documentation for more information. Also
-look at the <a href="{@docRoot}resources/samples/WiFiDirectDemo/index.html">Wi-Fi Direct Demo</a>
-sample application.</p>
-
-
-
-
-
-<h3 id="Bluetooth">Bluetooth Health Devices</h3>
-
-<p>Android now supports Bluetooth Health Profile devices, so you can create applications that use
-Bluetooth to communicate with health devices that support Bluetooth, such as heart-rate monitors,
-blood meters, thermometers, and scales.</p>
-
-<p>Similar to regular headset and A2DP profile devices, you must call {@link
-android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()} with a {@link
-android.bluetooth.BluetoothProfile.ServiceListener} and the {@link
-android.bluetooth.BluetoothProfile#HEALTH} profile type to establish a connection with the profile
-proxy object.</p>
-
-<p>Once you’ve acquired the Health Profile proxy (the {@link android.bluetooth.BluetoothHealth}
-object), connecting to and communicating with paired health devices involves the following new
-Bluetooth classes:</p>
-<ul>
-<li>{@link android.bluetooth.BluetoothHealthCallback}: You must extend this class and implement the
-callback methods to receive updates about changes in the application’s registration state and
-Bluetooth channel state.</li>
-<li>{@link android.bluetooth.BluetoothHealthAppConfiguration}: During callbacks to your {@link
-android.bluetooth.BluetoothHealthCallback}, you’ll receive an instance of this object, which
-provides configuration information about the available Bluetooth health device, which you must use
-to perform various operations such as initiate and terminate connections with the {@link
-android.bluetooth.BluetoothHealth} APIs.</li>
-</ul>
-
-<p>For more information about using the Bluetooth Health Profile, see the documentation for {@link
-android.bluetooth.BluetoothHealth}.</p>
-
-
-
-
-
-<h3 id="A11y">Accessibility</h3>
-
-<p>Android 4.0 improves accessibility for sight-impaired users with new explore-by-touch mode
-and extended APIs that allow you to provide more information about view content or
-develop advanced accessibility services.</p>
-
-
-<h4>Explore-by-touch mode</h4>
-
-<p>Users with vision loss can now explore the screen by touching and dragging a finger across the
-screen to hear voice descriptions of the content. Because the explore-by-touch mode works like a
-virtual cursor, it allows screen readers to identify the descriptive text the same way that screen
-readers can when the user navigates with a d-pad or trackball—by reading information provided
-by {@link android.R.attr#contentDescription android:contentDescription} and {@link
-android.view.View#setContentDescription setContentDescription()} upon a simulated "hover" event. So,
-consider this is a reminder that you should provide descriptive text for the views in your
-application, especially for {@link android.widget.ImageButton}, {@link android.widget.EditText},
-{@link android.widget.ImageView} and other widgets that might not naturally contain descriptive
-text.</p>
-
-
-<h4>Accessibility for views</h4>
-
-<p>To enhance the information available to accessibility services such as screen readers, you can
-implement new callback methods for accessibility events in your custom {@link
-android.view.View} components.</p>
-
-<p>It's important to first note that the behavior of the {@link
-android.view.View#sendAccessibilityEvent sendAccessibilityEvent()} method has changed in Android
-4.0. As with previous version of Android, when the user enables accessibility services on the device
-and an input event such as a click or hover occurs, the respective view is notified with a call to
-{@link android.view.View#sendAccessibilityEvent sendAccessibilityEvent()}. Previously, the
-implementation of {@link android.view.View#sendAccessibilityEvent sendAccessibilityEvent()} would
-initialize an {@link android.view.accessibility.AccessibilityEvent} and send it to {@link
-android.view.accessibility.AccessibilityManager}. The new behavior involves some additional callback
-methods that allow the view and its parents to add more contextual information to the event:
-<ol>
- <li>When invoked, the {@link
-android.view.View#sendAccessibilityEvent sendAccessibilityEvent()} and {@link
-android.view.View#sendAccessibilityEventUnchecked sendAccessibilityEventUnchecked()} methods defer
-to {@link android.view.View#onInitializeAccessibilityEvent onInitializeAccessibilityEvent()}.
- <p>Custom implementations of {@link android.view.View} might want to implement {@link
-android.view.View#onInitializeAccessibilityEvent onInitializeAccessibilityEvent()} to
-attach additional accessibility information to the {@link
-android.view.accessibility.AccessibilityEvent}, but should also call the super implementation to
-provide default information such as the standard content description, item index, and more.
-However, you should not add additional text content in this callback—that happens
-next.</p></li>
- <li>Once initialized, if the event is one of several types that should be populated with text
-information, the view then receives a call to {@link
-android.view.View#dispatchPopulateAccessibilityEvent dispatchPopulateAccessibilityEvent()}, which
-defers to the {@link android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()}
-callback.
- <p>Custom implementations of {@link android.view.View} should usually implement {@link
-android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()} to add additional
-text content to the {@link android.view.accessibility.AccessibilityEvent} if the {@link
-android.R.attr#contentDescription android:contentDescription} text is missing or
-insufficient. To add more text description to the
-{@link android.view.accessibility.AccessibilityEvent}, call {@link
-android.view.accessibility.AccessibilityEvent#getText()}.{@link java.util.List#add add()}.</p>
-</li>
- <li>At this point, the {@link android.view.View} passes the event up the view hierarchy by calling
-{@link android.view.ViewGroup#requestSendAccessibilityEvent requestSendAccessibilityEvent()} on the
-parent view. Each parent view then has the chance to augment the accessibility information by
-adding an {@link android.view.accessibility.AccessibilityRecord}, until it
-ultimately reaches the root view, which sends the event to the {@link
-android.view.accessibility.AccessibilityManager} with {@link
-android.view.accessibility.AccessibilityManager#sendAccessibilityEvent
-sendAccessibilityEvent()}.</li>
-</ol>
-
-<p>In addition to the new methods above, which are useful when extending the {@link
-android.view.View} class, you can also intercept these event callbacks on any {@link
-android.view.View} by extending {@link
-android.view.View.AccessibilityDelegate AccessibilityDelegate} and setting it on the view with
-{@link android.view.View#setAccessibilityDelegate setAccessibilityDelegate()}.
-When you do, each accessibility method in the view defers the call to the corresponding method in
-the delegate. For example, when the view receives a call to {@link
-android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()}, it passes it to the
-same method in the {@link android.view.View.AccessibilityDelegate}. Any methods not handled by
-the delegate are given right back to the view for default behavior. This allows you to override only
-the methods necessary for any given view without extending the {@link android.view.View} class.</p>
-
-
-<p>If you want to maintain compatibility with Android versions prior to 4.0, while also supporting
-the new the accessibility APIs, you can do so with the latest version of the <em>v4 support
-library</em> (in <a href="{@docRoot}sdk/compatibility-library.html">Compatibility Package, r4</a>)
-using a set of utility classes that provide the new accessibility APIs in a backward-compatible
-design.</p>
-
-
-
-
-<h4>Accessibility services</h4>
-
-<p>If you're developing an accessibility service, the information about various accessibility events
-has been significantly expanded to enable more advanced accessibility feedback for users. In
-particular, events are generated based on view composition, providing better context information and
-allowing accessibility services to traverse view hierarchies to get additional view information and
-deal with special cases.</p>
-
-<p>If you're developing an accessibility service (such as a screen reader), you can access
-additional content information and traverse view hierarchies with the following procedure:</p>
-<ol>
-<li>Upon receiving an {@link android.view.accessibility.AccessibilityEvent} from an application,
-call the {@link android.view.accessibility.AccessibilityEvent#getRecord(int)
-AccessibilityEvent.getRecord()} to retrieve a specific {@link
-android.view.accessibility.AccessibilityRecord} (there may be several records attached to the
-event).</li>
-
-<li>From either {@link android.view.accessibility.AccessibilityEvent} or an individual {@link
-android.view.accessibility.AccessibilityRecord}, you can call {@link
-android.view.accessibility.AccessibilityRecord#getSource() getSource()} to retrieve a {@link
-android.view.accessibility.AccessibilityNodeInfo} object.
- <p>An {@link android.view.accessibility.AccessibilityNodeInfo} represents a single node
-of the window content in a format that allows you to query accessibility information about that
-node. The {@link android.view.accessibility.AccessibilityNodeInfo} object returned from {@link
-android.view.accessibility.AccessibilityEvent} describes the event source, whereas the source from
-an {@link android.view.accessibility.AccessibilityRecord} describes the predecessor of the event
-source.</p></li>
-
-<li>With the {@link android.view.accessibility.AccessibilityNodeInfo}, you can query information
-about it, call {@link
-android.view.accessibility.AccessibilityNodeInfo#getParent getParent()} or {@link
-android.view.accessibility.AccessibilityNodeInfo#getChild getChild()} to traverse the view
-hierarchy, and even add child views to the node.</li>
-</ol>
-
-<p>In order for your application to publish itself to the system as an accessibility service, it
-must declare an XML configuration file that corresponds to {@link
-android.accessibilityservice.AccessibilityServiceInfo}. For more information about creating an
-accessibility service, see {@link
-android.accessibilityservice.AccessibilityService} and {@link
-android.accessibilityservice.AccessibilityService#SERVICE_META_DATA
-SERVICE_META_DATA} for information about the XML configuration.</p>
-
-
-<h4>Other accessibility APIs</h4>
-
-<p>If you're interested in the device's accessibility state, the {@link
-android.view.accessibility.AccessibilityManager} has some new APIs such as:</p>
-<ul>
- <li>{@link android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener}
-is an interface that allows you to receive a callback whenever accessibility is enabled or
-disabled.</li>
- <li>{@link android.view.accessibility.AccessibilityManager#getEnabledAccessibilityServiceList
- getEnabledAccessibilityServiceList()} provides information about which accessibility services
- are currently enabled.</li>
- <li>{@link android.view.accessibility.AccessibilityManager#isTouchExplorationEnabled()} tells
- you whether the explore-by-touch mode is enabled.</li>
-</ul>
-
-
-
-
-
-
-<h3 id="SpellChecker">Spell Checker Services</h3>
-
-<p>A new spell checker framework allows apps to create spell checkers in a manner similar to the
-input method framework (for IMEs). To create a new spell checker, you must implement a service that
-extends
-{@link android.service.textservice.SpellCheckerService} and extend the {@link
-android.service.textservice.SpellCheckerService.Session} class to provide spelling suggestions based
-on text provided by the interface's callback methods. In the {@link
-android.service.textservice.SpellCheckerService.Session} callback methods, you must return the
-spelling suggestions as {@link android.view.textservice.SuggestionsInfo} objects. </p>
-
-<p>Applications with a spell checker service must declare the {@link
-android.Manifest.permission#BIND_TEXT_SERVICE} permission as required by the service.
-The service must also declare an intent filter with {@code <action
-android:name="android.service.textservice.SpellCheckerService" />} as the intent’s action and should
-include a {@code <meta-data>} element that declares configuration information for the spell
-checker. </p>
-
-<p>See the sample <a href="{@docRoot}resources/samples/SpellChecker/SampleSpellCheckerService/index.html">
-Spell Checker Service</a> app and
-sample <a href="{@docRoot}resources/samples/SpellChecker/HelloSpellChecker/index.html">
-Spell Checker Client</a> app for example code.</p>
-
-
-
-
-<h3 id="TTS">Text-to-speech Engines</h3>
-
-<p>Android’s text-to-speech (TTS) APIs have been significantly extended to allow applications to
-more easily implement custom TTS engines, while applications that want to use a TTS engine have a
-couple new APIs for selecting an engine.</p>
-
-
-<h4>Using text-to-speech engines</h4>
-
-<p>In previous versions of Android, you could use the {@link android.speech.tts.TextToSpeech} class
-to perform text-to-speech (TTS) operations using the TTS engine provided by the system or set a
-custom engine using {@link android.speech.tts.TextToSpeech#setEngineByPackageName
-setEngineByPackageName()}. In Android 4.0, the {@link
-android.speech.tts.TextToSpeech#setEngineByPackageName setEngineByPackageName()} method has been
-deprecated and you can now specify the engine to use with a new {@link
-android.speech.tts.TextToSpeech} constructor that accepts the package name of a TTS engine.</p>
-
-<p>You can also query the available TTS engines with {@link
-android.speech.tts.TextToSpeech#getEngines()}. This method returns a list of {@link
-android.speech.tts.TextToSpeech.EngineInfo} objects, which include meta data such as the engine’s
-icon, label, and package name.</p>
-
-
-<h4>Building text-to-speech engines</h4>
-
-<p>Previously, custom engines required that the engine be built using an undocumented native header
-file. In Android 4.0, there is a complete set of framework APIs for building TTS engines. </p>
-
-<p>The basic setup requires an implementation of {@link android.speech.tts.TextToSpeechService} that
-responds to the {@link android.speech.tts.TextToSpeech.Engine#INTENT_ACTION_TTS_SERVICE} intent. The
-primary work for a TTS engine happens during the {@link
-android.speech.tts.TextToSpeechService#onSynthesizeText onSynthesizeText()} callback in a service
-that extends {@link android.speech.tts.TextToSpeechService}. The system delivers this method two
-objects:</p>
-<ul>
-<li>{@link android.speech.tts.SynthesisRequest}: This contains various data including the text to
-synthesize, the locale, the speech rate, and voice pitch.</li>
-<li>{@link android.speech.tts.SynthesisCallback}: This is the interface by which your TTS engine
-delivers the resulting speech data as streaming audio. First the engine must call {@link
-android.speech.tts.SynthesisCallback#start start()} to indicate that the engine is ready to deliver
-the audio, then call {@link android.speech.tts.SynthesisCallback#audioAvailable audioAvailable()},
-passing it the audio data in a byte buffer. Once your engine has passed all audio through the
-buffer, call {@link android.speech.tts.SynthesisCallback#done()}.</li>
-</ul>
-
-<p>Now that the framework supports a true API for creating TTS engines, support for the native code
-implementation has been removed. Look for a blog post about a compatibility layer
-that you can use to convert your old TTS engines to the new framework.</p>
-
-<p>For an example TTS engine using the new APIs, see the <a
-href="{@docRoot}resources/samples/TtsEngine/index.html">Text To Speech Engine</a> sample app.</p>
-
-
-
-
-
-
-<h3 id="NetworkUsage">Network Usage</h3>
-
-<p>Android 4.0 gives users precise visibility of how much network data their applications are using.
-The Settings app provides controls that allow users to manage set limits for network data usage and
-even disable the use of background data for individual apps. In order to avoid users disabling your
-app’s access to data from the background, you should develop strategies to use the data
-connection efficiently and adjust your usage depending on the type of connection available.</p>
-
-<p>If your application performs a lot of network transactions, you should provide user settings that
-allow users to control your app’s data habits, such as how often your app syncs data, whether to
-perform uploads/downloads only when on Wi-Fi, whether to use data while roaming, etc. With these
-controls available to them, users are much less likely to disable your app’s access to data when
-they approach their limits, because they can instead precisely control how much data your app uses.
-If you provide a preference activity with these settings, you should include in its manifest
-declaration an intent filter for the {@link android.content.Intent#ACTION_MANAGE_NETWORK_USAGE}
-action. For example:</p>
-
-<pre>
-<activity android:name="DataPreferences" android:label="@string/title_preferences">
- <intent-filter>
- <action android:name="android.intent.action.MANAGE_NETWORK_USAGE" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
-</activity>
-</pre>
-
-<p>This intent filter indicates to the system that this is the activity that controls your
-application’s data usage. Thus, when the user inspects how much data your app is using from the
-Settings app, a “View application settings" button is available that launches your
-preference activity so the user can refine how much data your app uses.</p>
-
-<p>Also beware that {@link android.net.ConnectivityManager#getBackgroundDataSetting()} is now
-deprecated and always returns true—use {@link
-android.net.ConnectivityManager#getActiveNetworkInfo()} instead. Before you attempt any network
-transactions, you should always call {@link android.net.ConnectivityManager#getActiveNetworkInfo()}
-to get the {@link android.net.NetworkInfo} that represents the current network and query {@link
-android.net.NetworkInfo#isConnected()} to check whether the device has a
-connection. You can then check other connection properties, such as whether the device is
-roaming or connected to Wi-Fi.</p>
-
-
-
-
-
-
-
-
-<h3 id="RenderScript">RenderScript</h3>
-
-<p>Three major features have been added to RenderScript:</p>
-
-<ul>
- <li>Off-screen rendering to a framebuffer object</li>
- <li>Rendering inside a view</li>
- <li>RS for each from the framework APIs</li>
-</ul>
-
-<p>The {@link android.renderscript.Allocation} class now supports a {@link
-android.renderscript.Allocation#USAGE_GRAPHICS_RENDER_TARGET} memory space, which allows you to
-render things directly into the {@link android.renderscript.Allocation} and use it as a framebuffer
-object.</p>
-
-<p>{@link android.renderscript.RSTextureView} provides a means to display RenderScript graphics
-inside of a {@link android.view.View}, unlike {@link android.renderscript.RSSurfaceView}, which
-creates a separate window. This key difference allows you to do things such as move, transform, or
-animate an {@link android.renderscript.RSTextureView} as well as draw RenderScript graphics inside
-a view that lies within an activity layout.</p>
-
-<p>The {@link android.renderscript.Script#forEach Script.forEach()} method allows you to call
-RenderScript compute scripts from the VM level and have them automatically delegated to available
-cores on the device. You do not use this method directly, but any compute RenderScript that you
-write will have a {@link android.renderscript.Script#forEach forEach()} method that you can call in
-the reflected RenderScript class. You can call the reflected {@link
-android.renderscript.Script#forEach forEach()} method by passing in an input {@link
-android.renderscript.Allocation} to process, an output {@link android.renderscript.Allocation} to
-write the result to, and a {@link android.renderscript.FieldPacker} data structure in case the
-RenderScript needs more information. Only one of the {@link android.renderscript.Allocation}s is
-necessary and the data structure is optional.</p>
-
-
-
-
-
-
-
-
-
-<h3 id="Enterprise">Enterprise</h3>
-
-<p>Android 4.0 expands the capabilities for enterprise application with the following features.</p>
-
-<h4>VPN services</h4>
-
-<p>The new {@link android.net.VpnService} allows applications to build their own VPN (Virtual
-Private Network), running as a {@link android.app.Service}. A VPN service creates an interface for a
-virtual network with its own address and routing rules and performs all reading and writing with a
-file descriptor.</p>
-
-<p>To create a VPN service, use {@link android.net.VpnService.Builder}, which allows you to specify
-the network address, DNS server, network route, and more. When complete, you can establish the
-interface by calling {@link android.net.VpnService.Builder#establish()}, which returns a {@link
-android.os.ParcelFileDescriptor}. </p>
-
-<p>Because a VPN service can intercept packets, there are security implications. As such, if you
-implement {@link android.net.VpnService}, then your service must require the {@link
-android.Manifest.permission#BIND_VPN_SERVICE} to ensure that only the system can bind to it (only
-the system is granted this permission—apps cannot request it). To then use your VPN service,
-users must manually enable it in the system settings.</p>
-
-
-<h4>Device policies</h4>
-
-<p>Applications that manage the device restrictions can now disable the camera using {@link
-android.app.admin.DevicePolicyManager#setCameraDisabled setCameraDisabled()} and the {@link
-android.app.admin.DeviceAdminInfo#USES_POLICY_DISABLE_CAMERA} property (applied with a {@code
-<disable-camera />} element in the policy configuration file).</p>
-
-
-<h4>Certificate management</h4>
-
-<p>The new {@link android.security.KeyChain} class provides APIs that allow you to import and access
-certificates in the system key store. Certificates streamline the installation of both client
-certificates (to validate the identity of the user) and certificate authority certificates (to
-verify server identity). Applications such as web browsers or email clients can access the installed
-certificates to authenticate users to servers. See the {@link android.security.KeyChain}
-documentation for more information.</p>
-
-
-
-
-
-
-
-<h3 id="Sensors">Device Sensors</h3>
-
-<p>Two new sensor types have been added in Android 4.0:</p>
-
-<ul>
- <li>{@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE}: A temperature sensor that provides
-the ambient (room) temperature in degrees Celsius.</li>
- <li>{@link android.hardware.Sensor#TYPE_RELATIVE_HUMIDITY}: A humidity sensor that provides the
-relative ambient (room) humidity as a percentage.</li>
-</ul>
-
-<p>If a device has both {@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE} and {@link
-android.hardware.Sensor#TYPE_RELATIVE_HUMIDITY} sensors, you can use them to calculate the dew point
-and the absolute humidity.</p>
-
-<p>The previous temperature sensor, {@link android.hardware.Sensor#TYPE_TEMPERATURE}, has been
-deprecated. You should use the {@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE} sensor
-instead.</p>
-
-<p>Additionally, Android’s three synthetic sensors have been greatly improved so they now have lower
-latency and smoother output. These sensors include the gravity sensor ({@link
-android.hardware.Sensor#TYPE_GRAVITY}), rotation vector sensor ({@link
-android.hardware.Sensor#TYPE_ROTATION_VECTOR}), and linear acceleration sensor ({@link
-android.hardware.Sensor#TYPE_LINEAR_ACCELERATION}). The improved sensors rely on the gyroscope
-sensor to improve their output, so the sensors appear only on devices that have a gyroscope.</p>
-
-
-
-
-
-<h3 id="ActionBar">Action Bar</h3>
-
-<p>The {@link android.app.ActionBar} has been updated to support several new behaviors. Most
-importantly, the system gracefully manages the action bar’s size and configuration when running on
-smaller screens in order to provide an optimal user experience on all screen sizes. For example,
-when the screen is narrow (such as when a handset is in portrait orientation), the action bar’s
-navigation tabs appear in a “stacked bar," which appears directly below the main action bar. You can
-also opt-in to a “split action bar," which places all action items in a separate bar at the bottom
-of the screen when the screen is narrow.</p>
-
-
-<h4>Split action bar</h4>
-
-<p>If your action bar includes several action items, not all of them will fit into the action bar on
-a narrow screen, so the system will place more of them into the overflow menu. However, Android 4.0
-allows you to enable “split action bar" so that more action items can appear on the screen in a
-separate bar at the bottom of the screen. To enable split action bar, add {@link
-android.R.attr#uiOptions android:uiOptions} with {@code "splitActionBarWhenNarrow"} to either your
-<a href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
-tag or
-individual <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
-<activity>}</a> tags
-in your manifest file. When enabled, the system will add an additional bar at the bottom of the
-screen for all action items when the screen is narrow (no action items will appear in the primary
-action bar).</p>
-
-<p>If you want to use the navigation tabs provided by the {@link android.app.ActionBar.Tab} APIs,
-but don’t need the main action bar on top (you want only the tabs to appear at the top), then enable
-the split action bar as described above and also call {@link
-android.app.ActionBar#setDisplayShowHomeEnabled setDisplayShowHomeEnabled(false)} to disable the
-application icon in the action bar. With nothing left in the main action bar, it
-disappears—all that’s left are the navigation tabs at the top and the action items at the
-bottom of the screen.</p>
-
-
-<h4>Action bar styles</h4>
-
-<p>If you want to apply custom styling to the action bar, you can use new style properties {@link
-android.R.attr#backgroundStacked} and {@link android.R.attr#backgroundSplit} to apply a background
-drawable or color to the stacked bar and split bar, respectively. You can also set these styles at
-runtime with {@link android.app.ActionBar#setStackedBackgroundDrawable
-setStackedBackgroundDrawable()} and {@link android.app.ActionBar#setSplitBackgroundDrawable
-setSplitBackgroundDrawable()}.</p>
-
-
-<h4>Action provider</h4>
-
-<p>The new {@link android.view.ActionProvider} class allows you to create a specialized handler for
-action items. An action provider can define an action view, a default action behavior, and a submenu
-for each action item to which it is associated. When you want to create an action item that has
-dynamic behaviors (such as a variable action view, default action, or submenu), extending {@link
-android.view.ActionProvider} is a good solution in order to create a reusable component, rather than
-handling the various action item transformations in your fragment or activity.</p>
-
-<p>For example, the {@link android.widget.ShareActionProvider} is an extension of {@link
-android.view.ActionProvider} that facilitates a “share" action from the action bar. Instead of using
-traditional action item that invokes the {@link android.content.Intent#ACTION_SEND} intent, you can
-use this action provider to present an action view with a drop-down list of applications that handle
-the {@link android.content.Intent#ACTION_SEND} intent. When the user selects an application to use
-for the action, {@link android.widget.ShareActionProvider} remembers that selection and provides it
-in the action view for faster access to sharing with that app.</p>
-
-<p>To declare an action provider for an action item, include the {@code android:actionProviderClass}
-attribute in the <a href="{@docRoot}guide/topics/resources/menu-resource.html#item-element">{@code
-<item>}</a> element for your activity’s options menu, with the class name of the action
-provider as the value. For example:</p>
-
-<pre>
-<item android:id="@+id/menu_share"
- android:title="Share"
- android:showAsAction="ifRoom"
- android:actionProviderClass="android.widget.ShareActionProvider" />
-</pre>
-
-<p>In your activity’s {@link android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()}
-callback method, retrieve an instance of the action provider from the menu item and set the
-intent:</p>
-
-<pre>
-public boolean onCreateOptionsMenu(Menu menu) {
- getMenuInflater().inflate(R.menu.options, menu);
- ShareActionProvider shareActionProvider =
- (ShareActionProvider) menu.findItem(R.id.menu_share).getActionProvider();
- // Set the share intent of the share action provider.
- shareActionProvider.setShareIntent(createShareIntent());
- ...
- return super.onCreateOptionsMenu(menu);
-}
-</pre>
-
-<p>For an example using the {@link android.widget.ShareActionProvider}, see <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/ActionBarShareActionProviderActivity.html"
->ActionBarShareActionProviderActivity</a> in ApiDemos.</p>
-
-
-<h4>Collapsible action views</h4>
-
-<p>Action items that provide an action view can now toggle between their action view state and
-traditional action item state. Previously only the {@link android.widget.SearchView} supported
-collapsing when used as an action view, but now you can add an action view for any action item and
-switch between the expanded state (action view is visible) and collapsed state (action item is
-visible).</p>
-
-<p>To declare that an action item that contains an action view be collapsible, include the {@code
-“collapseActionView"} flag in the {@code android:showAsAction} attribute for the <a
-href="{@docRoot}guide/topics/resources/menu-resource.html#item-element">{@code
-<item>}</a> element in the menu’s XML file.</p>
-
-<p>To receive callbacks when an action view switches between expanded and collapsed, register an
-instance of {@link android.view.MenuItem.OnActionExpandListener} with the respective {@link
-android.view.MenuItem} by calling {@link android.view.MenuItem#setOnActionExpandListener
-setOnActionExpandListener()}. Typically, you should do so during the {@link
-android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()} callback.</p>
-
-<p>To control a collapsible action view, you can call {@link
-android.view.MenuItem#collapseActionView()} and {@link android.view.MenuItem#expandActionView()} on
-the respective {@link android.view.MenuItem}.</p>
-
-<p>When creating a custom action view, you can also implement the new {@link
-android.view.CollapsibleActionView} interface to receive callbacks when the view is expanded and
-collapsed.</p>
-
-
-<h4>Other APIs for action bar</h4>
-<ul>
-<li>{@link android.app.ActionBar#setHomeButtonEnabled setHomeButtonEnabled()} allows you to specify
-whether the icon/logo behaves as a button to navigate home or “up" (pass “true" to make it behave as
-a button).</li>
-
-<li>{@link android.app.ActionBar#setIcon setIcon()} and {@link android.app.ActionBar#setLogo
-setLogo()} allow you to define the action bar icon or logo at runtime.</li>
-
-<li>{@link android.app.Fragment#setMenuVisibility Fragment.setMenuVisibility()} allows you to enable
-or disable the visibility of the options menu items declared by the fragment. This is useful if the
-fragment has been added to the activity, but is not visible, so the menu items should be
-hidden.</li>
-
-<li>{@link android.app.FragmentManager#invalidateOptionsMenu
-FragmentManager.invalidateOptionsMenu()}
-allows you to invalidate the activity options menu during various states of the fragment lifecycle
-in which using the equivalent method from {@link android.app.Activity} might not be available.</li>
-</ul>
-
-
-
-
-
-
-
-
-<h3 id="UI">User Interface and Views</h3>
-
-<p>Android 4.0 introduces a variety of new views and other UI components.</p>
-
-
-<h4>GridLayout</h4>
-
-<p>{@link android.widget.GridLayout} is a new view group that places child views in a rectangular
-grid. Unlike {@link android.widget.TableLayout}, {@link android.widget.GridLayout} relies on a flat
-hierarchy and does not make use of intermediate views such as table rows for providing structure.
-Instead, children specify which row(s) and column(s) they should occupy (cells can span multiple
-rows and/or columns), and by default are laid out sequentially across the grid’s rows and columns.
-The {@link android.widget.GridLayout} orientation determines whether sequential children are by
-default laid out horizontally or vertically. Space between children may be specified either by using
-instances of the new {@link android.widget.Space} view or by setting the relevant margin parameters
-on children.</p>
-
-<p>See <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/index.html">ApiDemos</a
->
-for samples using {@link android.widget.GridLayout}.</p>
-
-
-
-<h4>TextureView</h4>
-
-<p>{@link android.view.TextureView} is a new view that allows you to display a content stream, such
-as a video or an OpenGL scene. Although similar to {@link android.view.SurfaceView}, {@link
-android.view.TextureView} is unique in that it behaves like a regular view, rather than creating a
-separate window, so you can treat it like any other {@link android.view.View} object. For example,
-you can apply transforms, animate it using {@link android.view.ViewPropertyAnimator}, or
-adjust its opacity with {@link android.view.View#setAlpha setAlpha()}.</p>
-
-<p>Beware that {@link android.view.TextureView} works only within a hardware accelerated window.</p>
-
-<p>For more information, see the {@link android.view.TextureView} documentation.</p>
-
-
-<h4>Switch widget</h4>
-
-<p>The new {@link android.widget.Switch} widget is a two-state toggle that users can drag to one
-side or the other (or simply tap) to toggle an option between two states.</p>
-
-<p>You can use the {@code android:textOn} and {@code android:textOff} attributes to specify the text
-to appear on the switch when in the on and off setting. The {@code android:text} attribute also
-allows you to place a label alongside the switch.</p>
-
-<p>For a sample using switches, see the <a
-href="{@docRoot}resources/samples/ApiDemos/res/layout/switches.html">switches.xml</a> layout file
-and respective <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/Switches.html">Switches
-</a> activity.</p>
-
-
-<h4>Popup menus</h4>
-
-<p>Android 3.0 introduced {@link android.widget.PopupMenu} to create short contextual menus that pop
-up at an anchor point you specify (usually at the point of the item selected). Android 4.0 extends
-the {@link android.widget.PopupMenu} with a couple useful features:</p>
-<ul>
-<li>You can now easily inflate the contents of a popup menu from an XML <a
-href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a> with {@link
-android.widget.PopupMenu#inflate inflate()}, passing it the menu resource ID.</li>
-<li>You can also now create a {@link android.widget.PopupMenu.OnDismissListener} that receives a
-callback when the menu is dismissed.</li>
-</ul>
-
-
-<h4>Preferences</h4>
-
-<p>A new {@link android.preference.TwoStatePreference} abstract class serves as the basis for
-preferences that provide a two-state selection option. The new {@link
-android.preference.SwitchPreference} is an extension of {@link
-android.preference.TwoStatePreference} that provides a {@link android.widget.Switch} widget in the
-preference view to allow users to toggle a setting on or off without the need to open an additional
-preference screen or dialog. For example, the Settings application uses a {@link
-android.preference.SwitchPreference} for the Wi-Fi and Bluetooth settings.</p>
-
-
-
-<h4>System themes</h4>
-
-<p>The default theme for all applications that target Android 4.0 (by setting either <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> or
-<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> to
-{@code “14"} or higher) is now the
-"device default" theme: {@link android.R.style#Theme_DeviceDefault Theme.DeviceDefault}. This may be
-the dark Holo theme or a different dark theme defined by the specific device.</p>
-
-<p>The {@link android.R.style#Theme_Holo Theme.Holo} family of themes are guaranteed to not change
-from one device to another when running the same version of Android. If you explicitly
-apply any of the {@link android.R.style#Theme_Holo Theme.Holo} themes to your activities, you can
-rest assured that these themes will not change character on different devices within the same
-platform version.</p>
-
-<p>If you wish for your app to blend in with the overall device theme (such as when different OEMs
-provide different default themes for the system), you should explicitly apply themes from the {@link
-android.R.style#Theme_DeviceDefault Theme.DeviceDefault} family.</p>
-
-
-<h4>Options menu button</h4>
-
-<p>Beginning with Android 4.0, you'll notice that handsets no longer require a Menu hardware button.
-However, there's no need for you to worry about this if your existing application provides an <a
-href="{@docRoot}guide/topics/ui/menus.html#options-menu">options menu</a> and expects there to be a
-Menu button. To ensure that existing apps continue to work as they expect, the system provides an
-on-screen Menu button for apps that were designed for older versions of Android.</p>
-
-<p>For the best user experience, new and updated apps should instead use the {@link
-android.app.ActionBar} to provide access to menu items and set <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to
-{@code "14"} to take advantage of the latest framework default behaviors.</p>
-
-
-
-<h4>Controls for system UI visibility</h4>
-
-<p>Since the early days of Android, the system has managed a UI component known as the <em>status
-bar</em>, which resides at the top of handset devices to deliver information such as the carrier
-signal, time, notifications, and so on. Android 3.0 added the <em>system bar</em> for tablet
-devices, which resides at the bottom of the screen to provide system navigation controls (Home,
-Back, and so forth) and also an interface for elements traditionally provided by the status bar. In
-Android 4.0, the system provides a new type of system UI called the <em>navigation bar</em>. You
-might consider the navigation bar a re-tuned version of the system bar designed for
-handsets—it provides navigation controls
-for devices that don’t have hardware counterparts for navigating the system, but it leaves out the
-system bar's notification UI and setting controls. As such, a device that provides the navigation
-bar also has the status bar at the top.</p>
-
-<p>To this day, you can hide the status bar on handsets using the {@link
-android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN} flag. In Android 4.0, the APIs that control
-the system bar’s visibility have been updated to better reflect the behavior of both the system bar
-and navigation bar:</p>
-<ul>
-<li>The {@link android.view.View#SYSTEM_UI_FLAG_LOW_PROFILE} flag replaces the {@code
-STATUS_BAR_HIDDEN} flag. When set, this flag enables “low profile" mode for the system bar or
-navigation bar. Navigation buttons dim and other elements in the system bar also hide. Enabling
-this is useful for creating more immersive games without distraction for the system navigation
-buttons.</li>
-
-<li>The {@link android.view.View#SYSTEM_UI_FLAG_VISIBLE} flag replaces the {@code
-STATUS_BAR_VISIBLE} flag to request the system bar or navigation bar be visible.</li>
-
-<li>The {@link android.view.View#SYSTEM_UI_FLAG_HIDE_NAVIGATION} is a new flag that requests
-the navigation bar hide completely. Be aware that this works only for the <em>navigation bar</em>
-used by some handsets (it does <strong>not</strong> hide the system bar on tablets). The navigation
-bar returns to view as soon as the system receives user input. As such, this mode is useful
-primarily for video playback or other cases in which the whole screen is needed but user input is
-not required.</li>
-</ul>
-
-<p>You can set each of these flags for the system bar and navigation bar by calling {@link
-android.view.View#setSystemUiVisibility setSystemUiVisibility()} on any view in your activity. The
-window manager combines (OR-together) all flags from all views in your window and
-apply them to the system UI as long as your window has input focus. When your window loses input
-focus (the user navigates away from your app, or a dialog appears), your flags cease to have effect.
-Similarly, if you remove those views from the view hierarchy their flags no longer apply.</p>
-
-<p>To synchronize other events in your activity with visibility changes to the system UI (for
-example, hide the action bar or other UI controls when the system UI hides), you should register a
-{@link android.view.View.OnSystemUiVisibilityChangeListener} to be notified when the visibility
-of the system bar or navigation bar changes.</p>
-
-<p>See the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/OverscanActivity.html">
-OverscanActivity</a> class for a demonstration of different system UI options.</p>
-
-
-
-
-
-<h3 id="Input">Input Framework</h3>
-
-<p>Android 4.0 adds support for cursor hover events and new stylus and mouse button events.</p>
-
-<h4>Hover events</h4>
-
-<p>The {@link android.view.View} class now supports “hover" events to enable richer interactions
-through the use of pointer devices (such as a mouse or other devices that drive an on-screen
-cursor).</p>
-
-<p>To receive hover events on a view, implement the {@link android.view.View.OnHoverListener} and
-register it with {@link android.view.View#setOnHoverListener setOnHoverListener()}. When a hover
-event occurs on the view, your listener receives a call to {@link
-android.view.View.OnHoverListener#onHover onHover()}, providing the {@link android.view.View} that
-received the event and a {@link android.view.MotionEvent} that describes the type of hover event
-that occurred. The hover event can be one of the following:</p>
-<ul>
-<li>{@link android.view.MotionEvent#ACTION_HOVER_ENTER}</li>
-<li>{@link android.view.MotionEvent#ACTION_HOVER_EXIT}</li>
-<li>{@link android.view.MotionEvent#ACTION_HOVER_MOVE}</li>
-</ul>
-
-<p>Your {@link android.view.View.OnHoverListener} should return true from {@link
-android.view.View.OnHoverListener#onHover onHover()} if it handles the hover event. If your
-listener returns false, then the hover event will be dispatched to the parent view as usual.</p>
-
-<p>If your application uses buttons or other widgets that change their appearance based on the
-current state, you can now use the {@code android:state_hovered} attribute in a <a
-href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList">state list drawable</a> to
-provide a different background drawable when a cursor hovers over the view.</p>
-
-<p>For a demonstration of the new hover events, see the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/Hover.html">Hover</a> class in
-ApiDemos.</p>
-
-
-<h4>Stylus and mouse button events</h4>
-
-<p>Android now provides APIs for receiving input from a stylus input device such as a digitizer
-tablet peripheral or a stylus-enabled touch screen.</p>
-
-<p>Stylus input operates in a similar manner to touch or mouse input. When the stylus is in contact
-with the digitizer, applications receive touch events just like they would when a finger is used to
-touch the display. When the stylus is hovering above the digitizer, applications receive hover
-events just like they would when a mouse pointer was being moved across the display when no buttons
-are pressed.</p>
-
-<p>Your application can distinguish between finger, mouse, stylus and eraser input by querying the
-“tool type" associated with each pointer in a {@link android.view.MotionEvent} using {@link
-android.view.MotionEvent#getToolType getToolType()}. The currently defined tool types are: {@link
-android.view.MotionEvent#TOOL_TYPE_UNKNOWN}, {@link android.view.MotionEvent#TOOL_TYPE_FINGER},
-{@link android.view.MotionEvent#TOOL_TYPE_MOUSE}, {@link android.view.MotionEvent#TOOL_TYPE_STYLUS},
-and {@link android.view.MotionEvent#TOOL_TYPE_ERASER}. By querying the tool type, your application
-can choose to handle stylus input in different ways from finger or mouse input.</p>
-
-<p>Your application can also query which mouse or stylus buttons are pressed by querying the “button
-state" of a {@link android.view.MotionEvent} using {@link android.view.MotionEvent#getButtonState
-getButtonState()}. The currently defined button states are: {@link
-android.view.MotionEvent#BUTTON_PRIMARY}, {@link android.view.MotionEvent#BUTTON_SECONDARY}, {@link
-android.view.MotionEvent#BUTTON_TERTIARY}, {@link android.view.MotionEvent#BUTTON_BACK}, and {@link
-android.view.MotionEvent#BUTTON_FORWARD}. For convenience, the back and forward mouse buttons are
-automatically mapped to the {@link android.view.KeyEvent#KEYCODE_BACK} and {@link
-android.view.KeyEvent#KEYCODE_FORWARD} keys. Your application can handle these keys to support
-mouse button based back and forward navigation.</p>
-
-<p>In addition to precisely measuring the position and pressure of a contact, some stylus input
-devices also report the distance between the stylus tip and the digitizer, the stylus tilt angle,
-and the stylus orientation angle. Your application can query this information using {@link
-android.view.MotionEvent#getAxisValue getAxisValue()} with the axis codes {@link
-android.view.MotionEvent#AXIS_DISTANCE}, {@link android.view.MotionEvent#AXIS_TILT}, and {@link
-android.view.MotionEvent#AXIS_ORIENTATION}.</p>
-
-<p>For a demonstration of tool types, button states and the new axis codes, see the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.html">TouchPaint
-</a> class in ApiDemos.</p>
-
-
-
-
-
-
-<h3 id="Properties">Properties</h3>
-
-<p>The new {@link android.util.Property} class provides a fast, efficient, and easy way to specify a
-property on any object that allows callers to generically set/get values on target objects. It also
-allows the functionality of passing around field/method references and allows code to set/get values
-of the property without knowing the details of what the fields/methods are.</p>
-
-<p>For example, if you want to set the value of field {@code bar} on object {@code foo}, you would
-previously do this:</p>
-<pre>
-foo.bar = value;
-</pre>
-
-<p>If you want to call the setter for an underlying private field {@code bar}, you would previously
-do this:</p>
-<pre>
-foo.setBar(value);
-</pre>
-
-<p>However, if you want to pass around the {@code foo} instance and have some other code set the
-{@code bar} value, there is really no way to do it prior to Android 4.0.</p>
-
-<p>Using the {@link android.util.Property} class, you can declare a {@link android.util.Property}
-object {@code BAR} on class {@code Foo} so that you can set the field on instance {@code foo} of
-class {@code Foo} like this:</p>
-<pre>
-BAR.set(foo, value);
-</pre>
-
-<p>The {@link android.view.View} class now leverages the {@link android.util.Property} class to
-allow you to set various fields, such as transform properties that were added in Android 3.0 ({@link
-android.view.View#ROTATION}, {@link android.view.View#ROTATION_X}, {@link
-android.view.View#TRANSLATION_X}, etc.).</p>
-
-<p>The {@link android.animation.ObjectAnimator} class also uses the {@link android.util.Property}
-class, so you can create an {@link android.animation.ObjectAnimator} with a {@link
-android.util.Property}, which is faster, more efficient, and more type-safe than the string-based
-approach.</p>
-
-
-
-
-
-
-<h3 id="HwAccel">Hardware Acceleration</h3>
-
-<p>Beginning with Android 4.0, hardware acceleration for all windows is enabled by default if your
-application has set either <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> or
-<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> to
-{@code “14"} or higher. Hardware acceleration generally results in smoother animations, smoother
-scrolling, and overall better performance and response to user interaction.</p>
-
-<p>If necessary, you can manually disable hardware acceleration with the <a
-href="{@docRoot}guide/topics/manifest/activity-element.html#hwaccel">{@code hardwareAccelerated}</a>
-attribute for individual <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code
-<activity>}</a> elements or the <a
-href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
-element. You can alternatively disable hardware acceleration for individual views by calling {@link
-android.view.View#setLayerType setLayerType(LAYER_TYPE_SOFTWARE)}.</p>
-
-<p>For more information about hardware acceleration, including a list of unsupported drawing
-operations, see the <a href="{@docRoot}guide/topics/graphics/hardware-accel.html">Hardware
-Acceleration</a> document.</p>
-
-
-
-<h3 id="Jni">JNI Changes</h3>
-
-<p>In previous versions of Android, JNI local references weren’t indirect handles; Android used
-direct pointers. This wasn't a problem as long as the garbage collector didn't move objects, but it
-seemed to work because it made it possible to write buggy code. In Android 4.0, the system now uses
-indirect references in order to detect these bugs.</p>
-
-<p>The ins and outs of JNI local references are described in “Local and Global References" in <a
-href="{@docRoot}guide/practices/design/jni.html">JNI Tips</a>. In Android 4.0, <a
-href="http://android-developers.blogspot.com/2011/07/debugging-android-jni-with-checkjni.html">
-CheckJNI</a> has been enhanced to detect these errors. Watch the <a
-href="http://android-developers.blogspot.com/">Android Developers Blog</a> for an upcoming post
-about common errors with JNI references and how you can fix them.</p>
-
-<p>This change in the JNI implementation only affects apps that target Android 4.0 by setting either
-the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
-targetSdkVersion}</a> or <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
-minSdkVersion}</a> to {@code “14"} or higher. If you’ve set these attributes to any lower value,
-then JNI local references behave the same as in previous versions.</p>
-
-
-
-
-
-<h3 id="WebKit">WebKit</h3>
-<ul>
-<li>WebKit updated to version 534.30</li>
-<li>Support for Indic fonts (Devanagari, Bengali, and Tamil, including the complex character support
-needed for combining glyphs) in {@link android.webkit.WebView} and the built-in Browser</li>
-<li>Support for Ethiopic, Georgian, and Armenian fonts in {@link android.webkit.WebView} and the
-built-in Browser</li>
-<li>Support for <a
-href="http://google-opensource.blogspot.com/2009/05/introducing-webdriver.html">WebDriver</a> makes
-it easier for you to test apps that use {@link android.webkit.WebView}</li>
-</ul>
-
-
-<h4>Android Browser</h4>
-
-<p>The Browser application adds the following features to support web applications:</p>
-<ul>
-<li>Updated V8 JavaScript compiler for faster performance</li>
-<li>Plus other notable enhancements carried over from <a
-href="{@docRoot}sdk/android-3.0.html">Android
-3.0</a> are now available for handsets:
-<ul>
-<li>Support for fixed position elements on all pages</li>
-<li><a href="http://dev.w3.org/2009/dap/camera/">HTML media capture</a></li>
-<li><a href="http://dev.w3.org/geo/api/spec-source-orientation.html">Device orientation
-events</a></li>
-<li><a href="http://www.w3.org/TR/css3-3d-transforms/">CSS 3D transformations</a></li>
-</ul>
-</li>
-</ul>
-
-
-
-<h3 id="Permissions">Permissions</h3>
-
-<p>The following are new permissions:</p>
-<ul>
-<li>{@link android.Manifest.permission#ADD_VOICEMAIL}: Allows a voicemail service to add voicemail
-messages to the device.</li>
-<li>{@link android.Manifest.permission#BIND_TEXT_SERVICE}: A service that implements {@link
-android.service.textservice.SpellCheckerService} must require this permission for itself.</li>
-<li>{@link android.Manifest.permission#BIND_VPN_SERVICE}: A service that implements {@link
-android.net.VpnService} must require this permission for itself.</li>
-<li>{@link android.Manifest.permission#READ_PROFILE}: Provides read access to the {@link
-android.provider.ContactsContract.Profile} provider.</li>
-<li>{@link android.Manifest.permission#WRITE_PROFILE}: Provides write access to the {@link
-android.provider.ContactsContract.Profile} provider.</li>
-</ul>
-
-
-
-<h3 id="DeviceFeatures">Device Features</h3>
-
-<p>The following are new device features:</p>
-<ul>
-<li>{@link android.content.pm.PackageManager#FEATURE_WIFI_DIRECT}: Declares that the application
-uses
-Wi-Fi for peer-to-peer communications.</li>
-</ul>
-
-
-<div class="special" style="margin-top:3em">
-<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API Level
-{@sdkPlatformApiLevel}), see the <a
-href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API Differences Report</a>.</p>
-</div>
-
-
-<h2 id="Honeycomb">Previous APIs</h2>
-
-<p>In addition to everything above, Android 4.0 naturally supports all APIs from previous releases.
-Because the Android 3.x platform is available only for large-screen devices, if you've
-been developing primarily for handsets, then you might not be aware of all the APIs added to Android
-in these recent releases.</p>
-
-<p>Here's a look at some of the most notable APIs you might have missed that are now available
-on handsets as well:</p>
-
-<dl>
- <dt><a href="android-3.0.html">Android 3.0</a></dt>
- <dd>
- <ul>
- <li>{@link android.app.Fragment}: A framework component that allows you to separate distinct
-elements of an activity into self-contained modules that define their own UI and lifecycle. See the
-<a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a> developer guide.</li>
- <li>{@link android.app.ActionBar}: A replacement for the traditional title bar at the top of
-the activity window. It includes the application logo in the left corner and provides a new
-interface for menu items. See the
-<a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide.</li>
- <li>{@link android.content.Loader}: A framework component that facilitates asynchronous
-loading of data in combination with UI components to dynamically load data without blocking the
-main thread. See the
-<a href="{@docRoot}guide/topics/fundamentals/loaders.html">Loaders</a> developer guide.</li>
- <li>System clipboard: Applications can copy and paste data (beyond mere text) to and from
-the system-wide clipboard. Clipped data can be plain text, a URI, or an intent. See the
-<a href="{@docRoot}guide/topics/clipboard/copy-paste.html">Copy and Paste</a> developer guide.</li>
- <li>Drag and drop: A set of APIs built into the view framework that facilitates drag and drop
-operations. See the
-<a href="{@docRoot}guide/topics/ui/drag-drop.html">Drag and Drop</a> developer guide.</li>
- <li>An all new flexible animation framework allows you to animate arbitrary properties of any
-object (View, Drawable, Fragment, Object, or anything else) and define animation aspects such
-as duration, interpolation, repeat and more. The new framework makes Animations in Android
-simpler than ever. See the
-<a href="{@docRoot}guide/topics/graphics/prop-animation.html">Property Animation</a> developer
-guide.</li>
- <li>RenderScript graphics and compute engine: RenderScript offers a high performance 3D
-graphics rendering and compute API at the native level, which you write in the C (C99 standard),
-providing the type of performance you expect from a native environment while remaining portable
-across various CPUs and GPUs. See the
-<a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> developer
-guide.</li>
- <li>Hardware accelerated 2D graphics: You can now enable the OpenGL renderer for your
-application by setting {android:hardwareAccelerated="true"} in your manifest element's <a
-href="{@docRoot}guide/topics/manifest/application-element.html"><code><application></code></a>
-element or for individual <a
-href="{@docRoot}guide/topics/manifest/activity-element.html"><code><activity></code></a>
-elements. This results
-in smoother animations, smoother scrolling, and overall better performance and response to user
-interaction.
- <p class="note"><strong>Note:</strong> If you set your application's <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> or <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to
-{@code "14"} or higher, hardware acceleration is enabled by default.</p></li>
- <li>And much, much more. See the <a href="android-3.0.html">Android 3.0 Platform</a>
-notes for more information.</li>
- </ul>
- </dd>
-
- <dt><a href="android-3.1.html">Android 3.1</a></dt>
- <dd>
- <ul>
- <li>USB APIs: Powerful new APIs for integrating connected peripherals with
-Android applications. The APIs are based on a USB stack and services that are
-built into the platform, including support for both USB host and device interactions. See the <a
-href="{@docRoot}guide/topics/usb/index.html">USB Host and Accessory</a> developer guide.</li>
- <li>MTP/PTP APIs: Applications can interact directly with connected cameras and other PTP
-devices to receive notifications when devices are attached and removed, manage files and storage on
-those devices, and transfer files and metadata to and from them. The MTP API implements the PTP
-(Picture Transfer Protocol) subset of the MTP (Media Transfer Protocol) specification. See the
-{@link android.mtp} documentation.</li>
- <li>RTP APIs: Android exposes an API to its built-in RTP (Real-time Transport Protocol) stack,
-which applications can use to manage on-demand or interactive data streaming. In particular, apps
-that provide VOIP, push-to-talk, conferencing, and audio streaming can use the API to initiate
-sessions and transmit or receive data streams over any available network. See the {@link
-android.net.rtp} documentation.</li>
- <li>Support for joysticks and other generic motion inputs.</li>
- <li>See the <a href="android-3.1.html">Android 3.1 Platform</a>
-notes for many more new APIs.</li>
- </ul>
- </dd>
-
- <dt><a href="android-3.2.html">Android 3.2</a></dt>
- <dd>
- <ul>
- <li>New screens support APIs that give you more control over how your applications are
-displayed across different screen sizes. The API extends the existing screen support model with the
-ability to precisely target specific screen size ranges by dimensions, measured in
-density-independent pixel units (such as 600dp or 720dp wide), rather than by their generalized
-screen sizes (such as large or xlarge). For example, this is important in order to help you
-distinguish between a 5" device and a 7" device, which would both traditionally be bucketed as
-"large" screens. See the blog post, <a
-href="http://android-developers.blogspot.com/2011/07/new-tools-for-managing-screen-sizes.html">
-New Tools for Managing Screen Sizes</a>.</li>
- <li>New constants for <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> to
-declare landscape or portrait screen orientation requirements.</li>
- <li>The device "screen size" configuration now changes during a screen orientation
-change. If your app targets API level 13 or higher, you must handle the {@code "screenSize"}
-configuration change if you also want to handle the {@code "orientation"} configuration change. See
-<a href="{@docRoot}guide/topics/manifest/activity-element.html#config">{@code
-android:configChanges}</a> for more information.</li>
- <li>See the <a href="android-3.2.html">Android 3.2 Platform</a>
-notes for other new APIs.</li>
- </ul>
- </dd>
-
-</dl>
-
-
-
-
-<h2 id="api-level">API Level</h2>
-
-<p>The Android {@sdkPlatformVersion} API is assigned an integer
-identifier—<strong>{@sdkPlatformApiLevel}</strong>—that is stored in the system itself.
-This identifier, called the "API level", allows the system to correctly determine whether an
-application is compatible with the system, prior to installing the application. </p>
-
-<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, you need compile the
-application against an Android platform that supports API level {@sdkPlatformApiLevel} or
-higher. Depending on your needs, you might also need to add an
-<code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code> attribute to the
-<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a>
-element.</p>
-
-<p>For more information, see the <a href="{@docRoot}guide/appendix/api-levels.html">API Levels</a>
-document. </p>
-
-
-<h2 id="apps">Built-in Applications</h2>
-
-<p>The system image included in the downloadable platform provides these
-built-in applications:</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>API Demos</li>
-<li>Browser</li>
-<li>Calculator</li>
-<li>Calendar</li>
-<li>Camera</li>
-<li>Clock</li>
-<li>Custom Locale</li>
-<li>Dev Tools</li>
-<li>Downloads</li>
-<li>Email</li>
-<li>Gallery</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<ul>
-<li>Gestures Builder</li>
-<li>Messaging</li>
-<li>Music</li>
-<li>People</li>
-<li>Phone</li>
-<li>Search</li>
-<li>Settings</li>
-<li>Speech Recorder</li>
-<li>Widget Preview</li>
-</ul>
-</td>
-</tr>
-</table>
-
-
-<h2 id="locs" style="margin-top:.75em;">Locales</h2>
-
-<p>The system image included in the downloadable SDK platform provides a variety of built-in
-locales. In some cases, region-specific strings are available for the locales. In other cases, a
-default version of the language is used. The languages that are available in the Android 3.0 system
-image are listed below (with <em>language</em>_<em>country/region</em> locale descriptor).</p>
-
-<table style="border:0;padding-bottom:0;margin-bottom:0;">
-<tr>
-<td style="border:0;padding-bottom:0;margin-bottom:0;">
-<ul>
-<li>Arabic, Egypt (ar_EG)</li>
-<li>Arabic, Israel (ar_IL)</li>
-<li>Bulgarian, Bulgaria (bg_BG)</li>
-<li>Catalan, Spain (ca_ES)</li>
-<li>Czech, Czech Republic (cs_CZ)</li>
-<li>Danish, Denmark(da_DK)</li>
-<li>German, Austria (de_AT)</li>
-<li>German, Switzerland (de_CH)</li>
-<li>German, Germany (de_DE)</li>
-<li>German, Liechtenstein (de_LI)</li>
-<li>Greek, Greece (el_GR)</li>
-<li>English, Australia (en_AU)</li>
-<li>English, Canada (en_CA)</li>
-<li>English, Britain (en_GB)</li>
-<li>English, Ireland (en_IE)</li>
-<li>English, India (en_IN)</li>
-<li>English, New Zealand (en_NZ)</li>
-<li>English, Singapore(en_SG)</li>
-<li>English, US (en_US)</li>
-<li>English, South Africa (en_ZA)</li>
-<li>Spanish (es_ES)</li>
-<li>Spanish, US (es_US)</li>
-<li>Finnish, Finland (fi_FI)</li>
-<li>French, Belgium (fr_BE)</li>
-<li>French, Canada (fr_CA)</li>
-<li>French, Switzerland (fr_CH)</li>
-<li>French, France (fr_FR)</li>
-<li>Hebrew, Israel (he_IL)</li>
-<li>Hindi, India (hi_IN)</li>
-</ul>
-</td>
-<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
-<li>Croatian, Croatia (hr_HR)</li>
-<li>Hungarian, Hungary (hu_HU)</li>
-<li>Indonesian, Indonesia (id_ID)</li>
-<li>Italian, Switzerland (it_CH)</li>
-<li>Italian, Italy (it_IT)</li>
-<li>Japanese (ja_JP)</li>
-<li>Korean (ko_KR)</li>
-<li>Lithuanian, Lithuania (lt_LT)</li>
-<li>Latvian, Latvia (lv_LV)</li>
-<li>Norwegian bokmål, Norway (nb_NO)</li>
-<li>Dutch, Belgium (nl_BE)</li>
-<li>Dutch, Netherlands (nl_NL)</li>
-<li>Polish (pl_PL)</li>
-<li>Portuguese, Brazil (pt_BR)</li>
-<li>Portuguese, Portugal (pt_PT)</li>
-<li>Romanian, Romania (ro_RO)</li>
-<li>Russian (ru_RU)</li></li>
-<li>Slovak, Slovakia (sk_SK)</li>
-<li>Slovenian, Slovenia (sl_SI)</li>
-<li>Serbian (sr_RS)</li>
-<li>Swedish, Sweden (sv_SE)</li>
-<li>Thai, Thailand (th_TH)</li>
-<li>Tagalog, Philippines (tl_PH)</li>
-<li>Turkish, Turkey (tr_TR)</li>
-<li>Ukrainian, Ukraine (uk_UA)</li>
-<li>Vietnamese, Vietnam (vi_VN)</li>
-<li>Chinese, PRC (zh_CN)</li>
-<li>Chinese, Taiwan (zh_TW)</li>
-</td>
-</tr>
-</table>
-
-<p class="note"><strong>Note:</strong> The Android platform may support more
-locales than are included in the SDK system image. All of the supported locales
-are available in the <a href="http://source.android.com/">Android Open Source
-Project</a>.</p>
-
-<h2 id="skins">Emulator Skins</h2>
-
-<p>The downloadable platform includes the following emulator skins:</p>
-
-<ul>
- <li>
- QVGA (240x320, low density, small screen)
- </li>
- <li>
- WQVGA400 (240x400, low density, normal screen)
- </li>
- <li>
- WQVGA432 (240x432, low density, normal screen)
- </li>
- <li>
- HVGA (320x480, medium density, normal screen)
- </li>
- <li>
- WVGA800 (480x800, high density, normal screen)
- </li>
- <li>
- WVGA854 (480x854 high density, normal screen)
- </li>
- <li>
- WXGA720 (1280x720, extra-high density, normal screen) <span class="new">new</span>
- </li>
- <li>
- WSVGA (1024x600, medium density, large screen) <span class="new">new</span>
- </li>
- <li>
- WXGA (1280x800, medium density, xlarge screen)
- </li>
-</ul>
-
-<p>To test your application on an emulator that represents the latest Android device, you can create
-an AVD with the new WXGA720 skin (it's an xhdpi, normal screen device). Note that the emulator
-currently doesn't support the new on-screen navigation bar for devices without hardware navigation
-buttons, so when using this skin, you must use keyboard keys <em>Home</em> for the Home button,
-<em>ESC</em> for the Back button, and <em>F2</em> or <em>Page-up</em> for the Menu button.</p>
-
-<p>However, due to performance issues in the emulator when running high-resolution screens such as
-the one for the WXGA720 skin, we recommend that you primarily use the traditional WVGA800 skin
-(hdpi, normal screen) to test your application.</p>
-
diff --git a/docs/html/sdk/api_diff/10/changes/changes-summary.html b/docs/html/sdk/api_diff/10/changes/changes-summary.html
index dbb2881..ff0e479 100644
--- a/docs/html/sdk/api_diff/10/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/10/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/11/changes/changes-summary.html b/docs/html/sdk/api_diff/11/changes/changes-summary.html
index b6af9ae..18e9f5d 100644
--- a/docs/html/sdk/api_diff/11/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/11/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/12/changes/changes-summary.html b/docs/html/sdk/api_diff/12/changes/changes-summary.html
index 2a630c2..e069d3d 100644
--- a/docs/html/sdk/api_diff/12/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/12/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/13/changes/changes-summary.html b/docs/html/sdk/api_diff/13/changes/changes-summary.html
index 082fcfb..3b1c55a 100644
--- a/docs/html/sdk/api_diff/13/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/13/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/14/changes/changes-summary.html b/docs/html/sdk/api_diff/14/changes/changes-summary.html
index ccb5d26..0cec877 100644
--- a/docs/html/sdk/api_diff/14/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/14/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/15/changes/changes-summary.html b/docs/html/sdk/api_diff/15/changes/changes-summary.html
index 0acb973..7f00168 100644
--- a/docs/html/sdk/api_diff/15/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/15/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/3/changes/changes-summary.html b/docs/html/sdk/api_diff/3/changes/changes-summary.html
index 65a37f8..4c0012a 100644
--- a/docs/html/sdk/api_diff/3/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/3/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/4/changes/changes-summary.html b/docs/html/sdk/api_diff/4/changes/changes-summary.html
index 88b8be6..bbed016 100644
--- a/docs/html/sdk/api_diff/4/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/4/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/5/changes/changes-summary.html b/docs/html/sdk/api_diff/5/changes/changes-summary.html
index 3a06d98..1f10f25 100644
--- a/docs/html/sdk/api_diff/5/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/5/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/6/changes/changes-summary.html b/docs/html/sdk/api_diff/6/changes/changes-summary.html
index 77ceb25..a1c3985 100644
--- a/docs/html/sdk/api_diff/6/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/6/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/7/changes/changes-summary.html b/docs/html/sdk/api_diff/7/changes/changes-summary.html
index 330f727..34d4d25 100644
--- a/docs/html/sdk/api_diff/7/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/7/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/8/changes/changes-summary.html b/docs/html/sdk/api_diff/8/changes/changes-summary.html
index f5fa7e6..5041182 100644
--- a/docs/html/sdk/api_diff/8/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/8/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/api_diff/9/changes/changes-summary.html b/docs/html/sdk/api_diff/9/changes/changes-summary.html
index f81cea1..4bccfe5 100644
--- a/docs/html/sdk/api_diff/9/changes/changes-summary.html
+++ b/docs/html/sdk/api_diff/9/changes/changes-summary.html
@@ -73,7 +73,7 @@
<div id="docTitleContainer">
<h1>Android API Differences Report</h1>
<p>This report details the changes in the core Android framework API between two <a
-href="http://developer.android.com/guide/appendix/api-levels.html" target="_top">API Level</a>
+href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" target="_top">API Level</a>
specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields.
The report also includes general statistics that characterize the extent and type of the differences.</p>
<p>This report is based a comparison of the Android API specifications
diff --git a/docs/html/sdk/compatibility-library.jd b/docs/html/sdk/compatibility-library.jd
deleted file mode 100644
index f81e8ae..0000000
--- a/docs/html/sdk/compatibility-library.jd
+++ /dev/null
@@ -1,484 +0,0 @@
-page.title=Support Package
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#Notes">Revisions</a></li>
- <li><a href="#Downloading">Downloading the Support Package</a></li>
- <li><a href="#SettingUp">Setting Up a Project to Use a Library</a></li>
- <li><a href="#Using">Using the v4 Library APIs</a></li>
- <li><a href="#Docs">Reference Docs</a></li>
- <li><a href="#Samples">Samples</a></li>
-</ol>
-
-<h2>See also</h2>
-<ol>
- <li><a
-href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing Apps for Android 3.0</a></li>
- <li><a href="http://code.google.com/p/iosched/">Google I/O App source code</a></li>
-</ol>
-
-</div>
-</div>
-
-<p><em>Minimum API level supported:</em> <b>4</b></p>
-
-<p>The Support Package includes static "support libraries" that you can add to your Android
-application in order to use APIs that are either not available for older platform versions or that
-offer "utility" APIs that aren't a part of the framework APIs. The goal is to simplify your
-development by offering more APIs that you can bundle with your application so you can
-worry less about platform versions.</p>
-
-<p class="note"><strong>Note:</strong> The Support Package includes more than one support
-library. Each one has a different <em>minimum API level</em>. For example, one library requires API
-level 4 or higher, while another requires API level 13 or higher (v13 is a superset of v4 and
-includes additional
-support classes to work with v13 APIs). The minimum version is indicated
-by the directory name, such as {@code v4/} and {@code v13/}.</p>
-
-
-<h2 id="Notes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the Support Package, as denoted by revision number.</p>
-
-<div class="toggle-content open">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" />
- Support Package, revision 7 (March 2012)
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em">
- <dl>
- <dt>Changes for v4 support library:</dt>
- <dd>
- <ul>
- <li>Added {@link android.support.v4.app.ShareCompat}, which provides helper classes
-for sending and receiving content for social sharing applications, including new metadata for
-attributing shared data to the source app. This class also provides compatible integration with the
-new {@link android.widget.ShareActionProvider} in Android 4.0.</li>
- <li>Added {@link android.support.v4.app.NavUtils} and {@link
-android.support.v4.app.TaskStackBuilder} to provide support for implementing the
-<a href="{@docRoot}design/index.html">Android Design</a> guidelines for navigation. These
-additions include a way to implement the action bar's <em>Up</em> button across versions.
-For an example implementation of this pattern, see the AppNavigation sample in
-({@code <em><sdk></em>/samples/<em><platform></em>/AppNavigation}).</li>
- <li>Added {@link android.support.v4.app.NotificationCompat.Builder} to provide a
-compatibility implementation of Android 3.0's {@link android.app.Notification.Builder} helper class
-for creating standardized system notifications.</li>
- </ul>
- </dd>
- </dl>
- </div>
-
-<div class="toggle-content closed">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
- Support Package, revision 6 (December 2011)
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em">
- <p class="note"><strong>Note:</strong> Reference for support library APIs are now available with
- the framework references, for example: {@link android.support.v4.app}.</p>
-<dl>
- <dt>Changes for v4 support library:</dt>
- <dd>
- <ul>
- <li>Changes to ViewPager:
- <ul>
- <li>Added extra decorative view support for {@link android.support.v4.view.ViewPager}.
- Decorative views may be supplied as child views of a pager in XML layout.</li>
- <li>Added {@link android.support.v4.view.PagerAdapter#getPageTitle
- PagerAdapter.getPageTitle()} to supply title strings for pages, which defaults to no
- title for each page.</li>
- <li>Added {@link android.support.v4.view.PagerTitleStrip}, a non-interactive title
- strip, that can be added as a child of ViewPager. Developers can supply text
- appearance and color, as well as layout sizing and gravity information.</li>
- <li>Updated {@link android.support.v4.view.PagerAdapter} methods to take ViewGroup
- objects, rather than View to avoid class casting in adapter implementations.</li>
- <li>Updated {@link android.support.v4.view.ViewPager} to use Launcher-style
- fling behavior.</li>
- <li>Bug fixes for user interface interaction and test automation.</li>
- </ul>
- </li>
-
- <li>Support for Fragments:
- <ul>
- <li>Changed {@code setStartDeferred()} method to {@link
- android.support.v4.app.Fragment#setUserVisibleHint}.</li>
- <li>Added deferred start for off-screen pages to improve performance.</li>
- </ul>
- </li>
-
- <li>Support for Accessiblity APIs:
- <ul>
- <li>Updated {@link android.support.v4.view.AccessibilityDelegateCompat} methods
- to return empty lists instead of null.</li>
- <li>Added new APIs needed by the v4 samples.</li>
- </ul>
- </li>
-
- </ul>
- </dd>
- </dl>
- </div>
-
-<div class="toggle-content closed">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
- Support Package, revision 5 (December 2011)
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em">
- <dl>
- <dt>Changes for v4 support library:</dt>
- <dd>
- <ul>
- <li>Support for Accessiblity APIs:
- <ul>
- <li>Added {@link android.support.v4.view.AccessibilityDelegateCompat}
- to support {@link android.view.View.AccessibilityDelegate}.</li>
-
- <li>Added {@link android.support.v4.view.accessibility.AccessibilityEventCompat}
- to support {@link android.view.accessibility.AccessibilityEvent}.</li>
-
- <li>Added {@link android.support.v4.view.accessibility.AccessibilityManagerCompat}
- to support {@link android.view.accessibility.AccessibilityManager}.</li>
-
- <li>Added {@link android.support.v4.view.accessibility.AccessibilityNodeInfoCompat}
- to support {@link android.view.accessibility.AccessibilityNodeInfo}.</li>
-
- <li>Added {@link android.support.v4.view.accessibility.AccessibilityRecordCompat}
- to support {@link android.view.accessibility.AccessibilityRecord}.</li>
-
- <li>Added {@link
- android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat}
- to support {@link android.accessibilityservice.AccessibilityServiceInfo}.</li>
-
- <li>Added {@link android.support.v4.view.ViewGroupCompat}
- to support accessibility features in {@link android.view.ViewGroup}.
- </li>
-
- <li>Modified {@link android.support.v4.view.ViewCompat}
- to support accessibility features in {@link android.view.View}.</li>
- </ul>
- </li>
-
- <li>Changes to ViewPager:
- <ul>
- <li>Added support for margins between pages.
- An optional {@link android.graphics.drawable.Drawable} can be provided
- to fill the margins.</li>
- <li>Added support for {@link android.widget.EdgeEffect}.</li>
- <li>Added support for keyboard navigation</li>
- <li>Added support to control how many pages are kept to either side
- of the current page.</li>
- <li>Improved touch physics.</li>
- <li>Bug fixes for user interface behavior.</li>
- </ul>
- </li>
- </ul>
- </dd>
- </dl>
- </div>
-
-<div class="toggle-content closed">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
- Support Package, revision 4 (October 2011)
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em">
- <dl>
- <dt>Changes for v4 support library:</dt>
- <dd>
- <ul>
- <li>Added <code>EdgeEffectCompat</code> to
- support {@link android.widget.EdgeEffect}.</li>
-
- <li>Added <code>LocalBroadcastManager</code> to allow applications to easily
- register for and receive intents within a single application without
- broadcasting them globally.</li>
-
- <li>Added support in <code>ViewCompat</code> to check for and set overscroll
- modes for {@link android.view.View}s on Android 2.3 and later.</li>
- <li>Changes to Fragment APIs:
- <ul>
- <li>Added new APIs to control the visibility of new menus.</li>
- <li>Added custom animation APIs.</li>
- <li>Added APIs in <code>FragmentActivity</code> to retain custom,
- non-configuration instance data.</li>
- <li>Various bug fixes.</li>
- </ul>
- </li>
-
- <li>Fixed a {@link android.content.Loader} bug that caused issues in
- canceling {@link android.os.AsyncTask}s when running on Froyo and older
- versions of the platform. The support
- code now uses its own version of {@link android.os.AsyncTask} to keep the same
- behavior on all platform versions.</li>
-
- </ul>
- </dd>
- </dl>
- </div>
-
-
-
-</div>
-
-
-<div class="toggle-content closed">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
- Compatibility Package, revision 3 (July 2011)
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em">
- <dl>
- <dt>Changes for v4 support library:</dt>
- <dd>
- <ul>
- <li>Adds support for {@link android.app.Fragment.SavedState}</li>
- <li>Adds {@code MotionEventCompat} to support newer {@link
-android.view.MotionEvent} APIs</li>
- <li>Adds {@code VelocityTrackerCompat} to support a newer {@link
-android.view.VelocityTracker} APIs</li>
- <li>Adds {@code ViewConfigurationCompat} to support a newer {@link
-android.view.ViewConfiguration} APIs</li>
- <li>All new APIs (available only in the support library) that allow you to create UIs
-with horizontal paging, allowing users to swipe left and right between content views. Classes to
-support this include:
- <ul>
- <li>{@code ViewPager}: A {@link android.view.ViewGroup} that manages the
-layout for the child views, which the user can swipe between.</li>
- <li>{@code PagerAdapter}: An adapter that populates the {@code ViewPager} with the
-views that represent each page.</li>
- <li>{@code FragmentPagerAdapter}: An extension of {@code PagerAdapter} for flipping
-between fragments.</li>
- <li>{@code FragmentStatePagerAdapter}: An extension of {@code PagerAdapter} for
-flipping between fragments that uses the library's support for {@link
-android.app.Fragment.SavedState}.</li>
- </ul>
- </li>
- </ul>
- </dd>
- <dt>New v13 support library:</dt>
- <dd>
- <ul>
- <li>Includes the {@code FragmentPagerAdapter} and {@code FragmentStatePagerAdapter}
-to support the horizontal paging.
- <p>These are exactly the same as the APIs added to the v4 support library, but rely on
-other platform components in Android 3.2. Use this library instead of v4 if you're developing for
-Android 3.2 and higher (all other APIs in the v4 library are already available with API level
-13).</p>
- </li>
- </ul>
- </dd>
- </dl>
- </div>
-
-</div>
-
-
-<div class="toggle-content closed">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
- Compatibility Package, revision 2 (May 2011)
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em">
- <dl>
- <dt>Changes for v4 library:</dt>
- <dd>
- <ul>
- <li>Support for fragment animations</li>
- <li>Fix {@code android.support.v4.app.Fragment#onActivityResult Fragment.onActivityResult()}
- bug</li>
- </ul>
- </dd>
- </dl>
- </div>
-
-</div>
-
-
-<div class="toggle-content closed">
-
- <p><a href="#" onclick="return toggleContent(this)">
- <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
- Compatibility Package, revision 1 (March 2011)
- </a></p>
-
- <div class="toggle-content-toggleme" style="padding-left:2em">
- <p>Initial release with the v4 library.</p>
- </div>
-
-</div>
-
-
-
-<h2 id="Downloading">Downloading the Support Package</h2>
-
-<p>The Support Package is provided as a downloadable package from the Android SDK
-Manager. To install:</p>
-
-<ol>
- <li>Launch the Android SDK Manager.
- <p>From Eclipse, you can select <strong>Window</strong>
-> <strong>Android SDK Manager</strong>. Or, launch {@code SDK Manager.exe} from
-the {@code <sdk>/} directory (on Windows only) or {@code android} from the {@code
-<sdk>/tools/} directory.</p></li>
- <li>Expand the Android Repository, check <strong>Android Support package</strong>
-and click <strong>Install selected</strong>.</li>
- <li>Proceed to install the package.</li>
-</ol>
-
-<p>When done, all files (including source code, samples, and the {@code .jar} files) are saved
-into the <code><sdk>/extras/android/support/</code> directory. This directory contains
-each of the different support libraries, such as the library for API level 4 and up and the library
-for API level 13 and up, each named with the respective version (such as {@code v4/}).</p>
-
-
-<h2 id="SettingUp">Setting Up a Project to Use a Library</h2>
-
-<p>To add one of the libraries to your Android project:</p>
-<ol>
- <li>In your Android project, create a directory named {@code libs} at the root of your
-project (next to {@code src/}, {@code res/}, etc.)</li>
- <li>Locate the JAR file for the library you want to use and copy it into the {@code
-libs/} directory.
- <p>For example, the library that supports API level 4 and up is located at {@code
-<sdk>/extras/android/support/v4/android-support-v4.jar}.</p>
- </li>
- <li>Add the JAR to your project build path.
- <p>In Eclipse, right-click the JAR file in the Package Explorer, select <strong>Build
-Path</strong> > <strong>Add to Build Path</strong>.</p>
- </li>
-</ol>
-
-<p>Your application is now ready to use the library APIs. All the
-provided APIs are available in the {@code android.support} package (for
-example, {@code android.support.v4}).</p>
-
-<p class="note"><strong>Tip:</strong> To see the library APIs in action, take a look at the sample
-apps in {@code <sdk>/extras/android/support/<version>/samples/}.</p>
-
-<p class="warning"><strong>Warning:</strong> Be certain that you not confuse the standard
-{@code android} packages with those in {@code android.support} library. Some code completion tools
-might
-get this wrong, especially if you're building against recent versions of the platform. To be safe,
-keep your build target set to the same version as you have defined for your <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code android:minSdkVersion}</a>
-and double check the import statements for classes that also exist in the support library, such as
-{@code SimpleCursorAdapter}.</p>
-
-
-<h2 id="Using">Using the v4 Library APIs</h2>
-
-<p>The support library for v4 provides access to several classes introduced with Android 3.0 and
-beyond, plus some updated version of existing classes, and even some APIs that currently don't
-exist in the Android platform. Some of the most useful and notable classes that have
-counterparts in the v4 support library are:</p>
-
-<ul>
- <li>{@link android.app.Fragment}</li>
- <li>{@link android.app.FragmentManager}</li>
- <li>{@link android.app.FragmentTransaction}</li>
- <li>{@link android.app.ListFragment}</li>
- <li>{@link android.app.DialogFragment}</li>
- <li>{@link android.app.LoaderManager}</li>
- <li>{@link android.content.Loader}</li>
- <li>{@link android.content.AsyncTaskLoader}</li>
- <li>{@link android.content.CursorLoader}</li>
-</ul>
-
-<p>For each of the classes above (and others not listed), the APIs work almost exactly the same
-as the counterparts in the latest Android platform. Thus, you can usually refer to
-the online documentation for information about the supported APIs. There are some
-differences, however. Most notably:</p>
-
-<ul>
- <li>When creating an activity to use fragments, you must declare your activity to extend the
-{@link android.support.v4.app.FragmentActivity} class (instead of the traditional
-{@link android.app.Activity} class).</li>
- <li>To manage your fragments and loaders, you must use the methods
- {@link android.support.v4.app.FragmentActivity#getSupportFragmentManager
- FragmentActivity.getSupportFragmentManager()} and
- {@link android.support.v4.app.FragmentActivity#getSupportLoaderManager
- FragmentActivity.getSupportLoaderManager()} (instead of the
- {@link android.app.Activity#getFragmentManager()} and
- {@link android.app.Activity#getLoaderManager()} methods).</li>
- <li>The {@link android.app.ActionBar} is <strong>not supported</strong> by the library.
-However, when creating your <a href="{@docRoot}guide/topics/ui/menus.html#options-menu">Options
-Menu</a>, you can declare which items should be added to the Action Bar when it's available (on
-Android 3.0 or later). You can do so with the
-{@link android.support.v4.view.MenuCompat#setShowAsAction MenuCompat.setShowAsAction()} method, for
-example:
-<pre>
-public boolean onCreateOptionsMenu(Menu menu) {
- MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.options, menu);
- MenuCompat.setShowAsAction(menu.findItem(R.id.action_search), 1);
- return true;
-}
-</pre>
-<p>Also see the <a href="{@docRoot}resources/samples/ActionBarCompat/index.html">Action Bar
-Compatibility</a> sample for a demonstration of how to use {@link android.app.ActionBar} on Android
-3.0+ and also support action bar functionality on older versions.</p>
-</li>
-</ul>
-
-<div class="note"><p><strong>Tip:</strong> To enable the Holographic theme on devices
-running Android 3.0 or higher, declare in your manifest file that your application targets
-API level 11, for example:</p>
-<pre>
-<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" />
-</pre>
-<p>This way, your application automatically receives the Holographic theme and the Action Bar for
-each activity when running on Android 3.0 and higher.</p>
-</div>
-
-<p>For more information about how you can optimize your application for the latest
-Android-powered devices, read <a href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing
-Apps for Android 3.0</a>.</p>
-
-
-<h2 id="Docs">Reference Docs</h2>
-
-<p>The reference documentation for the Support Packages is included as part of the Android
-online developer documentation:</p>
-
-<ul>
- <li><a href="{@docRoot}reference/android/support/v4/app/package-summary.html">Support Package
- API 4 Reference</a></li>
- <li><a href="{@docRoot}reference/android/support/v13/app/package-summary.html">Support Package
- API 13 Reference</a></li>
-</ul>
-
-
-<h2 id="Samples">Samples</h2>
-
-<p>If you want to see some code that uses the support libraries, samples are included with the
-Support Package, inside each support library directory, for example; {@code
-<sdk>/extras/android/support/v4/samples/}. You can also view these samples as part of the
-Android online developer documentation:</p>
-
-<ul>
- <li><a href="{@docRoot}resources/samples/Support4Demos/index.html">Support API 4 Demos</a></li>
- <li><a href="{@docRoot}resources/samples/Support13Demos/index.html">Support API 13 Demos</a></li>
-</ul>
-
-<p>Additionally, the <a href="http://code.google.com/p/iosched/">Google I/O App</a> is a complete
-application that uses the v4 support library to provide a single APK for both handsets and tablets
-and also demonstrates some of Android's best practices in Android UI design.</p>
diff --git a/docs/html/sdk/eclipse-adt.jd b/docs/html/sdk/eclipse-adt.jd
deleted file mode 100644
index e117118..0000000
--- a/docs/html/sdk/eclipse-adt.jd
+++ /dev/null
@@ -1,1413 +0,0 @@
-page.title=ADT Plugin for Eclipse
-adt.zip.version=18.0.0
-adt.zip.download=ADT-18.0.0.zip
-adt.zip.bytes=12834793
-adt.zip.checksum=b446fa157ed97af79d1e21629201efbb
-
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#notes">Revisions</a></li>
- <li><a href="#installing">Installing the ADT Plugin</a>
- <ol>
- <li><a href="#preparing">Preparing for Installation</a></li>
- <li><a href="#downloading">Downloading the ADT Plugin</a>
- <li><a href="#configuring">Configuring the ADT Plugin</a></li>
- <li><a href="#troubleshooting">Troubleshooting</a></li>
- </ol>
- </li>
- <li><a href="#updating">Updating the ADT Plugin</a></li>
- </ol>
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/developing/tools/adt.html">Android Developer Tools</a></li>
- </ol>
-
-</div>
-</div>
-
-<p>Android Development Tools (ADT) is a plugin for the Eclipse IDE
-that is designed to give you a powerful, integrated environment in which
-to build Android applications.</p>
-
-<p>ADT extends the capabilities of Eclipse to let you quickly set up new Android
-projects, create an application UI, add packages based on the Android
-Framework API, debug your applications using the Android SDK tools, and even
-export signed (or unsigned) {@code .apk} files in order to distribute your application.</p>
-
-<p>Developing in Eclipse with ADT is highly recommended and is the fastest way
-to get started. With the guided project setup it provides, as well as tools
-integration, custom XML editors, and debug output pane, ADT gives you an
-incredible boost in developing Android applications. </p>
-
-<p>This document provides step-by-step instructions on how to download the ADT
-plugin and install it into your Eclipse development environment. Note that
-before you can install or use ADT, you must have compatible versions of both the
-Eclipse IDE and the Android SDK installed. For details, make sure to read <a
-href="#installing">Installing the ADT Plugin</a>, below. </p>
-
-<p>If you are already using ADT, this document also provides instructions on
-how to update ADT to the latest version or how to uninstall it, if necessary.
-</p>
-
-<p>For information about the features provided by the ADT plugin, such as code
-editor features, SDK tool integration, and the graphical layout editor (for drag-and-drop layout
-editing), see the <a href="{@docRoot}guide/developing/tools/adt.html">Android Developer Tools</a>
-document.</p>
-
-
-<h2 id="notes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the ADT Plugin, as denoted by revision number. </p>
-
-<p>For a summary of all known issues in ADT, see <a
-href="http://tools.android.com/knownissues">http://tools.android.com/knownissues</a>.</p>
-
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
-padding: .25em 1em;
-}
-.toggleme {
- padding: 1em 1em 0 2em;
- line-height:1em;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleme a {
- text-decoration:underline;
-}
-.toggleable.closed .toggleme {
- display:none;
-}
-#jd-content .toggle-img {
- margin:0;
-}
-</style>
-
-
-<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" />
-ADT 18.0.0</a> <em>(April 2012)</em>
- <div class="toggleme">
-<dl>
- <dt>Dependencies:</dt>
-
- <dd>
- <ul>
- <li>Java 1.6 or higher is required for ADT 18.0.0.</li>
- <li>Eclipse Helios (Version 3.6.2) or higher is required for ADT 18.0.0.</li>
- <li>ADT 18.0.0 is designed for use with <a href="{@docRoot}sdk/tools-notes.html">SDK Tools
- r18</a>. If you haven't already installed SDK Tools r18 into your SDK, use the Android SDK
- Manager to do so.</li>
- </ul>
- </dd>
-
- <dt>Bug fixes:</dt>
- <dd>
- <ul>
- <li>Fixed problem where exporting release package does not recompile libraries in release
- mode.
- (<a href="http://code.google.com/p/android/issues/detail?id=27940">Issue 27940</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" />
-ADT 17.0.0</a> <em>(March 2012)</em>
- <div class="toggleme">
-<dl>
- <dt>Dependencies:</dt>
-
- <dd>
- <ul>
- <li>Java 1.6 or higher is required for ADT 17.0.0.</li>
- <li>Eclipse Helios (Version 3.6.2) or higher is required for ADT 17.0.0.</li>
- <li>ADT 17.0.0 is designed for use with <a href="{@docRoot}sdk/tools-notes.html">SDK Tools
- r17</a>. If you haven't already installed SDK Tools r17 into your SDK, use the Android SDK
- Manager to do so.</li>
- </ul>
- </dd>
-
- <dt>General improvements:</dt>
- <dd>
- <ul>
- <li>New build features
- <ul>
- <li>Added feature to automatically setup JAR dependencies. Any {@code .jar} files in the
- {@code /libs} folder are added to the build configuration (similar to how the Ant build
- system works). Also, {@code .jar} files needed by library projects are also automatically
- added to projects that depend on those library projects.
- (<a href="http://tools.android.com/recent/dealingwithdependenciesinandroidprojects">more
- info</a>)</li>
- <li>Added a feature that allows you to run some code only in debug mode. Builds now
-generate a class called {@code BuildConfig} containing a {@code DEBUG} constant that is
-automatically set according to your build type. You can check the ({@code BuildConfig.DEBUG})
-constant in your code to run debug-only functions.</li>
- <li>Added support for custom views with custom attributes in libraries. Layouts using
-custom attributes must use the namespace URI {@code http://schemas.android.com/apk/res-auto} instead
-of the URI that includes the app package name. This URI is replaced with the app specific one at
-build time.</li>
- </ul>
- </li>
- <li>Improved Lint features. See the <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r17</a>
-release notes.</li>
- <li>Improved the Lint user interface
- <ul>
- <li>Added <strong>Run Lint</strong> toolbar action with a dropdown menu for selecting
-specific (or all) projects, clearing results and other actions.</li>
- <li>Updated the results window to be organized as a tree rather than a flat list. Each
-issue type has a single top level item, which makes it easier to quickly scan through the reported
-issues and narrow down to the issues you are most interested in.</li>
- <li>Added many new toolbar actions to the results window, including expand/collapse,
-ignore in file, ignore in project, ignore everywhere, show options, and configure columns.</li>
- <li>Added new column options for the <strong>Lint Warnings</strong> tab, such as
-category, priority, project, file and line. The column selection (as well as the column sizes) are
-persisted. You can also click on columns to sort by those values.</li>
- <li>Added Enable All and Disable All buttons to the Lint Options dialog, and a search
-filter textbox to filter by issue id, summary and severity.</li>
- </ul>
- </li>
- <li>Added Quick Outline for XML editors (Ctrl-O, Command-O). This feature shows the structure
-of the current file including icons and ids, lets you filter and quickly jump to specific ids.</li>
- <li>Updated the resource chooser to shows the resolved value for resources. For example,
-when selecting {@code @string/hello} the chooser displays a resolved value such as "Hello World").
-The resource chooser also now allows you to edit the chosen value directly.</li>
- <li>Updated Layout Editor so that it does not assign default ids to layouts, includes and
-merge tags. This behavior tended to pollute the namespace with a lot of unused resources since
-layouts are not usually manipulated via code, or referenced from XML. (The RelativeLayout editor
-automatically assigns ids to views without ids when pointing to them.)</li>
- <li>Added ability to export screenshots from the Layout Editor</li>
- </ul>
- </dd>
-
- <dt>Bug fixes:</dt>
- <dd>
- <ul>
- <li>Fixed problem using Layout Editor with {@link android.widget.SlidingDrawer} which could
- not be dragged into the layout on some platforms.</li>
- <li>Fixed preview rendering for {@link android.widget.SlidingDrawer} and
- {@link android.widget.TabHost}.
- (<a href="http://code.google.com/p/android/issues/detail?id=23022">Issue 23022</a>).</li>
- <li>Fixed issues that could prevent layout rendering due to unresolvable resources.
- (<a href="http://code.google.com/p/android/issues/detail?id=21046">Issue 21046</a>,
- <a href="http://code.google.com/p/android/issues/detail?id=21051">Issue 21051</a>)</li>
- <li>Fixed a bug in resource chooser which made some types of framework resources impossible to
-select. (<a href="http://code.google.com/p/android/issues/detail?id=20589">Issue 20589</a>)</li>
- <li>Fixed a bug in the formatter where a certain whitespace pattern could result in a
- non-space character getting deleted.
- (<a href="http://code.google.com/p/android/issues/detail?id=23940">Issue 23940</a>)</li>
- <li>Fixed a locale bug affecting Turkish locales in particular.
- (<a href="http://code.google.com/p/android/issues/detail?id=23747">Issue 23747</a>)</li>
- <li>Fixed issue where dex complains about duplicate classes in cases where a Library
- Project depends on the same jar files or Java-only projects.</li>
- <li>Fixed issue where test projects had to independently reference the library projects used
- by an app project. Now referencing only the app project is enough.</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" />
-ADT 16.0.1</a> <em>(December 2011)</em>
- <div class="toggleme">
-<dl>
- <dt>Dependencies:</dt>
-
- <dd>
- <ul>
- <li>Eclipse Helios (Version 3.6) or higher is required for ADT 16.0.1.</li>
- <li>ADT 16.0.1 is designed for use with <a href="{@docRoot}sdk/tools-notes.html">SDK Tools
- r16</a>. If you haven't already installed SDK Tools r16 into your SDK, use the Android SDK
- Manager to do so.</li>
- </ul>
- </dd>
-
- <dt>Bug fixes:</dt>
- <dd>
- <ul>
- <li>Fixed build issue where the 9-patch could be packaged as normal bitmap in some cases.</li>
- <li>Fixed minor issues in the <a href="http://tools.android.com/recent/lint">Lint</a>
- tool.</li>
- <li>Fixed minor issues in the SDK Manager.</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" />
-ADT 16.0.0</a> <em>(December 2011)</em>
- <div class="toggleme">
-<dl>
- <dt>Dependencies:</dt>
-
- <dd>
- <ul>
- <li>Eclipse Helios (Version 3.6) or higher is required for ADT
-16.0.0.</li>
- <li>ADT 16.0.0 is designed for use with <a
-href="{@docRoot}sdk/tools-notes.html">SDK Tools r16</a>. If you haven't already installed SDK Tools
-r16 into your SDK, use the Android SDK Manager to do so.</li>
- </ul>
- </dd>
-
- <dt>General improvements:</dt>
- <dd>
- <ul>
- <li>Added Lint tool to detect common errors in Android projects. (<a
-href="http://tools.android.com/recent/lint">more info</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" />
-ADT 15.0.1</a> <em>(November 2011)</em>
- <div class="toggleme">
-<dl>
- <dt>Dependencies:</dt>
-
- <dd>ADT 15.0.1 is designed for use with <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r15</a>.
- If you haven't already installed SDK Tools r15 into your SDK, use the Android SDK Manager to
- do so.</dd>
-
- <dt>Bug fixes:</dt>
- <dd>
- <ul>
- <li>Fixed how source files are attached to library project <code>.jar</code> files.</li>
- <li>Fixed how the <code>bin/</code> folder for library projects are refreshed. This ensures that parent projects pick up changes in library projects.</li>
- <li>Fixed how a parent project's library container is updated when a library project is recompiled. This ensures that parent projects are
- recompiled when code in a library project changes.</li>
- <li>Fixed how <code>res/</code> folders are checked in library projects. This ensures that all <code>res</code> folders are properly included
- even if Eclipse is not aware of them due to refresh issues.</li>
- <li>Fixed issue that prevented <code>aapt</code> from running when editing certain XML files.</li>
- <li>Fixed minor XML formatting issues.</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" />
-ADT 15.0.0</a> <em>(October 2011)</em>
- <div class="toggleme">
-<dl>
-
-<dt>Dependencies:</dt>
-
-<dd>ADT 15.0.0 is designed for use with <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r15</a>.
-If you haven't already installed SDK Tools r15 into your SDK, use the Android SDK Manager to
-do so.</dd>
-
-<dt>Bug fixes:</dt>
-<dd>
-<ul>
- <li>Fixed build issue when using Renderscript in projects that target API levels 11-13
- (<a href="http://code.google.com/p/android/issues/detail?id=21006">Issue 21006</a>).</li>
- <li>Fixed issue when creating projects from existing source code.</li>
- <li>Fixed issues in the SDK Manager
- (<a href="http://code.google.com/p/android/issues/detail?id=20939">Issue 20939</a>,
- <a href="http://code.google.com/p/android/issues/detail?id=20607">Issue 20607</a>).</li>
- <li>Fixed scrolling issue in the new Logcat panel of DDMS.</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" />
-ADT 14.0.0</a> <em>(October 2011)</em>
- <div class="toggleme">
-<dl>
-
-<dt>Dependencies:</dt>
-
-<dd>ADT 14.0.0 is designed for use with <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r14</a>.
-If you haven't already installed SDK Tools r14 into your SDK, use the Android SDK Manager to
-do so.</dd>
-
-<dt>Build system:</dt>
-<dd>
- <ul>
- <li>Changed <code>default.properties</code> to <code>project.properties</code> and
- <code>build.properties</code> to <code>ant.properties</code>. ADT automatically
- renames these files, if necessary, when you open a project in Eclipse.</li>
- <li>Changed how library projects are built in Eclipse.</a></li>
- <li>Changed output of <code>javac</code> from <code>bin/</code> to <code>bin/classes</code>
- in Eclipse.</li>
- <li>Improved incremental builds so that resource compilation runs less frequently. Builds no
- longer run when you edit strings or layouts (unless you add a new <code>id</code>) and no longer
- run once for each library project.</li>
- <li>Introduced a "PNG crunch cache" that only runs on modified PNG files, instead of
- crunching all existing PNG files, all the time.</li>
- <li>Modified resource compilation so it no longer happens for normal save operations. It only
- happens when running or debugging (the build option that lets you disable the packaging
- step, which was introduced in ADT 12, is now on by default.)</li>
- </ul>
-<p>For a complete overview of the build system changes and what you need to do to support them,
-see the <a href="http://tools.android.com/recent/buildchangesinrevision14">Android Tools Project
-site</a>.</p>
-</dd>
-
-<dt>General improvements:</dt>
-<dd>
- <ul>
-
-
-<li>Added a Welcome Wizard to help with the initial setup of the Android
-development environment (<a href="http://tools.android.com/recent/welcomewizard">more
-info</a>).</li>
-<li>Integrated the Android Asset Studio, which helps you create icons for things
-like the launcher, menus, and tabs. (<a
-href="http://tools.android.com/recent/assetstudiointegration">more
-info</a>).</li>
-<li>Revamped the Logcat view and added support to display and filter logs by
- application names as well as PIDs (<a
- href="http://tools.android.com/recent/updatedlogcatviewer">more info</a>).</li>
-<li>Revamped the SDK Manager UI (<a href="http://tools.android.com/recent/newsdkmanager">more
-info</a>).</li>
-<li>Revamped the New Project and the New XML File wizards to have
-multiple pages. Sample projects are now copied into the workspace such that they can be modified
-and deleted without affecting the master copy
-(<a href="http://tools.android.com/recent/revampedwizards">more info</a>).</li>
-<li>Removed the dependency on Eclipse GEF.</li>
-</ul>
-</dd>
-
-<dt>XML and Java editors:</dt>
-<dd>
- <ul>
- <li>Added a new XML formatter that formats all XML files according to the
- standard Android coding style. The formatter can also reorder
- attributes to follow a recommended order and processes any changes made in the Layout editor.
-(<a href="http://tools.android.com/recent/xmlformatter">more info</a>).</li>
- <li>Added the "Go to Matching" (Ctrl-Shift-P) feature, which lets you jump
-between opening and closing tags in XML files.</li>
- <li>Added support for the "Select Enclosing Element" feature on Mac.</li>
- <li>Added a Quickfix for extracting Strings when the caret is inside a String (<a href="">see
-more</a>).</li>
- <li>Improved "smart indent", which allows automatic indentation and un-indentation
- when pressing the Return key in XML editors (<a
-href="http://tools.android.com/recent/xmleditingimprovements">more info</a>).</li>
-
- </ul>
-</dd>
-
-<dt>Layout editor:</dt>
-<dd>
- <ul>
- <li>Added tooltip feedback for dragging and resizing operations. For
- example, when dragging in a relative layout, the proposed
- constraints are shown. When resizing, the new dimensions are
- shown (<a href="http://tools.android.com/recent/layouteditorfeedbacktooltips">more
-info</a>).</li>
- <li>Added the ability to suppress rendering fidelity warnings (<a
-href="http://tools.android.com/recent/suppressrenderwarnings">more info</a>).</li>
- <li>Added "Remove Container" visual refactoring that removes the
- children of a container up to the top level and transfers
- namespace and layout attributes if necessary (<a
-href="http://tools.android.com/recent/removecontainervisualrefactoring">more info</a>).</li>
- <li>Added pull-right menus to the context menu for accessing
- properties of the parents, which is useful when the children fully
- cover the parent and make it hard to select on their own.</li>
- <li>Improved access to properties in the context menu. The most
- frequently set attributes for each view are listed at the top of
- the menu. The Properties menu offers access to the most
- recently set attributes, attributes organized by their defining
- view, and layout attributes only or all attributes alphabetically (<a
-href="http://tools.android.com/recent/layouteditorcontextmenuimprovements">more info</a>).</li>
- </ul>
-</dd>
-
-<dt>Bug fixes:</dt>
-<dd>Fixed many bugs and added <a
-href="http://tools.android.com/recent/miscellaneousrecentfixes">minor improvements</a>, in
-particular some <a href="http://tools.android.com/recent/linuxfixes">critical bug fixes on
-Linux</a>.</dd>
-
-</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" />
-ADT 12.0.0</a> <em>(July 2011)</em>
- <div class="toggleme">
-<dl>
-
-<dt>Dependencies:</dt>
-
-<dd>ADT 12.0.0 is designed for use with <a href="{@docRoot}sdk/tools-notes.html">SDK Tools r12</a>. If you haven't
-already installed SDK Tools r12 into your SDK, use
-the Android SDK Manager to do so.</dd>
-
-<dt>Visual Layout Editor:</dt>
-<dd>
-<ul>
- <li>New RelativeLayout drop support with guideline suggestions for
- attachments and cycle prevention
- (<a href="http://tools.android.com/recent/revampedrelativelayoutsupport">more info</a>).</li>
- <li>Resize support in most layouts along with
- guideline snapping to the sizes dictated by <code>wrap_content</code> and <code>match_parent</code>.
- In LinearLayout, sizes are mapped to weights instead of pixel widths.
- (<a href="http://tools.android.com/recent/resizesupport">more info</a>).</li>
- <li>Previews of drawables and colors in the resource chooser dialogs
- (<a href="http://tools.android.com/recent/imageandcolorpreviews">more info</a>).</li>
- <li>Improved error messages and links for rendering errors including
- detection of misspelled class names
- (<a href="http://tools.android.com/recent/improvedrenderingerrordiagnostics">more info</a>).</li>
-</ul>
-</dd>
-
-<dt>Build system:</dt>
-<dd>
-<ul>
- <li id="build-option">A new option lets you disable the packaging step in the automatic
- builders. This improves performance when saving files by not
- performing a full build, which can take a long time for large projects.
- If the option is enabled, the APK is packaged when the
- application is deployed to a device or emulator or when the
- release APK is exported (<a href="http://tools.android.com/recent/finercontroloveradtbuildprocess">more info</a>).</li>
-</ul>
-</dd>
-
-<dt>Bug fixes:</dt>
-<dd>Many bug fixes are part of this release
-(<a href="http://tools.android.com/recent/adt12bugfixroundup">more info</a>).</dd>
-
-</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" />
-ADT 11.0.0</a> <em>(June 2011)</em>
- <div class="toggleme">
-
-<dl>
-
-<dt>Dependencies:</dt>
-
-<dd>ADT 11.0.0 is designed for use with SDK Tools r11. If you haven't
-already installed SDK Tools r11 into your SDK, use the Android SDK Manager to do
-so.</dd>
-
-<dt>Visual Refactoring:</dt>
-<dd>
- <ul>
- <li>"Extract Style" feature pulls out style-related attributes from your layout and extracts
-them as a new style defined in {@code styles.xml} (<a
-href="http://tools.android.com/recent/extractstylerefactoring">more info</a>).</li>
- <li>"Wrap in Container" feature lets you select a group of views then surround them
- in a new layout (a new view group, such as a LinearLayout), and transfers namespace and layout
- parameters to the new parent (<a
-href="http://tools.android.com/recent/newrefactoringswrapinchangelayoutchangewidget">more
-info</a>).</li>
- <li>"Change Layout" feature changes layouts from one type
- to another, and can also flatten a layout hierarchy (<a
-href="http://tools.android.com/recent/newrefactoringswrapinchangelayoutchangewidget">more
-info</a>).</li>
- <li>"Change Widget Type" feature changes the type of the
- selected views to a new type. Also, a new selection context menu
- in the visual layout editor makes it easy to select siblings as
- well as views anywhere in the layout that have the same type (<a
-href="http://tools.android.com/recent/newrefactoringswrapinchangelayoutchangewidget">more
-info</a>).</li>
- <li>"Extract as Include" feature finds identical collections of views
- in other layouts and offers to combine them into a single layout that you can then include in
- each layout (<a
-href="http://tools.android.com/recent/extractasincludeimprovements">more info</a>).</li>
- <li>Quick Assistant in Eclipse can be invoked
- from the XML editor (with Ctrl-1) to apply any of the above
- refactorings (and Extract String) to the current selection (<a
-href="http://tools.android.com/recent/refactoringquickassistant">more info</a>).</li>
- </ul>
-</dd>
-
-<dt>Visual Layout Editor:</dt>
-<dd>
- <ul>
- <li>This is the update to the layout editor you've been waiting for! It includes (almost) all
-the goodies demonstrated at Google I/O. <a href="http://www.youtube.com/watch?v=Oq05KqjXTvs">Watch
-the video</a> on YouTube.</li>
- <li>The palette now supports different configurations for supported widgets. That is, a single
-view is presented in various different configurations that you can drag into your layout. For
-example, there is a <em>Text Fields</em> palette category where you can drag an {@link
-android.widget.EditText} widget in as a password field, an e-mail field, a phone field, or other
-types of text boxes. Similarly, {@link android.widget.TextView} widgets are preconfigured
-with large, normal and small theme sizes, and {@link android.widget.LinearLayout} elements are
-preconfigured in horizontal and vertical configurations (<a
-href="http://tools.android.com/recent/multipletextfieldandlayouttypes">more info</a>).</li>
- <li>The palette supports custom views. You can pick up any custom
- implementations of the View class you've created in your project or from included libraries and
-drag them into your layout (<a
-href="http://tools.android.com/recent/customviewsinthepalette">more info</a>).</li>
- <li>Fragments are available in the palette for placement in your layout. In the tool, you can
-choose which layout to show rendered for a given fragment tag. Go to declaration works for fragment
-classes (<a href="http://tools.android.com/recent/fragmentsupport">more info</a>).</li>
- <li>The layout editor automatically applies a "zoom to fit" for newly
- opened files as well as on device size and orientation changes to
- ensure that large layouts are always fully visible unless you
- manually zoom in.</li>
- <li>You can drop in an {@code <include>} element from the palette, which will pop up
- a layout chooser. When you select the layout to include, it is added with an {@code
-<include>}. Similarly, dropping images or image buttons will pop up image
- resource choosers (<a
-href="http://tools.android.com/recent/includetagdropsupport">more info</a>).</li>
- <li>The configuration chooser now applies the "Render Target" and
- "Locale" settings project wide, making it trivial to check the
- layouts for different languages or render targets without having
- to configure these individually for each layout.</li>
- <li>The layout editor is smarter about picking a default theme to
- render a layout with, consulting factors like theme registrations
- in the manifest, the SDK version, and other factors.</li>
- <li>The layout editor is smarter about picking a default configuration to render a layout
-with, defaulting to the currently visible configuration in the previous file. It also considers the
-SDK target to determine whether to default to a tablet or phone screen size.</li>
- <li>Basic focus support. The first text field dropped in a layout is assigned focus, and there
-are <strong>Request Focus</strong> and <strong>Clear Focus</strong> context menu items on text
-fields to change the focus.</li>
- </ul>
-</dd>
-
-<dt>XML editors:</dt>
-<dd>
-<ul>
- <li>Code completion has been significantly improved. It now works
- with {@code <style>} elements, completes dimensional units,
- sorts resource paths in values based on the attribute name, and more. There are also many fixes to
-handle text replacement (<a
-href="http://tools.android.com/recent/xmlcodecompletionimprovements">more info</a>).</li>
- <li>AAPT errors are handled better. They are now underlined for the
- relevant range in the editor, and a new quickfix makes it trivial
- to create missing resources.</li>
- <li>Code completion for drawable, animation and color XML files (<a
-href="http://tools.android.com/recent/codecompletionfordrawablescolorsandanimationfiles">more
-info</a>).</li>
-</ul>
-</dd>
-
-<dt>DDMS:</dt>
-<dd>
-<ul>
- <li>"New Folder" action in the File Explorer.</li>
- <li>The screenshot dialog will add timestamps to the filenames and preserve the orientation on
-snapshot refresh.</li>
-</ul>
-</dd>
-
-<dt>General notes:</dt>
-<dd>
- <ul>
- <li>TraceView supports zooming with the mouse-wheel in the timeline.</li>
- <li>The New Android Project wizard now supports Eclipse working sets.</li>
- </ul>
-</dd>
-</dl>
-<p>More information about tool changes are available on the <a
-href="http://tools.android.com/recent">Android Tools Project Site</a>.</p>
-</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" />
-ADT 10.0.1</a> <em>(March 2011)</em>
- <div class="toggleme">
-
-<dl>
-
-<dt>Dependencies:</dt>
-
-<dd>ADT 10.0.1 is designed for use with SDK Tools r10. If you haven't
-already installed SDK Tools r10 into your SDK, use the Android SDK Manager to do
-so.</dd>
-
-<dt>General notes:</dt>
-<dd>
- <ul>
- <li>Temporary work-around to resolve the rare cases in which the layout editor will
-not open.</li>
- <li>Fix issue in which ADT 10.0.0 would install on Eclipse 3.4 and lower, even though ADT
-requires Eclipse 3.5 or higher (as of 10.0.0).</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" />
-ADT 10.0.0</a> <em>(February 2011)</em>
- <div class="toggleme">
-
-<dl>
-
-<dt>Dependencies:</dt>
-
-<dd>ADT 10.0.0 is designed for use with SDK Tools r10. If you haven't
-already installed SDK Tools r10 into your SDK, use the Android SDK Manager to do
-so.</dd>
-
-<dt>General notes:</dt>
-<dd>
- <ul>
- <li>The tools now automatically generate Java Programming Language source files (in the <code>gen/</code> directory) and
- bytecode (in the <code>res/raw/</code> directory) from your <code>.rs</code> files.</li>
- <li>A Binary XML editor has been added (<a href="http://tools.android.com/recent/binaryxmleditor">details</a>).</li>
- <li>Traceview is now integrated into the Eclipse UI (<a href="http://tools.android.com/recent/traceviewineclipse">details</a>).</li>
- <li>The "Go To Declaration" feature for XML and <code>.java</code> files quickly show all the matches in the project
- and allows you jump to specific items such as string translations or <code>onClick</code> handlers
- (<a href="http://tools.android.com/recent/gotodeclarationimprovements">details</a>).</li>
- <li>The Resource Chooser can create items such as dimensions, integers, ids, and booleans
- (<a href="http://tools.android.com/recent/resourcechoosercannowcreatearbitraryvalues">details</a>).</li>
- <li>Improvements to the Visual Layout Editor:
- <ul>
- <li>A new Palette with categories and rendering previews
- (<a href="http://tools.android.com/recent/newpalette">details</a>).</li>
- <li>A Layout Actions bar that provides quick access to common layout operations
- (<a href="http://tools.android.com/recent/layoutactionsbar">details</a>).</li>
- <li>When the Android 3.0 rendering library is selected, layouts render more like they do on devices.
- This includes rendering of status and title bars to more accurately reflect the actual
- screen space available to applications
- (<a href="http://tools.android.com/recent/systembarandactionbar">details</a>).</li>
- <li>Zoom improvements such as fit to view, persistent scale, and keyboard access.
- (<a href="http://tools.android.com/recent/zoomimprovements">details</a>).</li>
- <li>Further improvements to <code><merge></code> layouts, as well as layouts with gesture overlays
- (<a href="http://tools.android.com/recent/improvedsupportformergetags">details</a>).</li>
- <li>Improved rendering error diagnostics.</li>
- </ul>
- </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" />
-ADT 9.0.0</a> <em>(January 2011)</em>
- <div class="toggleme">
-
-<dl>
-
-<dt>Dependencies:</dt>
-
-<dd>ADT 9.0.0 is designed for use with SDK Tools r9. If you haven't
-already installed SDK Tools r9 into your SDK, use the Android SDK Manager to do
-so.</dd>
-
-<dt>General notes:</dt>
-<dd>
- <ul>
- <li>"Go To Declaration" hyperlink support: You can jump directly from code references (such as
- <code>R.id.main</code>) to the corresponding XML declaration, or from XML attributes (such as
- <code>@string</code>) to the corresponding resource definition, or from manifest XML
- registrations to activities and services.</li>
- <li>Improvements were made to name refactoring.</li>
- <li>AVDs now automatically save their state, so they can restart almost instantly. You can enable this feature when
- creating an AVD or by editing an AVD with the AVD Manager.</li>
- <li>Improvements to the Visual Layout Editor:
- <ul>
- <li>Support for rendering targets: You can now choose an arbitrary Android platform to
- render the current page, regardless of the project's minimum platform. This makes it
- easy to verify the layout and appearance of your activity on different versions of
- the platform.
- </li>
- <li>Improved support for empty and nested layouts: Dragging items over nested and
- invisible layouts automatically enlarges and highlights these layouts, so that they
- can receive drops.
- </li>
- <li>XML formatting improvements: The editor generates cleaner XML and you can now enable
- XML auto-formatting in the <strong>Preferences</strong> menu.</li>
- <li>Improved Outline labels: The Outline tab now displays additional information about each
- View. Textual Views display a snippet of the actual text. Views with a source
- (such as ImageView) displays the resource name. Included Views display the name of the View.
- </li>
- <li>When you right click a View in the Layout Editor,
- the context menu now contains <strong>Edit ID...</strong> and <strong>Edit Text...</strong>
- items. The <strong>Properties...</strong> context menus now list all of the properties and
- provide a way to edit them
- (<a href="http://tools.android.com/recent/editidtextandotherpropertiesviamenu">Details</a>).
- </li>
- <li>The layout editor now properly handles
- <a href="{@docRoot}guide/topics/resources/layout-resource.html#include-element"><code><include></code></a>
- and <a href="{@docRoot}guide/topics/resources/layout-resource.html#merge-element"><code><merge></code></a>
- tags (<a href="http://tools.android.com/recent/supportforincludeandmerge">Details</a>).</li>
- <li>"Extract as Include" refactoring: The Layout Editor has a new refactoring that allows
- you to select one or more views in a layout, and extract it into a separate layout
- (<a href="http://tools.android.com/recent/extractasincluderefactoring">Details</a>).</li>
- <li>Improved diagnostics for class loading and rendering errors: Class loading and rendering
- error messages are more useful and provide better information about the root cause of the
- error.</li>
- <li>Improved error handling to prevent drag and reordering operations from adding children
- into an {@link android.widget.AdapterView}.</li>
- <li>Outline reordering: Reordering your views in the Outline tab is much easier
- (<a href="http://tools.android.com/recent/outlineimprovements">Details</a>).</li>
- <li>Fix for keybinding bug where keyboard shortcuts did not work (Issues
- <a href="http://code.google.com/p/android/issues/detail?id=13231">13231</a> and
- <a href="http://code.google.com/p/android/issues/detail?id=13134">13134</a>).</li>
- <li>Fix for problems with Custom layout attribute menu (Issue
- <a href="http://code.google.com/p/android/issues/detail?id=13134">13134</a>).</li>
- <li>Automatic configuration for various view types: Certain views have properties configured
- by default. For example, the width of an {@link android.widget.EditText} object is set to
- <code>match_parent</code> when added to a vertical {@link android.widget.LinearLayout}
- or a default image is added to an {@link android.widget.ImageButton}.</li>
- <li>Previews during dragging: Dragging from the palette or dragging within the layout editor
- now shows live previews of the dragged item.</li>
- <li>Navigation improvements: In the Layout Editor, double-clicking Views jumps to the
- corresponding XML element. In the Outline view, double-clicking opens the Properties view.</li>
- <li>The editor has Honeycomb style animation preview support.</li>
- <li>Improved rendering support for various Views (such as TabHosts and SlidingDrawers) in
- Honeycomb (Issues <a href="http://code.google.com/p/android/issues/detail?id=3162">3162</a>
- and <a href="http://code.google.com/p/android/issues/detail?id=13092">13092</a>).</li>
- <li>Included layouts can be rendered and edited in the context of the layouts that include
- them. From a layout using an <a href="{@docRoot}guide/topics/resources/layout-resource.html#include-element">
- <code><include></code></a> tag, double-clicking on the
- <a href="{@docRoot}guide/topics/resources/layout-resource.html#include-element">
- <code><include></code></a> element edits the referenced layout in the context of the
- current layout. Additionally, when editing a layout that is included by other layouts,
- you can quickly change between context layouts, by right clicking in the editor and choosing
- <strong>Show included in...</strong>. This feature is only available in Honeycomb.</li>
- </ul>
- </li>
- <li>This release fixes many other bugs, but the most important ones are listed below:
- <ul>
- <li>Fixed issue that prevented launching debug builds on productions devices when
- <code>debuggable=true</code> was not set in the Android manifest.</li>
- <li>The LogCat view in DDMS properly handles UTF-8 characters.</li>
- <li>The SDK Manager is more reliable on Windows
- (<a href="http://tools.android.com/recent/sdkmanagerfixes">Details</a>).</li>
- <li>A JUnit initialization bug that prevented you from working with JUnit tests was fixed
- (Issue <a href="http://code.google.com/p/android/issues/detail?id=12411">12411</a>).</li>
- </ul>
-</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" />
-ADT 8.0.1</a> <em>(December 2010)</em>
- <div class="toggleme">
-
-<dl>
-
-<dt>Dependencies:</dt>
-
-<p><p>ADT 8.0.1 is designed for use with SDK Tools r8. If you haven't
-already installed SDK Tools r8 into your SDK, use the Android SDK Manager to do
-so.</p></dd>
-
-<dt>General notes:</dt>
-<dd>
-<ul>
- <li>This is a quick follow-up to ADT 8.0.0 to fix some bugs.</li>
- <li>Fixes an issue in which projects failed to compile, citing a dex error.</li>
- <li>Better ProGuard error reporting when exporting applications for release.</li>
-</ul>
-<p>Also see the recent release notes for 8.0.0, below.</p>
-</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" />
-ADT 8.0.0</a> <em>(December 2010)</em>
- <div class="toggleme">
-
-<dl>
-
-<dt>Dependencies:</dt>
-
-<p><p>ADT 8.0.0 is designed for use with SDK Tools r8. If you haven't
-already installed SDK Tools r8 into your SDK, use the Android SDK Manager to do
-so.</p></dd>
-
-<dt>General notes:</dt>
-<dd>
-<ul>
- <li>New version number scheme that follows the SDK Tools revision number. The major version
-number for your ADT plugin should now always match the revision number of your SDK Tools. For
-example, ADT 8.x is for SDK Tools r8.</li>
- <li>Support for true debug build. You no longer need to change the value of the
- <code>debuggable</code> attribute in the Android Manifest.
- <p>Incremental builds automatically insert <code>debuggable="true"</code>, but if you perform
- "export signed/unsigned application package", ADT does <em>not</em> insert it.
- If you manually set <code>debuggable="true"</code> in the manifest file, then release builds will
- actually create a debug build (it does not remove it if you placed it there).</p></li>
- <li>Automatic <a href="{@docRoot}guide/developing/tools/proguard.html">ProGuard</a> support in
- release builds. For it to work, you need to have a <code>proguard.config</code>
- property in the <code>default.properties</code> file that points to a ProGuard config file.</li>
- <li>Completely rewritten Visual Layout Editor. (This is still a work in progress.) Now includes:
- <ul>
- <li>Full drag and drop from palette to layout for all Layout classes.</li>
- <li>Move widgets inside a Layout view, from one Layout view to another and from one layout file to another.</li>
- <li>Contextual menu with enum/flag type properties.</li>
- <li>New zoom controls.</li>
- </ul></li>
- <li>New HierarchyViewer plug-in integrated in Eclipse.</li>
- <li>Android launch configurations don't recompile the whole workspace on launch anymore.</li>
- <li><code>android.jar</code> source and javadoc location can now be configured.</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" />
-ADT 0.9.9</a> <em>(September 2010)</em>
- <div class="toggleme">
-
-<dl>
-
-<dt>Dependencies:</dt>
-
-<dd><p>ADT 0.9.9 replaces ADT 0.9.8 and is designed for use with SDK Tools r7
-and later. ADT 0.9.9 includes the ADT 0.9.8 features as well as an important
-bugfix, so we recommend that you upgrade as soon as possible. If you haven't
-already installed SDK Tools r7 into your SDK, use the Android SDK Manager to do
-so.</p></dd>
-
-<dt>General notes:</dt>
-<dd>
-<ul>
-<li>Fixes a problem in project import, in which source files were deleted in some cases.</li>
-<li>Includes all other ADT 0.9.8 features (see below).</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" />
-ADT 0.9.8</a> <em>(September 2010)</em>
- <div class="toggleme">
-
-
-</ul>
-</dd>
-
-<dl>
-
-<dt>Dependencies:</dt>
-
-<dd><p>ADT 0.9.8 is now deprecated. Please use ADT 0.9.9 instead.</p></dd>
-
-<dt>General notes:</dt>
-<dd>
-<ul>
-<li>Adds a new Action, "Rename Application Package", to the Android Tools
-contextual menu. The Action does a full application package refactoring.
-<li>Adds support for library projects that don't have a source folder
-called <code>src/</code>. There is now support for any number of source folders,
-with no name restriction. They can even be in subfolder such as
-<code>src/java</code>. If you are already working with library projects created
-in ADT 0.9.7, see <a
-href="{@docRoot}guide/developing/projects/index.html#libraryMigrating">Migrating
-library projects to ADT 0.9.8</a> for important information about moving
-to the new ADT environment.</li>
-<li>Adds support for library projects that depend on other library
-projects.</li>
-<li>Adds support for additional resource qualifiers:
-<code>car</code>/<code>desk</code>, <code>night</code>/<code>notnight</code> and
-<code>navexposed</code>/<code>navhidden</code>.</li>
-<li>Adds more device screen types in the layout editor. All screen
-resolution/density combinations listed in the <a
-href="{@docRoot}guide/practices/screens_support.html#range">Supporting
-Multiple Screens</a> are now available.</li>
-<li>Fixes problems with handling of library project names that
-contain characters that are incompatible with the Eclipse path variable.
-Now properly sets up the link between the main project and the library
-project.</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" />
-ADT 0.9.7</a> <em>(May 2010)</em>
- <div class="toggleme">
-
-<dl>
-<dt>Library projects:</dt>
-<dd>
-<p>The ADT Plugin now supports the use of <em>library projects</em> during
-development, a capability that lets you store shared Android application
-code and resources in a separate development project. You can then reference the
-library project from other Android projects and, at build time, the tools
-compile the shared code and resources as part of the dependent applications.
-More information about this feature is available in the <a
-href="{@docRoot}guide/developing/projects/index.html#LibraryProjects">Creating and Managing Projects</a> document. </p>
-<p>If you are not developing in Eclipse, <a
-href="tools-notes.html">SDK Tools r6</a> provides the equivalent library
-project support through the Ant build system.</p>
-</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" />
-ADT 0.9.6</a> <em>(March 2010)</em>
- <div class="toggleme">
-
-<dl>
-<dt>Dependencies:</dt>
-
-<dd><p>ADT 0.9.6 is designed for use with SDK Tools r5 and later. Before
-updating to ADT 0.9.6, we highly recommend that you use the Android SDK Manager to install SDK
-Tools r5 into your SDK.</p></dd>
-
-<dt>General Notes:</dt>
-<dd>
-<ul>
-<li>Editing <code>default.properties</code> outside of Eclipse will now
-automatically update the project.</li>
-<li>Loads the SDK content only when a project requires it. This will make
-Eclipse use less resources when the SDK contains many versions of Android.</li>
-<li>Resolves potential deadlock between modal dialogs, when launching ADT the
-first time with the SDK Usage panel.</li>
-<li>Fixes issues with the New Project Wizard when selecting samples.</li>
-</ul>
-</dd>
-<dt>AVD/SDK Manager:</dt>
-<dd>
-<ul>
-<li>Adds support for platform samples packages.</li>
-<li>Improves support for dependency between packages.</li>
-<li>AVDs now sorted by API level.</li>
-<li>The AVD creation dialog now enforces a minimum SD card size of 9MB.</li>
-<li>Prevents deletion of running AVDs.</li>
-</ul>
-</dd>
-<dt>DDMS:</dt>
-<dd>
-<ul>
-<li>DDMS plug-in now contains the Allocation Tracker view.</li>
-<li>New action in the Logcat view: "Go to problem" lets you go directly from an
-exception trace output to the code.</li>
-</ul>
-</dd>
-<dt>Editors:</dt>
-<dd>
-<ul>
-<li>Explode mode in the Visual Layout Editor adds a margin to all layout objects
-so that it's easier to see embedded or empty layouts.</li>
-<li>Outline mode in the Visual Layout Editor draws layout outline to make it
-easier to see layout objects.</li>
-<li>Several fixes in the configuration selector of the Visual Layout
-Editor.</li>
-</ul>
-</dd>
-<dt>Application launching:</dt>
-<dd>
-<ul>
-<li>Applications launched from ADT now behave as if they were clicked from the
-Home screen.</li>
-<li>Fixes issue where add-on with no optional library would not show up as valid
-targets for application launches.</li>
-<li>Resolves possible crash when launching applications.</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" />
-ADT 0.9.5</a> <em>(December 2009)</em>
- <div class="toggleme">
-<dl>
-<dt>Dependencies:</dt>
-
-<dd><p>ADT 0.9.5 requires features provided in SDK Tools r4 or higher. If you install
-ADT 0.9.5, which is highly recommended, you should use the Android SDK
-Manager to download the latest SDK Tools into your SDK. For more information,
-see <a href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a>.</p>
-</dd>
-
-<dt>General notes:</dt>
-<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 skin name specified.</li>
-<li>Fixes XML validation issue in on older Java versions.</li>
-<li>.apk packaging now properly ignores vi swap files as well as hidden files.</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" />
-ADT 0.9.4</a> <em>(October 2009)</em>
- <div class="toggleme">
-<dl>
-<dt>Dependencies:</dt>
-
-<dd><p>ADT 0.9.4 requires features provided in SDK Tools r3 or higher. If you install
-ADT 0.9.4, which is highly recommended, you should use the Android SDK
-Manager to download the latest SDK Tools into your SDK. For more information,
-see <a href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a>.</p>
-</dd>
-
-<dt>Project Creation Wizard:</dt>
-<dd>
-<ul>
-<li>New option to create a project from a sample by choosing it from a list.</li>
-</ul>
-</dd>
-
-<dt>Layout Editor:</dt>
-<dd>
-<ul>
-<li>Improved Configuration selector that lets you see how your layout will
-render on different devices. Default device descriptions include ADP1
-and Google Ion, while SDK add-ons can also provide new descriptions.
-A new UI allows you to create custom descriptions.</li>
-<li>Adds a new clipping toggle, to let you see your full layout even if it's
-bigger than the screen.</li>
-</ul>
-</dd>
-
-<dt>DDMS integration:</dt>
-<dd>
-<ul>
-<li>Includes the improvements from the standlone DDMS, revision 3.</li>
-<li>Adds an option to open HPROF files into eclipse instead of writing them on
-disk. If a profiler such as MAT (<a href="http://eclipse.org/mat">Memory Analyzer
-Tool</a>) is installed, it'll open the file.</li>
-</ul>
-</dd>
-
-<dt>Android SDK and AVD Manager integration:</dt>
-<dd>
-<ul>
-<li>Includes the improvements from the standalone Android SDK and AVD Manager,
-revision 3.</li>
-</ul>
-</dd>
-</dl>
- </div>
-</div>
-
-
-
-<h2 id="installing">Installing the ADT Plugin</h2>
-
-<p>The sections below provide instructions on how to download and install
-ADT into your Eclipse environment. If you encounter problems, see the <a
-href="#troubleshooting">Troubleshooting</a> section.</p>
-
-
-<h3 id="preparing">Preparing Your Development Computer</h3>
-
-<p>ADT is a plugin for the Eclipse IDE. Before you can install or use ADT,
-you must have a compatible version of Eclipse installed on your development
-computer. Check the <a
-href="requirements.html">System Requirements</a> document for
-a list of Eclipse versions that are compatible with the Android SDK.</li></p>
-
-<ul>
-<li>If Eclipse is already installed on your computer, make sure that it is
-a version that is compatible with ADT and the Android SDK.
-
-<li>If you need to install or update Eclipse, you can download it from this
-location:
-
-<p style="margin-left:2em;"><a href=
-"http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a>
-</p>
-
-<p>The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP
-version of Eclipse is recommended.</p></li>
-</ul>
-
-<p>Additionally, before you can configure or use ADT, you must install the
-Android SDK starter package, as described in <a
-href="installing.html#Installing">Downloading the SDK Starter Package</a>.
-Specifically, you need to install a compatible version of the Android SDK Tools
-and at least one development platform. To simplify ADT setup, we recommend
-installing the Android SDK prior to installing ADT. </p>
-
-<p>When your Eclipse and Android SDK environments are ready, continue with the
-ADT installation as described in the steps below. </p>
-
-<h3 id="downloading">Downloading the ADT Plugin</h3>
-
-<p>Use the Update Manager feature of your Eclipse installation to install the latest
-revision of ADT on your development computer.</p>
-
-<p>Assuming that you have a compatible version of the Eclipse IDE installed, as
-described in <a href="#preparing">Preparing for Installation</a>, above, follow
-these steps to download the ADT plugin and install it in your Eclipse
-environment.</p>
-
-
-<ol>
- <li>Start Eclipse, then select <strong>Help</strong> > <strong>Install New
-Software...</strong>.</li>
- <li>Click <strong>Add</strong>, in the top-right corner.</li>
- <li>In the Add Repository dialog that appears, enter "ADT Plugin" for the <em>Name</em> and the
-following URL for the <em>Location</em>:
- <pre>https://dl-ssl.google.com/android/eclipse/</pre>
- </li>
- <li>Click <strong>OK</strong>
- <p>Note: If you have trouble acquiring the plugin, try using "http" in the Location URL,
-instead of "https" (https is preferred for security reasons).</p></li>
- <li>In the Available Software dialog, select the checkbox next to Developer Tools and click
-<strong>Next</strong>.</li>
- <li>In the next window, you'll see a list of the tools to be downloaded. Click
-<strong>Next</strong>. </li>
- <li>Read and accept the license agreements, then click <strong>Finish</strong>.
- <p>Note: If you get a security warning saying that the authenticity or validity of
-the software can't be established, click <strong>OK</strong>.</p></li>
- <li>When the installation completes, restart Eclipse. </li>
-</ol>
-
-<h3 id="configuring">Configuring the ADT Plugin</h3>
-
-<p>After you've successfully downloaded the ADT as described above, the next step
-is to modify your ADT preferences in Eclipse to point to the Android SDK directory:</p>
-
-<ol>
- <li>Select <strong>Window</strong> > <strong>Preferences...</strong> to open the Preferences
- panel (Mac OS X: <strong>Eclipse</strong> > <strong>Preferences</strong>).</li>
- <li>Select <strong>Android</strong> from the left panel.</li>
- <p>You may see a dialog asking whether you want to send usage statistics to Google. If so,
-make your choice and click <strong>Proceed</strong>. You cannot continue with this procedure until
-you click <strong>Proceed</strong>.</p>
- <li>For the <em>SDK Location</em> in the main panel, click <strong>Browse...</strong> and
- locate your downloaded SDK directory. </li>
- <li>Click <strong>Apply</strong>, then <strong>OK</strong>.</li>
-</ol>
-
-<p>Done! If you haven't encountered any problems, then the installation is
-complete. If you're installing the Android SDK for the first time, return to <a
-href="{@docRoot}sdk/installing.html#InstallingADT">Installing the SDK</a> to complete your setup.
-</p>
-
-
-<h3 id="troubleshooting">Troubleshooting ADT Installation</h3>
-
-<p> If you are having trouble downloading the ADT plugin after following the
-steps above, here are some suggestions: </p>
-
-<ul>
- <li>If Eclipse can not find the remote update site containing the ADT plugin,
-try changing the remote site URL to use http, rather than https. That is, set
-the Location for the remote site to:
-<pre>http://dl-ssl.google.com/android/eclipse/</pre></li>
-<li>If you are behind a firewall (such as a corporate firewall), make sure that
-you have properly configured your proxy settings in Eclipse. In Eclipse,
-you can configure proxy information from the main Eclipse menu in
-<strong>Window</strong> (on Mac OS X, <strong>Eclipse</strong>) >
-<strong>Preferences</strong> > <strong>General</strong> > <strong>Network
-Connections</strong>.</li>
-</ul>
-
-<p> If you are still unable to use Eclipse to download the ADT plugin as a
-remote update site, you can download the ADT zip file to your local machine and
-manually install it:</p>
-
-<ol>
- <li>Download the current ADT Plugin zip file from the table below (do not unpack it).
-
- <table class="download">
- <tr>
- <th>Name</th>
- <th>Package</th>
- <th>Size</th>
- <th>MD5 Checksum</th>
- </tr>
- <tr>
- <td>ADT {@adtZipVersion}</td>
- <td>
- <a href="http://dl.google.com/android/{@adtZipDownload}">{@adtZipDownload}</a>
- </td>
- <td>{@adtZipBytes} bytes</td>
- <td>{@adtZipChecksum}</td>
- </tr>
-</table>
-</li>
-
-</li>
- <li>Follow steps 1 and 2 in the <a href="#installing">default install
- instructions</a> (above).</li>
- <li>In the Add Site dialog, click <strong>Archive</strong>.</li>
- <li>Browse and select the downloaded zip file.</li>
- <li>Enter a name for the local update site (e.g.,
- "Android Plugin") in the "Name" field.</li>
- <li>Click <strong>OK</strong>.
- <li>Follow the remaining procedures as listed for
- <a href="#installing">default installation</a> above,
- starting from step 4.</li>
-</ol>
-
-<p>To update your plugin once you've installed using the zip file, you will have
-to follow these steps again instead of the default update instructions.</p>
-
-<h4>Other install errors</h4>
-
-<p>Note that there are features of ADT that require some optional
-Eclipse packages (for example, WST). If you encounter an error when
-installing ADT, your Eclipse installion might not include these packages.
-For information about how to quickly add the necessary packages to your
-Eclipse installation, see the troubleshooting topic
-<a href="{@docRoot}resources/faq/troubleshooting.html#installeclipsecomponents">ADT
-Installation Error: "requires plug-in org.eclipse.wst.sse.ui"</a>.</p>
-
-<h4>For Linux users</h4>
-<p>If you encounter this error when installing the ADT Plugin for Eclipse:
-<pre>
-An error occurred during provisioning.
-Cannot connect to keystore.
-JKS</pre>
-<p>
-...then your development machine lacks a suitable Java VM. Installing Sun
-Java 6 will resolve this issue and you can then reinstall the ADT
-Plugin.</p>
-
-
-<h2 id="updating">Updating the ADT Plugin</h2>
-
-<p>From time to time, a new revision of the ADT Plugin becomes available, with
-new features and bug fixes. Generally, when a new revision of ADT is available,
-you should update to it as soon as convenient. </p>
-
-<p>In some cases, a new revision of ADT will have a dependency on a specific
-revision of the Android SDK Tools. If such dependencies exist, you will need to
-update the SDK Tools package of the SDK after installing the new revision of
-ADT. To update the SDK Tools package, use the Android SDK Manager, as
-described in <a href="adding-components.html">Adding SDK Packages</a>.</p>
-
-<p>To learn about new features of each ADT revision and also any dependencies on
-the SDK Tools, see the listings in the <a href="#notes">Revisions</a>
-section. To determine the version currently installed, open the
-Eclipse Installed Software window using <strong>Help</strong>
-> <strong>Software Updates</strong> and refer to the version listed for
-"Android Development Tools".</p>
-
-<p>Follow the steps below to check whether an update is available and, if so,
-to install it. </p>
-
-<ol>
- <li>Select <strong>Help</strong> > <strong>Check for Updates</strong>.
- <p>If there are no updates available, a dialog will say so and you're done.</p></li>
- <li>If there are updates available, select Android DDMS, Android Development Tools,
- and Android Hierarchy Viewer, then click <strong>Next</strong>.</li>
- <li>In the Update Details dialog, click <strong>Next</strong>.</li>
- <li>Read and accept the license agreement and then click <strong>Finish</strong>.
- This will download and install the latest version of Android DDMS and
- Android Development Tools.</li>
- <li>Restart Eclipse.</li>
-</ol>
-
-
-<p>If you encounter problems during the update, remove the existing ADT plugin from Eclipse, then
-perform a fresh installation, using the instructions for <a href="#installing">Installing the ADT
-Plugin</a>.</p>
-
diff --git a/docs/html/sdk/exploring.jd b/docs/html/sdk/exploring.jd
new file mode 100644
index 0000000..8272b06
--- /dev/null
+++ b/docs/html/sdk/exploring.jd
@@ -0,0 +1,166 @@
+page.title=Exploring the SDK
+walkthru=1
+
+@jd:body
+
+
+<p>The Android SDK is composed of modular packages that you can download separately using
+the Android SDK Manager. For example, when the SDK Tools are updated or a new version of
+the Android platform is released, you can use the SDK Manager to quickly download them to
+your environment. Simply follow the procedures described in <a
+href="{@docRoot}sdk/installing/adding-packages.html">Adding Platforms and Packages</a>.</p>
+
+<p>There are several different packages available for the Android SDK. The table below describes
+most of the available packages and where they're located once you download them.</p>
+
+
+<h2 id="Packages">Available Packages</h2>
+
+
+<table>
+ <tr><th>Package</th><th>Description</th><th>File Location</th></tr>
+ <tr>
+ <td><a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools</a></td>
+ <td>Contains tools for debugging and testing, plus other
+utilities that are required to develop an app. If you've just installed the SDK starter package,
+then you already have the latest version of this package. Make sure you keep this up to date.</td>
+ <td>{@code <sdk>/tools/}</td></tr>
+ <tr><td>SDK Platform-tools</td>
+ <td>Contains platform-dependent tools for developing and debugging
+your application. These tools support the latest features of the Android platform and are typically
+updated only when a new platform becomes available. These tools are always backward compatible with
+older platforms, but you must be sure that you have the latest version of these tools when you
+install a new SDK platform.</td>
+ <td>{@code <sdk>/platform-tools/}</td>
+ </tr>
+
+ <tr>
+ <td>Documentation</td>
+ <td>An offline copy of the latest documentation for the Android
+platform APIs.</td>
+ <td>{@code <sdk>/docs/}</td>
+ </tr>
+ <tr><td>SDK Platform</td>
+ <td>There's one SDK Platform available for each version of Android. It includes an {@code
+android.jar} file with a fully compliant Android library. In order to build an Android app, you must
+specify an SDK platform as your build target.</td>
+ <td>{@code <sdk>/platforms/<android-version>/}</td>
+ </tr>
+ <tr>
+ <td>System Images</td>
+ <td>Each platform version offers one or more different system images (such as for ARM
+and x86). The Android emulator requires a system image to operate. You should always test your
+app on the latest version of Android and using the emulator with the latest system image is a
+good way to do so.</td>
+ <td>{@code <sdk>/platforms/<android-version>/}</td>
+ </tr>
+ <tr>
+ <td>Sources for Android SDK</td>
+ <td>A copy of the Android platform source code that's useful for
+stepping through the code while debugging your app.</td>
+ <td>{@code <sdk>/sources/}</td>
+ </tr>
+ <tr>
+ <td><a href="{@docRoot}tools/samples/index.html">Samples for SDK</a></td>
+ <td>A collection of sample apps that demonstrate a variety of the
+platform APIs. These are a great resource to browse Android app code. The API Demos app in
+particular provides a huge number of small demos you should explore.</td>
+ <td>{@code <sdk>/platforms/<android-version>/samples/}</td>
+ </tr>
+ <tr>
+ <td><a href="http://developers.google.com/android">Google APIs</a></td>
+ <td>An SDK add-on that provides both a platform you can use to develop an app
+using special Google APIs and a system image for the emulator so you can test your app using the
+Google APIs.</td>
+ <td>{@code <sdk>/add-ons/}</td>
+ </tr>
+
+ <tr>
+ <td><a href="{@docRoot}tools/extras/support-library.html">Android Support</a></td>
+ <td>A static library you can include in your app sources in order to use powerful
+APIs that aren't available in the standard platform. For example, the support library
+contains versions of the {@link android.support.v4.app.Fragment} class that's compatible with
+Android 1.6 and higher (the class was originally introduced in Android 3.0) and the {@link
+android.support.v4.view.ViewPager} APIs that allow you to easily build a side-swipeable UI.</td>
+ <td>{@code <sdk>/extras/android/support/}</td>
+ </tr>
+ <tr>
+ <td><a href="{@docRoot}guide/google/play/billing/index.html">Google Play Billing</a></td>
+ <td>Provides the static libraries and samples that allow you to
+integrate billing services in your app with Google Play.</td>
+ <td>{@code <sdk>/extras/google/}</td>
+ </tr>
+ <tr>
+ <td><a href="{@docRoot}guide/google/play/licensing/index.html">Google Play Licensing</a></td>
+ <td>Provides the static libraries and samples that allow you to perform license verification for
+your app when distributing with Google Play.</td>
+ <td>{@code <sdk>/extras/google/}</td>
+ </tr>
+</table>
+
+<p>The above table is not comprehensive and you can <a
+href="#AddingSites">add new sites</a> to download additional packages from third-parties.</p>
+
+<p>In some cases, an SDK package may require a specific minimum revision of
+another package or SDK tool. For example, there may be a dependency between the ADT Plugin for
+Eclipse and
+the SDK Tools package. When you install the SDK Tools
+package, you should also upgrade to the required version of ADT (if you
+are developing in Eclipse). In this case, the major version number for your ADT plugin should
+always match the revision number of your SDK Tools (for example, ADT 8.x requires SDK Tools r8).
+</p>
+
+<p>The development tools will notify you with debug warnings if there is dependency that you need to
+address. The Android SDK Manager also enforces dependencies by requiring that you download any
+packages that are needed by those you have selected.</p>
+
+
+
+
+
+<h2 id="AddingSites">Adding New Sites</h2>
+
+<p>By default, <strong>Available Packages</strong> displays packages available from the
+<em>Android Repository</em> and <em>Third party Add-ons</em>. You can add other sites that host
+their own Android SDK add-ons, then download the SDK add-ons
+from those sites.</p>
+
+<p>For example, a mobile carrier or device manufacturer might offer additional
+API libraries that are supported by their own Android-powered devices. In order
+to develop using their libraries, you must install their Android SDK add-on, if it's not already
+available under <em>Third party Add-ons</em>. </p>
+
+<p>If a carrier or device manufacturer has hosted an SDK add-on repository file
+on their web site, follow these steps to add their site to the Android SDK
+Manager:</p>
+
+<ol>
+ <li>Select <strong>Available Packages</strong> in the left panel.</li>
+ <li>Click <strong>Add Add-on Site</strong> and enter the URL of the
+<code>repository.xml</code> file. Click <strong>OK</strong>.</li>
+</ol>
+<p>Any SDK packages available from the site will now be listed under a new item named
+<strong>User Add-ons</strong>.</p>
+
+
+
+
+<h2 id="troubleshooting">Troubleshooting</h2>
+
+<p><strong>Problems connecting to the SDK repository</strong></p>
+
+<p>If you are using the Android SDK Manager to download packages and are encountering
+connection problems, try connecting over http, rather than https. To switch the
+protocol used by the Android SDK Manager, follow these steps: </p>
+
+<ol>
+ <li>With the Android SDK Manager window open, select "Settings" in the
+ left pane. </li>
+ <li>On the right, in the "Misc" section, check the checkbox labeled "Force
+ https://... sources to be fetched using http://..." </li>
+ <li>Click <strong>Save & Apply</strong>.</li>
+</ol>
+
+
+
+
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index b56ccdb..e788ffe 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -1,6 +1,6 @@
page.title=Android SDK
+header.hide=1
page.metaDescription=Download the official Android SDK to develop apps for Android-powered devices.
-sdk.redirect=0
sdk.win_installer=installer_r18-windows.exe
sdk.win_installer_bytes=37456234
@@ -20,28 +20,119 @@
@jd:body
-<div class="non-preview">
-<p>Here's an overview of the steps you must follow to set up the Android SDK:</p>
-
-<ol>
- <li>Prepare your development computer and ensure it meets the system requirements.</li>
- <li>Install the SDK starter package from the table above. (If you're on Windows, download the
-installer for help with the initial setup.)</li>
- <li>Install the ADT Plugin for Eclipse (if you'll be developing in Eclipse).</li>
- <li>Add Android platforms and other packages to your SDK.</li>
- <li>Explore the contents of the Android SDK (optional).</li>
-</ol>
-
-<p class="online-message">To get started, download the appropriate package from the table above,
-then read the guide to <a href="installing.html">Installing the SDK</a>.</p>
-
-<!-- non-inline style and based on only one selector so that
- it can be overriden by the sdkpage.cs template -->
<style type="text/css">
- .offline-message { display:none; }
+ .offline { display:none; }
</style>
-<p class="offline-message">For more information about how to set up your
-development environment, read the guide to <a href="installing.html">Installing the SDK</a>.</p>
+<div class="wrap">
+
+<div class="col-13"> </div><!-- provides top margin for content -->
+
+<div class="col-7" style="margin-left:0">
+ <img src="{@docRoot}images/sdk-cube.png" alt="" />
+</div>
+
+
+<div class="col-6" style="margin-right:0;">
+
+<div id="intro" style="position:absolute;width:inherit">
+<h1 style="margin-top:0">Get the Android SDK</h1>
+
+
+<p>The Android SDK provides you the API libraries and developer tools necessary to build, test,
+ and debug apps for Android.</p>
+
+<!-- this appears when viewing the offline docs -->
+<p class="offline">
+To get the latest Android SDK, please visit the web site at <a
+href="http://developer.android.com/sdk/index.html">developer.android.com/sdk/</a>
+</p>
+
+<!-- this appears when viewing the online docs -->
+<div class="online">
+<a class="big button disabled" id="download-button" href="" >Sorry, the SDK does not support
+your OS</a>
+
+<p style="margin-top:20px;font-size:12px"><a href='' onclick="
+ if ($('.pax').is(':visible')) {
+ $('.pax').slideUp();
+ } else {
+ $('.reqs').slideUp();
+ $('.pax').slideDown();
+ }return false;">Other platforms</a> |
+ <a href='' onclick="
+ if ($('.reqs').is(':visible')) {
+ $('.reqs').slideUp();
+ } else {
+ $('.pax').slideUp();
+ $('.reqs').slideDown();
+ }return false;">System requirements</a></p>
+</div><!-- end online -->
+
+</div><!-- end intro -->
+
+
+
+<div id="next-steps" class="online" style="display:none;position:absolute;width:inherit">
+ <h1 style="margin-top:0">Get ready to code!</h1>
+ <p><em><span id="filename"></span></em> is now downloading...</p>
+ <p>You'll soon be developing apps for Android! Once the download completes,
+ you need to follow a few steps to set up your environment.</p>
+ <p>To continue, follow the guide to <a href="{@docRoot}sdk/installing/index.html">Installing
+the SDK</a>.</p>
+
+</div><!-- end next-steps -->
+
+</div><!-- end col-6 -->
+
+
+<div class="col-13"> </div><!-- provides padding -->
+
+
+<div class="col-6 reqs" style="margin-left:0;display:none;font-size:12px">
+<h3>Operating Systems</h3>
+<ul>
+ <li>Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-bit)</li>
+ <li>Mac OS X 10.5.8 or later (x86 only)</li>
+ <li>Linux (tested on Ubuntu Linux, Lucid Lynx)
+ <ul>
+ <li>GNU C Library (glibc) 2.7 or later is required.</li>
+ <li>On Ubuntu Linux, version 8.04 or later is required.</li>
+ <li>64-bit distributions must be capable of running 32-bit applications.</li>
+ </ul>
+ </li>
+</ul>
+</div>
+
+<div class="col-7 reqs" style="margin-right:0;display:none;font-size:12px">
+<h3>Eclipse IDE</h3>
+ <ul>
+ <li>Eclipse 3.6.2 (Helios) or greater
+<p class="note"><strong>Note:</strong> Eclipse 3.5 (Galileo) is no longer
+supported with the latest version of ADT.</p></li>
+ <li>Eclipse <a href="http://www.eclipse.org/jdt">JDT</a> plugin (included
+in most Eclipse IDE packages) </li>
+ <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 6</a>
+ (JRE alone is not sufficient)</li>
+ <li><a href="{@docRoot}tools/sdk/eclipse-adt.html">Android Development Tools plugin</a>
+(recommended)</li>
+ <li><strong>Not</strong> compatible with Gnu Compiler for Java (gcj)</li>
+ </ul>
+
+
+<h3>Other development environments</h3>
+ <ul>
+ <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 6</a>
+ (JRE alone is not sufficient)</li>
+ <li><a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later</li>
+ <li><strong>Not</strong> compatible with Gnu Compiler for Java (gcj)</li>
+ </ul>
+ </li>
+</ul>
+
+<p class="note"><strong>Note:</strong> Some Linux distributions may include JDK 1.4 or Gnu Compiler
+for Java, both of which are <em>not</em> supported for Android development. </p>
+</div>
</div>
+
diff --git a/docs/html/sdk/installing.jd b/docs/html/sdk/installing.jd
deleted file mode 100644
index 7461eb0..0000000
--- a/docs/html/sdk/installing.jd
+++ /dev/null
@@ -1,590 +0,0 @@
-page.title=Installing the SDK
-
-@jd:body
-
-
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot +
-"assets/images/triangle-opened.png"));
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot +
-"assets/images/triangle-closed.png"));
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
- padding: .25em 1em 0em 1em;
- margin-bottom: 0;
-}
-.toggleme {
- padding: 1em 1em 0 2em;
- line-height:1em;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleme a {
- text-decoration:underline;
-}
-.toggleable.closed .toggleme {
- display:none;
-}
-#jd-content .toggle-img {
- margin:0;
-}
-</style>
-
-<div id="qv-wrapper">
-<div id="qv">
-
- <h2>In this document</h2>
- <ol>
- <li><a href="#Preparing">1. Preparing Your Development Computer</a></li>
- <li><a href="#Installing">2. Downloading the SDK Starter Package</a></li>
- <li><a href="#InstallingADT">3. Installing the ADT Plugin for Eclipse</a></li>
- <li><a href="#AddingComponents">4. Adding Platforms and Other Packages</a>
- <ol>
- <li><a href="#components">Available Packages</a></li>
- <li><a href="#which">Recommended Packages</a></li>
- </ol></li>
- <li><a href="#sdkContents">5. Exploring the SDK (Optional)</a></li>
- <li><a href="#NextSteps">Next Steps</a></li>
- <li><a href="#troubleshooting">Troubleshooting</a></li>
- </ol>
-
-<h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin for Eclipse</a></li>
- <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a></li>
- </ol>
-
-</div>
-</div>
-
-<p>This page describes how to install the Android SDK
-and set up your development environment for the first time.</p>
-
-<p>If you encounter any problems during installation, see the
-<a href="#troubleshooting">Troubleshooting</a> section at the bottom of
-this page.</p>
-
-<h4>Updating?</h4>
-
-<p>If you already have an Android SDK, use the Android SDK Manager tool to install
-updated tools and new Android platforms into your existing environment. For information about how to
-do that, see <a href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a>.</p>
-
-
-<h2 id="Preparing">Step 1. Preparing Your Development Computer</h2>
-
-<p>Before getting started with the Android SDK, take a moment to confirm that
-your development computer meets the <a href="requirements.html">System
-Requirements</a>. In particular, you might need to install the <a
-href="http://java.sun.com/javase/downloads/index.jsp">JDK</a>, if you don't have it already. </p>
-
-<p>If you will be developing in Eclipse with the Android Development
-Tools (ADT) Plugin—the recommended path if you are new to
-Android—make sure that you have a suitable version of Eclipse
-installed on your computer as described in the
-<a href="requirements.html">System Requirements</a> document.
-If you need to install Eclipse, you can download it from this location: </p>
-
-<p style="margin-left:2em;"><a href=
-"http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a></p>
-
-<p>The "Eclipse Classic" version is recommended. Otherwise, a Java or
-RCP version of Eclipse is recommended.</p>
-
-
-<h2 id="Installing">Step 2. Downloading the SDK Starter Package</h2>
-
-<p>The SDK starter package is not a full
-development environment—it includes only the core SDK Tools, which you can
-use to download the rest of the SDK packages (such as the latest Android platform).</p>
-
-<p>If you haven't already, get the latest version of the SDK starter package from the <a
-href="{@docRoot}sdk/index.html">SDK download page</a>.</p>
-
-<p>If you downloaded a {@code .zip} or {@code .tgz} package (instead of the SDK installer), unpack
-it to a safe location on your machine. By default, the SDK files are unpacked
-into a directory named <code>android-sdk-<machine-platform></code>.</p>
-
-<p>If you downloaded the Windows installer ({@code .exe} file), run it now and it will check
-whether the proper Java SE Development Kit (JDK) is installed (installing it, if necessary), then
-install the SDK Tools into a default location (which you can modify).</p>
-
-<p>Make a note of the name and location of the SDK directory on your system—you will need to
-refer to the SDK directory later, when setting up the ADT plugin and when using
-the SDK tools from the command line.</p>
-
-
-<h2 id="InstallingADT">Step 3. Installing the ADT Plugin for Eclipse</h2>
-
-<p>Android offers a custom plugin for the Eclipse IDE, called Android
-Development Tools (ADT), that is designed to give you a powerful, integrated
-environment in which to build Android applications. It extends the capabilites
-of Eclipse to let you quickly set up new Android projects, create an application
-UI, debug your applications
-using the Android SDK tools, and even export signed (or unsigned) APKs in order
-to distribute your application. In general, developing in Eclipse with ADT is a
-highly recommended approach and is the fastest way to get started with Android.
-</p>
-
-<p>If you'd like to use ADT for developing Android applications, install it now.
-Read <a href="{@docRoot}sdk/eclipse-adt.html#installing">Installing the ADT Plugin</a> for
-step-by-step installation instructions, then return here to continue the
-last step in setting up your Android SDK.</p>
-
-<p>If you prefer to work in a different IDE, you do not need to
-install Eclipse or ADT. Instead, you can directly use the SDK tools to build and
-debug your application. The <a href="{@docRoot}guide/developing/index.html">Introduction</a>
-to Android application development outlines the major steps that you need to complete when
-developing in Eclipse or other IDEs.</p>
-
-
-
-<h2 id="AddingComponents">Step 4. Adding Platforms and Other Packages</h2>
-
-<p>The last step in setting up your SDK is using the Android SDK Manager (a
-tool included in the SDK starter package) to download essential SDK packages into your development
-environment.</p>
-
-<p>The SDK uses a modular structure that separates the major parts of the SDK—Android platform
-versions, add-ons, tools, samples, and documentation—into a set of separately installable
-packages. The SDK starter package, which you've already downloaded, includes only a single
-package: the latest version of the SDK Tools. To develop an Android application, you also need to
-download at least one Android platform and the associated platform tools. You can add other
-packages and platforms as well, which is highly recommended.</p>
-
-<p>If you used the Windows installer, when you complete the installation wizard, it will launch the
-Android SDK Manager with a default set of platforms and other packages selected
-for you to install. Simply click <strong>Install</strong> to accept the recommended set of
-packages and install them. You can then skip to <a href="#sdkContents">Step 5</a>, but we
-recommend you first read the section about the <a href="#components">Available Packages</a> to
-better understand the packages available from the Android SDK Manager.</p>
-
-<p>You can launch the Android SDK Manager in one of the following ways:</p>
-<ul>
- <li>From within Eclipse, select <strong>Window > Android SDK Manager</strong>.</li>
- <li>On Windows, double-click the <code>SDK Manager.exe</code> file at the root of the Android
-SDK directory.</li>
- <li>On Mac or Linux, open a terminal and navigate to the <code>tools/</code> directory in the
-Android SDK, then execute: <pre>android</pre> </li>
-</ul>
-
-<p>To download packages, use the graphical UI of the Android SDK
-Manager to browse the SDK repository and select new or updated
-packages (see figure 1). The Android SDK Manager installs the selected packages in
-your SDK environment. For information about which packages you should download, see <a
-href="#which">Recommended Packages</a>.</p>
-
-<img src="/images/sdk_manager_packages.png" />
-<p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager's
-<strong>Available Packages</strong> panel, which shows the SDK packages that are
-available for you to download into your environment.</p>
-
-
-<h3 id="components">Available Packages</h3>
-
-<p>By default, there are two repositories of packages for your SDK: <em>Android
-Repository</em> and <em>Third party Add-ons</em>.</p>
-
-<p>The <em>Android Repository</em> offers these types of packages:</p>
-
-<ul>
-<li><strong>SDK Tools</strong> — Contains tools for debugging and testing your application
-and other utility tools. These tools are installed with the Android SDK starter package and receive
-periodic updates. You can access these tools in the <code><sdk>/tools/</code> directory of
-your SDK. To learn more about
-them, see <a href="{@docRoot}guide/developing/tools/index.html#tools-sdk">SDK Tools</a> in the
-developer guide.</li>
-
-<li><strong>SDK Platform-tools</strong> — Contains platform-dependent tools for developing
-and debugging your application. These tools support the latest features of the Android platform and
-are typically updated only when a new platform becomes available. You can access these tools in the
-<code><sdk>/platform-tools/</code> directory. To learn more about them, see <a
-href="{@docRoot}guide/developing/tools/index.html#tools-platform">Platform Tools</a> in the
-developer guide.</li>
-
-<li><strong>Android platforms</strong> — An SDK platform is
-available for every production Android platform deployable to Android-powered devices. Each
-SDK platform package includes a fully compliant Android library, system image, sample code,
-and emulator skins. To learn more about a specific platform, see the list of platforms that appears
-under the section "Downloadable SDK Packages" on the left part of this page.</li>
-
-<li><strong>USB Driver for Windows</strong> (Windows only) — Contains driver files
-that you can install on your Windows computer, so that you can run and debug
-your applications on an actual device. You <em>do not</em> need the USB driver unless
-you plan to debug your application on an actual Android-powered device. If you
-develop on Mac OS X or Linux, you do not need a special driver to debug
-your application on an Android-powered device. See <a
-href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a> for more information
-about developing on a real device.</li>
-
-<li><strong>Samples</strong> — Contains the sample code and apps available
-for each Android development platform. If you are just getting started with
-Android development, make sure to download the samples to your SDK. <!--The download
-includes not only a set of very useful sample apps, but also the source for <a
-href="{@docRoot}resources/tutorials/hello-world.html">Hello World</a> and other
-tutorials. --></li>
-
-<li><strong>Documentation</strong> — Contains a local copy of the latest
-multiversion documentation for the Android framework API. </li>
-</ul>
-
-<p>The <em>Third party Add-ons</em> provide packages that allow you to create a development
-environment using a specific Android external library (such as the Google Maps library) or a
-customized (but fully compliant) Android system image. You can add additional Add-on repositories by
-clicking <strong>Add Add-on Site</strong>.</p>
-
-
-<h3 id="which">Recommended Packages</h3>
-
-<p>The SDK repository contains a range of packages that you can download.
-Use the table below to determine which packages you need, based on whether you
-want to set up a basic, recommended, or full development environment:
-</p>
-
-<table style="width:95%">
-
-<tr>
-<th>Environment</th>
-<th>SDK Package</th>
-<th>Comments</th>
-</tr>
-
-<tr>
-<td rowspan="3" style="font-size:.9em;background-color:#FFE;">Basic</td>
-<td style="font-size:.9em;background-color:#FFE;">SDK Tools</td>
-<td style="font-size:.9em;background-color:#FFE;">If you've just installed
-the SDK starter package, then you already have the latest version of this package. The
-SDK Tools package is required to develop an Android application. Make sure you keep this up to
-date.</td>
-</tr>
-
-<tr>
-<td style="font-size:.9em;background-color:#FFE;">SDK Platform-tools</td>
-<td style="font-size:.9em;background-color:#FFE;">This includes more tools that are required
-for application development. These tools are platform-dependent and typically update only when
-a new SDK platform is made available, in order to support new features in the platform. These
-tools are always backward compatible with older platforms, but you must be sure that you have
-the latest version of these tools when you install a new SDK platform.</td>
-</tr>
-
-<tr>
-<td style="font-size:.9em;background-color:#FFE;">SDK platform</td>
-<td style="font-size:.9em;background-color:#FFE;">You need to download <strong
-style="color:red">at least one platform</strong> into your environment, so that
-you will be able to compile your application and set up an Android Virtual
-Device (AVD) to run it on (in the emulator). To start with, just download the
-latest version of the platform. Later, if you plan to publish your application,
-you will want to download other platforms as well, so that you can test your
-application on the full range of Android platform versions that your application supports.</td>
-</tr>
-<tr>
-<td colspan="2"
-style="border:none;text-align:center;font-size:1.5em;font-weight:bold;">+</td><td
-style="border:none"></td>
-</tr>
-<tr>
-<td rowspan="3">Recommended<br/>(plus Basic)</td>
-<td>Documentation</td>
-<td>The Documentation package is useful because it lets you work offline and
-also look up API reference information from inside Eclipse.</td>
-</tr>
-
-<tr>
-<td>Samples</td>
-<td>The Samples packages give you source code that you can use to learn about
-Android, load as a project and run, or reuse in your own app. Note that multiple
-samples packages are available — one for each Android platform version. When
-you are choosing a samples package to download, select the one whose API Level
-matches the API Level of the Android platform that you plan to use.</td>
-</tr>
-<tr>
-<td>Usb Driver</td>
-<td>The Usb Driver package is needed only if you are developing on Windows and
-have an Android-powered device on which you want to install your application for
-debugging and testing. For Mac OS X and Linux platforms, no
-special driver is needed.</td>
-</tr>
-<tr>
-<td colspan="2"
-style="border:none;text-align:center;font-size:1.5em;font-weight:bold;">+</td><td
-style="border:none"></td>
-</tr>
-<tr>
-<td rowspan="3">Full<br/>(plus Recommended)</td>
-<td>Google APIs</td>
-<td>The Google APIs add-on gives your application access to the Maps external
-library, which makes it easy to display and manipulate Maps data in your
-application. </td>
-</tr>
-<tr>
-<td>Additional SDK Platforms</td>
-<td>If you plan to publish your application, you will want to download
-additional platforms corresponding to the Android platform versions on which you
-want the application to run. The recommended approach is to compile your
-application against the lowest version you want to support, but test it against
-higher versions that you intend the application to run on. You can test your
-applications on different platforms by running in an Android Virtual Device
-(AVD) on the Android emulator.</td>
-</tr>
-
-</table>
-
-<p>Once you've installed at least the basic configuration of SDK packages, you're ready to start
-developing Android apps. The next section describes the contents of the Android SDK to familiarize
-you with the packages you've just installed.</p>
-
-<p>For more information about using the Android SDK Manager, see the <a
-href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a> document. </p>
-
-
-<h2 id="sdkContents">Step 5. Exploring the SDK (Optional)</h2>
-
-<p>Once you've installed the SDK and downloaded the platforms, documentation,
-and add-ons that you need, we suggest that you open the SDK directory and take a look at what's
-inside.</p>
-
-<p>The table below describes the full SDK directory contents, with packages
-installed. </p>
-
-<table>
-<tr>
-<th colspan="3">Name</th><th>Description</th>
-</tr>
-<tr>
-<td colspan="3"><code>add-ons/</code></td>
-<td>Contains add-ons to the Android SDK development
-environment, which let you develop against external libraries that are available on some
-devices. </td>
-</tr>
-<tr>
-<td colspan="3"><code>docs/</code></td>
-<td>A full set of documentation in HTML format, including the Developer's Guide,
-API Reference, and other information. To read the documentation, load the
-file <code>offline.html</code> in a web browser.</td>
-</tr>
-<tr>
-<td colspan="3"><code>platform-tools/</code></td>
-<td>Contains platform-dependent development tools that may be updated with each platform release.
-The platform tools include the Android Debug Bridge ({@code adb}) as well as other tools that you
-don't typically use directly. These tools are separate from the development tools in the {@code
-tools/} directory because these tools may be updated in order to support new
-features in the latest Android platform.</td>
-</tr>
-<tr>
-<td colspan="3"><code>platforms/</code></td>
-<td>Contains a set of Android platform versions that you can develop
-applications against, each in a separate directory. </td>
-</tr>
-<tr>
-<td style="width:2em;"></td>
-<td colspan="2"><code><em><platform></em>/</code></td>
-<td>Platform version directory, for example "android-11". All platform version directories contain
-a similar set of files and subdirectory structure. Each platform directory also includes the
-Android library (<code>android.jar</code>) that is used to compile applications against the
-platform version.</td>
-</tr>
-<tr>
-<td colspan="3"><code>samples/</code></td>
-<td>Sample code and apps that are specific to platform version.</td>
-</tr>
-<tr>
-<td colspan="3"><code>tools/</code></td>
-<td>Contains the set of development and profiling tools that are platform-independent, such
-as the emulator, the Android SDK Manager, the AVD Manager, <code>ddms</code>,
-<code>hierarchyviewer</code>
-and more. The tools in this directory may be updated at any time using the Android SDK
-Manager and are independent of platform releases.</td>
-</tr>
-<tr>
-<td colspan="3"><code>SDK Readme.txt</code></td>
-<td>A file that explains how to perform the initial setup of your SDK,
-including how to launch the Android SDK Manager tool on all
-platforms.</td>
-</tr>
-<tr>
-<td colspan="3"><code>SDK Manager.exe</code></td>
-<td>Windows SDK only. A shortcut that launches the Android SDK
-Manager tool, which you use to add packages to your SDK.</td>
-</tr>
-<!--<tr>
-<td colspan="3"><code>documentation.html</code></td>
-<td>A file that loads the entry page for the local Android SDK
-documentation.</td>
-</tr>-->
-
-</table>
-
-
-<p>Optionally, you might want to add the location of the SDK's <code>tools/</code> and
-<code>platform-tools</code> to your <code>PATH</code> environment variable, to provide easy
-access to the tools.</p>
-
-
-<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" />
- How to update your PATH</a>
- <div class="toggleme">
-
-<p>Adding both <code>tools/</code> and <code>platform-tools/</code> to your PATH lets you run
-command line <a href="{@docRoot}guide/developing/tools/index.html">tools</a> without needing to
-supply the full path to the tool directories. Depending on your operating system, you can
-include these directories in your PATH in the following way:</p>
-
-<ul>
-
- <li>On Windows, right-click on My Computer, and select Properties.
- Under the Advanced tab, hit the Environment Variables button, and in the
- dialog that comes up, double-click on Path (under System Variables). Add the full path to the
- <code>tools/</code> and <code>platform-tools/</code> directories to the path. </li>
-
- <li>On Linux, edit your <code>~/.bash_profile</code> or <code>~/.bashrc</code> file. Look
- for a line that sets the PATH environment variable and add the
- full path to the <code>tools/</code> and <code>platform-tools/</code> directories to it. If you
- don't see a line setting the path, you can add one:
- <pre>export PATH=${PATH}:<sdk>/tools:<sdk>/platform-tools</pre>
- </li>
-
- <li>On a Mac OS X, look in your home directory for <code>.bash_profile</code> and
- proceed as for Linux. You can create the <code>.bash_profile</code> if
- you don't already have one. </li>
-</ul>
-
-</div><!-- end toggleme -->
-</div><!-- end toggleable -->
-
-
-<h2 id="NextSteps">Next Steps</h2>
-<p>Once you have completed installation, you are ready to
-begin developing applications. Here are a few ways you can get started: </p>
-
-<p><strong>Set up the Hello World application</strong></p>
-<ul>
- <li>If you have just installed the SDK for the first time, go to the <a
- href="{@docRoot}resources/tutorials/hello-world.html">Hello
- World tutorial</a>. The tutorial takes you step-by-step through the process
- of setting up your first Android project, including setting up an Android
- Virtual Device (AVD) on which to run the application.
-</li>
-</ul>
-
-<p class="note">Following the Hello World tutorial is an essential
-first step in getting started with Android development. </p>
-
-<p><strong>Learn about Android</strong></p>
-<ul>
- <li>Take a look at the <a href="{@docRoot}guide/index.html">Dev
- Guide</a> and the types of information it provides.</li>
- <li>Read an introduction to Android as a platform in <a
- href="{@docRoot}guide/basics/what-is-android.html">What is
- Android?</a></li>
- <li>Learn about the Android framework and how applications run on it in
- <a href="{@docRoot}guide/topics/fundamentals.html">Application
- Fundamentals</a>.</li>
- <li>Take a look at the Android framework API specification in the <a
- href="{@docRoot}reference/packages.html">Reference</a> tab.</li>
-</ul>
-
-<p><strong>Explore the development tools</strong></p>
-<ul>
- <li>Get an overview of the <a
- href="{@docRoot}guide/developing/tools/index.html">development
- tools</a> that are available to you.</li>
- <li>Read the <a href="{@docRoot}guide/developing/index.html">Introduction</a> to Android
-application development.
- </li>
- <li>Read <a href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a> to learn
-how to set up an Android-powered device so you can run and test your application.</li>
-</ul>
-
-<p><strong>Follow the Notepad tutorial</strong></p>
-
-<ul>
- <li>The <a href="{@docRoot}resources/tutorials/notepad/index.html">
- Notepad Tutorial</a> shows you how to build a full Android application
- and provides helpful commentary on the Android system and API. The
- Notepad tutorial helps you bring together the important design
- and architectural concepts in a moderately complex application.
- </li>
-</ul>
-<p class="note">Following the Notepad tutorial is an excellent
-second step in getting started with Android development. </p>
-
-<p><strong>Explore some code</strong></p>
-
-<ul>
- <li>The Android SDK includes sample code and applications for each platform
-version. You can browse the samples in the <a
-href="{@docRoot}resources/index.html">Resources</a> tab or download them
-into your SDK using the Android SDK Manager. Once you've downloaded the
-samples, you'll find them in
-<code><em><sdk></em>/samples/<em><platform>/</em></code>. </li>
-</ul>
-
-<p><strong>Visit the Android developer groups</strong></p>
-<ul>
- <li>Take a look at the <a
- href="{@docRoot}resources/community-groups.html">Community</a> pages to see a list of
- Android developers groups. In particular, you might want to look at the
- <a href="http://groups.google.com/group/android-developers">Android
- Developers</a> group to get a sense for what the Android developer
- community is like.</li>
-</ul>
-
-<h2 id="troubleshooting">Troubleshooting</h2>
-
-<h3>Ubuntu Linux Notes</h3>
-
-<ul>
- <li>If you need help installing and configuring Java on your
- development machine, you might find these resources helpful:
- <ul>
- <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/Java </a></li>
- <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/JavaInstallation</a></li>
- </ul>
- </li>
- <li>Here are the steps to install Java and Eclipse, prior to installing
- the Android SDK and ADT Plugin.
- <ol>
- <li>If you are running a 64-bit distribution on your development
- machine, you need to install the <code>ia32-libs</code> package using
- <code>apt-get:</code>:
- <pre>apt-get install ia32-libs</pre>
- </li>
- <li>Next, install Java: <pre>apt-get install sun-java6-jdk</pre></li>
- <li>The Ubuntu package manager does not currently offer an Eclipse 3.3
- version for download, so we recommend that you download Eclipse from
- eclipse.org (<a
- href="http://www.eclipse.org/downloads/">http://www.eclipse.org/
- downloads/</a>). A Java or RCP version of Eclipse is recommended.</li>
- <li>Follow the steps given in previous sections to install the SDK
- and the ADT plugin. </li>
- </ol>
- </li>
-</ul>
-
-<h3>Other Linux Notes</h3>
-
-<ul>
- <li>If JDK is already installed on your development computer, please
- take a moment to make sure that it meets the version requirements listed
- in the <a href="requirements.html">System Requirements</a>.
- In particular, note that some Linux distributions may include JDK 1.4 or Gnu
- Compiler for Java, both of which are not supported for Android development.</li>
-</ul>
diff --git a/docs/html/sdk/installing/adding-packages.jd b/docs/html/sdk/installing/adding-packages.jd
new file mode 100644
index 0000000..7765343
--- /dev/null
+++ b/docs/html/sdk/installing/adding-packages.jd
@@ -0,0 +1,78 @@
+page.title=Adding Platforms and Packages
+walkthru=1
+
+@jd:body
+
+
+<p>The Android SDK separates different parts of the SDK into separately downloadable packages. The
+SDK starter package that you've installed includes only the SDK Tools. To develop an Android app,
+you also need to download at least one Android platform and the latest SDK Platform-tools.</p>
+
+<p>You can update and install SDK packages at any time using the Android SDK Manager.</p>
+
+<p>If you've used the Windows installer to install the SDK tools, you should already have the
+Android SDK Manager open. Otherwise, you can launch the Android SDK Manager in one of the following
+ways:</p>
+<ul>
+ <li>On Windows, double-click the <code>SDK Manager.exe</code> file at the root of the Android
+SDK directory.</li>
+ <li>On Mac or Linux, open a terminal and navigate to the <code>tools/</code> directory in the
+Android SDK, then execute <code>android sdk</code>.</li>
+</ul>
+
+<p>When you open the Android SDK Manager, it automatically selects a set of recommended packages.
+Simply click <strong>Install</strong> to install the recommended packages. The Android SDK Manager
+installs the selected packages into
+your Android SDK environment. The following sections describe some of the available SDK
+packages and more about which ones we recommend you install.</p>
+
+<p>Once you have installed your packages, continue to the next page.</p>
+
+<img src="/images/sdk_manager_packages.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager shows the
+SDK packages that are available, already installed, or for which an update is available.</p>
+
+
+
+
+<h2 id="Recommended">Recommended Packages</h2>
+
+<p>Here's an outlines of the packages required and those we recommend you use:
+</p>
+
+<dl>
+ <dt>SDK Tools</dt>
+ <dd><strong>Required.</strong> Your new SDK installation already has the latest version. Make sure
+you keep this up to date.</dd>
+ <dt>SDK Platform-tools</dt>
+ <dd><strong>Required.</strong> You must install this package when you install the SDK for
+the first time.</dd>
+ <dt>SDK Platform</dt>
+ <dd><strong>Required.</strong>You need to download <strong
+style="color:red">at least one platform</strong> into your environment so you're
+able to compile your application. In order to provide the best user experience on the latest
+devices, we recommend that you use the latest platform version as your build target. You'll
+still be able to run your app on older versions, but you must build against the latest version
+in order to use new features when running on devices with the latest version of Android.</dd>
+ <dt>System Image</dt>
+ <dd>Recommended. Although you might have one or more Android-powered devices on which to test
+ your app, it's unlikely you have a device for every version of Android your app supports. It's
+a good practice to download a system image for each version of Android you support and use them
+to test your app on the Android emulator.</dd>
+ <dt>SDK Samples</dt>
+ <dd>Recommended. The samples give you source code that you can use to learn about
+Android, load as a project and run, or reuse in your own app. Note that multiple
+samples packages are available — one for each Android platform version. When
+you are choosing a samples package to download, select the one whose API Level
+matches the API Level of the Android platform that you plan to use.</dd>
+ <dt>Android Support</dt>
+ <dd>Recommended. The APIs available in this static library allow you to use a variety of new
+framework features (including some not available in even the latest version) on devices running
+a platform version as old as Android 1.6. For more information, read <a
+href="{@docRoot}tools/extras/support-library.html">Support Library</a>.</dd>
+</dl>
+
+
+<p class="note"><strong>Tip:</strong> For easy access to the SDK tools from a command line, add the
+location of the SDK's <code>tools/</code> and
+<code>platform-tools</code> to your <code>PATH</code> environment variable.</p>
diff --git a/docs/html/sdk/installing/index.jd b/docs/html/sdk/installing/index.jd
new file mode 100644
index 0000000..2ae6bed
--- /dev/null
+++ b/docs/html/sdk/installing/index.jd
@@ -0,0 +1,133 @@
+page.title=Installing the SDK
+walkthru=1
+
+@jd:body
+
+
+<p>You should have already downloaded the <a href="{@docRoot}sdk/index.html">Android SDK</a>. Now
+you need to set up your development environment.</p>
+
+<p>The SDK you've downloaded is not the complete SDK environment. It includes only the core SDK tools, which you can
+use to download the rest of the SDK packages (such as the latest system image).</p>
+
+
+<div id="win" class="docs" style="display:none">
+
+<h3>Getting started on Windows</h3>
+<p>Your download package is an executable file that starts an installer. The installer checks your machine
+ for required tools, such as the proper Java SE Development Kit (JDK) and installs it if necessary.
+ The installer then saves the Android SDK Tools into a default location (or you can specify the location).</p>
+
+<p>Make a note of the name and location of the SDK directory on your system—you will need to
+refer to the SDK directory later, when setting up the ADT plugin and when using
+the SDK tools from the command line.</p>
+
+<p>Once the tools are installed, the installer offers to start the Android SDK Manager. Start it and
+continue with the installation guide by clicking the
+<strong>Next</strong> link on the right.</p>
+
+</div>
+
+
+
+<div id="mac" class="docs" style="display:none">
+
+<h3>Getting started on Mac</h3>
+
+<p>Your download package is {@code .zip}.
+ Unpack it to a safe location on your machine. By default, the SDK files are unpacked
+into a directory named <code>android-sdk-mac_x86</code>.</p>
+
+<p>Make a note of the name and location of the SDK directory on your system—you will need to
+refer to the SDK directory later, when setting up the ADT plugin and when using
+the SDK tools from the command line.</p>
+
+<p>Now continue with the installation guide by clicking the
+<strong>Next</strong> link on the right.</p>
+
+</div>
+
+
+
+
+<div id="linux" class="docs" style="display:none">
+
+<h3>Getting started on Linux</h3>
+
+<p>Your download package is a {@code .tgz}.
+ Unpack it to a safe location on your machine. By default, the SDK files are unpacked
+into a directory named <code>android-sdk-linux_x86</code>.</p>
+
+<p>Make a note of the name and location of the SDK directory on your system—you will need to
+refer to the SDK directory later, when setting up the ADT plugin and when using
+the SDK tools from the command line.</p>
+
+<p>Now continue with the installation guide by clicking the
+<strong>Next</strong> link on the right.</p>
+
+
+<h4 id="Troubleshooting">Troubleshooting Ubuntu</h4>
+
+<ul>
+ <li>If you need help installing and configuring Java on your
+ development machine, you might find these resources helpful:
+ <ul>
+ <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/Java </a></li>
+ <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/JavaInstallation</a></li>
+ </ul>
+ </li>
+ <li>Here are the steps to install Java and Eclipse, prior to installing
+ the Android SDK and ADT Plugin.
+ <ol>
+ <li>If you are running a 64-bit distribution on your development
+ machine, you need to install the <code>ia32-libs</code> package using
+ <code>apt-get:</code>:
+ <pre>apt-get install ia32-libs</pre>
+ </li>
+ <li>Next, install Java: <pre>apt-get install sun-java6-jdk</pre></li>
+ <li>The Ubuntu package manager does not currently offer an Eclipse 3.3
+ version for download, so we recommend that you download Eclipse from
+ eclipse.org (<a
+ href="http://www.eclipse.org/downloads/">http://www.eclipse.org/
+ downloads/</a>). A Java or RCP version of Eclipse is recommended.</li>
+ <li>Follow the steps given in previous sections to install the SDK
+ and the ADT plugin. </li>
+ </ol>
+ </li>
+</ul>
+
+</div>
+
+<p><a href='' onclick='showAll();return false;'>Other platforms</a></p>
+
+<script>
+ var $osDocs;
+ if (navigator.appVersion.indexOf("Win")!=-1) {
+ $osDocs = $('#win');
+ } else if (navigator.appVersion.indexOf("Mac")!=-1) {
+ $osDocs = $('#mac');
+ } else if (navigator.appVersion.indexOf("Linux")!=-1) {
+ $osDocs = $('#linux');
+ }
+
+ if ($osDocs.length) {
+ // reveal only the docs for this OS
+ $osDocs.show();
+ } else {
+ // not running a compatible OS, so just show all the docs
+ $('.docs').show();
+ }
+
+ function showAll() {
+ $('.docs').each(function() {
+ if (!$(this).is(':visible')) {
+ console.log('show')
+ $(this).show();
+ } else {
+ console.log('hide')
+ $(this).hide();
+ $osDocs.show();
+ }
+ });
+ }
+</script>
diff --git a/docs/html/sdk/installing/installing-adt.jd b/docs/html/sdk/installing/installing-adt.jd
new file mode 100644
index 0000000..2925272
--- /dev/null
+++ b/docs/html/sdk/installing/installing-adt.jd
@@ -0,0 +1,206 @@
+page.title=Installing the Eclipse Plugin
+walkthru=1
+adt.zip.version=18.0.0
+adt.zip.download=ADT-18.0.0.zip
+adt.zip.bytes=12834793
+adt.zip.checksum=b446fa157ed97af79d1e21629201efbb
+
+@jd:body
+
+
+
+<p>Android offers a custom plugin for the Eclipse IDE, called Android
+Development Tools (ADT). This plugin is designed to give you a powerful, integrated
+environment in which to develop Android apps. It extends the capabilites
+of Eclipse to let you quickly set up new Android projects, build an app
+UI, debug your app, and export signed (or unsigned) app packages (APKs) for distribution.
+</p>
+
+<p>If you will be developing in Eclipse with the ADT Plugin, first make sure that you have a
+suitable version of Eclipse
+installed on your computer as described by the
+<a href="{@docRoot}tools/sdk/index.html#Requirements">system requirements</a>.</p>
+
+<p>If you need to install Eclipse, you can download it from <a href=
+"http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a>.
+We recommend the "Eclipse Classic" version. Otherwise, you should use a Java or
+RCP version of Eclipse.</p>
+
+
+<p class="note"><strong>Note:</strong> If you prefer to work in a different IDE, you do not need to
+install Eclipse or ADT. Instead, you can directly use the SDK tools to build and
+debug your application. So if you're not using Eclipse, continue to the next page by clicking
+the <strong>Next</strong> link on the right.</p>
+
+
+
+<h2 id="Download">Download the ADT Plugin</h2>
+
+
+<ol>
+ <li>Start Eclipse, then select <strong>Help</strong> > <strong>Install New
+Software...</strong>.</li>
+ <li>Click <strong>Add</strong>, in the top-right corner.</li>
+ <li>In the Add Repository dialog that appears, enter "ADT Plugin" for the <em>Name</em> and the
+following URL for the <em>Location</em>:
+ <pre>https://dl-ssl.google.com/android/eclipse/</pre>
+ </li>
+ <li>Click <strong>OK</strong>
+ <p>Note: If you have trouble acquiring the plugin, try using "http" in the Location URL,
+instead of "https" (https is preferred for security reasons).</p></li>
+ <li>In the Available Software dialog, select the checkbox next to Developer Tools and click
+<strong>Next</strong>.</li>
+ <li>In the next window, you'll see a list of the tools to be downloaded. Click
+<strong>Next</strong>. </li>
+ <li>Read and accept the license agreements, then click <strong>Finish</strong>.
+ <p>Note: If you get a security warning saying that the authenticity or validity of
+the software can't be established, click <strong>OK</strong>.</p></li>
+ <li>When the installation completes, restart Eclipse. </li>
+</ol>
+
+
+
+
+<h2 id="Configure">Configure the ADT Plugin</h2>
+
+<p>After you've installed ADT and restarted Eclipse, you
+ must specify the location of your Android SDK directory:</p>
+
+<ol>
+ <li>Select <strong>Window</strong> > <strong>Preferences...</strong> to open the Preferences
+ panel (on Mac OS X, select <strong>Eclipse</strong> > <strong>Preferences</strong>).</li>
+ <li>Select <strong>Android</strong> from the left panel.</li>
+ <p>You may see a dialog asking whether you want to send usage statistics to Google. If so,
+make your choice and click <strong>Proceed</strong>.</p>
+ <li>For the <em>SDK Location</em> in the main panel, click <strong>Browse...</strong> and
+ locate your downloaded Android SDK directory (such as <code>android-sdk-windows</code>).</li>
+ <li>Click <strong>Apply</strong>, then <strong>OK</strong>.</li>
+</ol>
+
+
+<p>If you haven't encountered any errors, you're done setting up ADT
+ and can continue to the next step of the SDK installation.</p>
+
+
+
+
+<h2 id="Updating">Updating the ADT Plugin</h2>
+
+<p>From time to time, a new revision of the ADT Plugin becomes available, with
+new features and bug fixes. Generally, when a new revision of ADT is available,
+you should update to it as soon as convenient. </p>
+
+<p>In some cases, a new revision of ADT will have a dependency on a specific
+revision of the Android SDK Tools. If such dependencies exist, you will need to
+update the SDK Tools package of the SDK after installing the new revision of
+ADT. To update the SDK Tools package, use the Android SDK Manager, as
+described in <a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>.</p>
+
+<p>To learn about new features of each ADT revision and also any dependencies on
+the SDK Tools, see the listings in the <a href="#notes">Revisions</a>
+section. To determine the version currently installed, open the
+Eclipse Installed Software window using <strong>Help</strong>
+> <strong>Software Updates</strong> and refer to the version listed for
+"Android Development Tools".</p>
+
+<p>Follow the steps below to check whether an update is available and, if so,
+to install it. </p>
+
+<ol>
+ <li>Select <strong>Help</strong> > <strong>Check for Updates</strong>.
+ <p>If there are no updates available, a dialog will say so and you're done.</p></li>
+ <li>If there are updates available, select Android DDMS, Android Development Tools,
+ and Android Hierarchy Viewer, then click <strong>Next</strong>.</li>
+ <li>In the Update Details dialog, click <strong>Next</strong>.</li>
+ <li>Read and accept the license agreement and then click <strong>Finish</strong>.
+ This will download and install the latest version of Android DDMS and
+ Android Development Tools.</li>
+ <li>Restart Eclipse.</li>
+</ol>
+
+
+<p>If you encounter problems during the update, remove the existing ADT plugin from Eclipse, then
+perform a fresh installation, using the instructions for <a href="#installing">Installing the ADT
+Plugin</a>.</p>
+
+
+
+<h2 id="Troubleshooting">Troubleshooting</h2>
+
+<p> If you are having trouble downloading the ADT plugin after following the
+steps above, here are some suggestions: </p>
+
+<ul>
+ <li>If Eclipse can not find the remote update site containing the ADT plugin,
+try changing the remote site URL to use http, rather than https. That is, set
+the Location for the remote site to:
+<pre>http://dl-ssl.google.com/android/eclipse/</pre></li>
+<li>If you are behind a firewall (such as a corporate firewall), make sure that
+you have properly configured your proxy settings in Eclipse. In Eclipse,
+you can configure proxy information from the main Eclipse menu in
+<strong>Window</strong> (on Mac OS X, <strong>Eclipse</strong>) >
+<strong>Preferences</strong> > <strong>General</strong> > <strong>Network
+Connections</strong>.</li>
+</ul>
+
+<p> If you are still unable to use Eclipse to download the ADT plugin as a
+remote update site, you can download the ADT zip file to your local machine and
+manually install it:</p>
+
+<ol>
+ <li>Download the current ADT Plugin zip file from the table below (do not unpack it).
+
+ <table class="download">
+ <tr>
+ <th>Name</th>
+ <th>Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>ADT {@adtZipVersion}</td>
+ <td>
+ <a href="http://dl.google.com/android/{@adtZipDownload}">{@adtZipDownload}</a>
+ </td>
+ <td>{@adtZipBytes} bytes</td>
+ <td>{@adtZipChecksum}</td>
+ </tr>
+</table>
+</li>
+
+</li>
+ <li>Follow steps 1 and 2 in the <a href="#installing">default install
+ instructions</a> (above).</li>
+ <li>In the Add Site dialog, click <strong>Archive</strong>.</li>
+ <li>Browse and select the downloaded zip file.</li>
+ <li>Enter a name for the local update site (e.g.,
+ "Android Plugin") in the "Name" field.</li>
+ <li>Click <strong>OK</strong>.
+ <li>Follow the remaining procedures as listed for
+ <a href="#installing">default installation</a> above,
+ starting from step 4.</li>
+</ol>
+
+<p>To update your plugin once you've installed using the zip file, you will have
+to follow these steps again instead of the default update instructions.</p>
+
+<h4>Other install errors</h4>
+
+<p>Note that there are features of ADT that require some optional
+Eclipse packages (for example, WST). If you encounter an error when
+installing ADT, your Eclipse installion might not include these packages.
+For information about how to quickly add the necessary packages to your
+Eclipse installation, see the troubleshooting topic
+<a href="{@docRoot}resources/faq/troubleshooting.html#installeclipsecomponents">ADT
+Installation Error: "requires plug-in org.eclipse.wst.sse.ui"</a>.</p>
+
+<h4>For Linux users</h4>
+<p>If you encounter this error when installing the ADT Plugin for Eclipse:
+<pre>
+An error occurred during provisioning.
+Cannot connect to keystore.
+JKS</pre>
+<p>
+...then your development machine lacks a suitable Java VM. Installing Sun
+Java 6 will resolve this issue and you can then reinstall the ADT
+Plugin.</p>
diff --git a/docs/html/sdk/installing/next.jd b/docs/html/sdk/installing/next.jd
new file mode 100644
index 0000000..b1da7c6
--- /dev/null
+++ b/docs/html/sdk/installing/next.jd
@@ -0,0 +1,52 @@
+page.title=Next Steps
+walkthru=1
+
+@jd:body
+
+
+<p>Now that you've installed the Android SDK, here are are a few ways to learn Android
+and start developing: </p>
+
+<h3>Start coding</h3>
+<ul>
+ <li>Follow the training class for <a
+href="{@docRoot}training/basics/firstapp/index.html">Building Your First App</a>.
+ <p>This class is an essential first step for new Android developers.</p>
+ <p>It gives you step by step instructions for building a simple app. You’ll learn how to
+create an Android project and run a debuggable version of the app. You'll also learn some
+fundamentals of Android app design, including how to build a simple user interface and handle user
+input.</p>
+</li>
+</ul>
+
+
+<h3>Learn how to design your app</h3>
+<ul>
+ <li>Learn the best practices for Android design and user experience by reading the Android <a
+href="{@docRoot}design/index.html">Design</a> guidelines.</li>
+</ul>
+
+
+<h3>Read up on the API framework</h3>
+<ul>
+ <li>Start reading about fundamental framework topics in the collection of <a
+href="{@docRoot}guide/components/index.html">API Guides</a>.</li>
+ <li>Browse the API specifications in the <a
+ href="{@docRoot}reference/packages.html">Reference</a>.</li>
+</ul>
+
+
+<h3>Explore the development tools</h3>
+<ul>
+ <li>Learn about developing an app with the Android Developer Tools plugin for Eclipse
+ and other tools from the <a
+ href="{@docRoot}tools/workflow/index.html">Workflow</a>.</li>
+</ul>
+
+
+<h3>Explore some code</h3>
+
+<ul>
+ <li>Browse the sample apps available from the Android SDK Manager. You'll find them in
+<code><em><sdk></em>/samples/<em><platform-version>/</em></code>. </li>
+</ul>
diff --git a/docs/html/sdk/ndk/index.jd b/docs/html/sdk/ndk/index.jd
deleted file mode 100644
index fddbcc7..0000000
--- a/docs/html/sdk/ndk/index.jd
+++ /dev/null
@@ -1,1055 +0,0 @@
-ndk=true
-
-ndk.win_download=android-ndk-r7c-windows.zip
-ndk.win_bytes=80361003
-ndk.win_checksum=e86184cdc4bf71d32fa9185fad8544e2
-
-ndk.mac_download=android-ndk-r7c-darwin-x86.tar.bz2
-ndk.mac_bytes=73836512
-ndk.mac_checksum=025f57feb5f32ed993a5fa7f5996477d
-
-ndk.linux_download=android-ndk-r7c-linux-x86.tar.bz2
-ndk.linux_bytes=63432410
-ndk.linux_checksum=0bc21b78823dcf6f86b988203626b1fe
-
-page.title=Android NDK
-
-@jd:body
-
-<h2 id="notes">Revisions</h2>
-
-<p>The sections below provide information and notes about successive releases of
-the NDK, as denoted by revision number. </p>
-
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", "{@docRoot}assets/images/triangle-opened.png");
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", "/assets/images/triangle-closed.png");
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
-padding: .25em 1em;
-}
-.toggleme {
- padding: 1em 1em 0 2em;
- line-height:1em;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleme a {
- text-decoration:underline;
-}
-.toggleable.closed .toggleme {
- display:none;}
-#jd-content .toggle-img {
- margin:0;
-}
-</style>
-
-<div class="toggleable open">
- <a href="#" onclick="return toggleDiv(this)"><img src=
- "{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px">
- Android NDK, Revision 7c</a> <em>(April 2012)</em>
-
- <div class="toggleme">
- <p>This release of the NDK includes an important fix for Tegra2-based devices, and a few
-additional fixes and improvements:</p>
-
- <dl>
- <dt>Important bug fixes:</dt>
-
- <dd>
- <ul>
- <li>Fixed GNU STL armeabi-v7a binaries to not crash on non-NEON
- devices. The files provided with NDK r7b were not configured properly,
- resulting in crashes on Tegra2-based devices and others when trying to use
- certain floating-point functions (e.g., {@code cosf}, {@code sinf}, {@code expf}).</li>
- </ul>
- </dd>
-
- <dt>Important changes:</dt>
-
- <dd>
- <ul>
- <li>Added support for custom output directories through the {@code NDK_OUT}
- environment variable. When defined, this variable is used to store all
- intermediate generated files, instead of {@code $PROJECT_PATH/obj}. The variable is
- also recognized by {@code ndk-gdb}. </li>
- <li>Added support for building modules with hundreds or even thousands of source
- files by defining {@code LOCAL_SHORT_COMMANDS} to {@code true} in your {@code Android.mk}.
- <p>This change forces the NDK build system to put most linker or archiver options
- into list files, as a work-around for command-line length limitations.
- See {@code docs/ANDROID-MK.html} for details.</p>
- </li>
- </ul>
- </dd>
-
- <dt>Other bug fixes:</dt>
-
- <dd>
- <ul>
- <li>Fixed {@code android_getCpuCount()} implementation in the {@code cpufeatures}
-helper library. On certain devices, where cores are enabled dynamically by the system, the previous
-implementation would report the total number of <em>active</em> cores the first time the function
-was called, rather than the total number of <em>physically available</em> cores.</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">
- Android NDK, Revision 7b</a> <em>(February 2012)</em>
-
- <div class="toggleme">
- <p>This release of the NDK includes fixes for native Windows builds, Cygwin and many other
- improvements:</p>
-
- <dl>
- <dt>Important bug fixes:</dt>
-
- <dd>
- <ul>
- <li>Updated {@code sys/atomics.h} to avoid correctness issues
- on some multi-core ARM-based devices. Rebuild your unmodified sources with this
- version of the NDK and this problem should be completely eliminated.
- For more details, read {@code docs/ANDROID-ATOMICS.html}.</li>
- <li>Reverted to {@code binutils} 2.19 to fix debugging issues that
- appeared in NDK r7 (which switched to {@code binutils} 2.20.1).</li>
- <li>Fixed {@code ndk-build} on 32-bit Linux. A packaging error put a 64-bit version
- of the {@code awk} executable under {@code prebuilt/linux-x86/bin} in NDK r7.</li>
- <li>Fixed native Windows build ({@code ndk-build.cmd}). Other build modes were not
- affected. The fixes include:
- <ul>
- <li>Removed an infinite loop / stack overflow bug that happened when trying
- to call {@code ndk-build.cmd} from a directory that was <em>not</em> the top of
- your project path (e.g., in any sub-directory of it).</li>
- <li>Fixed a problem where the auto-generated dependency files were ignored. This
- meant that updating a header didn't trigger recompilation of sources that included
- it.</li>
- <li>Fixed a problem where special characters in files or paths, other than spaces and
- quotes, were not correctly handled.</li>
- </ul>
- </li>
- <li>Fixed the standalone toolchain to generate proper binaries when using
- {@code -lstdc++} (i.e., linking against the GNU {@code libstdc++} C++ runtime). You
- should use {@code -lgnustl_shared} if you want to link against the shared library
- version or {@code -lstdc++} for the static version.
-
- <p>See {@code docs/STANDALONE-TOOLCHAIN.html} for more details about this fix.</p>
- </li>
- <li>Fixed {@code gnustl_shared} on Cygwin. The linker complained that it couldn't find
- {@code libsupc++.a} even though the file was at the right location.</li>
- <li>Fixed Cygwin C++ link when not using any specific C++ runtime through
- {@code APP_STL}.</li>
- </ul>
- </dd>
- </dl>
-
- <dl>
- <dt>Other changes:</dt>
-
- <dd>
- <ul>
- <li>When your application uses the GNU {@code libstdc++} runtime, the compiler will
- no longer forcibly enable exceptions and RTTI. This change results in smaller code.
- <p>If you need these features, you must do one of the following:</p>
- <ul>
- <li>Enable exceptions and/or RTTI explicitly in your modules or
- {@code Application.mk}. (recommended)</li>
- <li>Define {@code APP_GNUSTL_FORCE_CPP_FEATURES} to {@code 'exceptions'},
- {@code 'rtti'} or both in your {@code Application.mk}. See
- {@code docs/APPLICATION-MK.html} for more details.</li>
- </ul>
- </li>
- <li>{@code ndk-gdb} now works properly when your application has private services
- running in independent processes. It debugs the main application process, instead of the
- first process listed by {@code ps}, which is usually a service process.</li>
- <li>Fixed a rare bug where NDK r7 would fail to honor the {@code LOCAL_ARM_MODE} value
- and always compile certain source files (but not all) to 32-bit instructions.</li>
- <li>{@code stlport}: Refresh the sources to match the Android platform version. This
- update fixes a few minor bugs:
- <ul>
- <li>Fixed instantiation of an incomplete type</li>
- <li>Fixed minor "==" versus "=" typo</li>
- <li>Used {@code memmove} instead of {@code memcpy} in {@code string::assign}</li>
- <li>Added better handling of {@code IsNANorINF}, {@code IsINF}, {@code IsNegNAN},
- etc.</li>
- </ul>
- <p>For complete details, see the commit log.</p>
- </li>
- <li>{@code stlport}: Removed 5 unnecessary static initializers from the library.</li>
- <li>The GNU libstdc++ libraries for armeabi-v7a were mistakenly compiled for
- armeabi instead. This change had no impact on correctness, but using the right
- ABI should provide slightly better performance.</li>
- <li>The {@code cpu-features} helper library was updated to report three optional
- x86 CPU features ({@code SSSE3}, {@code MOVBE} and {@code POPCNT}). See
- {@code docs/CPU-FEATURES.html} for more details.</li>
- <li>{@code docs/NDK-BUILD.html} was updated to mention {@code NDK_APPLICATION_MK} instead
- of {@code NDK_APP_APPLICATION_MK} to select a custom {@code Application.mk} file.</li>
- <li>Cygwin: {@code ndk-build} no longer creates an empty "NUL" file in the current
- directory when invoked.</li>
- <li>Cygwin: Added better automatic dependency detection. In the previous version, it
- didn't work properly in the following cases:
- <ul>
- <li>When the Cygwin drive prefix was not {@code /cygdrive}.</li>
- <li>When using drive-less mounts, for example, when Cygwin would translate
- {@code /home} to {@code \\server\subdir} instead of {@code C:\Some\Dir}.</li>
- </ul>
- </li>
- <li>Cygwin: {@code ndk-build} does not try to use the native Windows tools under
- {@code $NDK/prebuilt/windows/bin} with certain versions of Cygwin and/or GNU Make.</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">
- Android NDK, Revision 7</a> <em>(November 2011)</em>
-
- <div class="toggleme">
- <p>This release of the NDK includes new features to support the Android 4.0 platform as well
- as many other additions and improvements:</p>
-
- <dl>
- <dt>New features</dt>
-
- <dd>
- <ul>
- <li>Added official NDK APIs for Android 4.0 (API level 14), which adds the following
- native features to the platform:
-
- <ul>
- <li>Added native multimedia API based on the Khronos Group OpenMAX AL™ 1.0.1
- standard. The new <code><OMXAL/OpenMAXAL.h></code> and
- <code><OMXAL/OpenMAXAL_Android.h></code> headers allow applications targeting
- API level 14 to perform multimedia output directly from native code by using a new
- Android-specific buffer queue interface. For more details, see
- <code>docs/openmaxal/index.html</code> and <a href=
- "http://www.khronos.org/openmax/">http://www.khronos.org/openmax/</a>.</li>
-
- <li>Updated the native audio API based on the Khronos Group OpenSL ES 1.0.1™
- standard. With API Level 14, you can now decode compressed audio (e.g. MP3, AAC,
- Vorbis) to PCM. For more details, see <code>docs/opensles/index.html</code> and
- <a href=
- "http://www.khronos.org/opensles">http://www.khronos.org/opensles/</a>.</li>
- </ul>
- </li>
-
- <li>Added CCache support. To speed up large rebuilds, define the
- <code>NDK_CCACHE</code> environment variable to <code>ccache</code> (or the path to
- your <code>ccache</code> binary). When declared, the NDK build system automatically
- uses CCache when compiling any source file. For example:
- <pre>
-export NDK_CCACHE=ccache
-</pre>
- <p class="note"><strong>Note:</strong> CCache is not included in the NDK release
- so you must have it installed prior to using it. For more information about CCache, see
- <a href="http://ccache.samba.org">http://ccache.samba.org</a>.</p>
- </li>
-
- <li>Added support for setting <code>APP_ABI</code> to <code>all</code> to indicate that
- you want to build your NDK modules for all the ABIs supported by your given NDK
- release. This means that either one of the following two lines in your
- <code>Application.mk</code> are equivalent with this release:
- <pre>
-APP_ABI := all
-APP_ABI := armeabi armeabi-v7a x86
-</pre>
-
- <p>This also works if you define <code>APP_ABI</code> when calling
- <code>ndk-build</code> from the command-line, which is a quick way to check that your
- project builds for all supported ABIs without changing the project's
- <code>Application.mk file</code>. For example:</p>
- <pre>
-ndk-build APP_ABI=all
-</pre>
- </li>
-
- <li>Added a <code>LOCAL_CPP_FEATURES</code> variable in <code>Android.mk</code> that
- allows you to declare which C++ features (RTTI or Exceptions) your module uses. This
- ensures that the final linking works correctly if you have prebuilt modules that depend
- on these features. See <code>docs/ANDROID-MK.html</code> and
- <code>docs/CPLUSPLUS-SUPPORT.html</code> for more details.</li>
-
- <li>Shortened paths to source and object files that are used in build commands. When
- invoking <code>$NDK/ndk-build</code> from your project path, the paths to the source,
- object, and binary files that are passed to the build commands are significantly
- shorter now, because they are passed relative to the current directory. This is useful
- when building projects with a lot of source files, to avoid limits on the maximum
- command line length supported by your host operating system. The behavior is unchanged
- if you invoke <code>ndk-build</code> from a sub-directory of your project tree, or if
- you define <code>NDK_PROJECT_PATH</code> to point to a specific directory.</li>
- </ul>
- </dd>
-
- <dt>Experimental features</dt>
-
- <dd>
- You can now build your NDK source files on Windows <em>without</em> Cygwin by calling the
- <code>ndk-build.cmd</code> script from the command line from your project path. The
- script takes exactly the same arguments as the original <code>ndk-build</code> script.
- The Windows NDK package comes with its own prebuilt binaries for GNU Make, Awk and other
- tools required by the build. You should not need to install anything else to get a
- working build system.
-
- <p class="caution"><strong>Important:</strong> <code>ndk-gdb</code> does not work on
- Windows, so you still need Cygwin to debug.</p>
-
- <p>This feature is still experimental, so feel free to try it and report issues on the
- <a href="http://b.android.com">public bug database</a> or <a href=
- "http://groups.google.com/group/android-ndk">public forum</a>. All samples and unit tests
- shipped with the NDK succesfully compile with this feature.</p>
- </dd>
-
- <dt>Important bug fixes</dt>
-
- <dd>
- <ul>
- <li>Imported shared libraries are now installed by default to the target installation
- location (<code>libs/<abi></code>) if <code>APP_MODULES</code> is not defined in
- your <code>Application.mk</code>. For example, if a top-level module <code>foo</code>
- imports a module <code>bar</code>, then both <code>libfoo.so</code> and
- <code>libbar.so</code> are copied to the install location. Previously, only
- <code>libfoo.so</code> was copied, unless you listed <code>bar</code> in your
- <code>APP_MODULES</code> too. If you define <code>APP_MODULES</code> explicitly, the
- behavior is unchanged.</li>
-
- <li><code>ndk-gdb</code> now works correctly for activities with multiple categories in
- their MAIN intent filters.</li>
-
- <li>Static library imports are now properly transitive. For example, if a top-level
- module <code>foo</code> imports static library <code>bar</code> that imports static
- library <code>zoo</code>, the <code>libfoo.so</code> will now be linked against both
- <code>libbar.a</code> and <code>libzoo.a</code>.</li>
- </ul>
- </dd>
-
- <dt>Other changes</dt>
-
- <dd>
- <ul>
- <li><code>docs/NATIVE-ACTIVITY.HTML</code>: Fixed typo. The minimum API level should be
- 9, not 8 for native activities.</li>
-
- <li><code>docs/STABLE-APIS.html</code>: Added missing documentation listing EGL as a
- supported stable API, starting from API level 9.</li>
-
- <li><code>download-toolchain-sources.sh</code>: Updated to download the toolchain
- sources from <a href="http://android.googlesource.com">android.googlesource.com</a>,
- which is the new location for the AOSP servers.</li>
-
- <li>Added a new C++ support runtime named <code>gabi++</code>. More details about it
- are available in the updated <code>docs/CPLUSPLUS-SUPPORT.html</code>.</li>
-
- <li>Added a new C++ support runtime named <code>gnustl_shared</code> that corresponds
- to the shared library version of GNU libstdc++ v3 (GPLv3 license). See more info at
- <code>docs/CPLUSPLUS-SUPPORT.html</code></li>
-
- <li>Added support for RTTI in the STLport C++ runtimes (no support for
- exceptions).</li>
-
- <li>Added support for multiple file extensions in <code>LOCAL_CPP_EXTENSION</code>. For
- example, to compile both <code>foo.cpp</code> and <code>bar.cxx</code> as C++ sources,
- declare the following:
- <pre>
-LOCAL_CPP_EXTENSION := .cpp .cxx
-</pre>
- </li>
-
- <li>Removed many unwanted exported symbols from the link-time shared system libraries
- provided by the NDK. This ensures that code generated with the standalone toolchain
- doesn't risk to accidentally depend on a non-stable ABI symbol (e.g. any libgcc.a
- symbol that changes each time the toolchain used to build the platform is changed)</li>
-
- <li>Refreshed the EGL and OpenGLES Khronos headers to support more extensions. Note
- that this does <em>not</em> change the NDK ABIs for the corresponding libraries,
- because each extension must be probed at runtime by the client application.
-
- <p>The extensions that are available depend on your actual device and GPU drivers,
- not the platform version the device runs on. The header changes simply add new
- constants and types to make it easier to use the extensions when they have been
- probed with <code>eglGetProcAddress()</code> or <code>glGetProcAddress()</code>. The
- following list describes the newly supported extensions:</p>
-
- <dl>
- <dt>GLES 1.x</dt>
-
- <dd>
- <ul>
- <li><code>GL_OES_vertex_array_object</code></li>
-
- <li><code>GL_OES_EGL_image_external</code></li>
-
- <li><code>GL_APPLE_texture_2D_limited_npot</code></li>
-
- <li><code>GL_EXT_blend_minmax</code></li>
-
- <li><code>GL_EXT_discard_framebuffer</code></li>
-
- <li><code>GL_EXT_multi_draw_arrays</code></li>
-
- <li><code>GL_EXT_read_format_bgra</code></li>
-
- <li><code>GL_EXT_texture_filter_anisotropic</code></li>
-
- <li><code>GL_EXT_texture_format_BGRA8888</code></li>
-
- <li><code>GL_EXT_texture_lod_bias</code></li>
-
- <li><code>GL_IMG_read_format</code></li>
-
- <li><code>GL_IMG_texture_compression_pvrtc</code></li>
-
- <li><code>GL_IMG_texture_env_enhanced_fixed_function</code></li>
-
- <li><code>GL_IMG_user_clip_plane</code></li>
-
- <li><code>GL_IMG_multisampled_render_to_texture</code></li>
-
- <li><code>GL_NV_fence</code></li>
-
- <li><code>GL_QCOM_driver_control</code></li>
-
- <li><code>GL_QCOM_extended_get</code></li>
-
- <li><code>GL_QCOM_extended_get2</code></li>
-
- <li><code>GL_QCOM_perfmon_global_mode</code></li>
-
- <li><code>GL_QCOM_writeonly_rendering</code></li>
-
- <li><code>GL_QCOM_tiled_rendering</code></li>
- </ul>
- </dd>
-
- <dt>GLES 2.0</dt>
-
- <dd>
- <ul>
- <li><code>GL_OES_element_index_uint</code></li>
-
- <li><code>GL_OES_get_program_binary</code></li>
-
- <li><code>GL_OES_mapbuffer</code></li>
-
- <li><code>GL_OES_packed_depth_stencil</code></li>
-
- <li><code>GL_OES_texture_3D</code></li>
-
- <li><code>GL_OES_texture_float</code></li>
-
- <li><code>GL_OES_texture_float_linear</code></li>
-
- <li><code>GL_OES_texture_half_float_linear</code></li>
-
- <li><code>GL_OES_texture_npot</code></li>
-
- <li><code>GL_OES_vertex_array_object</code></li>
-
- <li><code>GL_OES_EGL_image_external</code></li>
-
- <li><code>GL_AMD_program_binary_Z400</code></li>
-
- <li><code>GL_EXT_blend_minmax</code></li>
-
- <li><code>GL_EXT_discard_framebuffer</code></li>
-
- <li><code>GL_EXT_multi_draw_arrays</code></li>
-
- <li><code>GL_EXT_read_format_bgra</code></li>
-
- <li><code>GL_EXT_texture_format_BGRA8888</code></li>
-
- <li><code>GL_EXT_texture_compression_dxt1</code></li>
-
- <li><code>GL_IMG_program_binary</code></li>
-
- <li><code>GL_IMG_read_format</code></li>
-
- <li><code>GL_IMG_shader_binary</code></li>
-
- <li><code>GL_IMG_texture_compression_pvrtc</code></li>
-
- <li><code>GL_IMG_multisampled_render_to_texture</code></li>
-
- <li><code>GL_NV_coverage_sample</code></li>
-
- <li><code>GL_NV_depth_nonlinear</code></li>
-
- <li><code>GL_QCOM_extended_get</code></li>
-
- <li><code>GL_QCOM_extended_get2</code></li>
-
- <li><code>GL_QCOM_writeonly_rendering</code></li>
-
- <li><code>GL_QCOM_tiled_rendering</code></li>
- </ul>
- </dd>
-
- <dt>EGL</dt>
-
- <dd>
- <ul>
- <li><code>EGL_ANDROID_recordable</code></li>
-
- <li><code>EGL_NV_system_time</code></li>
- </ul>
- </dd>
- </dl>
- </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">
- Android NDK, Revision 6b</a> <em>(August 2011)</em>
-
- <div class="toggleme">
- <p>This release of the NDK does not include any new features compared to r6. The r6b release
- addresses the following issues in the r6 release:</p>
- <dl>
- <dt>Important bug fixes</dt>
- <dd>
- <ul>
- <li>Fixed the build when <code>APP_ABI="armeabi x86"</code> is used for
- multi-architecture builds.</li>
- <li>Fixed the location of prebuilt STLport binaries in the NDK release package.
- A bug in the packaging script placed them in the wrong location.</li>
- <li>Fixed <code>atexit()</code> usage in shared libraries with the x86standalone
- toolchain.</li>
- <li>Fixed <code>make-standalone-toolchain.sh --arch=x86</code>. It used to fail
- to copy the proper GNU libstdc++ binaries to the right location.</li>
- <li>Fixed the standalone toolchain linker warnings about missing the definition and
- size for the <code>__dso_handle</code> symbol (ARM only).</li>
- <li>Fixed the inclusion order of <code>$(SYSROOT)/usr/include</code> for x86 builds.
- See the <a href="http://code.google.com/p/android/issues/detail?id=18540">bug</a> for
- more information.</li>
- <li>Fixed the definitions of <code>ptrdiff_t</code> and <code>size_t</code> in
- x86-specific systems when they are used with the x86 standalone toolchain.</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">
- Android NDK, Revision 6</a> <em>(July 2011)</em>
-
- <div class="toggleme">
- <p>This release of the NDK includes support for the x86 ABI and other minor changes.
- For detailed information describing the changes in this release, read the
- <code>CHANGES.HTML</code> document included in the NDK package.
- </p>
- <dl>
- <dt>General notes:</dt>
- <dd>
- <ul>
- <li>Adds support for the x86 ABI, which allows you to generate machine code
- that runs on compatible x86-based Android devices. Major features for x86
- include x86-specific toolchains, system headers, libraries and
- debugging support. For all of the details regarding x86 support,
- see <code>docs/CPU-X86.html</code> in the NDK package.
-
- <p>By default, code is generated for ARM-based devices, but you can add x86 to your
- <code>APP_ABI</code> definition in your <code>Application.mk</code> file to build
- for x86 platforms. For example, the following line instructs <code>ndk-build</code>
- to build your code for three distinct ABIs:</p>
-
- <pre>APP_ABI := armeabi armeabi-v7a x86</pre>
-
- <p>Unless you rely on ARM-based assembly sources, you shouldn't need to touch
- your <code>Android.mk</code> files to build x86 machine code.</p>
-
- </li>
-
- <li>You can build a standalone x86 toolchain using the <code>--toolchain=x86-4.4.3</code>
- option when calling <code>make-standalone-toolchain.sh</code>. See
- <code>docs/STANDALONE-TOOLCHAIN.html</code> for more details.
- </li>
- <li>The new <code>ndk-stack</code> tool lets you translate stack traces in
- <code>logcat</code> that are generated by native code. The tool translates
- instruction addresses into a readable format that contains things such
- as the function, source file, and line number corresponding to each stack frame.
- For more information and a usage example, see <code>docs/NDK-STACK.html</code>.
- </li>
- </ul>
- </dd>
- <dt>Other changes:</dt>
- <dd><code>arm-eabi-4.4.0</code>, which had been deprecated since NDK r5, has been
- removed from the NDK distribution.</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">
- Android NDK, Revision 5c</a> <em>(June 2011)</em>
-
- <div class="toggleme">
- <p>This release of the NDK does not include any new features compared to r5b. The r5c release
- addresses the following problems in the r5b release:</p>
- <dl>
- <dt>Important bug fixes:</dt>
- <dd>
- <ul>
- <li><code>ndk-build</code>: Fixed a rare bug that appeared when trying to perform parallel
- builds of debuggable projects.</li>
-
- <li>Fixed a typo that prevented <code>LOCAL_WHOLE_STATIC_LIBRARIES</code> to work
- correctly with the new toolchain and added documentation for this in
- <code>docs/ANDROID-MK.html</code>.</li>
-
- <li>Fixed a bug where code linked against <code>gnustl_static</code> crashed when run on
- platform releases older than API level 8 (Android 2.2).</li>
-
- <li><code>ndk-gdb</code>: Fixed a bug that caused a segmentation fault when debugging Android 3.0
- or newer devices.</li>
-
- <li><code><android/input.h></code>: Two functions that were introduced in API level
- 9 (Android 2.3) were incorrect and are fixed. While this breaks the source API, the
- binary interface to the system is unchanged. The incorrect functions were missing a
- <code>history_index</code> parameter, and the correct definitions are shown below:
-<pre>
-float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event,
- size_t pointer_index,
- size_t history_index);
-
-float AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event,
- size_t pointer_index,
- size_t history_index);
-</pre>
- </li>
-
- <li>Updated the C library ARM binary for API level 9 (Android 2.3) to correctly expose at
- link time new functions that were added in that API level (for example,
- <code>pthread_rwlock_init</code>).</li>
-
- </ul>
- </dd>
-
- <dt>Minor improvements and fixes:</dt>
- <dd>
- <ul>
- <li>Object files are now always linked in the order they appear in
- <code>LOCAL_SRC_FILES</code>. This was not the case previously because the files were
- grouped by source extensions instead.</li>
-
- <li>When <code>import-module</code> fails, it now prints the list of directories that
- were searched. This is useful to check that the <code>NDK_MODULE_PATH</code> definition
- used by the build system is correct.</li>
-
- <li>When <code>import-module</code> succeeds, it now prints the directory where the
- module was found to the log (visible with <code>NDK_LOG=1</code>).</li>
-
- <li>Increased the build speed of debuggable applications when there is a very large number
- of include directories in the project.</li>
-
- <li><code>ndk-gdb</code>: Better detection of <code>adb shell</code> failures and improved
- error messages.</li>
-
- <li><code><pthread.h></code>: Fixed the definition of
- <code>PTHREAD_RWLOCK_INITIALIZER</code> for API level 9 (Android 2.3) and higher.</li>
-
- <li>Fixed an issue where a module could import itself, resulting in an infinite loop in
- GNU Make.</li>
-
- <li>Fixed a bug that caused the build to fail if <code>LOCAL_ARM_NEON</code> was set to
- true (typo in <code>build/core/build-binary.mk</code>).</li>
-
- <li>Fixed a bug that prevented the compilation of </code>.s</code> assembly files
- (<code>.S</code> files were okay).</li>
- </ul>
- </dd>
- </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" /> Android NDK, Revision 5b</a> <em>(January 2011)</em>
-
- <div class="toggleme">
- <p>This release of the NDK does not include any new features compared to r5. The r5b release addresses the
- following problems in the r5 release:
- </p>
- <ul>
- <li>The r5 binaries required glibc 2.11, but the r5b binaries are generated with a special
- toolchain that targets glibc 2.7 or higher instead. The Linux toolchain binaries now run on Ubuntu 8.04 or higher. </li>
- <li>Fixes a compiler bug in the arm-linux-androideabi-4.4.3 toolchain.
- The previous binary generated invalid thumb instruction sequences when
- dealing with signed chars.</li>
- <li>Adds missing documentation for the
- "gnustl_static" value for APP_STL, that allows you to link against
- a static library version of GNU libstdc++. </li>
- <li>The following <code>ndk-build</code> issues are fixed:
- <ul>
- <li>A bug that created inconsistent dependency files when a
- compilation error occured on Windows. This prevented a proper build after
- the error was fixed in the source code.</li>
- <li>A Cygwin-specific bug where using very short paths for
- the Android NDK installation or the project path led to the
- generation of invalid dependency files. This made incremental builds
- impossible.</li>
- <li>A typo that prevented the cpufeatures library from working correctly
- with the new NDK toolchain.</li>
- <li>Builds in Cygwin are faster by avoiding calls to <code>cygpath -m</code>
- from GNU Make for every source or object file, which caused problems
- with very large source trees. In case this doesn't work properly, define <code>NDK_USE_CYGPATH=1</code> in your
- environment to use <code>cygpath -m</code> again.</li>
- <li>The Cygwin installation now notifies the user of invalid installation paths that contain spaces. Previously, an invalid path
- would output an error that complained about an incorrect version of GNU Make, even if the right one was installed.
- </ul>
- </li>
- <li>Fixed a typo that prevented the <code>NDK_MODULE_PATH</code> environment variable from working properly when
- it contained multiple directories separated with a colon. </li>
- <li>The <code>prebuilt-common.sh</code> script contains fixes to check the compiler for 64-bit
- generated machine code, instead of relying on the host tag, which
- allows the 32-bit toolchain to rebuild properly on Snow Leopard. The toolchain rebuild scripts now also support
- using a 32-bit host toolchain.</li>
- <li>A missing declaration for <code>INET_ADDRSTRLEN</code> was added to <code><netinet/in.h></code>.</li>
- <li>Missing declarations for <code>IN6_IS_ADDR_MC_NODELOCAL</code> and <code>IN6_IS_ADDR_MC_GLOBAL</code> were added to <code><netinet/in6.h></code>.</li>
- <li>'asm' was replaced with '__asm__' in <code><asm/byteorder.h></code> to allow compilation with <code>-std=c99</code>.</li>
- </ul>
- </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" /> Android NDK, Revision 5</a> <em>(December 2010)</em>
-
- <div class="toggleme">
- <p>This release of the NDK includes many new APIs, most of which are introduced to
- support the development of games and similar applications that make extensive use
- of native code. Using the APIs, developers have direct native access to events, audio,
- graphics and window management, assets, and storage. Developers can also implement the
- Android application lifecycle in native code with help from the new
- {@link android.app.NativeActivity} class. For detailed information describing the changes in this
- release, read the <code>CHANGES.HTML</code> document included in the downloaded NDK package.
- </p>
- <dl>
- <dt>General notes:</dt>
- <dd>
- <ul>
- <li>Adds support for native activities, which allows you to implement the
- Android application lifecycle in native code.</li>
-
- <li>Adds native support for the following:
-
- <ul>
-
- <li>Input subsystem (such as the keyboard and touch screen)</li>
-
- <li>Access to sensor data (accelerometer, compass, gyroscope, etc).</li>
-
- <li>Event loop APIs to wait for things such as input and sensor events.</li>
-
- <li>Window and surface subsystem</li>
-
- <li>Audio APIs based on the OpenSL ES standard that support playback and recording
- as well as control over platform audio effects</li>
-
- <li>Access to assets packaged in an <code>.apk</code> file.</li>
-
- </ul>
- </li>
-
- <li>Includes a new toolchain (based on GCC 4.4.3), which generates better code, and can also now
- be used as a standalone cross-compiler, for people who want to build their stuff with
- <code>./configure && make</code>. See
- docs/STANDALONE-TOOLCHAIN.html for the details. The binaries for GCC 4.4.0 are still provided,
- but the 4.2.1 binaries were removed.</li>
-
- <li>Adds support for prebuilt static and shared libraries (docs/PREBUILTS.html) and module
- exports and imports to make sharing and reuse of third-party modules much easier
- (docs/IMPORT-MODULE.html explains why).</li>
-
- <li>Provides a default C++ STL implementation (based on STLport) as a helper module. It can be used either
- as a static or shared library (details and usage examples are in sources/android/stlport/README). Prebuilt
- binaries for STLport (static or shared) and GNU libstdc++ (static only) are also provided if you choose to
- compile against those libraries instead of the default C++ STL implementation.
- C++ Exceptions and RTTI are not supported in the default STL implementation. For more information, see
- docs/CPLUSPLUS-SUPPORT.HTML.</li>
-
- <li>Includes improvements to the <code>cpufeatures</code> helper library that improves reporting
- of the CPU type (some devices previously reported ARMv7 CPU when the device really was an ARMv6). We
- recommend developers that use this library to rebuild their applications then
- upload to Google Play to benefit from the improvements.</li>
-
- <li>Adds an EGL library that lets you create and manage OpenGL ES textures and
- services.</li>
-
- <li>Adds new sample applications, <code>native-plasma</code> and <code>native-activity</code>,
- to demonstrate how to write a native activity.</li>
-
- <li>Includes many bugfixes and other small improvements; see docs/CHANGES.html for a more
- detailed list of changes.</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" /> Android NDK, Revision 4b</a> <em>(June 2010)</em>
-
- <div class="toggleme">
- <dl>
- <dt>NDK r4b notes:</dt>
-
- <dd>
- <p>Includes fixes for several issues in the NDK build and debugging scripts — if
- you are using NDK r4, we recommend downloading the NDK r4b build. For detailed
- information describing the changes in this release, read the CHANGES.TXT document
- included in the downloaded NDK package.</p>
- </dd>
- </dl>
-
- <dl>
- <dt>General notes:</dt>
-
- <dd>
- <ul>
- <li>Provides a simplified build system through the new <code>ndk-build</code> build
- command.</li>
-
- <li>Adds support for easy native debugging of generated machine code on production
- devices through the new <code>ndk-gdb</code> command.</li>
-
- <li>Adds a new Android-specific ABI for ARM-based CPU architectures,
- <code>armeabi-v7a</code>. The new ABI extends the existing <code>armeabi</code> ABI to
- include these CPU instruction set extensions:
-
- <ul>
- <li>Thumb-2 instructions</li>
-
- <li>VFP hardware FPU instructions (VFPv3-D16)</li>
-
- <li>Optional support for ARM Advanced SIMD (NEON) GCC intrinsics and VFPv3-D32.
- Supported by devices such as Verizon Droid by Motorola, Google Nexus One, and
- others.</li>
- </ul>
- </li>
-
- <li>Adds a new <code>cpufeatures</code> static library (with sources) that lets your
- app detect the host device's CPU features at runtime. Specifically, applications can
- check for ARMv7-A support, as well as VFPv3-D32 and NEON support, then provide separate
- code paths as needed.</li>
-
- <li>Adds a sample application, <code>hello-neon</code>, that illustrates how to use the
- <code>cpufeatures</code> library to check CPU features and then provide an optimized
- code path using NEON instrinsics, if supported by the CPU.</li>
-
- <li>Lets you generate machine code for either or both of the instruction sets supported
- by the NDK. For example, you can build for both ARMv5 and ARMv7-A architectures at the
- same time and have everything stored to your application's final
- <code>.apk</code>.</li>
-
- <li>To ensure that your applications are available to users only if their devices are
- capable of running them, Google Play now filters applications based on the
- instruction set information included in your application — no action is needed on
- your part to enable the filtering. Additionally, the Android system itself also checks
- your application at install time and allows the installation to continue only if the
- application provides a library that is compiled for the device's CPU architecture.</li>
-
- <li>Adds support for Android 2.2, including a new stable API for accessing the pixel
- buffers of {@link android.graphics.Bitmap} objects from native code.</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" /> Android NDK, Revision 3</a> <em>(March 2010)</em>
-
- <div class="toggleme">
- <dl>
- <dt>General notes:</dt>
-
- <dd>
- <ul>
- <li>Adds OpenGL ES 2.0 native library support.</li>
-
- <li>Adds a sample application,<code>hello-gl2</code>, that illustrates the use of
- OpenGL ES 2.0 vertex and fragment shaders.</li>
-
- <li>The toolchain binaries have been refreshed for this release with GCC 4.4.0, which
- should generate slightly more compact and efficient machine code than the previous one
- (4.2.1). The NDK also still provides the 4.2.1 binaries, which you can optionally use
- to build your machine code.</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" /> Android NDK, Revision 2</a> <em>(September 2009)</em>
-
- <div class="toggleme">
- <p>Originally released as "Android 1.6 NDK, Release 1".</p>
-
- <dl>
- <dt>General notes:</dt>
-
- <dd>
- <ul>
- <li>Adds OpenGL ES 1.1 native library support.</li>
-
- <li>Adds a sample application, <code>san-angeles</code>, that renders 3D graphics
- through the native OpenGL ES APIs, while managing activity lifecycle with a {@link
- android.opengl.GLSurfaceView} object.</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" /> Android NDK, Revision 1</a> <em>(June 2009)</em>
-
- <div class="toggleme">
- <p>Originally released as "Android 1.5 NDK, Release 1".</p>
-
- <dl>
- <dt>General notes:</dt>
-
- <dd>
- <ul>
- <li>Includes compiler support (GCC) for ARMv5TE instructions, including Thumb-1
- instructions.</li>
-
- <li>Includes system headers for stable native APIs, documentation, and sample
- applications.</li>
- </ul>
- </dd>
- </dl>
- </div>
- </div>
-
- <h2 id="installing">Installing the NDK</h2>
- <p>Installing the NDK on your development computer is straightforward and involves extracting the
- NDK from its download package.</p>
-
- <p>Before you get started make sure that you have downloaded the latest <a href=
- "{@docRoot}sdk/index.html">Android SDK</a> and upgraded your applications and environment as
- needed. The NDK is compatible with older platform versions but not older versions of the SDK tools.
- Also, take a moment to review the <a href="{@docRoot}sdk/ndk/overview.html#reqs">System and
-Software Requirements</a>
- for the NDK, if you haven't already.</p>
-
- <p>To install the NDK, follow these steps:</p>
-
- <ol>
- <li>From the table at the top of this page, select the NDK package that is appropriate for your
- development computer and download the package.</li>
-
- <li>Uncompress the NDK download package using tools available on your computer. When
- uncompressed, the NDK files are contained in a directory called
- <code>android-ndk-<version></code>. You can rename the NDK directory if necessary and you
- can move it to any location on your computer. This documentation refers to the NDK directory as
- <code><ndk></code>.</li>
- </ol>
-
- <p>You are now ready to start working with the NDK.</p>
-
- <h2 id="gettingstarted">Getting Started with the NDK</h2>
-
- <p>Once you've installed the NDK successfully, take a few minutes to read the documentation
- included in the NDK. You can find the documentation in the <code><ndk>/docs/</code>
- directory. In particular, please read the OVERVIEW.HTML document completely, so that you
- understand the intent of the NDK and how to use it.</p>
-
- <p>If you used a previous version of the NDK, take a moment to review the list of NDK changes in
- the CHANGES.HTML document.</p>
-
- <p>Here's the general outline of how you work with the NDK tools:</p>
-
- <ol>
- <li>Place your native sources under <code><project>/jni/...</code></li>
-
- <li>Create <code><project>/jni/Android.mk</code> to describe your native sources to the
- NDK build system</li>
-
- <li>Optional: Create <code><project>/jni/Application.mk</code>.</li>
-
- <li>Build your native code by running the 'ndk-build' script from your project's directory. It
- is located in the top-level NDK directory:
- <pre class="no-pretty-print">cd <project>
-<ndk>/ndk-build
-</pre>
-
- <p>The build tools copy the stripped, shared libraries needed by your application to the
- proper location in the application's project directory.</p>
- </li>
-
- <li>Finally, compile your application using the SDK tools in the usual way. The SDK build tools
- will package the shared libraries in the application's deployable <code>.apk</code> file.</li>
- </ol>
-
- <p>For complete information on all of the steps listed above, please see the documentation
- included with the NDK package.</p>
-
- <h2 id="samples">Sample Applications</h2>
-
- <p>The NDK includes sample Android applications that illustrate how to use native code in your
- Android applications. For more information, see <a href=
- "{@docRoot}sdk/ndk/overview.html#samples">Sample Applications</a>.</p>
-
- <h2 id="forum">Discussion Forum and Mailing List</h2>
-
- <p>If you have questions about the NDK or would like to read or contribute to discussions about
- it, please visit the <a href="http://groups.google.com/group/android-ndk">android-ndk</a> group
- and mailing list.</p>
diff --git a/docs/html/sdk/ndk/overview.jd b/docs/html/sdk/ndk/overview.jd
deleted file mode 100644
index d2a9746..0000000
--- a/docs/html/sdk/ndk/overview.jd
+++ /dev/null
@@ -1,559 +0,0 @@
-page.title=What is the NDK?
-@jd:body
-
- <div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
-
- <ol>
- <li><a href="#choosing">When to Develop in Native Code</a></li>
- <li>
- <a href="#contents">Contents of the NDK</a>
- <ol>
- <li><a href="#tools">Development tools</a></li>
-
- <li><a href="#docs">Documentation</a></li>
-
- <li><a href="#samples">Sample applications</a></li>
- </ol>
- </li>
- <li><a href="#reqs">System and Software Requirements</a></li>
- </ol>
- </div>
- </div>
-
- <p>The Android NDK is a toolset that lets you embed components that make use of native code in
- your Android applications.</p>
-
- <p>Android applications run in the Dalvik virtual machine. The NDK allows you to implement parts
- of your applications using native-code languages such as C and C++. This can provide benefits to
- certain classes of applications, in the form of reuse of existing code and in some cases
- increased speed.</p>
-
- <p>The NDK provides:</p>
-
- <ul>
- <li>A set of tools and build files used to generate native code libraries from C and C++
- sources</li>
-
- <li>A way to embed the corresponding native libraries into an application package file
- (<code>.apk</code>) that can be deployed on Android devices</li>
-
- <li>A set of native system headers and libraries that will be supported in all future versions
- of the Android platform, starting from Android 1.5. Applications that use native activities
- must be run on Android 2.3 or later.</li>
-
- <li>Documentation, samples, and tutorials</li>
- </ul>
-
- <p>The latest release of the NDK supports the following instruction sets:</p>
-
- <ul>
- <li>ARMv5TE (including Thumb-1 instructions)</li>
-
- <li>ARMv7-A (including Thumb-2 and VFPv3-D16 instructions, with optional support for
- NEON/VFPv3-D32 instructions)</li>
-
- <li>x86 instructions (see CPU-ARCH-ABIS.HTML for more information)</li>
- </ul>
-
- <p>ARMv5TE machine code will run on all ARM-based Android devices. ARMv7-A will run only on
- devices such as the Verizon Droid or Google Nexus One that have a compatible CPU. The main
- difference between the two instruction sets is that ARMv7-A supports hardware FPU, Thumb-2, and
- NEON instructions. You can target either or both of the instruction sets — ARMv5TE is the
- default, but switching to ARMv7-A is as easy as adding a single line to the application's
- <code>Application.mk</code> file, without needing to change anything else in the file. You can also build for
- both architectures at the same time and have everything stored in the final <code>.apk</code>.
- Complete information is provided in the CPU-ARCH-ABIS.HTML in the NDK package.</p>
-
- <p>The NDK provides stable headers for libc (the C library), libm (the Math library), OpenGL ES
- (3D graphics library), the JNI interface, and other libraries, as listed in the <a href=
- "#tools">Development Tools</a> section.</p>
-
- <h2 id="choosing">When to Develop in Native Code</h2>
-
- <p>The NDK will not benefit most applications. As a developer, you need to balance its benefits
- against its drawbacks; notably, using native code does not result in an automatic performance
- increase, but always increases application complexity. In general, you should only use native
- code if it is essential to your application, not just because you prefer to program in C/C++.</p>
-
- <p>Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't
- allocate much memory, such as signal processing, physics simulation, and so on. Simply re-coding
- a method to run in C usually does not result in a large performance increase. When examining
- whether or not you should develop in native code, think about your requirements and see if the
- Android framework APIs provide the functionality that you need. The NDK can, however, can be an
- effective way to reuse a large corpus of existing C/C++ code.</p>
-
- <p>The Android framework provides two ways to use native code:</p>
-
- <ul>
- <li>Write your application using the Android framework and use JNI to access the APIs provided
- by the Android NDK. This technique allows you to take advantage of the convenience of the
- Android framework, but still allows you to write native code when necessary. You can install
- applications that use native code through the JNI on devices that run Android 1.5 or
- later.</li>
-
- <li>
- <p>Write a native activity, which allows you to implement the lifecycle callbacks in native
- code. The Android SDK provides the {@link android.app.NativeActivity} class, which is a convenience class that notifies your
- native code of any activity lifecycle callbacks (<code>onCreate()</code>, <code>onPause()</code>,
- <code>onResume()</code>, etc). You can implement the callbacks in your native code to handle
- these events when they occur. Applications that use native activities must be run on Android
- 2.3 (API Level 9) or later.</p>
-
- <p>You cannot access features such as Services and Content Providers natively, so if you want
- to use them or any other framework API, you can still write JNI code to do so.</p>
- </li>
- </ul>
-
- <h2 id="contents">Contents of the NDK</h2>The NDK contains the APIs, documentation, and sample
- applications that help you write your native code.
-
- <h3 id="tools">Development tools</h3>
-
- <p>The NDK includes a set of cross-toolchains (compilers, linkers, etc..) that can generate
- native ARM binaries on Linux, OS X, and Windows (with Cygwin) platforms.</p>
-
- <p>It provides a set of system headers for stable native APIs that are guaranteed to be supported
- in all later releases of the platform:</p>
-
- <ul>
- <li>libc (C library) headers</li>
-
- <li>libm (math library) headers</li>
-
- <li>JNI interface headers</li>
-
- <li>libz (Zlib compression) headers</li>
-
- <li>liblog (Android logging) header</li>
-
- <li>OpenGL ES 1.1 and OpenGL ES 2.0 (3D graphics libraries) headers</li>
-
- <li>libjnigraphics (Pixel buffer access) header (for Android 2.2 and above).</li>
-
- <li>A Minimal set of headers for C++ support</li>
-
- <li>OpenSL ES native audio libraries</li>
-
- <li>Android native application APIS</li>
- </ul>
-
- <p>The NDK also provides a build system that lets you work efficiently with your sources, without
- having to handle the toolchain/platform/CPU/ABI details. You create very short build files to
- describe which sources to compile and which Android application will use them — the build
- system compiles the sources and places the shared libraries directly in your application
- project.</p>
-
- <p class="caution"><strong>Important:</strong> With the exception of the libraries listed above,
- native system libraries in the Android platform are <em>not</em> stable and may change in future
- platform versions. Your applications should <em>only</em> make use of the stable native system
- libraries provided in this NDK.</p>
-
- <h3 id="docs">Documentation</h3>
-
- <p>The NDK package includes a set of documentation that describes the capabilities of the NDK and
- how to use it to create shared libraries for your Android applications. In this release, the
- documentation is provided only in the downloadable NDK package. You can find the documentation in
- the <code><ndk>/docs/</code> directory. Included are these files:</p>
-
- <ul>
- <li>
- INSTALL.HTML — describes how to install the NDK and configure it for your host
- system</li>
-
- <li>OVERVIEW.HTML — provides an overview of the NDK capabilities and usage</li>
-
- <li>ANDROID-MK.HTML — describes the use of the Android.mk file, which defines the native
- sources you want to compile</li>
-
- <li>APPLICATION-MK.HTML — describes the use of the Application.mk file, which describes
- the native sources required by your Android application</li>
- <li>CPLUSPLUS-SUPPORT.HTML — describes the C++ support provided in the Android NDK</li>
- <li>CPU-ARCH-ABIS.HTML — a description of supported CPU architectures and how to target
- them.</li>
-
- <li>CPU-FEATURES.HTML — a description of the <code>cpufeatures</code> static library that
- lets your application code detect the target device's CPU family and the optional features at
- runtime.</li>
-
- <li>CPU-ARM-NEON.HTML — a description of how to build with optional ARM NEON / VFPv3-D32
- instructions.</li>
-
- <li>CHANGES.HTML — a complete list of changes to the NDK across all releases.</li>
-
- <li>DEVELOPMENT.HTML — describes how to modify the NDK and generate release packages for it</li>
-
- <li>HOWTO.HTML — information about common tasks associated with NDK development</li>
-
- <li>IMPORT-MODULE.HTML — describes how to share and reuse modules</li>
-
- <li>LICENSES.HTML — information about the various open source licenses that govern the Android NDK</li>
-
- <li>NATIVE-ACTIVITY.HTML — describes how to implement native activities</li>
-
- <li>NDK-BUILD.HTML — describes the usage of the ndk-build script</li>
-
- <li>NDK-GDB.HTML — describes how to use the native code debugger</li>
-
- <li>PREBUILTS.HTML — information about how shared and static prebuilt libraries work </li>
-
- <li>STANDALONE-TOOLCHAIN.HTML — describes how to use Android NDK toolchain as a standalone
- compiler (still in beta).</li>
-
- <li>SYSTEM-ISSUES.HTML — known issues in the Android system images that you should be
- aware of, if you are developing using the NDK.</li>
-
- <li>STABLE-APIS.HTML — a complete list of the stable APIs exposed by headers in the
- NDK.</li>
-
- </ul>
-
- <p>Additionally, the package includes detailed information about the "bionic" C library provided
- with the Android platform that you should be aware of, if you are developing using the NDK. You
- can find the documentation in the <code><ndk>/docs/system/libc/</code> directory:</p>
-
- <ul>
- <li>OVERVIEW.HTML — provides an overview of the "bionic" C library and the features it
- offers.</li>
- </ul>
-
- <h3 id="samples">Sample applications</h3>
-
-<p>The NDK includes sample applications that illustrate how to use native code in your Android
- applications:</p>
-
- <ul>
- <li><code>hello-jni</code> — a simple application that loads a string from a native
- method implemented in a shared library and then displays it in the application UI.</li>
-
- <li><code>two-libs</code> — a simple application that loads a shared library dynamically
- and calls a native method provided by the library. In this case, the method is implemented in a
- static library imported by the shared library.</li>
-
- <li><code>san-angeles</code> — a simple application that renders 3D graphics through the
- native OpenGL ES APIs, while managing activity lifecycle with a {@link
- android.opengl.GLSurfaceView} object.</li>
-
- <li><code>hello-gl2</code> — a simple application that renders a triangle using OpenGL ES
- 2.0 vertex and fragment shaders.</li>
-
- <li><code>hello-neon</code> — a simple application that shows how to use the
- <code>cpufeatures</code> library to check CPU capabilities at runtime, then use NEON intrinsics
- if supported by the CPU. Specifically, the application implements two versions of a tiny
- benchmark for a FIR filter loop, a C version and a NEON-optimized version for devices that
- support it.</li>
-
- <li><code>bitmap-plasma</code> — a simple application that demonstrates how to access the
- pixel buffers of Android {@link android.graphics.Bitmap} objects from native code, and uses
- this to generate an old-school "plasma" effect.</li>
-
- <li><code>native-activity</code> — a simple application that demonstrates how to use the
- native-app-glue static library to create a native activity</li>
-
- <li><code>native-plasma</code> — a version of bitmap-plasma implemented with a native
- activity.</li>
- </ul>
-
- <p>For each sample, the NDK includes the corresponding C source code and the necessary Android.mk
- and Application.mk files. There are located under <code><ndk>/samples/<name>/</code>
- and their source code can be found under <code><ndk>/samples/<name>/jni/</code>.</p>
-
- <p>You can build the shared libraries for the sample apps by going into
- <code><ndk>/samples/<name>/</code> then calling the <code>ndk-build</code> command.
- The generated shared libraries will be located under
- <code><ndk>/samples/<name>/libs/armeabi/</code> for (ARMv5TE machine code) and/or
- <code><ndk>/samples/<name>/libs/armeabi-v7a/</code> for (ARMv7 machine code).</p>
-
- <p>Next, build the sample Android applications that use the shared libraries:</p>
-
- <ul>
- <li>If you are developing in Eclipse with ADT, use the New Project Wizard to create a new
- Android project for each sample, using the "Import from Existing Source" option and importing
- the source from <code><ndk>/samples/<name>/</code>. Then, set up an AVD,
- if necessary, and build/run the application in the emulator.</li>
-
- <li>If you are developing with Ant, use the <code>android</code> tool to create the build file
- for each of the sample projects at <code><ndk>/samples/<name>/</code>.
- Then set up an AVD, if necessary, build your project in the usual way, and run it in the
- emulator.</li>
-
- </ul>
-
- <p>For more information about developing with the Android SDK tools and what
- you need to do to create, build, and run your applications, see
- the <a href="{@docRoot}guide/developing/index.html">Overview</a>
- section for developing on Android.</p>
-
- <h4 id="hello-jni">Exploring the hello-jni Sample</h4>
-
- <p>The hello-jni sample is a simple demonstration on how to use JNI from an Android application.
- The HelloJni activity receives a string from a simple C function and displays it in a
- TextView.</p>
-
- <p>The main components of the sample include:</p>
-
- <ul>
- <li>The familiar basic structure of an Android application (an <code>AndroidManifest.xml</code>
- file, a <code>src/</code> and <code>res</code> directories, and a main activity)</li>
-
- <li>A <code>jni/</code> directory that includes the implemented source file for the native code
- as well as the Android.mk file</li>
-
- <li>A <code>tests/</code> directory that contains unit test code.</li>
- </ul>
-
- <ol>
- <li>Create a new project in Eclipse from the existing sample source or use the
- <code>android</code> tool to update the project so it generates a build.xml file that you can
- use to build the sample.
-
- <ul>
- <li>In Eclipse:
-
- <ol type="a">
- <li>Click <strong>File > New Android Project...</strong></li>
-
- <li>Select the <strong>Create project from existing source</strong> radio button.</li>
-
- <li>Select any API level above Android 1.5.</li>
-
- <li>In the <strong>Location</strong> field, click <strong>Browse...</strong> and select
- the <code><ndk-root>/samples/hello-jni</code> directory.</li>
-
- <li>Click <strong>Finish</strong>.</li>
- </ol>
- </li>
-
- <li>On the command line:
-
- <ol type="a">
- <li>Change to the <code><ndk-root>/samples/hello-jni</code> directory.</li>
-
- <li>Run the following command to generate a build.xml file:
- <pre class="no-pretty-print">android update project -p . -s</pre>
- </li>
- </ol>
- </li>
- </ul>
- </li>
-
- <li>Compile the native code using the <code>ndk-build</code> command.
- <pre class="no-pretty-print">
-cd <ndk-root>/samples/hello-jni
-<ndk_root>/ndk-build
-</pre>
- </li>
-
- <li>Build and install the application as you would a normal Android application. If you are
- using Eclipse, run the application to build and install it on a device. If you are using Ant,
- run the following commands from the project directory:
- <pre class="no-pretty-print">
-ant debug
-adb install bin/HelloJni-debug.apk
-</pre>
- </li>
- </ol>
-
- <p>When you run the application on the device, the string <code>Hello JNI</code> should appear on
- your device. You can explore the rest of the samples that are located in the
- <code><ndk-root>/samples</code> directory for more examples on how to use the JNI.</p>
-
- <h4 id="native-activity">Exploring the native-activity Sample Application</h4>
-
- <p>The native-activity sample provided with the Android NDK demonstrates how to use the
- android_native_app_glue static library. This static library makes creating a native activity
- easier by providing you with an implementation that handles your callbacks in another thread, so
- you do not have to worry about them blocking your main UI thread. The main parts of the sample
- are described below:</p>
-
- <ul>
- <li>The familiar basic structure of an Android application (an <code>AndroidManifest.xml</code>
- file, a <code>src/</code> and <code>res</code> directories). The AndroidManifest.xml declares
- that the application is native and specifies the .so file of the native activity. See {@link
- android.app.NativeActivity} for the source or see the
- <code><ndk_root>/platforms/samples/native-activity/AndroidManifest.xml</code> file.</li>
-
- <li>A <code>jni/</code> directory contains the native activity, main.c, which uses the
- <code>android_native_app_glue.h</code> interface to implement the activity. The Android.mk that
- describes the native module to the build system also exists here.</li>
- </ul>
-
- <p>To build this sample application:</p>
-
- <ol>
- <li>Create a new project in Eclipse from the existing sample source or use the
- <code>android</code> tool to update the project so it generates a build.xml file that you can
- use to build the sample.
-
- <ul>
- <li>In Eclipse:
-
- <ol type="a">
- <li>Click <strong>File > New Android Project...</strong></li>
-
- <li>Select the <strong>Create project from existing source</strong> radio button.</li>
-
- <li>Select any API level above Android 2.3.</li>
-
- <li>In the <strong>Location</strong> field, click <strong>Browse...</strong> and select
- the <code><ndk-root>/samples/native-activity</code> directory.</li>
-
- <li>Click <strong>Finish</strong>.</li>
- </ol>
- </li>
-
- <li>On the command line:
-
- <ol type="a">
- <li>Change to the <code><ndk-root>/samples/native-activity</code> directory.</li>
-
- <li>Run the following command to generate a build.xml file:
- <pre class="no-pretty-print">
-android update project -p . -s
-</pre>
- </li>
- </ol>
- </li>
- </ul>
- </li>
-
- <li>Compile the native code using the <code>ndk-build</code> command.
- <pre class="no-pretty-print">
-cd <ndk-root>/platforms/samples/android-9/samples/native-activity
-<ndk_root>/ndk-build
-</pre>
- </li>
-
- <li>Build and install the application as you would a normal Android application. If you are
- using Eclipse, run the application to build and install it on a device. If you are using Ant,
- run the following commands in the project directory, then run the application on the device:
- <pre class="no-pretty-print">
-ant debug
-adb install bin/NativeActivity-debug.apk
-</pre>
- </li>
- </ol>
-
-
- <h2 id="reqs">System and Software Requirements</h2>
-
- <p>The sections below describe the system and software requirements for using the Android NDK, as
- well as platform compatibility considerations that affect appplications using libraries produced
- with the NDK.</p>
-
- <h4>The Android SDK</h4>
-
- <ul>
- <li>A complete Android SDK installation (including all dependencies) is required.</li>
-
- <li>Android 1.5 SDK or later version is required.</li>
- </ul>
-
- <h4>Supported operating systems</h4>
-
- <ul>
- <li>Windows XP (32-bit) or Vista (32- or 64-bit)</li>
-
- <li>Mac OS X 10.4.8 or later (x86 only)</li>
-
- <li>Linux (32 or 64-bit; Ubuntu 8.04, or other Linux distributions using GLibc 2.7 or
-later)</li>
- </ul>
-
- <h4>Required development tools</h4>
-
- <ul>
- <li>For all development platforms, GNU Make 3.81 or later is required. Earlier versions of GNU
- Make might work but have not been tested.</li>
-
- <li>A recent version of awk (either GNU Awk or Nawk) is also required.</li>
-
- <li>For Windows, <a href="http://www.cygwin.com">Cygwin</a> 1.7 or higher is required. The NDK
- will <em>not</em> work with Cygwin 1.5 installations.</li>
- </ul>
-
- <h4>Android platform compatibility</h4>
-
- <ul>
- <li>The native libraries created by the Android NDK can only be used on devices running the
- Android 1.5 platform version or later. This is due to toolchain and ABI related changes that
- make the native libraries incompatible with 1.0 and 1.1 system images.</li>
-
- <li>For this reason, you should use native libraries produced with the NDK in applications that
- are deployable to devices running the Android 1.5 platform version or later.</li>
-
- <li>To ensure compatibility, an application using a native library produced with the NDK
- <em>must</em> declare a <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code>
- <uses-sdk></code></a> element in its manifest file, with an
- <code>android:minSdkVersion</code> attribute value of "3" or higher. For example:
- <pre style="margin:1em;">
-<manifest>
- <uses-sdk android:minSdkVersion="3" />
- ...
-</manifest>
-</pre>
- </li>
-
- <li>If you use this NDK to create a native library that uses the OpenGL ES APIs, the
- application containing the library can be deployed only to devices running the minimum platform
- versions described in the table below. To ensure compatibility, make sure that your application
- declares the proper <code>android:minSdkVersion</code> attribute value, as given in the
- table.</li>
-
- <li style="list-style: none; display: inline">
- <table style="margin:1em;">
- <tr>
- <th>OpenGL ES Version Used</th>
-
- <th>Compatible Android Platform(s)</th>
-
- <th>Required uses-sdk Attribute</th>
- </tr>
-
- <tr>
- <td>OpenGL ES 1.1</td>
-
- <td>Android 1.6 and higher</td>
-
- <td><code>android:minSdkVersion="4"</code></td>
- </tr>
-
- <tr>
- <td>OpenGL ES 2.0</td>
-
- <td>Android 2.0 and higher</td>
-
- <td><code>android:minSdkVersion="5"</code></td>
- </tr>
- </table>
-
- <p>For more information about API Level and its relationship to Android platform versions,
- see <a href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a>.</p>
- </li>
-
- <li>Additionally, an application using the OpenGL ES APIs should declare a
- <code><uses-feature></code> element in its manifest, with an
- <code>android:glEsVersion</code> attribute that specifies the minimum OpenGl ES version
- required by the application. This ensures that Google Play will show your application only
- to users whose devices are capable of supporting your application. For example:
- <pre style="margin:1em;">
-<manifest>
-<!-- Declare that the application uses the OpenGL ES 2.0 API and is designed
- to run only on devices that support OpenGL ES 2.0 or higher. -->
- <uses-feature android:glEsVersion="0x00020000" />
- ...
-</manifest>
-</pre>
-
- <p>For more information, see the <a href=
- "{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></code></a>
- documentation.</p>
- </li>
-
- <li>If you use this NDK to create a native library that uses the API to access Android {@link
- android.graphics.Bitmap} pixel buffers or utilizes native activities, the application
- containing the library can be deployed only to devices running Android 2.2 (API level 8) or
- higher. To ensure compatibility, make sure that your application declares <code><uses-sdk
- android:minSdkVersion="8" /></code> attribute value in its manifest.</li>
- </ul>
diff --git a/docs/html/sdk/oem-usb.jd b/docs/html/sdk/oem-usb.jd
deleted file mode 100644
index 88d66dd..0000000
--- a/docs/html/sdk/oem-usb.jd
+++ /dev/null
@@ -1,324 +0,0 @@
-page.title=OEM USB Drivers
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#InstallingDriver">Installing a USB Driver</a>
- <ol>
- <li><a href="#Win7">Windows 7</a></li>
- <li><a href="#WinXp">Windows XP</a></li>
- <li><a href="#WinVista">Windows Vista</a></li>
- </ol>
- </li>
- <li><a href="#Drivers">OEM Drivers</a></li>
- </ol>
-
- <h2>See also</h2>
- <ol>
- <li><a href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a></li>
- <li><a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a></li>
- </ol>
-</div>
-</div>
-
-<p>If you are developing on Windows and would like to connect an Android-powered device
-to test your applications, then you need to install the appropriate USB driver. This document
-provides links to the web sites for several original equipment manufacturers (OEMs),
-where you can download the appropriate USB driver for your device. However, this list is
-not exhaustive for all available Android-powered devices.</p>
-
-<p>If you're developing on Mac OS X or Linux, then you probably don't need to install a USB driver.
-To start developing with your device, read <a
-href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a>.</p>
-
-<p class="note"><strong>Note:</strong> If your device is one of the Android Developer Phones
-(ADP), a Nexus One, or a Nexus S, then you need
-the <a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a>, instead of an OEM driver. The Galaxy
-Nexus driver, however, is distributed by <a
-href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a>
-(listed as model SCH-I515).</p>
-
-
-<h2 id="InstallingDriver">Installing a USB Driver</h2>
-
-<p>First, find the appropriate driver for your device from the <a href="#Drivers">OEM drivers</a>
-table below.</p>
-
-<p>Once you've downloaded your USB driver, follow the instructions below to install or upgrade the
-driver, based on your version of Windows and whether you're installing for the first time
-or upgrading an existing driver.</p>
-
-<p class="note"><strong>Tip:</strong> When you finish the USB driver installation,
-see <a
-href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a> for
-other important information about using an Android-powered device for
-development.</p>
-
-<ol class="nolist">
- <li><a href="#Win7">Windows 7</a></li>
- <li><a href="#WinXp">Windows XP</a></li>
- <li><a href="#WinVista">Windows Vista</a></li>
-</ol>
-
-
-<p class="caution"><strong>Caution:</strong>
-You may make changes to <code>android_winusb.inf</code> file found inside
-<code>usb_driver\</code> (for example, to add support for other devices),
-however, this will lead to security warnings when you install or upgrade the
-driver. Making any other changes to the driver files may break the installation
-process.</p>
-
-
-<h3 id="Win7">Windows 7</h3>
-
-
-<p>To install the Android USB driver on Windows 7 for the first time:</p>
-<ol>
- <li>Connect your Android-powered device to your computer's USB port.</li>
- <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer,
- and select <strong>Manage</strong>.</li>
- <li>Select <strong>Devices</strong> in the left pane.</li>
- <li>Locate and expand <em>Other device</em> in the right pane.</li>
- <li>Right-click the device name (such as <em>Nexus S</em>) and select <strong>Update
- Driver Software</strong>.
- This will launch the Hardware Update Wizard.</li>
- <li>Select <strong>Browse my computer for driver software</strong> and click
- <strong>Next</strong>.</li>
- <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
-Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li>
- <li>Click <strong>Next</strong> to install the driver.</li>
-</ol>
-
-<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows 7 with the new
-driver:</p>
-
-<ol>
- <li>Connect your Android-powered device to your computer's USB port.</li>
- <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer,
- and select <strong>Manage</strong>.</li>
- <li>Select <strong>Device Manager</strong> in the left pane of the Computer Management
- window.</li>
- <li>Locate and expand <em>Android Phone</em> in the right pane.</li>
- <li>Right-click <em>Android Composite ADB Interface</em> and select <strong>Update
- Driver</strong>.
- This will launch the Hardware Update Wizard.</li>
- <li>Select <strong>Install from a list or specific location</strong> and click
- <strong>Next</strong>.</li>
- <li>Select <strong>Search for the best driver in these locations</strong>; un-check
-<strong>Search removable media</strong>; and check <strong>Include this location in the
-search</strong>.</li>
- <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
-Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li>
- <li>Click <strong>Next</strong> to upgrade the driver.</li>
-</ol>
-
-
-
-
-
-<h3 id="WinXp">Windows XP</h3>
-
-<p>To install the Android USB driver on Windows XP for the first time:</p>
-
-<ol>
- <li>Connect your Android-powered device to your computer's USB port. Windows
- will detect the device and launch the Hardware Update Wizard.</li>
- <li>Select <strong>Install from a list or specific location</strong> and click
- <strong>Next</strong>.</li>
- <li>Select <strong>Search for the best driver in these locations</strong>; un-check
-<strong>Search
- removable media</strong>; and check <strong>Include
-this location in the search</strong>.</li>
- <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
-Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li>
- <li>Click <strong>Next</strong> to install the driver.</li>
-</ol>
-
-<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows XP with the new
-driver:</p>
-
-<ol>
- <li>Connect your Android-powered device to your computer's USB port.</li>
- <li>Right-click on <em>My Computer</em> from your desktop or Windows Explorer,
- and select <strong>Manage</strong>.</li>
- <li>Select <strong>Device Manager</strong> in the left pane.</li>
- <li>Locate and expand <em>Android Phone</em> in the right pane.</li>
- <li>Right-click <em>Android Composite ADB Interface</em> and select <strong>Update
- Driver</strong>.
- This will launch the Hardware Update Wizard.</li>
- <li>Select <strong>Install from a list or specific location</strong> and click
- <strong>Next</strong>.</li>
- <li>Select <strong>Search for the best driver in these locations</strong>; un-check <strong>Search
- removable media</strong>; and check <strong>Include
-this location in the search</strong>.</li>
- <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
-Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li>
- <li>Click <strong>Next</strong> to upgrade the driver.</li>
-</ol>
-
-
-
-<h3 id="WinVista">Windows Vista</h3>
-
-<p>To install the Android USB driver on Windows Vista for the first time:</p>
-
-<ol>
- <li>Connect your Android-powered device to your computer's USB port. Windows
- will detect the device and launch the Found New Hardware wizard.</li>
- <li>Select <strong>Locate and install driver software</strong>.</li>
- <li>Select <strong>Don't search online</strong>.</li>
- <li>Select <strong>I don't have the disk. Show me other options</strong>.</li>
- <li>Select <strong>Browse my computer for driver software</strong>.</li>
- <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
-Driver is located in {@code <sdk>\extras\google\usb_driver\}.) As long as you specified the
-exact location of the
- installation package, you may leave <strong>Include subfolders</strong> checked or
- unchecked—it doesn't matter.</li>
- <li>Click <strong>Next</strong>. Vista may prompt you to confirm the privilege elevation
- required for driver installation. Confirm it.</li>
- <li>When Vista asks if you'd like to install the Google ADB Interface device,
- click <strong>Install</strong> to install the driver.</li>
-</ol>
-
-<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows Vista with the new
-driver:</p>
-
-<ol>
- <li>Connect your Android-powered device to your computer's USB port.</li>
- <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer,
- and select <strong>Manage</strong>.</li>
- <li>Select <strong>Device Manager</strong> in the left pane.</li>
- <li>Locate and expand <em>ADB Interface</em> in the right pane.</li>
- <li>Right-click on <em>HTC Dream Composite ADB Interface</em>, and select <strong>Update
- Driver Software</strong>.</li>
- <li>When Vista starts updating the driver, a prompt will ask how you want to
- search for the driver
- software. Select <strong>Browse my computer for driver software</strong>.</li>
- <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
-Driver is located in {@code <sdk>\extras\google\usb_driver\}.) As long as you specified the
-exact location of the
- installation package, you may leave <strong>Include subfolders</strong> checked or
- unchecked—it doesn't matter.</li>
- <li>Click <strong>Next</strong>. Vista might prompt you to confirm the privilege elevation
- required for driver installation. Confirm it.</li>
- <li>When Vista asks if you'd like to install the Google ADB Interface device,
- click <strong>Install</strong> to upgrade the driver.</li>
-</ol>
-
-
-<h2 id="Drivers">OEM Drivers</h2>
-
-<p class="note"><strong>Note:</strong> If your device is one of the Android Developer Phones
-(purchased from the Google Play publisher site), a Nexus One, or a Nexus S, then you need
-the <a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a>, instead of an OEM driver. The Galaxy
-Nexus driver, however, is distributed by <a
-href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a>
-(listed as model SCH-I515).</p>
-
-
-<table><tr>
- <th>OEM</th>
- <th>Driver URL</th></tr>
-<tr><td>Acer</td> <td><a
-href="http://www.acer.com/worldwide/support/mobile.html">http://www.acer.com/worldwide/support/mobile.html</a>
- </td></tr>
- <tr>
- <td style="font-variant:small-caps">alcatel one touch</td>
- <td><a
-href="http://www.alcatel-mobilephones.com/global/Android-Downloads">http://www.alcatel-mobilephones.com/global/Android-Downloads</a></td>
- </tr>
- <tr>
- <td>Asus</td>
- <td><a href="http://support.asus.com/download/">http://support.asus.com/download/</a></td>
- </tr>
- <tr><td>
- Dell
- </td> <td>
- <a
-href="http://support.dell.com/support/downloads/index.aspx?c=us&cs=19&l=en&s=dhs&~ck=anavml">http://support.dell.com/support/downloads/index.aspx?c=us&cs=19&l=en&s=dhs&~ck=anavml</a> </td></tr>
-
-<tr><td>Foxconn</td> <td><a
-href="http://drivers.cmcs.com.tw/">http://drivers.cmcs.com.tw/</a></td>
-</tr>
- <tr>
- <td>
- Fujitsu
- </td>
- <td><a
-href="http://www.fmworld.net/product/phone/sp/android/develop/">http://www.fmworld.net/product/phone/sp/android/develop/</a>
- </td>
- </tr>
- <tr>
- <td>
- Fujitsu Toshiba
- </td>
- <td><a
-href="http://www.fmworld.net/product/phone/sp/android/develop/">http://www.fmworld.net/product/phone/sp/android/develop/</a>
- </td>
- </tr>
- <tr><td>
- Garmin-Asus
- </td> <td><a
-href="https://www.garminasus.com/en_US/support/pcsync/">https://www.garminasus.com/en_US/support/pcsync/</a></td>
-</tr>
-
-<tr><td>Hisense</td>
- <td><a
-href="http://app.hismarttv.com/dss/resourcecontent.do?method=viewResourceDetail&resourceId=16&type=5">http://app.hismarttv.com/dss/resourcecontent.do?method=viewResourceDetail&resourceId=16&type=5 </a></td>
-</tr>
-
-<tr><td>HTC</td> <td><a href="http://www.htc.com">http://www.htc.com </a> <br>Click on the
-support tab to select your products/device. Different regions will have different links.</td>
-</tr>
-
-<tr><td>Huawei</td> <td><a
-href="http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index">http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index</a></td>
-</tr>
-
-<tr><td>KT Tech</td> <td><a
-href="http://www.kttech.co.kr/cscenter/download05.asp">http://www.kttech.co.kr/cscenter/download05.asp</a> for EV-S100 (Take)</td>
-</tr>
- <tr>
- <td>
- Kyocera
- </td>
- <td><a href="http://www.kyocera-wireless.com/support/phone_drivers.htm">http://www.kyocera-wireless.com/support/phone_drivers.htm</a>
- </td>
- </tr>
- <tr>
- <td>Lenevo</td>
- <td><a href="http://developer.lenovomm.com/developer/download.jsp"
- >http://developer.lenovomm.com/developer/download.jsp</a>
- </td>
- </tr>
- <tr><td>LGE</td> <td><a
-href="http://www.lg.com/us/mobile-phones/mobile-support/mobile-lg-mobile-phone-support.jsp">http://www.lg.com/us/mobile-phones/mobile-support/mobile-lg-mobile-phone-support.jsp</a></td>
-</tr><tr><td>Motorola</td> <td><a
-href="http://developer.motorola.com/docstools/USB_Drivers/">http://developer.motorola.com/docstools/USB_Drivers/</a></td>
-</tr><tr><td>Pantech</td> <td><a
-href="http://www.isky.co.kr/cs/software/software.sky?fromUrl=index">http://www.isky.co.kr/cs/software/software.sky?fromUrl=index</a></td>
-</tr><tr><td>Pegatron</td> <td><a
-href="http://www.pegatroncorp.com/download/New_Duke_PC_Driver_0705.zip">http://www.pegatroncorp.com/download/New_Duke_PC_Driver_0705.zip</a> (ZIP download)</td>
-</tr><tr><td>Samsung</td> <td><a
-href="http://www.samsung.com/us/support/downloads">http://www.samsung.com/us/support/downloads</a></td>
-</tr><tr><td>Sharp</td> <td><a
-href="http://k-tai.sharp.co.jp/support/">http://k-tai.sharp.co.jp/support/</a></td>
-</tr><tr><td>SK Telesys</td> <td><a
-href="http://www.sk-w.com/service/wDownload/wDownload.jsp">http://www.sk-w.com/service/wDownload/wDownload.jsp</a></td></tr><tr>
-<td>Sony Ericsson</td> <td><a
-href="http://developer.sonyericsson.com/wportal/devworld/search-downloads/driver?cc=gb&lc=en">http://developer.sonyericsson.com/wportal/devworld/search-downloads/driver?cc=gb&lc=en</a></td></tr>
-
-<tr><td>Teleepoch</td> <td><a
-href="http://www.teleepoch.com/android.html">http://www.teleepoch.com/android.html</a></td>
-</tr>
-
-<tr><td>Yulong Coolpad</td> <td><a
-href="http://www.yulong.com/product/product/product/downloadList.html#downListUL">http://www.yulong.com/product/product/product/downloadList.html#downListUL</a></td>
-</tr>
-
-<tr>
-<td>ZTE</td> <td><a
-href="http://support.zte.com.cn/support/news/NewsDetail.aspx?newsId=1000442">http://support.zte.com.cn/support/news/NewsDetail.aspx?newsId=1000442</a></td></tr>
-</table>
diff --git a/docs/html/sdk/older_releases.jd b/docs/html/sdk/older_releases.jd
index 870ff04..bb274b6 100644
--- a/docs/html/sdk/older_releases.jd
+++ b/docs/html/sdk/older_releases.jd
@@ -15,7 +15,7 @@
<p>If you already have an Android SDK for platform version 1.6 or newer, then
you do not need to install a new SDK—especially not one from this page.
You should install older platforms as components of your existing SDK.
-See <a href="adding-components.html">Adding SDK Components</a>.</p>
+See <a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>.</p>
</div>
diff --git a/docs/html/sdk/preview/features.jd b/docs/html/sdk/preview/features.jd
deleted file mode 100644
index d7ecc47..0000000
--- a/docs/html/sdk/preview/features.jd
+++ /dev/null
@@ -1,8 +0,0 @@
-@jd:body
-
-<script type="text/javascript">
- document.location=toRoot+"sdk/android-3.0.html"
-</script>
-
-<p>You should have already been redirected by your browser. Please go to the
-<a href="{@docRoot}sdk/android-3.0.html">Android 3.0 Platform</a>.</p>
\ No newline at end of file
diff --git a/docs/html/sdk/preview/installing.jd b/docs/html/sdk/preview/installing.jd
deleted file mode 100644
index 94c6f2f..0000000
--- a/docs/html/sdk/preview/installing.jd
+++ /dev/null
@@ -1,8 +0,0 @@
-@jd:body
-
-<script type="text/javascript">
- document.location=toRoot+"sdk/installing.html"
-</script>
-
-<p>You should have already been redirected by your browser. Please go to
-<a href="{@docRoot}sdk/installing.html">Installing the SDK</a>.</p>
\ No newline at end of file
diff --git a/docs/html/sdk/requirements.jd b/docs/html/sdk/requirements.jd
deleted file mode 100644
index c76e8c8..0000000
--- a/docs/html/sdk/requirements.jd
+++ /dev/null
@@ -1,114 +0,0 @@
-page.title=System Requirements
-@jd:body
-
-<p>The sections below describe the system and software requirements for developing
-Android applications using the Android SDK. </p>
-
-<h3>Supported Operating Systems</h3>
-<ul>
- <li>Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-bit)</li>
- <li>Mac OS X 10.5.8 or later (x86 only)</li>
- <li>Linux (tested on Ubuntu Linux, Lucid Lynx)
- <ul>
- <li>GNU C Library (glibc) 2.7 or later is required.</li>
- <li>On Ubuntu Linux, version 8.04 or later is required.</li>
- <li>64-bit distributions must be capable of running 32-bit applications.
- For information about how to add support for 32-bit applications, see
- the <a href="installing.html#troubleshooting">Ubuntu Linux
- installation notes</a>.</li>
- </ul>
- </li>
-</ul>
-
-<h3>Supported Development Environments</h3>
-
-<h4 style="margin-top:.25em"><em>Eclipse IDE</em></h4>
- <ul>
- <li>Eclipse 3.6.2 (Helios) or greater
-<p class="note"><strong>Note:</strong> Eclipse 3.5 (Galileo) is no longer
-supported with the latest version of ADT.</p></li>
- <li>Eclipse <a href="http://www.eclipse.org/jdt">JDT</a> plugin (included
-in most Eclipse IDE packages) </li>
- <li>If you need to install or update Eclipse, you can download it from <a
-href="http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a>.
-
- <p>Several types of Eclipse packages are available for each platform. For
-developing Android applications, we recommend that you install one of these
-packages: </p>
- <ul>
- <li>Eclipse IDE for Java Developers</li>
- <li>Eclipse Classic</li>
- <li>Eclipse IDE for Java EE Developers</li>
- </ul>
- </li>
- <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 6</a>
- (JRE alone is not sufficient)</li>
- <li><a href="eclipse-adt.html">Android Development Tools plugin</a>
-(recommended)</li>
- <li><strong>Not</strong> compatible with Gnu Compiler for Java (gcj)</li>
- </ul>
-
-
-<h4><em>Other development environments or IDEs</em></h4>
- <ul>
- <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 6</a>
- (JRE alone is not sufficient)</li>
- <li><a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later</li>
- <li><strong>Not</strong> compatible with Gnu Compiler for Java (gcj)</li>
- </ul>
- </li>
-</ul>
-
-<p class="note"><strong>Note:</strong> If JDK is already installed on your development computer, please take a moment to make sure that it meets the version requirements listed above. In
-particular, note that some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which are not supported for Android development. </p>
-
-<h3>Hardware requirements</h3>
-
-<p>The Android SDK requires disk storage for all of the components that you choose to install. The table below provides a rough idea of the disk-space requirements to expect, based on the components that you plan to use. </p>
-
-<table>
-<tr>
-<th>Component type</th>
-<th>Approximate size</th>
-<th>Comments</th>
-</tr>
-<tr>
-<td>SDK Tools</td>
-<td>35 MB</td>
-<td>Required.</td>
-</tr>
-<tr>
-<td>SDK Platform-tools</td>
-<td>6 MB</td>
-<td>Required.</td>
-</tr>
-<tr>
-<td>Android platform (each)</td>
-<td>150 MB</td>
-<td>At least one platform is required.</td>
-</tr>
-<tr>
-<td>SDK Add-on (each)</td>
-<td>100 MB</td>
-<td>Optional.</td>
-</tr>
-<tr>
-<td>USB Driver for Windows</td>
-<td>10 MB</td>
-<td>Optional. For Windows only.</td>
-</tr>
-<tr>
-<td>Samples (per platform)</td>
-<td>10M</td>
-<td>Optional.</td>
-</tr>
-<tr>
-<td>Offline documentation</td>
-<td>250 MB</td>
-<td>Optional.</td>
-</tr>
-</table>
-
-<p>Note that the disk-space requirements above are <em>in addition to</em> those of the Eclipse IDE, JDK, or other prerequisite tools that you may need to install on your development computer.</p>
-
-
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
deleted file mode 100644
index e994d95..0000000
--- a/docs/html/sdk/sdk_toc.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-<?cs if:!sdk.redirect ?>
-<ul>
- <li>
- <span class="heading">
- <span class="en">Android SDK Starter Package</span>
- <span style="display:none" class="de">Aktuelle SDK-Version</span>
- <span style="display:none" class="es">Versión actual del SDK</span>
- <span style="display:none" class="fr">Version actuelle du SDK</span>
- <span style="display:none" class="it">Release SDK attuale</span>
- <span style="display:none" class="ja">現在リリースされている SDK</span>
- <span style="display:none" class="zh-CN">当前的 SDK 版本</span>
- <span style="display:none" class="zh-TW">目前 SDK 發行版本</span>
- </span>
- <ul><?cs
- if:android.whichdoc == "online" ?>
- <li><a href="<?cs var:toroot ?>sdk/index.html">
- <span class="en">Download</span>
- <span style="display:none" class="de">Herunterladen</span>
- <span style="display:none" class="es">Descargar</span>
- <span style="display:none" class="fr">Téléchargement</span>
- <span style="display:none" class="it">Download</span>
- <span style="display:none" class="ja">ダウンロード</span>
- <span style="display:none" class="zh-CN">下载</span>
- <span style="display:none" class="zh-TW">下載</span>
- </a></li><?cs
- /if ?>
- <li><a href="<?cs var:toroot ?>sdk/installing.html">
- <span class="en">Installing the SDK</span>
- <span style="display:none" class="de">Installieren</span>
- <span style="display:none" class="es">Instalación</span>
- <span style="display:none" class="fr">Installation</span>
- <span style="display:none" class="it">Installazione</span>
- <span style="display:none" class="ja">インストール</span>
- <span style="display:none" class="zh-CN">安装</span>
- <span style="display:none" class="zh-TW">安裝</span>
- </a></li>
- </ul>
- </li><?cs
- if:sdk.preview ?>
- <li>
- <span class="heading">Android 3.0 Preview SDK</span>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/preview/start.html">Getting Started</a></li>
- </ul>
- </li><?cs
- /if ?>
- <?cs
- if:sdk.preview ?>
- <li>
- <span class="heading">Android x.x Preview</span>
- <ul>
- </ul>
- </li><?cs
- /if ?>
- <li>
- <span class="heading">
- <span class="en">Downloadable SDK Packages</span>
- <span style="display:none" class="de"></span>
- <span style="display:none" class="es"></span>
- <span style="display:none" class="fr"></span>
- <span style="display:none" class="it"></span>
- <span style="display:none" class="ja"></span>
- <span style="display:none" class="zh-CN"></span>
- <span style="display:none" class="zh-TW"></span>
- </span>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/adding-components.html">
- <span class="en">Adding SDK Packages</span>
- <span style="display:none" class="de"></span>
- <span style="display:none" class="es"></span>
- <span style="display:none" class="fr"></span>
- <span style="display:none" class="it"></span>
- <span style="display:none" class="ja"></span>
- <span style="display:none" class="zh-CN"></span>
- <span style="display:none" class="zh-TW"></span></a>
- </li>
- </ul>
- <ul>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>sdk/android-4.0-highlights.html">
- <span class="en">Android 4.0.x Platform</span></a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/android-4.0.3.html">Android 4.0.3 Platform</a></li>
- <li><a href="<?cs var:toroot ?>sdk/android-4.0.html">Android 4.0 Platform</a> </li>
- </ul>
- </li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>sdk/android-3.2.html">
- <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 »</a></li>
- </ul>
- </li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>sdk/android-3.1.html">
- <span class="en">Android 3.1 Platform</span></a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/android-3.1-highlights.html">Platform Highlights</a></li>
- <li><a href="<?cs var:toroot ?>sdk/api_diff/12/changes.html">API Differences Report »</a></li>
- </ul>
- </li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>sdk/android-3.0.html">
- <span class="en">Android 3.0 Platform</span></a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/android-3.0-highlights.html">Platform Highlights</a></li>
- <li><a href="<?cs var:toroot ?>sdk/api_diff/11/changes.html">API Differences Report »</a></li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot ?>sdk/android-2.3.4.html">Android 2.3.4 Platform</span></a></li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>sdk/android-2.3.3.html">
- <span class="en">Android 2.3.3 Platform</span></a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/api_diff/10/changes.html">API Differences Report »</a></li>
- </ul>
- </li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>sdk/android-2.2.html">
- <span class="en">Android 2.2 Platform</span></a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/android-2.2-highlights.html">Platform Highlights</a></li>
- <li><a href="<?cs var:toroot ?>sdk/api_diff/8/changes.html">API Differences Report »</a></li>
- </ul>
- </li>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>sdk/android-2.1.html">
- <span class="en">Android 2.1 Platform</span></a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/api_diff/7/changes.html">API Differences Report »</a></li>
- </ul>
- </li>
- <li class="toggle-list">
- <div><a href="#" onclick="toggle(this.parentNode.parentNode,true); return false;">Other Platforms</a></div>
- <ul>
- <li class="toggle-list">
- <div><a href="<?cs var:toroot ?>sdk/android-2.3.html">
- <span class="en">Android 2.3 Platform</span></a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/android-2.3-highlights.html">Platform Highlights</a></li>
- <li><a href="<?cs var:toroot ?>sdk/api_diff/9/changes.html">API Differences Report »</a></li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot ?>sdk/android-2.0.1.html">Android 2.0.1 Platform</a></li>
- <li><a href="<?cs var:toroot ?>sdk/android-2.0.html">Android 2.0 Platform</a></li>
- <li><a href="<?cs var:toroot ?>sdk/android-1.6.html">Android 1.6 Platform</a></li>
- <li><a href="<?cs var:toroot ?>sdk/android-1.5.html">Android 1.5 Platform</a></li>
- <li><a href="<?cs var:toroot ?>sdk/android-1.1.html">Android 1.1 Platform</a></li>
- </ul>
- </li>
- </ul>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r19</a></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">Support Package, r7</a></li>
- </ul>
- </li>
- <li>
- <span class="heading">
- <span class="en">ADT Plugin for Eclipse</span>
- <span style="display:none" class="de"></span>
- <span style="display:none" class="es"></span>
- <span style="display:none" class="fr"></span>
- <span style="display:none" class="it"></span>
- <span style="display:none" class="ja"></span>
- <span style="display:none" class="zh-CN"></span>
- <span style="display:none" class="zh-TW"></span>
- </span>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/eclipse-adt.html">ADT 18.0.0
- <span style="display:none" class="de"></span>
- <span style="display:none" class="es"></span>
- <span style="display:none" class="fr"></span>
- <span style="display:none" class="it"></span>
- <span style="display:none" class="ja"></span>
- <span style="display:none" class="zh-CN"></span>
- <span style="display:none" class="zh-TW"></span></a>
- </li>
- </ul>
- </li>
- <li>
- <span class="heading">
- <span class="en">Native Development Tools</span>
- <span style="display:none" class="de"></span>
- <span style="display:none" class="es"></span>
- <span style="display:none" class="fr"></span>
- <span style="display:none" class="it"></span>
- <span style="display:none" class="ja"></span>
- <span style="display:none" class="zh-CN"></span>
- <span style="display:none" class="zh-TW"></span>
- </span>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Android NDK, r7c</a></li>
- <li><a href="<?cs var:toroot ?>sdk/ndk/overview.html">What is the NDK?</a></li>
- </ul>
- </li>
-
- <li>
- <span class="heading">
- <span class="en">More Information</span>
- <span style="display:none" class="de"></span>
- <span style="display:none" class="es"></span>
- <span style="display:none" class="fr"></span>
- <span style="display:none" class="it"></span>
- <span style="display:none" class="ja"></span>
- <span style="display:none" class="zh-CN"></span>
- <span style="display:none" class="zh-TW"></span>
- </span>
- <ul>
- <li><a href="<?cs var:toroot ?>sdk/oem-usb.html">
- <span class="en">OEM USB Drivers</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>sdk/requirements.html">SDK System Requirements</a></li>
- <li><a href="<?cs var:toroot ?>sdk/older_releases.html">SDK Archives</a></li>
-
- </ul>
- </li>
-
-</ul>
-
-<script type="text/javascript">
-<!--
- buildToggleLists();
- changeNavLang(getLangPref());
-//-->
-</script>
-<?cs /if ?>
diff --git a/docs/html/sdk/terms.jd b/docs/html/sdk/terms.jd
deleted file mode 100644
index 614a438..0000000
--- a/docs/html/sdk/terms.jd
+++ /dev/null
@@ -1,207 +0,0 @@
-page.title=Terms and Conditions
-hide_license_footer=true
-@jd:body
-
-<p>This is the Android Software Development Kit License Agreement.</p>
-
-<h2>
- 1. Introduction
-</h2>
-<p>
- 1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
-
-</p>
-<p>
- 1.2 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
-</p>
-<h2>
- 2. Accepting this License Agreement
-</h2>
-<p>
- 2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement.
-</p>
-<p>
- 2.2 You can accept this License Agreement by:
-</p>
-<p>
- (A) clicking to accept or agree to this License Agreement, where this option is made available to you; or
-</p>
-<p>
- (B) by actually using the SDK. In this case, you agree that use of the SDK constitutes acceptance of the Licensing Agreement from that point onwards.
-</p>
-<p>
- 2.3 You may not use the SDK and may not accept the Licensing Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK.
-</p>
-<p>
- 2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the Licensing Agreement or use the SDK on behalf of your employer or other entity.
-</p>
-<h2>
- 3. SDK License from Google
-</h2>
-<p>
- 3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non- assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform.
-</p>
-<p>
- 3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
-
-</p>
-<p>
- 3.3 Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
-</p>
-<p>
- 3.4 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
-</p>
-<p>
- 3.5 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.
-</p>
-<p>
- 3.6 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
-</p>
-<p>
- 3.7 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
-</p>
-<h2>
- 4. Use of the SDK by You
-</h2>
-<p>
- 4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications.
-</p>
-<p>
- 4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
-</p>
-<p>
- 4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, your must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.
-</p>
-<p>
- 4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier.
-</p>
-<p>
- 4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through the Android platform and/or applications for the Android platform, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
-</p>
-<p>
- 4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
-</p>
-<h2>
- 5. Your Developer Credentials
-</h2>
-<p>
- 5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
-</p>
-<h2>
- 6. Privacy and Information
-</h2>
-<p>
- 6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected.
-</p>
-<p>
- 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy.
-</p>
-<h2>
- 7. Third Party Applications for the Android Platform
-</h2>
-<p>
- 7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
-</p>
-<p>
- 7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners.
-</p>
-<p>
- 7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties.
-</p>
-<h2>
- 8. Using Android APIs
-</h2>
-<p>
- 8.1 Google Data APIs
-</p>
-<p>
- 8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.
-</p>
-<p>
- 8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so.
-
-</p>
-<h2>
- 9. Terminating this License Agreement
-</h2>
-<p>
- 9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below.
-</p>
-<p>
- 9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials.
-</p>
-<p>
- 9.3 Google may at any time, terminate this License Agreement with you if:
-</p>
-<p>
- (A) you have breached any provision of this License Agreement; or
-</p>
-<p>
- (B) Google is required to do so by law; or
-</p>
-<p>
- (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or
-</p>
-<p>
- (D) Google decides to no longer providing the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
-</p>
-<p>
- 9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.
-</p>
-<h2>
- 10. DISCLAIMER OF WARRANTIES
-</h2>
-<p>
- 10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
-</p>
-<p>
- 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
-</p>
-<p>
- 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-</p>
-<h2>
- 11. LIMITATION OF LIABILITY
-</h2>
-<p>
- 11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
-</p>
-<h2>
- 12. Indemnification
-</h2>
-<p>
- 12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement.
-</p>
-<h2>
- 13. Changes to the License Agreement
-</h2>
-<p>
- 13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.
-</p>
-<h2>
- 14. General Legal Terms
-</h2>
-<p>
- 14.1 This License Agreement constitute the whole legal agreement between you and Google and govern your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replace any prior agreements between you and Google in relation to the SDK.
-</p>
-<p>
- 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
-</p>
-<p>
- 14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable.
-</p>
-<p>
- 14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement.
-</p>
-<p>
- 14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
-</p>
-<p>
- 14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party.
-</p>
-<p>
- 14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
-</p>
-<p>
- <em>April 10, 2009</em>
-</p>
diff --git a/docs/html/sdk/terms_body.html b/docs/html/sdk/terms_body.html
deleted file mode 100644
index 8c55b37..0000000
--- a/docs/html/sdk/terms_body.html
+++ /dev/null
@@ -1,336 +0,0 @@
-
-
-<p>This is the Android Software Development Kit License Agreement.</p>
-
-<h2>
- 1. Introduction
-</h2>
-<p>
- 1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK"
-and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is
-licensed to you subject to the terms of this License Agreement. This License Agreement forms a
-legally binding contract between you and Google in relation to your use of the SDK.
-
-</p>
-<p>
- 1.2 "Google" means Google Inc., a Delaware corporation with principal place of business at
-1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
-</p>
-<h2>
- 2. Accepting this License Agreement
-</h2>
-<p>
- 2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use
-the SDK if you do not accept this License Agreement.
-</p>
-<p>
- 2.2 You can accept this License Agreement by:
-</p>
-<p>
- (A) clicking to accept or agree to this License Agreement, where this option is made
-available to you; or
-</p>
-<p>
- (B) by actually using the SDK. In this case, you agree that use of the SDK constitutes
-acceptance of the Licensing Agreement from that point onwards.
-</p>
-<p>
- 2.3 You may not use the SDK and may not accept the Licensing Agreement if you are a person
-barred from receiving the SDK under the laws of the United States or other countries including the
-country in which you are resident or from which you use the SDK.
-</p>
-<p>
- 2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or
-other entity, you represent and warrant that you have full legal authority to bind your employer or
-such entity to this License Agreement. If you do not have the requisite authority, you may not
-accept the Licensing Agreement or use the SDK on behalf of your employer or other entity.
-</p>
-<h2>
- 3. SDK License from Google
-</h2>
-<p>
- 3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide,
-royalty-free, non- assignable and non-exclusive license to use the SDK solely to develop
-applications to run on the Android platform.
-</p>
-<p>
- 3.2 You agree that Google or third parties own all legal right, title and interest in and to
-the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property
-Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law,
-and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
-
-</p>
-<p>
- 3.3 Except to the extent required by applicable third party licenses, you may not copy
-(except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble,
-or create derivative works of the SDK or any part of the SDK. Except to the extent required by
-applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any
-other hardware device except a personal computer, combine any part of the SDK with other software,
-or distribute any software or device incorporating a part of the SDK.
-</p>
-<p>
- 3.4 Use, reproduction and distribution of components of the SDK licensed under an open
-source software license are governed solely by the terms of that open source software license and
-not this License Agreement.
-</p>
-<p>
- 3.5 You agree that the form and nature of the SDK that Google provides may change without
-prior notice to you and that future versions of the SDK may be incompatible with applications
-developed on previous versions of the SDK. You agree that Google may stop (permanently or
-temporarily) providing the SDK (or any features within the SDK) to you or to users generally at
-Google's sole discretion, without prior notice to you.
-</p>
-<p>
- 3.6 Nothing in this License Agreement gives you a right to use any of Google's trade names,
-trademarks, service marks, logos, domain names, or other distinctive brand features.
-</p>
-<p>
- 3.7 You agree that you will not remove, obscure, or alter any proprietary rights notices
-(including copyright and trademark notices) that may be affixed to or contained within the SDK.
-</p>
-<h2>
- 4. Use of the SDK by You
-</h2>
-<p>
- 4.1 Google agrees that it obtains no right, title or interest from you (or your licensors)
-under this License Agreement in or to any software applications that you develop using the SDK,
-including any intellectual property rights that subsist in those applications.
-</p>
-<p>
- 4.2 You agree to use the SDK and write applications only for purposes that are permitted by
-(a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or
-guidelines in the relevant jurisdictions (including any laws regarding the export of data or
-software to and from the United States or other relevant countries).
-</p>
-<p>
- 4.3 You agree that if you use the SDK to develop applications for general public users, you
-will protect the privacy and legal rights of those users. If the users provide you with user names,
-passwords, or other login information or personal information, your must make the users aware that
-the information will be available to your application, and you must provide legally adequate privacy
-notice and protection for those users. If your application stores personal or sensitive information
-provided by users, it must do so securely. If the user provides your application with Google Account
-information, your application may only use that information to access the user's Google Account
-when, and for the limited purposes for which, the user has given you permission to do so.
-</p>
-<p>
- 4.4 You agree that you will not engage in any activity with the SDK, including the
-development or distribution of an application, that interferes with, disrupts, damages, or accesses
-in an unauthorized manner the servers, networks, or other properties or services of any third party
-including, but not limited to, Google or any mobile communications carrier.
-</p>
-<p>
- 4.5 You agree that you are solely responsible for (and that Google has no responsibility to
-you or to any third party for) any data, content, or resources that you create, transmit or display
-through the Android platform and/or applications for the Android platform, and for the consequences
-of your actions (including any loss or damage which Google may suffer) by doing so.
-</p>
-<p>
- 4.6 You agree that you are solely responsible for (and that Google has no responsibility to
-you or to any third party for) any breach of your obligations under this License Agreement, any
-applicable third party contract or Terms of Service, or any applicable law or regulation, and for
-the consequences (including any loss or damage which Google or any third party may suffer) of any
-such breach.
-</p>
-<h2>
- 5. Your Developer Credentials
-</h2>
-<p>
- 5.1 You agree that you are responsible for maintaining the confidentiality of any developer
-credentials that may be issued to you by Google or which you may choose yourself and that you will
-be solely responsible for all applications that are developed under your developer credentials.
-</p>
-<h2>
- 6. Privacy and Information
-</h2>
-<p>
- 6.1 In order to continually innovate and improve the SDK, Google may collect certain usage
-statistics from the software including but not limited to a unique identifier, associated IP
-address, version number of the software, and information on which tools and/or services in the SDK
-are being used and how they are being used. Before any of this information is collected, the SDK
-will notify you and seek your consent. If you withhold consent, the information will not be
-collected.
-</p>
-<p>
- 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in
-accordance with Google's Privacy Policy.
-</p>
-<h2>
- 7. Third Party Applications for the Android Platform
-</h2>
-<p>
- 7.1 If you use the SDK to run applications developed by a third party or that access data,
-content or resources provided by a third party, you agree that Google is not responsible for those
-applications, data, content, or resources. You understand that all data, content or resources which
-you may access through such third party applications are the sole responsibility of the person from
-which they originated and that Google is not liable for any loss or damage that you may experience
-as a result of the use or access of any of those third party applications, data, content, or
-resources.
-</p>
-<p>
- 7.2 You should be aware the data, content, and resources presented to you through such a
-third party application may be protected by intellectual property rights which are owned by the
-providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan,
-sell, distribute or create derivative works based on these data, content, or resources (either in
-whole or in part) unless you have been specifically given permission to do so by the relevant
-owners.
-</p>
-<p>
- 7.3 You acknowledge that your use of such third party applications, data, content, or
-resources may be subject to separate terms between you and the relevant third party. In that case,
-this License Agreement does not affect your legal relationship with these third parties.
-</p>
-<h2>
- 8. Using Android APIs
-</h2>
-<p>
- 8.1 Google Data APIs
-</p>
-<p>
- 8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be
-protected by intellectual property rights which are owned by Google or those parties that provide
-the data (or by other persons or companies on their behalf). Your use of any such API may be subject
-to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create
-derivative works based on this data (either in whole or in part) unless allowed by the relevant
-Terms of Service.
-</p>
-<p>
- 8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree
-that you shall retrieve data only with the user's explicit consent and only when, and for the
-limited purposes for which, the user has given you permission to do so.
-
-</p>
-<h2>
- 9. Terminating this License Agreement
-</h2>
-<p>
- 9.1 This License Agreement will continue to apply until terminated by either you or Google
-as set out below.
-</p>
-<p>
- 9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of
-the SDK and any relevant developer credentials.
-</p>
-<p>
- 9.3 Google may at any time, terminate this License Agreement with you if:
-</p>
-<p>
- (A) you have breached any provision of this License Agreement; or
-</p>
-<p>
- (B) Google is required to do so by law; or
-</p>
-<p>
- (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has
-terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or
-</p>
-<p>
- (D) Google decides to no longer providing the SDK or certain parts of the SDK to users in
-the country in which you are resident or from which you use the service, or the provision of the SDK
-or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially
-viable.
-</p>
-<p>
- 9.4 When this License Agreement comes to an end, all of the legal rights, obligations and
-liabilities that you and Google have benefited from, been subject to (or which have accrued over
-time whilst this License Agreement has been in force) or which are expressed to continue
-indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall
-continue to apply to such rights, obligations and liabilities indefinitely.
-</p>
-<h2>
- 10. DISCLAIMER OF WARRANTIES
-</h2>
-<p>
- 10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND
-THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
-</p>
-<p>
- 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE
-OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR
-COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
-</p>
-<p>
- 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER
-EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-</p>
-<h2>
- 11. LIMITATION OF LIABILITY
-</h2>
-<p>
- 11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND
-ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY
-LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN
-AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
-</p>
-<h2>
- 12. Indemnification
-</h2>
-<p>
- 12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold
-harmless Google, its affiliates and their respective directors, officers, employees and agents from
-and against any and all claims, actions, suits or proceedings, as well as any and all losses,
-liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or
-accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any
-copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any
-person or defames any person or violates their rights of publicity or privacy, and (c) any
-non-compliance by you with this License Agreement.
-</p>
-<h2>
- 13. Changes to the License Agreement
-</h2>
-<p>
- 13.1 Google may make changes to the License Agreement as it distributes new versions of the
-SDK. When these changes are made, Google will make a new version of the License Agreement available
-on the website where the SDK is made available.
-</p>
-<h2>
- 14. General Legal Terms
-</h2>
-<p>
- 14.1 This License Agreement constitute the whole legal agreement between you and Google and
-govern your use of the SDK (excluding any services which Google may provide to you under a separate
-written agreement), and completely replace any prior agreements between you and Google in relation
-to the SDK.
-</p>
-<p>
- 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which
-is contained in this License Agreement (or which Google has the benefit of under any applicable
-law), this will not be taken to be a formal waiver of Google's rights and that those rights or
-remedies will still be available to Google.
-</p>
-<p>
- 14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any
-provision of this License Agreement is invalid, then that provision will be removed from this
-License Agreement without affecting the rest of this License Agreement. The remaining provisions of
-this License Agreement will continue to be valid and enforceable.
-</p>
-<p>
- 14.4 You acknowledge and agree that each member of the group of companies of which Google is
-the parent shall be third party beneficiaries to this License Agreement and that such other
-companies shall be entitled to directly enforce, and rely upon, any provision of this License
-Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person
-or company shall be third party beneficiaries to this License Agreement.
-</p>
-<p>
- 14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS.
-YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE
-SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
-</p>
-<p>
- 14.6 The rights granted in this License Agreement may not be assigned or transferred by
-either you or Google without the prior written approval of the other party. Neither you nor Google
-shall be permitted to delegate their responsibilities or obligations under this License Agreement
-without the prior written approval of the other party.
-</p>
-<p>
- 14.7 This License Agreement, and your relationship with Google under this License Agreement,
-shall be governed by the laws of the State of California without regard to its conflict of laws
-provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located
-within the county of Santa Clara, California to resolve any legal matter arising from this License
-Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for
-injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
-</p>
-<p>
- <em>April 10, 2009</em>
-</p>
\ No newline at end of file
diff --git a/docs/html/sdk/tools-notes.jd b/docs/html/sdk/tools-notes.jd
deleted file mode 100644
index 062f8f1..0000000
--- a/docs/html/sdk/tools-notes.jd
+++ /dev/null
@@ -1,857 +0,0 @@
-page.title=SDK Tools
-@jd:body
-
-<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
-href="{@docRoot}sdk/index.html">SDK starter package</a> installs the
-latest revision of the SDK Tools in the <code><sdk>/tools</code> directory.</p>
-
-<p>If you are already using the SDK and you want to update to the latest version
-of the SDK Tools, use the <em>Android SDK Manager</em> to get the
-update, rather than downloading a new SDK starter package. For more information
-about how to update, see <a
-href="{@docRoot}sdk/adding-components.html#UpdatingComponents">Updating SDK
-Components</a>.</p>
-
-
-<h2 id="notes">Revisions</h2>
-
-<p>The sections below provide notes about successive releases of
-the SDK Tools, as denoted by revision number. To determine what revision of the SDK
-Tools you are using, refer to the "Installed Packages" listing in the Android SDK Manager. </p>
-
-<p>For a summary of all known issues in SDK Tools, see <a
-href="http://tools.android.com/knownissues">http://tools.android.com/knownissues</a>.</p>
-
-<script type="text/javascript">
-function toggleDiv(link) {
- var toggleable = $(link).parent();
- if (toggleable.hasClass("closed")) {
- //$(".toggleme", toggleable).slideDown("fast");
- toggleable.removeClass("closed");
- toggleable.addClass("open");
- $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
- } else {
- //$(".toggleme", toggleable).slideUp("fast");
- toggleable.removeClass("open");
- toggleable.addClass("closed");
- $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
- }
- return false;
-}
-</script>
-<style>
-.toggleable {
-padding: .25em 1em;
-}
-.toggleme {
- padding: 1em 1em 0 2em;
- line-height:1em;
-}
-.toggleable a {
- text-decoration:none;
-}
-.toggleme a {
- text-decoration:underline;
-}
-.toggleable.closed .toggleme {
- display:none;
-}
-#jd-content .toggle-img {
- margin:0;
-}
-</style>
-
-<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 19</a> <em>(April 2012)</em>
-
- <div class="toggleme">
- <p class="note"><strong>Note:</strong> This update of SDK Tools is only available through
-the <a href="{@docRoot}sdk/adding-components.html">Android SDK Manager</a>. Use this tool to
-download and install this update.</p>
-
- <dl>
- <dt>Dependencies:</dt>
- <dd>
- <ul>
- <li>Android SDK Platform-tools revision 9 or later.</li>
- <li>If you are developing in Eclipse with ADT, note that the SDK Tools r19 is designed for
- use with ADT 18.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 18.0.0.</li>
- <li>If you are developing outside Eclipse, you must have
- <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li>
- </ul>
- </dd>
- <dt>Bug fixes:</dt>
- <dd>
- <ul>
- <li>Fixed an issue that prevented some developers from running the emulator with GPU
-acceleration.</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 18</a> <em>(April 2012)</em>
-
- <div class="toggleme">
- <p class="caution"><strong>Important:</strong> To download the new Android
- 4.0 system components from the Android SDK Manager, you must first update the
- SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
- the Android 4.0 system components will not be available for download.</p>
-
- <dl>
- <dt>Dependencies:</dt>
- <dd>
- <ul>
- <li>Android SDK Platform-tools revision 9 or later.</li>
- <li>If you are developing in Eclipse with ADT, note that the SDK Tools r18 is designed for
- use with ADT 18.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 18.0.0.</li>
- <li>If you are developing outside Eclipse, you must have
- <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li>
- </ul>
- </dd>
- <dt>General notes:</dt>
- <dd>
- <ul>
- <li>Updated the SdkController app to encapsulate both sensor and multitouch emulation
- functionality.</li>
- </ul>
- </dd>
- <dt>Bug fixes:</dt>
- <dd>
- <ul>
- <li>Fixed Ant issues where some jar libraries in the {@code libs/} folder are not picked up
-in some cases.</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 17</a> <em>(March 2012)</em>
-
- <div class="toggleme">
- <p class="caution"><strong>Important:</strong> To download the new Android
- 4.0 system components from the Android SDK Manager, you must first update the
- SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
- the Android 4.0 system components will not be available for download.</p>
-
- <dl>
- <dt>Dependencies:</dt>
- <dd>
- <ul>
- <li>Android SDK Platform-tools revision 9 or later.</li>
- <li>If you are developing in Eclipse with ADT, note that the SDK Tools r17 is designed for
- use with ADT 17.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 17.0.0.</li>
- <li>If you are developing outside Eclipse, you must have
- <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li>
- </ul>
- </dd>
- <dt>General notes:</dt>
- <dd>
- <ul>
- <li>Emulator
- <ul>
- <li>Added support for hardware accelerated graphics rendering. This feature requires an
-API Level 15, Revision 3 or later system image.
-(<a href="{@docRoot}guide/developing/devices/emulator.html#accel-graphics">more info</a>)
- </li>
- <li>Added support for running Android x86 system images in virtualization mode on
-Windows and Mac OS X.
-(<a href="{@docRoot}guide/developing/devices/emulator.html#accel-vm">more info</a>)
- <p class="note"><strong>Note:</strong> Use the Android SDK Manager to download and
-install x86 system images. Android x86 system images are not available for all API levels.</p>
- </li>
- <li>Added experimental support for multi-touch input by enabing the emulator to receive
- touch input from a USB-tethered physical Android device.
- (<a href="http://tools.android.com/tips/hardware-emulation">more info</a>)</li>
- </ul>
- </li>
- <li>Added viewing of live detailed network usage of an app in DDMS. (<a
- href="http://tools.android.com/recent/detailednetworkusageinddms">more info</a>)</li>
- <li>ProGuard
- <ul>
- <li>Updated the bundled ProGuard tool to version 4.7. In addition to many new features,
-this update fixes the {@code Conversion to Dalvik format failed with error 1} error some users have
-experienced.</li>
- <li>Updated the default {@code proguard.cfg} file with better default flags for
- Android.</li>
- <li>Split the ProGuard configuration file has been in half, with project specific flags
-kept in project and the generic Android flags distributed (and updated) with the tools
-themselves.</li>
- </ul>
- </li>
- <li>Build
- <ul>
- <li>Added a feature that allows you to run some code only in debug mode. Builds now
-generate a class called {@code BuildConfig} containing a {@code DEBUG} constant that is
-automatically set according to your build type. You can check the ({@code BuildConfig.DEBUG})
-constant in your code to run debug-only functions.</li>
- <li>Fixed issue when a project and its libraries include the same jar file in their libs
- folder. (<a href="http://tools.android.com/recent/dealingwithdependenciesinandroidprojects">more
- info</a>)</li>
- <li>Added support for custom views with custom attributes in libraries. Layouts using
-custom attributes must use the namespace URI {@code http://schemas.android.com/apk/res-auto} instead
-of the URI that includes the app package name. This URI is replaced with the app specific one at
-build time.</li>
- </ul>
- </li>
- <li>Lint
- <ul>
- <li>Updated Lint to check Android application code. Lint rules which previously
-performed pattern based searches in the application code (such as the unused resource check) have
-been rewritten to use the more accurate Java-style parse trees.</li>
- <li>Added support for checking library projects. This change means that rules such as
-the unused resource check properly handle resources declared in a library project and referenced in
-a downstream project.</li>
- <li>Added ability to suppress Lint warnings in Java code with the new
-{@code @SuppressLint} annotation, and in XML files with the new tools: namespace and
-ignore attribute. (<a
- href="http://tools.android.com/recent/ignoringlintwarnings">more info</a>)</li>
- <li>New Lint checks:
- <ul>
- <li>Added check for Android API calls that require a version of Android higher than
- the minimum supported version. You can use the new {@code @TargetApi} annotation
- to suppress warnings when the code is wrapped in a system version condition.
- (<a href="http://tools.android.com/recent/lintapicheck">more info</a>)</li>
- <li>Added over 20 new Lint rules, including checks for
- <a href="http://tools.android.com/recent/lintperformancechecks">performance</a>,
- XML layouts, manifest and file handling.</li>
- </ul>
- </li>
- </ul>
- </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 16</a> <em>(December 2011)</em>
-
- <div class="toggleme">
- <p class="caution"><strong>Important:</strong> To download the new Android
- 4.0 system components from the Android SDK Manager, you must first update the
- SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
- the Android 4.0 system components will not be available for download.</p>
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
- <ul>
- <li>Android SDK Platform-tools revision 9 or later.</li>
- <li>If you are developing in Eclipse with ADT, note that the SDK Tools r16 is designed for use
- with ADT 16.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 16.0.0.</li>
- <li>If you are developing outside Eclipse, you must have <a href="http://ant.apache.org/">Apache
- Ant</a> 1.8 or later.</li>
-</ul>
-</dd>
-<dt>General notes:</dt>
-<dd>
- <ul>
- <li>Added Lint tools to detect common errors in Android projects.
- (<a href="http://tools.android.com/recent/lint">more info</a>)</li>
- <li>Added sensor emulation support, which allows the emulator to read sensor data from a
- physical Android device.
- (<a href="http://tools.android.com/recent/sensoremulation">more info</a>)</li>
- <li>Added support for using a webcam to emulate a camera on Mac OS X.</li>
- </ul>
-</dd>
-<dt>Bug fixes:</dt>
-<dd>
- <ul>
- <li>Snapshots now work for Android 4.0 system images.</li>
- <li>Fixed several small issues for the build file.
- (<a href="http://code.google.com/p/android/issues/detail?id=21023">Issue 21023</a>,
- <a href="http://code.google.com/p/android/issues/detail?id=21267">Issue 21267</a>,
- <a href="http://code.google.com/p/android/issues/detail?id=21465">Issue 21465</a>,
- <a href="http://code.google.com/p/android/issues/detail?id=21525">Issue 21525</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 15</a> <em>(October 2011)</em>
-
- <div class="toggleme">
- <p class="caution"><strong>Important:</strong> To download the new Android
- 4.0 system components from the Android SDK Manager, you must first update the
- SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
- the Android 4.0 system components will not be available for download.</p>
- <dl>
-<dt>Dependencies:</dt>
-<dd>
- <ul><li>Android SDK Platform-tools revision 9 or later.</li>
- <li>If you are developing in Eclipse with ADT, note that the SDK Tools r15 is designed for use
- with ADT 15.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 15.0.0.</li>
- <li>If you are developing outside Eclipse, you must have <a href="http://ant.apache.org/">Apache
- Ant</a> 1.8 or later.</li>
-</ul>
-
-<dt>Bug fixes:</dt>
-<dd>
- <ul>
- <li>Fixed emulator crash on Linux due to improper webcam detection
- (<a href="http://code.google.com/p/android/issues/detail?id=20952">Issue 20952</a>).</li>
- <li>Fixed emulator issue when using the <code>-wipe-data</code> argument.</li>
- <li>Fixed build issue when using Renderscript in projects that target API levels 11-13
- (<a href="http://code.google.com/p/android/issues/detail?id=21006">Issue 21006</a>).</li>
- <li>Fixed issue when creating an AVD using the GoogleTV addon
- (<a href="http://code.google.com/p/android/issues/detail?id=20963">Issue 20963</a>).</li>
- <li>Fixed <code>ant test</code>
- (<a href="http://code.google.com/p/android/issues/detail?id=20979">Issue 20979</a>).</li>
- <li>Fixed <code>android update project</code>
- (<a href="http://code.google.com/p/android/issues/detail?id=20535">Issue 20535</a>).</li>
- <li>Fixed scrolling issue in the new Logcat panel of DDMS.</li>
- <li>Fixed issue with MonkeyRunner
- (<a href="http://code.google.com/p/android/issues/detail?id=20964">Issue 20964</a>).</li>
- <li>Fixed issues in the SDK Manager
- (<a href="http://code.google.com/p/android/issues/detail?id=20939">Issue 20939</a>,
- <a href="http://code.google.com/p/android/issues/detail?id=20607">Issue 20607</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 14</a> <em>(October 2011)</em>
-
- <div class="toggleme">
- <p class="note"><strong>Important:</strong> To download the new Android
- 4.0 system components from the Android SDK Manager, you must first update the
- SDK tools to revision 14 and restart the Android SDK Manager. If you do not,
- the Android 4.0 system components will not be available for download.</p>
- <dl>
-<dt>Dependencies:</dt>
-<dd>
- <ul><li>Android SDK Platform-tools revision 8 or later.</li>
- <li>If you are developing in Eclipse with ADT, note that the SDK Tools r14 is designed for use
- with ADT 14.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 14.0.0.</li>
- <li>If you are developing outside Eclipse, you must have <a href="http://ant.apache.org/">Apache
- Ant</a> 1.8 or later.</li>
-</ul>
-
-<dt>General notes:</dt>
-<dd>
- <ul>
- <li>Added webcam support to Android 4.0 or later platforms to emulate rear-facing cameras when
- one webcam is present, and to emulate both rear-facing and front-facing cameras when two
- webcams are present. Webcam support is for Windows and Linux only.
- Mac support will come in a later release.</li>
- <li>Changed <code>default.properties</code> to <code>project.properties</code> and
- <code>build.properties</code> to <code>ant.properties</code>. Any existing
- projects that you build with Ant must be updated with the <code>android update project</code>
- command.</li>
- <li>Changed Ant <code>build.xml</code> file to support improvements to the
- build system and added and modified Ant commands to support these changes. For a list of Ant
-commands, see the
-<a href="{@docRoot}guide/developing/building/building-cmdline.html#AntReference">Ant Command
-Reference</a>.</li>
- <li>Changed how library projects are built.</li>
- <li>Improved incremental builds, so that resource compilation runs less frequently. Builds no
- longer run when you edit strings or layouts (unless you add a new <code>id</code>) and no longer
- run once for each library project.</li>
- <li>Introduced a "PNG crunch cache" that only runs on modified PNG files, instead of
- crunching all existing PNG files, all the time.</li>
- <li>Revamped the SDK Manager UI (<a href="http://tools.android.com/recent/newsdkmanager">more
-info</a>).</li>
- </ul>
- <p>For a complete overview of the build system changes and what you need to do to support them,
-see the <a href="http://tools.android.com/recent/buildchangesinrevision14">Android Tools Project
-site</a>.</p>
-</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 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>
-<dt>Dependencies:</dt>
-<dd>
-<p>If you are developing in Eclipse with ADT, note that the SDK Tools r12 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>The AVD manager and emulator can now use system images
- compiled for ARM v7 and x86 CPUs.</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 11</a> <em>(May 2011)</em>
- <div class="toggleme">
- <dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>If you are developing in Eclipse with ADT, note that the SDK Tools r11 is designed for use with
-ADT 10.0.1 and later. If you haven't already, we highly recommend updating your <a
-href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin</a> to 10.0.1.</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>Miscellaneous emulator changes to support Android 3.1.</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 10</a> <em>(February 2011)</em>
- <div class="toggleme">
- <dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>If you are developing in Eclipse with ADT, note that the SDK Tools r10 is
-designed for use with ADT 10.0.0 and later. After installing SDK Tools r10, we
-highly recommend updating your ADT Plugin to 10.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>The tools now automatically generate Java Programming Language source files (in the
-<code>gen</code> directory) and
- bytecode (in the <code>res/raw</code> directory) from your native <code>.rs</code> files</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 9</a> <em>(January 2011)</em>
- <div class="toggleme">
- <dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>If you are developing in Eclipse with ADT, note that the SDK Tools r9 is
-designed for use with ADT 9.0.0 and later. After installing SDK Tools r9, we
-highly recommend updating your ADT Plugin to 9.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>Upgrading to SDK Tools r9:</dt>
-<dd>
-<p>If you are upgrading to SDK Tools r9 from SDK Tools r7 or earlier, the default installed location
-for the <code>adb</code> tool has changed from <code><<em>SDK</em>>/tools/adb</code> to
-<code><<em>SDK</em>>/platform-tools/adb</code>. This means that you should
-add the new location to your PATH and modify any custom build scripts to
-reference the new location. Copying the <code>adb</code> executable from the new
-location to the old is not recommended, since subsequent updates to the SDK
-Tools will delete the file.</p>
-</dd>
-
-<dt>General notes:</dt>
-<dd>
- <ul>
- <li>The default ProGuard configuration, <code>proguard.cfg</code>, now ignores the following classes:
- <ul>
- <li>classes that extend {@link android.preference.Preference}</li>
- <li>classes that extend {@link android.app.backup.BackupAgentHelper}</li>
- </ul>
- </li>
- <li>Ant lib rules now allow you to override <code>java.encoding</code>, <code>java.source</code>,
- and <code>java.target</code> properties.</li>
- <li>The default encoding for the <code>javac</code> Ant task is now UTF-8.</li>
- <li>The LogCat view in DDMS now properly displays UTF-8 characters.</li>
- <li>The SDK Manager is more reliable on Windows. For details on the improvements, see the
- <a href="http://tools.android.com/recent/sdkmanagerfixes">Android Tools Project Site</a>. </li>
- <li>Early look at the new snapshot feature: To improve startup time for the emulator, you can
-enable snapshots for the system state. The emulator will then restore to the state when it last
-closed almost instantly. <strong>Note:</strong> The snapshot feature is still under active
-development and might not always perform as expected.</li>
- <li>Fixed the missing JAR file error that prevented <code>draw9patch</code> from running.</li>
- <li>Fixed the Windows launch scripts <code>hierarchyviewer</code> and <code>ddms</code> to support
- the new location of <code>adb</code>.</li>
- <li>Known issues with emulator performance: Because the Android emulator must simulate the ARM
-instruction set architecture on your computer, emulator performance is slow. We're working hard to
-resolve the performance issues and it will improve in future releases.</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 8</a> <em>(December 2010)</em>
- <div class="toggleme">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>If you are developing in Eclipse with ADT, note that SDK Tools r8 is
-designed for use with ADT 8.0.0 and later. After installing SDK Tools r8, we
-highly recommend updating your ADT Plugin to 8.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>
-
-<p>Also note that SDK Tools r8 requires a new SDK component called
-<em>Platform-tools</em>. The new Platform-tools component lets all SDK platforms
-(Android 2.1, Android 2.2, and so on) use the same (latest) version of build
-tools such as <code>adb</code>, <code>aapt</code>, <code>aidl</code>, and
-<code>dx</code>. To download the Platform-tools component, use the Android SDK
-Manager, as described in <a href="adding-components.html">Adding SDK
-Components</a></p>
-
-<dt>Upgrading from SDK Tools r7:</dt>
-<dd>
-<p>If you are upgrading to SDK Tools r8 from an earlier version, note that the
-the default installed location for the <code>adb</code> tool has changed from
-<code><<em>SDK</em>>/tools/adb</code> to
-<code><<em>SDK</em>>/platform-tools/adb</code>. This means that you should
-add the new location to your PATH and modify any custom build scripts to
-reference the new location. Copying the <code>adb</code> executable from the new
-location to the old is not recommended, since subsequent updates to the SDK
-Tools will delete the file.</p>
-</dd>
-
-<dt>General notes:</dt>
-<dd>
-<ul>
-<li>All SDK platforms now support Library Projects.</li>
-<li>Support for a true debug build. Developers no longer need to add the
-<code>android:debuggable</code> attribute to the
-<code><application></code> tag in the manifest — the build tools add
-the attribute automatically. In Eclipse/ADT, all incremental builds are assumed
-to be debug builds, so the tools insert <code>android:debuggable="true"</code>.
-When exporting a signed release build, the tools do not add the attribute. In
-Ant, a <code>ant debug</code> command automatically inserts the
-<code>android:debuggable="true"</code> attribute, while <code>ant release</code>
-does not. If <code>android:debuggable="true"</code> is manually set, then
-<code>ant release</code> will actually do a debug build, rather than a release
-build.</li>
-<li>Automatic ProGuard support in release builds. Developers generate a ProGuard
-configuration file using the <code>android</code> tool — the build tools
-then automatically run ProGuard against the project sources during the build.
-For more information, see the <a
-href="{@docRoot}guide/developing/tools/proguard.html">ProGuard</a>
-documentation. </li>
-<li>New overridable Ant javac properties: <code>java.encoding</code>,
-<code>java.source</code>, and <code>java.target</code> (default values are
-"ascii", "1.5", and "1.5", respectively).</li>
-<li>New UI for the HierarchyViewer tool.</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 7</a> <em>(September 2010)</em>
- <div class="toggleme">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>If you are developing in Eclipse with ADT, note that SDK Tools r7 is
-designed for use with ADT 0.9.8 and later. After installing SDK Tools r7, we
-highly recommend updating your ADT Plugin to 0.9.8.</p>
-</dd>
-
-<dt>General notes:</dt>
-<dd>
-<ul>
-<li>Added support for library projects that depend on other library projects.</li>
-<li>Adds support for aidl files in library projects.</li>
-<li>Adds support for extension targets in Ant build to perform tasks between the
-normal tasks: <code>-pre-build</code>, <code>-pre-compile</code>, and
-<code>-post-compile</code>.</li>
-<li>Adds support for "headless" SDK update. See <code>android -h update sdk</code>
-for more information.</li>
-<li>Fixes location control in DDMS to work in any locale not using '.' as a
-decimal point.</li>
-</ul>
-</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 6</a> <em>(May 2010)</em>
- <div class="toggleme">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd>
-<p>If you are developing in Eclipse with ADT, note that SDK Tools r6 is
-designed for use with ADT 0.9.7 and later. After installing SDK Tools r6, we
-highly recommend updating your ADT Plugin to 0.9.7.</p>
-</dd>
-
-<dt>Library projects:</dt>
-<dd>
-<p>The SDK Tools now support the use of <em>library projects</em> during
-development, a capability that lets you store shared Android application
-code and resources in a separate development project. You can then reference the
-library project from other Android projects and, at build time, the tools
-compile the shared code and resources as part of the dependent applications.
-More information about this feature is available in the <a
-href="{@docRoot}guide/developing/projects/index.html#LibraryProjects">Creating and Managing Projects</a> document.</p>
-<p>If you are developing in Eclipse, <a href="eclipse-adt.html">ADT</a>
-provides the equivalent library project support.</p>
-</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 5</a> <em>(March 2010)</em>
- <div class="toggleme">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd><ul>
-<li>If you are developing in Eclipse with ADT, note that SDK Tools r5 is
-designed for use with ADT 0.9.6 and later. After installing SDK Tools r5, we
-highly recommend updating your ADT Plugin to 0.9.6.</li>
-<li>For Mac OS platforms, OS X 10.4.x (Tiger) is no longer
-officially supported. </li>
-</ul>
-</dd>
-
-<dt>SDK and AVD Manager:</dt>
-<dd>
-<ul>
-<li>Fixes SSL download for the standalone version of the SDK Updater.</li>
-<li>Fixes issue with 64-bit JVM on Windows.</li>
-<li>Adds support for platform samples components.</li>
-<li>Improves support for dependency between components.</li>
-<li>AVDs now sorted by API level.</li>
-<li>The AVD creation dialog now enforces a minimum SD card size of 9MB.</li>
-<li>Prevents deletion of running AVDs.</li>
-<li>Settings are now automatically saved, no need to click "Apply".</li>
-</ul>
-</dd>
-
-<dt>Emulator:</dt>
-<dd>
-<ul>
-<li>Emulator now requires SD card to be 9MB or more.</li>
-</ul>
-</dd>
-
-<dt>Layoutopt:</dt>
-<dd>
-<ul>
-<li>Fixes <code>layoutopt.bat</code> to execute correctly on Windows.</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 4</a> <em>(December 2009)</em>
- <div class="toggleme">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd><p>SDK Tools r4 is compatible with ADT 0.9.5 and later, but not
-compatible with earlier versions. If you are developing in Eclipse with ADT, you
-<strong>must</strong> update your ADT plugin to version 0.9.5 or higher if you
-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
-compatibility issue between GTK and SWT.</li>
-</ul>
-</dd>
-
-<dt>Android SDK and AVD Manager:</dt>
-<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
-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>
-</ul>
-</dd>
-
-<dt>Emulator:</dt>
-<dd>
-<ul>
-<li>No longer limits the size of the system partition.</li>
-</ul>
-</dd>
-
-<dt>Ant build tools:</dt>
-<dd>
-<ul>
-<li>.apk packaging now properly ignores vi swap files as well as hidden files.</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 3</a> <em>(October 2009)</em>
- <div class="toggleme">
-
-<dl>
-<dt>Dependencies:</dt>
-<dd><p>SDK Tools r3 is compatible with ADT 0.9.4 and later, but not
-compatible with earlier versions. If you are developing in Eclipse with ADT, you
-<strong>must</strong> update your ADT plugin to version 0.9.4 or higher if you
-install SDK Tools r3 in your SDK.</p>
-</dd>
-
-<dt>Android tool:</dt>
-<dd>
-<ul>
-<li>Adds new <code>android create test-project</code> and <code>android update
-test-project</code> commands to allow for greater flexibility in the location of the
-main and test projects.</li>
-</ul>
-</dd>
-
-<dt>DDMS:</dt>
-<dd>
-<ul>
-<li>Adds a button to dump HPROF file for running applications (app must be able
-to write to the sdcard).</li>
-<li>Button to start/stop profiling of a running application (app must be able to
-write to the sdcard). Upon stop, Traceview will automatically be launched to
-display the trace.</li>
-<li>Fixed DDMS, Traceview, and the AVD Mananger/SDK Updater to run on Mac OS X
-10.6.</li>
-<li>Fixed screenshot support for devices running 32-bit framebuffer.</li>
-</ul>
-</dd>
-
-<dt>Android SDK and AVD Manager:</dt>
-<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
-an AVD.</li>
-<li>Provides improved AVD creation UI, which lets you customize the hardware
-properties of your AVDs.</li>
-<li>Now enforces dependencies between platforms and tools components, and
-between SDK add-ons and platforms.</li>
-</ul>
-</dd>
-
-<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
-href="/guide/developing/tools/layoutopt.html">layoutopt</a>.</p>
-</dd>
-</dl>
- </div>
-</div>
diff --git a/docs/html/sdk/win-usb.jd b/docs/html/sdk/win-usb.jd
index 3be0faf..802615e 100644
--- a/docs/html/sdk/win-usb.jd
+++ b/docs/html/sdk/win-usb.jd
@@ -10,7 +10,7 @@
</ol>
<h2>See also</h2>
<ol>
- <li><a href="{@docRoot}sdk/oem-usb.html#InstallingDriver">Installing a USB Driver</a></li>
+ <li><a href="{@docRoot}tools/extras/oem-usb.html#InstallingDriver">Installing a USB Driver</a></li>
<li><a href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a></li>
<li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Packages</a></li>
</ol>
@@ -30,7 +30,7 @@
<p>* <em>Or similar hardware on other carriers</em></p>
<p>All other devices require Windows drivers provided by the hardware manufacturer, as listed in
-the <a href="{@docRoot}sdk/oem-usb.html">OEM USB Drivers</a> document. The Galaxy Nexus
+the <a href="{@docRoot}tools/extras/oem-usb.html">OEM USB Drivers</a> document. The Galaxy Nexus
driver is also distributed by <a
href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a>
(listed as model SCH-I515).</p>
@@ -169,4 +169,4 @@
downloaded into the <code><sdk>\extras\google\usb_driver\</code> directory.</li>
</ol>
-<p>For installation information, read <a href="{@docRoot}sdk/oem-usb.html#InstallingDriver">Installing a USB Driver</a>.</p>
+<p>For installation information, read <a href="{@docRoot}tools/extras/oem-usb.html#InstallingDriver">Installing a USB Driver</a>.</p>
diff --git a/docs/html/search.jd b/docs/html/search.jd
deleted file mode 100644
index 407bc86..0000000
--- a/docs/html/search.jd
+++ /dev/null
@@ -1,148 +0,0 @@
-page.title=Search Results
-@jd:body
-
-<script src="http://www.google.com/jsapi" type="text/javascript"></script>
-<script src="{@docRoot}assets/jquery-history.js" type="text/javascript"></script>
-<script type="text/javascript">
- var tabIndex = 0;
-
- google.load('search', '1');
-
- function OnLoad() {
- document.getElementById("search_autocomplete").style.color = "#000";
-
- // create search control
- searchControl = new google.search.SearchControl();
-
- // use our existing search form and use tabs when multiple searchers are used
- drawOptions = new google.search.DrawOptions();
- drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
- drawOptions.setInput(document.getElementById("search_autocomplete"));
-
- // configure search result options
- searchOptions = new google.search.SearcherOptions();
- searchOptions.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
-
- // configure each of the searchers, for each tab
- devSiteSearcher = new google.search.WebSearch();
- devSiteSearcher.setUserDefinedLabel("All");
- devSiteSearcher.setSiteRestriction("001482626316274216503:zu90b7s047u");
-
- devGuideSearcher = new google.search.WebSearch();
- devGuideSearcher.setUserDefinedLabel("Dev Guide");
- devGuideSearcher.setSiteRestriction("http://developer.android.com/guide/");
-
- referenceSearcher = new google.search.WebSearch();
- referenceSearcher.setUserDefinedLabel("Reference");
- referenceSearcher.setSiteRestriction("http://developer.android.com/reference/");
-
- blogSearcher = new google.search.WebSearch();
- blogSearcher.setUserDefinedLabel("Blog");
- blogSearcher.setSiteRestriction("http://android-developers.blogspot.com");
-
- groupsSearcher = new google.search.WebSearch();
- groupsSearcher.setUserDefinedLabel("Developer Groups");
- groupsSearcher.setSiteRestriction("001283715400630100512:ggqrtvkztwm");
-
- sourceSiteSearcher = new google.search.WebSearch();
- sourceSiteSearcher.setUserDefinedLabel("Android Source");
- sourceSiteSearcher.setSiteRestriction("http://source.android.com");
-
- // add each searcher to the search control
- searchControl.addSearcher(devSiteSearcher, searchOptions);
- searchControl.addSearcher(devGuideSearcher, searchOptions);
- searchControl.addSearcher(referenceSearcher, searchOptions);
- searchControl.addSearcher(groupsSearcher, searchOptions);
- searchControl.addSearcher(sourceSiteSearcher, searchOptions);
- searchControl.addSearcher(blogSearcher, searchOptions);
-
- // configure result options
- searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
- searchControl.setLinkTarget(google.search.Search.LINK_TARGET_SELF);
- searchControl.setTimeoutInterval(google.search.SearchControl.TIMEOUT_LONG);
- searchControl.setNoResultsString(google.search.SearchControl.NO_RESULTS_DEFAULT_STRING);
-
- // upon ajax search, refresh the url and search title
- searchControl.setSearchStartingCallback(this, function(control, searcher, query) {
- $("#searchTitle").html("search results for <em>" + escapeHTML(query) + "</em>");
-
- // save the tab index from the hash
- tabIndex = location.hash.split("&t=")[1];
- $.history.add('q=' + query + '&t=' + tabIndex);
- });
-
- searchControl.setSearchCompleteCallback(this, function(control, searcher) {
- openTab();
- });
-
- // draw the search results box
- searchControl.draw(document.getElementById("leftSearchControl"), drawOptions);
-
- // get query and execute the search
- if (location.hash.indexOf("&t=") != -1) {
- searchControl.execute(decodeURI(getQuery(location.hash)));
- }
-
- document.getElementById("search_autocomplete").focus();
- addTabListeners();
- }
- // End of OnLoad
-
-
- google.setOnLoadCallback(OnLoad, true);
-
- // when an event on the browser history occurs (back, forward, load) perform a search
- $(window).history(function(e, hash) {
- var query = decodeURI(getQuery(hash));
- searchControl.execute(query);
-
- $("#searchTitle").html("search results for <em>" + escapeHTML(query) + "</em>");
- });
-
- // forcefully regain key-up event control (previously jacked by search api)
- $("#search_autocomplete").keyup(function(event) {
- return search_changed(event, false, '/');
- });
-
- // open a tab, specified by its array position
- function openTab() {
- tabIndex = location.hash.split("&t=")[1];
-
- // show the appropriate tab
- var tabHeaders = $(".gsc-tabHeader");
- $(tabHeaders[tabIndex]).click();
- }
-
- // add event listeners to each tab so we can track the browser history
- function addTabListeners() {
- var tabHeaders = $(".gsc-tabHeader");
- for (var i = 0; i < tabHeaders.length; i++) {
- $(tabHeaders[i]).attr("id",i).click(function() {
- var tabHeaders = $(".gsc-tabHeader");
- var tabIndex = $(this).attr("id");
- $.history.add('q=' + getQuery(location.hash) + '&t=' + tabIndex); // update the hash with the new tab
- });
- }
- }
-
- function getQuery(hash) {
- var hashParts = hash.split('&t=');
- var queryParts = hashParts[0].split('=');
- return queryParts[1];
- }
-
- /* returns the given string with all HTML brackets converted to entities
- TODO: move this to the site's JS library */
- function escapeHTML(string) {
- return string.replace(/</g,"<")
- .replace(/>/g,">");
- }
-
-</script>
-
- <div id="mainBodyFixed" style="width:auto; margin:20px">
- <h2 id="searchTitle">search results</h2>
- <img src="{@docRoot}assets/images/hr_gray_main.jpg" />
- <div><br /></div>
- <div id="leftSearchControl" class="search-control">Loading...</div>
- </div>
diff --git a/docs/html/shareables/training/CustomView.zip b/docs/html/shareables/training/CustomView.zip
new file mode 100644
index 0000000..f8c1c7a
--- /dev/null
+++ b/docs/html/shareables/training/CustomView.zip
Binary files differ
diff --git a/docs/html/shareables/training/FragmentBasics.zip b/docs/html/shareables/training/FragmentBasics.zip
index ff5b7f1..b5b19d0 100644
--- a/docs/html/shareables/training/FragmentBasics.zip
+++ b/docs/html/shareables/training/FragmentBasics.zip
Binary files differ
diff --git a/docs/html/shareables/training/NetworkUsage.zip b/docs/html/shareables/training/NetworkUsage.zip
new file mode 100644
index 0000000..8c7fbef
--- /dev/null
+++ b/docs/html/shareables/training/NetworkUsage.zip
Binary files differ
diff --git a/docs/html/shareables/training/OpenGLES.zip b/docs/html/shareables/training/OpenGLES.zip
new file mode 100644
index 0000000..862ae1f
--- /dev/null
+++ b/docs/html/shareables/training/OpenGLES.zip
Binary files differ
diff --git a/docs/html/sitemap-intl.txt b/docs/html/sitemap-intl.txt
index ded0554..9041581 100644
--- a/docs/html/sitemap-intl.txt
+++ b/docs/html/sitemap-intl.txt
@@ -1,11 +1,11 @@
http://developer.android.com/ja/sdk/1.5_r3/installing.html
http://developer.android.com/ja/community/index.html
http://developer.android.com/ja/index.html
-http://developer.android.com/ja/guide/publishing/versioning.html
-http://developer.android.com/ja/guide/publishing/app-signing.html
-http://developer.android.com/ja/guide/publishing/preparing.html
+http://developer.android.com/ja/tools/publishing/versioning.html
+http://developer.android.com/ja/tools/publishing/app-signing.html
+http://developer.android.com/ja/tools/publishing/preparing.html
http://developer.android.com/ja/guide/tutorials/hello-world.html
-http://developer.android.com/ja/guide/topics/fundamentals.html
+http://developer.android.com/ja/guide/components/fundamentals.html
http://developer.android.com/ja/guide/index.html
http://developer.android.com/ja/guide/basics/what-is-android.html
http://developer.android.com/ja/guide/developing/other-ide.html
diff --git a/docs/html/sitemap.txt b/docs/html/sitemap.txt
index 3f26dd0..ee85bd4 100644
--- a/docs/html/sitemap.txt
+++ b/docs/html/sitemap.txt
@@ -5,32 +5,32 @@
http://developer.android.com/reference/packages.html
http://developer.android.com/resources/index.html
http://developer.android.com/videos/index.html
-http://developer.android.com/resources/dashboard/platform-versions.html
+http://developer.android.com/about/dashboards/index.html
http://developer.android.com/license.html
-http://developer.android.com/sdk/installing.html
-http://developer.android.com/sdk/android-3.0-highlights.html
+http://developer.android.com/sdk/installing/index.html
+http://developer.android.com/about/versions/android-3.0-highlights.html
http://developer.android.com/sdk/preview/index.html
-http://developer.android.com/sdk/adding-components.html
-http://developer.android.com/sdk/android-2.3.html
-http://developer.android.com/sdk/android-2.3-highlights.html
+http://developer.android.com/sdk/exploring.html
+http://developer.android.com/about/versions/android-2.3.html
+http://developer.android.com/about/versions/android-2.3-highlights.html
http://developer.android.com/sdk/api_diff/9/changes.html
-http://developer.android.com/sdk/android-2.2.html
-http://developer.android.com/sdk/android-2.1.html
-http://developer.android.com/sdk/android-1.6.html
-http://developer.android.com/sdk/android-1.5.html
-http://developer.android.com/sdk/android-2.0.1.html
-http://developer.android.com/sdk/android-2.0.html
-http://developer.android.com/sdk/android-1.1.html
-http://developer.android.com/sdk/tools-notes.html
+http://developer.android.com/about/versions/android-2.2.html
+http://developer.android.com/about/versions/android-2.1.html
+http://developer.android.com/about/versions/android-1.6.html
+http://developer.android.com/about/versions/android-1.5.html
+http://developer.android.com/about/versions/android-2.0.1.html
+http://developer.android.com/about/versions/android-2.0.html
+http://developer.android.com/about/versions/android-1.1.html
+http://developer.android.com/tools/sdk/tools-notes.html
http://developer.android.com/sdk/win-usb.html
http://developer.android.com/sdk/eclipse-adt.html
http://developer.android.com/sdk/ndk/index.html
http://developer.android.com/sdk/ndk/overview.html
-http://developer.android.com/sdk/oem-usb.html
+http://developer.android.com/tools/extras/oem-usb.html
http://developer.android.com/sdk/requirements.html
http://developer.android.com/sdk/older_releases.html
http://developer.android.com/guide/basics/what-is-android.html
-http://developer.android.com/guide/topics/fundamentals.html
+http://developer.android.com/guide/components/fundamentals.html
http://developer.android.com/guide/topics/ui/index.html
http://developer.android.com/guide/topics/ui/declaring-layout.html
http://developer.android.com/guide/topics/ui/menus.html
@@ -58,7 +58,7 @@
http://developer.android.com/guide/topics/resources/string-resource.html
http://developer.android.com/guide/topics/resources/style-resource.html
http://developer.android.com/guide/topics/resources/more-resources.html
-http://developer.android.com/guide/topics/intents/intents-filters.html
+http://developer.android.com/guide/components/intents-filters.html
http://developer.android.com/guide/topics/data/data-storage.html
http://developer.android.com/guide/topics/data/backup.html
http://developer.android.com/guide/topics/providers/content-providers.html
@@ -93,62 +93,62 @@
http://developer.android.com/guide/topics/graphics/opengl.html
http://developer.android.com/guide/topics/media/index.html
http://developer.android.com/guide/topics/location/index.html
-http://developer.android.com/guide/topics/location/obtaining-user-location.html
+http://developer.android.com/guide/topics/location/strategies.html
http://developer.android.com/guide/topics/appwidgets/index.html
-http://developer.android.com/guide/topics/wireless/bluetooth.html
+http://developer.android.com/guide/topics/connectivity/bluetooth.html
http://developer.android.com/guide/topics/search/index.html
http://developer.android.com/guide/topics/search/search-dialog.html
http://developer.android.com/guide/topics/search/adding-recent-query-suggestions.html
http://developer.android.com/guide/topics/search/adding-custom-suggestions.html
http://developer.android.com/guide/topics/search/searchable-config.html
http://developer.android.com/guide/topics/admin/device-admin.html
-http://developer.android.com/guide/topics/testing/index.html
-http://developer.android.com/guide/topics/testing/testing_android.html
-http://developer.android.com/guide/topics/testing/activity_testing.html
-http://developer.android.com/guide/topics/testing/contentprovider_testing.html
-http://developer.android.com/guide/topics/testing/service_testing.html
-http://developer.android.com/guide/topics/testing/what_to_test.html
-http://developer.android.com/guide/market/licensing/index.html
-http://developer.android.com/guide/market/billing/index.html
-http://developer.android.com/guide/market/billing/billing_about.html
-http://developer.android.com/guide/market/billing/billing_overview.html
-http://developer.android.com/guide/market/billing/billing_integrate.html
-http://developer.android.com/guide/market/billing/billing_best_practices.html
-http://developer.android.com/guide/market/billing/billing_testing.html
-http://developer.android.com/guide/market/billing/billing_admin.html
-http://developer.android.com/guide/market/billing/billing_reference.html
-http://developer.android.com/guide/appendix/market-filters.html
+http://developer.android.com/tools/testing/index.html
+http://developer.android.com/tools/testing/testing_android.html
+http://developer.android.com/tools/testing/activity_testing.html
+http://developer.android.com/tools/testing/contentprovider_testing.html
+http://developer.android.com/tools/testing/service_testing.html
+http://developer.android.com/tools/testing/what_to_test.html
+http://developer.android.com/guide/google/play/licensing/index.html
+http://developer.android.com/guide/google/play/billing/index.html
+http://developer.android.com/guide/google/play/billing/billing_about.html
+http://developer.android.com/guide/google/play/billing/billing_overview.html
+http://developer.android.com/guide/google/play/billing/billing_integrate.html
+http://developer.android.com/guide/google/play/billing/billing_best_practices.html
+http://developer.android.com/guide/google/play/billing/billing_testing.html
+http://developer.android.com/guide/google/play/billing/billing_admin.html
+http://developer.android.com/guide/google/play/billing/billing_reference.html
+http://developer.android.com/guide/google/play/filters.html
http://developer.android.com/guide/developing/eclipse-adt.html
http://developer.android.com/guide/developing/other-ide.html
-http://developer.android.com/guide/developing/device.html
+http://developer.android.com/tools/device.html
http://developer.android.com/guide/developing/debug-tasks.html
-http://developer.android.com/guide/developing/testing/index.html
-http://developer.android.com/guide/developing/testing/testing_eclipse.html
-http://developer.android.com/guide/developing/testing/testing_otheride.html
-http://developer.android.com/guide/developing/tools/index.html
-http://developer.android.com/guide/developing/tools/aapt.html
-http://developer.android.com/guide/developing/tools/adb.html
-http://developer.android.com/guide/developing/tools/othertools.html
-http://developer.android.com/guide/developing/tools/aidl.html
-http://developer.android.com/guide/developing/tools/avd.html
-http://developer.android.com/guide/developing/tools/bmgr.html
-http://developer.android.com/guide/developing/tools/ddms.html
-http://developer.android.com/guide/developing/tools/draw9patch.html
-http://developer.android.com/guide/developing/tools/emulator.html
-http://developer.android.com/guide/developing/tools/hierarchy-viewer.html
-http://developer.android.com/guide/developing/tools/layoutopt.html
-http://developer.android.com/guide/developing/tools/monkey.html
-http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html
-http://developer.android.com/guide/developing/tools/MonkeyDevice.html
-http://developer.android.com/guide/developing/tools/MonkeyImage.html
-http://developer.android.com/guide/developing/tools/MonkeyRunner.html
-http://developer.android.com/guide/developing/tools/proguard.html
-http://developer.android.com/guide/developing/tools/traceview.html
-http://developer.android.com/guide/developing/tools/zipalign.html
-http://developer.android.com/guide/publishing/app-signing.html
-http://developer.android.com/guide/publishing/versioning.html
-http://developer.android.com/guide/publishing/preparing.html
-http://developer.android.com/guide/publishing/publishing.html
+http://developer.android.com/tools/testing/index.html
+http://developer.android.com/tools/testing/testing_eclipse.html
+http://developer.android.com/tools/testing/testing_otheride.html
+http://developer.android.com/tools/index.html
+http://developer.android.com/tools/aapt.html
+http://developer.android.com/tools/help/adb.html
+http://developer.android.com/tools/othertools.html
+http://developer.android.com/tools/aidl.html
+http://developer.android.com/tools/avd.html
+http://developer.android.com/tools/bmgr.html
+http://developer.android.com/tools/ddms.html
+http://developer.android.com/tools/draw9patch.html
+http://developer.android.com/tools/help/emulator.html
+http://developer.android.com/tools/hierarchy-viewer.html
+http://developer.android.com/tools/help/layoutopt.html
+http://developer.android.com/tools/monkey.html
+http://developer.android.com/tools/monkeyrunner_concepts.html
+http://developer.android.com/tools/MonkeyDevice.html
+http://developer.android.com/tools/MonkeyImage.html
+http://developer.android.com/tools/MonkeyRunner.html
+http://developer.android.com/tools/proguard.html
+http://developer.android.com/tools/traceview.html
+http://developer.android.com/tools/zipalign.html
+http://developer.android.com/tools/publishing/app-signing.html
+http://developer.android.com/tools/publishing/versioning.html
+http://developer.android.com/tools/publishing/preparing.html
+http://developer.android.com/tools/publishing/publishing.html
http://developer.android.com/guide/practices/compatibility.html
http://developer.android.com/guide/practices/screens_support.html
http://developer.android.com/guide/practices/ui_guidelines/index.html
@@ -160,15 +160,15 @@
http://developer.android.com/guide/practices/ui_guidelines/icon_design_dialog.html
http://developer.android.com/guide/practices/ui_guidelines/icon_design_list.html
http://developer.android.com/guide/practices/ui_guidelines/widget_design.html
-http://developer.android.com/guide/practices/design/performance.html
-http://developer.android.com/guide/practices/design/responsiveness.html
-http://developer.android.com/guide/practices/design/seamlessness.html
+http://developer.android.com/guide/practices/performance.html
+http://developer.android.com/guide/practices/responsiveness.html
+http://developer.android.com/guide/practices/seamlessness.html
http://developer.android.com/guide/webapps/index.html
http://developer.android.com/guide/webapps/targeting.html
http://developer.android.com/guide/webapps/webview.html
http://developer.android.com/guide/webapps/debugging.html
http://developer.android.com/guide/webapps/best-practices.html
-http://developer.android.com/guide/appendix/api-levels.html
+http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels
http://developer.android.com/guide/appendix/install-location.html
http://developer.android.com/guide/appendix/media-formats.html
http://developer.android.com/guide/appendix/g-app-intents.html
@@ -209,12 +209,12 @@
http://developer.android.com/resources/articles/wikinotes-intents.html
http://developer.android.com/resources/articles/window-bg-speed.html
http://developer.android.com/resources/articles/zipalign.html
-http://developer.android.com/resources/tutorials/hello-world.html
+http://developer.android.com/training/basics/firstapp/index.html
http://developer.android.com/resources/tutorials/views/index.html
http://developer.android.com/resources/tutorials/localization/index.html
http://developer.android.com/resources/tutorials/testing/helloandroid_test.html
http://developer.android.com/resources/tutorials/notepad/index.html
-http://developer.android.com/resources/tutorials/testing/activity_test.html
+http://developer.android.com/tools/testing/activity_test.html
http://developer.android.com/resources/samples/get.html
http://developer.android.com/resources/samples/index.html
http://developer.android.com/resources/samples/AccelerometerPlay/index.html
@@ -404,7 +404,7 @@
http://developer.android.com/reference/android/opengl/GLSurfaceView.html
http://developer.android.com/reference/android/graphics/Bitmap.html
http://developer.android.com/sdk/api_diff/3/changes.html
-http://developer.android.com/sdk/android-1.5-highlights.html
+http://developer.android.com/about/versions/android-1.5-highlights.html
http://developer.android.com/reference/android/widget/SlidingDrawer.html
http://developer.android.com/reference/android/widget/HorizontalScrollView.html
http://developer.android.com/reference/android/provider/LiveFolders.html
@@ -412,7 +412,7 @@
http://developer.android.com/reference/android/speech/RecognizerIntent.html
http://developer.android.com/reference/android/hardware/SensorManager.html
http://developer.android.com/sdk/api_diff/6/changes.html
-http://developer.android.com/sdk/android-2.0-highlights.html
+http://developer.android.com/about/versions/android-2.0-highlights.html
http://developer.android.com/reference/android/widget/QuickContactBadge.html
http://developer.android.com/reference/android/content/Intent.html
http://developer.android.com/reference/android/content/Context.html
@@ -503,7 +503,7 @@
http://developer.android.com/reference/java/text/Normalizer.html
http://developer.android.com/reference/java/text/Normalizer.Form.html
http://developer.android.com/sdk/api_diff/8/changes.html
-http://developer.android.com/sdk/android-2.2-highlights.html
+http://developer.android.com/about/versions/android-2.2-highlights.html
http://developer.android.com/reference/android/opengl/ETC1.html
http://developer.android.com/reference/android/opengl/ETC1Util.html
http://developer.android.com/reference/android/opengl/ETC1Util.ETC1Texture.html
@@ -540,7 +540,7 @@
http://developer.android.com/reference/android/widget/TextView.html
http://developer.android.com/reference/android/Manifest.permission.html
http://developer.android.com/sdk/api_diff/4/changes.html
-http://developer.android.com/sdk/android-1.6-highlights.html
+http://developer.android.com/about/versions/android-1.6-highlights.html
http://developer.android.com/reference/android/view/View.OnClickListener.html
http://developer.android.com/reference/android/app/SearchManager.html
http://developer.android.com/reference/android/telephony/SmsManager.html
@@ -942,7 +942,7 @@
http://developer.android.com/reference/org/apache/http/impl/client/DefaultHttpClient.html
http://developer.android.com/reference/org/apache/http/HttpRequestInterceptor.html
http://developer.android.com/reference/android/content/pm/PackageItemInfo.html
-http://developer.android.com/guide/developing/tools/adt.html
+http://developer.android.com/tools/adt.html
http://developer.android.com/reference/android/graphics/NinePatch.html
http://developer.android.com/reference/android/preference/Preference.OnPreferenceChangeListener.html
http://developer.android.com/reference/android/preference/Preference.OnPreferenceClickListener.html
@@ -5020,7 +5020,7 @@
http://developer.android.com/resources/samples/MultiResolution/res/drawable-ldpi-v6/ic_launcher.html
http://developer.android.com/reference/android/app/package-descr.html
http://developer.android.com/resources/samples/TicTacToeLib/res/layout/lib_game.html
-http://developer.android.com/guide/market/billing/billing-intents
+http://developer.android.com/guide/google/play/billing/billing-intents
http://developer.android.com/resources/samples/TicTacToeLib/res/values/strings.html
http://developer.android.com/resources/samples/ApiDemos/res/values-normal-notlong/strings.html
http://developer.android.com/resources/samples/TicTacToeMain/src/com/example/android/index.html
diff --git a/docs/html/support.jd b/docs/html/support.jd
new file mode 100644
index 0000000..89acd5d
--- /dev/null
+++ b/docs/html/support.jd
@@ -0,0 +1,74 @@
+page.title=Developer Support
+fullpage=1
+@jd:body
+
+<div class="wrap" style="width:940px;">
+
+ <h1>Developer Support Resources</h1>
+<!--
+<p>A variety of support resources are available to help you report and resolve issues while you are developing apps for Android. </p>
+-->
+ <div style="margin: 20px 0 0;">
+
+ <div class="col-8" style="margin-left:0">
+ <h3 style="font-size: 14px;line-height: 21px;color: #555;text-transform: uppercase;border-bottom: 1px solid #CCC;margin: 0 0 20px;">Code-Level Support</h3>
+
+<h5>Community and Office Hours</h5>
+<p style="color:#888">
+
+<a href="http://groups.google.com/group/android-developers">android-developers</a> support forum<br />
+<a href="http://groups.google.com/group/android-ndk">android-ndk</a> support forum<br />
+<a href="http://groups.google.com/group/android-security-discuss">android-security-discuss</a> support forum<br />
+
+ <a href="http://webchat.freenode.net/?channels=android">#android</a>, <a href="http://webchat.freenode.net/?channels=android-dev">#android-dev</a> <span style="color:#888">(IRC via irc.freenode.net)</span><br />
+ <a href="https://plus.google.com/108967384991768947849/posts">+Android Developers Office Hours</a> <span style="color:#888">(Wednesdays 2 PM PST (UTC-7))</span><br />
+</p>
+
+
+<h5>Send Feedback</h5>
+<p>
+ <a href="http://code.google.com/p/android/issues/entry?template=Developer%20Documentation">Report documentation bug</a><br />
+ <a href="https://code.google.com/p/android/issues/entry?template=User%20bug%20report">Report device bug</a><br />
+ <a href="https://code.google.com/p/android/issues/entry?template=Developer%20bug%20report">Report platform bug</a><br />
+
+ </div>
+
+
+
+ <div class="col-8" style="margin-right:0">
+ <h3 style="font-size: 14px;line-height: 21px;color: #555;text-transform:
+uppercase;border-bottom: 1px solid #CCC;margin: 0 0 20px;">Google Play Support</h3>
+<h5>Help center</h5>
+<p style="color:#888">
+ <a href="http://support.google.com/googleplay/android-developer/">Help Center Home</a><br />
+ <a href="http://support.google.com/googleplay/android-developer/bin/static.py?hl=en&page=known_issues.cs">Known Issues</a><br />
+</p>
+
+<h5 id="contact">Direct support contacts for developers</h5>
+<p style="color:#888">
+ <a href="http://support.google.com/googleplay/android-developer/bin/request.py?contact_type=dev_registration">Registration, account issues</a><br />
+ <a href="http://support.google.com/googleplay/android-developer/bin/request.py?contact_type=publishing">Publishing, app distribution issues</a><br />
+ <a href="http://support.google.com/googleplay/android-developer/bin/request.py?contact_type=bugs">Developer Console issues</a><br />
+ <a href="http://support.google.com/googleplay/android-developer/bin/request.py?contact_type=takedown">Inappropriate apps</a><br />
+ <a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1085703&topic=15868&ctx=topic">Report a Google Play policy violation</a>
+</p>
+
+<h5>End-user support</h5>
+<p style="color:#888">
+ <a href="http://support.google.com/googleplay/bin/request.py?contact_type=contact_policy&policy=apps">Click-to-call and email support for Google Play end users</a><br />
+</p>
+
+
+
+ <h5>Payment and Merchant Issues</h5>
+
+<p style="color:#888;margin-bottom:1.5em;">
+ <a href="http://support.google.com/checkout/sell/">Merchant Help Center Home<br />
+ <a href="http://support.google.com/checkout/sell/bin/static.py?hl=en&page=ts.cs&ts=2472700">Issue reporting tool<br />
+ <a href="https://productforums.google.com/forum/#!forum/checkout-merchant">checkout-merchant</a> support forum<br />
+ <a href="http://support.google.com/googleplay/android-developer/bin/request.py?contact_type=survey">Feedback survey</a>
+</p>
+
+
+</div>
+</div>
\ No newline at end of file
diff --git a/docs/html/tools/aidl.jd b/docs/html/tools/aidl.jd
new file mode 100644
index 0000000..805b7ec
--- /dev/null
+++ b/docs/html/tools/aidl.jd
@@ -0,0 +1,465 @@
+page.title=Android Interface Definition Language (AIDL)
+@jd:body
+
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+<ol>
+ <li><a href="#Defining">Defining an AIDL Interface</a>
+ <ol>
+ <li><a href="#Create">Create the .aidl file</a></li>
+ <li><a href="#Implement">Implement the interface</a></li>
+ <li><a href="#Expose">Expose the interface to clients</a></li>
+ </ol>
+ </li>
+ <li><a href="#PassingObjects">Passing Objects over IPC</a></li>
+ <li><a href="#Calling">Calling an IPC Method</a></li>
+</ol>
+
+<h2>See also</h2>
+<ol>
+ <li><a href="{@docRoot}guide/components/bound-services.html">Bound Services</a></li>
+</ol>
+
+</div>
+</div>
+
+
+<p>AIDL (Android Interface Definition Language) is similar to other IDLs you might have
+worked with. It allows you to define the programming interface that both
+the client and service agree upon in order to communicate with each other using
+interprocess communication (IPC). On Android, one process cannot normally access the
+memory of another process. So to talk, they need to decompose their objects into primitives that the
+operating system can understand, and marshall the objects across that boundary for you. The code to
+do that marshalling is tedious to write, so Android handles it for you with AIDL.</p>
+
+<p class="note"><strong>Note:</strong> Using AIDL is necessary only if you allow clients from
+different applications to access your service for IPC and want to handle multithreading in your
+service. If you do not need to perform concurrent IPC across
+different applications, you should create your interface by <a
+href="{@docRoot}guide/components/bound-services.html#Binder">implementing a
+Binder</a> or, if you want to perform IPC, but do <em>not</em> need to handle multithreading,
+implement your interface <a
+href="{@docRoot}guide/components/bound-services.html#Messenger">using a Messenger</a>.
+Regardless, be sure that you understand <a
+href="{@docRoot}guide/components/bound-services.html">Bound Services</a> before
+implementing an AIDL.</p>
+
+<p>Before you begin designing your AIDL interface, be aware that calls to an AIDL interface are
+direct function calls. You should not make assumptions about the thread in which the call
+occurs. What happens is different depending on whether the call is from a thread in the
+local process or a remote process. Specifically:</p>
+
+<ul>
+<li>Calls made from the local process are executed in the same thread that is making the call. If
+this is your main UI thread, that thread continues to execute in the AIDL interface. If it is
+another thread, that is the one that executes your code in the service. Thus, if only local
+threads are accessing the service, you can completely control which threads are executing in it (but
+if that is the case, then you shouldn't be using AIDL at all, but should instead create the
+interface by <a href="{@docRoot}guide/components/bound-services.html#Binder">implementing a
+Binder</a>).</li>
+
+<li>Calls from a remote process are dispatched from a thread pool the platform maintains inside of
+your own process. You must be prepared for incoming calls from unknown threads, with multiple calls
+happening at the same time. In other words, an implementation of an AIDL interface must be
+completely thread-safe.</li>
+
+<li>The {@code oneway} keyword modifies the behavior of remote calls. When used, a remote call does
+not block; it simply sends the transaction data and immediately returns.
+The implementation of the interface eventually receives this as a regular call from the {@link
+android.os.Binder} thread pool as a normal remote call. If {@code oneway} is used with a local call,
+there is no impact and the call is still synchronous.</li>
+</ul>
+
+
+<h2 id="Defining">Defining an AIDL Interface</h2>
+
+<p>You must define your AIDL interface in an {@code .aidl} file using the Java
+programming language syntax, then save it in the source code (in the {@code src/} directory) of both
+the application hosting the service and any other application that binds to the service.</p>
+
+<p>When you build each application that contains the {@code .aidl} file, the Android SDK tools
+generate an {@link android.os.IBinder} interface based on the {@code .aidl} file and save it in
+the project's {@code gen/} directory. The service must implement the {@link android.os.IBinder}
+interface as appropriate. The client applications can then bind to the service and call methods from
+the {@link android.os.IBinder} to perform IPC.</p>
+
+<p>To create a bounded service using AIDL, follow these steps:</p>
+<ol>
+ <li><a href="#CreateAidl">Create the .aidl file</a>
+ <p>This file defines the programming interface with method signatures.</p>
+ </li>
+ <li><a href="#ImplementTheInterface">Implement the interface</a>
+ <p>The Android SDK tools generate an interface in the Java programming language, based on your
+{@code .aidl} file. This interface has an inner abstract class named {@code Stub} that extends
+{@link android.os.Binder} and implements methods from your AIDL interface. You must extend the
+{@code Stub} class and implement the methods.</p>
+ </li>
+ <li><a href="#ExposeTheInterface">Expose the interface to clients</a>
+ <p>Implement a {@link android.app.Service Service} and override {@link
+android.app.Service#onBind onBind()} to return your implementation of the {@code Stub}
+class.</p>
+ </li>
+</ol>
+
+<p class="caution"><strong>Caution:</strong> Any changes that you make to your AIDL interface after
+your first release must remain backward compatible in order to avoid breaking other applications
+that use your service. That is, because your {@code .aidl} file must be copied to other applications
+in order for them to access your service's interface, you must maintain support for the original
+interface.</p>
+
+
+<h3 id="Create">1. Create the .aidl file</h3>
+
+<p>AIDL uses a simple syntax that lets you declare an interface with one or more methods that can
+take parameters and return values. The parameters and return values can be of any type, even other
+AIDL-generated interfaces.</p>
+
+<p>You must construct the {@code .aidl} file using the Java programming language. Each {@code .aidl}
+file must define a single interface and requires only the interface declaration and method
+signatures.</p>
+
+<p>By default, AIDL supports the following data types:</p>
+
+<ul>
+ <li>All primitive types in the Java programming language (such as {@code int}, {@code long},
+{@code char}, {@code boolean}, and so on)</li>
+ <li>{@link java.lang.String}</li>
+ <li>{@link java.lang.CharSequence}</li>
+ <li>{@link java.util.List}
+ <p>All elements in the {@link java.util.List} must be one of the supported data types in this
+list or one of the other AIDL-generated interfaces or parcelables you've declared. A {@link
+java.util.List} may optionally be used as a "generic" class (for example,
+<code>List<String></code>).
+The actual concrete class that the other side receives is always an {@link
+java.util.ArrayList}, although the method is generated to use the {@link
+java.util.List} interface.</p>
+ </li>
+ <li>{@link java.util.Map}
+ <p>All elements in the {@link java.util.Map} must be one of the supported data types in this
+list or one of the other AIDL-generated interfaces or parcelables you've declared. Generic maps,
+(such as those of the form
+{@code Map<String,Integer>} are not supported. The actual concrete class that the other side
+receives is always a {@link java.util.HashMap}, although the method is generated to
+use the {@link java.util.Map} interface.</p>
+ </li>
+</ul>
+
+<p>You must include an {@code import} statement for each additional type not listed above, even if
+they are defined in the same package as your interface.</p>
+
+<p>When defining your service interface, be aware that:</p>
+<ul>
+ <li>Methods can take zero or more parameters, and return a value or void.</li>
+ <li>All non-primitive parameters require a directional tag indicating which way the data goes.
+Either <code>in</code>, <code>out</code>, or <code>inout</code> (see the example below).
+ <p>Primitives are <code>in</code> by default, and cannot be otherwise.</p>
+ <p class="caution"><strong>Caution:</strong> You should limit the direction to what is truly
+needed, because marshalling parameters is expensive.</p></li>
+ <li>All code comments included in the {@code .aidl} file are included in the generated {@link
+android.os.IBinder} interface (except for comments before the import and package
+statements).</li>
+ <li>Only methods are supported; you cannot expose static fields in AIDL.</li>
+</ul>
+
+<p>Here is an example {@code .aidl} file:</p>
+
+<pre>
+// IRemoteService.aidl
+package com.example.android;
+
+// Declare any non-default types here with import statements
+
+/** Example service interface */
+interface IRemoteService {
+ /** Request the process ID of this service, to do evil things with it. */
+ int getPid();
+
+ /** Demonstrates some basic types that you can use as parameters
+ * and return values in AIDL.
+ */
+ void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
+ double aDouble, String aString);
+}
+</pre>
+
+<p>Simply save your {@code .aidl} file in your project's {@code src/} directory and when you
+build your application, the SDK tools generate the {@link android.os.IBinder} interface file in your
+project's {@code gen/} directory. The generated file name matches the {@code .aidl} file name, but
+with a {@code .java} extension (for example, {@code IRemoteService.aidl} results in {@code
+IRemoteService.java}).</p>
+
+<p>If you use Eclipse, the incremental build generates the binder class almost immediately. If you
+do not use Eclipse, then the Ant tool generates the binder class next time you build your
+application—you should build your project with <code>ant debug</code> (or <code>ant
+release</code>) as soon as you're finished writing the {@code .aidl} file, so that your code can
+link against the generated class.</p>
+
+
+<h3 id="Implement">2. Implement the interface</h3>
+
+<p>When you build your application, the Android SDK tools generate a {@code .java} interface file
+named after your {@code .aidl} file. The generated interface includes a subclass named {@code Stub}
+that is an abstract implementation of its parent interface (for example, {@code
+YourInterface.Stub}) and declares all the methods from the {@code .aidl} file.</p>
+
+<p class="note"><strong>Note:</strong> {@code Stub} also
+defines a few helper methods, most notably {@code asInterface()}, which takes an {@link
+android.os.IBinder} (usually the one passed to a client's {@link
+android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback method) and
+returns an instance of the stub interface. See the section <a href="#calling">Calling an IPC
+Method</a> for more details on how to make this cast.</p>
+
+<p>To implement the interface generated from the {@code .aidl}, extend the generated {@link
+android.os.Binder} interface (for example, {@code YourInterface.Stub}) and implement the methods
+inherited from the {@code .aidl} file.</p>
+
+<p>Here is an example implementation of an interface called {@code IRemoteService} (defined by the
+{@code IRemoteService.aidl} example, above) using an anonymous instance:</p>
+
+<pre>
+private final IRemoteService.Stub mBinder = new IRemoteService.Stub() {
+ public int getPid(){
+ return Process.myPid();
+ }
+ public void basicTypes(int anInt, long aLong, boolean aBoolean,
+ float aFloat, double aDouble, String aString) {
+ // Does nothing
+ }
+};
+</pre>
+
+<p>Now the {@code mBinder} is an instance of the {@code Stub} class (a {@link android.os.Binder}),
+which defines the RPC interface for the service. In the next step, this instance is exposed to
+clients so they can interact with the service.</p>
+
+<p>There are a few rules you should be aware of when implementing your AIDL interface: </p>
+<ul>
+ <li>Incoming calls are not guaranteed to be executed on the main thread, so you need to think
+about multithreading from the start and properly build your service to be thread-safe.</li>
+ <li>By default, RPC calls are synchronous. If you know that the service takes more than a few
+milliseconds to complete a request, you should not call it from the activity's main thread, because
+it might hang the application (Android might display an "Application is Not Responding"
+dialog)—you should usually call them from a separate thread in the client. </li>
+ <li>No exceptions that you throw are sent back to the caller.</li>
+</ul>
+
+
+<h3 id="Expose">3. Expose the interface to clients</h3>
+
+<p>Once you've implemented the interface for your service, you need to expose it to
+clients so they can bind to it. To expose the interface
+for your service, extend {@link android.app.Service Service} and implement {@link
+android.app.Service#onBind onBind()} to return an instance of your class that implements
+the generated {@code Stub} (as discussed in the previous section). Here's an example
+service that exposes the {@code IRemoteService} example interface to clients. </p>
+
+<pre>
+public class RemoteService extends Service {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ }
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ // Return the interface
+ return mBinder;
+ }
+
+ private final IRemoteService.Stub mBinder = new IRemoteService.Stub() {
+ public int getPid(){
+ return Process.myPid();
+ }
+ public void basicTypes(int anInt, long aLong, boolean aBoolean,
+ float aFloat, double aDouble, String aString) {
+ // Does nothing
+ }
+ };
+}
+</pre>
+
+<p>Now, when a client (such as an activity) calls {@link android.content.Context#bindService
+bindService()} to connect to this service, the client's {@link
+android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback receives the
+{@code mBinder} instance returned by the service's {@link android.app.Service#onBind onBind()}
+method.</p>
+
+<p>The client must also have access to the interface class, so if the client and service are in
+separate applications, then the client's application must have a copy of the {@code .aidl} file
+in its {@code src/} directory (which generates the {@code android.os.Binder}
+interface—providing the client access to the AIDL methods).</p>
+
+<p>When the client receives the {@link android.os.IBinder} in the {@link
+android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback, it must call
+<code><em>YourServiceInterface</em>.Stub.asInterface(service)</code> to cast the returned
+parameter to <code><em>YourServiceInterface</em></code> type. For example:</p>
+
+<pre>
+IRemoteService mIRemoteService;
+private ServiceConnection mConnection = new ServiceConnection() {
+ // Called when the connection with the service is established
+ public void onServiceConnected(ComponentName className, IBinder service) {
+ // Following the example above for an AIDL interface,
+ // this gets an instance of the IRemoteInterface, which we can use to call on the service
+ mIRemoteService = IRemoteService.Stub.asInterface(service);
+ }
+
+ // Called when the connection with the service disconnects unexpectedly
+ public void onServiceDisconnected(ComponentName className) {
+ Log.e(TAG, "Service has unexpectedly disconnected");
+ mIRemoteService = null;
+ }
+};
+</pre>
+
+<p>For more sample code, see the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.html">{@code
+RemoteService.java}</a> class in <a
+href="{@docRoot}resources/samples/ApiDemos/index.html">ApiDemos</a>.</p>
+
+
+
+
+
+
+
+
+<h2 id="PassingObjects">Passing Objects over IPC</h2>
+
+<p>If you have a class that you would like to send from one process to another through
+an IPC interface, you can do that. However, you must ensure that the code for your class is
+available to the other side of the IPC channel and your class must support the {@link
+android.os.Parcelable} interface. Supporting the {@link android.os.Parcelable} interface is
+important because it allows the Android system to decompose objects into primitives that can be
+marshalled across processes.</p>
+
+<p>To create a class that supports the {@link android.os.Parcelable} protocol, you must do the
+following:</b>
+<ol>
+<li>Make your class implement the {@link android.os.Parcelable} interface.</li>
+<li>Implement {@link android.os.Parcelable#writeToParcel writeToParcel}, which takes the
+current state of the object and writes it to a {@link android.os.Parcel}.</li>
+<li>Add a static field called <code>CREATOR</code> to your class which is an object implementing
+the {@link android.os.Parcelable.Creator Parcelable.Creator} interface.</li>
+<li>Finally, create an {@code .aidl} file that declares your parcelable class (as shown for the
+{@code Rect.aidl} file, below).
+ <p>If you are using a custom build process, do <em>not</em> add the {@code .aidl} file to your
+build. Similar to a header file in the C language, this {@code .aidl} file isn't compiled.</p></li>
+</ol>
+
+<p>AIDL uses these methods and fields in the code it generates to marshall and unmarshall
+your objects.</p>
+
+<p>For example, here is a {@code Rect.aidl} file to create a {@code Rect} class that's
+parcelable:</p>
+
+<pre>
+package android.graphics;
+
+// Declare Rect so AIDL can find it and knows that it implements
+// the parcelable protocol.
+parcelable Rect;
+</pre>
+
+<p>And here is an example of how the {@link android.graphics.Rect} class implements the
+{@link android.os.Parcelable} protocol.</p>
+
+<pre>
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public final class Rect implements Parcelable {
+ public int left;
+ public int top;
+ public int right;
+ public int bottom;
+
+ public static final Parcelable.Creator<Rect> CREATOR = new
+Parcelable.Creator<Rect>() {
+ public Rect createFromParcel(Parcel in) {
+ return new Rect(in);
+ }
+
+ public Rect[] newArray(int size) {
+ return new Rect[size];
+ }
+ };
+
+ public Rect() {
+ }
+
+ private Rect(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public void writeToParcel(Parcel out) {
+ out.writeInt(left);
+ out.writeInt(top);
+ out.writeInt(right);
+ out.writeInt(bottom);
+ }
+
+ public void readFromParcel(Parcel in) {
+ left = in.readInt();
+ top = in.readInt();
+ right = in.readInt();
+ bottom = in.readInt();
+ }
+}
+</pre>
+
+<p>The marshalling in the {@code Rect} class is pretty simple. Take a look at the other
+methods on {@link android.os.Parcel} to see the other kinds of values you can write
+to a Parcel.</p>
+
+<p class="warning"><strong>Warning:</strong> Don't forget the security implications of receiving
+data from other processes. In this case, the {@code Rect} reads four numbers from the {@link
+android.os.Parcel}, but it is up to you to ensure that these are within the acceptable range of
+values for whatever the caller is trying to do. See <a
+href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a> for more
+information about how to keep your application secure from malware.</p>
+
+
+
+<h2 id="Calling">Calling an IPC Method</h2>
+
+<p>Here are the steps a calling class must take to call a remote interface defined with AIDL: </p>
+<ol>
+ <li>Include the {@code .aidl} file in the project {@code src/} directory.</li>
+ <li>Declare an instance of the {@link android.os.IBinder} interface (generated based on the
+AIDL). </li>
+ <li>Implement {@link android.content.ServiceConnection ServiceConnection}. </li>
+ <li>Call {@link
+android.content.Context#bindService(android.content.Intent,android.content.ServiceConnection,int)
+ Context.bindService()}, passing in your {@link
+android.content.ServiceConnection} implementation. </li>
+ <li>In your implementation of {@link
+android.content.ServiceConnection#onServiceConnected onServiceConnected()},
+you will receive an {@link android.os.IBinder} instance (called <code>service</code>). Call
+<code><em>YourInterfaceName</em>.Stub.asInterface((IBinder)<em>service</em>)</code> to
+ cast the returned parameter to <em>YourInterface</em> type.</li>
+ <li>Call the methods that you defined on your interface. You should always trap
+ {@link android.os.DeadObjectException} exceptions, which are thrown when
+ the connection has broken; this will be the only exception thrown by remote
+ methods.</li>
+ <li>To disconnect, call {@link
+android.content.Context#unbindService(android.content.ServiceConnection)
+ Context.unbindService()} with the instance of your interface. </li>
+</ol>
+<p>A few comments on calling an IPC service:</p>
+<ul>
+ <li>Objects are reference counted across processes. </li>
+ <li>You can send anonymous objects
+ as method arguments. </li>
+</ul>
+
+<p>For more information about binding to a service, read the <a
+href="{@docRoot}guide/components/bound-services.html#Binding">Bound Services</a>
+document.</p>
+
+<p>Here is some sample code demonstrating calling an AIDL-created service, taken
+ from the Remote Service sample in the ApiDemos project.</p>
+<p>{@sample development/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.java
+ calling_a_service}</p>
diff --git a/docs/html/tools/avd.html b/docs/html/tools/avd.html
new file mode 100644
index 0000000..1d314a1
--- /dev/null
+++ b/docs/html/tools/avd.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/tools/devices/index.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/tools/devices/index.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/tools/building/building-cmdline.jd b/docs/html/tools/building/building-cmdline.jd
new file mode 100644
index 0000000..6154d96
--- /dev/null
+++ b/docs/html/tools/building/building-cmdline.jd
@@ -0,0 +1,371 @@
+page.title=Building and Running from the Command Line
+parent.title=Building and Running
+parent.link=index.html
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#DebugMode">Building in Debug Mode</a></li>
+ <li><a href="#ReleaseMode">Building in Release Mode</a>
+ <ol>
+ <li><a href="#ManualReleaseMode">Build unsigned</a></li>
+ <li><a href="#AutoReleaseMode">Build signed and aligned</a></li>
+ <li><a href="#OnceBuilt">Once built and signed in release mode</a></li>
+ </ol>
+ </li>
+ <li><a href="#RunningOnEmulator">Running on the Emulator</a></li>
+ <li><a href="#RunningOnDevice">Running on a Device</a></li>
+ <li><a href="#Signing">Application Signing</a></li>
+ <li><a href="#AntReference">Ant Command Reference</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}tools/devices/managing-avds-cmdline.html">Managing AVDs from
+the Command Line</a></li>
+ <li><a href="{@docRoot}tools/devices/emulator.html">Using the Android
+Emulator</a></li>
+ <li><a href="{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>There are two ways to build your application using the Ant build script: one for
+ testing/debugging your application — <em>debug mode</em> — and one for building your
+ final package for release — <em>release mode</em>. Regardless of which way you build your application,
+ it must be signed before it can install on an emulator or device—with a debug key when building
+ in debug mode and with your own private key when building in release mode.</p>
+
+ <p>Whether you're building in debug mode or release mode, you need to use the Ant tool to compile
+ and build your project. This will create the .apk file that you can install on an emulator or device.
+ When you build in debug mode, the .apk file is automatically signed by the SDK tools with
+ a debug key, so it's instantly ready for installation onto an emulator or attached
+ development device. You cannot distribute an application that is signed with a debug key.
+ When you build in release mode, the .apk file is <em>unsigned</em>, so you
+ must manually sign it with your own private key, using Keytool and Jarsigner.</p>
+
+ <p>It's important that you read and understand <a href=
+ "{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a>, particularly once
+ you're ready to release your application and share it with end-users. That document describes the
+ procedure for generating a private key and then using it to sign your .apk file. If you're just
+ getting started, however, you can quickly run your applications on an emulator or your own
+ development device by building in debug mode.</p>
+
+ <p>If you don't have Ant, you can obtain it from the <a href="http://ant.apache.org/">Apache Ant
+ home page</a>. Install it and make sure it is in your executable PATH. Before calling Ant, you
+ need to declare the JAVA_HOME environment variable to specify the path to where the JDK is
+ installed.</p>
+
+ <p class="note"><strong>Note:</strong> When installing JDK on Windows, the default is to install
+ in the "Program Files" directory. This location will cause <code>ant</code> to fail, because of
+ the space. To fix the problem, you can specify the JAVA_HOME variable like this:
+ <pre>set JAVA_HOME=c:\Progra~1\Java\<jdkdir></pre>
+
+ <p>The easiest solution, however, is to install JDK in a non-space directory, for example:</p>
+
+ <pre>c:\java\jdk1.6.0_02</pre>
+
+ <h2 id="DebugMode">Building in Debug Mode</h2>
+
+ <p>For immediate application testing and debugging, you can build your application in debug mode
+ and immediately install it on an emulator. In debug mode, the build tools automatically sign your
+ application with a debug key and optimize the package with {@code zipalign}.</p>
+
+ <p>To build in debug mode:</p>
+
+ <ol>
+ <li>Open a command-line and navigate to the root of your project directory.</li>
+ <li>Use Ant to compile your project in debug mode:
+ <pre>
+ant debug
+</pre>
+
+ <p>This creates your debug <code>.apk</code> file inside the project <code>bin/</code> directory, named
+ <code><your_project_name>-debug.apk</code>. The file is already signed with
+ the debug key and has been aligned with
+ <a href="{@docRoot}tools/help/zipalign.html"><code>zipalign</code></a>.
+ </p>
+ </li>
+ </ol>
+
+ <p>Each time you change a source file or resource, you must run Ant again in order to package up
+ the latest version of the application.</p>
+
+ <p>To install and run your application on an emulator, see the following section about <a href=
+ "#RunningOnEmulator">Running on the Emulator</a>.</p>
+
+ <h2 id="ReleaseMode">Building in Release Mode</h2>
+
+ <p>When you're ready to release and distribute your application to end-users, you must build your
+ application in release mode. Once you have built in release mode, it's a good idea to perform
+ additional testing and debugging with the final .apk.</p>
+
+ <p>Before you start building your application in release mode, be aware that you must sign the
+ resulting application package with your private key, and should then align it using the {@code
+ zipalign} tool. There are two approaches to building in release mode: build an unsigned package
+ in release mode and then manually sign and align the package, or allow the build script to sign
+ and align the package for you.</p>
+
+ <h3 id="ManualReleaseMode">Build unsigned</h3>
+
+ <p>If you build your application <em>unsigned</em>, then you will need to manually sign and align
+ the package.</p>
+
+ <p>To build an <em>unsigned</em> .apk in release mode:</p>
+
+ <ol>
+ <li>Open a command-line and navigate to the root of your project directory.</li>
+
+ <li>Use Ant to compile your project in release mode:
+ <pre>
+ant release
+</pre>
+ </li>
+ </ol>
+
+ <p>This creates your Android application .apk file inside the project <code>bin/</code>
+ directory, named <code><em><your_project_name></em>-unsigned.apk</code>.</p>
+
+ <p class="note"><strong>Note:</strong> The .apk file is <em>unsigned</em> at this point and can't
+ be installed until signed with your private key.</p>
+
+ <p>Once you have created the unsigned .apk, your next step is to sign the .apk with your private
+ key and then align it with {@code zipalign}. To complete this procedure, read <a href=
+ "{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a>.</p>
+
+ <p>When your <code>.apk</code> has been signed and aligned, it's ready to be distributed to end-users.
+ You should test the final build on different devices or AVDs to ensure that it
+ runs properly on different platforms.</p>
+
+ <h3 id="AutoReleaseMode">Build signed and aligned</h3>
+
+ <p>If you would like, you can configure the Android build script to automatically sign and align
+ your application package. To do so, you must provide the path to your keystore and the name of
+ your key alias in your project's {@code ant.properties} file. With this information provided,
+ the build script will prompt you for your keystore and alias password when you build in release
+ mode and produce your final application package, which will be ready for distribution.</p>
+
+ <p class="caution"><strong>Caution:</strong> Due to the way Ant handles input, the password that
+ you enter during the build process <strong>will be visible</strong>. If you are concerned about
+ your keystore and alias password being visible on screen, then you may prefer to perform the
+ application signing manually, via Jarsigner (or a similar tool). To instead perform the signing
+ procedure manually, <a href="#ManualReleaseMode">build unsigned</a> and then continue with
+ <a href="{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a>.</p>
+
+ <p>To specify your keystore and alias, open the project {@code ant.properties} file (found in
+ the root of the project directory) and add entries for {@code key.store} and {@code key.alias}.
+ For example:</p>
+ <pre>
+key.store=path/to/my.keystore
+key.alias=mykeystore
+</pre>
+
+ <p>Save your changes. Now you can build a <em>signed</em> .apk in release mode:</p>
+
+ <ol>
+ <li>Open a command-line and navigate to the root of your project directory.</li>
+
+ <li>Use Ant to compile your project in release mode:
+ <pre>
+ant release
+</pre>
+ </li>
+
+ <li>When prompted, enter you keystore and alias passwords.
+
+ <p class="caution"><strong>Caution:</strong> As described above, your password will be
+ visible on the screen.</p>
+ </li>
+ </ol>
+
+ <p>This creates your Android application .apk file inside the project <code>bin/</code>
+ directory, named <code><em><your_project_name></em>-release.apk</code>. This .apk file has
+ been signed with the private key specified in {@code ant.properties} and aligned with {@code
+ zipalign}. It's ready for installation and distribution.</p>
+
+ <h3 id="OnceBuilt">Once built and signed in release mode</h3>
+
+ <p>Once you have signed your application with a private key, you can install and run it on an
+ <a href="#RunningOnEmulator">emulator</a> or <a href="#RunningOnDevice">device</a>. You can
+ also try installing it onto a device from a web server. Simply upload the signed .apk to a web
+ site, then load the .apk URL in your Android web browser to download the application and begin
+ installation. (On your device, be sure you have enabled
+ <em>Settings > Applications > Unknown sources</em>.)</p>
+
+ <h2 id="RunningOnEmulator">Running on the Emulator</h2>
+
+ <p>Before you can run your application on the Android Emulator, you must <a href=
+ "{@docRoot}tools/devices/managing-avds.html">create an AVD</a>.</p>
+
+ <p>To run your application:</p>
+
+ <ol>
+ <li>
+ <strong>Open the AVD Manager and launch a virtual device</strong>
+
+ <p>From your SDK's <code>platform-tools/</code> directory, execute the {@code android} tool
+with the <code>avd</code> options:</p>
+ <pre>
+android avd
+</pre>
+
+ <p>In the <em>Virtual Devices</em> view, select an AVD and click <strong>Start</strong>.</p>
+ </li>
+
+ <li>
+ <strong>Install your application</strong>
+
+ <p>From your SDK's <code>tools/</code> directory, install the {@code .apk} on the
+ emulator:</p>
+ <pre>
+adb install <em><path_to_your_bin></em>.apk
+</pre>
+
+ <p>Your .apk file (signed with either a release or debug key) is in your project {@code bin/}
+ directory after you build your application.</p>
+
+ <p>If there is more than one emulator running, you must specify the emulator upon which to
+ install the application, by its serial number, with the <code>-s</code> option. For
+ example:</p>
+ <pre>
+adb -s emulator-5554 install <em>path/to/your/app</em>.apk
+</pre>
+
+ <p>To see a list of available device serial numbers, execute {@code adb devices}.</p>
+ </li>
+ </ol>
+
+ <p>If you don't see your application on the emulator, try closing the emulator and launching the
+ virtual device again from the AVD Manager. Sometimes when you install an application for the
+ first time, it won't show up in the application launcher or be accessible by other applications.
+ This is because the package manager usually examines manifests completely only on emulator
+ startup.</p>
+
+ <p>Be certain to create multiple AVDs upon which to test your application. You should have one
+ AVD for each platform and screen type with which your application is compatible. For instance, if
+ your application compiles against the Android 1.5 (API Level 3) platform, you should create an
+ AVD for each platform equal to and greater than 1.5 and an AVD for each <a href=
+ "{@docRoot}guide/practices/screens_support.html">screen type</a> you support, then test your
+ application on each one.</p>
+
+ <p class="note"><strong>Tip:</strong> If you have <em>only one</em> emulator running, you can
+ build your application and install it on the emulator in one simple step. Navigate to the root of
+ your project directory and use Ant to compile the project with <em>install mode</em>: <code>ant
+ install</code>. This will build your application, sign it with the debug key, and install it on
+ the currently running emulator.</p>
+
+ <h2 id="RunningOnDevice">Running on a Device</h2>
+
+ <p>Before you can run your application on a device, you must perform some basic setup for your
+ device:</p>
+
+ <ul>
+ <li>Enable USB Debugging on your device. You can find the setting on most Android devices by
+ going to <strong>Settings > Applications > Development > USB debugging</strong>.</li>
+
+ <li>Ensure that your development computer can detect your device when connected via USB</li>
+ </ul>
+
+ <p>Read <a href="{@docRoot}tools/device.html#setting-up">Setting up a Device for
+ Development</a> for more information.</p>
+
+ <p>Once your device is set up and connected via USB, navigate to your SDK's <code>platform-tools/</code>
+ directory and install the <code>.apk</code> on the device:</p>
+ <pre>
+adb -d install <em>path/to/your/app</em>.apk
+</pre>
+
+ <p>The {@code -d} flag specifies that you want to use the attached device (in case you also have
+ an emulator running).</p>
+
+ <p>For more information on the tools used above, please see the following documents:</p>
+
+ <ul>
+ <li><a href="{@docRoot}tools/help/android.html">android Tool</a></li>
+
+ <li><a href="{@docRoot}tools/devices/emulator.html">Android Emulator</a></li>
+
+ <li><a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a> (ADB)</li>
+ </ul>
+
+ <h2 id="Signing">Application Signing</h2>
+
+ <p>As you begin developing Android applications, understand that all Android applications must be
+ digitally signed before the system will install them on an emulator or device. There are two ways
+ to do this: with a <em>debug key</em> (for immediate testing on an emulator or development
+ device) or with a <em>private key</em> (for application distribution).</p>
+
+ <p>The Android build tools help you get started by automatically signing your .apk files with a
+ debug key at build time. This means that you can compile your application and install it on the
+ emulator without having to generate your own private key. However, please note that if you intend
+ to publish your application, you <strong>must</strong> sign the application with your own private
+ key, rather than the debug key generated by the SDK tools.</p>
+
+ <p>The ADT plugin helps you get started quickly by signing your .apk files with a debug key,
+ prior to installing them on an emulator or development device. This means that you can quickly
+ run your application from Eclipse without having to generate your own private key. No specific
+ action on your part is needed, provided ADT has access to Keytool. However, please note that if
+ you intend to publish your application, you <strong>must</strong> sign the application with your
+ own private key, rather than the debug key generated by the SDK tools.</p>
+
+ <p>Please read <a href="{@docRoot}tools/publishing/app-signing.html">Signing Your
+ Applications</a>, which provides a thorough guide to application signing on Android and what it
+ means to you as an Android application developer. The document also includes a guide to exporting
+ and signing your application with the ADT's Export Wizard.</p>
+
+ <h2 id="AntReference">Ant Command Reference</h2>
+ <dt><code>ant clean</code></dt>
+ <dd>Cleans the project. If you include the <code>all</code> target before <code>clean</code>
+(<code>ant all clean</code>), other projects are also cleaned. For instance if you clean a
+test project, the tested project is also cleaned.</dd>
+
+ <dt><code>ant debug</code></dt>
+ <dd>Builds a debug package. Works on application, library, and test projects and compiles
+ dependencies as needed.</dd>
+
+ <dt id="emma"><code>ant emma debug</code></dt>
+ <dd>Builds a test project while building the tested project with instrumentation turned on.
+ This is used to run tests with code coverage enabled.</dd>
+
+ <dt><code>ant release</code></dt>
+ <dd>Builds a release package.</dd>
+
+ <dt><code>ant instrument</code>
+ </dt>
+ <dd>Builds an instrumented debug package. This is generally called automatically when building a
+ test project with code coverage enabled (with the <code>emma</code>
+ target)</dd>
+
+ <dt><code>ant <build_target> install</code></dt>
+ <dd>Builds and installs a package. Using <code>install</code> by itself fails.</dd>
+
+ <dt><code>ant installd</code></dt>
+ <dd>Installs an already compiled debug package. This fails if the <code>.apk</code> is not
+ already built.</dd>
+
+ <dt><code>ant installr</code></dt>
+ <dd>Installs an already compiled release package. This fails if the <code>.apk</code> is not
+ already built.</dd>
+
+ <dt><code>ant installt</code></dt>
+ <dd>Installs an already compiled test package. Also installs the <code>.apk</code> of the
+ tested application. This fails if the <code>.apk</code> is not already built.</dd>
+
+ <dt><code>ant installi</code></dt>
+ <dd>Installs an already compiled instrumented package. This is generally not used manually as
+ it's called when installing a test package. This fails if the <code>.apk</code> is not already
+ built.</dd>
+
+ <dt><code>ant test</code></dt>
+ <dd>Runs the tests (for test projects). The tested and test <code>.apk</code> files must be
+ previously installed.</dd>
+
+ <dt><code>ant debug installt test</code></dt>
+ <dd>Builds a test project and the tested project, installs both <code>.apk</code> files, and
+ runs the tests.</dd>
+
+ <dt><code>ant emma debug install test</code></dt>
+ <dd>Builds a test project and the tested project, installs both <code>.apk</code> files, and
+ runs the tests with code coverage enabled.</dd>
+
diff --git a/docs/html/tools/building/building-eclipse.jd b/docs/html/tools/building/building-eclipse.jd
new file mode 100644
index 0000000..c73fe97
--- /dev/null
+++ b/docs/html/tools/building/building-eclipse.jd
@@ -0,0 +1,165 @@
+page.title=Building and Running from Eclipse with ADT
+parent.title=Building and Running
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#RunningOnEmulatorEclipse">Running on an Emulator</a></li>
+
+ <li><a href="#RunningOnDeviceEclipse">Running on a Device</a></li>
+
+ <li><a href="#RunConfig">Creating a Run Configuration</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>Eclipse and ADT provide an environment where most of the details of the build process are
+ hidden from you. By default, the build process constantly runs in the background as you make
+ changes to your project.</p>
+
+ <p>When Eclipse automatically builds your application, it enables debugging and signs the
+ <code>.apk</code> with a debug key, by default. When you run the application,
+ Eclipse invokes ADB and installs your application to a device or emulator, so you do not have to
+ manually perform these tasks. Since most of the build process is taken care of by Eclipse, the
+ following topics show you how to run an application, which will automatically build your
+ application as well.</p>
+
+ <p>To distribute your application, however, you must build your application in release mode and sign the
+ <code>.apk</code> file with your own private key.</p>
+
+ <p>This document shows you how to run your application on an emulator or a real device
+ from Eclipse—all of which is done using the debug version of your application.
+ For more information about how to sign your application with a private key for release, see <a href=
+ "{@docRoot}tools/publishing/app-signing.html#ExportWizard">Signing Your Applications</a></p>
+
+ <h2 id="RunningOnEmulatorEclipse">Running on the emulator</h2>
+
+ <p>Before you can run your application on the Android Emulator, you must <a href=
+ "{@docRoot}tools/devices/managing-avds.html">create an AVD</a>.</p>
+
+ <p>To run (or debug) your application, select <strong>Run</strong> > <strong>Run</strong> (or
+ <strong>Run</strong> > <strong>Debug</strong>) from the Eclipse menu bar. The ADT plugin will
+ automatically create a default run configuration for the project. Eclipse will then perform the
+ following:</p>
+
+ <ol>
+ <li>Compile the project (if there have been changes since the last build).</li>
+
+ <li>Create a default run configuration (if one does not already exist for the project).</li>
+
+ <li>Install and start the application on an emulator (or device), based on the Deployment
+ Target defined by the run configuration.
+
+ <p>By default, Android run configurations use an "automatic target" mode for selecting a
+ device target. For information on how automatic target mode selects a deployment target, see
+ <a href="#AutoAndManualTargetModes">Automatic and manual target modes</a> below.</p>
+ </li>
+ </ol>
+
+ <p>If you run the application with the Debug option, the application will start in the "Waiting For Debugger" mode. Once the debugger
+ is attached, Eclipse opens the Debug perspective and starts the application's main activity. Otherwise, if you run the
+ application with the normal Run option, Eclipse installs the application on the device and launches the main activity.</p>
+
+ <p>To set or change the run configuration used for your project, use the run configuration
+ manager. See the section below about <a href="#RunConfig">Creating a Run Configuration</a> for more information.</p>
+
+ <p>Be certain to create multiple AVDs upon which to test your application. You should have one
+ AVD for each platform and screen type with which your application is compatible. For instance, if
+ your application compiles against the Android 1.5 (API Level 3) platform, you should create an
+ AVD for each platform equal to and greater than 1.5 and an AVD for each <a href=
+ "{@docRoot}guide/practices/screens_support.html">screen type</a> you support, then test your
+ application on each one.</p>
+
+ <h2 id="RunningOnDeviceEclipse">Running on a device</h2>
+
+ <p>Before you can run your application on a device, you must perform some basic setup for your
+ device:</p>
+
+ <ul>
+ <li>Ensure that your application is debuggable by setting the
+ <code>android:debuggable</code> attribute of the <code><application></code>
+ element to <code>true</code>. As of ADT 8.0, this is done by default when you build in debug mode.</li>
+
+ <li>Enable USB Debugging on your device. You can find the setting on most Android devices by
+ going to <strong>Settings > Applications > Development > USB debugging</strong>.</li>
+
+ <li>Ensure that your development computer can detect your device when connected via USB</li>
+ </ul>
+
+ <p>Read <a href="{@docRoot}tools/device.html">Using Hardware Devices</a>
+ for more information.</p>
+
+ <p>Once set up and your device is connected via USB, install your application on the device by
+ selecting <strong>Run</strong> > <strong>Run</strong> (or <strong>Run</strong> >
+ <strong>Debug</strong>) from the Eclipse menu bar.</p>
+
+ <h2 id="RunConfig">Creating a Run Configuration</h2>
+
+ <p>The run configuration specifies the project to run, the Activity to start, the emulator or
+ connected device to use, and so on. When you first run a project as an <em>Android
+ Application</em>, ADT will automatically create a run configuration. The default run
+ configuration will launch the default project Activity and use automatic target mode for device
+ selection (with no preferred AVD). If the default settings don't suit your project, you can
+ customize the run configuration or even create a new one.</p>
+
+ <p>To create or modify a run configuration, refer to the Eclipse documentation on how to create Run configurations.
+ The following steps highlight the important things you need to do for an Android project:</p>
+
+ <ol>
+ <li>Open the run configuration manager from the Run Menu.</li>
+
+ <li>Expand the <strong>Android Application</strong> item and create a new configuration or open
+ an existing one.
+ </li>
+
+ <li>With the Run Configuration selected, adjust your desired run configuration settings:
+ <ul>
+ <li>In the Android tab, specify the Project and Activity to launch.
+ </li>
+ <li><p>In the Target tab, consider whether you'd like to use Manual or Automatic mode when
+ selecting an AVD to run your application. See the following section on <a href=
+ "#AutoAndManualTargetModes">Automatic and manual target modes</a>).</p>
+
+ <p>You can specify any emulator options to the Additional Emulator Command Line Options
+ field. For example, you could add <code>-scale 96dpi</code> to scale the AVD's screen to an
+ accurate size, based on the dpi of your computer monitor. For a full list of emulator
+ options, see the <a href="{@docRoot}tools/help/emulator.html">Android
+ Emulator</a> document.</p>
+ </li>
+ </ul>
+ </li>
+ </ol>
+
+ <h4 id="AutoAndManualTargetModes">Automatic and manual target modes</h4>
+
+ <p>By default, a run configuration uses the <strong>automatic</strong> target mode in order to
+ select an AVD. In this mode, ADT will select an AVD for the application in the following
+ manner:</p>
+
+ <ol>
+ <li>If there's a device or emulator already running and its AVD configuration meets the
+ requirements of the application's build target, the application is installed and run upon
+ it.</li>
+
+ <li>If there's more than one device or emulator running, each of which meets the requirements
+ of the build target, a "device chooser" is shown to let you select which device to use.</li>
+
+ <li>If there are no devices or emulators running that meet the requirements of the build
+ target, ADT looks at the available AVDs. If there is an AVD that matches the build target of the project,
+ ADT chooses that AVD. If the AVD versions are newer than the build target of the project, ADT chooses
+ the oldest possible version of an AVD that meets the project's build target requirement.</li>
+
+ <li>If there are no suitable AVDs, the application is not installed a console error warning tells
+ you that there is no existing AVD that meets the build target requirements.</li>
+ </ol>
+
+ <p>However, if a "preferred AVD" is selected in the run configuration, then the application will
+ <em>always</em> be deployed to that AVD. If it's not already running, then a new emulator will be
+ launched.</p>
+
+ <p>If your run configuration uses <strong>manual</strong> mode, then the "device chooser" is
+ presented every time that your application is run, so that you can select which AVD to use.</p>
\ No newline at end of file
diff --git a/docs/html/tools/building/index.jd b/docs/html/tools/building/index.jd
new file mode 100644
index 0000000..c64942f
--- /dev/null
+++ b/docs/html/tools/building/index.jd
@@ -0,0 +1,81 @@
+page.title=Building and Running
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#detailed-build">A Detailed Look at the Build Process</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>During the build process, your Android projects are compiled and packaged into an .apk file,
+ the container for your application binary. It contains all of the information necessary to run
+ your application on a device or emulator, such as compiled <code>.dex</code> files (<code>.class</code> files
+ converted to Dalvik byte code), a binary version of the <code>AndroidManifest.xml</code> file, compiled
+ resources (<code>resources.arsc</code>) and uncompiled resource files for your application.</p>
+
+ <p>If you are developing in Eclipse, the ADT plugin incrementally builds your project as you
+ make changes to the source code. Eclipse outputs an <code>.apk</code> file automatically to the bin folder of
+ the project, so you do not have to do anything extra to generate the <code>.apk</code>.</p>
+
+ <p>If you are developing in a non-Eclipse environment, you can build your project with the
+ generated <code>build.xml</code> Ant file that is in the project directory. The Ant file calls targets that
+ automatically call the build tools for you.</p>
+
+ <p>To run an application on an emulator or device, the application must be signed using debug or
+ release mode. You typically want to sign your application in debug mode when you develop and test
+ your application, because the build tools use a debug key with a known password so you do not have
+ to enter it every time you build. When you are ready to release the application to Google
+ Play, you must sign the application in release mode, using your own private key.</p>
+
+ <p>Fortunately, Eclipse or your Ant build script signs the application for you in debug mode
+ when you build your application. You can also easily setup Eclipse or your Ant build to sign your
+ application in release mode as well. For more information on signing applications, see <a href=
+ "{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a>.</p>
+
+ <p>The following diagram depicts the components involved in building and running an application:</p>
+
+ <img src="{@docRoot}images/build-simplified.png" />
+
+ <h2 id="detailed-build">A Detailed Look at the Build Process</h2>
+
+ <p>The build process involves many tools and processes that generate intermediate files on the
+ way to producing an <code>.apk</code>. If you are developing in Eclipse, the complete build process is
+ automatically done periodically as you develop and save your code changes. If you are using other
+ IDEs, this build process is done every time you run the generated Ant build script for your
+ project. It is useful, however, to understand what is happening under the hood since much of the
+ tools and processes are masked from you. The following diagram depicts the different tools and
+ processes that are involved in a build:</p>
+
+ <img src="{@docRoot}images/build.png" />
+
+ <p>The general process for a typical build is outlined below:</p>
+
+ <ul>
+
+ <li>The Android Asset Packaging Tool (aapt) takes your application resource files, such as the
+ <code>AndroidManifest.xml</code> file and the XML files for your Activities, and compiles them. An <code>R.java</code> is
+ also produced so you can reference your resources from your Java code.</li>
+
+ <li>The aidl tool converts any <code>.aidl</code> interfaces that you have into Java interfaces.</li>
+
+ <li>All of your Java code, including the <code>R.java</code> and <code>.aidl</code> files, are compiled by the Java
+ compiler and .class files are output.</li>
+
+ <li>The dex tool converts the .class files to Dalvik byte code. Any 3rd party libraries and
+ .class files that you have included in your project are also converted into <code>.dex</code> files so that
+ they can be packaged into the final <code>.apk</code> file.</li>
+
+ <li>All non-compiled resources (such as images), compiled resources, and the .dex files are
+ sent to the apkbuilder tool to be packaged into an <code>.apk</code> file.</li>
+
+ <li>Once the <code>.apk</code> is built, it must be signed with either a debug or release key before it can
+ be installed to a device.</li>
+
+ <li>Finally, if the application is being signed in release mode, you must align the <code>.apk</code> with
+ the zipalign tool. Aligning the final <code>.apk</code> decreases memory usage when the application is
+ running on a device.</li>
+ </ul>
+
diff --git a/docs/html/tools/debug-tasks.html b/docs/html/tools/debug-tasks.html
new file mode 100644
index 0000000..2a5bc51
--- /dev/null
+++ b/docs/html/tools/debug-tasks.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/tools/debugging/index.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/tools/debugging/index.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/tools/debugging/ddms.jd b/docs/html/tools/debugging/ddms.jd
new file mode 100644
index 0000000..3d6324b
--- /dev/null
+++ b/docs/html/tools/debugging/ddms.jd
@@ -0,0 +1,357 @@
+page.title=Using DDMS
+parent.title=Debugging
+parent.link=index.html
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#running">Running DDMS</a></li>
+ <li><a href="#how-ddms-works">How DDMS Interacts with a Debugger</a></li>
+
+ <li><a href="#using-ddms">Using DDMS</a>
+ <ol>
+ <li><a href="#heap">Viewing heap usage for a process</a></li>
+ <li><a href="#alloc">Tracking memory allocation of objects</a></li>
+ <li><a href="#emulator">Working with an emulator or device's file system</a></li>
+ <li><a href="#thread">Examining thread information</a></li>
+ <li><a href="#profiling">Starting method profiling</a></li>
+ <li><a href="#network">Using the Network Traffic tool</a></li>
+ <li><a href="#logcat">Using LogCat</a></li>
+ <li><a href="#ops-location">Emulating phone operations and location</a></li>
+ </ol>
+
+ </li>
+ </ol>
+ </div>
+ </div>
+
+ <p>Android ships with a debugging tool called the Dalvik Debug Monitor Server (DDMS), which
+ provides port-forwarding services, screen capture on the device, thread and heap information on
+ the device, logcat, process, and radio state information, incoming call and SMS spoofing,
+ location data spoofing, and more. This page provides a modest discussion of DDMS features; it is
+ not an exhaustive exploration of all the features and capabilities.</p>
+
+ <h2 id="running">Running DDMS</h2>
+ <p>DDMS is integrated into Eclipse and is also shipped in the <code>tools/</code> directory of the
+ SDK. DDMS works with both the emulator and a connected device. If both are connected and running simultaneously,
+ DDMS defaults to the emulator.</p>
+
+ <ul>
+ <li>From Eclipse: Click <strong>Window > Open Perspective > Other... > DDMS</strong>.</li>
+ <li>From the command line: Type <code>ddms</code> (or <code>./ddms</code> on Mac/Linux) from the <code>tools/</code>
+ directory. </li>
+ </ul>
+
+
+ <h2 id="how-ddms-works">How DDMS Interacts with a Debugger</h2>
+
+ <p>On Android, every application runs in its own process, each of which runs in its own virtual machine
+ (VM). Each VM exposes a unique port that a debugger can attach to.</p>
+
+ <p>When DDMS starts, it connects to <a href="{@docRoot}tools/help/adb.html">adb</a>.
+ When a device is connected, a VM monitoring service is created between
+ <code>adb</code> and DDMS, which notifies DDMS when a VM on the device is started or terminated. Once a VM
+ is running, DDMS retrieves the the VM's process ID (pid), via <code>adb</code>, and opens a connection to the
+ VM's debugger, through the adb daemon (adbd) on the device. DDMS can now talk to the VM using a
+ custom wire protocol.</p>
+
+ <p>DDMS assigns a debugging port to each VM on the device. Typically,
+ DDMS assigns port 8600 for the first debuggable VM, the next on 8601, and so on. When a debugger
+ connects to one of these ports, all traffic is forwarded to the debugger from the associated
+ VM. You can only attach a single debugger to a single port, but DDMS can handle multiple, attached
+ debuggers.</p>
+
+ <p>By default, DDMS also listens on another debugging port, the DDMS "base port" (8700, by default).
+ The base port is a port forwarder, which can accept VM traffic from any debugging port and forward
+ it to the debugger on port 8700. This allows you to attach one debugger to port 8700, and debug
+ all the VMs on a device. The traffic that is forwarded is determined by the currently selected process
+ in the DDMS Devices view.</p>
+
+ <p>The following screenshot shows a typical DDMS screen in Eclipse. If you are starting DDMS from
+ the command line, the screen is slightly different, but much of the functionality is identical.
+ Notice that the highlighted process, <code>com.android.email</code>, that is running in the emulator
+ has the debugging port 8700 assigned to it as well as 8606. This signifies that DDMS is currently
+ forwarding port 8606 to the static debugging port of 8700.</p>
+
+ <img src="{@docRoot}images/debug-ddms.png"
+ width="1024" />
+ <p class="img-caption"><strong>Figure 1.</strong>
+ Screenshot of DDMS</p>
+
+ <p>If you are not using Eclipse and ADT, read <a href=
+ "{@docRoot}tools/debugging/debugging-projects-cmdline.html#debuggingPort">Configuring
+ your IDE to attach to the debugging port</a>, for more information on attaching your
+ debugger.</p>
+
+ <p class="note"><strong>Tip:</strong> You can set a number of DDMS preferences in
+ <strong>File</strong> > <strong>Preferences</strong>. Preferences are saved to
+ <code>$HOME/.android/ddms.cfg</code>.</p>
+
+ <p class="warning"><strong>Known debugging issues with Dalvik</strong><br />
+ Debugging an application in the Dalvik VM should work the same as it does in other VMs. However,
+ when single-stepping out of synchronized code, the "current line" cursor may jump to the last
+ line in the method for one step.</p>
+
+ <h2 id="using-ddms">Using DDMS</h2>
+ The following sections describe how to use DDMS and the various tabs and panes that are part of the
+ DDMS GUI. The Eclipse version and the command line version have minor UI differences, but the
+ same functionality. For information on running DDMS, see the previous section in this document,
+ <a href="#running">Running DDMS</a>.
+
+
+ <h3 id="heap">Viewing heap usage for a process</h3>
+
+ <p>DDMS allows you to view how much heap memory a process is using. This information is useful in
+ tracking heap usage at a certain point of time during the execution of your application.</p>
+ <p>To view heap usage for a process:</p>
+ <ol>
+ <li>In the Devices tab, select the process that you want to see the heap information for.</li>
+
+ <li>Click the <strong>Update Heap</strong> button to enable heap information for the
+ process.</li>
+
+ <li>In the Heap tab, click <strong>Cause GC</strong> to invoke garbage collection, which
+ enables the collection of heap data. When the operation completes, you will see a group of
+ object types and the memory that has been allocated for each type. You can click <strong>Cause
+ GC</strong> again to refresh the data.</li>
+
+ <li>Click on an object type in the list to see a bar graph that shows the number of objects
+ allocated for a particular memory size in bytes.</li>
+ </ol>
+
+ <h3 id="alloc">Tracking memory allocation of objects</h3>
+
+ <p>DDMS provides a feature to track objects that are being allocated to memory and to see which
+ classes and threads are allocating the objects. This allows you to track, in real time, where
+ objects are being allocated when you perform certain actions in your application. This
+ information is valuable for assessing memory usage that can affect application performance.
+ </p>
+
+ <p>To track memory allocation of objects:</p>
+ <ol>
+ <li>In the Devices tab, select the process that you want to enable allocation tracking
+ for.</li>
+
+ <li>In the Allocation Tracker tab, click the <strong>Start Tracking</strong> button to begin
+ allocation tracking. At this point, anything you do in your application will be tracked.</li>
+
+ <li>Click <strong>Get Allocations</strong> to see a list of objects that have been allocated
+ since you clicked on the <strong>Start Tracking</strong> button. You can click on <strong>Get
+ Allocations</strong> again to append to the list new objects that that have been
+ allocated.</li>
+
+ <li>To stop tracking or to clear the data and start over, click the <strong>Stop Tracking
+ button</strong>.</li>
+
+ <li>Click on a specific row in the list to see more detailed information such as the method and
+ line number of the code that allocated the object.</li>
+ </ol>
+
+ <h3 id="emulator">Working with an emulator or device's file system</h3>
+
+ <p>DDMS provides a File Explorer tab that allows you to view, copy, and delete files on the
+ device. This feature is useful in examining files that are created by your application or if you
+ want to transfer files to and from the device.</p>
+
+ <p>To work with an emulator or device's file system:</p>
+ <ol>
+ <li>In the Devices tab, select the emulator that you want to view the file system for.</li>
+
+ <li>To copy a file from the device, locate the file in the File Explorer and click the
+ <strong>Pull file</strong> button.</li>
+
+ <li>To copy a file to the device, click the <strong>Push file</strong> button on the File
+ Explorer tab.</li>
+ </ol>
+
+ <!-- Need to elaborate more on where things are stored in the file system,
+ databases, apks, user info, files that are important to look at -->
+
+ <h3 id="thread">Examining thread information</h3>
+
+ <p>The Threads tab in DDMS shows you the currently running threads for a selected process.</p>
+
+ <ol>
+ <li>In the Devices tab, select the process that you want to examine the threads for.</li>
+
+ <li>Click the <strong>Update Threads</strong> button.</li>
+
+ <li>In the Threads tab, you can view the thread information for the selected process.</li>
+ </ol>
+
+ <h3 id="profiling">Starting method profiling</h3>
+
+ <p>Method profiling is a means to track certain metrics about a method, such as number of calls,
+ execution time, and time spent executing the method. If you want more granular control over
+ where profiling data is collected, use the {@link android.os.Debug#startMethodTracing()} and
+ {@link android.os.Debug#stopMethodTracing()} methods. For more information about generating trace logs, see
+ <a href="debugging-tracing.html">Profiling and Debugging UIs</a>.</p>
+
+ <p>Before you start method profiling in DDMS, be aware of the following restrictions:</p>
+ <ul>
+ <li>Android 1.5 devices are not supported.</li>
+ <li>Android 2.1 and earlier devices must
+ have an SD card present and your application must have permission to write to the SD card.
+ <li>Android 2.2 and later devices do not need an SD card. The trace log files are
+ streamed directly to your development machine.</li>
+ </ul>
+
+ <p>To start method profiling:</p>
+ <ol>
+ <li>On the Devices tab, select the process that you want to enable method profiling for.</li>
+
+ <li>Click the <strong>Start Method Profiling</strong> button.</li>
+
+ <li>Interact with your application to start the methods that you want to profile.</li>
+
+ <li>Click the <strong>Stop Method Profiling</strong> button. DDMS stops profiling your
+ application and opens <a href="{@docRoot}tools/debugging/debugging-ui.html">Traceview</a>
+ with the method profiling information that was collected
+ between the time you clicked on <strong>Start Method Profiling</strong> and <strong>Stop Method
+ Profiling</strong>.</li>
+ </ol>
+
+ <h3 id="network">Using the Network Traffic tool</h3>
+
+ <p>In Android 4.0, the DDMS (Dalvik Debug Monitor Server) includes a Detailed
+Network Usage tab that makes it possible to track when your application is
+making network requests. Using this tool, you can monitor how and when your app
+transfers data and optimize the underlying code appropriately. You can also
+distinguish between different traffic types by applying a “tag” to network
+sockets before use.</p>
+
+<p>These tags are shown in a stack area chart in DDMS, as shown in figure 2:</p>
+
+<img src="{@docRoot}images/developing/ddms-network.png" />
+<p class="img-caption"><strong>Figure 2.</strong> Network Usage tab.</p>
+
+<p>By monitoring the frequency of your data transfers, and the amount of data
+transferred during each connection, you can identify areas of your application
+that can be made more battery-efficient. Generally, you should look for
+short spikes that can be delayed, or that should cause a later transfer to be
+pre-empted. </p>
+
+<p>To better identify the cause of transfer spikes, the
+{@link android.net.TrafficStats} API allows you
+to tag the data transfers occurring within a thread using {@link
+android.net.TrafficStats#setThreadStatsTag setThreadStatsTag()}, followed
+by manually tagging (and untagging) individual sockets using {@link
+android.net.TrafficStats#tagSocket tagSocket()} and {@link
+android.net.TrafficStats#untagSocket untagSocket()}. For example:</p>
+
+<pre>TrafficStats.setThreadStatsTag(0xF00D);
+TrafficStats.tagSocket(outputSocket);
+// Transfer data using socket
+TrafficStats.untagSocket(outputSocket);</pre>
+
+<p>Alternatively, the Apache {@link org.apache.http.client.HttpClient} and
+{@link java.net.URLConnection} APIs included in the platform
+automatically tag sockets internally based on the active tag (as
+identified by
+{@link android.net.TrafficStats#getThreadStatsTag getThreadStatsTag()}).
+These APIs correctly tag/untag sockets when recycled through
+keep-alive pools. In the following example,
+{@link android.net.TrafficStats#setThreadStatsTag setThreadStatsTag()}
+sets the active tag to be {@code 0xF00D}.
+There can only be one active tag per thread.
+That is the value that will
+be returned by {@link android.net.TrafficStats#getThreadStatsTag getThreadStatsTag()}
+and thus used by {@link org.apache.http.client.HttpClient}
+ to tag sockets. The {@code finally} statement
+invokes
+{@link android.net.TrafficStats#clearThreadStatsTag clearThreadStatsTag()}
+to clear the tag.</p>
+
+<pre>TrafficStats.setThreadStatsTag(0xF00D);
+ try {
+ // Make network request using HttpClient.execute()
+ } finally {
+ TrafficStats.clearThreadStatsTag();
+}</pre>
+
+<p>Socket tagging is supported in Android 4.0, but real-time stats will only be
+displayed on devices running Android 4.0.3 or higher.</p>
+
+ <h3 id="logcat">Using LogCat</h3>
+
+ <p>LogCat is integrated into DDMS, and outputs the messages that you print out using the {@link android.util.Log}
+ class along with other system messages such as stack traces when exceptions are thrown. View the
+ <a href="{@docRoot}tools/debugging/debugging-log.html">Reading and
+ Writing Log Messages.</a> topic for more information on how to log messages to the LogCat.</p>
+
+ <p>When you have set up your logging, you can use the LogCat feature of DDMS to filter certain
+ messages with the following buttons:</p>
+
+ <ul>
+ <li>Verbose</li>
+
+ <li>Debug</li>
+
+ <li>Info</li>
+
+ <li>Warn</li>
+
+ <li>Error</li>
+ </ul>
+
+ <p>You can also setup your own custom filter to specify more details such as filtering messages
+ with the log tags or with the process id that generated the log message. The add filter,
+ edit filter, and delete filter buttons let you manage your custom filters.</p>
+
+ <h3 id="ops-location">Emulating phone operations and location</h3>
+ <p>The Emulator control tab lets you simulate a
+ phone's voice and data network status. This is useful when you want to test your application's
+ robustness in differing network environments.</p>
+
+ <h4>Changing network state, speed, and latency</h4>
+ <p>The Telephony Status section of the Emulator
+ controls tab lets you change different aspects of the phone's networks status, speed and latency.
+ The following options are available to you and are effective immediately after you set them:</p>
+
+ <ul>
+ <li>Voice - unregistered, home, roaming, searching, denied</li>
+
+ <li>Data - unregistered, home, roaming, searching, denied</li>
+
+ <li>Speed - Full, GSM, HSCSD, GPRS, EDGE, UMTS, HSDPA</li>
+
+ <li>Latency - GPRS, EDGE, UMTS</li>
+ </ul>
+
+ <h4>Spoofing calls or SMS text messages</h4>
+ <p>The Telephony Actions section of the Emulator
+ controls tab lets you spoof calls and messages. This is useful when you want to to test your
+ application's robustness in responding to incoming calls and messages that are sent to the phone.
+ The following actions are available to you:</p>
+
+ <ul>
+ <li>Voice - Enter a number in the <strong>Incoming number</strong> field and click
+ <strong>Call</strong> to send a simulated call to the emulator or phone. Click the
+ <strong>Hang up</strong> button to terminate the call.</li>
+
+ <li>SMS - Enter a number in the <strong>Incoming number</strong> field and a message in the
+ <strong>Message:</strong> field and click the <strong>Send</strong> button to send the
+ message.</li>
+ </ul>
+
+ <h4>Setting the location of the phone</h4>
+ <p>If your application depends on the location of the phone, you can have DDMS send your
+ device or AVD a mock location. This is useful if you
+ want to test different aspects of your application's location specific features without
+ physically moving. The following geolocation data types are available to you:</p>
+
+ <ul>
+ <li>Manual - set the location by manually specifying decimal or sexagesimal longitude and
+ latitude values.</li>
+
+ <li>GPX - GPS eXchange file</li>
+
+ <li>KML - Keyhole Markup Language file</li>
+ </ul>
+
+ For more information about providing mock location data, see
+ <a href="{@docRoot}guide/topics/location/strategies.html#MockData">Location Strategies</a>.
+
diff --git a/docs/html/tools/debugging/debugging-devtools.jd b/docs/html/tools/debugging/debugging-devtools.jd
new file mode 100644
index 0000000..3a05120
--- /dev/null
+++ b/docs/html/tools/debugging/debugging-devtools.jd
@@ -0,0 +1,77 @@
+page.title=Using the Dev Tools App
+parent.title=Debugging
+parent.link=index.html
+@jd:body
+
+<p>The Dev Tools application is installed by default on all system images included with the SDK,
+ so you can use it with the Android Emulator. With the Dev Tools application, you can enable a
+ number of settings on your device that will make it easier to test and debug your applications.</p>
+
+ <p> The Dev Tools application relies on a number of permissions that are not available for
+ third party applications. If you'd like to install the Dev Tools application
+ on a real development device, you'd have to build a system image for that device and sign
+ the Dev Tools application with the same key as used for the system image.</p>
+
+ <p>To get started, launch the Dev Tools application and select <strong>Development Settings</strong>. This will
+ open the Development Settings page with the following options (among others):</p>
+
+ <dl>
+ <dt><strong>Debug app</strong></dt>
+
+ <dd>
+ Lets you select the application to debug. You do not need to set this to attach a debugger,
+ but setting this value has two effects:
+
+ <ul>
+ <li>It will prevent Android from throwing an error if you pause on a breakpoint for a long
+ time while debugging.</li>
+
+ <li>It will enable you to select the <em>Wait for Debugger</em> option to pause application
+ startup until your debugger attaches (described next).</li>
+ </ul>
+ </dd>
+
+ <dt><strong>Wait for debugger</strong></dt>
+
+ <dd>Blocks the selected application from loading until a debugger attaches. This way you can
+ set a breakpoint in {@link android.app.Activity#onCreate onCreate()},
+ which is important to debug the startup process of an Activity.
+ When you change this option, any currently running instances of the selected application will
+ be killed. In order to check this box, you must have selected a debug application as described
+ in the previous option. You can do the same thing by adding {@link
+ android.os.Debug#waitForDebugger()} to your code.</dd>
+
+ <dt><strong>Show screen updates</strong></dt>
+
+ <dd>Flashes a momentary pink rectangle on any screen sections that are being redrawn. This is
+ very useful for discovering unnecessary screen drawing.</dd>
+
+ <dt><strong>Immediately destroy activities</strong></dt>
+
+ <dd>Tells the system to destroy an activity as soon as it is stopped (as if Android had to
+ reclaim memory). This is very useful for testing the {@link
+ android.app.Activity#onSaveInstanceState} / {@link
+ android.app.Activity#onCreate(android.os.Bundle)} code path, which would otherwise be difficult
+ to force. Choosing this option will probably reveal a number of problems in your application
+ due to not saving state. For more information about saving an activity's state, see the
+ <a href="{@docRoot}guide/components/activities.html#SavingActivityState">Activities</a>
+document.</dd>
+
+ <dt><strong>Show CPU usage</strong></dt>
+
+ <dd>Displays CPU meters at the top of the screen, showing how much the CPU is being used. The
+ top red bar shows overall CPU usage, and the green bar underneath it shows the CPU time spent
+ in compositing the screen.
+ <p class="note">Note: You cannot turn this feature off once it is on, without
+ restarting the emulator.</p></dd>
+
+ <dt><strong>Show background</strong></dt>
+
+ <dd>Displays a background pattern when no activity screens are visible. This typically does not
+ happen, but can happen during debugging.</dd>
+ </dl>
+
+ <p>These settings will be remembered across emulator restarts.</p>
+
+
+
diff --git a/docs/html/tools/debugging/debugging-log.jd b/docs/html/tools/debugging/debugging-log.jd
new file mode 100644
index 0000000..d2baaf26
--- /dev/null
+++ b/docs/html/tools/debugging/debugging-log.jd
@@ -0,0 +1,308 @@
+page.title=Reading and Writing Logs
+parent.title=Debugging
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#logClass">The Log class</a></li>
+
+ <li><a href="#startingLogcat">Starting LogCat</a></li>
+
+ <li><a href="#filteringOutput">Filtering Log Output</a></li>
+
+ <li><a href="#outputFormat">Controlling Log Output Format</a></li>
+
+ <li><a href="#alternativeBuffers">Viewing Alternative Log Output Buffers</a></li>
+
+ <li><a href="#viewingStd">Viewing stdout and stderr</a></li>
+
+ <li><a href="#DebuggingWebPages">Debugging Web Pages</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>The Android logging system provides a mechanism for collecting and viewing system debug
+ output. Logcat dumps a log of system messages, which include things such as stack traces when the
+ emulator throws an error and messages that you have written from your application by using the
+ {@link android.util.Log} class. You can run LogCat through ADB or from DDMS, which allows you to
+ read the messages in real time.</p>
+
+ <h2 id="logClass">The <code>Log</code> class</h2>
+
+ <p>{@link android.util.Log} is a logging class that you can utilize in your code to print out
+ messages to the LogCat. Common logging methods include:</p>
+
+ <ul>
+ <li>{@link android.util.Log#v(String,String)} (verbose)</li>
+
+ <li>{@link android.util.Log#d(String,String)} (debug)</li>
+
+ <li>{@link android.util.Log#i(String,String)} (information)</li>
+
+ <li>{@link android.util.Log#w(String,String)} (warning)</li>
+
+ <li>{@link android.util.Log#e(String,String)} (error)</li>
+ </ul>For example:
+ <pre class="no-pretty-print">
+Log.i("MyActivity", "MyClass.getView() — get item number " + position);
+</pre>
+
+ <p>The LogCat will then output something like:</p>
+ <pre class="no-pretty-print">
+I/MyActivity( 1557): MyClass.getView() — get item number 1
+</pre>
+
+ <h2 id="startingLogcat">Using LogCat</h2>
+
+ <p>You can use LogCat from within DDMS or call it on an ADB shell. For more information on how to
+ use LogCat within DDMS, see <a href="{@docRoot}tools/debugging/ddms.html#logcat">Using
+ DDMS</a>. To run LogCat, through the ADB shell, the general usage is:</p>
+ <pre>
+[adb] logcat [<option>] ... [<filter-spec>] ...
+</pre>
+
+ <p>You can use the <code>logcat</code> command from your development computer or from a remote
+ adb shell in an emulator/device instance. To view log output in your development computer, you
+ use</p>
+ <pre>
+$ adb logcat
+</pre>
+
+ <p>and from a remote adb shell you use</p>
+ <pre>
+# logcat
+</pre>
+
+ <p>The following table describes the <code>logcat</code> command line options:</p>
+
+ <table>
+ <tr>
+ <td><code>-c</code></td>
+
+ <td>Clears (flushes) the entire log and exits.</td>
+ </tr>
+
+ <tr>
+ <td><code>-d</code></td>
+
+ <td>Dumps the log to the screen and exits.</td>
+ </tr>
+
+ <tr>
+ <td><code>-f <filename></code></td>
+
+ <td>Writes log message output to <code><filename></code>. The default is
+ <code>stdout</code>.</td>
+ </tr>
+
+ <tr>
+ <td><code>-g</code></td>
+ <td>Prints the size of the specified log buffer and exits.</td>
+ </tr>
+
+ <tr>
+ <td><code>-n <count></code></td>
+
+ <td>Sets the maximum number of rotated logs to <code><count></code>. The default value
+ is 4. Requires the <code>-r</code> option.</td>
+ </tr>
+
+ <tr>
+ <td><code>-r <kbytes></code></td>
+
+ <td>Rotates the log file every <code><kbytes></code> of output. The default value is
+ 16. Requires the <code>-f</code> option.</td>
+ </tr>
+
+ <tr>
+ <td><code>-s</code></td>
+
+ <td>Sets the default filter spec to silent.</td>
+ </tr>
+
+ <tr>
+ <td><code>-v <format></code></td>
+
+ <td>Sets the output format for log messages. The default is <code>brief</code> format. For a
+ list of supported formats, see <a href="#outputFormat">Controlling Log Output
+ Format</a>.</td>
+ </tr>
+ </table>
+
+ <h3 id="filteringOutput">Filtering Log Output</h3>
+
+ <p>Every Android log message has a <em>tag</em> and a <em>priority</em> associated with it.</p>
+
+ <ul>
+ <li>The tag of a log message is a short string indicating the system component from which the
+ message originates (for example, "View" for the view system).</li>
+
+ <li>The priority is one of the following character values, ordered from lowest to highest
+ priority:</li>
+
+ <li style="list-style: none; display: inline">
+ <ul>
+ <li><code>V</code> — Verbose (lowest priority)</li>
+
+ <li><code>D</code> — Debug</li>
+
+ <li><code>I</code> — Info</li>
+
+ <li><code>W</code> — Warning</li>
+
+ <li><code>E</code> — Error</li>
+
+ <li><code>F</code> — Fatal</li>
+
+ <li><code>S</code> — Silent (highest priority, on which nothing is ever printed)</li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>You can obtain a list of tags used in the system, together with priorities, by running
+ LogCat and observing the first two columns of each message, given as
+ <code><priority>/<tag></code>.</p>
+
+ <p>Here's an example of logcat output that shows that the message relates to priority level "I"
+ and tag "ActivityManager":</p>
+ <pre>
+I/ActivityManager( 585): Starting activity: Intent { action=android.intent.action...}
+</pre>
+
+ <p>To reduce the log output to a manageable level, you can restrict log output using <em>filter
+ expressions</em>. Filter expressions let you indicate to the system the tags-priority
+ combinations that you are interested in — the system suppresses other messages for the
+ specified tags.</p>
+
+ <p>A filter expression follows this format <code>tag:priority ...</code>, where <code>tag</code>
+ indicates the tag of interest and <code>priority</code> indicates the <em>minimum</em> level of
+ priority to report for that tag. Messages for that tag at or above the specified priority are
+ written to the log. You can supply any number of <code>tag:priority</code> specifications in a
+ single filter expression. The series of specifications is whitespace-delimited.</p>
+
+ <p>Here's an example of a filter expression that suppresses all log messages except those with
+ the tag "ActivityManager", at priority "Info" or above, and all log messages with tag "MyApp",
+ with priority "Debug" or above:</p>
+ <pre>
+adb logcat ActivityManager:I MyApp:D *:S
+</pre>
+
+ <p>The final element in the above expression, <code>*:S</code>, sets the priority level for all
+ tags to "silent", thus ensuring only log messages with "View" and "MyApp" are displayed. Using
+ <code>*:S</code> is an excellent way to ensure that log output is restricted to the filters that
+ you have explicitly specified — it lets your filters serve as a "whitelist" for log
+ output.</p>
+
+ <p>The following filter expression displays all log messages with priority level "warning" and higher, on all tags:</p>
+ <pre>
+adb logcat *:W
+</pre>
+
+ <p>If you're running LogCat from your development computer (versus running it on a
+ remote adb shell), you can also set a default filter expression by exporting a value for the
+ environment variable <code>ANDROID_LOG_TAGS</code>:</p>
+ <pre>
+export ANDROID_LOG_TAGS="ActivityManager:I MyApp:D *:S"
+</pre>
+
+ <p>Note that <code>ANDROID_LOG_TAGS</code> filter is not exported to the emulator/device
+ instance, if you are running LogCat from a remote shell or using <code>adb shell
+ logcat</code>.</p>
+
+ <h3 id="outputFormat">Controlling Log Output Format</h3>
+
+ <p>Log messages contain a number of metadata fields, in addition to the tag and priority. You can
+ modify the output format for messages so that they display a specific metadata field. To do so,
+ you use the <code>-v</code> option and specify one of the supported output formats listed
+ below.</p>
+
+ <ul>
+ <li><code>brief</code> — Display priority/tag and PID of the process issuing the
+ message (the default format).</li>
+
+ <li><code>process</code> — Display PID only.</li>
+
+ <li><code>tag</code> — Display the priority/tag only.</li>
+
+ <li><code>raw</code> — Display the raw log message, with no other metadata fields.</li>
+
+ <li><code>time</code> — Display the date, invocation time, priority/tag, and PID of the
+ process issuing the message.</li>
+
+ <li><code>threadtime</code> — Display the date, invocation time, priority, tag, and
+ the PID and TID of the thread issuing the message.</li>
+
+ <li><code>long</code> — Display all metadata fields and separate messages with blank
+ lines.</li>
+ </ul>
+
+ <p>When starting LogCat, you can specify the output format you want by using the
+ <code>-v</code> option:</p>
+ <pre>
+[adb] logcat [-v <format>]
+</pre>
+
+ <p>Here's an example that shows how to generate messages in <code>thread</code> output
+ format:</p>
+ <pre>
+adb logcat -v thread
+</pre>
+
+ <p>Note that you can only specify one output format with the <code>-v</code> option.</p>
+
+ <h3 id="alternativeBuffers">Viewing Alternative Log Buffers</h3>
+
+ <p>The Android logging system keeps multiple circular buffers for log messages, and not all of
+ the log messages are sent to the default circular buffer. To see additional log messages, you can
+ run the <code>logcat</code> command with the <code>-b</code> option, to request viewing of an alternate
+ circular buffer. You can view any of these alternate buffers:</p>
+
+ <ul>
+ <li><code>radio</code> — View the buffer that contains radio/telephony related
+ messages.</li>
+
+ <li><code>events</code> — View the buffer containing events-related messages.</li>
+
+ <li><code>main</code> — View the main log buffer (default)</li>
+ </ul>
+
+ <p>The usage of the <code>-b</code> option is:</p>
+ <pre>
+[adb] logcat [-b <buffer>]
+</pre>
+
+ <p>Here's an example of how to view a log buffer containing radio and telephony messages:</p>
+ <pre>
+adb logcat -b radio
+</pre><a name="stdout"
+ id="stdout"></a>
+
+ <h2 id="viewingStd">Viewing stdout and stderr</h2>
+
+ <p>By default, the Android system sends <code>stdout</code> and <code>stderr</code>
+ (<code>System.out</code> and <code>System.err</code>) output to <code>/dev/null</code>. In
+ processes that run the Dalvik VM, you can have the system write a copy of the output to the log
+ file. In this case, the system writes the messages to the log using the log tags
+ <code>stdout</code> and <code>stderr</code>, both with priority <code>I</code>.</p>
+
+ <p>To route the output in this way, you stop a running emulator/device instance and then use the
+ shell command <code>setprop</code> to enable the redirection of output. Here's how you do it:</p>
+ <pre>
+$ adb shell stop
+$ adb shell setprop log.redirect-stdio true
+$ adb shell start
+</pre>
+
+ <p>The system retains this setting until you terminate the emulator/device instance. To use the
+ setting as a default on the emulator/device instance, you can add an entry to
+ <code>/data/local.prop</code> on the device.</p>
+
+ <h2 id="DebuggingWebPages">Debugging Web Apps</h2>
+ <p>
+ If you're developing a web application for Android, you can debug your JavaScript using the console JavaScript APIs,
+ which output messages to LogCat. For more information, see
+ <a href="{@docRoot}guide/webapps/debugging.html">Debugging Web Apps</a>.</p>
diff --git a/docs/html/tools/debugging/debugging-projects-cmdline.jd b/docs/html/tools/debugging/debugging-projects-cmdline.jd
new file mode 100644
index 0000000..0b79575
--- /dev/null
+++ b/docs/html/tools/debugging/debugging-projects-cmdline.jd
@@ -0,0 +1,78 @@
+page.title=Debugging from Other IDEs
+parent.title=Debugging
+parent.link=index.html
+@jd:body
+
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#start-debugging">Starting a Debugging Environment</a>
+ <ul>
+ <li><a href="#debuggingPort">Configuring Your IDE to Attach to the Debugging Port</a></li>
+ </ul>
+ </li>
+ </ol>
+ </div>
+ </div>
+
+ <p>If you are not using Eclipse to develop, you can still take advantage of all the tools that
+ the Android SDK provides for debugging. A basic debugging environment consists of:</p>
+
+ <ul>
+ <li><a href="{@docRoot}tools/help/adb.html">ADB</a></li>
+
+ <li><a href="{@docRoot}tools/debugging/ddms.html">DDMS</a></li>
+
+ <li>Java Debugger</li>
+ </ul>
+
+ <p>You need to obtain a JDWP-compliant Java debugger to properly debug your application.
+ Most Java IDEs will already have one included, or you can use a command line debugger,
+ such as JDB, if you are using a simple text editor to develop applications.</p>
+
+ <h2 id="start-debugging">Starting a debugging environment</h2>
+ <p>A Java Debugger assists you in finding problems with
+ your code by letting you set breakpoints, step through execution of your application, and examine
+ variable values. Since you are not using Eclipse, you have to manually start up the debugging
+ environment yourself by running a few tools that are provided in the Android SDK. To begin
+ debugging your application, follow these general steps:</p>
+
+ <ol>
+ <li>Load an AVD with the Android emulator or connect a device to your computer.</li>
+
+ <li>Start DDMS from the sdk <code>/tools</code> directory. This also starts ADB if it is
+ not already started. You should see your device appear in DDMS.</li>
+
+ <li>Install and run your <code>.apk</code> file on the device or emulator. In DDMS, you should see your
+ application running under the device that you installed it to.</li>
+
+ <li>Attach your debugger to the debugging port 8700, or to the specific port shown for the
+ application in DDMS.</li>
+ </ol>
+
+ <h3 id="debuggingPort">Configuring Your IDE to Attach to the Debugging Port</h3>
+
+ <p>DDMS assigns a specific debugging port to every virtual machine that it finds on the
+ emulator. You must either attach your IDE to that port (listed on the Info tab for that VM), or
+ you can use a default port 8700 to connect to whatever application is currently selected on the
+ list of discovered virtual machines.</p>
+
+ <p>Your IDE should attach to your application running on the emulator, showing you its threads
+ and allowing you to suspend them, inspect their state, and set breakpoints. If you selected "Wait
+ for debugger" in the Development settings panel the application will run when Eclipse connects,
+ so you will need to set any breakpoints you want before connecting.</p>
+
+ <p>Changing either the application being debugged or the "Wait for debugger" option causes the
+ system to kill the selected application if it is currently running. You can use this to kill your
+ application if it is in a bad state by simply going to the settings and toggling the
+ checkbox.</p>
+
+
+
+
+
+
+
diff --git a/docs/html/guide/developing/debugging/debugging-projects.jd b/docs/html/tools/debugging/debugging-projects.jd
similarity index 100%
rename from docs/html/guide/developing/debugging/debugging-projects.jd
rename to docs/html/tools/debugging/debugging-projects.jd
diff --git a/docs/html/tools/debugging/debugging-tracing.jd b/docs/html/tools/debugging/debugging-tracing.jd
new file mode 100644
index 0000000..f0d0c0b
--- /dev/null
+++ b/docs/html/tools/debugging/debugging-tracing.jd
@@ -0,0 +1,402 @@
+page.title=Profiling with Traceview and dmtracedump
+parent.title=Debugging
+parent.link=index.html
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li>
+ <a href="#traceviewLayout">Traceview Layout</a>
+
+ <ol>
+ <li><a href="#timelinepanel">Timeline Panel</a></li>
+
+ <li><a href="#profilepanel">Profile Panel</a></li>
+ </ol>
+ </li>
+
+ <li>
+ <a href="#format">Traceview File Format</a>
+ <ol>
+ <li><a href="#datafileformat">Data File Format</a></li>
+
+ <li><a href="#keyfileformat">Key File Format</a></li>
+ </ol>
+ </li>
+
+ <li><a href="#creatingtracefiles">Creating Trace Files</a></li>
+
+ <li><a href="#copyingfiles">Copying Trace Files to a Host Machine</a></li>
+
+ <li><a href="#runningtraceview">Viewing Trace Files in Traceview</a></li>
+
+ <li><a href="#dmtracedump">Using dmtracedump</a></li>
+
+ <li><a href="#knownissues">Traceview Known Issues</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>Traceview is a graphical viewer for execution logs that you create by using the {@link
+ android.os.Debug} class to log tracing information in your code. Traceview can help you debug
+ your application and profile its performance.</p>
+
+ <h2 id="traceviewLayout">Traceview Layout</h2>
+
+ <p>When you have a trace log file (generated by adding tracing code to your application or by DDMS),
+ you can have Traceview load the log files and display their data in a window visualizes your application
+ in two panels:</p>
+
+ <ul>
+ <li>A <a href="#timelinepanel">timeline panel</a> -- describes when each thread and method
+ started and stopped</li>
+
+ <li>A <a href="#timelinepanel">profile panel</a> -- provides a summary of what happened inside
+ a method</li>
+ </ul>
+
+ <p>The sections below provide addition information about the traceview output panes.</p>
+
+ <h3 id="timelinepanel">Timeline Panel</h3>
+
+ <p>The image below shows a close up of the timeline panel. Each thread’s execution is shown
+ in its own row, with time increasing to the right. Each method is shown in another color (colors
+ are reused in a round-robin fashion starting with the methods that have the most inclusive time).
+ The thin lines underneath the first row show the extent (entry to exit) of all the calls to the
+ selected method. The method in this case is <code>LoadListener.nativeFinished()</code> and it was selected in
+ the profile view.</p>
+
+ <img src="{@docRoot}images/traceview_timeline.png"
+ alt="Traceview timeline panel"
+ width="893"
+ height="284" />
+ <p class="img-caption"><strong>Figure 1.</strong> The Traceview Timeline Panel</p>
+
+ <h3 id="profilepanel">Profile Panel</h3>
+
+ <p>Figure 2 shows the profile pane, a summary of all the time spent
+ in a method. The table shows both the inclusive and exclusive times (as well as the percentage of
+ the total time). Exclusive time is the time spent in the method. Inclusive time is the time spent
+ in the method plus the time spent in any called functions. We refer to calling methods as
+ "parents" and called methods as "children." When a method is selected (by clicking on it), it
+ expands to show the parents and children. Parents are shown with a purple background and children
+ with a yellow background. The last column in the table shows the number of calls to this method
+ plus the number of recursive calls. The last column shows the number of calls out of the total
+ number of calls made to that method. In this view, we can see that there were 14 calls to
+ <code>LoadListener.nativeFinished();</code> looking at the timeline panel shows that one of those calls took
+ an unusually long time.</p>
+
+ <img src="{@docRoot}images/traceview_profile.png"
+ alt="Traceview profile panel."
+ width="892"
+ height="630" />
+ <p class="img-caption"><strong>Figure 2.</strong> The Traceview Profile Panel</p>
+
+ <h2 id="format">Traceview File Format</h2>
+
+ <p>Tracing creates two distinct pieces of output: a <em>data</em> file, which holds the trace
+ data, and a <em>key</em> file, which provides a mapping from binary identifiers to thread and
+ method names. The files are concatenated when tracing completes, into a single <em>.trace</em>
+ file.</p>
+
+ <p class="note"><strong>Note:</strong> The previous version of Traceview did not concatenate
+ these files for you. If you have old key and data files that you'd still like to trace, you can
+ concatenate them yourself with <code>cat mytrace.key mytrace.data >
+ mytrace.trace</code>.</p>
+
+ <h3 id="datafileformat">Data File Format</h3>
+
+ <p>The data file is binary, structured as follows (all values are stored in little-endian
+ order):</p>
+ <pre>
+* File format:
+* header
+* record 0
+* record 1
+* ...
+*
+* Header format:
+* u4 magic 0x574f4c53 ('SLOW')
+* u2 version
+* u2 offset to data
+* u8 start date/time in usec
+*
+* Record format:
+* u1 thread ID
+* u4 method ID | method action
+* u4 time delta since start, in usec
+</pre>
+
+ <p>The application is expected to parse all of the header fields, then seek to "offset to data"
+ from the start of the file. From there it just reads 9-byte records until EOF is reached.</p>
+
+ <p><em>u8 start date/time in usec</em> is the output from <code>gettimeofday()</code>. It's mainly there so
+ that you can tell if the output was generated yesterday or three months ago.</p>
+
+ <p><em>method action</em> sits in the two least-significant bits of the <em>method</em> word. The
+ currently defined meanings are:</p>
+
+ <ul>
+ <li>0 - method entry</li>
+
+ <li>1 - method exit</li>
+
+ <li>2 - method "exited" when unrolled by exception handling</li>
+
+ <li>3 - (reserved)</li>
+ </ul>
+
+ <p>An unsigned 32-bit integer can hold about 70 minutes of time in microseconds.</p>
+
+ <h3 id="keyfileformat">Key File Format</h3>
+
+ <p>The key file is a plain text file divided into three sections. Each section starts with a
+ keyword that begins with '*'. If you see a '*' at the start of a line, you have found the start
+ of a new section.</p>
+
+ <p>An example file might look like this:</p>
+ <pre>
+*version
+1
+clock=global
+*threads
+1 main
+6 JDWP Handler
+5 Async GC
+4 Reference Handler
+3 Finalizer
+2 Signal Handler
+*methods
+0x080f23f8 java/io/PrintStream write ([BII)V
+0x080f25d4 java/io/PrintStream print (Ljava/lang/String;)V
+0x080f27f4 java/io/PrintStream println (Ljava/lang/String;)V
+0x080da620 java/lang/RuntimeException <init> ()V
+[...]
+0x080f630c android/os/Debug startMethodTracing ()V
+0x080f6350 android/os/Debug startMethodTracing (Ljava/lang/String;Ljava/lang/String;I)V
+*end
+</pre>
+<p>The following list describes the major sections of a key file:</p>
+ <dl>
+ <dt><em>version section</em></dt>
+
+ <dd>The first line is the file version number, currently 1. The second line,
+ <code>clock=global</code>, indicates that we use a common clock across all threads. A future
+ version may use per-thread CPU time counters that are independent for every thread.</dd>
+
+ <dt><em>threads section</em></dt>
+
+ <dd>One line per thread. Each line consists of two parts: the thread ID, followed by a tab,
+ followed by the thread name. There are few restrictions on what a valid thread name is, so
+ include everything to the end of the line.</dd>
+
+ <dt><em>methods section</em></dt>
+
+ <dd>One line per method entry or exit. A line consists of four pieces, separated by tab marks:
+ <em>method-ID</em> [TAB] <em>class-name</em> [TAB] <em>method-name</em> [TAB]
+ <em>signature</em> . Only the methods that were actually entered or exited are included in the
+ list. Note that all three identifiers are required to uniquely identify a method.</dd>
+ </dl>
+
+ <p>Neither the threads nor methods sections are sorted.</p>
+
+ <h2 id="creatingtracefiles">Creating Trace Files</h2>
+
+ <p>To use Traceview, you need to generate log files containing the trace information you want to
+ analyze.</p>
+
+ <p>There are two ways to generate trace logs:</p>
+ <ul>
+ <li>Include the {@link android.os.Debug} class in your code and call its
+ methods to start and stop logging of trace information to disk. This method is very precise because
+ you can specify in your code exactly where to start and stop logging trace data.</li>
+ <li>Use the method profiling feature of DDMS to generate trace logs. This method is less
+ precise since you do not modify code, but rather specify when to start and stop logging with
+ a DDMS. Although you have less control on exactly where the data is logged, this method is useful
+ if you don't have access to the application's code, or if you do not need the precision of the first method.
+ </li>
+ </ul>
+
+ <p>Before you start generating trace logs, be aware of the following restrictions:</p>
+ <ul>
+ <li>If you are using the {@link android.os.Debug} class, your device or emulator must have an SD card
+ and your application must have permission to write to the SD card. </li>
+ <li>If you are using DDMS, Android 1.5 devices are not supported.</li>
+ <li>If you are using DDMS, Android 2.1 and earlier devices must
+ have an SD card present and your application must have permission to write to the SD card.
+ <li>If you are using DDMS, Android 2.2 and later devices do not need an SD card. The trace log files are
+ streamed directly to your development machine.</li>
+ </ul>
+
+ <p>This document focuses on using the {@link android.os.Debug} class to generate trace data. For more information on using DDMS
+ to generate trace data, see <a href="ddms.html#profiling">Using the Dalvik Debug Monitor Server.</a>
+ </p>
+
+ <p>To create the trace files, include the {@link android.os.Debug} class and call one of the
+ {@link android.os.Debug#startMethodTracing() startMethodTracing()} methods. In the call, you
+ specify a base name for the trace files that the system generates. To stop tracing, call {@link
+ android.os.Debug#stopMethodTracing() stopMethodTracing()}. These methods start and stop method
+ tracing across the entire virtual machine. For example, you could call
+ {@link android.os.Debug#startMethodTracing() startMethodTracing()} in
+ your activity's {@link android.app.Activity#onCreate onCreate()} method, and call
+ {@link android.os.Debug#stopMethodTracing() stopMethodTracing()} in that activity's
+ {@link android.app.Activity#onDestroy()} method.</p>
+ <pre>
+ // start tracing to "/sdcard/calc.trace"
+ Debug.startMethodTracing("calc");
+ // ...
+ // stop tracing
+ Debug.stopMethodTracing();
+</pre>
+
+ <p>When your application calls startMethodTracing(), the system creates a file called
+ <code><trace-base-name>.trace</code>. This contains the binary method trace data and a
+ mapping table with thread and method names.</p>
+
+ <p>The system then begins buffering the generated trace data, until your application calls
+ stopMethodTracing(), at which time it writes the buffered data to the output file. If the system
+ reaches the maximum buffer size before stopMethodTracing() is called, the system stops tracing
+ and sends a notification to the console.</p>
+
+ <p>Interpreted code will run more slowly when profiling is enabled. Don't try to generate
+ absolute timings from the profiler results (i.e. "function X takes 2.5 seconds to run"). The
+ times are only useful in relation to other profile output, so you can see if changes have made
+ the code faster or slower.</p>
+
+ <p>When using the Android emulator, you must specify an SD card when you create your AVD because the trace files
+ are written to the SD card. Your application must have permission to write to the SD card as well.
+
+ <p>The format of the trace files is previously described <a href="#format">in this
+ document</a>.</p>
+
+ <h2 id="copyingfiles">Copying Trace Files to a Host Machine</h2>
+
+ <p>After your application has run and the system has created your trace files
+ <code><trace-base-name>.trace</code> on a device or emulator, you must copy those files to
+ your development computer. You can use <code>adb pull</code> to copy the files. Here's an example
+ that shows how to copy an example file, calc.trace, from the default location on the emulator to
+ the /tmp directory on the emulator host machine:</p>
+ <pre>
+adb pull /sdcard/calc.trace /tmp
+</pre>
+
+ <h2 id="runningtraceview">Viewing Trace Files in Traceview</h2>
+
+ <p>To run Traceview and view the trace files, enter <code>traceview
+ <trace-base-name></code>. For example, to run Traceview on the example files copied in the
+ previous section, use:</p>
+ <pre>
+traceview /tmp/calc
+</pre>
+
+ <p class="note"><strong>Note:</strong> If you are trying to view the trace logs of an application
+ that is built with ProGuard enabled (release mode build), some method and member names might be obfuscated.
+ You can use the Proguard <code>mapping.txt</code> file to figure out the original unobfuscated names. For more information
+ on this file, see the <a href="{@docRoot}tools/help/proguard.html">Proguard</a> documentation.</p>
+
+ <h2 id="dmtracedump">Using dmtracdedump</h2>
+
+ <p><code>dmtracedump</code> is a tool that gives you an alternate way of generating
+ graphical call-stack diagrams from trace log files. The tool uses the Graphviz Dot utility to
+ create the graphical output, so you need to install Graphviz before running dmtracedump.</p>
+
+ <p>The dmtracedump tool generates the call stack data as a tree diagram, with each call
+ represented as a node. It shows call flow (from parent node to child nodes) using arrows. The
+ diagram below shows an example of dmtracedump output.</p>
+ <img src=
+ "{@docRoot}images/tracedump.png"
+ width="485"
+ height="401" />
+ <p class="image-caption"><strong>Figure 3.</strong> Screenshot of dmtracedump</p>
+
+ <p>For each node, dmtracedump shows <code><ref>
+ <em>callname</em> (<inc-ms>, <exc-ms>,<numcalls>)</code>, where</p>
+
+ <ul>
+ <li><code><ref></code> -- Call reference number, as used in trace logs</li>
+
+ <li><code><inc-ms></code> -- Inclusive elapsed time (milliseconds spent in method,
+ including all child methods)</li>
+
+ <li><code><exc-ms></code> -- Exclusive elapsed time (milliseconds spent in method,
+ not including any child methods)</li>
+
+ <li><code><numcalls></code> -- Number of calls</li>
+ </ul>
+
+ <p>The usage for dmtracedump is:</p>
+ <pre>
+dmtracedump [-ho] [-s sortable] [-d trace-base-name] [-g outfile] <trace-base-name>
+</pre>
+
+ <p>The tool then loads trace log data from <code><trace-base-name>.data</code> and
+ <code><trace-base-name>.key</code>. The table below lists the options for dmtracedump.</p>
+
+ <table>
+ <tr>
+ <th>Option</th>
+
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><code>-d <trace-base-name></code></td>
+
+ <td>Diff with this trace name</td>
+ </tr>
+
+ <tr>
+ <td><code>-g <outfile></code></td>
+
+ <td>Generate output to <outfile></td>
+ </tr>
+
+ <tr>
+ <td><code>-h</code></td>
+
+ <td>Turn on HTML output</td>
+ </tr>
+
+ <tr>
+ <td><code>-o</code></td>
+
+ <td>Dump the trace file instead of profiling</td>
+ </tr>
+
+ <tr>
+ <td><code>-d <trace-base-name></code></td>
+
+ <td>URL base to the location of the sortable javascript file</td>
+ </tr>
+
+ <tr>
+ <td><code>-t <percent></code></td>
+
+ <td>Minimum threshold for including child nodes in the graph (child's inclusive time as a
+ percentage of parent inclusive time). If this option is not used, the default threshold
+ is 20%.</td>
+ </tr>
+ </table>
+
+
+
+ <h2 id="knownissues">Traceview Known Issues</h2>
+
+ <dl>
+ <dt>Threads</dt>
+
+ <dd>
+ Traceview logging does not handle threads well, resulting in these two problems:
+
+ <ol>
+ <li>If a thread exits during profiling, the thread name is not emitted;</li>
+
+ <li>The VM reuses thread IDs. If a thread stops and another starts, they may get the same
+ ID.</li>
+ </ol>
+ </dd>
+
+ </dl>
\ No newline at end of file
diff --git a/docs/html/tools/debugging/debugging-ui.jd b/docs/html/tools/debugging/debugging-ui.jd
new file mode 100644
index 0000000..c1976b8
--- /dev/null
+++ b/docs/html/tools/debugging/debugging-ui.jd
@@ -0,0 +1,547 @@
+page.title=Optimizing Your UI
+parent.title=Debugging
+parent.link=index.html
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li>
+ <a href="#HierarchyViewer">
+ Using Hierarchy Viewer
+ </a>
+ <ol>
+ <li><a href="#runhv">Running Hierarchy Viewer and choosing a window</a></li>
+ <li><a href="#viewhierarchy">About the View Hierarchy window</a></li>
+ <li><a href="#indiView">Working with an individual View in Tree View</a></li>
+ <li><a href="#hvdebugging">Debugging with View Hierarchy</a></li>
+ <li><a href="#hvoptimize">Optimizing with View Hierarchy</a></li>
+ </ol>
+ </li>
+ <li>
+ <a href="#pixelperfect">
+ Using Pixel Perfect
+ </a>
+ <ol>
+ <li><a href="#aboutpixelperfect">About the Pixel Perfect window</a></li>
+ <li><a href="#overlays">Working with Pixel Perfect overlays</a></li>
+ </ol>
+ </li>
+ <li><a href="#layoutopt">Using layoutopt</a></li>
+ </ol>
+ <h2>Related videos</h2>
+ <ol>
+ <li>
+<iframe title="Hierarchyviewer"
+ width="210" height="160"
+ src="http://www.youtube.com/embed/PAgE7saQUUY?rel=0&hd=1"
+ frameborder="0" allowfullscreen>
+</iframe>
+ </li>
+ <li>
+<iframe title="Pixel Perfect"
+ width="210" height="160"
+ src="http://www.youtube.com/embed/C45bMZGdN7Y?rel=0&hd=1"
+ frameborder="0"
+ allowfullscreen>
+</iframe>
+ </li>
+ </ol>
+ </div>
+ </div>
+
+ <p>
+Sometimes your application's layout can slow down your application.
+ To help debug issues in your layout, the Android SDK provides the Hierarchy Viewer and
+ <code>layoutopt</code> tools.
+ </p>
+
+ <p>The Hierarchy Viewer application allows you to debug and optimize your user interface. It
+ provides a visual representation of the layout's View hierarchy (the View Hierarchy window)
+ and a magnified view of the display (the Pixel Perfect window).</p>
+
+ <p><code>layoutopt</code> is a command-line tool that helps you optimize the layouts and layout
+ hierarchies of your applications. You can run it against your layout files or resource
+ directories to quickly check for inefficiencies or other types of problems that could be
+ affecting the performance of your application.</p>
+
+<h2 id="HierarchyViewer">Using Hierarchy Viewer</h2>
+
+<h3 id="runhv">Running Hierarchy Viewer and choosing a window</h3>
+<p>
+ To run Hierarchy Viewer, follow these steps:</p>
+<ol>
+ <li>
+ Connect your device or launch an emulator.
+ <p>
+ To preserve security, Hierarchy Viewer can only connect to devices running a
+ developer version of the Android system.
+ </p>
+ </li>
+ <li>
+ If you have not done so already, install the application you want to work with.
+ </li>
+ <li>
+ Run the application, and ensure that its UI is visible.
+ </li>
+ <li>
+ From a terminal, launch <code>hierarchyviewer</code> from the
+ <code><sdk>/tools/</code>
+ directory.
+ </li>
+ <li>
+ The first window you see displays a list of devices and emulators. To expand the list
+ of Activity objects for a device or emulator, click the arrow on the left. This displays a
+ list of the Activity objects whose UI is currently visible on the device or emulator. The
+ objects are listed by their Android component name. The list includes both your application
+ Activity and system Activity objects. A screenshot of this window appears in
+ figure 1.
+ </li>
+ <li>
+ Select the name of your Activity from the list. You can now look at its view
+ hierarchy using the View Hierarchy window, or look at a magnified image of the UI using
+ the Pixel Perfect window.
+ </li>
+</ol>
+<p>
+ To learn how to use the View Hierarchy window, go to
+ <a href="#viewhierarchy">About the View Hierarchy window</a>. To learn how to use the
+ Pixel Perfect window, go to <a href="#pixelperfect">About the Pixel Perfect window</a>.
+</p>
+<img id="Fig1" src="{@docRoot}images/developing/hv_device_window.png" alt="" height="600"/>
+<p class="img-caption"><strong>Figure 1.</strong> Hierarchy Viewer device window</p>
+<h3 id="viewhierarchy">About the View Hierarchy window</h3>
+<p>
+ The View Hierarchy window displays the View objects that form the UI of the
+ Activity that is running on your device or emulator. You use it to look at individual
+ View objects within the context of the entire View tree. For each View object, the View
+ Hierarchy window also displays rendering performance data.
+</p>
+<p>
+ To see the View Hierarchy window, run Hierarchy Viewer as described in
+ the section <a href="#runhv">Running Hierarchy Viewer and choosing a window</a>. Next, click
+ <strong>View Hierarchy</strong> at the top of the device window.
+</p>
+<p>
+ You should see four panes:
+</p>
+<ul>
+ <li>
+ <strong>Tree View</strong>: The left-hand pane displays the Tree View,
+ a diagram of the Activity object's hierarchy of views. Use Tree View to examine individual
+ View objects and see the relationships between View objects in your UI.
+ <p>
+ To zoom in on the pane, use the slider at the bottom of the pane, or use your mouse
+ scroll wheel. To move around in the pane or reveal View objects that are not currently
+ visible, click and drag the pane.
+ </p>
+ <p>
+ To highlight the nodes in the tree whose class or ID match a search string, enter the
+ string in the <strong>Filter by class or id:</strong> edit box at the bottom of the
+ window. The background of nodes that match the search string will change from gray to
+ bright blue.
+ </p>
+ <p>
+ To save a screenshot of Tree View to a PNG file, click <strong>Save As PNG</strong> at
+ the top of the View Hierarchy window. This displays a dialog in which you can choose
+ a directory and file name.
+ </p>
+ <p>
+ To save a layered screenshot of your device or emulator to an Adobe Photoshop (PSD)
+ file, click <strong>Capture Layers</strong> at the top of the View Hierarchy window.
+ This displays a dialog in which you can choose a directory or file name.
+ Each View in the UI is saved as a separate Photoshop layer.
+ </p>
+ <p>
+ In Photoshop (or similar program that accepts .psd files), you can hide, show or edit a
+ layer independently of others. When you save a layered screenshot, you can examine and
+ modify the image of an individual View object. This helps you experiment with design
+ changes.
+ </p>
+ </li>
+ <li>
+ The upper right-hand pane displays the <strong>Tree Overview</strong>, a smaller map
+ representation of the entire Tree View window. Use Tree Overview to identify the part of the
+ view tree that is being displayed in Tree View.
+ <p>
+ You can also use Tree Overview to move around in the Tree View pane. Click and drag
+ the shaded rectangle over an area to reveal it in Tree View.
+ </p>
+ </li>
+ <li>
+ The middle right-hand pane displays the <strong>Properties View</strong>,
+ a list of the properties for a selected View object. With Properties View, you can
+ examine all the properties without having to look at your application source.
+ <p>
+ The properties are organized by category. To find an individual property, expand
+ a category name by clicking the arrow on its left. This reveals all the properties
+ in that category.
+ </p>
+ </li>
+ <li>
+ The lower right-hand pane displays the <strong>Layout View</strong>,
+ a block representation of the UI. Layout View is another way to navigate through your UI.
+ When you click on a View object in Tree View, its position in the UI is highlighted.
+ Conversely, when you click in an area of Layout View, the View object for that area is
+ highlighted in Tree View.
+ <p>
+ The outline colors of blocks in Layout View provide additional information:
+ </p>
+ <ul>
+ <li>
+ Bold red: The block represents the the View that is currently selected in
+ Tree View.
+ </li>
+ <li>
+ Light red: The block represents the parent of the block outlined in bold red.
+ </li>
+ <li>
+ White: The block represents a visible View that is not a parent or child of the
+ View that is currently selected in Tree View.
+ </li>
+ </ul>
+ </li>
+</ul>
+<p>
+ When the UI of the current Activity changes, the View Hierarchy window is not automatically
+ updated. To update it, click <strong>Load View Hierarchy</strong> at the top of the window.
+</p>
+<p>
+ Also, the window is not updated if you switch to a new Activity. To update it, start by
+ clicking the window selection icon in the bottom left-hand corner of the window. This
+ navigates back to the Window Selection window. From this window, click the Android
+ component name of the new Activity and then click <strong>Load View Hierarchy</strong>
+ at the top of the window.
+</p>
+<p>
+ A screenshot of the View Hierarchy window appears in figure 2.
+</p>
+<img id="Fig2" src="{@docRoot}images/developing/hv_view_hierarchy_window.png" alt="" height="600"/>
+<p class="img-caption"><strong>Figure 2.</strong> The View Hierarchy window</p>
+<h3 id="indiView">Working with an individual View in Tree View</h3>
+<p>
+ Each node in Tree View represents a single View. Some information is always visible. Starting
+ at the top of the node, you see the following:
+</p>
+<ol>
+ <li>
+ View class: The View object's class.
+ </li>
+ <li>
+ View object address: A pointer to View object.
+ </li>
+ <li>
+ View object ID: The value of the
+ <code><a href="{@docRoot}guide/topics/resources/layout-resource.html#idvalue">android:id</a>
+ </code> attribute.
+ </li>
+ <li>
+ Performance indicators: A set of three colored dots that indicate the rendering
+ speed of this View relative to other View objects in the tree. The three dots
+ represent (from left to right) the measure, layout, and draw times of the rendering.
+ <p>
+ The colors indicate the following relative performance:
+ </p>
+ <ul>
+ <li>
+ Green: For this part of the render time, this View is in the faster 50% of all
+ the View objects in the tree. For example, a green dot for the measure time means
+ that this View has a faster measure time than 50% of the View objects in the tree.
+ </li>
+ <li>
+ Yellow: For this part of the render time, this View is in the slower 50% of all
+ the View objects in the tree. For example, a yellow dot for the layout time means
+ that this View has a slower layout time than 50% of the View objects in the tree.
+ </li>
+ <li>
+ Red: For this part of the render time, this View is the slowest one in the tree.
+ For example, a red dot for the draw time means that this View takes the most
+ time to draw of all the View objects in the tree.
+ </li>
+ </ul>
+ </li>
+ <li>
+ View index: The zero-based index of the View in its parent View. If it is the only child,
+ this is 0.
+ </li>
+</ol>
+<p>
+ When you select a node, additional information for the View appears in a small window above
+ the node. When you click one of the nodes, you see the following:
+</p>
+<ul>
+ <li>
+ Image: The actual image of the View, as it would appear in the emulator. If the View has
+ children, these are also displayed.
+ </li>
+ <li>
+ View count: The number of View objects represented by this node. This includes the View
+ itself and a count of its children. For example, this value is 4 for a View that has 3
+ children.
+ </li>
+ <li>
+ Render times: The actual measure, layout, and draw times for the View rendering, in
+ milliseconds. These represent the same values as the performance indicators mentioned in
+ the preceding section.
+ </li>
+</ul>
+<p>
+ An annotated screenshot of an individual node in the Tree View window appears in figure 3.
+</p>
+<img id="Fig3" src="{@docRoot}images/developing/hv_treeview_screenshot.png" alt="" height="600"/>
+<p class="img-caption"><strong>Figure 3.</strong> An annotated node in Tree View</p>
+<h3 id="hvdebugging">Debugging with View Hierarchy</h3>
+<p>
+ The View Hierarchy window helps you debug an application by providing a static display
+ of the UI. The display starts with your application's opening screen. As you step through
+ your application, the display remains unchanged until you redraw it by invalidating and
+ then requesting layout for a View.
+</p>
+<p>
+ To redraw a View in the display:
+</p>
+ <ul>
+ <li>
+ Select a View in Tree View. As you move up towards the root of the tree (to the
+ left in the Tree View), you see the highest-level View objects. Redrawing a high-level
+ object usually forces the lower-level objects to redraw as well.
+ </li>
+ <li>
+ Click <strong>Invalidate</strong> at the top of the window. This marks the View as
+ invalid, and schedules it for a redraw at the next point that a layout is requested.
+ </li>
+ <li>
+ Click <strong>Request Layout</strong> to request a layout. The View and its children
+ are redrawn, as well as any other View objects that need to be redrawn.
+ </li>
+ </ul>
+<p>
+ Manually redrawing a View allows you to watch the View object tree and examine the properties of
+ individual View objects one step at a time as you go through breakpoints in your code.
+</p>
+<h3 id="hvoptimize">Optimizing with View Hierarchy</h3>
+<p>
+ View Hierarchy also helps you identify slow render performance. You start by looking at the
+ View nodes with red or yellow performance indicators to identify the slower View objects. As you
+ step through your application, you can judge if a View is consistently slow or slow only in
+ certain circumstances.
+</p>
+<p>
+ Remember that slow performance is not necessarily evidence of a problem, especially for
+ ViewGroup objects. View objects that have more children and more complex View objects render
+ more slowly.
+</p>
+<p>
+ The View Hierarchy window also helps you find performance issues. Just by looking at the
+ performance indicators (the dots) for each View node, you can see which View objects are the
+ slowest to measure, layout, and draw. From that, you can quickly identify the problems you
+ should look at first.
+</p>
+<h2 id="pixelperfect">Using Pixel Perfect</h2>
+<p>
+ Pixel Perfect is a tool for examining pixel properties and laying out UIs from a design drawing.
+</p>
+<h3 id="aboutpixelperfect">About the Pixel Perfect window</h3>
+<p>
+ The Pixel Perfect window displays a magnified image of the screen that is currently
+ visible on the emulator or device. In it, you can examine the properties
+ of individual pixels in the screen image. You can also use the Pixel Perfect window
+ to help you lay out your application UI based on a bitmap design.
+</p>
+<p>
+ To see the Pixel Perfect window, run Hierarchy Viewer, as described in
+ the section <a href="#runhv">Running Hierarchy Viewer and choosing a window</a>. Next, click
+ <strong>Inspect Screenshot</strong> at the top of the device window. The Pixel Perfect window
+ appears.
+</p>
+<p>
+ In it, you see three panes:
+</p>
+<ul>
+ <li>
+ View Object pane: This is a hierarchical list of the View objects that are currently
+ visible on the device or emulator screen, including both the ones in your application and
+ the ones generated by the system. The objects are listed by their View class.
+ To see the class names of a View object's children, expand the View by clicking the
+ arrow to its left. When you click a View, its position is highlighted in the Pixel Perfect
+ pane on the right.
+ </li>
+ <li>
+ Pixel Perfect Loupe pane: This is the magnified screen image. It is overlaid by a grid in
+ which each square represents one pixel. To look at the information for a pixel, click in its
+ square. Its color and X,Y coordinates appear at the bottom of the pane.
+ <p>
+ The magenta crosshair in the pane corresponds to the positioning
+ crosshair in the next pane. It only moves when you move the crosshair in the next pane.
+ </p>
+ <p>
+ To zoom in or out on the image, use the <strong>Zoom</strong> slider at the bottom of
+ the pane, or use your mouse's scroll wheel.
+ </p>
+ <p>
+ When you select a pixel in the Loupe pane, you see the following information at the
+ bottom of the pane:
+ </p>
+ <ul>
+ <li>
+ Pixel swatch: A rectangle filled with the same color as the pixel.
+ </li>
+ <li>
+ HTML color code: The hexadecimal RGB code corresponding to the pixel color
+ </li>
+ <li>
+ RGB color values: A list of the (R), green (G), and blue (B) color values of the
+ pixel color. Each value is in the range 0-255.
+ </li>
+ <li>
+ X and Y coordinates: The pixel's coordinates, in device-specific pixel units.
+ The values are 0-based, with X=0 at the left of the screen and Y=0 at the top.
+ </li>
+ </ul>
+ </li>
+ <li>
+ Pixel Perfect pane: This displays the currently visible screen as it would appear in the
+ emulator.
+ <p>
+ You use the cyan crosshair to do coarse positioning. Drag the crosshair in the image,
+ and the Loupe crosshair will move accordingly. You can also click on a point in the
+ Pixel Perfect pane, and the crosshair will move to that point.
+ </p>
+ <p>
+ The image corresponding to the View object selected in the View Object pane is
+ outlined in a box that indicates the View object's position on the screen. For the
+ selected object, the box is bold red. Sibling and parent View objects have a light
+ red box. View objects that are neither parents nor siblings are in white.
+ </p>
+ <p>
+ The layout box may have other rectangles either inside or outside it, each of which
+ indicates part of the View. A purple or green rectangle indicates the View bounding box.
+ A white or black box inside the layout box represents the <strong>padding</strong>, the
+ defined distance between the View object's content and its bounding box. An outer white
+ or black rectangle represents the <strong>margins</strong>, the distance between the
+ View bounding box and adjacent View objects. The padding and margin boxes are white if
+ the layout background is black, and vice versa.
+ </p>
+ <p>
+ You can save the screen image being displayed in the Pixel Perfect pane as a PNG file.
+ This produces a screenshot of the current screen. To do this, click
+ <strong>Save as PNG</strong> at the top of the window. This displays a dialog,
+ in which you can choose a directory and filename for the file.
+ </p>
+ </li>
+</ul>
+<p>
+ The panes are not automatically refreshed when you change one of the View objects or go to
+ another Activity. To refresh the Pixel Perfect pane and the Loupe pane, click
+ <strong>Refresh Screenshot</strong> at the top of the window. This will change the panes
+ to reflect the current screen image. You still may need to refresh the View Object pane;
+ to do this, click <strong>Refresh Tree</strong> at the top of the window.
+</p>
+<p>
+ To automatically refresh the panes while you are debugging, set
+ <strong>Auto Refresh</strong> at the top of the window, and then set a refresh rate
+ with the <strong>Refresh Rate</strong> slider at the bottom of the Loupe pane.
+</p>
+<h3 id="overlays">Working with Pixel Perfect overlays</h3>
+<p>
+ You often construct a UI based on a design done as a bitmap image. The Pixel Perfect window
+ helps you match up your View layout to a bitmap image by allowing you to load the bitmap as an
+ <strong>overlay</strong> on the screen image.
+</p>
+<p>
+ To use a bitmap image as an overlay:
+</p>
+<ul>
+ <li>
+ Start your application in a device or emulator and navigate to the Activity whose UI you
+ want to work with.
+ </li>
+ <li>
+ Start Hierarchy Viewer and navigate to the Pixel Perfect window.
+ </li>
+ <li>
+ At the top of the window, click <strong>Load Overlay</strong>. A dialog opens, prompting
+ for the image file to load. Load the image file.
+ </li>
+ <li>
+ Pixel Perfect displays the overlay over the screen image in the Pixel Perfect pane. The
+ lower left corner of the bitmap image (X=0, Y=<em>max value</em>) is anchored on the lower
+ leftmost pixel (X=0, Y=<em>max screen</em>) of the screen.
+ <p>
+ By default, the overlay has a 50% transparency, which allows you to see the screen
+ image underneath. You can adjust this with the <strong>Overlay:</strong> slider at the
+ bottom of the Loupe pane.
+ </p>
+ <p>
+ Also by default, the overlay is not displayed in the Loupe pane. To display it,
+ set <strong>Show in Loupe</strong> at the top of the window.
+ </p>
+ </li>
+</ul>
+<p>
+ The overlay is not saved as part of the screenshot when you save the screen image as a PNG
+ file.
+</p>
+<p>
+ A screenshot of the Pixel Perfect window appears in figure 4.
+</p>
+<img id="Fig4" src="{@docRoot}images/developing/hv_pixelperfect.png"
+ alt=""
+ height="600"/>
+<p class="img-caption"><strong>Figure 4.</strong> The Pixel Perfect window</p>
+<h2 id="layoutopt">Using layoutopt</h2>
+<p>
+ The <code>layoutopt</code> tool lets you analyze the XML files that define your
+ application's UI to find inefficiencies in the view hierarchy.</p>
+
+<p>
+ To run the tool, open a terminal and launch <code>layoutopt <xmlfiles></code>
+ from your SDK <code>tools/</code> directory. The <xmlfiles> argument is a space-
+ delimited list of resources you want to analyze, either uncompiled resource xml files or
+ directories of such files.
+</p>
+<p>
+ The tool loads the specified XML files and analyzes their definitions and
+ hierarchies according to a set of predefined rules. For every issue it detects, it
+ displays the following information:
+</p>
+<ul>
+ <li>
+ The filename in which the issue was detected.
+ </li>
+ <li>
+ The line number for the issue.
+ </li>
+ <li>
+ A description of the issue, and for some types of issues it also suggests a resolution.
+ </li>
+</ul>
+<p>The following is a sample of the output from the tool:</p>
+<pre>
+$ layoutopt samples/
+samples/compound.xml
+ 7:23 The root-level <FrameLayout/> can be replaced with <merge/>
+ 11:21 This LinearLayout layout or its FrameLayout parent is useless
+samples/simple.xml
+ 7:7 The root-level <FrameLayout/> can be replaced with <merge/>
+samples/too_deep.xml
+ -1:-1 This layout has too many nested layouts: 13 levels, it should have <= 10!
+ 20:81 This LinearLayout layout or its LinearLayout parent is useless
+ 24:79 This LinearLayout layout or its LinearLayout parent is useless
+ 28:77 This LinearLayout layout or its LinearLayout parent is useless
+ 32:75 This LinearLayout layout or its LinearLayout parent is useless
+ 36:73 This LinearLayout layout or its LinearLayout parent is useless
+ 40:71 This LinearLayout layout or its LinearLayout parent is useless
+ 44:69 This LinearLayout layout or its LinearLayout parent is useless
+ 48:67 This LinearLayout layout or its LinearLayout parent is useless
+ 52:65 This LinearLayout layout or its LinearLayout parent is useless
+ 56:63 This LinearLayout layout or its LinearLayout parent is useless
+samples/too_many.xml
+ 7:413 The root-level <FrameLayout/> can be replaced with <merge/>
+ -1:-1 This layout has too many views: 81 views, it should have <= 80!
+samples/useless.xml
+ 7:19 The root-level <FrameLayout/> can be replaced with <merge/>
+ 11:17 This LinearLayout layout or its FrameLayout parent is useless
+</pre>
diff --git a/docs/html/tools/debugging/index.jd b/docs/html/tools/debugging/index.jd
new file mode 100644
index 0000000..45fbc9e
--- /dev/null
+++ b/docs/html/tools/debugging/index.jd
@@ -0,0 +1,186 @@
+page.title=Debugging
+@jd:body
+
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#stack">Debugging Environment</a></li>
+
+ <li><a href="#addltools">Additional Debugging Tools</a></li>
+
+ <li><a href="#tips">Debugging Tips</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>The Android SDK provides most of the tools that you need to debug your applications. You need
+ a JDWP-compliant debugger if you want to be able to do things such as step through code,
+ view variable values, and pause execution of an application. If you are using Eclipse, a
+ JDWP-compliant debugger is already included and there is no setup required. If you are using
+ another IDE, you can use the debugger that comes with it and attach the debugger to a special
+ port so it can communicate with the application VMs on your devices. The main components that
+ comprise a typical Android debugging environment are:</p>
+
+ <dl>
+ <dt><a href="{@docRoot}tools/help/adb.html"><strong>adb</strong></a></dt>
+
+ <dd><code>adb</code> acts as a middleman between a device and your development system. It provides various
+ device management capabilities, including moving and syncing files to the emulator, running a
+ UNIX shell on the device or emulator, and providing a general means to communicate with
+ connected emulators and devices.</dd>
+
+ <dt><a href="{@docRoot}tools/debugging/ddms.html"><strong>Dalvik Debug Monitor
+ Server</strong></a></dt>
+
+ <dd>DDMS is a graphical program that communicates with your devices through <code>adb</code>. DDMS can
+ capture screenshots, gather thread and stack information, spoof incoming calls and SMS
+ messages, and has many other features.</dd>
+
+ <dt><strong><a href="{@docRoot}tools/device.html">Device</a> or
+ <a href="{@docRoot}tools/devices/index.html">Android Virtual Device</a></strong></dt>
+
+ <dd>Your application must run in a device or in an AVD so that it can be debugged. An <code>adb</code> device
+ daemon runs on the device or emulator and provides a means for the <code>adb</code> host daemon to
+ communicate with the device or emulator.</dd>
+
+ <dt><strong>JDWP debugger</strong></dt>
+
+ <dd>The Dalvik VM (Virtual Machine) supports the JDWP protocol to allow debuggers to attach to
+ a VM. Each application runs in a VM and exposes a unique port that you can attach a debugger to
+ via DDMS. If you want to debug multiple applications, attaching to each port might become
+ tedious, so DDMS provides a port forwarding feature that can forward a specific VM's debugging
+ port to port 8700. You can switch freely from application to application by highlighting it in the
+ Devices tab of DDMS. DDMS forwards the appropriate port to port 8700. Most modern Java IDEs include a JDWP debugger,
+ or you can use a command line debugger such as <a href="http://download.oracle.com/javase/6/docs/technotes/tools/">
+ <code>jdb</code></a>.</dd>
+ </dl>
+
+ <h2>Debugging Environment</h2>
+
+ <p>Figure 1 shows how the various debugging tools work together in a typical
+ debugging environment.</p>
+ <img src="{@docRoot}images/debugging.png"
+ alt="Debugging workflow" />
+ <p class="img-caption><strong>Figure 1. </strong> Debugging Workflow</p>
+
+ <p>On your emulator or device, each application runs in its own instance of a Dalvik VM. The <code>adb</code>
+ device daemon allows communication with the VMs from an outside party.</p>
+
+ <p>On your development machine, the <code>adb</code> host daemon communicates with the <code>adb</code> device daemon and
+ allows tools such as DDMS to communicate with the device or emulator. The <code>adb</code> host daemon also
+ allows you to access shell commands on the device as well as providing capabilities such as
+ application installation and file transferring.</p>
+
+ <p>Each application VM on the device or emulator exposes a debugging port that you can attach to
+ via DDMS. DDMS can forward any of these ports to a static debugging port (typically port 8700) by
+ selecting the application that you want to debug in the DDMS user interface. A JDWP debugger can
+ attach to this static debugging port and debug all the applications that are running on the
+ device or emulator without having to attach to multiple ports.</p>
+
+ <p>If you are using Eclipse, much of these interconnections are hidden from you. DDMS, <code>adb</code>, and a
+ JDWP debugger are all setup for you and you can access them through the Debug and DDMS
+ perspectives in Eclipse. If you are developing in a non-Eclipse environment, you have to invoke
+ these tools manually.</p>
+
+ <h2 id="addltools">Additional Debugging Tools</h2>
+
+ <p>In addition to the main debugging tools, the Android SDK provides additional tools to help you
+ debug and profile your applications:</p>
+
+ <dl>
+ <dt><strong><a href="{@docRoot}tools/debugging/debugging-ui.html">Heirarchy Viewer
+ and layoutopt</a></strong></dt>
+
+ <dd>Graphical programs that let you debug and profile user interfaces.</dd>
+
+ <dt><strong><a href=
+ "{@docRoot}tools/debugging/debugging-tracing.html">Traceview</a></strong></dt>
+
+ <dd>A graphical viewer that displays trace file data for method calls and times saved by your
+ application, which can help you profile the performance of your application.</dd>
+
+ <dt><strong><a href="{@docRoot}tools/debugging/debugging-devtools.html">Dev Tools
+ Android application</a></strong></dt>
+
+ <dd>The Dev Tools application included in the emulator system image exposes several settings
+ that provide useful information such as CPU usage and frame rate. You can also transfer the
+ application to a hardware device.</dd>
+ </dl>
+
+
+ <h2 id="tips">Debugging Tips</h2>
+
+<p>While debugging, keep these helpful tips in mind to help you figure out common problems with your
+applications:</p>
+
+<dl>
+<dt><strong>Dump the stack trace</strong></dt>
+<dd>To obtain a stack dump from emulator, you can log
+in with <code>adb shell</code>, use <code>ps</code> to find the process you
+want, and then <code>kill -3</code>. The stack trace appears in the log file.
+</dd>
+
+<dt><strong>Display useful info on the emulator screen</strong></dt>
+<dd>The device can display useful information such as CPU usage or highlights
+around redrawn areas. Turn these features on and off in the developer settings
+window as described in <a href="{@docRoot}tools/debugging/debugging-devtools.html">
+Debugging with the Dev Tools App</a>.
+</dd>
+
+<dt><strong>Get application and system state information from the emulator</strong></dt>
+<dd>You can access dumpstate information from the <code>adb shell</code> commands. See
+<a href="{@docRoot}tools/help/adb.html#dumpsys">dumpsys and
+dumpstate</a> on the adb topic page.</dd>
+
+
+
+<dt><strong>Get wireless connectivity information</strong></dt>
+<dd>You can get information about wireless connectivity using DDMS.
+From the <strong>Device</strong> menu, select <strong>Dump
+radio state</strong>.</dd>
+
+<dt><strong>Log trace data</strong></dt>
+<dd>You can log method calls and other tracing data in an activity by calling
+{@link android.os.Debug#startMethodTracing(String) startMethodTracing()}. See <a
+href="{@docRoot}tools/debugging/debugging-tracing.html">Profiling with Traceview and
+dmtracedump</a> for details. </dd>
+
+<dt><strong>Log radio data</strong></dt>
+<dd>By default, radio information is not logged to the system (it is a lot of
+data). However, you can enable radio logging using the following commands:
+
+<pre class="no-pretty-print">
+adb shell
+logcat -b radio
+</pre>
+</dd>
+
+<dt><strong>Capture screenshots</strong></dt>
+<dd>The Dalvik Debug Monitor Server (DDMS) can capture screenshots from the emulator. Select
+<strong>Device > Screen capture</strong>.</dd>
+
+<dt><strong>Use debugging helper classes</strong></dt>
+<dd>Android provides debug helper classes such as {@link android.util.Log
+ util.Log} and {@link android.os.Debug} for your convenience. </dd>
+
+<dt><strong>Garbage collection</strong></dt>
+<dd>
+The debugger and garbage collector are currently loosely integrated. The VM guarantees that any
+object the debugger is aware of is not garbage collected until after the debugger disconnects.
+This can result in a buildup of objects over time while the debugger is connected. For example,
+if the debugger sees a running thread, the associated {@link java.lang.Thread} object is not
+garbage collected even after the thread terminates.
+</dd>
+
+</dl>
+
+
+
+
+
+
+
+
diff --git a/docs/html/tools/device.jd b/docs/html/tools/device.jd
new file mode 100644
index 0000000..d5fd581
--- /dev/null
+++ b/docs/html/tools/device.jd
@@ -0,0 +1,267 @@
+page.title=Using Hardware Devices
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#setting-up">Setting up a Device for Development</a>
+ <ol>
+ <li><a href="#VendorIds">USB Vendor IDs</a></li>
+ </ol>
+ </li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a></li>
+ <li><a href="{@docRoot}tools/extras/oem-usb.html">OEM USB Drivers</a></li>
+ </ol>
+</div>
+</div>
+
+<p>When building a mobile application, it's important that you always test your application on a
+real device before releasing it to users. This page describes how to set up your development
+environment and Android-powered device for testing and debugging on the device.</p>
+
+<p>You can use any Android-powered device as an environment for running,
+debugging, and testing your applications. The tools included in the SDK make it easy to install and
+run your application on the device each time you compile. You can install your application on the
+device directly from Eclipse or from the command line with ADB. If
+you don't yet have a device, check with the service providers in your area to determine which
+Android-powered devices are available.</p>
+
+<p>If you want a SIM-unlocked phone, then you might consider the Google Nexus S. To find a place
+to purchase the Nexus S and other Android-powered devices, visit <a
+href="http://www.google.com/phone/detail/nexus-s">google.com/phone</a>.</p>
+
+<p class="note"><strong>Note:</strong> When developing on a device, keep in mind that you should
+still use the <a
+href="{@docRoot}tools/devices/emulator.html">Android emulator</a> to test your
+application
+on configurations that are not equivalent to those of your real device. Although the emulator
+does not allow you to test every device feature (such as the accelerometer), it does
+allow you to verify that your application functions properly on different versions of the Android
+platform, in different screen sizes and orientations, and more.</p>
+
+
+<h2 id="setting-up">Setting up a Device for Development</h2>
+
+<p>With an Android-powered device, you can develop and debug your Android applications just as you
+would on the emulator. Before you can start, there are just a few things to do:</p>
+
+<ol>
+ <li>Declare your application as "debuggable" in your Android Manifest.
+ <p>When using Eclipse, you can skip this step, because running your app directly from
+the Eclipse IDE automatically enables debugging.</p>
+ <p>In the <code>AndroidManifest.xml</code> file, add <code>android:debuggable="true"</code> to
+the <code><application></code> element.</p>
+ <p class="note"><strong>Note:</strong> If you manually enable debugging in the manifest
+ file, be sure to disable it before you build for release (your published application
+should usually <em>not</em> be debuggable).</p></li>
+ <li>Turn on "USB Debugging" on your device.
+ <p>On the device, go to <strong>Settings > Applications > Development</strong>
+ and enable <strong>USB debugging</strong>
+ (on an Android 4.0 device, the setting is
+located in <strong>Settings > Developer options</strong>).</p>
+ </li>
+ <li>Set up your system to detect your device.
+ <ul>
+ <li>If you're developing on Windows, you need to install a USB driver for adb. For an
+installation guide and links to OEM drivers, see the <a href="{@docRoot}tools/extras/oem-usb.html">OEM USB
+Drivers</a> document.</li>
+ <li>If you're developing on Mac OS X, it just works. Skip this step.</li>
+ <li>If you're developing on Ubuntu Linux, you need to add a
+<code>udev</code> rules file that contains a USB configuration for each type of device
+you want to use for development. In the rules file, each device manufacturer
+is identified by a unique vendor ID, as specified by the
+<code>ATTR{idVendor}</code> property. For a list of vendor IDs, see <a
+href="#VendorIds">USB Vendor IDs</a>, below. To set up device detection on
+Ubuntu Linux:
+
+ <ol type="a">
+ <li>Log in as root and create this file:
+ <code>/etc/udev/rules.d/51-android.rules</code></span>.
+ <p>Use this format to add each vendor to the file:<br/>
+ <code>SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"</code>
+ <br /><br />
+
+ In this example, the vendor ID is for HTC. The <code>MODE</code>
+assignment specifies read/write permissions, and <code>GROUP</code> defines
+which Unix group owns the device node. </p>
+
+ <p class="note"><strong>Note:</strong> The rule syntax
+may vary slightly depending on your environment. Consult the <code>udev</code>
+documentation for your system as needed. For an overview of rule syntax, see
+this guide to <a
+href="http://www.reactivated.net/writing_udev_rules.html">writing udev
+rules</a>.</p>
+ </li>
+ <li>Now execute:<br/>
+ <code>chmod a+r /etc/udev/rules.d/51-android.rules</code>
+ </li>
+ </ol>
+ </li>
+ </ul>
+ </li>
+</ol>
+
+<p>When plugged in over USB, can verify that your device is connected by executing <code>adb
+devices</code> from your SDK {@code platform-tools/} directory. If connected,
+you'll see the device name listed as a "device."</p>
+
+<p>If using Eclipse, run or debug your application as usual. You will be
+presented with a <b>Device Chooser</b> dialog that lists the available
+emulator(s) and connected device(s). Select the device upon which you want to
+install and run the application.</p>
+
+<p>If using the <a href="{@docRoot}tools/help/adb.html">Android
+Debug Bridge</a> (adb), you can issue commands with the <code>-d</code> flag to
+target your connected device.</p>
+
+<h3 id="VendorIds">USB Vendor IDs</h3>
+
+<p>This table provides a reference to the vendor IDs needed in order to add USB
+device support on Linux. The USB Vendor ID is the value given to the
+<code>ATTR{idVendor}</code> property in the rules file, as described
+above.</p>
+
+<table>
+ <tr>
+ <th>Company</th><th>USB Vendor ID</th></tr>
+ <tr>
+ <td>Acer</td>
+ <td><code>0502</code></td>
+ </tr>
+ <tr>
+ <td>ASUS</td>
+ <td><code>0b05</code></td>
+ </tr>
+ <tr>
+ <td>Dell</td>
+ <td><code>413c</code></td>
+ </tr>
+ <tr>
+ <td>Foxconn</td>
+ <td><code>0489</code></td>
+ </tr>
+ <tr>
+ <td>Fujitsu</td>
+ <td><code>04c5</code></td>
+ </tr>
+ <tr>
+ <td>Fujitsu Toshiba</td>
+ <td><code>04c5</code></td>
+ </tr>
+ <tr>
+ <td>Garmin-Asus</td>
+ <td><code>091e</code></td>
+ </tr>
+ <tr>
+ <td>Google</td>
+ <td><code>18d1</code></td>
+ </tr>
+ <tr>
+ <td>Hisense</td>
+ <td><code>109b</code></td>
+ </tr>
+ <tr>
+ <td>HTC</td>
+ <td><code>0bb4</code></td>
+ </tr>
+ <tr>
+ <td>Huawei</td>
+ <td><code>12d1</code></td>
+ </tr>
+ <tr>
+ <td>K-Touch</td>
+ <td><code>24e3</code></td>
+ </tr>
+ <tr>
+ <td>KT Tech</td>
+ <td><code>2116</code></td>
+ </tr>
+ <tr>
+ <td>Kyocera</td>
+ <td><code>0482</code></td>
+ </tr>
+ <tr>
+ <td>Lenovo</td>
+ <td><code>17ef</code></td>
+ </tr>
+ <tr>
+ <td>LG</td>
+ <td><code>1004</code></td>
+ </tr>
+ <tr>
+ <td>Motorola</td>
+ <td><code>22b8</code></td>
+ </tr>
+ <tr>
+ <td>NEC</td>
+ <td><code>0409</code></td>
+ </tr>
+ <tr>
+ <td>Nook</td>
+ <td><code>2080</code></td>
+ </tr>
+ <tr>
+ <td>Nvidia</td>
+ <td><code>0955</code></td>
+ </tr>
+ <tr>
+ <td>OTGV</td>
+ <td><code>2257</code></td>
+ </tr>
+ <tr>
+ <td>Pantech</td>
+ <td><code>10a9</code></td>
+ </tr>
+ <tr>
+ <td>Pegatron</td>
+ <td><code>1d4d</code></td>
+ </tr>
+ <tr>
+ <td>Philips</td>
+ <td><code>0471</code></td>
+ </tr>
+ <tr>
+ <td>PMC-Sierra</td>
+ <td><code>04da</code></td>
+ </tr>
+ <tr>
+ <td>Qualcomm</td>
+ <td><code>05c6</code></td>
+ </tr>
+ <tr>
+ <td>SK Telesys</td>
+ <td><code>1f53</code></td>
+ </tr>
+ <tr>
+ <td>Samsung</td>
+ <td><code>04e8</code></td>
+ </tr>
+ <tr>
+ <td>Sharp</td>
+ <td><code>04dd</code></td>
+ </tr>
+ <tr>
+ <td>Sony</td>
+ <td><code>054c</code></td>
+ </tr>
+ <tr>
+ <td>Sony Ericsson</td>
+ <td><code>0fce</code></td>
+ </tr>
+ <tr>
+ <td>Teleepoch</td>
+ <td><code>2340</code></td>
+ </tr>
+ <tr>
+ <td>Toshiba</td>
+ <td><code>0930</code></td>
+ </tr>
+ <tr>
+ <td>ZTE</td>
+ <td><code>19d2</code></td>
+ </tr>
+</table>
diff --git a/docs/html/tools/devices/emulator.jd b/docs/html/tools/devices/emulator.jd
new file mode 100644
index 0000000..cee6473
--- /dev/null
+++ b/docs/html/tools/devices/emulator.jd
@@ -0,0 +1,1571 @@
+page.title=Using the Android Emulator
+parent.title=Managing Virtual Devices
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#overview">Overview</a></li>
+ <li><a href="#avds">Android Virtual Devices and the Emulator</a></li>
+ <li><a href="#starting">Starting and Stopping the Emulator</a></li>
+ <li><a href="#apps">Installing Applications on the Emulator</a></li>
+ <li><a href="#acceleration">Using Hardware Acceleration</a>
+ <ol>
+ <li><a href="#accel-graphics">Configuring Graphics Acceleration</a></li>
+ <li><a href="#accel-vm">Configuring Virtual Machine Acceleration</a></li>
+ </ol>
+ </li>
+ <li><a href="#sdcard">SD Card Emulation</a>
+ <ol>
+ <li><a href="#sdcard-creating">Creating an SD card image</a></li>
+ <li><a href="#sdcard-files">Copying files to an SD card image</a></li>
+ <li><a href="#sdcard-loading">Loading an SD card image</a></li>
+ </ol>
+ </li>
+ <li><a href="#diskimages">Working with Emulator Disk Images</a>
+ <ol>
+ <li><a href="#defaultimages">Default image files</a></li>
+ <li><a href="#runtimeimages">Runtime images: user data and SD card</a></li>
+ <li><a href="#temporaryimages">Temporary images</a></li>
+ </ol>
+ </li>
+ <li><a href="#emulatornetworking">Emulator Networking</a>
+ <ol>
+ <li><a href="#networkaddresses">Network Address Space</a></li>
+ <li><a href="#networkinglimitations">Local Networking Limitations</a></li>
+ <li><a href="#redirection">Using Network Redirection</a></li>
+ <li><a href="#dns">Configuring the Emulator's DNS Settings</a></li>
+ <li><a href="#proxy">Using the Emulator with a Proxy</a></li>
+ <li><a href="#connecting">Interconnecting Emulator Instances</a></li>
+ <li><a href="#calling">Sending a Voice Call or SMS to Another Emulator Instance</a></li>
+ </ol>
+ </li>
+ <li><a href="#console">Using the Emulator Console</a>
+ <ol>
+ <li><a href="#portredirection">Port Redirection</a></li>
+ <li><a href="#geo">Geo Location Provider Emulation</a></li>
+ <li><a href="#events">Hardware Events Emulation</a></li>
+ <li><a href="#power">Device Power Characteristics</a></li>
+ <li><a href="#netstatus">Network Status</a></li>
+ <li><a href="#netdelay">Network Delay Emulation</a></li>
+ <li><a href="#netspeed">Network Speed Emulation</a></li>
+ <li><a href="#telephony">Telephony Emulation</a></li>
+ <li><a href="#sms">SMS Emulation</a></li>
+ <li><a href="#vm">VM State</a></li>
+ <li><a href="#window">Emulator Window</a></li>
+ <li><a href="#terminating">Terminating an Emulator Instance</a></li>
+ </ol>
+ </li>
+ <li><a href="#limitations">Emulator Limitations</a></li>
+ <li><a href="#troubleshooting">Troubleshooting Emulator Problems</a></li>
+ </ol>
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}tools/help/emulator.html">Android Emulator</a></li>
+ <li><a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with AVD Manager</a></li>
+ </ol>
+</div>
+</div>
+
+<p>The Android SDK includes a virtual mobile device emulator
+that runs on your computer. The emulator lets you prototype, develop and test
+Android applications without using a physical device. </p>
+
+<p>The Android emulator mimics all of the hardware and software features
+of a typical mobile device, except that it cannot place actual phone
+calls. It provides a variety of navigation and control keys, which you can "press"
+using your mouse or keyboard to generate events for your application. It also
+provides a screen in which your application is displayed, together with any other
+active Android applications. </p>
+
+<img src="{@docRoot}images/emulator-wvga800l.png" width="367" height="349" />
+
+<p>To let you model and test your application more easily, the emulator utilizes
+Android Virtual Device (AVD) configurations. AVDs let you define certain hardware
+aspects of your emulated phone and allow you to create many configurations to test
+many Android platforms and hardware permutations. Once your application is running on
+the emulator, it can use the services of the Android platform to invoke other
+applications, access the network, play audio and video, store and retrieve data,
+notify the user, and render graphical transitions and themes. </p>
+
+<p>The emulator also includes a variety of debug capabilities, such as a console
+from which you can log kernel output, simulate application interrupts (such as
+arriving SMS messages or phone calls), and simulate latency effects and dropouts
+on the data network.</p>
+
+
+
+<h2 id="overview">Overview</h2>
+
+<p>The Android emulator is an application that provides a virtual
+mobile device on which you can run your Android applications. It runs a full
+Android system stack, down to the kernel level, that includes a set of
+preinstalled applications (such as the dialer) that you can access from your
+applications. You can choose what version of the Android system you want to
+run in the emulator by configuring AVDs, and you can also customize the
+mobile device skin and key mappings. When launching the emulator and at runtime,
+you can use a variety of commands and options to control its behavior.
+</p>
+
+<p>The Android system images available through the Android SDK Manager contain
+code for the Android Linux kernel, the native libraries, the Dalvik VM, and the
+various Android packages (such as the Android framework and preinstalled
+applications). The emulator provides dynamic binary translation of device
+machine code to the OS and processor architecture of your development
+machine.</p>
+
+<p>The Android emulator supports many hardware features likely to be found on
+mobile devices, including: </p>
+
+<ul>
+ <li>An ARMv5 CPU and the corresponding memory-management unit (MMU)</li>
+ <li>A 16-bit LCD display</li>
+ <li>One or more keyboards (a Qwerty-based keyboard and associated Dpad/Phone
+buttons)</li>
+ <li>A sound chip with output and input capabilities</li>
+ <li>Flash memory partitions (emulated through disk image files on the
+development machine)</li>
+ <li>A GSM modem, including a simulated SIM Card</li>
+ <li>A camera, using a webcam connected to your development computer.</li>
+ <li>Sensors like an accelerometer, using data from a USB-connected Android device.</li>
+</ul>
+
+<p>The following sections describe the emulator and its use for development of Android
+applications in more detail.</p>
+
+
+<h2 id="avds">Android Virtual Devices and the Emulator</h2>
+
+<p>To use the emulator, you first must create one or more AVD configurations. In each
+configuration, you specify an Android platform to run in the emulator and the set of hardware
+options and emulator skin you want to use. Then, when you launch the emulator, you specify
+the AVD configuration that you want to load. </p>
+
+<p>Each AVD functions as an independent device, with its own private storage for
+user data, SD card, and so on. When you launch the emulator with an AVD configuration,
+it automatically loads the user data and SD card data from the AVD directory. By default,
+the emulator stores the user data, SD card data, and cache in the AVD directory.</p>
+
+<p>To create and manage AVDs you use the AVD Manager UI or the <code>android</code> tool
+that is included in the SDK.
+For complete information about how to set up AVDs, see <a
+href="{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>.</p>
+
+
+<h2 id="starting">Starting and Stopping the Emulator</h2>
+
+<p>During development and testing of your application, you install and run your
+application in the Android emulator. You can launch the emulator as a standalone
+application from a command line, or you can run it from within your Eclipse
+development environment. In either case, you specify the AVD configuration to
+load and any startup options you want to use, as described in this document.
+</p>
+
+<p>You can run your application on a single instance of the emulator or,
+depending on your needs, you can start multiple emulator instances and run your
+application in more than one emulated device. You can use the emulator's
+built-in commands to simulate GSM phone calling or SMS between emulator
+instances, and you can set up network redirection that allows emulators to send
+data to one another. For more information, see <a href="#telephony">Telephony
+Emulation</a>, <a href="#sms">SMS Emulation</a>, and
+<a href="#emulatornetworking">Emulator Networking</a></p>
+
+<p>To start an instance of the emulator from the command line, navigate to the
+<code>tools/</code> folder of the SDK. Enter <code>emulator</code> command
+like this: </p>
+
+<pre>emulator -avd <avd_name> [<options>]</pre>
+
+<p>This initializes the emulator, loads an AVD configuration and displays the emulator
+window. For more information about command line options for the emulator, see the
+<a href="{@docRoot}tools/help/emulator.html">Android Emulator</a> tool reference.</p>
+
+<p class="note"><strong>Note:</strong> You can run multiple
+instances of the emulator concurrently, each with its own AVD configuration and
+storage area for user data, SD card, and so on.</p>
+
+<p>If you are working in Eclipse, the ADT plugin for Eclipse installs your
+application and starts the emulator automatically, when you run or debug
+the application. You can specify emulator startup options in the Run/Debug
+dialog, in the Target tab. When the emulator is running, you can issue
+console commands as described later in this document.</p>
+
+<p>If you are not working in Eclipse, see <a href="#apps">Installing Applications
+on the Emulator</a> for information about how to install your application.</p>
+
+<p>To stop an emulator instance, just close the emulator's window.</p>
+
+<p>For a reference of the emulator's startup commands and keyboard mapping, see
+the <a href="{@docRoot}tools/help/emulator.html">Android Emulator</a> tool
+reference.</p>
+
+
+<h2 id="apps">Installing Applications on the Emulator</h2>
+
+<p>If you don't have access to Eclipse or the ADT Plugin, you can install your application on the
+emulator using the <a href="{@docRoot}tools/help/adb.html#move">adb</a> utility. Before
+installing the application, you need to build and package it into an <code>.apk</code> as described
+in <a href="{@docRoot}tools/building/index.html">Building and
+Running Apps</a>. Once the application is installed, you can start the emulator from the command
+line as described previously, using any startup options necessary.
+When the emulator is running, you can also connect to the emulator instance's
+<a href="#console">console</a> to issue commands as needed.</p>
+
+<p>As you update your code, you periodically package and install it on the emulator.
+The emulator preserves the application and its state data across restarts,
+in a user-data disk partition. To ensure that the application runs properly
+as you update it, you may need to delete the emulator's user-data partition.
+To do so, start the emulator with the <code>-wipe-data</code> option.
+For more information about the user-data partition and other emulator storage,
+see <a href="#diskimages">Working with Emulator Disk Images</a>.</p>
+
+
+<h2 id="acceleration">Using Hardware Acceleration</h2>
+
+<p>In order to make the Android emulator run faster and be more responsive, you can configure it to
+take advantage of hardware acceleration, using a combination of configuration options, specific
+Android system images and hardware drivers.</p>
+
+
+<h3 id="accel-graphics">Configuring Graphics Acceleration</h3>
+
+<p class="caution"><strong>Caution:</strong> As of SDK Tools Revision 17, the graphics
+acceleration feature for the emulator is experimental; be alert for incompatibilities and
+errors when using this feature. </p>
+
+<p>Graphics acceleration for the emulator takes advantage of your development computer's graphics
+hardware, specifically its graphics processing unit (GPU), to make screen drawing faster. To use
+the graphics acceleration feature, you must have the following versions of the Android development
+tools installed:</p>
+
+<ul>
+ <li>Android SDK Tools, Revision 17 or higher</li>
+ <li>Android SDK Platform API 15, Revision 3 or higher</li>
+</ul>
+
+<p>Use the <a href="{@docRoot}sdk/installing/index.html#AddingComponents">Android SDK
+Manager</a> to install these components:</p>
+
+<p class="note"><strong>Note:</strong> Not all applications are compatible with graphics hardware
+acceleration. In particular, the Browser application and applications using the {@link
+android.webkit.WebView} component are not compatible with graphics acceleration.</p>
+
+<p>To configure an AVD to use graphics acceleration:</p>
+
+<ol>
+ <li>Make sure you have the required SDK components installed (listed above).</li>
+ <li>Start the AVD Manager and create a new AVD with the <strong>Target</strong> value of
+<strong>Android 4.0.3 (API Level 15)</strong>, revision 3 or higher.</li>
+ <li>If you want to have graphics acceleration enabled by default for this AVD, in the
+<strong>Hardware</strong> section, click <strong>New</strong>, select <strong>GPU emulation</strong>
+and set the value to <strong>Yes</strong>.
+ <p class="note"><strong>Note:</strong> You can also enable graphics acceleration when you
+start an emulator using command line options as describe in the next section.</p>
+ </li>
+ <li>Name the AVD instance and select any other configuration options.
+ <p class="caution"><strong>Caution:</strong> Do not select the <strong>Snapshot: Enabled</strong>
+option. Snapshots are not supported for emulators with graphics acceleration enabled.</p>
+ </li>
+ <li>Click <strong>Create AVD</strong> to save the emulator configuration.</li>
+</ol>
+
+<p>If you set <strong>GPU emulation</strong> to <strong>Yes</strong> for your AVD, then graphics
+acceleration is automatically enabled when you run it. If you did not enable <strong>GPU
+emulation</strong> when you created the AVD, you can still enable it at runtime.</p>
+
+<p>To enable graphics acceleration at runtime for an AVD:</p>
+
+<ul>
+ <li>If you are running the emulator from the command line, just include the {@code -gpu on}
+option:
+<pre>emulator -avd <avd_name> -gpu on</pre>
+ <p class="note"><strong>Note:</strong> You must specify an AVD configuration that uses
+Android 4.0.3 (API Level 15, revision 3) or higher system image target. Graphics acceleration is not
+available for earlier system images.</p>
+ </li>
+ <li>If you are running the emulator from Eclipse, run your Android application using an AVD with
+the {@code -gpu on} option enabled:
+ <ol>
+ <li>In Eclipse, click your Android project folder and then select <strong>Run > Run
+Configurations...</strong></li>
+ <li>In the left panel of the <strong>Run Configurations</strong> dialog, select your Android
+project run configuration or create a new configuration.</li>
+ <li>Click the <strong>Target</strong> tab.</li>
+ <li>Select the AVD you created in the previous procedure.</li>
+ <li>In the <strong>Additional Emulator Command Line Options</strong> field, enter:<br>
+ {@code -gpu on}</li>
+ <li>Run your Android project using this run configuration.</li>
+ </ol>
+ </li>
+</ul>
+
+
+<h3 id="accel-vm">Configuring Virtual Machine Acceleration</h2>
+
+<p class="caution"><strong>Caution:</strong> As of SDK Tools Revision 17, the virtual machine
+acceleration feature for the emulator is experimental; be alert for incompatibilities and errors
+when using this feature.</p>
+
+<p>Many modern CPUs provide extensions for running virtual machines (VMs) more efficiently. Taking
+advantage of these extensions with the Android emulator requires some additional configuration of
+your development system, but can significantly improve the execution speed. Before attempting to use
+this type of acceleration, you should first determine if your development system’s CPU supports one
+of the following virtualization extensions technologies:</p>
+
+<ul>
+ <li>Intel Virtualization Technology (VT, VT-x, vmx) extensions</li>
+ <li>AMD Virtualization (AMD-V, SVM) extensions (only supported for Linux)</li>
+</ul>
+
+<p>The specifications from the manufacturer of your CPU should indicate if it supports
+virtualization extensions. If your CPU does not support one of these virtualization technologies,
+then you cannot use virtual machine acceleration.</p>
+
+<p class="note"><strong>Note:</strong> Virtualization extensions are typically enabled through
+your computer's BIOS and are frequently turned off by default. Check the documentation for your
+system's motherboard to find out how to enable virtualization extensions.</p>
+
+<p>Once you have determined that your CPU supports virtualization extensions, make sure you can work
+within these additional requirements of running an emulator inside an accelerated virtual
+machine:</p>
+
+<ul>
+ <li><strong>x86 AVD Only</strong> - You must use an AVD that is uses an x86 system image target.
+AVDs that use ARM-based system images cannot be accelerated using the emulator configurations
+described here.</li>
+ <li><strong>Not Inside a VM</strong> - You cannot run a VM-accelerated emulator inside another
+virtual machine, such as a VirtualBox or VMWare-hosted virtual machine. You must run the emulator
+directly on your system hardware.</li>
+ <li><strong>Other VM Drivers</strong> - If you are running another virtualization technology on
+your system such as VirtualBox or VMWare, you may need to unload the driver for that virtual machine
+hosting software before running an accelerated emulator.</li>
+ <li><strong>OpenGL® Graphics</strong> - Emulation of OpenGL ES graphics may not perform at the
+same level as an actual device.</li>
+</ul>
+
+<p>To use virtual machine acceleration with the emulator, you need the following version of Android
+development tools. Use the <a href="{@docRoot}sdk/installing/index.html#AddingComponents">Android SDK
+Manager</a> to install these components:</p>
+
+<ul>
+ <li>Android SDK Tools, Revision 17 or higher</li>
+ <li>Android x86-based system image</li>
+</ul>
+
+<p>If your development environment meets all of the requirements for running a VM-accelerated
+emulator, you can use the AVD Manager to create an x86-based AVD configuration:</p>
+
+<ol>
+ <li>In the Android SDK Manager, make sure you have an x86-based <strong>System Image</strong>
+ installed for your target Android version. If you do not have an x86 <strong>System
+ Image</strong> installed, select one in the Android SDK Manager and install it.
+ <p class="note"><strong>Tip:</strong> System images are listed under each API Level in the SDK
+ Manager. An x86 system image may not be available for all API levels.</p>
+ </li>
+ <li>Start the AVD Manager and create a new AVD with an x86 value for the
+<strong>CPU/ABI</strong> field. You may need to select a specific <strong>Target</strong> value, or
+select a <strong>Target</strong> value and then select a specific <strong>CPU/ABI</strong>
+option.</li>
+ <li>Name the emulator instance and select any other configuration options.</li>
+ <li>Click <strong>Create AVD</strong> to save the emulator configuration.</li>
+</ol>
+
+<h4 id="vm-windows">Configuring VM Acceleration on Windows</h4>
+
+<p>Virtual machine acceleration for Windows requires the installation of the Intel Hardware
+Accelerated Execution Manager (Intel HAXM). The software requires an Intel CPU with
+Virtualization Technology (VT) support and one of the following operating systems:</p>
+
+<ul>
+ <li>Windows 7 (32/64-bit)</li>
+ <li>Windows Vista (32/64-bit)</li>
+ <li>Windows XP (32-bit only)</li>
+</ul>
+
+<p>To install the virtualization driver:</p>
+
+<ol>
+ <li>Start the Android SDK Manager, select <strong>Extras</strong> and then select <strong>Intel
+Hardware Accelerated Execution Manager</strong>.</li>
+ <li>After the download completes, execute {@code
+<sdk>/extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM.exe}.</li>
+ <li>Follow the on-screen instructions to complete installation.</li>
+ <li>After installation completes, confirm that the virtualization driver is operating correctly by
+opening a command prompt window and running the following command:
+ <pre>sc query intelhaxm</pre>
+ <p>You should see a status message including the following information:</p>
+<pre>
+SERVICE_NAME: intelhaxm
+ ...
+ STATE : 4 RUNNING
+ ...
+</pre>
+ </li>
+</ol>
+
+<p>To run an x86-based emulator with VM acceleration:</p>
+<ul>
+ <li>If you are running the emulator from the command line, just specify an x86-based AVD:
+<pre>emulator -avd <avd_name></pre>
+ <p class="note"><strong>Note:</strong> You must provide an x86-based AVD configuration
+name, otherwise VM acceleration will not be enabled.</p>
+ </li>
+ <li>If you are running the emulator from Eclipse, run your Android application with an x86-based
+AVD:
+ <ol>
+ <li>In Eclipse, click your Android project folder and then select <strong>Run > Run
+Configurations...</strong></li>
+ <li>In the left panel of the <strong>Run Configurations</strong> dialog, select your Android
+project run configuration or create a new configuration.</li>
+ <li>Click the <strong>Target</strong> tab.</li>
+ <li>Select the x86-based AVD you created previously.</li>
+ <li>Run your Android project using this run configuration.</li>
+ </ol>
+ </li>
+</ul>
+
+<p>You can adjust the amount of memory available to the Intel HAXM kernel extension by re-running
+its installer.</p>
+
+<p>You can stop using the virtualization driver by uninstalling it. Re-run the installer or use
+the Control Panel to remove the software.</p>
+
+
+<h4 id="vm-mac">Configuring VM Acceleration on Mac</h4>
+
+<p>Virtual machine acceleration on a Mac requires the installation of the Intel Hardware Accelerated
+Execution Manager (Intel HAXM) kernel extension to allow the Android emulator to make use of CPU
+virtualization extensions. The kernel extension is compatible with Mac OS X Snow Leopard (version
+10.6.0) and higher.</p>
+
+<p>To install the Intel HAXM kernel extension:</p>
+
+<ol>
+ <li>Start the Android SDK Manager, select <strong>Extras</strong> and then select <strong>Intel
+Hardware Accelerated Execution Manager</strong>.
+ <li>After the download completes, execute
+ {@code <sdk>/extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM.dmg}.</li>
+ <li>Double click the <strong>IntelHAXM.mpkg</strong> icon to begin installation.</li>
+ <li>Follow the on-screen instructions to complete installation.</li>
+ <li>After installation completes, confirm that the new kernel extension is operating correctly by
+opening a terminal window and running the following command:
+ <pre>kextstat | grep intel</pre>
+ <p>You should see a status message containing the following extension name, indicating that the
+ kernel extension is loaded:</p>
+ <pre>com.intel.kext.intelhaxm</pre>
+ </li>
+</ol>
+
+<p>To run an x86-based emulator with VM acceleration:</p>
+<ul>
+ <li>If you are running the emulator from the command line, just specify an x86-based AVD:
+<pre>emulator -avd <avd_name></pre>
+ <p class="note"><strong>Note:</strong> You must provide an x86-based AVD configuration
+name, otherwise VM acceleration will not be enabled.</p>
+ </li>
+ <li>If you are running the emulator from Eclipse, run your Android application with an x86-based
+AVD:
+ <ol>
+ <li>In Eclipse, click your Android project folder and then select <strong>Run > Run
+Configurations...</strong></li>
+ <li>In the left panel of the <strong>Run Configurations</strong> dialog, select your Android
+project run configuration or create a new configuration.</li>
+ <li>Click the <strong>Target</strong> tab.</li>
+ <li>Select the x86-based AVD you created previously.</li>
+ <li>Run your Android project using this run configuration.</li>
+ </ol>
+ </li>
+</ul>
+
+<p>You can adjust the amount of memory available to the Intel HAXM kernel extension by re-running
+the installer.</p>
+
+<p>You can stop using the virtualization kernel driver by uninstalling it. Before removing it, shut
+down any running x86 emulators. To unload the virtualization kernel driver, run the following
+command in a terminal window:</p>
+
+<pre>sudo /System/Library/Extensions/intelhaxm.kext/Contents/Resources/uninstall.sh</pre>
+
+<h4 id="vm-linux">Configuring VM Acceleration on Linux</h4>
+
+<p>Linux-based systems support virtual machine acceleration through the KVM software package. Follow
+<a href="https://www.google.com/?q=kvm+installation">instructions for installing KVM</a> on your
+Linux system, and verify that KVM is enabled. In addition to following the installation
+instructions, be aware of these configuration requirements:</p>
+
+<ul>
+ <li>Running KVM requires specific user permissions, make sure you have sufficient permissions
+according to the KVM installation instructions.</li>
+ <li>If you use another virtualization technology in your Linux platform, unload its kernel driver
+before running the x86 emulator. For example, the VirtualBox driver program is {@code vboxdrv}.</li>
+</ul>
+
+<p>To run an x86-based emulator with VM acceleration:</p>
+
+<ul>
+ <li>If you are running the emulator from the command line, start the emulator with an x86-based
+AVD and include the KVM options:
+<pre>emulator -avd <avd_name> -qemu -m 512 -enable-kvm</pre>
+ <p class="note"><strong>Note:</strong> You must provide an x86-based AVD configuration
+name, otherwise VM acceleration will not be enabled.</p>
+ </li>
+ <li>If you are running the emulator from Eclipse, run your Android application with an x86-based
+AVD and include the KVM options:
+ <ol>
+ <li>In Eclipse, click your Android project folder and then select <strong>Run > Run
+Configurations...</strong></li>
+ <li>In the left panel of the <strong>Run Configurations</strong> dialog, select your Android
+project run configuration or create a new configuration.</li>
+ <li>Click the <strong>Target</strong> tab.</li>
+ <li>Select the x86-based AVD you created previously.</li>
+ <li>In the <strong>Additional Emulator Command Line Options</strong> field, enter:
+ <pre>-qemu -m 512 -enable-kvm</pre>
+ </li>
+ <li>Run your Android project using this run configuration.</li>
+ </ol>
+ </li>
+</ul>
+
+<p class="note"><strong>Important:</strong> When using the {@code -qemu} command line option, make sure
+it is the last parameter in your command. All subsequent options are interpreted as qemu-specific
+parameters.</p>
+
+
+<h2 id="sdcard">SD Card Emulation</h2>
+
+<p>You can create a disk image and then load it to the emulator at startup, to
+simulate the presence of a user's SD card in the device. To do this, you can specify
+an SD card image when you create an AVD, or you can use the mksdcard utility included
+in the SDK.</p>
+
+<p>The following sections describe how to create an SD card disk image, how to copy
+files to it, and how to load it in the emulator at startup. </p>
+
+<p>Note that you can only load a disk image at emulator startup. Similarly, you
+can not remove a simulated SD card from a running emulator. However, you can
+browse, send files to, and copy/remove files from a simulated SD card either
+with adb or the emulator. </p>
+
+<p>The emulator supports emulated SDHC cards, so you can create an SD card image
+of any size up to 128 gigabytes.</p>
+
+
+<h3 id="sdcard-creating">Creating an SD card image</h3>
+
+<p>There are several ways of creating an SD card image. The easiest way is to use the
+<strong>AVD Manager</strong> to create a new SD card by specifying a size when you create an AVD.
+You can also use the {@code android} command line tool when creating an AVD. Just add the
+<code>-c</code> option to your command: </p>
+
+<pre>android create avd -n <avd_name> -t <targetID> -c <size>[K|M]</pre>
+
+<p>The <code>-c</code> option can also be used to to specify a path to an SD card
+image for the new AVD. For more information, see <a
+href="{@docRoot}tools/devices/managing-avds-cmdline.html">Managing Virtual Devices
+from the Command Line</a>.
+</p>
+
+<p>You can also use the mksdcard tool, included in the SDK, to create a FAT32 disk
+image that you can load in the emulator at startup. You can access mksdcard in
+the tools/ directory of the SDK and create a disk image like this: </p>
+
+<pre>mksdcard <size> <file></pre>
+
+<p>For example:</p>
+
+<pre>mksdcard 1024M sdcard1.iso</pre>
+
+<p>For more information, see <a
+href="{@docRoot}tools/help/mksdcard.html"><code>mksdcard</code></a>.</p>
+
+
+<h3 id="sdcard-files">Copying files to an SD card image</h3>
+
+<p>Once you have created the disk image, you can copy files to it prior to
+loading it in the emulator. To copy files, you can mount the image as a loop
+device and then copy the files to it, or you can use a utility such as {@code mtools} to
+copy the files directly to the image. The {@code mtools} package is available for Linux,
+Mac, and Windows.</p>
+
+<p>Alternatively, you can use the {@code adb push} command to move files onto an SD card image
+while it is loaded in an emulator. For more information see the <a
+href="{@docRoot}tools/help/adb.html#copyfiles">{@code adb push}</a> documentation.</p>
+
+<h3 id="sdcard-loading">Loading an SD card image</h3>
+
+<p>By default, the emulator loads the SD card image that is stored with the active
+AVD (see the <code>-avd</code> startup option).</p>
+
+<p>Alternatively, you can start the emulator with the
+<code>-sdcard</code> flag and specify the name and path of your image (relative
+to the current working directory): </p>
+
+<pre>emulator -sdcard <filepath></pre>
+
+
+<h2 id="diskimages">Working with Emulator Disk Images</h2>
+
+<p>The emulator uses mountable disk images stored on your development machine to
+simulate flash (or similar) partitions on an actual device. For example, it uses a
+disk image containing an emulator-specific kernel, the Android system, a
+ramdisk image, and writeable images for user data and simulated SD card.</p>
+
+<p>To run properly, the emulator requires access to a specific set of disk image
+files. By default, the Emulator always looks for the disk images in the
+private storage area of the AVD in use. If no images exist there when
+the Emulator is launched, it creates the images in the AVD directory based on
+default versions stored in the SDK. </p>
+
+<p class="note"><strong>Note:</strong> The default storage location for
+AVDs is in <code>~/.android/avd</code> on OS X and Linux, <code>C:\Documents and
+Settings\<user>\.android\</code> on Windows XP, and
+<code>C:\Users\<user>\.android\</code>
+on Windows Vista.</p>
+
+<p>To let you use alternate or custom versions of the image files, the emulator
+provides startup options that override the default locations and filenames of
+the image files. When you use one of these options, the emulator searches for the image
+file under the image name or location that you specify; if it can not locate the
+image, it reverts to using the default names and location.</p>
+
+<p>The emulator uses three types of image files: default image files, runtime
+image files, and temporary image files. The sections below describe how to
+override the location/name of each type of file. </p>
+
+<h3 id="defaultimages">Default image files</h3>
+
+<p>When the emulator launches, but does not find an existing user data image in
+the active AVD's storage area, it creates a new one from a default version
+included in the SDK. The default user data image is read-only. The image
+files are read-only.</p>
+
+<p>The emulator provides the <code>-system <dir></code> startup option to
+let you override the location where the emulator looks for the default
+user data image. </p>
+
+<p>The emulator also provides a startup option that lets you override the name
+of the default user data image, as described in the following table. When you use the
+option, the emulator looks in the default directory, or in a custom location
+(if you specified <code>-system <dir></code>). </p>
+
+
+<table>
+<tr>
+ <th width="10%" >Name</th>
+ <th width="30%" >Description</th>
+ <th width="40%" >Comments</th>
+</tr>
+
+<!--
+<tr>
+ <td><code>kernel-qemu.img</code></td>
+ <td>The emulator-specific Linux kernel image</td>
+ <td>Override using <code>-kernel <file></code></td>
+</tr>
+
+<tr>
+ <td><code>ramdisk.img</code></td>
+ <td>The ramdisk image used to boot the system.</td>
+ <td>Override using <code>-ramdisk <file></code></td>
+</tr>
+
+<tr>
+ <td><code>system.img</code></td>
+ <td>The <em>initial</em> Android system image.</td>
+ <td>Override using <code>-image <file></code></td>
+</tr>
+-->
+<tr>
+ <td><code>userdata.img</code></td>
+ <td>The <em>initial</em> user-data disk image</td>
+ <td>Override using <code>-initdata <file></code>. Also see
+<code>-data <file></code>, below.</td>
+</tr>
+
+</table>
+
+<h3 id="runtimeimages">Runtime images: user data and SD card</h3>
+
+<p>At runtime, the emulator reads and writes data to two disk images: a
+user-data image and (optionally) an SD card image. These images emulate the user-data
+partition and removable storage media on actual device. </p>
+
+<p>The emulator provides a default user-data disk image. At startup, the emulator
+creates the default image as a copy of the system user-data image (user-data.img),
+described above. The emulator stores the new image with the files of the active AVD.</p>
+
+<!--
+<p>The emulator provides a startup option, <code>-datadir <dir></code>,
+that you can use to override the location under which the emulator looks for the runtime
+image files. </p>
+-->
+
+<p>The emulator provides startup options to let you override the actual names and storage
+locations of the runtime images to load, as described in the following table. When you use one
+of these options, the emulator looks for the specified file(s) in the current working directory,
+in the AVD directory, or in a custom location (if you specified a path with the filename). </p>
+
+<table>
+<tr>
+ <th width="10%" >Name</th>
+ <th width="30%" >Description</th>
+ <th width="40%" >Comments</th>
+</tr>
+<tr>
+ <td><code>userdata-qemu.img</code></td>
+ <td>An image to which the emulator writes runtime user-data for a unique user.</td>
+ <td>Override using <code>-data <filepath></code>, where <code><filepath></code> is the
+path the image, relative to the current working directory. If you supply a filename only,
+the emulator looks for the file in the current working directory. If the file at <code><filepath></code> does
+not exist, the emulator creates an image from the default userdata.img, stores it under the name you
+specified, and persists user data to it at shutdown. </td>
+</tr>
+
+<tr>
+ <td><code>sdcard.img</code></td>
+ <td>An image representing an SD card inserted into the emulated device.</td>
+ <td>Override using <code>-sdcard <filepath></code>, where <code><filepath></code> is the
+path the image, relative to the current working directory. If you supply a filename only,
+the emulator looks for the file in the current working directory. </td>
+</tr>
+
+</table>
+
+<h4>User-Data Image</h4>
+
+<p>Each emulator instance uses a writeable user-data image to store user- and
+session-specific data. For example, it uses the image to store a unique user's
+installed application data, settings, databases, and files. </p>
+
+<p>At startup, the emulator attempts to load a user-data image stored during
+a previous session. It looks for the file in the current working directory,
+in the AVD directory described in a previous section and at the custom location/name
+that you specified at startup. </p>
+
+<ul>
+<li>If it finds a user-data image, it mounts the image and makes it available
+to the system for reading and writing of user data. </li>
+<li>If it does not find one, it creates an image by copying the system user-data
+image (userdata.img), described above. At device power-off, the system persists
+the user data to the image, so that it will be available in the next session.
+Note that the emulator stores the new disk image at the location/name that you
+specify in <code>-data</code> startup option.</li>
+</ul>
+
+<p class="note"><strong>Note:</strong> Because of the AVD configurations used in the emulator,
+each emulator instance gets its own dedicated storage. There is no longer a need
+to use the <code>-d</code> option to specify an instance-specific storage area.</p>
+
+<h4>SD Card</h4>
+
+<P>Optionally, you can create a writeable disk image that the emulator can use
+to simulate removeable storage in an actual device. For information about how to create an
+emulated SD card and load it in the emulator, see <a href="#sdcard">SD Card Emulation</a></p>
+
+<p>You can also use the android tool to automatically create an SD Card image
+for you, when creating an AVD. For more information, see <a
+href="{@docRoot}tools/devices/managing-avds.html">Managing Virtual Devices with AVD
+Manager</a>.
+
+
+<h3 id="temporaryimages">Temporary Images</h3>
+
+<p>The emulator creates two writeable images at startup that it deletes at
+device power-off. The images are: </p>
+
+<ul>
+ <li>A writable copy of the Android system image</li>
+ <li>The <code>/cache</code> partition image</li>
+</ul>
+
+<p>The emulator does not permit renaming the temporary system image or
+persisting it at device power-off. </p>
+
+<p>The <code>/cache</code> partition image is initially empty, and is used by
+the browser to cache downloaded web pages and images. The emulator provides an
+<code>-cache <file></code>, which specifies the name of the file in which
+to persist the <code>/cache</code> image at device power-off. If <code><file>
+</code> does not exist, the emulator creates it as an empty file. </p>
+
+<p>You can also disable the use of the cache partition by specifying the
+<code>-nocache</code> option at startup. </p>
+
+
+<h2 id="emulatornetworking">Emulator Networking</h2>
+
+<p>The emulator provides versatile networking capabilities that you can use to
+set up complex modeling and testing environments for your application. The
+sections below introduce the emulator's network architecture and capabilities.
+</p>
+
+<h3 id="networkaddresses">Network Address Space</h3>
+
+<p>Each instance of the emulator runs behind a virtual router/firewall service
+that isolates it from your development machine's network interfaces and settings
+and from the internet. An emulated device can not see your development machine
+or other emulator instances on the network. Instead, it sees only that it is
+connected through Ethernet to a router/firewall.</p>
+
+<p>The virtual router for each instance manages the 10.0.2/24 network address
+space — all addresses managed by the router are in the form of
+10.0.2.<xx>, where <xx> is a number. Addresses within this space are
+pre-allocated by the emulator/router as follows:</p>
+
+<table>
+ <tr>
+ <th>Network Address</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>10.0.2.1</td>
+ <td>Router/gateway address </td>
+ </tr>
+ <tr>
+ <td>10.0.2.2</td>
+ <td>Special alias to your host loopback interface (i.e., 127.0.0.1 on your
+development machine)</td>
+ </tr>
+ <tr>
+ <td>10.0.2.3</td>
+ <td>First DNS server</td>
+ </tr>
+ <tr>
+ <td>10.0.2.4 / 10.0.2.5 / 10.0.2.6</td>
+ <td>Optional second, third and fourth DNS server (if any) </td>
+ </tr>
+ <tr>
+ <td>10.0.2.15</td>
+ <td>The emulated device's own network/ethernet interface</td>
+ </tr>
+ <tr>
+ <td>127.0.0.1</td>
+ <td>The emulated device's own loopback interface </td>
+ </tr>
+</table>
+
+<p>Note that the same address assignments are used by all running emulator
+instances. That means that if you have two instances running concurrently on
+your machine, each will have its own router and, behind that, each will have an
+IP address of 10.0.2.15. The instances are isolated by a router and can
+<em>not</em> see each other on the same network. For information about how to
+let emulator instances communicate over TCP/UDP, see <a
+href="#connecting">Connecting Emulator Instances</a>.</p>
+
+<p>Also note that the address 127.0.0.1 on your development machine corresponds
+to the emulator's own loopback interface. If you want to access services running
+on your development machine's loopback interface (a.k.a. 127.0.0.1 on your
+machine), you should use the special address 10.0.2.2 instead.</p>
+
+<p>Finally, note that each emulated device's pre-allocated addresses are
+specific to the Android emulator and will probably be very different on real
+devices (which are also very likely to be NAT-ed, i.e., behind a
+router/firewall)</p>
+
+
+<h3 id="networkinglimitations">Local Networking Limitations</h3>
+
+<p>Android applications running in an emulator can connect to the network available on your
+workstation. However, they connect through the emulator, not directly to hardware, and the emulator
+acts like a normal application on your workstation. This means that the emulator, and thus your
+Android applications, are subject to some limitations:</p>
+
+<ul>
+ <li>Communication with the emulated device may be blocked by a firewall
+program running on your machine.</li>
+ <li>Communication with the emulated device may be blocked by another
+(physical) firewall/router to which your machine is connected.</li>
+</ul>
+
+<p>The emulator's virtual router should be able to handle all outbound TCP and
+UDP connections/messages on behalf of the emulated device, provided your
+development machine's network environment allows it to do so. There are no
+built-in limitations on port numbers or ranges except the one imposed by your
+host operating system and network.</p>
+
+<p>Depending on the environment, the emulator may not be able to support other
+protocols (such as ICMP, used for "ping") might not be supported. Currently, the
+emulator does not support IGMP or multicast. </p>
+
+<h3 id="redirection">Using Network Redirection</h3>
+
+<p>To communicate with an emulator instance behind its virtual router, you need
+to set up network redirection on the virtual router. Clients can then connect
+to a specified guest port on the router, while the router directs traffic
+to/from that port to the emulated device's host port. </p>
+
+<p>To set up the network redirection, you create a mapping of host and guest
+ports/addresses on the the emulator instance. There are two ways to set up
+network redirection: using emulator console commands and using the ADB tool, as
+described below. </p>
+
+
+<h4 id="consoleredir">Setting up Redirection through the Emulator Console</h4>
+
+<p>Each emulator instance provides a control console the you can connect to, to
+issue commands that are specific to that instance. You can use the
+<code>redir</code> console command to set up redirection as needed for an
+emulator instance. </p>
+
+<p>First, determine the console port number for the target emulator instance.
+For example, the console port number for the first emulator instance launched is
+5554. Next, connect to the console of the target emulator instance, specifying
+its console port number, as follows: </p>
+
+<pre><code>telnet localhost 5554</code></pre>
+
+<p>Once connected, use the <code>redir</code> command to work with redirection.
+To add a redirection, use:</p>
+
+<pre><code>add <protocol>:<host-port>:<guest-port></code>
+</pre>
+
+<p>where <code><protocol></code> is either <code>tcp</code> or <code>udp</code>,
+and <code><host-port></code> and <code><guest-port></code> sets the
+mapping between your own machine and the emulated system, respectively. </p>
+
+<p>For example, the following command sets up a redirection that handles all
+incoming TCP connections to your host (development) machine on 127.0.0.1:5000
+and will pass them through to the emulated system's 10.0.2.15:6000.:</p>
+
+<pre>redir add tcp:5000:6000</pre>
+
+<p>To delete a redirection, you can use the <code>redir del</code> command. To
+list all redirection for a specific instance, you can use <code>redir
+list</code>. For more information about these and other console commands, see
+<a href="#console">Using the Emulator Console</a>. </p>
+
+<p>Note that port numbers are restricted by your local environment. this typically
+means that you cannot use host port numbers under 1024 without special
+administrator privileges. Also, you won't be able to set up a redirection for a
+host port that is already in use by another process on your machine. In that
+case, <code>redir</code> generates an error message to that effect. </p>
+
+<h4 id="adbredir">Setting Up Redirection through ADB</h4>
+
+<p>The Android Debug Bridge (ADB) tool provides port forwarding, an alternate
+way for you to set up network redirection. For more information, see <a
+href="{@docRoot}tools/help/adb.html#forwardports">Forwarding Ports</a> in the ADB
+documentation.</p>
+
+<p>Note that ADB does not currently offer any way to remove a redirection,
+except by killing the ADB server.</p>
+
+
+<h3 id="dns">Configuring the Emulator's DNS Settings</h3>
+
+<p>At startup, the emulator reads the list of DNS servers that your system is
+currently using. It then stores the IP addresses of up to four servers on this
+list and sets up aliases to them on the emulated addresses 10.0.2.3, 10.0.2.4,
+10.0.2.5 and 10.0.2.6 as needed. </p>
+
+<p>On Linux and OS X, the emulator obtains the DNS server addresses by parsing
+the file <code>/etc/resolv.conf</code>. On Windows, the emulator obtains the
+addresses by calling the <code>GetNetworkParams()</code> API. Note that this
+usually means that the emulator ignores the content of your "hosts" file
+(<code>/etc/hosts</code> on Linux/OS X, <code>%WINDOWS%/system32/HOSTS</code>
+ on Windows).</P>
+
+<p>When starting the emulator at the command line, you can also use the
+<code>-dns-server <serverList></code> option to manually specify the
+addresses of DNS servers to use, where <serverList> is a comma-separated
+list of server names or IP addresses. You might find this option useful if you
+encounter DNS resolution problems in the emulated network (for example, an
+"Unknown Host error" message that appears when using the web browser).</p>
+
+
+<h3 id="proxy">Using the Emulator with a Proxy</h3>
+
+<p>If your emulator must access the Internet through a proxy server, you can use
+the <code>-http-proxy <proxy></code> option when starting the emulator, to
+set up the appropriate redirection. In this case, you specify proxy information
+in <code><proxy></code> in one of these formats:</p>
+
+<pre>http://<machineName>:<port></pre>
+
+<p>or</p>
+
+<pre>http://<username>:<password>@<machineName>:<port></pre>
+
+<p>The <code>-http-proxy</code> option forces the emulator to use the specified
+HTTP/HTTPS proxy for all outgoing TCP connections. Redirection for UDP is not
+currently supported.</p>
+
+<p>Alternatively, you can define the environment variable
+<code>http_proxy</code> to the value you want to use for
+<code><proxy></code>. In this case, you do not need to specify a value for
+<code><proxy></code> in the <code>-http-proxy</code> command — the
+emulator checks the value of the <code>http_proxy</code> environment variable at
+startup and uses its value automatically, if defined. </p>
+
+<p>You can use the <code>-verbose-proxy</code> option to diagnose proxy
+connection problems.</p>
+
+
+<h3 id="connecting">Interconnecting Emulator Instances</h3>
+
+<p>To allow one emulator instance to communicate with another, you must set up
+the necessary network redirection as illustrated below. </p>
+
+<p>Assume that your environment is</p>
+
+<ul>
+ <li>A is you development machine</li>
+ <li>B is your first emulator instance, running on A</li>
+ <li>C is your second emulator instance, also running on A</li>
+</ul>
+
+<p>and you want to run a server on B, to which C will connect, here is how you
+could set it up: </p>
+
+<ol>
+ <li>Set up the server on B, listening to
+<code>10.0.2.15:<serverPort></code></li>
+ <li>On B's console, set up a redirection from
+<code>A:localhost:<localPort></code> to <code>
+B:10.0.2.15:<serverPort></code></li>
+ <li>On C, have the client connect to <code>10.0.2.2:<localPort></code></li>
+</ol>
+
+<p>For example, if you wanted to run an HTTP server, you can select
+<code><serverPort></code> as 80 and <code><localPort></code> as
+8080:</p>
+
+<ul>
+ <li>B listens on 10.0.2.15:80</li>
+ <li>On B's console, issue <code>redir add tcp:8080:80</code></li>
+ <li>C connects to 10.0.2.2:8080</li>
+</ul>
+
+<h3 id="calling">Sending a Voice Call or SMS to Another Emulator Instance</h3>
+
+<p>The emulator automatically forwards simulated voice calls and SMS messages from one instance to
+another. To send a voice call or SMS, use the dialer application or SMS application, respectively,
+from one of the emulators.</p>
+
+<p>To initiate a simulated voice call to another emulator instance:</p>
+<ol>
+<li>Launch the dialer application on the originating emulator instance.</li>
+<li>As the number to dial, enter the console port number of the instance you'd like to call. You can determine
+ the console port number of the target instance by checking its window title, where the
+ console port number is reported as "Android Emulator (<port>). </li>
+<li>Press "Dial". A new inbound call appears in the target emulator instance. </li>
+</ol>
+
+<p>To send an SMS message to another emulator instance, launch the SMS application (if available). Specify the console port number of the target emulator instance as as the SMS address, enter the message text, and send the message. The message is delivered to the target emulator instance. </p>
+
+<p>You can also connect to an emulator instance's console to simulate an incoming voice call or SMS. For more information, see <a href="#telephony">Telephony Emulation</a> and <a href="#sms">SMS Emulation</a>.
+
+
+<h2 id="console">Using the Emulator Console</h2>
+
+<p>Each running emulator instance provides a console that lets you query and control the emulated
+device environment. For example, you can use the console to manage port redirection, network
+characteristics, and telephony events while your application is running on the emulator. To
+access the console and enter commands, use telnet to connect to the console's port number.</p>
+
+<p>To connect to the console of any running emulator instance at any time, use this command: </p>
+
+<pre>telnet localhost <console-port></pre>
+
+<p>An emulator instance occupies a pair of adjacent ports: a console port and an {@code adb} port.
+The port numbers differ by 1, with the {@code adb} port having the higher port number. The console
+of the first emulator instance running on a given machine uses console port 5554 and {@code adb}
+port 5555. Subsequent instances use port numbers increasing by two — for example, 5556/5557,
+5558/5559, and so on. Up to 16 concurrent emulator instances can run a console facility. </p>
+
+<p>To connect to the emulator console, you must specify a valid console port. If multiple emulator instances are running, you need to determine the console port of the emulator instance you want to connect to. You can find the instance's console port listed in the title of the instance window. For example, here's the window title for an instance whose console port is 5554:</p>
+
+<p><code>Android Emulator (5554)</code></p>
+
+<p>Alternatively, you can use the <code>adb devices</code> command, which prints a list of running emulator instances and their console port numbers. For more information, see <a href="{@docRoot}tools/help/adb.html#devicestatus">Querying for Emulator/Device Instances</a> in the adb documentation.</p>
+
+<p class="note">Note: The emulator listens for connections on ports 5554-5587 and accepts connections only from localhost.</p>
+
+<p>Once you are connected to the console, you can then enter <code>help [command]</code> to see a list of console commands and learn about specific commands. </p>
+
+<p>To exit the console session, use <code>quit</code> or <code>exit</code>.</p>
+
+<p>The following sections below describe the major functional areas of the console.</p>
+
+
+<h3 id="portredirection">Port Redirection</h3>
+
+<p>You can use the console to add and remove port redirection while the emulator is running. After
+you connect to the console, manage port redirection by entering the following command:</p>
+
+<pre>redir <list|add|del> </pre>
+
+<p>The <code>redir</code> command supports the subcommands listed in the table below. </p>
+
+<table>
+<tr>
+ <th width="25%" >Subcommand
+ <th width="30%" >Description</th>
+ <th width="35%">Comments</th>
+</tr>
+
+ <tr>
+ <td><code>list</code></td>
+ <td>List the current port redirection.</td>
+ <td> </td>
+ </tr>
+
+
+<tr>
+ <td><code>add <protocol>:<host-port>:<guest-port></code></td>
+ <td>Add a new port redirection.</td>
+<td><ul><li><protocol> must be either "tcp" or "udp"</li>
+<li><host-port> is the port number to open on the host</li>
+<li><guest-port> is the port number to route data to on the emulator/device</li>
+</ul></td>
+</tr>
+<tr>
+ <td><code>del <protocol>:<host-port></code></td>
+ <td>Delete a port redirection.</td>
+<td>The meanings of <protocol> and <host-port> are listed in the previous row.</td>
+</tr>
+</table>
+
+
+<h3 id="geo">Geo Location Provider Emulation</h3>
+
+<p>You can use the console to set the geographic location reported to the applications running
+inside an emulator. Use the <code>geo</code> command to send a simple GPS fix to the
+emulator, with or without NMEA 1083 formatting:</p>
+
+<pre>geo <fix|nmea></pre>
+
+<p>The <code>geo</code> command supports the subcommands listed in the table below.</p>
+
+<table>
+<tr>
+ <th width="25%">Subcommand</th>
+ <th width="30%">Description</th>
+ <th width="35%">Comments</th>
+</tr>
+
+ <tr>
+ <td><code>fix <longitude> <latitude> [<altitude>]</code></td>
+ <td>Send a simple GPS fix to the emulator instance.</td>
+ <td>Specify longitude and latitude in decimal degrees. Specify altitude in meters.</td>
+ </tr>
+<tr>
+ <td><code>nmea <sentence></code></td>
+ <td>Send an NMEA 0183 sentence to the emulated device, as if it were sent from an emulated GPS modem.</td>
+<td><code><sentence></code> must begin with '$GP'. Only '$GPGGA' and '$GPRCM' sentences are currently supported.</td>
+</tr>
+</table>
+
+<p>You can issue the <code>geo</code> command as soon as an emulator instance is running. The
+emulator sets the location you enter by creating a mock location provider. This provider responds to
+location listeners set by applications, and also supplies the location to the {@link
+android.location.LocationManager}. Any application can query the location manager to obtain the
+current GPS fix for the emulated device by calling:
+
+<pre>LocationManager.getLastKnownLocation("gps")</pre>
+
+<p>For more information about the Location Manager, see {@link android.location.LocationManager}.
+</p>
+
+<h3 id="events">Hardware Events Emulation</h3>
+
+<p>The {@code event} console commands sends hardware events to the emulator. The syntax for this
+command is as follows:</p>
+
+<pre>event <send|types|codes|text></pre>
+
+<p>The <code>event</code> command supports the subcommands listed in the table below. </p>
+
+<table>
+<tr>
+ <th width="25%" >Subcommand
+ <th width="30%" >Description</th>
+ <th width="35%">Comments</th>
+</tr>
+
+ <tr>
+ <td><code>send <type>:<code>:<value> [...]</code></td>
+ <td>Send one or more events to the Android kernel. </td>
+ <td>You can use text names or integers for <code><type></code> and <code><value></code>.</td>
+ </tr>
+<tr>
+ <td><code>types</code></td>
+ <td>List all <code><type></code> string aliases supported by the <code>event</code> subcommands.</td>
+<td> </td>
+</tr>
+<tr>
+ <td><code>codes <type></code></td>
+ <td>List all <code><codes></code> string aliases supported by the <code>event</code>
+ subcommands for the specified <code><type></code>.</td>
+<td> </td>
+</tr>
+<tr>
+ <td><code>event text <message></code></td>
+ <td>Simulate keypresses to send the specified string of characters as a message,</td>
+<td>The message must be a UTF-8 string. Unicode posts will be reverse-mapped according to the current device keyboard. Unsupported characters will be discarded silently.</td>
+</tr>
+</table>
+
+
+<h3 id="power">Device Power Characteristics</h3>
+
+<p>The {@code power} command controls the power state reported by the emulator to applications. The
+syntax for this command is as follows: </p>
+
+<pre>power <display|ac|status|present|health|capacity></pre>
+
+<p>The <code>event</code> command supports the subcommands listed in the table below. </p>
+
+<table>
+<tr>
+ <th width="25%" >Subcommand </th>
+ <th width="30%" >Description</th>
+ <th width="35%">Comments</th>
+</tr>
+
+ <tr>
+ <td><code>display</code></td>
+ <td>Display battery and charger state.</td>
+ <td> </td>
+ </tr>
+<tr>
+ <td><code>ac <on|off></code></td>
+ <td>Set AC charging state to on or off. </td>
+<td> </td>
+</tr>
+<tr>
+ <td><code>status <unknown|charging|discharging|not-charging|full></code></td>
+ <td>Change battery status as specified.</td>
+<td> </td>
+</tr>
+
+<tr>
+ <td><code>present <true|false></code></td>
+ <td>Set battery presence state.</td>
+<td> </td>
+</tr>
+<tr>
+ <td><code>health <unknown|good|overheat|dead|overvoltage|failure></code></td>
+ <td>Set battery health state.</td>
+<td> </td>
+</tr>
+<tr>
+ <td><code>power health <percent></code></td>
+ <td>Set remaining battery capacity state (0-100).</td>
+<td> </td>
+</tr>
+</table>
+
+
+<h3 id="netstatus">Network Status</h3>
+
+<p>You can use the console to check the network status and current delay and speed characteristics. To do so, connect to the console and use the <code>netstatus</code> command. Here's an example of the command and its output. </p>
+
+<pre>network status
+</pre>
+
+
+<h3 id="netdelay">Network Delay Emulation</h3>
+
+<p>The emulator lets you simulate various network latency levels, so that you can test your
+application in an environment more typical of the actual conditions in which it will run. You can
+set a latency level or range at emulator startup or you can use the console to change the latency,
+while the application is running in the emulator. </p>
+
+<p>To set latency at emulator startup, use the <code>-netdelay</code> emulator option with a
+supported <code><delay></code> value, as listed in the table below. Here are some
+examples:</p>
+
+<pre>emulator -netdelay gprs
+emulator -netdelay 40 100</pre>
+
+<p>To make changes to network delay while the emulator is running, connect to the console and use
+the <code>netdelay</code> command with a supported <code><delay></code> value from the table
+below.</p>
+
+<pre>network delay gprs</pre>
+
+<p>The format of network <delay> is one of the following (numbers are milliseconds):</p>
+
+<table style="clear:right;width:100%;">
+<tr>
+ <th width="30%" >Value</th>
+ <th width="35%" >Description</th><th width="35%">Comments</th></tr>
+
+ <tr><td><code>gprs</code></td><td>GPRS</td>
+ <td>(min 150, max 550)</td>
+ </tr>
+
+<tr><td><code>edge</code></td><td>EDGE/EGPRS</td>
+<td>(min 80, max 400)</td>
+</tr>
+<tr><td><code>umts</code></td><td>UMTS/3G</td>
+<td>(min 35, max 200)</td>
+</tr>
+<tr><td><code>none</code></td><td>No latency</td><td>(min 0, max 0)</td></tr>
+<tr><td><code><num></code></td>
+<td>Emulate an exact latency (milliseconds).</td>
+<td> </td></tr>
+<tr><td><code><min>:<max></code></td>
+<td>Emulate an specified latency range (min, max milliseconds).</td>
+<td> </td></tr>
+</table>
+
+
+<h3 id="netspeed">Network Speed Emulation</h3>
+
+<p>The emulator also lets you simulate various network transfer rates.
+You can set a transfer rate or range at emulator startup or you can use the console to change the
+rate, while the application is running in the emulator.</p>
+
+<p>To set the network speed at emulator startup, use the <code>-netspeed</code> emulator option with a supported
+<code><speed></code> value, as listed in the table below. Here are some examples:</p>
+
+<pre>emulator -netspeed gsm
+emulator -netspeed 14.4 80</pre>
+
+<p>To make changes to network speed while the emulator is running, connect to the console and use
+the <code>netspeed</code> command with a supported <code><speed></code> value from the table
+below.</p>
+
+<pre>network speed 14.4 80</pre>
+
+<p>The format of network <code><speed></code> is one of the following (numbers are
+kilobits/sec):</p>
+<table style="clear:right;width:100%;">
+<tbody>
+<tr>
+ <th width="30%">Value</th>
+ <th width="35%">Description</th><th width="35%">Comments</th></tr>
+
+ <tr>
+ <td><code>gsm</code></td>
+ <td>GSM/CSD</td><td>(Up: 14.4, down: 14.4)</td></tr>
+<tr>
+ <td><code>hscsd</code></td>
+ <td>HSCSD</td><td>(Up: 14.4, down: 43.2)</td></tr>
+<tr>
+ <td><code>gprs</code></td>
+ <td>GPRS</td><td>(Up: 40.0, down: 80.0)</td></tr>
+<tr>
+ <td><code>edge</code></td>
+ <td>EDGE/EGPRS</td>
+ <td>(Up: 118.4, down: 236.8)</td>
+</tr>
+<tr>
+ <td><code>umts</code></td>
+ <td>UMTS/3G</td><td>(Up: 128.0, down: 1920.0)</td></tr>
+<tr>
+ <td><code>hsdpa</code></td>
+ <td>HSDPA</td><td>(Up: 348.0, down: 14400.0)</td></tr>
+<tr>
+ <td><code>full</code></td>
+ <td>no limit</td><td>(Up: 0.0, down: 0.0)</td></tr>
+<tr>
+ <td><code><num></code></td>
+ <td>Set an exact rate used for both upload and download.</td><td></td></tr>
+<tr>
+ <td><code><up>:<down></code></td>
+ <td>Set exact rates for upload and download separately.</td><td></td></tr>
+</table>
+
+
+<h3 id="telephony">Telephony Emulation</h3>
+
+<p>The Android emulator includes its own GSM emulated modem that lets you simulate telephony
+functions in the emulator. For example, you can simulate inbound phone calls, establish data
+connections and terminate them. The Android system handles simulated calls exactly as it would
+actual calls. The emulator does not support call audio.</p>
+
+<p>You can use the {@code gsm} command to access the emulator's telephony functions after connecting
+to the console. The syntax for this command is as follows:</p>
+
+<pre>gsm <call|accept|busy|cancel|data|hold|list|voice|status> </pre>
+
+<p>The <code>gsm</code> command supports the subcommands listed in the table below. </p>
+<table>
+ <tr>
+ <th>Subcommand </th>
+ <th width="25%">Description</th>
+ <th>Comments</th>
+ </tr>
+ <tr>
+ <td><code>call <phonenumber></code></td>
+ <td>Simulate an inbound phone call from <phonenumber>.</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td><code>accept <phonenumber></code></td>
+ <td>Accept an inbound call from <phonenumber> and change the call's state "active".</td>
+ <td>You can change a call's state to "active" only if its current state is "waiting" or "held".</td>
+ </tr>
+ <tr>
+ <td><code>busy <phonenumber></code></td>
+ <td>Close an outbound call to <phonenumber> and change the call's state to "busy".</td>
+ <td>You can change a call's state to "busy" only if its current state is "waiting".</td>
+ </tr>
+ <tr>
+ <td><code>cancel <phonenumber></code></td>
+ <td>Terminate an inbound or outbound phone call to/from <phonenumber>.</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td><code>data <state></code></td>
+ <td>Change the state of the GPRS data connection to <state>.</td>
+ <td>Supported <state> values are:<br />
+ <ul>
+ <li><code>unregistered</code> -- No network available</li>
+ <li><code>home</code> -- On local network, non-roaming</li>
+ <li><code>roaming</code> -- On roaming network</li>
+ <li><code>searching</code> -- Searching networks</li>
+ <li><code>denied</code> -- Emergency calls only</li>
+ <li><code>off</code> -- Same as 'unregistered'</li>
+ <li><code>on</code> -- same as 'home'</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td><code>hold</code></td>
+ <td>Change the state of a call to "held". </td>
+ <td>You can change a call's state to "held" only if its current state is "active" or "waiting". </td>
+ </tr>
+ <tr>
+ <td><code>list</code></td>
+ <td>List all inbound and outbound calls and their states.</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td><code>voice <state></code></td>
+ <td>Change the state of the GPRS voice connection to <state>.</td>
+ <td>Supported <state> values are:<br />
+ <ul>
+ <li><code>unregistered</code> -- No network available</li>
+ <li><code>home</code> -- On local network, non-roaming</li>
+ <li><code>roaming</code> -- On roaming network</li>
+ <li><code>searching</code> -- Searching networks</li>
+ <li><code>denied</code> -- Emergency calls only</li>
+ <li><code>off</code> -- Same as 'unregistered'</li>
+ <li><code>on</code> -- Same as 'home'</li>
+ </ul>
+ </td>
+ </tr>
+
+ <tr>
+ <td><code>status</code></td>
+ <td>Report the current GSM voice/data state.</td>
+ <td>Values are those described for the <code>voice</code> and <code>data</code> commands.</td>
+ </tr>
+</table>
+
+
+<h3 id="sms">SMS Emulation</h3>
+
+<p>The Android emulator console lets you generate an SMS message and direct it to an emulator
+instance. Once you connect to an emulator instance, you can generate an emulated incoming SMS using
+the following command:</p>
+
+<pre>sms send <senderPhoneNumber> <textmessage></pre>
+
+<p>where <code><senderPhoneNumber></code> contains an arbitrary numeric string. </p>
+
+<p>The console forwards the SMS message to the Android framework, which passes it through to an application that handles that message type. </p>
+
+
+<h3 id="vm">VM State</h3>
+
+<p>You can use the <code>vm</code> command to control the VM on an emulator instance. The syntax for
+this command is as follows: </p>
+
+<pre>vm <start|stop|status></pre>
+
+<p>The <code>vm</code> command supports the subcommands listed in the table below. </p>
+
+<table>
+<tr>
+ <th width="25%">Subcommand</th>
+ <th width="30%">Description</th>
+ <th width="35%">Comments</th>
+</tr>
+<tr>
+ <td><code>start</code></td>
+ <td>Start the VM on the instance. </td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>stop</code></td>
+ <td>Stop the VM on the instance. </td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>start</code></td>
+ <td>Display the current status of the VM (running or stopped). </td>
+ <td> </td>
+</tr>
+</table>
+
+
+<h3 id="window">Emulator Window</h3>
+
+<p>You can use the <code>window</code> command to manage the emulator window. The syntax for this
+command is as follows: </p>
+
+<pre>window <scale></pre>
+
+<p>The <code>vm</code> command supports the subcommands listed in the table below. </p>
+
+<table>
+<tr>
+ <th width="25%">Subcommand</th>
+ <th width="30%">Description</th>
+ <th width="35%">Comments</th>
+</tr>
+<tr>
+ <td><code>scale <scale></code></td>
+ <td>Scale the emulator window.</td>
+ <td>A number between 0.1 and 3 that sets the scaling factor. You can
+ also specify scale as a DPI value if you add the suffix "dpi" to the scale value. A value of "auto"
+ tells the emulator to select the best window size.</td>
+</tr>
+</table>
+
+
+<h3 id="terminating">Terminating an Emulator Instance</h3>
+
+<p>You can terminate an emulator instance through the console, using the <code>kill</code> command.</p>
+
+
+<h2 id="limitations">Emulator Limitations</h2>
+
+<p>The functional limitations of the emulator include: </p>
+<ul>
+ <li>No support for placing or receiving actual phone calls. You can simulate phone calls (placed
+ and received) through the emulator console, however. </li>
+ <li>No support for USB connections</li>
+ <li>No support for device-attached headphones</li>
+ <li>No support for determining network connected state</li>
+ <li>No support for determining battery charge level and AC charging state</li>
+ <li>No support for determining SD card insert/eject</li>
+ <li>No support for Bluetooth</li>
+</ul>
+
+
+<h2 id="troubleshooting">Troubleshooting Emulator Problems</h2>
+
+<p>The {@code adb} utility sees the emulator as an actual physical device. For this reason, you
+might have to use the {@code -d} flag with some common {@code adb} commands, such as
+<code>install</code>. The {@code -d} flag lets you specify which of several connected devices to use
+as the target of a command. If you don't specify {@code -d}, the emulator targets the first
+device in its list. For more information about {@code adb}, see <a
+href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a>.</p>
+
+<p>For emulators running on Mac OS X, if you see an error {@code Warning: No DNS servers found}
+when starting the emulator, check to see whether you have an <code>/etc/resolv.conf</code> file. If
+not, please run the following line in a command window:</p>
+ <pre>ln -s /private/var/run/resolv.conf /etc/resolv.conf</pre>
+
+<p>See <a href="{@docRoot}resources/faq/index.html">Frequently Asked Questions</a> for more
+troubleshooting information. </p>
diff --git a/docs/html/tools/devices/index.jd b/docs/html/tools/devices/index.jd
new file mode 100644
index 0000000..bec2268
--- /dev/null
+++ b/docs/html/tools/devices/index.jd
@@ -0,0 +1,78 @@
+page.title=Managing Virtual Devices
+@jd:body
+
+
+ <p>An Android Virtual Device (AVD) is an emulator configuration that lets you model an actual
+ device by defining hardware and software options to be emulated by the Android Emulator.</p>
+
+ <p>The easiest way to create an AVD is to use the graphical <a href=
+ "{@docRoot}tools/devices/managing-avds.html">AVD Manager</a>, which you launch
+ from Eclipse by clicking <strong>Window > AVD Manager</strong>. You can also start the AVD
+Manager from the command line by calling the <code>android</code> tool with the <code>avd</code>
+options, from the <strong><sdk>/tools/</strong> directory.</p>
+
+ <p>You can also create AVDs on the command line by passing the <code>android</code> tool options.
+ For more information on how to create AVDs in this manner, see <a href=
+ "{@docRoot}tools/devices/managing-avds-cmdline.html">Managing Virtual
+ Devices from the Command Line</a>.</p>
+
+ <p>An AVD consists of:</p>
+
+ <ul>
+ <li>A hardware profile: Defines the hardware features of the virtual
+ device. For example, you can define whether the device has a camera, whether it uses a physical
+ QWERTY keyboard or a dialing pad, how much memory it has, and so on.</li>
+
+ <li>A mapping to a system image: You can define what version of the Android platform will run
+ on the virtual device. You can choose a version of the standard Android platform or the system
+ image packaged with an SDK add-on.</li>
+
+ <li>Other options: You can specify the emulator skin you want to use with the AVD, which lets
+ you control the screen dimensions, appearance, and so on. You can also specify the emulated SD
+ card to use with the AVD.</li>
+
+ <li>A dedicated storage area on your development machine: the device's user data (installed
+ applications, settings, and so on) and emulated SD card are stored in this area.</li>
+ </ul>
+
+ <p>You can create as many AVDs as you need, based on the types of device you want to model.
+ To thoroughly test your application, you should create an AVD for each general device configuration
+ (for example, different screen sizes and platform versions) with which your application is compatible
+ and test your application on each one.</p>
+
+ <p>Keep these points in mind when you are selecting a system image target for your AVD:</p>
+
+ <ul>
+ <li>The API Level of the target is important, because your application will not be able to run
+ on a system image whose API Level is less than that required by your application, as specified
+ in the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">
+ <code>minSdkVersion</code></a> attribute of the application's manifest file. For more
+ information about the relationship between system API Level and application
+ <code>minSdkVersion</code>, see <a href=
+ "{@docRoot}tools/publishing/versioning.html">Specifying Minimum System API Version</a>.</li>
+
+ <li>You should create at least one AVD that uses a target whose API Level is greater than that required
+ by your application, because it allows you to test the
+ forward-compatibility of your application. Forward-compatibility testing ensures that, when
+ users who have downloaded your application receive a system update, your application will
+ continue to function normally.</li>
+
+ <li>If your application declares a
+ <a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><code>uses-library</code></a>
+ element in its manifest file, the application can only run on a system image in which that external
+ library is present. If you want to run your application on an emulator, create an AVD that
+ includes the required library. Usually, you must create such an AVD using an Add-on component for the
+ AVD's platform (for example, the Google APIs Add-on contains the Google Maps library).</li>
+ </ul>
+
+ <p>To learn how to manage AVDs using a graphical tool, read <a href=
+ "{@docRoot}tools/devices/managing-avds.html">Managing AVDs with AVD Manager</a>. To
+learn how to manage AVDs on the command line, read
+ <a href="{@docRoot}tools/devices/managing-avds-cmdline.html">Managing AVDs
+ from the Command Line</a>.</p>
+
+
+
+
+
+
diff --git a/docs/html/tools/devices/managing-avds-cmdline.jd b/docs/html/tools/devices/managing-avds-cmdline.jd
new file mode 100644
index 0000000..ba353c1
--- /dev/null
+++ b/docs/html/tools/devices/managing-avds-cmdline.jd
@@ -0,0 +1,369 @@
+page.title=Managing AVDs from the Command Line
+parent.title=Managing Virtual Devices
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#listingtargets">Listing Targets</a></li>
+ <li><a href="#AVDCmdLine">Creating AVDs</a>
+ <ol>
+ <li><a href="#CustomDensity">Customize the device resolution or density</a></li>
+ <li><a href="#DefaultLocation">Default location of AVD files</a></li>
+ <li><a href="#hardwareopts">Setting hardware emulation options</a></li>
+ </ol>
+ </li>
+ <li><a href="#moving">Moving an AVD</a></li>
+ <li><a href="#updating">Updating an AVD</a></li>
+ <li><a href="#deleting">Deleting an AVD</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}tools/building/building-cmdline.html">Building and Running
+from the Command Line</a></li>
+ <li><a href="{@docRoot}tools/devices/emulator.html">Using the Android
+Emulator</a></li>
+ </ol>
+ </div>
+</div>
+
+
+<p>The <code>android</code> tool lets you manage AVDs on the command line. For a complete reference
+of the command line options that you can use, see the reference for the
+<a href="{@docRoot}tools/help/android.html"><code>android</code></a> tool.</p>
+
+
+
+<h2 id="listingtargets">Listing Targets</h2>
+
+<p>To generate a list of system image targets, use this command: </p>
+
+<pre>android list targets</pre>
+
+<p>The <code>android</code> tool scans the <code><sdk>/platforms/</code> and
+<code><sdk>/add-ons/</code> directories looking for valid system images and
+then generates the list of targets. Here's an example of the command output:
+</p>
+
+<pre>Available Android targets:
+id: 1 or "android-3"
+ Name: Android 1.5
+ Type: Platform
+ API level: 3
+ Revision: 4
+ Skins: QVGA-L, HVGA-L, HVGA (default), HVGA-P, QVGA-P
+id: 2 or "android-4"
+ Name: Android 1.6
+ Type: Platform
+ API level: 4
+ Revision: 3
+ Skins: QVGA, HVGA (default), WVGA800, WVGA854
+id: 3 or "android-7"
+ Name: Android 2.1-update1
+ Type: Platform
+ API level: 7
+ Revision: 2
+ Skins: QVGA, WQVGA400, HVGA (default), WVGA854, WQVGA432, WVGA800
+id: 4 or "android-8"
+ Name: Android 2.2
+ Type: Platform
+ API level: 8
+ Revision: 2
+ Skins: WQVGA400, QVGA, WVGA854, HVGA (default), WVGA800, WQVGA432
+id: 5 or "android-9"
+ Name: Android 2.3
+ Type: Platform
+ API level: 9
+ Revision: 1
+ Skins: HVGA (default), WVGA800, WQVGA432, QVGA, WVGA854, WQVGA400
+</pre>
+
+
+
+<h2 id="AVDCmdLine">Creating AVDs</h2>
+
+<p>In addition to creating AVDs with the
+<a href="{@docRoot}tools/devices/managing-avds-cmdline.html">AVD Manager user interface</a>,
+you can also create them by passing in command line arguments to the <code>android</code> tool.
+</p>
+
+<p>Open a terminal window and change to
+the <code><sdk>/tools/</code> directory, if needed.</p>
+
+<p>To create each AVD, you issue the command <code>android create avd</code>,
+with options that specify a name for the new AVD and the system image you want
+to run on the emulator when the AVD is invoked. You can specify other options on
+the command line also, such as the emulated SD card size, the emulator skin, or a custom
+location for the user data files.</p>
+
+<p>Here's the command-line usage for creating an AVD: </p>
+
+<pre>android create avd -n <name> -t <targetID> [-<option> <value>] ... </pre>
+
+<p>You can use any name you want for the AVD, but since you are likely to be
+creating multiple AVDs, you should choose a name that lets you recognize the
+general characteristics offered by the AVD. The target ID is an integer assigned by the
+<code>android</code> tool. The target ID is not derived from the system image name,
+version, or API Level, or other attribute, so you need to run the <code>android list targets</code>
+command to list the target ID of each system image. You should do this <em>before</em> you run
+the <code>android create avd</code> command. See the <a
+href="{@docRoot}tools/help/android.html">android</a>
+tool documentation for more information on the command line options.</p>
+
+
+<p>When you've selected the target you want to use and made a note of its ID,
+use the <code>android create avd</code> command to create the AVD, supplying the
+target ID as the <code>-t</code> argument. Here's an example that creates an
+AVD with name "my_android1.5" and target ID "2" (the standard Android 1.5
+system image in the list above): </p>
+
+<pre>android create avd -n my_android1.5 -t 2</pre>
+
+<p>If the target you selected was a standard Android system image ("Type:
+platform"), the <code>android</code> tool next asks you whether you want to
+create a custom hardware profile. </p>
+<pre>Android 1.5 is a basic Android platform.
+Do you wish to create a custom hardware profile [no]</pre>
+
+<p>If you want to set custom hardware emulation options for the AVD, enter
+"yes" and set values as needed. If you want to use the default hardware
+emulation options for the AVD, just press the return key (the default is "no").
+The <code>android</code> tool creates the AVD with name and system image mapping you
+requested, with the options you specified. For more information, see <a href="#hardwareopts">
+Setting Hardware Emulation Options</a>.
+
+<p class="note"><strong>Note:</strong> If you are creating an AVD whose target is an SDK add-on, the
+<code>android</code> tool does not allow you to set hardware emulation options.
+It assumes that the provider of the add-on has set emulation options
+appropriately for the device that the add-on is modeling, and so prevents you
+from resetting the options. </p>
+
+
+<h3 id="CustomDensity">Customize the device resolution or density</h3>
+
+<p>When testing your application, we recommend that you test your application in several different
+AVDs, using different screen configurations (different combinations of size and density). In
+addition, you should set up the AVDs to run at a physical size that closely matches an actual
+device.</p>
+
+<p>To set up your AVDs for a specific resolution or density, follow these steps:</p>
+
+<ol>
+ <li>Use the <code>create avd</code> command to create a new AVD, specifying
+the <code>--skin</code> option with a value that references either a default
+skin name (such as "WVGA800") or a custom skin resolution (such as 240x432).
+Here's an example:
+ <pre>android create avd -n <name> -t <targetID> --skin WVGA800</pre>
+ </li>
+ <li>To specify a custom density for the skin, answer "yes" when asked whether
+you want to create a custom hardware profile for the new AVD.</li>
+ <li>Continue through the various profile settings until the tool asks you to
+specify "Abstracted LCD density" (<em>hw.lcd.density</em>). Enter an appropriate
+value, such as "120" for a low-density screen, "160" for a medium density screen,
+or "240" for a high-density screen.</li>
+ <li>Set any other hardware options and complete the AVD creation.</li>
+</ol>
+
+<p>In the example above (WVGA medium density), the new AVD will emulate a 5.8"
+WVGA screen.</p>
+
+<p>As an alternative to adjusting the emulator skin configuration, you can use
+the emulator skin's default density and add the <code>-dpi-device</code> option
+to the <a href="{@docRoot}tools/help/emulator.html">emulator</a> command line when
+starting the AVD. For example:</p>
+
+<pre>emulator -avd WVGA800 -scale 96dpi -dpi-device 160</pre>
+
+
+
+<h3 id="DefaultLocation">Default location of AVD files</h3>
+
+<p>When you create an AVD, the <code>android</code> tool creates a dedicated directory for it
+on your development computer. The directory contains the AVD configuration file,
+the user data image and SD card image (if available), and any other files
+associated with the device. Note that the directory does not contain a system
+image — instead, the AVD configuration file contains a mapping to the
+system image, which it loads when the AVD is launched. </p>
+
+<p>The <code>android</code> tool also creates an <code><AVD_name>.ini</code> file for the AVD at the
+root of the <code>.android/avd/</code> directory on your computer. The file specifies the
+location of the AVD directory and always remains at the root the .android
+directory.</p>
+
+<p>By default, the <code>android</code> tool creates the AVD directory inside
+<code>~/.android/avd/</code> (on Linux/Mac), <code>C:\Documents and
+Settings\<user>\.android\</code> on Windows XP, and
+<code>C:\Users\<user>\.android\</code> on Windows 7 and Vista.
+If you want to use a custom location for the AVD directory, you
+can do so by using the <code>-p <path></code> option when
+you create the AVD: </p>
+
+<pre>android create avd -n my_android1.5 -t 2 -p path/to/my/avd</pre>
+
+<p>If the .android directory is hosted on a network drive, we recommend using
+the <code>-p</code> option to place the AVD directory in another location.
+The AVD's .ini file remains in the .android directory on the network
+drive, regardless of the location of the AVD directory.
+
+
+<h3 id="hardwareopts">Setting hardware emulation options</h3>
+
+<p>When you are creating a new AVD that uses a standard Android system image ("Type:
+platform"), the <code>android</code> tool lets you set hardware emulation
+options for virtual device. The table below lists the options available and the
+default values, as well as the names of properties that store the emulated
+hardware options in the AVD's configuration file (the config.ini file in the
+AVD's local directory). </p>
+
+<p class="table-caption"><strong>Table 1.</strong> Available hardware profile options for AVDs and
+the default values </p>
+
+<table>
+<tr>
+<th>Characteristic</th>
+<th>Description</th>
+<th>Property</th>
+</tr>
+
+<tr>
+<td>Device ram size</td>
+<td>The amount of physical RAM on the device, in megabytes. Default value is "96".
+<td>hw.ramSize</td>
+</tr>
+
+<tr>
+<td>Touch-screen support</td>
+<td>Whether there is a touch screen or not on the device. Default value is "yes".</td>
+<td>hw.touchScreen
+
+<tr>
+<td>Trackball support </td>
+<td>Whether there is a trackball on the device. Default value is "yes".</td>
+<td>hw.trackBall</td>
+</tr>
+
+<tr>
+<td>Keyboard support</td>
+<td>Whether the device has a QWERTY keyboard. Default value is "yes".</td>
+<td>hw.keyboard</td>
+</tr>
+
+<tr>
+<td>DPad support</td>
+<td>Whether the device has DPad keys. Default value is "yes".</td>
+<td>hw.dPad</td>
+</tr>
+
+<tr>
+<td>GSM modem support</td>
+<td>Whether there is a GSM modem in the device. Default value is "yes".</td>
+<td>hw.gsmModem</td>
+</tr>
+
+<tr>
+<td>Camera support</td>
+<td>Whether the device has a camera. Default value is "no".</td>
+<td>hw.camera</td>
+</tr>
+
+<tr>
+<td>Maximum horizontal camera pixels</td>
+<td>Default value is "640".</td>
+<td>hw.camera.maxHorizontalPixels</td>
+</tr>
+
+<tr>
+<td>Maximum vertical camera pixels</td>
+<td>Default value is "480".</td>
+<td>hw.camera.maxVerticalPixels</td>
+</tr>
+
+<tr>
+<td>GPS support</td>
+<td>Whether there is a GPS in the device. Default value is "yes".</td>
+<td>hw.gps</td>
+</tr>
+
+<tr>
+<td>Battery support</td>
+<td>Whether the device can run on a battery. Default value is "yes".</td>
+<td>hw.battery</td>
+</tr>
+
+<tr>
+<td>Accelerometer</td>
+<td>Whether there is an accelerometer in the device. Default value is "yes".</td>
+<td>hw.accelerometer</td>
+</tr>
+
+<tr>
+<td>Audio recording support</td>
+<td>Whether the device can record audio. Default value is "yes".</td>
+<td>hw.audioInput</td>
+</tr>
+
+<tr>
+<td>Audio playback support</td>
+<td>Whether the device can play audio. Default value is "yes".</td>
+<td>hw.audioOutput</td>
+</tr>
+
+<tr>
+<td>SD Card support</td>
+<td>Whether the device supports insertion/removal of virtual SD Cards. Default value is "yes".</td>
+<td>hw.sdCard</td>
+</tr>
+
+<tr>
+<td>Cache partition support</td>
+<td>Whether we use a /cache partition on the device. Default value is "yes".</td>
+<td>disk.cachePartition</td>
+</tr>
+
+<tr>
+<td>Cache partition size</td>
+<td>Default value is "66MB".</td>
+<td>disk.cachePartition.size </td>
+</tr>
+
+<tr>
+<td>Abstracted LCD density</td>
+<td>Sets the generalized density characteristic used by the AVD's screen. Default value is "160".</td>
+<td>hw.lcd.density </td>
+</tr>
+
+<tr>
+<td>Trackball support</td>
+<td>Whether there is a trackball present.</td>
+<td>hw.trackBall </td>
+</tr>
+</table>
+
+
+<h2 id="moving">Moving an AVD</h2>
+
+<p>If you want to move or rename an AVD, you can do so using this command:</p>
+
+<pre>android move avd -n <name> [-<option> <value>] ...</pre>
+
+<h2 id="updating">Updating an AVD</h2>
+
+<p>If, for any reason, the platform/add-on root folder has its name changed (maybe because the user has installed an update of the platform/add-on) then the AVD will not be able to load the system image that it is mapped to. In this case, the <code>android list targets</code> command will produce this output:
+
+<pre>The following Android Virtual Devices could not be loaded:
+Name: foo
+Path: <path>/.android/avd/foo.avd
+Error: Invalid value in image.sysdir. Run 'android update avd -n foo' </pre>
+
+<p>To fix this error, use the <code>android update avd</code> command to recompute the path to the system images.</p>
+
+<h2 id="deleting">Deleting an AVD</h2>
+
+<p>You can use the <code>android</code> tool to delete an AVD. Here is the command usage:</p>
+
+<pre>android delete avd -n <name> </pre>
+
+<p>When you issue the command, the <code>android</code> tool looks for an AVD matching the
+specified name deletes the AVD's directory and files. </p>
diff --git a/docs/html/guide/developing/devices/managing-avds.jd b/docs/html/tools/devices/managing-avds.jd
similarity index 100%
rename from docs/html/guide/developing/devices/managing-avds.jd
rename to docs/html/tools/devices/managing-avds.jd
diff --git a/docs/html/tools/eclipse-adt.html b/docs/html/tools/eclipse-adt.html
new file mode 100644
index 0000000..0d59d49
--- /dev/null
+++ b/docs/html/tools/eclipse-adt.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/tools/projects/projects-eclipse.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/tools/projects/projects-eclipse.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/tools/extras/index.jd b/docs/html/tools/extras/index.jd
new file mode 100644
index 0000000..8da26dc
--- /dev/null
+++ b/docs/html/tools/extras/index.jd
@@ -0,0 +1,5 @@
+page.title=Extras
+page.noplus=1
+@jd:body
+
+<p>SDK extras add functionality to your development environment. You can download all of the SDK extras into your development environment using the SDK Manager. </p>
diff --git a/docs/html/tools/extras/oem-usb.jd b/docs/html/tools/extras/oem-usb.jd
new file mode 100644
index 0000000..f7aa192
--- /dev/null
+++ b/docs/html/tools/extras/oem-usb.jd
@@ -0,0 +1,328 @@
+page.title=OEM USB Drivers
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#InstallingDriver">Installing a USB Driver</a>
+ <ol>
+ <li><a href="#Win7">Windows 7</a></li>
+ <li><a href="#WinXp">Windows XP</a></li>
+ <li><a href="#WinVista">Windows Vista</a></li>
+ </ol>
+ </li>
+ <li><a href="#Drivers">OEM Drivers</a></li>
+ </ol>
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}tools/device.html">Using Hardware Devices</a></li>
+ <li><a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a></li>
+ </ol>
+</div>
+</div>
+
+<p>If you are developing on Windows and would like to connect an Android-powered device
+to test your applications, then you need to install the appropriate USB driver. This document
+provides links to the web sites for several original equipment manufacturers (OEMs),
+where you can download the appropriate USB driver for your device. However, this list is
+not exhaustive for all available Android-powered devices.</p>
+
+<p>If you're developing on Mac OS X or Linux, then you probably don't need to install a USB driver.
+To start developing with your device, read <a
+href="{@docRoot}tools/device.html">Using Hardware Devices</a>.</p>
+
+<p class="note"><strong>Note:</strong> If your device is one of the Android Developer Phones
+(ADP), a Nexus One, or a Nexus S, then you need
+the <a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a>, instead of an OEM driver. The Galaxy
+Nexus driver, however, is distributed by <a
+href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a>
+(listed as model SCH-I515).</p>
+
+
+<h2 id="InstallingDriver">Installing a USB Driver</h2>
+
+<p>First, find the appropriate driver for your device from the <a href="#Drivers">OEM drivers</a>
+table below.</p>
+
+<p>Once you've downloaded your USB driver, follow the instructions below to install or upgrade the
+driver, based on your version of Windows and whether you're installing for the first time
+or upgrading an existing driver.</p>
+
+<p class="note"><strong>Tip:</strong> When you finish the USB driver installation,
+see <a
+href="{@docRoot}tools/device.html">Using Hardware Devices</a> for
+other important information about using an Android-powered device for
+development.</p>
+
+<ol class="nolist">
+ <li><a href="#Win7">Windows 7</a></li>
+ <li><a href="#WinXp">Windows XP</a></li>
+ <li><a href="#WinVista">Windows Vista</a></li>
+</ol>
+
+
+<p class="caution"><strong>Caution:</strong>
+You may make changes to <code>android_winusb.inf</code> file found inside
+<code>usb_driver\</code> (for example, to add support for other devices),
+however, this will lead to security warnings when you install or upgrade the
+driver. Making any other changes to the driver files may break the installation
+process.</p>
+
+
+<h3 id="Win7">Windows 7</h3>
+
+
+<p>To install the Android USB driver on Windows 7 for the first time:</p>
+<ol>
+ <li>Connect your Android-powered device to your computer's USB port.</li>
+ <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer,
+ and select <strong>Manage</strong>.</li>
+ <li>Select <strong>Devices</strong> in the left pane.</li>
+ <li>Locate and expand <em>Other device</em> in the right pane.</li>
+ <li>Right-click the device name (such as <em>Nexus S</em>) and select <strong>Update
+ Driver Software</strong>.
+ This will launch the Hardware Update Wizard.</li>
+ <li>Select <strong>Browse my computer for driver software</strong> and click
+ <strong>Next</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li>
+ <li>Click <strong>Next</strong> to install the driver.</li>
+</ol>
+
+<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows 7 with the new
+driver:</p>
+
+<ol>
+ <li>Connect your Android-powered device to your computer's USB port.</li>
+ <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer,
+ and select <strong>Manage</strong>.</li>
+ <li>Select <strong>Device Manager</strong> in the left pane of the Computer Management
+ window.</li>
+ <li>Locate and expand <em>Android Phone</em> in the right pane.</li>
+ <li>Right-click <em>Android Composite ADB Interface</em> and select <strong>Update
+ Driver</strong>.
+ This will launch the Hardware Update Wizard.</li>
+ <li>Select <strong>Install from a list or specific location</strong> and click
+ <strong>Next</strong>.</li>
+ <li>Select <strong>Search for the best driver in these locations</strong>; un-check
+<strong>Search removable media</strong>; and check <strong>Include this location in the
+search</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li>
+ <li>Click <strong>Next</strong> to upgrade the driver.</li>
+</ol>
+
+
+
+
+
+<h3 id="WinXp">Windows XP</h3>
+
+<p>To install the Android USB driver on Windows XP for the first time:</p>
+
+<ol>
+ <li>Connect your Android-powered device to your computer's USB port. Windows
+ will detect the device and launch the Hardware Update Wizard.</li>
+ <li>Select <strong>Install from a list or specific location</strong> and click
+ <strong>Next</strong>.</li>
+ <li>Select <strong>Search for the best driver in these locations</strong>; un-check
+<strong>Search
+ removable media</strong>; and check <strong>Include
+this location in the search</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li>
+ <li>Click <strong>Next</strong> to install the driver.</li>
+</ol>
+
+<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows XP with the new
+driver:</p>
+
+<ol>
+ <li>Connect your Android-powered device to your computer's USB port.</li>
+ <li>Right-click on <em>My Computer</em> from your desktop or Windows Explorer,
+ and select <strong>Manage</strong>.</li>
+ <li>Select <strong>Device Manager</strong> in the left pane.</li>
+ <li>Locate and expand <em>Android Phone</em> in the right pane.</li>
+ <li>Right-click <em>Android Composite ADB Interface</em> and select <strong>Update
+ Driver</strong>.
+ This will launch the Hardware Update Wizard.</li>
+ <li>Select <strong>Install from a list or specific location</strong> and click
+ <strong>Next</strong>.</li>
+ <li>Select <strong>Search for the best driver in these locations</strong>; un-check <strong>Search
+ removable media</strong>; and check <strong>Include
+this location in the search</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li>
+ <li>Click <strong>Next</strong> to upgrade the driver.</li>
+</ol>
+
+
+
+<h3 id="WinVista">Windows Vista</h3>
+
+<p>To install the Android USB driver on Windows Vista for the first time:</p>
+
+<ol>
+ <li>Connect your Android-powered device to your computer's USB port. Windows
+ will detect the device and launch the Found New Hardware wizard.</li>
+ <li>Select <strong>Locate and install driver software</strong>.</li>
+ <li>Select <strong>Don't search online</strong>.</li>
+ <li>Select <strong>I don't have the disk. Show me other options</strong>.</li>
+ <li>Select <strong>Browse my computer for driver software</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\extras\google\usb_driver\}.) As long as you specified the
+exact location of the
+ installation package, you may leave <strong>Include subfolders</strong> checked or
+ unchecked—it doesn't matter.</li>
+ <li>Click <strong>Next</strong>. Vista may prompt you to confirm the privilege elevation
+ required for driver installation. Confirm it.</li>
+ <li>When Vista asks if you'd like to install the Google ADB Interface device,
+ click <strong>Install</strong> to install the driver.</li>
+</ol>
+
+<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows Vista with the new
+driver:</p>
+
+<ol>
+ <li>Connect your Android-powered device to your computer's USB port.</li>
+ <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer,
+ and select <strong>Manage</strong>.</li>
+ <li>Select <strong>Device Manager</strong> in the left pane.</li>
+ <li>Locate and expand <em>ADB Interface</em> in the right pane.</li>
+ <li>Right-click on <em>HTC Dream Composite ADB Interface</em>, and select <strong>Update
+ Driver Software</strong>.</li>
+ <li>When Vista starts updating the driver, a prompt will ask how you want to
+ search for the driver
+ software. Select <strong>Browse my computer for driver software</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\extras\google\usb_driver\}.) As long as you specified the
+exact location of the
+ installation package, you may leave <strong>Include subfolders</strong> checked or
+ unchecked—it doesn't matter.</li>
+ <li>Click <strong>Next</strong>. Vista might prompt you to confirm the privilege elevation
+ required for driver installation. Confirm it.</li>
+ <li>When Vista asks if you'd like to install the Google ADB Interface device,
+ click <strong>Install</strong> to upgrade the driver.</li>
+</ol>
+
+
+<h2 id="Drivers">OEM Drivers</h2>
+
+<p class="note"><strong>Note:</strong> If your device is one of the Android Developer Phones
+(purchased from the Google Play publisher site), a Nexus One, or a Nexus S, then you need
+the <a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a>, instead of an OEM driver. The Galaxy
+Nexus driver, however, is distributed by <a
+href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a>
+(listed as model SCH-I515).</p>
+
+
+<table><tr>
+ <th>OEM</th>
+ <th>Driver URL</th></tr>
+<tr><td>Acer</td> <td><a
+href="http://www.acer.com/worldwide/support/mobile.html">http://www.acer.com/worldwide/support/mobile.html</a>
+ </td></tr>
+ <tr>
+ <td style="font-variant:small-caps">alcatel one touch</td>
+ <td><a
+href="http://www.alcatel-mobilephones.com/global/Android-Downloads">http://www.alcatel-mobilephones.com/global/Android-Downloads</a></td>
+ </tr>
+ <tr>
+ <td>Asus</td>
+ <td><a href="http://support.asus.com/download/">http://support.asus.com/download/</a></td>
+ </tr>
+ <tr><td>
+ Dell
+ </td> <td>
+ <a
+href="http://support.dell.com/support/downloads/index.aspx?c=us&cs=19&l=en&s=dhs&~ck=anavml">http://support.dell.com/support/downloads/index.aspx?c=us&cs=19&l=en&s=dhs&~ck=anavml</a> </td></tr>
+
+<tr><td>Foxconn</td> <td><a
+href="http://drivers.cmcs.com.tw/">http://drivers.cmcs.com.tw/</a></td>
+</tr>
+ <tr>
+ <td>
+ Fujitsu
+ </td>
+ <td><a
+href="http://www.fmworld.net/product/phone/sp/android/develop/">http://www.fmworld.net/product/phone/sp/android/develop/</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Fujitsu Toshiba
+ </td>
+ <td><a
+href="http://www.fmworld.net/product/phone/sp/android/develop/">http://www.fmworld.net/product/phone/sp/android/develop/</a>
+ </td>
+ </tr>
+ <tr><td>
+ Garmin-Asus
+ </td> <td><a
+href="https://www.garminasus.com/en_US/support/pcsync/">https://www.garminasus.com/en_US/support/pcsync/</a></td>
+</tr>
+
+<tr><td>Hisense</td>
+ <td><a
+href="http://app.hismarttv.com/dss/resourcecontent.do?method=viewResourceDetail&resourceId=16&type=5">http://app.hismarttv.com/dss/resourcecontent.do?method=viewResourceDetail&resourceId=16&type=5 </a></td>
+</tr>
+
+<tr><td>HTC</td> <td><a href="http://www.htc.com">http://www.htc.com </a> <br>Click on the
+support tab to select your products/device. Different regions will have different links.</td>
+</tr>
+
+<tr><td>Huawei</td> <td><a
+href="http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index">http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index</a></td>
+</tr>
+
+<tr><td>Intel</td> <td><a
+href="http://www.intel.com/software/android">http://www.intel.com/software/android</a></td>
+</tr>
+
+<tr><td>KT Tech</td> <td><a
+href="http://www.kttech.co.kr/cscenter/download05.asp">http://www.kttech.co.kr/cscenter/download05.asp</a> for EV-S100 (Take)</td>
+</tr>
+ <tr>
+ <td>
+ Kyocera
+ </td>
+ <td><a href="http://www.kyocera-wireless.com/support/phone_drivers.htm">http://www.kyocera-wireless.com/support/phone_drivers.htm</a>
+ </td>
+ </tr>
+ <tr>
+ <td>Lenevo</td>
+ <td><a href="http://developer.lenovomm.com/developer/download.jsp"
+ >http://developer.lenovomm.com/developer/download.jsp</a>
+ </td>
+ </tr>
+ <tr><td>LGE</td> <td><a
+href="http://www.lg.com/us/mobile-phones/mobile-support/mobile-lg-mobile-phone-support.jsp">http://www.lg.com/us/mobile-phones/mobile-support/mobile-lg-mobile-phone-support.jsp</a></td>
+</tr><tr><td>Motorola</td> <td><a
+href="http://developer.motorola.com/docstools/USB_Drivers/">http://developer.motorola.com/docstools/USB_Drivers/</a></td>
+</tr><tr><td>Pantech</td> <td><a
+href="http://www.isky.co.kr/cs/software/software.sky?fromUrl=index">http://www.isky.co.kr/cs/software/software.sky?fromUrl=index</a></td>
+</tr><tr><td>Pegatron</td> <td><a
+href="http://www.pegatroncorp.com/download/New_Duke_PC_Driver_0705.zip">http://www.pegatroncorp.com/download/New_Duke_PC_Driver_0705.zip</a> (ZIP download)</td>
+</tr><tr><td>Samsung</td> <td><a
+href="http://www.samsung.com/us/support/downloads">http://www.samsung.com/us/support/downloads</a></td>
+</tr><tr><td>Sharp</td> <td><a
+href="http://k-tai.sharp.co.jp/support/">http://k-tai.sharp.co.jp/support/</a></td>
+</tr><tr><td>SK Telesys</td> <td><a
+href="http://www.sk-w.com/service/wDownload/wDownload.jsp">http://www.sk-w.com/service/wDownload/wDownload.jsp</a></td></tr><tr>
+<td>Sony Ericsson</td> <td><a
+href="http://developer.sonyericsson.com/wportal/devworld/search-downloads/driver?cc=gb&lc=en">http://developer.sonyericsson.com/wportal/devworld/search-downloads/driver?cc=gb&lc=en</a></td></tr>
+
+<tr><td>Teleepoch</td> <td><a
+href="http://www.teleepoch.com/android.html">http://www.teleepoch.com/android.html</a></td>
+</tr>
+
+<tr><td>Yulong Coolpad</td> <td><a
+href="http://www.yulong.com/product/product/product/downloadList.html#downListUL">http://www.yulong.com/product/product/product/downloadList.html#downListUL</a></td>
+</tr>
+
+<tr>
+<td>ZTE</td> <td><a
+href="http://support.zte.com.cn/support/news/NewsDetail.aspx?newsId=1000442">http://support.zte.com.cn/support/news/NewsDetail.aspx?newsId=1000442</a></td></tr>
+</table>
diff --git a/docs/html/tools/extras/support-library.jd b/docs/html/tools/extras/support-library.jd
new file mode 100644
index 0000000..7258c77
--- /dev/null
+++ b/docs/html/tools/extras/support-library.jd
@@ -0,0 +1,507 @@
+page.title=Support Library
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#Notes">Revisions</a></li>
+ <li><a href="#Downloading">Downloading the Support Package</a></li>
+ <li><a href="#SettingUp">Setting Up a Project to Use a Library</a></li>
+ <li><a href="#Using">Using the v4 Library APIs</a></li>
+ <li><a href="#Docs">Reference Docs</a></li>
+ <li><a href="#Samples">Samples</a></li>
+</ol>
+
+<h2>See also</h2>
+<ol>
+ <li><a
+href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing Apps for Android 3.0</a></li>
+ <li><a href="http://code.google.com/p/iosched/">Google I/O App source code</a></li>
+</ol>
+
+</div>
+</div>
+
+<p><em>Minimum API level supported:</em> <b>4</b></p>
+
+<p>The Support Package includes static "support libraries" that you can add to your Android
+application in order to use APIs that are either not available for older platform versions or that
+offer "utility" APIs that aren't a part of the framework APIs. The goal is to simplify your
+development by offering more APIs that you can bundle with your application so you can
+worry less about platform versions.</p>
+
+<p class="note"><strong>Note:</strong> The Support Package includes more than one support
+library. Each one has a different <em>minimum API level</em>. For example, one library requires API
+level 4 or higher, while another requires API level 13 or higher (v13 is a superset of v4 and
+includes additional
+support classes to work with v13 APIs). The minimum version is indicated
+by the directory name, such as {@code v4/} and {@code v13/}.</p>
+
+
+<h2 id="Notes">Revisions</h2>
+
+<p>The sections below provide notes about successive releases of
+the Support Package, as denoted by revision number.</p>
+
+<div class="toggle-content open">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" />
+ Support Package, revision 8 (April 2012)
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em">
+ <dl>
+ <dt>Changes for v4 support library:</dt>
+ <dd>
+ <ul>
+ <li>Fixed intent flags for {@link android.app.PendingIntent} objects generated
+ by {@link android.support.v4.app.TaskStackBuilder}.</li>
+ <li>Removed unused attributes from the gridlayout library projects to make sure
+ the library can be built with API Level 7 and higher.</li>
+ <li>Added {@code .classpath} and {@code .project} files for the gridlayout
+ library project.</li>
+ </ul>
+ </dd>
+ </dl>
+</div>
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
+ Support Package, revision 7 (March 2012)
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em">
+ <dl>
+ <dt>Changes for v4 support library:</dt>
+ <dd>
+ <ul>
+ <li>Added {@link android.support.v4.app.ShareCompat}, which provides helper classes
+for sending and receiving content for social sharing applications, including new metadata for
+attributing shared data to the source app. This class also provides compatible integration with the
+new {@link android.widget.ShareActionProvider} in Android 4.0.</li>
+ <li>Added {@link android.support.v4.app.NavUtils} and {@link
+android.support.v4.app.TaskStackBuilder} to provide support for implementing the
+<a href="{@docRoot}design/index.html">Android Design</a> guidelines for navigation. These
+additions include a way to implement the action bar's <em>Up</em> button across versions.
+For an example implementation of this pattern, see the AppNavigation sample in
+({@code <em><sdk></em>/samples/<em><platform></em>/AppNavigation}).</li>
+ <li>Added {@link android.support.v4.app.NotificationCompat.Builder} to provide a
+compatibility implementation of Android 3.0's {@link android.app.Notification.Builder} helper class
+for creating standardized system notifications.</li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
+ Support Package, revision 6 (December 2011)
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em">
+ <p class="note"><strong>Note:</strong> Reference for support library APIs are now available with
+ the framework references, for example: {@link android.support.v4.app}.</p>
+<dl>
+ <dt>Changes for v4 support library:</dt>
+ <dd>
+ <ul>
+ <li>Changes to ViewPager:
+ <ul>
+ <li>Added extra decorative view support for {@link android.support.v4.view.ViewPager}.
+ Decorative views may be supplied as child views of a pager in XML layout.</li>
+ <li>Added {@link android.support.v4.view.PagerAdapter#getPageTitle
+ PagerAdapter.getPageTitle()} to supply title strings for pages, which defaults to no
+ title for each page.</li>
+ <li>Added {@link android.support.v4.view.PagerTitleStrip}, a non-interactive title
+ strip, that can be added as a child of ViewPager. Developers can supply text
+ appearance and color, as well as layout sizing and gravity information.</li>
+ <li>Updated {@link android.support.v4.view.PagerAdapter} methods to take ViewGroup
+ objects, rather than View to avoid class casting in adapter implementations.</li>
+ <li>Updated {@link android.support.v4.view.ViewPager} to use Launcher-style
+ fling behavior.</li>
+ <li>Bug fixes for user interface interaction and test automation.</li>
+ </ul>
+ </li>
+
+ <li>Support for Fragments:
+ <ul>
+ <li>Changed {@code setStartDeferred()} method to {@link
+ android.support.v4.app.Fragment#setUserVisibleHint}.</li>
+ <li>Added deferred start for off-screen pages to improve performance.</li>
+ </ul>
+ </li>
+
+ <li>Support for Accessiblity APIs:
+ <ul>
+ <li>Updated {@link android.support.v4.view.AccessibilityDelegateCompat} methods
+ to return empty lists instead of null.</li>
+ <li>Added new APIs needed by the v4 samples.</li>
+ </ul>
+ </li>
+
+ </ul>
+ </dd>
+ </dl>
+ </div>
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
+ Support Package, revision 5 (December 2011)
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em">
+ <dl>
+ <dt>Changes for v4 support library:</dt>
+ <dd>
+ <ul>
+ <li>Support for Accessiblity APIs:
+ <ul>
+ <li>Added {@link android.support.v4.view.AccessibilityDelegateCompat}
+ to support {@link android.view.View.AccessibilityDelegate}.</li>
+
+ <li>Added {@link android.support.v4.view.accessibility.AccessibilityEventCompat}
+ to support {@link android.view.accessibility.AccessibilityEvent}.</li>
+
+ <li>Added {@link android.support.v4.view.accessibility.AccessibilityManagerCompat}
+ to support {@link android.view.accessibility.AccessibilityManager}.</li>
+
+ <li>Added {@link android.support.v4.view.accessibility.AccessibilityNodeInfoCompat}
+ to support {@link android.view.accessibility.AccessibilityNodeInfo}.</li>
+
+ <li>Added {@link android.support.v4.view.accessibility.AccessibilityRecordCompat}
+ to support {@link android.view.accessibility.AccessibilityRecord}.</li>
+
+ <li>Added {@link
+ android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat}
+ to support {@link android.accessibilityservice.AccessibilityServiceInfo}.</li>
+
+ <li>Added {@link android.support.v4.view.ViewGroupCompat}
+ to support accessibility features in {@link android.view.ViewGroup}.
+ </li>
+
+ <li>Modified {@link android.support.v4.view.ViewCompat}
+ to support accessibility features in {@link android.view.View}.</li>
+ </ul>
+ </li>
+
+ <li>Changes to ViewPager:
+ <ul>
+ <li>Added support for margins between pages.
+ An optional {@link android.graphics.drawable.Drawable} can be provided
+ to fill the margins.</li>
+ <li>Added support for {@link android.widget.EdgeEffect}.</li>
+ <li>Added support for keyboard navigation</li>
+ <li>Added support to control how many pages are kept to either side
+ of the current page.</li>
+ <li>Improved touch physics.</li>
+ <li>Bug fixes for user interface behavior.</li>
+ </ul>
+ </li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
+ Support Package, revision 4 (October 2011)
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em">
+ <dl>
+ <dt>Changes for v4 support library:</dt>
+ <dd>
+ <ul>
+ <li>Added <code>EdgeEffectCompat</code> to
+ support {@link android.widget.EdgeEffect}.</li>
+
+ <li>Added <code>LocalBroadcastManager</code> to allow applications to easily
+ register for and receive intents within a single application without
+ broadcasting them globally.</li>
+
+ <li>Added support in <code>ViewCompat</code> to check for and set overscroll
+ modes for {@link android.view.View}s on Android 2.3 and later.</li>
+ <li>Changes to Fragment APIs:
+ <ul>
+ <li>Added new APIs to control the visibility of new menus.</li>
+ <li>Added custom animation APIs.</li>
+ <li>Added APIs in <code>FragmentActivity</code> to retain custom,
+ non-configuration instance data.</li>
+ <li>Various bug fixes.</li>
+ </ul>
+ </li>
+
+ <li>Fixed a {@link android.content.Loader} bug that caused issues in
+ canceling {@link android.os.AsyncTask}s when running on Froyo and older
+ versions of the platform. The support
+ code now uses its own version of {@link android.os.AsyncTask} to keep the same
+ behavior on all platform versions.</li>
+
+ </ul>
+ </dd>
+ </dl>
+ </div>
+
+
+
+</div>
+
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
+ Compatibility Package, revision 3 (July 2011)
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em">
+ <dl>
+ <dt>Changes for v4 support library:</dt>
+ <dd>
+ <ul>
+ <li>Adds support for {@link android.app.Fragment.SavedState}</li>
+ <li>Adds {@code MotionEventCompat} to support newer {@link
+android.view.MotionEvent} APIs</li>
+ <li>Adds {@code VelocityTrackerCompat} to support a newer {@link
+android.view.VelocityTracker} APIs</li>
+ <li>Adds {@code ViewConfigurationCompat} to support a newer {@link
+android.view.ViewConfiguration} APIs</li>
+ <li>All new APIs (available only in the support library) that allow you to create UIs
+with horizontal paging, allowing users to swipe left and right between content views. Classes to
+support this include:
+ <ul>
+ <li>{@code ViewPager}: A {@link android.view.ViewGroup} that manages the
+layout for the child views, which the user can swipe between.</li>
+ <li>{@code PagerAdapter}: An adapter that populates the {@code ViewPager} with the
+views that represent each page.</li>
+ <li>{@code FragmentPagerAdapter}: An extension of {@code PagerAdapter} for flipping
+between fragments.</li>
+ <li>{@code FragmentStatePagerAdapter}: An extension of {@code PagerAdapter} for
+flipping between fragments that uses the library's support for {@link
+android.app.Fragment.SavedState}.</li>
+ </ul>
+ </li>
+ </ul>
+ </dd>
+ <dt>New v13 support library:</dt>
+ <dd>
+ <ul>
+ <li>Includes the {@code FragmentPagerAdapter} and {@code FragmentStatePagerAdapter}
+to support the horizontal paging.
+ <p>These are exactly the same as the APIs added to the v4 support library, but rely on
+other platform components in Android 3.2. Use this library instead of v4 if you're developing for
+Android 3.2 and higher (all other APIs in the v4 library are already available with API level
+13).</p>
+ </li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+
+</div>
+
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
+ Compatibility Package, revision 2 (May 2011)
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em">
+ <dl>
+ <dt>Changes for v4 library:</dt>
+ <dd>
+ <ul>
+ <li>Support for fragment animations</li>
+ <li>Fix {@code android.support.v4.app.Fragment#onActivityResult Fragment.onActivityResult()}
+ bug</li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+
+</div>
+
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" />
+ Compatibility Package, revision 1 (March 2011)
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em">
+ <p>Initial release with the v4 library.</p>
+ </div>
+
+</div>
+
+
+
+<h2 id="Downloading">Downloading the Support Package</h2>
+
+<p>The Support Package is provided as a downloadable package from the Android SDK
+Manager. To install:</p>
+
+<ol>
+ <li>Launch the Android SDK Manager.
+ <p>From Eclipse, you can select <strong>Window</strong>
+> <strong>Android SDK Manager</strong>. Or, launch {@code SDK Manager.exe} from
+the {@code <sdk>/} directory (on Windows only) or {@code android} from the {@code
+<sdk>/tools/} directory.</p></li>
+ <li>Expand the Android Repository, check <strong>Android Support package</strong>
+and click <strong>Install selected</strong>.</li>
+ <li>Proceed to install the package.</li>
+</ol>
+
+<p>When done, all files (including source code, samples, and the {@code .jar} files) are saved
+into the <code><sdk>/extras/android/support/</code> directory. This directory contains
+each of the different support libraries, such as the library for API level 4 and up and the library
+for API level 13 and up, each named with the respective version (such as {@code v4/}).</p>
+
+
+<h2 id="SettingUp">Setting Up a Project to Use a Library</h2>
+
+<p>To add one of the libraries to your Android project:</p>
+<ol>
+ <li>In your Android project, create a directory named {@code libs} at the root of your
+project (next to {@code src/}, {@code res/}, etc.)</li>
+ <li>Locate the JAR file for the library you want to use and copy it into the {@code
+libs/} directory.
+ <p>For example, the library that supports API level 4 and up is located at {@code
+<sdk>/extras/android/support/v4/android-support-v4.jar}.</p>
+ </li>
+ <li>Add the JAR to your project build path.
+ <p>In Eclipse, right-click the JAR file in the Package Explorer, select <strong>Build
+Path</strong> > <strong>Add to Build Path</strong>.</p>
+ </li>
+</ol>
+
+<p>Your application is now ready to use the library APIs. All the
+provided APIs are available in the {@code android.support} package (for
+example, {@code android.support.v4}).</p>
+
+<p class="note"><strong>Tip:</strong> To see the library APIs in action, take a look at the sample
+apps in {@code <sdk>/extras/android/support/<version>/samples/}.</p>
+
+<p class="warning"><strong>Warning:</strong> Be certain that you not confuse the standard
+{@code android} packages with those in {@code android.support} library. Some code completion tools
+might
+get this wrong, especially if you're building against recent versions of the platform. To be safe,
+keep your build target set to the same version as you have defined for your <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code android:minSdkVersion}</a>
+and double check the import statements for classes that also exist in the support library, such as
+{@code SimpleCursorAdapter}.</p>
+
+
+<h2 id="Using">Using the v4 Library APIs</h2>
+
+<p>The support library for v4 provides access to several classes introduced with Android 3.0 and
+beyond, plus some updated version of existing classes, and even some APIs that currently don't
+exist in the Android platform. Some of the most useful and notable classes that have
+counterparts in the v4 support library are:</p>
+
+<ul>
+ <li>{@link android.app.Fragment}</li>
+ <li>{@link android.app.FragmentManager}</li>
+ <li>{@link android.app.FragmentTransaction}</li>
+ <li>{@link android.app.ListFragment}</li>
+ <li>{@link android.app.DialogFragment}</li>
+ <li>{@link android.app.LoaderManager}</li>
+ <li>{@link android.content.Loader}</li>
+ <li>{@link android.content.AsyncTaskLoader}</li>
+ <li>{@link android.content.CursorLoader}</li>
+</ul>
+
+<p>For each of the classes above (and others not listed), the APIs work almost exactly the same
+as the counterparts in the latest Android platform. Thus, you can usually refer to
+the online documentation for information about the supported APIs. There are some
+differences, however. Most notably:</p>
+
+<ul>
+ <li>When creating an activity to use fragments, you must declare your activity to extend the
+{@link android.support.v4.app.FragmentActivity} class (instead of the traditional
+{@link android.app.Activity} class).</li>
+ <li>To manage your fragments and loaders, you must use the methods
+ {@link android.support.v4.app.FragmentActivity#getSupportFragmentManager
+ FragmentActivity.getSupportFragmentManager()} and
+ {@link android.support.v4.app.FragmentActivity#getSupportLoaderManager
+ FragmentActivity.getSupportLoaderManager()} (instead of the
+ {@link android.app.Activity#getFragmentManager()} and
+ {@link android.app.Activity#getLoaderManager()} methods).</li>
+ <li>The {@link android.app.ActionBar} is <strong>not supported</strong> by the library.
+However, when creating your <a href="{@docRoot}guide/topics/ui/menus.html#options-menu">Options
+Menu</a>, you can declare which items should be added to the Action Bar when it's available (on
+Android 3.0 or later). You can do so with the
+{@link android.support.v4.view.MenuCompat#setShowAsAction MenuCompat.setShowAsAction()} method, for
+example:
+<pre>
+public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.options, menu);
+ MenuCompat.setShowAsAction(menu.findItem(R.id.action_search), 1);
+ return true;
+}
+</pre>
+<p>Also see the <a href="{@docRoot}resources/samples/ActionBarCompat/index.html">Action Bar
+Compatibility</a> sample for a demonstration of how to use {@link android.app.ActionBar} on Android
+3.0+ and also support action bar functionality on older versions.</p>
+</li>
+</ul>
+
+<div class="note"><p><strong>Tip:</strong> To enable the Holographic theme on devices
+running Android 3.0 or higher, declare in your manifest file that your application targets
+API level 11, for example:</p>
+<pre>
+<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" />
+</pre>
+<p>This way, your application automatically receives the Holographic theme and the Action Bar for
+each activity when running on Android 3.0 and higher.</p>
+</div>
+
+<p>For more information about how you can optimize your application for the latest
+Android-powered devices, read <a href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing
+Apps for Android 3.0</a>.</p>
+
+
+<h2 id="Docs">Reference Docs</h2>
+
+<p>The reference documentation for the Support Packages is included as part of the Android
+online developer documentation:</p>
+
+<ul>
+ <li><a href="{@docRoot}reference/android/support/v4/app/package-summary.html">Support Package
+ API 4 Reference</a></li>
+ <li><a href="{@docRoot}reference/android/support/v13/app/package-summary.html">Support Package
+ API 13 Reference</a></li>
+</ul>
+
+
+<h2 id="Samples">Samples</h2>
+
+<p>If you want to see some code that uses the support libraries, samples are included with the
+Support Package, inside each support library directory, for example; {@code
+<sdk>/extras/android/support/v4/samples/}. You can also view these samples as part of the
+Android online developer documentation:</p>
+
+<ul>
+ <li><a href="{@docRoot}resources/samples/Support4Demos/index.html">Support API 4 Demos</a></li>
+ <li><a href="{@docRoot}resources/samples/Support13Demos/index.html">Support API 13 Demos</a></li>
+</ul>
+
+<p>Additionally, the <a href="http://code.google.com/p/iosched/">Google I/O App</a> is a complete
+application that uses the v4 support library to provide a single APK for both handsets and tablets
+and also demonstrates some of Android's best practices in Android UI design.</p>
diff --git a/docs/html/tools/help/MonkeyDevice.jd b/docs/html/tools/help/MonkeyDevice.jd
new file mode 100644
index 0000000..e7612e6
--- /dev/null
+++ b/docs/html/tools/help/MonkeyDevice.jd
@@ -0,0 +1,1355 @@
+page.title=MonkeyDevice
+parent.title=monkeyrunner
+parent.link=index.html
+@jd:body
+<style>
+ h4.jd-details-title {background-color: #DEE8F1;}
+</style>
+<p>
+ A monkeyrunner class that represents a device or emulator accessible by the workstation running
+<code><a href="{@docRoot}tools/help/monkeyrunner_concepts.html">monkeyrunner</a></code>.
+</p>
+<p>
+ This class is used to control an Android device or emulator. The methods send UI events,
+ retrieve information, install and remove applications, and run applications.
+</p>
+<p>
+ You normally do not have to create an instance of <code>MonkeyDevice</code>. Instead, you
+ use
+<code><a href="{@docRoot}tools/help/MonkeyRunner.html#waitForConnection">
+MonkeyRunner.waitForConnection()</a></code> to create a new object from a connection to a device or
+emulator. For example, instead of
+using:</p>
+<pre>
+newdevice = MonkeyDevice()
+</pre>
+<p>
+ you would use:
+</p>
+<pre>
+newdevice = MonkeyRunner.waitForConnection()
+</pre>
+<h2>Summary</h2>
+ <table id="constants" class="jd-sumtable" style="background-color: white;">
+ <tr>
+ <th colspan="12" style="background-color: #E2E2E2">Constants</th>
+ </tr>
+ <tr class="api" style="background-color: white;">
+ <td class="jd-typecol"><em>string</em></td>
+ <td class="jd-linkcol"><a href="#ACTION_DOWN">DOWN</a></td>
+ <td class="jd-descrcol" width="100%">
+ Use this with the <code>type</code> argument of
+ <code><a href="#press">press()</a></code> or <code><a href="#touch">touch()</a>
+ </code>
+ to send a DOWN event.
+ </td>
+ </tr>
+ <tr class="api" style="background-color: white;">
+ <td class="jd-typecol"><em>string</em></td>
+ <td class="jd-linkcol"><a href="#ACTION_UP">UP</a></td>
+ <td class="jd-descrcol" width="100%">
+ Use this with the <code>type</code> argument of
+ <code><a href="#press">press()</a></code> or <code><a href="#touch">touch()</a>
+ </code>
+ to send an UP event.
+ </td>
+ </tr>
+ <tr class="api" style="background-color: white;">
+ <td class="jd-typecol"><em>string</em></td>
+ <td class="jd-linkcol"><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></td>
+ <td class="jd-descrcol" width="100%">
+ Use this with the <code>type</code> argument of
+ <code><a href="#press">press()</a></code> or <code><a href="#touch">touch()</a>
+ </code>
+ to send a DOWN event immediately followed by an UP event.
+ </td>
+ </tr>
+ </table>
+<table id="pubmethods" class="jd-sumtable">
+ <tr>
+ <th colspan="12" style="background-color: #E2E2E2">Methods</th>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#broadcastIntent">broadcastIntent</a>
+ </span>
+ (<em>string</em> uri,
+ <em>string</em> action,
+ <em>string</em> data,
+ <em>string</em> mimetype,
+ <em>iterable</em> categories
+ <em>dictionary</em> extras,
+ <em>component</em> component,
+ <em>iterable</em> flags)
+ </nobr>
+ <div class="jd-descrdiv">
+ Broadcasts an Intent to this device, as if the Intent were coming from an
+ application.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#drag">drag</a>
+ </span>
+ (<em>tuple</em> start,
+ <em>tuple</em> end,
+ <em>float</em> duration,
+ <em>integer</em> steps)
+ </nobr>
+ <div class="jd-descrdiv">
+ Simulates a drag gesture (touch, hold, and move) on this device's screen.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <em>object</em>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#getProperty">getProperty</a>
+ </span>
+ (<em>string</em> key)
+ </nobr>
+ <div class="jd-descrdiv">
+ Given the name of a system environment variable, returns its value for this device.
+ The available variable names are listed in the <a href="#getProperty">
+ detailed description</a> of this method.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <em>object</em>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#getSystemProperty">getSystemProperty</a>
+ </span>
+ (<em>string</em> key)
+ </nobr>
+ <div class="jd-descrdiv">
+. The API equivalent of <code>adb shell getprop <key>. This is provided for use
+ by platform developers.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#installPackage">installPackage</a>
+ </span>
+ (<em>string</em> path)
+ </nobr>
+ <div class="jd-descrdiv">
+ Installs the Android application or test package contained in packageFile onto this
+ device. If the application or test package is already installed, it is replaced.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <em>dictionary</em>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#instrument">instrument</a>
+ </span>
+ (<em>string</em> className,
+ <em>dictionary</em> args)
+ </nobr>
+ <div class="jd-descrdiv">
+ Runs the specified component under Android instrumentation, and returns the results
+ in a dictionary whose exact format is dictated by the component being run. The
+ component must already be present on this device.
+ </div>
+ </td>
+ </tr>
+ <tr class="api">
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#press">press</a>
+ </span>
+ (<em>string</em> name,
+ <em>dictionary</em> type)
+ </nobr>
+ <div class="jd-descrdiv">
+ Sends the key event specified by type to the key specified by
+ keycode.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#reboot">reboot</a>
+ </span>
+ (<em>string</em> into)
+ </nobr>
+ <div class="jd-descrdiv">
+ Reboots this device into the bootloader specified by bootloadType.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#removePackage">removePackage</a>
+ </span>
+ (<em>string</em> package)
+ </nobr>
+ <div class="jd-descrdiv">
+ Deletes the specified package from this device, including its data and cache.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <em>object</em>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#shell">shell</a>
+ </span>
+ (<em>string</em> cmd)
+ </nobr>
+ <div class="jd-descrdiv">
+ Executes an <code>adb</code> shell command and returns the result, if any.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#startActivity">startActivity</a>
+ </span>
+ (<em>string</em> uri,
+ <em>string</em> action,
+ <em>string</em> data,
+ <em>string</em> mimetype,
+ <em>iterable</em> categories
+ <em>dictionary</em> extras,
+ <em>component</em> component,
+ <em>flags</em>)
+ </nobr>
+ <div class="jd-descrdiv">
+ Starts an Activity on this device by sending an Intent constructed from the
+ supplied arguments.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <code>
+ <a href="{@docRoot}tools/help/MonkeyImage.html">
+ MonkeyImage
+ </a>
+ </code>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#takeSnapshot">takeSnapshot</a>()
+ </span>
+ </nobr>
+ <div class="jd-descrdiv">
+ Captures the entire screen buffer of this device, yielding a
+ <code>
+ <a href="{@docRoot}tools/help/MonkeyImage.html">
+ MonkeyImage
+ </a>
+ </code> object containing a screen capture of the current display.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#touch">touch</a>
+ </span>
+ (<em>integer</em> x,
+ <em>integer</em> y,
+ <em>integer</em> type)
+ </nobr>
+ <div class="jd-descrdiv">
+ Sends a touch event specified by type to the screen location specified
+ by x and y.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#touch">type</a>
+ </span>
+ (<em>string</em> message)
+ </nobr>
+ <div class="jd-descrdiv">
+ Sends the characters contained in message to this device, as if they
+ had been typed on the device's keyboard. This is equivalent to calling
+ <code><a href="#press">press()</a></code> for each keycode in <code>message</code>
+ using the key event type <code><a href="#ACTION_DOWN_AND_UP"></a>DOWN_AND_UP</code>.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#touch">wake</a>
+ </span>
+ ()
+ </nobr>
+ <div class="jd-descrdiv">
+ Wakes the screen of this device.
+ </div>
+ </td>
+ </tr>
+</table>
+<!-- ========= ENUM CONSTANTS DETAIL ======== -->
+<h2>Constants</h2>
+<A NAME="ACTION_DOWN"></a>
+<div class="jd-details api">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>string</em>
+ </span>
+ DOWN
+ </h4>
+ <div class="jd-details-descr">
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ <code><a href="#press">press()</a></code> or
+ <code><a href="#press">touch()</a></code> value.
+ Specifies that a DOWN event type should be sent to the device, corresponding to
+ pressing down on a key or touching the screen.
+ </p>
+ </div>
+ </div>
+</div>
+<A NAME="ACTION_UP"></A>
+<div class="jd-details api">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>string</em>
+ </span>
+ UP
+ </h4>
+ <div class="jd-details-descr">
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ <code><a href="#press">press()</a></code> or
+ <code><a href="#press">touch()</a></code> value.
+ Specifies that an UP event type should be sent to the device, corresponding to
+ releasing a key or lifting up from the screen.
+ </p>
+ </div>
+ </div>
+</div>
+<A NAME="ACTION_DOWN_AND_UP"></A>
+
+<div class="jd-details api">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>string</em>
+ </span>
+ DOWN_AND_UP
+ </h4>
+ <div class="jd-details-descr">
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ <code><a href="#press">press()</a></code>,
+ <code><a href="#press">touch()</a></code> or
+ <code><a href="#type">type()</a></code> value.
+ Specifies that a DOWN event type followed by an UP event type should be sent to the
+ device, corresponding to typing a key or clicking the screen.
+ </p>
+ </div>
+ </div>
+</div>
+<!-- ========= METHOD DETAIL ======== -->
+<!-- Public methods -->
+<h2>Public Methods</h2>
+<A NAME="broadcastIntent"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">broadcastIntent</span>
+ <span class="normal">
+ (
+ <em>string</em> uri,
+ <em>string</em> action,
+ <em>string</em> data,
+ <em>string</em> mimetype,
+ <em>iterable</em> categories
+ <em>dictionary</em> extras,
+ <em>component</em> component,
+ <em>iterable</em> flags)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Broadcasts an Intent to this device, as if the Intent were coming from an
+ application. See {@link android.content.Intent Intent} for more information about the
+ arguments.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>uri</th>
+ <td>
+ The URI for the Intent.
+ (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}).
+ </td>
+ </tr>
+ <tr>
+ <th>action</th>
+ <td>
+ The action for this Intent
+ (see {@link android.content.Intent#setAction(java.lang.String) Intent.setAction()}).
+ </td>
+ </tr>
+ <tr>
+ <th>data</th>
+ <td>
+ The data URI for this Intent
+ (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}).
+ </td>
+ </tr>
+ <tr>
+ <th>mimetype</th>
+ <td>
+ The MIME type for the Intent
+ (see {@link android.content.Intent#setType(java.lang.String) Intent.setType()}).
+ </td>
+ </tr>
+ <tr>
+ <th>categories</th>
+ <td>
+ An iterable data structure containing strings that define categories for this
+ Intent
+ (see
+ {@link android.content.Intent#addCategory(java.lang.String) Intent.addCategory()}).
+ </td>
+ </tr>
+ <tr>
+ <th>extras</th>
+ <td>
+ A dictionary of extra data for this Intent
+ (see {@link android.content.Intent#putExtra(java.lang.String,java.lang.String)
+ Intent.putExtra()}
+ for an example).
+ <p>
+ The key for each dictionary item should be a <em>string</em>. The item's value
+ can be any simple or structured data type.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <th>component</th>
+ <td>
+ The component for this Intent (see {@link android.content.ComponentName}).
+ Using this argument will direct the Intent to a specific class within a specific
+ Android package.
+ </td>
+ </tr>
+ <tr>
+ <th>flags</th>
+ <td>
+ An iterable data structure containing flags that control how the Intent is handled
+ (see {@link android.content.Intent#setFlags(int) Intent.setFlags()}).
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+<A NAME="drag"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">drag</span>
+ <span class="normal">
+ (
+ <em>tuple</em> start,
+ <em>tuple</em> end,
+ <em>float</em> duration,
+ <em>integer</em> steps)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Simulates a drag gesture (touch, hold, and move) on this device's screen.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>start</th>
+ <td>
+ The starting point of the drag gesture, in the form of a <em>tuple</em>
+ (x,y) where x and y are <em>integers</em>.
+ </td>
+ </tr>
+ <tr>
+ <th>end</th>
+ <td>
+ The end point of the drag gesture, in the form of a <em>tuple</em> (x,y)
+ where x and y are <em>integers</em>.
+ </td>
+ </tr>
+ <tr>
+ <th>duration</th>
+ <td>The duration of the drag gesture in seconds. The default is 1.0 seconds.</td>
+ </tr>
+ <tr>
+ <th>steps</th>
+ <td>The number of steps to take when interpolating points. The default is 10.</td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+<A NAME="getProperty"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>object</em>
+ </span>
+ <span class="sympad">getProperty</span>
+ <span class="normal">
+ (<em>string</em> key)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Given the name of a system environment variable, returns its value for this device.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>key</th>
+ <td>
+ The name of the system environment variable. The available variable names are listed in
+ <a href="#table1">Table 1. Property variable names</a> at the end of this topic.
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ The value of the variable. The data format varies according to the variable requested.
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+<A NAME="getSystemProperty"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>object</em>
+ </span>
+ <span class="sympad">getSystemProperty</span>
+ <span class="normal">
+ (<em>string</em> key)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Synonym for <code><a href="#getProperty">getProperty()</a></code>.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>key</th>
+ <td>
+ The name of the system environment variable. The available variable names are listed in
+ <a href="#table1">Table 1. Property Variable Names</a>.
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ The value of the variable. The data format varies according to the variable requested.
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+<A NAME="installPackage"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">installPackage</span>
+ <span class="normal">
+ (<em>string</em> path)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Installs the Android application or test package contained in packageFile
+ onto this device. If the application or test package is already installed, it is
+ replaced.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>path</th>
+ <td>
+ The fully-qualified path and filename of the <code>.apk</code> file to install.
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+<A NAME="instrument"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>dictionary</em>
+ </span>
+ <span class="sympad">instrument</span>
+ <span class="normal">
+ (
+ <em>string</em> className,
+ <em>dictionary</em> args)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Runs the specified component with Android instrumentation, and returns the results
+ in a dictionary whose exact format is dictated by the component being run. The
+ component must already be present on this device.
+ </p>
+ <p>
+ Use this method to start a test case that uses one of Android's test case classes.
+ See <a href="{@docRoot}tools/testing/testing_android.html">Testing
+ Fundamentals</a> to learn more about unit testing with the Android testing
+ framework.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>className</th>
+ <td>
+ The name of an Android component that is already installed on this device, in the
+ standard form packagename/classname, where packagename is the
+ Android package name of a <code>.apk</code> file on this device, and
+ classname is the class name of an Android component (Activity,
+ ContentProvider, Service, or BroadcastReceiver) in that file. Both
+ packagename and classname must be fully qualified. See
+ {@link android.content.ComponentName} for more details.
+ </td>
+ </tr>
+ <tr>
+ <th>args</th>
+ <td>
+ A dictionary containing flags and their values. These are passed to the component as it
+ is started. If the flag does not take a value, set its dictionary value to an empty
+ string.
+ </td>
+ </tr>
+ </table>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ <p>
+ A dictionary containing the component's output. The contents of the dictionary
+ are defined by the component itself.
+ </p>
+ <p>
+ If you use {@link android.test.InstrumentationTestRunner} as the class name in
+ the componentName argument, then the result dictionary contains
+ the single key "stream". The value of "stream" is a <em>string</em> containing
+ the test output, as if <code>InstrumentationTestRunner</code> was run from the
+ command line. The format of this output is described in
+ <a href="{@docRoot}tools/testing/testing_otheride.html">
+ Testing in Other IDEs</a>.
+ </p>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+</div>
+<A NAME="press"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">press</span>
+ <span class="normal">
+ (<em>string</em> name,
+ <em>integer</em> type)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Sends the key event specified by <code>type</code> to the key specified by
+ <code>keycode</code>.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>name</th>
+ <td>
+ The name of the keycode to send. See {@link android.view.KeyEvent} for a list of
+ keycode names. Use the keycode name, not its integer value.
+ </td>
+ </tr>
+ <tr>
+ <th>type</th>
+ <td>
+ The type of key event to send. The allowed values are <code><a href="#ACTION_DOWN">
+ DOWN</a></code>, <code><a href="#ACTION_UP">UP</a></code>, and
+ <code><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></code>.
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+<A NAME="reboot"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">reboot</span>
+ <span class="normal">
+ (<em>string</em> bootloadType)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Reboots this device into the bootloader specified by <code>bootloadType</code>.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>into</th>
+ <td>
+ The type of bootloader to reboot into. The allowed values are
+ "bootloader", "recovery", or "None".
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+<A NAME="removePackage"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">removePackage</span>
+ <span class="normal">
+ (<em>string</em> package)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Deletes the specified package from this device, including its data and cache.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>package</th>
+ <td>
+ The Android package name of an <code>.apk</code> file on this device.
+ </td>
+ </table>
+ </div>
+ </div>
+</div>
+<A NAME="shell"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>object</em>
+ </span>
+ <span class="sympad">shell</span>
+ <span class="normal">
+ (<em>string</em> cmd)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Executes an <code>adb</code> shell command and returns the result, if any.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>cmd</th>
+ <td>
+ The command to execute in the <code>adb</code> shell. The form of these commands is
+ described in the topic <a href="{@docRoot}tools/help/adb.html">Android
+ Debug Bridge</a>.
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ The results of the command, if any. The format of the results is determined by the
+ command.
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+<A NAME="startActivity"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">startActivity</span>
+ <span class="normal">
+ (
+ <em>string</em> uri,
+ <em>string</em> action,
+ <em>string</em> data,
+ <em>string</em> mimetype,
+ <em>iterable</em> categories
+ <em>dictionary</em> extras,
+ <em>component</em> component,
+ <em>iterable</em> flags)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Starts an Activity on this device by sending an Intent constructed from the
+ supplied arguments.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>uri</th>
+ <td>
+ The URI for the Intent.
+ (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}).
+ </td>
+ </tr>
+ <tr>
+ <th>action</th>
+ <td>
+ The action for the Intent
+ (see {@link android.content.Intent#setAction(java.lang.String) Intent.setAction()}).
+ </td>
+ </tr>
+ <tr>
+ <th>data</th>
+ <td>
+ The data URI for the Intent
+ (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}).
+ </td>
+ </tr>
+ <tr>
+ <th>mimetype</th>
+ <td>
+ The MIME type for the Intent
+ (see {@link android.content.Intent#setType(java.lang.String) Intent.setType()}).
+ </td>
+ </tr>
+ <tr>
+ <th>categories</th>
+ <td>
+ An iterable data structure containing strings that define categories for the
+ Intent
+ (see
+ {@link android.content.Intent#addCategory(java.lang.String) Intent.addCategory()}).
+ </td>
+ </tr>
+ <tr>
+ <th>extras</th>
+ <td>
+ A dictionary of extra data for the Intent
+ (see
+ {@link android.content.Intent#putExtra(java.lang.String,java.lang.String)
+ Intent.putExtra()}
+ for an example).
+ <p>
+ The key for each dictionary item should be a <em>string</em>. The item's value
+ can be any simple or structured data type.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <th>component</th>
+ <td>
+ The component for the Intent
+ (see {@link android.content.ComponentName}). Using this argument will direct the
+ Intent to a specific class within a specific Android package.
+ </td>
+ </tr>
+ <tr>
+ <th>flags</th>
+ <td>
+ An iterable data structure containing flags that control how the Intent is handled
+ (see {@link android.content.Intent#setFlags(int) Intent.setFlags()}).
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+<A NAME="takeSnapshot"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <code>
+ <a href="{@docRoot}tools/help/MonkeyImage.html">
+ MonkeyImage
+ </a>
+ </code>
+ </span>
+ <span class="sympad">takeSnapshot</span>
+ <span class="normal">
+ ()
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Captures the entire screen buffer of this device, yielding a
+ screen capture of the current display.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ A <a href="{@docRoot}tools/help/MonkeyImage.html">
+ MonkeyImage</a> object containing the image of the current display.
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+<A NAME="touch"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">touch</span>
+ <span class="normal">
+ (
+ <em>integer</em> x,
+ <em>integer</em> y,
+ <em>string</em> type)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Sends a touch event specified by type to the screen location specified
+ by x and y.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>x</th>
+ <td>
+ The horizontal position of the touch in actual device pixels, starting from the left of
+ the screen in its current orientation.
+ </td>
+ </tr>
+ <tr>
+ <th>y</th>
+ <td>
+ The vertical position of the touch in actual device pixels, starting from the top of
+ the screen in its current orientation.
+ </td>
+ </tr>
+ <tr>
+ <th>type</th>
+ <td>
+ The type of key event to send. The allowed values are <code><a href="#ACTION_DOWN">
+ DOWN</a></code>, <code><a href="#ACTION_UP">UP</a></code>, and
+ <code><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></code>.
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+<A NAME="type"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">type</span>
+ <span class="normal">
+ (<em>string</em> message)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Sends the characters contained in message to this device, as if they
+ had been typed on the device's keyboard. This is equivalent to calling
+ <code><a href="#press">press()</a></code> for each keycode in <code>message</code>
+ using the key event type <code><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></code>.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>message</th>
+ <td>
+ A string containing the characters to send.
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+<A NAME="wake"></A>
+<div class="jd-details api">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">wake</span>
+ <span class="normal">
+ ()
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Wakes the screen of this device.
+ </p>
+ </div>
+ </div>
+</div>
+<hr></hr>
+<h2>Appendix</h2>
+ <p class="table-caption" id="table1">
+ <strong>Table 1.</strong>Property variable names used with
+ <span class="sympad"><a href="#getProperty">getProperty()</a></span> and
+ <span class="sympad"><a href="#getSystemProperty">getSystemProperty()</a></span>.
+ </p>
+ <table>
+ <tr>
+ <th>
+ Property Group
+ </th>
+ <th>
+ Property
+ </th>
+ <th>
+ Description
+ </th>
+ <th>
+ Notes
+ </th>
+ </tr>
+ <tr>
+ <td rowspan="17"><code>build</code></td>
+ <td><code>board</code></td>
+ <td>Code name for the device's system board</td>
+ <td rowspan="17">
+ See {@link android.os.Build}
+ </td>
+ </tr>
+ <tr>
+ <td><code>brand</code></td>
+ <td>The carrier or provider for which the OS is customized.</td>
+ </tr>
+ <tr>
+ <td><code>device</code></td>
+ <td>The device design name.</td>
+ </tr>
+ <tr>
+ <td><code>fingerprint</code></td>
+ <td>A unique identifier for the currently-running build.</td>
+ </tr>
+ <tr>
+ <td><code>host</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td><code>ID</code></td>
+ <td>A changelist number or label.</td>
+ </tr>
+ <tr>
+ <td><code>model</code></td>
+ <td>The end-user-visible name for the device.</td>
+ </tr>
+ <tr>
+ <td><code>product</code></td>
+ <td>The overall product name.</td>
+ </tr>
+ <tr>
+ <td><code>tags</code></td>
+ <td>Comma-separated tags that describe the build, such as "unsigned" and "debug".</td>
+ </tr>
+ <tr>
+ <td><code>type</code></td>
+ <td>The build type, such as "user" or "eng".</td>
+ </tr>
+ <tr>
+ <td><code>user</code></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td><code>CPU_ABI</code></td>
+ <td>
+ The name of the native code instruction set, in the form CPU type plus
+ ABI convention.
+ </td>
+ </tr>
+ <tr>
+ <td><code>manufacturer</code></td>
+ <td>The product/hardware manufacturer.</td>
+ </tr>
+ <tr>
+ <td><code>version.incremental</code></td>
+ <td>
+ The internal code used by the source control system to represent this version
+ of the software.
+ </td>
+ </tr>
+ <tr>
+ <td><code>version.release</code></td>
+ <td>The user-visible name of this version of the software.</td>
+ </tr>
+ <tr>
+ <td><code>version.sdk</code></td>
+ <td>The user-visible SDK version associated with this version of the OS.</td>
+ </tr>
+ <tr>
+ <td><code>version.codename</code></td>
+ <td>
+ The current development codename, or "REL" if this version of the software has been
+ released.
+ </td>
+ </tr>
+ <tr>
+ <td rowspan="3"><code>display</code></td>
+ <td><code>width</code></td>
+ <td>The device's display width in pixels.</td>
+ <td rowspan="3">
+ See
+ {@link android.util.DisplayMetrics} for details.
+ </td>
+ </tr>
+ <tr>
+ <td><code>height</code></td>
+ <td>The device's display height in pixels.</td>
+ </tr>
+ <tr>
+ <td><code>density</code></td>
+ <td>
+ The logical density of the display. This is a factor that scales
+ DIP (Density-Independent Pixel) units to the device's resolution. DIP is adjusted so
+ that 1 DIP is equivalent to one pixel on a 160 pixel-per-inch display. For example,
+ on a 160-dpi screen, density = 1.0, while on a 120-dpi screen, density = .75.
+ <p>
+ The value does not exactly follow the real screen size, but is adjusted to
+ conform to large changes in the display DPI. See
+ {@link android.util.DisplayMetrics#density} for more details.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td rowspan="6"><code>am.current</code></td>
+ <td><code>package</code></td>
+ <td>The Android package name of the currently running package.</td>
+ <td rowspan="6">
+ The <code>am.current</code> keys return information about the currently-running
+ Activity.
+ </td>
+ </tr>
+ <tr>
+ <td><code>action</code></td>
+ <td>
+ The current activity's action. This has the same format as the <code>name</code>
+ attribute of the <code>action</code> element in a package manifest.
+ </td>
+ </tr>
+ <tr>
+ <td><code>comp.class</code></td>
+ <td>
+ The class name of the component that started the current Activity. See
+ <code><a href="#comppackage">comp.package</a></code> for more details.</td>
+ </tr>
+ <tr>
+ <td><a name="comppackage"><code>comp.package</code></a></td>
+ <td>
+ The package name of the component that started the current Activity. A component
+ is specified by a package name and the name of class that the package contains.
+ </td>
+ </tr>
+ <tr>
+ <td><code>data</code></td>
+ <td>The data (if any) contained in the Intent that started the current Activity.</td>
+ </tr>
+ <tr>
+ <td><code>categories</code></td>
+ <td>The categories specified by the Intent that started the current Activity.</td>
+ </tr>
+ <tr>
+ <td rowspan="3"><code>clock</code></td>
+ <td><code>realtime</code></td>
+ <td>
+ The number of milliseconds since the device rebooted, including deep-sleep
+ time.
+ </td>
+ <td rowspan="3">
+ See {@link android.os.SystemClock} for more information.
+ </td>
+ </tr>
+ <tr>
+ <td><code>uptime</code></td>
+ <td>
+ The number of milliseconds since the device rebooted, <em>not</em> including
+ deep-sleep time
+ </td>
+ </tr>
+ <tr>
+ <td><code>millis</code></td>
+ <td>current time since the UNIX epoch, in milliseconds.</td>
+ </tr>
+ </table>
diff --git a/docs/html/tools/help/MonkeyImage.jd b/docs/html/tools/help/MonkeyImage.jd
new file mode 100644
index 0000000..79f4948
--- /dev/null
+++ b/docs/html/tools/help/MonkeyImage.jd
@@ -0,0 +1,437 @@
+page.title=MonkeyImage
+parent.title=monkeyrunner
+parent.link=index.html
+@jd:body
+<style>
+ h4.jd-details-title {background-color: #DEE8F1;}
+</style>
+
+<p>
+ A monkeyrunner class to hold an image of the device or emulator's screen. The image is
+ copied from the screen buffer during a screenshot. This object's methods allow you to
+ convert the image into various storage formats, write the image to a file, copy parts of
+ the image, and compare this object to other <code>MonkeyImage</code> objects.
+</p>
+<p>
+ You do not need to create new instances of <code>MonkeyImage</code>. Instead, use
+<code><a href="{@docRoot}tools/help/MonkeyDevice.html#takeSnapshot">
+MonkeyDevice.takeSnapshot()</a></code> to create a new instance from a screenshot. For example, use:
+</p>
+<pre>
+newimage = MonkeyDevice.takeSnapshot()
+</pre>
+<h2>Summary</h2>
+<table id="pubmethods" class="jd-sumtable">
+ <tr>
+ <th colspan="12" style="background-color: #E2E2E2">Methods</th>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <em>string</em>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#convertToBytes">convertToBytes</a>
+ </span>
+ (<em>string</em> format)
+ </nobr>
+ <div class="jd-descrdiv">
+ Converts the current image to a particular format and returns it as a
+ <em>string</em> that you can then access as an <em>iterable</em> of binary bytes.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <em>tuple</em>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#getRawPixel">getRawPixel</a>
+ </span>
+ (<em>integer</em> x,
+ <em>integer</em> y)
+ </nobr>
+ <div class="jd-descrdiv">
+ Returns the single pixel at the image location (x,y), as an
+ a <em>tuple</em> of <em>integer</em>, in the form (a,r,g,b).
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <em>integer</em>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#getRawPixelInt">getRawPixelInt</a>
+ </span>
+ (<em>integer</em> x,
+ <em>integer</em> y)
+ </nobr>
+ <div class="jd-descrdiv">
+ Returns the single pixel at the image location (x,y), as
+ a 32-bit <em>integer</em>.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <code>
+ <a href="{@docRoot}tools/help/MonkeyImage.html">MonkeyImage</a>
+ </code>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#getSubImage">getSubImage</a>
+ </span>
+ (<em>tuple</em> rect)
+ </nobr>
+ <div class="jd-descrdiv">
+ Creates a new <code>MonkeyImage</code> object from a rectangular selection of the
+ current image.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <em>boolean</em>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#sameAs">sameAs</a>
+ </span>
+ (<code><a href="{@docRoot}tools/help/MonkeyImage.html">MonkeyImage</a></code>
+ other,
+ <em>float</em> percent)
+ </nobr>
+ <div class="jd-descrdiv">
+ Compares this <code>MonkeyImage</code> object to another and returns the result of
+ the comparison. The <code>percent</code> argument specifies the percentage
+ difference that is allowed for the two images to be "equal".
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <em>void</em>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#writeToFile">writeToFile</a>
+ </span>
+ (<em>string</em> path,
+ <em>string</em> format)
+ </nobr>
+ <div class="jd-descrdiv">
+ Writes the current image to the file specified by <code>filename</code>, in the
+ format specified by <code>format</code>.
+ </div>
+ </td>
+ </tr>
+</table>
+<!-- ========= METHOD DETAIL ======== -->
+<!-- Public methods -->
+<h2>Public Methods</h2>
+<A NAME="convertToBytes"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>string</em>
+ </span>
+ <span class="sympad">convertToBytes</span>
+ <span class="normal">
+ (
+ <em>string</em> format)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Converts the current image to a particular format and returns it as a <em>string</em>
+ that you can then access as an <em>iterable</em> of binary bytes.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>format</th>
+ <td>
+ The desired output format. All of the common raster output formats are supported.
+ The default value is "png" (Portable Network Graphics).
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
+</div>
+<A NAME="getRawPixel"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>tuple</em>
+ </span>
+ <span class="sympad">getRawPixel</span>
+ <span class="normal">
+ (<em>integer</em> x,
+ <em>integer</em> y)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Returns the single pixel at the image location (x,y), as an
+ a <em>tuple</em> of <em>integer</em>, in the form (a,r,g,b).
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>x</th>
+ <td>
+ The horizontal position of the pixel, starting with 0 at the left of the screen in the
+ orientation it had when the screenshot was taken.
+ </td>
+ </tr>
+ <tr>
+ <th>y</th>
+ <td>
+ The vertical position of the pixel, starting with 0 at the top of the screen in the
+ orientation it had when the screenshot was taken.
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ A tuple of integers representing the pixel, in the form (a,r,g,b) where
+ a is the alpha channel value, and r, g, and b are the red, green, and blue values,
+ respectively.
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+<A NAME="getRawPixelInt"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>tuple</em>
+ </span>
+ <span class="sympad">getRawPixelInt</span>
+ <span class="normal">
+ (<em>integer</em> x,
+ <em>integer</em> y)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Returns the single pixel at the image location (x,y), as an
+ an <em>integer</em>. Use this method to economize on memory.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>x</th>
+ <td>
+ The horizontal position of the pixel, starting with 0 at the left of the screen in the
+ orientation it had when the screenshot was taken.
+ </td>
+ </tr>
+ <tr>
+ <th>y</th>
+ <td>
+ The vertical position of the pixel, starting with 0 at the top of the screen in the
+ orientation it had when the screenshot was taken.
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ The a,r,g, and b values of the pixel as 8-bit values combined into a 32-bit
+ integer, with a as the leftmost 8 bits, r the next rightmost, and so forth.
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+<A NAME="getSubImage"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <code>
+ <a href="{@docRoot}tools/help/MonkeyImage.html">MonkeyImage</a>
+ </code>
+ </span>
+ <span class="sympad">getSubImage</span>
+ <span class="normal">
+ (<em>tuple</em> rect)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Creates a new <code>MonkeyImage</code> object from a rectangular selection of the
+ current image.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>rect</th>
+ <td>
+ A tuple (x, y, w, h) specifying the selection. x and y specify the 0-based pixel
+ position of the upper left-hand corner of the selection. w specifies the width of the
+ region, and h specifies its height, both in units of pixels.
+ <p>
+ The image's orientation is the same as the screen orientation at the time the
+ screenshot was made.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ A new <code>MonkeyImage</code> object containing the selection.
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+<A NAME="sameAs"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>boolean</em>
+ </span>
+ <span class="sympad">sameAs</span>
+ <span class="normal">
+ (
+ <code>
+ <a href="{@docRoot}tools/help/MonkeyImage.html">MonkeyImage</a>
+ </code> otherImage,
+ <em>float</em> percent
+ )
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Compares this <code>MonkeyImage</code> object to another and returns the result of
+ the comparison. The <code>percent</code> argument specifies the percentage
+ difference that is allowed for the two images to be "equal".
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>other</th>
+ <td>
+ Another <code>MonkeyImage</code> object to compare to this one.
+ </td>
+ </tr>
+ <tr>
+ <th>
+ percent
+ </th>
+ <td>
+ A float in the range 0.0 to 1.0, inclusive, indicating
+ the percentage of pixels that need to be the same for the method to return
+ <code>true</code>. The default is 1.0, indicating that all the pixels
+ must match.
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ Boolean <code>true</code> if the images match, or boolean <code>false</code> otherwise.
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+<A NAME="writeToFile"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">writeToFile</span>
+ <span class="normal">
+ (<em>string</em> filename,
+ <em>string</em> format)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Writes the current image to the file specified by <code>filename</code>, in the
+ format specified by <code>format</code>.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>path</th>
+ <td>
+ The fully-qualified filename and extension of the output file.
+ </td>
+ </tr>
+ <tr>
+ <th>
+ format
+ </th>
+ <td>
+ The output format to use for the file. If no format is provided, then the
+ method tries to guess the format from the filename's extension. If no
+ extension is provided and no format is specified, then the default format of
+ "png" (Portable Network Graphics) is used.
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
diff --git a/docs/html/tools/help/MonkeyRunner.jd b/docs/html/tools/help/MonkeyRunner.jd
new file mode 100644
index 0000000..a924d2d
--- /dev/null
+++ b/docs/html/tools/help/MonkeyRunner.jd
@@ -0,0 +1,448 @@
+page.title=MonkeyRunner
+parent.title=monkeyrunner
+parent.link=index.html
+@jd:body
+
+<style>
+ h4.jd-details-title {background-color: #DEE8F1;}
+</style>
+<p>
+ A monkeyrunner class that contains static utility methods.
+</p>
+<h2>Summary</h2>
+<table id="pubmethods" class="jd-sumtable">
+ <tr>
+ <th colspan="12" style="background-color: #E2E2E2">Methods</th>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#alert">alert</a>
+ </span>
+ (<em>string</em> message,
+ <em>string</em> title,
+ <em>string</em> okTitle)
+ </nobr>
+ <div class="jd-descrdiv">
+ Displays an alert dialog to the process running the current
+ program.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <em>integer</em>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#choice">choice</a>
+ </span>
+ (<em>string</em> message,
+ <em>iterable</em> choices,
+ <em>string</em> title)
+ </nobr>
+ <div class="jd-descrdiv">
+ Displays a dialog with a list of choices to the process running the current program.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#help">help</a>
+ </span>
+ (<em>string</em> format)
+ </nobr>
+ <div class="jd-descrdiv">
+ Displays the monkeyrunner API reference in a style similar to that of Python's
+ <code>pydoc</code> tool, using the specified format.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <em>string</em>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#input">input</a>
+ </span>
+ (<em>string</em> message,
+ <em>string</em> initialValue,
+ <em>string</em> title,
+ <em>string</em> okTitle,
+ <em>string</em> cancelTitle)
+ </nobr>
+ <div class="jd-descrdiv">
+ Displays a dialog that accepts input.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ void
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#sleep">sleep</a>
+ </span>
+ (<em>float</em> seconds)
+ </nobr>
+ <div class="jd-descrdiv">
+ Pauses the current program for the specified number of seconds.
+ </div>
+ </td>
+ </tr>
+ <tr class="api" >
+ <td class="jd-typecol">
+ <nobr>
+ <code>
+ <a href="{@docRoot}tools/help/MonkeyDevice.html">MonkeyDevice</a>
+ </code>
+ </nobr>
+ </td>
+ <td class="jd-linkcol" width="100%">
+ <nobr>
+ <span class="sympad">
+ <a href="#waitForConnection">waitForConnection</a>
+ </span>
+ (<em>float</em> timeout,
+ <em>string</em> deviceId)
+ </nobr>
+ <div class="jd-descrdiv">
+ Tries to make a connection between the <code>monkeyrunner</code> backend and the
+ specified device or emulator.
+ </div>
+ </td>
+ </tr>
+</table>
+<!-- ========= METHOD DETAIL ======== -->
+<!-- Public methods -->
+<h2>Public Methods</h2>
+<A NAME="alert"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>string</em>
+ </span>
+ <span class="sympad">alert</span>
+ <span class="normal">
+ (
+ <em>string</em> message,
+ <em>string</em> title,
+ <em>string</em> okTitle)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Displays an alert dialog to the process running the current
+ program. The dialog is modal, so the program pauses until the user clicks the dialog's
+ button.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>message</th>
+ <td>
+ The message to display in the dialog.
+ </td>
+ </tr>
+ <tr>
+ <th>title</th>
+ <td>
+ The dialog's title. The default value is "Alert".
+ </td>
+ </tr>
+ <tr>
+ <th>okTitle</th>
+ <td>
+ The text displayed in the dialog button. The default value is "OK".
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
+</div>
+<A NAME="choice"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>integer</em>
+ </span>
+ <span class="sympad">choice</span>
+ <span class="normal">
+ (<em>string</em> message,
+ <em>iterable</em> choices,
+ <em>string</em> title)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Displays a dialog with a list of choices to the process running the current program. The
+ dialog is modal, so the program pauses until the user clicks one of the dialog's
+ buttons.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>message</th>
+ <td>
+ The prompt message displayed in the dialog.
+ </td>
+ </tr>
+ <tr>
+ <th>choices</th>
+ <td>
+ A Python iterable containing one or more objects that are displayed as strings. The
+ recommended form is an array of strings.
+ </td>
+ </tr>
+ <tr>
+ <th>
+ title
+ </th>
+ <td>
+ The dialog's title. The default is "Input".
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ If the user makes a selection and clicks the "OK" button, the method returns
+ the 0-based index of the selection within the iterable.
+ If the user clicks the "Cancel" button, the method returns -1.
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+<A NAME="help"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">help</span>
+ <span class="normal">
+ (<em>string</em> format)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Displays the monkeyrunner API reference in a style similar to that of Python's
+ <code>pydoc</code> tool, using the specified format.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>format</th>
+ <td>
+ The markup format to use in the output. The possible values are "text" for plain text
+ or "html" for HTML.
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+<A NAME="input"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <em>string</em>
+ </span>
+ <span class="sympad">input</span>
+ <span class="normal">
+ (<em>string</em> message
+ <em>string</em> initialValue,
+ <em>string</em> title,
+ <em>string</em> okTitle,
+ <em>string</em> cancelTitle)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Displays a dialog that accepts input and returns it to the program. The dialog is
+ modal, so the program pauses until the user clicks one of the dialog's buttons.
+ </p>
+ <p>
+ The dialog contains two buttons, one of which displays the okTitle value
+ and the other the cancelTitle value. If the user clicks the okTitle button,
+ the current value of the input box is returned. If the user clicks the cancelTitle
+ button, an empty string is returned.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>message</th>
+ <td>
+ The prompt message displayed in the dialog.
+ </td>
+ </tr>
+ <tr>
+ <th>initialValue</th>
+ <td>
+ The initial value to display in the dialog. The default is an empty string.
+ </td>
+ </tr>
+ <tr>
+ <th>title</th>
+ <td>
+ The dialog's title. The default is "Input".
+ </td>
+ </tr>
+ <tr>
+ <th>okTitle</th>
+ <td>
+ The text displayed in the okTitle button. The default is "OK".
+ </td>
+ </tr>
+ <tr>
+ <th>cancelTitle</th>
+ <td>
+ The text displayed in the cancelTitle button. The default is "Cancel".
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ If the user clicks the okTitle button, then the method returns the current value of
+ the dialog's input box. If the user clicks the cancelTitle button, the method returns
+ an empty string.
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
+<A NAME="sleep"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ void
+ </span>
+ <span class="sympad">sleep</span>
+ <span class="normal">
+ (
+ <em>float</em> seconds
+ )
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Pauses the current program for the specified number of seconds.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>seconds</th>
+ <td>
+ The number of seconds to pause.
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+<A NAME="waitForConnection"></A>
+<div class="jd-details api ">
+ <h4 class="jd-details-title">
+ <span class="normal">
+ <code>
+ <a href="{@docRoot}tools/help/MonkeyDevice.html">MonkeyDevice</a>
+ </code>
+ </span>
+ <span class="sympad">waitForConnection</span>
+ <span class="normal">
+ (<em>float</em> timeout,
+ <em>string</em> deviceId)
+ </span>
+ </h4>
+ <div class="jd-details-descr">
+
+ <div class="jd-tagdata jd-tagdescr">
+ <p>
+ Tries to make a connection between the <code>monkeyrunner</code> backend and the
+ specified device or emulator.
+ </p>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Arguments</h5>
+ <table class="jd-tagtable">
+ <tr>
+ <th>timeout</th>
+ <td>
+ The number of seconds to wait for a connection. The default is to wait forever.
+ </td>
+ </tr>
+ <tr>
+ <th>
+ deviceId
+ </th>
+ <td>
+ A regular expression that specifies the serial number of the device or emulator. See
+ the topic
+ <a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a>
+ for a description of device and emulator serial numbers.
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Returns</h5>
+ <ul class="nolist">
+ <li>
+ A <code><a href="{@docRoot}tools/help/MonkeyDevice.html">MonkeyDevice</a></code>
+ instance for the device or emulator. Use this object to control and communicate with the
+ device or emulator.
+ </li>
+ </ul>
+ </div>
+ </div>
+</div>
diff --git a/docs/html/tools/help/aapt.html b/docs/html/tools/help/aapt.html
new file mode 100644
index 0000000..ebd375d
--- /dev/null
+++ b/docs/html/tools/help/aapt.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/tools/building/index.html#detailed-build">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/tools/building/index.html#detailed-build">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/tools/help/adb.jd b/docs/html/tools/help/adb.jd
new file mode 100644
index 0000000..ddebed60
--- /dev/null
+++ b/docs/html/tools/help/adb.jd
@@ -0,0 +1,669 @@
+page.title=Android Debug Bridge
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>ADB quickview</h2>
+ <ul>
+<li>Manage the state of an emulator or device</li>
+<li>Run shell commands on a device</li>
+<li>Manage port forwarding on an emulator or device</li>
+<li>Copy files to/from an emulator or device</li>
+ </ul>
+
+ <h2>In this document</h2>
+ <ol>
+<li><a href="#issuingcommands">Issuing ADB Commands</a></li>
+<li><a href="#devicestatus">Querying for Emulator/Device Instances</a></li>
+<li><a href="#directingcommands">Directing Commands to a Specific Emulator/Device Instance</a></li>
+<li><a href="#move">Installing an Application</a></li>
+<li><a href="#forwardports">Forwarding Ports</a></li>
+<li><a href="#copyfiles">Copying Files to or from an Emulator/Device Instance</a></li>
+<li><a href="#commandsummary">Listing of adb Commands </a></li>
+<li><a href="#shellcommands">Issuing Shell Commands</a></li>
+<li><a href="#logcat">Enabling logcat Logging</a></li>
+<li><a href="#stopping">Stopping the adb Server</a></li>
+ </ol>
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="emulator.html">Emulator</a></li>
+ </ol>
+
+</div>
+</div>
+
+<p>Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an
+emulator instance or connected Android-powered device. It is a client-server program that includes
+three components: </p>
+
+<ul>
+ <li>A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients. </li>
+ <li>A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device. </li>
+ <li>A daemon, which runs as a background process on each emulator or device instance. </li>
+</ul>
+
+<p>You can find the {@code adb} tool in {@code <sdk>/platform-tools/}.</p>
+
+<p>When you start an adb client, the client first checks whether there is an adb server process already running. If there isn't, it starts the server process. When the server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb clients use port 5037 to communicate with the adb server. </p>
+
+<p>The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example: </p>
+
+<p style="margin-left:2em">
+Emulator 1, console: 5554<br/>
+Emulator 1, adb: 5555<br>
+Emulator 2, console: 5556<br>
+Emulator 2, adb: 5557 ...
+</p>
+
+<p>As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554. </p>
+
+<p>Once the server has set up connections to all emulator instances, you can use adb commands to control and access those instances. Because the server manages connections to emulator/device instances and handles commands from multiple adb clients, you can control any emulator/device instance from any client (or from a script).</p>
+
+<p>The sections below describe the commands that you can use to access adb capabilities and manage the state of an emulator/device. Note that if you are developing Android applications in Eclipse and have installed the ADT plugin, you do not need to access adb from the command line. The ADT plugin provides a transparent integration of adb into the Eclipse IDE. However, you can still use adb directly as necessary, such as for debugging.</p>
+
+<a name="issuingcommands"></a>
+
+<h2>Issuing adb Commands</h2>
+
+<p>You can issue adb commands from a command line on your development machine or from a script. The usage is: </p>
+
+ <pre>adb [-d|-e|-s <serialNumber>] <command> </pre>
+
+<p>When you issue a command, the program invokes an adb client. The client is not specifically associated with any emulator instance, so if multiple emulators/devices are running, you need to use the <code>-d</code> option to specify the target instance to which the command should be directed. For more information about using this option, see <a href="#directingcommands">Directing Commands to a Specific Emulator/Device Instance</a>. </p>
+
+<a name="devicestatus"></a>
+
+<h2>Querying for Emulator/Device Instances</h2>
+
+<p>Before issuing adb commands, it is helpful to know what emulator/device instances are connected to the adb server. You can generate a list of attached emulators/devices using the <code>devices</code> command: </p>
+
+ <pre>adb devices</pre>
+
+<p>In response, adb prints this status information for each instance:</p>
+
+<ul>
+ <li>Serial number — A string created by adb to uniquely identify an emulator/device instance by its
+ console port number. The format of the serial number is <code><type>-<consolePort></code>.
+ Here's an example serial number: <code>emulator-5554</code></li>
+ <li>State — The connection state of the instance. Three states are supported:
+ <ul>
+ <li><code>offline</code> — the instance is not connected to adb or is not responding.</li>
+ <li><code>device</code> — the instance is now connected to the adb server. Note that this state does not
+ imply that the Android system is fully booted and operational, since the instance connects to adb
+ while the system is still booting. However, after boot-up, this is the normal operational state of
+ an emulator/device instance.</li>
+ </ul>
+ </li>
+</ul>
+
+<p>The output for each instance is formatted like this: </p>
+
+ <pre>[serialNumber] [state]</pre>
+
+<p>Here's an example showing the <code>devices</code> command and its output:</p>
+
+ <pre>$ adb devices
+List of devices attached
+emulator-5554 device
+emulator-5556 device
+emulator-5558 device</pre>
+
+<p>If there is no emulator/device running, adb returns <code>no device</code>.</p>
+
+
+<a name="directingcommands"></a>
+
+<h2>Directing Commands to a Specific Emulator/Device Instance</h2>
+
+<p>If multiple emulator/device instances are running, you need to specify a target instance when issuing adb commands. To so so, use the <code>-s</code> option in the commands. The usage for the <code>-s</code> option is:</p>
+
+ <pre>adb -s <serialNumber> <command> </pre>
+
+<p>As shown, you specify the target instance for a command using its adb-assigned serial number. You can use the <code>devices</code> command to obtain the serial numbers of running emulator/device instances. </p>
+
+<p>Here is an example: </p>
+
+ <pre>adb -s emulator-5556 install helloWorld.apk</pre>
+
+<p>Note that, if you issue a command without specifying a target emulator/device instance using <code>-s</code>, adb generates an error.
+
+<a name="move"></a>
+
+<h2>Installing an Application</h2>
+<p>You can use adb to copy an application from your development computer and install it on an emulator/device instance. To do so, use the <code>install</code> command. With the command, you must specify the path to the .apk file that you want to install:</p>
+
+<pre>adb install <path_to_apk></pre>
+
+<p>For more information about how to create an .apk file that you can install on an emulator/device
+instance, see <a href="{@docRoot}tools/building/index.html">Building and Running</a></p>
+
+<p>Note that, if you are using the Eclipse IDE and have the ADT plugin installed, you do not need to use adb (or aapt) directly to install your application on the emulator/device. Instead, the ADT plugin handles the packaging and installation of the application for you. </p>
+
+
+<a name="forwardports"></a>
+
+<h2>Forwarding Ports</h2>
+
+ <p>You can use the <code>forward</code> command to set up arbitrary port forwarding — forwarding of requests on a specific host port to a different port on an emulator/device instance. Here's how you would set up forwarding of host port 6100 to emulator/device port 7100:</p>
+<pre>adb forward tcp:6100 tcp:7100</pre>
+ <p>You can also use adb to set up forwarding to named abstract UNIX domain sockets, as illustrated here:</p>
+<pre>adb forward tcp:6100 local:logd </pre>
+
+<a name="copyfiles"></a>
+
+<h2>Copying Files to or from an Emulator/Device Instance</h2>
+
+<p>You can use the adb commands <code>pull</code> and <code>push</code> to copy files to and from an emulator/device instance's data file. Unlike the <code>install</code> command, which only copies an .apk file to a specific location, the <code>pull</code> and <code>push</code> commands let you copy arbitrary directories and files to any location in an emulator/device instance. </p>
+
+<p>To copy a file or directory (recursively) <em>from</em> the emulator or device, use</p>
+<pre>adb pull <remote> <local></pre>
+
+<p>To copy a file or directory (recursively) <em>to</em> the emulator or device, use</p>
+ <pre>adb push <local> <remote></pre>
+
+<p>In the commands, <code><local></code> and <code><remote></code> refer to the paths to the target files/directory on your development machine (local) and on the emulator/device instance (remote).</p>
+
+<p>Here's an example: </p>
+<pre>adb push foo.txt /sdcard/foo.txt</pre>
+
+<a name="commandsummary"></a>
+
+<h2>Listing of adb Commands</h2>
+
+<p>The table below lists all of the supported adb commands and explains their meaning and usage. </p>
+
+
+<table>
+<tr>
+ <th>Category</th>
+ <th>Command</th>
+ <th>Description</th>
+ <th>Comments</th>
+</tr>
+
+<tr>
+<td rowspan="3">Options</td>
+<td><code>-d</code></td>
+<td>Direct an adb command to the only attached USB device.</td>
+<td>Returns an error if more than one USB device is attached.</td>
+</tr>
+
+<tr>
+<td><code>-e</code></td>
+<td>Direct an adb command to the only running emulator instance.</td>
+<td>Returns an error if more than one emulator instance is running. </td>
+</tr>
+
+<tr>
+<td><code>-s <serialNumber></code></td>
+<td>Direct an adb command a specific emulator/device instance, referred to by its adb-assigned serial number (such as "emulator-5556").</td>
+<td>If not specified, adb generates an error.</td>
+</tr>
+
+<tr>
+<td rowspan="3">General</td>
+<td><code>devices</code></td>
+<td>Prints a list of all attached emulator/device instances.</td>
+<td>See <a href="#devicestatus">Querying for Emulator/Device Instances</a> for more information.</td>
+</tr>
+
+<tr>
+<td><code>help</code></td>
+<td>Prints a list of supported adb commands.</td>
+<td> </td>
+</tr>
+
+<tr>
+<td><code>version</code></td>
+<td>Prints the adb version number. </td>
+<td> </td>
+</tr>
+
+<tr>
+<td rowspan="3">Debug</td>
+<td ><code>logcat [<option>] [<filter-specs>]</code></td>
+<td>Prints log data to the screen. </td>
+<td> </td>
+</tr>
+
+<tr>
+<td><code>bugreport</code></td>
+<td>Prints <code>dumpsys</code>, <code>dumpstate</code>, and <code>logcat</code> data to the screen, for the purposes of bug reporting. </td>
+<td> </td>
+</tr>
+
+<tr>
+<td><code>jdwp</code></td>
+<td>Prints a list of available JDWP processes on a given device. </td>
+<td>You can use the <code>forward jdwp:<pid></code> port-forwarding specification to connect to a specific JDWP process. For example: <br>
+ <code>adb forward tcp:8000 jdwp:472</code><br>
+ <code>jdb -attach localhost:8000</code></p>
+ </td>
+</tr>
+
+<tr>
+<td rowspan=3">Data</td>
+<td><code>install <path-to-apk></code></td>
+<td>Pushes an Android application (specified as a full path to an .apk file) to the data file of an emulator/device. </td>
+<td> </td>
+</tr>
+
+<tr>
+<td><code>pull <remote> <local></code></td>
+<td>Copies a specified file from an emulator/device instance to your development computer. </td>
+<td> </td>
+</tr>
+
+<tr>
+<td><code>push <local> <remote></code></td>
+<td>Copies a specified file from your development computer to an emulator/device instance. </td>
+<td> </td>
+</tr>
+
+<tr>
+<td rowspan="2">Ports and Networking</td>
+<td><code>forward <local> <remote></code></td>
+<td>Forwards socket connections from a specified local port to a specified remote port on the emulator/device instance. </td>
+<td>Port specifications can use these schemes:
+<ul><li><code>tcp:<portnum></code></li>
+<li><code>local:<UNIX domain socket name></code></li>
+<li><code>dev:<character device name></code></li>
+<li><code>jdwp:<pid></code></li></ul>
+</td>
+</tr>
+
+<tr>
+<td><code>ppp <tty> [parm]...</code></td>
+<td>Run PPP over USB.
+<ul>
+<li><code><tty></code> — the tty for PPP stream. For example <code>dev:/dev/omap_csmi_ttyl</code>. </li>
+<li><code>[parm]... </code> — zero or more PPP/PPPD options, such as <code>defaultroute</code>, <code>local</code>, <code>notty</code>, etc.</li></ul>
+
+<p>Note that you should not automatically start a PPP connection. </p></td>
+<td></td>
+</tr>
+
+<tr>
+<td rowspan="3">Scripting</td>
+<td><code>get-serialno</code></td>
+<td>Prints the adb instance serial number string.</td>
+<td rowspan="2">See <a href="#devicestatus">Querying for Emulator/Device Instances</a> for more information. </td>
+</tr>
+
+<tr>
+<td><code>get-state</code></td>
+<td>Prints the adb state of an emulator/device instance.</td>
+</td>
+</tr>
+
+<tr>
+<td><code>wait-for-device</code></td>
+<td>Blocks execution until the device is online — that is, until the instance state is <code>device</code>.</td>
+<td>You can prepend this command to other adb commands, in which case adb will wait until the emulator/device instance is connected before issuing the other commands. Here's an example:
+<pre>adb wait-for-device shell getprop</pre>
+
+Note that this command does <em>not</em> cause adb to wait until the entire system is fully booted. For that reason, you should not prepend it to other commands that require a fully booted system. As an example, the <code>install</code> requires the Android package manager, which is available only after the system is fully booted. A command such as
+
+<pre>adb wait-for-device install <app>.apk</pre>
+
+would issue the <code>install</code> command as soon as the emulator or device instance connected to the adb server, but before the Android system was fully booted, so it would result in an error. </td>
+</tr>
+
+
+
+<tr>
+<td rowspan="2">Server</td>
+<td><code>start-server</code></td>
+<td>Checks whether the adb server process is running and starts it, if not.</td>
+<td> </td>
+</tr>
+
+<tr>
+<td><code>kill-server</code></td>
+<td>Terminates the adb server process.</td>
+<td> </td>
+</tr>
+
+
+
+<tr>
+<td rowspan="2">Shell</td>
+<td><code>shell</code></td>
+<td>Starts a remote shell in the target emulator/device instance.</td>
+<td rowspan="2">See <a href="#shellcommands">Issuing Shell Commands</a> for more information. </td>
+</tr>
+
+<tr>
+<td><code>shell [<shellCommand>]</code></td>
+<td>Issues a shell command in the target emulator/device instance and then exits the remote shell.</td>
+</tr>
+
+</table>
+
+
+<a name="shellcommands"></a>
+
+<h2>Issuing Shell Commands</h2>
+
+<p>Adb provides an ash shell that you can use to run a variety of commands on an emulator
+or device. The command binaries are stored in the file system of the emulator or device,
+in this location: </p>
+
+<pre>/system/bin/...</pre>
+
+<p>You can use the <code>shell</code> command to issue commands, with or without entering the adb remote shell on the emulator/device. </p>
+
+<p>To issue a single command without entering a remote shell, use the <code>shell</code> command like this: </p>
+
+ <pre>adb [-d|-e|-s {<serialNumber>}] shell <shellCommand></pre>
+
+<p>To drop into a remote shell on a emulator/device instance, use the <code>shell</code> command like this:</p>
+
+ <pre>adb [-d|-e|-s {<serialNumber>}] shell</pre>
+
+<p>When you are ready to exit the remote shell, use <code>CTRL+D</code> or <code>exit</code> to end the shell session. </p>
+
+<p>The sections below provide more information about shell commands that you can use.</p>
+
+<a name="sqlite" id="sqlite"></a>
+
+<h3>Examining sqlite3 Databases from a Remote Shell</h3>
+
+<p>From an adb remote shell, you can use the
+<a href="http://www.sqlite.org/sqlite.html">sqlite3</a> command-line program to
+manage SQLite databases created by Android applications. The
+<code>sqlite3</code> tool includes many useful commands, such as
+<code>.dump</code> to print out the contents of a table and
+<code>.schema</code> to print the SQL CREATE statement for an existing table.
+The tool also gives you the ability to execute SQLite commands on the fly.</p>
+
+<p>To use <code>sqlite3</code>, enter a remote shell on the emulator instance, as described above, then invoke the tool using the <code>sqlite3</code> command. Optionally, when invoking <code>sqlite3</code> you can specify the full path to the database you want to explore. Emulator/device instances store SQLite3 databases in the folder <code><span chatdir="1"><span chatindex="259474B4B070F261">/data/data/<em><package_name></em>/databases</span></span>/</code>. </p>
+
+<p>Here's an example: </p>
+
+<pre>$ adb -s emulator-5554 shell
+# sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db
+SQLite version 3.3.12
+Enter ".help" for instructions
+<em>.... enter commands, then quit...</em>
+sqlite> .exit </pre>
+
+<p>Once you've invoked <code>sqlite3</code>, you can issue <code>sqlite3</code> commands in the shell. To exit and return to the adb remote shell, use <code>exit</code> or <code>CTRL+D</code>.
+
+
+<a name="monkey"></a>
+
+<h3>UI/Application Exerciser Monkey</h3>
+
+<p>The Monkey is a program that runs on your emulator or device and generates pseudo-random
+streams of user events such as clicks, touches, or gestures, as well as a number of system-level
+events. You can use the Monkey to stress-test applications that you are developing,
+in a random yet repeatable manner.</p>
+
+<p>The simplest way to use the monkey is with the following command, which will launch your
+application and send 500 pseudo-random events to it.</p>
+
+<pre>$ adb shell monkey -v -p your.package.name 500</pre>
+
+<p>For more information about command options for Monkey, see the complete
+<a href="{@docRoot}tools/help/monkey.html" title="monkey">UI/Application Exerciser Monkey</a> documentation page.</p>
+
+
+<a name="othershellcommands"></a>
+
+<h3>Other Shell Commands</h3>
+
+<p>The table below lists several of the adb shell commands available. For a complete list of commands and programs, start an emulator instance and use the <code>adb -help</code> command. </p>
+
+<pre>adb shell ls /system/bin</pre>
+
+<p>Help is available for most of the commands. </p>
+
+<table>
+<tr>
+ <th>Shell Command</th>
+ <th>Description</th>
+ <th>Comments</th>
+</tr>
+
+<tr>
+<td><code>dumpsys</code></td>
+<td>Dumps system data to the screen.</td>
+<td rowspan=4">The <a href="{@docRoot}tools/debugging/ddms.html">Dalvik Debug Monitor Server</a>
+(DDMS) tool offers integrated debug environment that you may find easier to use.</td>
+</tr>
+
+<tr>
+<td><code>dumpstate</code></td>
+<td>Dumps state to a file.</td>
+</tr>
+
+<tr>
+<td><code>logcat [<option>]... [<filter-spec>]...</code></td>
+<td>Enables radio logging and prints output to the screen. </td>
+</tr>
+
+<tr>
+<td><code>dmesg</code></td>
+<td>Prints kernel debugging messages to the screen. </td>
+</tr>
+
+<tr>
+<td><code>start</code></td>
+<td>Starts (restarts) an emulator/device instance.</td>
+<td> </td>
+</tr>
+
+<tr>
+<td><code>stop</code></td>
+<td>Stops execution of an emulator/device instance.</td>
+<td> </td>
+</tr>
+
+</table>
+
+<a name="logcat"></a>
+
+<h2>Enabling logcat Logging</h2>
+
+<p>The Android logging system provides a mechanism for collecting and viewing system debug output. Logs from various applications and portions of the system are collected in a series of circular buffers, which then can be viewed and filtered by the <code>logcat</code> command.</p>
+
+<a name="usinglogcat"></a>
+
+<h3>Using logcat Commands</h3>
+
+<p>You can use the <code>logcat</code> command to view and follow the contents of the system's log buffers. The general usage is:</p>
+
+<pre>[adb] logcat [<option>] ... [<filter-spec>] ...</pre>
+
+<p>The sections below explain filter specifications and the command options. See <a href="#logcatoptions">Listing of logcat Command Options</a> for a summary of options. </p>
+
+<p>You can use the <code>logcat</code> command from your development computer or from a remote adb shell in an emulator/device instance. To view log output in your development computer, you use</p>
+
+<pre>$ adb logcat</pre>
+
+<p>and from a remote adb shell you use</p>
+
+<pre># logcat</pre>
+
+<a name="filteringoutput"></a>
+
+<h3>Filtering Log Output</h3>
+
+<p>Every Android log message has a <em>tag</em> and a <em>priority</em> associated with it. </p>
+
+<ul>
+<li>The tag of a log message is a short string indicating the system component from which the message originates (for example, "View" for the view system). </li>
+
+<li>The priority is one of the following character values, ordered from lowest to highest priority:</li>
+
+<ul>
+ <li><code>V</code> — Verbose (lowest priority)</li>
+ <li><code>D</code> — Debug</li>
+ <li><code>I</code> — Info (default priority)</li>
+ <li><code>W</code> — Warning</li>
+ <li><code>E</code> — Error</li>
+ <li><code>F</code> — Fatal</li>
+ <li><code>S</code> — Silent (highest priority, on which nothing is ever printed)</li>
+</ul>
+</ul>
+
+<p>You can obtain a list of tags used in the system, together with priorities, by running <code>logcat</code> and observing the first two columns
+of each message, given as <code><priority>/<tag></code>. </p>
+
+<p>Here's an example of logcat output that shows that the message relates to priority level "I" and tag "ActivityManager":</p>
+
+<pre>I/ActivityManager( 585): Starting activity: Intent { action=android.intent.action...}</pre>
+
+<p>To reduce the log output to a manageable level, you can restrict log output using <em>filter expressions</em>. Filter expressions let you indicate to the system the tags-priority combinations that you are interested in — the system suppresses other messages for the specified tags. </p>
+
+<p>A filter expression follows this format <code>tag:priority ...</code>, where <code>tag</code> indicates the tag of interest and <code>priority</code> indicates the <em>minimum</em> level of priority to report for that tag. Messages for that tag at or above the specified priority are written to the log. You can supply any number of <code>tag:priority</code> specifications in a single filter expression. The series of specifications is whitespace-delimited. The default output is to show all log messages with the Info priority (*:I).</p>
+
+<p>Here's an example of a filter expression that suppresses all log messages except those with the tag "ActivityManager", at priority "Info" or above, and all log messages with tag "MyApp", with priority "Debug" or above:</p>
+
+<pre>adb logcat ActivityManager:I MyApp:D *:S</pre>
+
+<p>The final element in the above expression, <code>*:S</code>, sets the priority level for all tags to "silent", thus ensuring only log messages with "View" and "MyApp" are displayed. Using <code>*:S</code> is an excellent way to ensure that log output is restricted to the filters that you have explicitly specified — it lets your filters serve as a "whitelist" for log output.</p>
+
+<p>The following filter expression displays all log messages with priority level "warning" and higher, on all tags:</p>
+
+<pre>adb logcat *:W</pre>
+
+<p>If you're running <code>logcat</code> from your development computer (versus running it on a remote adb shell), you can also set a default filter expression by exporting a value for the environment variable <code>ANDROID_LOG_TAGS</code>:</p>
+
+<pre>export ANDROID_LOG_TAGS="ActivityManager:I MyApp:D *:S"</pre>
+
+<p>Note that <code>ANDROID_LOG_TAGS</code> filter is not exported to the emulator/device instance, if you are running <code>logcat</code> from a remote shell or using <code>adb shell logcat</code>.</p>
+
+
+<a name="outputformat"></a>
+
+<h3>Controlling Log Output Format</h3>
+
+<p>Log messages contain a number of metadata fields, in addition to the tag and priority. You can modify the output format for messages so that they display a specific metadata field. To do so, you use the <code>-v</code> option and specify one of the supported output formats listed below. </p>
+
+<ul>
+ <li><code>brief</code> — Display priority/tag and the PID of process issuing the message (the default format).</li>
+ <li><code>process</code> — Display PID only.</li>
+ <li><code>tag</code> — Display the priority/tag only. </li>
+ <li><code>raw</code> — Display the raw log message, with no other metadata fields.</li>
+ <li><code>time</code> — Display the date, invocation time, priority/tag, and PID of the process issuing the message.</li>
+ <li><code>threadtime</code> — Display the date, invocation time, priority, tag, and the PID and TID of the thread issuing the message.</li>
+ <li><code>long</code> — Display all metadata fields and separate messages with a blank lines.</li>
+</ul>
+
+<p>When starting <code>logcat</code>, you can specify the output format you want by using the <code>-v</code> option:</p>
+
+<pre>[adb] logcat [-v <format>]</pre>
+
+<p>Here's an example that shows how to generate messages in <code>thread</code> output format: </p>
+
+<pre>adb logcat -v thread</pre>
+
+<p>Note that you can only specify one output format with the <code>-v</code> option. </p>
+
+<a name="alternativebuffers"></a>
+
+<h3>Viewing Alternative Log Buffers </h3>
+
+<p>The Android logging system keeps multiple circular buffers for log messages, and not all of the log messages are sent to the default circular buffer. To see additional log messages, you can start <code>logcat</code> with the <code>-b</code> option, to request viewing of an alternate circular buffer. You can view any of these alternate buffers: </p>
+
+<ul>
+<li><code>radio</code> — View the buffer that contains radio/telephony related messages.</li>
+<li><code>events</code> — View the buffer containing events-related messages.</li>
+<li><code>main</code> — View the main log buffer (default)</li>
+</ul>
+
+<p>The usage of the <code>-b</code> option is:</p>
+
+<pre>[adb] logcat [-b <buffer>]</pre>
+
+<p>Here's an example of how to view a log buffer containing radio and telephony messages: </p>
+
+<pre>adb logcat -b radio</b></pre>
+
+<a name="stdout"></a>
+
+<h3>Viewing stdout and stderr</h3>
+
+<p>By default, the Android system sends <code>stdout</code> and <code>stderr</code> (<code>System.out</code> and <code>System.err</code>) output to <code>/dev/null</code>. In
+processes that run the Dalvik VM, you can have the system write a copy of the output to the log file. In this case, the system writes the messages to the log using the log tags <code>stdout</code> and <code>stderr</code>, both with priority <code>I</code>. </p>
+
+<p>To route the output in this way, you stop a running emulator/device instance and then use the shell command <code>setprop</code> to enable the redirection of output. Here's how you do it: </p>
+
+<pre>$ adb shell stop
+$ adb shell setprop log.redirect-stdio true
+$ adb shell start</pre>
+
+<p>The system retains this setting until you terminate the emulator/device instance. To use the setting as a default on the emulator/device instance, you can add an entry to <code>/data/local.prop</code>
+on the device.</p>
+
+<a name="logcatoptions"></a>
+
+<h3>Listing of logcat Command Options</h3>
+
+<table>
+<tr>
+ <th>Option</th>
+ <th>Description</th>
+</tr>
+
+<tr>
+<td><code>-b <buffer></code></td>
+<td>Loads an alternate log buffer for viewing, such as <code>event</code> or <code>radio</code>. The <code>main</code> buffer is used by default. See <a href="#alternativebuffers">Viewing Alternative Log Buffers</a>.</td>
+</tr>
+
+<tr>
+<td><code>-c</code></td>
+<td>Clears (flushes) the entire log and exits. </td>
+</tr>
+
+<tr>
+<td><code>-d</code></td>
+<td>Dumps the log to the screen and exits.</td>
+</tr>
+
+<tr>
+<td><code>-f <filename></code></td>
+<td>Writes log message output to <code><filename></code>. The default is <code>stdout</code>.</td>
+</tr>
+
+<tr>
+<td><code>-g</code></td>
+<td>Prints the size of the specified log buffer and exits. </td>
+</tr>
+
+<tr>
+<td><code>-n <count></code></td>
+<td>Sets the maximum number of rotated logs to <code><count></code>. The default value is 4. Requires the <code>-r</code> option. </td>
+</tr>
+
+<tr>
+<td><code>-r <kbytes></code></td>
+<td>Rotates the log file every <code><kbytes></code> of output. The default value is 16. Requires the <code>-f</code> option. </td>
+</tr>
+
+<tr>
+<td><code>-s</code></td>
+<td>Sets the default filter spec to silent. </td>
+</tr>
+
+<tr>
+<td><code>-v <format></code></td>
+<td>Sets the output format for log messages. The default is <code>brief</code> format. For a list of supported formats, see <a href="#outputformat">Controlling Log Output Format</a>.</td>
+</tr>
+
+</table>
+
+<a name="stopping"></a>
+
+<h2>Stopping the adb Server</h2>
+
+<p>In some cases, you might need to terminate the adb server process and then restart it. For example, if adb does not respond to a command, you can terminate the server and restart it and that may resolve the problem. </p>
+
+<p>To stop the adb server, use the <code>kill-server</code>. You can then restart the server by issuing any adb command. </p>
+
+
diff --git a/docs/html/tools/help/adt.jd b/docs/html/tools/help/adt.jd
new file mode 100644
index 0000000..cd5bc67
--- /dev/null
+++ b/docs/html/tools/help/adt.jd
@@ -0,0 +1,527 @@
+page.title=Android Developer Tools
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#tools">SDK Tools Integration</a></li>
+
+ <li><a href="#editors">Code Editors</a>
+ <ol>
+ <li><a href="#resource-linking">Resource linking enhancements</a></li>
+ </ol>
+ </li>
+
+ <li><a href="#graphical-editor">Graphical Layout Editor</a>
+ <ol>
+ <li><a href="#canvas">Canvas and outline view</a></li>
+ <li><a href="#palette">Palette</a></li>
+ <li><a href="#config-chooser">Configuration chooser</a></li>
+ </ol>
+ </li>
+
+ <li><a href="#refactoring">Layout Factoring Support</a></li>
+
+ </ol>
+
+ <h2>Related videos</h2>
+
+ <ol>
+ <li><a href="{@docRoot}videos/index.html#v=Oq05KqjXTvs">Android Developer Tools
+ Google I/O Session</a>
+ </li>
+ </ol>
+
+ <h2>See also</h2>
+
+ <ol>
+ <li><a href="http://tools.android.com/recent">Android Tools change blog</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>ADT (Android Developer Tools) is a plugin for Eclipse that provides a suite of
+ tools that are integrated with the Eclipse IDE. It offers you access to many features that help
+ you develop Android applications quickly. ADT
+ provides GUI access to many of the command line SDK tools as well as a UI design tool for rapid
+ prototyping, designing, and building of your application's user interface.</p>
+
+ <p>Because ADT is a plugin for Eclipse, you get the functionality of a well-established IDE,
+ along with Android-specific features that are bundled with ADT. The following
+ describes important features of Eclipse and ADT:</p>
+
+ <dl>
+ <dt><strong>Integrated Android project creation, building, packaging, installation, and
+ debugging</strong></dt>
+
+ <dd>ADT integrates many development workflow tasks into Eclipse, making it easy for you to
+ rapidly develop and test your Android applications.</dd>
+
+ <dt><strong>SDK Tools integration</strong></dt>
+
+ <dd>Many of the <a href="#tools">SDK tools</a> are integrated into Eclipse's menus,
+ perspectives, or as a part of background processes ran by ADT.</dd>
+
+ <dt><strong>Java programming language and XML editors</strong></dt>
+
+ <dd>The Java programming language editor contains common IDE features such as compile time
+ syntax checking, auto-completion, and integrated documentation for the Android framework APIs.
+ ADT also provides custom XML editors that let you
+ edit Android-specific XML files in a form-based UI. A graphical layout editor lets you design
+ user interfaces with a drag and drop interface.</dd>
+
+ <dt><strong>Integrated documentation for Android framework APIs</strong></dt>
+ <dd>You can access documentation by hovering over classes, methods, or variables.</dd>
+ </dl>
+
+ <p>You can find the most up-to-date and more detailed information about changes and new features
+on the <a href="http://tools.android.com/recent">Recent Changes</a> page at the Android Tools
+Project site.</p>
+
+ <h2 id="tools">SDK Tools Integration</h2>
+
+ <div class="sidebox-wrapper">
+ <div class="sidebox">
+ <h2>Need help designing icons?</h2>
+ <p>The <a href="http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html">Android
+ Asset Studio</a> is a web-based tool that lets you generate icons from existing images,
+ clipart, or text. It also generates the icons with different DPIs for different screen sizes and
+ types.</p>
+
+ </div>
+ </div>
+
+ <p>Many of the tools that you can start or run from the command line are integrated into ADT.
+ They include:</p>
+
+ <ul>
+ <li><a href="{@docRoot}tools/debugging/debugging-tracing.html">Traceview</a>:
+ Allows you to profile your program's execution
+ (<strong>Window > Open Perspective > Traceview</strong>). </li>
+
+ <li><a href="{@docRoot}tools/help/android.html">android</a>: Provides access to
+ the Android SDK Manager and AVD Manager. Other <code>android</code> features such as creating or
+ updating projects (application and library) are integrated throughout the Eclipse IDE. </li>
+
+ <li><a href="{@docRoot}tools/debugging/debugging-ui.html#HierarchyViewer">Hierarchy
+ Viewer</a>: Allows you to visualize your application's view hierarchy to find inefficiencies
+ (<strong>Window > Open Perspective > Hierarchy Viewer</strong>).</li>
+
+ <li><a href="{@docRoot}tools/debugging/debugging-ui.html#pixelperfect">Pixel
+ Perfect</a>: Allows you to closely examine your UI to help with designing and building.
+ (<strong>Window > Open Perspective > Pixel Perfect</strong>).</li>
+
+ <li><a href="{@docRoot}tools/debugging/ddms.html">DDMS</a>: Provides
+ debugging features including: screen capturing, thread and heap information, and logcat
+ (<strong>Window > Open Perspective > DDMS</strong>).</li>
+
+ <li><a href="{@docRoot}tools/help/adb.html">adb</a>: Provides access to
+ a device from your development system. Some features of
+ <code>adb</code> are integrated into ADT such as project installation (Eclipse run menu),
+ file transfer, device enumeration, and logcat (DDMS). You must access the more advanced
+ features of <code>adb</code>, such as shell commands, from the command line.</li>
+
+ <li><a href="{@docRoot}tools/help/proguard.html">ProGuard</a>: Allows code obfuscation,
+ shrinking, and optimization. ADT integrates ProGuard as part of the build, if you <a href=
+ "{@docRoot}tools/help/proguard.html#enabling">enable it</a>.</li>
+ </ul>
+
+<h2 id="editors">Code Editors</h2>
+
+ <p>In addition to Eclipse's standard editor features, ADT provides custom XML editors to help
+ you create and edit Android manifests, resources, menus, and layouts in a form-based or graphical
+ mode. Double-clicking on an XML file in Eclipse's package explorer opens the
+ appropriate XML editor.
+
+ <div class="sidebox-wrapper">
+ <div class="sidebox">
+ <h2>Google I/O Session Video</h2>
+ <p>View the segment on the <a href=
+ "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=30m50s">XML editors</a> for more
+ information.</p>
+ </div>
+ </div>
+
+ <p class="note"><strong>Note:</strong> You can edit Android-specific XML files (such as a layout
+or manifest) in both a graphical mode and also an XML markup mode. You can switch between
+these modes with the pair of tabs at the bottom of each custom XML editor.</p>
+
+ <p>In addition, some special file types that don't have custom editors, such as drawables, animations,
+ and color files offer editing enhancements such as XML tag completion.</p>
+
+<p>ADT provides the following custom, form-based XML editors:</p>
+
+ <dl>
+
+ <dt><strong>Graphical Layout Editor</strong></dt>
+
+ <dd>Edit and design your XML layout files with a drag and drop interface. The layout editor
+ renders your interface as well, offering you a preview as you design your layouts. This editor
+ is invoked when you open an XML file with a view declared (usually declared in
+ <code>res/layout</code>. For more information, see <a href="#graphical-editor">Graphical Layout
+ Editor</a>.</dd>
+
+ <dt><strong>Android Manifest Editor</strong></dt>
+
+ <dd>Edit Android manifests with a simple graphical interface. This editor is invoked
+ when you open an <code>AndroidManifest.xml</code> file.</dd>
+
+ <dt><strong>Menu Editor</strong></dt>
+
+ <dd>Edit menu groups and items with a simple graphical interface. This editor is
+ invoked when you open an XML file with a <code><menu></code> declared (usually located in
+ the <code>res/menu</code> folder).</dd>
+
+ <dt><strong>Resources Editor</strong></dt>
+
+ <dd>Edit resources with a simple graphical interface. This editor is invoked when
+ you open an XML file with a <code><resources></code> tag declared.</dd>
+
+ <dt><strong>XML Resources Editor</strong></dt>
+
+ <dd>Edit XML resources with a simple graphical interface. This editor is invoked
+ when you open an XML file.</dd>
+ </dl>
+
+
+ <h3 id="resource-linking">Resource linking enhancements</h3>
+ <p>In addition to the normal code editing features of Eclipse, ADT provides enhancements to the Android
+ development experience that allow you to quickly jump to declarations of various types of resources such
+ as strings or layout files. You can access these enhancements by holding down the control key and
+ clicking on the following items:
+
+ <ul>
+
+ <li>A resource identifier, such as <code>R.id.button1</code>, jumps
+ to the XML definition of the view.</li>
+
+ <li>A declaration in the <code>R.java</code> file, such as <code>public
+ static final int Button01=0x7f050000"</code>, jumps to the corresponding XML definition.</li>
+
+ <li>An activity or service definition in your manifest, such as
+ <code><activity android:name=".TestActivity"></code>, jumps to the corresponding Java class. You can
+ jump from an activity definition (or service definition) into the corresponding Java class.</li>
+
+ <li>You can jump to any value definition (e.g. <code>@string:foo</code>), regardless of
+which XML file
+ "foo" is defined in.</li>
+
+ <li>Any file-based declaration, such as <code>@layout/bar</code>, opens the file.</li>
+
+ <li>Non-XML resources, such as <code>@drawable/icon</code>, launches
+ Eclipse's default application for the given file type, which in this case is an
+ image.</li>
+
+ <li><code>@android</code> namespace resources opens the resources found in
+ the SDK install area.</li>
+
+ <li>Custom views in XML layouts, such as <code><foo.bar.MyView></foo.bar.MyView></code>,
+ or <code><view class="foo.bar.MyView"></code>) jump to the corresponding custom view classes.</li>
+
+ <li>An XML attribute such as <code>@android:string/ok</code> or <code>android.R.string.id</code> in Java code
+ opens the file that declares the strings. The XML tab opens when doing this, not
+ the form-based editor.</li>
+
+ </ul>
+
+ <h2 id="graphical-editor">Graphical Layout Editor</h2>
+
+ <p>ADT provides many features to allow you to design and build your application's user interface.
+ Many of these features are in the graphical layout editor, which you can access by opening one of
+ your application's XML layout files in Eclipse.
+ </p>
+
+ <p>The graphical layout editor is the main screen that you use to visually design and build your
+ UI. It is split up into the following parts:</p>
+
+ <dl>
+ <dt><strong>Canvas</strong></dt>
+
+ <dd>In the middle of the editor is the canvas. It provides the rendered view of your
+ layout and supports dragging and dropping of UI widgets
+ directly from the palette. You can select the platform version used to render the items in
+ the canvas. Each platform version has its own look and feel, which might be the similar to or
+ radically different from another platform version. The canvas renders the appropriate look
+ and feel for the currently selected platform version.
+ This platform version does not need to be the same as the version that your
+ application targets.
+
+ <p>The canvas also provides
+ context-sensitive actions in the layout actions bar, such as adjusting layout margins and
+orientation.
+ The layout actions bar displays available actions depending on the selected UI element in the
+ canvas.</p>
+ </dd>
+
+ <dt><strong>Outline</strong></dt>
+
+ <dd>On the right side of the editor is the outline view. It displays a hierarchical
+ view of your layout where you can do things such as reorder of views. The outline
+ view exposes similar functionality as the canvas but displays your layout in an ordered
+ list instead of a rendered preview.</dd>
+
+ <dt><strong>Palette</strong></dt>
+
+ <dd>On the left side of the editor is the palette. It provides a set of widgets that
+ you can drag onto the canvas. The palette shows rendered previews of the
+ widgets for easy lookup of desired UI widgets.</dd>
+
+ <dt><strong>Configuration Chooser</strong></dt>
+
+ <dd>At the top of the editor is the configuration chooser.
+ It provides options to change a layout's rendering mode or screen type.</dd>
+ </dl>
+
+ <img src="{@docRoot}images/layout_editor.png" alt="graphical layout editor screenshot"
+ height="500" id="layout-editor" name="layout-editor">
+
+ <p class="img-caption"><strong>Figure 1.</strong> Graphical layout editor</p>
+
+ <h3 id="canvas">Canvas and outline view</h3>
+
+ <div class="sidebox-wrapper">
+ <div class="sidebox">
+ <h2>Google I/O Session Video</h2>
+
+ <p>View the segment on the <a href=
+ "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=7m16s">canvas and outline view</a> and the
+ <a href="http://www.youtube.com/watch?v=Oq05KqjXTvs#t=11m43s">layout actions bar</a>
+ for more information.
+ </p>
+ </div>
+ </div>
+
+ <p>The canvas is the area where you can drag and drop UI widgets from the palette to design your
+ layout. The canvas offers a rendered preview of your layout depending on factors such as the
+ selected platform version, screen orientation, and currently selected theme that you specify in
+ the <a href="#configuration-chooser">configuration chooser</a>. You can also drag and drop
+ items into the outline view, which displays your layout in a hierarchical list. The outline view
+ exposes much of the same functionality as the canvas but offers another method of organization
+ that is beneficial for ordering and quickly selecting items. When you right-click a specific item
+ in the canvas or outline view, you can access a context-sensitive menu that lets you modify the
+ following attributes of the layout or view:</p>
+
+ <dl>
+ <dt><strong>View and layout properties</strong></dt>
+
+ <dd>
+ When you right-click a view or layout in the canvas or outline view, it brings up a
+ context-sensitive menu that lets you set things such as:
+
+ <ul>
+ <li>ID of the view or layout</li>
+
+ <li>Text of the view</li>
+
+ <li>Layout width</li>
+
+ <li>Layout height</li>
+
+ <li>Properties such as alpha or clickable</li>
+ </ul>
+ </dd>
+
+ <dt><strong>Animation preview and creation</strong></dt>
+
+ <dd>
+ If your layout or view is animated, you can preview the animation directly in the canvas
+ (when you select Android 3.0 or later as the platform version in the configuration chooser).
+ Right-click an item in the canvas and select <strong>Play Animation</strong>. If
+ animation is not associated with item, an option is available in the menu to create one.
+
+ <p>View the segment on the <a href=
+ "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=28m30s">animation features</a> for more
+ information.</p>
+ </dd>
+
+ <dt><strong>Extract as Include</strong></dt>
+
+ <dd>You can extract parts of a current layout into its own layout file,
+ which you can then include in any layout with a single line of XML. See <a href=
+ "#extract-as-include">Layout Refactoring Support</a> for more information.</dd>
+ </dl>
+
+ <h4>Other canvas features</h4>
+
+ <p>The canvas has additional features not available in the outline view:</p>
+
+ <ul>
+
+ <li>Edit views with the layout actions bar: The context-sensitive layout actions bar allows you to
+ edit how a view is laid out in your UI. The available actions depend on the currently
+ selected view and its parent layout. Some common actions include
+ toggling the fill mode of the view and specifying margins. For instance, if you select a
+ {@link android.widget.Button}
+ in a {@link android.widget.LinearLayout}, you see actions related to the {@link
+android.widget.LinearLayout}, such as a toggle to switch
+ between horizontal and vertical layout, and a toggle to control whether its children are
+ aligned along their text baseline. You will also see toolbar actions to control the individual
+ layout attributes of the child, such as whether the child should stretch out to match its
+ parent's width and height, a dropdown action to set the child's layout gravity, a button to open
+ a margin editor, and a layout weight editor.</li>
+
+ <li>Edit a nested layout in its current context: If you are editing a layout
+ that includes another layout, you can edit the included layout in the layout that included
+ it.</li>
+
+ <li>Preview drag and drop location: When you drag and drop a UI widget onto the canvas, ruler
+ markers appear showing you the approximate location of the UI widget depending on the
+ type of layout, such as {@link android.widget.RelativeLayout} or {@link
+ android.widget.LinearLayout}.</li>
+
+ <li>Preview animations: You can preview view and layout animations when you select Android 2.1
+ or later for the platform version in the configuration bar.</li>
+
+ <li>Render layouts in real-time: Layouts are rendered as accurately as possible according to
+ the platform version, including the appropriate system and action bars.</li>
+
+ <li>Support for fragments: Fragments can be rendered in the same screen as the layout that
+ includes the fragments.</li>
+
+ </ul>
+
+ <img src="{@docRoot}images/canvas.png" alt="screenshot of the canvas" height="553">
+
+ <p class="img-caption"><strong>Figure 2.</strong> Canvas portion of the layout editor showing
+ a rendered preview of an application</p>
+
+ <img src=
+ "{@docRoot}images/layout_outline.png" alt="screenshot of the outline view" height="185">
+
+ <p class="img-caption"><strong>Figure 3.</strong> Outline view showing current layout's structure</p>
+
+ <h3 id="palette">Palette</h3>
+
+ <div class="sidebox-wrapper">
+ <div class="sidebox">
+ <h2>Google I/O Session Video</h2>
+
+ <p>View the segment on the <a href=
+ "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=7m53s">palette</a> for more information.</p>
+ </div>
+ </div>
+
+ <p>The palette contains the UI widgets that you can drag and drop onto the canvas and add to your
+ layout. The pallete categorizes the widgets and shows rendered previews
+ for easier lookup. The main features of the palette include:</p>
+
+ <ul>
+ <li>Different modes of rendered previews include: icons only, icons and text, tiny previews,
+ small previews, and previews (rendered in real size). Previews are only available for layouts
+ rendered with the latest revisions of Android 2.1 (API Level 7) or later.</li>
+
+ <li>Custom views in your project or library projects are added under custom views
+ category.</li>
+
+ <li>Arrange UI widgets alphabetically or by category.</li>
+ </ul>
+ <img src="{@docRoot}images/palette.png" alt="palette screenshot" height="566">
+
+ <p class="img-caption"><strong>Figure 4.</strong> Palette showing available UI widgets</p>
+
+ <h3 id="config-chooser">Configuration chooser</h3>
+
+ <div class="sidebox-wrapper">
+ <div class="sidebox">
+ <h2>Google I/O Session Video</h2>
+
+ <p>View the segment on the <a href=
+ "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=12m51s">configuration chooser</a> for more
+ information.</p>
+ </div>
+ </div>
+
+
+ <p>The configuration chooser allows you to create and configure different configurations of
+ a layout for different situations, such as one for landscape and one for portrait mode. You can
+ set the following options for each configuration of a layout:
+ </p>
+ <ul>
+ <li>Screen type combo box: Predefined screen settings for common device configurations. You
+ can also create your own by selecting <strong>Custom...</strong>.</li>
+
+ <li>Screen orientation combo box: Portrait or Landscape screen orientation.</li>
+
+ <li>Theme combo box: Predefined themes or a custom theme that you have created.</li>
+
+ <li>Platform combo box: Platform version used to render the canvas and palette as well as
+ displaying appropriate themes.</li>
+
+ <li>Custom layout combo boxes: The locale, dock, and time of day combo boxes let you select
+ different versions of the same layout depending on the device's current state. You can
+ create a new version of a layout with the <strong>Create</strong> button.</li>
+ </ul>
+
+ <img src="{@docRoot}images/layout_bar.png" alt=
+ "configuration chooser screenshot" height="50" id="configuration-chooser" name="configuration chooser">
+
+ <p class="img-caption"><strong>Figure 5.</strong> Configuration chooser</p>
+
+ <h2 id="refactoring">Layout Refactoring Support</h2>
+
+ <div class="sidebox-wrapper">
+ <div class="sidebox">
+ <h2>Google I/O Session Video</h2>
+
+ <p>View the segment on <a href=
+ "http://www.youtube.com/watch?v=Oq05KqjXTvs#t=18m00s">refactoring features</a> for a rundown
+of the more important refactoring features.</p>
+
+ </div>
+ </div>
+
+ <p>In both the graphical and XML layout editor, there are many features that help you quickly
+ refactor your layouts. The following list describes the major refactoring support:</p>
+
+ <dl>
+
+ <dt><strong>Change layout</strong></dt>
+ <dd>This lets you change the layout on the fly and re-renders the canvas for you.
+ You can apply this refactoring to any layout and the layout is converted to the new type if
+ possible. In many cases, the opening and closing tags of the layout's XML element are changed
+ along with things such as ID attributes and their references. However, for some supported
+ types, ADT attempts to preserve the layout, such as changing a {@link
+ android.widget.LinearLayout} to a {@link android.widget.RelativeLayout}.</dd>
+
+ <dt><strong>Change widget</strong></dt>
+ <dd>This lets you select one or more widgets and converts them to a new widget type. In
+ addition to changing the element name, it also removes any
+ attributes that are not supported by the new widget type and adds in any mandatory attributes
+ required by the new widget type. If the current ID of a widget includes the
+ current widget type in its ID (such as a <code><Button></code> widget named
+ <code>"button1"</code>), then the ID is changed to match the new widget type and all
+ references are updated.</dd>
+
+ <dt id="extract-as-include"><strong>Extract as include</strong></dt>
+ <dd>This lets you extract views inside of an existing layout into their own separate layout
+ file. An <code>include</code> tag that points to the newly created layout file is inserted
+ into the existing layout file. Right-click the view or layout and select <strong>Extract as
+ Include...</strong>.</dd>
+
+ <dt><strong>Extract string</strong></dt>
+ <dd>Extract strings from either XML or Java files into their own separate resource file.</dd>
+
+ <dt><strong>Extract style</strong></dt>
+ <dd>Extract style-related attributes from a layout and define them in a new
+ <code>styles.xml</code> file. You can select multiple views and this refactoring extracts all
+ of the same styles into one style and assigns that style to all the views that use it.</dd>
+
+ <dt><strong>Wrap-in container</strong></dt>
+ <dd>This lets you select one or more sibling elements and wrap them in a new container. This
+ can be applied to the root element as well, in which case the namespace declaration attributes
+ will be transferred to the new root. This refactoring also transfers <code>layout_</code>
+ attribute references to the new root, For example, suppose you have a {@link android.widget.RelativeLayout}.
+ If other widgets have layout constraints pointing to your widget, wrapping the widget causes
+ these constraints to point to the parent instead.</dd>
+
+ <dt><strong>Quick Assistant</strong></dt>
+ <dd>Provides refactoring suggestions depending on the current context. Press
+ <strong>Ctrl-1</strong> (or <strong>Cmd-1</strong> on
+ Mac) in an editor, and Eclipse provides a list of possible refactorings depending on the
+ context. The Quick Assistant provides fast access to all of the above refactorings, where applicable.
+ For example, if you are editing an XML value and decide you want to extract it out
+ as a string, place the text cursor in the string and press Ctrl-1 to see the refactoring context
+ menu.</dd>
+ </dl>
diff --git a/docs/html/tools/help/android.jd b/docs/html/tools/help/android.jd
new file mode 100644
index 0000000..282c791
--- /dev/null
+++ b/docs/html/tools/help/android.jd
@@ -0,0 +1,393 @@
+page.title=android
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+<p>{@code android} is an important development tool that lets you:</p>
+
+ <ul>
+ <li>Create, delete, and view Android Virtual Devices (AVDs). See <a href=
+ "{@docRoot}tools/devices/managing-avds-cmdline.html">Managing AVDs from the Command
+Line</a>.</li>
+
+ <li>Create and update Android projects. See <a href=
+ "{@docRoot}tools/projects/projects-cmdline.html">Managing Projects from
+ the Command Line</a>.</li>
+
+ <li>Update your Android SDK with new platforms, add-ons, and documentation. See <a href=
+ "{@docRoot}sdk/exploring.html">Exploring the SDK</a>.</li>
+ </ul>If you are using Eclipse, the <code>android</code> tool's features are integrated
+ into ADT, so you should not need to use this tool directly.
+
+ <p class="note"><strong>Note:</strong> The documentation of options below is not exhaustive
+and may be out of date. For the most current list of options, execute <code>android
+--help</code>.</p>
+
+
+
+
+ <h2>Syntax</h2>
+ <pre>android [global options] action [action options]</pre>
+
+ <h3>Global Options</h3>
+
+ <dl>
+ <dt><code>-s</code></dt>
+
+ <dd>Silent mode: only errors are printed out</dd>
+
+ <dt><code>-h</code></dt>
+
+ <dd>Usage help</dd>
+
+ <dt><code>-v</code></dt>
+
+ <dd>Verbose mode: errors, warnings and informational messages are printed.</dd>
+ </dl>
+
+ <h3>AVD actions and options</h3>
+
+ <table>
+ <tr>
+ <th width="15%">Action</th>
+
+ <th width="20%">Option</th>
+
+ <th width="30%">Description</th>
+
+ <th>Comments</th>
+ </tr>
+
+ <tr>
+ <td><code>avd</code></td>
+
+ <td>None</td>
+
+ <td>Launch the AVD Manager</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>sdk</code></td>
+
+ <td>None</td>
+
+ <td>Launch the Android SDK Manager</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td rowspan="6"><code>create avd</code></td>
+
+ <td><code>-n <name></code></td>
+
+ <td>The name for the AVD.</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-t <targetID></code></td>
+
+ <td>Target ID of the system image to use with the new AVD. To obtain a list of available
+ targets, use <code>android list targets</code></td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-c <path>|<size>[K|M]</code></td>
+
+ <td>The path to the SD card image to use with this AVD or the size of a new SD card image to
+ create for this AVD. For example, <code>-c path/to/sdcard</code> or <code>-c
+ 1000M</code>.</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>-f</code></td>
+
+ <td>Force creation of the AVD</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>-p <path></code></td>
+
+ <td>Path to the location at which to create the directory for this AVD's files.</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>-s <name>|<width>-<height></code></td>
+
+ <td>The skin to use for this AVD, identified by name or dimensions. The <code>android</code>
+ tool scans for a matching skin by name or dimension in the <code>skins/</code> directory of
+ the target referenced in the <code>-t <targetID></code> argument. For example, <code>-s
+ HVGA-L</code></td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>delete avd</code></td>
+
+ <td><code>-n <name></code></td>
+
+ <td>The name of the AVD to delete</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td rowspan="3"><code>move avd</code></td>
+
+ <td><code>-n <name></code></td>
+
+ <td>The name of the AVD to move</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-p <path></code></td>
+
+ <td>Path to the location at which to create the directory for this AVD's files.</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>-r <new-name></code></td>
+
+ <td>New name of the AVD if you want to rename it</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>update avd</code></td>
+
+ <td><code>-n <name></code></td>
+
+ <td>The name of the AVD to move</td>
+
+ <td>Required</td>
+ </tr>
+ </table>
+
+ <h3>Project actions and options</h3>
+
+ <table>
+ <tr>
+ <th width="15%">Action</th>
+
+ <th width="20%">Option</th>
+
+ <th width="30%">Description</th>
+
+ <th>Comments</th>
+ </tr>
+
+ <tr>
+ <td rowspan="5"><code>create project</code></td>
+
+ <td><code>-n <name></code></td>
+
+ <td>The name for the project</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-t <targetID></code></td>
+
+ <td>Target ID of the system image to use with the new AVD. To obtain a list of available
+ targets, use <code>android list targets</code></td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-k <path>|<size>[K|M]</code></td>
+
+ <td>Package namespace</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-a</code></td>
+
+ <td>Name for the default Activity class</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-p <path></code></td>
+
+ <td>Location of your project directory</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td rowspan="5"><code>update project</code></td>
+
+ <td><code>-n <name></code></td>
+
+ <td>The name of the project to update</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>-p <path></code></td>
+
+ <td>Location path of the project</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-l <library path></code></td>
+
+ <td>Location path of an Android Library to add, relative to the main project</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>-s <subprojects></code></td>
+
+ <td>Update any projects in subfolders such as test projects</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>-t <targetID></code></td>
+
+ <td>Target id to set for the project</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td rowspan="3"><code>create-test-project</code></td>
+
+ <td><code>-n <name></code></td>
+
+ <td>The name of the project</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>-p <path></code></td>
+
+ <td>Location path of the project</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-m <main></code></td>
+
+ <td>The name of the project</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td rowspan="2"><code>update-test-project</code></td>
+
+ <td><code>-p <path></code></td>
+
+ <td>Location path of the project to test, relative to the new project</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-m <main></code></td>
+
+ <td>The main class of the project to test</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td rowspan="4"><code>create-lib-project</code></td>
+
+ <td><code>-k <packageName></code></td>
+
+ <td>(Required) Package name of the library project</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-p <path></code></td>
+
+ <td>Location path of the project</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-t <targetID></code></td>
+
+ <td>Target ID of the library project</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-n <name></code></td>
+
+ <td>The name of the project</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td rowspan="3"><code>update-lib-project</code></td>
+
+ <td><code>-p <path></code></td>
+
+ <td>Location path of the project</td>
+
+ <td>Required</td>
+ </tr>
+
+ <tr>
+ <td><code>-l <libraryPath></code></td>
+
+ <td>Location path of an Android Library to add, relative to the main project</td>
+
+ <td></td>
+ </tr>
+
+ <tr>
+ <td><code>-t <name></code></td>
+
+ <td>Target ID of the library project</td>
+
+ <td></td>
+ </tr>
+ </table>
+
+ <h3>Update actions</h3>
+ <dl>
+ <dt><code>update adb</code></dt>
+ <dd>Updates adb to support the USB devices declared in the SDK add-ons.</dd>
+
+ <dt><code>update sdk</code></dt>
+ <dd>Updates the SDK by suggesting new platforms to install if available.</dd>
diff --git a/docs/html/tools/help/bmgr.jd b/docs/html/tools/help/bmgr.jd
new file mode 100644
index 0000000..2248fa6
--- /dev/null
+++ b/docs/html/tools/help/bmgr.jd
@@ -0,0 +1,193 @@
+page.title=bmgr
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+<!-- quickview box content here -->
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>bmgr quickview</h2>
+<p><code>bmgr</code> lets you control the backup/restore system on an Android device.
+
+ <h2>In this document</h2>
+ <ol>
+<li><a href="#backup">Forcing a Backup Operation</a></li>
+<li><a href="#restore">Forcing a Restore Operation</a></li>
+<li><a href="#other">Other Commands</a></li>
+ </ol>
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/topics/data/backup.html">Data Backup</a></li>
+ </ol>
+
+</div>
+</div>
+
+<!-- normal page content here -->
+
+<p><code>bmgr</code> is a shell tool you can use to interact with the Backup Manager
+on Android devices supporting API Level 8 or greater. It provides commands to induce backup
+and restore operations so that you don't need to repeatedly wipe data or take similar
+intrusive steps in order to test your application's backup agent. These commands are
+accessed via the <a href="{@docRoot}tools/help/adb.html">adb</a> shell.
+
+<p>For information about adding support for backup in your application, read <a
+href="{@docRoot}guide/topics/data/backup.html">Data Backup</a>, which includes a guide to testing
+your application using {@code bmgr}.</p>
+
+
+<h2 id="backup">Forcing a Backup Operation</h2>
+
+<p>Normally, your application must notify the Backup Manager when its data has changed, via {@link
+android.app.backup.BackupManager#dataChanged()}. The Backup Manager will then invoke your
+backup agent's {@link
+android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor,BackupDataOutput,ParcelFileDescriptor)
+onBackup()} implementation at some time in the future. However, instead of calling {@link
+android.app.backup.BackupManager#dataChanged()}, you can invoke a backup request from the command
+line by running the <code>bmgr backup</code> command:
+
+ <pre class="no-pretty-print">adb shell bmgr backup <em><package></em></pre>
+
+<p><code><em><package></em></code> is the formal package name of the application you wish to
+schedule for
+backup. When you execute this backup command, your application's backup agent will be invoked to
+perform a backup operation at some time in the future (via your {@link
+android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor,BackupDataOutput,ParcelFileDescriptor)
+onBackup()} method), though there is no guarantee when it will occur. However, you can force all
+pending backup operations to run immediately by using the <code>bmgr run</code> command:
+
+ <pre class="no-pretty-print">adb shell bmgr run</pre>
+
+<p>This causes a backup pass to execute immediately, invoking the backup agents of all applications
+that had previously called {@link android.app.backup.BackupManager#dataChanged()} since the
+last backup operation, plus any applications which had been manually scheduled for
+backup via <code>bmgr backup</code>.
+
+
+
+<h2 id="restore">Forcing a Restore Operation</h2>
+
+<p>Unlike backup operations, which are batched together and run on an occasional basis, restore
+operations execute immediately. The Backup Manager currently provides two kinds of restore
+operations. The first kind restores an entire device with the data that has been backed up. This
+is typically performed only when a device is first provisioned (to replicate settings and other
+saved state from the user's previous device) and is an operation that only the system can
+perform. The second kind of restore operation restores
+a single application to its "active" data set; that is, the application will abandon its current
+data and revert to the last-known-good data that is held in the current backup image. You can
+invoke this second restore operation with the {@link
+android.app.backup.BackupManager#requestRestore(RestoreObserver) requestRestore()} method. The
+Backup Manager will then invoke your backup agent's {@link
+android.app.backup.BackupAgent#onRestore(BackupDataInput,int,ParcelFileDescriptor)
+onRestore()} implementation.
+
+<p>While testing your application, you can immediately invoke the restore operation (bypassing the
+{@link android.app.backup.BackupManager#requestRestore(RestoreObserver) requestRestore()} method)
+for your application by using the <code>bmgr restore</code> command:
+
+ <pre class="no-pretty-print">adb shell bmgr restore <em><package></em></pre>
+
+<p><code><em><package></em></code> is the formal Java-style package name of the application
+participating in the backup/restore mechanism, which you would like to restore. The Backup
+Manager will immediately instantiate the application's backup agent and invoke it for restore. This
+will happen even if your application is not currently running.
+
+
+
+
+
+<h2 id="other">Other Commands</h2>
+
+<h3>Wiping data</h3>
+
+<p>The data for a single application can be erased from the active data set on demand. This is
+very useful while you're developing a backup agent, in case bugs lead you to write corrupt data
+or saved state information. You can wipe an application's data with the <code>bmgr wipe</code>
+command:
+
+ <pre class="no-pretty-print">adb shell bmgr wipe <em><package></em></pre>
+
+<p><code><em><package></em></code> is the formal package name of the application whose data
+you wish to
+erase. The next backup operation that the application's agent processes will look as
+though the application had never backed anything up before.
+
+
+<h3>Enabling and disabling backup</h3>
+
+<p>You can see whether the Backup Manager is operational at all with the <code>bmgr
+enabled</code> command:
+
+ <pre class="no-pretty-print">adb shell bmgr enabled</pre>
+
+<p>This might be useful if your application's backup agent is never being invoked for backup, to
+verify whether the operating system thinks it should be performing such operations at all.</p>
+
+<p>You can also directly disable or enable the Backup Manager with this command:
+
+ <pre class="no-pretty-print">adb shell bmgr enable <em><boolean></em></pre>
+
+<p><code><em><boolean></em></code> is either <code>true</code> or <code>false</code>.
+This is equivalent to disabling or enabling backup in the device's main Settings UI.</p>
+
+<p class="warning"><strong>Warning!</strong> When backup is disabled, the current backup transport
+will explicitly wipe
+the entire active data set from its backend storage. This is so that when a user says
+they do <em>not</em> want their data backed up, the Backup Manager respects that wish. No further
+data will be saved from the device, and no restore operations will be possible, unless the Backup
+Manager is re-enabled (either through Settings or through the above <code>bmgr</code> command).
+
+
+
+
+<!-- The following is not useful to applications, but may be some useful information some day...
+
+
+<h2 id="transports">Applying a Backup Transport</h2>
+
+<p>A "backup transport" is the code module responsible for moving backup and restore data
+to and from some storage location. A device can have multipe transports installed, though only
+one is active at any given time. Transports are identified by name. You can see what
+transports are available on your device or emulator by running the
+<code>bmgr list transports</code> command:
+
+ <pre class="no-pretty-print">adb shell bmgr list transports</pre>
+
+<p>The output of this command is a list of the transports available on the device. The currently
+active transport is flagged with a <code>*</code> character. Transport names may look like
+component names (for example, <code>android/com.android.internal.backup.LocalTransport</code>),
+but they need not be, and the strings are never used as direct class references. The use of
+a component-like naming scheme is simply for purposes of preventing name collisions.
+
+<p>You can change which transport is currently active from the command line as well:
+
+ <pre class="no-pretty-print">adb shell bmgr transport <em><name></em></pre>
+
+<p><code><em><name></em></code> is one of the names as printed by the <code>bmgr list
+transports</code>
+command. From this point forward, backup and restore operations will be directed through the
+newly-selected transport. Backup state tracking is managed separately for each transport, so
+switching back and forth between them will not corrupt the saved state.
+
+
+
+
+<h2 id="restoresets">Viewing Restore Sets</h2>
+
+<p>All of the application data that a device has written to its backup transport is tracked
+as a group that is collectively called a "restore set," because each data set is
+most often manipulated during a restore operation. When a device is provisioned for the first
+time, a new restore set is established. You can get a listing of all the restore sets available to
+the current transport by running the <code>bmgr list sets</code> command:
+
+ <pre class="no-pretty-print">adb shell bmgr list sets</pre>
+
+<p>The output is a listing of available restore sets, one per line. The first item on each line is
+a token (a hexadecimal value that identifies the restore set to the transport). Following
+the token is a string that briefly identifies the restore set.
+Only the token is used within the backup and restore mechanism.
+
+
+-->
diff --git a/docs/html/tools/help/ddms.html b/docs/html/tools/help/ddms.html
new file mode 100644
index 0000000..d885d56
--- /dev/null
+++ b/docs/html/tools/help/ddms.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/tools/debugging/ddms.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/tools/debugging/ddms.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/tools/help/dmtracedump.jd b/docs/html/tools/help/dmtracedump.jd
new file mode 100644
index 0000000..bdc820d
--- /dev/null
+++ b/docs/html/tools/help/dmtracedump.jd
@@ -0,0 +1,66 @@
+page.title=dmtracedump
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+
+ <p><code>dmtracedump</code> is a tool that gives you an alternate way of generating
+ graphical call-stack diagrams from trace log files (instead of using Traceview).</p>
+
+ <p>This document is a reference to the available command line options. For more information on generating trace
+ logs, see <a href="{@docRoot}tools/debugging/debugging-tracing.html">Profiling with
+ Traceview and dmtracedump</a>.</p>
+
+ <p>The usage for <code>dmtracedump</code> is:</p>
+ <pre>
+dmtracedump [-ho] [-s sortable] [-d trace-base-name] [-g outfile] <trace-base-name>
+</pre>
+
+ <p>The tool then loads trace log data from <code><trace-base-name>.data</code> and
+ <trace-base-name>.key. The table below lists the options for dmtracedump.</p>
+
+ <table>
+ <tr>
+ <th>Option</th>
+
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><nobr><code>-d <em><trace-base-name></em></code></nobr></td>
+
+ <td>Diff with this trace name</td>
+ </tr>
+
+ <tr>
+ <td><code>-g <em><outfile></em></code></td>
+
+ <td>Generate output to <outfile></td>
+ </tr>
+
+ <tr>
+ <td><code>-h</code></td>
+
+ <td>Turn on HTML output</td>
+ </tr>
+
+ <tr>
+ <td><code>-o</code></td>
+
+ <td>Dump the trace file instead of profiling</td>
+ </tr>
+
+ <tr>
+ <td><code>-d <em><trace-base-name></em></code></td>
+
+ <td>URL base to the location of the sortable javascript file</td>
+ </tr>
+
+ <tr>
+ <td><code>-t <percent></code></td>
+
+ <td>Minimum threshold for including child nodes in the graph (child's inclusive time as a
+ percentage of parent inclusive time). If this option is not used, the default threshold is
+ 20%.</td>
+ </tr>
+ </table>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/draw9patch.jd b/docs/html/tools/help/draw9patch.jd
similarity index 100%
rename from docs/html/guide/developing/tools/draw9patch.jd
rename to docs/html/tools/help/draw9patch.jd
diff --git a/docs/html/tools/help/emulator.jd b/docs/html/tools/help/emulator.jd
new file mode 100644
index 0000000..fa101e1
--- /dev/null
+++ b/docs/html/tools/help/emulator.jd
@@ -0,0 +1,581 @@
+page.title=Android Emulator
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#KeyMapping">Keyboard Commands</a></li>
+ <li><a href="#startup-options">Command Line Parameters</a></li>
+ </ol>
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}tools/devices/emulator.html">Using the Android Emulator</a></li>
+ <li><a href="{@docRoot}tools/devices/index.html">Managing Virtual Devices</a></li>
+ </ol>
+
+</div>
+</div>
+
+
+<p>The Android SDK includes a mobile device emulator — a virtual mobile device
+that runs on your computer. The emulator lets you develop and test
+Android applications without using a physical device.</p>
+
+<p>This document is a reference to the available command line options and the keyboard mapping to
+device keys.
+For a complete guide to using the Android Emulator, see
+<a href="{@docRoot}tools/devices/emulator.html">Using the Android Emulator</a>.
+
+
+<h2 id="KeyMapping">Keyboard Commands</h2>
+
+<p>Table 1 summarizes the mappings between the emulator keys and the keys of your keyboard.</p>
+
+<p class="table-caption"><strong>Table 1.</strong> Emulator keyboard mapping</p>
+<table border="0" style="clear:left;">
+ <tr>
+ <th>Emulated Device Key </th>
+ <th>Keyboard Key </th>
+ </tr>
+ <tr>
+ <td>Home</td>
+ <td>HOME</td>
+ </tr>
+ <tr>
+ <td>Menu (left softkey)</td>
+ <td>F2 <em>or</em> Page-up button</td>
+ </tr>
+ <tr>
+ <td>Star (right softkey)</td>
+ <td>Shift-F2 <em>or </em>Page Down</td>
+ </tr>
+ <tr>
+ <td>Back</td>
+ <td>ESC</td>
+ </tr>
+ <tr>
+ <td>Call/dial button </td>
+ <td>F3</td>
+ </tr>
+ <tr>
+ <td>Hangup/end call button</td>
+ <td>F4</td>
+ </tr>
+ <tr>
+ <td>Search</td>
+ <td>F5 </td>
+ </tr>
+ <tr>
+ <td>Power button</td>
+ <td>F7 </td>
+ </tr>
+ <tr>
+ <td>Audio volume up button</td>
+ <td>KEYPAD_PLUS, Ctrl-F5</td>
+ </tr>
+
+ <tr>
+ <td>Audio volume down button</td>
+ <td>KEYPAD_MINUS, Ctrl-F6</td>
+ </tr>
+ <tr>
+ <td>Camera button</td>
+ <td>Ctrl-KEYPAD_5, Ctrl-F3</td>
+ </tr>
+ <tr>
+ <td>Switch to previous layout orientation (for example, portrait, landscape)</td>
+ <td>KEYPAD_7, Ctrl-F11</td>
+ </tr>
+ <tr>
+ <td>Switch to next layout orientation (for example, portrait, landscape)</td>
+ <td>KEYPAD_9, Ctrl-F12</td>
+ </tr>
+ <tr>
+ <td>Toggle cell networking on/off</td>
+ <td>F8</td>
+ </tr>
+ <tr>
+ <td>Toggle code profiling</td>
+ <td>F9 (only with <code>-trace</code> startup option)</td>
+ </tr>
+ <tr>
+ <td>Toggle fullscreen mode</td>
+ <td>Alt-Enter</td>
+ </tr>
+ <tr>
+ <td>Toggle trackball mode</td>
+ <td>F6</td>
+ </tr>
+ <tr>
+ <td>Enter trackball mode temporarily (while key is pressed)</td>
+ <td>Delete</td>
+ </tr>
+ <tr>
+ <td>DPad left/up/right/down</td>
+ <td>KEYPAD_4/8/6/2</td>
+ </tr>
+ <tr>
+ <td>DPad center click</td>
+ <td>KEYPAD_5</td>
+ </tr>
+ <tr>
+ <td>Onion alpha increase/decrease</td>
+ <td>KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/)</td>
+ </tr>
+</table>
+
+
+<h2 id="startup-options">Command Line Parameters</h2>
+
+<p>The emulator supports a variety of options that you can specify
+when launching the emulator, to control its appearance or behavior.
+Here's the command-line syntax of the options available to the {@code emulator} program:</p>
+
+<pre>emulator -avd <avd_name> [-<option> [<value>]] ... [-<qemu args>]</pre>
+
+<p class="table-caption"><strong>Table 2.</strong> Emulator command line parameters</p>
+<table>
+<tr>
+ <th width="10%" >Category</th>
+ <th width="20%" >Option</th>
+ <th width="30%" >Description</th>
+ <th width="40%" >Comments</th>
+</tr>
+
+<tr>
+ <td>AVD</td>
+ <td><code>-avd <avd_name></code> or <br>
+ <code>@<avd_name></code></td>
+ <td><strong>Required</strong>. Specifies the AVD to load for this emulator
+ instance.</td>
+ <td>You must create an AVD configuration before launching the emulator. For
+ information, see <a href="{@docRoot}tools/devices/managing-avds.html">Managing
+ AVDs with AVD Manager</a>.</td>
+<tr>
+ <td rowspan="7">Disk Images</td>
+ <td><code>-cache <filepath></code></td>
+ <td>Use <filepath> as the working cache partition image. </td>
+ <td>An absolute or relative path to the current working directory.
+ If no cache file is specified, the emulator's default behavior is to use a temporary file instead.
+ <p>For more information on disk images, use <code>-help-disk-images</code>.</p>
+</td></tr>
+<tr>
+ <td><code>-data <filepath></code></td>
+ <td>Use {@code <filepath>} as the working user-data disk image. </td>
+ <td>Optionally, you can specify a path relative to the current working directory.
+ If <code>-data</code> is not used, the emulator looks for a file named {@code userdata-qemu.img}
+ in the storage area of the AVD being used (see <code>-avd</code>).
+</td></tr>
+<!--
+<tr>
+ <td><code>-datadir <dir></code></td>
+ <td>Search for the user-data disk image specified in <code>-data</code> in <dir></td>
+ <td><code><dir></code> is a path relative to the current working directory.
+
+<p>If you do not specify <code>-datadir</code>, the emulator looks for the user-data image
+in the storage area of the AVD being used (see <code>-avd</code>)</p><p>For more information
+on disk images, use <code>-help-disk-images</code>.</p>
+</td></tr>
+-->
+<!--
+<tr>
+ <td><code>-image <filepath></code></td>
+ <td>Use <filepath> as the system image.</td>
+ <td>Optionally, you can specify a path relative to the current working directory.
+ Default is <system>/system.img.</td>
+</tr>
+-->
+<tr>
+ <td><code>-initdata <filepath></code></td>
+ <td>When resetting the user-data image (through <code>-wipe-data</code>), copy the contents
+ of this file to the new user-data disk image. By default, the emulator copies the <code><system>/userdata.img</code>.</td>
+ <td>Optionally, you can specify a path relative to the current working directory. See also <code>-wipe-data</code>.
+ <p>For more information on disk images, use <code>-help-disk-images</code>.</p></td>
+</tr>
+<tr>
+ <td><code>-nocache</code></td>
+ <td>Start the emulator without a cache partition.</td>
+ <td>See also <code>-cache <file></code>.</td>
+</tr>
+<tr>
+ <td><code>-ramdisk <filepath></code></td>
+ <td>Use <filepath> as the ramdisk image.</td>
+ <td>Default value is <code><system>/ramdisk.img</code>.
+ <p>Optionally, you can specify a path relative to the current working directory.
+ For more information on disk images, use <code>-help-disk-images</code>.</p>
+</td>
+</tr>
+<tr>
+ <td><code>-sdcard <filepath></code></td>
+ <td>Use <file> as the SD card image.</td>
+ <td>Default value is <code><system>/sdcard.img</code>.
+ <p>Optionally, you can specify a path relative to the current working directory. For more information on disk images, use <code>-help-disk-images</code>.</p>
+</td>
+</tr>
+<!--
+<tr>
+ <td><code>-system <dirpath></code></td>
+ <td>Search for system, ramdisk and user data images in <dir>.</td>
+ <td><code><dir></code> is a directory path relative to the current
+ working directory.</td>
+</tr>
+-->
+<tr>
+ <td><code>-wipe-data</code></td>
+ <td>Reset the current user-data disk image (that is, the file specified by <code>-datadir</code> and
+ <code>-data</code>, or the default file). The emulator deletes all data from the user data image file,
+ then copies the contents of the file at <code>-inidata</code> data to the image file before starting.
+ </td>
+ <td>See also <code>-initdata</code>.
+ <p>For more information on disk images, use <code>-help-disk-images</code>.</p>
+</td>
+</tr>
+<tr>
+ <td rowspan="9">Debug</td>
+ <td><code>-debug <tags></code></td>
+ <td>Enable/disable debug messages for the specified debug tags.</td>
+ <td><code><tags></code> is a space/comma/column-separated list of debug component names.
+ Use <code>-help-debug-tags</code> to print a list of debug component names that you can use. </td>
+</tr>
+<tr>
+ <td><code>-debug-<tag></code></td>
+ <td>Enable/disable debug messages for the specified debug tag.</td>
+ <td rowspan="2">Use <code>-help-debug-tags</code> to print a list of debug component names that you can use in <code><tag></code>. </td>
+</tr>
+<tr>
+ <td><code>-debug-no-<tag></code></td>
+ <td>Disable debug messages for the specified debug tag.</td>
+</tr>
+<tr>
+ <td><code>-logcat <logtags></code></td>
+ <td>Enable logcat output with given tags.</td>
+ <td>If the environment variable ANDROID_LOG_TAGS is defined and not
+ empty, its value will be used to enable logcat output by default.</td>
+</tr>
+<tr>
+ <td><code>-shell</code></td>
+ <td>Create a root shell console on the current terminal.</td>
+ <td>You can use this command even if the adb daemon in the emulated system is broken.
+ Pressing Ctrl-c from the shell stops the emulator instead of the shell.</td>
+</tr>
+<tr>
+ <td><code>-shell-serial <device></code></td>
+ <td>Enable the root shell (as in <code>-shell</code> and specify the QEMU character
+ device to use for communication with the shell.</td>
+ <td><device> must be a QEMU device type. See the documentation for '-serial <em>dev</em>' at
+ <a href="http://wiki.qemu.org/download/qemu-doc.html">http://wiki.qemu.org/download/qemu-doc.html</a>
+ for a list of device types.
+
+<p>Here are some examples: </p>
+<ul>
+ <li><code>-shell-serial stdio</code> is identical to <code>-shell</code></li>
+ <li><code>-shell-serial tcp::4444,server,nowait</code> lets you communicate with the shell over TCP port 4444</li>
+ <li><code>-shell-serial fdpair:3:6</code> lets a parent process communicate with the shell using fds 3 (in) and 6 (out)</li>
+ <li><code>-shell-serial fdpair:0:1</code> uses the normal stdin and stdout fds, except that QEMU won't tty-cook the data.</li>
+ </ul>
+</td>
+</tr>
+<tr>
+ <td><code>-show-kernel <name></code></td>
+ <td>Display kernel messages.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-trace <name></code></td>
+ <td>Enable code profiling (press F9 to start), written to a specified file.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-verbose</code></td>
+ <td>Enable verbose output.</td>
+ <td>Equivalent to <code>-debug-init</code>.
+<p>You can define the default verbose output options used by emulator instances in the Android environment variable
+ANDROID_VERBOSE. Define the options you want to use in a comma-delimited list, specifying only the stem of each option:
+<code>-debug-<tags>.</code> </p>
+<p>Here's an example showing ANDROID_VERBOSE defined with the <code>-debug-init</code> and <code>-debug-modem</code> options:
+<p><code>ANDROID_VERBOSE=init,modem</code></p>
+<p>For more information about debug tags, use <code><-help-debug-tags></code>.</p>
+</td>
+</tr>
+<tr>
+ <td rowspan="6">Media</td>
+ <td><code>-audio <backend></code></td>
+ <td>Use the specified audio backend.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-audio-in <backend></code></td>
+ <td>Use the specified audio-input backend.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-audio-out <backend></code></td>
+ <td>Use the specified audio-output backend.</td>
+ <td> </td>
+</tr>
+<!--<tr>
+ <td><code>-mic <device or file></code></td>
+ <td>Use device or WAV file for audio input.</td>
+ <td> </td>
+</tr>
+-->
+<tr>
+ <td><code>-noaudio</code></td>
+ <td>Disable audio support in the current emulator instance.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-radio <device></code></td>
+ <td>Redirect radio modem interface to a host character device.</td>
+ <td> </td></tr>
+<tr>
+ <td><code>-useaudio</code></td>
+ <td>Enable audio support in the current emulator instance.</td>
+ <td>Enabled by default. </td>
+</tr>
+
+<tr>
+ <td rowspan="7">Network</td>
+ <td><code>-dns-server <servers></code></td>
+ <td>Use the specified DNS server(s). </td>
+ <td>The value of <code><servers></code> must be a comma-separated list of up to 4 DNS server names or
+ IP addresses.</td>
+</tr>
+<tr>
+ <td><code>-http-proxy <proxy></code></td>
+ <td>Make all TCP connections through a specified HTTP/HTTPS proxy</td>
+ <td>The value of <code><proxy></code> can be one of the following:<br>
+ <code>http://<server>:<port></code><br>
+ <code>http://<username>:<password>@<server>:<port></code>
+ <p>The <code>http://</code> prefix can be omitted. If the <code>-http-proxy <proxy></code> command is not supplied,
+ the emulator looks up the <code>http_proxy</code> environment variable and automatically uses any value matching
+ the <code><proxy></code> format described above.</p></td>
+</tr>
+<tr>
+ <td><code>-netdelay <delay></code></td>
+ <td>Set network latency emulation to <delay>.</td>
+ <td>Default value is <code>none</code>. See the table in
+ <a href="{@docRoot}tools/devices/emulator.html#netdelay">Network Delay Emulation</a>
+ for supported <code><delay></code> values. </td>
+</tr>
+<tr>
+ <td><code>-netfast</code></td>
+ <td>Shortcut for <code>-netspeed full -netdelay none</code></td>
+ <td> </td></tr>
+<tr>
+ <td><code>-netspeed <speed></code></td>
+ <td>Set network speed emulation to <speed>.</td>
+ <td>Default value is <code>full</code>. See the table in
+ <a href="{@docRoot}tools/devices/emulator.html#netspeed">Network Speed Emulation</a> for
+ supported <code><speed></code> values. </td>
+</tr>
+<tr>
+ <td><code>-port <port></code></td>
+ <td>Set the console port number for this emulator instance to <code><port></code>.</td>
+ <td>The console port number must be an even integer between 5554 and 5584, inclusive. <code><port></code>+1
+ must also be free and will be reserved for ADB.</td>
+</tr>
+<tr>
+ <td><code>-report-console <socket></code></td>
+ <td>Report the assigned console port for this emulator instance to a remote third party
+ before starting the emulation. </td>
+ <td><code><socket></code> must use one of these formats:
+
+<p><code>tcp:<port>[,server][,max=<seconds>]</code></br>
+<code>unix:<port>[,server][,max=<seconds>]</code></p>
+
+<p>Use <code>-help-report-console</code></p> to view more information about this topic. </td>
+</tr>
+<tr>
+ <td rowspan="10">System</td>
+ <td><code>-cpu-delay <delay></code></td>
+ <td>Slow down emulated CPU speed by <delay> </td>
+ <td>Supported values for <delay> are integers between 0 and 1000.
+
+<p>Note that the <delay> does not correlate to clock speed or other absolute metrics
+— it simply represents an abstract, relative delay factor applied non-deterministically
+in the emulator. Effective performance does not always
+scale in direct relationship with <delay> values.</p>
+</td>
+</tr>
+<tr>
+ <td><code>-gps <device></code></td>
+ <td>Redirect NMEA GPS to character device.</td>
+ <td>Use this command to emulate an NMEA-compatible GPS unit connected to
+ an external character device or socket. The format of <code><device></code> must be QEMU-specific
+ serial device specification. See the documentation for 'serial -dev' at
+ <a href="http://wiki.qemu.org/download/qemu-doc.html">http://wiki.qemu.org/download/qemu-doc.html</a>.
+</td>
+</tr>
+<tr>
+ <td><code>-nojni</code></td>
+ <td>Disable JNI checks in the Dalvik runtime.</td><td> </td></tr>
+<tr>
+ <td><code>-qemu</code></td>
+ <td>Pass arguments to the qemu emulator software.</td>
+ <td><p class="caution"><strong>Important:</strong> When using this option, make sure it is the
+ <em>last option</em> specified, since all options after it are interpretted as qemu-specific
+ options.</p></td></tr>
+<tr>
+ <td><code>-qemu -enable-kvm</code></td>
+ <td>Enable KVM acceleration of the emulator virtual machine.</td>
+ <td>This option is only effective when your system is set up to use
+ <a href="{@docRoot}tools/devices/emulator.html#vm-linux">KVM-based VM acceleration</a>.
+ You can optionally specify a memory size ({@code -m <size>}) for the VM, which should match
+ your emulator's memory size:</p>
+ {@code -qemu -m 512 -enable-kvm}<br>
+ {@code -qemu -m 1024 -enable-kvm}
+ </td></tr>
+<tr>
+ <td><code>-qemu -h</code></td>
+ <td>Display qemu help.</td>
+ <td></td></tr>
+<tr>
+ <td><code>-gpu on</code></td>
+ <td>Turn on graphics acceleration for the emulator.</td>
+ <td>This option is only available for emulators using a system image with API Level 15, revision 3
+ and higher. For more information, see
+ <a href="{@docRoot}tools/devices/emulator.html#accel-graphics">Using the Android
+ Emulator</a>.</td></tr>
+<tr>
+ <td><code>-radio <device></code></td>
+ <td>Redirect radio mode to the specified character device.</td>
+ <td>The format of <code><device></code> must be QEMU-specific
+ serial device specification. See the documentation for 'serial -dev' at
+<a href="http://wiki.qemu.org/download/qemu-doc.html">http://wiki.qemu.org/download/qemu-doc.html</a>.
+</td>
+</tr>
+<tr>
+ <td><code>-timezone <timezone></code></td>
+ <td>Set the timezone for the emulated device to <timezone>, instead of the host's timezone.</td>
+ <td><code><timezone></code> must be specified in zoneinfo format. For example:
+<p>"America/Los_Angeles"<br>
+"Europe/Paris"</p>
+</td>
+</tr>
+<tr>
+ <td><code>-version</code></td>
+ <td>Display the emulator's version number.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td rowspan="12">UI</td>
+ <td><code>-dpi-device <dpi></code></td>
+ <td>Scale the resolution of the emulator to match the screen size
+ of a physical device.</td>
+ <td>The default value is 165. See also <code>-scale</code>.</td>
+</tr>
+<tr>
+ <td><code>-no-boot-anim</code></td>
+ <td>Disable the boot animation during emulator startup.</td>
+ <td>Disabling the boot animation can speed the startup time for the emulator.</td>
+</tr>
+<tr>
+ <td><code>-no-window</code></td>
+ <td>Disable the emulator's graphical window display.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-scale <scale></code></td>
+ <td>Scale the emulator window. </td>
+ <td><code><scale></code> is a number between 0.1 and 3 that represents the desired scaling factor. You can
+ also specify scale as a DPI value if you add the suffix "dpi" to the scale value. A value of "auto"
+ tells the emulator to select the best window size.</td>
+</tr>
+<tr>
+ <td><code>-raw-keys</code></td>
+ <td>Disable Unicode keyboard reverse-mapping.</td>
+ <td> </td></tr>
+<tr>
+ <td><code>-noskin</code></td>
+ <td>Don't use any emulator skin.</td>
+ <td> </td></tr>
+<tr>
+ <td><code>-keyset <file></code></td>
+ <td>Use the specified keyset file instead of the default.</td>
+ <td>The keyset file defines the list of key bindings between the emulator and the host keyboard.
+ For more information, use <code>-help-keyset</code> to print information about this topic.
+</td>
+</tr>
+<tr>
+ <td><code>-onion <image></code></td>
+ <td>Use overlay image over screen.</td>
+ <td>No support for JPEG. Only PNG is supported.</td></tr>
+<tr>
+ <td><code>-onion-alpha <percent></code></td>
+ <td>Specify onion skin translucency value (as percent).
+ <td>Default is 50.</td>
+</tr>
+<tr>
+ <td><code>-onion-rotation <position></code></td>
+ <td>Specify onion skin rotation.
+ <td><code><position></code> must be one of the values 0, 1, 2, 3.</td>
+</tr>
+<tr>
+ <td><code>-skin <skinID></code></td>
+ <td>This emulator option is deprecated. </td>
+ <td>Please set skin options using AVDs, rather than by using this emulator
+option. Using this option may yield unexpected and in some cases misleading
+results, since the density with which to render the skin may not be defined.
+AVDs let you associate each skin with a default density and override the default
+as needed. For more information, see <a
+href="{@docRoot}tools/devices/managing-avds.html">Managing Virtual Devices
+with AVD Manager</a>.
+</td>
+</tr>
+<tr>
+ <td><code>-skindir <dir></code></td>
+ <td>This emulator option is deprecated. </td>
+ <td>See comments for <code>-skin</code>, above.</td>
+</tr>
+<tr>
+ <td rowspan="9">Help</td>
+ <td><code>-help</code></td>
+ <td>Print a list of all emulator options.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-help-all</code></td>
+ <td>Print help for all startup options.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-help-<option></code></td>
+ <td>Print help for a specific startup option.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-help-debug-tags</code></td>
+ <td>Print a list of all tags for <code>-debug <tags></code>.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-help-disk-images</code></td>
+ <td>Print help for using emulator disk images.</td>
+ <td> </td>
+ </tr>
+<tr>
+ <td><code>-help-environment</code></td>
+ <td>Print help for emulator environment variables.</td>
+ <td> </td>s
+</tr><tr>
+ <td><code>-help-keys</code></td>
+ <td>Print the current mapping of keys.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-help-keyset-file</code></td>
+ <td>Print help for defining a custom key mappings file.</td>
+ <td> </td>
+</tr>
+<tr>
+ <td><code>-help-virtual-device</code></td>
+ <td>Print help for Android Virtual Device usage.</td>
+ <td> </td>
+</tr>
+</table>
diff --git a/docs/html/guide/developing/tools/etc1tool.jd b/docs/html/tools/help/etc1tool.jd
similarity index 100%
rename from docs/html/guide/developing/tools/etc1tool.jd
rename to docs/html/tools/help/etc1tool.jd
diff --git a/docs/html/tools/help/hierarchy-viewer.jd b/docs/html/tools/help/hierarchy-viewer.jd
new file mode 100644
index 0000000..4a346e0
--- /dev/null
+++ b/docs/html/tools/help/hierarchy-viewer.jd
@@ -0,0 +1,18 @@
+page.title=Hierarchy Viewer
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+<p>Hierarchy Viewer allows you to debug and optimize your user
+interface. It provides a visual representation of the layout's View hierarchy
+(the Layout View) and a magnified inspector of the display (the Pixel Perfect View).
+</p>
+
+<p>To start Hierarchy Viewer, enter the following command from the SDK <code>tools/</code> directory:</p>
+ <pre>hierarchyviewer</pre>
+</ol>
+
+<p>For more information on how to use Hierarchy Viewer, see
+<a href="{@docRoot}tools/debugging/debugging-ui.html">Debugging and Profiling UIs</a>
+</p>
+
diff --git a/docs/html/guide/developing/tools/hprof-conv.jd b/docs/html/tools/help/hprof-conv.jd
similarity index 100%
rename from docs/html/guide/developing/tools/hprof-conv.jd
rename to docs/html/tools/help/hprof-conv.jd
diff --git a/docs/html/tools/help/index.jd b/docs/html/tools/help/index.jd
new file mode 100644
index 0000000..aa95de2
--- /dev/null
+++ b/docs/html/tools/help/index.jd
@@ -0,0 +1,84 @@
+page.title=Tools
+@jd:body
+
+
+<p>The Android SDK includes a variety of tools that help you develop mobile
+applications for the Android platform. The tools are classified into two groups: SDK tools
+and platform tools. SDK tools are platform independent and are required no matter which
+Android platform you are developing on. Platform tools are customized to support the features of the
+latest Android platform.</p>
+
+<h2 id="tools-sdk">SDK Tools</h2>
+<p>The SDK tools are installed with the SDK starter package and are periodically updated.
+The SDK tools are required if you are developing Android applications. The most important SDK tools
+include the Android SDK Manager (<code>android sdk</code>), the AVD Manager (<code>android
+avd</code>) the emulator (<code>emulator</code>), and the Dalvik Debug Monitor Server
+(<code>ddms</code>). A short summary of some frequently-used SDK tools is provided below.</p>
+
+<dl>
+ <dt><a href="android.html">android</a></dt>
+ <dd>Lets you manage AVDs, projects, and the installed components of the SDK.</dd>
+ <dt><a href="{@docRoot}tools/debugging/ddms.html">Dalvik Debug Monitor
+Server (ddms)</a></dt>
+ <dd>Lets you debug Android applications.</dd>
+ <dt><a href="dmtracedump.html">dmtracedump</a></dt>
+ <dd>Generates graphical call-stack diagrams from trace log files. The tool uses the
+Graphviz Dot utility to create the graphical output, so you need to install Graphviz before
+running <code>dmtracedump</code>. For more information on using <code>dmtracedump</code>, see <a
+href="{@docRoot}tools/debugging/debugging-tracing.html#dmtracedump">Profiling
+with Traceview and dmtracedump</a></dd>
+ <dt><a href="draw9patch.html">Draw 9-patch</a></dt>
+ <dd>Allows you to easily create a {@link android.graphics.NinePatch} graphic using a
+WYSIWYG editor. It also previews stretched versions of the image, and highlights the area in which
+content is allowed.</dd>
+ <dt><a href="emulator.html">Android Emulator (emulator)</a></dt>
+ <dd>A QEMU-based device-emulation tool that you can use to design, debug, and test
+your applications in an actual Android run-time environment.</dd>
+ <dt><a href="hierarchy-viewer.html">Hierarchy Viewer (hierarchyviewer)</a></dt>
+ <dd>Lets you debug and optimize an Android application's user interface.</dd>
+ <dt><a href="hprof-conv.html">hprof-conv</a></dt>
+ <dd>Converts the HPROF file that is generated by the Android SDK tools to a standard format so
+you can view the file in a profiling tool of your choice.</dd>
+ <dt><a href="layoutopt.html">layoutopt</a></dt>
+ <dd>Lets you quickly analyze your application's layouts in order to optimize them for
+efficiency.</dd>
+ <dt><a href="mksdcard.html">mksdcard</a></dt>
+ <dd>Helps you create a disk image that you can use with the emulator, to simulate the presence
+of an external storage card (such as an SD card).</dd>
+ <dt><a href="monkey.html">Monkey</a></dt>
+ <dd>Runs on your emulator or device and generates pseudo-random streams of user events such
+as clicks, touches, or gestures, as well as a number of system-level events. You can use the Monkey
+to stress-test applications that you are developing, in a random yet repeatable manner.</dd>
+ <dt><a href="monkeyrunner_concepts.html">monkeyrunner</a></dt>
+ <dd>Provides an API for writing programs that control an Android device or emulator from
+outside of Android code.</dd>
+ <dt><a href="proguard.html">ProGuard</a></dt>
+ <dd>Shrinks, optimizes, and obfuscates your code by removing unused code and renaming
+classes, fields, and methods with semantically obscure names.</dd>
+ <dt><a href="sqlite3.html">sqlite3</a></dt>
+ <dd>Lets you access the SQLite data files created and used by Android applications.</dd>
+ <dt><a href="traceview.html">traceview</a></dt>
+ <dd>Provides a graphical viewer for execution logs saved by your application.</dd>
+ <dt><a href="zipalign.html">zipalign</a></dt>
+ <dd>Optimizes <code>.apk</code> files by ensuring that all uncompressed data starts with a
+particular alignment relative to the start of the file. This should always be used to align .apk
+files after they have been signed.</dd>
+ </dl>
+
+<h2 id="tools-platform">Platform Tools</h2>
+
+<p>The platform tools are typically updated every time you install a new SDK platform. Each update
+of the platform tools is backward compatible with older platforms. Usually, you directly use only
+one of the platform tools—the <a href="adb.html">Android Debug Bridge (<code>adb</code>)</a>.
+Android Debug Bridge is a versatile tool that lets you manage the state of an emulator instance or
+Android-powered device. You can also use it to install an Android application (.apk) file on a
+device.</p>
+
+<p>The other platform tools, such as <a href="{@docRoot}tools/aidl.html">aidl</a>,
+<code>aapt</code>, <code>dexdump</code>, and <code>dx</code>, are typically called by the Android
+build tools or Android Development Tools (ADT), so you rarely need to invoke these tools directly.
+As a general rule, you should rely on the build tools or the ADT plugin to call them as needed.</p>
+
+<p class="note"><strong>Note:</strong> The Android SDK provides additional shell tools that can
+be accessed through <code>adb</code>, such as <a href="bmgr.html">bmgr</a> and
+<a href="logcat.html">logcat</a>.</p>
\ No newline at end of file
diff --git a/docs/html/tools/help/layoutopt.jd b/docs/html/tools/help/layoutopt.jd
new file mode 100644
index 0000000..1308b1e
--- /dev/null
+++ b/docs/html/tools/help/layoutopt.jd
@@ -0,0 +1,24 @@
+page.title=layoutopt
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+<p><code>layoutopt</code> is a command-line tool that helps you optimize the
+layouts and layout hierarchies of your applications.<p>
+
+<p>This document is a reference to the available command line options. For more information and sample
+output of the tool, see <a
+href="{@docRoot}tools/debugging/debugging-ui.html#layoutopt">Optimizing layouts with
+layoutopt</a>.</p>
+
+<h3>Usage</h3>
+
+<p>To run <code>layoutopt</code> against a given list of layout resources:</p>
+
+<pre>layoutopt <file_or_directory> ...</pre>
+
+<p>For example:</p>
+
+<pre>$ layoutopt res/layout-land</pre>
+<pre>$ layoutopt res/layout/main.xml res/layout-land/main.xml</pre>
+
diff --git a/docs/html/tools/help/logcat.jd b/docs/html/tools/help/logcat.jd
new file mode 100644
index 0000000..d504b22
--- /dev/null
+++ b/docs/html/tools/help/logcat.jd
@@ -0,0 +1,106 @@
+page.title=logcat
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+ <p>The Android logging system provides a mechanism for collecting and viewing system debug
+ output. Logs from various applications and portions of the system are collected in a series of
+ circular buffers, which then can be viewed and filtered by the <code>logcat</code> command. You can use
+ <code>logcat</code> from an ADB shell to view the log messages.</p>
+
+ <p>This document is a reference to the available command line options. For more information on <code>logcat</code>, see
+ <a href="{@docRoot}tools/debugging/debugging-log.html">Reading and Writing Logs</a>.
+For more
+ information on accessing <code>logcat</code> from DDMS, instead of the command line, see the documentation for the
+ <a href="{@docRoot}tools/debugging/ddms.html">Dalvik Debug Monitor Server</a>.
+ </p>
+
+ <h3>Syntax</h3>
+ <pre>
+[adb] logcat [<option>] ... [<filter-spec>] ...
+</pre>
+
+ <p>You can run <code>logcat</code> as an adb command or directly in a shell prompt
+ of your emulator or connected device. To view log output using adb, navigate to your SDK
+ <code>platform-tools/</code> directory and execute:</p>
+ <pre>
+$ adb logcat
+</pre>
+
+ <p>You can create a shell connection to a device and execute:</p>
+ <pre>
+$ adb shell
+# logcat
+</pre>
+
+ <h3>Options</h3>
+ <p>The following table describes the command line options of <code>logcat</code>.</p>
+
+ <table>
+ <tr>
+ <th>Option</th>
+
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><code>-b <buffer></code></td>
+
+ <td>Loads an alternate log buffer for viewing, such as <code>event</code> or
+ <code>radio</code>. The <code>main</code> buffer is used by default. See <a href=
+ "#alternativebuffers">Viewing Alternative Log Buffers</a>.</td>
+ </tr>
+
+ <tr>
+ <td><code>-c</code></td>
+
+ <td>Clears (flushes) the entire log and exits.</td>
+ </tr>
+
+ <tr>
+ <td><code>-d</code></td>
+
+ <td>Dumps the log to the screen and exits.</td>
+ </tr>
+
+ <tr>
+ <td><code>-f <filename></code></td>
+
+ <td>Writes log message output to <code><filename></code>. The default is
+ <code>stdout</code>.</td>
+ </tr>
+
+ <tr>
+ <td><code>-g</code></td>
+
+ <td>Prints the size of the specified log buffer and exits.</td>
+ </tr>
+
+ <tr>
+ <td><code>-n <count></code></td>
+
+ <td>Sets the maximum number of rotated logs to <code><count></code>. The default value
+ is 4. Requires the <code>-r</code> option.</td>
+ </tr>
+
+ <tr>
+ <td><code>-r <kbytes></code></td>
+
+ <td>Rotates the log file every <code><kbytes></code> of output. The default value is
+ 16. Requires the <code>-f</code> option.</td>
+ </tr>
+
+ <tr>
+ <td><code>-s</code></td>
+
+ <td>Sets the default filter spec to silent.</td>
+ </tr>
+
+ <tr>
+ <td><code>-v <format></code></td>
+
+ <td>Sets the output format for log messages. The default is <code>brief</code> format. For a
+ list of supported formats, see <a href="#outputformat">Controlling Log Output
+ Format</a>.</td>
+ </tr>
+ </table>
diff --git a/docs/html/tools/help/mksdcard.jd b/docs/html/tools/help/mksdcard.jd
new file mode 100644
index 0000000..38c4356
--- /dev/null
+++ b/docs/html/tools/help/mksdcard.jd
@@ -0,0 +1,55 @@
+page.title=mksdcard
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+ <p>The <code>mksdcard</code> tool lets you quickly create a FAT32 disk image that you can load in the
+ emulator, to simulate the presence of an SD card in the device. Because you can specify an SD
+ card while creating an AVD in the AVD Manager, you usually use that feature to create an SD card.
+ This tool creates an SD card that is not bundled with an AVD, so it is useful for situations
+ where you need to share a virtual SD card between multiple emulators.</p>
+
+ <h3>Usage</h3>
+ <pre>
+mksdcard -l <label> <size> <file>
+</pre>
+
+ <h3>Options</h3>
+ <p>The following table describes the command-line options of <code>mksdcard</code></p>
+ <table>
+ <tr>
+ <th>Option</th>
+
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><code>-l</code></td>
+
+ <td>A volume label for the disk image to create.</td>
+ </tr>
+
+ <tr>
+ <td><code>size</code></td>
+
+ <td>An integer that specifies the size (in bytes) of disk image to create. You can also
+ specify size in kilobytes or megabytes, by appending a "K" or "M" to <size>. For
+ example, <code>1048576K</code>, <code>1024M</code>.</td>
+ </tr>
+
+ <tr>
+ <td><code>file</code></td>
+
+ <td>The path/filename of the disk image to create.</td>
+ </tr>
+ </table>
+
+ <p>Once you have created the disk image file, you can load it in the emulator at startup using
+ the emulator's <code>-sdcard</code> option. For more information, see <a href=
+ "{@docRoot}tools/help/emulator.html">Android Emulator</a>.</p>
+
+ <p>The usage for the <code>-sdcard</code> option is as follows:</p>
+ <pre>emulator -sdcard <file></pre>
+
+<h3>Example</h3>
+<pre>mksdcard -l mySdCard 1024M mySdCardFile.img</pre>
\ No newline at end of file
diff --git a/docs/html/tools/help/monkey.jd b/docs/html/tools/help/monkey.jd
new file mode 100644
index 0000000..b6300a7
--- /dev/null
+++ b/docs/html/tools/help/monkey.jd
@@ -0,0 +1,242 @@
+page.title=UI/Application Exerciser Monkey
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+<p>The Monkey is a program that runs on your
+<a href="{@docRoot}tools/help/emulator.html">emulator</a> or device and generates pseudo-random
+streams of user events such as clicks, touches, or gestures, as well as a number of system-level
+events. You can use the Monkey to stress-test applications that you are developing, in a random
+yet repeatable manner.</p>
+
+<a name="overview"></a>
+<h2>Overview</h2>
+
+<p>The Monkey is a command-line tool that that you can run on any emulator
+instance or on a device. It sends a pseudo-random stream of
+user events into the system, which acts as a stress test on the application software you are
+developing.</p>
+
+<p>The Monkey includes a number of options, but they break down into four primary
+categories:</p>
+
+<ul>
+ <li>Basic configuration options, such as setting the number of events to attempt.</li>
+ <li>Operational constraints, such as restricting the test to a single package.</li>
+ <li>Event types and frequencies.</li>
+ <li>Debugging options.</li>
+</ul>
+
+<p>When the Monkey runs, it generates events and sends them to the system. It also <i>watches</i>
+the system under test and looks for three conditions, which it treats specially:</p>
+
+<ul>
+ <li>If you have constrained the Monkey to run in one or more specific packages, it
+ watches for attempts to navigate to any other packages, and blocks them.</li>
+ <li>If your application crashes or receives any sort of unhandled exception, the Monkey
+ will stop and report the error.</li>
+ <li>If your application generates an <i>application not responding</i> error, the Monkey
+ will stop and report the error.</li>
+</ul>
+
+<p>Depending on the verbosity level you have selected, you will also see reports on the progress
+of the Monkey and the events being generated.</p>
+
+<a name="basics"></a>
+<h2>Basic Use of the Monkey</h2>
+
+<p>You can launch the Monkey using a command line on your development machine or from a script.
+Because the Monkey runs in the emulator/device environment, you must launch it from a shell in
+that environment. You can do this by prefacing <code>adb shell</code> to each command,
+or by entering the shell and entering Monkey commands directly.</p>
+<p>The basic syntax is: </p>
+
+<pre>$ adb shell monkey [options] <event-count></pre>
+
+<p>With no options specified, the Monkey will launch in a quiet (non-verbose) mode, and will send
+events to any (and all) packages installed on your target. Here is a more typical command line,
+which will launch your application and send 500 pseudo-random events to it:</p>
+
+<pre>$ adb shell monkey -p your.package.name -v 500</pre>
+
+<a name="reference"></a>
+<h2>Command Options Reference</h2>
+
+<p>The table below lists all options you can include on the Monkey command line.</p>
+
+<table>
+<tr>
+ <th>Category</th>
+ <th>Option</th>
+ <th>Description</th>
+</tr>
+
+<tr>
+<td rowspan="2">General</td>
+<td><code>--help</code></td>
+<td>Prints a simple usage guide.</td>
+</tr>
+
+<tr>
+<td><code>-v</code></td>
+<td>Each -v on the command line will increment the verbosity level.
+Level 0 (the default) provides little information beyond startup notification, test completion, and
+final results.
+Level 1 provides more details about the test as it runs, such as individual events being sent to
+your activities.
+Level 2 provides more detailed setup information such as activities selected or not selected for
+testing.</td>
+</tr>
+
+<tr>
+<td rowspan="10">Events</td>
+<td><code>-s <seed></code></td>
+<td>Seed value for pseudo-random number generator. If you re-run the Monkey with the same seed
+value, it will generate the same sequence of events.</td>
+</tr>
+
+<tr>
+<td><code>--throttle <milliseconds></code></td>
+<td>Inserts a fixed delay between events. You can use this option to slow down the Monkey.
+If not specified, there is no delay and the events are generated as rapidly as possible.</td>
+</tr>
+
+<tr>
+<td><code>--pct-touch <percent></code></td>
+<td>Adjust percentage of touch events.
+(Touch events are a down-up event in a single place on the screen.)</td>
+</tr>
+
+<tr>
+<td><code>--pct-motion <percent></code></td>
+<td>Adjust percentage of motion events.
+(Motion events consist of a down event somewhere on the screen, a series of pseudo-random
+movements, and an up event.)</td>
+</tr>
+
+<tr>
+<td><code>--pct-trackball <percent></code></td>
+<td>Adjust percentage of trackball events.
+(Trackball events consist of one or more random movements, sometimes followed by a click.)</td>
+</tr>
+
+<tr>
+<td><code>--pct-nav <percent></code></td>
+<td>Adjust percentage of "basic" navigation events.
+(Navigation events consist of up/down/left/right, as input from a directional input device.)</td>
+</tr>
+
+<tr>
+<td><code>--pct-majornav <percent></code></td>
+<td>Adjust percentage of "major" navigation events.
+(These are navigation events that will typically cause actions within your UI, such as
+the center button in a 5-way pad, the back key, or the menu key.)</td>
+</tr>
+
+<tr>
+<td><code>--pct-syskeys <percent></code></td>
+<td>Adjust percentage of "system" key events.
+(These are keys that are generally reserved for use by the system, such as Home, Back, Start Call,
+End Call, or Volume controls.)</td>
+</tr>
+
+<tr>
+<td><code>--pct-appswitch <percent></code></td>
+<td>Adjust percentage of activity launches. At random intervals, the Monkey will issue a startActivity() call, as a way of maximizing
+coverage of all activities within your package.</td>
+</tr>
+
+<tr>
+<td><code>--pct-anyevent <percent></code></td>
+<td>Adjust percentage of other types of events. This is a catch-all for all other types of events such as keypresses, other less-used
+buttons on the device, and so forth.</td>
+</tr>
+
+<tr>
+<td rowspan="2">Constraints</td>
+<td><code>-p <allowed-package-name></code></td>
+<td>If you specify one or more packages this way, the Monkey will <i>only</i> allow the system
+to visit activities within those packages. If your application requires access to activities in
+other packages (e.g. to select a contact) you'll need to specify those packages as well.
+If you don't specify any packages, the Monkey will allow the system to launch activities
+in all packages. To specify multiple packages, use the -p option multiple times — one -p
+option per package.</td>
+</tr>
+
+<tr>
+<td><code>-c <main-category></code></td>
+<td>If you specify one or more categories this way, the Monkey will <i>only</i> allow the
+system to visit activities that are listed with one of the specified categories.
+If you don't specify any categories, the Monkey will select activities listed with the category
+Intent.CATEGORY_LAUNCHER or Intent.CATEGORY_MONKEY. To specify multiple categories, use the -c
+option multiple times — one -c option per category.</td>
+</tr>
+
+<tr>
+<td rowspan="8">Debugging</td>
+<td><code>--dbg-no-events</code></td>
+<td>When specified, the Monkey will perform the initial launch into a test activity, but
+will not generate any further events.
+For best results, combine with -v, one or more package constraints, and a non-zero throttle to keep the Monkey
+running for 30 seconds or more. This provides an environment in which you can monitor package
+transitions invoked by your application.</td>
+</tr>
+
+<tr>
+<td><code>--hprof</code></td>
+<td>If set, this option will generate profiling reports immediately before and after
+the Monkey event sequence.
+This will generate large (~5Mb) files in data/misc, so use with care. See
+<a href="{@docRoot}tools/debugging/debugging-tracing.html" title="traceview">Traceview</a> for more information
+on trace files.</td>
+</tr>
+
+<tr>
+<td><code>--ignore-crashes</code></td>
+<td>Normally, the Monkey will stop when the application crashes or experiences any type of
+unhandled exception. If you specify this option, the Monkey will continue to send events to
+the system, until the count is completed.</td>
+</tr>
+
+<tr>
+<td><code>--ignore-timeouts</code></td>
+<td>Normally, the Monkey will stop when the application experiences any type of timeout error such
+as a "Application Not Responding" dialog. If you specify this option, the Monkey will continue to
+send events to the system, until the count is completed.</td>
+</tr>
+
+<tr>
+<td><code>--ignore-security-exceptions</code></td>
+<td>Normally, the Monkey will stop when the application experiences any type of permissions error,
+for example if it attempts to launch an activity that requires certain permissions. If you specify
+this option, the Monkey will continue to send events to the system, until the count is
+completed.</td>
+</tr>
+
+<tr>
+<td><code>--kill-process-after-error</code></td>
+<td>Normally, when the Monkey stops due to an error, the application that failed will be left
+running. When this option is set, it will signal the system to stop the process in which the error
+occurred.
+Note, under a normal (successful) completion, the launched process(es) are not stopped, and
+the device is simply left in the last state after the final event.</td>
+</tr>
+
+<tr>
+<td><code>--monitor-native-crashes</code></td>
+<td>Watches for and reports crashes occurring in the Android system native code. If --kill-process-after-error is set, the system will stop.</td>
+</tr>
+
+<tr>
+<td><code>--wait-dbg</code></td>
+<td>Stops the Monkey from executing until a debugger is attached to it.</td>
+</tr>
+
+</table>
+
+<!-- TODO: add a section called "debugging" that covers ways to use it,
+need to clear data, use of the seed, etc. -->
+
+<!-- TODO: add a section that lays down a contract for Monkey output so it can be
+scripted safely. -->
+
diff --git a/docs/html/tools/help/monkeyrunner_concepts.jd b/docs/html/tools/help/monkeyrunner_concepts.jd
new file mode 100644
index 0000000..c37e64d
--- /dev/null
+++ b/docs/html/tools/help/monkeyrunner_concepts.jd
@@ -0,0 +1,319 @@
+page.title=monkeyrunner
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li>
+ <a href="#SampleProgram">A Simple monkeyrunner Program</a>
+ </li>
+ <li>
+ <a href="#APIClasses">The monkeyrunner API</a>
+ </li>
+ <li>
+ <a href="#RunningMonkeyRunner">Running monkeyrunner</a>
+ </li>
+ <li>
+ <a href="#Help">monkeyrunner Built-in Help</a>
+ </li>
+ <li>
+ <a href="#Plugins">Extending monkeyrunner with Plugins</a>
+ </li>
+ </ol>
+ <h2>See Also</h2>
+ <ol>
+ <li>
+ <a href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>
+ </li>
+ </ol>
+ </div>
+</div>
+<p>
+ The monkeyrunner tool provides an API for writing programs that control an Android device
+ or emulator from outside of Android code. With monkeyrunner, you can write a Python program
+ that installs an Android application or test package, runs it, sends keystrokes to it,
+ takes screenshots of its user interface, and stores screenshots on the workstation. The
+ monkeyrunner tool is primarily designed to test applications and devices at the
+ functional/framework level and for running unit test suites, but you are free to use it for
+ other purposes.
+</p>
+<p>
+ The monkeyrunner tool is not related to the
+ <a href="{@docRoot}tools/help/monkey.html">UI/Application Exerciser Monkey</a>,
+ also known as the <code>monkey</code> tool. The <code>monkey</code> tool runs in an
+ <code><a href="{@docRoot}tools/help/adb.html">adb</a></code> shell directly on the
+ device or emulator and generates pseudo-random streams of user and system events. In comparison,
+ the monkeyrunner tool controls devices and emulators from a workstation by sending specific
+ commands and events from an API.
+</p>
+<p>
+ The monkeyrunner tool provides these unique features for Android testing:
+</p>
+<ul>
+ <li>
+ Multiple device control: The monkeyrunner API can apply one or more
+ test suites across multiple devices or emulators. You can physically attach all the devices
+ or start up all the emulators (or both) at once, connect to each one in turn
+ programmatically, and then run one or more tests. You can also start up an emulator
+ configuration programmatically, run one or more tests, and then shut down the emulator.
+ </li>
+ <li>
+ Functional testing: monkeyrunner can run an automated start-to-finish test of an Android
+ application. You provide input values with keystrokes or touch events, and view the results
+ as screenshots.
+ </li>
+ <li>
+ Regression testing - monkeyrunner can test application stability by running an application
+ and comparing its output screenshots to a set of screenshots that are known to be correct.
+ </li>
+ <li>
+ Extensible automation - Since monkeyrunner is an API toolkit, you can develop an entire
+ system of Python-based modules and programs for controlling Android devices. Besides using
+ the monkeyrunner API itself, you can use the standard Python
+ <code><a href="http://docs.python.org/library/os.html">os</a></code> and
+ <code><a href="http://docs.python.org/library/subprocess.html">subprocess</a></code>
+ modules to call Android tools such as
+ <a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a>.
+ <p>
+ You can also add your own classes to the monkeyrunner API. This is described
+ in more detail in the section
+ <a href="#Plugins">Extending monkeyrunner with plugins</a>.
+ </p>
+ </li>
+</ul>
+<p>
+ The monkeyrunner tool uses <a href="http://www.jython.org/">Jython</a>, a
+ implementation of Python that uses the Java programming language. Jython allows the
+ monkeyrunner API to interact easily with the Android framework. With Jython you can
+ use Python syntax to access the constants, classes, and methods of the API.
+</p>
+
+<h2 id="SampleProgram">A Simple monkeyrunner Program</h2>
+<p>
+ Here is a simple monkeyrunner program that connects to a device, creating a
+ <code><a href="{@docRoot}tools/help/MonkeyDevice.html">MonkeyDevice</a></code>
+ object. Using the <code>MonkeyDevice</code> object, the program installs an Android application
+ package, runs one of its activities, and sends key events to the activity.
+ The program then takes a screenshot of the result, creating a
+ <code><a href="{@docRoot}tools/help/MonkeyImage.html">MonkeyImage</a></code> object.
+ From this object, the program writes out a <code>.png</code> file containing the screenshot.
+</p>
+<pre>
+# Imports the monkeyrunner modules used by this program
+from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
+
+# Connects to the current device, returning a MonkeyDevice object
+device = MonkeyRunner.waitForConnection()
+
+# Installs the Android package. Notice that this method returns a boolean, so you can test
+# to see if the installation worked.
+device.installPackage('myproject/bin/MyApplication.apk')
+
+# sets a variable with the package's internal name
+package = 'com.example.android.myapplication'
+
+# sets a variable with the name of an Activity in the package
+activity = 'com.example.android.myapplication.MainActivity'
+
+# sets the name of the component to start
+runComponent = package + '/' + activity
+
+# Runs the component
+device.startActivity(component=runComponent)
+
+# Presses the Menu button
+device.press('KEYCODE_MENU', MonkeyDevice.DOWN_AND_UP)
+
+# Takes a screenshot
+result = device.takeSnapshot()
+
+# Writes the screenshot to a file
+result.writeToFile('myproject/shot1.png','png')
+</pre>
+
+<h2 id="APIClasses">The monkeyrunner API</h2>
+<p>
+ The monkeyrunner API is contained in three modules in the package
+ <code>com.android.monkeyrunner</code>:
+</p>
+<ul>
+ <li>
+ <code><a href="{@docRoot}tools/help/MonkeyRunner.html">MonkeyRunner</a></code>:
+ A class of utility methods for monkeyrunner programs. This class provides a method for
+ connecting monkeyrunner to a device or emulator. It also provides methods for
+ creating UIs for a monkeyrunner program and for displaying the built-in help.
+ </li>
+ <li>
+ <code><a href="{@docRoot}tools/help/MonkeyDevice.html">MonkeyDevice</a></code>:
+ Represents a device or emulator. This class provides methods for installing and
+ uninstalling packages, starting an Activity, and sending keyboard or touch events to an
+ application. You also use this class to run test packages.
+ </li>
+ <li>
+ <code><a href="{@docRoot}tools/help/MonkeyImage.html">MonkeyImage</a></code>:
+ Represents a screen capture image. This class provides methods for capturing screens,
+ converting bitmap images to various formats, comparing two MonkeyImage objects, and
+ writing an image to a file.
+ </li>
+</ul>
+<p>
+ In a Python program, you access each class as a Python module. The monkeyrunner tool
+ does not import these modules automatically. To import a module, use the
+ Python <code>from</code> statement:
+</p>
+<pre>
+from com.android.monkeyrunner import <module>
+</pre>
+<p>
+ where <code><module></code> is the class name you want to import. You can import more
+ than one module in the same <code>from</code> statement by separating the module names with
+ commas.
+</p>
+<h2 id="RunningMonkeyRunner">Running monkeyrunner</h2>
+<p>
+ You can either run monkeyrunner programs from a file, or enter monkeyrunner statements in
+ an interactive session. You do both by invoking the <code>monkeyrunner</code> command
+ which is found in the <code>tools/</code> subdirectory of your SDK directory.
+ If you provide a filename as an argument, the <code>monkeyrunner</code> command
+ runs the file's contents as a Python program; otherwise, it starts an interactive session.
+</p>
+<p>
+ The syntax of the <code>monkeyrunner</code> command is
+</p>
+<pre>
+monkeyrunner -plugin <plugin_jar> <program_filename> <program_options>
+</pre>
+<p>
+Table 1 explains the flags and arguments.
+</p>
+<p class="table-caption" id="table1">
+ <strong>Table 1.</strong> <code>monkeyrunner</code> flags and arguments.</p>
+
+<table>
+ <tr>
+ <th>Argument</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>
+ <nobr>
+ <code>-plugin <plugin_jar></code>
+ </nobr>
+ </td>
+ <td>
+ (Optional) Specifies a <code>.jar</code> file containing a plugin for monkeyrunner.
+ To learn more about monkeyrunner plugins, see
+ <a href="#Plugins">Extending monkeyrunner with plugins</a>. To specify more than one
+ file, include the argument multiple times.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <nobr>
+ <code><program_filename></code>
+ </nobr>
+ </td>
+ <td>
+ If you provide this argument, the <code>monkeyrunner</code> command runs the contents
+ of the file as a Python program. If the argument is not provided, the command starts an
+ interactive session.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><program_options></code>
+ </td>
+ <td>
+ (Optional) Flags and arguments for the program in <program_file>.
+ </td>
+ </tr>
+</table>
+<h2 id="Help">monkeyrunner Built-in Help</h2>
+<p>
+ You can generate an API reference for monkeyrunner by running:
+</p>
+<pre>
+monkeyrunner help.py <format> <outfile>
+</pre>
+<p>
+The arguments are:
+</p>
+ <ul>
+ <li>
+ <code><format></code> is either <code>text</code> for plain text output
+ or <code>html</code> for HTML output.
+ </li>
+ <li>
+ <code><outfile></code> is a path-qualified name for the output file.
+ </li>
+ </ul>
+<h2 id="Plugins">Extending monkeyrunner with Plugins</h2>
+<p>
+ You can extend the monkeyrunner API with classes you write in the Java programming language
+ and build into one or more <code>.jar</code> files. You can use this feature to extend the
+ monkeyrunner API with your own classes or to extend the existing classes. You can also use this
+ feature to initialize the monkeyrunner environment.
+</p>
+<p>
+ To provide a plugin to monkeyrunner, invoke the <code>monkeyrunner</code> command with the
+ <code>-plugin <plugin_jar></code> argument described in
+ <a href="#table1">table 1</a>.
+</p>
+<p>
+ In your plugin code, you can import and extend the the main monkeyrunner classes
+ <code>MonkeyDevice</code>, <code>MonkeyImage</code>, and <code>MonkeyRunner</code> in
+ <code>com.android.monkeyrunner</code> (see <a href="#APIClasses">The monkeyrunner API</a>).
+</p>
+<p>
+ Note that plugins do not give you access to the Android SDK. You can't import packages
+ such as <code>com.android.app</code>. This is because monkeyrunner interacts with the
+ device or emulator below the level of the framework APIs.
+</p>
+<h3>The plugin startup class</h3>
+<p>
+ The <code>.jar</code> file for a plugin can specify a class that is instantiated before
+ script processing starts. To specify this class, add the key
+ <code>MonkeyRunnerStartupRunner</code> to the <code>.jar</code> file's
+ manifest. The value should be the name of the class to run at startup. The following
+ snippet shows how you would do this within an <code>ant</code> build script:
+</p>
+<pre>
+<jar jarfile="myplugin" basedir="${build.dir}">
+<manifest>
+<attribute name="MonkeyRunnerStartupRunner" value="com.myapp.myplugin"/>
+</manifest>
+</jar>
+
+
+</pre>
+<p>
+ To get access to monkeyrunner's runtime environment, the startup class can implement
+ <code>com.google.common.base.Predicate<PythonInterpreter></code>. For example, this
+ class sets up some variables in the default namespace:
+</p>
+<pre>
+package com.android.example;
+
+import com.google.common.base.Predicate;
+import org.python.util.PythonInterpreter;
+
+public class Main implements Predicate<PythonInterpreter> {
+ @Override
+ public boolean apply(PythonInterpreter anInterpreter) {
+
+ /*
+ * Examples of creating and initializing variables in the monkeyrunner environment's
+ * namespace. During execution, the monkeyrunner program can refer to the variables "newtest"
+ * and "use_emulator"
+ *
+ */
+ anInterpreter.set("newtest", "enabled");
+ anInterpreter.set("use_emulator", 1);
+
+ return true;
+ }
+}
+</pre>
diff --git a/docs/html/tools/help/proguard.jd b/docs/html/tools/help/proguard.jd
new file mode 100644
index 0000000..1da94ba
--- /dev/null
+++ b/docs/html/tools/help/proguard.jd
@@ -0,0 +1,189 @@
+page.title=ProGuard
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#enabling">Enabling ProGuard</a></li>
+
+ <li><a href="#configuring">Configuring ProGuard</a></li>
+
+ <li>
+ <a href="#decoding">Decoding Obfuscated Stack Traces</a>
+
+ <ol>
+ <li><a href="#considerations">Debugging considerations for published
+ applications</a></li>
+ </ol>
+ </li>
+ </ol>
+
+ <h2>See also</h2>
+
+ <ol>
+ <li><a href="http://proguard.sourceforge.net/manual/introduction.html">ProGuard
+ Manual »</a></li>
+
+ <li><a href="http://proguard.sourceforge.net/manual/retrace/introduction.html">ProGuard
+ ReTrace Manual »</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and
+ renaming classes, fields, and methods with semantically obscure names. The result is a smaller
+ sized <code>.apk</code> file that is more difficult to reverse engineer. Because ProGuard makes your
+ application harder to reverse engineer, it is important that you use it
+ when your application utilizes features that are sensitive to security like when you are
+ <a href="{@docRoot}guide/google/play/licensing/index.html">Licensing Your Applications</a>.</p>
+
+ <p>ProGuard is integrated into the Android build system, so you do not have to invoke it
+ manually. ProGuard runs only when you build your application in release mode, so you do not
+ have to deal with obfuscated code when you build your application in debug mode.
+ Having ProGuard run is completely optional, but highly recommended.</p>
+
+ <p>This document describes how to enable and configure ProGuard as well as use the
+ <code>retrace</code> tool to decode obfuscated stack traces.</p>
+
+ <h2 id="enabling">Enabling ProGuard</h2>
+
+ <p>When you create an Android project, a <code>proguard.cfg</code> file is automatically
+ generated in the root directory of the project. This file defines how ProGuard optimizes and
+ obfuscates your code, so it is very important that you understand how to customize it for your
+ needs. The default configuration file only covers general cases, so you most likely have to edit
+ it for your own needs. See the following section about <a href="#configuring">Configuring ProGuard</a> for information on
+ customizing the ProGuard configuration file.</p>
+
+ <p>To enable ProGuard so that it runs as part of an Ant or Eclipse build, set the
+ <code>proguard.config</code> property in the <code><project_root>/project.properties</code>
+ file. The path can be an absolute path or a path relative to the project's root.</p>
+<p>If you left the <code>proguard.cfg</code> file in its default location (the project's root directory),
+you can specify its location like this:</p>
+<pre class="no-pretty-print">
+proguard.config=proguard.cfg
+</pre>
+<p>
+You can also move the the file to anywhere you want, and specify the absolute path to it:
+</p>
+<pre class="no-pretty-print">
+proguard.config=/path/to/proguard.cfg
+</pre>
+
+
+ <p>When you build your application in release mode, either by running <code>ant release</code> or
+ by using the <em>Export Wizard</em> in Eclipse, the build system automatically checks to see if
+ the <code>proguard.config</code> property is set. If it is, ProGuard automatically processes
+ the application's bytecode before packaging everything into an <code>.apk</code> file. Building in debug mode
+ does not invoke ProGuard, because it makes debugging more cumbersome.</p>
+
+ <p>ProGuard outputs the following files after it runs:</p>
+
+ <dl>
+ <dt><code>dump.txt</code></dt>
+ <dd>Describes the internal structure of all the class files in the <code>.apk</code> file</dd>
+
+ <dt><code>mapping.txt</code></dt>
+ <dd>Lists the mapping between the original and obfuscated class, method, and field names.
+ This file is important when you receive a bug report from a release build, because it
+ translates the obfuscated stack trace back to the original class, method, and member names.
+ See <a href="#decoding">Decoding Obfuscated Stack Traces</a> for more information.</dd>
+
+ <dt><code>seeds.txt</code></dt>
+ <dd>Lists the classes and members that are not obfuscated</dd>
+
+ <dt><code>usage.txt</code></dt>
+ <dd>Lists the code that was stripped from the <code>.apk</code></dd>
+ </ul>
+
+ <p>These files are located in the following directories:</p>
+
+ <ul>
+ <li><code><project_root>/bin/proguard</code> if you are using Ant.</li>
+
+ <li><code><project_root>/proguard</code> if you are using Eclipse.</li>
+ </ul>
+
+
+ <p class="caution"><strong>Caution:</strong> Every time you run a build in release mode, these files are
+ overwritten with the latest files generated by ProGuard. Save a copy of them each time you release your
+ application in order to de-obfuscate bug reports from your release builds.
+ For more information on why saving these files is important, see
+ <a href="#considerations">Debugging considerations for published applications</a>.
+ </p>
+
+ <h2 id="configuring">Configuring ProGuard</h2>
+
+ <p>For some situations, the default configurations in the <code>proguard.cfg</code> file will
+ suffice. However, many situations are hard for ProGuard to analyze correctly and it might remove code
+ that it thinks is not used, but your application actually needs. Some examples include:</p>
+
+ <ul>
+ <li>a class that is referenced only in the <code>AndroidManifest.xml</code> file</li>
+
+ <li>a method called from JNI</li>
+
+ <li>dynamically referenced fields and methods</li>
+ </ul>
+
+ <p>The default <code>proguard.cfg</code> file tries to cover general cases, but you might
+ encounter exceptions such as <code>ClassNotFoundException</code>, which happens when ProGuard
+ strips away an entire class that your application calls.</p>
+
+ <p>You can fix errors when ProGuard strips away your code by adding a <code>-keep</code> line in
+ the <code>proguard.cfg</code> file. For example:</p>
+ <pre>
+-keep public class <MyClass>
+</pre>
+
+ <p>There are many options and considerations when using the <code>-keep</code> option, so it is
+ highly recommended that you read the <a href="http://proguard.sourceforge.net/manual/introduction.html">ProGuard
+ Manual</a> for more information about customizing your configuration file. The <a href=
+ "http://proguard.sourceforge.net/manual/usage.html#keepoverview">Overview of Keep options</a> and
+ <a href="http://proguard.sourceforge.net/index.html#/manual/examples.html">Examples section</a>
+ are particularly helpful. The <a href=
+ "http://proguard.sourceforge.net/manual/troubleshooting.html">Troubleshooting</a> section of the
+ ProGuard Manual outlines other common problems you might encounter when your code gets stripped
+ away.</p>
+
+ <h2 id="decoding">Decoding Obfuscated Stack Traces</h2>
+
+ <p>When your obfuscated code outputs a stack trace, the method names are obfuscated, which makes
+ debugging hard, if not impossible. Fortunately, whenever ProGuard runs, it outputs a
+ <code><project_root>/bin/proguard/mapping.txt</code> file, which shows you the original
+ class, method, and field names mapped to their obfuscated names.</p>
+
+ <p>The <code>retrace.bat</code> script on Windows or the <code>retrace.sh</code> script on Linux
+ or Mac OS X can convert an obfuscated stack trace to a readable one. It is located in the
+ <code><sdk_root>/tools/proguard/</code> directory. The syntax for executing the
+ <code>retrace</code> tool is:</p>
+ <pre>retrace.bat|retrace.sh [-verbose] mapping.txt [<stacktrace_file>]</pre>
+ <p>For example:</p>
+
+ <pre>retrace.bat -verbose mapping.txt obfuscated_trace.txt</pre>
+
+ <p>If you do not specify a value for <em><stacktrace_file></em>, the <code>retrace</code> tool reads
+ from standard input.</p>
+
+ <h3 id="considerations">Debugging considerations for published applications</h3>
+
+ <p>Save the <code>mapping.txt</code> file for every release that you publish to your users.
+ By retaining a copy of the <code>mapping.txt</code> file for each release build,
+ you ensure that you can debug a problem if a user encounters a bug and submits an obfuscated stack trace.
+ A project's <code>mapping.txt</code> file is overwritten every time you do a release build, so you must be
+ careful about saving the versions that you need.</p>
+
+ <p>For example, say you publish an application and continue developing new features of
+ the application for a new version. You then do a release build using ProGuard soon after. The
+ build overwrites the previous <code>mapping.txt</code> file. A user submits a bug report
+ containing a stack trace from the application that is currently published. You no longer have a way
+ of debugging the user's stack trace, because the <code>mapping.txt</code> file associated with the version
+ on the user's device is gone. There are other situations where your <code>mapping.txt</code> file can be overwritten, so
+ ensure that you save a copy for every release that you anticipate you have to debug.</p>
+
+ <p>How you save the <code>mapping.txt</code> file is your decision. For example, you can rename them to
+ include a version or build number, or you can version control them along with your source
+ code.</p>
\ No newline at end of file
diff --git a/docs/html/guide/developing/tools/sqlite3.jd b/docs/html/tools/help/sqlite3.jd
similarity index 100%
rename from docs/html/guide/developing/tools/sqlite3.jd
rename to docs/html/tools/help/sqlite3.jd
diff --git a/docs/html/tools/help/traceview.jd b/docs/html/tools/help/traceview.jd
new file mode 100644
index 0000000..6555ac0
--- /dev/null
+++ b/docs/html/tools/help/traceview.jd
@@ -0,0 +1,16 @@
+page.title=Traceview
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+<p>Traceview is a graphical viewer for execution logs saved by your application.
+Traceview can help you debug your application and profile its performance.</p>
+
+<p>To start Traceview, enter the following command from the SDK <code>tools/</code> directory:</p>
+ <pre>traceview</pre>
+</ol>
+
+<p>For more information on how to use Traceview, see
+<a href="{@docRoot}tools/debugging/debugging-tracing.html">Profiling with Traceview and dmtracedump</a>
+</p>
+
diff --git a/docs/html/tools/help/zipalign.jd b/docs/html/tools/help/zipalign.jd
new file mode 100644
index 0000000..184cdcb
--- /dev/null
+++ b/docs/html/tools/help/zipalign.jd
@@ -0,0 +1,67 @@
+page.title=zipalign
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+<p>zipalign is an archive alignment tool that provides important
+optimization to Android application (.apk) files.
+The purpose is to ensure that all uncompressed data starts
+with a particular alignment relative to the start of the file. Specifically,
+it causes all uncompressed data within the .apk, such as images or raw files,
+to be aligned on 4-byte boundaries. This
+allows all portions to be accessed directly with {@code mmap()} even if they
+contain binary data with alignment restrictions.
+The benefit is a reduction in the amount of RAM consumed
+when running the application.</p>
+
+<p>This tool should always be used to align your .apk file before
+distributing it to end-users. The Android build tools can handle
+this for you. When using Eclipse with the ADT plugin, the Export Wizard
+will automatically zipalign your .apk after it signs it with your private key.
+The build scripts used
+when compiling your application with Ant will also zipalign your .apk,
+as long as you have provided the path to your keystore and the key alias in
+your project {@code ant.properties} file, so that the build tools
+can sign the package first.</p>
+
+<p class="caution"><strong>Caution:</strong> zipalign must only be performed
+<strong>after</strong> the .apk file has been signed with your private key.
+If you perform zipalign before signing, then the signing procedure will undo
+the alignment. Also, do not make alterations to the aligned package.
+Alterations to the archive, such as renaming or deleting entries, will
+potentially disrupt the alignment of the modified entry and all later
+entries. And any files added to an "aligned" archive will not be aligned.</p>
+
+<p>The adjustment is made by altering the size of
+the "extra" field in the zip Local File Header sections. Existing data
+in the "extra" fields may be altered by this process.</p>
+
+<p>For more information about how to use zipalign when building your
+application, please read <a href="{@docRoot}tools/publishing/app-signing.html">Signing
+Your Application</a>.</p>
+
+
+<h3>Usage</h3>
+
+<p>To align {@code infile.apk} and save it as {@code outfile.apk}:</p>
+
+<pre>zipalign [-f] [-v] <alignment> infile.apk outfile.apk</pre>
+
+<p>To confirm the alignment of {@code existing.apk}:</p>
+
+<pre>zipalign -c -v <alignment> existing.apk</pre>
+
+<p>The {@code <alignment>} is an integer that defines the byte-alignment boundaries.
+This must always be 4 (which provides 32-bit alignment) or else it effectively
+does nothing.</p>
+
+<p>Flags:</p>
+
+<ul>
+ <li>{@code -f} : overwrite existing outfile.zip</li>
+ <li>{@code -v} : verbose output</li>
+ <li>{@code -c} : confirm the alignment of the given file</li>
+</ul>
+
+
+
diff --git a/docs/html/tools/index.jd b/docs/html/tools/index.jd
new file mode 100644
index 0000000..929f849
--- /dev/null
+++ b/docs/html/tools/index.jd
@@ -0,0 +1,96 @@
+page.title=Developer Tools
+@jd:body
+
+
+<img src="{@docRoot}images/tools-home.png" style="float:right;" height="415" width="763" />
+
+<div style="position:relative;height:0">
+<div style="position:absolute;width:420px">
+ <p>The Android Developer Tools (ADT) plugin for Eclipse provides
+ a professional-grade development environment for building
+ Android apps. It's a full Java IDE with advanced features to help you build, test, debug,
+ and package your Android apps. </p>
+ <p>Free, open-source, and runs on most major OS platforms.<br>To get started,
+ <a href="{@docRoot}sdk/index.html">download the Android SDK.</a></p>
+</div>
+</div>
+
+<div style="margin-top:20px;"></div>
+
+<div class="col-6">
+<h3>Full Java IDE</h3>
+
+ <ul>
+ <li>Android-specific refactoring, quick fixes, integrated navigation between Java and Android XML resources.</li>
+ <li>Enhanced XML editors for Android XML resources</li>
+ <li>Static analysis tools to catch performance, usability, and correctness problems</li>
+ <li>Build support for complex projects, command-line support for CI through Ant. Includes ProGuard and app-signing. </li>
+ </ul>
+</div>
+
+<div class="col-6">
+<h3>Graphical UI Builders</h3>
+
+ <ul>
+ <li>Build rich Android UI with drag and drop.
+ <li>Vsualize your UI on tablets, phones, and other devices. Switch themes, locales, even plaform versions instantly, without building.</li>
+ <li>Visual refactoring lets you extracts layout for inclusion, convert layouts, extract styles</li>
+ <li>Editor support for working with custom UI components</li>
+ </ul>
+</div>
+
+<div class="col-6" style="clear:both">
+<h3>Develop on Hardware Devices</h3>
+
+ <ul>
+ <li>Use any commercial Android hardware device or multiple devices.</li>
+ <li>Deploy your app to connected devices directy from the IDE</li>
+ <li>Live, on-device debugging, testing, and profiling</li>
+ </ul>
+</div>
+
+<div class="col-6">
+<h3>Develop on Virtual Devices</h3>
+ <ul>
+ <li>Emulate any device. Use custom screen sizes, keyboards, and other hardware components. </li>
+ <li>Advanced hardware emulation, including camera, sensors, multitouch, telephony.</li>
+ <li>Develop and test for broadest compatibility at lowest cost.</li>
+ </ul>
+
+</div>
+
+<div style="margin-top:20px;"></div>
+
+<div class="col-5">
+<h3>Powerful Debugging</h3>
+
+ <ul>
+ <li>Full Java debugger with on-device debugging and Android-specidic tools</li>
+ <li>Built-in memory analysis, performance/CPU profiling.</li>
+ <li>Graphical tools for debugging and optimizing UI, runtime inspecton of UI structure and performance.</li>
+ <li>Runtime graphical analysis of your app's network bandwidth usage.</li>
+ </ul>
+</div>
+
+<div style="float:right;width:360px;padding-top:1em;">
+ <img src="{@docRoot}images/debugging-tall.png" align="left">
+</div>
+
+
+<div class="col-6">
+<h3>Testing</h3>
+
+ <ul>
+ <li>Fully instrumentated, scriptable test environment.</li>
+ <li>Integrated reports using standard test UI.</li>
+ <li>Create and run unit tests on hardware devices or emulator.</li>
+ </ul>
+
+<h3>Native Development</h3>
+
+ <ul>
+ <li>Support for compiling and packaging existing code written in C or C++.</li>
+ <li>Support for packaging multiple architectures in a single binary, for broad compatibility.</li>
+ </ul>
+</div>
+
diff --git a/docs/html/tools/other-ide.html b/docs/html/tools/other-ide.html
new file mode 100644
index 0000000..2bfe876
--- /dev/null
+++ b/docs/html/tools/other-ide.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/tools/projects/projects-cmdline.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/tools/projects/projects-cmdline.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/tools/othertools.html b/docs/html/tools/othertools.html
new file mode 100644
index 0000000..ed45ccd
--- /dev/null
+++ b/docs/html/tools/othertools.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0;url=http://developer.android.com/tools/index.html">
+<title>Redirecting...</title>
+</head>
+<body>
+<p>You should be redirected. Please <a
+href="http://developer.android.com/tools/index.html">click here</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/html/tools/projects/index.jd b/docs/html/tools/projects/index.jd
new file mode 100644
index 0000000..6a49ac9
--- /dev/null
+++ b/docs/html/tools/projects/index.jd
@@ -0,0 +1,446 @@
+page.title=Managing Projects
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#ApplicationProjects">Android Projects</a></li>
+
+ <li><a href="#LibraryProjects">Library Projects</a>
+ <ol>
+ <li><a href="#considerations">Development considerations</a></li>
+ </ol>
+ </li>
+
+ <li><a href="#TestProjects">Test Projects</a></li>
+
+ <li><a href="#testing">Testing a Library Project</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>Projects act as containers for storing things such as code and resource files. The SDK tools
+ expect your projects to follow a specific structure so it can compile and package your
+ application correctly, so it is highly recommended that you create them with Eclipse and ADT or
+ with the <code>android</code> tool on the command line. There are three types of projects, and
+ they all share the same general structure but differ in function:</p>
+
+ <dl>
+ <dt><strong>Android Projects</strong></dt>
+
+ <dd>An Android project is the container for your application's source code, resource files, and
+ files such as the Ant build and Android Manifest file. An application project is the main type
+ of project and the contents are eventually built into an <code>.apk</code> file that you install on a
+ device.</dd>
+
+ <dt><strong>Test Projects</strong></dt>
+
+ <dd>These projects contain code to test your application projects and are built into
+ applications that run on a device.</dd>
+
+ <dt><strong>Library Projects</strong></dt>
+
+ <dd>These projects contain shareable Android source code and resources that you can reference
+ in Android projects. This is useful when you have common code that you want to reuse.
+ Library projects cannot be installed onto a device, however, they are
+ pulled into the <code>.apk</code> file at build time.</dd>
+ </dl>
+
+ <p>When you use the Android development tools to create a new project, the essential files and
+ folders will be created for you. There are only a handful of files and folders generated for you,
+ and some of them depend on whether you use the Eclipse plugin or the {@code android} tool to
+ generate your project. As your application grows in complexity, you might require new kinds of
+ resources, directories, and files.</p>
+
+ <h2 id="ApplicationProjects">Android Projects</h2>
+
+ <p>Android projects are the projects that eventually get built into an <code>.apk</code> file that you install
+ onto a device. They contain things such as application source code and resource files.
+ Some are generated for you by default, while others should be created if
+ required. The following directories and files comprise an Android project:</p>
+
+ <dl>
+ <dt><code>src/</code></dt>
+
+ <dd>Contains your stub Activity file, which is stored at
+ <code>src<em>/your/package/namespace/ActivityName</em>.java</code>. All other source code
+ files (such as <code>.java</code> or <code>.aidl</code> files) go here as well.</dd>
+
+ <dt><code>bin</code></dt>
+
+ <dd>Output directory of the build. This is where you can find the final <code>.apk</code> file and other
+ compiled resources.</dd>
+
+ <dt><code>jni</code></dt>
+
+ <dd>Contains native code sources developed using the Android NDK. For more information, see the
+ <a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK documentation</a>.</dd>
+
+ <dt><code>gen/</code></dt>
+
+ <dd>Contains the Java files generated by ADT, such as your <code>R.java</code> file and
+ interfaces created from AIDL files.</dd>
+
+ <dt><code>assets/</code></dt>
+
+ <dd>This is empty. You can use it to store raw asset files. Files that you save here are
+ compiled into an <code>.apk</code> file as-is, and the original filename is preserved. You can navigate this
+ directory in the same way as a typical file system using URIs and read files as a stream of
+ bytes using the the {@link android.content.res.AssetManager}. For example, this is a good
+ location for textures and game data.</dd>
+
+ <dt><code>res/</code></dt>
+
+ <dd>
+ Contains application resources, such as drawable files, layout files, and string values. See
+ <a href="{@docRoot}guide/topics/resources/index.html">Application Resources</a> for more
+ information.
+
+ <dl>
+ <dt><code>anim/</code></dt>
+
+ <dd>For XML files that are compiled into animation objects. See the <a href=
+ "{@docRoot}guide/topics/resources/animation-resource.html">Animation</a> resource
+ type.</dd>
+
+ <dt><code>color/</code></dt>
+
+ <dd>For XML files that describe colors. See the <a href=
+ "{@docRoot}guide/topics/resources/color-list-resource.html">Color Values</a> resource
+ type.</dd>
+
+ <dt><code>drawable/</code></dt>
+
+ <dd>For bitmap files (PNG, JPEG, or GIF), 9-Patch image files, and XML files that describe
+ Drawable shapes or a Drawable objects that contain multiple states (normal, pressed, or
+ focused). See the <a href=
+ "{@docRoot}guide/topics/resources/drawable-resource.html">Drawable</a> resource type.</dd>
+
+ <dt><code>layout/</code></dt>
+
+ <dd>XML files that are compiled into screen layouts (or part of a screen). See the <a href=
+ "{@docRoot}guide/topics/resources/layout-resource.html">Layout</a> resource type.</dd>
+
+ <dt><code>menu/</code></dt>
+
+ <dd>For XML files that define application menus.
+ See the <a href="{@docRoot}guide/topics/resources/menu-resource.html">Menus</a>
+ resource type.</dd>
+
+ <dt><code>raw/</code></dt>
+
+ <dd>For arbitrary raw asset files. Saving asset files here instead of in the
+ <code>assets/</code> directory only differs in the way that you access them. These files
+ are processed by aapt and must be referenced from the application using a resource
+ identifier in the {@code R} class. For example, this is a good place for media, such as MP3
+ or Ogg files.</dd>
+
+ <dt><code>values/</code></dt>
+
+ <dd>For XML files that are compiled into many kinds of resource. Unlike other resources in
+ the <code>res/</code> directory, resources written to XML files in this folder are not
+ referenced by the file name. Instead, the XML element type controls how the resources is
+ defined within them are placed into the {@code R} class.</dd>
+
+ <dt><code>xml/</code></dt>
+
+ <dd>For miscellaneous XML files that configure application components. For example, an XML
+ file that defines a {@link android.preference.PreferenceScreen}, {@link
+ android.appwidget.AppWidgetProviderInfo}, or <a href=
+ "{@docRoot}reference/android/app/SearchManager.html#SearchabilityMetadata">Searchability
+ Metadata</a>. See <a href="{@docRoot}guide/topics/resources/index.html">Application Resources</a>
+ for more information about configuring these application components.</dd>
+ </dl>
+ </dd>
+
+ <dt><code>libs/</code></dt>
+
+ <dd>Contains private libraries.</dd>
+
+ <dt><code>AndroidManifest.xml</code></dt>
+
+ <dd>The control file that describes the nature of the application and each of its components.
+ For instance, it describes: certain qualities about the activities, services, intent receivers,
+ and content providers; what permissions are requested; what external libraries are needed; what
+ device features are required, what API Levels are supported or required; and others. See the
+ <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>
+ documentation for more information</dd>
+
+ <dt><code>project.properties</code></dt>
+
+ <dd>This file contains project settings, such as the build target. This file is integral to
+ the project, so maintain it in a source revision control system. To edit project
+ properties in Eclipse, right-click the project folder and select
+ <strong>Properties</strong>.</dd>
+
+ <dt><code>local.properties</code></dt>
+
+ <dd>Customizable computer-specific properties for the build system. If you use Ant to build
+ the project, this contains the path to the SDK installation. Because the content of the file
+ is specific to the local installation of the SDK, the <code>local.properties</code> should not
+be maintained in a source revision control system. If you use Eclipse, this file is not
+used.</dd>
+
+ <dt><code>ant.properties</code></dt>
+
+ <dd>Customizable properties for the build system. You can edit this file to override default
+ build settings used by Ant and also provide the location of your keystore and key alias so that
+ the build tools can sign your application when building in release mode. This file is integral
+ to the project, so maintain it in a source revision control system. If you use Eclipse, this
+ file is not used.</dd>
+
+ <dt><code>build.xml</code></dt>
+
+ <dd>The Ant build file for your project. This is only applicable for projects that
+ you build with Ant.</dd>
+
+ </dl>
+
+ <h2 id="LibraryProjects">Library Projects</h2>
+
+ <div class="sidebox-wrapper">
+ <div class="sidebox">
+ <h2>Library project example code</h2>
+
+ <p>The SDK includes an example application called <code>TicTacToeMain</code> that shows how a dependent
+ application can use code and resources from an Android Library project. The TicTacToeMain
+ application uses code and resources from an example library project called TicTacToeLib.</p>
+
+ <p>To download the sample applications and run them as projects in
+ your environment, use the <em>Android SDK Manager</em> to download the "Samples for
+ SDK API 8" (or later) package into your SDK.</p>
+
+ <p>For more information and to browse the code of the samples, see
+ the <a href="{@docRoot}resources/samples/TicTacToeMain/index.html">TicTacToeMain
+ application</a>.</p>
+ </div>
+ </div>
+
+ <p>An Android <em>library project</em> is a development project that holds shared Android
+ source code and resources. Other Android application projects can reference the library project
+ and, at build time, include its compiled sources in their <code>.apk</code> files. Multiple
+ application projects can reference the same library project and any single application project
+ can reference multiple library projects.</p>
+
+ <p class="note"><strong>Note:</strong> You need SDK Tools r14 or newer to use the new library
+ project feature that generates each library project into its own JAR file.
+ You can download the tools and platforms using the
+ <em>Android SDK Manager</em>, as described in
+ <a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>.</p>
+
+ <p>If you have source code and resources that are common to multiple Android projects, you
+ can move them to a library project so that it is easier to maintain across applications and
+ versions. Here are some common scenarios in which you could make use of library projects:</p>
+
+ <ul>
+ <li>If you are developing multiple related applications that use some of the same components,
+ you move the redundant components out of their respective application projects and create a
+ single, reuseable set of the same components in a library project.</li>
+
+ <li>If you are creating an application that exists in both free and paid versions. You move
+ the part of the application that is common to both versions into a library project. The two
+ dependent projects, with their different package names, will reference the library project
+ and provide only the difference between the two application versions.</li>
+ </ul>
+
+ <p>Structurally, a library project is similar to a standard Android application project. For
+ example, it includes a manifest file at the project root, as well as <code>src/</code>,
+ <code>res/</code> and similar directories. The project can contain the same types of source
+ code and resources as a standard Android project, stored in the same way. For example, source
+ code in the library project can access its own resources through its <code>R</code> class.</p>
+
+ <p>However, a library project differs from an standard Android application project in that you
+ cannot compile it directly to its own <code>.apk</code> and run it on an Android device.
+ Similarly, you cannot export the library project to a self-contained JAR file, as you would do
+ for a true library. Instead, you must compile the library indirectly, by referencing the
+ library in the dependent application and building that application.</p>
+
+ <p>When you build an application that depends on a library project, the SDK tools compile the
+ library into a temporary JAR file and uses it in the main project, then uses the
+ result to generate the <code>.apk</code>. In cases where a resource ID is defined in both the
+ application and the library, the tools ensure that the resource declared in the application gets
+ priority and that the resource in the library project is not compiled into the application
+ <code>.apk</code>. This gives your application the flexibility to either use or redefine any
+ resource behaviors or values that are defined in any library.</p>
+
+ <p>To organize your code further, your application can add references to multiple library
+ projects, then specify the relative priority of the resources in each library. This lets you
+ build up the resources actually used in your application in a cumulative manner. When two
+ libraries referenced from an application define the same resource ID, the tools select the
+ resource from the library with higher priority and discard the other.</p>
+
+ <p>Once you have added references to library projects to your Android project,
+ you can set their relative priority. At build time, the
+ libraries are merged with the application one at a time, starting from the lowest priority to
+ the highest.</p>
+
+ <p>Library projects can reference other library projects and can import an external library
+ (JAR) in the normal way.</p>
+
+ <h3 id="considerations">Development considerations</h3>
+
+ <p>As you develop your library project and dependent applications, keep the points listed below
+ in mind:</p>
+
+ <ul>
+ <li><p><strong>Resource conflicts</strong></p>
+ <p>Since the tools merge the resources of a library project with those of a dependent application
+ project, a given resource ID might be defined in both projects. In this case, the tools select
+ the resource from the application, or the library with highest priority, and discard the other
+ resource. As you develop your applications, be aware that common resource IDs are likely to be
+ defined in more than one project and will be merged, with the resource from the application or
+ highest-priority library taking precedence.</p>
+ </li>
+
+ <li><p><strong>Use prefixes to avoid resource conflicts</strong></p>
+
+ <p>To avoid resource conflicts for common resource IDs, consider using a prefix or other
+ consistent naming scheme that is unique to the project (or is unique across all projects).</p></li>
+
+ <li><p><strong>You cannot export a library project to a JAR file</strong></p>
+
+ <p>A library cannot be distributed as a binary file (such as a JAR file). This will
+be added in a future
+ version of the SDK Tools.</p></li>
+
+ <li><p><strong>A library project can include a JAR library</strong></p>
+
+ <p>You can develop a library project that itself includes a JAR library, however you need to
+ manually edit the dependent application project's build path and add a path to the JAR file.</p></li>
+
+ <li><p><strong>A library project can depend on an external JAR library</strong></p>
+
+ <p>You can develop a library project that depends on an external library (for example, the Maps
+ external library). In this case, the dependent application must build against a target that
+ includes the external library (for example, the Google APIs Add-On). Note also that both the
+ library project and the dependent application must declare the external library in their manifest
+ files, in a <a href=
+ "{@docRoot}guide/topics/manifest/uses-library-element.html"><code><uses-library></code></a>
+ element.</p></li>
+
+ <li> <p><strong>Library projects cannot include raw assets</strong></p>
+
+ <p>The tools do not support the use of raw asset files (saved in the <code>assets/</code> directory)
+ in a library project. Any asset resources
+ used by an application must be stored in the <code>assets/</code> directory of the application
+ project itself. However, resource files saved in the
+ <code>res/</code> directory are supported.</p></li>
+
+ <li><p><strong>Platform version must be lower than or equal to the Android project</strong></p>
+
+ <p>A library is compiled as part of the dependent application project, so the API used in the
+ library project must be compatible with the version of the Android library used to compile the
+ application project. In general, the library project should use an <a href=
+ "{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level</a> that is the same as — or lower
+ than — that used by the application. If the library project uses an API level that is
+ higher than that of the application, the application project will not compile. It is
+ perfectly acceptable to have a library that uses the Android 1.5 API (API level 3) and that is
+ used in an Android 1.6 (API level 4) or Android 2.1 (API level 7) project, for instance.</p></li>
+
+ <li> <p><strong>No restriction on library package names</strong></p>
+
+ <p>There is no requirement for the package name of a library to be the same as that of
+ applications that use it.</p></li>
+
+ <li><p><strong>Each library project creates its own R class </strong></p>
+
+ <p>When you build the dependent application project, library projects are compiled and
+ merged with the application project. Each library has its own <code>R</code> class, named according
+ to the library's package name. The <code>R</code> class generated from main
+ project and the library project is created in all the packages that are needed including the main
+ project's package and the libraries' packages.</p></li>
+
+ <li><p><strong>Library project storage location</strong></p>
+
+ <p>There are no specific requirements on where you should store a library project, relative to a
+ dependent application project, as long as the application project can reference the library
+ project by a relative link. What is important is that the main
+ project can reference the library project through a relative link.</p></li>
+ </ul>
+
+ <h2 id="TestProjects">Test Projects</h2>
+
+ <p>Test projects contain Android applications that you write using the
+ <a href="{@docRoot}tools/testing/index.html">Testing and
+ Instrumentation framework</a>. The framework is an extension of the JUnit test framework and adds
+ access to Android system objects. The file structure of a test project is the same as an
+ Android project.</p>
+
+ <dl>
+ <dt><code>src/</code></dt>
+
+ <dd>Includes your test source files. Test projects do not require an Activity <code>.java</code>
+ file, but can include one.</dd>
+
+ <dt><code>gen/</code></dt>
+
+ <dd>This contains the Java files generated by ADT, such as your <code>R.java</code> file and
+ interfaces created from AIDL files.</dd>
+
+ <dt><code>assets/</code></dt>
+
+ <dd>This is empty. You can use it to store raw asset files.</dd>
+
+ <dt><code>res/</code></dt>
+
+ <dd>A folder for your application resources, such as drawable files, layout files, string
+ values, etc. See <a href="{@docRoot}guide/topics/resources/index.html">Application
+ Resources</a>.</dd>
+
+ <dt><code>AndroidManifest.xml</code></dt>
+
+ <dd>The Android Manifest for your project. See <a href=
+ "{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a>. Test
+ Projects have a special <a href=
+ "{@docRoot}guide/topics/manifest/instrumentation-element.html">
+ <code><instrumentation></code></a>
+ element that connects the test project with the application project.</dd>
+
+ <dt><code>project.properties</code></dt>
+
+ <dd>This file contains project settings, such as the build target and links to the project being
+tested. This file is integral to the project, so maintain it in a source
+revision control system. To edit project properties in Eclipse, right-click the project folder
+and select <strong>Properties</strong>.</dd>
+
+ <dt><code>local.properties</code></dt>
+
+ <dd>Customizable computer-specific properties for the build system. If you use Ant to build
+ the project, this contains the path to the SDK installation. Because the content of the file
+ is specific to the local installation of the SDK, it should not be maintained in a Source
+ Revision Control system. If you use Eclipse, this file is not used.</dd>
+
+ <dt><code>ant.properties</code></dt>
+
+ <dd>Customizable properties for the build system. You can edit this file to override default
+ build settings used by Ant and provide the location to your keystore and key alias, so that the
+ build tools can sign your application when building in release mode. This file is integral to
+ the project, so maintain it in a source revision control system.
+ If you use Eclipse, this file is not used.</dd>
+
+ <dt><code>build.xml</code></dt>
+
+ <dd>The Ant build file for your project. This is only applicable for projects that
+ you build with Ant.</dd>
+ </dl>
+
+ <p>For more information, see the <a href=
+ "{@docRoot}tools/testing/index.html">Testing</a> section.</p>
+
+
+ <h2 id="testing">Testing a Library Project</h2>
+
+ <p>There are two recommended ways of setting up testing on code and resources in a library
+ project:</p>
+
+ <ul>
+ <li>You can set up a <a href="{@docRoot}tools/testing/testing_otheride.html">test
+ project</a> that instruments an application project that depends on the library project. You
+ can then add tests to the project for library-specific features.</li>
+
+ <li>You can set up a standard application project that depends on the library and put
+ the instrumentation in that project. This lets you create a self-contained project that
+ contains both the tests/instrumentations and the code to test.</li>
+ </ul>
diff --git a/docs/html/tools/projects/projects-cmdline.jd b/docs/html/tools/projects/projects-cmdline.jd
new file mode 100644
index 0000000..29d0e57
--- /dev/null
+++ b/docs/html/tools/projects/projects-cmdline.jd
@@ -0,0 +1,295 @@
+page.title=Managing Projects from the Command Line
+parent.title=Managing Projects
+parent.link=index.html
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#CreatingAProject">Creating an Android Project</a></li>
+ <li><a href="#UpdatingAProject">Updating a Project</a></li>
+ <li><a href="#SettingUpLibraryProject">Setting up a Library Project</a>
+ <ol>
+ <li><a href="#CreatingManifestFile">Creating the manifest file</a></li>
+ <li><a href="#UpdatingLibraryProject">Updating a library project</a></li>
+ </ol>
+ </li>
+ <li><a href="#ReferencingLibraryProject">Referencing a Library Project</a>
+ <ol>
+ <li><a href="#DeclaringLibrary">Declaring library components in the manifest
+file</a></li>
+ <li><a href="#depAppBuild">Building a dependent application</a></li>
+ </ol>
+ </li>
+ </ol>
+
+ <h2>See also</h2>
+
+ <ol>
+ <li><a href=
+ "{@docRoot}tools/testing/testing_otheride.html#CreateTestProjectCommand">Testing
+ from Other IDEs</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>The <code>android</code> tool provides you with commands to create all three types of
+ projects. An Android project contains all of the files and resources that are needed to build a
+ project into an .apk file for installation.
+
+ <ul>
+ <li>An Android project contains all of the files and resources that are needed to build a project into
+ an .apk file for installation. You need to create an Android project for any application that you
+ want to eventually install on a device.</li>
+
+ <li>You can also designate an Android project as a library project, which allows it to be shared
+ with other projects that depend on it. Once an Android project is designated as a library
+ project, it cannot be installed onto a device.</li>
+
+ <li>Test projects extend JUnit test functionality to include Android specific functionality. For
+ more information on creating a test project, see <a href=
+ "{@docRoot}tools/testing/testing_otheride.html">Testing from other IDEs</a>.</li>
+ </ul>
+
+
+ <h2 id="CreatingAProject">Creating an Android Project</h2>
+
+ <p>To create an Android project, you must use the <code>android</code> tool. When you create a
+ new project with <code>android</code>, it will generate a project directory with some default
+ application files, stub files, configuration files and a build file.</p>
+
+ <p>To create a new Android project, open a command-line, navigate to the <code>tools/</code>
+ directory of your SDK and run:</p>
+ <pre>
+android create project \
+--target <target_ID> \
+--name <your_project_name> \
+--path path/to/your/project \
+--activity <your_activity_name> \
+--package <your_package_namespace>
+</pre>
+
+ <ul>
+ <li><code>target</code> is the "build target" for your application. It corresponds to an
+ Android platform library (including any add-ons, such as Google APIs) that you would like to
+ build your project against. To see a list of available targets and their corresponding IDs,
+ execute: <code>android list targets</code>.</li>
+
+ <li><code>name</code> is the name for your project. This is optional. If provided, this name
+ will be used for your .apk filename when you build your application.</li>
+
+ <li><code>path</code> is the location of your project directory. If the directory does not
+ exist, it will be created for you.</li>
+
+ <li><code>activity</code> is the name for your default {@link android.app.Activity} class. This
+ class file will be created for you inside
+ <code><em><path_to_your_project></em>/src/<em><your_package_namespace_path></em>/</code>
+ . This will also be used for your .apk filename unless you provide a <code>name</code>.</li>
+
+ <li><code>package</code> is the package namespace for your project, following the same rules as
+ for packages in the Java programming language.</li>
+ </ul>
+
+ <p>Here's an example:</p>
+ <pre>
+android create project \
+--target 1 \
+--name MyAndroidApp \
+--path ./MyAndroidAppProject \
+--activity MyAndroidAppActivity \
+--package com.example.myandroid
+</pre>
+
+ <p>Once you've created your project, you're ready to begin development. You can move your project
+ folder wherever you want for development, but keep in mind that you must use the <a href=
+ "{@docRoot}tools/help/adb.html">Android Debug Bridge</a> (adb) — located in the
+ SDK <code>platform-tools/</code> directory — to send your application to the emulator (discussed
+ later). So you need access between your project solution and the <code>platform-tools/</code> folder.</p>
+
+ <p class="note"><strong>Tip:</strong> Add the <code>platform-tools/</code> as well as the <code>tools/</code> directory
+ to your <code>PATH</code> environment variable.</p>
+
+ <p class="caution"><strong>Caution:</strong> You should refrain from moving the location of the
+ SDK directory, because this will break the SDK location property located in <code>local.properties</code>.
+ If you need to update the SDK location, use the <code>android update project</code> command.
+ See <a href="#UpdatingAProject">Updating a Project</a> for more information.</p>
+
+ <h2 id="UpdatingAProject">Updating a Project</h2>
+
+ <p>If you're upgrading a project from an older version of the Android SDK or want to create a new
+ project from existing code, use the <code>android update project</code> command to update the
+ project to the new development environment. You can also use this command to revise the build
+ target of an existing project (with the <code>--target</code> option) and the project name (with
+ the <code>--name</code> option). The <code>android</code> tool will generate any files and
+ folders (listed in the previous section) that are either missing or need to be updated, as needed
+ for the Android project.</p>
+
+ <p>To update an existing Android project, open a command-line and navigate to the
+ <code>tools/</code> directory of your SDK. Now run:</p>
+ <pre>
+android update project --name <project_name> --target <target_ID>
+--path <path_to_your_project>
+</pre>
+
+ <ul>
+ <li><code>target</code> is the "build target" for your application. It corresponds to an
+ Android platform library (including any add-ons, such as Google APIs) that you would like to
+ build your project against. To see a list of available targets and their corresponding IDs,
+ execute: <code>android list targets</code>.</li>
+
+ <li><code>path</code> is the location of your project directory.</li>
+
+ <li><code>name</code> is the name for the project. This is optional—if you're not
+ changing the project name, you don't need this.</li>
+ </ul>
+
+ <p>Here's an example:</p>
+ <pre>
+android update project --name MyApp --target 2 --path ./MyAppProject
+</pre>
+
+ <h2 id="SettingUpLibraryProject">Setting up a Library Project</h2>
+
+ <p>A library project is a standard Android project, so you can create a new one in the same way
+ as you would a new application project. Specifically, you can use the <code>android</code> tool
+ to generate a new library project with all of the necessary files and folders.</p>
+
+ <p>To create a new library project, navigate to the <code><sdk>/tools/</code> directory and
+ use this command:</p>
+ <pre class="no-pretty-print">
+android create lib-project --name <your_project_name> \
+--target <target_ID> \
+--path path/to/your/project \
+--package <your_library_package_namespace>
+</pre>
+
+ <p>The <code>create lib-project</code> command creates a standard project structure that includes
+ preset property that indicates to the build system that the project is a library. It does this by
+ adding this line to the project's <code>project.properties</code> file:</p>
+ <pre class="no-pretty-print">
+android.library=true
+</pre>
+
+ <p>Once the command completes, the library project is created and you can begin moving source
+ code and resources into it, as described in the sections below.</p>
+
+ <p>If you want to convert an existing application project to a library project, so that other
+ applications can use it, you can do so by adding a the <code>android.library=true</code> property
+ to the application's <code>project.properties</code> file.</p>
+
+ <h3 id="CreatingManifestFile">Creating the manifest file</h3>
+
+ <p>A library project's manifest file must declare all of the shared components that it includes,
+ just as would a standard Android application. For more information, see the documentation for
+ <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
+
+ <p>For example, the <a href=
+ "{@docRoot}resources/samples/TicTacToeLib/AndroidManifest.html">TicTacToeLib</a> example library
+ project declares the Activity <code>GameActivity</code>:</p>
+ <pre>
+<manifest>
+ ...
+ <application>
+ ...
+ <activity android:name="GameActivity" />
+ ...
+ </application>
+</manifest>
+</pre>
+
+ <h3 id="UpdatingLibraryProject">Updating a library project</h3>
+
+ <p>If you want to update the build properties (build target, location) of the library project,
+ use this command:</p>
+ <pre>
+android update lib-project \
+--target <em><target_ID></em> \
+--path <em>path/to/your/project</em>
+</pre>
+
+ <h2 id="ReferencingLibraryProject">Referencing a Library Project</h2>
+
+ <p>If you are developing an application and want to include the shared code or resources from a
+ library project, you can do so easily by adding a reference to the library project in the
+ application project's build properties.</p>
+
+ <p>To add a reference to a library project, navigate to the <code><sdk>/tools/</code>
+ directory and use this command:</p>
+ <pre>
+android update project \
+--target <em><target_ID></em> \
+--path <em>path/to/your/project</em>
+--library <em>path/to/library_projectA</em>
+</pre>
+
+ <p>This command updates the application project's build properties to include a reference to the
+ library project. Specifically, it adds an <code>android.library.reference.<em>n</em></code>
+ property to the project's <code>project.properties</code> file. For example:</p>
+ <pre class="no-pretty-print">
+android.library.reference.1=path/to/library_projectA
+</pre>
+
+ <p>If you are adding references to multiple libraries, note that you can set their relative
+ priority (and merge order) by manually editing the <code>project.properties</code> file and
+ adjusting the each reference's <code>.<em>n</em></code> index as appropriate. For example, assume
+ these references:</p>
+ <pre class="no-pretty-print">
+android.library.reference.1=path/to/library_projectA
+android.library.reference.2=path/to/library_projectB
+android.library.reference.3=path/to/library_projectC
+</pre>
+
+ <p>You can reorder the references to give highest priority to <code>library_projectC</code> in
+ this way:</p>
+ <pre class="no-pretty-print">
+android.library.reference.2=path/to/library_projectA
+android.library.reference.3=path/to/library_projectB
+android.library.reference.1=path/to/library_projectC
+</pre>
+
+ <p>Note that the <code>.<em>n</em></code> index in the references must begin at "1" and increase
+ uniformly without "holes". References appearing in the index after a hole are ignored.</p>
+
+ <p>At build time, the libraries are merged with the application one at a time, starting from the
+ lowest priority to the highest. Note that a library cannot itself reference another library and
+ that, at build time, libraries are not merged with each other before being merged with the
+ application.</p>
+
+ <h3 id="DeclaringLibrary">Declaring library components in the manifest file</h3>
+
+ <p>In the manifest file of the application project, you must add declarations of all components
+ that the application will use that are imported from a library project. For example, you must
+ declare any <code><activity></code>, <code><service></code>,
+ <code><receiver></code>, <code><provider></code>, and so on, as well as
+ <code><permission></code>, <code><uses-library></code>, and similar elements.</p>
+
+ <p>Declarations should reference the library components by their fully-qualified package names,
+ where appropriate.</p>
+
+ <p>For example, the <a href=
+ "{@docRoot}resources/samples/TicTacToeMain/AndroidManifest.html">TicTacToeMain</a> example
+ application declares the library Activity <code>GameActivity</code> like this:</p>
+ <pre>
+<manifest>
+ ...
+ <application>
+ ...
+ <activity android:name="com.example.android.tictactoe.library.GameActivity" />
+ ...
+ </application>
+</manifest>
+</pre>
+
+ <p>For more information about the manifest file, see the documentation for
+ <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
+
+ <h3 id="depAppBuild">Building a dependent application</h3>
+
+ <p>To build an application project that depends on one or more library projects, you can use the
+ standard Ant build commands and compile modes, as described in <a href=
+ "{@docRoot}tools/building/index.html">Building and Running</a>. The tools
+compile and merge all libraries referenced by the application as part of
+ compiling the dependent application project. No additional commands or steps are necessary.</p>
+
diff --git a/docs/html/tools/projects/projects-eclipse.jd b/docs/html/tools/projects/projects-eclipse.jd
new file mode 100644
index 0000000..f1972bc
--- /dev/null
+++ b/docs/html/tools/projects/projects-eclipse.jd
@@ -0,0 +1,237 @@
+page.title=Managing Projects from Eclipse with ADT
+parent.title=Managing Projects
+parent.link=index.html
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#CreatingAProject">Creating an Android Project</a></li>
+
+ <li><a href="#SettingUpLibraryProject">Setting up a Library Project</a></li>
+
+ <li><a href="#ReferencingLibraryProject">Referencing a Library Project</a></li>
+ </ol>
+
+ <h2>See also</h2>
+
+ <ol>
+ <li><a href=
+ "{@docRoot}tools/testing/testing_eclipse.html#CreateTestProjectEclipse">Testing
+ from Eclipse with ADT</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>Eclipse and the ADT plugin provide GUIs and wizards to create all three types of projects
+ (Android project, Library project, and Test project):
+
+ <ul>
+ <li>An Android project contains all of the files and resources that are needed to build a project into
+ an .apk file for installation. You need to create an Android project for any application that you
+ want to eventually install on a device.</li>
+
+ <li>You can also designate an Android project as a library project, which allows it to be shared
+ with other projects that depend on it. Once an Android project is designated as a library
+ project, it cannot be installed onto a device.</li>
+
+ <li>Test projects extend JUnit test functionality to include Android specific functionality. For
+ more information on creating a test project, see <a href=
+ "{@docRoot}tools/testing/testing_eclipse.html">Testing from Eclipse with ADT</a>.</li>
+ </ul>
+
+ <h2 id="CreatingAProject">Creating an Android Project</h2>
+
+ <p>The ADT plugin provides a <em>New Project Wizard</em> that you can use to quickly create a new Android
+ project (or a project from existing code). To create a new project:</p>
+
+ <ol>
+ <li>Select <strong>File</strong> > <strong>New</strong> > <strong>Project</strong>.</li>
+
+ <li>Select <strong>Android</strong> > <strong>Android Project</strong>, and click
+ <strong>Next</strong>.</li>
+
+ <li>Select the contents for the project:
+
+ <ul>
+ <li>Enter a <em>Project Name</em>. This will be the name of the folder where your project
+ is created.</li>
+
+ <li>Under Contents, select <strong>Create new project in workspace</strong>. Select your
+ project workspace location.</li>
+
+ <li>Under Target, select an Android target to be used as the project's Build Target. The
+ Build Target specifies which Android platform you'd like your application built against.
+
+ <p>Select the lowest platform with which your application is compatible.</p>
+
+ <p class="note"><strong>Note:</strong> You can change your the Build Target for your
+ project at any time: Right-click the project in the Package Explorer, select
+ <strong>Properties</strong>, select <strong>Android</strong> and then check the desired
+ Project Target.</p>
+ </li>
+
+ <li>Under Properties, fill in all necessary fields.
+
+ <ul>
+ <li>Enter an <em>Application name</em>. This is the human-readable title for your
+ application — the name that will appear on the Android device.</li>
+
+ <li>Enter a <em>Package name</em>. This is the package namespace (following the same
+ rules as for packages in the Java programming language) where all your source code will
+ reside.</li>
+
+ <li>Select <em>Create Activity</em> (optional, of course, but common) and enter a name
+ for your main Activity class.</li>
+
+ <li>Enter a <em>Min SDK Version</em>. This is an integer that indicates the minimum API
+ Level required to properly run your application. Entering this here automatically sets
+ the <code>minSdkVersion</code> attribute in the <a href=
+ "{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a> of your
+ Android Manifest file. If you're unsure of the appropriate <a href=
+ "{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Level</a> to use, copy the API Level
+ listed for the Build Target you selected in the Target tab.</li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+
+ <li>Click <strong>Finish</strong>.</li>
+ </ol>
+
+ <p class="note"><strong>Tip:</strong> You can also start the New Project Wizard from the
+ <em>New</em> icon in the toolbar.</p>
+
+ <h2 id="SettingUpLibraryProject">Setting up a Library Project</h2>
+
+ <p>A library project is a standard Android project, so you can create a new one in the same way
+ as you would a new application project.</p>
+
+ <p>When you are creating the library project, you can select any application name, package, and
+ set other fields as needed, as shown in figure 1.</p>
+
+ <p>Next, set the project's properties to indicate that it is a library project:</p>
+
+ <ol>
+ <li>In the <strong>Package Explorer</strong>, right-click the library project and select
+ <strong>Properties</strong>.</li>
+
+ <li>In the <strong>Properties</strong> window, select the "Android" properties group at left
+ and locate the <strong>Library</strong> properties at right.</li>
+
+ <li>Select the "is Library" checkbox and click <strong>Apply</strong>.</li>
+
+ <li>Click <strong>OK</strong> to close the <em>Properties</em> window.</li>
+ </ol>
+
+ <p>The new project is now marked as a library project. You can begin moving source code and
+ resources into it, as described in the sections below.</p>
+
+ <p>You can also convert an existing application project into a library. To do so, simply open the
+ Properties for the project and select the "is Library" checkbox. Other application projects can
+ now reference the existing project as a library project.</p>
+
+ <img src= "{@docRoot}images/developing/adt-props-isLib.png">
+
+ <p class="img-caption"><strong>Figure 1.</strong> Marking a project as an
+ Android library project.</p>
+
+ <h3>Creating the manifest file</h3>
+
+ <p>A library project's manifest file must declare all of the shared components that it includes,
+ just as would a standard Android application. For more information, see the documentation for
+ <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
+
+ <p>For example, the <a href=
+ "{@docRoot}resources/samples/TicTacToeLib/AndroidManifest.html">TicTacToeLib</a> example library
+ project declares the Activity <code>GameActivity</code>:</p>
+ <pre>
+<manifest>
+ ...
+ <application>
+ ...
+ <activity android:name="GameActivity" />
+ ...
+ </application>
+</manifest>
+</pre>
+
+ <h2 id="ReferencingLibraryProject">Referencing a library project</h2>
+
+ <p>If you are developing an application and want to include the shared code or resources from a
+ library project, you can do so easily by adding a reference to the library project in the
+ application project's Properties.</p>
+
+ <p>To add a reference to a library project, follow these steps:</p>
+
+ <ol>
+ <li>In the <strong>Package Explorer</strong>, right-click the dependent project and select
+ <strong>Properties</strong>.</li>
+
+ <li>In the <strong>Properties</strong> window, select the "Android" properties group at left
+ and locate the <strong>Library</strong> properties at right.</li>
+
+ <li>Click <strong>Add</strong> to open the <strong>Project Selection</strong> dialog.</li>
+
+ <li>From the list of available library projects, select a project and click
+ <strong>OK</strong>.</li>
+
+ <li>When the dialog closes, click <strong>Apply</strong> in the <strong>Properties</strong>
+ window.</li>
+
+ <li>Click <strong>OK</strong> to close the <strong>Properties</strong> window.</li>
+ </ol>
+
+ <p>As soon as the Properties dialog closes, Eclipse rebuilds the project, including the contents
+ of the library project.</p>
+
+ <p>Figure 2 shows the Properties dialog that lets you add library references and move
+ them up and down in priority.</p><img src="{@docRoot}images/developing/adt-props-libRef.png">
+
+ <p class="img-caption"><strong>Figure 2.</strong> Adding a reference to a
+ library project in the properties of an application project.</p>
+
+ <p>If you are adding references to multiple libraries, note that you can set their relative
+ priority (and merge order) by selecting a library and using the <strong>Up</strong> and
+ <strong>Down</strong> controls. The tools merge the referenced libraries with your application
+ starting from lowest priority (bottom of the list) to highest (top of the list). If more than one
+ library defines the same resource ID, the tools select the resource from the library with higher
+ priority. The application itself has highest priority and its resources are always used in
+ preference to identical resource IDs defined in libraries.</p>
+
+ <h3>Declaring library components in the manifest file</h3>
+
+ <p>In the manifest file of the application project, you must add declarations of all components
+ that the application will use that are imported from a library project. For example, you must
+ declare any <code><activity></code>, <code><service></code>,
+ <code><receiver></code>, <code><provider></code>, and so on, as well as
+ <code><permission></code>, <code><uses-library></code>, and similar elements.</p>
+
+ <p>Declarations should reference the library components by their fully-qualified package names,
+ where appropriate.</p>
+
+ <p>For example, the <a href=
+ "{@docRoot}resources/samples/TicTacToeMain/AndroidManifest.html">TicTacToeMain</a> example
+ application declares the library Activity <code>GameActivity</code> like this:</p>
+ <pre>
+<manifest>
+ ...
+ <application>
+ ...
+ <activity android:name="com.example.android.tictactoe.library.GameActivity" />
+ ...
+ </application>
+</manifest>
+</pre>
+
+ <p>For more information about the manifest file, see the documentation for <a href=
+ "{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>.</p>
+
+
+
+
+
+
+
diff --git a/docs/html/tools/publishing/app-signing.jd b/docs/html/tools/publishing/app-signing.jd
new file mode 100644
index 0000000..ac45242
--- /dev/null
+++ b/docs/html/tools/publishing/app-signing.jd
@@ -0,0 +1,618 @@
+page.title=Signing Your Applications
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Quickview</h2>
+
+<ul>
+<li>All Android apps <em>must</em> be signed</li>
+<li>You can sign with a self-signed key</li>
+<li>How you sign your apps is critical — read this document carefully</li>
+<li>Determine your signing strategy early in the development process</li>
+</ul>
+
+<h2>In this document</h2>
+
+<ol>
+<li><a href="#signing">Signing Process</a></li>
+<li><a href="#strategies">Signing Strategies</a></li>
+<li><a href="#setup">Basic Setup for Signing</a></li>
+<li><a href="#debugmode">Signing in Debug Mode</a></li>
+<li><a href="#releasemode">Signing Release Mode</a>
+ <ol>
+ <li><a href="#cert">Obtain a suitable private key</a></li>
+ <li><a href="#releasecompile">Compile the application in release mode</a></li>
+ <li><a href="#signapp">Sign your application with your private key</a></li>
+ <li><a href="#align">Align the final APK package</a></li>
+ <li><a href="#ExportWizard">Compile and sign with Eclipse ADT</a></li>
+ </ol>
+</li>
+<li><a href="#secure-key">Securing Your Private Key</a></li>
+
+</ol>
+
+<h2>See also</h2>
+
+<ol>
+<li><a href="{@docRoot}tools/publishing/versioning.html">Versioning Your Applications</a></li>
+<li><a href="{@docRoot}tools/publishing/preparing.html">Preparing to Publish</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>The Android system requires that all installed applications be digitally signed with a
+certificate whose private key is held by the application's developer. The Android system uses the
+certificate as a means of identifying the author of an application and establishing trust
+relationships between applications. The certificate is not used to control which applications the
+user can install. The certificate does not need to be signed by a certificate authority: it is
+perfectly allowable, and typical, for Android applications to use self-signed certificates.</p>
+
+<p>The important points to understand about signing Android applications are:</p>
+
+<ul>
+ <li>All applications <em>must</em> be signed. The system will not install an application
+on an emulator or a device if it is not signed.</li>
+ <li>To test and debug your application, the build tools sign your application with a special debug
+ key that is created by the Android SDK build tools.</li>
+ <li>When you are ready to release your application for end-users, you must sign it with a suitable
+ private key. You cannot publish an application that is signed with the debug key generated
+ by the SDK tools.</li>
+ <li>You can use self-signed certificates to sign your applications. No certificate authority is
+ needed.</li>
+ <li>The system tests a signer certificate's expiration date only at install time. If an
+application's signer certificate expires after the application is installed, the application
+will continue to function normally.</li>
+ <li>You can use standard tools — Keytool and Jarsigner — to generate keys and
+sign your application {@code .apk} files.</li>
+ <li>After you sign your application for release, we recommend that you use the
+ <code>zipalign</code> tool to optimize the final APK package.</li>
+</ul>
+
+<p>The Android system will not install or run an application that is not signed appropriately. This
+applies wherever the Android system is run, whether on an actual device or on the emulator.
+For this reason, you must <a href="#setup">set up signing</a> for your application before you can
+run it or debug it on an emulator or device.</p>
+
+<h2 id="signing">Signing Process</h3>
+
+<p>The Android build process signs your application differently depending on which build mode you
+use to build your application. There are two build modes: <em>debug mode</em> and <em>release
+mode</em>. You use debug mode when you are developing and testing your application. You use
+release mode when you want to build a release version of your application that you can
+distribute directly to users or publish on an application marketplace such as Google Play.</p>
+
+<p>When you build in <em>debug mode</em> the Android SDK build tools use the Keytool utility
+(included in the JDK) to create a debug key. Because the SDK build tools created the debug key,
+they know the debug key's alias and password. Each time you compile your application in debug mode,
+the build tools use the debug key along with the Jarsigner utility (also included in the JDK) to
+sign your application's <code>.apk</code> file. Because the alias and password are known to the SDK
+build tools, the tools don't need to prompt you for the debug key's alias and password each time
+you compile.</p>
+
+<p>When you build in <em>release mode</em> you use your own private key to sign your application. If
+you don't have a private key, you can use the Keytool utility to create one for you. When you
+compile your application in release mode, the build tools use your private key along with the
+Jarsigner utility to sign your application's <code>.apk</code> file. Because the certificate and
+private key you use are your own, you will have to provide the password for the keystore and key
+alias.</p>
+
+<p>The debug signing process happens automatically when you run or debug your application using
+Eclipse with the ADT plugin. Debug signing also happens automatically when you use the Ant build
+script with the <code>debug</code> option. You can automate the release signing process by using the
+Eclipse Export Wizard or by modifying the Ant build script and building with the
+<code>release</code> option.</p>
+
+<h2 id="strategies">Signing Strategies</h2>
+
+<p>Some aspects of application signing may affect how you approach the development
+of your application, especially if you are planning to release multiple
+applications. </p>
+
+<p>In general, the recommended strategy for all developers is to sign
+all of your applications with the same certificate, throughout the expected
+lifespan of your applications. There are several reasons why you should do so: </p>
+
+<ul>
+<li>Application upgrade – As you release updates to your application, you
+will want to continue to sign the updates with the same certificate or set of
+certificates, if you want users to upgrade seamlessly to the new version. When
+the system is installing an update to an application, it compares the
+certificate(s) in the new version with those in the existing version. If the
+certificates match exactly, including both the certificate data and order, then
+the system allows the update. If you sign the new version without using matching
+certificates, you will also need to assign a different package name to the
+application — in this case, the user installs the new version as a
+completely new application. </li>
+
+<li>Application modularity – The Android system allows applications that
+are signed by the same certificate to run in the same process, if the
+applications so requests, so that the system treats them as a single application.
+In this way you can deploy your application in modules, and users can update
+each of the modules independently if needed.</li>
+
+<li>Code/data sharing through permissions – The Android system provides
+signature-based permissions enforcement, so that an application can expose
+functionality to another application that is signed with a specified
+certificate. By signing multiple applications with the same certificate and
+using signature-based permissions checks, your applications can share code and
+data in a secure manner. </li>
+
+</ul>
+
+<p>Another important consideration in determining your signing strategy is
+how to set the validity period of the key that you will use to sign your
+applications.</p>
+
+<ul>
+<li>If you plan to support upgrades for a single application, you should ensure
+that your key has a validity period that exceeds the expected lifespan of
+that application. A validity period of 25 years or more is recommended.
+When your key's validity period expires, users will no longer be
+able to seamlessly upgrade to new versions of your application.</li>
+
+<li>If you will sign multiple distinct applications with the same key,
+you should ensure that your key's validity period exceeds the expected
+lifespan of <em>all versions of all of the applications</em>, including
+dependent applications that may be added to the suite in the future. </li>
+
+<li>If you plan to publish your application(s) on Google Play, the
+key you use to sign the application(s) must have a validity period
+ending after 22 October 2033. Google Play enforces this requirement
+to ensure that users can seamlessly upgrade applications when
+new versions are available. </li>
+</ul>
+
+<p>As you design your application, keep these points in mind and make sure to
+use a <a href="#cert">suitable certificate</a> to sign your applications. </p>
+
+<h2 id="setup">Basic Setup for Signing</h2>
+
+<p>Before you begin, make sure that the Keytool utility and Jarsigner utility are available to
+the SDK build tools. Both of these tools are available in the JDK. In most cases, you can tell
+the SDK build tools how to find these utilities by setting your <code>JAVA_HOME</code> environment
+variable so it references a suitable JDK. Alternatively, you can add the JDK version of Keytool and
+Jarsigner to your <code>PATH</code> variable.</p>
+
+<p>If you are developing on a version of Linux that originally came with GNU Compiler for
+Java, make sure that the system is using the JDK version of Keytool, rather than the gcj
+version. If Keytool is already in your <code>PATH</code>, it might be pointing to a symlink at
+<code>/usr/bin/keytool</code>. In this case, check the symlink target to be sure it points
+to the Keytool in the JDK.</p>
+
+<h2 id="debugmode">Signing in Debug Mode</h2>
+
+<p>The Android build tools provide a debug signing mode that makes it easier for you
+to develop and debug your application, while still meeting the Android system
+requirement for signing your APK.
+When using debug mode to build your app, the SDK tools invoke Keytool to automatically create
+a debug keystore and key. This debug key is then used to automatically sign the APK, so
+you do not need to sign the package with your own key.</p>
+
+<p>The SDK tools create the debug keystore/key with predetermined names/passwords:</p>
+<ul>
+<li>Keystore name: "debug.keystore"</li>
+<li>Keystore password: "android"</li>
+<li>Key alias: "androiddebugkey"</li>
+<li>Key password: "android"</li>
+<li>CN: "CN=Android Debug,O=Android,C=US"</li>
+</ul>
+
+<p>If necessary, you can change the location/name of the debug keystore/key or
+supply a custom debug keystore/key to use. However, any custom debug
+keystore/key must use the same keystore/key names and passwords as the default
+debug key (as described above). (To do so in Eclipse/ADT, go to
+<strong>Windows</strong> > <strong>Preferences</strong> >
+<strong>Android</strong> > <strong>Build</strong>.) </p>
+
+<p class="caution"><strong>Caution:</strong> You <em>cannot</em> release your application
+to the public when signed with the debug certificate.</p>
+
+<h3>Eclipse Users</h3>
+
+<p>If you are developing in Eclipse/ADT (and have set up Keytool and Jarsigner as described above in
+<a href="#setup">Basic Setup for Signing</a>),
+signing in debug mode is enabled by default. When you run or debug your
+application, ADT signs the {@code .apk} file with the debug certificate, runs {@code zipalign} on
+the package, then installs it on
+the selected emulator or connected device. No specific action on your part is needed,
+provided ADT has access to Keytool.</p>
+
+<h3>Ant Users</h3>
+
+<p>If you are using Ant to build your {@code .apk} file, debug signing mode
+is enabled by using the <code>debug</code> option with the <code>ant</code> command
+(assuming that you are using a <code>build.xml</code> file generated by the
+<code>android</code> tool). When you run <code>ant debug</code> to
+compile your app, the build script generates a keystore/key and signs the APK for you.
+The script then also aligns the APK with the <code>zipalign</code> tool.
+No other action on your part is needed. Read
+<a href="{@docRoot}tools/building/building-cmdline.html#DebugMode">Building and Running Apps
+on the Command Line</a> for more information.</p>
+
+
+<h3 id="debugexpiry">Expiry of the Debug Certificate</h3>
+
+<p>The self-signed certificate used to sign your application in debug mode (the default on
+Eclipse/ADT and Ant builds) will have an expiration date of 365 days from its creation date.</p>
+
+<p>When the certificate expires, you will get a build error. On Ant builds, the error
+looks like this:</p>
+
+<pre>debug:
+[echo] Packaging bin/samples-debug.apk, and signing it with a debug key...
+[exec] Debug Certificate expired on 8/4/08 3:43 PM</pre>
+
+<p>In Eclipse/ADT, you will see a similar error in the Android console.</p>
+
+<p>To fix this problem, simply delete the <code>debug.keystore</code> file.
+The default storage location for AVDs is in <code>~/.android/</code> on OS X and Linux,
+in <code>C:\Documents and Settings\<user>\.android\</code> on Windows XP, and in
+<code>C:\Users\<user>\.android\</code> on Windows Vista and Windows 7.</p>
+
+
+<p>The next time you build, the build tools will regenerate a new keystore and debug key.</p>
+
+<p>Note that, if your development machine is using a non-Gregorian locale, the build
+tools may erroneously generate an already-expired debug certificate, so that you get an
+error when trying to compile your application. For workaround information, see the
+troubleshooting topic <a href="{@docRoot}resources/faq/troubleshooting.html#signingcalendar">
+I can't compile my app because the build tools generated an expired debug
+certificate</a>. </p>
+
+
+<h2 id="releasemode">Signing in Release Mode</h2>
+
+<p>When your application is ready for release to other users, you must:</p>
+<ol>
+ <li><a href="#cert">Obtain a suitable private key</a></li>
+ <li><a href="#releasecompile">Compile the application in release mode</a></li>
+ <li><a href="#signapp">Sign your application with your private key</a></li>
+ <li><a href="#align">Align the final APK package</a></li>
+</ol>
+
+<p>If you are developing in Eclipse with the ADT plugin, you can use the Export Wizard
+to perform the compile, sign, and align procedures. The Export Wizard even allows you to
+generate a new keystore and private key in the process. So if you use Eclipse, you can
+skip to <a href="#ExportWizard">Compile and sign with Eclipse ADT</a>.</p>
+
+
+
+<h3 id="cert">1. Obtain a suitable private key</h3>
+
+<p>In preparation for signing your application, you must first ensure that
+you have a suitable private key with which to sign. A suitable private
+key is one that:</p>
+
+<ul>
+<li>Is in your possession</li>
+<li>Represents the personal, corporate, or organizational entity to be identified
+with the application</li>
+<li>Has a validity period that exceeds the expected lifespan of the application
+or application suite. A validity period of more than 25 years is recommended.
+<p>If you plan to publish your application(s) on Google Play, note that a
+validity period ending after 22 October 2033 is a requirement. You can not upload an
+application if it is signed with a key whose validity expires before that date.
+</p></li>
+<li>Is not the debug key generated by the Android SDK tools. </li>
+</ul>
+
+<p>The key may be self-signed. If you do not have a suitable key, you must
+generate one using Keytool. Make sure that you have Keytool available, as described
+in <a href="#setup">Basic Setup</a>.</p>
+
+<p>To generate a self-signed key with Keytool, use the <code>keytool</code>
+command and pass any of the options listed below (and any others, as
+needed). </p>
+
+<p class="warning"><strong>Warning:</strong> Keep your private key secure.
+Before you run Keytool, make sure to read
+<a href="#secure-key">Securing Your Private Key</a> for a discussion of how to keep
+your key secure and why doing so is critically important to you and to users. In
+particular, when you are generating your key, you should select strong passwords
+for both the keystore and key.</p>
+
+<table>
+<tr>
+<th>Keytool Option</th>
+<th>Description</th>
+</tr>
+<tr>
+<td><code>-genkey</code></td><td>Generate a key pair (public and private
+keys)</td>
+</tr>
+<tr>
+<td><code>-v</code></td><td>Enable verbose output.</td>
+</tr>
+<tr>
+<td><code>-alias <alias_name></code></td><td>An alias for the key. Only
+the first 8 characters of the alias are used.</td>
+</tr>
+<tr>
+<td><code>-keyalg <alg></code></td><td>The encryption algorithm to use
+when generating the key. Both DSA and RSA are supported.</td>
+</tr>
+<tr>
+<td><code>-keysize <size></code></td><td>The size of each generated key
+(bits). If not supplied, Keytool uses a default key size of 1024 bits. In
+general, we recommend using a key size of 2048 bits or higher. </td>
+</tr>
+<tr>
+<td><code>-dname <name></code></td><td><p>A Distinguished Name that describes
+who created the key. The value is used as the issuer and subject fields in the
+self-signed certificate. </p><p>Note that you do not need to specify this option
+in the command line. If not supplied, Jarsigner prompts you to enter each
+of the Distinguished Name fields (CN, OU, and so on).</p></td>
+</tr>
+<tr>
+<td><code>-keypass <password></code></td><td><p>The password for the
+key.</p> <p>As a security precaution, do not include this option in your command
+line. If not supplied, Keytool prompts you to enter the password. In this way,
+your password is not stored in your shell history.</p></td>
+</tr>
+<tr>
+<td><code>-validity <valdays></code></td><td><p>The validity period for the
+key, in days. </p><p><strong>Note:</strong> A value of 10000 or greater is recommended.</p></td>
+</tr>
+<tr>
+<td><code>-keystore <keystore-name>.keystore</code></td><td>A name
+for the keystore containing the private key.</td>
+</tr>
+<tr>
+<td><code>-storepass <password></code></td><td><p>A password for the
+keystore.</p><p>As a security precaution, do not include this option in your
+command line. If not supplied, Keytool prompts you to enter the password. In
+this way, your password is not stored in your shell history.</p></td>
+</tr>
+</table>
+
+<p>Here's an example of a Keytool command that generates a private key:</p>
+
+<pre>$ keytool -genkey -v -keystore my-release-key.keystore
+-alias alias_name -keyalg RSA -keysize 2048 -validity 10000</pre>
+
+<p>Running the example command above, Keytool prompts you to provide
+passwords for the keystore and key, and to provide the Distinguished
+Name fields for your key. It then generates the keystore as a file called
+<code>my-release-key.keystore</code>. The keystore and key are
+protected by the passwords you entered. The keystore contains
+a single key, valid for 10000 days. The alias is a name that you —
+will use later, to refer to this keystore when signing your application. </p>
+
+<p>For more information about Keytool, see the documentation at
+<a
+href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html">
+http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html</a></p>
+
+
+
+<h3 id="releasecompile">2. Compile the application in release mode</h3>
+
+<p>In order to release your application to users, you must compile it in release mode.
+In release mode, the compiled application is not signed by default and you will need
+to sign it with your private key.</p>
+
+<p class="caution"><strong>Caution:</strong>
+You can not release your application unsigned, or signed with the debug key.</p>
+
+<h4>With Eclipse</h4>
+
+<p>To export an <em>unsigned</em> APK from Eclipse, right-click the project in the Package
+Explorer and select <strong>Android Tools</strong> > <strong>Export Unsigned Application
+Package</strong>. Then specify the file location for the unsigned APK.
+(Alternatively, open your <code>AndroidManifest.xml</code> file in Eclipse, select
+the <strong>Manifest</strong> tab, and click <strong>Export an unsigned APK</strong>.)</p>
+
+<p>Note that you can combine the compiling and signing steps with the Export Wizard. See
+<a href="#ExportWizard">Compiling and signing with Eclipse ADT</a>.</p>
+
+<h4>With Ant</h4>
+
+<p>If you are using Ant, you can enable release mode by using the <code>release</code> option
+with the <code>ant</code> command. For example, if you are running Ant from the
+directory containing your {@code build.xml} file, the command would look like this:</p>
+
+<pre>$ ant release</pre>
+
+<p>By default, the build script compiles the application APK without signing it. The output file
+in your project {@code bin/} will be <code><em><your_project_name></em>-unsigned.apk</code>.
+Because the application APK is still unsigned, you must manually sign it with your private
+key and then align it using {@code zipalign}.</p>
+
+<p>However, the Ant build script can also perform the signing
+and aligning for you, if you have provided the path to your keystore and the name of
+your key alias in the project's {@code ant.properties} file. With this information provided,
+the build script will prompt you for your keystore and alias password when you perform
+<code>ant release</code>, it will sign the package and then align it. The final output
+file in {@code bin/} will instead be
+<code><em><your_project_name></em>-release.apk</code>. With these steps
+automated for you, you're able to skip the manual procedures below (steps 3 and 4).
+To learn how to specify your keystore and alias in the {@code ant.properties} file,
+see <a href="{@docRoot}tools/building/building-cmdline.html#ReleaseMode">
+Building and Running Apps on the Command Line</a>.</p>
+
+
+
+<h3 id="signapp">3. Sign your application with your private key</h3>
+
+<p>When you have an application package that is ready to be signed, you can do sign it
+using the Jarsigner tool. Make sure that you have Jarsigner available on your
+machine, as described in <a href="#setup">Basic Setup</a>. Also, make sure that
+the keystore containing your private key is available.</p>
+
+<p>To sign your application, you run Jarsigner, referencing both the
+application's APK and the keystore containing the private key with which to
+sign the APK. The table below shows the options you could use. </p>
+
+<table>
+<tr>
+<th>Jarsigner Option</th>
+<th>Description</th>
+</tr>
+<tr>
+<td><code>-keystore <keystore-name>.keystore</code></td><td>The name of
+the keystore containing your private key.</td>
+</tr>
+<tr>
+<td><code>-verbose</code></td><td>Enable verbose output.</td>
+</tr>
+<tr>
+<td><code>-sigalg</code></td><td>The name of the signature algorithim to use in signing the APK.
+Use the value {@code MD5withRSA}.</td>
+</tr>
+<tr>
+<td><code>-digestalg</code></td><td>The message digest algorithim to use in processing the entries
+of an APK. Use the value {@code SHA1}.</td>
+</tr>
+<tr>
+<td><code>-storepass <password></code></td><td><p>The password for the
+keystore. </p><p>As a security precaution, do not include this option
+in your command line unless you are working at a secure computer.
+If not supplied, Jarsigner prompts you to enter the password. In this
+way, your password is not stored in your shell history.</p></td>
+</tr>
+<tr>
+<td><code>-keypass <password></code></td><td><p>The password for the private
+key. </p><p>As a security precaution, do not include this option
+in your command line unless you are working at a secure computer.
+If not supplied, Jarsigner prompts you to enter the password. In this
+way, your password is not stored in your shell history.</p></td>
+</tr>
+</table>
+
+<p>Here's how you would use Jarsigner to sign an application package called
+<code>my_application.apk</code>, using the example keystore created above.
+</p>
+
+<pre>$ jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore my-release-key.keystore
+my_application.apk alias_name</pre>
+
+<p>Running the example command above, Jarsigner prompts you to provide
+passwords for the keystore and key. It then modifies the APK
+in-place, meaning the APK is now signed. Note that you can sign an
+APK multiple times with different keys.</p>
+
+<p class="caution"><strong>Caution:</strong> As of JDK 7, the default signing algorithim has
+changed, requiring you to specify the signature and digest algorithims ({@code -sigalg} and {@code
+-digestalg}) when you sign an APK.</p>
+
+<p>To verify that your APK is signed, you can use a command like this:</p>
+
+<pre>$ jarsigner -verify my_signed.apk</pre>
+
+<p>If the APK is signed properly, Jarsigner prints "jar verified".
+If you want more details, you can try one of these commands:</p>
+
+<pre>$ jarsigner -verify -verbose my_application.apk</pre>
+
+<p>or</p>
+
+<pre>$ jarsigner -verify -verbose -certs my_application.apk</pre>
+
+<p>The command above, with the <code>-certs</code> option added, will show you the
+"CN=" line that describes who created the key.</p>
+
+<p class="note"><strong>Note:</strong> If you see "CN=Android Debug", this means the APK was
+signed with the debug key generated by the Android SDK. If you intend to release
+your application, you must sign it with your private key instead of the debug
+key.</p>
+
+<p>For more information about Jarsigner, see the documentation at
+<a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html">
+http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html</a></p>
+
+
+<h3 id="align">4. Align the final APK package</h3>
+
+<p>Once you have signed the APK with your private key, run <code>zipalign</code> on the file.
+This tool ensures that all uncompressed data starts with a particular byte alignment,
+relative to the start of the file. Ensuring alignment at 4-byte boundaries provides
+a performance optimization when installed on a device. When aligned, the Android
+system is able to read files with {@code mmap()}, even if
+they contain binary data with alignment restrictions, rather than copying all
+of the data from the package. The benefit is a reduction in the amount of
+RAM consumed by the running application.</p>
+
+<p>The <code>zipalign</code> tool is provided with the Android SDK, inside the
+<code>tools/</code> directory. To align your signed APK, execute:</p>
+
+<pre>$ zipalign -v 4 <em>your_project_name</em>-unaligned.apk <em>your_project_name</em>.apk</pre>
+
+<p>The {@code -v} flag turns on verbose output (optional). {@code 4} is the
+byte-alignment (don't use anything other than 4). The first file argument is
+your signed {@code .apk} file (the input) and the second file is the destination {@code .apk} file
+(the output). If you're overriding an existing APK, add the {@code -f} flag.</p>
+
+<p class="caution"><strong>Caution:</strong> Your input APK must be signed with your
+private key <strong>before</strong> you optimize the package with {@code zipalign}.
+If you sign it after using {@code zipalign}, it will undo the alignment.</p>
+
+<p>For more information, read about the
+<a href="{@docRoot}tools/help/zipalign.html">zipalign</a> tool.
+
+
+<h3 id="ExportWizard">Compile and sign with Eclipse ADT</h3>
+
+<p>If you are using Eclipse with the ADT plugin, you can use the Export Wizard to
+export a <em>signed</em> APK (and even create a new keystore,
+if necessary). The Export Wizard performs all the interaction with
+the Keytool and Jarsigner for you, which allows you to sign the package using a GUI
+instead of performing the manual procedures to compile, sign,
+and align, as discussed above. Once the wizard has compiled and signed your package,
+it will also perfom package alignment with {@code zipalign}.
+Because the Export Wizard uses both Keytool and Jarsigner, you should
+ensure that they are accessible on your computer, as described above
+in the <a href="#setup">Basic Setup for Signing</a>.</p>
+
+<p>To create a signed and aligned APK in Eclipse:</p>
+
+<ol>
+ <li>Select the project in the Package
+Explorer and select <strong>File > Export</strong>.</li>
+ <li>Open the Android folder, select Export Android Application,
+ and click <strong>Next</strong>.
+ <p>The Export Android Application wizard now starts, which will
+ guide you through the process of signing your application,
+ including steps for selecting the private key with which to sign the APK
+ (or creating a new keystore and private key).</p>
+ <li>Complete the Export Wizard and your application will be compiled,
+ signed, aligned, and ready for distribution.</li>
+</ol>
+
+
+
+<h2 id="secure-key">Securing Your Private Key</h2>
+
+<p>Maintaining the security of your private key is of critical importance, both
+to you and to the user. If you allow someone to use your key, or if you leave
+your keystore and passwords in an unsecured location such that a third-party
+could find and use them, your authoring identity and the trust of the user
+are compromised. </p>
+
+<p>If a third party should manage to take your key without your knowledge or
+permission, that person could sign and distribute applications that maliciously
+replace your authentic applications or corrupt them. Such a person could also
+sign and distribute applications under your identity that attack other
+applications or the system itself, or corrupt or steal user data. </p>
+
+<p>Your reputation as a developer entity depends on your securing your private
+key properly, at all times, until the key is expired. Here are some tips for
+keeping your key secure: </p>
+
+<ul>
+<li>Select strong passwords for the keystore and key.</li>
+<li>When you generate your key with Keytool, <em>do not</em> supply the
+<code>-storepass</code> and <code>-keypass</code> options at the command line.
+If you do so, your passwords will be available in your shell history,
+which any user on your computer could access.</li>
+<li>Similarly, when signing your applications with Jarsigner,
+<em>do not</em> supply the <code>-storepass</code> and <code>-keypass</code>
+options at the command line. </li>
+<li>Do not give or lend anyone your private key, and do not let unauthorized
+persons know your keystore and key passwords.</li>
+</ul>
+
+<p>In general, if you follow common-sense precautions when generating, using,
+and storing your key, it will remain secure. </p>
\ No newline at end of file
diff --git a/docs/html/tools/publishing/preparing.jd b/docs/html/tools/publishing/preparing.jd
new file mode 100644
index 0000000..3ebf3f7
--- /dev/null
+++ b/docs/html/tools/publishing/preparing.jd
@@ -0,0 +1,359 @@
+page.title=Preparing for Release
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>Quickview</h2>
+ <ul>
+ <li>Learn which resources you'll need to release your app.</li>
+ <li>Find out how to configure and build your app for release.</li>
+ <li>Learn best practices for releasing your app.</li>
+ </ul>
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#publishing-intro">Introduction</a></li>
+ <li><a href="#publishing-gather">Gathering Materials and Resources</a></li>
+ <li><a href="#publishing-configure">Configuring Your Application</a></li>
+ <li><a href="#publishing-build">Building Your Application</a></li>
+ <li><a href="#publishing-resources">Preparing External Servers and Resources</a></li>
+ <li><a href="#publishing-test">Testing Your Application for Release</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}tools/publishing/publishing_overview.html">Publishing Overview</a></li>
+ <li><a href="{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a></li>
+ <li><a href="{@docRoot}distribute/googleplay/publish/preparing.html">Publishing Checklist for Google Play</a></li>
+ </ol>
+ </div>
+</div>
+
+<p>Before you distribute your Android application to users you need to prepare it for release. The
+preparation process is a required <a href="{@docRoot}tools/workflow/index.html">development
+task</a> for all Android applications and is the first step in the publishing process (see figure
+1).</p>
+
+<p>When you prepare your application for release, you configure, build, and test a release
+version of your application. The configuration tasks are straightforward, involving basic code
+cleanup and code modification tasks that help optimize your application. The build process is
+similar to the debug build process and can be done using JDK and Android SDK tools. The testing
+tasks serve as a final check, ensuring that your application performs as expected under real-world
+conditions. When you are finished preparing your application for release you have a signed
+<code>.apk</code> file, which you can distribute directly to users or distribute through an
+application marketplace such as Google Play.</p>
+
+<p>This document summarizes the main tasks you need to perform to prepare your application for
+release. The tasks that are described in this document apply to all Android applications regardless
+how they are released or distributed to users. If you are releasing your application through Google
+Play, you should also read <a href="{@docRoot}distribute/googleplay/publish/preparing.html">Publishing
+Checklist for Google Play</a> to be sure your release-ready application satisfies all Google Play
+requirements.</p>
+
+<p class="note"><strong>Note:</strong> As a best practice, your application should meet all of your
+release criteria for functionality, performance, and stability before you perform the tasks outlined
+in this document.</p>
+
+<img src="{@docRoot}images/publishing/publishing_overview_prep.png"
+ alt="Shows how the preparation process fits into the development process"
+ height="190"
+ id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Preparing for release is a required <a
+href="{@docRoot}tools/workflow/index.html">development
+task</a> and is the first step in the publishing process.
+</p>
+
+<h2 id="publishing-intro">Introduction</h2>
+
+<p>To release your application to users you need to create a release-ready package that users can
+install and run on their Android-powered devices. The release-ready package contains the same
+components as the debug <code>.apk</code> file — compiled source code, resources, manifest
+file, and so on — and it is built using the same build tools. However, unlike the debug
+<code>.apk</code> file, the release-ready <code>.apk</code> file is signed with your own certificate
+and it is optimized with the zipalign tool.</p>
+
+<div class="figure" style="width:331px">
+ <img src="{@docRoot}images/publishing/publishing_preparing.png"
+ alt="Shows the five tasks you perform to prepare your app for release"
+ height="450" />
+ <p class="img-caption">
+ <strong>Figure 2.</strong> You perform five main tasks to prepare your application for
+ release.
+ </p>
+</div>
+
+<p>The signing and optimization tasks are usually seamless if you are building your application with
+Eclipse and the ADT plugin or with the Ant build script (included with the Android SDK). For
+example, you can use the Eclipse Export Wizard to compile, sign, and optimize your application all
+at once. You can also configure the Ant build script to do the same when you build from the command
+line.</p>
+
+<p>To prepare your application for release you typically perform five main tasks (see figure 2).
+Each main task may include one or more smaller tasks depending on how you are releasing your
+application. For example, if you are releasing your application through Google Play you may want
+to add special filtering rules to your manifest while you are configuring your application for
+release. Similarly, to meet Google Play publishing guidelines you may have to prepare screenshots
+and create promotional text while you are gathering materials for release.</p>
+
+<p>You usually perform the tasks listed in figure 2 after you have throroughly debugged and tested
+your application. The Android SDK contains several tools to help you test and debug your Android
+applications. For more information, see the <a
+href="{@docRoot}tools/debugging/index.html">Debugging</a> and <a
+href="{@docRoot}tools/testing/index.html">Testing</a> sections in the Dev Guide.</p>
+
+<h2 id="publishing-gather">Gathering Materials and Resources</h2>
+
+<p>To begin preparing your application for release you need to gather several supporting items. At a
+minimum this includes cryptographic keys for signing your application and an application icon. You
+might also want to include an end-user license agreement.</p>
+
+<h4 id="publishing-keys">Cryptographic keys</h4>
+
+<p>The Android system requires that each installed application be digitally signed with a
+certificate that is owned by the application's developer (that is, a certificate for which the
+developer holds the private key). The Android system uses the certificate as a means of identifying
+the author of an application and establishing trust relationships between applications. The
+certificate that you use for signing does not need to be signed by a certificate authority; the
+Android system allows you to sign your applications with a self-signed certificate. To learn about
+certificate requirements, see <a href="{@docRoot}tools/publishing/app-signing.html#cert">Obtain a
+suitable private key</a>.</p>
+
+<p class="caution"><strong>Important:</strong> Your application must be signed with a cryptographic
+key whose validity period ends after 22 October 2033.</p>
+
+<p>You may also have to obtain other release keys if your application accesses a service or uses a
+third-party library that requires you to use a key that is based on your private key. For example,
+if your application uses the <a
+href="http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapView.html">MapView</a>
+class, which is part of the <a
+href="http://code.google.com/android/add-ons/google-apis/maps-overview.html">Google Maps external
+library</a>, you will need to register your application with the Google Maps service and obtain
+a Maps API key. For information about getting a Maps API key, see <a
+href="http://code.google.com/android/add-ons/google-apis/mapkey.html"> Obtaining a Maps API
+key</a>.</p>
+
+<h4>Application Icon</h4>
+
+<p>Be sure you have an application icon and that it meets the recommended <a
+href="{@docRoot}guide/practices/ui_guidelines/icon_design_launcher.html">icon guidelines</a>. Your
+application's icon helps users identify your application on a device's Home
+screen and in the Launcher window. It also appears in Manage Applications, My Downloads, and
+elsewhere. In addition, publishing services such as Google Play display your icon to users.</p>
+
+<p class="note"><strong>Note:</strong> If you are releasing your application on Google Play, you
+need to create a high resolution
+ version of your icon. See <a
+href="https://www.google.com/support/androidmarket/developer/bin/answer.py?answer=1078870">Graphic
+Assets for your Application</a> for more information.</p>
+
+<h4>End-user License Agreement</h4>
+
+<p>Consider preparing an End User License Agreement (EULA) for your application. A EULA can help
+protect your person, organization, and intellectual property, and we recommend that you provide one
+with your application.</p>
+
+<h4>Miscellaneous Materials</h4>
+
+<p>You might also have to prepare promotional and marketing materials to publicize your application.
+For example, if you are releasing your application on Google Play you will need to prepare some
+promotional text and you will need to create screenshots of your application. For more
+information, see
+<a href="https://www.google.com/support/androidmarket/developer/bin/answer.py?answer=1078870">
+Graphic Assets for your Application</a></p>
+
+<h2 id="publishing-configure">Configuring Your Application for Release</h2>
+
+<p>After you gather all of your supporting materials you can start configuring your application
+for release. This section provides a summary of the configuration changes we recommend that you make
+to your source code, resource files, and application manifest prior to releasing your application.
+Although most of the configuration changes listed in this section are optional, they are
+considered good coding practices and we encourage you to implement them. In some cases,
+you may have already made these configuration changes as part of your development process.</p>
+
+<h4>Choose a good package name</h4>
+
+<p>Make sure you choose a package name that is suitable over the life of your application. You
+cannot change the package name after you distribute your application to users. You can set the
+package name in application's manifest file. For more information, see the <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#package">package</a> attribute
+documentation.</p>
+
+<h4>Turn off logging and debugging</h4>
+
+<p>Make sure you deactivate logging and disable the debugging option before you build your
+application for release. You can deactivate logging by removing calls to
+{@link android.util.Log} methods in your source files. You can disable debugging by removing the
+<code>android:debuggable</code> attribute from the <code><application></code> tag in your
+manifest file, or by setting the <code>android:debuggable</code> attribute to
+<code>false</code> in your manifest file. Also, remove any log files or static test files that
+were created in your project.</p>
+
+<p>Also, you should remove all {@link android.os.Debug} tracing calls that you
+added to your code, such as {@link android.os.Debug#startMethodTracing()} and
+{@link android.os.Debug#stopMethodTracing()} method calls.</p>
+
+<h4>Clean up your project directories</h4>
+
+<p>Clean up your project and make sure it conforms to the directory structure described in <a
+href="{@docRoot}tools/projects/index.html#ApplicationProjects">Android Projects</a>.
+Leaving stray or orphaned files in your project can prevent your application from compiling and
+cause your application to behave unpredictably. At a minimum you should do the following cleanup
+tasks:</p>
+
+<ul>
+ <li>Review the contents of your <code>jni/</code>, <code>lib/</code>, and <code>src/</code>
+ directories. The <code>jni/</code> directory should contain only source files associated with the
+ <a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK</a>, such as
+ <code>.c</code>, <code>.cpp</code>, <code>.h</code>, and <code>.mk</code> files. The
+ <code>lib/</code> directory should contain only third-party library files or private library
+ files, including prebuilt shared and static libraries (for example, <code>.so</code> files). The
+ <code>src/</code> directory should contain only the source files for your application
+ (<code>.java</code> and <code>.aidl</code> files). The <code>src/</code> directory should not
+ contain any <code>.jar</code> files.</li>
+ <li>Check your project for private or proprietary data files that your application does not use
+ and remove them. For example, look in your project's <code>res/</code> directory for old
+ drawable files, layout files, and values files that you are no longer using and delete them.</li>
+ <li>Check your <code>lib/</code> directory for test libraries and remove them if they are no
+ longer being used by your application.</li>
+ <li>Review the contents of your <code>assets/</code> directory and your <code>res/raw/</code>
+ directory for raw asset files and static files that you need to update or remove prior to
+ release.</li>
+</ul>
+
+<h4>Review and update your manifest settings</h4>
+
+<p>Verify that the following manifest items are set correctly:</p>
+
+<ul>
+ <li><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">
+ <uses-permission></a> element
+ <p>You should specify only those permissions that are relevant and required for your application.</p>
+ </li>
+ <li><code>android:icon</code> and <code>android:label</code> attributes
+ <p>You must specify values for these attributes, which are located in the
+ <a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a>
+ element.</p>
+ </li>
+ <li><code>android:versionCode</code> and <code>android:versionName</code> attributes.
+ <p>We recommend that you specify values for these attributes, which are located in the
+ <a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a>
+ element. For more information see
+ <a href="{@docRoot}tools/publishing/versioning.html">Versioning your Application</a>.</p>
+ </li>
+</ul>
+
+<p>There are several additional manifest elements that you can set if you are releasing your
+application on Google Play. For example, the <code>android:minSdkVersion</code> and
+<code>android:targetSdkVersion</code> attributes, which are located in the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"> <uses-sdk></a> element. For more
+information about these and other Google Play settings, see <a
+href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a>.</p>
+
+<h4>Address compatibility issues</h4>
+
+<p>Android provides several tools and techniques to make your application compatible with a wide
+range of devices. To make your application available to the largest number of users, consider
+doing the following:</p>
+
+<ul>
+ <li><strong>Add support for multiple screen configurations</strong>
+ <p>Make sure you meet the
+ <a href="{@docRoot}guide/practices/screens_support.html#screen-independence">
+ best practices for supporting multiple screens</a>. By supporting multiple screen configurations
+ you can create an application that functions properly and looks good on any of the screen sizes
+ supported by Android.</p>
+ </li>
+ <li><strong>Optimize your application for Android tablet devices.</strong>
+ <p>If your application is designed for devices older than Android 3.0, make it compatible
+ with Android 3.0 devices by following the guidelines and best practices described in
+ <a href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing Apps for Android 3.0
+ </a>.</p>
+ </li>
+ <li><strong>Consider using the Support Library</strong>
+ <p>If your application is designed for devices running Android 3.x, make your application
+ compatible with older versions of Android by adding the
+ <a href="{@docRoot}tools/extras/support-library.html">Support Library</a> to your
+ application project. The Support Library provides static support libraries that you can add to
+ your Android application, which enables you to use APIs that are either not available on
+ older platform versions or use utility APIs that are not part of the framework APIs.</p>
+ </li>
+</ul>
+
+<h4>Update URLs for servers and services</h4>
+
+<p>If your application accesses remote servers or services, make sure you are using the production
+URL or path for the server or service and not a test URL or path.</p>
+
+<h4>Implement Licensing (if you are releasing on Google Play)</h4>
+
+<p>If you are releasing a paid application through Google Play, consider adding support for
+Google Play Licensing. Licensing lets you control access to your application based on whether the
+current user has purchased it. Using Google Play Licensing is optional even if you are
+releasing your app through Google Play.</p>
+
+<p>For more information about Google Play Licensing Service and how to use it in your
+application, see <a href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a>.</p>
+
+<h2 id="publishing-build">Building Your Application for Release</h2>
+
+<p>After you finish configuring your application you can build it into a release-ready
+<code>.apk</code> fle that is signed and optimized. The JDK includes the tools for signing the
+<code>.apk</code> file (Keytool and Jarsigner); the Android SDK includes the tools for compiling and
+optimizing the <code>.apk</code> file. If you are using Eclipse with the ADT plugin or you are using
+the Ant build script from the command line, you can automate the entire build process.</p>
+
+<h3>Building with Eclipse</h3>
+
+<p>You can use the Eclipse Export Wizard to build a release-ready <code>.apk</code> file that is
+signed with your private key and optimized. To learn how to run the Export Wizard, see
+<a href="{@docRoot}tools/publishing/app-signing.html#ExportWizard">Compile and sign with Eclipse
+ADT</a>. The Export Wizard compiles your application for release, signs your application with your
+private key, and optimizes your application with the zipalign tool. The Export Wizard should run
+successfully if you have run or debugged your application from Eclipse and you have no errors in
+your application (see <a href="{@docRoot}tools/building/building-eclipse.html">Building
+and Running from Eclipse with ADT</a> for more information.</p>
+
+<p>The Export Wizard assumes that you have a <a href="#billing-keys">certificate and private key</a>
+suitable for signing your application. If you do not have a suitable certificate and private key,
+the Export Wizard will help you generate one (see
+<a href="{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a> for more
+information about the signing process and signing guidelines.</p>
+
+<h3>Building with Ant</h3>
+
+<p>You can use the Ant build script (included in the Android SDK) to build a release-ready
+<code>.apk</code> file that is signed with your private key and optimized. To learn how to do this,
+see <a href="{@docRoot}tools/building/building-cmdline.html#ReleaseMode">Building in
+Release Mode</a>. This build method assumes you have a <a href="#billing-keys">certificate and
+private key</a> suitable for signing your application. If you do not have a suitable certificate and
+private key, the Export Wizard will help you generate one (see
+<a href="{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a> for more
+information about the signing process and signing guidelines.</p>
+
+<h2 id="publishing-resources">Preparing External Servers and Resources</h2>
+
+<p>If your application relies on a remote server, make sure the server is secure and that it is
+configured for production use. This is particularly important if you are implementing <a
+href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> in your application and you are
+performing the signature verification step on a remote server.</p>
+
+<p>Also, if your application fetches content from a remote server or a real-time service (such as a
+content feed), be sure the content you are providing is up to date and production-ready.</p>
+
+<h2 id="publishing-test">Testing Your Application for Release</h2>
+
+<p>Testing the release version of your application helps ensure that your application runs properly
+under realistic device and network conditions. Ideally, you should test your application on at least
+one handset-sized device and one tablet-sized device to verify that your user interface elements are
+sized correctly and that your application's performance and battery efficiency are acceptable.</p>
+
+<p>As a starting point for testing, see
+<a href="{@docRoot}tools/testing/what_to_test.html">What to Test</a>. This article provides
+a summary of common Android situations that you should consider when you are testing. When you are
+done testing and you are satisfied that the release version of your application
+behaves correctly, you can release your application to users. For more information, see
+<a href="{@docRoot}tools/publishing/publishing_overview.html#publishing-release">Releasing Your
+Application to Users</a>. If you are publishing your application on Google Play, see
+<a href="{@docRoot}distribute/googleplay/publish/preparing.html">Publishing Checklist
+for Google Play</a>.</p>
+
+
diff --git a/docs/html/tools/publishing/publishing_overview.jd b/docs/html/tools/publishing/publishing_overview.jd
new file mode 100755
index 0000000..572766c9
--- /dev/null
+++ b/docs/html/tools/publishing/publishing_overview.jd
@@ -0,0 +1,238 @@
+page.title=Publishing Overview
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>Quickview</h2>
+ <ul>
+ <li>Learn how to publish Android apps.</li>
+ <li>Find out how to prepare apps for release.</li>
+ <li>Learn how to release apps to users.</li>
+ </ul>
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#publishing-prepare">Preparing Your Application for Release</a></li>
+ <li><a href="#publishing-release">Releasing Your Application to Users</a>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}distribute/googleplay/publish/preparing.html">Publishing on Google Play</a></li>
+ </ol>
+</div>
+</div>
+
+<p>Publishing is the general process that makes your Android applications available to users. When you
+publish an Android application you perform two main tasks:</p>
+
+<ul>
+ <li>You prepare the application for release.
+ <p>During the preparation step you build a release version of your application, which users can
+ download and install on their Android-powered devices.</p>
+ </li>
+ <li>You release the application to users.
+ <p>During the release step you publicize, sell, and distribute the release version of your
+ application to users.</p>
+ </li>
+</ul>
+
+<p>Usually, you release your application through an application marketplace, such as <a href="{@docRoot}distribute/index.html">Google Play</a>.
+However, you can also release applications by sending them directly to users or by letting users
+download them from your own website.</p>
+
+<p>Figure 1 shows how the publishing process fits into the overall Android <a
+href="{@docRoot}tools/workflow/index.html">application development process</a>.
+The publishing process is typically performed after you finish testing your application in a debug
+environment. Also, as a best practice, your application should meet all of your release criteria for
+functionality, performance, and stability before you begin the publishing process.</p>
+
+<img src="{@docRoot}images/publishing/publishing_overview.png" alt="Shows where the publishing
+ process fits into the overall development process" height="86" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Publishing is the last phase of the Android <a
+href="{@docRoot}tools/workflow/index.html">application development process</a>.
+</p>
+
+<h2 id="publishing-prepare">Preparing Your Application for Release</h2>
+
+<p>Preparing your application for release is a multi-step process that involves the following
+tasks:</p>
+
+<ul>
+ <li>Configuring your application for release.
+ <p>At a minimum you need to remove {@link android.util.Log} calls and remove the
+ <a href="{@docRoot}guide/topics/manifest/application-element.html#debug">android:debuggable</a>
+ attribute from your manifest file. You should also provide values for the
+ <code>android:versionCode</code> and <code>android:versionName</code> attributes, which are
+ located in the
+ <a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a>
+ element. You may also have to configure several other settings to meet Google Play
+ requirements or accomodate whatever method you're using to release your application.</p>
+ </li>
+ <li>Building and signing a release version of your application.
+ <p>The Android Development Tools (ADT) plugin and the Ant build script that are provided
+ with the Android SDK tools provide everything you need to build and sign a release version of
+ your application.</p>
+ </li>
+ <li>Testing the release version of your application.
+ <p>Before you distribute your application, you should thoroughly test the release version on at
+ least one target handset device and one target tablet device.</p>
+ </li>
+ <li>Updating application resources for release.
+ <p>You need to be sure that all application resources such as multimedia files and graphics
+ are updated and included with your application or staged on the proper production servers.</p>
+ </li>
+ <li>Preparing remote servers and services that your application depends on.
+ <p>If your application depends on external servers or services, you need to be sure they
+ are secure and production ready.</p>
+ </li>
+</ul>
+
+<p>You may have to perform several other tasks as part of the preparation process. For example, you
+will need to get a private key for signing your application, and you may need to get a Maps API
+release key if you are using the <a
+href="http://code.google.com/android/add-ons/google-apis/maps-overview.html">Google Maps external
+library</a>. You will also need to create an icon for your application, and you may want to prepare
+an End User License Agreement (EULA) to protect your person, organization, and intellectual
+property.</p>
+
+<p>When you are finished preparing your application for release you will have a signed
+<code>.apk</code> file that you can distribute to users.</p>
+
+<p>To learn how to prepare your application for release, see <a
+href="{@docRoot}tools/publishing/preparing.html">Preparing for Release</a> in the Dev Guide. This
+topic provides step-by-step instructions for configuring and building a release version of your
+application.</p>
+
+<h2 id="publishing-release">Releasing Your Application to Users</h2>
+
+<p>You can release your Android applications several ways. Usually, you release applications
+through an application marketplace such as Google Play, but you can also release applications
+on your own website or by sending an application directly to a user.
+
+<h3 id="publishing-marketplace">Releasing through an App Marketplace</h3>
+
+<p>If you want to distribute your apps to the broadest possible audience, releasing through
+an app marketplace such as Google Play is ideal. </p>
+
+<p>Google Play is the premier marketplace for Android apps and is particularly
+useful if you want to distribute your applications to a large global audience.
+However, you can distribute your apps through any app marketplace you want or
+you can use multiple marketplaces.</p>
+
+
+<h4 id="publishing-market">Releasing Your Applications on Google Play</h4>
+
+<p>Google Play is a robust publishing platform that helps you publicize, sell, and distribute
+your Android applications to users around the world. When you release your applications through
+Google Play you have access to a suite of developer tools that let you analyze your sales,
+identify market trends, and control who your applications are being distributed to. You also have
+access to several revenue-enhancing features such as <a
+href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> and <a
+href="{@docRoot}guide/google/play/licensing/index.html">application licensing</a>. The rich array of tools
+and features, coupled with numerous end-user community features, makes Google Play the premier
+marketplace for selling and buying Android applications.</p>
+
+<p>Releasing your application on Google Play is a simple process that involves three basic
+ steps:</p>
+
+<ul>
+ <li>Preparing promotional materials.
+ <p>To fully leverage the marketing and publicity capabilities of Google Play, you need to
+ create promotional materials for your application, such as screenshots, videos, graphics, and
+ promotional text.</p>
+ </li>
+ <li>Configuring options and uploading assets.
+ <p>Google Play lets you target your application to a worldwide pool of users and devices.
+ By configuring various Google Play settings, you can choose the countries you want to
+ reach, the listing languages you want to use, and the price you want to charge in each
+ country. You can also configure listing details such as the application type, category, and
+ content rating. When you are done configuring options you can upload your promotional materials
+ and your application as a draft (unpublished) application.</p>
+ </li>
+ <li>Publishing the release version of your application.
+ <p>If you are satisfied that your publishing settings are correctly configured and your
+ uploaded application is ready to be released to the public, you can simply click
+ <strong>Publish</strong > in the developer console and within minutes your application will be
+ live and available for download around the world.</p>
+ </li>
+</ul>
+
+<p>For information complete information, see <a href="{@docRoot}distribute/index.html">Google Play</a>.</p>
+
+
+<h3 id="publishing-email">Releasing your application through email</h3>
+
+<div class="figure" style="width:246px">
+ <img src="{@docRoot}images/publishing/publishing_via_email.png"
+ alt="Screenshot showing the graphical user interface users see when you send them an app"
+ style="width:240px;" />
+ <p class="img-caption">
+ <strong>Figure 1.</strong> Users can simply click <strong>Install</strong> when you send them
+ an application via email.
+ </p>
+</div>
+
+<p>The easiest and quickest way to release your application is to send it to a user through
+email. To do this, you prepare your application for release and then attach it to an email
+and send it to a user. When the user opens your email message on their Android-powered device
+the Android system will recognize the APK and display an <strong>Install Now</strong>
+button in the email message (see figure 1). Users can install your application by touching the
+button.</p>
+
+<p class="note"><strong>Note:</strong> The <strong>Install Now</strong> button
+shown in Figure 1 appears only if a user has configured their device to allow
+installation from <a href="#unknown-sources">unknown sources</a> and has opened your
+email with the native Gmail application.</p>
+
+<p>Distributing applications through email is convenient if you are sending your application to
+only a few trusted users, but it provides few protections from piracy and unauthorized
+distribution; that is, anyone you send your application to can simply forward it to someone else.</p>
+
+<h2 id="publishing-website">Releasing through a web site</h2>
+
+<p>If you do not want to release your app on a marketplace like Google Play, you
+can make the app available for download on your own website or server, including
+on a private or enterprise server. To do this, you must first prepare your
+application for release in the normal way. Then all you need to do is host the
+release-ready APK file on your website and provide a download link to users.
+</p>
+
+<p>When users browse to the download link from their Android-powered devices,
+the file is downloaded and Android system automatically starts installing it on
+the device. However, the installation process will start automatically only if
+the user has configured their Settings to allow the installation of apps from
+<a href="#unknown-sources">unknown sources</a>.</p>
+
+<p>Although it is relatively easy to release your application on your own
+website, it can be inefficient. For example, if you want to monetize your
+application you will have to process and track all financial transactions
+yourself and you will not be able to use Google Play's <a
+href="{@docRoot}guide/google/play/billing/index.html">In-app Billing service</a>
+to sell in-app products. In addition, you will not be able to use the <a
+href="{@docRoot}guide/google/play/licensing/index.html">Licensing service</a> to
+help prevent unauthorized installation and use of your application.</p>
+
+
+<h2 id="unknown-sources">User Opt-In for Apps from Unknown Sources</h2>
+
+<div class="figure" style="width:246px;margin-top:0;">
+ <img src="{@docRoot}images/publishing/publishing_unknown_sources_sm.png"
+ alt="Screenshot showing the setting for accepting download and install of
+ apps from unknown sources." style="width:240px;" />
+ <p class="img-caption">
+ <strong>Figure 2.</strong> Users must enable the <strong>Unknown sources</strong>
+ setting before they can install apps not downloaded from Google Play.
+ </p>
+</div>
+
+<p>Android protects users from inadvertent download and install of apps from
+locations other than Google Play (which is trusted). It blocks such installs
+until the user opts-in <strong>Unknown sources</strong> in
+Settings <strong>></strong> Security, shown in Figure 2. To allow
+the installation of applications from other sources, users need to enable the
+Unknown sources setting on their devices, and they need to make this
+configuration change <em>before</em> they download your application to their
+devices.</p>
+
+<p class="note">Note that some network providers do not allow users to install
+applications from unknown sources.</p>
diff --git a/docs/html/tools/publishing/versioning.jd b/docs/html/tools/publishing/versioning.jd
new file mode 100644
index 0000000..8f602b4
--- /dev/null
+++ b/docs/html/tools/publishing/versioning.jd
@@ -0,0 +1,174 @@
+page.title=Versioning Your Applications
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Quickview</h2>
+
+<ul>
+<li>Your application <em>must</em> be versioned</a></li>
+<li>You set the version in the application's manifest file</li>
+<li>How you version your applications affects how users upgrade </li>
+<li>Determine your versioning strategy early in the development process, including considerations for future releases.</li>
+</ul>
+
+<h2>In this document</h2>
+
+<ol>
+<li><a href="#appversioning">Setting Application Version</a></li>
+<li><a href="#minsdkversion">Specifying Your Application's System API Requirements</a>
+</ol>
+
+
+<h2>See also</h2>
+
+<ol>
+<li><a href="{@docRoot}tools/publishing/preparing.html">Preparing to Publish Your Application</a></li>
+<li><a href="{@docRoot}distribute/googleplay/publish/preparing.html">Publishing Checklist for Google Play</a></li>
+<li><a href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>Versioning is a critical component of your application upgrade and maintenance
+strategy. Versioning is important because:</p>
+
+<ul>
+<li>Users need to have specific information about the application version that
+is installed on their devices and the upgrade versions available for
+installation. </li>
+<li>Other applications — including other applications that you publish as
+a suite — need to query the system for your application's version, to
+determine compatibility and identify dependencies.</li>
+<li>Services through which you will publish your application(s) may also need to
+query your application for its version, so that they can display the version to
+users. A publishing service may also need to check the application version to
+determine compatibility and establish upgrade/downgrade relationships.</li>
+</ul>
+
+<p>The Android system does not use app version information to enforce
+restrictions on upgrades, downgrades, or compatibility of third-party apps. Instead, you (the
+developer) are responsible for enforcing version restrictions within your application or by
+informing users of the version restrictions and limitations. The Android system does, however,
+enforce system version compatibility as expressed by the <code>minSdkVersion</code> attribute in the
+manifest. This attribute allows an application to specify the minimum system API with which it is
+compatible. For more information see <a href="#minsdkversion">Specifying Minimum System API
+Version</a>.</p>
+
+<h2 id="appversioning">Setting Application Version</h2>
+<p>To define the version information for your application, you set attributes in
+the application's manifest file. Two attributes are available, and you should
+always define values for both of them: </p>
+
+<ul>
+<li><code>android:versionCode</code> — An integer value that represents
+the version of the application code, relative to other versions.
+
+<p>The value is an integer so that other applications can programmatically
+evaluate it, for example to check an upgrade or downgrade relationship. You can
+set the value to any integer you want, however you should make sure that each
+successive release of your application uses a greater value. The system does not
+enforce this behavior, but increasing the value with successive releases is
+normative. </p>
+
+<p>Typically, you would release the first version of your application with
+versionCode set to 1, then monotonically increase the value with each release,
+regardless whether the release constitutes a major or minor release. This means
+that the <code>android:versionCode</code> value does not necessarily have a
+strong resemblance to the application release version that is visible to the
+user (see <code>android:versionName</code>, below). Applications and publishing
+services should not display this version value to users.</p>
+</li>
+<li><code>android:versionName</code> — A string value that represents the
+release version of the application code, as it should be shown to users.
+<p>The value is a string so that you can describe the application version as a
+<major>.<minor>.<point> string, or as any other type of
+absolute or relative version identifier. </p>
+
+<p>As with <code>android:versionCode</code>, the system does not use this value
+for any internal purpose, other than to enable applications to display it to
+users. Publishing services may also extract the <code>android:versionName</code>
+value for display to users.</p>
+</li>
+</ul>
+
+<p>You define both of these version attributes in the
+<code><manifest></code> element of the manifest file. </p>
+
+<p>Here's an example manifest that shows the <code>android:versionCode</code>
+and <code>android:versionName</code> attributes in the
+<code><manifest></code> element. </p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.package.name"
+ android:versionCode="2"
+ android:versionName="1.1">
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+ ...
+ </application>
+</manifest>
+</pre>
+
+<p>In this example, note that <code>android:versionCode</code> value indicates
+that the current .apk contains the second release of the application code, which
+corresponds to a minor follow-on release, as shown by the
+<code>android:versionName</code> string. </p>
+
+<p>The Android framework provides an API to let applications query the system
+for version information about your application. To obtain version information,
+applications use the
+{@link android.content.pm.PackageManager#getPackageInfo(java.lang.String, int)}
+method of {@link android.content.pm.PackageManager PackageManager}. </p>
+
+<h2 id="minsdkversion">Specifying Your Application's System API Requirements</h2>
+
+<p>If your application requires a specific minimum version of the Android
+platform, or is designed only to support a certain range of Android platform
+versions, you can specify those version requirements as API Level identifiers
+in the application's manifest file. Doing so ensures that your
+application can only be installed on devices that
+are running a compatible version of the Android system. </p>
+
+<p>To specify API Level requirements, add a <code><uses-sdk></code>
+element in the application's manifest, with one or more of these attributes: </p>
+
+<ul>
+<li><code>android:minSdkVersion</code> — The minimum version
+of the Android platform on which the application will run, specified
+by the platform's API Level identifier. </li>
+<li><code>android:targetSdkVersion</code> — Specifies the API Level
+on which the application is designed to run. In some cases, this allows the
+application to use manifest elements or behaviors defined in the target
+API Level, rather than being restricted to using only those defined
+for the minimum API Level.</li>
+<li><code>android:maxSdkVersion</code> — The maximum version
+of the Android platform on which the application is designed to run,
+specified by the platform's API Level identifier. <strong>Important:</strong> Please read the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+documentation before using this attribute. </li>
+</ul>
+
+<p>When preparing to install your application, the system checks the value of this
+attribute and compares it to the system version. If the
+<code>android:minSdkVersion</code> value is greater than the system version, the
+system aborts the installation of the application. Similarly, the system
+installs your application only if its <code>android:maxSdkVersion</code>
+is compatible with the platform version.</p>
+
+<p>If you do not specify these attributes in your manifest, the system assumes
+that your application is compatible with all platform versions, with no
+maximum API Level. </p>
+
+<p>To specify a minimum platform version for your application, add a
+<code><uses-sdk></code> element as a child of
+<code><manifest></code>, then define the
+<code>android:minSdkVersion</code> as an attribute. </p>
+
+<p>For more information, see the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+manifest element documentation and the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Levels</a> document.</p>
diff --git a/docs/html/tools/revisions/index.jd b/docs/html/tools/revisions/index.jd
new file mode 100644
index 0000000..0e7ceef
--- /dev/null
+++ b/docs/html/tools/revisions/index.jd
@@ -0,0 +1,9 @@
+page.title=Revisions
+page.noplus=1
+@jd:body
+
+<p>The Android SDK is composed of individual packages that may undergo
+an update at their own schedule, so some have their own set of release notes. You can
+find information about some of the packages in this section, including the core <a
+href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools</a> and the latest <a
+href="{@docRoot}tools/revisions/platforms.html">Platforms</a>.</p>
\ No newline at end of file
diff --git a/docs/html/tools/revisions/platforms.jd b/docs/html/tools/revisions/platforms.jd
new file mode 100644
index 0000000..e57c221
--- /dev/null
+++ b/docs/html/tools/revisions/platforms.jd
@@ -0,0 +1,831 @@
+page.title=Platforms
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+
+<h2>See Also</h2>
+<ol>
+ <li><a href="{@docRoot}about/versions/android-4.0-highlights.html">Ice Cream Sandwich
+Highlights and APIs</a></li>
+ <li><a href="{@docRoot}about/versions/android-3.0-highlights.html">Honeycomb
+Highlights and APIs</a></li>
+ <li><a href="{@docRoot}about/versions/android-2.3-highlights.html">Gingerbread
+Highlights and APIs</a></li>
+</ol>
+
+</div>
+</div>
+
+
+
+<p>To develop an Android app, you must install at least one Android platform from the SDK Manager
+against which you can compile your app. Often, any given version of the Android will be revised
+with bug fixes or other changes, as denoted by the "revision" number. Below, you'll find the
+release notes for each version of the platform and the subsequent revisions to the platform
+version.</p>
+
+<p>To determine what revision of an Android platform you
+have installed, refer to the "Installed Packages" listing in the Android SDK Manager.</p>
+
+
+
+
+
+
+
+
+<h2 id="4.0.3">Android 4.0.3</h2>
+
+
+<p class="caution"><strong>Important:</strong> To download the new Android
+4.0.x system components from the Android SDK Manager, you must first update the
+SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
+the Android 4.0.x system components will not be available for download.</p>
+
+<div class="toggle-content opened">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-opened.png"
+class="toggle-content-img" alt="" />
+ Revision 3</a> <em>(March 2012)</em>
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em;">
+
+ <p>Maintenance update. The system version is 4.0.4.</p>
+ <p class="note"><strong>Note:</strong> This system image includes support for emulator
+hardware graphics acceleration when used with SDK Tools r17 or higher.
+(<a href="{@docRoot}tools/devices/emulator.html#accel-graphics">more info</a>)</p>
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>SDK Tools r17 or higher is required.</dd>
+ </dl>
+
+ </div>
+</div>
+
+<div class="toggle-content closed" >
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Revision 2</a> <em>(January 2012)</em>
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em;">
+
+ <p>Maintenance update. The system version is 4.0.3.</p>
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>SDK Tools r14 or higher is required.</dd>
+ </dl>
+
+ </div>
+</div>
+
+<div class="toggle-content closed" >
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Revision 1</a> <em>(December 2011)</em>
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em;">
+
+ <p>Initial release. The system version is 4.0.3.</p>
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>SDK Tools r14 or higher is required.</dd>
+ </dl>
+
+ </div>
+</div>
+
+<h3>Emulator Skins</h3>
+
+<p>The downloadable platform includes the following emulator skins:</p>
+
+<ul>
+ <li>
+ QVGA (240x320, low density, small screen)
+ </li>
+ <li>
+ WQVGA400 (240x400, low density, normal screen)
+ </li>
+ <li>
+ WQVGA432 (240x432, low density, normal screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ WVGA800 (480x800, high density, normal screen)
+ </li>
+ <li>
+ WVGA854 (480x854 high density, normal screen)
+ </li>
+ <li>
+ WXGA720 (1280x720, extra-high density, normal screen)
+ </li>
+ <li>
+ WSVGA (1024x600, medium density, large screen)
+ </li>
+ <li>
+ WXGA (1280x800, medium density, xlarge screen)
+ </li>
+</ul>
+
+<p>To test your application on an emulator that represents the latest Android device, you can create
+an AVD with the new WXGA720 skin (it's an xhdpi, normal screen device). Note that the emulator
+currently doesn't support the new on-screen navigation bar for devices without hardware navigation
+buttons, so when using this skin, you must use keyboard keys <em>Home</em> for the Home button,
+<em>ESC</em> for the Back button, and <em>F2</em> or <em>Page-up</em> for the Menu button.</p>
+
+<p>However, due to performance issues in the emulator when running high-resolution screens such as
+the one for the WXGA720 skin, we recommend that you primarily use the traditional WVGA800 skin
+(hdpi, normal screen) to test your application.</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h2 id="4.0">Android 4.0</h2>
+
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android 4.0, Revision 2</a> <em>(December 2011)</em>
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em;">
+ <p>Maintenance update. The system version is 4.0.2.</p>
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>SDK Tools r14 or higher is required.</dd>
+ </dl>
+ </div>
+</div>
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android 4.0, Revision 1</a> <em>(October 2011)</em>
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em;">
+ <p>Initial release. The system version is 4.0.1.</p>
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>SDK Tools r14 or higher is required.</dd>
+ </dl>
+ </div>
+</div>
+
+
+<h3>Emulator Skins</h3>
+
+<p>The downloadable platform includes the following emulator skins:</p>
+
+<ul>
+ <li>
+ QVGA (240x320, low density, small screen)
+ </li>
+ <li>
+ WQVGA400 (240x400, low density, normal screen)
+ </li>
+ <li>
+ WQVGA432 (240x432, low density, normal screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ WVGA800 (480x800, high density, normal screen)
+ </li>
+ <li>
+ WVGA854 (480x854 high density, normal screen)
+ </li>
+ <li>
+ WXGA720 (1280x720, extra-high density, normal screen) <span class="new">new</span>
+ </li>
+ <li>
+ WSVGA (1024x600, medium density, large screen) <span class="new">new</span>
+ </li>
+ <li>
+ WXGA (1280x800, medium density, xlarge screen)
+ </li>
+</ul>
+
+<p>To test your application on an emulator that represents the latest Android device, you can create
+an AVD with the new WXGA720 skin (it's an xhdpi, normal screen device). Note that the emulator
+currently doesn't support the new on-screen navigation bar for devices without hardware navigation
+buttons, so when using this skin, you must use keyboard keys <em>Home</em> for the Home button,
+<em>ESC</em> for the Back button, and <em>F2</em> or <em>Page-up</em> for the Menu button.</p>
+
+<p>However, due to performance issues in the emulator when running high-resolution screens such as
+the one for the WXGA720 skin, we recommend that you primarily use the traditional WVGA800 skin
+(hdpi, normal screen) to test your application.</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h2 id="3.2">Android 3.2</h2>
+
+
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android 3.2, Revision 1</a> <em>(July 2011)</em>
+ </a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em;">
+
+<dl>
+<dt>Initial release. SDK Tools r12 or higher is recommended.</dt>
+</dl>
+
+ </div>
+</div>
+
+
+
+
+<h3>Emulator Skins</h3>
+
+<p>The downloadable platform includes the following emulator skin:</p>
+
+<ul>
+ <li>
+ WXGA (1280x800, medium density, xlarge screen)
+ </li>
+</ul>
+
+<p>For more information about how to develop an application that displays
+and functions properly on all Android-powered devices, see <a
+href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
+Screens</a>.</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h2 id="3.1">Android 3.1</h2>
+
+
+<div class="toggle-content closed">
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android 3.1, Revision 3</a> <em>(July 2011)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r12</a> or
+higher.</p>
+</dd>
+<dt>Notes:</dt>
+<dd>
+<p>Improvements to the platform's rendering library to support the visual layout editor in the ADT
+Eclipse plugin. This revision allows for more drawing features in ADT and fixes several
+bugs in the previous rendering library. It also unlocks several editor features that were added in
+ADT 12.</p>
+</dd>
+</dl>
+
+</div>
+</div>
+
+
+<div class="toggle-content closed" >
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android 3.1, Revision 2</a> <em>(May 2011)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r11</a> or
+higher.</p>
+</dd>
+<dt>Notes:</dt>
+<dd>
+<p>Fixes an issue with the visual layout editor rendering library that prevented Android 3.1 from
+running in ADT.</p>
+</dd>
+</dl>
+
+</div>
+</div>
+
+
+<div class="toggle-content closed">
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android 3.1, Revision 1</a> <em>(May 2011)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r11</a> or
+higher.</p>
+</dd>
+</dl>
+
+</div>
+</div>
+
+
+<h3>Emulator Skins</h3>
+
+<p>The downloadable platform includes the following emulator skin:</p>
+
+<ul>
+ <li>
+ WXGA (1280x800, medium density, xlarge screen)
+ </li>
+</ul>
+
+<p>For more information about how to develop an application that displays
+and functions properly on all Android-powered devices, see <a
+href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
+Screens</a>.</p>
+
+
+
+
+
+
+
+
+
+
+
+<h2 id="3.0">Android 3.0</h2>
+
+
+<div class="toggle-content closed" >
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android 3.0, Revision 2</a> <em>(July 2011)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r12</a> or
+higher.</p>
+</dd>
+<dt>Notes:</dt>
+<dd>
+<p>Improvements to the platform's rendering library to support the visual layout editor in the ADT
+Eclipse plugin. This revision allows for more drawing features in ADT and fixes several
+bugs in the previous rendering library. It also unlocks several editor features that were added in
+ADT 12.</p>
+</dd>
+</dl>
+
+</div>
+</div>
+
+<div class="toggle-content closed">
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />
+ Android 3.0, Revision 1</a> <em>(February 2011)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r10</a> or higher.</p>
+</dd>
+</dl>
+
+</div>
+</div>
+
+
+
+<h3>Emulator Skins</h3>
+
+<p>The downloadable platform includes the following emulator skin:</p>
+
+<ul>
+ <li>
+ WXGA (1280x800, medium density, xlarge screen)
+ </li>
+</ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h2 id="2.3.4">Android 2.3.4</h2>
+
+
+
+<p>The sections below provide notes about successive releases of
+the Android 2.3.4 platform component for the Android SDK, as denoted by
+revision number. To determine what revision(s) of the Android
+2.3.4 platforms are installed in your SDK environment, refer to
+the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
+
+<div class="toggle-content closed" >
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />
+ Android 2.3.4, Revision 1</a> <em>(May 2011)</em>
+</a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em;">
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>
+ <p>Requires SDK Tools r11 or higher.</p>
+ </dd>
+ </dl>
+ </div>
+</div>
+
+
+<h3>Emulator Skins</h3>
+
+<p>The downloadable platform includes a set of emulator skins that you can use
+for modeling your application in different screen sizes and resolutions. The
+emulator skins are:</p>
+
+<ul>
+ <li>
+ QVGA (240x320, low density, small screen)
+ </li>
+ <li>
+ WQVGA400 (240x400, low density, normal screen)
+ </li>
+ <li>
+ WQVGA432 (240x432, low density, normal screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ WVGA800 (480x800, high density, normal screen)
+ </li>
+ <li>
+ WVGA854 (480x854 high density, normal screen)
+ </li>
+</ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h2 id="2.3.3">Android 2.3.3</h2>
+
+
+<div class="toggle-content closed" >
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android 2.3.3, Revision 2</a> <em>(July 2011)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r12</a> or
+higher.</p>
+</dd>
+<dt>Notes:</dt>
+<dd>
+<p>Improvements to the platform's rendering library to support the visual layout editor in the ADT
+Eclipse plugin. This revision allows for more drawing features in ADT and fixes several
+bugs in the previous rendering library. It also unlocks several editor features that were added in
+ADT 12.</p>
+</dd>
+</dl>
+
+</div>
+</div>
+
+<div class="toggle-content closed" >
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android 2.3.3, Revision 1</a> <em>(February 2011)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires SDK Tools r9 or higher.</p>
+</dd>
+</dl>
+
+</div>
+</div>
+
+
+<h3>Emulator Skins</h3>
+
+<p>The downloadable platform includes a set of emulator skins that you can use
+for modeling your application in different screen sizes and resolutions. The
+emulator skins are:</p>
+
+<ul>
+ <li>
+ QVGA (240x320, low density, small screen)
+ </li>
+ <li>
+ WQVGA400 (240x400, low density, normal screen)
+ </li>
+ <li>
+ WQVGA432 (240x432, low density, normal screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ WVGA800 (480x800, high density, normal screen)
+ </li>
+ <li>
+ WVGA854 (480x854 high density, normal screen)
+ </li>
+</ul>
+
+
+
+
+
+
+
+
+
+
+
+
+<h2 id="2.3">Android 2.3</h2>
+
+
+
+<p>The sections below provide notes about successive releases of
+the Android 2.3 platform component for the Android SDK, as denoted by
+revision number. To determine what revision(s) of the Android
+2.3 platforms are installed in your SDK environment, refer to
+the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
+
+
+<div class="toggle-content closed" >
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />
+ Android 2.3, Revision 1</a> <em>(December 2010)</em>
+</a></p>
+
+ <div class="toggle-content-toggleme" style="padding-left:2em;">
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>
+ <p>Requires SDK Tools r8 or higher.</p>
+ </dd>
+ </dl>
+ </div>
+</div>
+
+
+<h3>Emulator Skins</h3>
+
+<p>The downloadable platform includes a set of emulator skins that you can use
+for modeling your application in different screen sizes and resolutions. The
+emulator skins are:</p>
+
+<ul>
+ <li>
+ QVGA (240x320, low density, small screen)
+ </li>
+ <li>
+ WQVGA400 (240x400, low density, normal screen)
+ </li>
+ <li>
+ WQVGA432 (240x432, low density, normal screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ WVGA800 (480x800, high density, normal screen)
+ </li>
+ <li>
+ WVGA854 (480x854 high density, normal screen)
+ </li>
+</ul>
+
+
+
+
+
+
+
+
+
+<h2 id="2.2">Android 2.2</h2>
+
+
+<div class="toggle-content closed" >
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android {@sdkPlatformVersion}, Revision 3</a> <em>(July 2011)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r12</a> or
+higher.</p>
+</dd>
+<dt>Notes:</dt>
+<dd>
+<p>Improvements to the platform's rendering library to support the visual layout editor in the ADT
+Eclipse plugin. This revision allows for more drawing features in ADT and fixes several
+bugs in the previous rendering library. It also unlocks several editor features that were added in
+ADT 12.</p>
+</dd>
+</dl>
+
+</div>
+</div>
+
+<div class="toggle-content closed" >
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android {@sdkPlatformVersion}, Revision 2</a> <em>(July 2010)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires SDK Tools r6 or higher.</p>
+</dd>
+
+<dt>System Image:</dt>
+<dd>
+<ul>
+<li>Adds default Search Widget.</li>
+<li>Includes proper provisioning for the platform's Backup Manager. For more information about how
+to use the Backup Manager, see <a href="{@docRoot}guide/topics/data/backup.html">Data
+Backup</a>.</li>
+<li>Updates the Android 2.2 system image to FRF91.</li>
+</ul>
+</dd>
+
+</dl>
+ </div>
+</div>
+
+<div class="toggle-content closed">
+
+<p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
+class="toggle-content-img" alt="" />
+ Android {@sdkPlatformVersion}, Revision 1</a> <em>(May 2010)</em>
+</a></p>
+
+<div class="toggle-content-toggleme" style="padding-left:2em;">
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>Requires SDK Tools r6 or higher.</p>
+</dd>
+
+<dt>Tools:</dt>
+<dd>
+<p>Adds support for building with Android library projects. See <a href="tools-notes.html">SDK
+Tools, r6</a> for information.</p>
+</dd>
+
+</dl>
+ </div>
+</div>
+
+
+<h3>Emulator Skins</h3>
+
+<p>The downloadable platform includes a set of emulator skins that you can use
+for modeling your application in different screen sizes and resolutions. The
+emulator skins are:</p>
+
+<ul>
+ <li>
+ QVGA (240x320, low density, small screen)
+ </li>
+ <li>
+ WQVGA (240x400, low density, normal screen)
+ </li>
+ <li>
+ FWQVGA (240x432, low density, normal screen)
+ </li>
+ <li>
+ HVGA (320x480, medium density, normal screen)
+ </li>
+ <li>
+ WVGA800 (480x800, high density, normal screen)
+ </li>
+ <li>
+ WVGA854 (480x854 high density, normal screen)
+ </li>
+</ul>
\ No newline at end of file
diff --git a/docs/html/tools/samples/index.jd b/docs/html/tools/samples/index.jd
new file mode 100644
index 0000000..5c0e8db
--- /dev/null
+++ b/docs/html/tools/samples/index.jd
@@ -0,0 +1,31 @@
+page.title=Samples
+
+@jd:body
+
+<p>To help you understand some fundamental Android APIs and coding practices, a variety of sample
+code is available from the Android SDK Manager.</p>
+
+<p>To download the samples:</p>
+<ol>
+ <li>Launch the Android SDK Manager.
+ <ul>
+ <li>On Windows, double-click the SDK Manager.exe file at the root of the Android SDK
+directory.</li>
+ <li>On Mac or Linux, open a terminal to the {@code tools/} directory in the
+Android SDK, then execute {@code android sdk}.</ul>
+ </li>
+ <li>Expand the list of packages for the latest Android platform.</li>
+ <li>Select and download <em>Samples for SDK</em>.</li>
+</ol>
+
+<p>When the download is complete, you can find the samples sources at this location:</p>
+
+<p style="margin-left:2em">
+<code><em><sdk></em>/platforms/<android-version>/samples/</code>
+</p>
+
+<p>You can easily create new Android projects with the downloaded samples, modify them
+if you'd like, and then run them on an emulator or device. </p>
+<!--
+<p>Below are summaries for several of the available samples.</p>
+-->
\ No newline at end of file
diff --git a/docs/html/tools/sdk/OLD_RELEASENOTES.jd b/docs/html/tools/sdk/OLD_RELEASENOTES.jd
new file mode 100644
index 0000000..6865db2
--- /dev/null
+++ b/docs/html/tools/sdk/OLD_RELEASENOTES.jd
@@ -0,0 +1,527 @@
+page.title=Release Notes for Older SDK Versions
+@jd:body
+
+<div class="special">
+ <p><strong>Note:</strong> These are the release notes for the "early-look" SDK versions, released
+ before the full Android 1.0 release in September 2008.
+ Release notes for the Android 1.0 and later SDK versions are provided in the main
+ <a href="{@docRoot}sdk/RELEASENOTES.html">Release Notes</a> document.</p>
+</div>
+
+
+
+<a name="0.9_r1" id="0.9_r1"></a>
+<h2>Android 0.9 SDK Beta (r1)</h2>
+
+<p>This beta SDK release contains a large number of bug fixes and improvements from the early-look SDKs.
+The sections below describe the highlights of the release.
+
+<h3>New Features and Notable Changes</h3>
+
+<p><strong>Behavior and System Changes</strong></p>
+<ul>
+ <li>New Home screen and many user interface updates
+ </li>
+ <li>Minor changes to Activity lifecycle and task management
+ </li>
+ <li>New window option to request OpenGL acceleration for certain kinds of View structures
+ </li>
+</ul>
+<p>
+ <b>
+ Significant API Changes</b>
+</p>
+<ul>
+ <li>onFreeze(Bundle) renamed to onSaveInstanceState(Bundle), to better reflect the fact that it does not represent an actual change in application lifecycle
+ </li>
+ <li>IntentReceivers are now known as BroadcastReceivers (but still operate on Intents.)
+ </li>
+ <li>Various parts of the API cleaned up to use Intents instead of Bundles; Intent itself improved to reduce the need for separate payload Bundles.</li>
+ <li>ContentProvider Cursors have had significant changes to make them easier to create and remove certain data consistency bugs.
+ </li>
+ <li>Changes to menus to make them more flexible; also added context menus (similar to "right mouse button" menus)
+ </li>
+ <li>Changes to the Sensor API to make reading sensors more convenient and reduce the need to poll
+ </li>
+ <li>Improvements to the Camera API
+ </li>
+ <li>Significant changes to the Location API to make it easier to use and better self-documenting
+ </li>
+ <li>API cleanup on MapViews
+ </li>
+ <li>Performance-related changes to the MediaPlayer, as well as support for new types of ringtones
+ </li>
+ <li>Apache HTTPClient installation upgraded to 4.x of that API; 3.x version is removed
+ </li>
+ <li>HTTPClient 4.x removes multipart methods, include HttpMime which is an extension of Mime4j (http://james.apache.org/mime4j/index.html) in your project instead
+ </li>
+ <li>Improvements to WiFi and related networking
+ </li>
+ <li>New Preferences API to easily store small amounts of data
+ </li>
+ <li>Improvements to the Telephony API, including ability to obtain source number of incoming phone calls
+ </li>
+ <li>Variety of improvements to the View API
+ </li>
+ <li>Variety of improvements to component management, such as the ability to keep components private, better control over when processes are started, and ability to "alias" an Activity to more than one entry in AndroidManifest.xml
+ </li>
+ <li>Improvements to how the Browser and WebView, such as better control over content downloads
+ </li>
+ <li>A number of enhancements to XML layouts, such as the new <merge> tag
+ </li>
+ <li>Numerous improvements to the standard widgets
+ </li>
+ <li>Network access now requires that applications obtain a permission in their AndroidManifest.xml files.
+ </li>
+</ul>
+<p>
+ <b>
+ Maps & Location</b>
+</p>
+<ul>
+ <li>The MapView will require an API key on final Android 1.0 devices. This key can be obtained at no cost from Google, and will allow access to the full MapView API. In this release, the API key must be provided but can be any dummy value. In the final 1.0-compatible SDKs, this will need to be a real key.
+ </li>
+ <li>The KML-based mock location provider supported in previous releases is no longer supported. In the current SDK, you can use the emulator console to send GPS fix updates to the emulator and applications running on it. Also, the DDMS tool provides an UI that you can use to easily upload GPX and KML files. DDMS handles playback of the KML or GPX tracks automatically. </li>
+</ul>
+<p>
+ <b>ADT Plugin for Eclipse</b></p>
+ <p>The ADT Plugin that accompanies this SDK includes a preview of the Graphical Layout Editor. Files located in <project>/res/layout[-qualifiers]/ will be opened with the new layout editor. This is very much a work in progress, and provided here for preview purpose. The editor feature is subject to change.
+</p>
+<ul>
+ <li>Dual page editor with a WYSIWYG page (the graphical editor) and an XML page with content assist.
+ </li>
+ <li>The interactivity in the editor itself is limited to selection at the moment. Actions on the layout elements can be done from the following standard Eclipse views: Outline (add/remove/up/down), and Properties (editing of all the element properties with a tooltip in the status bar).
+ </li>
+ <li>Top part of the editor allows you to display the layout in different configurations (language, orientation, size, etc...), and different themes.
+
+ <ul>
+ <li>All referenced resources (strings, bitmaps, etc...) are resolved based on the selected configuration/theme.
+ </li>
+ <li>A green check mark next to a resource qualifier indicates that the opened file matches the value of the qualifier. A warning sign indicates that the opened file does not specifies any value for this qualifier.
+ </li>
+ <li>If a different version of the opened layout matches the new configuration selection (in a different res/layout-qualifier folder) then the editor automatically switches to that new file.
+ </li>
+ </ul>
+ </li>
+ <li>Custom Views are supported, however if they do too much in their constructor/onDraw method, it may not work (the layout library used by the editor only includes a sub-part of the Android framework). Check the android console for errors/exceptions.
+ </li>
+</ul>
+
+<p>Known issues/limitations for Graphical Layout Editor include:</p>
+
+ <ul>
+ <li>Font display is very close but not equals to on-device rendering since the font engine in Java slightly differs from the font engine in Android. This should not have any impact on your layouts.
+ </li>
+ <li>Creating new views in a relative layout automatically puts each new elements below each other using the <i>layout_below</i> attribute. However, until the layout file is saved, they will appear stacked on top of each other.
+ </li>
+ <li>Some XML based drawables don't draw. Fading in the scroll/list view appears as a white rectangle. Generally do not expect every single fancy drawing feature of the android framework to be supported in the layout editor (but we're working on it).
+ </li>
+ <li>Themes defined in the project are not added to the theme drop-down.
+ </li>
+ <li>No animation support!
+ </li>
+ <li>No support for WebView, MapView and SurfaceView.
+ </li>
+ <li>No UI support for <merge>, <include>, <ViewStub> elements. You can add these elements to your manifest using the xml editor only.
+ </li>
+ <li>If a layout fails to render in a way that prevents the whole editor from opening, you can:
+
+ <ul>
+ <li>open that particular file in a different editor: right click the file in the package explorer and choose Open With... > XML editor
+ </li>
+ <li>completely disable the layout editor, by setting a system wide environment variable called ANDROID_DISABLE_LAYOUT to any value.
+ </li>
+ </ul>
+ <li>If a layout fails to render, check the android console (in the standard Eclipse Console view). Errors/Exceptions will be displayed in there.
+ </li>
+ </ul>
+ </li>
+</ul>
+<p>Other ADT features/notes include:</p>
+<ul>
+ <li>There is a new launch option for activity. You can choose to launch the default activity (finds an activity configured to show up in the home screen), or a specific activity, or none.</li>
+ <li>Normal Java resources (non Java files placed in package folders) are now properly packaged in the final package, and can be accessed through normal java API such as ClassLoader.getResourceAsStream()</li>
+ <li>Launch configuration now has an option to wipe emulator data on launch. This always asks for confirmation.</li>
+ <li>Launch configuration now has an option to disable the boot animation. This will let the emulator start faster on older computers.</li>
+ <li>Installation of application is now more robust and will notify of installation failure. Also installation is blocking, removing issues where ADT tried to launch the activity before the app was installed.</li>
+
+</ul>
+
+<p><b>Ant Build Tools</b></p>
+
+<ul>
+ <li><span>External jar libraries are now directly supported by build.xml, just drop them in the libs directory.</li>
+</ul>
+
+<p><b>Emulator</b></p>
+
+<ul>
+ <li>The console port number of a given emulator instance is now displayed in its window's title bar.</li>
+ <li>You can define the console port number used by a given emulator instance.
+To do so, start the instance with the '-port <port>' option and
+specify which port the emulator should bind to for the console. <port> must be an *even* integer between 5554 and 5584 inclusive. The corresponding ADB port will be <port>+1.</li>
+ <li>The <code>-adb-port</code> command is deprecated. Please do not use it, as it will be removed soon and you cannot use both -port and -adb-port at the same time.</li>
+ <li>Voice/sms are automatically forwarded to other emulator instances running on the same machine, as long as you use their console port number as the destination phone number. For example, if you have two emulators running, the first one will typically use console port 5554, and the second one will use port 5556, dialing 5556 on the first emulator will generate an incoming call on the second emulator. You can also hold/unhold calls. This also works when sending SMS messages from one emulator to the other.</li>
+ <li>A new <code>-scale <fraction></code> option allows you to scale the emulator window. </li>
+ <li>A new <code>-no-boot-anim</code> option tells the emulator to disable the boot animation. On slower systems, this can significantly reduce the time to boot the system in the emulator.</li>
+
+</ul>
+
+<p>
+ <b>Other Development Tools</b>
+</p>
+
+<p>The SDK includes several new development tools, such as</p>
+<ul>
+ <li><a href="{@docRoot}tools/help/hierarchy-viewer.html">HierarchyViewer</a> is a visual tool for inspecting and debugging your user interfaces and layout. </li>
+ <li><a href="{@docRoot}tools/help/draw9patch.html">Draw 9-patch</a> allows you to easily create a NinePatch graphic using a WYSIWYG editor. </li>
+ <li>The <a href="{@docRoot}tools/help/monkey.html">UI/Application Exerciser Monkey</a> generates pseudo-random system and user events, for testing your application. </li>
+</ul>
+<p>
+ <b>Application Signing</b>
+</p>
+<ul>
+ <li>Starting with this release, Android .apk files must be cryptographically signed, or the system will reject them upon installation. The purpose of this requirement is to securely and uniquely identify developers, so that the system can -- for example -- safely let multiple .apk files signed by the same developer share resources.
+ </li>
+ <li>There are no requirements on the key used to sign .apk files; locally-generated and self-signed keys are allowed. There is no PKI, and developers will not be required to purchase certificates, or similar. For developers who use the Eclipse/ADT plugin, application signing will be largely automatic. Developers who do not use Eclipse/ADT can use the standard Java jarsigner tool to sign .apk files.
+ </li>
+</ul>
+<p>
+ <b>Sample Code</b>
+</p>
+<ul>
+ <li>LunarLander has been converted to render into a SurfaceView via a background Thread, for better performance.
+ </li>
+ <li>New sample: the source code for the now-obsolete Home screen from M5 is included as an example of how to construct a Home screen replacement.
+ </li>
+</ul>
+<p>
+ <b>
+ Removed Functionality</b>
+</p>
+<ul>
+ <li>Due to significant API changes in the upstream open-source project and due to the timeline of getting certain Bluetooth profile implementations certified, a comprehensive Bluetooth API will not be possible or present in Android 1.0.
+ </li>
+ <li>Due to the security risks inherent in accepting arbitrary data from "outside" the device, the data messaging facility of the GTalkService will not be present in Android 1.0. The GTalkService will provide connectivity to Google's servers for Google Talk instant messaging, but the API has been removed from this release while we improve the service. Note that this will be a Google-specific service and is not part of the core of Android.
+ </li>
+ <li>We know that these changes will affect many developers who have worked with the prior early looks at the SDK, and we are very sorry for the resulting inconvenience. We look forward to the possibilty of restoring some or all of this functionality in a later version of the Android platform.
+ </li>
+</ul>
+<p>
+ <b>
+ Miscellaneous</b>
+</p>
+<ul>
+ <li>Many internal and non-public APIs have been removed from the documentation. Classes and methods that are not present in the documentation are non-public and should not be used, even though they may appear in tools such as IDEs. A future version of the SDK will ship with an android.jar file that contains only public classes, to help developers avoid accidentally using non-public APIs.
+ </li>
+ <li>A few extraneous APIs (such as unnecessary packages under java.awt) have been removed.
+ </li>
+ <li>Several additional tools are included, such as a utility for easily drawing 9-patch images.
+ </li>
+ <li>The DDMS utility has been refactored into library form. This is not of direct interest to application developers, but may be of interest to vendors interested in integrating the Android SDK into their products. Watch for more information about the ddmlib library soon.
+ </li>
+ <li>For performance and maintainability reasons, some APIs were moved into separate modules that must be explicitly included in the application via a directive in AndroidManifest.xml. Notable APIs that fall into this category are the MapView, and the java.awt.* classes, which each now reside in separate modules that must be imported. Developers who overlook this requirement will see ClassNotFoundExceptions that seem spurious.
+ </li>
+ <li>Developers who use 'adb push' to install applications must now use 'adb install', since the full package manager is now implemented. 'adb push' will no longer work to install .apk files.
+ </li>
+ <li>The emulator supports a variety of new options, and some existing options have been changed. Please consult the updated emulator documentation for details.
+ </li>
+</ul>
+
+<h3>
+ Resolved Issues
+</h3>
+<p>
+ The list below is not comprehensive, but instead highlights the most interesting fixes since the last SDK release.
+</p>
+<ul>
+ <li>More of the standard Android user applications are now included, such as the Music and Messaging applications.
+ </li>
+ <li>Many bug fixes to the Media Player
+ </li>
+ <li>Emulator performance is improved, especially for startup
+ </li>
+ <li>More internal APIs are removed from class documentation. (However, this work is not quite yet complete.)
+ </li>
+ <li>It's now much easier to add media content to the SD card and have the ContentProvider locate and expose it to other applications.
+ </li>
+</ul>
+
+<h3>
+ Known Issues
+</h3>
+<ul>
+ <li>The final set of Intent patterns honored by Android 1.0 has not yet been fully documented. Documentation will be provided in future releases.
+ </li>
+ <li>We regret to inform developers that Android 1.0 will not support 3.5" floppy disks.
+ </li>
+ <li>Unfortunately, the ability to play audio streams from memory (such as via an InputStream or Reader) will not be possible in Android 1.0. As a workaround, we recommend that developers save media content to SD card and use MediaPlayer to play from a file URI, or embed a small HTTP server and play from a URI on localhost (such as http://127.0.0.1:4242/something).
+ </li>
+ <li>Android now supports modules or libraries that can be optionally linked into applications; a good example is the MapView, which has been moved into such a library. However, Android 1.0 will not support the ability for third-party developers to create such libraries for sharing with other applications.
+ </li>
+ <li>We believe that we have eliminated the problem with very long emulator startups on Windows, but had some trouble reproducing the issue. We are interested in feedback from developers, if this issue persists.
+ </li>
+</ul>
+
+
+
+
+<a name="m5-rc15"></a>
+<h2>Version m5-rc15</h2>
+
+<h3>New Features</h3>
+<p>m5-rc15 does not introduce any new features.</p>
+
+<h3>Resolved Issues</h3>
+<ul>
+ <li>1012640: Incorrect handling of BMP images.</li>
+</ul>
+
+<h3>Known Issues</h3>
+<p>Unless otherwise noted, Known Issues from m5-rc14 also apply to m5-rc15.</p>
+
+
+
+
+<a name="m5-rc14"></a>
+<h2>Version m5-rc14</h2>
+
+<h3>New Features</h3>
+
+<p>In addition to changes in the Android APIs, m5-rc14 also introduces changes to the Android Developer Tools:</p>
+
+<h4>emulator</h4>
+<ul>
+ <li>The Android emulator now support SD card images up to 128 GB in size. The previous limit was 2 GB.</li>
+</ul>
+
+<h4>DDMS</h4>
+<ul>
+ <li>Support for managing multiple devices has been integrated into DDMS. This should make it easier to debug applications that are run on multiple device scenarios.</li>
+</ul>
+
+<h4>ADT</h4>
+<ul>
+ <li>ADT now attempts to connect a debugger to any application that shows up
+ in the wait-for-debugger state, even if this application was not launched
+ from Eclipse.
+ <br /><br />
+ The connection is actually established only if there exists a project
+ in the Eclipse workspace that contains an <code>AndroidManifest.xml</code>
+ declaring a package matching the name of the process.
+ To force this connection from your code, use <code>Debug.waitForDebugger()</code>. Activities declaring that they require their own process through the
+ "process" attribute with a value like ":someProcess" will be
+ recognized and a debugger will be connected accordingly.
+ This should make it easier to debug intent receivers, services,
+ providers, and other activities not launched from the standard app
+ launcher.<br /><br /></li>
+ <li>ADT has launch modes for device target selection. Automatic mode will: 1) launch an emulator if no device is present, 2) automatically target the device if only one is connected, and 3) prompt the user if 2 or more are connected. Manual mode will always prompt the user.<br /><br /></li>
+ <li>ADT also contains the same support for multiple devices that has been introduced into DDMS.</li>
+</ul>
+
+<h4>AIDL</h4>
+<ul>
+ <li>AIDL files that import and reuse types is now supported by activityCreator.py and ADT.</li>
+</ul>
+
+<h4>traceview</h4>
+<ul>
+ <li>The <a href="{@docRoot}tools/help/traceview.html">traceview</a> tool is now included in the SDK.</li>
+</ul>
+
+<h3>Resolved Issues</h3>
+
+<p>The following Known Issues from m3-rc20 have been resolved:</p>
+<ul>
+ <li>917572: The activityCreator created incorrect IntelliJ scripts</li>
+ <li>917465: Unanswered incoming calls placed from the emulator console will result in an unfinished call UI if you press the call back button</li>
+ <li>917247: dmtracedump and traceview tools are not available in the SDK</li>
+ <li>912168: Extremely rapid or prolonged scrolling in the Maps application or MapsView will result in application errors</li>
+ <li>905852: adb emits warnings about deprecated API use on Mac OS X 10.5</li>
+ <li>905242: The Run dialog sometimes failed to show the Android Launcher</li>
+ <li>901122: The focus ring in the browser is sometimes incorrect</li>
+ <li>896274: On Windows, the emulator sometimes starts off-screen</li>
+ <li>778432: Icons for newly installed applications do not display</li>
+</ul>
+
+<h3>Known Issues</h3>
+
+<p>The following are known issues in m5-rc14:</p>
+
+<ul>
+ <li>1017312: The emulator window size has been reduced slightly, to allow it to be fully visible on smaller screens. This causes a slight clipping of the HVGA emulator skin but does not affect its function.</li>
+ <li>1021777: Setting a power requirement in a <code>Criteria</code> object passed to <code>{@link android.location.LocationManager#getBestProvider getBestProvider()}</code> will result in a value not being returned.</li>
+ <li>1025850: Emulator failing to launch from the Eclipse plugin due to wrong custom command line parameters do not report the error anywhere and silently fails.</li>
+</ul>
+
+<p>Unless otherwise noted, Known Issues from m3-rc20a also apply to m5-rc14.</p>
+
+
+
+
+<a name="m3-rc37a"></a>
+<h2>Version m3-rc37a</h2>
+
+<p>Version m3-rc37a and ADT 0.3.3 were released on December 14, 2007.</p>
+
+<h3>New Features</h3>
+
+<h4>Android Debug Bridge (ADB)</h4>
+<ul>
+<li>Now supports multiple emulators on one host computer. Please note that you need to use the <code>-data</code> option when starting secondary emulators, to allow those instances to save their data across sessions. Also, DDMS does not yet support debugging on multiple emulators yet. </li>
+</ul>
+
+<h4>ADT Plugin for Eclipse</h4>
+<ul>
+<li>Adds editor capabilities for working with Android manifest files, such as syntax highlighting and autocompletion. The editor capabilities require the Web Tools WST plugin for Eclipse, which is included in <a href="http://www.eclipse.org/downloads/moreinfo/compare.php">most Eclipse packages</a>. Not having WST does not prevent the ADT plugin from working. If necessary, you can download and install WST from the Web Tools Project <a href="http://download.eclipse.org/webtools/downloads">downloads page</a>. To update directly from an Eclipse installation, you can add a remote update site with this URL: http://download.eclipse.org/webtools/updates . Note that installing WST on Eclipse 3.4 will require installing other packages, as detailed on the WTP downloads page</a>.
+</li>
+<li>Now retries to launch the app on the emulator if it fails due to timing issues when the emulator is booting.</li>
+<li>Adds support for loading custom skins from the <SDK>/lib/images/skins/ directory. The Skin dropdown in the Emulator tab is now built from the content of the skins/ directory in order to support developer-made skins.</li>
+<li>Adds an Emulator control panel. This is a UI on top of the emulator console that allows you to change the state of the network and gsm connection, and to initiate incoming voice call. (This is also present in standalone DDMS.)</li>
+<li>Adds support for referenced projects. Android projects will add to the apk package any code from referenced projects.</li>
+<li>Eclipse console now warns if an .apk that is pushed to the device declares the same package as another already installed package.</li>
+<li>Java classes generated by the Eclipse plugin are now marked as derived automatically, so that Team plugins do not consider them as regular source.</li>
+</ul>
+
+<h4>Emulator Console</h4>
+<ul>
+<li>Now provides support for emulating inbound SMS messages. The ADT plugin and DDMS provide integrated access to
+this capability. For more information about how to emulate inbound SMS from the console,
+see <a href="{@docRoot}tools/help/emulator.html#sms">SMS Emulation</a>. </li>
+</ul>
+
+<h4>Emulator</h4>
+<ul><li>The default emulator skin has been changed to HVGA-P from QVGA-L. For information
+about emulator skins and how to load a specific skin when starting the emulator, see
+<a href="{@docRoot}tools/help/emulator.html#skins">Using Emulator Skins</a>.</li>
+</ul>
+
+<h3>Resolved Issues</h3>
+
+<h4>907947</h4>
+<p><code>adb -version</code> now returns a version number.</p>
+
+<h4>917462</h4>
+<p>Audio on Windows is fixed and is no longer 'choppy'. </p>
+
+<h4>Removed Manifest File Locking on Mac OS X</h4>
+
+<p>ADT plugin now uses a custom java editor for R.java/Manifest.java, to make those files non-editable. This is to replace the current locking mechanism which causes issues on Mac OS (preventing projects from being deleted). Note that your project must recompile at least once for the lock to be removed from the files.</p>
+
+<h4>The following known issues noted in m3-rc20 are now fixed:</h4>
+<p>
+<ul>
+<li>890937: Emulator does not support non-qwerty keyboards.
+<li>894618: <code>adb shell</code> may fail to connect when used the first time.
+<li>896274: On Windows, the emulator window may start off-screen.
+<li>899949: The emulator may fail to start with <code>-useaudio</code> on some environments.
+<li>912619: Emulator console listens on non-local ports 5554-5584.
+<li>917399: On Windows, running multiple emulator consoles can result in unexpected behavior when simulating incoming telephone calls.
+</ul>
+</p>
+
+<h3>Known Issues</h3>
+
+<p>Unless otherwise noted, Known Issues from m3-rc22a also apply to m3-rc37a.</p>
+
+
+
+
+<a name="m3-rc22a"></a>
+<h2>Version m3-rc22a</h2>
+
+<p>Version m3-rc22a and ADT 0.3.1 were released on November 16, 2007.</p>
+
+<h3>Resolved Issues</h3>
+
+<h4>920067</h4>
+<p>The New Android Project wizard provided by ADT 0.3.1 now properly displays error messages when used with Eclipse 3.2 on Windows.</p>
+
+<h4>920045</h4>
+<p>The <code>AndroidManifest.xml</code> files generated by ADT 0.3.1 now include the XML element required for displaying the associated app in the "Applications" menu. If you have applications created with ADT 0.3.0, simply ensure that your <code>AndroidManifest.xml</code> file contains the following highlighted line:</p>
+<pre>
+...
+ <intent-filter>
+ <action android:value="android.intent.action.MAIN" />
+ <strong><category android:value="android.intent.category.LAUNCHER" /></strong>
+ </intent-filter>
+...
+</pre>
+
+<h4>920098</h4>
+<p>ADT 0.3.1 is now compatible with Eclipse 3.4.</p>
+
+<h4>920282</h4>
+<p>Fixes a NullPointerException that is thrown in certain situations with the DDMS perspective in Eclipse.</p>
+
+<h4>918637</h4>
+<p>Address a keyboard lock-up issue when using <code>adb</code> on Mac OS X 10.4 and 10.5.</p>
+
+<h3>Known Issues</h3>
+
+<p>Unless otherwise noted, known issues from m3-rc20a also apply to m3-rc22a.</p>
+
+<a name="m3-rc20a"></a>
+
+<h2>Version m3-rc20a</h2>
+<h3>Known Issues</h3>
+
+<p>The following are known issues in m3-rc20a:</p>
+
+<h4>778432 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m5-rc14">m5</a></span></h4>
+<p>In certain circumstances, icons for newly installed applications do not display as expected.</p>
+
+<h4>890937 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m3-rc37a">m3-rc37a</a></span></h4>
+<p>The emulator currently does not support non-QWERTY keyboards.</p>
+
+<h4>894618 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m3-rc37a">m3-rc37a</a></span></h4>
+<p>The adb shell command may fail to connect when used for the first time.</p>
+
+<h4>896274 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m5-rc14">m5</a></span></h4>
+<p>On Windows, the emulator screen will sometimes show up off-screen when it is started. The workaround for this is to right-click on the emulator taskbar entry, select Move, and move the window using keyboard arrow keys</p>
+
+<h4>899949 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m3-rc37a">m3-rc37a</a></span></h4>
+<p>The emulator may fail to start when using the <code>-useaudio</code> in some environments</p>
+
+<h4>901122 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m5-rc14">m5</a></span></h4>
+<p>The focus ring shown in the browser may sometimes not properly wrap links.</p>
+
+<h4>905242 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m5-rc14">m5</a></span></h4>
+<p>On Mac OS X 10.5, the Eclipse plugin's Run Dialog may sometimes fail to show the option to select the Android Launcher.</p>
+
+<h4>905852 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m5-rc14">m5</a></span></h4>
+<p>On Mac OS X 10.5, adb will emit warnings about deprecated API use when first used.</p>
+
+<h4>912168 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m5-rc14">m5</a></span></h4>
+<p>extremely rapid or prolonged scrolling in the Maps application or in a MapView will result in application errors.</p>
+
+<h4>912619 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m3-rc37a">m3-rc37a</a></span></h4>
+<p>The emulator console listens for connections on ports 5554-5587. Future versions will only accept connections from localhost. It is recommend that you use a firewall to block external connections to those ports on your development machine.</p>
+
+<h4>912849</h4>
+<p>On Mac OS X 10.4, the emulator may hang if started in the background (i.e. <code>./emulator &</code>).</p>
+
+<h4>914692</h4>
+<p>On Mac OS X 10.5, the emulator will emit warnings about deprecated API use when started from the command line.</p>
+
+<h4>917247 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m5-rc14">m5</a></span></h4>
+<p>The dmtracedump and traceview tools are not available in the SDK.</p>
+
+<h4>917399 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m3-rc37a">m3-rc37a</a></span></h4>
+<p>On Windows, running multiple emulator consoles can result in unexpected behavior when simulating incoming telephone calls.</p>
+
+<h4>917465 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m5-rc14">m5</a></span></h4>
+<p>Unanswered incoming calls placed from the emulator console, will result in an unfinished call UI if you press the call back button.</p>
+
+<h4>917572 - <span style="font-weight: normal; font-size: 13px; font-style: italic">Resolved in <a href="#m5-rc14">m5</a></span></h4>
+<p>Using activityCreator with the <code>--ide intellij</code> option creates IntelliJ scripts with incorrect documentation location specified. To correct, change value for the <code><JAVADOC></code> element in the generated .ipr file from <code>file://.../docs/framework</code> to <code>file://.../docs/reference</code>.</p>
+
+<h4>917579</h4>
+<p>On Ubuntu 7.10 (Gusty), the Eclipse package installed by the <code>apt-get install eclipse</code> command uses java-gcj by default. This configuration is not compatible with the Android Eclipse plugin (ADT) and will result in "Class not found" errors whenever you access an ADT feature.</p>
+ <p>The resolution for this issue is to install a Sun JDK</p>
+ <pre>sudo update-java-alternatives --jre java-1.5.0-sun</pre>
+ <p>and then configure Eclipse to use it by exporting the following environment variable:</p>
+ <pre>export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun</pre>
+ <p>or by adding following to your <code>.eclipse/eclipserc file</code>:</p>
+ <pre>JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun</pre>
+
diff --git a/docs/html/tools/sdk/RELEASENOTES.jd b/docs/html/tools/sdk/RELEASENOTES.jd
new file mode 100644
index 0000000..c7ece42
--- /dev/null
+++ b/docs/html/tools/sdk/RELEASENOTES.jd
@@ -0,0 +1,803 @@
+page.title=SDK Release Notes
+@jd:body
+
+<p>This document provides version-specific information about Android SDK
+releases. <!--For the latest known issues, please ensure that you're viewing this
+page at <a
+href="http://developer.android.com/sdk/RELEASENOTES.html">http://developer.
+android.com/sdk/RELEASENOTES.html</a>.--></p>
+
+<h2 id="multiversion_r1">Android SDK</h2>
+
+<p>The Android SDK has changed! If you've worked with the Android SDK before,
+you will notice several important differences:</p>
+
+<ul>
+<li style="margin-top:.5em">The SDK downloadable package includes <em>only</em>
+the latest version of the Android SDK Tools.</li>
+<li>Once you've installed the SDK, you now use the Android SDK and AVD Manager
+to download all of the SDK components that you need, such as Android platforms,
+SDK add-ons, tools, and documentation. </li>
+<li>The new approach is modular — you can install only the components you
+need and update any or all components without affecting your development
+environment.</li>
+<li>In short, once you've installed the new SDK, you will not need to download
+an SDK package again. Instead, you will use the Android SDK and AVD Manager to
+keep your development environment up-to-date. </li>
+</ul>
+
+<p>Note that if you are currently using the Android 1.6 SDK, you do not
+necessarily need to install the new SDK, since your existing SDK already
+includes the Android SDK and AVD Manager tool. To develop against Android 2.0.1,
+for example, you could just download the Android 2.0.1 platform into your existing
+SDK. </p>
+
+<p>Release notes for Android platforms and other SDK components are
+now available from the "SDK" tab, under "Downloadable SDK Components."</p>
+
+<ul>
+<li>Notes for the Android 2.0.1 platform are in the <a
+href="{@docRoot}about/versions/android-2.0.1.html">Android 2.0.1, Release 1</a> document. </li>
+<li>You can find information about tools changes in the <a
+href="{@docRoot}tools/sdk/tools-notes.html#notes">SDK Tools</a> and <a
+href="{@docRoot}tools/sdk/eclipse-adt.html#notes">ADT Plugin for Eclipse</a>.</li>
+</ul>
+
+<p>To get started with the SDK, review the Quick Start summary on the <a
+href="{@docRoot}sdk/index.html">Android SDK download page</a> or read <a
+href="{@docRoot}sdk/installing/index.html">Installing the SDK</a> for detailed
+installation instructions. </p>
+
+
+<h2 id="1.6_r1">Android 1.6 SDK, Release 1</h2>
+
+<p>This SDK provides updates to the development tools and Android system that
+you use to create applications for compliant Android-powered devices. </p>
+
+<h3>Release Overview</h3>
+
+<p>This SDK release includes several new features for developers. Highlights of the
+changes include: </p>
+
+ <ul>
+ <li>Emulator support for multiple screen sizes/densities, including new
+skins. </li>
+ <li>Android SDK and AVD Manager, a graphical UI to let you manage your
+SDK and AVD environments more easily. The tool lets you create and manage
+your <a href="{@docRoot}tools/devices/managing-avds.html">Android Virtual
+Devices</a> and download new SDK packages (such as platform versions and
+add-ons) into your environment.</li>
+ <li>Improved support for test packages in New Project Wizard</li>
+ <li>The reference documentation now offers a "Filter by API Level"
+capability that lets you display only the parts of the API that are actually
+available to your application, based on the <code>android:minSdkVersion</code>
+value the application declares in its manifest. For more information, see
+<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">Android API Levels</a></li>
+ </ul>
+
+<p>For details about the Android platforms included in the SDK — including
+bug fixes, features, and API changes — please read the <a
+href="android-1.6.html">Android 1.6 version notes</a>.</p>
+
+<h3>Installation and Upgrade Notes</h3>
+
+<p>If you've been developing an application using an Android 1.1 SDK, you need
+to make a few changes to your development environment to migrate to the new SDK.
+Tools and documentation are provided to assist you. No changes to the source
+code of an existing application should be needed, provided that your application
+is not using Android internal structures or APIs.</p>
+
+<p>To ensure that your existing application will work properly on a device
+running the latest version of the Android platform, you are strongly encouraged
+to migrate the application to the new SDK, compile it using the platform
+matching the application's original API Level, and run it against the most
+current platform. </p>
+
+<h3>ADT Plugin for Eclipse</h3>
+
+<p>An updated version of the ADT Plugin for Eclipse is available with the
+Android 1.6 SDK. The new version, ADT 0.9.3, provides several new
+features, including integrated support for the Android SDK and AVD Manager
+and zipalign tool. In addition, the New Project Wizard now
+lets you create a test package containing tests for your application. These
+features are described in the sections below. </p>
+
+<p>If you are developing in Eclipse with ADT and want to get started with the
+Android 1.6 SDK, you should download and install a compatible version of the ADT
+Plugin (0.9.3 or higher). </p>
+
+<p>The new version of ADT is downloadable from the usual remote update site or
+is separately downloadable as a .zip archive. For instructions on how to
+download the plugin, please see <a
+href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin for Eclipse</a>. </p>
+
+<h3>Android SDK and AVD Manager</h3>
+
+<p>The SDK offers a new tool called Android SDK and AVD Manager that lets you
+manage your SDK and AVD environments more efficiently. </p>
+
+<p>Using the tool, you can quickly check what Android platforms, add-ons,
+extras, and documentation packages are available in your SDK environment, what
+their versions are, and whether updated versions are available. You can then
+download one or more items from remote repositories and install them directly in
+your SDK environment. For example, the tool lets you obtain updates to SDK tools
+incrementally, as they are made available, without having to wait for the next
+SDK release. You can also download Android platform versions into your
+environment that were not included in the SDK package.</p>
+
+<p>The tool also lets you quickly create new AVDs, manage
+their properties, and run a target AVD from a single window. </p>
+
+<p>If you are developing in Eclipse with ADT, you can access the Android SDK
+and AVD Manager from the <strong>Window</strong> menu. </p>
+
+<p>If you are developing in another IDE, you can access the Android SDK and
+AVD Manager through the <code>android</code> command-line tool, located in the
+<sdk>/tools directory. You can launch the tool with a graphical UI by
+using the <code>android</code> command without specifying any options. You can
+also simply double-click the android.bat (Windows) or android (OS X/Linux) file.
+You can still use <code>android</code> commands to create and manage AVDs,
+including AVDs with custom hardware configurations.</p>
+
+<h3>Integration with zipalign</h3>
+
+<p>The Android system offers a performance optimization for installed
+application packages whose contained uncompressed files are all aligned on
+4-byte boundaries. For these .apks, the system can read the files by mmap'ing
+the zip file, rather than by copying all the data out of them. This reduces
+the amount of memory used by the application at run time. The SDK includes
+a tool called <code>zipalign</code> that you can run against your .apks, to
+align them properly and enable them to benefit from this optimization.</p>
+
+<p>The ADT Plugin and the Ant build tools both provide integrated support for
+aligning your application packages. After you build an .apk, the SDK tools can
+sign and then run <code>zipalign</code> against it. The SDK includes the
+standalone version of the <code>zipalign</code> tool, so you can run also run it
+manually from the command line if you choose. </p>
+
+<ul>
+ <li>If you are developing in Eclipse with ADT, support for
+<code>zipalign</code> is integrated into the Export Wizard. When you use the
+Wizard to export a signed application package, ADT signs and then automatically
+runs <code>zipalign</code> against the exported package. If you use the Wizard
+to export an unsigned application package, then it will not zipalign the
+package because zipalign must be performed only after the APK has been signed.
+You must manually sign and zipalign the package after export. </li>
+ <li>If you are developing using Ant and are compiling in release mode, the
+build tools will automatically sign and then <code>zipalign</code> the
+application package, provided that you have specified the location of a valid
+keystore in the build properties file. If you are compiling in debug mode, the
+build tools will sign the package with the debug key and then <code>zipalign</code>
+it.</li>
+ <li>To use <code>zipalign</code> manually, change to the SDK tools directory
+and use the command syntax <code>$ zipalign 4 <infile>
+<outfile></code></li>
+</ul>
+
+<p>In general, note that you must <code>zipalign</code> an application only
+<em>after</em> it has been signed, as signing will disrupt the package
+alignment.</p>
+
+<h3>Support for Test Packages in New Project Wizard</h3>
+
+<p>The New Project Wizard available in the ADT 0.9.3 now lets you add a test
+package containing Instrumentation or other classes of tests while you are
+creating or importing a new Android application project. </p>
+
+<h3>New USB Driver for Windows</h3>
+
+<p>If you are using Windows and want to develop or test your application on an
+Android-powered device (such as the T-Mobile G1), you need an appropriate USB
+driver.
+
+<p>The Windows version of the Android 1.6 SDK includes a new, WinUSB-based
+driver that you can install. The driver is compatible with both 32- and 64-bit
+versions of Windows XP and Vista. The driver represents an upgrade from the USB
+driver included in previous Android SDKs, although installing the new driver is
+not required. </p>
+
+<p>If you installed the USB driver from a previous SDK release and it is working
+properly, you do not need to upgrade to the new driver. However, we recommend
+upgrading if you have had any problems with the older driver or simply want
+to upgrade to the latest version.</p>
+
+<p>For driver installation or
+upgrade instructions, see <a
+href="{@docRoot}sdk/win-usb.html">USB Driver for Windows</a>.</p>
+</p>
+
+<h3>Emulator Skins, Android 1.6 Platform</h3>
+
+<p>The Android 1.6 platform included in the SDK provides a new set of emulator
+skins, including: </p>
+
+<ul>
+ <li>QVGA — 240 x 320, low density (120 dpi)</li>
+ <li>HVGA — 320 x 480, medium density (160 dpi)</li>
+ <li>WVGA800 — 480 x 800, high density (240 dpi)</li>
+ <li>WVGA854 — 480 x 854, high density (240 dpi)</li>
+</ul>
+
+<p>Besides these defaults, You can also create an AVD that overrides the default
+density for each skin, to create any combination of resolution/density (WVGA
+with medium density, for instance). To do so, use the <code>android</code> tool
+command line to create a new AVD that uses a custom hardware configuration. See
+<a href="{@docRoot}tools/devices/managing-avds.html#createavd">Creating an
+AVD</a> for more information.</p>
+
+<h3>Other Notes and Resolved Issues</h3>
+
+<ul>
+ <li>This SDK release adds support for Eclipse 3.5 (Galileo) and deprecates
+support for Eclipse 3.3 (Europa). </li>
+ <li>We regret to inform developers that Android 1.6 will not include support
+for <a href="http://www.ietf.org/rfc/rfc2549">RFC 2549</a></li>
+ <li>The issue preventing adb from recognizing Samsung Galaxy devices (linux SDK
+only) has been fixed.</li>
+</ul>
+
+
+<h2 id="1.5_r3">Android 1.5 SDK, Release 3</h2>
+
+<p>Provides an updated Android 1.5 system image that includes permissions
+fixes, as described below, and a new application — an IME for Japanese
+text input. Also provides the same set of developer tools included in the
+previous SDK, but with bug fixes and several new features.</p>
+
+<h3>Permissions Fixes</h3>
+
+<p>The latest version of the Android platform, deployable to
+Android-powered devices, includes fixes to the permissions-checking
+in certain areas of the framework. Specifically, the Android system
+now properly checks and enforces several existing permissions where it
+did not do so in the previous release. Because of these changes in
+enforcement, you are strongly encouraged to test your application
+against the new Android 1.5 system image included in this SDK, to ensure
+that it functions normally. </p>
+
+<p>In particular, if your application uses any of the system areas listed below,
+you should add the required permissions to the application's manifest and then
+test the areas of your code that depend on the permission-protected services.
+Even if you believe your application does not use the permissions-protected
+services, you should compile and test your application under the latest platform
+version to ensure that users will not encounter problems when using your
+application. </p>
+
+<p>The changes to permissions are as follows:</p>
+
+<ul>
+<li>When an application requests access to device camera (through
+android.hardware.camera), the <code>CAMERA</code> permission check is now
+properly enforced. </li>
+<li>When an application requests access to device audio capture (through
+android.media.MediaRecorder), the <code>RECORD_AUDIO</code> permission check is
+now properly enforced.</li>
+</ul>
+
+<p>For more information, see the issue described in the oCert advisory
+below:</p>
+
+<p style="margin-left: 2em;"><a href="http://www.ocert.org/advisories/ocert-2009-011.html">http://www.ocert.org/advisories/ocert-2009-011.html</a> </p>
+
+<h3>Resolved Issues, Changes</h3>
+
+<ul>
+<li>The SDK includes a new version of the Google APIs add-on. The add-on
+provides an updated com.google.android.maps external library that fixes compile
+errors related to certain classes such as GeoPoint. For information about the
+Google APIs add-on and the library it provides, see:
+
+<p style="margin-left:2em;"><a
+href="http://code.google.com/android/add-ons/google-apis">http://code.google.com/android/add-ons/google-apis</a> </p></li>
+
+<li>The SDK add-on architecture now lets device manufacturers specify a USB
+Vendor ID in their add-ons.
+<li>The <code>android</code> tool provides a new command that scans SDK add-ons
+for their USB Vendor IDs and makes them available to adb (OS X and Linux
+versions of the SDK only). The command is <code>android update adb</code>. On
+Windows versions of the SDK, a custom USB driver is included that supports the
+"Google" and "HTC" Vendor IDs, which allow adb to recognize G1 and HTC
+Magic devices. For other devices, contact the device manufacturer
+to obtain a USB driver, especially if you have an SDK add-on that defines
+a new USB Vendor ID.</li>
+<li>The telephony, sensor, and geo fix issues in the emulator are now
+fixed.</li>
+<li>When you use adb to uninstall an upgraded application, the Android system
+now properly restores any permissions that had already been granted to the
+previous (downgrade) version of the application</li>
+</ul>
+
+<h2 id="1.5_r2">Android 1.5 SDK, Release 2</h2>
+
+<p>This SDK release provides the same developer tools as the Android 1.5 SDK,
+Release 1, but provides an updated Android 1.5 system image that includes a
+security patch for the issue described in the oCert advisory below:</p>
+
+<p style="margin-left:2em;"><a href="http://www.ocert.org/advisories/ocert-2009-006.html">http://www.ocert.org/advisories/ocert-2009-006.html</a></p>
+
+<h2 id="1.5_r1">Android 1.5 SDK, Release 1</h2>
+
+<p>This SDK provides updates to the development tools and Android system that
+you use to create applications for compliant Android-powered devices. </p>
+
+<h3>Release Overview</h3>
+
+<p>This SDK release includes many new features for developers. Highlights of the
+changes include: </p>
+
+ <ul>
+ <li>Multiple versions of the Android platform are included (Android 1.1,
+Android 1.5). The tools are updated to let you deploy your application
+on any platform in the SDK, which helps you ensure forward-compatibility and,
+if applicable, backward-compatibility.</li>
+ <li>Introduces <a href="{@docRoot}tools/devices/managing-avds.html">Android
+Virtual Devices</a> — (AVD) configurations of options that you
+run in the emulator to better model actual devices. Each AVD gets its
+own dedicated storage area, making it much easier to work with multiple emulators
+that are running concurrently.</li>
+ <li>Support for SDK add-ons, which extend the
+Android SDK to give you access to one or more external Android libraries and/or
+a customized (but compliant) system image that can run in the emulator. </li>
+ <li>The new Eclipse ADT plugin (version 0.9.x) offers new Wizards to let you
+create projects targeted for specific Android configurations, generate XML
+resources (such as layouts, animations, and menus), generate alternate layouts,
+and export and sign your application for publishing.</li>
+ <li>Improved JUnit support in ADT</li>
+ <li>Easier profiling of performance</li>
+ <li>Easier management of localized applications. You can now include or
+exclude locale resources when building your APK from a single
+Android project.</li>
+ <li>A new tool called "android" replaces the activitycreator script.</li>
+ </ul>
+
+<p>For details about the Android platforms included in the SDK — including
+bug fixes, features, and API changes — please read the <a
+href="{@docRoot}about/versions/android-1.5.html">Android 1.5 version notes</a>.</p>
+
+<h3>Installation and Upgrade Notes</h3>
+
+<p>If you've been developing an application using an Android 1.1 SDK, you need
+to make a few changes to your development environment to migrate to the new SDK.
+Tools and documentation are provided to assist you. No changes to the source
+code of an existing application should be needed, provided that your application
+is not using Android internal structures or APIs.</p>
+
+<p>To ensure that your existing application will work properly on a device
+running the latest version of the Android platform, you are strongly encouraged
+to migrate the application to the new SDK, compile it using the platform
+matching the application's original API Level, and run it against the most
+current platform. </p>
+
+<h3>SDK Add-Ons</h3>
+
+<p>This version of the SDK introduces support for SDK add-ons, which extend the
+Android SDK to give you access to one or more external Android libraries and/or
+a customized (but compliant) system image that can run in the emulator. The
+purpose of an SDK add-on is to give you a way to develop applications for a
+specific actual device (or family of devices) that extends the APIs available to
+Android applications through external libraries or system customizations. </p>
+
+<p>From the perspective of your Android development environment, an SDK add-on
+is similar to any of the Android platform targets included in the SDK — it
+includes an external library, a system image, as well as custom emulator skins
+and system properties. The add-on differs in that the Android platform it
+provides may include customized UI, resources, or behaviors, a different set of
+preinstalled applications, or other similar modifications.
+
+<p>The SDK includes a single SDK add-on — the Google APIs add-on. The
+Google APIs add-on gives your application access to the com.google.android.maps
+external library that is included on many (if not most) Android-powered devices.
+The Google APIs add-on also includes a {@link android.location.Geocoder Geocoder}
+backend service implementation. For more information, see the "Maps External
+Library" section below. </p>
+
+<h3>Android Virtual Devices (AVDs)</h3>
+
+<p>The SDK now gives you the capability to compile an application against any
+one of several system targets, then run it in the emulator on top of any
+compatible system image. There are two types of targets:</p>
+<ul>
+<li>Targets that represent core Android platform versions. </li>
+<li>Targets that are SDK add-ons, which typically provide application access to
+one or more external libraries and/or a customized (but compliant) system image
+that can run in the emulator.
+</ul>
+
+<p>A new tool called "android" lets you discover what targets and AVDs are
+available to use.</p>
+
+<p>For more information about AVDs, see <a
+href="{@docRoot}tools/devices/index.html">Creating and Managing Virtual Devices</a>
+
+<h3>Other Notes</h3>
+
+<p><strong>Maps External Library</strong></p>
+
+<p>In previous versions of the SDK, the com.google.android.maps package was
+included in the standard Android library and system image. In the Android 1.5
+SDK, that is not the case. The Android 1.5 library and system image do not
+include the Maps external library (com.google.android.maps). However, the Maps
+external library is available as part of the Google APIs add-on for the Android
+SDK, downloadable from this location: </p>
+
+<p style="margin-left:2em;"><a
+href="http://code.google.com/android/add-ons/google-apis">http://code.google.com
+/android/add-ons/google-apis</a> </p>
+
+<p>For your convenience, the Google APIs add-on is included in the SDK. </p>
+
+<p>For information about how to register for a Maps API Key, see
+<a href="http://code.google.com/android/add-ons/google-apis/mapkey.html">
+Obtaining a Maps API Key</a>.</p>
+
+<p><strong>USB Drivers for Windows</strong></p>
+
+<p>If you are using Windows and want to develop or test your application on an
+Android-powered device (such as the T-Mobile G1), you need an appropriate USB
+driver. For your convenience, the Windows version of the Android SDK includes
+these USB drivers that you can install, to let you develop on the device:</p>
+
+<ul>
+<li>USB driver for 32-bit XP and Vista</li>
+<li>USB driver for 64-bit Vista only</li>
+</ul>
+
+<p>For driver installation or
+upgrade instructions, see <a
+href="{@docRoot}sdk/win-usb.html">USB Driver for Windows</a>.</p>
+</p>
+
+<h3>Resolved Issues, Changes</h3>
+
+<p><strong>Media</strong></p>
+<ul>
+<li>Updated documentation for {@link android.media.SoundPool
+android.media.SoundPool}</li>
+<li>{@link android.webkit.WebView} objects no longer automatically save
+thumbnails. The {@link android.webkit.WebView#capturePicture() capturePicture()}
+method will need to be called manually.</li>
+</ul>
+
+<h3>Known Issues</h3>
+
+<p><strong>Sensor problems in Emulator</strong></p>
+
+<ul>
+<li>If your application uses the Sensor API and you are running it in the
+emulator on the Android 1.5 system image, you may experience problems. Your
+application may generate ANR messages or crash when using the sensors. The
+problem is being investigated.</li>
+</ul>
+
+<p><strong>Other</strong></p>
+
+<ul>
+<li>We regret to inform developers that Android 1.5 will not include support for
+the Zilog Z80 processor architecture.</li>
+</ul>
+
+
+<h2 id="1.1_r1">Android 1.1 SDK, Release 1</h2>
+
+<p>This SDK provides the development tools and Android system image you need to
+create applications for Android-powered devices. Applications developed on this
+SDK will be compatible with mobile devices running the Android 1.1 platform.
+</p>
+
+<p>This release provides an updated system image (Android 1.1), updated
+documentation, and the same set of development tools provided in the Android 1.0
+r2 SDK. The updated system image includes bug fixes and some smaller features,
+as well as a few minor API changes from the 1.0 version. </p>
+
+<p>For details about the Android 1.1 system image included in the SDK —
+including bug fixes, features, and API changes — please read the <a
+href="{@docRoot}about/versions/android-1.1.html">Android 1.1 version notes</a>.</p>
+
+<h3>App Versioning for Android 1.1</h3>
+
+<p>If you are using this SDK to build an application that is compatible
+<em>only</em> with Android-powered devices running the Android 1.1 platform,
+please note that you <strong>must</strong> set the the
+<code>android:minSdkVersion</code> attribute in the application's manifest to
+the API Level of Android 1.1 — "2".</p>
+
+<p>Specifically, you specify the <code>android:minSdkVersion</code> attribute in
+a <code><uses-sdk></code> element as a child of
+<code><manifest></code> in the manifest file. When set, the attribute
+looks like this: </p>
+
+<pre><code><manifest>
+ ...
+ <uses-sdk android:minSdkVersion="2" />
+ ...
+</manifest></code>
+</pre>
+
+<p>By setting <code>android:minSdkVersion</code> in this way, you ensure that
+users will only be able to install your application if their devices are running
+the Android 1.1 platform. In turn, this ensures that your application will
+function properly on their devices, especially if it uses APIs introduced in
+Android 1.1. </p>
+
+<p>If your application uses APIs introduced in Android 1.1 but does not declare
+<code><uses-sdk android:minSdkVersion="2" /></code>, then it will run properly on
+Android 1.1 devices but <em>not</em> on Android 1.0 devices. </p>
+
+<p>If your application does not use any new APIs introduced in Android 1.1, you
+can indicate Android 1.0 compatibility by removing <code>android:minSdkVersion</code> or
+setting the attribute to "1". However, before publishing your application, you
+must make sure to compile your application against the Android 1.0 system image
+(available in the Android 1.0 SDK), to ensure that it builds and functions
+properly for Android 1.0 devices. You should test the application against system
+images corresponding to the API Levels that the application is designed to be
+compatible with.</p>
+
+<p>If you are sure your application is not using Android 1.1 APIs and has no
+need to use them, you might find it easier to keep working in the Android 1.0
+SDK, rather than migrating to the Android 1.1 SDK and having to do additional
+testing.</p>
+
+
+<h3>ADT Plugin Compatibility</h3>
+
+<p>For this version of the SDK — Android 1.1 SDK, Release 1
+— the compatible version of the Android Development Tools (ADT)
+Plugin for Eclipse is <strong>0.8.0</strong>. If you are using a
+previous version of ADT, you should update to the latest version for use
+with this SDK. For information about how to update your ADT plugin, see
+<a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin for Eclipse</a>.</p>
+
+<h3>Installation and Upgrade Notes</h3>
+
+<p>If you've been developing an application using an Android 1.0 SDK no
+changes to your application are needed. You may want to wipe application
+user data (emulator option <code>-wipe-data</code>) when running your
+application on the Android 1.1 emulator for the first time.</p>
+
+<h3>Other Notes</h3>
+
+<p><strong>MapView API Key</strong></p>
+
+<p>com.google.android.maps.MapView is a class that lets you
+easily integrate Google Maps into your application. Before you can
+access the maps data, you will need to register with the Google Maps
+service and receive a Maps API Key, which you then add to your MapView
+for authentication to the server.</p>
+
+<p>Developers should note that the registration service for MapView is now
+active and Google Maps is actively enforcing the Maps API Key requirement.
+For information about how to register for a Maps API Key, see
+<a href="http://code.google.com/android/add-ons/google-apis/mapkey.html">
+Obtaining a Maps API Key</a>.</p>
+
+<p><strong>USB Drivers for Windows</strong></p>
+
+<p>If you using Windows and want to develop or test your application on an
+Android-powered device (such as the T-Mobile G1), you need an appropriate USB
+driver. For your convenience, the Windows version of the Android SDK includes
+these USB drivers that you can install, to let you develop on the device:</p>
+
+<ul>
+<li>USB driver for 32-bit XP and Vista</li>
+<li>USB driver for 64-bit Vista only</li>
+</ul>
+
+<p>The USB driver files are located in the
+<code><SDK>/usb_driver</code> directory. For details and
+installation instructions, see <a
+href="{@docRoot}tools/device.html#setting-up">Connecting Hardware Devices</a>.</p>
+</p>
+
+<h3>Resolved Issues, Changes</h3>
+
+<p><strong>Emulator</strong></p>
+<ul>
+<li>Emulator now saves the user image in <android>/SDK1.1/</code></li>
+</ul>
+
+<h3>Known Issues</h3>
+
+<p><strong>JUnit and Eclipse/ADT</strong></p>
+<ul>
+<li>If you are developing in Eclipse/ADT and want to add JUnit test
+classes, you can do so. However, you need to set up a custom JUnit configuration
+before your tests will run properly. For detailed information about how to set
+up the JUnit configuration, see the troubleshooting topic <a
+href="{@docRoot}resources/faq/troubleshooting.html#addjunit">Running a Junit test class
+in Eclipse</a>.</li>
+</ul>
+
+<p><strong>Other</strong></p>
+
+<ul>
+<li>It is not possible to send MMS messages between emulator instances. </li>
+<li>In some cases, you may encounter problems when using the browser on an
+emulator started with the command-line option <code>-http-proxy</code>. </li>
+<li>On the OSX platform, if you manually remove the ~/.android directory
+using <code>rm -rf ~/.android</code>, then try to run
+the emulator, it crashes. This happens because the emulator fails to create
+a new .android directory before attempting to create the child SDK1.0 directory.
+To work around this issue, manually create a new .android directory using
+<code>mkdir ~/.android</code>, then run the emulator. The emulator
+creates the SDK1.0 directory and starts normally. </li>
+<li>We regret to inform developers that Android 1.1 will not include support
+for ARCNet network interfaces.</li>
+<li>The final set of Intent patterns honored by Android 1.0 has not yet been
+fully documented. Documentation will be provided in future releases.</li>
+<li>In ADT Editor, you can add at most ten new resource values at a time,
+in a given res/values/*.xml, using the form in the Android Resources pane.
+If you add more than ten, the Android Resources pane will not display the
+attributes fields for the additional resource entries. To work around this
+problem, you can close the file in the editor and open it again, or you
+can edit the resource entries in the XML text mode. </li>
+<li>The emulator's battery-control commands (<code>power <option></code>)
+are not working in this release.</li>
+</ul>
+
+
+<h2 id="1.0_r2">Android 1.0 SDK, Release 2</h2>
+
+<p>This SDK release includes the Android 1.0 platform and application API.
+Applications developed on this SDK will be compatible with mobile devices
+running the Android 1.0 platform.</p>
+
+<p>This release includes mainly bug fixes, although some smaller features were
+added.</p>
+
+<h3>ADT Plugin Compatibility</h3>
+
+<p>For this release of the SDK, the compatible version of the Android
+Development Tools (ADT) Plugin for Eclipse is <strong>0.8.0</strong>. If you are
+using a previous version of ADT, you should update to the latest version for use
+with this SDK. For information about how to update your ADT plugin, see <a
+href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin for Eclipse</a>.</p>
+
+<h3>Other Notes</h3>
+
+<p><strong>T-Mobile G1 Compatibility</strong></p>
+
+<p>This version of the SDK has been tested for compatibility with the first
+Android-powered mobile device, the T-Mobile
+G1. </p>
+
+<p><strong>MapView API Key</strong></p>
+
+<p>MapView is a class that lets you easily integrate Google Maps into your
+application. Before you can access the maps data, you will need to register with
+the Google Maps service and receive a Maps API Key, which you then add to your
+MapView for authentication to the server.</p>
+
+<p>Developers should note that the registration service for MapView is now
+active and Google Maps is actively enforcing the Maps API Key requirement. For
+information about how to register for a Maps API Key, see <a
+href="http://code.google.com/android/add-ons/google-apis/mapkey.html">http://code.google.com/android/add-ons/google-apis/mapkey.html</a>.
+</p>
+
+<p><strong>USB Driver for Windows</strong></p>
+<p>If you using Windows and want to develop or test your application on an
+Android-powered device (such as the T-Mobile G1), you need an appropriate USB
+driver. For your convenience, the Windows version of the Android SDK includes a
+USB driver that you can install, to let you develop on the device. The USB
+driver files are located in the <code><SDK>/usb_driver</code> directory.
+
+</p>
+
+<h3>Resolved Issues, Changes</h3>
+<ul>
+<li>The android.jar in this SDK release now includes several classes that were
+missing from the previous SDK. </li>
+<li>The android.R.styleable class and its fields were removed from the public
+API, to better ensure forward-compatibility for applications. The constants
+declared in android.R.styleable were platform-specific and subject to arbitrary
+change across versions, so were not suitable for use by applications. You can
+still access the platform's styleable attributes from your resources or code. To
+do so, declare a custom resource element using a
+<code><declare-styleable></code> in your project's res/values/R.attrs
+file, then declare the attribute inside. For examples, see
+<sdk>/samples/ApiDemos/res/values/attrs.xml. For more information about
+custom resources, see <a
+href="{@docRoot}guide/topics/resources/available-resources.html#customresources">Custom
+Layout Resources</a>. Note that the android.R.styleable documentation is still
+provided in the SDK, but only as a reference of the platform's styleable
+attributes for the various elements.</li>
+<li>The VM now properly ensures that private classes are not
+available to applications through reflection. If you were using reflection
+to access private classes in a previous release, you will now get a run-time
+error. </li>
+
+<li>The Settings and Email applications are now included in the SDK and
+available in the emulator.</li>
+<li>We regret to inform developers that SDK 1.0_r2 does not support MFM, RLL,
+or Winchester hard disk drives.</li>
+<li>In the emulator, the control key for enabling/disabling trackball mode
+is changed from Control-T to F6. You can also enter trackball mode temporarily
+using the Delete key. While the key is pressed, you can send trackball events.</li>
+</ul>
+
+<p>Unless otherwise noted, Known Issues from the previous SDK release also apply
+to this release.</p>
+
+
+
+
+
+
+<h2 id="1.0_r1">Android 1.0 SDK, Release 1</h2>
+
+<p>This SDK release is the first to include the Android 1.0 platform and application API. Applications developed on this SDK will be compatible with mobile devices running the Android 1.0 platform, when such devices are available.</p>
+
+<p>This release includes mainly bug fixes, although some smaller features were added. The Android 1.0 also includes several API changes from the 0.9 version. For those porting from the M5 release, the SDK also includes the legacy changes overview and API Differences Reports. See the current Overview of Changes for more information. </p>
+
+<h3>ADT Plugin Compatibility</h3>
+
+<p>For this version of the SDK — Android 1.0 SDK, Release 1 — the compatible version of the Android Development Tools (ADT) Plugin for Eclipse is <strong>0.8.0</strong>. If you are using a previous version of ADT, you should update to the latest version for use with this SDK. For information about how to update your ADT plugin, see <a href="{@docRoot}sdk/1.0_r1/upgrading.html">Upgrading the SDK</a>.</p>
+
+<h3>Installation and Upgrade Notes</h3>
+
+<p>If you've been developing an application using a previous SDK version and you want the application to run on Android-powered mobile devices, you must port the application to the Android 1.0 SDK. Please see <a href="{@docRoot}sdk/1.0_r1/upgrading.html">Upgrading the SDK</a> for detailed instructions on how to make the transition to this release. Be sure to wipe application user data (emulator option <code>-wipe-data</code>) when running your application on the Android 1.0 SDK emulator.</p>
+
+<h3>Other Notes</h3>
+
+<p><strong>MapView API Key</strong></p>
+
+<p>MapView is a class that lets you easily integrate Google Maps into your application. Before you can access the maps data, you will need to register with the Google Maps service and receive a Maps API Key, which you then add to your MapView for authentication to the server.</p>
+
+<p>Currently, the registration service for MapView is not yet active and Google Maps is not yet enforcing the Maps API Key requirement. However, note that the registration service will be activated soon, so that MapViews in any application deployed to a mobile device will require registration and a valid Maps API Key. </p>
+
+<p>As soon as the registration service becomes available, we will update the page at <a href="http://code.google.com/android/add-ons/google-apis/mapkey.html">http://code.google.com/android/add-ons/google-apis/mapkey.html</a> with details about how and where to register. Please check that page periodically for registration information, if you are using a MapView.</p>
+
+
+<h3>Resolved Issues, Changes</h3>
+
+<p><strong>Emulator</strong></p>
+<ul>
+<li>Emulator now saves the user image in <android>/SDK1.0/</code></li>
+<li>Fixed EsounD-related freezes on Linux.</li>
+<li>Fixed the documentation in -help-audio. '-audio list' doesn't work, one
+ needs to call -help-audio-out and -help-audio-in to get the list of valid
+ audio backends.</li>
+<li>Fixed scrollwheel Dpad emulation in rotated mode. before that, using the
+ scroll-wheel would always generated Dpad Up/Down events, even when in
+ landscape mode.</li>
+
+<li>Several Obsolete command options were removed.</li>
+<li>Setting the network speed through the console or the -netspeed option will
+ properly modify the connectivity icon on the device.</li>
+<li>Setting the GSM voice registration state to 'roaming' in the console will
+ properly modify the voice icon on the device</li>
+</ul>
+
+<p><strong>SQLite</strong></p>
+<ul>
+<li>SQLite is now included in the SDK package on all platforms. </li>
+</ul>
+
+<p><strong>Other</strong></p>
+
+<ul>
+<li>It is not possible to send MMS messages between emulator instances. </li>
+<li>In some cases, you may encounter problems when using the browser on an
+emulator started with the command-line option <code>-http-proxy</code>. </li>
+
+<li>We regret to inform developers that Android 1.0 will not include support for
+dot-matrix printers.</li>
+<li>On the OSX platform, if you manually remove the ~/.android directory
+using <code>rm -rf ~/.android</code>, then try to run
+the emulator, it crashes. This happens because the emulator fails to create
+a new .android directory before attempting to create the child SDK1.0 directory.
+To work around this issue, manually create a new .android directory using
+<code>mkdir ~/.android</code>, then run the emulator. The emulator
+creates the SDK1.0 directory and starts normally. </li>
+<li>The final set of Intent patterns honored by Android 1.0 has not yet been
+fully documented. Documentation will be provided in future releases.</li>
+<li>In ADT Editor, you can add at most ten new resource values at a time,
+in a given res/values/*.xml, using the form in the Android Resources pane.
+If you add more than ten, the Android Resources pane will not display the
+attributes fields for the additional resource entries. To work around this
+problem, you can close the file in the editor and open it again, or you
+can edit the resource entries in the XML text mode. </li>
+<li>The emulator's battery-control commands (<code>power <option></code>)
+are not working in this release.</li>
+
+</ul>
+
diff --git a/docs/html/tools/sdk/addons.jd b/docs/html/tools/sdk/addons.jd
new file mode 100644
index 0000000..8c5e1ed
--- /dev/null
+++ b/docs/html/tools/sdk/addons.jd
@@ -0,0 +1,9 @@
+page.title=SDK Add-Ons
+
+@jd:body
+
+
+
+<p>A page that lists SDK addons and links to release notes. Links to dashboards etc.</p>
+
+
diff --git a/docs/html/sdk/adt-notes.jd b/docs/html/tools/sdk/adt-notes.jd
similarity index 100%
rename from docs/html/sdk/adt-notes.jd
rename to docs/html/tools/sdk/adt-notes.jd
diff --git a/docs/html/sdk/adt_download.html b/docs/html/tools/sdk/adt_download.html
similarity index 100%
rename from docs/html/sdk/adt_download.html
rename to docs/html/tools/sdk/adt_download.html
diff --git a/docs/html/sdk/download.jd b/docs/html/tools/sdk/download.jd
similarity index 100%
rename from docs/html/sdk/download.jd
rename to docs/html/tools/sdk/download.jd
diff --git a/docs/html/tools/sdk/eclipse-adt.jd b/docs/html/tools/sdk/eclipse-adt.jd
new file mode 100644
index 0000000..ac200b6
--- /dev/null
+++ b/docs/html/tools/sdk/eclipse-adt.jd
@@ -0,0 +1,1178 @@
+page.title=ADT Plugin
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}sdk/installing/installing-adt.html">Installing the Eclipse
+Plugin</a></li>
+ </ol>
+
+</div>
+</div>
+
+<p>Android Development Tools (ADT) is a plugin for the Eclipse IDE
+that is designed to give you a powerful, integrated environment in which
+to build Android applications.</p>
+
+<p>ADT extends the capabilities of Eclipse to let you quickly set up new Android
+projects, create an application UI, add packages based on the Android
+Framework API, debug your applications using the Android SDK tools, and even
+export signed (or unsigned) {@code .apk} files in order to distribute your application.</p>
+
+<p>Developing in Eclipse with ADT is highly recommended and is the fastest way
+to get started. With the guided project setup it provides, as well as tools
+integration, custom XML editors, and debug output pane, ADT gives you an
+incredible boost in developing Android applications. </p>
+
+<p>This document provides step-by-step instructions on how to download the ADT
+plugin and install it into your Eclipse development environment. Note that
+before you can install or use ADT, you must have compatible versions of both the
+Eclipse IDE and the Android SDK installed. For details, make sure to read <a
+href="#installing">Installing the ADT Plugin</a>, below. </p>
+
+<p>If you are already using ADT, this document also provides instructions on
+how to update ADT to the latest version or how to uninstall it, if necessary.
+</p>
+
+<p>For information about the features provided by the ADT plugin, such as code
+editor features, SDK tool integration, and the graphical layout editor (for drag-and-drop layout
+editing), see the <a href="{@docRoot}tools/help/adt.html">Android Developer Tools</a>
+document.</p>
+
+
+<h2 id="notes">Revisions</h2>
+
+<p>The sections below provide notes about successive releases of
+the ADT Plugin, as denoted by revision number. </p>
+
+<p>For a summary of all known issues in ADT, see <a
+href="http://tools.android.com/knownissues">http://tools.android.com/knownissues</a>.</p>
+
+<script type="text/javascript">
+function toggleDiv(link) {
+ var toggleable = $(link).parent();
+ if (toggleable.hasClass("closed")) {
+ //$(".toggleme", toggleable).slideDown("fast");
+ toggleable.removeClass("closed");
+ toggleable.addClass("open");
+ $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
+ } else {
+ //$(".toggleme", toggleable).slideUp("fast");
+ toggleable.removeClass("open");
+ toggleable.addClass("closed");
+ $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
+ }
+ return false;
+}
+</script>
+
+<style>
+.toggleable {
+padding: 5px 0 0;
+}
+.toggleme {
+ padding: 10px 0 0 20px;
+}
+.toggleable a {
+ text-decoration:none;
+}
+.toggleme a {
+ text-decoration:underline;
+}
+.toggleable.closed .toggleme {
+ display:none;
+}
+#jd-content .toggle-img {
+ margin:0 5px 3px 0;
+}
+</style>
+
+
+<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" />
+ADT 18.0.0</a> <em>(April 2012)</em>
+ <div class="toggleme">
+<dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Java 1.6 or higher is required for ADT 18.0.0.</li>
+ <li>Eclipse Helios (Version 3.6.2) or higher is required for ADT 18.0.0.</li>
+ <li>ADT 18.0.0 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools
+ r18</a>. If you haven't already installed SDK Tools r18 into your SDK, use the Android SDK
+ Manager to do so.</li>
+ </ul>
+ </dd>
+
+ <dt>Bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed problem where exporting release package does not recompile libraries in release
+ mode.
+ (<a href="http://code.google.com/p/android/issues/detail?id=27940">Issue 27940</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" />
+ADT 17.0.0</a> <em>(March 2012)</em>
+ <div class="toggleme">
+<dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Java 1.6 or higher is required for ADT 17.0.0.</li>
+ <li>Eclipse Helios (Version 3.6.2) or higher is required for ADT 17.0.0.</li>
+ <li>ADT 17.0.0 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools
+ r17</a>. If you haven't already installed SDK Tools r17 into your SDK, use the Android SDK
+ Manager to do so.</li>
+ </ul>
+ </dd>
+
+ <dt>General improvements:</dt>
+ <dd>
+ <ul>
+ <li>New build features
+ <ul>
+ <li>Added feature to automatically setup JAR dependencies. Any {@code .jar} files in the
+ {@code /libs} folder are added to the build configuration (similar to how the Ant build
+ system works). Also, {@code .jar} files needed by library projects are also automatically
+ added to projects that depend on those library projects.
+ (<a href="http://tools.android.com/recent/dealingwithdependenciesinandroidprojects">more
+ info</a>)</li>
+ <li>Added a feature that allows you to run some code only in debug mode. Builds now
+generate a class called {@code BuildConfig} containing a {@code DEBUG} constant that is
+automatically set according to your build type. You can check the ({@code BuildConfig.DEBUG})
+constant in your code to run debug-only functions.</li>
+ <li>Added support for custom views with custom attributes in libraries. Layouts using
+custom attributes must use the namespace URI {@code http://schemas.android.com/apk/res-auto} instead
+of the URI that includes the app package name. This URI is replaced with the app specific one at
+build time.</li>
+ </ul>
+ </li>
+ <li>Improved Lint features. See the <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r17</a>
+release notes.</li>
+ <li>Improved the Lint user interface
+ <ul>
+ <li>Added <strong>Run Lint</strong> toolbar action with a dropdown menu for selecting
+specific (or all) projects, clearing results and other actions.</li>
+ <li>Updated the results window to be organized as a tree rather than a flat list. Each
+issue type has a single top level item, which makes it easier to quickly scan through the reported
+issues and narrow down to the issues you are most interested in.</li>
+ <li>Added many new toolbar actions to the results window, including expand/collapse,
+ignore in file, ignore in project, ignore everywhere, show options, and configure columns.</li>
+ <li>Added new column options for the <strong>Lint Warnings</strong> tab, such as
+category, priority, project, file and line. The column selection (as well as the column sizes) are
+persisted. You can also click on columns to sort by those values.</li>
+ <li>Added Enable All and Disable All buttons to the Lint Options dialog, and a search
+filter textbox to filter by issue id, summary and severity.</li>
+ </ul>
+ </li>
+ <li>Added Quick Outline for XML editors (Ctrl-O, Command-O). This feature shows the structure
+of the current file including icons and ids, lets you filter and quickly jump to specific ids.</li>
+ <li>Updated the resource chooser to shows the resolved value for resources. For example,
+when selecting {@code @string/hello} the chooser displays a resolved value such as "Hello World").
+The resource chooser also now allows you to edit the chosen value directly.</li>
+ <li>Updated Layout Editor so that it does not assign default ids to layouts, includes and
+merge tags. This behavior tended to pollute the namespace with a lot of unused resources since
+layouts are not usually manipulated via code, or referenced from XML. (The RelativeLayout editor
+automatically assigns ids to views without ids when pointing to them.)</li>
+ <li>Added ability to export screenshots from the Layout Editor</li>
+ </ul>
+ </dd>
+
+ <dt>Bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed problem using Layout Editor with {@link android.widget.SlidingDrawer} which could
+ not be dragged into the layout on some platforms.</li>
+ <li>Fixed preview rendering for {@link android.widget.SlidingDrawer} and
+ {@link android.widget.TabHost}.
+ (<a href="http://code.google.com/p/android/issues/detail?id=23022">Issue 23022</a>).</li>
+ <li>Fixed issues that could prevent layout rendering due to unresolvable resources.
+ (<a href="http://code.google.com/p/android/issues/detail?id=21046">Issue 21046</a>,
+ <a href="http://code.google.com/p/android/issues/detail?id=21051">Issue 21051</a>)</li>
+ <li>Fixed a bug in resource chooser which made some types of framework resources impossible to
+select. (<a href="http://code.google.com/p/android/issues/detail?id=20589">Issue 20589</a>)</li>
+ <li>Fixed a bug in the formatter where a certain whitespace pattern could result in a
+ non-space character getting deleted.
+ (<a href="http://code.google.com/p/android/issues/detail?id=23940">Issue 23940</a>)</li>
+ <li>Fixed a locale bug affecting Turkish locales in particular.
+ (<a href="http://code.google.com/p/android/issues/detail?id=23747">Issue 23747</a>)</li>
+ <li>Fixed issue where dex complains about duplicate classes in cases where a Library
+ Project depends on the same jar files or Java-only projects.</li>
+ <li>Fixed issue where test projects had to independently reference the library projects used
+ by an app project. Now referencing only the app project is enough.</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" />
+ADT 16.0.1</a> <em>(December 2011)</em>
+ <div class="toggleme">
+<dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Eclipse Helios (Version 3.6) or higher is required for ADT 16.0.1.</li>
+ <li>ADT 16.0.1 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools
+ r16</a>. If you haven't already installed SDK Tools r16 into your SDK, use the Android SDK
+ Manager to do so.</li>
+ </ul>
+ </dd>
+
+ <dt>Bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed build issue where the 9-patch could be packaged as normal bitmap in some cases.</li>
+ <li>Fixed minor issues in the <a href="http://tools.android.com/recent/lint">Lint</a>
+ tool.</li>
+ <li>Fixed minor issues in the SDK Manager.</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" />
+ADT 16.0.0</a> <em>(December 2011)</em>
+ <div class="toggleme">
+<dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Eclipse Helios (Version 3.6) or higher is required for ADT
+16.0.0.</li>
+ <li>ADT 16.0.0 is designed for use with <a
+href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r16</a>. If you haven't already installed SDK Tools
+r16 into your SDK, use the Android SDK Manager to do so.</li>
+ </ul>
+ </dd>
+
+ <dt>General improvements:</dt>
+ <dd>
+ <ul>
+ <li>Added Lint tool to detect common errors in Android projects. (<a
+href="http://tools.android.com/recent/lint">more info</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" />
+ADT 15.0.1</a> <em>(November 2011)</em>
+ <div class="toggleme">
+<dl>
+ <dt>Dependencies:</dt>
+
+ <dd>ADT 15.0.1 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r15</a>.
+ If you haven't already installed SDK Tools r15 into your SDK, use the Android SDK Manager to
+ do so.</dd>
+
+ <dt>Bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed how source files are attached to library project <code>.jar</code> files.</li>
+ <li>Fixed how the <code>bin/</code> folder for library projects are refreshed. This ensures that parent projects pick up changes in library projects.</li>
+ <li>Fixed how a parent project's library container is updated when a library project is recompiled. This ensures that parent projects are
+ recompiled when code in a library project changes.</li>
+ <li>Fixed how <code>res/</code> folders are checked in library projects. This ensures that all <code>res</code> folders are properly included
+ even if Eclipse is not aware of them due to refresh issues.</li>
+ <li>Fixed issue that prevented <code>aapt</code> from running when editing certain XML files.</li>
+ <li>Fixed minor XML formatting issues.</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" />
+ADT 15.0.0</a> <em>(October 2011)</em>
+ <div class="toggleme">
+<dl>
+
+<dt>Dependencies:</dt>
+
+<dd>ADT 15.0.0 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r15</a>.
+If you haven't already installed SDK Tools r15 into your SDK, use the Android SDK Manager to
+do so.</dd>
+
+<dt>Bug fixes:</dt>
+<dd>
+<ul>
+ <li>Fixed build issue when using Renderscript in projects that target API levels 11-13
+ (<a href="http://code.google.com/p/android/issues/detail?id=21006">Issue 21006</a>).</li>
+ <li>Fixed issue when creating projects from existing source code.</li>
+ <li>Fixed issues in the SDK Manager
+ (<a href="http://code.google.com/p/android/issues/detail?id=20939">Issue 20939</a>,
+ <a href="http://code.google.com/p/android/issues/detail?id=20607">Issue 20607</a>).</li>
+ <li>Fixed scrolling issue in the new Logcat panel of DDMS.</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" />
+ADT 14.0.0</a> <em>(October 2011)</em>
+ <div class="toggleme">
+<dl>
+
+<dt>Dependencies:</dt>
+
+<dd>ADT 14.0.0 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r14</a>.
+If you haven't already installed SDK Tools r14 into your SDK, use the Android SDK Manager to
+do so.</dd>
+
+<dt>Build system:</dt>
+<dd>
+ <ul>
+ <li>Changed <code>default.properties</code> to <code>project.properties</code> and
+ <code>build.properties</code> to <code>ant.properties</code>. ADT automatically
+ renames these files, if necessary, when you open a project in Eclipse.</li>
+ <li>Changed how library projects are built in Eclipse.</a></li>
+ <li>Changed output of <code>javac</code> from <code>bin/</code> to <code>bin/classes</code>
+ in Eclipse.</li>
+ <li>Improved incremental builds so that resource compilation runs less frequently. Builds no
+ longer run when you edit strings or layouts (unless you add a new <code>id</code>) and no longer
+ run once for each library project.</li>
+ <li>Introduced a "PNG crunch cache" that only runs on modified PNG files, instead of
+ crunching all existing PNG files, all the time.</li>
+ <li>Modified resource compilation so it no longer happens for normal save operations. It only
+ happens when running or debugging (the build option that lets you disable the packaging
+ step, which was introduced in ADT 12, is now on by default.)</li>
+ </ul>
+<p>For a complete overview of the build system changes and what you need to do to support them,
+see the <a href="http://tools.android.com/recent/buildchangesinrevision14">Android Tools Project
+site</a>.</p>
+</dd>
+
+<dt>General improvements:</dt>
+<dd>
+ <ul>
+
+
+<li>Added a Welcome Wizard to help with the initial setup of the Android
+development environment (<a href="http://tools.android.com/recent/welcomewizard">more
+info</a>).</li>
+<li>Integrated the Android Asset Studio, which helps you create icons for things
+like the launcher, menus, and tabs. (<a
+href="http://tools.android.com/recent/assetstudiointegration">more
+info</a>).</li>
+<li>Revamped the Logcat view and added support to display and filter logs by
+ application names as well as PIDs (<a
+ href="http://tools.android.com/recent/updatedlogcatviewer">more info</a>).</li>
+<li>Revamped the SDK Manager UI (<a href="http://tools.android.com/recent/newsdkmanager">more
+info</a>).</li>
+<li>Revamped the New Project and the New XML File wizards to have
+multiple pages. Sample projects are now copied into the workspace such that they can be modified
+and deleted without affecting the master copy
+(<a href="http://tools.android.com/recent/revampedwizards">more info</a>).</li>
+<li>Removed the dependency on Eclipse GEF.</li>
+</ul>
+</dd>
+
+<dt>XML and Java editors:</dt>
+<dd>
+ <ul>
+ <li>Added a new XML formatter that formats all XML files according to the
+ standard Android coding style. The formatter can also reorder
+ attributes to follow a recommended order and processes any changes made in the Layout editor.
+(<a href="http://tools.android.com/recent/xmlformatter">more info</a>).</li>
+ <li>Added the "Go to Matching" (Ctrl-Shift-P) feature, which lets you jump
+between opening and closing tags in XML files.</li>
+ <li>Added support for the "Select Enclosing Element" feature on Mac.</li>
+ <li>Added a Quickfix for extracting Strings when the caret is inside a String (<a href="">see
+more</a>).</li>
+ <li>Improved "smart indent", which allows automatic indentation and un-indentation
+ when pressing the Return key in XML editors (<a
+href="http://tools.android.com/recent/xmleditingimprovements">more info</a>).</li>
+
+ </ul>
+</dd>
+
+<dt>Layout editor:</dt>
+<dd>
+ <ul>
+ <li>Added tooltip feedback for dragging and resizing operations. For
+ example, when dragging in a relative layout, the proposed
+ constraints are shown. When resizing, the new dimensions are
+ shown (<a href="http://tools.android.com/recent/layouteditorfeedbacktooltips">more
+info</a>).</li>
+ <li>Added the ability to suppress rendering fidelity warnings (<a
+href="http://tools.android.com/recent/suppressrenderwarnings">more info</a>).</li>
+ <li>Added "Remove Container" visual refactoring that removes the
+ children of a container up to the top level and transfers
+ namespace and layout attributes if necessary (<a
+href="http://tools.android.com/recent/removecontainervisualrefactoring">more info</a>).</li>
+ <li>Added pull-right menus to the context menu for accessing
+ properties of the parents, which is useful when the children fully
+ cover the parent and make it hard to select on their own.</li>
+ <li>Improved access to properties in the context menu. The most
+ frequently set attributes for each view are listed at the top of
+ the menu. The Properties menu offers access to the most
+ recently set attributes, attributes organized by their defining
+ view, and layout attributes only or all attributes alphabetically (<a
+href="http://tools.android.com/recent/layouteditorcontextmenuimprovements">more info</a>).</li>
+ </ul>
+</dd>
+
+<dt>Bug fixes:</dt>
+<dd>Fixed many bugs and added <a
+href="http://tools.android.com/recent/miscellaneousrecentfixes">minor improvements</a>, in
+particular some <a href="http://tools.android.com/recent/linuxfixes">critical bug fixes on
+Linux</a>.</dd>
+
+</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" />
+ADT 12.0.0</a> <em>(July 2011)</em>
+ <div class="toggleme">
+<dl>
+
+<dt>Dependencies:</dt>
+
+<dd>ADT 12.0.0 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r12</a>. If you haven't
+already installed SDK Tools r12 into your SDK, use
+the Android SDK Manager to do so.</dd>
+
+<dt>Visual Layout Editor:</dt>
+<dd>
+<ul>
+ <li>New RelativeLayout drop support with guideline suggestions for
+ attachments and cycle prevention
+ (<a href="http://tools.android.com/recent/revampedrelativelayoutsupport">more info</a>).</li>
+ <li>Resize support in most layouts along with
+ guideline snapping to the sizes dictated by <code>wrap_content</code> and <code>match_parent</code>.
+ In LinearLayout, sizes are mapped to weights instead of pixel widths.
+ (<a href="http://tools.android.com/recent/resizesupport">more info</a>).</li>
+ <li>Previews of drawables and colors in the resource chooser dialogs
+ (<a href="http://tools.android.com/recent/imageandcolorpreviews">more info</a>).</li>
+ <li>Improved error messages and links for rendering errors including
+ detection of misspelled class names
+ (<a href="http://tools.android.com/recent/improvedrenderingerrordiagnostics">more info</a>).</li>
+</ul>
+</dd>
+
+<dt>Build system:</dt>
+<dd>
+<ul>
+ <li id="build-option">A new option lets you disable the packaging step in the automatic
+ builders. This improves performance when saving files by not
+ performing a full build, which can take a long time for large projects.
+ If the option is enabled, the APK is packaged when the
+ application is deployed to a device or emulator or when the
+ release APK is exported (<a href="http://tools.android.com/recent/finercontroloveradtbuildprocess">more info</a>).</li>
+</ul>
+</dd>
+
+<dt>Bug fixes:</dt>
+<dd>Many bug fixes are part of this release
+(<a href="http://tools.android.com/recent/adt12bugfixroundup">more info</a>).</dd>
+
+</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" />
+ADT 11.0.0</a> <em>(June 2011)</em>
+ <div class="toggleme">
+
+<dl>
+
+<dt>Dependencies:</dt>
+
+<dd>ADT 11.0.0 is designed for use with SDK Tools r11. If you haven't
+already installed SDK Tools r11 into your SDK, use the Android SDK Manager to do
+so.</dd>
+
+<dt>Visual Refactoring:</dt>
+<dd>
+ <ul>
+ <li>"Extract Style" feature pulls out style-related attributes from your layout and extracts
+them as a new style defined in {@code styles.xml} (<a
+href="http://tools.android.com/recent/extractstylerefactoring">more info</a>).</li>
+ <li>"Wrap in Container" feature lets you select a group of views then surround them
+ in a new layout (a new view group, such as a LinearLayout), and transfers namespace and layout
+ parameters to the new parent (<a
+href="http://tools.android.com/recent/newrefactoringswrapinchangelayoutchangewidget">more
+info</a>).</li>
+ <li>"Change Layout" feature changes layouts from one type
+ to another, and can also flatten a layout hierarchy (<a
+href="http://tools.android.com/recent/newrefactoringswrapinchangelayoutchangewidget">more
+info</a>).</li>
+ <li>"Change Widget Type" feature changes the type of the
+ selected views to a new type. Also, a new selection context menu
+ in the visual layout editor makes it easy to select siblings as
+ well as views anywhere in the layout that have the same type (<a
+href="http://tools.android.com/recent/newrefactoringswrapinchangelayoutchangewidget">more
+info</a>).</li>
+ <li>"Extract as Include" feature finds identical collections of views
+ in other layouts and offers to combine them into a single layout that you can then include in
+ each layout (<a
+href="http://tools.android.com/recent/extractasincludeimprovements">more info</a>).</li>
+ <li>Quick Assistant in Eclipse can be invoked
+ from the XML editor (with Ctrl-1) to apply any of the above
+ refactorings (and Extract String) to the current selection (<a
+href="http://tools.android.com/recent/refactoringquickassistant">more info</a>).</li>
+ </ul>
+</dd>
+
+<dt>Visual Layout Editor:</dt>
+<dd>
+ <ul>
+ <li>This is the update to the layout editor you've been waiting for! It includes (almost) all
+the goodies demonstrated at Google I/O. <a href="http://www.youtube.com/watch?v=Oq05KqjXTvs">Watch
+the video</a> on YouTube.</li>
+ <li>The palette now supports different configurations for supported widgets. That is, a single
+view is presented in various different configurations that you can drag into your layout. For
+example, there is a <em>Text Fields</em> palette category where you can drag an {@link
+android.widget.EditText} widget in as a password field, an e-mail field, a phone field, or other
+types of text boxes. Similarly, {@link android.widget.TextView} widgets are preconfigured
+with large, normal and small theme sizes, and {@link android.widget.LinearLayout} elements are
+preconfigured in horizontal and vertical configurations (<a
+href="http://tools.android.com/recent/multipletextfieldandlayouttypes">more info</a>).</li>
+ <li>The palette supports custom views. You can pick up any custom
+ implementations of the View class you've created in your project or from included libraries and
+drag them into your layout (<a
+href="http://tools.android.com/recent/customviewsinthepalette">more info</a>).</li>
+ <li>Fragments are available in the palette for placement in your layout. In the tool, you can
+choose which layout to show rendered for a given fragment tag. Go to declaration works for fragment
+classes (<a href="http://tools.android.com/recent/fragmentsupport">more info</a>).</li>
+ <li>The layout editor automatically applies a "zoom to fit" for newly
+ opened files as well as on device size and orientation changes to
+ ensure that large layouts are always fully visible unless you
+ manually zoom in.</li>
+ <li>You can drop in an {@code <include>} element from the palette, which will pop up
+ a layout chooser. When you select the layout to include, it is added with an {@code
+<include>}. Similarly, dropping images or image buttons will pop up image
+ resource choosers (<a
+href="http://tools.android.com/recent/includetagdropsupport">more info</a>).</li>
+ <li>The configuration chooser now applies the "Render Target" and
+ "Locale" settings project wide, making it trivial to check the
+ layouts for different languages or render targets without having
+ to configure these individually for each layout.</li>
+ <li>The layout editor is smarter about picking a default theme to
+ render a layout with, consulting factors like theme registrations
+ in the manifest, the SDK version, and other factors.</li>
+ <li>The layout editor is smarter about picking a default configuration to render a layout
+with, defaulting to the currently visible configuration in the previous file. It also considers the
+SDK target to determine whether to default to a tablet or phone screen size.</li>
+ <li>Basic focus support. The first text field dropped in a layout is assigned focus, and there
+are <strong>Request Focus</strong> and <strong>Clear Focus</strong> context menu items on text
+fields to change the focus.</li>
+ </ul>
+</dd>
+
+<dt>XML editors:</dt>
+<dd>
+<ul>
+ <li>Code completion has been significantly improved. It now works
+ with {@code <style>} elements, completes dimensional units,
+ sorts resource paths in values based on the attribute name, and more. There are also many fixes to
+handle text replacement (<a
+href="http://tools.android.com/recent/xmlcodecompletionimprovements">more info</a>).</li>
+ <li>AAPT errors are handled better. They are now underlined for the
+ relevant range in the editor, and a new quickfix makes it trivial
+ to create missing resources.</li>
+ <li>Code completion for drawable, animation and color XML files (<a
+href="http://tools.android.com/recent/codecompletionfordrawablescolorsandanimationfiles">more
+info</a>).</li>
+</ul>
+</dd>
+
+<dt>DDMS:</dt>
+<dd>
+<ul>
+ <li>"New Folder" action in the File Explorer.</li>
+ <li>The screenshot dialog will add timestamps to the filenames and preserve the orientation on
+snapshot refresh.</li>
+</ul>
+</dd>
+
+<dt>General notes:</dt>
+<dd>
+ <ul>
+ <li>TraceView supports zooming with the mouse-wheel in the timeline.</li>
+ <li>The New Android Project wizard now supports Eclipse working sets.</li>
+ </ul>
+</dd>
+</dl>
+<p>More information about tool changes are available on the <a
+href="http://tools.android.com/recent">Android Tools Project Site</a>.</p>
+</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" />
+ADT 10.0.1</a> <em>(March 2011)</em>
+ <div class="toggleme">
+
+<dl>
+
+<dt>Dependencies:</dt>
+
+<dd>ADT 10.0.1 is designed for use with SDK Tools r10. If you haven't
+already installed SDK Tools r10 into your SDK, use the Android SDK Manager to do
+so.</dd>
+
+<dt>General notes:</dt>
+<dd>
+ <ul>
+ <li>Temporary work-around to resolve the rare cases in which the layout editor will
+not open.</li>
+ <li>Fix issue in which ADT 10.0.0 would install on Eclipse 3.4 and lower, even though ADT
+requires Eclipse 3.5 or higher (as of 10.0.0).</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" />
+ADT 10.0.0</a> <em>(February 2011)</em>
+ <div class="toggleme">
+
+<dl>
+
+<dt>Dependencies:</dt>
+
+<dd>ADT 10.0.0 is designed for use with SDK Tools r10. If you haven't
+already installed SDK Tools r10 into your SDK, use the Android SDK Manager to do
+so.</dd>
+
+<dt>General notes:</dt>
+<dd>
+ <ul>
+ <li>The tools now automatically generate Java Programming Language source files (in the <code>gen/</code> directory) and
+ bytecode (in the <code>res/raw/</code> directory) from your <code>.rs</code> files.</li>
+ <li>A Binary XML editor has been added (<a href="http://tools.android.com/recent/binaryxmleditor">details</a>).</li>
+ <li>Traceview is now integrated into the Eclipse UI (<a href="http://tools.android.com/recent/traceviewineclipse">details</a>).</li>
+ <li>The "Go To Declaration" feature for XML and <code>.java</code> files quickly show all the matches in the project
+ and allows you jump to specific items such as string translations or <code>onClick</code> handlers
+ (<a href="http://tools.android.com/recent/gotodeclarationimprovements">details</a>).</li>
+ <li>The Resource Chooser can create items such as dimensions, integers, ids, and booleans
+ (<a href="http://tools.android.com/recent/resourcechoosercannowcreatearbitraryvalues">details</a>).</li>
+ <li>Improvements to the Visual Layout Editor:
+ <ul>
+ <li>A new Palette with categories and rendering previews
+ (<a href="http://tools.android.com/recent/newpalette">details</a>).</li>
+ <li>A Layout Actions bar that provides quick access to common layout operations
+ (<a href="http://tools.android.com/recent/layoutactionsbar">details</a>).</li>
+ <li>When the Android 3.0 rendering library is selected, layouts render more like they do on devices.
+ This includes rendering of status and title bars to more accurately reflect the actual
+ screen space available to applications
+ (<a href="http://tools.android.com/recent/systembarandactionbar">details</a>).</li>
+ <li>Zoom improvements such as fit to view, persistent scale, and keyboard access.
+ (<a href="http://tools.android.com/recent/zoomimprovements">details</a>).</li>
+ <li>Further improvements to <code><merge></code> layouts, as well as layouts with gesture overlays
+ (<a href="http://tools.android.com/recent/improvedsupportformergetags">details</a>).</li>
+ <li>Improved rendering error diagnostics.</li>
+ </ul>
+ </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" />
+ADT 9.0.0</a> <em>(January 2011)</em>
+ <div class="toggleme">
+
+<dl>
+
+<dt>Dependencies:</dt>
+
+<dd>ADT 9.0.0 is designed for use with SDK Tools r9. If you haven't
+already installed SDK Tools r9 into your SDK, use the Android SDK Manager to do
+so.</dd>
+
+<dt>General notes:</dt>
+<dd>
+ <ul>
+ <li>"Go To Declaration" hyperlink support: You can jump directly from code references (such as
+ <code>R.id.main</code>) to the corresponding XML declaration, or from XML attributes (such as
+ <code>@string</code>) to the corresponding resource definition, or from manifest XML
+ registrations to activities and services.</li>
+ <li>Improvements were made to name refactoring.</li>
+ <li>AVDs now automatically save their state, so they can restart almost instantly. You can enable this feature when
+ creating an AVD or by editing an AVD with the AVD Manager.</li>
+ <li>Improvements to the Visual Layout Editor:
+ <ul>
+ <li>Support for rendering targets: You can now choose an arbitrary Android platform to
+ render the current page, regardless of the project's minimum platform. This makes it
+ easy to verify the layout and appearance of your activity on different versions of
+ the platform.
+ </li>
+ <li>Improved support for empty and nested layouts: Dragging items over nested and
+ invisible layouts automatically enlarges and highlights these layouts, so that they
+ can receive drops.
+ </li>
+ <li>XML formatting improvements: The editor generates cleaner XML and you can now enable
+ XML auto-formatting in the <strong>Preferences</strong> menu.</li>
+ <li>Improved Outline labels: The Outline tab now displays additional information about each
+ View. Textual Views display a snippet of the actual text. Views with a source
+ (such as ImageView) displays the resource name. Included Views display the name of the View.
+ </li>
+ <li>When you right click a View in the Layout Editor,
+ the context menu now contains <strong>Edit ID...</strong> and <strong>Edit Text...</strong>
+ items. The <strong>Properties...</strong> context menus now list all of the properties and
+ provide a way to edit them
+ (<a href="http://tools.android.com/recent/editidtextandotherpropertiesviamenu">Details</a>).
+ </li>
+ <li>The layout editor now properly handles
+ <a href="{@docRoot}guide/topics/resources/layout-resource.html#include-element"><code><include></code></a>
+ and <a href="{@docRoot}guide/topics/resources/layout-resource.html#merge-element"><code><merge></code></a>
+ tags (<a href="http://tools.android.com/recent/supportforincludeandmerge">Details</a>).</li>
+ <li>"Extract as Include" refactoring: The Layout Editor has a new refactoring that allows
+ you to select one or more views in a layout, and extract it into a separate layout
+ (<a href="http://tools.android.com/recent/extractasincluderefactoring">Details</a>).</li>
+ <li>Improved diagnostics for class loading and rendering errors: Class loading and rendering
+ error messages are more useful and provide better information about the root cause of the
+ error.</li>
+ <li>Improved error handling to prevent drag and reordering operations from adding children
+ into an {@link android.widget.AdapterView}.</li>
+ <li>Outline reordering: Reordering your views in the Outline tab is much easier
+ (<a href="http://tools.android.com/recent/outlineimprovements">Details</a>).</li>
+ <li>Fix for keybinding bug where keyboard shortcuts did not work (Issues
+ <a href="http://code.google.com/p/android/issues/detail?id=13231">13231</a> and
+ <a href="http://code.google.com/p/android/issues/detail?id=13134">13134</a>).</li>
+ <li>Fix for problems with Custom layout attribute menu (Issue
+ <a href="http://code.google.com/p/android/issues/detail?id=13134">13134</a>).</li>
+ <li>Automatic configuration for various view types: Certain views have properties configured
+ by default. For example, the width of an {@link android.widget.EditText} object is set to
+ <code>match_parent</code> when added to a vertical {@link android.widget.LinearLayout}
+ or a default image is added to an {@link android.widget.ImageButton}.</li>
+ <li>Previews during dragging: Dragging from the palette or dragging within the layout editor
+ now shows live previews of the dragged item.</li>
+ <li>Navigation improvements: In the Layout Editor, double-clicking Views jumps to the
+ corresponding XML element. In the Outline view, double-clicking opens the Properties view.</li>
+ <li>The editor has Honeycomb style animation preview support.</li>
+ <li>Improved rendering support for various Views (such as TabHosts and SlidingDrawers) in
+ Honeycomb (Issues <a href="http://code.google.com/p/android/issues/detail?id=3162">3162</a>
+ and <a href="http://code.google.com/p/android/issues/detail?id=13092">13092</a>).</li>
+ <li>Included layouts can be rendered and edited in the context of the layouts that include
+ them. From a layout using an <a href="{@docRoot}guide/topics/resources/layout-resource.html#include-element">
+ <code><include></code></a> tag, double-clicking on the
+ <a href="{@docRoot}guide/topics/resources/layout-resource.html#include-element">
+ <code><include></code></a> element edits the referenced layout in the context of the
+ current layout. Additionally, when editing a layout that is included by other layouts,
+ you can quickly change between context layouts, by right clicking in the editor and choosing
+ <strong>Show included in...</strong>. This feature is only available in Honeycomb.</li>
+ </ul>
+ </li>
+ <li>This release fixes many other bugs, but the most important ones are listed below:
+ <ul>
+ <li>Fixed issue that prevented launching debug builds on productions devices when
+ <code>debuggable=true</code> was not set in the Android manifest.</li>
+ <li>The LogCat view in DDMS properly handles UTF-8 characters.</li>
+ <li>The SDK Manager is more reliable on Windows
+ (<a href="http://tools.android.com/recent/sdkmanagerfixes">Details</a>).</li>
+ <li>A JUnit initialization bug that prevented you from working with JUnit tests was fixed
+ (Issue <a href="http://code.google.com/p/android/issues/detail?id=12411">12411</a>).</li>
+ </ul>
+</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" />
+ADT 8.0.1</a> <em>(December 2010)</em>
+ <div class="toggleme">
+
+<dl>
+
+<dt>Dependencies:</dt>
+
+<p><p>ADT 8.0.1 is designed for use with SDK Tools r8. If you haven't
+already installed SDK Tools r8 into your SDK, use the Android SDK Manager to do
+so.</p></dd>
+
+<dt>General notes:</dt>
+<dd>
+<ul>
+ <li>This is a quick follow-up to ADT 8.0.0 to fix some bugs.</li>
+ <li>Fixes an issue in which projects failed to compile, citing a dex error.</li>
+ <li>Better ProGuard error reporting when exporting applications for release.</li>
+</ul>
+<p>Also see the recent release notes for 8.0.0, below.</p>
+</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" />
+ADT 8.0.0</a> <em>(December 2010)</em>
+ <div class="toggleme">
+
+<dl>
+
+<dt>Dependencies:</dt>
+
+<p><p>ADT 8.0.0 is designed for use with SDK Tools r8. If you haven't
+already installed SDK Tools r8 into your SDK, use the Android SDK Manager to do
+so.</p></dd>
+
+<dt>General notes:</dt>
+<dd>
+<ul>
+ <li>New version number scheme that follows the SDK Tools revision number. The major version
+number for your ADT plugin should now always match the revision number of your SDK Tools. For
+example, ADT 8.x is for SDK Tools r8.</li>
+ <li>Support for true debug build. You no longer need to change the value of the
+ <code>debuggable</code> attribute in the Android Manifest.
+ <p>Incremental builds automatically insert <code>debuggable="true"</code>, but if you perform
+ "export signed/unsigned application package", ADT does <em>not</em> insert it.
+ If you manually set <code>debuggable="true"</code> in the manifest file, then release builds will
+ actually create a debug build (it does not remove it if you placed it there).</p></li>
+ <li>Automatic <a href="{@docRoot}tools/help/proguard.html">ProGuard</a> support in
+ release builds. For it to work, you need to have a <code>proguard.config</code>
+ property in the <code>default.properties</code> file that points to a ProGuard config file.</li>
+ <li>Completely rewritten Visual Layout Editor. (This is still a work in progress.) Now includes:
+ <ul>
+ <li>Full drag and drop from palette to layout for all Layout classes.</li>
+ <li>Move widgets inside a Layout view, from one Layout view to another and from one layout file to another.</li>
+ <li>Contextual menu with enum/flag type properties.</li>
+ <li>New zoom controls.</li>
+ </ul></li>
+ <li>New HierarchyViewer plug-in integrated in Eclipse.</li>
+ <li>Android launch configurations don't recompile the whole workspace on launch anymore.</li>
+ <li><code>android.jar</code> source and javadoc location can now be configured.</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" />
+ADT 0.9.9</a> <em>(September 2010)</em>
+ <div class="toggleme">
+
+<dl>
+
+<dt>Dependencies:</dt>
+
+<dd><p>ADT 0.9.9 replaces ADT 0.9.8 and is designed for use with SDK Tools r7
+and later. ADT 0.9.9 includes the ADT 0.9.8 features as well as an important
+bugfix, so we recommend that you upgrade as soon as possible. If you haven't
+already installed SDK Tools r7 into your SDK, use the Android SDK Manager to do
+so.</p></dd>
+
+<dt>General notes:</dt>
+<dd>
+<ul>
+<li>Fixes a problem in project import, in which source files were deleted in some cases.</li>
+<li>Includes all other ADT 0.9.8 features (see below).</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" />
+ADT 0.9.8</a> <em>(September 2010)</em>
+ <div class="toggleme">
+
+
+</ul>
+</dd>
+
+<dl>
+
+<dt>Dependencies:</dt>
+
+<dd><p>ADT 0.9.8 is now deprecated. Please use ADT 0.9.9 instead.</p></dd>
+
+<dt>General notes:</dt>
+<dd>
+<ul>
+<li>Adds a new Action, "Rename Application Package", to the Android Tools
+contextual menu. The Action does a full application package refactoring.
+<li>Adds support for library projects that don't have a source folder
+called <code>src/</code>. There is now support for any number of source folders,
+with no name restriction. They can even be in subfolder such as
+<code>src/java</code>. If you are already working with library projects created
+in ADT 0.9.7, see <a
+href="{@docRoot}tools/projects/index.html#libraryMigrating">Migrating
+library projects to ADT 0.9.8</a> for important information about moving
+to the new ADT environment.</li>
+<li>Adds support for library projects that depend on other library
+projects.</li>
+<li>Adds support for additional resource qualifiers:
+<code>car</code>/<code>desk</code>, <code>night</code>/<code>notnight</code> and
+<code>navexposed</code>/<code>navhidden</code>.</li>
+<li>Adds more device screen types in the layout editor. All screen
+resolution/density combinations listed in the <a
+href="{@docRoot}guide/practices/screens_support.html#range">Supporting
+Multiple Screens</a> are now available.</li>
+<li>Fixes problems with handling of library project names that
+contain characters that are incompatible with the Eclipse path variable.
+Now properly sets up the link between the main project and the library
+project.</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" />
+ADT 0.9.7</a> <em>(May 2010)</em>
+ <div class="toggleme">
+
+<dl>
+<dt>Library projects:</dt>
+<dd>
+<p>The ADT Plugin now supports the use of <em>library projects</em> during
+development, a capability that lets you store shared Android application
+code and resources in a separate development project. You can then reference the
+library project from other Android projects and, at build time, the tools
+compile the shared code and resources as part of the dependent applications.
+More information about this feature is available in the <a
+href="{@docRoot}tools/projects/index.html#LibraryProjects">Creating and Managing Projects</a> document. </p>
+<p>If you are not developing in Eclipse, <a
+href="tools-notes.html">SDK Tools r6</a> provides the equivalent library
+project support through the Ant build system.</p>
+</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" />
+ADT 0.9.6</a> <em>(March 2010)</em>
+ <div class="toggleme">
+
+<dl>
+<dt>Dependencies:</dt>
+
+<dd><p>ADT 0.9.6 is designed for use with SDK Tools r5 and later. Before
+updating to ADT 0.9.6, we highly recommend that you use the Android SDK Manager to install SDK
+Tools r5 into your SDK.</p></dd>
+
+<dt>General Notes:</dt>
+<dd>
+<ul>
+<li>Editing <code>default.properties</code> outside of Eclipse will now
+automatically update the project.</li>
+<li>Loads the SDK content only when a project requires it. This will make
+Eclipse use less resources when the SDK contains many versions of Android.</li>
+<li>Resolves potential deadlock between modal dialogs, when launching ADT the
+first time with the SDK Usage panel.</li>
+<li>Fixes issues with the New Project Wizard when selecting samples.</li>
+</ul>
+</dd>
+<dt>AVD/SDK Manager:</dt>
+<dd>
+<ul>
+<li>Adds support for platform samples packages.</li>
+<li>Improves support for dependency between packages.</li>
+<li>AVDs now sorted by API level.</li>
+<li>The AVD creation dialog now enforces a minimum SD card size of 9MB.</li>
+<li>Prevents deletion of running AVDs.</li>
+</ul>
+</dd>
+<dt>DDMS:</dt>
+<dd>
+<ul>
+<li>DDMS plug-in now contains the Allocation Tracker view.</li>
+<li>New action in the Logcat view: "Go to problem" lets you go directly from an
+exception trace output to the code.</li>
+</ul>
+</dd>
+<dt>Editors:</dt>
+<dd>
+<ul>
+<li>Explode mode in the Visual Layout Editor adds a margin to all layout objects
+so that it's easier to see embedded or empty layouts.</li>
+<li>Outline mode in the Visual Layout Editor draws layout outline to make it
+easier to see layout objects.</li>
+<li>Several fixes in the configuration selector of the Visual Layout
+Editor.</li>
+</ul>
+</dd>
+<dt>Application launching:</dt>
+<dd>
+<ul>
+<li>Applications launched from ADT now behave as if they were clicked from the
+Home screen.</li>
+<li>Fixes issue where add-on with no optional library would not show up as valid
+targets for application launches.</li>
+<li>Resolves possible crash when launching applications.</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" />
+ADT 0.9.5</a> <em>(December 2009)</em>
+ <div class="toggleme">
+<dl>
+<dt>Dependencies:</dt>
+
+<dd><p>ADT 0.9.5 requires features provided in SDK Tools r4 or higher. If you install
+ADT 0.9.5, which is highly recommended, you should use the Android SDK
+Manager to download the latest SDK Tools into your SDK. For more information,
+see <a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>.</p>
+</dd>
+
+<dt>General notes:</dt>
+<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 skin name specified.</li>
+<li>Fixes XML validation issue in on older Java versions.</li>
+<li>.apk packaging now properly ignores vi swap files as well as hidden files.</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" />
+ADT 0.9.4</a> <em>(October 2009)</em>
+ <div class="toggleme">
+<dl>
+<dt>Dependencies:</dt>
+
+<dd><p>ADT 0.9.4 requires features provided in SDK Tools r3 or higher. If you install
+ADT 0.9.4, which is highly recommended, you should use the Android SDK
+Manager to download the latest SDK Tools into your SDK. For more information,
+see <a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>.</p>
+</dd>
+
+<dt>Project Creation Wizard:</dt>
+<dd>
+<ul>
+<li>New option to create a project from a sample by choosing it from a list.</li>
+</ul>
+</dd>
+
+<dt>Layout Editor:</dt>
+<dd>
+<ul>
+<li>Improved Configuration selector that lets you see how your layout will
+render on different devices. Default device descriptions include ADP1
+and Google Ion, while SDK add-ons can also provide new descriptions.
+A new UI allows you to create custom descriptions.</li>
+<li>Adds a new clipping toggle, to let you see your full layout even if it's
+bigger than the screen.</li>
+</ul>
+</dd>
+
+<dt>DDMS integration:</dt>
+<dd>
+<ul>
+<li>Includes the improvements from the standlone DDMS, revision 3.</li>
+<li>Adds an option to open HPROF files into eclipse instead of writing them on
+disk. If a profiler such as MAT (<a href="http://eclipse.org/mat">Memory Analyzer
+Tool</a>) is installed, it'll open the file.</li>
+</ul>
+</dd>
+
+<dt>Android SDK and AVD Manager integration:</dt>
+<dd>
+<ul>
+<li>Includes the improvements from the standalone Android SDK and AVD Manager,
+revision 3.</li>
+</ul>
+</dd>
+</dl>
+ </div>
+</div>
diff --git a/docs/html/tools/sdk/images/2.0/camera-modes.png b/docs/html/tools/sdk/images/2.0/camera-modes.png
new file mode 100644
index 0000000..ac4c1da
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.0/camera-modes.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.0/email-inbox.png b/docs/html/tools/sdk/images/2.0/email-inbox.png
new file mode 100644
index 0000000..50d1c19
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.0/email-inbox.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.0/mms-search.png b/docs/html/tools/sdk/images/2.0/mms-search.png
new file mode 100644
index 0000000..22c7dca
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.0/mms-search.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.0/multiple-accounts.png b/docs/html/tools/sdk/images/2.0/multiple-accounts.png
new file mode 100644
index 0000000..aa4cb15
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.0/multiple-accounts.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.0/quick-connect.png b/docs/html/tools/sdk/images/2.0/quick-connect.png
new file mode 100644
index 0000000..0bbf7dd
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.0/quick-connect.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.2/22browser.png b/docs/html/tools/sdk/images/2.2/22browser.png
new file mode 100644
index 0000000..817439d
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.2/22browser.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.2/22exchange.png b/docs/html/tools/sdk/images/2.2/22exchange.png
new file mode 100644
index 0000000..1fa1f59
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.2/22exchange.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.2/22gallery.png b/docs/html/tools/sdk/images/2.2/22gallery.png
new file mode 100644
index 0000000..0cb74ad
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.2/22gallery.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.2/22home.png b/docs/html/tools/sdk/images/2.2/22home.png
new file mode 100644
index 0000000..a11ea30
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.2/22home.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.2/22hotspot.png b/docs/html/tools/sdk/images/2.2/22hotspot.png
new file mode 100644
index 0000000..0951439
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.2/22hotspot.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.2/22keyboard.png b/docs/html/tools/sdk/images/2.2/22keyboard.png
new file mode 100644
index 0000000..69f95ca
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.2/22keyboard.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.2/jit-graph.png b/docs/html/tools/sdk/images/2.2/jit-graph.png
new file mode 100644
index 0000000..52b8d60
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.2/jit-graph.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.3/ffc.png b/docs/html/tools/sdk/images/2.3/ffc.png
new file mode 100644
index 0000000..136a395f
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.3/ffc.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.3/home-menu.png b/docs/html/tools/sdk/images/2.3/home-menu.png
new file mode 100644
index 0000000..e9c8620
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.3/home-menu.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.3/home-plain.png b/docs/html/tools/sdk/images/2.3/home-plain.png
new file mode 100644
index 0000000..a6255f6
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.3/home-plain.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.3/nfc.png b/docs/html/tools/sdk/images/2.3/nfc.png
new file mode 100644
index 0000000..a21b6ab
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.3/nfc.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.3/onetouch.png b/docs/html/tools/sdk/images/2.3/onetouch.png
new file mode 100644
index 0000000..2789612
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.3/onetouch.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.3/power.png b/docs/html/tools/sdk/images/2.3/power.png
new file mode 100644
index 0000000..7b0785d
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.3/power.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.3/running.png b/docs/html/tools/sdk/images/2.3/running.png
new file mode 100644
index 0000000..fe9a1a0
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.3/running.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.3/selection.png b/docs/html/tools/sdk/images/2.3/selection.png
new file mode 100644
index 0000000..46ff28c
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.3/selection.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/2.3/sipcall.png b/docs/html/tools/sdk/images/2.3/sipcall.png
new file mode 100644
index 0000000..48a5a1d
--- /dev/null
+++ b/docs/html/tools/sdk/images/2.3/sipcall.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/browser.png b/docs/html/tools/sdk/images/3.0/browser.png
new file mode 100644
index 0000000..0f16b27
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/browser.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/browser_full.png b/docs/html/tools/sdk/images/3.0/browser_full.png
new file mode 100644
index 0000000..08a329d
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/browser_full.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/camera.png b/docs/html/tools/sdk/images/3.0/camera.png
new file mode 100644
index 0000000..7dabdfc
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/camera.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/camera_full.png b/docs/html/tools/sdk/images/3.0/camera_full.png
new file mode 100644
index 0000000..3ee95c9
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/camera_full.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/contacts.png b/docs/html/tools/sdk/images/3.0/contacts.png
new file mode 100644
index 0000000..9304701
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/contacts.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/contacts_full.png b/docs/html/tools/sdk/images/3.0/contacts_full.png
new file mode 100644
index 0000000..b5eaf5b
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/contacts_full.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/copy.png b/docs/html/tools/sdk/images/3.0/copy.png
new file mode 100644
index 0000000..d5a4c3e
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/copy.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/copy_full.png b/docs/html/tools/sdk/images/3.0/copy_full.png
new file mode 100644
index 0000000..124cf52
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/copy_full.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/home_hero1.png b/docs/html/tools/sdk/images/3.0/home_hero1.png
new file mode 100644
index 0000000..c00391f
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/home_hero1.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/home_hero1_full.png b/docs/html/tools/sdk/images/3.0/home_hero1_full.png
new file mode 100644
index 0000000..1910ed2
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/home_hero1_full.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/homescreen_cust_port.png b/docs/html/tools/sdk/images/3.0/homescreen_cust_port.png
new file mode 100644
index 0000000..b003a30
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/homescreen_cust_port.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/homescreen_cust_port_full.png b/docs/html/tools/sdk/images/3.0/homescreen_cust_port_full.png
new file mode 100644
index 0000000..9c64edd
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/homescreen_cust_port_full.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/mail_drag.png b/docs/html/tools/sdk/images/3.0/mail_drag.png
new file mode 100644
index 0000000..1f09a7a
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/mail_drag.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/mail_drag_full.png b/docs/html/tools/sdk/images/3.0/mail_drag_full.png
new file mode 100644
index 0000000..be4472f
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/mail_drag_full.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/tasks.png b/docs/html/tools/sdk/images/3.0/tasks.png
new file mode 100644
index 0000000..a4ba1ba
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/tasks.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/tasks_full.png b/docs/html/tools/sdk/images/3.0/tasks_full.png
new file mode 100644
index 0000000..d2a2241
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/tasks_full.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.0/widgets.png b/docs/html/tools/sdk/images/3.0/widgets.png
new file mode 100644
index 0000000..d847666
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.0/widgets.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.1/controls.png b/docs/html/tools/sdk/images/3.1/controls.png
new file mode 100644
index 0000000..e0ca1f8
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.1/controls.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.1/home.png b/docs/html/tools/sdk/images/3.1/home.png
new file mode 100644
index 0000000..ea0a75a
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.1/home.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.1/home_full.png b/docs/html/tools/sdk/images/3.1/home_full.png
new file mode 100644
index 0000000..2b8e85e
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.1/home_full.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.1/resizeable.png b/docs/html/tools/sdk/images/3.1/resizeable.png
new file mode 100644
index 0000000..c9f5e8e
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.1/resizeable.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/3.1/tasks.png b/docs/html/tools/sdk/images/3.1/tasks.png
new file mode 100644
index 0000000..89d69e5
--- /dev/null
+++ b/docs/html/tools/sdk/images/3.1/tasks.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/allapps-lg.png b/docs/html/tools/sdk/images/4.0/allapps-lg.png
new file mode 100644
index 0000000..f5eba3c
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/allapps-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/allapps.png b/docs/html/tools/sdk/images/4.0/allapps.png
new file mode 100644
index 0000000..317a49a
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/allapps.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/bbench.png b/docs/html/tools/sdk/images/4.0/bbench.png
new file mode 100644
index 0000000..f113092
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/bbench.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/beam-lg.png b/docs/html/tools/sdk/images/4.0/beam-lg.png
new file mode 100644
index 0000000..608fc94
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/beam-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/beam-maps-lg.png b/docs/html/tools/sdk/images/4.0/beam-maps-lg.png
new file mode 100644
index 0000000..96ac235
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/beam-maps-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/beam-maps.png b/docs/html/tools/sdk/images/4.0/beam-maps.png
new file mode 100644
index 0000000..63b6756
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/beam-maps.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/beam.png b/docs/html/tools/sdk/images/4.0/beam.png
new file mode 100644
index 0000000..0eb7d26
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/beam.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/browser-lg.png b/docs/html/tools/sdk/images/4.0/browser-lg.png
new file mode 100644
index 0000000..fe3fe81
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/browser-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/browser-tabs-lg.png b/docs/html/tools/sdk/images/4.0/browser-tabs-lg.png
new file mode 100644
index 0000000..0ea8f10
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/browser-tabs-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/browser-tabs.png b/docs/html/tools/sdk/images/4.0/browser-tabs.png
new file mode 100644
index 0000000..413b0c6
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/browser-tabs.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/browser.png b/docs/html/tools/sdk/images/4.0/browser.png
new file mode 100644
index 0000000..4bc8179
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/browser.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/calendar-widget-lg.png b/docs/html/tools/sdk/images/4.0/calendar-widget-lg.png
new file mode 100644
index 0000000..39fc986
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/calendar-widget-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/calendar-widget.png b/docs/html/tools/sdk/images/4.0/calendar-widget.png
new file mode 100644
index 0000000..80a57f7
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/calendar-widget.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/camera-lg.png b/docs/html/tools/sdk/images/4.0/camera-lg.png
new file mode 100644
index 0000000..7d96a4f
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/camera-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/camera.png b/docs/html/tools/sdk/images/4.0/camera.png
new file mode 100644
index 0000000..7454549
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/camera.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/contact-call-lg.png b/docs/html/tools/sdk/images/4.0/contact-call-lg.png
new file mode 100644
index 0000000..40b1f40
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/contact-call-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/contact-call.png b/docs/html/tools/sdk/images/4.0/contact-call.png
new file mode 100644
index 0000000..5550b57
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/contact-call.png
Binary files differ
diff --git a/docs/html/sdk/images/4.0/contact-call.xcf b/docs/html/tools/sdk/images/4.0/contact-call.xcf
similarity index 100%
rename from docs/html/sdk/images/4.0/contact-call.xcf
rename to docs/html/tools/sdk/images/4.0/contact-call.xcf
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/contact-connect-lg.png b/docs/html/tools/sdk/images/4.0/contact-connect-lg.png
new file mode 100644
index 0000000..ad0d04c
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/contact-connect-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/contact-connect.png b/docs/html/tools/sdk/images/4.0/contact-connect.png
new file mode 100644
index 0000000..d958206
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/contact-connect.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/contact-email-lg.png b/docs/html/tools/sdk/images/4.0/contact-email-lg.png
new file mode 100644
index 0000000..db75a46
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/contact-email-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/contact-email.png b/docs/html/tools/sdk/images/4.0/contact-email.png
new file mode 100644
index 0000000..9e5460d
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/contact-email.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/contact-faves-lg.png b/docs/html/tools/sdk/images/4.0/contact-faves-lg.png
new file mode 100644
index 0000000..1ec3fd0
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/contact-faves-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/contact-faves.png b/docs/html/tools/sdk/images/4.0/contact-faves.png
new file mode 100644
index 0000000..57e4ca6
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/contact-faves.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/face-unlock-lg.png b/docs/html/tools/sdk/images/4.0/face-unlock-lg.png
new file mode 100644
index 0000000..3fd1695
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/face-unlock-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/face-unlock.png b/docs/html/tools/sdk/images/4.0/face-unlock.png
new file mode 100644
index 0000000..00afb83
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/face-unlock.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/folders.xcf b/docs/html/tools/sdk/images/4.0/folders.xcf
new file mode 100644
index 0000000..66cc02c
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/folders.xcf
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/gallery-edit-lg.png b/docs/html/tools/sdk/images/4.0/gallery-edit-lg.png
new file mode 100644
index 0000000..3d6688f
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/gallery-edit-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/gallery-edit.png b/docs/html/tools/sdk/images/4.0/gallery-edit.png
new file mode 100644
index 0000000..69744ec
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/gallery-edit.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/gallery-share-lg.png b/docs/html/tools/sdk/images/4.0/gallery-share-lg.png
new file mode 100644
index 0000000..749f51e
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/gallery-share-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/gallery-share.png b/docs/html/tools/sdk/images/4.0/gallery-share.png
new file mode 100644
index 0000000..443a70c
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/gallery-share.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/gallery-widget.png b/docs/html/tools/sdk/images/4.0/gallery-widget.png
new file mode 100644
index 0000000..e72fd0d
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/gallery-widget.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/home-lg.png b/docs/html/tools/sdk/images/4.0/home-lg.png
new file mode 100644
index 0000000..5b9021d
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/home-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/home.png b/docs/html/tools/sdk/images/4.0/home.png
new file mode 100644
index 0000000..cd24732
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/home.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/live-effects.png b/docs/html/tools/sdk/images/4.0/live-effects.png
new file mode 100644
index 0000000..11a0122
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/live-effects.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/lock-camera-lg.png b/docs/html/tools/sdk/images/4.0/lock-camera-lg.png
new file mode 100644
index 0000000..c82cec6
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/lock-camera-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/lock-camera.png b/docs/html/tools/sdk/images/4.0/lock-camera.png
new file mode 100644
index 0000000..d3cc153
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/lock-camera.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/lock-lg.png b/docs/html/tools/sdk/images/4.0/lock-lg.png
new file mode 100644
index 0000000..b859e11
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/lock-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/lock.png b/docs/html/tools/sdk/images/4.0/lock.png
new file mode 100644
index 0000000..d168826
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/lock.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/quick-responses-lg.png b/docs/html/tools/sdk/images/4.0/quick-responses-lg.png
new file mode 100644
index 0000000..39cea9a
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/quick-responses-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/quick-responses.png b/docs/html/tools/sdk/images/4.0/quick-responses.png
new file mode 100644
index 0000000..d43f348
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/quick-responses.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/screenshot-lg.png b/docs/html/tools/sdk/images/4.0/screenshot-lg.png
new file mode 100644
index 0000000..30ac339
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/screenshot-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/screenshot.png b/docs/html/tools/sdk/images/4.0/screenshot.png
new file mode 100644
index 0000000..b23c913
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/screenshot.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/tasks-lg.png b/docs/html/tools/sdk/images/4.0/tasks-lg.png
new file mode 100644
index 0000000..58b5c5d
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/tasks-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/tasks.png b/docs/html/tools/sdk/images/4.0/tasks.png
new file mode 100644
index 0000000..34a9d4a
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/tasks.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/text-replace-lg.png b/docs/html/tools/sdk/images/4.0/text-replace-lg.png
new file mode 100644
index 0000000..047d802
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/text-replace-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/text-replace.png b/docs/html/tools/sdk/images/4.0/text-replace.png
new file mode 100644
index 0000000..d2bda3e
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/text-replace.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/tts-lg.png b/docs/html/tools/sdk/images/4.0/tts-lg.png
new file mode 100644
index 0000000..2f49051
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/tts-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/tts.png b/docs/html/tools/sdk/images/4.0/tts.png
new file mode 100644
index 0000000..3eae634
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/tts.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/usage-all-lg.png b/docs/html/tools/sdk/images/4.0/usage-all-lg.png
new file mode 100644
index 0000000..fd7eeba
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/usage-all-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/usage-all.png b/docs/html/tools/sdk/images/4.0/usage-all.png
new file mode 100644
index 0000000..048db83
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/usage-all.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/usage-maps-lg.png b/docs/html/tools/sdk/images/4.0/usage-maps-lg.png
new file mode 100644
index 0000000..b144370
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/usage-maps-lg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/4.0/usage-maps.png b/docs/html/tools/sdk/images/4.0/usage-maps.png
new file mode 100644
index 0000000..a6dcd21
--- /dev/null
+++ b/docs/html/tools/sdk/images/4.0/usage-maps.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/battery.png b/docs/html/tools/sdk/images/battery.png
new file mode 100644
index 0000000..10fd16b
--- /dev/null
+++ b/docs/html/tools/sdk/images/battery.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/camera.png b/docs/html/tools/sdk/images/camera.png
new file mode 100644
index 0000000..6078388
--- /dev/null
+++ b/docs/html/tools/sdk/images/camera.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/donut_small_bg.png b/docs/html/tools/sdk/images/donut_small_bg.png
new file mode 100644
index 0000000..f514b50
--- /dev/null
+++ b/docs/html/tools/sdk/images/donut_small_bg.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/market.png b/docs/html/tools/sdk/images/market.png
new file mode 100644
index 0000000..8d11134
--- /dev/null
+++ b/docs/html/tools/sdk/images/market.png
Binary files differ
diff --git a/docs/html/tools/sdk/images/search.png b/docs/html/tools/sdk/images/search.png
new file mode 100644
index 0000000..10ab910
--- /dev/null
+++ b/docs/html/tools/sdk/images/search.png
Binary files differ
diff --git a/docs/html/tools/sdk/index.jd b/docs/html/tools/sdk/index.jd
new file mode 100644
index 0000000..fb71065
--- /dev/null
+++ b/docs/html/tools/sdk/index.jd
@@ -0,0 +1,10 @@
+page.title=Android SDK
+header.hide=1
+
+@jd:body
+
+<p>This page should not exist.</p>
+
+
+
+
diff --git a/docs/html/tools/sdk/installing.jd b/docs/html/tools/sdk/installing.jd
new file mode 100644
index 0000000..4837ab7
--- /dev/null
+++ b/docs/html/tools/sdk/installing.jd
@@ -0,0 +1,590 @@
+page.title=Installing the SDK
+
+@jd:body
+
+
+<script type="text/javascript">
+function toggleDiv(link) {
+ var toggleable = $(link).parent();
+ if (toggleable.hasClass("closed")) {
+ //$(".toggleme", toggleable).slideDown("fast");
+ toggleable.removeClass("closed");
+ toggleable.addClass("open");
+ $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot +
+"assets/images/triangle-opened.png"));
+ } else {
+ //$(".toggleme", toggleable).slideUp("fast");
+ toggleable.removeClass("open");
+ toggleable.addClass("closed");
+ $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot +
+"assets/images/triangle-closed.png"));
+ }
+ return false;
+}
+</script>
+<style>
+.toggleable {
+ padding: .25em 1em 0em 1em;
+ margin-bottom: 0;
+}
+.toggleme {
+ padding: 1em 1em 0 2em;
+ line-height:1em;
+}
+.toggleable a {
+ text-decoration:none;
+}
+.toggleme a {
+ text-decoration:underline;
+}
+.toggleable.closed .toggleme {
+ display:none;
+}
+#jd-content .toggle-img {
+ margin:0;
+}
+</style>
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#Preparing">1. Preparing Your Development Computer</a></li>
+ <li><a href="#Installing">2. Downloading the SDK Starter Package</a></li>
+ <li><a href="#InstallingADT">3. Installing the ADT Plugin for Eclipse</a></li>
+ <li><a href="#AddingComponents">4. Adding Platforms and Other Packages</a>
+ <ol>
+ <li><a href="#components">Available Packages</a></li>
+ <li><a href="#which">Recommended Packages</a></li>
+ </ol></li>
+ <li><a href="#sdkContents">5. Exploring the SDK (Optional)</a></li>
+ <li><a href="#NextSteps">Next Steps</a></li>
+ <li><a href="#troubleshooting">Troubleshooting</a></li>
+ </ol>
+
+<h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin for Eclipse</a></li>
+ <li><a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a></li>
+ </ol>
+
+</div>
+</div>
+
+<p>This page describes how to install the Android SDK
+and set up your development environment for the first time.</p>
+
+<p>If you encounter any problems during installation, see the
+<a href="#troubleshooting">Troubleshooting</a> section at the bottom of
+this page.</p>
+
+<h4>Updating?</h4>
+
+<p>If you already have an Android SDK, use the Android SDK Manager tool to install
+updated tools and new Android platforms into your existing environment. For information about how to
+do that, see <a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>.</p>
+
+
+<h2 id="Preparing">Step 1. Preparing Your Development Computer</h2>
+
+<p>Before getting started with the Android SDK, take a moment to confirm that
+your development computer meets the <a href="requirements.html">System
+Requirements</a>. In particular, you might need to install the <a
+href="http://java.sun.com/javase/downloads/index.jsp">JDK</a>, if you don't have it already. </p>
+
+<p>If you will be developing in Eclipse with the Android Development
+Tools (ADT) Plugin—the recommended path if you are new to
+Android—make sure that you have a suitable version of Eclipse
+installed on your computer as described in the
+<a href="requirements.html">System Requirements</a> document.
+If you need to install Eclipse, you can download it from this location: </p>
+
+<p style="margin-left:2em;"><a href=
+"http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a></p>
+
+<p>The "Eclipse Classic" version is recommended. Otherwise, a Java or
+RCP version of Eclipse is recommended.</p>
+
+
+<h2 id="Installing">Step 2. Downloading the SDK Starter Package</h2>
+
+<p>The SDK starter package is not a full
+development environment—it includes only the core SDK Tools, which you can
+use to download the rest of the SDK packages (such as the latest Android platform).</p>
+
+<p>If you haven't already, get the latest version of the SDK starter package from the <a
+href="{@docRoot}sdk/index.html">SDK download page</a>.</p>
+
+<p>If you downloaded a {@code .zip} or {@code .tgz} package (instead of the SDK installer), unpack
+it to a safe location on your machine. By default, the SDK files are unpacked
+into a directory named <code>android-sdk-<machine-platform></code>.</p>
+
+<p>If you downloaded the Windows installer ({@code .exe} file), run it now and it will check
+whether the proper Java SE Development Kit (JDK) is installed (installing it, if necessary), then
+install the SDK Tools into a default location (which you can modify).</p>
+
+<p>Make a note of the name and location of the SDK directory on your system—you will need to
+refer to the SDK directory later, when setting up the ADT plugin and when using
+the SDK tools from the command line.</p>
+
+
+<h2 id="InstallingADT">Step 3. Installing the ADT Plugin for Eclipse</h2>
+
+<p>Android offers a custom plugin for the Eclipse IDE, called Android
+Development Tools (ADT), that is designed to give you a powerful, integrated
+environment in which to build Android applications. It extends the capabilites
+of Eclipse to let you quickly set up new Android projects, create an application
+UI, debug your applications
+using the Android SDK tools, and even export signed (or unsigned) APKs in order
+to distribute your application. In general, developing in Eclipse with ADT is a
+highly recommended approach and is the fastest way to get started with Android.
+</p>
+
+<p>If you'd like to use ADT for developing Android applications, install it now.
+Read <a href="{@docRoot}tools/sdk/eclipse-adt.html#installing">Installing the ADT Plugin</a> for
+step-by-step installation instructions, then return here to continue the
+last step in setting up your Android SDK.</p>
+
+<p>If you prefer to work in a different IDE, you do not need to
+install Eclipse or ADT. Instead, you can directly use the SDK tools to build and
+debug your application. The <a href="{@docRoot}tools/workflow/index.html">Introduction</a>
+to Android application development outlines the major steps that you need to complete when
+developing in Eclipse or other IDEs.</p>
+
+
+
+<h2 id="AddingComponents">Step 4. Adding Platforms and Other Packages</h2>
+
+<p>The last step in setting up your SDK is using the Android SDK Manager (a
+tool included in the SDK starter package) to download essential SDK packages into your development
+environment.</p>
+
+<p>The SDK uses a modular structure that separates the major parts of the SDK—Android platform
+versions, add-ons, tools, samples, and documentation—into a set of separately installable
+packages. The SDK starter package, which you've already downloaded, includes only a single
+package: the latest version of the SDK Tools. To develop an Android application, you also need to
+download at least one Android platform and the associated platform tools. You can add other
+packages and platforms as well, which is highly recommended.</p>
+
+<p>If you used the Windows installer, when you complete the installation wizard, it will launch the
+Android SDK Manager with a default set of platforms and other packages selected
+for you to install. Simply click <strong>Install</strong> to accept the recommended set of
+packages and install them. You can then skip to <a href="#sdkContents">Step 5</a>, but we
+recommend you first read the section about the <a href="#components">Available Packages</a> to
+better understand the packages available from the Android SDK Manager.</p>
+
+<p>You can launch the Android SDK Manager in one of the following ways:</p>
+<ul>
+ <li>From within Eclipse, select <strong>Window > Android SDK Manager</strong>.</li>
+ <li>On Windows, double-click the <code>SDK Manager.exe</code> file at the root of the Android
+SDK directory.</li>
+ <li>On Mac or Linux, open a terminal and navigate to the <code>tools/</code> directory in the
+Android SDK, then execute: <pre>android</pre> </li>
+</ul>
+
+<p>To download packages, use the graphical UI of the Android SDK
+Manager to browse the SDK repository and select new or updated
+packages (see figure 1). The Android SDK Manager installs the selected packages in
+your SDK environment. For information about which packages you should download, see <a
+href="#which">Recommended Packages</a>.</p>
+
+<img src="/images/sdk_manager_packages.png" />
+<p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager's
+<strong>Available Packages</strong> panel, which shows the SDK packages that are
+available for you to download into your environment.</p>
+
+
+<h3 id="components">Available Packages</h3>
+
+<p>By default, there are two repositories of packages for your SDK: <em>Android
+Repository</em> and <em>Third party Add-ons</em>.</p>
+
+<p>The <em>Android Repository</em> offers these types of packages:</p>
+
+<ul>
+<li><strong>SDK Tools</strong> — Contains tools for debugging and testing your application
+and other utility tools. These tools are installed with the Android SDK starter package and receive
+periodic updates. You can access these tools in the <code><sdk>/tools/</code> directory of
+your SDK. To learn more about
+them, see <a href="{@docRoot}tools/index.html#tools-sdk">SDK Tools</a> in the
+developer guide.</li>
+
+<li><strong>SDK Platform-tools</strong> — Contains platform-dependent tools for developing
+and debugging your application. These tools support the latest features of the Android platform and
+are typically updated only when a new platform becomes available. You can access these tools in the
+<code><sdk>/platform-tools/</code> directory. To learn more about them, see <a
+href="{@docRoot}tools/index.html#tools-platform">Platform Tools</a> in the
+developer guide.</li>
+
+<li><strong>Android platforms</strong> — An SDK platform is
+available for every production Android platform deployable to Android-powered devices. Each
+SDK platform package includes a fully compliant Android library, system image, sample code,
+and emulator skins. To learn more about a specific platform, see the list of platforms that appears
+under the section "Downloadable SDK Packages" on the left part of this page.</li>
+
+<li><strong>USB Driver for Windows</strong> (Windows only) — Contains driver files
+that you can install on your Windows computer, so that you can run and debug
+your applications on an actual device. You <em>do not</em> need the USB driver unless
+you plan to debug your application on an actual Android-powered device. If you
+develop on Mac OS X or Linux, you do not need a special driver to debug
+your application on an Android-powered device. See <a
+href="{@docRoot}tools/device.html">Using Hardware Devices</a> for more information
+about developing on a real device.</li>
+
+<li><strong>Samples</strong> — Contains the sample code and apps available
+for each Android development platform. If you are just getting started with
+Android development, make sure to download the samples to your SDK. <!--The download
+includes not only a set of very useful sample apps, but also the source for <a
+href="{@docRoot}training/basics/firstapp/index.html">Building Your First App</a> and other
+tutorials. --></li>
+
+<li><strong>Documentation</strong> — Contains a local copy of the latest
+multiversion documentation for the Android framework API. </li>
+</ul>
+
+<p>The <em>Third party Add-ons</em> provide packages that allow you to create a development
+environment using a specific Android external library (such as the Google Maps library) or a
+customized (but fully compliant) Android system image. You can add additional Add-on repositories by
+clicking <strong>Add Add-on Site</strong>.</p>
+
+
+<h3 id="which">Recommended Packages</h3>
+
+<p>The SDK repository contains a range of packages that you can download.
+Use the table below to determine which packages you need, based on whether you
+want to set up a basic, recommended, or full development environment:
+</p>
+
+<table style="width:95%">
+
+<tr>
+<th>Environment</th>
+<th>SDK Package</th>
+<th>Comments</th>
+</tr>
+
+<tr>
+<td rowspan="3" style="font-size:.9em;background-color:#FFE;">Basic</td>
+<td style="font-size:.9em;background-color:#FFE;">SDK Tools</td>
+<td style="font-size:.9em;background-color:#FFE;">If you've just installed
+the SDK starter package, then you already have the latest version of this package. The
+SDK Tools package is required to develop an Android application. Make sure you keep this up to
+date.</td>
+</tr>
+
+<tr>
+<td style="font-size:.9em;background-color:#FFE;">SDK Platform-tools</td>
+<td style="font-size:.9em;background-color:#FFE;">This includes more tools that are required
+for application development. These tools are platform-dependent and typically update only when
+a new SDK platform is made available, in order to support new features in the platform. These
+tools are always backward compatible with older platforms, but you must be sure that you have
+the latest version of these tools when you install a new SDK platform.</td>
+</tr>
+
+<tr>
+<td style="font-size:.9em;background-color:#FFE;">SDK platform</td>
+<td style="font-size:.9em;background-color:#FFE;">You need to download <strong
+style="color:red">at least one platform</strong> into your environment, so that
+you will be able to compile your application and set up an Android Virtual
+Device (AVD) to run it on (in the emulator). To start with, just download the
+latest version of the platform. Later, if you plan to publish your application,
+you will want to download other platforms as well, so that you can test your
+application on the full range of Android platform versions that your application supports.</td>
+</tr>
+<tr>
+<td colspan="2"
+style="border:none;text-align:center;font-size:1.5em;font-weight:bold;">+</td><td
+style="border:none"></td>
+</tr>
+<tr>
+<td rowspan="3">Recommended<br/>(plus Basic)</td>
+<td>Documentation</td>
+<td>The Documentation package is useful because it lets you work offline and
+also look up API reference information from inside Eclipse.</td>
+</tr>
+
+<tr>
+<td>Samples</td>
+<td>The Samples packages give you source code that you can use to learn about
+Android, load as a project and run, or reuse in your own app. Note that multiple
+samples packages are available — one for each Android platform version. When
+you are choosing a samples package to download, select the one whose API Level
+matches the API Level of the Android platform that you plan to use.</td>
+</tr>
+<tr>
+<td>Usb Driver</td>
+<td>The Usb Driver package is needed only if you are developing on Windows and
+have an Android-powered device on which you want to install your application for
+debugging and testing. For Mac OS X and Linux platforms, no
+special driver is needed.</td>
+</tr>
+<tr>
+<td colspan="2"
+style="border:none;text-align:center;font-size:1.5em;font-weight:bold;">+</td><td
+style="border:none"></td>
+</tr>
+<tr>
+<td rowspan="3">Full<br/>(plus Recommended)</td>
+<td>Google APIs</td>
+<td>The Google APIs add-on gives your application access to the Maps external
+library, which makes it easy to display and manipulate Maps data in your
+application. </td>
+</tr>
+<tr>
+<td>Additional SDK Platforms</td>
+<td>If you plan to publish your application, you will want to download
+additional platforms corresponding to the Android platform versions on which you
+want the application to run. The recommended approach is to compile your
+application against the lowest version you want to support, but test it against
+higher versions that you intend the application to run on. You can test your
+applications on different platforms by running in an Android Virtual Device
+(AVD) on the Android emulator.</td>
+</tr>
+
+</table>
+
+<p>Once you've installed at least the basic configuration of SDK packages, you're ready to start
+developing Android apps. The next section describes the contents of the Android SDK to familiarize
+you with the packages you've just installed.</p>
+
+<p>For more information about using the Android SDK Manager, see the <a
+href="{@docRoot}sdk/exploring.html">Exploring the SDK</a> document. </p>
+
+
+<h2 id="sdkContents">Step 5. Exploring the SDK (Optional)</h2>
+
+<p>Once you've installed the SDK and downloaded the platforms, documentation,
+and add-ons that you need, we suggest that you open the SDK directory and take a look at what's
+inside.</p>
+
+<p>The table below describes the full SDK directory contents, with packages
+installed. </p>
+
+<table>
+<tr>
+<th colspan="3">Name</th><th>Description</th>
+</tr>
+<tr>
+<td colspan="3"><code>add-ons/</code></td>
+<td>Contains add-ons to the Android SDK development
+environment, which let you develop against external libraries that are available on some
+devices. </td>
+</tr>
+<tr>
+<td colspan="3"><code>docs/</code></td>
+<td>A full set of documentation in HTML format, including the Developer's Guide,
+API Reference, and other information. To read the documentation, load the
+file <code>offline.html</code> in a web browser.</td>
+</tr>
+<tr>
+<td colspan="3"><code>platform-tools/</code></td>
+<td>Contains platform-dependent development tools that may be updated with each platform release.
+The platform tools include the Android Debug Bridge ({@code adb}) as well as other tools that you
+don't typically use directly. These tools are separate from the development tools in the {@code
+tools/} directory because these tools may be updated in order to support new
+features in the latest Android platform.</td>
+</tr>
+<tr>
+<td colspan="3"><code>platforms/</code></td>
+<td>Contains a set of Android platform versions that you can develop
+applications against, each in a separate directory. </td>
+</tr>
+<tr>
+<td style="width:2em;"></td>
+<td colspan="2"><code><em><platform></em>/</code></td>
+<td>Platform version directory, for example "android-11". All platform version directories contain
+a similar set of files and subdirectory structure. Each platform directory also includes the
+Android library (<code>android.jar</code>) that is used to compile applications against the
+platform version.</td>
+</tr>
+<tr>
+<td colspan="3"><code>samples/</code></td>
+<td>Sample code and apps that are specific to platform version.</td>
+</tr>
+<tr>
+<td colspan="3"><code>tools/</code></td>
+<td>Contains the set of development and profiling tools that are platform-independent, such
+as the emulator, the Android SDK Manager, the AVD Manager, <code>ddms</code>,
+<code>hierarchyviewer</code>
+and more. The tools in this directory may be updated at any time using the Android SDK
+Manager and are independent of platform releases.</td>
+</tr>
+<tr>
+<td colspan="3"><code>SDK Readme.txt</code></td>
+<td>A file that explains how to perform the initial setup of your SDK,
+including how to launch the Android SDK Manager tool on all
+platforms.</td>
+</tr>
+<tr>
+<td colspan="3"><code>SDK Manager.exe</code></td>
+<td>Windows SDK only. A shortcut that launches the Android SDK
+Manager tool, which you use to add packages to your SDK.</td>
+</tr>
+<!--<tr>
+<td colspan="3"><code>documentation.html</code></td>
+<td>A file that loads the entry page for the local Android SDK
+documentation.</td>
+</tr>-->
+
+</table>
+
+
+<p>Optionally, you might want to add the location of the SDK's <code>tools/</code> and
+<code>platform-tools</code> to your <code>PATH</code> environment variable, to provide easy
+access to the tools.</p>
+
+
+<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" />
+ How to update your PATH</a>
+ <div class="toggleme">
+
+<p>Adding both <code>tools/</code> and <code>platform-tools/</code> to your PATH lets you run
+command line <a href="{@docRoot}tools/index.html">tools</a> without needing to
+supply the full path to the tool directories. Depending on your operating system, you can
+include these directories in your PATH in the following way:</p>
+
+<ul>
+
+ <li>On Windows, right-click on My Computer, and select Properties.
+ Under the Advanced tab, hit the Environment Variables button, and in the
+ dialog that comes up, double-click on Path (under System Variables). Add the full path to the
+ <code>tools/</code> and <code>platform-tools/</code> directories to the path. </li>
+
+ <li>On Linux, edit your <code>~/.bash_profile</code> or <code>~/.bashrc</code> file. Look
+ for a line that sets the PATH environment variable and add the
+ full path to the <code>tools/</code> and <code>platform-tools/</code> directories to it. If you
+ don't see a line setting the path, you can add one:
+ <pre>export PATH=${PATH}:<sdk>/tools:<sdk>/platform-tools</pre>
+ </li>
+
+ <li>On a Mac OS X, look in your home directory for <code>.bash_profile</code> and
+ proceed as for Linux. You can create the <code>.bash_profile</code> if
+ you don't already have one. </li>
+</ul>
+
+</div><!-- end toggleme -->
+</div><!-- end toggleable -->
+
+
+<h2 id="NextSteps">Next Steps</h2>
+<p>Once you have completed installation, you are ready to
+begin developing applications. Here are a few ways you can get started: </p>
+
+<p><strong>Set up the Hello World application</strong></p>
+<ul>
+ <li>If you have just installed the SDK for the first time, go to the <a
+ href="{@docRoot}training/basics/firstapp/index.html">Hello
+ World tutorial</a>. The tutorial takes you step-by-step through the process
+ of setting up your first Android project, including setting up an Android
+ Virtual Device (AVD) on which to run the application.
+</li>
+</ul>
+
+<p class="note">Following the Hello World tutorial is an essential
+first step in getting started with Android development. </p>
+
+<p><strong>Learn about Android</strong></p>
+<ul>
+ <li>Take a look at the <a href="{@docRoot}guide/index.html">Dev
+ Guide</a> and the types of information it provides.</li>
+ <li>Read an introduction to Android as a platform in <a
+ href="{@docRoot}guide/basics/what-is-android.html">What is
+ Android?</a></li>
+ <li>Learn about the Android framework and how applications run on it in
+ <a href="{@docRoot}guide/components/fundamentals.html">Application
+ Fundamentals</a>.</li>
+ <li>Take a look at the Android framework API specification in the <a
+ href="{@docRoot}reference/packages.html">Reference</a> tab.</li>
+</ul>
+
+<p><strong>Explore the development tools</strong></p>
+<ul>
+ <li>Get an overview of the <a
+ href="{@docRoot}tools/index.html">development
+ tools</a> that are available to you.</li>
+ <li>Read the <a href="{@docRoot}tools/workflow/index.html">Introduction</a> to Android
+application development.
+ </li>
+ <li>Read <a href="{@docRoot}tools/device.html">Using Hardware Devices</a> to learn
+how to set up an Android-powered device so you can run and test your application.</li>
+</ul>
+
+<p><strong>Follow the Notepad tutorial</strong></p>
+
+<ul>
+ <li>The <a href="{@docRoot}resources/tutorials/notepad/index.html">
+ Notepad Tutorial</a> shows you how to build a full Android application
+ and provides helpful commentary on the Android system and API. The
+ Notepad tutorial helps you bring together the important design
+ and architectural concepts in a moderately complex application.
+ </li>
+</ul>
+<p class="note">Following the Notepad tutorial is an excellent
+second step in getting started with Android development. </p>
+
+<p><strong>Explore some code</strong></p>
+
+<ul>
+ <li>The Android SDK includes sample code and applications for each platform
+version. You can browse the samples in the <a
+href="{@docRoot}resources/index.html">Resources</a> tab or download them
+into your SDK using the Android SDK Manager. Once you've downloaded the
+samples, you'll find them in
+<code><em><sdk></em>/samples/<em><platform>/</em></code>. </li>
+</ul>
+
+<p><strong>Visit the Android developer groups</strong></p>
+<ul>
+ <li>Take a look at the <a
+ href="{@docRoot}resources/community-groups.html">Community</a> pages to see a list of
+ Android developers groups. In particular, you might want to look at the
+ <a href="http://groups.google.com/group/android-developers">Android
+ Developers</a> group to get a sense for what the Android developer
+ community is like.</li>
+</ul>
+
+<h2 id="troubleshooting">Troubleshooting</h2>
+
+<h3>Ubuntu Linux Notes</h3>
+
+<ul>
+ <li>If you need help installing and configuring Java on your
+ development machine, you might find these resources helpful:
+ <ul>
+ <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/Java </a></li>
+ <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/JavaInstallation</a></li>
+ </ul>
+ </li>
+ <li>Here are the steps to install Java and Eclipse, prior to installing
+ the Android SDK and ADT Plugin.
+ <ol>
+ <li>If you are running a 64-bit distribution on your development
+ machine, you need to install the <code>ia32-libs</code> package using
+ <code>apt-get:</code>:
+ <pre>apt-get install ia32-libs</pre>
+ </li>
+ <li>Next, install Java: <pre>apt-get install sun-java6-jdk</pre></li>
+ <li>The Ubuntu package manager does not currently offer an Eclipse 3.3
+ version for download, so we recommend that you download Eclipse from
+ eclipse.org (<a
+ href="http://www.eclipse.org/downloads/">http://www.eclipse.org/
+ downloads/</a>). A Java or RCP version of Eclipse is recommended.</li>
+ <li>Follow the steps given in previous sections to install the SDK
+ and the ADT plugin. </li>
+ </ol>
+ </li>
+</ul>
+
+<h3>Other Linux Notes</h3>
+
+<ul>
+ <li>If JDK is already installed on your development computer, please
+ take a moment to make sure that it meets the version requirements listed
+ in the <a href="requirements.html">System Requirements</a>.
+ In particular, note that some Linux distributions may include JDK 1.4 or Gnu
+ Compiler for Java, both of which are not supported for Android development.</li>
+</ul>
diff --git a/docs/html/tools/sdk/libraries.jd b/docs/html/tools/sdk/libraries.jd
new file mode 100644
index 0000000..9e47c4a
--- /dev/null
+++ b/docs/html/tools/sdk/libraries.jd
@@ -0,0 +1,9 @@
+page.title=Libraries
+
+@jd:body
+
+
+
+<p>A page that lists libraries and links to release notes. Links to dashboards etc.</p>
+
+
diff --git a/docs/html/sdk/ndk/1.5_r1/index.jd b/docs/html/tools/sdk/ndk/1.5_r1/index.jd
similarity index 100%
rename from docs/html/sdk/ndk/1.5_r1/index.jd
rename to docs/html/tools/sdk/ndk/1.5_r1/index.jd
diff --git a/docs/html/sdk/ndk/1.6_r1/index.jd b/docs/html/tools/sdk/ndk/1.6_r1/index.jd
similarity index 100%
rename from docs/html/sdk/ndk/1.6_r1/index.jd
rename to docs/html/tools/sdk/ndk/1.6_r1/index.jd
diff --git a/docs/html/tools/sdk/ndk/index.jd b/docs/html/tools/sdk/ndk/index.jd
new file mode 100644
index 0000000..956d939
--- /dev/null
+++ b/docs/html/tools/sdk/ndk/index.jd
@@ -0,0 +1,1128 @@
+ndk=true
+
+ndk.win_download=android-ndk-r8-windows.zip
+ndk.win_bytes=109928336
+ndk.win_checksum=37b1a2576f28752fcc09e1b9c07e3f14
+
+ndk.mac_download=android-ndk-r8-darwin-x86.tar.bz2
+ndk.mac_bytes=96650992
+ndk.mac_checksum=81ce5de731f945692123b377afe0bad9
+
+ndk.linux_download=android-ndk-r8-linux-x86.tar.bz2
+ndk.linux_bytes=88310791
+ndk.linux_checksum=5c9afc9695ad67c61f82fbf896803c05
+
+page.title=Android NDK
+
+@jd:body
+
+<h2 id="notes">Revisions</h2>
+
+<p>The sections below provide information and notes about successive releases of
+the NDK, as denoted by revision number. </p>
+
+<script type="text/javascript">
+function toggleDiv(link) {
+ var toggleable = $(link).parent();
+ if (toggleable.hasClass("closed")) {
+ //$(".toggleme", toggleable).slideDown("fast");
+ toggleable.removeClass("closed");
+ toggleable.addClass("open");
+ $(".toggle-img", toggleable).attr("title", "hide").attr("src", "{@docRoot}assets/images/triangle-opened.png");
+ } else {
+ //$(".toggleme", toggleable).slideUp("fast");
+ toggleable.removeClass("open");
+ toggleable.addClass("closed");
+ $(".toggle-img", toggleable).attr("title", "show").attr("src", "/assets/images/triangle-closed.png");
+ }
+ return false;
+}
+</script>
+
+<style>
+.toggleable {
+padding: 5px 0 0;
+}
+.toggleme {
+ padding: 10px 0 0 20px;
+}
+.toggleable a {
+ text-decoration:none;
+}
+.toggleme a {
+ text-decoration:underline;
+}
+.toggleable.closed .toggleme {
+ display:none;
+}
+#jd-content .toggle-img {
+ margin:0 5px 3px 0;
+}
+</style>
+
+<div class="toggleable open">
+ <a href="#" onclick="return toggleDiv(this)"><img src=
+ "{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px">
+ Android NDK, Revision 8</a> <em>(May 2012)</em>
+
+ <div class="toggleme">
+ <p>This release of the NDK includes support for MIPS ABI and a few additional fixes.</p>
+
+ </dl>
+ <dt>New features:</dt>
+
+ <dd>
+ <ul>
+ <li>Added support for the MIPS ABI, which allows you to generate machine code that runs on
+ compatible MIPS-based Android devices. Major features for MIPS include MIPS-specific
+ toolchains, system headers, libraries and debugging support. For more details regarding
+ MIPS support, see {@code docs/CPU-MIPS.html} in the NDK package.
+
+ <p>By default, code is generated for ARM-based devices. You can add {@code mips} to
+ your {@code APP_ABI} definition in your {@code Application.mk} file to build
+ for MIPS platforms. For example, the following line instructs {@code ndk-build}
+ to build your code for three distinct ABIs:</p>
+
+ <pre>APP_ABI := armeabi armeabi-v7a <strong>mips</strong></pre>
+
+ <p>Unless you rely on architecture-specific assembly sources, such as ARM assembly
+ code, you should not need to touch your {@code Android.mk} files to build MIPS
+ machine code.</p>
+ </li>
+
+ <li>You can build a standalone MIPS toolchain using the {@code --arch=mips}
+ option when calling <code>make-standalone-toolchain.sh</code>. See
+ {@code docs/STANDALONE-TOOLCHAIN.html} for more details.
+ </li>
+ </ul>
+
+ <p class="note"><strong>Note:</strong> To ensure that your applications are available
+to users only if their devices are capable of running them, Google Play filters applications based
+on the instruction set information included in your application — no action is needed on your part
+to enable the filtering. Additionally, the Android system itself also checks your application at
+install time and allows the installation to continue only if the application provides a library that
+is compiled for the device's CPU architecture.</p>
+ </dd>
+
+ <dt>Important bug fixes:</dt>
+
+ <dd>
+ <ul>
+ <li>Fixed a typo in GAbi++ implementation where the result of {@code
+ dynamic_cast<D>(b)} of base class object {@code b} to derived class {@code D} is
+ incorrectly adjusted in the opposite direction from the base class.
+ (<a href="http://code.google.com/p/android/issues/detail?id=28721">Issue 28721</a>)
+ </li>
+ <li>Fixed an issue in which {@code make-standalone-toolchain.sh} fails to copy
+ {@code libsupc++.*}.</li>
+ </ul>
+ </dd>
+
+ <dt>Other bug fixes:</dt>
+
+ <dd>
+ <ul>
+ <li>Fixed {@code ndk-build.cmd} to ensure that {@code ndk-build.cmd} works correctly even
+ if the user has redefined the {@code SHELL} environment variable, which may be changed
+ when installing a variety of development tools in Windows environments.
+ </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">
+ Android NDK, Revision 7c</a> <em>(April 2012)</em>
+
+ <div class="toggleme">
+ <p>This release of the NDK includes an important fix for Tegra2-based devices, and a few
+additional fixes and improvements:</p>
+
+ <dl>
+ <dt>Important bug fixes:</dt>
+
+ <dd>
+ <ul>
+ <li>Fixed GNU STL armeabi-v7a binaries to not crash on non-NEON
+ devices. The files provided with NDK r7b were not configured properly,
+ resulting in crashes on Tegra2-based devices and others when trying to use
+ certain floating-point functions (e.g., {@code cosf}, {@code sinf}, {@code expf}).</li>
+ </ul>
+ </dd>
+
+ <dt>Important changes:</dt>
+
+ <dd>
+ <ul>
+ <li>Added support for custom output directories through the {@code NDK_OUT}
+ environment variable. When defined, this variable is used to store all
+ intermediate generated files, instead of {@code $PROJECT_PATH/obj}. The variable is
+ also recognized by {@code ndk-gdb}. </li>
+ <li>Added support for building modules with hundreds or even thousands of source
+ files by defining {@code LOCAL_SHORT_COMMANDS} to {@code true} in your {@code Android.mk}.
+ <p>This change forces the NDK build system to put most linker or archiver options
+ into list files, as a work-around for command-line length limitations.
+ See {@code docs/ANDROID-MK.html} for details.</p>
+ </li>
+ </ul>
+ </dd>
+
+ <dt>Other bug fixes:</dt>
+
+ <dd>
+ <ul>
+ <li>Fixed {@code android_getCpuCount()} implementation in the {@code cpufeatures}
+helper library. On certain devices, where cores are enabled dynamically by the system, the previous
+implementation would report the total number of <em>active</em> cores the first time the function
+was called, rather than the total number of <em>physically available</em> cores.</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">
+ Android NDK, Revision 7b</a> <em>(February 2012)</em>
+
+ <div class="toggleme">
+ <p>This release of the NDK includes fixes for native Windows builds, Cygwin and many other
+ improvements:</p>
+
+ <dl>
+ <dt>Important bug fixes:</dt>
+
+ <dd>
+ <ul>
+ <li>Updated {@code sys/atomics.h} to avoid correctness issues
+ on some multi-core ARM-based devices. Rebuild your unmodified sources with this
+ version of the NDK and this problem should be completely eliminated.
+ For more details, read {@code docs/ANDROID-ATOMICS.html}.</li>
+ <li>Reverted to {@code binutils} 2.19 to fix debugging issues that
+ appeared in NDK r7 (which switched to {@code binutils} 2.20.1).</li>
+ <li>Fixed {@code ndk-build} on 32-bit Linux. A packaging error put a 64-bit version
+ of the {@code awk} executable under {@code prebuilt/linux-x86/bin} in NDK r7.</li>
+ <li>Fixed native Windows build ({@code ndk-build.cmd}). Other build modes were not
+ affected. The fixes include:
+ <ul>
+ <li>Removed an infinite loop / stack overflow bug that happened when trying
+ to call {@code ndk-build.cmd} from a directory that was <em>not</em> the top of
+ your project path (e.g., in any sub-directory of it).</li>
+ <li>Fixed a problem where the auto-generated dependency files were ignored. This
+ meant that updating a header didn't trigger recompilation of sources that included
+ it.</li>
+ <li>Fixed a problem where special characters in files or paths, other than spaces and
+ quotes, were not correctly handled.</li>
+ </ul>
+ </li>
+ <li>Fixed the standalone toolchain to generate proper binaries when using
+ {@code -lstdc++} (i.e., linking against the GNU {@code libstdc++} C++ runtime). You
+ should use {@code -lgnustl_shared} if you want to link against the shared library
+ version or {@code -lstdc++} for the static version.
+
+ <p>See {@code docs/STANDALONE-TOOLCHAIN.html} for more details about this fix.</p>
+ </li>
+ <li>Fixed {@code gnustl_shared} on Cygwin. The linker complained that it couldn't find
+ {@code libsupc++.a} even though the file was at the right location.</li>
+ <li>Fixed Cygwin C++ link when not using any specific C++ runtime through
+ {@code APP_STL}.</li>
+ </ul>
+ </dd>
+ </dl>
+
+ <dl>
+ <dt>Other changes:</dt>
+
+ <dd>
+ <ul>
+ <li>When your application uses the GNU {@code libstdc++} runtime, the compiler will
+ no longer forcibly enable exceptions and RTTI. This change results in smaller code.
+ <p>If you need these features, you must do one of the following:</p>
+ <ul>
+ <li>Enable exceptions and/or RTTI explicitly in your modules or
+ {@code Application.mk}. (recommended)</li>
+ <li>Define {@code APP_GNUSTL_FORCE_CPP_FEATURES} to {@code 'exceptions'},
+ {@code 'rtti'} or both in your {@code Application.mk}. See
+ {@code docs/APPLICATION-MK.html} for more details.</li>
+ </ul>
+ </li>
+ <li>{@code ndk-gdb} now works properly when your application has private services
+ running in independent processes. It debugs the main application process, instead of the
+ first process listed by {@code ps}, which is usually a service process.</li>
+ <li>Fixed a rare bug where NDK r7 would fail to honor the {@code LOCAL_ARM_MODE} value
+ and always compile certain source files (but not all) to 32-bit instructions.</li>
+ <li>{@code stlport}: Refresh the sources to match the Android platform version. This
+ update fixes a few minor bugs:
+ <ul>
+ <li>Fixed instantiation of an incomplete type</li>
+ <li>Fixed minor "==" versus "=" typo</li>
+ <li>Used {@code memmove} instead of {@code memcpy} in {@code string::assign}</li>
+ <li>Added better handling of {@code IsNANorINF}, {@code IsINF}, {@code IsNegNAN},
+ etc.</li>
+ </ul>
+ <p>For complete details, see the commit log.</p>
+ </li>
+ <li>{@code stlport}: Removed 5 unnecessary static initializers from the library.</li>
+ <li>The GNU libstdc++ libraries for armeabi-v7a were mistakenly compiled for
+ armeabi instead. This change had no impact on correctness, but using the right
+ ABI should provide slightly better performance.</li>
+ <li>The {@code cpu-features} helper library was updated to report three optional
+ x86 CPU features ({@code SSSE3}, {@code MOVBE} and {@code POPCNT}). See
+ {@code docs/CPU-FEATURES.html} for more details.</li>
+ <li>{@code docs/NDK-BUILD.html} was updated to mention {@code NDK_APPLICATION_MK} instead
+ of {@code NDK_APP_APPLICATION_MK} to select a custom {@code Application.mk} file.</li>
+ <li>Cygwin: {@code ndk-build} no longer creates an empty "NUL" file in the current
+ directory when invoked.</li>
+ <li>Cygwin: Added better automatic dependency detection. In the previous version, it
+ didn't work properly in the following cases:
+ <ul>
+ <li>When the Cygwin drive prefix was not {@code /cygdrive}.</li>
+ <li>When using drive-less mounts, for example, when Cygwin would translate
+ {@code /home} to {@code \\server\subdir} instead of {@code C:\Some\Dir}.</li>
+ </ul>
+ </li>
+ <li>Cygwin: {@code ndk-build} does not try to use the native Windows tools under
+ {@code $NDK/prebuilt/windows/bin} with certain versions of Cygwin and/or GNU Make.</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">
+ Android NDK, Revision 7</a> <em>(November 2011)</em>
+
+ <div class="toggleme">
+ <p>This release of the NDK includes new features to support the Android 4.0 platform as well
+ as many other additions and improvements:</p>
+
+ <dl>
+ <dt>New features</dt>
+
+ <dd>
+ <ul>
+ <li>Added official NDK APIs for Android 4.0 (API level 14), which adds the following
+ native features to the platform:
+
+ <ul>
+ <li>Added native multimedia API based on the Khronos Group OpenMAX AL™ 1.0.1
+ standard. The new <code><OMXAL/OpenMAXAL.h></code> and
+ <code><OMXAL/OpenMAXAL_Android.h></code> headers allow applications targeting
+ API level 14 to perform multimedia output directly from native code by using a new
+ Android-specific buffer queue interface. For more details, see
+ <code>docs/openmaxal/index.html</code> and <a href=
+ "http://www.khronos.org/openmax/">http://www.khronos.org/openmax/</a>.</li>
+
+ <li>Updated the native audio API based on the Khronos Group OpenSL ES 1.0.1™
+ standard. With API Level 14, you can now decode compressed audio (e.g. MP3, AAC,
+ Vorbis) to PCM. For more details, see <code>docs/opensles/index.html</code> and
+ <a href=
+ "http://www.khronos.org/opensles">http://www.khronos.org/opensles/</a>.</li>
+ </ul>
+ </li>
+
+ <li>Added CCache support. To speed up large rebuilds, define the
+ <code>NDK_CCACHE</code> environment variable to <code>ccache</code> (or the path to
+ your <code>ccache</code> binary). When declared, the NDK build system automatically
+ uses CCache when compiling any source file. For example:
+ <pre>
+export NDK_CCACHE=ccache
+</pre>
+ <p class="note"><strong>Note:</strong> CCache is not included in the NDK release
+ so you must have it installed prior to using it. For more information about CCache, see
+ <a href="http://ccache.samba.org">http://ccache.samba.org</a>.</p>
+ </li>
+
+ <li>Added support for setting <code>APP_ABI</code> to <code>all</code> to indicate that
+ you want to build your NDK modules for all the ABIs supported by your given NDK
+ release. This means that either one of the following two lines in your
+ <code>Application.mk</code> are equivalent with this release:
+ <pre>
+APP_ABI := all
+APP_ABI := armeabi armeabi-v7a x86
+</pre>
+
+ <p>This also works if you define <code>APP_ABI</code> when calling
+ <code>ndk-build</code> from the command-line, which is a quick way to check that your
+ project builds for all supported ABIs without changing the project's
+ <code>Application.mk file</code>. For example:</p>
+ <pre>
+ndk-build APP_ABI=all
+</pre>
+ </li>
+
+ <li>Added a <code>LOCAL_CPP_FEATURES</code> variable in <code>Android.mk</code> that
+ allows you to declare which C++ features (RTTI or Exceptions) your module uses. This
+ ensures that the final linking works correctly if you have prebuilt modules that depend
+ on these features. See <code>docs/ANDROID-MK.html</code> and
+ <code>docs/CPLUSPLUS-SUPPORT.html</code> for more details.</li>
+
+ <li>Shortened paths to source and object files that are used in build commands. When
+ invoking <code>$NDK/ndk-build</code> from your project path, the paths to the source,
+ object, and binary files that are passed to the build commands are significantly
+ shorter now, because they are passed relative to the current directory. This is useful
+ when building projects with a lot of source files, to avoid limits on the maximum
+ command line length supported by your host operating system. The behavior is unchanged
+ if you invoke <code>ndk-build</code> from a sub-directory of your project tree, or if
+ you define <code>NDK_PROJECT_PATH</code> to point to a specific directory.</li>
+ </ul>
+ </dd>
+
+ <dt>Experimental features</dt>
+
+ <dd>
+ You can now build your NDK source files on Windows <em>without</em> Cygwin by calling the
+ <code>ndk-build.cmd</code> script from the command line from your project path. The
+ script takes exactly the same arguments as the original <code>ndk-build</code> script.
+ The Windows NDK package comes with its own prebuilt binaries for GNU Make, Awk and other
+ tools required by the build. You should not need to install anything else to get a
+ working build system.
+
+ <p class="caution"><strong>Important:</strong> <code>ndk-gdb</code> does not work on
+ Windows, so you still need Cygwin to debug.</p>
+
+ <p>This feature is still experimental, so feel free to try it and report issues on the
+ <a href="http://b.android.com">public bug database</a> or <a href=
+ "http://groups.google.com/group/android-ndk">public forum</a>. All samples and unit tests
+ shipped with the NDK succesfully compile with this feature.</p>
+ </dd>
+
+ <dt>Important bug fixes</dt>
+
+ <dd>
+ <ul>
+ <li>Imported shared libraries are now installed by default to the target installation
+ location (<code>libs/<abi></code>) if <code>APP_MODULES</code> is not defined in
+ your <code>Application.mk</code>. For example, if a top-level module <code>foo</code>
+ imports a module <code>bar</code>, then both <code>libfoo.so</code> and
+ <code>libbar.so</code> are copied to the install location. Previously, only
+ <code>libfoo.so</code> was copied, unless you listed <code>bar</code> in your
+ <code>APP_MODULES</code> too. If you define <code>APP_MODULES</code> explicitly, the
+ behavior is unchanged.</li>
+
+ <li><code>ndk-gdb</code> now works correctly for activities with multiple categories in
+ their MAIN intent filters.</li>
+
+ <li>Static library imports are now properly transitive. For example, if a top-level
+ module <code>foo</code> imports static library <code>bar</code> that imports static
+ library <code>zoo</code>, the <code>libfoo.so</code> will now be linked against both
+ <code>libbar.a</code> and <code>libzoo.a</code>.</li>
+ </ul>
+ </dd>
+
+ <dt>Other changes</dt>
+
+ <dd>
+ <ul>
+ <li><code>docs/NATIVE-ACTIVITY.HTML</code>: Fixed typo. The minimum API level should be
+ 9, not 8 for native activities.</li>
+
+ <li><code>docs/STABLE-APIS.html</code>: Added missing documentation listing EGL as a
+ supported stable API, starting from API level 9.</li>
+
+ <li><code>download-toolchain-sources.sh</code>: Updated to download the toolchain
+ sources from <a href="http://android.googlesource.com">android.googlesource.com</a>,
+ which is the new location for the AOSP servers.</li>
+
+ <li>Added a new C++ support runtime named <code>gabi++</code>. More details about it
+ are available in the updated <code>docs/CPLUSPLUS-SUPPORT.html</code>.</li>
+
+ <li>Added a new C++ support runtime named <code>gnustl_shared</code> that corresponds
+ to the shared library version of GNU libstdc++ v3 (GPLv3 license). See more info at
+ <code>docs/CPLUSPLUS-SUPPORT.html</code></li>
+
+ <li>Added support for RTTI in the STLport C++ runtimes (no support for
+ exceptions).</li>
+
+ <li>Added support for multiple file extensions in <code>LOCAL_CPP_EXTENSION</code>. For
+ example, to compile both <code>foo.cpp</code> and <code>bar.cxx</code> as C++ sources,
+ declare the following:
+ <pre>
+LOCAL_CPP_EXTENSION := .cpp .cxx
+</pre>
+ </li>
+
+ <li>Removed many unwanted exported symbols from the link-time shared system libraries
+ provided by the NDK. This ensures that code generated with the standalone toolchain
+ doesn't risk to accidentally depend on a non-stable ABI symbol (e.g. any libgcc.a
+ symbol that changes each time the toolchain used to build the platform is changed)</li>
+
+ <li>Refreshed the EGL and OpenGLES Khronos headers to support more extensions. Note
+ that this does <em>not</em> change the NDK ABIs for the corresponding libraries,
+ because each extension must be probed at runtime by the client application.
+
+ <p>The extensions that are available depend on your actual device and GPU drivers,
+ not the platform version the device runs on. The header changes simply add new
+ constants and types to make it easier to use the extensions when they have been
+ probed with <code>eglGetProcAddress()</code> or <code>glGetProcAddress()</code>. The
+ following list describes the newly supported extensions:</p>
+
+ <dl>
+ <dt>GLES 1.x</dt>
+
+ <dd>
+ <ul>
+ <li><code>GL_OES_vertex_array_object</code></li>
+
+ <li><code>GL_OES_EGL_image_external</code></li>
+
+ <li><code>GL_APPLE_texture_2D_limited_npot</code></li>
+
+ <li><code>GL_EXT_blend_minmax</code></li>
+
+ <li><code>GL_EXT_discard_framebuffer</code></li>
+
+ <li><code>GL_EXT_multi_draw_arrays</code></li>
+
+ <li><code>GL_EXT_read_format_bgra</code></li>
+
+ <li><code>GL_EXT_texture_filter_anisotropic</code></li>
+
+ <li><code>GL_EXT_texture_format_BGRA8888</code></li>
+
+ <li><code>GL_EXT_texture_lod_bias</code></li>
+
+ <li><code>GL_IMG_read_format</code></li>
+
+ <li><code>GL_IMG_texture_compression_pvrtc</code></li>
+
+ <li><code>GL_IMG_texture_env_enhanced_fixed_function</code></li>
+
+ <li><code>GL_IMG_user_clip_plane</code></li>
+
+ <li><code>GL_IMG_multisampled_render_to_texture</code></li>
+
+ <li><code>GL_NV_fence</code></li>
+
+ <li><code>GL_QCOM_driver_control</code></li>
+
+ <li><code>GL_QCOM_extended_get</code></li>
+
+ <li><code>GL_QCOM_extended_get2</code></li>
+
+ <li><code>GL_QCOM_perfmon_global_mode</code></li>
+
+ <li><code>GL_QCOM_writeonly_rendering</code></li>
+
+ <li><code>GL_QCOM_tiled_rendering</code></li>
+ </ul>
+ </dd>
+
+ <dt>GLES 2.0</dt>
+
+ <dd>
+ <ul>
+ <li><code>GL_OES_element_index_uint</code></li>
+
+ <li><code>GL_OES_get_program_binary</code></li>
+
+ <li><code>GL_OES_mapbuffer</code></li>
+
+ <li><code>GL_OES_packed_depth_stencil</code></li>
+
+ <li><code>GL_OES_texture_3D</code></li>
+
+ <li><code>GL_OES_texture_float</code></li>
+
+ <li><code>GL_OES_texture_float_linear</code></li>
+
+ <li><code>GL_OES_texture_half_float_linear</code></li>
+
+ <li><code>GL_OES_texture_npot</code></li>
+
+ <li><code>GL_OES_vertex_array_object</code></li>
+
+ <li><code>GL_OES_EGL_image_external</code></li>
+
+ <li><code>GL_AMD_program_binary_Z400</code></li>
+
+ <li><code>GL_EXT_blend_minmax</code></li>
+
+ <li><code>GL_EXT_discard_framebuffer</code></li>
+
+ <li><code>GL_EXT_multi_draw_arrays</code></li>
+
+ <li><code>GL_EXT_read_format_bgra</code></li>
+
+ <li><code>GL_EXT_texture_format_BGRA8888</code></li>
+
+ <li><code>GL_EXT_texture_compression_dxt1</code></li>
+
+ <li><code>GL_IMG_program_binary</code></li>
+
+ <li><code>GL_IMG_read_format</code></li>
+
+ <li><code>GL_IMG_shader_binary</code></li>
+
+ <li><code>GL_IMG_texture_compression_pvrtc</code></li>
+
+ <li><code>GL_IMG_multisampled_render_to_texture</code></li>
+
+ <li><code>GL_NV_coverage_sample</code></li>
+
+ <li><code>GL_NV_depth_nonlinear</code></li>
+
+ <li><code>GL_QCOM_extended_get</code></li>
+
+ <li><code>GL_QCOM_extended_get2</code></li>
+
+ <li><code>GL_QCOM_writeonly_rendering</code></li>
+
+ <li><code>GL_QCOM_tiled_rendering</code></li>
+ </ul>
+ </dd>
+
+ <dt>EGL</dt>
+
+ <dd>
+ <ul>
+ <li><code>EGL_ANDROID_recordable</code></li>
+
+ <li><code>EGL_NV_system_time</code></li>
+ </ul>
+ </dd>
+ </dl>
+ </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">
+ Android NDK, Revision 6b</a> <em>(August 2011)</em>
+
+ <div class="toggleme">
+ <p>This release of the NDK does not include any new features compared to r6. The r6b release
+ addresses the following issues in the r6 release:</p>
+ <dl>
+ <dt>Important bug fixes</dt>
+ <dd>
+ <ul>
+ <li>Fixed the build when <code>APP_ABI="armeabi x86"</code> is used for
+ multi-architecture builds.</li>
+ <li>Fixed the location of prebuilt STLport binaries in the NDK release package.
+ A bug in the packaging script placed them in the wrong location.</li>
+ <li>Fixed <code>atexit()</code> usage in shared libraries with the x86standalone
+ toolchain.</li>
+ <li>Fixed <code>make-standalone-toolchain.sh --arch=x86</code>. It used to fail
+ to copy the proper GNU libstdc++ binaries to the right location.</li>
+ <li>Fixed the standalone toolchain linker warnings about missing the definition and
+ size for the <code>__dso_handle</code> symbol (ARM only).</li>
+ <li>Fixed the inclusion order of <code>$(SYSROOT)/usr/include</code> for x86 builds.
+ See the <a href="http://code.google.com/p/android/issues/detail?id=18540">bug</a> for
+ more information.</li>
+ <li>Fixed the definitions of <code>ptrdiff_t</code> and <code>size_t</code> in
+ x86-specific systems when they are used with the x86 standalone toolchain.</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">
+ Android NDK, Revision 6</a> <em>(July 2011)</em>
+
+ <div class="toggleme">
+ <p>This release of the NDK includes support for the x86 ABI and other minor changes.
+ For detailed information describing the changes in this release, read the
+ <code>CHANGES.HTML</code> document included in the NDK package.
+ </p>
+ <dl>
+ <dt>General notes:</dt>
+ <dd>
+ <ul>
+ <li>Adds support for the x86 ABI, which allows you to generate machine code
+ that runs on compatible x86-based Android devices. Major features for x86
+ include x86-specific toolchains, system headers, libraries and
+ debugging support. For all of the details regarding x86 support,
+ see <code>docs/CPU-X86.html</code> in the NDK package.
+
+ <p>By default, code is generated for ARM-based devices, but you can add x86 to your
+ <code>APP_ABI</code> definition in your <code>Application.mk</code> file to build
+ for x86 platforms. For example, the following line instructs <code>ndk-build</code>
+ to build your code for three distinct ABIs:</p>
+
+ <pre>APP_ABI := armeabi armeabi-v7a x86</pre>
+
+ <p>Unless you rely on ARM-based assembly sources, you shouldn't need to touch
+ your <code>Android.mk</code> files to build x86 machine code.</p>
+
+ </li>
+
+ <li>You can build a standalone x86 toolchain using the <code>--toolchain=x86-4.4.3</code>
+ option when calling <code>make-standalone-toolchain.sh</code>. See
+ <code>docs/STANDALONE-TOOLCHAIN.html</code> for more details.
+ </li>
+ <li>The new <code>ndk-stack</code> tool lets you translate stack traces in
+ <code>logcat</code> that are generated by native code. The tool translates
+ instruction addresses into a readable format that contains things such
+ as the function, source file, and line number corresponding to each stack frame.
+ For more information and a usage example, see <code>docs/NDK-STACK.html</code>.
+ </li>
+ </ul>
+ </dd>
+ <dt>Other changes:</dt>
+ <dd><code>arm-eabi-4.4.0</code>, which had been deprecated since NDK r5, has been
+ removed from the NDK distribution.</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">
+ Android NDK, Revision 5c</a> <em>(June 2011)</em>
+
+ <div class="toggleme">
+ <p>This release of the NDK does not include any new features compared to r5b. The r5c release
+ addresses the following problems in the r5b release:</p>
+ <dl>
+ <dt>Important bug fixes:</dt>
+ <dd>
+ <ul>
+ <li><code>ndk-build</code>: Fixed a rare bug that appeared when trying to perform parallel
+ builds of debuggable projects.</li>
+
+ <li>Fixed a typo that prevented <code>LOCAL_WHOLE_STATIC_LIBRARIES</code> to work
+ correctly with the new toolchain and added documentation for this in
+ <code>docs/ANDROID-MK.html</code>.</li>
+
+ <li>Fixed a bug where code linked against <code>gnustl_static</code> crashed when run on
+ platform releases older than API level 8 (Android 2.2).</li>
+
+ <li><code>ndk-gdb</code>: Fixed a bug that caused a segmentation fault when debugging Android 3.0
+ or newer devices.</li>
+
+ <li><code><android/input.h></code>: Two functions that were introduced in API level
+ 9 (Android 2.3) were incorrect and are fixed. While this breaks the source API, the
+ binary interface to the system is unchanged. The incorrect functions were missing a
+ <code>history_index</code> parameter, and the correct definitions are shown below:
+<pre>
+float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event,
+ size_t pointer_index,
+ size_t history_index);
+
+float AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event,
+ size_t pointer_index,
+ size_t history_index);
+</pre>
+ </li>
+
+ <li>Updated the C library ARM binary for API level 9 (Android 2.3) to correctly expose at
+ link time new functions that were added in that API level (for example,
+ <code>pthread_rwlock_init</code>).</li>
+
+ </ul>
+ </dd>
+
+ <dt>Minor improvements and fixes:</dt>
+ <dd>
+ <ul>
+ <li>Object files are now always linked in the order they appear in
+ <code>LOCAL_SRC_FILES</code>. This was not the case previously because the files were
+ grouped by source extensions instead.</li>
+
+ <li>When <code>import-module</code> fails, it now prints the list of directories that
+ were searched. This is useful to check that the <code>NDK_MODULE_PATH</code> definition
+ used by the build system is correct.</li>
+
+ <li>When <code>import-module</code> succeeds, it now prints the directory where the
+ module was found to the log (visible with <code>NDK_LOG=1</code>).</li>
+
+ <li>Increased the build speed of debuggable applications when there is a very large number
+ of include directories in the project.</li>
+
+ <li><code>ndk-gdb</code>: Better detection of <code>adb shell</code> failures and improved
+ error messages.</li>
+
+ <li><code><pthread.h></code>: Fixed the definition of
+ <code>PTHREAD_RWLOCK_INITIALIZER</code> for API level 9 (Android 2.3) and higher.</li>
+
+ <li>Fixed an issue where a module could import itself, resulting in an infinite loop in
+ GNU Make.</li>
+
+ <li>Fixed a bug that caused the build to fail if <code>LOCAL_ARM_NEON</code> was set to
+ true (typo in <code>build/core/build-binary.mk</code>).</li>
+
+ <li>Fixed a bug that prevented the compilation of </code>.s</code> assembly files
+ (<code>.S</code> files were okay).</li>
+ </ul>
+ </dd>
+ </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" /> Android NDK, Revision 5b</a> <em>(January 2011)</em>
+
+ <div class="toggleme">
+ <p>This release of the NDK does not include any new features compared to r5. The r5b release addresses the
+ following problems in the r5 release:
+ </p>
+ <ul>
+ <li>The r5 binaries required glibc 2.11, but the r5b binaries are generated with a special
+ toolchain that targets glibc 2.7 or higher instead. The Linux toolchain binaries now run on Ubuntu 8.04 or higher. </li>
+ <li>Fixes a compiler bug in the arm-linux-androideabi-4.4.3 toolchain.
+ The previous binary generated invalid thumb instruction sequences when
+ dealing with signed chars.</li>
+ <li>Adds missing documentation for the
+ "gnustl_static" value for APP_STL, that allows you to link against
+ a static library version of GNU libstdc++. </li>
+ <li>The following <code>ndk-build</code> issues are fixed:
+ <ul>
+ <li>A bug that created inconsistent dependency files when a
+ compilation error occured on Windows. This prevented a proper build after
+ the error was fixed in the source code.</li>
+ <li>A Cygwin-specific bug where using very short paths for
+ the Android NDK installation or the project path led to the
+ generation of invalid dependency files. This made incremental builds
+ impossible.</li>
+ <li>A typo that prevented the cpufeatures library from working correctly
+ with the new NDK toolchain.</li>
+ <li>Builds in Cygwin are faster by avoiding calls to <code>cygpath -m</code>
+ from GNU Make for every source or object file, which caused problems
+ with very large source trees. In case this doesn't work properly, define <code>NDK_USE_CYGPATH=1</code> in your
+ environment to use <code>cygpath -m</code> again.</li>
+ <li>The Cygwin installation now notifies the user of invalid installation paths that contain spaces. Previously, an invalid path
+ would output an error that complained about an incorrect version of GNU Make, even if the right one was installed.
+ </ul>
+ </li>
+ <li>Fixed a typo that prevented the <code>NDK_MODULE_PATH</code> environment variable from working properly when
+ it contained multiple directories separated with a colon. </li>
+ <li>The <code>prebuilt-common.sh</code> script contains fixes to check the compiler for 64-bit
+ generated machine code, instead of relying on the host tag, which
+ allows the 32-bit toolchain to rebuild properly on Snow Leopard. The toolchain rebuild scripts now also support
+ using a 32-bit host toolchain.</li>
+ <li>A missing declaration for <code>INET_ADDRSTRLEN</code> was added to <code><netinet/in.h></code>.</li>
+ <li>Missing declarations for <code>IN6_IS_ADDR_MC_NODELOCAL</code> and <code>IN6_IS_ADDR_MC_GLOBAL</code> were added to <code><netinet/in6.h></code>.</li>
+ <li>'asm' was replaced with '__asm__' in <code><asm/byteorder.h></code> to allow compilation with <code>-std=c99</code>.</li>
+ </ul>
+ </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" /> Android NDK, Revision 5</a> <em>(December 2010)</em>
+
+ <div class="toggleme">
+ <p>This release of the NDK includes many new APIs, most of which are introduced to
+ support the development of games and similar applications that make extensive use
+ of native code. Using the APIs, developers have direct native access to events, audio,
+ graphics and window management, assets, and storage. Developers can also implement the
+ Android application lifecycle in native code with help from the new
+ {@link android.app.NativeActivity} class. For detailed information describing the changes in this
+ release, read the <code>CHANGES.HTML</code> document included in the downloaded NDK package.
+ </p>
+ <dl>
+ <dt>General notes:</dt>
+ <dd>
+ <ul>
+ <li>Adds support for native activities, which allows you to implement the
+ Android application lifecycle in native code.</li>
+
+ <li>Adds native support for the following:
+
+ <ul>
+
+ <li>Input subsystem (such as the keyboard and touch screen)</li>
+
+ <li>Access to sensor data (accelerometer, compass, gyroscope, etc).</li>
+
+ <li>Event loop APIs to wait for things such as input and sensor events.</li>
+
+ <li>Window and surface subsystem</li>
+
+ <li>Audio APIs based on the OpenSL ES standard that support playback and recording
+ as well as control over platform audio effects</li>
+
+ <li>Access to assets packaged in an <code>.apk</code> file.</li>
+
+ </ul>
+ </li>
+
+ <li>Includes a new toolchain (based on GCC 4.4.3), which generates better code, and can also now
+ be used as a standalone cross-compiler, for people who want to build their stuff with
+ <code>./configure && make</code>. See
+ docs/STANDALONE-TOOLCHAIN.html for the details. The binaries for GCC 4.4.0 are still provided,
+ but the 4.2.1 binaries were removed.</li>
+
+ <li>Adds support for prebuilt static and shared libraries (docs/PREBUILTS.html) and module
+ exports and imports to make sharing and reuse of third-party modules much easier
+ (docs/IMPORT-MODULE.html explains why).</li>
+
+ <li>Provides a default C++ STL implementation (based on STLport) as a helper module. It can be used either
+ as a static or shared library (details and usage examples are in sources/android/stlport/README). Prebuilt
+ binaries for STLport (static or shared) and GNU libstdc++ (static only) are also provided if you choose to
+ compile against those libraries instead of the default C++ STL implementation.
+ C++ Exceptions and RTTI are not supported in the default STL implementation. For more information, see
+ docs/CPLUSPLUS-SUPPORT.HTML.</li>
+
+ <li>Includes improvements to the <code>cpufeatures</code> helper library that improves reporting
+ of the CPU type (some devices previously reported ARMv7 CPU when the device really was an ARMv6). We
+ recommend developers that use this library to rebuild their applications then
+ upload to Google Play to benefit from the improvements.</li>
+
+ <li>Adds an EGL library that lets you create and manage OpenGL ES textures and
+ services.</li>
+
+ <li>Adds new sample applications, <code>native-plasma</code> and <code>native-activity</code>,
+ to demonstrate how to write a native activity.</li>
+
+ <li>Includes many bugfixes and other small improvements; see docs/CHANGES.html for a more
+ detailed list of changes.</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" /> Android NDK, Revision 4b</a> <em>(June 2010)</em>
+
+ <div class="toggleme">
+ <dl>
+ <dt>NDK r4b notes:</dt>
+
+ <dd>
+ <p>Includes fixes for several issues in the NDK build and debugging scripts — if
+ you are using NDK r4, we recommend downloading the NDK r4b build. For detailed
+ information describing the changes in this release, read the CHANGES.TXT document
+ included in the downloaded NDK package.</p>
+ </dd>
+ </dl>
+
+ <dl>
+ <dt>General notes:</dt>
+
+ <dd>
+ <ul>
+ <li>Provides a simplified build system through the new <code>ndk-build</code> build
+ command.</li>
+
+ <li>Adds support for easy native debugging of generated machine code on production
+ devices through the new <code>ndk-gdb</code> command.</li>
+
+ <li>Adds a new Android-specific ABI for ARM-based CPU architectures,
+ <code>armeabi-v7a</code>. The new ABI extends the existing <code>armeabi</code> ABI to
+ include these CPU instruction set extensions:
+
+ <ul>
+ <li>Thumb-2 instructions</li>
+
+ <li>VFP hardware FPU instructions (VFPv3-D16)</li>
+
+ <li>Optional support for ARM Advanced SIMD (NEON) GCC intrinsics and VFPv3-D32.
+ Supported by devices such as Verizon Droid by Motorola, Google Nexus One, and
+ others.</li>
+ </ul>
+ </li>
+
+ <li>Adds a new <code>cpufeatures</code> static library (with sources) that lets your
+ app detect the host device's CPU features at runtime. Specifically, applications can
+ check for ARMv7-A support, as well as VFPv3-D32 and NEON support, then provide separate
+ code paths as needed.</li>
+
+ <li>Adds a sample application, <code>hello-neon</code>, that illustrates how to use the
+ <code>cpufeatures</code> library to check CPU features and then provide an optimized
+ code path using NEON instrinsics, if supported by the CPU.</li>
+
+ <li>Lets you generate machine code for either or both of the instruction sets supported
+ by the NDK. For example, you can build for both ARMv5 and ARMv7-A architectures at the
+ same time and have everything stored to your application's final
+ <code>.apk</code>.</li>
+
+ <li>To ensure that your applications are available to users only if their devices are
+ capable of running them, Google Play now filters applications based on the
+ instruction set information included in your application — no action is needed on
+ your part to enable the filtering. Additionally, the Android system itself also checks
+ your application at install time and allows the installation to continue only if the
+ application provides a library that is compiled for the device's CPU architecture.</li>
+
+ <li>Adds support for Android 2.2, including a new stable API for accessing the pixel
+ buffers of {@link android.graphics.Bitmap} objects from native code.</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" /> Android NDK, Revision 3</a> <em>(March 2010)</em>
+
+ <div class="toggleme">
+ <dl>
+ <dt>General notes:</dt>
+
+ <dd>
+ <ul>
+ <li>Adds OpenGL ES 2.0 native library support.</li>
+
+ <li>Adds a sample application,<code>hello-gl2</code>, that illustrates the use of
+ OpenGL ES 2.0 vertex and fragment shaders.</li>
+
+ <li>The toolchain binaries have been refreshed for this release with GCC 4.4.0, which
+ should generate slightly more compact and efficient machine code than the previous one
+ (4.2.1). The NDK also still provides the 4.2.1 binaries, which you can optionally use
+ to build your machine code.</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" /> Android NDK, Revision 2</a> <em>(September 2009)</em>
+
+ <div class="toggleme">
+ <p>Originally released as "Android 1.6 NDK, Release 1".</p>
+
+ <dl>
+ <dt>General notes:</dt>
+
+ <dd>
+ <ul>
+ <li>Adds OpenGL ES 1.1 native library support.</li>
+
+ <li>Adds a sample application, <code>san-angeles</code>, that renders 3D graphics
+ through the native OpenGL ES APIs, while managing activity lifecycle with a {@link
+ android.opengl.GLSurfaceView} object.</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" /> Android NDK, Revision 1</a> <em>(June 2009)</em>
+
+ <div class="toggleme">
+ <p>Originally released as "Android 1.5 NDK, Release 1".</p>
+
+ <dl>
+ <dt>General notes:</dt>
+
+ <dd>
+ <ul>
+ <li>Includes compiler support (GCC) for ARMv5TE instructions, including Thumb-1
+ instructions.</li>
+
+ <li>Includes system headers for stable native APIs, documentation, and sample
+ applications.</li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+ </div>
+
+ <h2 id="installing">Installing the NDK</h2>
+ <p>Installing the NDK on your development computer is straightforward and involves extracting the
+ NDK from its download package.</p>
+
+ <p>Before you get started make sure that you have downloaded the latest <a href=
+ "{@docRoot}sdk/index.html">Android SDK</a> and upgraded your applications and environment as
+ needed. The NDK is compatible with older platform versions but not older versions of the SDK tools.
+ Also, take a moment to review the <a href="{@docRoot}tools/sdk/ndk/overview.html#reqs">System and
+Software Requirements</a>
+ for the NDK, if you haven't already.</p>
+
+ <p>To install the NDK, follow these steps:</p>
+
+ <ol>
+ <li>From the table at the top of this page, select the NDK package that is appropriate for your
+ development computer and download the package.</li>
+
+ <li>Uncompress the NDK download package using tools available on your computer. When
+ uncompressed, the NDK files are contained in a directory called
+ <code>android-ndk-<version></code>. You can rename the NDK directory if necessary and you
+ can move it to any location on your computer. This documentation refers to the NDK directory as
+ <code><ndk></code>.</li>
+ </ol>
+
+ <p>You are now ready to start working with the NDK.</p>
+
+ <h2 id="gettingstarted">Getting Started with the NDK</h2>
+
+ <p>Once you've installed the NDK successfully, take a few minutes to read the documentation
+ included in the NDK. You can find the documentation in the <code><ndk>/docs/</code>
+ directory. In particular, please read the OVERVIEW.HTML document completely, so that you
+ understand the intent of the NDK and how to use it.</p>
+
+ <p>If you used a previous version of the NDK, take a moment to review the list of NDK changes in
+ the CHANGES.HTML document.</p>
+
+ <p>Here's the general outline of how you work with the NDK tools:</p>
+
+ <ol>
+ <li>Place your native sources under <code><project>/jni/...</code></li>
+
+ <li>Create <code><project>/jni/Android.mk</code> to describe your native sources to the
+ NDK build system</li>
+
+ <li>Optional: Create <code><project>/jni/Application.mk</code>.</li>
+
+ <li>Build your native code by running the 'ndk-build' script from your project's directory. It
+ is located in the top-level NDK directory:
+ <pre class="no-pretty-print">cd <project>
+<ndk>/ndk-build
+</pre>
+
+ <p>The build tools copy the stripped, shared libraries needed by your application to the
+ proper location in the application's project directory.</p>
+ </li>
+
+ <li>Finally, compile your application using the SDK tools in the usual way. The SDK build tools
+ will package the shared libraries in the application's deployable <code>.apk</code> file.</li>
+ </ol>
+
+ <p>For complete information on all of the steps listed above, please see the documentation
+ included with the NDK package.</p>
+
+ <h2 id="samples">Sample Applications</h2>
+
+ <p>The NDK includes sample Android applications that illustrate how to use native code in your
+ Android applications. For more information, see <a href=
+ "{@docRoot}tools/sdk/ndk/overview.html#samples">Sample Applications</a>.</p>
+
+ <h2 id="forum">Discussion Forum and Mailing List</h2>
+
+ <p>If you have questions about the NDK or would like to read or contribute to discussions about
+ it, please visit the <a href="http://groups.google.com/group/android-ndk">android-ndk</a> group
+ and mailing list.</p>
diff --git a/docs/html/tools/sdk/ndk/overview.jd b/docs/html/tools/sdk/ndk/overview.jd
new file mode 100644
index 0000000..98ef1fc
--- /dev/null
+++ b/docs/html/tools/sdk/ndk/overview.jd
@@ -0,0 +1,588 @@
+page.title=What is the NDK?
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+
+ <ol>
+ <li><a href="#choosing">When to Develop in Native Code</a></li>
+ <li>
+ <a href="#contents">Contents of the NDK</a>
+ <ol>
+ <li><a href="#tools">Development tools</a></li>
+
+ <li><a href="#docs">Documentation</a></li>
+
+ <li><a href="#samples">Sample applications</a></li>
+ </ol>
+ </li>
+ <li><a href="#reqs">System and Software Requirements</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>The Android NDK is a toolset that lets you embed components that make use of native code in
+ your Android applications.</p>
+
+ <p>Android applications run in the Dalvik virtual machine. The NDK allows you to implement parts
+ of your applications using native-code languages such as C and C++. This can provide benefits to
+ certain classes of applications, in the form of reuse of existing code and in some cases
+ increased speed.</p>
+
+ <p>The NDK provides:</p>
+
+ <ul>
+ <li>A set of tools and build files used to generate native code libraries from C and C++
+ sources</li>
+
+ <li>A way to embed the corresponding native libraries into an application package file
+ (<code>.apk</code>) that can be deployed on Android devices</li>
+
+ <li>A set of native system headers and libraries that will be supported in all future versions
+ of the Android platform, starting from Android 1.5. Applications that use native activities
+ must be run on Android 2.3 or later.</li>
+
+ <li>Documentation, samples, and tutorials</li>
+ </ul>
+
+ <p>The latest release of the NDK supports the following instruction sets:</p>
+
+ <ul>
+ <li>ARMv5TE, including Thumb-1 instructions (see {@code docs/CPU-ARCH-ABIS.html} for more
+information)</li>
+
+ <li>ARMv7-A, including Thumb-2 and VFPv3-D16 instructions, with optional support for
+ NEON/VFPv3-D32 instructions (see {@code docs/CPU-ARM-NEON.html} for more information)</li>
+
+ <li>x86 instructions (see {@code docs/CPU-X86.html} for more information)</li>
+
+ <li>MIPS instructions (see {@code docs/CPU-MIPS.html} for more information)</li>
+ </ul>
+
+ <p>ARMv5TE machine code will run on all ARM-based Android devices. ARMv7-A will run only on
+ devices such as the Verizon Droid or Google Nexus One that have a compatible CPU. The main
+ difference between the two instruction sets is that ARMv7-A supports hardware FPU, Thumb-2, and
+ NEON instructions. You can target either or both of the instruction sets — ARMv5TE is the
+ default, but switching to ARMv7-A is as easy as adding a single line to the application's
+ <code>Application.mk</code> file, without needing to change anything else in the file. You can also build for
+ both architectures at the same time and have everything stored in the final <code>.apk</code>.
+ Complete information is provided in the CPU-ARCH-ABIS.HTML in the NDK package.</p>
+
+ <p>The NDK provides stable headers for libc (the C library), libm (the Math library), OpenGL ES
+ (3D graphics library), the JNI interface, and other libraries, as listed in the <a href=
+ "#tools">Development Tools</a> section.</p>
+
+ <h2 id="choosing">When to Develop in Native Code</h2>
+
+ <p>The NDK will not benefit most applications. As a developer, you need to balance its benefits
+ against its drawbacks; notably, using native code does not result in an automatic performance
+ increase, but always increases application complexity. In general, you should only use native
+ code if it is essential to your application, not just because you prefer to program in C/C++.</p>
+
+ <p>Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't
+ allocate much memory, such as signal processing, physics simulation, and so on. Simply re-coding
+ a method to run in C usually does not result in a large performance increase. When examining
+ whether or not you should develop in native code, think about your requirements and see if the
+ Android framework APIs provide the functionality that you need. The NDK can, however, can be an
+ effective way to reuse a large corpus of existing C/C++ code.</p>
+
+ <p>The Android framework provides two ways to use native code:</p>
+
+ <ul>
+ <li>Write your application using the Android framework and use JNI to access the APIs provided
+ by the Android NDK. This technique allows you to take advantage of the convenience of the
+ Android framework, but still allows you to write native code when necessary. If you use this
+ approach, your application must target specific, minimum Android platform levels, see <a
+ href="#platform-compat">Android platform compatibility</a> for more information.</li>
+
+ <li>
+ <p>Write a native activity, which allows you to implement the lifecycle callbacks in native
+ code. The Android SDK provides the {@link android.app.NativeActivity} class, which is a
+ convenience class that notifies your
+ native code of any activity lifecycle callbacks (<code>onCreate()</code>, <code>onPause()</code>,
+ <code>onResume()</code>, etc). You can implement the callbacks in your native code to handle
+ these events when they occur. Applications that use native activities must be run on Android
+ 2.3 (API Level 9) or later.</p>
+
+ <p>You cannot access features such as Services and Content Providers natively, so if you want
+ to use them or any other framework API, you can still write JNI code to do so.</p>
+ </li>
+ </ul>
+
+ <h2 id="contents">Contents of the NDK</h2>The NDK contains the APIs, documentation, and sample
+ applications that help you write your native code.
+
+ <h3 id="tools">Development tools</h3>
+
+ <p>The NDK includes a set of cross-toolchains (compilers, linkers, etc..) that can generate
+ native ARM binaries on Linux, OS X, and Windows (with Cygwin) platforms.</p>
+
+ <p>It provides a set of system headers for stable native APIs that are guaranteed to be supported
+ in all later releases of the platform:</p>
+
+ <ul>
+ <li>libc (C library) headers</li>
+
+ <li>libm (math library) headers</li>
+
+ <li>JNI interface headers</li>
+
+ <li>libz (Zlib compression) headers</li>
+
+ <li>liblog (Android logging) header</li>
+
+ <li>OpenGL ES 1.1 and OpenGL ES 2.0 (3D graphics libraries) headers</li>
+
+ <li>libjnigraphics (Pixel buffer access) header (for Android 2.2 and above).</li>
+
+ <li>A Minimal set of headers for C++ support</li>
+
+ <li>OpenSL ES native audio libraries</li>
+
+ <li>Android native application APIS</li>
+ </ul>
+
+ <p>The NDK also provides a build system that lets you work efficiently with your sources, without
+ having to handle the toolchain/platform/CPU/ABI details. You create very short build files to
+ describe which sources to compile and which Android application will use them — the build
+ system compiles the sources and places the shared libraries directly in your application
+ project.</p>
+
+ <p class="caution"><strong>Important:</strong> With the exception of the libraries listed above,
+ native system libraries in the Android platform are <em>not</em> stable and may change in future
+ platform versions. Your applications should <em>only</em> make use of the stable native system
+ libraries provided in this NDK.</p>
+
+ <h3 id="docs">Documentation</h3>
+
+ <p>The NDK package includes a set of documentation that describes the capabilities of the NDK and
+ how to use it to create shared libraries for your Android applications. In this release, the
+ documentation is provided only in the downloadable NDK package. You can find the documentation in
+ the <code><ndk>/docs/</code> directory. Included are these files (partial listing):</p>
+
+ <ul>
+ <li>
+ INSTALL.HTML — describes how to install the NDK and configure it for your host
+ system</li>
+
+ <li>OVERVIEW.HTML — provides an overview of the NDK capabilities and usage</li>
+
+ <li>ANDROID-MK.HTML — describes the use of the Android.mk file, which defines the native
+ sources you want to compile</li>
+
+ <li>APPLICATION-MK.HTML — describes the use of the Application.mk file, which describes
+ the native sources required by your Android application</li>
+ <li>CPLUSPLUS-SUPPORT.HTML — describes the C++ support provided in the Android NDK</li>
+ <li>CPU-ARCH-ABIS.HTML — a description of supported CPU architectures and how to target
+ them.</li>
+
+ <li>CPU-FEATURES.HTML — a description of the <code>cpufeatures</code> static library that
+ lets your application code detect the target device's CPU family and the optional features at
+ runtime.</li>
+
+ <li>CHANGES.HTML — a complete list of changes to the NDK across all releases.</li>
+
+ <li>DEVELOPMENT.HTML — describes how to modify the NDK and generate release packages for it</li>
+
+ <li>HOWTO.HTML — information about common tasks associated with NDK development</li>
+
+ <li>IMPORT-MODULE.HTML — describes how to share and reuse modules</li>
+
+ <li>LICENSES.HTML — information about the various open source licenses that govern the Android NDK</li>
+
+ <li>NATIVE-ACTIVITY.HTML — describes how to implement native activities</li>
+
+ <li>NDK-BUILD.HTML — describes the usage of the ndk-build script</li>
+
+ <li>NDK-GDB.HTML — describes how to use the native code debugger</li>
+
+ <li>PREBUILTS.HTML — information about how shared and static prebuilt libraries work </li>
+
+ <li>STANDALONE-TOOLCHAIN.HTML — describes how to use Android NDK toolchain as a standalone
+ compiler (still in beta).</li>
+
+ <li>SYSTEM-ISSUES.HTML — known issues in the Android system images that you should be
+ aware of, if you are developing using the NDK.</li>
+
+ <li>STABLE-APIS.HTML — a complete list of the stable APIs exposed by headers in the
+ NDK.</li>
+
+ </ul>
+
+ <p>Additionally, the package includes detailed information about the "bionic" C library provided
+ with the Android platform that you should be aware of, if you are developing using the NDK. You
+ can find the documentation in the <code><ndk>/docs/system/libc/</code> directory:</p>
+
+ <ul>
+ <li>OVERVIEW.HTML — provides an overview of the "bionic" C library and the features it
+ offers.</li>
+ </ul>
+
+ <h3 id="samples">Sample applications</h3>
+
+<p>The NDK includes sample applications that illustrate how to use native code in your Android
+ applications:</p>
+
+ <ul>
+ <li><code>hello-jni</code> — a simple application that loads a string from a native
+ method implemented in a shared library and then displays it in the application UI.</li>
+
+ <li><code>two-libs</code> — a simple application that loads a shared library dynamically
+ and calls a native method provided by the library. In this case, the method is implemented in a
+ static library imported by the shared library.</li>
+
+ <li><code>san-angeles</code> — a simple application that renders 3D graphics through the
+ native OpenGL ES APIs, while managing activity lifecycle with a {@link
+ android.opengl.GLSurfaceView} object.</li>
+
+ <li><code>hello-gl2</code> — a simple application that renders a triangle using OpenGL ES
+ 2.0 vertex and fragment shaders.</li>
+
+ <li><code>hello-neon</code> — a simple application that shows how to use the
+ <code>cpufeatures</code> library to check CPU capabilities at runtime, then use NEON intrinsics
+ if supported by the CPU. Specifically, the application implements two versions of a tiny
+ benchmark for a FIR filter loop, a C version and a NEON-optimized version for devices that
+ support it.</li>
+
+ <li><code>bitmap-plasma</code> — a simple application that demonstrates how to access the
+ pixel buffers of Android {@link android.graphics.Bitmap} objects from native code, and uses
+ this to generate an old-school "plasma" effect.</li>
+
+ <li><code>native-activity</code> — a simple application that demonstrates how to use the
+ native-app-glue static library to create a native activity</li>
+
+ <li><code>native-plasma</code> — a version of bitmap-plasma implemented with a native
+ activity.</li>
+ </ul>
+
+ <p>For each sample, the NDK includes the corresponding C source code and the necessary Android.mk
+ and Application.mk files. There are located under <code><ndk>/samples/<name>/</code>
+ and their source code can be found under <code><ndk>/samples/<name>/jni/</code>.</p>
+
+ <p>You can build the shared libraries for the sample apps by going into
+ <code><ndk>/samples/<name>/</code> then calling the <code>ndk-build</code> command.
+ The generated shared libraries will be located under
+ <code><ndk>/samples/<name>/libs/armeabi/</code> for (ARMv5TE machine code) and/or
+ <code><ndk>/samples/<name>/libs/armeabi-v7a/</code> for (ARMv7 machine code).</p>
+
+ <p>Next, build the sample Android applications that use the shared libraries:</p>
+
+ <ul>
+ <li>If you are developing in Eclipse with ADT, use the New Project Wizard to create a new
+ Android project for each sample, using the "Import from Existing Source" option and importing
+ the source from <code><ndk>/samples/<name>/</code>. Then, set up an AVD,
+ if necessary, and build/run the application in the emulator.</li>
+
+ <li>If you are developing with Ant, use the <code>android</code> tool to create the build file
+ for each of the sample projects at <code><ndk>/samples/<name>/</code>.
+ Then set up an AVD, if necessary, build your project in the usual way, and run it in the
+ emulator.</li>
+
+ </ul>
+
+ <p>For more information about developing with the Android SDK tools and what
+ you need to do to create, build, and run your applications, see
+ the <a href="{@docRoot}tools/workflow/index.html">Overview</a>
+ section for developing on Android.</p>
+
+ <h4 id="hello-jni">Exploring the hello-jni Sample</h4>
+
+ <p>The hello-jni sample is a simple demonstration on how to use JNI from an Android application.
+ The HelloJni activity receives a string from a simple C function and displays it in a
+ TextView.</p>
+
+ <p>The main components of the sample include:</p>
+
+ <ul>
+ <li>The familiar basic structure of an Android application (an <code>AndroidManifest.xml</code>
+ file, a <code>src/</code> and <code>res</code> directories, and a main activity)</li>
+
+ <li>A <code>jni/</code> directory that includes the implemented source file for the native code
+ as well as the Android.mk file</li>
+
+ <li>A <code>tests/</code> directory that contains unit test code.</li>
+ </ul>
+
+ <ol>
+ <li>Create a new project in Eclipse from the existing sample source or use the
+ <code>android</code> tool to update the project so it generates a build.xml file that you can
+ use to build the sample.
+
+ <ul>
+ <li>In Eclipse:
+
+ <ol type="a">
+ <li>Click <strong>File > New Android Project...</strong></li>
+
+ <li>Select the <strong>Create project from existing source</strong> radio button.</li>
+
+ <li>Select any API level above Android 1.5.</li>
+
+ <li>In the <strong>Location</strong> field, click <strong>Browse...</strong> and select
+ the <code><ndk-root>/samples/hello-jni</code> directory.</li>
+
+ <li>Click <strong>Finish</strong>.</li>
+ </ol>
+ </li>
+
+ <li>On the command line:
+
+ <ol type="a">
+ <li>Change to the <code><ndk-root>/samples/hello-jni</code> directory.</li>
+
+ <li>Run the following command to generate a build.xml file:
+ <pre class="no-pretty-print">android update project -p . -s</pre>
+ </li>
+ </ol>
+ </li>
+ </ul>
+ </li>
+
+ <li>Compile the native code using the <code>ndk-build</code> command.
+ <pre class="no-pretty-print">
+cd <ndk-root>/samples/hello-jni
+<ndk_root>/ndk-build
+</pre>
+ </li>
+
+ <li>Build and install the application as you would a normal Android application. If you are
+ using Eclipse, run the application to build and install it on a device. If you are using Ant,
+ run the following commands from the project directory:
+ <pre class="no-pretty-print">
+ant debug
+adb install bin/HelloJni-debug.apk
+</pre>
+ </li>
+ </ol>
+
+ <p>When you run the application on the device, the string <code>Hello JNI</code> should appear on
+ your device. You can explore the rest of the samples that are located in the
+ <code><ndk-root>/samples</code> directory for more examples on how to use the JNI.</p>
+
+ <h4 id="native-activity">Exploring the native-activity Sample Application</h4>
+
+ <p>The native-activity sample provided with the Android NDK demonstrates how to use the
+ android_native_app_glue static library. This static library makes creating a native activity
+ easier by providing you with an implementation that handles your callbacks in another thread, so
+ you do not have to worry about them blocking your main UI thread. The main parts of the sample
+ are described below:</p>
+
+ <ul>
+ <li>The familiar basic structure of an Android application (an <code>AndroidManifest.xml</code>
+ file, a <code>src/</code> and <code>res</code> directories). The AndroidManifest.xml declares
+ that the application is native and specifies the .so file of the native activity. See {@link
+ android.app.NativeActivity} for the source or see the
+ <code><ndk_root>/platforms/samples/native-activity/AndroidManifest.xml</code> file.</li>
+
+ <li>A <code>jni/</code> directory contains the native activity, main.c, which uses the
+ <code>android_native_app_glue.h</code> interface to implement the activity. The Android.mk that
+ describes the native module to the build system also exists here.</li>
+ </ul>
+
+ <p>To build this sample application:</p>
+
+ <ol>
+ <li>Create a new project in Eclipse from the existing sample source or use the
+ <code>android</code> tool to update the project so it generates a build.xml file that you can
+ use to build the sample.
+
+ <ul>
+ <li>In Eclipse:
+
+ <ol type="a">
+ <li>Click <strong>File > New Android Project...</strong></li>
+
+ <li>Select the <strong>Create project from existing source</strong> radio button.</li>
+
+ <li>Select any API level above Android 2.3.</li>
+
+ <li>In the <strong>Location</strong> field, click <strong>Browse...</strong> and select
+ the <code><ndk-root>/samples/native-activity</code> directory.</li>
+
+ <li>Click <strong>Finish</strong>.</li>
+ </ol>
+ </li>
+
+ <li>On the command line:
+
+ <ol type="a">
+ <li>Change to the <code><ndk-root>/samples/native-activity</code> directory.</li>
+
+ <li>Run the following command to generate a build.xml file:
+ <pre class="no-pretty-print">
+android update project -p . -s
+</pre>
+ </li>
+ </ol>
+ </li>
+ </ul>
+ </li>
+
+ <li>Compile the native code using the <code>ndk-build</code> command.
+ <pre class="no-pretty-print">
+cd <ndk-root>/platforms/samples/android-9/samples/native-activity
+<ndk_root>/ndk-build
+</pre>
+ </li>
+
+ <li>Build and install the application as you would a normal Android application. If you are
+ using Eclipse, run the application to build and install it on a device. If you are using Ant,
+ run the following commands in the project directory, then run the application on the device:
+ <pre class="no-pretty-print">
+ant debug
+adb install bin/NativeActivity-debug.apk
+</pre>
+ </li>
+ </ol>
+
+
+ <h2 id="reqs">System and Software Requirements</h2>
+
+ <p>The sections below describe the system and software requirements for using the Android NDK, as
+ well as platform compatibility considerations that affect appplications using libraries produced
+ with the NDK.</p>
+
+ <h4>The Android SDK</h4>
+
+ <ul>
+ <li>A complete Android SDK installation (including all dependencies) is required.</li>
+
+ <li>Android 1.5 SDK or later version is required.</li>
+ </ul>
+
+ <h4>Supported operating systems</h4>
+
+ <ul>
+ <li>Windows XP (32-bit) or Vista (32- or 64-bit)</li>
+
+ <li>Mac OS X 10.4.8 or later (x86 only)</li>
+
+ <li>Linux (32 or 64-bit; Ubuntu 8.04, or other Linux distributions using GLibc 2.7 or
+later)</li>
+ </ul>
+
+ <h4>Required development tools</h4>
+
+ <ul>
+ <li>For all development platforms, GNU Make 3.81 or later is required. Earlier versions of GNU
+ Make might work but have not been tested.</li>
+
+ <li>A recent version of awk (either GNU Awk or Nawk) is also required.</li>
+
+ <li>For Windows, <a href="http://www.cygwin.com">Cygwin</a> 1.7 or higher is required. The NDK
+ will <em>not</em> work with Cygwin 1.5 installations.</li>
+ </ul>
+
+ <h4 id="platform-compat">Android platform compatibility</h4>
+
+ <ul>
+ <li>The native libraries created by the Android NDK can only be used on devices running
+ specific minimum Android platform versions. The minimum required platform version depends on
+ the CPU architecture of the devices you are targeting. The following table details which
+ Android platform versions are compatible with native code developed for specific CPU
+ architectures.
+
+ <table style="margin:1em;">
+ <tr>
+ <th>Native Code CPU Architecture Used</th>
+ <th>Compatible Android Platform(s)</th>
+ </tr>
+
+ <tr>
+ <td>ARM, ARM-NEON</td>
+ <td>Android 1.5 (API Level 3) and higher</td>
+ </tr>
+
+ <tr>
+ <td>x86</td>
+ <td>Android 2.3 (API Level 9) and higher</td>
+ </tr>
+
+ <tr>
+ <td>MIPS</td>
+ <td>Android 2.3 (API Level 9) and higher</td>
+ </tr>
+ </table>
+
+ <p>These requirements mean you can use native libraries produced with the NDK in
+ applications that are deployable to ARM-based devices running Android 1.5 or later. If you are
+ deploying native libraries to x86 and MIPS-based devices, your application must target Android
+ 2.3 or later.</p>
+ </li>
+
+ <li>To ensure compatibility, an application using a native library produced with the NDK
+ <em>must</em> declare a <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code>
+ <uses-sdk></code></a> element in its manifest file, with an
+ <code>android:minSdkVersion</code> attribute value of "3" or higher. For example:
+
+<pre style="margin:1em;">
+<manifest>
+ <uses-sdk android:minSdkVersion="3" />
+ ...
+</manifest>
+</pre>
+ </li>
+
+ <li>If you use this NDK to create a native library that uses the OpenGL ES APIs, the
+ application containing the library can be deployed only to devices running the minimum platform
+ versions described in the table below. To ensure compatibility, make sure that your application
+ declares the proper <code>android:minSdkVersion</code> attribute value, as shown in the
+ following table.</li>
+
+ <li style="list-style: none; display: inline">
+ <table style="margin:1em;">
+ <tr>
+ <th>OpenGL ES Version Used</th>
+
+ <th>Compatible Android Platform(s)</th>
+
+ <th>Required uses-sdk Attribute</th>
+ </tr>
+
+ <tr>
+ <td>OpenGL ES 1.1</td>
+
+ <td>Android 1.6 (API Level 4) and higher</td>
+
+ <td><code>android:minSdkVersion="4"</code></td>
+ </tr>
+
+ <tr>
+ <td>OpenGL ES 2.0</td>
+
+ <td>Android 2.0 (API Level 5) and higher</td>
+
+ <td><code>android:minSdkVersion="5"</code></td>
+ </tr>
+ </table>
+
+ <p>For more information about API Level and its relationship to Android platform versions,
+ see <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">Android API Levels</a>.</p>
+ </li>
+
+ <li>Additionally, an application using the OpenGL ES APIs should declare a
+ <code><uses-feature></code> element in its manifest, with an
+ <code>android:glEsVersion</code> attribute that specifies the minimum OpenGl ES version
+ required by the application. This ensures that Google Play will show your application only
+ to users whose devices are capable of supporting your application. For example:
+ <pre style="margin:1em;">
+<manifest>
+<!-- Declare that the application uses the OpenGL ES 2.0 API and is designed
+ to run only on devices that support OpenGL ES 2.0 or higher. -->
+ <uses-feature android:glEsVersion="0x00020000" />
+ ...
+</manifest>
+</pre>
+
+ <p>For more information, see the <a href=
+ "{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></code></a>
+ documentation.</p>
+ </li>
+
+ <li>If you use this NDK to create a native library that uses the API to access Android {@link
+ android.graphics.Bitmap} pixel buffers or utilizes native activities, the application
+ containing the library can be deployed only to devices running Android 2.2 (API level 8) or
+ higher. To ensure compatibility, make sure that your application declares <code><uses-sdk
+ android:minSdkVersion="8" /></code> attribute value in its manifest.</li>
+ </ul>
diff --git a/docs/html/tools/sdk/older_releases.jd b/docs/html/tools/sdk/older_releases.jd
new file mode 100644
index 0000000..bb274b6
--- /dev/null
+++ b/docs/html/tools/sdk/older_releases.jd
@@ -0,0 +1,613 @@
+page.title=SDK Archives
+@jd:body
+
+<p>This page provides a full list of archived and obsolete SDK releases,
+including non-current versions of active releases and "early look" versions that
+were released before Android 1.0. <strong>These are provided for
+informational and archival purposes only</strong>.</p>
+
+<div class="special">
+<p>If you are just starting to develop applications for Android, please
+download the current <a href="{@docRoot}sdk/index.html">Android
+SDK</a>. With the current Android SDK, you can add any current and previous
+version of the Android platform as a component and use it for
+development and testing.</p>
+<p>If you already have an Android SDK for platform version 1.6 or newer, then
+you do not need to install a new SDK—especially not one from this page.
+You should install older platforms as components of your existing SDK.
+See <a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>.</p>
+</div>
+
+
+<h2>Archived SDKs</h2>
+
+<p>The tables below provides Android SDKs that are current in terms of their
+platform version, but do not provide the latest Android development
+environment and tools. Instead of downloading one of these, as a separate
+SDK for each version of the platform, you should instead use the new
+version-neutral Android SDK to download each version of
+the Android platfrom as an individual component.</p>
+
+<p>Please download the current <a
+href="http://developer.android.com/sdk/index.html">Android SDK</a>.</p>
+
+
+<h3>Release 1.6 r1</h3>
+ <p><em>September 2009 - <a href="RELEASENOTES.html#1.6_r1">Release
+Notes</a></em></p>
+
+ <table class="download">
+ <tr>
+ <th>Platform</th>
+ <th>Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-windows-1.6_r1.zip">android-sdk-
+windows-1 .6_r1.zip</a>
+ </td>
+ <td>260529085 bytes</td>
+ <td>2bcbacbc7af0363058ca1cac6abad848</td>
+ </tr>
+ <tr class="alt-color">
+ <td>Mac OS X (intel)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-mac_x86-1.6_r1.zip">android-sdk-
+mac_x86-1 .6_r1.zip</a>
+ </td>
+ <td>247412515 bytes</td>
+ <td>eb13cc79602d492e89103efcf48ac1f6</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-linux_x86-1.6_r1.tgz">android-
+sdk- linux_x86-1.6_r1.tgz</a>
+ </td>
+ <td>238224860 bytes</td>
+ <td>b4bf0e610ff6db2fb6fb09c49cba1e79</td>
+ </tr>
+
+ </table>
+
+
+<h3>Release 1.5 r3</h3>
+ <p><em>July 2009 - <a href="RELEASENOTES.html#1.5_r3">Release
+Notes</a></em></p>
+
+ <table class="download">
+ <tr>
+ <th>Platform</th>
+ <th>Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-windows-1.5_r3.zip">android-sdk-
+windows-1 .5_r3.zip</a>
+ </td>
+ <td>191477853 bytes</td>
+ <td>1725fd6963ce69102ba7192568dfc711</td>
+ </tr>
+ <tr class="alt-color">
+ <td>Mac OS X (intel)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-mac_x86-1.5_r3.zip">android-sdk-
+mac_x86-1 .5_r3.zip</a>
+ </td>
+ <td>183024673 bytes</td>
+ <td>b1bafdaefdcec89a14b604b504e7daec</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-linux_x86-1.5_r3.zip">android-
+sdk- linux_x86-1.5_r3.zip</a>
+ </td>
+ <td>178117561 bytes</td>
+ <td>350d0211678ced38da926b8c9ffa4fac</td>
+ </tr>
+
+ </table>
+
+
+<h3>Release 1.1 r1</h3>
+ <p><em>February 2009 - <a href="RELEASENOTES.html#1.1_r1">Release
+Notes</a></em></p>
+
+ <table class="download">
+ <tr>
+ <th>Platform</th>
+ <th>Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-windows-1.1_r1.zip">android-sdk-
+windows-1
+.1_r1.zip</a>
+ </td>
+ <td>86038515 bytes</td>
+ <td>8c4b9080b430025370689e03d20842f3</td>
+ </tr>
+ <tr class="alt-color">
+ <td>Mac OS X (intel)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-mac_x86-1.1_r1.zip">android-sdk-
+mac_x86-1
+.1_r1.zip</a>
+ </td>
+ <td>79046151 bytes</td>
+ <td>becf0f1763d61eedce15d2a903d6c1dd</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-linux_x86-1.1_r1.zip">android-
+sdk-
+linux_x86-1.1_r1.zip</a>
+ </td>
+ <td>79345522 bytes</td>
+ <td>ebcb16b0cd4aef198b4dd9a1418efbf1</td>
+ </tr>
+
+ </table>
+
+
+<h3>Release 1.0 r2</h3>
+ <p><em>November 2008 - <a href="RELEASENOTES.html#1.0_r2">Release
+Notes</a></em></p>
+
+ <table class="download">
+ <tr>
+ <th>Platform</th>
+ <th>Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-windows-1.0_r2.zip">android-sdk-
+windows-1
+.0_r2.zip</a>
+ </td>
+ <td>98360564 bytes</td>
+ <td>a5e1af8ac145946b4a9627516ad4a711</td>
+ </tr>
+ <tr class="alt-color">
+ <td>Mac OS X (intel)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-mac_x86-1.0_r2.zip">android-sdk-
+mac_x86-1
+.0_r2.zip</a>
+ </td>
+ <td>93771410 bytes</td>
+ <td>87b99d5e9f59b78363a63200c11498e8</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-linux_x86-1.0_r2.zip">android-
+sdk-
+linux_x86-1.0_r2.zip</a>
+ </td>
+ <td>94186463 bytes</td>
+ <td>a1f3b6d854596f850f5008856d0f380e</td>
+ </tr>
+
+ </table>
+
+
+
+
+<h2>Obsolete SDK Releases</h2>
+
+<p>These tables provide Android SDK releases that have been superceded by
+an active release (shown above) and that are now obsolete.</p>
+
+
+<h3>Release 1.5 r2</h3>
+ <p><em>May 2009 - <a href="RELEASENOTES.html#1.5_r2">Release
+Notes</a></em></p>
+
+ <table class="download">
+ <tr>
+ <th>Platform</th>
+ <th>Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-windows-1.5_r2.zip">android-sdk-
+windows-1 .5_r2.zip</a>
+ </td>
+ <td>178346828 bytes</td>
+ <td>ba54ac6bda45921d442b74b6de6ff6a9</td>
+ </tr>
+ <tr class="alt-color">
+ <td>Mac OS X (intel)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-mac_x86-1.5_r2.zip">android-sdk-
+mac_x86-1 .5_r2.zip</a>
+ </td>
+ <td>169945128 bytes</td>
+ <td>f4e06a5194410243f213d0177713d6c9</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-linux_x86-1.5_r2.zip">android-
+sdk- linux_x86-1.5_r2.zip</a>
+ </td>
+ <td>165035130 bytes</td>
+ <td>1d3c3d099e95a31c43a7b3e6ae307ed3</td>
+ </tr>
+
+ </table>
+
+
+<h3>Release 1.5 r1</h3>
+ <p><em>April 2009 - <a href="RELEASENOTES.html#1.5_r1">Release
+Notes</a></em></p>
+
+ <table class="download">
+ <tr>
+ <th>Platform</th>
+ <th>Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-windows-1.5_r1.zip">android-sdk-
+windows-1 .5_r1.zip</a>
+ </td>
+ <td>176263368 bytes</td>
+ <td>42be980eb2d3efaced01ea6c32c0045f</td>
+ </tr>
+ <tr class="alt-color">
+ <td>Mac OS X (intel)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-mac_x86-1.5_r1.zip">android-sdk-
+mac_x86-1 .5_r1.zip</a>
+ </td>
+ <td>167848675 bytes</td>
+ <td>5b2a8d9f096032db4a75bfa0d689a51b</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-linux_x86-1.5_r1.zip">android-
+sdk- linux_x86-1.5_r1.zip</a>
+ </td>
+ <td>162938845 bytes</td>
+ <td>2addfd315da0ad8b5bde6b09d5ff3b06</td>
+ </tr>
+
+ </table>
+
+
+<h3>Release 1.0 r1</h3>
+ <p><em>September 23, 2008 - <a href="RELEASENOTES.html#1.0_r1">Release
+Notes</a></em></p>
+
+ <table class="download">
+ <tr>
+ <th>Platform</th>
+ <th>Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-windows-1.0_r1.zip">android-sdk-
+windows-1 .0_r1.zip</a>
+ </td>
+ <td>89.7 MB bytes</td>
+ <td>d69f4ee93d4010f726c04302662fd999</td>
+ </tr>
+ <tr class="alt-color">
+ <td>Mac OS X (intel)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-mac_x86-1.0_r1.zip">android-sdk-
+mac_x86-1 .0_r1.zip</a>
+ </td>
+ <td>87.5 MB bytes</td>
+ <td>564876ada22872e50c2866806de9fc5c</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+ <a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-linux_x86-1.0_r1.zip">android-
+sdk- linux_x86-1.0_r1.zip</a>
+ </td>
+ <td>87.8 MB bytes</td>
+ <td>2660b4029039b7d714e59827e9a9a11d</td>
+ </tr>
+
+ </table>
+
+
+
+
+<h2>Non-Compatible SDK Releases</h2>
+
+<!-- <div class="special"> -->
+<p>The SDKs listed below are "early-look" versions that were released in
+ the year preceding the full release of Android 1.0 in September 2008. Because
+ these early-look SDKs were released before the Android 1.0 API specification was
+ finalized, they do not provide a compliant Android execution environment.
+ Consequently, applications that you develop in these SDKs will not be able to
+ run on any Android-powered devices.</p>
+
+<p>If you have an older application that you built in one of the early-look
+SDKs, you must migrate it to the Android 1.0 SDK (or later release) before you
+will be able to deploy it to an Android-powered device. To help with this
+migration, each SDK package below provides information about API changes from
+the previous version. You can find the migration information in the
+documentation included in each SDK package.</p>
+<!-- </div> -->
+
+<h4>Version 0.9 Beta</h4>
+<p><em>August 18, 2008 - <a href="OLD_RELEASENOTES.html#0.9_beta">Release Notes</a></em></p>
+ <table>
+ <tr>
+ <th colspan="2">Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-windows-0.9_beta.zip">
+android-sdk-windows-0.9_beta.zip</a></td>
+ <td>93,126,573 bytes</td>
+ <td>305031ad8335d1b6040bdd5a65349d6d</td>
+ </tr>
+ <tr class="alt">
+ <td>Mac OS X (intel)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-mac_x86-0.9_beta.zip">
+android-sdk-mac_x86-0.9_beta.zip</a></td>
+ <td>91,374,464 bytes</td>
+ <td>9a6969159091cede46302e11049fe3ca</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk-linux_x86-0.9_beta.zip"
+>android-sdk-linux_x86-0.9_beta.zip</a></td>
+ <td>91,821,068 bytes</td>
+ <td>077e5ef549dd9c5be54bd88e6a8e196c</td>
+ </tr>
+ </table>
+
+<h4>Version m5-rc15</h4>
+ <p><em>March 3, 2008 - <a href="OLD_RELEASENOTES.html#m5-rc15">Release Notes</a></em></p>
+ <table>
+ <tr>
+ <th colspan="2">Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk_m5-rc15_windows.zip">
+android-sdk_m5-rc15_windows.zip</a></td>
+ <td>79 MB</td>
+ <td>ecce40bc50201886d95ba2690cdbc5ce</td>
+ </tr>
+ <tr class="alt">
+ <td>Mac OS X (intel)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk_m5-rc15_mac-x86.zip">
+android-sdk_m5-rc15_mac-x86.zip</a></td>
+ <td>76 MB</td>
+ <td>45a6385bbc1b2cb295409cfc81fb04b4</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk_m5-rc15_linux-x86.zip">
+android-sdk_m5-rc15_linux-x86.zip</a></td>
+ <td>76 MB</td>
+ <td>e913f785afecdeed34c30639fd8c5862</td>
+ </tr>
+ </table>
+
+ <h4>Version m5-rc14</h4>
+ <p><em>February 12, 2008 - <a href="OLD_RELEASENOTES.html#m5-rc14">Release Notes</a></em></p>
+ <table>
+ <tr>
+ <th colspan="2">Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk_m5-rc14_windows.zip">
+android-sdk_m5-rc14_windows.zip</a></td>
+ <td>79 MB</td>
+ <td>ecc75c1e69588350634ca25867ce05a0</td>
+ </tr>
+ <tr class="alt">
+ <td>Mac OS X (intel)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk_m5-rc14_mac-x86.zip">
+android-sdk_m5-rc14_mac-x86.zip</a></td>
+ <td>76 MB</td>
+ <td>844c80d0adb1a326f5a9fff262c61efc</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android-sdk_m5-rc14_linux-x86.zip">
+android-sdk_m5-rc14_linux-x86.zip</a></td>
+ <td>76 MB</td>
+ <td>f8b863c8a880afe9bb84124f5976aab1</td>
+ </tr>
+ </table>
+
+
+
+
+ <h4>Version m3-rc37a</h4>
+ <p><em>December 14, 2007 - <a href="OLD_RELEASENOTES.html#m3-rc37a">Release Notes</a></em></p>
+ <table>
+ <tr>
+ <th colspan="2">Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android_sdk_windows_m3-rc37a.zip">
+android_sdk_windows_m3-rc37a.zip</a></td>
+ <td>58 MB</td>
+ <td>5db5aea20a2c2f010baefc4b1091a575</td>
+ </tr>
+ <tr class="alt">
+ <td>Mac OS X (intel)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android_sdk_darwin_m3-rc37a.zip">
+android_sdk_darwin_m3-rc37a.zip</a></td>
+ <td>54 MB</td>
+ <td>0b22e73fbd07b4af4009387afce3a37f</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android_sdk_linux_m3-rc37a.zip">
+android_sdk_linux_m3-rc37a.zip</a></td>
+ <td>54 MB</td>
+ <td>41285beecc4f9926e6ecf5f12610b356</td>
+ </tr>
+ </table>
+
+
+
+
+ <h4>Version m3-rc22a</h4>
+ <p><em>November 16, 2007 - <a href="OLD_RELEASENOTES.html#m3-rc22a">Release Notes</a></em></p>
+ <table>
+ <tr>
+ <th colspan="2">Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android_sdk_windows_m3-rc22a.zip">
+android_sdk_windows_m3-rc22a.zip</a></td>
+ <td>59 MB</td>
+ <td>aa3dee05a9872752a3bc4efd0f93e98b</td>
+ </tr>
+ <tr class="alt">
+ <td>Mac OS X (intel)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android_sdk_darwin_m3-rc22a.zip">
+android_sdk_darwin_m3-rc22a.zip</a></td>
+ <td>55 MB</td>
+ <td>0547f45614ad94c3af22c3c0aa6f709f</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android_sdk_linux_m3-rc22a.zip">
+android_sdk_linux_m3-rc22a.zip</a></td>
+ <td>55 MB</td>
+ <td>84b3455de5cdfd841a172c13d24c382e</td>
+ </tr>
+ </table>
+
+
+
+
+ <h4>Version m3-rc20a</h4>
+ <p><em>November 12, 2007 - <a href="OLD_RELEASENOTES.html#m3-rc20a">Release Notes</a></em></p>
+ <table>
+ <tr>
+ <th colspan="2">Package</th>
+ <th>Size</th>
+ <th>MD5 Checksum</th>
+ </tr>
+ <tr>
+ <td>Windows</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android_sdk_windows_m3-rc20a.zip">
+android_sdk_windows_m3-rc20a.zip</a></td>
+ <td>59 MB</td>
+ <td>a404b875708df7339ba77bdf2e08dc06</td>
+ </tr>
+ <tr class="alt">
+ <td>Mac OS X (intel)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android_sdk_darwin_m3-rc20a.zip">
+android_sdk_darwin_m3-rc20a.zip</a></td>
+ <td>55 MB</td>
+ <td>8fc29aeaa45eda84bfac854ebd02a6da</td>
+ </tr>
+ <tr>
+ <td>Linux (i386)</td>
+ <td>
+<a
+href="{@docRoot}sdk/download.html?v=archives/android_sdk_linux_m3-rc20a.zip">
+android_sdk_linux_m3-rc20a.zip</a></td>
+ <td>55 MB</td>
+ <td>9196759df9b69cd89a220b156f133364</td>
+ </tr>
+ </table>
diff --git a/docs/html/tools/sdk/platforms.jd b/docs/html/tools/sdk/platforms.jd
new file mode 100644
index 0000000..27e89de
--- /dev/null
+++ b/docs/html/tools/sdk/platforms.jd
@@ -0,0 +1,9 @@
+page.title=Android Development Platforms
+
+@jd:body
+
+
+
+<p>A page that lists platforms and links to release notes. Links to dashboards etc.</p>
+
+
diff --git a/docs/html/tools/sdk/preview/features.jd b/docs/html/tools/sdk/preview/features.jd
new file mode 100644
index 0000000..02897cd
--- /dev/null
+++ b/docs/html/tools/sdk/preview/features.jd
@@ -0,0 +1,8 @@
+@jd:body
+
+<script type="text/javascript">
+ document.location=toRoot+"about/versions/android-3.0.html"
+</script>
+
+<p>You should have already been redirected by your browser. Please go to the
+<a href="{@docRoot}about/versions/android-3.0.html">Android 3.0 Platform</a>.</p>
\ No newline at end of file
diff --git a/docs/html/sdk/preview/index.jd b/docs/html/tools/sdk/preview/index.jd
similarity index 100%
rename from docs/html/sdk/preview/index.jd
rename to docs/html/tools/sdk/preview/index.jd
diff --git a/docs/html/tools/sdk/preview/installing.jd b/docs/html/tools/sdk/preview/installing.jd
new file mode 100644
index 0000000..c40e531
--- /dev/null
+++ b/docs/html/tools/sdk/preview/installing.jd
@@ -0,0 +1,8 @@
+@jd:body
+
+<script type="text/javascript">
+ document.location=toRoot+"sdk/installing/index.html"
+</script>
+
+<p>You should have already been redirected by your browser. Please go to
+<a href="{@docRoot}sdk/installing/index.html">Installing the SDK</a>.</p>
\ No newline at end of file
diff --git a/docs/html/sdk/preview/requirements.jd b/docs/html/tools/sdk/preview/requirements.jd
similarity index 100%
rename from docs/html/sdk/preview/requirements.jd
rename to docs/html/tools/sdk/preview/requirements.jd
diff --git a/docs/html/sdk/preview/upgrading.jd b/docs/html/tools/sdk/preview/upgrading.jd
similarity index 100%
rename from docs/html/sdk/preview/upgrading.jd
rename to docs/html/tools/sdk/preview/upgrading.jd
diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd
new file mode 100644
index 0000000..f08209b
--- /dev/null
+++ b/docs/html/tools/sdk/tools-notes.jd
@@ -0,0 +1,855 @@
+page.title=SDK Tools
+@jd:body
+
+<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
+href="{@docRoot}sdk/index.html">SDK starter package</a> installs the
+latest revision of the SDK Tools in the <code><sdk>/tools</code> directory.</p>
+
+<p>If you are already using the SDK and you want to update to the latest version
+of the SDK Tools, use the <em>Android SDK Manager</em> to get the
+update, rather than downloading a new SDK starter package. For more information
+about how to update, see <a
+href="{@docRoot}sdk/exploring.html#UpdatingComponents">Exploring the SDK</a>.</p>
+
+
+<h2 id="notes">Revisions</h2>
+
+<p>The sections below provide notes about successive releases of
+the SDK Tools, as denoted by revision number. To determine what revision of the SDK
+Tools you are using, refer to the "Installed Packages" listing in the Android SDK Manager. </p>
+
+<p>For a summary of all known issues in SDK Tools, see <a
+href="http://tools.android.com/knownissues">http://tools.android.com/knownissues</a>.</p>
+
+<script type="text/javascript">
+function toggleDiv(link) {
+ var toggleable = $(link).parent();
+ if (toggleable.hasClass("closed")) {
+ //$(".toggleme", toggleable).slideDown("fast");
+ toggleable.removeClass("closed");
+ toggleable.addClass("open");
+ $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
+ } else {
+ //$(".toggleme", toggleable).slideUp("fast");
+ toggleable.removeClass("open");
+ toggleable.addClass("closed");
+ $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
+ }
+ return false;
+}
+</script>
+<style>
+.toggleable {
+padding: 5px 0 0;
+}
+.toggleme {
+ padding: 10px 0 0 20px;
+}
+.toggleable a {
+ text-decoration:none;
+}
+.toggleme a {
+ text-decoration:underline;
+}
+.toggleable.closed .toggleme {
+ display:none;
+}
+#jd-content .toggle-img {
+ margin:0 5px 3px 0;
+}
+</style>
+
+<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 19</a> <em>(April 2012)</em>
+
+ <div class="toggleme">
+ <p class="note"><strong>Note:</strong> This update of SDK Tools is only available through
+the <a href="{@docRoot}sdk/exploring.html">Android SDK Manager</a>. Use this tool to
+download and install this update.</p>
+
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>
+ <ul>
+ <li>Android SDK Platform-tools revision 9 or later.</li>
+ <li>If you are developing in Eclipse with ADT, note that the SDK Tools r19 is designed for
+ use with ADT 18.0.0 and later. If you haven't already, we highly recommend updating your
+ <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 18.0.0.</li>
+ <li>If you are developing outside Eclipse, you must have
+ <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li>
+ </ul>
+ </dd>
+ <dt>Bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed an issue that prevented some developers from running the emulator with GPU
+acceleration.</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 18</a> <em>(April 2012)</em>
+
+ <div class="toggleme">
+ <p class="caution"><strong>Important:</strong> To download the new Android
+ 4.0 system components from the Android SDK Manager, you must first update the
+ SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
+ the Android 4.0 system components will not be available for download.</p>
+
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>
+ <ul>
+ <li>Android SDK Platform-tools revision 9 or later.</li>
+ <li>If you are developing in Eclipse with ADT, note that the SDK Tools r18 is designed for
+ use with ADT 18.0.0 and later. If you haven't already, we highly recommend updating your
+ <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 18.0.0.</li>
+ <li>If you are developing outside Eclipse, you must have
+ <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li>
+ </ul>
+ </dd>
+ <dt>General notes:</dt>
+ <dd>
+ <ul>
+ <li>Updated the SdkController app to encapsulate both sensor and multitouch emulation
+ functionality.</li>
+ </ul>
+ </dd>
+ <dt>Bug fixes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed Ant issues where some jar libraries in the {@code libs/} folder are not picked up
+in some cases.</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 17</a> <em>(March 2012)</em>
+
+ <div class="toggleme">
+ <p class="caution"><strong>Important:</strong> To download the new Android
+ 4.0 system components from the Android SDK Manager, you must first update the
+ SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
+ the Android 4.0 system components will not be available for download.</p>
+
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>
+ <ul>
+ <li>Android SDK Platform-tools revision 9 or later.</li>
+ <li>If you are developing in Eclipse with ADT, note that the SDK Tools r17 is designed for
+ use with ADT 17.0.0 and later. If you haven't already, we highly recommend updating your
+ <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 17.0.0.</li>
+ <li>If you are developing outside Eclipse, you must have
+ <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li>
+ </ul>
+ </dd>
+ <dt>General notes:</dt>
+ <dd>
+ <ul>
+ <li>Emulator
+ <ul>
+ <li>Added support for hardware accelerated graphics rendering. This feature requires an
+API Level 15, Revision 3 or later system image.
+(<a href="{@docRoot}tools/devices/emulator.html#accel-graphics">more info</a>)
+ </li>
+ <li>Added support for running Android x86 system images in virtualization mode on
+Windows and Mac OS X.
+(<a href="{@docRoot}tools/devices/emulator.html#accel-vm">more info</a>)
+ <p class="note"><strong>Note:</strong> Use the Android SDK Manager to download and
+install x86 system images. Android x86 system images are not available for all API levels.</p>
+ </li>
+ <li>Added experimental support for multi-touch input by enabing the emulator to receive
+ touch input from a USB-tethered physical Android device.
+ (<a href="http://tools.android.com/tips/hardware-emulation">more info</a>)</li>
+ </ul>
+ </li>
+ <li>Added viewing of live detailed network usage of an app in DDMS. (<a
+ href="http://tools.android.com/recent/detailednetworkusageinddms">more info</a>)</li>
+ <li>ProGuard
+ <ul>
+ <li>Updated the bundled ProGuard tool to version 4.7. In addition to many new features,
+this update fixes the {@code Conversion to Dalvik format failed with error 1} error some users have
+experienced.</li>
+ <li>Updated the default {@code proguard.cfg} file with better default flags for
+ Android.</li>
+ <li>Split the ProGuard configuration file has been in half, with project specific flags
+kept in project and the generic Android flags distributed (and updated) with the tools
+themselves.</li>
+ </ul>
+ </li>
+ <li>Build
+ <ul>
+ <li>Added a feature that allows you to run some code only in debug mode. Builds now
+generate a class called {@code BuildConfig} containing a {@code DEBUG} constant that is
+automatically set according to your build type. You can check the ({@code BuildConfig.DEBUG})
+constant in your code to run debug-only functions.</li>
+ <li>Fixed issue when a project and its libraries include the same jar file in their libs
+ folder. (<a href="http://tools.android.com/recent/dealingwithdependenciesinandroidprojects">more
+ info</a>)</li>
+ <li>Added support for custom views with custom attributes in libraries. Layouts using
+custom attributes must use the namespace URI {@code http://schemas.android.com/apk/res-auto} instead
+of the URI that includes the app package name. This URI is replaced with the app specific one at
+build time.</li>
+ </ul>
+ </li>
+ <li>Lint
+ <ul>
+ <li>Updated Lint to check Android application code. Lint rules which previously
+performed pattern based searches in the application code (such as the unused resource check) have
+been rewritten to use the more accurate Java-style parse trees.</li>
+ <li>Added support for checking library projects. This change means that rules such as
+the unused resource check properly handle resources declared in a library project and referenced in
+a downstream project.</li>
+ <li>Added ability to suppress Lint warnings in Java code with the new
+{@code @SuppressLint} annotation, and in XML files with the new tools: namespace and
+ignore attribute. (<a
+ href="http://tools.android.com/recent/ignoringlintwarnings">more info</a>)</li>
+ <li>New Lint checks:
+ <ul>
+ <li>Added check for Android API calls that require a version of Android higher than
+ the minimum supported version. You can use the new {@code @TargetApi} annotation
+ to suppress warnings when the code is wrapped in a system version condition.
+ (<a href="http://tools.android.com/recent/lintapicheck">more info</a>)</li>
+ <li>Added over 20 new Lint rules, including checks for
+ <a href="http://tools.android.com/recent/lintperformancechecks">performance</a>,
+ XML layouts, manifest and file handling.</li>
+ </ul>
+ </li>
+ </ul>
+ </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 16</a> <em>(December 2011)</em>
+
+ <div class="toggleme">
+ <p class="caution"><strong>Important:</strong> To download the new Android
+ 4.0 system components from the Android SDK Manager, you must first update the
+ SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
+ the Android 4.0 system components will not be available for download.</p>
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+ <ul>
+ <li>Android SDK Platform-tools revision 9 or later.</li>
+ <li>If you are developing in Eclipse with ADT, note that the SDK Tools r16 is designed for use
+ with ADT 16.0.0 and later. If you haven't already, we highly recommend updating your
+ <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 16.0.0.</li>
+ <li>If you are developing outside Eclipse, you must have <a href="http://ant.apache.org/">Apache
+ Ant</a> 1.8 or later.</li>
+</ul>
+</dd>
+<dt>General notes:</dt>
+<dd>
+ <ul>
+ <li>Added Lint tools to detect common errors in Android projects.
+ (<a href="http://tools.android.com/recent/lint">more info</a>)</li>
+ <li>Added sensor emulation support, which allows the emulator to read sensor data from a
+ physical Android device.
+ (<a href="http://tools.android.com/recent/sensoremulation">more info</a>)</li>
+ <li>Added support for using a webcam to emulate a camera on Mac OS X.</li>
+ </ul>
+</dd>
+<dt>Bug fixes:</dt>
+<dd>
+ <ul>
+ <li>Snapshots now work for Android 4.0 system images.</li>
+ <li>Fixed several small issues for the build file.
+ (<a href="http://code.google.com/p/android/issues/detail?id=21023">Issue 21023</a>,
+ <a href="http://code.google.com/p/android/issues/detail?id=21267">Issue 21267</a>,
+ <a href="http://code.google.com/p/android/issues/detail?id=21465">Issue 21465</a>,
+ <a href="http://code.google.com/p/android/issues/detail?id=21525">Issue 21525</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 15</a> <em>(October 2011)</em>
+
+ <div class="toggleme">
+ <p class="caution"><strong>Important:</strong> To download the new Android
+ 4.0 system components from the Android SDK Manager, you must first update the
+ SDK tools to revision 14 or later and restart the Android SDK Manager. If you do not,
+ the Android 4.0 system components will not be available for download.</p>
+ <dl>
+<dt>Dependencies:</dt>
+<dd>
+ <ul><li>Android SDK Platform-tools revision 9 or later.</li>
+ <li>If you are developing in Eclipse with ADT, note that the SDK Tools r15 is designed for use
+ with ADT 15.0.0 and later. If you haven't already, we highly recommend updating your <a
+ href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 15.0.0.</li>
+ <li>If you are developing outside Eclipse, you must have <a href="http://ant.apache.org/">Apache
+ Ant</a> 1.8 or later.</li>
+</ul>
+
+<dt>Bug fixes:</dt>
+<dd>
+ <ul>
+ <li>Fixed emulator crash on Linux due to improper webcam detection
+ (<a href="http://code.google.com/p/android/issues/detail?id=20952">Issue 20952</a>).</li>
+ <li>Fixed emulator issue when using the <code>-wipe-data</code> argument.</li>
+ <li>Fixed build issue when using Renderscript in projects that target API levels 11-13
+ (<a href="http://code.google.com/p/android/issues/detail?id=21006">Issue 21006</a>).</li>
+ <li>Fixed issue when creating an AVD using the GoogleTV addon
+ (<a href="http://code.google.com/p/android/issues/detail?id=20963">Issue 20963</a>).</li>
+ <li>Fixed <code>ant test</code>
+ (<a href="http://code.google.com/p/android/issues/detail?id=20979">Issue 20979</a>).</li>
+ <li>Fixed <code>android update project</code>
+ (<a href="http://code.google.com/p/android/issues/detail?id=20535">Issue 20535</a>).</li>
+ <li>Fixed scrolling issue in the new Logcat panel of DDMS.</li>
+ <li>Fixed issue with MonkeyRunner
+ (<a href="http://code.google.com/p/android/issues/detail?id=20964">Issue 20964</a>).</li>
+ <li>Fixed issues in the SDK Manager
+ (<a href="http://code.google.com/p/android/issues/detail?id=20939">Issue 20939</a>,
+ <a href="http://code.google.com/p/android/issues/detail?id=20607">Issue 20607</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 14</a> <em>(October 2011)</em>
+
+ <div class="toggleme">
+ <p class="note"><strong>Important:</strong> To download the new Android
+ 4.0 system components from the Android SDK Manager, you must first update the
+ SDK tools to revision 14 and restart the Android SDK Manager. If you do not,
+ the Android 4.0 system components will not be available for download.</p>
+ <dl>
+<dt>Dependencies:</dt>
+<dd>
+ <ul><li>Android SDK Platform-tools revision 8 or later.</li>
+ <li>If you are developing in Eclipse with ADT, note that the SDK Tools r14 is designed for use
+ with ADT 14.0.0 and later. If you haven't already, we highly recommend updating your <a
+ href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 14.0.0.</li>
+ <li>If you are developing outside Eclipse, you must have <a href="http://ant.apache.org/">Apache
+ Ant</a> 1.8 or later.</li>
+</ul>
+
+<dt>General notes:</dt>
+<dd>
+ <ul>
+ <li>Added webcam support to Android 4.0 or later platforms to emulate rear-facing cameras when
+ one webcam is present, and to emulate both rear-facing and front-facing cameras when two
+ webcams are present. Webcam support is for Windows and Linux only.
+ Mac support will come in a later release.</li>
+ <li>Changed <code>default.properties</code> to <code>project.properties</code> and
+ <code>build.properties</code> to <code>ant.properties</code>. Any existing
+ projects that you build with Ant must be updated with the <code>android update project</code>
+ command.</li>
+ <li>Changed Ant <code>build.xml</code> file to support improvements to the
+ build system and added and modified Ant commands to support these changes. For a list of Ant
+commands, see the
+<a href="{@docRoot}tools/building/building-cmdline.html#AntReference">Ant Command
+Reference</a>.</li>
+ <li>Changed how library projects are built.</li>
+ <li>Improved incremental builds, so that resource compilation runs less frequently. Builds no
+ longer run when you edit strings or layouts (unless you add a new <code>id</code>) and no longer
+ run once for each library project.</li>
+ <li>Introduced a "PNG crunch cache" that only runs on modified PNG files, instead of
+ crunching all existing PNG files, all the time.</li>
+ <li>Revamped the SDK Manager UI (<a href="http://tools.android.com/recent/newsdkmanager">more
+info</a>).</li>
+ </ul>
+ <p>For a complete overview of the build system changes and what you need to do to support them,
+see the <a href="http://tools.android.com/recent/buildchangesinrevision14">Android Tools Project
+site</a>.</p>
+</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 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}tools/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>
+<dt>Dependencies:</dt>
+<dd>
+<p>If you are developing in Eclipse with ADT, note that the SDK Tools r12 is designed for use with
+ADT 12.0.0 and later. If you haven't already, we highly recommend updating your <a
+href="{@docRoot}tools/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>The AVD manager and emulator can now use system images
+ compiled for ARM v7 and x86 CPUs.</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 11</a> <em>(May 2011)</em>
+ <div class="toggleme">
+ <dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>If you are developing in Eclipse with ADT, note that the SDK Tools r11 is designed for use with
+ADT 10.0.1 and later. If you haven't already, we highly recommend updating your <a
+href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 10.0.1.</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>Miscellaneous emulator changes to support Android 3.1.</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 10</a> <em>(February 2011)</em>
+ <div class="toggleme">
+ <dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>If you are developing in Eclipse with ADT, note that the SDK Tools r10 is
+designed for use with ADT 10.0.0 and later. After installing SDK Tools r10, we
+highly recommend updating your ADT Plugin to 10.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>The tools now automatically generate Java Programming Language source files (in the
+<code>gen</code> directory) and
+ bytecode (in the <code>res/raw</code> directory) from your native <code>.rs</code> files</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 9</a> <em>(January 2011)</em>
+ <div class="toggleme">
+ <dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>If you are developing in Eclipse with ADT, note that the SDK Tools r9 is
+designed for use with ADT 9.0.0 and later. After installing SDK Tools r9, we
+highly recommend updating your ADT Plugin to 9.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>Upgrading to SDK Tools r9:</dt>
+<dd>
+<p>If you are upgrading to SDK Tools r9 from SDK Tools r7 or earlier, the default installed location
+for the <code>adb</code> tool has changed from <code><<em>SDK</em>>/tools/adb</code> to
+<code><<em>SDK</em>>/platform-tools/adb</code>. This means that you should
+add the new location to your PATH and modify any custom build scripts to
+reference the new location. Copying the <code>adb</code> executable from the new
+location to the old is not recommended, since subsequent updates to the SDK
+Tools will delete the file.</p>
+</dd>
+
+<dt>General notes:</dt>
+<dd>
+ <ul>
+ <li>The default ProGuard configuration, <code>proguard.cfg</code>, now ignores the following classes:
+ <ul>
+ <li>classes that extend {@link android.preference.Preference}</li>
+ <li>classes that extend {@link android.app.backup.BackupAgentHelper}</li>
+ </ul>
+ </li>
+ <li>Ant lib rules now allow you to override <code>java.encoding</code>, <code>java.source</code>,
+ and <code>java.target</code> properties.</li>
+ <li>The default encoding for the <code>javac</code> Ant task is now UTF-8.</li>
+ <li>The LogCat view in DDMS now properly displays UTF-8 characters.</li>
+ <li>The SDK Manager is more reliable on Windows. For details on the improvements, see the
+ <a href="http://tools.android.com/recent/sdkmanagerfixes">Android Tools Project Site</a>. </li>
+ <li>Early look at the new snapshot feature: To improve startup time for the emulator, you can
+enable snapshots for the system state. The emulator will then restore to the state when it last
+closed almost instantly. <strong>Note:</strong> The snapshot feature is still under active
+development and might not always perform as expected.</li>
+ <li>Fixed the missing JAR file error that prevented <code>draw9patch</code> from running.</li>
+ <li>Fixed the Windows launch scripts <code>hierarchyviewer</code> and <code>ddms</code> to support
+ the new location of <code>adb</code>.</li>
+ <li>Known issues with emulator performance: Because the Android emulator must simulate the ARM
+instruction set architecture on your computer, emulator performance is slow. We're working hard to
+resolve the performance issues and it will improve in future releases.</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 8</a> <em>(December 2010)</em>
+ <div class="toggleme">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>If you are developing in Eclipse with ADT, note that SDK Tools r8 is
+designed for use with ADT 8.0.0 and later. After installing SDK Tools r8, we
+highly recommend updating your ADT Plugin to 8.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>
+
+<p>Also note that SDK Tools r8 requires a new SDK component called
+<em>Platform-tools</em>. The new Platform-tools component lets all SDK platforms
+(Android 2.1, Android 2.2, and so on) use the same (latest) version of build
+tools such as <code>adb</code>, <code>aapt</code>, <code>aidl</code>, and
+<code>dx</code>. To download the Platform-tools component, use the Android SDK
+Manager, as described in <a href="{@docRoot}sdk/exploring.html">Exploring the
+SDK</a></p>
+
+<dt>Upgrading from SDK Tools r7:</dt>
+<dd>
+<p>If you are upgrading to SDK Tools r8 from an earlier version, note that the
+the default installed location for the <code>adb</code> tool has changed from
+<code><<em>SDK</em>>/tools/adb</code> to
+<code><<em>SDK</em>>/platform-tools/adb</code>. This means that you should
+add the new location to your PATH and modify any custom build scripts to
+reference the new location. Copying the <code>adb</code> executable from the new
+location to the old is not recommended, since subsequent updates to the SDK
+Tools will delete the file.</p>
+</dd>
+
+<dt>General notes:</dt>
+<dd>
+<ul>
+<li>All SDK platforms now support Library Projects.</li>
+<li>Support for a true debug build. Developers no longer need to add the
+<code>android:debuggable</code> attribute to the
+<code><application></code> tag in the manifest — the build tools add
+the attribute automatically. In Eclipse/ADT, all incremental builds are assumed
+to be debug builds, so the tools insert <code>android:debuggable="true"</code>.
+When exporting a signed release build, the tools do not add the attribute. In
+Ant, a <code>ant debug</code> command automatically inserts the
+<code>android:debuggable="true"</code> attribute, while <code>ant release</code>
+does not. If <code>android:debuggable="true"</code> is manually set, then
+<code>ant release</code> will actually do a debug build, rather than a release
+build.</li>
+<li>Automatic ProGuard support in release builds. Developers generate a ProGuard
+configuration file using the <code>android</code> tool — the build tools
+then automatically run ProGuard against the project sources during the build.
+For more information, see the <a
+href="{@docRoot}tools/help/proguard.html">ProGuard</a>
+documentation. </li>
+<li>New overridable Ant javac properties: <code>java.encoding</code>,
+<code>java.source</code>, and <code>java.target</code> (default values are
+"ascii", "1.5", and "1.5", respectively).</li>
+<li>New UI for the HierarchyViewer tool.</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 7</a> <em>(September 2010)</em>
+ <div class="toggleme">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>If you are developing in Eclipse with ADT, note that SDK Tools r7 is
+designed for use with ADT 0.9.8 and later. After installing SDK Tools r7, we
+highly recommend updating your ADT Plugin to 0.9.8.</p>
+</dd>
+
+<dt>General notes:</dt>
+<dd>
+<ul>
+<li>Added support for library projects that depend on other library projects.</li>
+<li>Adds support for aidl files in library projects.</li>
+<li>Adds support for extension targets in Ant build to perform tasks between the
+normal tasks: <code>-pre-build</code>, <code>-pre-compile</code>, and
+<code>-post-compile</code>.</li>
+<li>Adds support for "headless" SDK update. See <code>android -h update sdk</code>
+for more information.</li>
+<li>Fixes location control in DDMS to work in any locale not using '.' as a
+decimal point.</li>
+</ul>
+</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 6</a> <em>(May 2010)</em>
+ <div class="toggleme">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>If you are developing in Eclipse with ADT, note that SDK Tools r6 is
+designed for use with ADT 0.9.7 and later. After installing SDK Tools r6, we
+highly recommend updating your ADT Plugin to 0.9.7.</p>
+</dd>
+
+<dt>Library projects:</dt>
+<dd>
+<p>The SDK Tools now support the use of <em>library projects</em> during
+development, a capability that lets you store shared Android application
+code and resources in a separate development project. You can then reference the
+library project from other Android projects and, at build time, the tools
+compile the shared code and resources as part of the dependent applications.
+More information about this feature is available in the <a
+href="{@docRoot}tools/projects/index.html#LibraryProjects">Creating and Managing Projects</a> document.</p>
+<p>If you are developing in Eclipse, <a href="eclipse-adt.html">ADT</a>
+provides the equivalent library project support.</p>
+</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 5</a> <em>(March 2010)</em>
+ <div class="toggleme">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd><ul>
+<li>If you are developing in Eclipse with ADT, note that SDK Tools r5 is
+designed for use with ADT 0.9.6 and later. After installing SDK Tools r5, we
+highly recommend updating your ADT Plugin to 0.9.6.</li>
+<li>For Mac OS platforms, OS X 10.4.x (Tiger) is no longer
+officially supported. </li>
+</ul>
+</dd>
+
+<dt>SDK and AVD Manager:</dt>
+<dd>
+<ul>
+<li>Fixes SSL download for the standalone version of the SDK Updater.</li>
+<li>Fixes issue with 64-bit JVM on Windows.</li>
+<li>Adds support for platform samples components.</li>
+<li>Improves support for dependency between components.</li>
+<li>AVDs now sorted by API level.</li>
+<li>The AVD creation dialog now enforces a minimum SD card size of 9MB.</li>
+<li>Prevents deletion of running AVDs.</li>
+<li>Settings are now automatically saved, no need to click "Apply".</li>
+</ul>
+</dd>
+
+<dt>Emulator:</dt>
+<dd>
+<ul>
+<li>Emulator now requires SD card to be 9MB or more.</li>
+</ul>
+</dd>
+
+<dt>Layoutopt:</dt>
+<dd>
+<ul>
+<li>Fixes <code>layoutopt.bat</code> to execute correctly on Windows.</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 4</a> <em>(December 2009)</em>
+ <div class="toggleme">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd><p>SDK Tools r4 is compatible with ADT 0.9.5 and later, but not
+compatible with earlier versions. If you are developing in Eclipse with ADT, you
+<strong>must</strong> update your ADT plugin to version 0.9.5 or higher if you
+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
+compatibility issue between GTK and SWT.</li>
+</ul>
+</dd>
+
+<dt>Android SDK and AVD Manager:</dt>
+<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
+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>
+</ul>
+</dd>
+
+<dt>Emulator:</dt>
+<dd>
+<ul>
+<li>No longer limits the size of the system partition.</li>
+</ul>
+</dd>
+
+<dt>Ant build tools:</dt>
+<dd>
+<ul>
+<li>.apk packaging now properly ignores vi swap files as well as hidden files.</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 3</a> <em>(October 2009)</em>
+ <div class="toggleme">
+
+<dl>
+<dt>Dependencies:</dt>
+<dd><p>SDK Tools r3 is compatible with ADT 0.9.4 and later, but not
+compatible with earlier versions. If you are developing in Eclipse with ADT, you
+<strong>must</strong> update your ADT plugin to version 0.9.4 or higher if you
+install SDK Tools r3 in your SDK.</p>
+</dd>
+
+<dt>Android tool:</dt>
+<dd>
+<ul>
+<li>Adds new <code>android create test-project</code> and <code>android update
+test-project</code> commands to allow for greater flexibility in the location of the
+main and test projects.</li>
+</ul>
+</dd>
+
+<dt>DDMS:</dt>
+<dd>
+<ul>
+<li>Adds a button to dump HPROF file for running applications (app must be able
+to write to the sdcard).</li>
+<li>Button to start/stop profiling of a running application (app must be able to
+write to the sdcard). Upon stop, Traceview will automatically be launched to
+display the trace.</li>
+<li>Fixed DDMS, Traceview, and the AVD Mananger/SDK Updater to run on Mac OS X
+10.6.</li>
+<li>Fixed screenshot support for devices running 32-bit framebuffer.</li>
+</ul>
+</dd>
+
+<dt>Android SDK and AVD Manager:</dt>
+<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
+an AVD.</li>
+<li>Provides improved AVD creation UI, which lets you customize the hardware
+properties of your AVDs.</li>
+<li>Now enforces dependencies between platforms and tools components, and
+between SDK add-ons and platforms.</li>
+</ul>
+</dd>
+
+<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
+href="/tools/help/layoutopt.html">layoutopt</a>.</p>
+</dd>
+</dl>
+ </div>
+</div>
diff --git a/docs/html/tools/sdk/usb-drivers.jd b/docs/html/tools/sdk/usb-drivers.jd
new file mode 100644
index 0000000..27e89de
--- /dev/null
+++ b/docs/html/tools/sdk/usb-drivers.jd
@@ -0,0 +1,9 @@
+page.title=Android Development Platforms
+
+@jd:body
+
+
+
+<p>A page that lists platforms and links to release notes. Links to dashboards etc.</p>
+
+
diff --git a/docs/html/tools/sdk/win-usb.jd b/docs/html/tools/sdk/win-usb.jd
new file mode 100644
index 0000000..d322340
--- /dev/null
+++ b/docs/html/tools/sdk/win-usb.jd
@@ -0,0 +1,172 @@
+page.title=Google USB Driver
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#notes">Revisions</a></li>
+ <li><a href="#WinUsbDriver">Downloading the Google USB Driver</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}tools/extras/oem-usb.html#InstallingDriver">Installing a USB Driver</a></li>
+ <li><a href="{@docRoot}tools/device.html">Using Hardware Devices</a></li>
+ <li><a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a></li>
+ </ol>
+</div>
+</div>
+
+<p>The Google USB driver is a downloadable component for the Android SDK, available
+from the SDK Manager. The driver is for Windows only and provides the necessary drivers for the
+following devices:</p>
+ <ul>
+ <li>ADP1 / T-Mobile G1*</li>
+ <li>ADP2 / Google Ion / T-Mobile myTouch 3G*</li>
+ <li>Verizon Droid*</li>
+ <li>Nexus One</li>
+ <li>Nexus S</li>
+ </ul>
+ <p>* <em>Or similar hardware on other carriers</em></p>
+
+ <p>All other devices require Windows drivers provided by the hardware manufacturer, as listed in
+the <a href="{@docRoot}tools/extras/oem-usb.html">OEM USB Drivers</a> document. The Galaxy Nexus
+driver is also distributed by <a
+href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a>
+(listed as model SCH-I515).</p>
+
+<p class="note"><strong>Note:</strong>
+If you're developing on Mac OS X or Linux, then you do not need to install a USB driver. To start
+developing with your device, also read <a href="{@docRoot}tools/device.html">Using
+Hardware Devices</a>.</p>
+
+<p>The sections below provide instructions on how to download and install the Google USB Driver
+for Windows. </p>
+
+
+
+
+<h2 id="notes">Revisions</h2>
+
+<p>The sections below provide notes about successive revisions of the USB Driver
+for Windows, as denoted by revision number. To determine what revision of the
+USB Driver for Windows you are using, refer to the "Installed Packages" listing
+in the Android SDK Manager.</p>
+
+<script type="text/javascript">
+function toggleDiv(link) {
+ var toggleable = $(link).parent();
+ if (toggleable.hasClass("closed")) {
+ //$(".toggleme", toggleable).slideDown("fast");
+ toggleable.removeClass("closed");
+ toggleable.addClass("open");
+ $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
+ } else {
+ //$(".toggleme", toggleable).slideUp("fast");
+ toggleable.removeClass("open");
+ toggleable.addClass("closed");
+ $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
+ }
+ return false;
+}
+</script>
+<style>
+.toggleable {
+padding: .25em 1em;
+}
+.toggleme {
+ padding: 1em 1em 0 2em;
+ line-height:1em;
+}
+.toggleable a {
+ text-decoration:none;
+}
+.toggleme a {
+ text-decoration:underline;
+}
+.toggleable.closed .toggleme {
+ display:none;
+}
+#jd-content .toggle-img {
+ margin:0;
+}
+</style>
+
+<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" />
+USB Driver for Windows, Revision 4</a> <em>(December 2010)</em>
+ <div class="toggleme">
+
+<dl>
+<dt><p>Adds support for the Nexus S.</p></dt>
+</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" />
+USB Driver for Windows, Revision 3</a> <em>(January 2010)</em>
+ <div class="toggleme">
+
+<dl>
+<dt><p>Adds support for the Nexus One.</p></dt>
+</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" />
+USB Driver for Windows, Revision 2</a> <em>(November 2009)</em>
+ <div class="toggleme">
+
+<dl>
+<dt><p>Adds support for the Verizon Droid (or similar hardware on
+other carriers).</p></dt>
+</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" />
+USB Driver for Windows, Revision 1</a> <em>(October 2009)</em>
+ <div class="toggleme">
+
+<dl>
+<dt><p>Initial release of the WinUsb-based driver, with support
+for the T-Mobile G1 and myTouch 3G (and similar devices).</p></dt>
+</dl>
+ </div>
+</div>
+
+
+<h2 id="WinUsbDriver">Downloading the Google USB Driver</h2>
+
+<div class="figure" style="width:536px;margin:0">
+ <img src="{@docRoot}images/developing/sdk-usb-driver.png" alt="" />
+ <p class="img-caption"><strong>Figure 1.</strong> The SDK Manager
+ with the Google USB Driver selected.</p>
+</div>
+
+<p>The USB Driver for Windows is available for download as an optional SDK
+component. You need the driver only if you are developing on Windows and
+want to connect an Android-powered device (ADP, Nexus One, or Nexus S) to your
+development environment over USB. </p>
+
+<p>To download the driver, use the Android SDK Manager tool that is
+included with the <a href="{@docRoot}sdk/index.html">Android SDK</a>:</p>
+<ol>
+ <li>Launch the Android SDK Manager by double-clicking <code>SDK Manager.exe</code>,
+ at the root of your SDK directory.</li>
+ <li>Expand <em>Extras</em>.</li>
+ <li>Check <strong>Google USB Driver package</strong> and click <strong>Install</strong>.</li>
+ <li>Proceed to install the package. When done, the driver files are
+downloaded into the <code><sdk>\extras\google\usb_driver\</code> directory.</li>
+</ol>
+
+<p>For installation information, read <a href="{@docRoot}tools/extras/oem-usb.html#InstallingDriver">Installing a USB Driver</a>.</p>
diff --git a/docs/html/tools/testing/activity_test.jd b/docs/html/tools/testing/activity_test.jd
new file mode 100644
index 0000000..8288249
--- /dev/null
+++ b/docs/html/tools/testing/activity_test.jd
@@ -0,0 +1,1334 @@
+page.title=Activity Testing Tutorial
+parent.title=Testing
+parent.link=index.html
+@jd:body
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li>
+ <a href="#Prerequisites">Prerequisites</a>
+ </li>
+ <li>
+ <a href="#DownloadCode">Installing the Tutorial Sample Code</a>
+ </li>
+ <li>
+ <a href="#SetupEmulator">Setting Up the Emulator</a>
+ </li>
+ <li>
+ <a href="#SetupProjects">Setting Up the Projects</a>
+ </li>
+ <li>
+ <a href="#CreateTestCaseClass">Creating the Test Case Class</a>
+ <ol>
+ <li>
+ <a href="#AddTestCaseClass">Adding the test case class file</a>
+ </li>
+ <li>
+ <a href="#AddConstructor">Adding the test case constructor</a>
+ </li>
+ <li>
+ <a href="#AddSetupMethod">Adding the setup method</a>
+ </li>
+ <li>
+ <a href="#AddPreConditionsTest">Adding an initial conditions test</a>
+ </li>
+ <li>
+ <a href="#AddUITest">Adding a UI test</a>
+ </li>
+ <li>
+ <a href="#StateManagementTests">Adding state management tests</a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <a href="#RunTests">Running the Tests and Seeing the Results</a>
+ </li>
+ <li>
+ <a href="#TestFailure">Forcing Some Tests to Fail</a>
+ </li>
+ <li>
+ <a href="#NextSteps">Next Steps</a>
+ </li>
+</ol>
+<h2 id="#Appendix">Appendix</h2>
+<ol>
+ <li>
+ <a href="#InstallCompletedTestApp">Installing the Completed Test Application File</a>
+ </li>
+ <li>
+ <a href="#EditorCommandLine">For Users Not Developing In Eclipse</a>
+ </li>
+</ol>
+<h2>See Also</h2>
+<ol>
+ <li>
+ <a href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>
+ </li>
+ <li>
+ {@link android.test.ActivityInstrumentationTestCase2}
+ </li>
+ <li>
+ {@link junit.framework.Assert}
+ </li>
+ <li>
+ {@link android.test.InstrumentationTestRunner}
+ </li>
+</ol>
+</div>
+</div>
+<p>
+ Android includes powerful tools for testing applications. The tools extend JUnit with additional features, provide convenience classes for mock Android system objects, and use
+ instrumentation to give you control over your main application while you are testing it. The entire Android testing environment is discussed in the document
+ <a href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>.
+</p>
+<p>
+ This tutorial demonstrates the Android testing tools by presenting a simple Android application and then leading you step-by-step through the creation of a test application for it.
+ The test application demonstrates these key points:
+</p>
+ <ul>
+ <li>
+ An Android test is itself an Android application that is linked to the application under test by entries in its <code>AndroidManifest.xml</code> file.
+ </li>
+ <li>
+ Instead of Android components, an Android test application contains one or more test cases. Each of these is a separate class definition.
+ </li>
+ <li>
+ Android test case classes extend the JUnit {@link junit.framework.TestCase} class.
+ </li>
+ <li>
+ Android test case classes for activities extend JUnit and also connect you to the application under test with instrumentation. You can send keystroke or touch events directly to the UI.
+ </li>
+ <li>
+ You choose an Android test case class based on the type of component (application, activity, content provider, or service) you are testing.
+ </li>
+ <li>
+ Additional test tools in Eclipse/ADT provide integrated support for creating test applications, running them, and viewing the results.
+ </li>
+ </ul>
+<p>
+ The test application contains methods that perform the following tests:
+</p>
+ <ul>
+ <li>
+ Initial conditions test. Tests that the application under test initializes correctly. This is also a unit test of the application's
+ {@link android.app.Activity#onCreate(android.os.Bundle) onCreate()} method. Testing initial conditions also provides a confidence measure for subsequent tests.
+ </li>
+ <li>
+ UI test. Tests that the main UI operation works correctly. This test demonstrates the instrumentation features available in activity testing.
+ It shows that you can automate UI tests by sending key events from the test application to the main application.
+ </li>
+ <li>
+ State management tests. Test the application's code for saving state. This test demonstrates the instrumentation features of the test runner, which
+ are available for testing any component.
+ </li>
+ </ul>
+<h2 id="Prerequisites">Prerequisites</h2>
+<p>
+ The instructions and code in this tutorial depend on the following:
+</p>
+ <ul>
+ <li>
+ Basic knowledge of Android programming. If you haven't yet written an Android application,
+ do the class
+ <a href="{@docRoot}training/basics/firstapp/index.html">Building Your First App</a>.
+ If you want to learn more about Spinner, the application under test, then you
+ might want to review the "Spinner" sample app.
+ </li>
+ <li>
+ Some familiarity with the Android testing framework and concepts. If you haven't explored
+ Android testing yet, start by reading the
+ <a href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>
+ guide.
+ </li>
+ <li>
+ Eclipse with ADT. This tutorial describes how to set up and run a test application using
+ Eclipse with ADT. If you haven't yet installed Eclipse and the ADT plugin,
+ follow the steps in <a href="{@docRoot}sdk/installing/index.html">Installing the SDK</a>
+ to install them before continuing. If you are not developing in Eclipse, you will
+ find instructions for setting up and running the test application in the
+ <a href="#EditorCommandLine">appendix</a> of this document.
+ </li>
+ <li>
+ Android 1.5 platform (API Level 3) or higher. You must have the Android 1.5 platform
+ (API Level 3) or higher installed in your SDK, because this tutorial uses APIs that
+ were introduced in that version.
+ <p>
+ If you are not sure which platforms are installed in your SDK,
+ open the Android SDK and AVD Manager and check in the
+ <strong>Installed Packages</strong> panel.
+ If aren't sure how to download a platform into your SDK,
+ read <a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>.
+ </p>
+ </li>
+ </ul>
+<h2 id="DownloadCode">Installing the Tutorial Sample Code</h2>
+<p>
+ During this tutorial, you will be working with sample code that is provided as part
+ of the downloadable Samples component of the SDK. Specifically, you will be working
+ with a pair of related sample applications — an application under test and a test
+ application:
+</p>
+ <ul>
+ <li>
+ Spinner is the application under test. This tutorial focuses on the
+ common situation of writing tests for an application that already exists, so the main
+ application is provided to you.
+ </li>
+ <li>
+ SpinnerTest is the test application. In the tutorial, you create this application
+ step-by-step. If you want to run quickly through the tutorial,
+ you can install the completed SpinnerTest application first, and then follow the
+ text. You may get more from the tutorial, however, if you create the test application
+ as you go. The instructions for installing the completed test application are in the
+ section
+ <a href="#InstallCompletedTestApp">Installing the Completed Test Application File</a>.
+ </li>
+ </ul>
+<p>
+ The sample applications are described in more detail in the
+ <a href="{@docRoot}tools/samples/index.html">Samples</a> topic. Follow the instructions to
+ download the version of the samples that's appropriate for the platform you're working with.
+</p>
+<h2 id="SetupEmulator">Setting Up the Emulator</h2>
+<p>
+ In this tutorial, you will use the Android emulator to run applications. The emulator needs
+ an Android Virtual Device (AVD) with an API level equal to or higher than the one you set for the projects in the previous step.
+ To find out how to check this and create the right AVD if necessary,
+ see <a href="{@docRoot}tools/devices/managing-avds.html">Creating an AVD</a>.
+</p>
+<p>
+ As a test of the AVD and emulator, run the SpinnerActivity application in Eclipse with ADT. When it starts,
+ click the large downward-pointing arrow to the right of the spinner text. You see the spinner expand and display the title "Select a planet" at the top.
+ Click one of the other planets. The spinner closes, and your selection appears below it on the screen.
+</p>
+<h2 id="SetupProjects">Setting Up the Projects</h2>
+<p>
+ When you are ready to get started with the tutorial, begin by setting up Eclipse projects for
+ both Spinner (the application under test) and SpinnerTest (the test application).
+</p>
+<p>
+ You'll be using the Spinner application as-is, without modification, so you'll be loading it
+ into Eclipse as a new Android project from existing source. In the process, you'll be
+ creating a new test project associated with Spinner that will contain the SpinnerTest
+ application. The SpinnerTest application will be completely new and you'll be
+ using the code examples in this tutorial to add test classes and tests to it.
+</p>
+<p>
+ To install the Spinner app in a new Android project from existing source, following these steps:
+</p>
+<ol>
+ <li>
+ In Eclipse, select <strong>File</strong> > <strong>New</strong> > <strong>Project</strong> > <strong>Android</strong> > <strong>Android Project</strong>,
+ then click Next. The <strong>New Android Project</strong> dialog appears.
+ </li>
+ <li>
+ In the <em>Project name</em> text box, enter "SpinnerActivity". The <em>Properties</em> area is filled in automatically.
+ </li>
+ <li>
+ In the <em>Contents</em> area, set "Create project from existing source".
+ </li>
+ <li>
+ For <em>Location</em>, click <strong>Browse</strong>, navigate to the directory <code><SDK_path>/samples/android-8/Spinner</code>,
+ then click Open. The directory name <code><SDK_path>/samples/android-8/Spinner</code> now appears in the <em>Location</em> text box.
+ </li>
+ <li>
+ In the <em>Build Target</em> area, set a API level of 3 or higher. If you are already developing with a particular target, and it is API level 3 or higher, then use that target.
+ </li>
+ <li>
+ In the <em>Properties</em> area, in the <em>Min SDK Version:</em>, enter "3".
+ </li>
+ <li>
+ You should now see these values:
+ <ul>
+ <li><em>Project Name:</em> "SpinnerActivity"</li>
+ <li><em>Create project from existing source:</em> set</li>
+ <li><em>Location:</em> "<code><SDK_path>/samples/android-8/Spinner</code>"</li>
+ <li><em>Build Target:</em> "API level of 3 or higher" (<em>Target Name</em> "Android 1.5 or higher")</li>
+ <li><em>Package name:</em> (disabled, set to "<code>com.android.example.spinner</code>")</li>
+ <li><em>Create Activity:</em> (disabled, set to ".SpinnerActivity")</li>
+ <li><em>Min SDK Version:</em> "3"</li>
+ </ul>
+ <p>
+ The following screenshot summarizes these values:
+ </p>
+ <a href="{@docRoot}images/testing/eclipse_new_android_project_complete_callouts.png">
+ <img src="{@docRoot}images/testing/eclipse_new_android_project_complete_callouts.png" alt="New Android Project dialog with filled-in values" style="height:230px"/>
+ </a>
+
+ </li>
+</ol>
+<p>
+ To create a new test project for the SpinnerTest application, follow these steps:
+</p>
+<ol>
+ <li>
+ Click Next. The <strong>New Android Test Project</strong> dialog appears.
+ </li>
+ <li>
+ Set "Create a Test Project".
+ </li>
+ <li>
+ Leave the other values unchanged. The result should be:
+ <ul>
+ <li><em>Create a Test Project:</em> checked</li>
+ <li><em>Test Project Name:</em> "SpinnerActivityTest"</li>
+ <li><em>Use default location:</em> checked (this should contain the directory name "<code>workspace/SpinnerActivityTest</code>").</li>
+ <li><em>Build Target:</em> Use the same API level you used in the previous step.</li>
+ <li><em>Application name:</em> "SpinnerActivityTest"</li>
+ <li><em>Package name:</em> "<code>com.android.example.spinner.test</code>"</li>
+ <li><em>Min SDK Version:</em> "3"</li>
+ </ul>
+ <p>
+ The following screenshot summarizes these values:
+ </p>
+ <a href="{@docRoot}images/testing/eclipse_new_android_testproject_complete_callouts.png">
+ <img src="{@docRoot}images/testing/eclipse_new_android_testproject_complete_callouts.png" alt="New Android Test Project dialog with filled-in values" style="height:230px"/>
+ </a>
+ </li>
+ <li>
+ Click Finish. Entries for SpinnerActivity and SpinnerActivityTest should appear in the
+ <strong>Package Explorer</strong>.
+ <p class="note">
+ <strong>Note:</strong> If you set <em>Build Target</em> to an API level higher than "3", you will see the warning
+ "The API level for the selected SDK target does not match the Min SDK version". You do not need to change the API level or the Min SDK version.
+ The message tells you that you are building the projects with one particular API level, but specifying that a lower API level is required. This may
+ occur if you have chosen not to install the optional earlier API levels.
+ </p>
+ <p>
+ If you see errors listed in the <strong>Problems</strong> pane at the bottom of the Eclipse window, or if a red error marker appears next to
+ the entry for SpinnerActivity in the Package Explorer, highlight the SpinnerActivity entry and then select
+ <strong>Project</strong> > <strong>Clean</strong>. This should fix any errors.
+ </p>
+ </li>
+</ol>
+<p>
+ You now have the application under test in the SpinnerActivity project,
+ and an empty test project in SpinnerActivityTest. You may
+ notice that the two projects are in different directories, but Eclipse with
+ ADT handles this automatically. You should have no problem in either building or running them.
+</p>
+<p>
+ Notice that Eclipse and ADT have already done some initial setup for your test application.
+ Expand the SpinnerActivityTest project, and notice that it already has an
+ Android manifest file <code>AndroidManifest.xml</code>.
+ Eclipse with ADT created this when you added the test project.
+ Also, the test application is already set up to use instrumentation. You can see this
+ by examining <code>AndroidManifest.xml</code>.
+ Open it, then at the bottom of the center pane click <strong>AndroidManifest.xml</strong>
+ to display the XML contents:
+</p>
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.example.spinner.test"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <uses-sdk android:minSdkVersion="3" />
+ <instrumentation
+ android:targetPackage="com.android.example.spinner"
+ android:name="android.test.InstrumentationTestRunner" />
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <uses-library android:name="android.test.runner" />
+ ...
+ </application>
+</manifest>
+</pre>
+<p>
+ Notice the <code><instrumentation></code> element. The attribute
+ <code>android:targetPackage="com.android.example.spinner"</code> tells Android that the
+ application under test is defined in the Android package
+ <code>com.android.example.spinner</code>. Android now knows to use that
+ package's <code>AndroidManifest.xml</code> file to launch the application under test.
+ The <code><instrumentation></code> element also contains the attribute
+ <code>android:name="android.test.InstrumentationTestRunner"</code>, which tells Android
+ instrumentation to run the test application with Android's instrumentation-enabled test runner.
+</p>
+<h2 id="CreateTestCaseClass">Creating the Test Case Class</h2>
+
+<p>
+ You now have a test project SpinnerActivityTest, and the basic structure of a test
+ application also called SpinnerActivityTest. The basic structure includes all the files and
+ directories you need to build and run a test application, except for the class that
+ contains your tests (the test case class).
+</p>
+<p>
+ The next step is to define the test case class. In this tutorial, you'll be creating a
+ test case class that includes:
+</p>
+<ul>
+ <li>
+ Test setup. This use of the JUnit {@link junit.framework.TestCase#setUp() setUp()}
+ method demonstrates some of the tasks you might perform before running an Android test.
+ </li>
+ <li>
+ Testing initial conditions. This test demonstrates a good testing technique.
+ It also demonstrates that with Android instrumentation you can look at the application
+ under test <em>before</em> the main activity starts. The test checks that the application's
+ important objects have been initialized.
+ If the test fails, you then know that any other tests against the application are
+ unreliable, since the application was running in an incorrect state.
+ <p class="note">
+ <strong>Note:</strong> The purpose of testing initial conditions is not the same as
+ using <code>setUp()</code>. The JUnit {@link junit.framework.TestCase#setUp()} runs once
+ before <strong>each test method</strong>, and its purpose is to create a clean test
+ environment. The initial conditions test runs once, and its purpose is to verify that the
+ application under test is ready to be tested.
+ </p>
+ </li>
+ <li>
+ Testing the UI. This test shows how to control the main application's UI
+ with instrumentation, a powerful automation feature of Android testing.
+ </li>
+ <li>
+ Testing state management. This test shows some techniques for testing how
+ well the application maintains state in the Android environment. Remember that to
+ provide a satisfactory user experience, your application must never lose its current state,
+ even if it's interrupted by a phone call or destroyed because of memory constraints.
+ The Android activity lifecycle provides ways to maintain state, and the
+ <code>SpinnerActivity</code> application uses them. The test shows the techniques for
+ verifying that they work.
+ </li>
+</ul>
+<p>
+ Android tests are contained in a special type of Android application that contains one or more test class definitions. Each of these contains
+ one or more test methods that do the actual tests. In this tutorial, you will first add a test case class, and then add tests to it.
+</p>
+<p>
+ You first choose an Android test case class to extend. You choose from the base test case classes according to the Android component you are testing and the types of tests you are doing.
+ In this tutorial, the application under test has a single simple activity, so the test case class will be for an Activity component. Android offers several, but the one that tests in
+ the most realistic environment is {@link android.test.ActivityInstrumentationTestCase2}, so you will use it as the base class. Like all activity test case classes,
+ <code>ActivityInstrumentationTestCase2</code> offers convenience methods for interacting directly with the UI of the application under test.
+</p>
+<h3 id="AddTestCaseClass">Adding the test case class file</h3>
+<p>
+ To add <code>ActivityInstrumentationTestCase2</code> as the base test case class, follow these steps:
+</p>
+<ol>
+ <li>
+ In the Package Explorer, expand the test project SpinnerActivityTest if it is not open already.
+ </li>
+ <li>
+ Within SpinnerActivityTest, expand the <code>src/</code> folder and then the package marker for
+ <code>com.android.example.spinner.test</code>. Right-click on the package name and select <strong>New</strong> > <strong>Class</strong>:<br/>
+ <a href="{@docRoot}images/testing/spinner_create_test_class_callouts.png">
+ <img alt="Menu for creating a new class in the test application" src="{@docRoot}images/testing/spinner_create_test_class_callouts.png" style="height:230px"/>
+ </a>
+ <p>
+ The <strong>New Java Class</strong> wizard appears:
+ </p>
+ <a href="{@docRoot}images/testing/spinnertest_new_class_callouts.png">
+ <img alt="New Java Class wizard dialog" src="{@docRoot}images/testing/spinnertest_new_class_callouts.png" style="height:230px"/>
+ </a>
+ </li>
+ <li>
+ In the wizard, enter the following:
+ <ul>
+ <li>
+ <em>Name:</em> "SpinnerActivityTest". This becomes the name of your test class.
+ </li>
+ <li>
+ <em>Superclass:</em> "<code>android.test.ActivityInstrumentationTestCase2<SpinnerActivity></code>". The superclass is parameterized, so
+ you have to provide it your main application's class name.
+ </li>
+ </ul>
+ <p>
+ Do not change any of the other settings. Click Finish.
+ </p>
+ </li>
+ <li>
+ You now have a new file <code>SpinnerActivityTest.java</code> in the project.
+ </li>
+ <li>
+ To resolve the reference to SpinnerActivity, add the following import:
+<pre>
+import com.android.example.spinner.SpinnerActivity;
+</pre>
+ </li>
+</ol>
+<h3 id="AddConstructor">Adding the test case constructor</h3>
+ <p>
+ To ensure that the test application is instantiated correctly, you must set up a constructor that the test
+ runner will call when it instantiates your test class. This constructor has no parameters, and its sole
+ purpose is to pass information to the superclass's default constructor. To set up this constructor, enter the
+ following code in the class:
+ </p>
+<pre>
+ public SpinnerActivityTest() {
+ super("com.android.example.spinner", SpinnerActivity.class);
+ } // end of SpinnerActivityTest constructor definition
+</pre>
+<p>
+ This calls the superclass constructor with the Android package name (<code>com.android.example.spinner</code>)and main activity's class
+ (<code>SpinnerActivity.class</code>) for the application under test. Android uses this information to find the application and activity to test.
+</p>
+<p>
+ You are now ready to add tests, by adding test methods to the class.
+</p>
+<h3 id="AddSetupMethod">Adding the setup method</h3>
+<p>
+ The <code>setUp()</code> method is invoked before every test. You use it to initialize variables and clean up from previous tests. You can also use
+ the JUnit {@link junit.framework.TestCase#tearDown() tearDown()} method, which runs <strong>after</strong> every test method. The tutorial does not use it.
+</p>
+<p>
+ The method you are going to add does the following:
+</p>
+<ul>
+ <li>
+ <code>super.setUp()</code>. Invokes the superclass constructor for <code>setUp()</code>, which is required by JUnit.
+ </li>
+ <li>
+ Calls {@link android.test.ActivityInstrumentationTestCase2#setActivityInitialTouchMode(boolean) setActivityInitialTouchMode(false)}.
+ This turns off <strong>touch mode</strong> in the device or emulator. If any of your test methods send key events to the application,
+ you must turn off touch mode <em>before</em> you start any activities; otherwise, the call is ignored.
+ </li>
+ <li>
+ Stores references to system objects. Retrieves and stores a reference to the activity under test, the <code>Spinner</code>
+ widget used by the activity, the <code>SpinnerAdapter</code> that backs the widget, and the string value of the selection that is
+ set when the application is first installed. These objects are used in the state management test. The methods invoked are:
+ <ul>
+ <li>
+ {@link android.test.ActivityInstrumentationTestCase2#getActivity()}. Gets a reference to the activity under test (<code>SpinnerActivity</code>).
+ This call also starts the activity if it is not already running.
+ </li>
+ <li>
+ {@link android.app.Activity#findViewById(int)}. Gets a reference to the <code>Spinner</code> widget of the application under test.
+ </li>
+ <li>
+ {@link android.widget.AbsSpinner#getAdapter()}. Gets a reference to the adapter (an array of strings) backing the spinner.
+ </li>
+ </ul>
+ </li>
+</ul>
+<p>
+ Add this code to the definition of <code>SpinnerActivityTest</code>, after the constructor definition:
+</p>
+<pre>
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ setActivityInitialTouchMode(false);
+
+ mActivity = getActivity();
+
+ mSpinner =
+ (Spinner) mActivity.findViewById(
+ com.android.example.spinner.R.id.Spinner01
+ );
+
+ mPlanetData = mSpinner.getAdapter();
+
+ } // end of setUp() method definition
+</pre>
+<p>
+ Add these members to the test case class:
+</p>
+<pre>
+ private SpinnerActivity mActivity;
+ private Spinner mSpinner;
+ private SpinnerAdapter mPlanetData;
+</pre>
+<p>
+ Add these imports:
+</p>
+<pre>
+import android.widget.Spinner;
+import android.widget.SpinnerAdapter;
+</pre>
+<p>
+ You now have the the complete <code>setUp()</code> method.
+</p>
+<h3 id="AddPreConditionsTest">Adding an initial conditions test</h3>
+<p>
+ The initial conditions test verifies that the application under test is initialized correctly. It is an illustration of the types of tests you can run, so it is not comprehensive.
+ It verifies the following:
+</p>
+<ul>
+ <li>
+ The item select listener is initialized. This listener is called when a selection is made from the spinner.
+ </li>
+ <li>
+ The adapter that provides values to the spinner is initialized.
+ </li>
+ <li>
+ The adapter contains the right number of entries.
+ </li>
+</ul>
+<p>
+ The actual initialization of the application under test is done in <code>setUp()</code>, which the test runner calls automatically before every test. The verifications are
+ done with JUnit {@link junit.framework.Assert} calls. As a useful convention, the method name is <code>testPreConditions()</code>:
+</p>
+<pre>
+ public void testPreConditions() {
+ assertTrue(mSpinner.getOnItemSelectedListener() != null);
+ assertTrue(mPlanetData != null);
+ assertEquals(mPlanetData.getCount(),ADAPTER_COUNT);
+ } // end of testPreConditions() method definition
+</pre>
+<p>
+ Add this member:
+</p>
+<pre>
+ public static final int ADAPTER_COUNT = 9;
+</pre>
+<h3 id="AddUITest">Adding a UI test</h3>
+<p>
+ Now create a UI test that selects an item from the <code>Spinner</code> widget. The test sends key events to the UI with key events.
+ The test confirms that the selection matches the result you expect.
+</p>
+<p>
+ This test demonstrates the power of using instrumentation in Android testing. Only an instrumentation-based test class allows you to send key events (or touch events)
+ to the application under test. With instrumentation, you can test your UI without having to take screenshots, record the screen, or do human-controlled testing.
+</p>
+<p>
+ To work with the spinner, the test has to request focus for it and then set it to a known position. The test uses {@link android.view.View#requestFocus() requestFocus()} and
+ {@link android.widget.AbsSpinner#setSelection(int) setSelection()} to do this. Both of these methods interact with a View in the application under test, so you have to call them
+ in a special way.
+</p>
+<p>
+ Code in a test application that interacts with a View of the application under test must run in the main application's thread, also
+ known as the <em>UI thread</em>. To do this, you use the {@link android.app.Activity#runOnUiThread(java.lang.Runnable) Activity.runOnUiThread()}
+ method. You pass the code to <code>runOnUiThread()</code>in an anonymous {@link java.lang.Runnable Runnable} object. To set
+ the statements in the <code>Runnable</code> object, you override the object's {@link java.lang.Runnable#run()} method.
+</p>
+<p>
+ To send key events to the UI of the application under test, you use the <a href="{@docRoot}reference/android/test/InstrumentationTestCase.html#sendKeys(int...)">sendKeys</a>() method.
+ This method does not have to run on the UI thread, since Android uses instrumentation to pass the key events to the application under test.
+</p>
+<p>
+ The last part of the test compares the selection made by sending the key events to a pre-determined value. This tests that the spinner is working as intended.
+</p>
+<p>
+ The following sections show you how to add the code for this test.
+</p>
+<ol>
+ <li>
+ Get focus and set selection. Create a new method <code>public void testSpinnerUI()</code>. Add
+ code to to request focus for the spinner and set its position to default or initial position, "Earth". This code is run on the UI thread of
+ the application under test:
+<pre>
+ public void testSpinnerUI() {
+
+ mActivity.runOnUiThread(
+ new Runnable() {
+ public void run() {
+ mSpinner.requestFocus();
+ mSpinner.setSelection(INITIAL_POSITION);
+ } // end of run() method definition
+ } // end of anonymous Runnable object instantiation
+ ); // end of invocation of runOnUiThread
+</pre>
+ <p>
+ Add the following member to the test case class.
+ </p>
+<pre>
+ public static final int INITIAL_POSITION = 0;
+</pre>
+ </li>
+ <li>
+ Make a selection. Send key events to the spinner to select one of the items. To do this, open the spinner by
+ "clicking" the center keypad button (sending a DPAD_CENTER key event) and then clicking (sending) the down arrow keypad button five times. Finally,
+ click the center keypad button again to highlight the desired item. Add the following code:
+<pre>
+ this.sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
+ for (int i = 1; i <= TEST_POSITION; i++) {
+ this.sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
+ } // end of for loop
+
+ this.sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
+</pre>
+ <p>
+ Add the following member to the test case class:
+ </p>
+<pre>
+ public static final int TEST_POSITION = 5;
+</pre>
+ <p>
+ This sets the final position of the spinner to "Saturn" (the spinner's backing adapter is 0-based).
+ </p>
+ </li>
+ <li>
+ Check the result. Query the current state of the spinner, and compare its current selection to the expected value.
+ Call the method {@link android.widget.AdapterView#getSelectedItemPosition() getSelectedItemPosition()} to find out the current selection position, and then
+ {@link android.widget.AdapterView#getItemAtPosition(int) getItemAtPosition()} to get the object corresponding to that position (casting it to a String). Assert that
+ this string value matches the expected value of "Saturn":
+<pre>
+ mPos = mSpinner.getSelectedItemPosition();
+ mSelection = (String)mSpinner.getItemAtPosition(mPos);
+ TextView resultView =
+ (TextView) mActivity.findViewById(
+ com.android.example.spinner.R.id.SpinnerResult
+ );
+
+ String resultText = (String) resultView.getText();
+
+ assertEquals(resultText,mSelection);
+
+ } // end of testSpinnerUI() method definition
+</pre>
+<p>
+ Add the following members to the test case class:
+</p>
+<pre>
+ private String mSelection;
+ private int mPos;
+</pre>
+ <p>
+ Add the following imports to the test case class:
+ </p>
+<pre>
+ import android.view.KeyEvent;
+ import android.widget.TextView;
+</pre>
+ </li>
+</ol>
+<p>
+ Pause here to run the tests you have. The procedure for running a test application is different
+ from running a regular Android application. You run a test application as an Android JUnit
+ application. To see how to do this, see <a href="#RunTests">Running the Tests and Seeing the Results</a>.
+</p>
+<p>
+ Eventually, you will see the <code>SpinnerActivity</code> application start, and the test
+ application controlling it by sending it key events. You will also see a new
+ <strong>JUnit</strong> view in the Explorer pane, showing the results of the
+ test. The JUnit view is documented in a following section,
+ <a href="#RunTests">Running the Test and Seeing the Results</a>.
+</p>
+<h3 id="StateManagementTests">Adding state management tests</h3>
+<p>
+ You now write two tests that verify that SpinnerActivity maintains its state when it is paused or terminated.
+ The state, in this case, is the current selection in the spinner. When users make a selection,
+ pause or terminate the application, and then resume or restart it, they should see
+ the same selection.
+</p>
+<p>
+ Maintaining state is an important feature of an application. Users may switch from the current
+ application temporarily to answer the phone, and then switch back. Android may decide to
+ terminate and restart an activity to change the screen orientation, or terminate an unused
+ activity to regain storage. In each case, users are best served by having the UI return to its
+ previous state (except where the logic of the application dictates otherwise).
+</p>
+<p>
+ SpinnerActivity manages its state in these ways:
+</p>
+ <ul>
+ <li>
+ Activity is hidden. When the spinner screen (the activity) is running but hidden by some other screen, it
+ stores the spinner's position and value in a form that persists while the application is running.
+ </li>
+ <li>
+ Application is terminated. When the activity is terminated, it stores the spinner's position and value in
+ a permanent form. The activity can read the position and value when it restarts, and restore the spinner to its previous state.
+ </li>
+ <li>
+ Activity re-appears. When the user returns to the spinner screen, the previous selection is restored.
+ </li>
+ <li>
+ Application is restarted. When the user starts the application again, the previous selection is restored.
+ </li>
+ </ul>
+<p class="note">
+ <strong>Note:</strong> An application can manage its state in other ways as well, but these are
+ not covered in this tutorial.
+</p>
+<p>
+ When an activity is hidden, it is <strong>paused</strong>. When it re-appears, it
+ <strong>resumes</strong>. Recognizing that these are key points in an activity's life cycle,
+ the Activity class provides two callback methods {@link android.app.Activity#onPause()} and
+ {@link android.app.Activity#onResume()} for handling pauses and resumes.
+ SpinnerActivity uses them for code that saves and restores state.
+</p>
+<p>
+ <strong>Note:</strong> If you would like to learn more about the difference between losing
+ focus/pausing and killing an application,
+ read about the <a href="{@docRoot}guide/components/activities.html#Lifecycle">activity
+lifecycle</a>.
+</p>
+<p>
+ The first test verifies that the spinner selection is maintained after the entire application is shut down and then restarted. The test uses instrumentation to
+ set the spinner's variables outside of the UI. It then terminates the activity by calling {@link android.app.Activity#finish() Activity.finish()}, and restarts it
+ using the instrumentation method {@link android.test.ActivityInstrumentationTestCase2#getActivity()}. The test then asserts that the current spinner state matches
+ the test values.
+</p>
+<p>
+ The second test verifies that the spinner selection is maintained after the activity is paused and then resumed. The test uses instrumentation to
+ set the spinner's variables outside of the UI and then force calls to the <code>onPause()</code> and <code>onResume()</code> methods. The test then
+ asserts that the current spinner state matches the test values.
+</p>
+<p>
+ Notice that these tests make limited assumptions about the mechanism by which the activity manages state. The tests use the activity's getters and
+ setters to control the spinner. The first test also knows that hiding an activity calls <code>onPause()</code>, and bringing it back to the foreground
+ calls <code>onResume()</code>. Other than this, the tests treat the activity as a "black box".
+</p>
+<p>
+ To add the code for testing state management across shutdown and restart, follow these steps:
+</p>
+ <ol>
+ <li>
+ Add the test method <code>testStateDestroy()</code>, then
+ set the spinner selection to a test value:
+<pre>
+ public void testStateDestroy() {
+ mActivity.setSpinnerPosition(TEST_STATE_DESTROY_POSITION);
+ mActivity.setSpinnerSelection(TEST_STATE_DESTROY_SELECTION);
+</pre>
+ </li>
+ <li>
+ Terminate the activity and restart it:
+<pre>
+ mActivity.finish();
+ mActivity = this.getActivity();
+</pre>
+ </li>
+ <li>
+ Get the current spinner settings from the activity:
+<pre>
+ int currentPosition = mActivity.getSpinnerPosition();
+ String currentSelection = mActivity.getSpinnerSelection();
+</pre>
+ </li>
+ <li>
+ Test the current settings against the test values:
+<pre>
+ assertEquals(TEST_STATE_DESTROY_POSITION, currentPosition);
+ assertEquals(TEST_STATE_DESTROY_SELECTION, currentSelection);
+ } // end of testStateDestroy() method definition
+</pre>
+<p>
+ Add the following members to the test case class:
+<pre>
+ public static final int TEST_STATE_DESTROY_POSITION = 2;
+ public static final String TEST_STATE_DESTROY_SELECTION = "Earth";
+</pre>
+ </li>
+ </ol>
+<p>
+ To add the code for testing state management across a pause and resume, follow these steps:
+</p>
+<ol>
+ <li>
+ Add the test method <code>testStatePause()</code>:
+<pre>
+ @UiThreadTest
+ public void testStatePause() {
+</pre>
+ <p>
+ The <code>@UiThreadTest</code> annotation tells Android to build this method so that it runs
+ on the UI thread. This allows the method to change the state of the spinner widget in the
+ application under test. This use of <code>@UiThreadTest</code> shows that, if necessary, you
+ can run an entire method on the UI thread.
+ </p>
+ </li>
+ <li>
+ Set up instrumentation. Get the instrumentation object
+ that is controlling the application under test. This is used later to
+ invoke the <code>onPause()</code> and <code>onResume()</code> methods:
+<pre>
+ Instrumentation mInstr = this.getInstrumentation();
+</pre>
+ </li>
+ <li>
+ Set the spinner selection to a test value:
+<pre>
+ mActivity.setSpinnerPosition(TEST_STATE_PAUSE_POSITION);
+ mActivity.setSpinnerSelection(TEST_STATE_PAUSE_SELECTION);
+</pre>
+ </li>
+ <li>
+ Use instrumentation to call the Activity's <code>onPause()</code>:
+<pre>
+ mInstr.callActivityOnPause(mActivity);
+</pre>
+ <p>
+ Under test, the activity is waiting for input. The invocation of
+ {@link android.app.Instrumentation#callActivityOnPause(android.app.Activity)}
+ performs a call directly to the activity's <code>onPause()</code> instead
+ of manipulating the activity's UI to force it into a paused state.
+ </p>
+ </li>
+ <li>
+ Force the spinner to a different selection:
+<pre>
+ mActivity.setSpinnerPosition(0);
+ mActivity.setSpinnerSelection("");
+</pre>
+ <p>
+ This ensures that resuming the activity actually restores the
+ spinner's state rather than simply leaving it as it was.
+ </p>
+ </li>
+ <li>
+ Use instrumentation to call the Activity's <code>onResume()</code>:
+<pre>
+ mInstr.callActivityOnResume(mActivity);
+</pre>
+ <p>
+ Invoking {@link android.app.Instrumentation#callActivityOnResume(android.app.Activity)}
+ affects the activity in a way similar to <code>callActivityOnPause</code>. The
+ activity's <code>onResume()</code> method is invoked instead of manipulating the
+ activity's UI to force it to resume.
+ </p>
+ </li>
+ <li>
+ Get the current state of the spinner:
+<pre>
+ int currentPosition = mActivity.getSpinnerPosition();
+ String currentSelection = mActivity.getSpinnerSelection();
+</pre>
+ </li>
+ <li>
+ Test the current spinner state against the test values:
+<pre>
+ assertEquals(TEST_STATE_PAUSE_POSITION,currentPosition);
+ assertEquals(TEST_STATE_PAUSE_SELECTION,currentSelection);
+ } // end of testStatePause() method definition
+</pre>
+ <p>
+ Add the following members to the test case class:
+ </p>
+<pre>
+ public static final int TEST_STATE_PAUSE_POSITION = 4;
+ public static final String TEST_STATE_PAUSE_SELECTION = "Jupiter";
+</pre>
+ </li>
+ <li>
+ Add the following imports:
+<pre>
+ import android.app.Instrumentation;
+ import android.test.UiThreadTest;
+</pre>
+ </li>
+</ol>
+<h2 id="RunTests">Running the Tests and Seeing the Results</h2>
+ <p>
+ The most simple way to run the <code>SpinnerActivityTest</code> test case is to run it directly from the Package Explorer.
+ </p>
+ <p>
+ To run the <code>SpinnerActivityTest</code> test, follow these steps:
+</p>
+ <ol>
+ <li>
+ In the Package Explorer, right-click the project SpinnerActivityTest at the top level, and then
+ select <strong>Run As</strong> > <strong>Android JUnit Test</strong>:<br/>
+ <a href="{@docRoot}images/testing/spinnertest_runas_menu_callouts.png">
+ <img alt="Menu to run a test as an Android JUnit test" src="{@docRoot}images/testing/spinnertest_runas_menu_callouts.png" style="height:230px">
+ </a>
+ </li>
+ <li>
+ You will see the emulator start. When the unlock option is displayed (its appearance depends on the API level you specified for the AVD),
+ unlock the home screen.
+ </li>
+ <li>
+ The test application starts. You see a new tab for the <strong>JUnit</strong> view, next to the Package Explorer tab:<br/>
+ <a href="{@docRoot}images/testing/spinnertest_junit_panel.png">
+ <img alt="The JUnit window" src="{@docRoot}images/testing/spinnertest_junit_panel.png" style="height:230px">
+ </a>
+ </li>
+</ol>
+<p>
+ This view contains two sub-panes. The top pane summarizes the tests that were run, and the bottom pane shows failure traces for
+ highlighted tests.
+</p>
+<p>
+ At the conclusion of a successful test run, this is the view's appearance:<br/>
+ <a href="{@docRoot}images/testing/spinnertest_junit_success.png">
+ <img src="{@docRoot}images/testing/spinnertest_junit_success.png" alt="JUnit test run success" style="height:230px"/>
+ </a>
+</p>
+<p>
+ The upper pane summarizes the test:
+</p>
+ <ul>
+ <li>
+ Total time elapsed for the test application(labeled <em>Finished after <x> seconds</em>).
+ </li>
+ <li>
+ Number of runs (<em>Runs:</em>) - the number of tests in the entire test class.
+ </li>
+ <li>
+ Number of errors (<em>Errors:</em>) - the number of program errors and exceptions encountered during
+ the test run.
+ </li>
+ <li>
+ Number of failures (<em>Failures:</em>) - the number of test failures encountered during the test
+ run. This is the number of assertion failures. A test can fail even if the program does not encounter an error.
+ </li>
+ <li>
+ A progress bar. The progress bar extends from left to right as the tests run.
+ <p>
+ If all the tests succeed, the bar remains green. If a test fails, the bar turns from green to red.
+ </p>
+ </li>
+ <li>
+ A test method summary. Below the bar, you see a line for each class in the test application. To look at the results for the individual
+ methods in a test, click the arrow at the left to expand the line. You see the name of each test method. To the
+ right of the name, you see the time taken by the test. You can look at the test's code
+ by double-clicking its name.
+ </li>
+ </ul>
+<p>
+ The lower pane contains the failure trace. If all the tests are successful, this pane is empty. If some tests fail,
+ then if you highlight a failed test in the upper pane, the lower view contains a stack trace for the test. This is
+ demonstrated in the next section.
+</p>
+<p class="note">
+ <strong>Note:</strong> If you run the test application and nothing seems to happen, look for
+ the JUnit view. If you do not see it, you may have run the test application
+ as a regular Android application.
+ Remember that you need to run it as an Android <strong>JUnit</strong>
+ application.
+</p>
+<h2 id="TestFailure">Forcing Some Tests to Fail</h2>
+<p>
+ A test is as useful when it fails as when it succeeds. This section shows what happens in Eclipse with ADT when a test fails. You
+ can quickly see that a test class has failed, find the method or methods that failed, and then use a failure trace to find
+ the exact problem.
+</p>
+<p>
+ The example application SpinnerActivity that you downloaded passes all the tests in the test application SpinnerActivityTest.
+ To force the test to fail, you must modify the example application. You change a line of setup code in the application under test. This
+ causes the <code>testPreConditions()</code> and <code>testTextView()</code> test methods to fail.
+</p>
+<p>
+ To force the tests to fail, follow these steps:
+</p>
+<ol>
+ <li>
+ In Eclipse with ADT, go to the SpinnerActivity project and open the file <code>SpinnerActivity.java</code>.
+ </li>
+ <li>
+ At the top of <code>SpinnerActivity.java</code>, at the end of the <code>onCreate()</code> method, find the following line:
+<pre>
+ // mySpinner.setOnItemSelectedListener(null);
+</pre>
+ <p>Remove the forward slash characters at the beginning of the line to
+ uncomment the line. This sets the listener callback to null:
+ </p>
+<pre>
+ mySpinner.setOnItemSelectedListener(null);
+</pre>
+ </li>
+ <li>
+ The <code>testPreConditions()</code> method in <code>SpinnerActivityTest</code> contains the following test:
+ <code>assertTrue(mSpinner.getOnItemSelectedListener() != null);</code>. This test asserts that the listener callback is <em>not</em> null.
+ Since you have modified the application under test, this assertion now fails.
+ </li>
+ <li>
+ Run the test, as described in the previous section <a href="#RunTests">Running the Tests and Seeing the Results</a>.
+ </li>
+</ol>
+<p>
+ The JUnit view is either created or updated with the results of the test. Now, however, the progress bar is red,
+ the number of failures is 2, and small "x" icons appear in the list icons next to the testPreConditions and
+ TestSpinnerUI tests. This indicates that the tests have failed. The display is similar to this:<br/>
+ <a href="{@docRoot}images/testing/spinnertest_junit_panel_fail_callouts.png">
+ <img src="{@docRoot}images/testing/spinnertest_junit_panel_fail_callouts.png" alt="The JUnit Failure window" style="height:230px"/>
+ </a>
+</p>
+<p>
+ You now want to look at the failures to see exactly where they occurred.
+</p>
+<p>
+ To examine the failures, follow these steps:
+</p>
+<ol>
+ <li>
+ Click the testPreconditions entry. In the lower pane entitled <strong>Failure Trace</strong>,
+ you see a stack trace of the calls that led to the failure. This trace is similar to the following screenshot:<br/>
+ <a href="{@docRoot}images/testing/spinnertest_junit_panel_failtrace_callouts.png">
+ <img src="{@docRoot}images/testing/spinnertest_junit_panel_failtrace_callouts.png" alt="The JUnit failure trace" style="height:230px"/>
+ </a>
+ </li>
+ <li>
+ The first line of the trace tells you the error. In this case, a JUnit assertion failed. To look at the
+ assertion in the test code, double-click the next line (the first line of the trace). In the center pane
+ a new tabbed window opens, containing the code for the test application <code>SpinnerActivityTest</code>. The failed assertion
+ is highlighted in the middle of the window.
+ </li>
+</ol>
+<p>
+ The assertion failed because you modified the main application to set the <code>getOnItemSelectedListener</code> callback to <code>null</code>.
+</p>
+<p>
+ You can look at the failure in <code>testTextView</code> if you want. Remember, though, that <code>testPreConditions</code> is meant to verify the
+ initial setup of the application under test. If testPreConditions() fails, then succeeding tests can't be trusted. The best strategy to follow is to
+ fix the problem and re-run all the tests.
+</p>
+<p>
+ Remember to go back to <code>SpinnerActivity.java</code> and re-comment the line you uncommented in an earlier step.
+</p>
+<p>
+ You have now completed the tutorial.
+</p>
+<h2 id="NextSteps">Next Steps</h2>
+<p>
+ This example test application has shown you how to create a test project and link it to
+ the application you want to test, how to choose and add a test case class, how to write
+ UI and state management tests, and how to run the tests against the application under
+ test. Now that you are familiar with the basics of testing Android applications, here
+ are some suggested next steps:
+</p>
+<p>
+ <strong>Learn more about testing on Android</strong>
+</p>
+<ul>
+ <li>
+ If you haven't done so already, read the
+ <a href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>
+ document in the <em>Dev Guide</em>. It provides an overview of how testing on Android
+ works. If you are just getting started with Android testing, reading that document will
+ help you understand the tools available to you, so that you can develop effective
+ tests.
+ </li>
+</ul>
+<p>
+ <strong>Review the main Android test case classes</strong>
+</p>
+<ul>
+ <li>
+ {@link android.test.ActivityInstrumentationTestCase2}
+ </li>
+ <li>
+ {@link android.test.ActivityUnitTestCase}
+ </li>
+ <li>
+ {@link android.test.ProviderTestCase2}
+ </li>
+ <li>
+ {@link android.test.ServiceTestCase}
+ </li>
+</ul>
+<p>
+ <strong>Learn more about the assert and utility classes</strong>
+</p>
+<ul>
+ <li>
+ {@link junit.framework.Assert}, the JUnit Assert class.
+ </li>
+ <li>
+ {@link android.test.MoreAsserts}, additional Android assert methods.
+ </li>
+ <li>
+ {@link android.test.ViewAsserts}, useful assertion methods for testing Views.
+ </li>
+ <li>
+ {@link android.test.TouchUtils}, utility methods for simulating touch events in an Activity.
+ </li>
+</ul>
+<p>
+ <strong>Learn about instrumentation and the instrumented test runner</strong>
+</p>
+<ul>
+ <li>
+ {@link android.app.Instrumentation}, the base instrumentation class.
+ </li>
+ <li>
+ {@link android.test.InstrumentationTestCase}, the base instrumentation test case.
+ </li>
+ <li>
+ {@link android.test.InstrumentationTestRunner}, the standard Android test runner.
+ </li>
+</ul>
+<h2 id="Appendix">Appendix</h2>
+<h3 id="InstallCompletedTestApp">Installing the Completed Test Application File</h3>
+<p>
+ The recommended approach to this tutorial is to follow the instructions step-by-step and
+ write the test code as you go. However, if you want to do this tutorial quickly,
+ you can install the entire file for the test application into the test project.
+</p>
+<p>
+ To do this, you first create a test project with the necessary structure and files by using
+ the automated tools in Eclipse. Then you exit Eclipse and copy the test application's file
+ from the SpinnerTest sample project into your test project. The SpinnerTest sample project is
+ part of the Samples component of the SDK.
+</p>
+<p>
+ The result is a complete test application, ready to run against the Spinner sample application.
+</p>
+<p>
+ To install the test application file, follow these steps:
+</p>
+<ol>
+ <li>
+ Set up the projects for the application under test and the test application, as described
+ in the section section <a href="#SetupProjects">Setting Up the Projects</a>.
+ </li>
+ <li>
+ Set up the emulator, as described in the section <a href="#SetupEmulator">Setting Up the Emulator</a>.
+ </li>
+ <li>
+ Add the test case class, as described in the section <a href="#AddTestCaseClass">Adding the test case class file</a>.
+ </li>
+ <li>
+ Close Eclipse with ADT.
+ </li>
+ <li>
+ Copy the file <code><SDK_path>/samples/android-8/SpinnerTest/src/com/android/example/spinner/test/SpinnerActivityTest.java</code>
+ to the directory <code>workspace/SpinnerActivityTest/src/com/android/example/spinner/test/</code>.
+ </li>
+ <li>
+ Restart Eclipse with ADT.
+ </li>
+ <li>
+ In Eclipse with ADT, re-build the project <code>SpinnerActivityTest</code> by selecting it in the Package Explorer, right-clicking,
+ and selecting <em>Project</em> > <em>Clean</em>.
+ </li>
+ <li>
+ The complete, working test application should now be in the <code>SpinnerActivityTest</code> project.
+ </li>
+</ol>
+<p>
+ You can now continue with the tutorial, starting at the section <a href="#AddConstructor">Adding the test case constructor</a> and
+ following along in the text.
+</p>
+<h3 id="EditorCommandLine">For Users Not Developing In Eclipse</h3>
+<p>
+ If you are not developing in Eclipse, you can still do this tutorial. Android provides tools for
+ creating test applications using a code editor and command-line tools. You use the following tools:
+</p>
+<ul>
+ <li>
+ <a href="{@docRoot}tools/help/adb.html">adb</a> - Installs and uninstalls applications and test applications to a device or the emulator. You
+ also use this tool to run the test application from the command line.
+ </li>
+ <li>
+ <a href="{@docRoot}tools/help/android.html">android</a> - Manages projects and test projects. This tool also manages AVDs and Android platforms.
+ </li>
+</ul>
+ <p>
+ You use the <code>emulator</code> tool to run the emulator from the command line.
+ </p>
+ <p>
+ Here are the general steps for doing this tutorial using an editor and the command line:
+ </p>
+<ol>
+ <li>
+ As described in the section <a href="#DownloadCode">Installing the Tutorial Sample Code</a>, get the sample code. You will then
+ have a directory <code><SDK_path>/samples/android-8</code>, containing (among others) the directories <code>Spinner</code>
+ and <code>SpinnerTest</code>:
+ <ul>
+ <li>
+ <code>Spinner</code> contains the main application, also known as the <strong>application under test</strong>. This tutorial focuses on the
+ common situation of writing tests for an application that already exists, so the main application is provided to you.
+ </li>
+ <li>
+ <code>SpinnerTest</code> contains all the code for the test application. If you want to run quickly through the tutorial, you can
+ install the test code and then follow the text. You may get more from the tutorial, however, if you write the code as you go. The instructions
+ for installing the test code are in the section <a href="#InstallCompletedTestApp">Appendix: Installing the Completed Test Application File</a>.
+ </li>
+ </ul>
+ </li>
+ <li>
+ Navigate to the directory <code><SDK_path>/samples/android-8</code>.
+ </li>
+ <li>
+ Create a new Android application project using <code>android create project</code>:
+<pre>
+$ android create project -t <APItarget> -k com.android.example.spinner -a SpinnerActivity -n SpinnerActivity -p Spinner
+</pre>
+ <p>
+ The value of <code><APItarget></code> should be "3" (API level 3) or higher. If you are already developing with a particular API level, and it is
+ higher than 3, then use that API level.
+ </p>
+ <p>
+ This a new Android project <code>SpinnerActivity</code> in the existing <code>Spinner</code> directory. The existing source and
+ resource files are not touched, but the <code>android</code> tool adds the necessary build files.
+ </p>
+ </li>
+ <li>
+ Create a new Android test project using <code>android create test-project</code>:
+<pre>
+$ android create test-project -m ../Spinner -n SpinnerActivityTest -p SpinnerActivityTest
+</pre>
+ <p>
+ This will create a new Android test project in the <em>new</em> directory <code>SpinnerActivityTest</code>. You do this
+ so that the solution to the tutorial that is in <code>SpinnerTest</code> is left untouched. If you want to use the solution
+ code instead of entering it as you read through the tutorial, refer to the section
+ <a href="#InstallCompletedTestApp">Appendix: Installing the Completed Test Application File</a>.
+ </p>
+ <p class="Note">
+ <strong>Note:</strong> Running <code>android create test-project</code> will automatically create
+ the file <code>AndroidManifest.xml</code> with the correct <code><instrumentation></code> element.
+ </p>
+ </li>
+ <li>
+ Build the sample application. If you are building with Ant, then it is easiest to use the command <code>ant debug</code> to build a debug version, since the SDK comes
+ with a debug signing key. The result will be the file <code>Spinner/bin/SpinnerActivity-debug.apk</code>.
+ You can install this to your device or emulator. Attach your device or start the emulator if you haven't already, and run the command:
+<pre>
+$ adb install Spinner/bin/SpinnerActivity-debug.apk
+</pre>
+ </li>
+ <li>
+ To create the test application, create a file <code>SpinnerActivityTest.java</code> in the directory
+ <code>SpinnerActivityTest/src/com/android/example/spinner/test/</code>.
+ </li>
+ <li>
+ Follow the tutorial, starting with the section <a href="#CreateTestCaseClass">Creating the Test Case Class</a>. When you are prompted to
+ run the sample application, go the the Launcher screen in your device or emulator and select SpinnerActivity.
+ When you are prompted to run the test application, return here to continue with the following instructions.
+ </li>
+ <li>
+ Build the test application. If you are building with Ant, then it is easiest to use the command <code>ant debug</code> to build a
+ debug version, since the SDK comes with a debug signing key. The result will be the Android file
+ <code>SpinnerActivityTest/bin/SpinnerActivityTest-debug.apk</code>. You can install this to your device or emulator.
+ Attach your device or start the emulator if you haven't already, and run the command:
+<pre>
+$ adb install SpinnerActivityTest/bin/SpinnerActivityTest-debug.apk
+</pre>
+ </li>
+ <li>
+ In your device or emulator, check that both the main application <code>SpinnerActivity</code> and the test application
+ <code>SpinnerActivityTest</code> are installed.
+ </li>
+ <li>
+ To run the test application, enter the following at the command line:
+<pre>
+$ adb shell am instrument -w com.android.example.spinner.test/android.test.InstrumentationTestRunner
+ </pre>
+ </li>
+</ol>
+<p>
+ The result of a successful test looks like this:
+</p>
+<pre>
+com.android.example.spinner.test.SpinnerActivityTest:....
+Test results for InstrumentationTestRunner=....
+Time: 10.098
+OK (4 tests)
+</pre>
+<p>
+ If you force the test to fail, as described in the previous section <a href="#TestFailure">Forcing Some Tests to Fail</a>, then
+ the output looks like this:
+</p>
+<pre>
+com.android.example.spinner.test.SpinnerActivityTest:
+Failure in testPreConditions:
+junit.framework.AssertionFailedError
+ at com.android.example.spinner.test.SpinnerActivityTest.testPreConditions(SpinnerActivityTest.java:104)
+ at java.lang.reflect.Method.invokeNative(Native Method)
+ at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:205)
+ at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:195)
+ at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:175)
+ at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
+ at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
+ at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)
+ at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
+Failure in testSpinnerUI:
+junit.framework.ComparisonFailure: expected:<Result> but was:<Saturn>
+ at com.android.example.spinner.test.SpinnerActivityTest.testSpinnerUI(SpinnerActivityTest.java:153)
+ at java.lang.reflect.Method.invokeNative(Native Method)
+ at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:205)
+ at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:195)
+ at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:175)
+ at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
+ at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
+ at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)
+ at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
+..
+Test results for InstrumentationTestRunner=.F.F..
+Time: 9.377
+FAILURES!!!
+Tests run: 4, Failures: 2, Errors: 0
+</pre>
diff --git a/docs/html/tools/testing/activity_testing.jd b/docs/html/tools/testing/activity_testing.jd
new file mode 100644
index 0000000..7190b98
--- /dev/null
+++ b/docs/html/tools/testing/activity_testing.jd
@@ -0,0 +1,375 @@
+page.title=Activity Testing
+parent.title=Testing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li>
+ <a href="#ActivityTestAPI">The Activity Testing API</a>
+ <ol>
+ <li>
+ <a href="#ActivityInstrumentationTestCase2">ActivityInstrumentationTestCase2</a>
+ </li>
+ <li>
+ <a href="#ActivityUnitTestCase">ActivityUnitTestCase</a>
+ </li>
+ <li>
+ <a href="#SingleLaunchActivityTestCase">SingleLaunchActivityTestCase</a>
+ </li>
+ <li>
+ <a href="#MockObjectNotes">Mock objects and activity testing</a>
+ </li>
+ <li>
+ <a href="#AssertionNotes">Assertions for activity testing</a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <a href="#WhatToTest">What to Test</a>
+ </li>
+ <li>
+ <a href="#NextSteps">Next Steps</a>
+ </li>
+ <li>
+ <a href="#UITesting">Appendix: UI Testing Notes</a>
+ <ol>
+ <li>
+ <a href="#RunOnUIThread">Testing on the UI thread</a>
+ </li>
+ <li>
+ <a href="#NotouchMode">Turning off touch mode</a>
+ </li>
+ <li>
+ <a href="#UnlockDevice">Unlocking the Emulator or Device</a>
+ </li>
+ <li>
+ <a href="#UITestTroubleshooting">Troubleshooting UI tests</a>
+ </li>
+ </ol>
+ </li>
+ </ol>
+<h2>Key Classes</h2>
+ <ol>
+ <li>{@link android.test.InstrumentationTestRunner}</li>
+ <li>{@link android.test.ActivityInstrumentationTestCase2}</li>
+ <li>{@link android.test.ActivityUnitTestCase}</li>
+ </ol>
+<h2>Related Tutorials</h2>
+ <ol>
+ <li>
+ <a href="{@docRoot}tools/testing/activity_test.html">Activity Testing Tutorial</a>
+ </li>
+ </ol>
+<h2>See Also</h2>
+ <ol>
+ <li>
+ <a href="{@docRoot}tools/testing/testing_eclipse.html">
+ Testing from Eclipse with ADT</a>
+ </li>
+ <li>
+ <a href="{@docRoot}tools/testing/testing_otheride.html">
+ Testing from Other IDEs</a>
+ </li>
+ </ol>
+ </div>
+</div>
+<p>
+ Activity testing is particularly dependent on the the Android instrumentation framework.
+ Unlike other components, activities have a complex lifecycle based on callback methods; these
+ can't be invoked directly except by instrumentation. Also, the only way to send events to the
+ user interface from a program is through instrumentation.
+</p>
+<p>
+ This document describes how to test activities using instrumentation and other test
+ facilities. The document assumes you have already read
+ <a href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>,
+ the introduction to the Android testing and instrumentation framework.
+</p>
+<h2 id="ActivityTestAPI">The Activity Testing API</h2>
+<p>
+ The activity testing API base class is {@link android.test.InstrumentationTestCase},
+ which provides instrumentation to the test case subclasses you use for Activities.
+</p>
+<p>
+ For activity testing, this base class provides these functions:
+</p>
+<ul>
+ <li>
+ Lifecycle control: With instrumentation, you can start the activity under test, pause it,
+ and destroy it, using methods provided by the test case classes.
+ </li>
+ <li>
+ Dependency injection: Instrumentation allows you to create mock system objects such as
+ Contexts or Applications and use them to run the activity under test. This
+ helps you control the test environment and isolate it from production systems. You can
+ also set up customized Intents and start an activity with them.
+ </li>
+ <li>
+ User interface interaction: You use instrumentation to send keystrokes or touch events
+ directly to the UI of the activity under test.
+ </li>
+</ul>
+<p>
+ The activity testing classes also provide the JUnit framework by extending
+ {@link junit.framework.TestCase} and {@link junit.framework.Assert}.
+</p>
+<p>
+ The two main testing subclasses are {@link android.test.ActivityInstrumentationTestCase2} and
+ {@link android.test.ActivityUnitTestCase}. To test an Activity that is launched in a mode
+ other than <code>standard</code>, you use {@link android.test.SingleLaunchActivityTestCase}.
+</p>
+<h3 id="ActivityInstrumentationTestCase2">ActivityInstrumentationTestCase2</h3>
+<p>
+ The {@link android.test.ActivityInstrumentationTestCase2} test case class is designed to do
+ functional testing of one or more Activities in an application, using a normal system
+ infrastructure. It runs the Activities in a normal instance of the application under test,
+ using a standard system Context. It allows you to send mock Intents to the activity under
+ test, so you can use it to test an activity that responds to multiple types of intents, or
+ an activity that expects a certain type of data in the intent, or both. Notice, though, that it
+ does not allow mock Contexts or Applications, so you can not isolate the test from the rest of
+ a production system.
+</p>
+<h3 id="ActivityUnitTestCase">ActivityUnitTestCase</h3>
+<p>
+ The {@link android.test.ActivityUnitTestCase} test case class tests a single activity in
+ isolation. Before you start the activity, you can inject a mock Context or Application, or both.
+ You use it to run activity tests in isolation, and to do unit testing of methods
+ that do not interact with Android. You can not send mock Intents to the activity under test,
+ although you can call
+ {@link android.app.Activity#startActivity(Intent) Activity.startActivity(Intent)} and then
+ look at arguments that were received.
+</p>
+<h3 id="SingleLaunchActivityTestCase">SingleLaunchActivityTestCase</h3>
+<p>
+ The {@link android.test.SingleLaunchActivityTestCase} class is a convenience class for
+ testing a single activity in an environment that doesn't change from test to test.
+ It invokes {@link junit.framework.TestCase#setUp() setUp()} and
+ {@link junit.framework.TestCase#tearDown() tearDown()} only once, instead of once per
+ method call. It does not allow you to inject any mock objects.
+</p>
+<p>
+ This test case is useful for testing an activity that runs in a mode other than
+ <code>standard</code>. It ensures that the test fixture is not reset between tests. You
+ can then test that the activity handles multiple calls correctly.
+</p>
+<h3 id="MockObjectNotes">Mock objects and activity testing</h3>
+<p>
+ This section contains notes about the use of the mock objects defined in
+ {@link android.test.mock} with activity tests.
+</p>
+<p>
+ The mock object {@link android.test.mock.MockApplication} is only available for activity
+ testing if you use the {@link android.test.ActivityUnitTestCase} test case class.
+ By default, <code>ActivityUnitTestCase</code>, creates a hidden <code>MockApplication</code>
+ object that is used as the application under test. You can inject your own object using
+ {@link android.test.ActivityUnitTestCase#setApplication(Application) setApplication()}.
+</p>
+<h3 id="AssertionNotes">Assertions for activity testing</h3>
+<p>
+ {@link android.test.ViewAsserts} defines assertions for Views. You use it to verify the
+ alignment and position of View objects, and to look at the state of ViewGroup objects.
+</p>
+<h2 id="WhatToTest">What To Test</h2>
+<ul>
+ <li>
+ Input validation: Test that an activity responds correctly to input values in an
+ EditText View. Set up a keystroke sequence, send it to the activity, and then
+ use {@link android.view.View#findViewById(int)} to examine the state of the View. You can
+ verify that a valid keystroke sequence enables an OK button, while an invalid one leaves the
+ button disabled. You can also verify that the Activity responds to invalid input by
+ setting error messages in the View.
+ </li>
+ <li>
+ Lifecycle events: Test that each of your application's activities handles lifecycle events
+ correctly. In general, lifecycle events are actions, either from the system or from the
+ user, that trigger a callback method such as <code>onCreate()</code> or
+ <code>onClick()</code>. For example, an activity should respond to pause or destroy events
+ by saving its state. Remember that even a change in screen orientation causes the current
+ activity to be destroyed, so you should test that accidental device movements don't
+ accidentally lose the application state.
+ </li>
+ <li>
+ Intents: Test that each activity correctly handles the intents listed in the intent
+ filter specified in its manifest. You can use
+ {@link android.test.ActivityInstrumentationTestCase2} to send mock Intents to the
+ activity under test.
+ </li>
+ <li>
+ Runtime configuration changes: Test that each activity responds correctly to the
+ possible changes in the device's configuration while your application is running. These
+ include a change to the device's orientation, a change to the current language, and so
+ forth. Handling these changes is described in detail in the topic
+ <a href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime
+ Changes</a>.
+ </li>
+ <li>
+ Screen sizes and resolutions: Before you publish your application, make sure to test it on
+ all of the screen sizes and densities on which you want it to run. You can test the
+ application on multiple sizes and densities using AVDs, or you can test your application
+ directly on the devices that you are targeting. For more information, see the topic
+ <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.
+ </li>
+</ul>
+<h2 id="NextSteps">Next Steps</h2>
+<p>
+ To learn how to set up and run tests in Eclipse, please refer to
+<a href="{@docRoot}tools/testing/testing_eclipse.html">Testing from Eclipse with ADT</a>.
+ If you're not working in Eclipse, refer to
+<a href="{@docRoot}tools/testing/testing_otheride.html">Testing from Other IDEs</a>.
+</p>
+<p>
+ If you want a step-by-step introduction to testing activities, try the
+ <a href="{@docRoot}tools/testing/activity_test.html">Activity Testing Tutorial</a>, which
+ guides you through a testing scenario that you develop against an activity-oriented application.
+</p>
+<h2 id="UITesting">Appendix: UI Testing Notes</h2>
+<p>
+ The following sections have tips for testing the UI of your Android application, specifically
+ to help you handle actions that run in the UI thread, touch screen and keyboard events, and home
+ screen unlock during testing.
+</p>
+<h3 id="RunOnUIThread">Testing on the UI thread</h3>
+<p>
+ An application's activities run on the application's <strong>UI thread</strong>. Once the
+ UI is instantiated, for example in the activity's <code>onCreate()</code> method, then all
+ interactions with the UI must run in the UI thread. When you run the application normally, it
+ has access to the thread and does not have to do anything special.
+</p>
+<p>
+ This changes when you run tests against the application. With instrumentation-based classes,
+ you can invoke methods against the UI of the application under test. The other test classes
+ don't allow this. To run an entire test method on the UI thread, you can annotate the thread
+ with <code>@UIThreadTest</code>. Notice that this will run <em>all</em> of the method statements
+ on the UI thread. Methods that do not interact with the UI are not allowed; for example, you
+ can't invoke <code>Instrumentation.waitForIdleSync()</code>.
+</p>
+<p>
+ To run a subset of a test method on the UI thread, create an anonymous class of type
+ <code>Runnable</code>, put the statements you want in the <code>run()</code> method, and
+ instantiate a new instance of the class as a parameter to the method
+ <code><em>appActivity</em>.runOnUiThread()</code>, where <code><em>appActivity</em></code> is
+ the instance of the application you are testing.
+</p>
+<p>
+ For example, this code instantiates an activity to test, requests focus (a UI action) for the
+ Spinner displayed by the activity, and then sends a key to it. Notice that the calls to
+ <code>waitForIdleSync</code> and <code>sendKeys</code> aren't allowed to run on the UI thread:
+</p>
+<pre>
+ private MyActivity mActivity; // MyActivity is the class name of the app under test
+ private Spinner mSpinner;
+
+ ...
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ mInstrumentation = getInstrumentation();
+
+ mActivity = getActivity(); // get a references to the app under test
+
+ /*
+ * Get a reference to the main widget of the app under test, a Spinner
+ */
+ mSpinner = (Spinner) mActivity.findViewById(com.android.demo.myactivity.R.id.Spinner01);
+
+ ...
+
+ public void aTest() {
+ /*
+ * request focus for the Spinner, so that the test can send key events to it
+ * This request must be run on the UI thread. To do this, use the runOnUiThread method
+ * and pass it a Runnable that contains a call to requestFocus on the Spinner.
+ */
+ mActivity.runOnUiThread(new Runnable() {
+ public void run() {
+ mSpinner.requestFocus();
+ }
+ });
+
+ mInstrumentation.waitForIdleSync();
+
+ this.sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
+</pre>
+
+<h3 id="NotouchMode">Turning off touch mode</h3>
+<p>
+ To control the emulator or a device with key events you send from your tests, you must turn off
+ touch mode. If you do not do this, the key events are ignored.
+</p>
+<p>
+ To turn off touch mode, you invoke
+ <code>ActivityInstrumentationTestCase2.setActivityTouchMode(false)</code>
+ <em>before</em> you call <code>getActivity()</code> to start the activity. You must invoke the
+ method in a test method that is <em>not</em> running on the UI thread. For this reason, you
+ can't invoke the touch mode method from a test method that is annotated with
+ <code>@UIThread</code>. Instead, invoke the touch mode method from <code>setUp()</code>.
+</p>
+<h3 id="UnlockDevice">Unlocking the emulator or device</h3>
+<p>
+ You may find that UI tests don't work if the emulator's or device's home screen is disabled with
+ the keyguard pattern. This is because the application under test can't receive key events sent
+ by <code>sendKeys()</code>. The best way to avoid this is to start your emulator or device
+ first and then disable the keyguard for the home screen.
+</p>
+<p>
+ You can also explicitly disable the keyguard. To do this,
+ you need to add a permission in the manifest file (<code>AndroidManifest.xml</code>) and
+ then disable the keyguard in your application under test. Note, though, that you either have to
+ remove this before you publish your application, or you have to disable it with code in
+ the published application.
+</p>
+<p>
+ To add the the permission, add the element
+ <code><uses-permission android:name="android.permission.DISABLE_KEYGUARD"/></code>
+ as a child of the <code><manifest></code> element. To disable the KeyGuard, add the
+ following code to the <code>onCreate()</code> method of activities you intend to test:
+</p>
+<pre>
+ mKeyGuardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE);
+ mLock = mKeyGuardManager.newKeyguardLock("<em>activity_classname</em>");
+ mLock.disableKeyguard();
+</pre>
+<p>where <code><em>activity_classname</em></code> is the class name of the activity.</p>
+<h3 id="UITestTroubleshooting">Troubleshooting UI tests</h3>
+<p>
+ This section lists some of the common test failures you may encounter in UI testing, and their
+ causes:
+</p>
+<dl>
+ <dt><code>WrongThreadException</code></dt>
+ <dd>
+ <p><strong>Problem:</strong></p>
+ For a failed test, the Failure Trace contains the following error message:
+ <code>
+ android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created
+ a view hierarchy can touch its views.
+ </code>
+ <p><strong>Probable Cause:</strong></p>
+ This error is common if you tried to send UI events to the UI thread from outside the UI
+ thread. This commonly happens if you send UI events from the test application, but you don't
+ use the <code>@UIThread</code> annotation or the <code>runOnUiThread()</code> method. The
+ test method tried to interact with the UI outside the UI thread.
+ <p><strong>Suggested Resolution:</strong></p>
+ Run the interaction on the UI thread. Use a test class that provides instrumentation. See
+ the previous section <a href="#RunOnUIThread">Testing on the UI Thread</a>
+ for more details.
+ </dd>
+ <dt><code>java.lang.RuntimeException</code></dt>
+ <dd>
+ <p><strong>Problem:</strong></p>
+ For a failed test, the Failure Trace contains the following error message:
+ <code>
+ java.lang.RuntimeException: This method can not be called from the main application thread
+ </code>
+ <p><strong>Probable Cause:</strong></p>
+ This error is common if your test method is annotated with <code>@UiThreadTest</code> but
+ then tries to do something outside the UI thread or tries to invoke
+ <code>runOnUiThread()</code>.
+ <p><strong>Suggested Resolution:</strong></p>
+ Remove the <code>@UiThreadTest</code> annotation, remove the <code>runOnUiThread()</code>
+ call, or re-factor your tests.
+ </dd>
+</dl>
diff --git a/docs/html/tools/testing/contentprovider_testing.jd b/docs/html/tools/testing/contentprovider_testing.jd
new file mode 100644
index 0000000..a6440df
--- /dev/null
+++ b/docs/html/tools/testing/contentprovider_testing.jd
@@ -0,0 +1,217 @@
+page.title=Content Provider Testing
+parent.title=Testing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li>
+ <a href="#DesignAndTest">Content Provider Design and Testing</a>
+ </li>
+ <li>
+ <a href="#ContentProviderTestAPI">The Content Provider Testing API</a>
+ <ol>
+ <li>
+ <a href="#ProviderTestCase2">ProviderTestCase2 </a>
+ </li>
+ <li>
+ <a href="#MockObjects">Mock object classes</a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <a href="#WhatToTest">What To Test</a>
+ </li>
+ <li>
+ <a href="#NextSteps">Next Steps</a>
+ </li>
+ </ol>
+ <h2>Key Classes</h2>
+ <ol>
+ <li>{@link android.test.InstrumentationTestRunner}</li>
+ <li>{@link android.test.ProviderTestCase2}</li>
+ <li>{@link android.test.IsolatedContext}</li>
+ <li>{@link android.test.mock.MockContentResolver}</li>
+ </ol>
+ <h2>Related Tutorials</h2>
+ <ol>
+ <li>
+ <a href="{@docRoot}tools/testing/activity_test.html">Activity Testing Tutorial</a>
+ </li>
+ </ol>
+ <h2>See Also</h2>
+ <ol>
+ <li>
+ <a
+ href="{@docRoot}tools/testing/testing_android.html">
+ Testing Fundamentals</a>
+ </li>
+ <li>
+ <a href="{@docRoot}tools/testing/testing_eclipse.html">
+ Testing From Eclipse with ADT</a>
+ </li>
+ <li>
+ <a href="{@docRoot}tools/testing/testing_otheride.html">
+ Testing From Other IDEs</a>
+ </li>
+ </ol>
+ </div>
+</div>
+<p>
+ Content providers, which store and retrieve data and make it accessible across applications,
+ are a key part of the Android API. As an application developer you're allowed to provide your
+ own public providers for use by other applications. If you do, then you should test them
+ using the API you publish.
+</p>
+<p>
+ This document describes how to test public content providers, although the information is
+ also applicable to providers that you keep private to your own application. If you aren't
+ familiar with content providers or the Android testing framework, please read
+ <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>,
+ the guide to developing content providers, and
+ <a href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>,
+ the introduction to the Android testing and instrumentation framework.
+</p>
+<h2 id="DesignAndTest">Content Provider Design and Testing</h2>
+<p>
+ In Android, content providers are viewed externally as data APIs that provide
+ tables of data, with their internals hidden from view. A content provider may have many
+ public constants, but it usually has few if any public methods and no public variables.
+ This suggests that you should write your tests based only on the provider's public members.
+ A content provider that is designed like this is offering a contract between itself and its
+ users.
+</p>
+<p>
+ The base test case class for content providers,
+ {@link android.test.ProviderTestCase2}, allows you to test your content provider in an
+ isolated environment. Android mock objects such as {@link android.test.IsolatedContext} and
+ {@link android.test.mock.MockContentResolver} also help provide an isolated test environment.
+</p>
+<p>
+ As with other Android tests, provider test packages are run under the control of the test
+ runner {@link android.test.InstrumentationTestRunner}. The section
+ <a href="{@docRoot}tools/testing/testing_android.html#InstrumentationTestRunner">
+ Running Tests With InstrumentationTestRunner</a> describes the test runner in
+ more detail. The topic <a href="{@docRoot}tools/testing/testing_eclipse.html">
+ Testing From Eclipse with ADT</a> shows you how to run a test package in Eclipse, and the
+ topic <a href="{@docRoot}tools/testing/testing_otheride.html">
+ Testing From Other IDEs</a>
+ shows you how to run a test package from the command line.
+</p>
+<h2 id="ContentProviderTestAPI">Content Provider Testing API</h2>
+<p>
+ The main focus of the provider testing API is to provide an isolated testing environment. This
+ ensures that tests always run against data dependencies set explicitly in the test case. It
+ also prevents tests from modifying actual user data. For example, you want to avoid writing
+ a test that fails because there was data left over from a previous test, and you want to
+ avoid adding or deleting contact information in a actual provider.
+</p>
+<p>
+ The test case class and mock object classes for provider testing set up this isolated testing
+ environment for you.
+</p>
+<h3 id="ProviderTestCase2">ProviderTestCase2</h3>
+<p>
+ You test a provider with a subclass of {@link android.test.ProviderTestCase2}. This base class
+ extends {@link android.test.AndroidTestCase}, so it provides the JUnit testing framework as well
+ as Android-specific methods for testing application permissions. The most important
+ feature of this class is its initialization, which creates the isolated test environment.
+</p>
+<p>
+ The initialization is done in the constructor for {@link android.test.ProviderTestCase2}, which
+ subclasses call in their own constructors. The {@link android.test.ProviderTestCase2}
+ constructor creates an {@link android.test.IsolatedContext} object that allows file and
+ database operations but stubs out other interactions with the Android system.
+ The file and database operations themselves take place in a directory that is local to the
+ device or emulator and has a special prefix.
+</p>
+<p>
+ The constructor then creates a {@link android.test.mock.MockContentResolver} to use as the
+ resolver for the test. The {@link android.test.mock.MockContentResolver} class is described in
+ detail in the section
+ <a href="{@docRoot}tools/testing/testing_android.html#MockObjectClasses">Mock object
+classes</a>.
+</p>
+<p>
+ Lastly, the constructor creates an instance of the provider under test. This is a normal
+ {@link android.content.ContentProvider} object, but it takes all of its environment information
+ from the {@link android.test.IsolatedContext}, so it is restricted to
+ working in the isolated test environment. All of the tests done in the test case class run
+ against this isolated object.
+</p>
+<h3 id="MockObjects">Mock object classes</h3>
+<p>
+ {@link android.test.ProviderTestCase2} uses {@link android.test.IsolatedContext} and
+ {@link android.test.mock.MockContentResolver}, which are standard mock object classes. To
+ learn more about them, please read
+ <a href="{@docRoot}tools/testing/testing_android.html#MockObjectClasses">
+ Testing Fundamentals</a>.
+</p>
+<h2 id="WhatToTest">What To Test</h2>
+<p>
+ The topic <a href="{@docRoot}tools/testing/what_to_test.html">What To Test</a>
+ lists general considerations for testing Android components.
+ Here are some specific guidelines for testing content providers.
+</p>
+<ul>
+ <li>
+ Test with resolver methods: Even though you can instantiate a provider object in
+ {@link android.test.ProviderTestCase2}, you should always test with a resolver object
+ using the appropriate URI. This ensures that you are testing the provider using the same
+ interaction that a regular application would use.
+ </li>
+ <li>
+ Test a public provider as a contract: If you intent your provider to be public and
+ available to other applications, you should test it as a contract. This includes
+ the following ideas:
+ <ul>
+ <li>
+ Test with constants that your provider publicly exposes. For
+ example, look for constants that refer to column names in one of the provider's
+ data tables. These should always be constants publicly defined by the provider.
+ </li>
+ <li>
+ Test all the URIs offered by your provider. Your provider may offer several URIs,
+ each one referring to a different aspect of the data. The
+ <a href="{@docRoot}resources/samples/NotePad/index.html">Note Pad</a> sample,
+ for example, features a provider that offers one URI for retrieving a list of notes,
+ another for retrieving an individual note by it's database ID, and a third for
+ displaying notes in a live folder.
+ </li>
+ <li>
+ Test invalid URIs: Your unit tests should deliberately call the provider with an
+ invalid URI, and look for errors. Good provider design is to throw an
+ IllegalArgumentException for invalid URIs.
+
+ </li>
+ </ul>
+ </li>
+ <li>
+ Test the standard provider interactions: Most providers offer six access methods:
+ query, insert, delete, update, getType, and onCreate(). Your tests should verify that all
+ of these methods work. These are described in more detail in the topic
+ <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.
+ </li>
+ <li>
+ Test business logic: Don't forget to test the business logic that your provider should
+ enforce. Business logic includes handling of invalid values, financial or arithmetic
+ calculations, elimination or combining of duplicates, and so forth. A content provider
+ does not have to have business logic, because it may be implemented by activities that
+ modify the data. If the provider does implement business logic, you should test it.
+ </li>
+</ul>
+<h2 id="NextSteps">Next Steps</h2>
+<p>
+ To learn how to set up and run tests in Eclipse, please refer to
+<a href="{@docRoot}tools/testing/testing_eclipse.html">Testing from Eclipse with ADT</a>.
+ If you're not working in Eclipse, refer to
+<a href="{@docRoot}tools/testing/testing_otheride.html">Testing From Other IDEs</a>.
+</p>
+<p>
+ If you want a step-by-step introduction to testing activities, try the
+ <a href="{@docRoot}tools/testing/activity_test.html">Activity Testing Tutorial</a>, which
+ guides you through a testing scenario that you develop against an activity-oriented application.
+</p>
+
diff --git a/docs/html/tools/testing/index.jd b/docs/html/tools/testing/index.jd
new file mode 100644
index 0000000..56de4cf
--- /dev/null
+++ b/docs/html/tools/testing/index.jd
@@ -0,0 +1,40 @@
+page.title=Testing
+@jd:body
+
+<p> The Android framework includes an integrated testing framework that helps you test all aspects
+of your application and the SDK tools include tools for setting up and running test applications.
+Whether you are working in Eclipse with ADT or working from the command line, the SDK tools help you
+set up and run your tests within an emulator or the device you are targeting. </p>
+
+<p>If you aren't yet familiar with the Android testing framework, start by reading <a
+href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>. For a step-by-step
+introduction to Android testing, try the <a
+href="{@docRoot}tools/testing/activity_test.html">Activity Testing Tutorial</a>. </p>
+
+
+
+<div class="landing-docs">
+
+ <div class="col-13" style="margin-left:0">
+ <h3>Blog Articles</h3>
+
+ <a href="http://android-developers.blogspot.com/2010/12/new-gingerbread-api-strictmode.html">
+ <h4>New Gingerbread API: StrictMode</h4>
+ <p>StrictMode is a new API in Gingerbread which primarily lets you set a policy on a thread
+declaring what you’re not allowed to do on that thread, and what the penalty is if you violate the
+policy. Implementation-wise, this policy is simply a thread-local integer bitmask.</p>
+ </a>
+
+ <a href="http://android-developers.blogspot.com/2010/10/traceview-war-story.html">
+ <h4>Traceview War Story</h4>
+ <p>I recently took my first serious look at Traceview, and it occurred to me, first, that
+there are probably a few other Android developers who haven’t used it and, second, that this is an
+opportunity to lecture sternly on one of my favorite subjects: performance improvement and
+profiling.</p>
+ </a>
+ </div>
+
+
+</div>
+
+
diff --git a/docs/html/tools/testing/service_testing.jd b/docs/html/tools/testing/service_testing.jd
new file mode 100644
index 0000000..7c56fd9
--- /dev/null
+++ b/docs/html/tools/testing/service_testing.jd
@@ -0,0 +1,176 @@
+page.title=Service Testing
+parent.title=Testing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li>
+ <a href="#DesignAndTest">Service Design and Testing</a>
+ </li>
+ <li>
+ <a href="#ServiceTestCase">ServiceTestCase</a>
+ </li>
+ <li>
+ <a href="#MockObjects">Mock object classes</a>
+ </li>
+ <li>
+ <a href="#TestAreas">What to Test</a>
+ </li>
+ </ol>
+ <h2>Key Classes</h2>
+ <ol>
+ <li>{@link android.test.InstrumentationTestRunner}</li>
+ <li>{@link android.test.ServiceTestCase}</li>
+ <li>{@link android.test.mock.MockApplication}</li>
+ <li>{@link android.test.RenamingDelegatingContext}</li>
+ </ol>
+ <h2>Related Tutorials</h2>
+ <ol>
+ <li>
+ <a href="{@docRoot}tools/testing/activity_test.html">Activity Testing Tutorial</a>
+ </li>
+ </ol>
+ <h2>See Also</h2>
+ <ol>
+ <li>
+ <a href="{@docRoot}tools/testing/testing_eclipse.html">
+ Testing From Eclipse with ADT</a>
+ </li>
+ <li>
+ <a href="{@docRoot}tools/testing/testing_otheride.html">
+ Testing From Other IDEs</a>
+ </li>
+ </ol>
+ </div>
+</div>
+<p>
+ Android provides a testing framework for Service objects that can run them in
+ isolation and provides mock objects. The test case class for Service objects is
+ {@link android.test.ServiceTestCase}. Since the Service class assumes that it is separate
+ from its clients, you can test a Service object without using instrumentation.
+</p>
+<p>
+ This document describes techniques for testing Service objects. If you aren't familiar with the
+ Service class, please read the <a href="{@docRoot}guide/components/services.html">
+ Services</a> document. If you aren't familiar with Android testing, please read
+ <a href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>,
+ the introduction to the Android testing and instrumentation framework.
+</p>
+<h2 id="DesignAndTest">Service Design and Testing</h2>
+<p>
+ When you design a Service, you should consider how your tests can examine the various states
+ of the Service lifecycle. If the lifecycle methods that start up your Service, such as
+ {@link android.app.Service#onCreate() onCreate()} or
+ {@link android.app.Service#onStartCommand(Intent, int, int) onStartCommand()} do not normally
+ set a global variable to indicate that they were successful, you may want to provide such a
+ variable for testing purposes.
+</p>
+<p>
+ Most other testing is facilitated by the methods in the {@link android.test.ServiceTestCase}
+ test case class. For example, the {@link android.test.ServiceTestCase#getService()} method
+ returns a handle to the Service under test, which you can test to confirm that the Service is
+ running even at the end of your tests.
+</p>
+<h2 id="ServiceTestCase">ServiceTestCase</h2>
+<p>
+ {@link android.test.ServiceTestCase} extends the JUnit {@link junit.framework.TestCase} class
+ with with methods for testing application permissions and for controlling the application and
+ Service under test. It also provides mock application and Context objects that isolate your
+ test from the rest of the system.
+</p>
+<p>
+ {@link android.test.ServiceTestCase} defers initialization of the test environment until you
+ call {@link android.test.ServiceTestCase#startService(Intent) ServiceTestCase.startService()} or
+ {@link android.test.ServiceTestCase#bindService(Intent) ServiceTestCase.bindService()}. This
+ allows you to set up your test environment, particularly your mock objects, before the Service
+ is started.
+</p>
+<p>
+ Notice that the parameters to <code>ServiceTestCase.bindService()</code>are different from
+ those for <code>Service.bindService()</code>. For the <code>ServiceTestCase</code> version,
+ you only provide an Intent. Instead of returning a boolean,
+ <code>ServiceTestCase.bindService()</code> returns an object that subclasses
+ {@link android.os.IBinder}.
+</p>
+<p>
+ The {@link android.test.ServiceTestCase#setUp()} method for {@link android.test.ServiceTestCase}
+ is called before each test. It sets up the test fixture by making a copy of the current system
+ Context before any test methods touch it. You can retrieve this Context by calling
+ {@link android.test.ServiceTestCase#getSystemContext()}. If you override this method, you must
+ call <code>super.setUp()</code> as the first statement in the override.
+</p>
+<p>
+ The methods {@link android.test.ServiceTestCase#setApplication(Application) setApplication()}
+ and {@link android.test.AndroidTestCase#setContext(Context)} setContext()} allow you to set
+ a mock Context or mock Application (or both) for the Service, before you start it. These mock
+ objects are described in <a href="#MockObjects">Mock object classes</a>.
+</p>
+<p>
+ By default, {@link android.test.ServiceTestCase} runs the test method
+ {@link android.test.AndroidTestCase#testAndroidTestCaseSetupProperly()}, which asserts that
+ the base test case class successfully set up a Context before running.
+</p>
+<h2 id="MockObjects">Mock object classes</h2>
+<p>
+ <code>ServiceTestCase</code> assumes that you will use a mock Context or mock Application
+ (or both) for the test environment. These objects isolate the test environment from the
+ rest of the system. If you don't provide your own instances of these objects before you
+ start the Service, then {@link android.test.ServiceTestCase} will create its own internal
+ instances and inject them into the Service. You can override this behavior by creating and
+ injecting your own instances before starting the Service
+</p>
+<p>
+ To inject a mock Application object into the Service under test, first create a subclass of
+ {@link android.test.mock.MockApplication}. <code>MockApplication</code> is a subclass of
+ {@link android.app.Application} in which all the methods throw an Exception, so to use it
+ effectively you subclass it and override the methods you need. You then inject it into the
+ Service with the
+ {@link android.test.ServiceTestCase#setApplication(Application) setApplication()} method.
+ This mock object allows you to control the application values that the Service sees, and
+ isolates it from the real system. In addition, any hidden dependencies your Service has on
+ its application reveal themselves as exceptions when you run the test.
+</p>
+<p>
+ You inject a mock Context into the Service under test with the
+ {@link android.test.AndroidTestCase#setContext(Context) setContext()} method. The mock
+ Context classes you can use are described in more detail in
+ <a href="{@docRoot}tools/testing/testing_android.html#MockObjectClasses">
+ Testing Fundamentals</a>.
+</p>
+<h2 id="TestAreas">What to Test</h2>
+<p>
+ The topic <a href="{@docRoot}tools/testing/what_to_test.html">What To Test</a>
+ lists general considerations for testing Android components.
+ Here are some specific guidelines for testing a Service:
+</p>
+<ul>
+ <li>
+ Ensure that the {@link android.app.Service#onCreate()} is called in response to
+ {@link android.content.Context#startService(Intent) Context.startService()} or
+ {@link android.content.Context#bindService(Intent,ServiceConnection,int) Context.bindService()}.
+ Similarly, you should ensure that {@link android.app.Service#onDestroy()} is called in
+ response to {@link android.content.Context#stopService(Intent) Context.stopService()},
+ {@link android.content.Context#unbindService(ServiceConnection) Context.unbindService()},
+ {@link android.app.Service#stopSelf()}, or
+ {@link android.app.Service#stopSelfResult(int) stopSelfResult()}.
+ </li>
+ <li>
+ Test that your Service correctly handles multiple calls from
+ <code>Context.startService()</code>. Only the first call triggers
+ <code>Service.onCreate()</code>, but all calls trigger a call to
+ <code>Service.onStartCommand()</code>.
+ <p>
+ In addition, remember that <code>startService()</code> calls don't
+ nest, so a single call to <code>Context.stopService()</code> or
+ <code>Service.stopSelf()</code> (but not <code>stopSelf(int)</code>)
+ will stop the Service. You should test that your Service stops at the correct point.
+ </p>
+ </li>
+ <li>
+ Test any business logic that your Service implements. Business logic includes checking for
+ invalid values, financial and arithmetic calculations, and so forth.
+ </li>
+</ul>
diff --git a/docs/html/tools/testing/testing_android.jd b/docs/html/tools/testing/testing_android.jd
new file mode 100755
index 0000000..acf5ec2
--- /dev/null
+++ b/docs/html/tools/testing/testing_android.jd
@@ -0,0 +1,640 @@
+page.title=Testing Fundamentals
+parent.title=Testing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li>
+ <a href="#TestStructure">Test Structure</a>
+ </li>
+ <li>
+ <a href="#TestProjects">Test Projects</a>
+ </li>
+ <li>
+ <a href="#TestAPI">The Testing API</a>
+ <ol>
+ <li>
+ <a href="#JUnit">JUnit</a>
+ </li>
+ <li>
+ <a href="#Instrumentation">Instrumentation</a>
+ </li>
+ <li>
+ <a href="#TestCaseClasses">Test case classes</a>
+ </li>
+ <li>
+ <a href="#AssertionClasses">Assertion classes</a>
+ </li>
+ <li>
+ <a href="#MockObjectClasses">Mock object classes</a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <a href="#InstrumentationTestRunner">Running Tests</a>
+ </li>
+ <li>
+ <a href="#TestResults">Seeing Test Results</a>
+ </li>
+ <li>
+ <a href="#Monkeys">monkey and monkeyrunner</a>
+ </li>
+ <li>
+ <a href="#PackageNames">Working With Package Names</a>
+ </li>
+ <li>
+ <a href="#WhatToTest">What To Test</a>
+ </li>
+ <li>
+ <a href="#NextSteps">Next Steps</a>
+ </li>
+ </ol>
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.test.InstrumentationTestRunner}</li>
+ <li>{@link android.test}</li>
+ <li>{@link android.test.mock}</li>
+ <li>{@link junit.framework}</li>
+ </ol>
+ <h2>Related tutorials</h2>
+ <ol>
+ <li>
+ <a href="{@docRoot}tools/testing/activity_test.html">Activity Testing Tutorial</a>
+ </li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li>
+ <a href="{@docRoot}tools/testing/testing_eclipse.html">
+ Testing from Eclipse with ADT</a>
+ </li>
+ <li>
+ <a href="{@docRoot}tools/testing/testing_otheride.html">
+ Testing from Other IDEs</a>
+ </li>
+ <li>
+ <a href="{@docRoot}tools/help/monkeyrunner_concepts.html">
+ monkeyrunner</a>
+ </li>
+ <li>
+ <a href="{@docRoot}tools/help/monkey.html">UI/Application Exerciser Monkey</a>
+ </li>
+ </ol>
+ </div>
+</div>
+<p>
+ The Android testing framework, an integral part of the development environment,
+ provides an architecture and powerful tools that help you test every aspect of your application
+ at every level from unit to framework.
+</p>
+<p>
+ The testing framework has these key features:
+</p>
+<ul>
+ <li>
+ Android test suites are based on JUnit. You can use plain JUnit to test a class that doesn't
+ call the Android API, or Android's JUnit extensions to test Android components. If you're
+ new to Android testing, you can start with general-purpose test case classes such as {@link
+ android.test.AndroidTestCase} and then go on to use more sophisticated classes.
+ </li>
+ <li>
+ The Android JUnit extensions provide component-specific test case classes. These classes
+ provide helper methods for creating mock objects and methods that help you control the
+ lifecycle of a component.
+ </li>
+ <li>
+ Test suites are contained in test packages that are similar to main application packages, so
+ you don't need to learn a new set of tools or techniques for designing and building tests.
+ </li>
+ <li>
+ The SDK tools for building and tests are available in Eclipse with ADT, and also in
+ command-line form for use with other IDES. These tools get information from the project of
+ the application under test and use this information to automatically create the build files,
+ manifest file, and directory structure for the test package.
+ </li>
+ <li>
+ The SDK also provides
+ <a href="{@docRoot}tools/help/monkeyrunner_concepts.html">monkeyrunner</a>, an API
+ testing devices with Python programs, and <a
+ href="{@docRoot}tools/help/monkey.html">UI/Application Exerciser Monkey</a>,
+ a command-line tool for stress-testing UIs by sending pseudo-random events to a device.
+ </li>
+</ul>
+<p>
+ This document describes the fundamentals of the Android testing framework, including the
+ structure of tests, the APIs that you use to develop tests, and the tools that you use to run
+ tests and view results. The document assumes you have a basic knowledge of Android application
+ programming and JUnit testing methodology.
+</p>
+<p>
+ The following diagram summarizes the testing framework:
+</p>
+<div style="width: 70%; margin-left:auto; margin-right:auto;">
+<a href="{@docRoot}images/testing/test_framework.png">
+ <img src="{@docRoot}images/testing/test_framework.png"
+ alt="The Android testing framework"/>
+</a>
+</div>
+<h2 id="TestStructure">Test Structure</h2>
+<p>
+ Android's build and test tools assume that test projects are organized into a standard
+ structure of tests, test case classes, test packages, and test projects.
+</p>
+<p>
+ Android testing is based on JUnit. In general, a JUnit test is a method whose
+ statements test a part of the application under test. You organize test methods into classes
+ called test cases (or test suites). Each test is an isolated test of an individual module in
+ the application under test. Each class is a container for related test methods, although it
+ often provides helper methods as well.
+</p>
+<p>
+ In JUnit, you build one or more test source files into a class file. Similarly, in Android you
+ use the SDK's build tools to build one or more test source files into class files in an
+ Android test package. In JUnit, you use a test runner to execute test classes. In Android, you
+ use test tools to load the test package and the application under test, and the tools then
+ execute an Android-specific test runner.
+</p>
+<h2 id="TestProjects">Test Projects</h2>
+<p>
+ Tests, like Android applications, are organized into projects.
+</p>
+<p>
+ A test project is a directory or Eclipse project in which you create the source code, manifest
+ file, and other files for a test package. The Android SDK contains tools for Eclipse with ADT
+ and for the command line that create and update test projects for you. The tools create the
+ directories you use for source code and resources and the manifest file for the test package.
+ The command-line tools also create the Ant build files you need.
+</p>
+<p>
+ You should always use Android tools to create a test project. Among other benefits,
+ the tools:
+</p>
+ <ul>
+ <li>
+ Automatically set up your test package to use
+ {@link android.test.InstrumentationTestRunner} as the test case runner. You must use
+ <code>InstrumentationTestRunner</code> (or a subclass) to run JUnit tests.
+ </li>
+ <li>
+ Create an appropriate name for the test package. If the application
+ under test has a package name of <code>com.mydomain.myapp</code>, then the
+ Android tools set the test package name to <code>com.mydomain.myapp.test</code>. This
+ helps you identify their relationship, while preventing conflicts within the system.
+ </li>
+ <li>
+ Automatically create the proper build files, manifest file, and directory
+ structure for the test project. This helps you to build the test package without
+ having to modify build files and sets up the linkage between your test package and
+ the application under test.
+ The
+ </li>
+ </ul>
+<p>
+ You can create a test project anywhere in your file system, but the best approach is to
+ add the test project so that its root directory <code>tests/</code> is at the same level
+ as the <code>src/</code> directory of the main application's project. This helps you find the
+ tests associated with an application. For example, if your application project's root directory
+ is <code>MyProject</code>, then you should use the following directory structure:
+</p>
+<pre class="classic no-pretty-print">
+ MyProject/
+ AndroidManifest.xml
+ res/
+ ... (resources for main application)
+ src/
+ ... (source code for main application) ...
+ tests/
+ AndroidManifest.xml
+ res/
+ ... (resources for tests)
+ src/
+ ... (source code for tests)
+</pre>
+<h2 id="TestAPI">The Testing API</h2>
+<p>
+ The Android testing API is based on the JUnit API and extended with a instrumentation
+ framework and Android-specific testing classes.
+</p>
+<h3 id="JUnit">JUnit</h3>
+<p>
+ You can use the JUnit {@link junit.framework.TestCase TestCase} class to do unit testing on
+ a class that doesn't call Android APIs. <code>TestCase</code> is also the base class for
+ {@link android.test.AndroidTestCase}, which you can use to test Android-dependent objects.
+ Besides providing the JUnit framework, AndroidTestCase offers Android-specific setup,
+ teardown, and helper methods.
+</p>
+<p>
+ You use the JUnit {@link junit.framework.Assert} class to display test results.
+ The assert methods compare values you expect from a test to the actual results and
+ throw an exception if the comparison fails. Android also provides a class of assertions that
+ extend the possible types of comparisons, and another class of assertions for testing the UI.
+ These are described in more detail in the section <a href="#AssertionClasses">
+ Assertion classes</a>
+</p>
+<p>
+ To learn more about JUnit, you can read the documentation on the
+ <a href="http://www.junit.org">junit.org</a> home page.
+ Note that the Android testing API supports JUnit 3 code style, but not JUnit 4. Also, you must
+ use Android's instrumented test runner {@link android.test.InstrumentationTestRunner} to run
+ your test case classes. This test runner is described in the
+ section <a href="#InstrumentationTestRunner">Running Tests</a>.
+</p>
+<h3 id="Instrumentation">Instrumentation</h3>
+<p>
+ Android instrumentation is a set of control methods or "hooks" in the Android system. These hooks
+ control an Android component independently of its normal lifecycle. They also control how
+ Android loads applications.
+</p>
+<p>
+ Normally, an Android component runs in a lifecycle determined by the system. For example, an
+ Activity object's lifecycle starts when the Activity is activated by an Intent. The object's
+ <code>onCreate()</code> method is called, followed by <code>onResume()</code>. When the user
+ starts another application, the <code>onPause()</code> method is called. If the Activity
+ code calls the <code>finish()</code> method, the <code>onDestroy()</code> method is called.
+ The Android framework API does not provide a way for your code to invoke these callback
+ methods directly, but you can do so using instrumentation.
+</p>
+<p>
+ Also, the system runs all the components of an application into the same
+ process. You can allow some components, such as content providers, to run in a separate process,
+ but you can't force an application to run in the same process as another application that is
+ already running.
+</p>
+<p>
+ With Android instrumentation, though, you can invoke callback methods in your test code.
+ This allows you to run through the lifecycle of a component step by step, as if you were
+ debugging the component. The following test code snippet demonstrates how to use this to
+ test that an Activity saves and restores its state:
+</p>
+<a name="ActivitySnippet"></a>
+<pre>
+ // Start the main activity of the application under test
+ mActivity = getActivity();
+
+ // Get a handle to the Activity object's main UI widget, a Spinner
+ mSpinner = (Spinner)mActivity.findViewById(com.android.example.spinner.R.id.Spinner01);
+
+ // Set the Spinner to a known position
+ mActivity.setSpinnerPosition(TEST_STATE_DESTROY_POSITION);
+
+ // Stop the activity - The onDestroy() method should save the state of the Spinner
+ mActivity.finish();
+
+ // Re-start the Activity - the onResume() method should restore the state of the Spinner
+ mActivity = getActivity();
+
+ // Get the Spinner's current position
+ int currentPosition = mActivity.getSpinnerPosition();
+
+ // Assert that the current position is the same as the starting position
+ assertEquals(TEST_STATE_DESTROY_POSITION, currentPosition);
+</pre>
+<p>
+ The key method used here is
+ {@link android.test.ActivityInstrumentationTestCase2#getActivity()}, which is a
+ part of the instrumentation API. The Activity under test is not started until you call this
+ method. You can set up the test fixture in advance, and then call this method to start the
+ Activity.
+</p>
+<p>
+ Also, instrumentation can load both a test package and the application under test into the
+ same process. Since the application components and their tests are in the same process, the
+ tests can invoke methods in the components, and modify and examine fields in the components.
+</p>
+<h3 id="TestCaseClasses">Test case classes</h3>
+<p>
+ Android provides several test case classes that extend {@link junit.framework.TestCase} and
+ {@link junit.framework.Assert} with Android-specific setup, teardown, and helper methods.
+</p>
+<h4 id="AndroidTestCase">AndroidTestCase</h4>
+<p>
+ A useful general test case class, especially if you are
+ just starting out with Android testing, is {@link android.test.AndroidTestCase}. It extends
+ both {@link junit.framework.TestCase} and {@link junit.framework.Assert}. It provides the
+ JUnit-standard <code>setUp()</code> and <code>tearDown()</code> methods, as well as
+ all of JUnit's Assert methods. In addition, it provides methods for testing permissions, and a
+ method that guards against memory leaks by clearing out certain class references.
+</p>
+<h4 id="ComponentTestCase">Component-specific test cases</h4>
+<p>
+ A key feature of the Android testing framework is its component-specific test case classes.
+ These address specific component testing needs with methods for fixture setup and
+ teardown and component lifecycle control. They also provide methods for setting up mock objects.
+ These classes are described in the component-specific testing topics:
+</p>
+<ul>
+ <li>
+ <a href="{@docRoot}tools/testing/activity_testing.html">Activity Testing</a>
+ </li>
+ <li>
+ <a href="{@docRoot}tools/testing/contentprovider_testing.html">
+ Content Provider Testing</a>
+ </li>
+ <li>
+ <a href="{@docRoot}tools/testing/service_testing.html">Service Testing</a>
+ </li>
+</ul>
+<p>
+ Android does not provide a separate test case class for BroadcastReceiver. Instead, test a
+ BroadcastReceiver by testing the component that sends it Intent objects, to verify that the
+ BroadcastReceiver responds correctly.
+</p>
+<h4 id="ApplicationTestCase">ApplicationTestCase</h4>
+<p>
+ You use the {@link android.test.ApplicationTestCase} test case class to test the setup and
+ teardown of {@link android.app.Application} objects. These objects maintain the global state of
+ information that applies to all the components in an application package. The test case can
+ be useful in verifying that the <application> element in the manifest file is correctly
+ set up. Note, however, that this test case does not allow you to control testing of the
+ components within your application package.
+</p>
+<h4 id="InstrumentationTestCase">InstrumentationTestCase</h4>
+<p>
+ If you want to use instrumentation methods in a test case class, you must use
+ {@link android.test.InstrumentationTestCase} or one of its subclasses. The
+ {@link android.app.Activity} test cases extend this base class with other functionality that
+ assists in Activity testing.
+</p>
+
+<h3 id="AssertionClasses">Assertion classes</h3>
+<p>
+ Because Android test case classes extend JUnit, you can use assertion methods to display the
+ results of tests. An assertion method compares an actual value returned by a test to an
+ expected value, and throws an AssertionException if the comparison test fails. Using assertions
+ is more convenient than doing logging, and provides better test performance.
+</p>
+<p>
+ Besides the JUnit {@link junit.framework.Assert} class methods, the testing API also provides
+ the {@link android.test.MoreAsserts} and {@link android.test.ViewAsserts} classes:
+</p>
+<ul>
+ <li>
+ {@link android.test.MoreAsserts} contains more powerful assertions such as
+ {@link android.test.MoreAsserts#assertContainsRegex}, which does regular expression
+ matching.
+ </li>
+ <li>
+ {@link android.test.ViewAsserts} contains useful assertions about Views. For example
+ it contains {@link android.test.ViewAsserts#assertHasScreenCoordinates} that tests if a View
+ has a particular X and Y position on the visible screen. These asserts simplify testing of
+ geometry and alignment in the UI.
+ </li>
+</ul>
+<h3 id="MockObjectClasses">Mock object classes</h3>
+<p>
+ To facilitate dependency injection in testing, Android provides classes that create mock system
+ objects such as {@link android.content.Context} objects,
+ {@link android.content.ContentProvider} objects, {@link android.content.ContentResolver}
+ objects, and {@link android.app.Service} objects. Some test cases also provide mock
+ {@link android.content.Intent} objects. You use these mocks both to isolate tests
+ from the rest of the system and to facilitate dependency injection for testing. These classes
+ are found in the packages {@link android.test} and {@link android.test.mock}.
+</p>
+<p>
+ Mock objects isolate tests from a running system by stubbing out or overriding
+ normal operations. For example, a {@link android.test.mock.MockContentResolver}
+ replaces the normal resolver framework with its own local framework, which is isolated
+ from the rest of the system. MockContentResolver also stubs out the
+ {@link android.content.ContentResolver#notifyChange(Uri, ContentObserver, boolean)} method
+ so that observer objects outside the test environment are not accidentally triggered.
+</p>
+<p>
+ Mock object classes also facilitate dependency injection by providing a subclass of the
+ normal object that is non-functional except for overrides you define. For example, the
+ {@link android.test.mock.MockResources} object provides a subclass of
+ {@link android.content.res.Resources} in which all the methods throw Exceptions when called.
+ To use it, you override only those methods that must provide information.
+</p>
+<p>
+ These are the mock object classes available in Android:
+</p>
+<h4 id="SimpleMocks">Simple mock object classes</h4>
+<p>
+ {@link android.test.mock.MockApplication}, {@link android.test.mock.MockContext},
+ {@link android.test.mock.MockContentProvider}, {@link android.test.mock.MockCursor},
+ {@link android.test.mock.MockDialogInterface}, {@link android.test.mock.MockPackageManager}, and
+ {@link android.test.mock.MockResources} provide a simple and useful mock strategy. They are
+ stubbed-out versions of the corresponding system object class, and all of their methods throw an
+ {@link java.lang.UnsupportedOperationException} exception if called. To use them, you override
+ the methods you need in order to provide mock dependencies.
+</p>
+<p class="Note"><strong>Note:</strong>
+ {@link android.test.mock.MockContentProvider}
+ and {@link android.test.mock.MockCursor} are new as of API level 8.
+</p>
+<h4 id="ResolverMocks">Resolver mock objects</h4>
+<p>
+ {@link android.test.mock.MockContentResolver} provides isolated testing of content providers by
+ masking out the normal system resolver framework. Instead of looking in the system to find a
+ content provider given an authority string, MockContentResolver uses its own internal table. You
+ must explicitly add providers to this table using
+ {@link android.test.mock.MockContentResolver#addProvider(String,ContentProvider)}.
+</p>
+<p>
+ With this feature, you can associate a mock content provider with an authority. You can create
+ an instance of a real provider but use test data in it. You can even set the provider for an
+ authority to <code>null</code>. In effect, a MockContentResolver object isolates your test
+ from providers that contain real data. You can control the
+ function of the provider, and you can prevent your test from affecting real data.
+</p>
+<h3 id="ContextMocks">Contexts for testing</h3>
+<p>
+ Android provides two Context classes that are useful for testing:
+</p>
+<ul>
+ <li>
+ {@link android.test.IsolatedContext} provides an isolated {@link android.content.Context},
+ File, directory, and database operations that use this Context take place in a test area.
+ Though its functionality is limited, this Context has enough stub code to respond to
+ system calls.
+ <p>
+ This class allows you to test an application's data operations without affecting real
+ data that may be present on the device.
+ </p>
+ </li>
+ <li>
+ {@link android.test.RenamingDelegatingContext} provides a Context in which
+ most functions are handled by an existing {@link android.content.Context}, but
+ file and database operations are handled by a {@link android.test.IsolatedContext}.
+ The isolated part uses a test directory and creates special file and directory names.
+ You can control the naming yourself, or let the constructor determine it automatically.
+ <p>
+ This object provides a quick way to set up an isolated area for data operations,
+ while keeping normal functionality for all other Context operations.
+ </p>
+ </li>
+</ul>
+<h2 id="InstrumentationTestRunner">Running Tests</h2>
+<p>
+ Test cases are run by a test runner class that loads the test case class, set ups,
+ runs, and tears down each test. An Android test runner must also be instrumented, so that
+ the system utility for starting applications can control how the test package
+ loads test cases and the application under test. You tell the Android platform
+ which instrumented test runner to use by setting a value in the test package's manifest file.
+</p>
+<p>
+ {@link android.test.InstrumentationTestRunner} is the primary Android test runner class. It
+ extends the JUnit test runner framework and is also instrumented. It can run any of the test
+ case classes provided by Android and supports all possible types of testing.
+</p>
+<p>
+ You specify <code>InstrumentationTestRunner</code> or a subclass in your test package's
+ manifest file, in the
+<code><a href="{@docRoot}guide/topics/manifest/instrumentation-element.html"><instrumentation></a></code>
+ element. Also, <code>InstrumentationTestRunner</code> code resides
+ in the shared library <code>android.test.runner</code>, which is not normally linked to
+ Android code. To include it, you must specify it in a
+<code><a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library></a></code>
+ element. You do not have to set up these elements yourself. Both Eclipse with ADT and the
+ <code>android</code> command-line tool construct them automatically and add them to your
+ test package's manifest file.
+</p>
+<p class="Note">
+ <strong>Note:</strong> If you use a test runner other than
+ <code>InstrumentationTestRunner</code>, you must change the <instrumentation>
+ element to point to the class you want to use.
+</p>
+<p>
+ To run {@link android.test.InstrumentationTestRunner}, you use internal system classes called by
+ Android tools. When you run a test in Eclipse with ADT, the classes are called automatically.
+ When you run a test from the command line, you run these classes with
+ <a href="{@docRoot}tools/help/adb.html">Android Debug Bridge (adb)</a>.
+</p>
+<p>
+ The system classes load and start the test package, kill any processes that
+ are running an instance of the application under test, and then load a new instance of the
+ application under test. They then pass control to
+ {@link android.test.InstrumentationTestRunner}, which runs
+ each test case class in the test package. You can also control which test cases and
+ methods are run using settings in Eclipse with ADT, or using flags with the command-line tools.
+</p>
+<p>
+ Neither the system classes nor {@link android.test.InstrumentationTestRunner} run
+ the application under test. Instead, the test case does this directly. It either calls methods
+ in the application under test, or it calls its own methods that trigger lifecycle events in
+ the application under test. The application is under the complete control of the test case,
+ which allows it to set up the test environment (the test fixture) before running a test. This
+ is demonstrated in the previous <a href="#ActivitySnippet">code snippet</a> that tests an
+ Activity that displays a Spinner widget.
+</p>
+<p>
+ To learn more about running tests, please read the topics
+ <a href="{@docRoot}tools/testing/testing_eclipse.html">
+ Testing from Eclipse with ADT</a> or
+ <a href="{@docRoot}tools/testing/testing_otheride.html">
+ Testing from Other IDEs</a>.
+</p>
+<h2 id="TestResults">Seeing Test Results</h2>
+<p>
+ The Android testing framework returns test results back to the tool that started the test.
+ If you run a test in Eclipse with ADT, the results are displayed in a new JUnit view pane. If
+ you run a test from the command line, the results are displayed in <code>STDOUT</code>. In
+ both cases, you see a test summary that displays the name of each test case and method that
+ was run. You also see all the assertion failures that occurred. These include pointers to the
+ line in the test code where the failure occurred. Assertion failures also list the expected
+ value and actual value.
+</p>
+<p>
+ The test results have a format that is specific to the IDE that you are using. The test
+ results format for Eclipse with ADT is described in
+ <a href="{@docRoot}tools/testing/testing_eclipse.html#RunTestEclipse">
+ Testing from Eclipse with ADT</a>. The test results format for tests run from the
+ command line is described in
+ <a href="{@docRoot}tools/testing/testing_otheride.html#RunTestsCommand">
+ Testing from Other IDEs</a>.
+</p>
+<h2 id="Monkeys">monkey and monkeyrunner</h2>
+<p>
+ The SDK provides two tools for functional-level application testing:
+</p>
+ <ul>
+ <li>
+The <a href="{@docRoot}tools/help/monkey.html">UI/Application Exerciser Monkey</a>,
+ usually called "monkey", is a command-line tool that sends pseudo-random streams of
+ keystrokes, touches, and gestures to a device. You run it with the
+ <a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a> (adb) tool.
+ You use it to stress-test your application and report back errors that are encountered.
+ You can repeat a stream of events by running the tool each time with the same random
+ number seed.
+ </li>
+ <li>
+ The <a href="{@docRoot}tools/help/monkeyrunner_concepts.html">monkeyrunner</a> tool
+ is an API and execution environment for test programs written in Python. The API
+ includes functions for connecting to a device, installing and uninstalling packages,
+ taking screenshots, comparing two images, and running a test package against an
+ application. Using the API, you can write a wide range of large, powerful, and complex
+ tests. You run programs that use the API with the <code>monkeyrunner</code> command-line
+ tool.
+ </li>
+ </ul>
+<h2 id="PackageNames">Working With Package names</h2>
+<p>
+ In the test environment, you work with both Android application package names and
+ Java package identifiers. Both use the same naming format, but they represent substantially
+ different entities. You need to know the difference to set up your tests correctly.
+</p>
+<p>
+ An Android package name is a unique system name for a <code>.apk</code> file, set by the
+ "android:package" attribute of the <manifest> element in the package's
+ manifest. The Android package name of your test package must be different from the
+ Android package name of the application under test. By default, Android tools create the
+ test package name by appending ".test" to the package name of the application under test.
+</p>
+<p>
+ The test package also uses an Android package name to target the application package it
+ tests. This is set in the "android:targetPackage" attribute of the
+ <instrumentation> element in the test package's manifest.
+</p>
+<p>
+ A Java package identifier applies to a source file. This package name reflects the directory
+ path of the source file. It also affects the visibility of classes and members to each other.
+</p>
+<p>
+ Android tools that create test projects set up an Android test package name for you.
+ From your input, the tools set up the test package name and the target package name for the
+ application under test. For these tools to work, the application project must already exist.
+</p>
+<p>
+ By default, these tools set the Java package identifier for the test class to be the same
+ as the Android package identifier. You may want to change this if you want to expose
+ members in the application under test by giving them package visibility. If you do this,
+ change only the Java package identifier, not the Android package names, and change only the
+ test case source files. Do not change the Java package name of the generated
+ <code>R.java</code> class in your test package, because it will then conflict with the
+ <code>R.java</code> class in the application under test. Do not change the Android package name
+ of your test package to be the same as the application it tests, because then their names
+ will no longer be unique in the system.
+</p>
+<h2 id="WhatToTest">What to Test</h2>
+<p>
+ The topic <a href="{@docRoot}tools/testing/what_to_test.html">What To Test</a>
+ describes the key functionality you should test in an Android application, and the key
+ situations that might affect that functionality.
+</p>
+<p>
+ Most unit testing is specific to the Android component you are testing.
+ The topics <a href="{@docRoot}tools/testing/activity_testing.html">Activity Testing</a>,
+ <a href="{@docRoot}tools/testing/contentprovider_testing.html">
+ Content Provider Testing</a>, and <a href="{@docRoot}tools/testing/service_testing.html">
+ Service Testing</a> each have a section entitled "What To Test" that lists possible testing
+ areas.
+</p>
+<p>
+ When possible, you should run these tests on an actual device. If this is not possible, you can
+ use the <a href="{@docRoot}tools/devices/emulator.html">Android Emulator</a> with
+ Android Virtual Devices configured for the hardware, screens, and versions you want to test.
+</p>
+<h2 id="NextSteps">Next Steps</h2>
+<p>
+ To learn how to set up and run tests in Eclipse, please refer to
+<a href="{@docRoot}tools/testing/testing_eclipse.html">Testing from Eclipse with ADT</a>.
+ If you're not working in Eclipse, refer to
+<a href="{@docRoot}tools/testing/testing_otheride.html">Testing from Other IDEs</a>.
+</p>
+<p>
+ If you want a step-by-step introduction to Android testing, try the
+ <a href="{@docRoot}tools/testing/activity_test.html">Activity Testing Tutorial</a>.
+</p>
diff --git a/docs/html/tools/testing/testing_eclipse.jd b/docs/html/tools/testing/testing_eclipse.jd
new file mode 100644
index 0000000..7d3be47
--- /dev/null
+++ b/docs/html/tools/testing/testing_eclipse.jd
@@ -0,0 +1,535 @@
+page.title=Testing from Eclipse with ADT
+parent.title=Testing
+parent.link=index.html
+@jd:body
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#CreateTestProjectEclipse">Creating a Test Project</a></li>
+ <li><a href="#CreateTestAppEclipse">Creating a Test Package</a></li>
+ <li><a href="#RunTestEclipse">Running Tests</a></li>
+ </ol>
+ </div>
+</div>
+<p>
+ This topic explains how create and run tests of Android applications in Eclipse with ADT.
+ Before you read this topic, you should read about how to create an Android application with the
+ basic processes for creating and running applications with ADT, as described in
+ <a href="{@docRoot}tools/projects/projects-eclipse.html">Managing Projects from
+Eclipse</a>
+ and <a href="{@docRoot}tools/building/building-eclipse.html">Building and Running
+from Eclipse</a>.
+ You may also want to read
+ <a href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>,
+ which provides an overview of the Android testing framework.
+</p>
+<p>
+ ADT provides several features that help you set up and manage your testing environment
+ effectively:
+</p>
+ <ul>
+ <li>
+ It lets you quickly create a test project and link it to the application under test.
+ When it creates the test project, it automatically inserts the necessary
+ <code><instrumentation></code> element in the test package's manifest file.
+ </li>
+ <li>
+ It lets you quickly import the classes of the application under test, so that your
+ tests can inspect them.
+ </li>
+ <li>
+ It lets you create run configurations for your test package and include in
+ them flags that are passed to the Android testing framework.
+ </li>
+ <li>
+ It lets you run your test package without leaving Eclipse. ADT builds both the
+ application under test and the test package automatically, installs them if
+ necessary to your device or emulator, runs the test package, and displays the
+ results in a separate window in Eclipse.
+ </li>
+ </ul>
+<p>
+ If you are not developing in Eclipse or you want to learn how to create and run tests from the
+ command line, see
+ <a href="{@docRoot}tools/testing/testing_otheride.html">Testing from Other IDEs</a>.
+</p>
+<h2 id="CreateTestProjectEclipse">Creating a Test Project</h2>
+<p>
+ To set up a test environment for your Android application, you must first create a separate
+ project that holds the test code. The new project follows the directory structure
+ used for any Android application. It includes the same types of content and files, such as
+ source code, resources, a manifest file, and so forth. The test package you
+ create is connected to the application under test by an
+ <a href="{@docRoot}guide/topics/manifest/instrumentation-element.html">
+ <code><instrumentation></code></a> element in its manifest file.
+</p>
+<p>
+ The <em>New Android Test Project</em> dialog makes it easy for you to generate a
+ new test project that has the proper structure, including the
+ <code><instrumentation></code> element in the manifest file. You can use the New
+ Android Test Project dialog to generate the test project at any time. The dialog appears
+ just after you create a new Android main application project, but you can also run it to
+ create a test project for a project that you created previously.
+</p>
+<p>
+ To create a test project in Eclipse with ADT:
+</p>
+<ol>
+ <li>
+ In Eclipse, select <strong>File > New > Other</strong>. This opens the <em>Select a
+ Wizard</em> dialog.
+ </li>
+ <li>
+ In the dialog, in the <em>Wizards</em> drop-down list, find the entry for Android, then
+ click the toggle to the left. Select <strong>Android Test Project</strong>, then at the
+ bottom of the dialog click <strong>Next</strong>. The <em>New Android Test Project</em>
+ wizard appears.
+ </li>
+ <li>
+ Next to <em>Test Project Name</em>, enter a name for the project. You may use any name,
+ but you may want to associate the name with the project name for the application under test.
+ One way to do this is to take the application's project name, append the string "Test" to
+ it, and then use this as the test package project name.
+ <p>
+ The name becomes part of the suggested project path, but you can change this in the
+ next step.
+ </p>
+ </li>
+ <li>
+ In the <em>Content</em> panel, examine the suggested path to the project.
+ If <em>Use default location</em> is set, then the wizard will suggest a path that is
+ a concatenation of the workspace path and the project name you entered. For example,
+ if your workspace path is <code>/usr/local/workspace</code> and your project name is
+ <code>MyTestApp</code>, then the wizard will suggest
+ <code>/usr/local/workspace/MyTestApp</code>. To enter your own
+ choice for a path, unselect <em>Use default location</em>, then enter or browse to the
+ path where you want your project.
+ <p>
+ To learn more about choosing the location of test projects, please read
+ <a href="{@docRoot}tools/testing/testing_android.html#TestProjectPaths">
+ Testing Fundamentals</a>.
+ </p>
+ </li>
+ <li>
+ In the Test Target panel, set An Existing Android Project, click Browse, then select your
+ Android application from the list. You now see that the wizard has completed the Test
+ Target Package, Application Name, and Package Name fields for you (the latter two are in
+ the Properties panel).
+ </li>
+ <li>
+ In the Build Target panel, select the Android SDK platform that the application under test
+ uses.
+ </li>
+ <li>
+ Click Finish to complete the wizard. If Finish is disabled, look for error messages at the
+ top of the wizard dialog, and then fix any problems.
+ </li>
+</ol>
+<h2 id="CreateTestAppEclipse">Creating a Test Package</h2>
+<p>
+ Once you have created a test project, you populate it with a test package. This package does not
+ require an Activity, although you can define one if you wish. Although your test package can
+ combine Activity classes, test case classes, or ordinary classes, your main test case
+ should extend one of the Android test case classes or JUnit classes, because these provide the
+ best testing features.
+</p>
+<p>
+ Test packages do not need to have an Android GUI. When you run the package in
+ Eclipse with ADT, its results appear in the JUnit view. Running tests and seeing the results is
+ described in more detail in the section <a href="#RunTestEclipse">Running Tests</a>.
+</p>
+
+<p>
+ To create a test package, start with one of Android's test case classes defined in
+ {@link android.test android.test}. These extend the JUnit
+ {@link junit.framework.TestCase TestCase} class. The Android test classes for Activity objects
+ also provide instrumentation for testing an Activity. To learn more about test case
+ classes, please read the topic <a href="{@docRoot}tools/testing/testing_android.html">
+ Testing Fundamentals</a>.
+</p>
+<p>
+ Before you create your test package, you choose the Java package identifier you want to use
+ for your test case classes and the Android package name you want to use. To learn more
+ about this, please read
+ <a href="{@docRoot}tools/testing/testing_android.html#PackageNames">
+ Testing Fundamentals</a>.
+</p>
+<p>
+ To add a test case class to your project:
+</p>
+<ol>
+ <li>
+ In the <em>Project Explorer</em> tab, open your test project, then open the <em>src</em>
+ folder.
+ </li>
+ <li>
+ Find the Java package identifier set by the projection creation wizard. If you haven't
+ added classes yet, this node won't have any children, and its icon will not be filled in.
+ If you want to change the identifier value, right-click the identifier and select
+ <strong>Refactor</strong> > <strong>Rename</strong>, then enter the new name.
+ </li>
+ <li>
+ When you are ready, right-click the Java package identifier again and select
+ <strong>New</strong> > <strong>Class</strong>. This displays the <em>New Java Class</em>
+ dialog, with the <em>Source folder</em> and <em>Package</em> values already set.
+ </li>
+ <li>
+ In the <em>Name</em> field, enter a name for the test case class. One way to choose a
+ class name is to append the string "Test" to the class of the component you are testing.
+ For example, if you are testing the class MyAppActivity, your test case class
+ name would be MyAppActivityTest. Leave the modifiers set to <em>public</em>.
+ </li>
+ <li>
+ In the <em>Superclass</em> field, enter the name of the Android test case class you
+ are extending. You can also browse the available classes.
+ </li>
+ <li>
+ In <em>Which method stubs would you like to create?</em>, unset all the options, then
+ click <strong>Finish</strong>. You will set up the constructor manually.
+ </li>
+ <li>
+ Your new class appears in a new Java editor pane.
+ </li>
+</ol>
+<p>
+ You now have to ensure that the constructor is set up correctly. Create a constructor for your
+ class that has no arguments; this is required by JUnit. As the first statement in this
+ constructor, add a call to the base class' constructor. Each base test case class has its
+ own constructor signature. Refer to the class documentation in the documentation for
+ {@link android.test} for more information.
+</p>
+<p>
+ To control your test environment, you will want to override the <code>setUp()</code> and
+ <code>tearDown()</code> methods:
+</p>
+<ul>
+ <li>
+ <code>setUp()</code>: This method is invoked before any of the test methods in the class.
+ Use it to set up the environment for the test (the test fixture. You can use
+ <code>setUp()</code> to instantiate a new Intent with the action <code>ACTION_MAIN</code>.
+ You can then use this intent to start the Activity under test.
+ </li>
+ <li>
+ <code>tearDown()</code>: This method is invoked after all the test methods in the class. Use
+ it to do garbage collection and to reset the test fixture.
+ </li>
+</ul>
+<p>
+ Another useful convention is to add the method <code>testPreconditions()</code> to your test
+ class. Use this method to test that the application under test is initialized correctly. If this
+ test fails, you know that that the initial conditions were in error. When this happens, further
+ test results are suspect, regardless of whether or not the tests succeeded.
+</p>
+<p>
+ The Resources tab contains an
+ <a href="{@docRoot}tools/testing/activity_test.html">Activity Testing</a>
+ tutorial with more information about creating test classes and methods.
+</p>
+<h2 id="RunTestEclipse">Running Tests</h2>
+ <div class="sidebox-wrapper">
+ <div class="sidebox">
+ <h2>Running tests from the command line</h2>
+ <p>
+ If you've created your tests in Eclipse, you can still run your tests and test
+ suites by using command-line tools included with the Android SDK. You may want
+ to do this, for example, if you have a large number of tests to run, if you
+ have a large test case, or if you want a fine level of control over which
+ tests are run at a particular time.
+ </p>
+ <p>
+ To run tests created in Eclipse with ADT with command-line tools, you must first
+ install additional files into the test project using the <code>android</code>
+ tool's "create test-project" option. To see how to do this, read
+ <a href="{@docRoot}tools/testing/testing_otheride.html#CreateProject">
+ Testing in Other IDEs</a>.
+ </p>
+ </div>
+ </div>
+<p>
+ When you run a test package in Eclipse with ADT, the output appears in the Eclipse JUnit view.
+ You can run the entire test package or one test case class. To do run tests, Eclipse runs the
+ <code>adb</code> command for running a test package, and displays the output, so there is no
+ difference between running tests inside Eclipse and running them from the command line.
+</p>
+<p>
+ As with any other package, to run a test package in Eclipse with ADT you must either attach a
+ device to your computer or use the Android emulator. If you use the emulator, you must have an
+ Android Virtual Device (AVD) that uses the same target as the test package.
+</p>
+<p>
+ To run a test in Eclipse, you have two choices:</p>
+<ul>
+ <li>
+ Run a test just as you run an application, by selecting
+ <strong>Run As... > Android JUnit Test</strong> from the project's context menu or
+ from the main menu's <strong>Run</strong> item.
+ </li>
+ <li>
+ Create an Eclipse run configuration for your test project. This is useful if you want
+ multiple test suites, each consisting of selected tests from the project. To run
+ a test suite, you run the test configuration.
+ <p>
+ Creating and running test configurations is described in the next section.
+ </p>
+ </li>
+</ul>
+<p>
+ To create and run a test suite using a run configuration:
+</p>
+<ol>
+ <li>
+ In the Package Explorer, select the test project, then from the main menu, select
+ <strong>Run > Run Configurations...</strong>. The Run Configurations dialog appears.
+ </li>
+ <li>
+ In the left-hand pane, find the Android JUnit Test entry. In the right-hand pane, click the
+ Test tab. The Name: text box shows the name of your project. The Test class: dropdown box
+ shows one of the test classes in your project.
+ </li>
+ <li>
+ To run one test class, click Run a single test, then enter your project name in the
+ Project: text box and the class name in the Test class: text box.
+ <p>
+ To run all the test classes, click Run all tests in the selected project or package,
+ then enter the project or package name in the text box.
+ </p>
+ </li>
+ <li>
+ Now click the Target tab.
+ <ul>
+ <li>
+ Optional: If you are using the emulator, click Automatic, then in the Android
+ Virtual Device (AVD) selection table, select an existing AVD.
+ </li>
+ <li>
+ In the Emulator Launch Parameters pane, set the Android emulator flags you want to
+ use. These are documented in the topic
+ <a href="{@docRoot}tools/help/emulator.html#startup-options">
+ Android Emulator</a>.
+ </li>
+ </ul>
+ </li>
+ <li>
+ Click the Common tab. In the Save As pane, click Local to save this run configuration
+ locally, or click Shared to save it to another project.
+ </li>
+ <li>
+ Optional: Add the configuration to the Run toolbar and the <strong>Favorites</strong>
+ menu: in the Display in Favorites pane click the checkbox next to Run.
+ </li>
+ <li>
+ Optional: To add this configuration to the <strong>Debug</strong> menu and toolbar, click
+ the checkbox next to Debug.
+ </li>
+ <li>
+ To save your settings, click Close.<br/>
+ <p class="note"><strong>Note:</strong>
+ Although you can run the test immediately by clicking Run, you should save the test
+ first and then run it by selecting it from the Eclipse standard toolbar.
+ </p>
+ </li>
+ <li>
+ On the Eclipse standard toolbar, click the down arrow next to the green Run arrow. This
+ displays a menu of saved Run and Debug configurations.
+ </li>
+ <li>
+ Select the test run configuration you just created. The test starts.
+ </li>
+</ol>
+<p>
+ The progress of your test appears in the Console view as a series of messages. Each message is
+ preceded by a timestamp and the <code>.apk</code> filename to which it applies. For example,
+ this message appears when you run a test to the emulator, and the emulator is not yet started:
+</p>
+<div class="sidebox-wrapper">
+ <div class="sidebox">
+ <h2>Message Examples</h2>
+ <p>
+ The examples shown in this section come from the
+ <a href="{@docRoot}resources/samples/SpinnerTest/index.html">SpinnerTest</a>
+ sample test package, which tests the
+ <a href="{@docRoot}resources/samples/Spinner/index.html">Spinner</a>
+ sample application. This test package is also featured in the
+ <a href="{@docRoot}tools/testing/activity_test.html">Activity Testing</a>
+ tutorial.
+ </p>
+ </div>
+</div>
+<pre>
+ [<em>yyyy-mm-dd hh:mm:ss</em> - <em>testfile</em>] Waiting for HOME ('android.process.acore') to be launched...
+</pre>
+<p>
+ In the following description of these messages, <code><em>devicename</em></code> is the name of
+ the device or emulator you are using to run the test, and <code><em>port</em></code> is the
+ port number for the device. The name and port number are in the format used by the
+ <code><a href="{@docRoot}tools/help/adb.html#devicestatus">adb devices</a></code>
+ command. Also, <code><em>testfile</em></code> is the <code>.apk</code> filename of the test
+ package you are running, and <em>appfile</em> is the filename of the application under test.
+</p>
+<ul>
+ <li>
+ If you are using an emulator and you have not yet started it, then Eclipse
+ first starts the emulator. When this is complete, you see
+ the message:
+ <p>
+ <code>HOME is up on device '<em>devicename</em>-<em>port</em>'</code>
+ </p>
+ </li>
+ <li>
+ If you have not already installed your test package, then you see
+ the message:
+ <p>
+ <code>Uploading <em>testfile</em> onto device '<em>devicename</em>-<em>port</em>'
+ </code>
+ </p>
+ <p>
+ then the message <code>Installing <em>testfile</em></code>.
+ </p>
+ <p>
+ and finally the message <code>Success!</code>
+ </p>
+ </li>
+</ul>
+<p>
+ The following lines are an example of this message sequence:
+</p>
+<code>
+[2010-07-01 12:44:40 - MyTest] HOME is up on device 'emulator-5554'<br>
+[2010-07-01 12:44:40 - MyTest] Uploading MyTest.apk onto device 'emulator-5554'<br>
+[2010-07-01 12:44:40 - MyTest] Installing MyTest.apk...<br>
+[2010-07-01 12:44:49 - MyTest] Success!<br>
+</code>
+<br>
+<ul>
+ <li>
+ Next, if you have not yet installed the application under test to the device or
+ emulator, you see the message
+ <p>
+ <code>Project dependency found, installing: <em>appfile</em></code>
+ </p>
+ <p>
+ then the message <code>Uploading <em>appfile</em></code> onto device
+ '<em>devicename</em>-<em>port</em>'
+ </p>
+ <p>
+ then the message <code>Installing <em>appfile</em></code>
+ </p>
+ <p>
+ and finally the message <code>Success!</code>
+ </p>
+ </li>
+</ul>
+<p>
+ The following lines are an example of this message sequence:
+</p>
+<code>
+[2010-07-01 12:44:49 - MyTest] Project dependency found, installing: MyApp<br>
+[2010-07-01 12:44:49 - MyApp] Uploading MyApp.apk onto device 'emulator-5554'<br>
+[2010-07-01 12:44:49 - MyApp] Installing MyApp.apk...<br>
+[2010-07-01 12:44:54 - MyApp] Success!<br>
+</code>
+<br>
+<ul>
+ <li>
+ Next, you see the message
+ <code>Launching instrumentation <em>instrumentation_class</em> on device
+ <em>devicename</em>-<em>port</em></code>
+ <p>
+ <code>instrumentation_class</code> is the fully-qualified class name of the
+ instrumentation test runner you have specified (usually
+ {@link android.test.InstrumentationTestRunner}.
+ </p>
+ </li>
+ <li>
+ Next, as {@link android.test.InstrumentationTestRunner} builds a list of tests to run,
+ you see the message
+ <p>
+ <code>Collecting test information</code>
+ </p>
+ <p>
+ followed by
+ </p>
+ <p>
+ <code>Sending test information to Eclipse</code>
+ </p>
+ </li>
+ <li>
+ Finally, you see the message <code>Running tests</code>, which indicates that your tests
+ are running. At this point, you should start seeing the test results in the JUnit view.
+ When the tests are finished, you see the console message <code>Test run complete</code>.
+ This indicates that your tests are finished.
+ </li>
+</ul>
+<p>
+ The following lines are an example of this message sequence:
+</p>
+<code>
+[2010-01-01 12:45:02 - MyTest] Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5554<br>
+[2010-01-01 12:45:02 - MyTest] Collecting test information<br>
+[2010-01-01 12:45:02 - MyTest] Sending test information to Eclipse<br>
+[2010-01-01 12:45:02 - MyTest] Running tests...<br>
+[2010-01-01 12:45:22 - MyTest] Test run complete<br>
+</code>
+<br>
+<p>
+ The test results appear in the JUnit view. This is divided into an upper summary pane,
+ and a lower stack trace pane.
+</p>
+<p>
+ The upper pane contains test information. In the pane's header, you see the following
+ information:
+</p>
+<ul>
+ <li>
+ Total time elapsed for the test package (labeled Finished after <em>x</em> seconds).
+ </li>
+ <li>
+ Number of runs (Runs:) - the number of tests in the entire test class.
+ </li>
+ <li>
+ Number of errors (Errors:) - the number of program errors and exceptions encountered
+ during the test run.
+ </li>
+ <li>
+ Number of failures (Failures:) - the number of test failures encountered during the test
+ run. This is the number of assertion failures. A test can fail even if the program does
+ not encounter an error.
+ </li>
+ <li>
+ A progress bar. The progress bar extends from left to right as the tests run. If all the
+ tests succeed, the bar remains green. If a test fails, the bar turns from green to red.
+ </li>
+</ul>
+<p>
+ The body of the upper pane contains the details of the test run. For each test case class
+ that was run, you see a line with the class name. To look at the results for the individual
+ test methods in that class, you click the left arrow to expand the line. You now see a
+ line for each test method in the class, and to its right the time it took to run.
+ If you double-click the method name, Eclipse opens the test class source in an editor view
+ pane and moves the focus to the first line of the test method.
+</p>
+<p>
+ The results of a successful test are shown in figure 1.
+</p>
+<a href="{@docRoot}images/testing/eclipse_test_results.png">
+ <img src="{@docRoot}images/testing/eclipse_test_results.png"
+ alt="Messages for a successful test" height="327px" id="TestResults"/>
+</a>
+<p class="img-caption">
+ <strong>Figure 1.</strong> Messages for a successful test.
+</p>
+<p>
+ The lower pane is for stack traces. If you highlight a failed test in the upper pane, the
+ lower pane contains a stack trace for the test. If a line corresponds to a point in your
+ test code, you can double-click it to display the code in an editor view pane, with the
+ line highlighted. For a successful test, the lower pane is empty.
+</p>
+<p>The results of a failed test are shown in figure 2.</p>
+<a href="{@docRoot}images/testing/eclipse_test_run_failure.png">
+ <img src="{@docRoot}images/testing/eclipse_test_run_failure.png"
+ alt="" height="372px" id="TestRun"/>
+</a>
+<p class="img-caption">
+ <strong>Figure 2.</strong> Messages for a test failure.
+</p>
diff --git a/docs/html/tools/testing/testing_otheride.jd b/docs/html/tools/testing/testing_otheride.jd
new file mode 100644
index 0000000..0678f52
--- /dev/null
+++ b/docs/html/tools/testing/testing_otheride.jd
@@ -0,0 +1,690 @@
+page.title=Testing from Other IDEs
+parent.title=Testing
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li>
+ <a href="#CreateTestProjectCommand">Working with Test Projects</a>
+ <ol>
+ <li>
+ <a href="#CreateTestProject">Creating a test project</a>
+ </li>
+ <li>
+ <a href="#UpdateTestProject">Updating a test project</a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <a href="#CreateTestApp">Creating a Test Package</a>
+ </li>
+ <li>
+ <a href="#RunTestsCommand">Running Tests</a>
+ <ol>
+ <li>
+ <a href="#RunTestsAnt">Quick build and run with Ant</a>
+ </li>
+ <li>
+ <a href="#RunTestsDevice">Running tests on a device or emulator</a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <a href="#AMSyntax">Using the Instrument Command</a>
+ <ol>
+ <li>
+ <a href="#AMOptionsSyntax">Instrument options</a>
+ </li>
+ <li>
+ <a href="#RunTestExamples">Instrument examples</a>
+ </li>
+ </ol>
+ </li>
+ </ol>
+ <h2>See Also</h2>
+ <ol>
+ <li>
+ <a href="{@docRoot}tools/testing/testing_android.html">
+ Testing Fundamentals</a>
+ </li>
+ <li>
+ <a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a>
+ </li>
+ </ol>
+ </div>
+</div>
+<p>
+ This document describes how to create and run tests directly from the command line.
+ You can use the techniques described here if you are developing in an IDE other than Eclipse
+ or if you prefer to work from the command line. This document assumes that you already know how
+ to create a Android application in your programming environment. Before you start this
+ document, you should read the topic
+ <a href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>,
+ which provides an overview of Android testing.
+</p>
+<p>
+ If you are developing in Eclipse with ADT, you can set up and run your tests
+ directly in Eclipse. For more information, please read
+ <a href="{@docRoot}tools/testing/testing_eclipse.html">
+ Testing from Eclipse with ADT</a>.
+</p>
+<h2 id="CreateTestProjectCommand">Working with Test Projects</h2>
+<p>
+ You use the <code>android</code> tool to create test projects.
+ You also use <code>android</code> to convert existing test code into an Android test project,
+ or to add the <code>run-tests</code> Ant target to an existing Android test project.
+ These operations are described in more detail in the section <a href="#UpdateTestProject">
+ Updating a test project</a>. The <code>run-tests</code> target is described in
+ <a href="#RunTestsAnt">Quick build and run with Ant</a>.
+</p>
+<h3 id="CreateTestProject">Creating a test project</h3>
+<p>
+ To create a test project with the <code>android</code> tool, enter:
+</p>
+<pre>
+android create test-project -m <main_path> -n <project_name> -p <test_path>
+</pre>
+<p>
+ You must supply all the flags. The following table explains them in detail:
+</p>
+<table>
+ <tr>
+ <th>Flag</th>
+ <th>Value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>-m, --main</code></td>
+ <td>
+ Path to the project of the application under test, relative to the test package
+ directory.
+ </td>
+ <td>
+ For example, if the application under test is in <code>source/HelloAndroid</code>, and
+ you want to create the test project in <code>source/HelloAndroidTest</code>, then the
+ value of <code>--main</code> should be <code>../HelloAndroid</code>.
+ <p>
+ To learn more about choosing the location of test projects, please read
+ <a href="{@docRoot}tools/testing/testing_android.html#TestProjects">
+ Testing Fundamentals</a>.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td><code>-n, --name</code></td>
+ <td>Name that you want to give the test project.</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td><code>-p, --path</code></td>
+ <td>Directory in which you want to create the new test project.</td>
+ <td>
+ The <code>android</code> tool creates the test project files and directory structure
+ in this directory. If the directory does not exist, <code>android</code> creates it.
+ </td>
+ </tr>
+</table>
+<p>
+ If the operation is successful, <code>android</code> lists to STDOUT the names of the files
+ and directories it has created.
+</p>
+<p>
+ This creates a new test project with the appropriate directories and build files. The directory
+ structure and build file contents are identical to those in a regular Android application
+ project. They are described in detail in the topic
+ <a href="{@docRoot}tools/projects/index.html">Managing Projects</a>.
+</p>
+<p>
+ The operation also creates an <code>AndroidManifest.xml</code> file with instrumentation
+ information. When you run the test, Android uses this information to load the application you
+ are testing and control it with instrumentation.
+</p>
+<p>
+ For example, suppose you create a project in the directory <code>~/source/HelloAndroid</code>,
+with the package name <code>com.example.helloandroid</code>,
+ and the activity name <code>HelloAndroid</code>. You can to create the test for this in
+ <code>~/source/HelloAndroidTest</code>. To do so, you enter:
+</p>
+<pre>
+$ cd ~/source
+$ android create test-project -m ../HelloAndroid -n HelloAndroidTest -p HelloAndroidTest
+</pre>
+<p>
+ This creates a directory called <code>~/src/HelloAndroidTest</code>. In the new directory you
+ see the file <code>AndroidManifest.xml</code>. This file contains the following
+ instrumentation-related elements and attributes:
+</p>
+<ul>
+ <li>
+ <code><application></code>: to contain the
+ <code><uses-library></code> element.
+ </li>
+ <li>
+ <code><uses-library android:name="android.test.runner"</code>:
+ specifies this testing application uses the <code>android.test.runner</code> library.
+ </li>
+ <li>
+ <code><instrumentation></code>: contains attributes that control Android
+ instrumentation. The attributes are:
+ <ul>
+ <li>
+ <code>android:name="android.test.InstrumentationTestRunner"</code>:
+ {@link android.test.InstrumentationTestRunner} runs test cases. It extends both
+ JUnit test case runner classes and Android instrumentation classes.
+ </li>
+ <li>
+ <code>android:targetPackage="com.example.helloandroid"</code>: specifies
+ that the tests in HelloAndroidTest should be run against the application with the
+ <em>Android</em> package name <code>com.example.helloandroid</code>.
+ </li>
+ <li>
+ <code>android:label="Tests for .HelloAndroid"</code>: specifies a
+ user-readable label for the instrumentation class. By default,
+ the <code>android</code> tool gives it the value "Tests for " plus
+ the name of the main Activity of the application under test.
+ </li>
+ </ul>
+ </li>
+</ul>
+<h3 id="UpdateTestProject">Updating a test project</h3>
+<p>
+ You use the <code>android</code> tool when you need to change the path to the
+ project of the application under test. If you are changing an existing test project created in
+ Eclipse with ADT so that you can also build and run it from the command line, you must use the
+ "create" operation. See the section <a href="#CreateTestProject">Creating a test project</a>.
+</p>
+<p class="note">
+ <strong>Note:</strong> If you change the Android package name of the application under test,
+ you must <em>manually</em> change the value of the <code><android:targetPackage></code>
+ attribute within the <code>AndroidManifest.xml</code> file of the test package.
+ Running <code>android update test-project</code> does not do this.
+</p>
+<p>
+ To update a test project with the <code>android</code> tool, enter:
+</p>
+<pre>android update test-project -m <main_path> -p <test_path></pre>
+
+<table>
+ <tr>
+ <th>Flag</th>
+ <th>Value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>-m, --main</code></td>
+ <td>The path to the project of the application under test, relative to the test project</td>
+ <td>
+ For example, if the application under test is in <code>source/HelloAndroid</code>, and
+ the test project is in <code>source/HelloAndroidTest</code>, then the value for
+ <code>--main</code> is <code>../HelloAndroid</code>.
+ </td>
+ </tr>
+ <tr>
+ <td><code>-p, --path</code></td>
+ <td>The of the test project.</td>
+ <td>
+ For example, if the test project is in <code>source/HelloAndroidTest</code>, then the
+ value for <code>--path</code> is <code>HelloAndroidTest</code>.
+ </td>
+ </tr>
+</table>
+<p>
+ If the operation is successful, <code>android</code> lists to STDOUT the names of the files
+ and directories it has created.
+</p>
+<h2 id="CreateTestApp">Creating a Test Package</h2>
+<p>
+ Once you have created a test project, you populate it with a test package.
+ The application does not require an {@link android.app.Activity Activity},
+ although you can define one if you wish. Although your test package can
+ combine Activities, Android test class extensions, JUnit extensions, or
+ ordinary classes, you should extend one of the Android test classes or JUnit classes,
+ because these provide the best testing features.
+</p>
+<p>
+ If you run your tests with {@link android.test.InstrumentationTestRunner}
+ (or a related test runner), then it will run all the methods in each class. You can modify
+ this behavior by using the {@link junit.framework.TestSuite TestSuite} class.
+</p>
+
+<p>
+ To create a test package, start with one of Android's test classes in the Java package
+ {@link android.test android.test}. These extend the JUnit
+ {@link junit.framework.TestCase TestCase} class. With a few exceptions, the Android test
+ classes also provide instrumentation for testing.
+</p>
+<p>
+ For test classes that extend {@link junit.framework.TestCase TestCase}, you probably want to
+ override the <code>setUp()</code> and <code>tearDown()</code> methods:
+</p>
+<ul>
+ <li>
+ <code>setUp()</code>: This method is invoked before any of the test methods in the class.
+ Use it to set up the environment for the test. You can use <code>setUp()</code>
+ to instantiate a new <code>Intent</code> object with the action <code>ACTION_MAIN</code>.
+ You can then use this intent to start the Activity under test.
+ <p class="note">
+ <strong>Note:</strong> If you override this method, call
+ <code>super.setUp()</code> as the first statement in your code.
+ </p>
+ </li>
+ <li>
+ <code>tearDown()</code>: This method is invoked after all the test methods in the class. Use
+ it to do garbage collection and re-setting before moving on to the next set of tests.
+ <p class="note"><strong>Note:</strong> If you override this method, you must call
+ <code>super.tearDown()</code> as the <em>last</em> statement in your code.</p>
+ </li>
+</ul>
+<p>
+ Another useful convention is to add the method <code>testPreConditions()</code> to your test
+ class. Use this method to test that the application under test is initialized correctly. If this
+ test fails, you know that that the initial conditions were in error. When this happens, further
+ test results are suspect, regardless of whether or not the tests succeeded.
+</p>
+<p>
+ To learn more about creating test packages, see the topic <a
+ href="{@docRoot}tools/testing/testing_android.html">Testing Fundamentals</a>,
+ which provides an overview of Android testing. If you prefer to follow a tutorial,
+ try the <a href="{@docRoot}tools/testing/activity_test.html">Activity Testing</a>
+ tutorial, which leads you through the creation of tests for an actual Android application.
+</p>
+<h2 id="RunTestsCommand">Running Tests</h2>
+<p>
+ You run tests from the command line, either with Ant or with an
+ <a href="{@docRoot}tools/help/adb.html">
+ Android Debug Bridge (adb)</a> shell.
+</p>
+<h3 id="RunTestsAnt">Quick build and run with Ant</h3>
+<p>
+ You can use Ant to run all the tests in your test project, using the target
+ <code>run-tests</code>, which is created automatically when you create a test project with
+ the <code>android</code> tool.
+</p>
+<p>
+ This target re-builds your main project and test project if necessary, installs the test
+ application to the current AVD or device, and then runs all the test classes in the test
+ application. The results are directed to <code>STDOUT</code>.
+</p>
+<p>
+ You can update an existing test project to use this feature. To do this, use the
+ <code>android</code> tool with the <code>update test-project</code> option. This is described
+ in the section <a href="#UpdateTestProject">Updating a test project</a>.
+</p>
+<h3 id="RunTestsDevice">Running tests on a device or emulator</h3>
+<p>
+ When you run tests from the command line with
+ <a href="{@docRoot}tools/help/adb.html">
+ Android Debug Bridge (adb)</a>, you get more options for choosing the tests
+ to run than with any other method. You can select individual test methods, filter tests
+ according to their annotation, or specify testing options. Since the test run is controlled
+ entirely from a command line, you can customize your testing with shell scripts in various ways.
+</p>
+<p>
+ To run a test from the command line, you run <code>adb shell</code> to start a command-line
+ shell on your device or emulator, and then in the shell run the <code>am instrument</code>
+ command. You control <code>am</code> and your tests with command-line flags.
+</p>
+<p>
+ As a shortcut, you can start an <code>adb</code> shell, call <code>am instrument</code>, and
+ specify command-line flags all on one input line. The shell opens on the device or emulator,
+ runs your tests, produces output, and then returns to the command line on your computer.
+</p>
+<p>
+ To run a test with <code>am instrument</code>:
+</p>
+<ol>
+ <li>
+ If necessary, rebuild your main application and test package.
+ </li>
+ <li>
+ Install your test package and main application Android package files
+ (<code>.apk</code> files) to your current Android device or emulator</li>
+ <li>
+ At the command line, enter:
+<pre>
+$ adb shell am instrument -w <test_package_name>/<runner_class>
+</pre>
+ <p>
+ where <code><test_package_name></code> is the Android package name of your test
+ application, and <code><runner_class></code> is the name of the Android test
+ runner class you are using. The Android package name is the value of the
+ <code>package</code> attribute of the <code>manifest</code> element in the manifest file
+ (<code>AndroidManifest.xml</code>) of your test package. The Android test runner
+ class is usually {@link android.test.InstrumentationTestRunner}.
+ </p>
+ <p>
+ Your test results appear in <code>STDOUT</code>.
+ </p>
+ </li>
+</ol>
+<p>
+ This operation starts an <code>adb</code> shell, then runs <code>am instrument</code>
+ with the specified parameters. This particular form of the command will run all of the tests
+ in your test package. You can control this behavior with flags that you pass to
+ <code>am instrument</code>. These flags are described in the next section.
+</p>
+<h2 id="AMSyntax">Using the am instrument Command</h2>
+<p>
+ The general syntax of the <code>am instrument</code> command is:
+</p>
+<pre>
+ am instrument [flags] <test_package>/<runner_class>
+</pre>
+<p>
+ The main input parameters to <code>am instrument</code> are described in the following table:
+</p>
+<table>
+ <tr>
+ <th>
+ Parameter
+ </th>
+ <th>
+ Value
+ </th>
+ <th>
+ Description
+ </th>
+ </tr>
+ <tr>
+ <td>
+ <code><test_package></code>
+ </td>
+ <td>
+ The Android package name of the test package.
+ </td>
+ <td>
+ The value of the <code>package</code> attribute of the <code>manifest</code>
+ element in the test package's manifest file.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code><runner_class></code>
+ </td>
+ <td>
+ The class name of the instrumented test runner you are using.
+ </td>
+ <td>
+ This is usually {@link android.test.InstrumentationTestRunner}.
+ </td>
+ </tr>
+</table>
+<p>
+ The flags for <code>am instrument</code> are described in the following table:
+</p>
+<table>
+ <tr>
+ <th>
+ Flag
+ </th>
+ <th>
+ Value
+ </th>
+ <th>
+ Description
+ </th>
+ </tr>
+ <tr>
+ <td>
+ <code>-w</code>
+ </td>
+ <td>
+ (none)
+ </td>
+ <td>
+ Forces <code>am instrument</code> to wait until the instrumentation terminates
+ before terminating itself. The net effect is to keep the shell open until the tests
+ have finished. This flag is not required, but if you do not use it, you will not
+ see the results of your tests.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>-r</code>
+ </td>
+ <td>
+ (none)
+ </td>
+ <td>
+ Outputs results in raw format. Use this flag when you want to collect
+ performance measurements, so that they are not formatted as test results. This flag is
+ designed for use with the flag <code>-e perf true</code> (documented in the section
+ <a href="#AMOptionsSyntax">Instrument options</a>).
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <code>-e</code>
+ </td>
+ <td>
+ <test_options>
+ </td>
+ <td>
+ Provides testing options as key-value pairs. The
+ <code>am instrument</code> tool passes these to the specified instrumentation class
+ via its <code>onCreate()</code> method. You can specify multiple occurrences of
+ <code>-e <test_options></code>. The keys and values are described in the
+ section <a href="#AMOptionsSyntax">am instrument options</a>.
+ <p>
+ The only instrumentation class that uses these key-value pairs is
+ {@link android.test.InstrumentationTestRunner} (or a subclass). Using them with
+ any other class has no effect.
+ </p>
+ </td>
+ </tr>
+</table>
+
+<h3 id="AMOptionsSyntax">am instrument options</h3>
+<p>
+ The <code>am instrument</code> tool passes testing options to
+ <code>InstrumentationTestRunner</code> or a subclass in the form of key-value pairs,
+ using the <code>-e</code> flag, with this syntax:
+</p>
+<pre>
+ -e <key> <value>
+</pre>
+<p>
+ Some keys accept multiple values. You specify multiple values in a comma-separated list.
+ For example, this invocation of <code>InstrumentationTestRunner</code> provides multiple
+ values for the <code>package</code> key:
+</p>
+<pre>
+$ adb shell am instrument -w -e package com.android.test.package1,com.android.test.package2 \
+> com.android.test/android.test.InstrumentationTestRunner
+</pre>
+<p>
+ The following table describes the key-value pairs and their result. Please review the
+ <strong>Usage Notes</strong> following the table.
+</p>
+<table>
+ <tr>
+ <th>Key</th>
+ <th>Value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>
+ <code>package</code>
+ </td>
+ <td>
+ <Java_package_name>
+ </td>
+ <td>
+ The fully-qualified <em>Java</em> package name for one of the packages in the test
+ application. Any test case class that uses this package name is executed. Notice that
+ this is not an <em>Android</em> package name; a test package has a single
+ Android package name but may have several Java packages within it.
+ </td>
+ </tr>
+ <tr>
+ <td rowspan="2"><code>class</code></td>
+ <td><class_name></td>
+ <td>
+ The fully-qualified Java class name for one of the test case classes. Only this test
+ case class is executed.
+ </td>
+ </tr>
+ <tr>
+ <td><class_name><strong>#</strong>method name</td>
+ <td>
+ A fully-qualified test case class name, and one of its methods. Only this method is
+ executed. Note the hash mark (#) between the class name and the method name.
+ </td>
+ </tr>
+ <tr>
+ <td><code>func</code></td>
+ <td><code>true</code></td>
+ <td>
+ Runs all test classes that extend {@link android.test.InstrumentationTestCase}.
+ </td>
+ </tr>
+ <tr>
+ <td><code>unit</code></td>
+ <td><code>true</code></td>
+ <td>
+ Runs all test classes that do <em>not</em> extend either
+ {@link android.test.InstrumentationTestCase} or
+ {@link android.test.PerformanceTestCase}.
+ </td>
+ </tr>
+ <tr>
+ <td><code>size</code></td>
+ <td>
+ [<code>small</code> | <code>medium</code> | <code>large</code>]
+ </td>
+ <td>
+ Runs a test method annotated by size. The annotations are <code>@SmallTest</code>,
+ <code>@MediumTest</code>, and <code>@LargeTest</code>.
+ </td>
+ </tr>
+ <tr>
+ <td><code>perf</code></td>
+ <td><code>true</code></td>
+ <td>
+ Runs all test classes that implement {@link android.test.PerformanceTestCase}.
+ When you use this option, also specify the <code>-r</code> flag for
+ <code>am instrument</code>, so that the output is kept in raw format and not
+ re-formatted as test results.
+ </td>
+ </tr>
+ <tr>
+ <td><code>debug</code></td>
+ <td><code>true</code></td>
+ <td>
+ Runs tests in debug mode.
+ </td>
+ </tr>
+ <tr>
+ <td><code>log</code></td>
+ <td><code>true</code></td>
+ <td>
+ Loads and logs all specified tests, but does not run them. The test
+ information appears in <code>STDOUT</code>. Use this to verify combinations of other
+ filters and test specifications.
+ </td>
+ </tr>
+ <tr>
+ <td><code>emma</code></td>
+ <td><code>true</code></td>
+ <td>
+ Runs an EMMA code coverage analysis and writes the output to
+ <code>/data//coverage.ec</code> on the device. To override the file location, use the
+ <code>coverageFile</code> key that is described in the following entry.
+ <p class="note">
+ <strong>Note:</strong> This option requires an EMMA-instrumented build of the test
+ application, which you can generate with the <code>coverage</code> target.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td><code>coverageFile</code></td>
+ <td><code><filename></code></td>
+ <td>
+ Overrides the default location of the EMMA coverage file on the device. Specify this
+ value as a path and filename in UNIX format. The default filename is described in the
+ entry for the <code>emma</code> key.
+ </td>
+ </tr>
+</table>
+<strong><code>-e</code> Flag Usage Notes</strong>
+<ul>
+ <li>
+ <code>am instrument</code> invokes
+ {@link android.test.InstrumentationTestRunner#onCreate(Bundle)}
+ with a {@link android.os.Bundle} containing the key-value pairs.
+ </li>
+ <li>
+ The <code>package</code> key takes precedence over the <code>class</code> key. If you
+ specifiy a package, and then separately specify a class within that package, Android
+ will run all the tests in the package and ignore the <code>class</code> key.
+ </li>
+ <li>
+ The <code>func</code> key and <code>unit</code> key are mutually exclusive.
+ </li>
+</ul>
+<h3 id="RunTestExamples">Usage examples</h3>
+<p>
+The following sections provide examples of using <code>am instrument</code> to run tests.
+They are based on the following structure:</p>
+<ul>
+ <li>
+ The test package has the Android package name <code>com.android.demo.app.tests</code>
+ </li>
+ <li>
+ There are three test classes:
+ <ul>
+ <li>
+ <code>UnitTests</code>, which contains the methods
+ <code>testPermissions</code> and <code>testSaveState</code>.
+ </li>
+ <li>
+ <code>FunctionTests</code>, which contains the methods
+ <code>testCamera</code>, <code>testXVGA</code>, and <code>testHardKeyboard</code>.
+ </li>
+ <li>
+ <code>IntegrationTests</code>,
+ which contains the method <code>testActivityProvider</code>.
+ </li>
+ </ul>
+ </li>
+ <li>
+ The test runner is {@link android.test.InstrumentationTestRunner}.
+ </li>
+</ul>
+<h4>Running the entire test package</h4>
+<p>
+ To run all of the test classes in the test package, enter:
+</p>
+<pre>
+$ adb shell am instrument -w com.android.demo.app.tests/android.test.InstrumentationTestRunner
+</pre>
+<h4>Running all tests in a test case class</h4>
+<p>
+ To run all of the tests in the class <code>UnitTests</code>, enter:
+</p>
+<pre>
+$ adb shell am instrument -w \
+> -e class com.android.demo.app.tests.UnitTests \
+> com.android.demo.app.tests/android.test.InstrumentationTestRunner
+</pre>
+<p>
+ <code>am instrument</code> gets the value of the <code>-e</code> flag, detects the
+ <code>class</code> keyword, and runs all the methods in the <code>UnitTests</code> class.
+</p>
+<h4>Selecting a subset of tests</h4>
+<p>
+ To run all of the tests in <code>UnitTests</code>, and the <code>testCamera</code> method in
+ <code>FunctionTests</code>, enter:
+</p>
+<pre>
+$ adb shell am instrument -w \
+> -e class com.android.demo.app.tests.UnitTests,com.android.demo.app.tests.FunctionTests#testCamera \
+> com.android.demo.app.tests/android.test.InstrumentationTestRunner
+</pre>
+<p>
+ You can find more examples of the command in the documentation for
+ {@link android.test.InstrumentationTestRunner}.
+</p>
diff --git a/docs/html/tools/testing/what_to_test.jd b/docs/html/tools/testing/what_to_test.jd
new file mode 100644
index 0000000..77ae211
--- /dev/null
+++ b/docs/html/tools/testing/what_to_test.jd
@@ -0,0 +1,86 @@
+page.title=What To Test
+parent.title=Testing
+parent.link=index.html
+@jd:body
+<p>
+ As you develop Android applications, knowing what to test is as important as knowing how to
+ test. This document lists some most common Android-related situations that you should consider
+ when you test, even at the unit test level. This is not an exhaustive list, and you consult the
+ documentation for the features that you use for more ideas. The
+ <a href="http://groups.google.com/group/android-developers">android-developers</a> Google Groups
+ site is another resource for information about testing.
+</p>
+<h2 id="Tests">Ideas for Testing</h2>
+<p>
+ The following sections are organized by behaviors or situations that you should test. Each
+ section contains a scenario that further illustrates the situation and the test or tests you
+ should do.
+</p>
+<h4>Change in orientation</h4>
+<p>
+ For devices that support multiple orientations, Android detects a change in orientation when
+ the user turns the device so that the display is "landscape" (long edge is horizontal) instead
+ of "portrait" (long edge is vertical).
+</p>
+<p>
+ When Android detects a change in orientation, its default behavior is to destroy and then
+ re-start the foreground Activity. You should consider testing the following:
+</p>
+<ul>
+ <li>
+ Is the screen re-drawn correctly? Any custom UI code you have should handle changes in the
+ orientation.
+ </li>
+ <li>
+ Does the application maintain its state? The Activity should not lose anything that the
+ user has already entered into the UI. The application should not "forget" its place in the
+ current transaction.
+ </li>
+</ul>
+<h4>Change in configuration</h4>
+<p>
+ A situation that is more general than a change in orientation is a change in the device's
+ configuration, such as a change in the availability of a keyboard or a change in system
+ language.
+</p>
+<p>
+ A change in configuration also triggers the default behavior of destroying and then restarting
+ the foreground Activity. Besides testing that the application maintains the UI and its
+ transaction state, you should also test that the application updates itself to respond
+ correctly to the new configuration.
+</p>
+<h4>Battery life</h4>
+<p>
+ Mobile devices primarily run on battery power. A device has finite "battery budget", and when it
+ is gone, the device is useless until it is recharged. You need to write your application to
+ minimize battery usage, you need to test its battery performance, and you need to test the
+ methods that manage battery usage.
+</p>
+<p>
+ Techniques for minimizing battery usage were presented at the 2010 Google I/O conference in the
+ presentation
+ <a href="http://code.google.com/events/io/2009/sessions/CodingLifeBatteryLife.html">
+ Coding for Life -- Battery Life, That Is</a>. This presentation describes the impact on battery
+ life of various operations, and the ways you can design your application to minimize these
+ impacts. When you code your application to reduce battery usage, you also write the
+ appropriate unit tests.
+</p>
+<h4>Dependence on external resources</h4>
+<p>
+ If your application depends on network access, SMS, Bluetooth, or GPS, then you should
+ test what happens when the resource or resources are not available.
+</p>
+<p>
+ For example, if your application uses the network,it can notify the user if access is
+ unavailable, or disable network-related features, or do both. For GPS, it can switch to
+ IP-based location awareness. It can also wait for WiFi access before doing large data transfers,
+ since WiFi transfers maximize battery usage compared to transfers over 3G or EDGE.
+</p>
+<p>
+ You can use the emulator to test network access and bandwidth. To learn more, please see
+ <a href="{@docRoot}tools/help/emulator.html#netspeed">Network Speed Emulation</a>.
+ To test GPS, you can use the emulator console and {@link android.location.LocationManager}. To
+ learn more about the emulator console, please see
+ <a href="{@docRoot}tools/help/emulator.html#console">
+ Using the Emulator Console</a>.
+</p>
diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs
new file mode 100644
index 0000000..27fbd2d
--- /dev/null
+++ b/docs/html/tools/tools_toc.cs
@@ -0,0 +1,214 @@
+<ul id="nav">
+
+ <li class="nav-section">
+ <div class="nav-section-header empty">
+ <a href="<?cs var:toroot ?>tools/index.html"><span class="en">Developer Tools</span></a>
+ </div>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot
+?>sdk/index.html"><span class="en">Download</span></a></div>
+ <ul>
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>sdk/installing/index.html"><span class="en">Installing
+ the SDK</span></a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>sdk/installing/adding-packages.html">
+ <span class="en">Adding Platforms and Packages</span></a></li>
+ <li><a href="<?cs var:toroot ?>sdk/installing/installing-adt.html">
+ <span class="en">Installing the Eclipse Plugin</span></a></li>
+ <li><a href="<?cs var:toroot ?>sdk/installing/next.html">
+ <span class="en">Next Steps</span></a></li>
+ </ul>
+ </li>
+ <li><a href="<?cs var:toroot ?>sdk/exploring.html">
+ <span class="en">Exploring the SDK</span></a></li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="/tools/workflow/index.html"><span class="en">Workflow</span></a>
+ </div>
+ <ul>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="/tools/devices/index.html"><span class="en">Setting Up Virtual Devices</span></a></div>
+ <ul>
+ <li><a href="/tools/devices/managing-avds.html"><span class="en">With AVD Manager</span></a></li>
+ <li><a href="/tools/devices/managing-avds-cmdline.html"><span class="en">From the Command Line</span></a></li>
+ <li><a href="/tools/devices/emulator.html"><span class="en">Using the Android Emulator</span></a></li>
+ </ul>
+ </li>
+ <li><a href="/tools/device.html"><span class="en">Using Hardware Devices</span></a></li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="/tools/projects/index.html"><span class="en">Setting Up Projects</span></a></div>
+ <ul>
+ <li><a href="/tools/projects/projects-eclipse.html"><span class="en">From Eclipse with ADT</span></a></li>
+ <li><a href="/tools/projects/projects-cmdline.html"><span class="en">From the Command Line</span></a></li>
+ </ul>
+ </li>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="/tools/building/index.html"><span class="en">Building and Running</span></a></div>
+ <ul>
+ <li><a href="/tools/building/building-eclipse.html"><span class="en">From Eclipse with ADT</span></a></li>
+ <li><a href="/tools/building/building-cmdline.html"><span class="en">From the Command Line</span></a></li>
+ </ul>
+ </li>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot?>tools/testing/index.html">
+ <span class="en">Testing</span>
+ </a></div>
+ <ul>
+ <li>
+ <a href="<?cs var:toroot?>tools/testing/testing_android.html">
+ <span class="en">Fundamentals</span></a>
+ </li>
+ <li><a href="<?cs var:toroot ?>tools/testing/testing_eclipse.html">
+ <span class="en">From Eclipse</span></a>
+ </li>
+ <li><a href="<?cs var:toroot ?>tools/testing/testing_otheride.html">
+ <span class="en">From Other IDEs</span></a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot?>tools/testing/activity_testing.html">
+ <span class="en">Activity Testing</span></a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot?>tools/testing/service_testing.html">
+ <span class="en">Service Testing</span></a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot?>tools/testing/contentprovider_testing.html">
+ <span class="en">Content Provider Testing</span></a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot ?>tools/testing/what_to_test.html">
+ <span class="en">What To Test</span></a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot ?>tools/testing/activity_test.html">
+ <span class="en">Activity Testing Tutorial</span></a>
+ </li>
+ </ul>
+ </li><!-- end of testing -->
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/debugging/index.html"><span class="en">Debugging</span></a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>tools/debugging/debugging-projects.html"><span class="en">From Eclipse with ADT</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/debugging/debugging-projects-cmdline.html"><span class="en">From Other IDEs</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/debugging/ddms.html"><span class="en">Using DDMS</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/debugging/debugging-log.html"><span class="en">Reading and Writing Logs</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/debugging/debugging-ui.html"><span class="en">Optimizing your UI</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/debugging/debugging-tracing.html"><span class="en">Profiling with Traceview and dmtracedump</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/debugging/debugging-devtools.html"><span class="en">Using the Dev Tools App</span></a></li>
+ </ul>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/publishing/publishing_overview.html"><span class="en">Publishing</span></a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>tools/publishing/preparing.html"><span class="en">Preparing for Release</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/publishing/versioning.html"><span class="en">Versioning Your Apps</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/publishing/app-signing.html"><span class="en">Signing Your Apps</span></a></li>
+ </ul>
+ </li>
+</ul>
+</li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/help/index.html"><span
+class="en">Tools Help</span></a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>tools/help/adb.html">adb</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/adt.html">ADT</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/android.html">android</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/bmgr.html">bmgr</a>
+ <li><a href="<?cs var:toroot ?>tools/help/dmtracedump.html">dmtracedump</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/draw9patch.html">Draw 9-Patch</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/emulator.html">Emulator</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/etc1tool.html">etc1tool</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/hierarchy-viewer.html">Hierarchy Viewer</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/hprof-conv.html">hprof-conv</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/layoutopt.html">layoutopt</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/logcat.html">logcat</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/mksdcard.html">mksdcard</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/monkey.html">monkey</a></li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot
+?>tools/help/monkeyrunner_concepts.html"><span class="en">monkeyrunner</span></a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>tools/help/MonkeyDevice.html"><span
+class="en">MonkeyDevice</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/MonkeyImage.html"><span
+class="en">MonkeyImage</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/MonkeyRunner.html"><span
+class="en">MonkeyRunner</span></a></li>
+ </ul>
+ </li>
+ <li><a href="<?cs var:toroot ?>tools/help/proguard.html">ProGuard</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/traceview.html">Traceview</a></li>
+ <li><a href="<?cs var:toroot ?>tools/help/zipalign.html">zipalign</a></li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot
+?>tools/revisions/index.html"><span class="en">Revisions</span></a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>tools/sdk/tools-notes.html">
+ <span class="en">Tools</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>tools/sdk/eclipse-adt.html">
+ <span class="en">ADT Plugin</span>
+ </a></li>
+ <!--
+ <li><a href="<?cs var:toroot ?>tools/sdk/addons.html"><span class="en">Add-ons</span></a></li>
+ -->
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>tools/sdk/ndk/index.html">
+ <span class="en">NDK</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>tools/sdk/ndk/overview.html">What is the NDK?</a></li>
+ </ul>
+ </li>
+ <li><a href="<?cs var:toroot ?>tools/revisions/platforms.html"><span
+class="en">Platforms</span></a></li>
+ </ul>
+ </li>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot
+?>tools/extras/index.html"><span class="en">Extras</span></a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>tools/extras/support-library.html"><span class="en">Support
+Library</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/extras/oem-usb.html"><span
+class="en">USB Drivers</span></a>
+ </li>
+ </ul>
+ </li>
+
+
+
+ <li class="nav-section">
+ <div class="nav-section-header empty"><a href="<?cs var:toroot
+?>tools/samples/index.html"><span class="en">Samples</span></a></div>
+ </li>
+
+
+</ul><!-- nav -->
+
+<script type="text/javascript">
+<!--
+ buildToggleLists();
+ changeNavLang(getLangPref());
+//-->
+</script>
diff --git a/docs/html/tools/workflow.jd b/docs/html/tools/workflow.jd
new file mode 100644
index 0000000..4eb5ada
--- /dev/null
+++ b/docs/html/tools/workflow.jd
@@ -0,0 +1,150 @@
+page.title=Introduction
+@jd:body
+
+<p>Developing applications for Android devices is facilitated by a group of tools that are
+ provided with the SDK. You can access these tools through an Eclipse plugin called ADT (Android
+ Development Tools) or from the command line. Developing with Eclipse is the preferred method because
+ it can directly invoke the tools that you need while developing applications.</p>
+
+ <p>However, you may choose to develop with another IDE or a simple text editor and invoke the
+ tools on the command line or with scripts. This is a less streamlined way to develop because you
+ will sometimes have to call command line tools manually, but you will have access to the same
+ number of features that you would have in Eclipse.</p>
+
+<div class="figure" style="width:461px">
+ <img src="{@docRoot}images/developing/developing_overview.png"
+ alt="Development process for Android applications"
+ height="738" />
+ <p class="img-caption">
+ <strong>Figure 1.</strong> The development process for Android applications.
+ </p>
+</div>
+
+<p>The basic steps for developing applications (with or without Eclipse) are shown in figure 1. The
+development steps encompass four development phases, which include:</p>
+
+<ul>
+ <li><strong>Setup</strong>
+ <p>During this phase you install and set up your development environment. You also create
+ Android Virtual Devices (AVDs) and connect hardware devices on which you can install your
+ applications.</p>
+ <p>See <a href="{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>
+ and <a href="{@docRoot}tools/device.html">Using Hardware Devices</a> for more
+ information.
+ </li>
+ <li><strong>Development</strong>
+ <p>During this phase you set up and develop your Android project, which contains all of the
+ source code and resource files for your application. For more informations, see
+ <a href="{@docRoot}tools/projects/index.html">Create an Android project</a>.</p>
+ </li>
+ <li><strong>Debugging and Testing</strong>
+ <p>During this phase you build your project into a debuggable <code>.apk</code> package that you
+ can install and run on the emulator or an Android-powered device. If you are using Eclipse,
+ builds are generated each time you project is saved. If you're using another IDE,
+ you can build your project using Ant and install it on a device using
+ <a href="{@docRoot}tools/help/adb.html">adb</a>. For more information, see
+ <a href="{@docRoot}tools/building/index.html">Build and run your application</a>.</p>
+ <p>Next, you debug your application using a JDWP-compliant debugger along with the debugging
+ and logging tools that are provided with the Android SDK. Eclipse already comes packaged with
+ a compatible debugger. For more information see,
+ <a href="{@docRoot}tools/debugging/index.html">Debug your application with the
+ SDK debugging and logging tools</a>.</p>
+ <p>Last, you test your application using various Android SDK testing tools. For more
+ information, see <a href="{@docRoot}tools/testing/index.html">Test your application
+ with the Testing and Instrumentation framework</a>.</p>
+ </li>
+ <li><strong>Publishing</strong>
+ <p>During this phase you configure and build your application for release and distribute your
+ application to users. For more information, see
+ <a href="{@docRoot}tools/publishing/publishing_overview.html">Publishing Overview</a>.</p>
+ </li>
+</ul>
+
+<h2 id="EssentialTools">Essential command line tools</h2>
+
+ <p>When developing in IDEs or editors other than Eclipse, be familiar with
+ all of the tools below, because you will have to run them from the command line.</p>
+
+ <dl>
+ <dt><a href="{@docRoot}tools/help/android.html">android</a></dt>
+
+ <dd>Create and update Android projects and create, move, and delete AVDs.</dd>
+
+ <dt><a href="{@docRoot}tools/devices/emulator.html">Android Emulator</a></dt>
+
+ <dd>Run your Android applications on an emulated Android platform.</dd>
+
+ <dt><a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a></dt>
+
+ <dd>Interface with your emulator or connected device (install apps, shell the device, issue
+ commands, etc.).</dd>
+ </dl>
+
+ <p>In addition to the above tools that are included with the SDK, you need the following open
+ source and third-party tools:</p>
+
+ <dl>
+ <dt>Ant</dt>
+
+ <dd>To compile and build your Android project into an installable .apk file.</dd>
+
+ <dt>Keytool</dt>
+
+ <dd>To generate a keystore and private key, used to sign your .apk file. Keytool is part of the
+ JDK.</dd>
+
+ <dt>Jarsigner (or similar signing tool)</dt>
+
+ <dd>To sign your .apk file with a private key generated by Keytool. Jarsigner is part of the
+ JDK.</dd>
+ </dl>
+
+ <p>If you are using Eclipse and ADT, tools such as <code>adb</code> and <code>android</code>
+ are automatically called by Eclipse and ADT so you don't have to manually invoke these tools.
+ You need to be familiar with <code>adb</code>, however, because certain functions are not
+accessible from
+ Eclipse, such as the <code>adb</code> shell commands. You might also need to call Keytool and
+Jarsigner to
+ sign your applications, but you can set up Eclipse to do this automatically as well.</p>
+
+<p>For more information on the tools provided with the Android SDK, see the
+ <a href="{@docRoot}tools/index.html">Tools</a> section of the documentation.</p>
+
+<h2 id="ThirdParty">Other Third-Party Development Tools</h2>
+<p>
+ The tools described in this section are not developed by the Android SDK team. The Android Dev Guide
+ does not provide documentation for these tools. Please refer to the linked documents in each
+ section for documentation.
+</p>
+<h3 id="IntelliJ">Developing in IntelliJ IDEA</h3>
+<div style="float: right">
+<img alt="The IntelliJ graphical user interface" height="500px"
+src="{@docRoot}images/developing/intellijidea_android_ide.png"/>
+</div>
+<p>
+ IntelliJ IDEA is a powerful Java IDE from JetBrains that provides
+ full-cycle Android development support in both the free Community
+ Edition and the Ultimate edition.
+</p>
+<p>
+ The IDE ensures compatibility with the latest Android SDK and offers a
+ smart code editor with completion, quick navigation between code and
+ resources, a graphical debugger, unit testing support using Android
+ Testing Framework, and the ability to run applications in either the
+ emulator or a USB-connected device.
+</p>
+<p>
+ <strong>Links:</strong>
+</p>
+<ul>
+ <li>
+ <a href="http://www.jetbrains.com/idea">IntelliJ IDEA official website</a>
+</li>
+ <li>
+ <a href="http://www.jetbrains.com/idea/features/google_android.html">Android support in IntelliJ IDEA</a>
+</li>
+ <li>
+ <a href="http://wiki.jetbrains.net/intellij/Android">IntelliJ IDEA Android Tutorials</a>
+ </li>
+</ul>
+
diff --git a/docs/html/tools/workflow/app-signing.jd b/docs/html/tools/workflow/app-signing.jd
new file mode 100644
index 0000000..ac45242
--- /dev/null
+++ b/docs/html/tools/workflow/app-signing.jd
@@ -0,0 +1,618 @@
+page.title=Signing Your Applications
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Quickview</h2>
+
+<ul>
+<li>All Android apps <em>must</em> be signed</li>
+<li>You can sign with a self-signed key</li>
+<li>How you sign your apps is critical — read this document carefully</li>
+<li>Determine your signing strategy early in the development process</li>
+</ul>
+
+<h2>In this document</h2>
+
+<ol>
+<li><a href="#signing">Signing Process</a></li>
+<li><a href="#strategies">Signing Strategies</a></li>
+<li><a href="#setup">Basic Setup for Signing</a></li>
+<li><a href="#debugmode">Signing in Debug Mode</a></li>
+<li><a href="#releasemode">Signing Release Mode</a>
+ <ol>
+ <li><a href="#cert">Obtain a suitable private key</a></li>
+ <li><a href="#releasecompile">Compile the application in release mode</a></li>
+ <li><a href="#signapp">Sign your application with your private key</a></li>
+ <li><a href="#align">Align the final APK package</a></li>
+ <li><a href="#ExportWizard">Compile and sign with Eclipse ADT</a></li>
+ </ol>
+</li>
+<li><a href="#secure-key">Securing Your Private Key</a></li>
+
+</ol>
+
+<h2>See also</h2>
+
+<ol>
+<li><a href="{@docRoot}tools/publishing/versioning.html">Versioning Your Applications</a></li>
+<li><a href="{@docRoot}tools/publishing/preparing.html">Preparing to Publish</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>The Android system requires that all installed applications be digitally signed with a
+certificate whose private key is held by the application's developer. The Android system uses the
+certificate as a means of identifying the author of an application and establishing trust
+relationships between applications. The certificate is not used to control which applications the
+user can install. The certificate does not need to be signed by a certificate authority: it is
+perfectly allowable, and typical, for Android applications to use self-signed certificates.</p>
+
+<p>The important points to understand about signing Android applications are:</p>
+
+<ul>
+ <li>All applications <em>must</em> be signed. The system will not install an application
+on an emulator or a device if it is not signed.</li>
+ <li>To test and debug your application, the build tools sign your application with a special debug
+ key that is created by the Android SDK build tools.</li>
+ <li>When you are ready to release your application for end-users, you must sign it with a suitable
+ private key. You cannot publish an application that is signed with the debug key generated
+ by the SDK tools.</li>
+ <li>You can use self-signed certificates to sign your applications. No certificate authority is
+ needed.</li>
+ <li>The system tests a signer certificate's expiration date only at install time. If an
+application's signer certificate expires after the application is installed, the application
+will continue to function normally.</li>
+ <li>You can use standard tools — Keytool and Jarsigner — to generate keys and
+sign your application {@code .apk} files.</li>
+ <li>After you sign your application for release, we recommend that you use the
+ <code>zipalign</code> tool to optimize the final APK package.</li>
+</ul>
+
+<p>The Android system will not install or run an application that is not signed appropriately. This
+applies wherever the Android system is run, whether on an actual device or on the emulator.
+For this reason, you must <a href="#setup">set up signing</a> for your application before you can
+run it or debug it on an emulator or device.</p>
+
+<h2 id="signing">Signing Process</h3>
+
+<p>The Android build process signs your application differently depending on which build mode you
+use to build your application. There are two build modes: <em>debug mode</em> and <em>release
+mode</em>. You use debug mode when you are developing and testing your application. You use
+release mode when you want to build a release version of your application that you can
+distribute directly to users or publish on an application marketplace such as Google Play.</p>
+
+<p>When you build in <em>debug mode</em> the Android SDK build tools use the Keytool utility
+(included in the JDK) to create a debug key. Because the SDK build tools created the debug key,
+they know the debug key's alias and password. Each time you compile your application in debug mode,
+the build tools use the debug key along with the Jarsigner utility (also included in the JDK) to
+sign your application's <code>.apk</code> file. Because the alias and password are known to the SDK
+build tools, the tools don't need to prompt you for the debug key's alias and password each time
+you compile.</p>
+
+<p>When you build in <em>release mode</em> you use your own private key to sign your application. If
+you don't have a private key, you can use the Keytool utility to create one for you. When you
+compile your application in release mode, the build tools use your private key along with the
+Jarsigner utility to sign your application's <code>.apk</code> file. Because the certificate and
+private key you use are your own, you will have to provide the password for the keystore and key
+alias.</p>
+
+<p>The debug signing process happens automatically when you run or debug your application using
+Eclipse with the ADT plugin. Debug signing also happens automatically when you use the Ant build
+script with the <code>debug</code> option. You can automate the release signing process by using the
+Eclipse Export Wizard or by modifying the Ant build script and building with the
+<code>release</code> option.</p>
+
+<h2 id="strategies">Signing Strategies</h2>
+
+<p>Some aspects of application signing may affect how you approach the development
+of your application, especially if you are planning to release multiple
+applications. </p>
+
+<p>In general, the recommended strategy for all developers is to sign
+all of your applications with the same certificate, throughout the expected
+lifespan of your applications. There are several reasons why you should do so: </p>
+
+<ul>
+<li>Application upgrade – As you release updates to your application, you
+will want to continue to sign the updates with the same certificate or set of
+certificates, if you want users to upgrade seamlessly to the new version. When
+the system is installing an update to an application, it compares the
+certificate(s) in the new version with those in the existing version. If the
+certificates match exactly, including both the certificate data and order, then
+the system allows the update. If you sign the new version without using matching
+certificates, you will also need to assign a different package name to the
+application — in this case, the user installs the new version as a
+completely new application. </li>
+
+<li>Application modularity – The Android system allows applications that
+are signed by the same certificate to run in the same process, if the
+applications so requests, so that the system treats them as a single application.
+In this way you can deploy your application in modules, and users can update
+each of the modules independently if needed.</li>
+
+<li>Code/data sharing through permissions – The Android system provides
+signature-based permissions enforcement, so that an application can expose
+functionality to another application that is signed with a specified
+certificate. By signing multiple applications with the same certificate and
+using signature-based permissions checks, your applications can share code and
+data in a secure manner. </li>
+
+</ul>
+
+<p>Another important consideration in determining your signing strategy is
+how to set the validity period of the key that you will use to sign your
+applications.</p>
+
+<ul>
+<li>If you plan to support upgrades for a single application, you should ensure
+that your key has a validity period that exceeds the expected lifespan of
+that application. A validity period of 25 years or more is recommended.
+When your key's validity period expires, users will no longer be
+able to seamlessly upgrade to new versions of your application.</li>
+
+<li>If you will sign multiple distinct applications with the same key,
+you should ensure that your key's validity period exceeds the expected
+lifespan of <em>all versions of all of the applications</em>, including
+dependent applications that may be added to the suite in the future. </li>
+
+<li>If you plan to publish your application(s) on Google Play, the
+key you use to sign the application(s) must have a validity period
+ending after 22 October 2033. Google Play enforces this requirement
+to ensure that users can seamlessly upgrade applications when
+new versions are available. </li>
+</ul>
+
+<p>As you design your application, keep these points in mind and make sure to
+use a <a href="#cert">suitable certificate</a> to sign your applications. </p>
+
+<h2 id="setup">Basic Setup for Signing</h2>
+
+<p>Before you begin, make sure that the Keytool utility and Jarsigner utility are available to
+the SDK build tools. Both of these tools are available in the JDK. In most cases, you can tell
+the SDK build tools how to find these utilities by setting your <code>JAVA_HOME</code> environment
+variable so it references a suitable JDK. Alternatively, you can add the JDK version of Keytool and
+Jarsigner to your <code>PATH</code> variable.</p>
+
+<p>If you are developing on a version of Linux that originally came with GNU Compiler for
+Java, make sure that the system is using the JDK version of Keytool, rather than the gcj
+version. If Keytool is already in your <code>PATH</code>, it might be pointing to a symlink at
+<code>/usr/bin/keytool</code>. In this case, check the symlink target to be sure it points
+to the Keytool in the JDK.</p>
+
+<h2 id="debugmode">Signing in Debug Mode</h2>
+
+<p>The Android build tools provide a debug signing mode that makes it easier for you
+to develop and debug your application, while still meeting the Android system
+requirement for signing your APK.
+When using debug mode to build your app, the SDK tools invoke Keytool to automatically create
+a debug keystore and key. This debug key is then used to automatically sign the APK, so
+you do not need to sign the package with your own key.</p>
+
+<p>The SDK tools create the debug keystore/key with predetermined names/passwords:</p>
+<ul>
+<li>Keystore name: "debug.keystore"</li>
+<li>Keystore password: "android"</li>
+<li>Key alias: "androiddebugkey"</li>
+<li>Key password: "android"</li>
+<li>CN: "CN=Android Debug,O=Android,C=US"</li>
+</ul>
+
+<p>If necessary, you can change the location/name of the debug keystore/key or
+supply a custom debug keystore/key to use. However, any custom debug
+keystore/key must use the same keystore/key names and passwords as the default
+debug key (as described above). (To do so in Eclipse/ADT, go to
+<strong>Windows</strong> > <strong>Preferences</strong> >
+<strong>Android</strong> > <strong>Build</strong>.) </p>
+
+<p class="caution"><strong>Caution:</strong> You <em>cannot</em> release your application
+to the public when signed with the debug certificate.</p>
+
+<h3>Eclipse Users</h3>
+
+<p>If you are developing in Eclipse/ADT (and have set up Keytool and Jarsigner as described above in
+<a href="#setup">Basic Setup for Signing</a>),
+signing in debug mode is enabled by default. When you run or debug your
+application, ADT signs the {@code .apk} file with the debug certificate, runs {@code zipalign} on
+the package, then installs it on
+the selected emulator or connected device. No specific action on your part is needed,
+provided ADT has access to Keytool.</p>
+
+<h3>Ant Users</h3>
+
+<p>If you are using Ant to build your {@code .apk} file, debug signing mode
+is enabled by using the <code>debug</code> option with the <code>ant</code> command
+(assuming that you are using a <code>build.xml</code> file generated by the
+<code>android</code> tool). When you run <code>ant debug</code> to
+compile your app, the build script generates a keystore/key and signs the APK for you.
+The script then also aligns the APK with the <code>zipalign</code> tool.
+No other action on your part is needed. Read
+<a href="{@docRoot}tools/building/building-cmdline.html#DebugMode">Building and Running Apps
+on the Command Line</a> for more information.</p>
+
+
+<h3 id="debugexpiry">Expiry of the Debug Certificate</h3>
+
+<p>The self-signed certificate used to sign your application in debug mode (the default on
+Eclipse/ADT and Ant builds) will have an expiration date of 365 days from its creation date.</p>
+
+<p>When the certificate expires, you will get a build error. On Ant builds, the error
+looks like this:</p>
+
+<pre>debug:
+[echo] Packaging bin/samples-debug.apk, and signing it with a debug key...
+[exec] Debug Certificate expired on 8/4/08 3:43 PM</pre>
+
+<p>In Eclipse/ADT, you will see a similar error in the Android console.</p>
+
+<p>To fix this problem, simply delete the <code>debug.keystore</code> file.
+The default storage location for AVDs is in <code>~/.android/</code> on OS X and Linux,
+in <code>C:\Documents and Settings\<user>\.android\</code> on Windows XP, and in
+<code>C:\Users\<user>\.android\</code> on Windows Vista and Windows 7.</p>
+
+
+<p>The next time you build, the build tools will regenerate a new keystore and debug key.</p>
+
+<p>Note that, if your development machine is using a non-Gregorian locale, the build
+tools may erroneously generate an already-expired debug certificate, so that you get an
+error when trying to compile your application. For workaround information, see the
+troubleshooting topic <a href="{@docRoot}resources/faq/troubleshooting.html#signingcalendar">
+I can't compile my app because the build tools generated an expired debug
+certificate</a>. </p>
+
+
+<h2 id="releasemode">Signing in Release Mode</h2>
+
+<p>When your application is ready for release to other users, you must:</p>
+<ol>
+ <li><a href="#cert">Obtain a suitable private key</a></li>
+ <li><a href="#releasecompile">Compile the application in release mode</a></li>
+ <li><a href="#signapp">Sign your application with your private key</a></li>
+ <li><a href="#align">Align the final APK package</a></li>
+</ol>
+
+<p>If you are developing in Eclipse with the ADT plugin, you can use the Export Wizard
+to perform the compile, sign, and align procedures. The Export Wizard even allows you to
+generate a new keystore and private key in the process. So if you use Eclipse, you can
+skip to <a href="#ExportWizard">Compile and sign with Eclipse ADT</a>.</p>
+
+
+
+<h3 id="cert">1. Obtain a suitable private key</h3>
+
+<p>In preparation for signing your application, you must first ensure that
+you have a suitable private key with which to sign. A suitable private
+key is one that:</p>
+
+<ul>
+<li>Is in your possession</li>
+<li>Represents the personal, corporate, or organizational entity to be identified
+with the application</li>
+<li>Has a validity period that exceeds the expected lifespan of the application
+or application suite. A validity period of more than 25 years is recommended.
+<p>If you plan to publish your application(s) on Google Play, note that a
+validity period ending after 22 October 2033 is a requirement. You can not upload an
+application if it is signed with a key whose validity expires before that date.
+</p></li>
+<li>Is not the debug key generated by the Android SDK tools. </li>
+</ul>
+
+<p>The key may be self-signed. If you do not have a suitable key, you must
+generate one using Keytool. Make sure that you have Keytool available, as described
+in <a href="#setup">Basic Setup</a>.</p>
+
+<p>To generate a self-signed key with Keytool, use the <code>keytool</code>
+command and pass any of the options listed below (and any others, as
+needed). </p>
+
+<p class="warning"><strong>Warning:</strong> Keep your private key secure.
+Before you run Keytool, make sure to read
+<a href="#secure-key">Securing Your Private Key</a> for a discussion of how to keep
+your key secure and why doing so is critically important to you and to users. In
+particular, when you are generating your key, you should select strong passwords
+for both the keystore and key.</p>
+
+<table>
+<tr>
+<th>Keytool Option</th>
+<th>Description</th>
+</tr>
+<tr>
+<td><code>-genkey</code></td><td>Generate a key pair (public and private
+keys)</td>
+</tr>
+<tr>
+<td><code>-v</code></td><td>Enable verbose output.</td>
+</tr>
+<tr>
+<td><code>-alias <alias_name></code></td><td>An alias for the key. Only
+the first 8 characters of the alias are used.</td>
+</tr>
+<tr>
+<td><code>-keyalg <alg></code></td><td>The encryption algorithm to use
+when generating the key. Both DSA and RSA are supported.</td>
+</tr>
+<tr>
+<td><code>-keysize <size></code></td><td>The size of each generated key
+(bits). If not supplied, Keytool uses a default key size of 1024 bits. In
+general, we recommend using a key size of 2048 bits or higher. </td>
+</tr>
+<tr>
+<td><code>-dname <name></code></td><td><p>A Distinguished Name that describes
+who created the key. The value is used as the issuer and subject fields in the
+self-signed certificate. </p><p>Note that you do not need to specify this option
+in the command line. If not supplied, Jarsigner prompts you to enter each
+of the Distinguished Name fields (CN, OU, and so on).</p></td>
+</tr>
+<tr>
+<td><code>-keypass <password></code></td><td><p>The password for the
+key.</p> <p>As a security precaution, do not include this option in your command
+line. If not supplied, Keytool prompts you to enter the password. In this way,
+your password is not stored in your shell history.</p></td>
+</tr>
+<tr>
+<td><code>-validity <valdays></code></td><td><p>The validity period for the
+key, in days. </p><p><strong>Note:</strong> A value of 10000 or greater is recommended.</p></td>
+</tr>
+<tr>
+<td><code>-keystore <keystore-name>.keystore</code></td><td>A name
+for the keystore containing the private key.</td>
+</tr>
+<tr>
+<td><code>-storepass <password></code></td><td><p>A password for the
+keystore.</p><p>As a security precaution, do not include this option in your
+command line. If not supplied, Keytool prompts you to enter the password. In
+this way, your password is not stored in your shell history.</p></td>
+</tr>
+</table>
+
+<p>Here's an example of a Keytool command that generates a private key:</p>
+
+<pre>$ keytool -genkey -v -keystore my-release-key.keystore
+-alias alias_name -keyalg RSA -keysize 2048 -validity 10000</pre>
+
+<p>Running the example command above, Keytool prompts you to provide
+passwords for the keystore and key, and to provide the Distinguished
+Name fields for your key. It then generates the keystore as a file called
+<code>my-release-key.keystore</code>. The keystore and key are
+protected by the passwords you entered. The keystore contains
+a single key, valid for 10000 days. The alias is a name that you —
+will use later, to refer to this keystore when signing your application. </p>
+
+<p>For more information about Keytool, see the documentation at
+<a
+href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html">
+http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html</a></p>
+
+
+
+<h3 id="releasecompile">2. Compile the application in release mode</h3>
+
+<p>In order to release your application to users, you must compile it in release mode.
+In release mode, the compiled application is not signed by default and you will need
+to sign it with your private key.</p>
+
+<p class="caution"><strong>Caution:</strong>
+You can not release your application unsigned, or signed with the debug key.</p>
+
+<h4>With Eclipse</h4>
+
+<p>To export an <em>unsigned</em> APK from Eclipse, right-click the project in the Package
+Explorer and select <strong>Android Tools</strong> > <strong>Export Unsigned Application
+Package</strong>. Then specify the file location for the unsigned APK.
+(Alternatively, open your <code>AndroidManifest.xml</code> file in Eclipse, select
+the <strong>Manifest</strong> tab, and click <strong>Export an unsigned APK</strong>.)</p>
+
+<p>Note that you can combine the compiling and signing steps with the Export Wizard. See
+<a href="#ExportWizard">Compiling and signing with Eclipse ADT</a>.</p>
+
+<h4>With Ant</h4>
+
+<p>If you are using Ant, you can enable release mode by using the <code>release</code> option
+with the <code>ant</code> command. For example, if you are running Ant from the
+directory containing your {@code build.xml} file, the command would look like this:</p>
+
+<pre>$ ant release</pre>
+
+<p>By default, the build script compiles the application APK without signing it. The output file
+in your project {@code bin/} will be <code><em><your_project_name></em>-unsigned.apk</code>.
+Because the application APK is still unsigned, you must manually sign it with your private
+key and then align it using {@code zipalign}.</p>
+
+<p>However, the Ant build script can also perform the signing
+and aligning for you, if you have provided the path to your keystore and the name of
+your key alias in the project's {@code ant.properties} file. With this information provided,
+the build script will prompt you for your keystore and alias password when you perform
+<code>ant release</code>, it will sign the package and then align it. The final output
+file in {@code bin/} will instead be
+<code><em><your_project_name></em>-release.apk</code>. With these steps
+automated for you, you're able to skip the manual procedures below (steps 3 and 4).
+To learn how to specify your keystore and alias in the {@code ant.properties} file,
+see <a href="{@docRoot}tools/building/building-cmdline.html#ReleaseMode">
+Building and Running Apps on the Command Line</a>.</p>
+
+
+
+<h3 id="signapp">3. Sign your application with your private key</h3>
+
+<p>When you have an application package that is ready to be signed, you can do sign it
+using the Jarsigner tool. Make sure that you have Jarsigner available on your
+machine, as described in <a href="#setup">Basic Setup</a>. Also, make sure that
+the keystore containing your private key is available.</p>
+
+<p>To sign your application, you run Jarsigner, referencing both the
+application's APK and the keystore containing the private key with which to
+sign the APK. The table below shows the options you could use. </p>
+
+<table>
+<tr>
+<th>Jarsigner Option</th>
+<th>Description</th>
+</tr>
+<tr>
+<td><code>-keystore <keystore-name>.keystore</code></td><td>The name of
+the keystore containing your private key.</td>
+</tr>
+<tr>
+<td><code>-verbose</code></td><td>Enable verbose output.</td>
+</tr>
+<tr>
+<td><code>-sigalg</code></td><td>The name of the signature algorithim to use in signing the APK.
+Use the value {@code MD5withRSA}.</td>
+</tr>
+<tr>
+<td><code>-digestalg</code></td><td>The message digest algorithim to use in processing the entries
+of an APK. Use the value {@code SHA1}.</td>
+</tr>
+<tr>
+<td><code>-storepass <password></code></td><td><p>The password for the
+keystore. </p><p>As a security precaution, do not include this option
+in your command line unless you are working at a secure computer.
+If not supplied, Jarsigner prompts you to enter the password. In this
+way, your password is not stored in your shell history.</p></td>
+</tr>
+<tr>
+<td><code>-keypass <password></code></td><td><p>The password for the private
+key. </p><p>As a security precaution, do not include this option
+in your command line unless you are working at a secure computer.
+If not supplied, Jarsigner prompts you to enter the password. In this
+way, your password is not stored in your shell history.</p></td>
+</tr>
+</table>
+
+<p>Here's how you would use Jarsigner to sign an application package called
+<code>my_application.apk</code>, using the example keystore created above.
+</p>
+
+<pre>$ jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore my-release-key.keystore
+my_application.apk alias_name</pre>
+
+<p>Running the example command above, Jarsigner prompts you to provide
+passwords for the keystore and key. It then modifies the APK
+in-place, meaning the APK is now signed. Note that you can sign an
+APK multiple times with different keys.</p>
+
+<p class="caution"><strong>Caution:</strong> As of JDK 7, the default signing algorithim has
+changed, requiring you to specify the signature and digest algorithims ({@code -sigalg} and {@code
+-digestalg}) when you sign an APK.</p>
+
+<p>To verify that your APK is signed, you can use a command like this:</p>
+
+<pre>$ jarsigner -verify my_signed.apk</pre>
+
+<p>If the APK is signed properly, Jarsigner prints "jar verified".
+If you want more details, you can try one of these commands:</p>
+
+<pre>$ jarsigner -verify -verbose my_application.apk</pre>
+
+<p>or</p>
+
+<pre>$ jarsigner -verify -verbose -certs my_application.apk</pre>
+
+<p>The command above, with the <code>-certs</code> option added, will show you the
+"CN=" line that describes who created the key.</p>
+
+<p class="note"><strong>Note:</strong> If you see "CN=Android Debug", this means the APK was
+signed with the debug key generated by the Android SDK. If you intend to release
+your application, you must sign it with your private key instead of the debug
+key.</p>
+
+<p>For more information about Jarsigner, see the documentation at
+<a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html">
+http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html</a></p>
+
+
+<h3 id="align">4. Align the final APK package</h3>
+
+<p>Once you have signed the APK with your private key, run <code>zipalign</code> on the file.
+This tool ensures that all uncompressed data starts with a particular byte alignment,
+relative to the start of the file. Ensuring alignment at 4-byte boundaries provides
+a performance optimization when installed on a device. When aligned, the Android
+system is able to read files with {@code mmap()}, even if
+they contain binary data with alignment restrictions, rather than copying all
+of the data from the package. The benefit is a reduction in the amount of
+RAM consumed by the running application.</p>
+
+<p>The <code>zipalign</code> tool is provided with the Android SDK, inside the
+<code>tools/</code> directory. To align your signed APK, execute:</p>
+
+<pre>$ zipalign -v 4 <em>your_project_name</em>-unaligned.apk <em>your_project_name</em>.apk</pre>
+
+<p>The {@code -v} flag turns on verbose output (optional). {@code 4} is the
+byte-alignment (don't use anything other than 4). The first file argument is
+your signed {@code .apk} file (the input) and the second file is the destination {@code .apk} file
+(the output). If you're overriding an existing APK, add the {@code -f} flag.</p>
+
+<p class="caution"><strong>Caution:</strong> Your input APK must be signed with your
+private key <strong>before</strong> you optimize the package with {@code zipalign}.
+If you sign it after using {@code zipalign}, it will undo the alignment.</p>
+
+<p>For more information, read about the
+<a href="{@docRoot}tools/help/zipalign.html">zipalign</a> tool.
+
+
+<h3 id="ExportWizard">Compile and sign with Eclipse ADT</h3>
+
+<p>If you are using Eclipse with the ADT plugin, you can use the Export Wizard to
+export a <em>signed</em> APK (and even create a new keystore,
+if necessary). The Export Wizard performs all the interaction with
+the Keytool and Jarsigner for you, which allows you to sign the package using a GUI
+instead of performing the manual procedures to compile, sign,
+and align, as discussed above. Once the wizard has compiled and signed your package,
+it will also perfom package alignment with {@code zipalign}.
+Because the Export Wizard uses both Keytool and Jarsigner, you should
+ensure that they are accessible on your computer, as described above
+in the <a href="#setup">Basic Setup for Signing</a>.</p>
+
+<p>To create a signed and aligned APK in Eclipse:</p>
+
+<ol>
+ <li>Select the project in the Package
+Explorer and select <strong>File > Export</strong>.</li>
+ <li>Open the Android folder, select Export Android Application,
+ and click <strong>Next</strong>.
+ <p>The Export Android Application wizard now starts, which will
+ guide you through the process of signing your application,
+ including steps for selecting the private key with which to sign the APK
+ (or creating a new keystore and private key).</p>
+ <li>Complete the Export Wizard and your application will be compiled,
+ signed, aligned, and ready for distribution.</li>
+</ol>
+
+
+
+<h2 id="secure-key">Securing Your Private Key</h2>
+
+<p>Maintaining the security of your private key is of critical importance, both
+to you and to the user. If you allow someone to use your key, or if you leave
+your keystore and passwords in an unsecured location such that a third-party
+could find and use them, your authoring identity and the trust of the user
+are compromised. </p>
+
+<p>If a third party should manage to take your key without your knowledge or
+permission, that person could sign and distribute applications that maliciously
+replace your authentic applications or corrupt them. Such a person could also
+sign and distribute applications under your identity that attack other
+applications or the system itself, or corrupt or steal user data. </p>
+
+<p>Your reputation as a developer entity depends on your securing your private
+key properly, at all times, until the key is expired. Here are some tips for
+keeping your key secure: </p>
+
+<ul>
+<li>Select strong passwords for the keystore and key.</li>
+<li>When you generate your key with Keytool, <em>do not</em> supply the
+<code>-storepass</code> and <code>-keypass</code> options at the command line.
+If you do so, your passwords will be available in your shell history,
+which any user on your computer could access.</li>
+<li>Similarly, when signing your applications with Jarsigner,
+<em>do not</em> supply the <code>-storepass</code> and <code>-keypass</code>
+options at the command line. </li>
+<li>Do not give or lend anyone your private key, and do not let unauthorized
+persons know your keystore and key passwords.</li>
+</ul>
+
+<p>In general, if you follow common-sense precautions when generating, using,
+and storing your key, it will remain secure. </p>
\ No newline at end of file
diff --git a/docs/html/tools/workflow/index.jd b/docs/html/tools/workflow/index.jd
new file mode 100644
index 0000000..5ae06e6
--- /dev/null
+++ b/docs/html/tools/workflow/index.jd
@@ -0,0 +1,150 @@
+page.title=Introduction
+@jd:body
+
+<p>To develop apps for Android devices, you use a set of tools that are included in the Android SDK.
+Once you've downloaded and installed the SDK, you can access these tools right from your Eclipse IDE,
+through the ADT plugin, or from the command line. Developing with Eclipse is the preferred method because
+it can directly invoke the tools that you need while developing applications.</p>
+
+ <p>However, you may choose to develop with another IDE or a simple text editor and invoke the
+ tools on the command line or with scripts. This is a less streamlined way to develop because you
+ will sometimes have to call command line tools manually, but you will have access to the same
+ number of features that you would have in Eclipse.</p>
+
+<div class="figure" style="width:461px">
+ <img src="{@docRoot}images/developing/developing_overview.png"
+ alt="Development process for Android applications"
+ height="738" />
+ <p class="img-caption">
+ <strong>Figure 1.</strong> The development process for Android applications.
+ </p>
+</div>
+
+<p>The basic steps for developing applications (with or without Eclipse) are shown in figure 1. The
+development steps encompass four development phases, which include:</p>
+
+<ul>
+ <li><strong>Setup</strong>
+ <p>During this phase you install and set up your development environment. You also create
+ Android Virtual Devices (AVDs) and connect hardware devices on which you can install your
+ applications.</p>
+ <p>See <a href="{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>
+ and <a href="{@docRoot}tools/device.html">Using Hardware Devices</a> for more
+ information.
+ </li>
+ <li><strong>Development</strong>
+ <p>During this phase you set up and develop your Android project, which contains all of the
+ source code and resource files for your application. For more informations, see
+ <a href="{@docRoot}tools/projects/index.html">Create an Android project</a>.</p>
+ </li>
+ <li><strong>Debugging and Testing</strong>
+ <p>During this phase you build your project into a debuggable <code>.apk</code> package that you
+ can install and run on the emulator or an Android-powered device. If you are using Eclipse,
+ builds are generated each time you project is saved. If you're using another IDE,
+ you can build your project using Ant and install it on a device using
+ <a href="{@docRoot}tools/help/adb.html">adb</a>. For more information, see
+ <a href="{@docRoot}tools/building/index.html">Build and run your application</a>.</p>
+ <p>Next, you debug your application using a JDWP-compliant debugger along with the debugging
+ and logging tools that are provided with the Android SDK. Eclipse already comes packaged with
+ a compatible debugger. For more information see,
+ <a href="{@docRoot}tools/debugging/index.html">Debug your application with the
+ SDK debugging and logging tools</a>.</p>
+ <p>Last, you test your application using various Android SDK testing tools. For more
+ information, see <a href="{@docRoot}tools/testing/index.html">Test your application
+ with the Testing and Instrumentation framework</a>.</p>
+ </li>
+ <li><strong>Publishing</strong>
+ <p>During this phase you configure and build your application for release and distribute your
+ application to users. For more information, see
+ <a href="{@docRoot}tools/publishing/publishing_overview.html">Publishing Overview</a>.</p>
+ </li>
+</ul>
+
+<h2 id="EssentialTools">Essential command line tools</h2>
+
+ <p>When developing in IDEs or editors other than Eclipse, be familiar with
+ all of the tools below, because you will have to run them from the command line.</p>
+
+ <dl>
+ <dt><a href="{@docRoot}tools/help/android.html">android</a></dt>
+
+ <dd>Create and update Android projects and create, move, and delete AVDs.</dd>
+
+ <dt><a href="{@docRoot}tools/devices/emulator.html">Android Emulator</a></dt>
+
+ <dd>Run your Android applications on an emulated Android platform.</dd>
+
+ <dt><a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a></dt>
+
+ <dd>Interface with your emulator or connected device (install apps, shell the device, issue
+ commands, etc.).</dd>
+ </dl>
+
+ <p>In addition to the above tools that are included with the SDK, you need the following open
+ source and third-party tools:</p>
+
+ <dl>
+ <dt>Ant</dt>
+
+ <dd>To compile and build your Android project into an installable .apk file.</dd>
+
+ <dt>Keytool</dt>
+
+ <dd>To generate a keystore and private key, used to sign your .apk file. Keytool is part of the
+ JDK.</dd>
+
+ <dt>Jarsigner (or similar signing tool)</dt>
+
+ <dd>To sign your .apk file with a private key generated by Keytool. Jarsigner is part of the
+ JDK.</dd>
+ </dl>
+
+ <p>If you are using Eclipse and ADT, tools such as <code>adb</code> and <code>android</code>
+ are automatically called by Eclipse and ADT so you don't have to manually invoke these tools.
+ You need to be familiar with <code>adb</code>, however, because certain functions are not
+accessible from
+ Eclipse, such as the <code>adb</code> shell commands. You might also need to call Keytool and
+Jarsigner to
+ sign your applications, but you can set up Eclipse to do this automatically as well.</p>
+
+<p>For more information on the tools provided with the Android SDK, see the
+ <a href="{@docRoot}tools/index.html">Tools</a> section of the documentation.</p>
+
+<h2 id="ThirdParty">Other Third-Party Development Tools</h2>
+<p>
+ The tools described in this section are not developed by the Android SDK team. The Android Dev Guide
+ does not provide documentation for these tools. Please refer to the linked documents in each
+ section for documentation.
+</p>
+<h3 id="IntelliJ">Developing in IntelliJ IDEA</h3>
+<div style="float: right">
+<img alt="The IntelliJ graphical user interface" height="500px"
+src="{@docRoot}images/developing/intellijidea_android_ide.png"/>
+</div>
+<p>
+ IntelliJ IDEA is a powerful Java IDE from JetBrains that provides
+ full-cycle Android development support in both the free Community
+ Edition and the Ultimate edition.
+</p>
+<p>
+ The IDE ensures compatibility with the latest Android SDK and offers a
+ smart code editor with completion, quick navigation between code and
+ resources, a graphical debugger, unit testing support using Android
+ Testing Framework, and the ability to run applications in either the
+ emulator or a USB-connected device.
+</p>
+<p>
+ <strong>Links:</strong>
+</p>
+<ul>
+ <li>
+ <a href="http://www.jetbrains.com/idea">IntelliJ IDEA official website</a>
+</li>
+ <li>
+ <a href="http://www.jetbrains.com/idea/features/google_android.html">Android support in IntelliJ IDEA</a>
+</li>
+ <li>
+ <a href="http://wiki.jetbrains.net/intellij/Android">IntelliJ IDEA Android Tutorials</a>
+ </li>
+</ul>
+
diff --git a/docs/html/tools/workflow/publishing/app-signing.jd b/docs/html/tools/workflow/publishing/app-signing.jd
new file mode 100644
index 0000000..ac45242
--- /dev/null
+++ b/docs/html/tools/workflow/publishing/app-signing.jd
@@ -0,0 +1,618 @@
+page.title=Signing Your Applications
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Quickview</h2>
+
+<ul>
+<li>All Android apps <em>must</em> be signed</li>
+<li>You can sign with a self-signed key</li>
+<li>How you sign your apps is critical — read this document carefully</li>
+<li>Determine your signing strategy early in the development process</li>
+</ul>
+
+<h2>In this document</h2>
+
+<ol>
+<li><a href="#signing">Signing Process</a></li>
+<li><a href="#strategies">Signing Strategies</a></li>
+<li><a href="#setup">Basic Setup for Signing</a></li>
+<li><a href="#debugmode">Signing in Debug Mode</a></li>
+<li><a href="#releasemode">Signing Release Mode</a>
+ <ol>
+ <li><a href="#cert">Obtain a suitable private key</a></li>
+ <li><a href="#releasecompile">Compile the application in release mode</a></li>
+ <li><a href="#signapp">Sign your application with your private key</a></li>
+ <li><a href="#align">Align the final APK package</a></li>
+ <li><a href="#ExportWizard">Compile and sign with Eclipse ADT</a></li>
+ </ol>
+</li>
+<li><a href="#secure-key">Securing Your Private Key</a></li>
+
+</ol>
+
+<h2>See also</h2>
+
+<ol>
+<li><a href="{@docRoot}tools/publishing/versioning.html">Versioning Your Applications</a></li>
+<li><a href="{@docRoot}tools/publishing/preparing.html">Preparing to Publish</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>The Android system requires that all installed applications be digitally signed with a
+certificate whose private key is held by the application's developer. The Android system uses the
+certificate as a means of identifying the author of an application and establishing trust
+relationships between applications. The certificate is not used to control which applications the
+user can install. The certificate does not need to be signed by a certificate authority: it is
+perfectly allowable, and typical, for Android applications to use self-signed certificates.</p>
+
+<p>The important points to understand about signing Android applications are:</p>
+
+<ul>
+ <li>All applications <em>must</em> be signed. The system will not install an application
+on an emulator or a device if it is not signed.</li>
+ <li>To test and debug your application, the build tools sign your application with a special debug
+ key that is created by the Android SDK build tools.</li>
+ <li>When you are ready to release your application for end-users, you must sign it with a suitable
+ private key. You cannot publish an application that is signed with the debug key generated
+ by the SDK tools.</li>
+ <li>You can use self-signed certificates to sign your applications. No certificate authority is
+ needed.</li>
+ <li>The system tests a signer certificate's expiration date only at install time. If an
+application's signer certificate expires after the application is installed, the application
+will continue to function normally.</li>
+ <li>You can use standard tools — Keytool and Jarsigner — to generate keys and
+sign your application {@code .apk} files.</li>
+ <li>After you sign your application for release, we recommend that you use the
+ <code>zipalign</code> tool to optimize the final APK package.</li>
+</ul>
+
+<p>The Android system will not install or run an application that is not signed appropriately. This
+applies wherever the Android system is run, whether on an actual device or on the emulator.
+For this reason, you must <a href="#setup">set up signing</a> for your application before you can
+run it or debug it on an emulator or device.</p>
+
+<h2 id="signing">Signing Process</h3>
+
+<p>The Android build process signs your application differently depending on which build mode you
+use to build your application. There are two build modes: <em>debug mode</em> and <em>release
+mode</em>. You use debug mode when you are developing and testing your application. You use
+release mode when you want to build a release version of your application that you can
+distribute directly to users or publish on an application marketplace such as Google Play.</p>
+
+<p>When you build in <em>debug mode</em> the Android SDK build tools use the Keytool utility
+(included in the JDK) to create a debug key. Because the SDK build tools created the debug key,
+they know the debug key's alias and password. Each time you compile your application in debug mode,
+the build tools use the debug key along with the Jarsigner utility (also included in the JDK) to
+sign your application's <code>.apk</code> file. Because the alias and password are known to the SDK
+build tools, the tools don't need to prompt you for the debug key's alias and password each time
+you compile.</p>
+
+<p>When you build in <em>release mode</em> you use your own private key to sign your application. If
+you don't have a private key, you can use the Keytool utility to create one for you. When you
+compile your application in release mode, the build tools use your private key along with the
+Jarsigner utility to sign your application's <code>.apk</code> file. Because the certificate and
+private key you use are your own, you will have to provide the password for the keystore and key
+alias.</p>
+
+<p>The debug signing process happens automatically when you run or debug your application using
+Eclipse with the ADT plugin. Debug signing also happens automatically when you use the Ant build
+script with the <code>debug</code> option. You can automate the release signing process by using the
+Eclipse Export Wizard or by modifying the Ant build script and building with the
+<code>release</code> option.</p>
+
+<h2 id="strategies">Signing Strategies</h2>
+
+<p>Some aspects of application signing may affect how you approach the development
+of your application, especially if you are planning to release multiple
+applications. </p>
+
+<p>In general, the recommended strategy for all developers is to sign
+all of your applications with the same certificate, throughout the expected
+lifespan of your applications. There are several reasons why you should do so: </p>
+
+<ul>
+<li>Application upgrade – As you release updates to your application, you
+will want to continue to sign the updates with the same certificate or set of
+certificates, if you want users to upgrade seamlessly to the new version. When
+the system is installing an update to an application, it compares the
+certificate(s) in the new version with those in the existing version. If the
+certificates match exactly, including both the certificate data and order, then
+the system allows the update. If you sign the new version without using matching
+certificates, you will also need to assign a different package name to the
+application — in this case, the user installs the new version as a
+completely new application. </li>
+
+<li>Application modularity – The Android system allows applications that
+are signed by the same certificate to run in the same process, if the
+applications so requests, so that the system treats them as a single application.
+In this way you can deploy your application in modules, and users can update
+each of the modules independently if needed.</li>
+
+<li>Code/data sharing through permissions – The Android system provides
+signature-based permissions enforcement, so that an application can expose
+functionality to another application that is signed with a specified
+certificate. By signing multiple applications with the same certificate and
+using signature-based permissions checks, your applications can share code and
+data in a secure manner. </li>
+
+</ul>
+
+<p>Another important consideration in determining your signing strategy is
+how to set the validity period of the key that you will use to sign your
+applications.</p>
+
+<ul>
+<li>If you plan to support upgrades for a single application, you should ensure
+that your key has a validity period that exceeds the expected lifespan of
+that application. A validity period of 25 years or more is recommended.
+When your key's validity period expires, users will no longer be
+able to seamlessly upgrade to new versions of your application.</li>
+
+<li>If you will sign multiple distinct applications with the same key,
+you should ensure that your key's validity period exceeds the expected
+lifespan of <em>all versions of all of the applications</em>, including
+dependent applications that may be added to the suite in the future. </li>
+
+<li>If you plan to publish your application(s) on Google Play, the
+key you use to sign the application(s) must have a validity period
+ending after 22 October 2033. Google Play enforces this requirement
+to ensure that users can seamlessly upgrade applications when
+new versions are available. </li>
+</ul>
+
+<p>As you design your application, keep these points in mind and make sure to
+use a <a href="#cert">suitable certificate</a> to sign your applications. </p>
+
+<h2 id="setup">Basic Setup for Signing</h2>
+
+<p>Before you begin, make sure that the Keytool utility and Jarsigner utility are available to
+the SDK build tools. Both of these tools are available in the JDK. In most cases, you can tell
+the SDK build tools how to find these utilities by setting your <code>JAVA_HOME</code> environment
+variable so it references a suitable JDK. Alternatively, you can add the JDK version of Keytool and
+Jarsigner to your <code>PATH</code> variable.</p>
+
+<p>If you are developing on a version of Linux that originally came with GNU Compiler for
+Java, make sure that the system is using the JDK version of Keytool, rather than the gcj
+version. If Keytool is already in your <code>PATH</code>, it might be pointing to a symlink at
+<code>/usr/bin/keytool</code>. In this case, check the symlink target to be sure it points
+to the Keytool in the JDK.</p>
+
+<h2 id="debugmode">Signing in Debug Mode</h2>
+
+<p>The Android build tools provide a debug signing mode that makes it easier for you
+to develop and debug your application, while still meeting the Android system
+requirement for signing your APK.
+When using debug mode to build your app, the SDK tools invoke Keytool to automatically create
+a debug keystore and key. This debug key is then used to automatically sign the APK, so
+you do not need to sign the package with your own key.</p>
+
+<p>The SDK tools create the debug keystore/key with predetermined names/passwords:</p>
+<ul>
+<li>Keystore name: "debug.keystore"</li>
+<li>Keystore password: "android"</li>
+<li>Key alias: "androiddebugkey"</li>
+<li>Key password: "android"</li>
+<li>CN: "CN=Android Debug,O=Android,C=US"</li>
+</ul>
+
+<p>If necessary, you can change the location/name of the debug keystore/key or
+supply a custom debug keystore/key to use. However, any custom debug
+keystore/key must use the same keystore/key names and passwords as the default
+debug key (as described above). (To do so in Eclipse/ADT, go to
+<strong>Windows</strong> > <strong>Preferences</strong> >
+<strong>Android</strong> > <strong>Build</strong>.) </p>
+
+<p class="caution"><strong>Caution:</strong> You <em>cannot</em> release your application
+to the public when signed with the debug certificate.</p>
+
+<h3>Eclipse Users</h3>
+
+<p>If you are developing in Eclipse/ADT (and have set up Keytool and Jarsigner as described above in
+<a href="#setup">Basic Setup for Signing</a>),
+signing in debug mode is enabled by default. When you run or debug your
+application, ADT signs the {@code .apk} file with the debug certificate, runs {@code zipalign} on
+the package, then installs it on
+the selected emulator or connected device. No specific action on your part is needed,
+provided ADT has access to Keytool.</p>
+
+<h3>Ant Users</h3>
+
+<p>If you are using Ant to build your {@code .apk} file, debug signing mode
+is enabled by using the <code>debug</code> option with the <code>ant</code> command
+(assuming that you are using a <code>build.xml</code> file generated by the
+<code>android</code> tool). When you run <code>ant debug</code> to
+compile your app, the build script generates a keystore/key and signs the APK for you.
+The script then also aligns the APK with the <code>zipalign</code> tool.
+No other action on your part is needed. Read
+<a href="{@docRoot}tools/building/building-cmdline.html#DebugMode">Building and Running Apps
+on the Command Line</a> for more information.</p>
+
+
+<h3 id="debugexpiry">Expiry of the Debug Certificate</h3>
+
+<p>The self-signed certificate used to sign your application in debug mode (the default on
+Eclipse/ADT and Ant builds) will have an expiration date of 365 days from its creation date.</p>
+
+<p>When the certificate expires, you will get a build error. On Ant builds, the error
+looks like this:</p>
+
+<pre>debug:
+[echo] Packaging bin/samples-debug.apk, and signing it with a debug key...
+[exec] Debug Certificate expired on 8/4/08 3:43 PM</pre>
+
+<p>In Eclipse/ADT, you will see a similar error in the Android console.</p>
+
+<p>To fix this problem, simply delete the <code>debug.keystore</code> file.
+The default storage location for AVDs is in <code>~/.android/</code> on OS X and Linux,
+in <code>C:\Documents and Settings\<user>\.android\</code> on Windows XP, and in
+<code>C:\Users\<user>\.android\</code> on Windows Vista and Windows 7.</p>
+
+
+<p>The next time you build, the build tools will regenerate a new keystore and debug key.</p>
+
+<p>Note that, if your development machine is using a non-Gregorian locale, the build
+tools may erroneously generate an already-expired debug certificate, so that you get an
+error when trying to compile your application. For workaround information, see the
+troubleshooting topic <a href="{@docRoot}resources/faq/troubleshooting.html#signingcalendar">
+I can't compile my app because the build tools generated an expired debug
+certificate</a>. </p>
+
+
+<h2 id="releasemode">Signing in Release Mode</h2>
+
+<p>When your application is ready for release to other users, you must:</p>
+<ol>
+ <li><a href="#cert">Obtain a suitable private key</a></li>
+ <li><a href="#releasecompile">Compile the application in release mode</a></li>
+ <li><a href="#signapp">Sign your application with your private key</a></li>
+ <li><a href="#align">Align the final APK package</a></li>
+</ol>
+
+<p>If you are developing in Eclipse with the ADT plugin, you can use the Export Wizard
+to perform the compile, sign, and align procedures. The Export Wizard even allows you to
+generate a new keystore and private key in the process. So if you use Eclipse, you can
+skip to <a href="#ExportWizard">Compile and sign with Eclipse ADT</a>.</p>
+
+
+
+<h3 id="cert">1. Obtain a suitable private key</h3>
+
+<p>In preparation for signing your application, you must first ensure that
+you have a suitable private key with which to sign. A suitable private
+key is one that:</p>
+
+<ul>
+<li>Is in your possession</li>
+<li>Represents the personal, corporate, or organizational entity to be identified
+with the application</li>
+<li>Has a validity period that exceeds the expected lifespan of the application
+or application suite. A validity period of more than 25 years is recommended.
+<p>If you plan to publish your application(s) on Google Play, note that a
+validity period ending after 22 October 2033 is a requirement. You can not upload an
+application if it is signed with a key whose validity expires before that date.
+</p></li>
+<li>Is not the debug key generated by the Android SDK tools. </li>
+</ul>
+
+<p>The key may be self-signed. If you do not have a suitable key, you must
+generate one using Keytool. Make sure that you have Keytool available, as described
+in <a href="#setup">Basic Setup</a>.</p>
+
+<p>To generate a self-signed key with Keytool, use the <code>keytool</code>
+command and pass any of the options listed below (and any others, as
+needed). </p>
+
+<p class="warning"><strong>Warning:</strong> Keep your private key secure.
+Before you run Keytool, make sure to read
+<a href="#secure-key">Securing Your Private Key</a> for a discussion of how to keep
+your key secure and why doing so is critically important to you and to users. In
+particular, when you are generating your key, you should select strong passwords
+for both the keystore and key.</p>
+
+<table>
+<tr>
+<th>Keytool Option</th>
+<th>Description</th>
+</tr>
+<tr>
+<td><code>-genkey</code></td><td>Generate a key pair (public and private
+keys)</td>
+</tr>
+<tr>
+<td><code>-v</code></td><td>Enable verbose output.</td>
+</tr>
+<tr>
+<td><code>-alias <alias_name></code></td><td>An alias for the key. Only
+the first 8 characters of the alias are used.</td>
+</tr>
+<tr>
+<td><code>-keyalg <alg></code></td><td>The encryption algorithm to use
+when generating the key. Both DSA and RSA are supported.</td>
+</tr>
+<tr>
+<td><code>-keysize <size></code></td><td>The size of each generated key
+(bits). If not supplied, Keytool uses a default key size of 1024 bits. In
+general, we recommend using a key size of 2048 bits or higher. </td>
+</tr>
+<tr>
+<td><code>-dname <name></code></td><td><p>A Distinguished Name that describes
+who created the key. The value is used as the issuer and subject fields in the
+self-signed certificate. </p><p>Note that you do not need to specify this option
+in the command line. If not supplied, Jarsigner prompts you to enter each
+of the Distinguished Name fields (CN, OU, and so on).</p></td>
+</tr>
+<tr>
+<td><code>-keypass <password></code></td><td><p>The password for the
+key.</p> <p>As a security precaution, do not include this option in your command
+line. If not supplied, Keytool prompts you to enter the password. In this way,
+your password is not stored in your shell history.</p></td>
+</tr>
+<tr>
+<td><code>-validity <valdays></code></td><td><p>The validity period for the
+key, in days. </p><p><strong>Note:</strong> A value of 10000 or greater is recommended.</p></td>
+</tr>
+<tr>
+<td><code>-keystore <keystore-name>.keystore</code></td><td>A name
+for the keystore containing the private key.</td>
+</tr>
+<tr>
+<td><code>-storepass <password></code></td><td><p>A password for the
+keystore.</p><p>As a security precaution, do not include this option in your
+command line. If not supplied, Keytool prompts you to enter the password. In
+this way, your password is not stored in your shell history.</p></td>
+</tr>
+</table>
+
+<p>Here's an example of a Keytool command that generates a private key:</p>
+
+<pre>$ keytool -genkey -v -keystore my-release-key.keystore
+-alias alias_name -keyalg RSA -keysize 2048 -validity 10000</pre>
+
+<p>Running the example command above, Keytool prompts you to provide
+passwords for the keystore and key, and to provide the Distinguished
+Name fields for your key. It then generates the keystore as a file called
+<code>my-release-key.keystore</code>. The keystore and key are
+protected by the passwords you entered. The keystore contains
+a single key, valid for 10000 days. The alias is a name that you —
+will use later, to refer to this keystore when signing your application. </p>
+
+<p>For more information about Keytool, see the documentation at
+<a
+href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html">
+http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html</a></p>
+
+
+
+<h3 id="releasecompile">2. Compile the application in release mode</h3>
+
+<p>In order to release your application to users, you must compile it in release mode.
+In release mode, the compiled application is not signed by default and you will need
+to sign it with your private key.</p>
+
+<p class="caution"><strong>Caution:</strong>
+You can not release your application unsigned, or signed with the debug key.</p>
+
+<h4>With Eclipse</h4>
+
+<p>To export an <em>unsigned</em> APK from Eclipse, right-click the project in the Package
+Explorer and select <strong>Android Tools</strong> > <strong>Export Unsigned Application
+Package</strong>. Then specify the file location for the unsigned APK.
+(Alternatively, open your <code>AndroidManifest.xml</code> file in Eclipse, select
+the <strong>Manifest</strong> tab, and click <strong>Export an unsigned APK</strong>.)</p>
+
+<p>Note that you can combine the compiling and signing steps with the Export Wizard. See
+<a href="#ExportWizard">Compiling and signing with Eclipse ADT</a>.</p>
+
+<h4>With Ant</h4>
+
+<p>If you are using Ant, you can enable release mode by using the <code>release</code> option
+with the <code>ant</code> command. For example, if you are running Ant from the
+directory containing your {@code build.xml} file, the command would look like this:</p>
+
+<pre>$ ant release</pre>
+
+<p>By default, the build script compiles the application APK without signing it. The output file
+in your project {@code bin/} will be <code><em><your_project_name></em>-unsigned.apk</code>.
+Because the application APK is still unsigned, you must manually sign it with your private
+key and then align it using {@code zipalign}.</p>
+
+<p>However, the Ant build script can also perform the signing
+and aligning for you, if you have provided the path to your keystore and the name of
+your key alias in the project's {@code ant.properties} file. With this information provided,
+the build script will prompt you for your keystore and alias password when you perform
+<code>ant release</code>, it will sign the package and then align it. The final output
+file in {@code bin/} will instead be
+<code><em><your_project_name></em>-release.apk</code>. With these steps
+automated for you, you're able to skip the manual procedures below (steps 3 and 4).
+To learn how to specify your keystore and alias in the {@code ant.properties} file,
+see <a href="{@docRoot}tools/building/building-cmdline.html#ReleaseMode">
+Building and Running Apps on the Command Line</a>.</p>
+
+
+
+<h3 id="signapp">3. Sign your application with your private key</h3>
+
+<p>When you have an application package that is ready to be signed, you can do sign it
+using the Jarsigner tool. Make sure that you have Jarsigner available on your
+machine, as described in <a href="#setup">Basic Setup</a>. Also, make sure that
+the keystore containing your private key is available.</p>
+
+<p>To sign your application, you run Jarsigner, referencing both the
+application's APK and the keystore containing the private key with which to
+sign the APK. The table below shows the options you could use. </p>
+
+<table>
+<tr>
+<th>Jarsigner Option</th>
+<th>Description</th>
+</tr>
+<tr>
+<td><code>-keystore <keystore-name>.keystore</code></td><td>The name of
+the keystore containing your private key.</td>
+</tr>
+<tr>
+<td><code>-verbose</code></td><td>Enable verbose output.</td>
+</tr>
+<tr>
+<td><code>-sigalg</code></td><td>The name of the signature algorithim to use in signing the APK.
+Use the value {@code MD5withRSA}.</td>
+</tr>
+<tr>
+<td><code>-digestalg</code></td><td>The message digest algorithim to use in processing the entries
+of an APK. Use the value {@code SHA1}.</td>
+</tr>
+<tr>
+<td><code>-storepass <password></code></td><td><p>The password for the
+keystore. </p><p>As a security precaution, do not include this option
+in your command line unless you are working at a secure computer.
+If not supplied, Jarsigner prompts you to enter the password. In this
+way, your password is not stored in your shell history.</p></td>
+</tr>
+<tr>
+<td><code>-keypass <password></code></td><td><p>The password for the private
+key. </p><p>As a security precaution, do not include this option
+in your command line unless you are working at a secure computer.
+If not supplied, Jarsigner prompts you to enter the password. In this
+way, your password is not stored in your shell history.</p></td>
+</tr>
+</table>
+
+<p>Here's how you would use Jarsigner to sign an application package called
+<code>my_application.apk</code>, using the example keystore created above.
+</p>
+
+<pre>$ jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore my-release-key.keystore
+my_application.apk alias_name</pre>
+
+<p>Running the example command above, Jarsigner prompts you to provide
+passwords for the keystore and key. It then modifies the APK
+in-place, meaning the APK is now signed. Note that you can sign an
+APK multiple times with different keys.</p>
+
+<p class="caution"><strong>Caution:</strong> As of JDK 7, the default signing algorithim has
+changed, requiring you to specify the signature and digest algorithims ({@code -sigalg} and {@code
+-digestalg}) when you sign an APK.</p>
+
+<p>To verify that your APK is signed, you can use a command like this:</p>
+
+<pre>$ jarsigner -verify my_signed.apk</pre>
+
+<p>If the APK is signed properly, Jarsigner prints "jar verified".
+If you want more details, you can try one of these commands:</p>
+
+<pre>$ jarsigner -verify -verbose my_application.apk</pre>
+
+<p>or</p>
+
+<pre>$ jarsigner -verify -verbose -certs my_application.apk</pre>
+
+<p>The command above, with the <code>-certs</code> option added, will show you the
+"CN=" line that describes who created the key.</p>
+
+<p class="note"><strong>Note:</strong> If you see "CN=Android Debug", this means the APK was
+signed with the debug key generated by the Android SDK. If you intend to release
+your application, you must sign it with your private key instead of the debug
+key.</p>
+
+<p>For more information about Jarsigner, see the documentation at
+<a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html">
+http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html</a></p>
+
+
+<h3 id="align">4. Align the final APK package</h3>
+
+<p>Once you have signed the APK with your private key, run <code>zipalign</code> on the file.
+This tool ensures that all uncompressed data starts with a particular byte alignment,
+relative to the start of the file. Ensuring alignment at 4-byte boundaries provides
+a performance optimization when installed on a device. When aligned, the Android
+system is able to read files with {@code mmap()}, even if
+they contain binary data with alignment restrictions, rather than copying all
+of the data from the package. The benefit is a reduction in the amount of
+RAM consumed by the running application.</p>
+
+<p>The <code>zipalign</code> tool is provided with the Android SDK, inside the
+<code>tools/</code> directory. To align your signed APK, execute:</p>
+
+<pre>$ zipalign -v 4 <em>your_project_name</em>-unaligned.apk <em>your_project_name</em>.apk</pre>
+
+<p>The {@code -v} flag turns on verbose output (optional). {@code 4} is the
+byte-alignment (don't use anything other than 4). The first file argument is
+your signed {@code .apk} file (the input) and the second file is the destination {@code .apk} file
+(the output). If you're overriding an existing APK, add the {@code -f} flag.</p>
+
+<p class="caution"><strong>Caution:</strong> Your input APK must be signed with your
+private key <strong>before</strong> you optimize the package with {@code zipalign}.
+If you sign it after using {@code zipalign}, it will undo the alignment.</p>
+
+<p>For more information, read about the
+<a href="{@docRoot}tools/help/zipalign.html">zipalign</a> tool.
+
+
+<h3 id="ExportWizard">Compile and sign with Eclipse ADT</h3>
+
+<p>If you are using Eclipse with the ADT plugin, you can use the Export Wizard to
+export a <em>signed</em> APK (and even create a new keystore,
+if necessary). The Export Wizard performs all the interaction with
+the Keytool and Jarsigner for you, which allows you to sign the package using a GUI
+instead of performing the manual procedures to compile, sign,
+and align, as discussed above. Once the wizard has compiled and signed your package,
+it will also perfom package alignment with {@code zipalign}.
+Because the Export Wizard uses both Keytool and Jarsigner, you should
+ensure that they are accessible on your computer, as described above
+in the <a href="#setup">Basic Setup for Signing</a>.</p>
+
+<p>To create a signed and aligned APK in Eclipse:</p>
+
+<ol>
+ <li>Select the project in the Package
+Explorer and select <strong>File > Export</strong>.</li>
+ <li>Open the Android folder, select Export Android Application,
+ and click <strong>Next</strong>.
+ <p>The Export Android Application wizard now starts, which will
+ guide you through the process of signing your application,
+ including steps for selecting the private key with which to sign the APK
+ (or creating a new keystore and private key).</p>
+ <li>Complete the Export Wizard and your application will be compiled,
+ signed, aligned, and ready for distribution.</li>
+</ol>
+
+
+
+<h2 id="secure-key">Securing Your Private Key</h2>
+
+<p>Maintaining the security of your private key is of critical importance, both
+to you and to the user. If you allow someone to use your key, or if you leave
+your keystore and passwords in an unsecured location such that a third-party
+could find and use them, your authoring identity and the trust of the user
+are compromised. </p>
+
+<p>If a third party should manage to take your key without your knowledge or
+permission, that person could sign and distribute applications that maliciously
+replace your authentic applications or corrupt them. Such a person could also
+sign and distribute applications under your identity that attack other
+applications or the system itself, or corrupt or steal user data. </p>
+
+<p>Your reputation as a developer entity depends on your securing your private
+key properly, at all times, until the key is expired. Here are some tips for
+keeping your key secure: </p>
+
+<ul>
+<li>Select strong passwords for the keystore and key.</li>
+<li>When you generate your key with Keytool, <em>do not</em> supply the
+<code>-storepass</code> and <code>-keypass</code> options at the command line.
+If you do so, your passwords will be available in your shell history,
+which any user on your computer could access.</li>
+<li>Similarly, when signing your applications with Jarsigner,
+<em>do not</em> supply the <code>-storepass</code> and <code>-keypass</code>
+options at the command line. </li>
+<li>Do not give or lend anyone your private key, and do not let unauthorized
+persons know your keystore and key passwords.</li>
+</ul>
+
+<p>In general, if you follow common-sense precautions when generating, using,
+and storing your key, it will remain secure. </p>
\ No newline at end of file
diff --git a/docs/html/tools/workflow/publishing/preparing.jd b/docs/html/tools/workflow/publishing/preparing.jd
new file mode 100644
index 0000000..4633d7e
--- /dev/null
+++ b/docs/html/tools/workflow/publishing/preparing.jd
@@ -0,0 +1,358 @@
+page.title=Preparing for Release
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>Quickview</h2>
+ <ul>
+ <li>Learn which resources you'll need to release your app.</li>
+ <li>Find out how to configure and build your app for release.</li>
+ <li>Learn best practices for releasing your app.</li>
+ </ul>
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#publishing-intro">Introduction</a></li>
+ <li><a href="#publishing-gather">Gathering Materials and Resources</a></li>
+ <li><a href="#publishing-configure">Configuring Your Application</a></li>
+ <li><a href="#publishing-build">Building Your Application</a></li>
+ <li><a href="#publishing-resources">Preparing External Servers and Resources</a></li>
+ <li><a href="#publishing-test">Testing Your Application for Release</a></li>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}tools/publishing/publishing_overview.html">Publishing Overview</a></li>
+ <li><a href="{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a></li>
+ <li><a href="{@docRoot}tools/publishing/publishing.html">Publishing on Google Play</a></li>
+ </ol>
+ </div>
+</div>
+
+<p>Before you distribute your Android application to users you need to prepare it for release. The
+preparation process is a required <a href="{@docRoot}tools/workflow/index.html">development
+task</a> for all Android applications and is the first step in the publishing process (see figure
+1).</p>
+
+<p>When you prepare your application for release, you configure, build, and test a release
+version of your application. The configuration tasks are straightforward, involving basic code
+cleanup and code modification tasks that help optimize your application. The build process is
+similar to the debug build process and can be done using JDK and Android SDK tools. The testing
+tasks serve as a final check, ensuring that your application performs as expected under real-world
+conditions. When you are finished preparing your application for release you have a signed
+<code>.apk</code> file, which you can distribute directly to users or distribute through an
+application marketplace such as Google Play.</p>
+
+<p>This document summarizes the main tasks you need to perform to prepare your application for
+release. The tasks that are described in this document apply to all Android applications regardless
+how they are released or distributed to users. If you are releasing your application through Google
+Play, you should also read <a href="{@docRoot}tools/publishing/publishing.html">Publishing on
+Google Play</a> to be sure your release-ready application satisfies all Google Play
+requirements.</p>
+
+<p class="note"><strong>Note:</strong> As a best practice, your application should meet all of your
+release criteria for functionality, performance, and stability before you perform the tasks outlined
+in this document.</p>
+
+<img src="{@docRoot}images/publishing/publishing_overview_prep.png"
+ alt="Shows how the preparation process fits into the development process"
+ height="190"
+ id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Preparing for release is a required <a
+href="{@docRoot}tools/workflow/index.html">development
+task</a> and is the first step in the publishing process.
+</p>
+
+<h2 id="publishing-intro">Introduction</h2>
+
+<p>To release your application to users you need to create a release-ready package that users can
+install and run on their Android-powered devices. The release-ready package contains the same
+components as the debug <code>.apk</code> file — compiled source code, resources, manifest
+file, and so on — and it is built using the same build tools. However, unlike the debug
+<code>.apk</code> file, the release-ready <code>.apk</code> file is signed with your own certificate
+and it is optimized with the zipalign tool.</p>
+
+<div class="figure" style="width:331px">
+ <img src="{@docRoot}images/publishing/publishing_preparing.png"
+ alt="Shows the five tasks you perform to prepare your app for release"
+ height="450" />
+ <p class="img-caption">
+ <strong>Figure 2.</strong> You perform five main tasks to prepare your application for
+ release.
+ </p>
+</div>
+
+<p>The signing and optimization tasks are usually seamless if you are building your application with
+Eclipse and the ADT plugin or with the Ant build script (included with the Android SDK). For
+example, you can use the Eclipse Export Wizard to compile, sign, and optimize your application all
+at once. You can also configure the Ant build script to do the same when you build from the command
+line.</p>
+
+<p>To prepare your application for release you typically perform five main tasks (see figure 2).
+Each main task may include one or more smaller tasks depending on how you are releasing your
+application. For example, if you are releasing your application through Google Play you may want
+to add special filtering rules to your manifest while you are configuring your application for
+release. Similarly, to meet Google Play publishing guidelines you may have to prepare screenshots
+and create promotional text while you are gathering materials for release.</p>
+
+<p>You usually perform the tasks listed in figure 2 after you have throroughly debugged and tested
+your application. The Android SDK contains several tools to help you test and debug your Android
+applications. For more information, see the <a
+href="{@docRoot}tools/debugging/index.html">Debugging</a> and <a
+href="{@docRoot}tools/testing/index.html">Testing</a> sections in the Dev Guide.</p>
+
+<h2 id="publishing-gather">Gathering Materials and Resources</h2>
+
+<p>To begin preparing your application for release you need to gather several supporting items. At a
+minimum this includes cryptographic keys for signing your application and an application icon. You
+might also want to include an end-user license agreement.</p>
+
+<h4 id="publishing-keys">Cryptographic keys</h4>
+
+<p>The Android system requires that each installed application be digitally signed with a
+certificate that is owned by the application's developer (that is, a certificate for which the
+developer holds the private key). The Android system uses the certificate as a means of identifying
+the author of an application and establishing trust relationships between applications. The
+certificate that you use for signing does not need to be signed by a certificate authority; the
+Android system allows you to sign your applications with a self-signed certificate. To learn about
+certificate requirements, see <a href="{@docRoot}tools/publishing/app-signing.html#cert">Obtain a
+suitable private key</a>.</p>
+
+<p class="caution"><strong>Important:</strong> Your application must be signed with a cryptographic
+key whose validity period ends after 22 October 2033.</p>
+
+<p>You may also have to obtain other release keys if your application accesses a service or uses a
+third-party library that requires you to use a key that is based on your private key. For example,
+if your application uses the <a
+href="http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapView.html">MapView</a>
+class, which is part of the <a
+href="http://code.google.com/android/add-ons/google-apis/maps-overview.html">Google Maps external
+library</a>, you will need to register your application with the Google Maps service and obtain
+a Maps API key. For information about getting a Maps API key, see <a
+href="http://code.google.com/android/add-ons/google-apis/mapkey.html"> Obtaining a Maps API
+key</a>.</p>
+
+<h4>Application Icon</h4>
+
+<p>Be sure you have an application icon and that it meets the recommended <a
+href="{@docRoot}guide/practices/ui_guidelines/icon_design_launcher.html">icon guidelines</a>. Your
+application's icon helps users identify your application on a device's Home
+screen and in the Launcher window. It also appears in Manage Applications, My Downloads, and
+elsewhere. In addition, publishing services such as Google Play display your icon to users.</p>
+
+<p class="note"><strong>Note:</strong> If you are releasing your application on Google Play, you
+need to create a high resolution
+ version of your icon. See <a
+href="https://www.google.com/support/androidmarket/developer/bin/answer.py?answer=1078870">Graphic
+Assets for your Application</a> for more information.</p>
+
+<h4>End-user License Agreement</h4>
+
+<p>Consider preparing an End User License Agreement (EULA) for your application. A EULA can help
+protect your person, organization, and intellectual property, and we recommend that you provide one
+with your application.</p>
+
+<h4>Miscellaneous Materials</h4>
+
+<p>You might also have to prepare promotional and marketing materials to publicize your application.
+For example, if you are releasing your application on Google Play you will need to prepare some
+promotional text and you will need to create screenshots of your application. For more
+information, see
+<a href="https://www.google.com/support/androidmarket/developer/bin/answer.py?answer=1078870">
+Graphic Assets for your Application</a></p>
+
+<h2 id="publishing-configure">Configuring Your Application for Release</h2>
+
+<p>After you gather all of your supporting materials you can start configuring your application
+for release. This section provides a summary of the configuration changes we recommend that you make
+to your source code, resource files, and application manifest prior to releasing your application.
+Although most of the configuration changes listed in this section are optional, they are
+considered good coding practices and we encourage you to implement them. In some cases,
+you may have already made these configuration changes as part of your development process.</p>
+
+<h4>Choose a good package name</h4>
+
+<p>Make sure you choose a package name that is suitable over the life of your application. You
+cannot change the package name after you distribute your application to users. You can set the
+package name in application's manifest file. For more information, see the <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#package">package</a> attribute
+documentation.</p>
+
+<h4>Turn off logging and debugging</h4>
+
+<p>Make sure you deactivate logging and disable the debugging option before you build your
+application for release. You can deactivate logging by removing calls to
+{@link android.util.Log} methods in your source files. You can disable debugging by removing the
+<code>android:debuggable</code> attribute from the <code><application></code> tag in your
+manifest file, or by setting the <code>android:debuggable</code> attribute to
+<code>false</code> in your manifest file. Also, remove any log files or static test files that
+were created in your project.</p>
+
+<p>Also, you should remove all {@link android.os.Debug} tracing calls that you
+added to your code, such as {@link android.os.Debug#startMethodTracing()} and
+{@link android.os.Debug#stopMethodTracing()} method calls.</p>
+
+<h4>Clean up your project directories</h4>
+
+<p>Clean up your project and make sure it conforms to the directory structure described in <a
+href="{@docRoot}tools/projects/index.html#ApplicationProjects">Android Projects</a>.
+Leaving stray or orphaned files in your project can prevent your application from compiling and
+cause your application to behave unpredictably. At a minimum you should do the following cleanup
+tasks:</p>
+
+<ul>
+ <li>Review the contents of your <code>jni/</code>, <code>lib/</code>, and <code>src/</code>
+ directories. The <code>jni/</code> directory should contain only source files associated with the
+ <a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK</a>, such as
+ <code>.c</code>, <code>.cpp</code>, <code>.h</code>, and <code>.mk</code> files. The
+ <code>lib/</code> directory should contain only third-party library files or private library
+ files, including prebuilt shared and static libraries (for example, <code>.so</code> files). The
+ <code>src/</code> directory should contain only the source files for your application
+ (<code>.java</code> and <code>.aidl</code> files). The <code>src/</code> directory should not
+ contain any <code>.jar</code> files.</li>
+ <li>Check your project for private or proprietary data files that your application does not use
+ and remove them. For example, look in your project's <code>res/</code> directory for old
+ drawable files, layout files, and values files that you are no longer using and delete them.</li>
+ <li>Check your <code>lib/</code> directory for test libraries and remove them if they are no
+ longer being used by your application.</li>
+ <li>Review the contents of your <code>assets/</code> directory and your <code>res/raw/</code>
+ directory for raw asset files and static files that you need to update or remove prior to
+ release.</li>
+</ul>
+
+<h4>Review and update your manifest settings</h4>
+
+<p>Verify that the following manifest items are set correctly:</p>
+
+<ul>
+ <li><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">
+ <uses-permission></a> element
+ <p>You should specify only those permissions that are relevant and required for your application.</p>
+ </li>
+ <li><code>android:icon</code> and <code>android:label</code> attributes
+ <p>You must specify values for these attributes, which are located in the
+ <a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a>
+ element.</p>
+ </li>
+ <li><code>android:versionCode</code> and <code>android:versionName</code> attributes.
+ <p>We recommend that you specify values for these attributes, which are located in the
+ <a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a>
+ element. For more information see
+ <a href="{@docRoot}tools/publishing/versioning.html">Versioning your Application</a>.</p>
+ </li>
+</ul>
+
+<p>There are several additional manifest elements that you can set if you are releasing your
+application on Google Play. For example, the <code>android:minSdkVersion</code> and
+<code>android:targetSdkVersion</code> attributes, which are located in the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"> <uses-sdk></a> element. For more
+information about these and other Google Play settings, see <a
+href="{@docRoot}/guide//appendix/market-filters.html">Filters on Google Play</a>.</p>
+
+<h4>Address compatibility issues</h4>
+
+<p>Android provides several tools and techniques to make your application compatible with a wide
+range of devices. To make your application available to the largest number of users, consider
+doing the following:</p>
+
+<ul>
+ <li><strong>Add support for multiple screen configurations</strong>
+ <p>Make sure you meet the
+ <a href="{@docRoot}guide/practices/screens_support.html#screen-independence">
+ best practices for supporting multiple screens</a>. By supporting multiple screen configurations
+ you can create an application that functions properly and looks good on any of the screen sizes
+ supported by Android.</p>
+ </li>
+ <li><strong>Optimize your application for Android 3.0 devices.</strong>
+ <p>If your application is designed for devices older than Android 3.0, make it compatible
+ with Android 3.0 devices by following the guidelines and best practices described in
+ <a href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing Apps for Android 3.0
+ </a>.</p>
+ </li>
+ <li><strong>Consider using the Support Library</strong>
+ <p>If your application is designed for devices running Android 3.x, make your application
+ compatible with older versions of Android by adding the
+ <a href="{@docRoot}tools/extras/support-library.html">Support Library</a> to your
+ application project. The Support Library provides static support libraries that you can add to
+ your Android application, which enables you to use APIs that are either not available on
+ older platform versions or use utility APIs that are not part of the framework APIs.</p>
+ </li>
+</ul>
+
+<h4>Update URLs for servers and services</h4>
+
+<p>If your application accesses remote servers or services, make sure you are using the production
+URL or path for the server or service and not a test URL or path.</p>
+
+<h4>Implement Licensing (if you are releasing on Google Play)</h4>
+
+<p>If you are releasing a paid application through Google Play, consider adding support for
+Google Play Licensing. Licensing lets you control access to your application based on whether the
+current user has purchased it. Using Google Play Licensing is optional even if you are
+releasing your app through Google Play.</p>
+
+<p>For more information about Google Play Licensing Service and how to use it in your
+application, see <a href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a>.</p>
+
+<h2 id="publishing-build">Building Your Application for Release</h2>
+
+<p>After you finish configuring your application you can build it into a release-ready
+<code>.apk</code> fle that is signed and optimized. The JDK includes the tools for signing the
+<code>.apk</code> file (Keytool and Jarsigner); the Android SDK includes the tools for compiling and
+optimizing the <code>.apk</code> file. If you are using Eclipse with the ADT plugin or you are using
+the Ant build script from the command line, you can automate the entire build process.</p>
+
+<h3>Building with Eclipse</h3>
+
+<p>You can use the Eclipse Export Wizard to build a release-ready <code>.apk</code> file that is
+signed with your private key and optimized. To learn how to run the Export Wizard, see
+<a href="{@docRoot}tools/publishing/app-signing.html#ExportWizard">Compile and sign with Eclipse
+ADT</a>. The Export Wizard compiles your application for release, signs your application with your
+private key, and optimizes your application with the zipalign tool. The Export Wizard should run
+successfully if you have run or debugged your application from Eclipse and you have no errors in
+your application (see <a href="{@docRoot}tools/building/building-eclipse.html">Building
+and Running from Eclipse with ADT</a> for more information.</p>
+
+<p>The Export Wizard assumes that you have a <a href="#billing-keys">certificate and private key</a>
+suitable for signing your application. If you do not have a suitable certificate and private key,
+the Export Wizard will help you generate one (see
+<a href="{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a> for more
+information about the signing process and signing guidelines.</p>
+
+<h3>Building with Ant</h3>
+
+<p>You can use the Ant build script (included in the Android SDK) to build a release-ready
+<code>.apk</code> file that is signed with your private key and optimized. To learn how to do this,
+see <a href="{@docRoot}tools/building/building-cmdline.html#ReleaseMode">Building in
+Release Mode</a>. This build method assumes you have a <a href="#billing-keys">certificate and
+private key</a> suitable for signing your application. If you do not have a suitable certificate and
+private key, the Export Wizard will help you generate one (see
+<a href="{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a> for more
+information about the signing process and signing guidelines.</p>
+
+<h2 id="publishing-resources">Preparing External Servers and Resources</h2>
+
+<p>If your application relies on a remote server, make sure the server is secure and that it is
+configured for production use. This is particularly important if you are implementing <a
+href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> in your application and you are
+performing the signature verification step on a remote server.</p>
+
+<p>Also, if your application fetches content from a remote server or a real-time service (such as a
+content feed), be sure the content you are providing is up to date and production-ready.</p>
+
+<h2 id="publishing-test">Testing Your Application for Release</h2>
+
+<p>Testing the release version of your application helps ensure that your application runs properly
+under realistic device and network conditions. Ideally, you should test your application on at least
+one handset-sized device and one tablet-sized device to verify that your user interface elements are
+sized correctly and that your application's performance and battery efficiency are acceptable.</p>
+
+<p>As a starting point for testing, see
+<a href="{@docRoot}tools/testing/what_to_test.html">What to Test</a>. This article provides
+a summary of common Android situations that you should consider when you are testing. When you are
+done testing and you are satisfied that the release version of your application
+behaves correctly, you can release your application to users. For more information, see
+<a href="{@docRoot}tools/publishing/publishing_overview.html#publishing-release">Releasing Your
+Application to Users</a>. If you are publishing your application on Google Play, see
+<a href="{@docRoot}tools/publishing/publishing.html">Publishing on Google Play</a>.</p>
+
+
diff --git a/docs/html/tools/workflow/publishing/publishing.jd b/docs/html/tools/workflow/publishing/publishing.jd
new file mode 100644
index 0000000..a54b030
--- /dev/null
+++ b/docs/html/tools/workflow/publishing/publishing.jd
@@ -0,0 +1,703 @@
+page.title=Publishing on Google Play
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Quickview</h2>
+
+<ul>
+<li>Learn how to publish and update apps on Google Play.</li>
+<li>Find out how to create links to apps that are published on Google Play.</li>
+<li>Learn about Google Play features.</li>
+</ul>
+
+
+<h2>In this document</h2>
+
+<ol>
+<li><a href="#overview">About Google Play</a>
+<li><A href="#marketpublish">Publishing Apps on Google Play</a></li>
+<li><a href="#marketupgrade">Publishing Updates on Google Play</a></li>
+<li><a href="#marketLicensing">Using Google Play Licensing Service</a></li>
+<li><a href="#marketinappbilling">Using Google Play In-app Billing</a></li>
+<li><a href="#marketintent">Linking to Your Apps on Google Play</a>
+ <ol>
+ <li><a href="#OpeningDetails">Opening an app's details page</a></li>
+ <li><a href="#PerformingSearch">Performing a search</a></li>
+ <li><a href="#BuildaButton">Build a Google Play button</a></li>
+ <li><a href="#UriSummary">Summary of URI formats</a></li>
+ </ol>
+</li>
+</ol>
+
+<h2>See also</h2>
+
+<ol>
+<li><a href="{@docRoot}tools/publishing/publishing_overview.html">Publishing Overview</a></li>
+<li><a href="{@docRoot}tools/publishing/preparing.html">Preparing for Release</a></li>
+</ol>
+
+<div id="qv-extra">
+ <img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
+ <div id="qv-sub-rule">
+ <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0 5px;">
+ <h2 style="color:#669999;">Already know about Google Play and want to get started?</h2>
+ <p>Go to <a href="http://play.google.com/apps/publish">Google Play</a>, create a developer
+account, and upload your application. For more information about required assets, listing details,
+and publishing options, see <a
+href="http://market.android.com/support/bin/answer.py?answer=113469">Upload
+Applications</a>.</p>
+ </div>
+</div>
+
+</div>
+</div>
+
+<p>One of the most effective ways to get your application into users' hands is to
+publish it on an application marketplace like Google Play. Publishing on Google Play is a
+straightforward process that you can do in just a few simple steps—register, configure,
+upload, and publish. Registration takes only a few minutes and needs to be done only once.
+The configuration and publishing steps can all be done through the Google Play Android Developer Console
+after you register as a Google Play developer.</p>
+
+<p>To start publishing on Google Play, first read this topic and then go to the <a
+href="https://play.google.com/apps/publish">Google Play Android Developer Console</a> and register as
+a Google Play developer.</p>
+
+
+<h2 id="overview">About Google Play</h2>
+
+<p>Google Play is a robust publishing platform that helps you publicize, sell, and distribute
+your Android applications to users around the world. When you release your applications through
+Google Play you have access to a suite of developer tools that let you analyze your sales,
+identify market trends, and control who your applications are being distributed to. You also have
+access to several revenue-enhancing features, such as <a
+href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> and
+<a href="{@docRoot}guide/google/play/licensing/index.html">application licensing</a>.</p>
+
+<p>Before you can publish applications on Google Play, you need to <a
+href="http://play.google.com/apps/publish">register</a> as a Google Play developer. During the
+registration process you will need to create a developer profile, pay a registration fee, and agree
+to the <a href="http://www.android.com/us/developer-distribution-agreement.html">Google Play
+Developer Distribution Agreement</a>. After you register you can access the Developer
+Console, where you can upload applications, configure publishing options, and monitor publishing
+data. If you want to sell your applications or use the in-app billing feature, you will also need
+to set up a Google Checkout merchant account. For more information about the registration process,
+see <a href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=113468">
+Developer Registration</a>.</p>
+
+<h2 id="marketpublish">Publishing Apps on Google Play</h2>
+
+<p>Publishing your application on Google Play is a simple process that involves three basic
+tasks (see figure 1):</p>
+
+<ul>
+ <li>Creating various graphical assets that
+accompany your app on Google Play.</li>
+ <li>Using the Google Play <a
+href="http://play.google.com/apps/publish">Developer Console</a> to configure publishing options,
+specify listing details, and upload your app and graphical assets to Google Play.</li>
+ <li>Reviewing your publishing settings and changing the release
+status of your app from Unpublished to Published.</li>
+</ul>
+
+<img src="{@docRoot}images/publishing/publishing_android_market.png"
+ alt="Shows the three steps that are required to publish on Google Play"
+ height="168"
+ id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> To publish apps on Google Play you must first <a
+href="{@docRoot}tools/publishing/preparing.html">prepare your app for release</a> and then perform
+three simple tasks.
+</p>
+
+<p class="caution"><strong>Important:</strong> You must <a
+href="{@docRoot}tools/publishing/preparing.html">prepare your application for release</a> before you
+can publish it on Google Play. When you prepare your application for release you configure it for
+release and build it in release mode. Building in release mode signs your application's {@code .apk}
+file with your private release key. You cannot publish an application on Google Play unless it is
+signed with your own private release key.</p>
+
+<h3>Preparing promotional materials</h3>
+
+<p>To fully leverage the marketing and publicity capabilities of Google Play, you need to create
+several graphical assets that accompany your app on Google Play, such as screenshots, videos,
+promotional graphics, and promotional text. At a minimum you must provide two screenshots of your
+application and a high resolution application icon. The screenshots are displayed on the details
+page for your application on Google Play, and the high resolution application icon is displayed
+in various locations throughout Google Play. The high resolution icon does not replace the
+launcher icon for your application, rather, it serves as a supplemental icon and should look
+the same as your launcher icon. Promotional video,
+graphics, and text are optional, although we strongly recommended that you prepare these for your
+app. For more information about the graphic assets that accompany your application, see <a
+href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=1078870">Graphic
+Assets for your Application</a>.</p>
+
+<h3>Configuring options and uploading assets</h3>
+
+<p>Google Play lets you target your application to a worldwide pool of users and devices. To
+reach these users you can use the Developer Console to configure various publishing
+options and listing details for your app. For example, you can choose the <a
+href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=138294&topic=
+2365624&ctx=topic">countries</a> you want to reach, the listing languages you want to use, and the
+<a
+href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=138412&topic=
+15867&ctx=topic">price</a> you want to charge in each country. You can also configure listing
+details such as the application type, <a
+href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=113475&topic=
+2365760&ctx=topic">category</a>, and <a
+href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=188189&topic=
+2364761&ctx=topic">content rating</a>. In addition, if you want to sell items within your app using
+the in-app billing feature, you can use the Developer Console to <a
+href="http://grendel.sea.corp.google.com:48014/guide/google/play/billing/billing_admin.html#billing-list
+- setup">create a product list</a> and control which items are available for purchase in your
+app.</p>
+
+<p>When you are finished setting publishing options and listing details, you can upload your assets
+and your application to Google Play. You can also upload your application as a draft
+(unpublished) application, which lets you do final testing before you publish it for final
+release.</p>
+
+<p>To learn more about Google Play publishing settings, see the following resources:</p>
+
+<ul>
+ <li><a
+href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=113469&topic=
+236562&ctx=topic">Upload Applications</a>—provides a summary of the publishing settings
+you can configure for an app.</li>
+ <li><a
+href="http://support.google.com/androidmarket/developer/bin/topic.py?hl=en&topic=15867">Selling
+Your Apps</a>—provides guidance about pricing, supported currencies, tax rates, and many
+other topics related to selling apps.</li>
+ <li><a
+href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=1169947&topic=
+15867&ctx=topic">Selling Apps in Multiple Currencies</a>—provides a description of how
+pricing, payouts, and exchange rates work.</li>
+</ul>
+
+<h3>Publishing your application</h3>
+
+<p>When you are satisfied that your publishing settings are correctly configured and your uploaded
+application is ready to be released to the public, you can simply click <strong>Publish</strong> in
+the Developer Console to make your app available for download
+around the world. Keep in mind, it can take several hours for your app to appear on Google
+Play after you click <strong>Publish</strong> in the Developer Console.</p>
+
+<h3>Controlling Distribution to Devices</h3>
+
+<p>If your application targets different device configurations, you can control which Android-powered
+devices have access to your application on Google Play by
+using Google Play filters. Filtering compares device configurations that you declare in your
+app's manifest file to the configuration defined by a device. For example, if you declare the camera
+filter in your manifest, only those devices that have a camera will see your app on Google
+Play. Filters must be configured in your application's manifest file when you are <a
+href="{@docRoot}tools/publishing/preparing.html">preparing your app for release</a> (that is, before
+you upload your app to Google Play). For more information, see <a
+href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a>.</p>
+
+<p>You can also use the multiple APK feature to distribute different {@code .apk} files under the same
+application listing and the same package name; however, you should use this option only as a last
+resort. Android applications usually run on most compatible devices with a single APK, by supplying
+alternative resources for different configurations (for example, different layouts for different screen
+sizes) and the Android system selects the appropriate resources for the device at runtime. In a
+few cases, however, a single APK is unable to support all device configurations, because alternative
+resources make the APK file too big (greater than 50MB) or other technical challenges prevent a
+single APK from working on all devices. Although we encourage you to develop and publish a single
+APK that supports as many device configurations as possible, doing so is sometimes
+not possible. To help you publish your application for as many devices as possible, Google Play
+allows you to publish multiple APKs under the same application listing. Google Play then supplies
+each APK to the appropriate devices based on configuration support you've declared in the manifest
+file of each APK. To use this feature, you need to build your separate {@code .apk} files when you are <a
+href="{@docRoot}tools/publishing/preparing.html">preparing your app for release</a> (that is, before
+you upload your app to Google Play). For more information, see <a
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html">Multiple APK Support</a>.</p>
+
+<h2 id="marketupgrade">Publishing Updates on Google Play</h2>
+
+<p>At any time after publishing an application on Google Play, you can upload
+and publish an update to the same application package. When you publish an
+update to an application, users who have already installed the
+application may receive a notification that an update is
+available for the application. They can then choose to update the application
+to the latest version.</p>
+
+<p>Before uploading the updated application, be sure that you have incremented
+the <code>android:versionCode</code> and <code>android:versionName</code>
+attributes in the <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html"><code><manifest></code></a>
+element of the manifest file. Also, the package name must be the same as the existing version and
+the {@code .apk} file must be signed with the same private key. If the package name and signing
+certificate do <em>not</em> match those of the existing version, Google Play will
+consider it a new application, publish it as such, and will not offer it to existing users as an
+update.</p>
+
+<p>If you plan to publish your application on Google Play, you must make sure
+ that it meets the requirements listed below, which are enforced by Google Play
+ when you upload the application.</p>
+
+<h2 id="marketLicensing">Using Google Play Licensing Service</h2>
+
+<p>Google Play offers a licensing service that lets you enforce licensing
+policies for paid applications that you publish through Google Play. With
+Google Play Licensing, your applications can query Google Play at runtime
+to obtain the licensing status for the current user, then allow or disallow
+further use of the application as appropriate. Using the service, you can apply a flexible
+licensing policy on an application-by-application basis—each
+application can enforce its licensing status in the way most appropriate
+for it. </p>
+
+<p>Any application that you publish through Google Play can use the Google
+Play Licensing Service. The service uses no dedicated framework APIs, so you can
+add licensing to any application that uses a minimum API Level of 3 or
+higher.</p>
+
+<p>For complete information about Google Play Licensing Service and how to
+use it in your application, read <a
+href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a>.</p>
+
+<h2 id="marketinappbilling">Using Google Play In-app Billing</h2>
+
+<p><a href="{@docRoot}guide/google/play/billing/billing_overview.html">Google Play In-app Billing</a>
+is a Google Play service that lets you sell digital content in your applications. You can use
+the service to sell a wide range of content, including downloadable content such as media files or
+photos, and virtual content such as game levels or potions.</p>
+
+<p>When you use Google Play's in-app billing service to sell an item, Google Play handles all
+billing details so your application never has to directly process any financial transactions.
+Google Play uses the same checkout service that is used for application purchases, so your users
+experience a consistent and familiar purchase flow (see figure 1). Also, the transaction fee for
+in-app purchases is the same as the transaction fee for application purchases (30%).</p>
+
+<p>Any application that you publish through Google Play can implement in-app billing. No special
+account or registration is required other than a Google Play publisher account and a Google
+Checkout Merchant account. Also, because the service uses no dedicated framework APIs, you can add
+in-app billing to any application that uses a minimum API level of 4 or higher.</p>
+
+<p>To help you integrate in-app billing into your application, the Android SDK provides a <a
+href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">sample application</a>
+that demonstrates a simple implementation of in-app billing. The sample application contains
+examples of billing-related classes you can use to implement in-app billing in your application. It
+also contains examples of the database, user interface, and business logic you might use to
+implement in-app billing. For more information about the in-app billing feature, see the
+<a href="{@docRoot}guide/google/play/billing/index.html">In-app Billing documentation</a>.</p>
+
+<h2 id="marketintent">Linking to Your Apps on Google Play</h2>
+
+<p>To help users discover your published applications, you can use two special Google Play URIs
+that direct users to your application's details page or perform a search for all of your published
+applications on Google Play. You can use these URIs to create a button in your application or a
+link on a web page that:</p>
+
+<ul>
+ <li>Opens your application's details page in the Google Play application or web site.</li>
+ <li>Searches for all your published applications in the Google Play application or web
+site.</li>
+</ul>
+
+<p>You can launch the Google Play application or web site in the following ways:</p>
+<ul>
+ <li>Initiate an {@link android.content.Intent} from your application that launches the
+Google Play application on the user's device.</li>
+ <li>Provide a link on a web page that opens the Google Play web site (but will also
+open the Google Play application if clicked from a device).</li>
+</ul>
+
+<p>In both cases, whether you want to initiate the action from your application or from a web
+page, the URIs are quite similar. The only difference is the URI prefix.</p>
+
+<p>To open the Google Play application from your application, the prefix for the intent's data
+URI is:</p>
+
+<p style="margin-left:2em"><code>market://</code></p>
+
+<p>To open Google Play store from your web site, the prefix for the link URI is:</p>
+
+<p style="margin-left:2em"><code>http://play.google.com/store/</code></p>
+
+<p>The following sections describe how to create a complete URI for each action.</p>
+
+<p class="note"><strong>Note:</strong> If you create a link to open Google Play from your web
+site and the user selects it from an Android-powered device, the device's Google Play application will
+resolve the link so the user can use the Google Play application on the device instead of opening the web
+site. As such, you should always use {@code http://play.google.com/store/apps/...} URIs when
+creating a link on
+a web page. When pointing to your apps from within your Android app, use the
+{@code market://} URIs in an intent, so that the Google Play application always opens.</p>
+
+
+<h3 id="OpeningDetails">Opening an app's details page</h3>
+
+<p>As described above, you can open the details page for a specific application either on the
+Google Play application or the Google Play web site. The details page allows the user to see
+the application description, screenshots, reviews and more, and choose to install it.</p>
+
+<p>The format for the URI that opens the details page is:</p>
+
+<p style="margin-left:2em"><code><URI_prefix><b>apps/details?id=</b><package_name></code></p>
+
+<p>The <code><package_name></code> is a placeholder for the target application's
+fully-qualified package name, as declared in the <a
+href="{@docRoot}guide/topics/manifest/manifest-element.html#package">{@code
+package}</a> attribute of the <a href="{@docRoot}guide/topics/manifest/manifest-element.html">{@code
+<manifest>}</a> element.</p>
+
+<p>For example: <code>http://play.google.com/store/apps/details?id=com.example.myapp</code></p>
+
+
+<h4>Opening the app details page from your Android app</h4>
+
+<p>To open the Google Play details page from your application,
+create an intent with the {@link android.content.Intent#ACTION_VIEW} action and include a data URI
+in this format:</p>
+
+<p style="margin-left:2em"><code>market://details?id=<package_name></code></p>
+
+<p>For example, here's how you can create an intent and open an application's details page in
+Google Play:</p>
+
+<pre>
+Intent intent = new Intent(Intent.ACTION_VIEW);
+intent.setData(Uri.parse("market://details?id=com.example.android"));
+startActivity(intent);
+</pre>
+
+<p>This will open the Google Play application on the device to view the {@code
+com.example.android} application.</p>
+
+
+<h4>Opening the app details page from a web site</h4>
+
+<p>To open the details page from your web site, create a link with a URI in this
+format:</p>
+
+<p style="margin-left:2em">
+ <code>http://play.google.com/store/apps/details?id=<package_name></code>
+</p>
+
+<p>For example, here's a link that opens an application's details page on Google Play:</p>
+
+<pre>
+<a href="http://play.google.com/store/apps/details?id=com.example.android">App Link</a>
+</pre>
+
+<p>When clicked from a desktop web browser, this opens the Google Play web site to view the
+{@code com.example.android} application. When clicked from an Android-powered device, users are
+given the option to use either their web browser or the Google Play application to view the
+application.</p>
+
+
+
+<h3 id="PerformingSearch">Performing a search</h3>
+
+<p>To initiate a search on Google Play, the format for the URI is:</p>
+
+<p style="margin-left:2em">
+ <code><URI_prefix><b>search?q=</b><query></code>
+</p>
+
+<p>The <code><query></code> is a placeholder for the search query to execute in Google
+Play. The query can be a raw text string or you can include a parameter that performs a search
+based on the publisher name:</p>
+
+<ul>
+ <li>To perform a raw text search, append the query string:
+ <p><code><URI_prefix><b>search?q=</b><search_query></code></p></li>
+
+ <li>To search based on the publisher name, use the {@code pub:} parameter in the query, followed
+by the publisher name:
+ <p><code><URI_prefix><b>search?q=pub:</b><publisher_name></code></p>
+ <p>You can use this type of search to show all of your published applications.</p></li>
+</ul>
+
+
+<h4>Searching from your Android app</h4>
+
+<p>To initiate a search on Google Play from your application, create an intent with the
+{@link android.content.Intent#ACTION_VIEW} action and include a data URI in this format:</p>
+
+<p style="margin-left:2em"><code>market://search?q=<query></code></p>
+
+<p>The query may include the {@code pub:} parameter described above.</p>
+
+<p>For example, here's how you can initiate a search in the Google Play application, based on the
+publisher name:</p>
+
+<pre>
+Intent intent = new Intent(Intent.ACTION_VIEW);
+intent.setData(Uri.parse("market://search?q=pub:Your Publisher Name"));
+startActivity(intent);
+</pre>
+
+<p>This opens the Google Play application to perform the search. The search result shows all
+applications published by the publisher that are compatible with the current device.</p>
+
+
+<h4>Searching from a web site</h4>
+
+<p>To initiate a search on Google Play from your web site, create a link with a URI in this
+format:</p>
+
+<p style="margin-left:2em">
+ <code>http://play.google.com/store/search?q=<query></code>
+</p>
+
+<p>The query may include the {@code pub:} parameter described above.</p>
+
+<p>For example, here's a link that initiates a search on Google Play, based on the
+publisher name:</p>
+
+<pre>
+<a href="http://play.google.com/store/search?q=pub:Your Publisher Name">Search Link</a>
+</pre>
+
+<p>When clicked from a desktop web browser, this opens the Google Play web site and performs the
+search. When clicked from an Android-powered device, users are given the option to use either their
+web browser or the Google Play application to perform the search.</p>
+
+
+
+<h3 id="BuildaButton">Build a Google Play button</h3>
+
+<p>Use the following form to create a button for your web site that takes users to your application
+on Google Play. Input either your application's package name or your publisher name and the button
+will take users to Google Play to either view your application's information or view a list of your
+published apps. If users click the button while on an Android-powered device, the Google Play
+application will respond to show users your application(s).</p>
+
+<p>This form offers two styles of the official brand badge each at recommended sizes. You can pick
+between either "Get it on Google Play" or "Android app on Google Play." You should not modify the
+badge images in any way. For more usage guidelines,
+see the <a href="http://www.android.com/branding.html">Android Brand Guidelines</a>.</p>
+
+<style type="text/css">
+
+form.button-form {
+ margin-top:2em;
+}
+
+/* the label and input elements are blocks that float left in order to
+ keep the left edgets of the input aligned, and IE 6/7 do not fully support "inline-block" */
+label.block {
+ display: block;
+ float: left;
+ width: 100px;
+ padding-right: 10px;
+}
+
+input.text {
+ display: block;
+ float: left;
+ width: 250px;
+}
+
+div.button-row {
+ white-space:nowrap;
+ min-height:80px;
+}
+
+div.button-row input {
+ vertical-align:120%;
+}
+
+#jd-content div.button-row img {
+ margin: 0;
+}
+
+</style>
+
+<script type="text/javascript">
+
+// variables for creating 'try it out' demo button
+var imagePath = "http://www.android.com/images/brand/"
+var linkStart = "<a href=\"http://play.google.com/store/";
+var imageStart = "\">\n"
+ + " <img alt=\"";
+ // leaves opening for the alt text value
+var imageSrc = "\"\n src=\"" + imagePath;
+ // leaves opening for the image file name
+var imageEnd = ".png\" />\n</a>";
+
+// variables for creating code snippet
+var linkStartCode = "<a href=\"http://play.google.com/store/";
+var imageStartCode = "\">\n"
+ + " <img alt=\"";
+ // leaves opening for the alt text value
+var imageSrcCode = "\"\n src=\"" + imagePath;
+ // leaves opening for the image file name
+var imageEndCode = ".png\" />\n</a>";
+
+/** Generate the HTML snippet and demo based on form values */
+function buildButton(form) {
+ var selectedValue = $('form input[type=radio]:checked').val();
+ var altText = selectedValue.indexOf("get_it") != -1 ? "Get it on Google Play" : "Android app on Google Play";
+
+ if (form["package"].value != "com.example.android") {
+ $("#preview").show();
+ $("#snippet").show().html(linkStartCode + "apps/details?id=" + form["package"].value
+ + imageStartCode + altText + imageSrcCode
+ + selectedValue + imageEndCode);
+ $("#button-preview").html(linkStart + "apps/details?id=" + form["package"].value
+ + imageStart + altText + imageSrc
+ + selectedValue + imageEnd);
+ } else if (form["publisher"].value != "Example, Inc.") {
+ $("#preview").show();
+ $("#snippet").show().html(linkStartCode + "search?q=pub:" + form["publisher"].value
+ + imageStartCode + altText + imageSrcCode
+ + selectedValue + imageEndCode);
+ $("#button-preview").html(linkStart + "search?q=pub:" + form["publisher"].value
+ + imageStart + altText + imageSrc
+ + selectedValue + imageEnd);
+ } else {
+ alert("Please enter your package name or publisher name");
+ }
+ return false;
+}
+
+/** Listen for Enter key */
+function onTextEntered(event, form, me) {
+ // 13 = enter
+ if (event.keyCode == 13) {
+ buildButton(form);
+ }
+}
+
+/** When input is focused, remove example text and disable other input */
+function onInputFocus(object, example) {
+ if (object.value == example) {
+ $(object).val('').css({'color' : '#000'});
+ }
+ $('input[type="text"]:not(input[name='+object.name+'])',
+ object.parentNode).attr('disabled','true');
+ $('#'+object.name+'-clear').show();
+}
+
+/** When input is blured, restore example text if appropriate and enable other input */
+function onInputBlur(object, example) {
+ if (object.value.length < 1) {
+ $(object).attr('value',example).css({'color':'#ccc'});
+ $('input[type="text"]', object.parentNode).removeAttr('disabled');
+ $('#'+object.name+'-clear').hide();
+ }
+}
+
+/** Clear the form to start over */
+function clearLabel(id, example) {
+ $("#preview").hide();
+ $('#'+id+'').html('').attr('value',example).css({'color':'#ccc'});
+ $('input[type="text"]', $('#'+id+'').parent()).removeAttr('disabled');
+ $('#'+id+'-clear').hide();
+ return false;
+}
+
+/** When the doc is ready, find the inputs and color the input grey if the value is the example
+ text. This is necessary to handle back-navigation, which can auto-fill the form with previous
+ values (and text should not be grey) */
+$(document).ready(function() {
+ $(".button-form input.text").each(function(index) {
+ if ($(this).val() == $(this).attr("default")) {
+ $(this).css("color","#ccc");
+ } else {
+ /* This is necessary to handle back-navigation to the page after form was filled */
+ $('input[type="text"]:not(input[name='+this.name+'])',
+ this.parentNode).attr('disabled','true');
+ $('#'+this.name+'-clear').show();
+ }
+ });
+});
+
+</script>
+
+<form class="button-form">
+ <label class="block" for="package">Package name:</label>
+ <input class="text" type="text" id="package" name="package"
+ value="com.example.android"
+ default="com.example.android"
+ onfocus="onInputFocus(this, 'com.example.android')"
+ onblur="onInputBlur(this, 'com.example.android')"
+ onkeyup="return onTextEntered(event, this.parentNode, this)"/>
+ <a id="package-clear" style="display:none" href="#"
+ onclick="return clearLabel('package','com.example.android');">clear</a>
+ <p style="clear:both;margin:0"> <em>or</em></p>
+ <label class="block" style="margin-top:5px" for="publisher">Publisher name:</label>
+ <input class="text" type="text" id="publisher" name="publisher"
+ value="Example, Inc."
+ default="Example, Inc."
+ onfocus="onInputFocus(this, 'Example, Inc.')"
+ onblur="onInputBlur(this, 'Example, Inc.')"
+ onkeyup="return onTextEntered(event, this.parentNode, this)"/>
+ <a id="publisher-clear" style="display:none" href="#"
+ onclick="return clearLabel('publisher','Example, Inc.');">clear</a>
+ <br/><br/>
+
+<div class="button-row">
+ <input type="radio" name="buttonStyle" value="get_it_on_play_logo_small" id="ns" checked="checked" />
+ <label for="ns"><img src="http://www.android.com/images/brand/get_it_on_play_logo_small.png"
+alt="Get it on Google Play (small)" /></label>
+
+ <input type="radio" name="buttonStyle" value="get_it_on_play_logo_large" id="nm" />
+ <label for="nm"><img src="http://www.android.com/images/brand/get_it_on_play_logo_large.png"
+alt="Get it on Google Play (large)" /></label>
+</div>
+
+<div class="button-row">
+ <input type="radio" name="buttonStyle" value="android_app_on_play_logo_small" id="ws" />
+ <label for="ws"><img src="http://www.android.com/images/brand/android_app_on_play_logo_small.png"
+alt="Android app on Google Play (small)" /></label>
+
+ <input type="radio" name="buttonStyle" value="android_app_on_play_logo_large" id="wm" />
+ <label for="wm"><img src="http://www.android.com/images/brand/android_app_on_play_logo_large.png"
+alt="Android app on Google Play (large)" /></label>
+</div>
+
+ <input type="button" onclick="return buildButton(this.parentNode)" value="Build my button"
+style="padding:5px" />
+ <br/>
+</form>
+
+<div id="preview" style="display:none">
+ <p>Copy and paste this HTML into your web site:</p>
+ <textarea id="snippet" cols="100" rows="5" onclick="this.select()"
+style="font-family:monospace;background-color:#efefef;padding:5px;display:none;margin-bottom:1em">
+ </textarea >
+
+<p>Try it out:</p>
+<div id="button-preview" style="margin-top:1em"></div>
+</div>
+
+
+
+
+
+
+<h3 id="UriSummary">Summary of URI formats</h3>
+
+<p>The table below provides a summary of the URIs currently supported by the Google Play (both on
+the web and in the Android application), as discussed in the previous sections.</p>
+
+<table>
+<tr>
+<th>For this result</th>
+<th>Use this URI in a web page link</th>
+<th>Or this URI in an {@link android.content.Intent#ACTION_VIEW} intent</th>
+</tr>
+
+<tr>
+<td>Display the details screen for a specific application</td>
+<td><code>http://play.google.com/store/apps/details?id=<package_name></code>
+<td><code>market://details?id=<package_name></code></td>
+</tr>
+
+<tr>
+<td>Search for applications using a general string query.</td>
+<td><code>http://play.google.com/store/search?q=<query></code></td>
+<td><code>market://search?q=<query></code></td>
+</tr>
+
+<tr>
+<td>Search for applications by publisher name</td>
+<td><nobr><code>http://play.google.com/store/search?q=pub:<publisher_name></code></nobr></td>
+<td><nobr><code>market://search?q=pub:<publisher_name></code></nobr></td>
+</tr>
+
+</table>
diff --git a/docs/html/tools/workflow/publishing/publishing_overview.jd b/docs/html/tools/workflow/publishing/publishing_overview.jd
new file mode 100755
index 0000000..ca0dca8
--- /dev/null
+++ b/docs/html/tools/workflow/publishing/publishing_overview.jd
@@ -0,0 +1,231 @@
+page.title=Publishing Overview
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>Quickview</h2>
+ <ul>
+ <li>Learn how to publish Android apps.</li>
+ <li>Find out how to prepare apps for release.</li>
+ <li>Learn how to release apps to users.</li>
+ </ul>
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#publishing-prepare">Preparing Your Application for Release</a></li>
+ <li><a href="#publishing-release">Releasing Your Application to Users</a>
+ <ol>
+ <li><a href="#publishing-market">Releasing on Google Play</a></li>
+ <li><a href="#publishing-website">Releasing on your own website</a></li>
+ <li><a href="#publishing-email">Releasing through email</a></li>
+ </ol>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}tools/publishing/preparing.html">Preparing for
+ Release</a></li>
+ <li><a href="{@docRoot}tools/publishing/publishing.html">Publishing on Google Play</a></li>
+ </ol>
+</div>
+</div>
+
+<p>Publishing is the process that makes your Android applications available to users. When you
+publish an Android application you perform two main tasks:</p>
+
+<ul>
+ <li>You prepare the application for release.
+ <p>During the preparation step you build a release version of your application, which users can
+ download and install on their Android-powered devices.</p>
+ </li>
+ <li>You release the application to users.
+ <p>During the release step you publicize, sell, and distribute the release version of your
+ application to users.</p>
+ </li>
+</ul>
+
+<p>Usually, you release your application through an application marketplace, such as Google Play.
+However, you can also release applications by sending them directly to users or by letting users
+download them from your own website.</p>
+
+<p>Figure 1 shows how the publishing process fits into the overall Android <a
+href="{@docRoot}tools/workflow/index.html">application development process</a>.
+The publishing process is typically performed after you finish testing your application in a debug
+environment. Also, as a best practice, your application should meet all of your release criteria for
+functionality, performance, and stability before you begin the publishing process.</p>
+
+<img src="{@docRoot}images/publishing/publishing_overview.png" alt="Shows where the publishing
+ process fits into the overall development process" height="86" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Publishing is the last phase of the Android <a
+href="{@docRoot}tools/workflow/index.html">application development process</a>.
+</p>
+
+<h2 id="publishing-prepare">Preparing Your Application for Release</h2>
+
+<p>Preparing your application for release is a multi-step process that involves the following
+tasks:</p>
+
+<ul>
+
+ <li>Configuring your application for release.
+ <p>At a minimum you need to remove {@link android.util.Log} calls and remove the
+ <a href="{@docRoot}guide/topics/manifest/application-element.html#debug">android:debuggable</a>
+ attribute from your manifest file. You should also provide values for the
+ <code>android:versionCode</code> and <code>android:versionName</code> attributes, which are
+ located in the
+ <a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a>
+ element. You may also have to configure several other settings to meet Google Play
+ requirements or accomodate whatever method you're using to release your application.</p>
+ </li>
+ <li>Building and signing a release version of your application.
+ <p>The Android Development Tools (ADT) plugin and the Ant build script that are provided
+ with the Android SDK tools provide everything you need to build and sign a release version of
+ your application.</p>
+ </li>
+ <li>Testing the release version of your application.
+ <p>Before you distribute your application, you should thoroughly test the release version on at
+ least one target handset device and one target tablet device.</p>
+ </li>
+ <li>Updating application resources for release.
+ <p>You need to be sure that all application resources such as multimedia files and graphics
+ are updated and included with your application or staged on the proper production servers.</p>
+ </li>
+ <li>Preparing remote servers and services that your application depends on.
+ <p>If your application depends on external servers or services, you need to be sure they
+ are secure and production ready.</p>
+ </li>
+</ul>
+
+<p>You may have to perform several other tasks as part of the preparation process. For example, you
+will need to get a private key for signing your application, and you may need to get a Maps API
+release key if you are using the <a
+href="http://code.google.com/android/add-ons/google-apis/maps-overview.html">Google Maps external
+library</a>. You will also need to create an icon for your application, and you may want to prepare
+an End User License Agreement (EULA) to protect your person, organization, and intellectual
+property.</p>
+
+<p>When you are finished preparing your application for release you will have a signed
+<code>.apk</code> file that you can distribute to users.</p>
+
+<p>To learn how to prepare your application for release, see <a
+href="{@docRoot}tools/publishing/preparing.html">Preparing for Release</a> in the Dev Guide. This
+topic provides step-by-step instructions for configuring and building a release version of your
+application.</p>
+
+<h2 id="publishing-release">Releasing Your Application to Users</h2>
+
+<p>You can release your Android applications several ways. Usually, you release applications
+through an application marketplace, such as Google Play, but you can also release applications
+on your own website or by sending an application directly to a user. Google Play is the
+recommended marketplace for Android applications and is particularly useful if you want to
+distribute your applications to a large global audience. The other two release methods—server
+distribution and email distribution—are useful if you are releasing an application to a small
+group of users (for example, a work group in an enterprise environment), or if you do not want to
+make your application available to the general public.</p>
+
+<h3 id="publishing-market">Releasing Your Applications on Google Play</h3>
+
+<p>Google Play is a robust publishing platform that helps you publicize, sell, and distribute
+your Android applications to users around the world. When you release your applications through
+Google Play you have access to a suite of developer tools that let you analyze your sales,
+identify market trends, and control who your applications are being distributed to. You also have
+access to several revenue-enhancing features that are not available anywhere else, such as <a
+href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> and <a
+href="{@docRoot}guide/google/play/licensing.html">application licensing</a>. This rich array of tools
+and features, coupled with numerous end-user community features, makes Google Play the premier
+marketplace for selling and buying Android applications.</p>
+
+<p>Releasing your application on Google Play is a simple process that involves three basic
+ steps:</p>
+
+<div class="figure" style="width:275px">
+ <img src="{@docRoot}images/publishing/publishing_unknown_sources.png"
+ alt="Screenshot showing the graphical user interface element that allows unknown sources
+ to be installed" />
+ <p class="img-caption">
+ <strong>Figure 2.</strong> The <strong>Unknown sources</strong> setting lets you install
+ applications that are not published on Google Play .
+ </p>
+</div>
+
+<ul>
+ <li>Preparing promotional materials.
+ <p>To fully leverage the marketing and publicity capabilities of Google Play, you need to
+ create promotional materials for your application, such as screenshots, videos, graphics, and
+ promotional text.</p>
+ </li>
+ <li>Configuring options and uploading assets.
+ <p>Google Play lets you target your application to a worldwide pool of users and devices.
+ By configuring various Google Play settings, you can choose the countries you want to
+ reach, the listing languages you want to use, and the price you want to charge in each
+ country. You can also configure listing details such as the application type, category, and
+ content rating. When you are done configuring options you can upload your promotional materials
+ and your application as a draft (unpublished) application.</p>
+ </li>
+ <li>Publishing the release version of your application.
+ <p>If you are satisfied that your publishing settings are correctly configured and your
+ uploaded application is ready to be released to the public, you can simply click
+ <strong>Publish</strong > in the developer console and within minutes your application will be
+ live and available for download around the world.</p>
+ </li>
+</ul>
+
+<p>For information about Google Play, see <a
+href="{@docRoot}tools/publishing/publishing.html#market">Publishing on Google Play</a>. This
+topic provides an introduction to Google Play features and provides a step-by-step guide for
+distributing your applications on Google Play.</p>
+
+<h3 id="publishing-website">Releasing your application on your own website</h3>
+
+<p>If you do not want to release your application on an application marketplace like Google Play,
+you can release your application by making it available for download on your own website or server.
+To do this, you must first prepare your application for release (that is, you must build it for
+release and sign it). Then all you need to do is host the release-ready application on your website
+and provide a download link for the application. When users browse to your website with their
+Android-powered devices and download your application, the Android system will automatically start
+installing the application on the device. However, the installation process will start automatically
+only if the user has configured their device to allow the installation of non-Google Play
+applications.</p>
+
+<div class="figure" style="width:275px">
+ <img src="{@docRoot}images/publishing/publishing_via_email.png"
+ alt="Screenshot showing the graphical user interface users see when you send them an app"
+ height="453" />
+ <p class="img-caption">
+ <strong>Figure 3.</strong> Users can simply click <strong>Install</strong> when you send them
+ an application via email.
+ </p>
+</div>
+
+<p>By default, Android-powered devices allow users to install applications only if the applications
+have been downloaded from Google Play. To allow the installation of applications from other
+sources, users need to enable the <strong>Unknown sources</strong> setting on their devices, and
+they need to make this configuration change before they download your application to their
+device (see figure 2).</p>
+
+<p class="note"><strong>Note:</strong> Some network providers do not allow users to install
+applications from unknown sources.</p>
+
+<p>Although it is relatively easy to release your application on your own website, it can be
+inefficient and cumbersome. For example, if you want to monetize your application you will
+have to process and track all financial transactions yourself and you will not be able to use
+Google Play's in-app billing feature to sell in-app products. In addition, you will not be
+able to use the licensing feature to help prevent unauthorized installation and use of your
+application.</p>
+
+<h3 id="publishing-email">Releasing your application through email</h3>
+
+<p>The easiest and quickest way to release your application is to send it to a user through
+email. To do this, you prepare your application for release and then attach it to an email
+and send it to a user. When the user opens your email message on their Android-powered device
+the Android system will recognize the <code>.apk</code> and display an <strong>Install Now</strong>
+button in the email message (see figure 3). Users can install your application by touching the
+button.</p>
+
+<p class="note"><strong>Note:</strong> The <strong>Install Now</strong> button appears only if a
+user has configured their device to allow the installation of non-Google Play applications and
+they open your email with the native Gmail application.</p>
+
+<p>Releasing applications through email is convenient if you are sending your application to
+only a few trusted users, but it provides few protections from piracy and unauthorized
+distribution; that is, anyone you send your application to can simply forward it to someone else.
+else.
diff --git a/docs/html/tools/workflow/publishing/versioning.jd b/docs/html/tools/workflow/publishing/versioning.jd
new file mode 100644
index 0000000..e0b4435
--- /dev/null
+++ b/docs/html/tools/workflow/publishing/versioning.jd
@@ -0,0 +1,174 @@
+page.title=Versioning Your Applications
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Quickview</h2>
+
+<ul>
+<li>Your application <em>must</em> be versioned</a></li>
+<li>You set the version in the application's manifest file</li>
+<li>How you version your applications affects how users upgrade </li>
+<li>Determine your versioning strategy early in the development process, including considerations for future releases.</li>
+</ul>
+
+<h2>In this document</h2>
+
+<ol>
+<li><a href="#appversioning">Setting Application Version</a></li>
+<li><a href="#minsdkversion">Specifying Your Application's System API Requirements</a>
+</ol>
+
+
+<h2>See also</h2>
+
+<ol>
+<li><a href="{@docRoot}tools/publishing/preparing.html">Preparing to Publish Your Application</a></li>
+<li><a href="{@docRoot}tools/publishing/publishing.html#market">Publishing On Google Play</a></li>
+<li><a href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>Versioning is a critical component of your application upgrade and maintenance
+strategy. Versioning is important because:</p>
+
+<ul>
+<li>Users need to have specific information about the application version that
+is installed on their devices and the upgrade versions available for
+installation. </li>
+<li>Other applications — including other applications that you publish as
+a suite — need to query the system for your application's version, to
+determine compatibility and identify dependencies.</li>
+<li>Services through which you will publish your application(s) may also need to
+query your application for its version, so that they can display the version to
+users. A publishing service may also need to check the application version to
+determine compatibility and establish upgrade/downgrade relationships.</li>
+</ul>
+
+<p>The Android system does not use app version information to enforce
+restrictions on upgrades, downgrades, or compatibility of third-party apps. Instead, you (the
+developer) are responsible for enforcing version restrictions within your application or by
+informing users of the version restrictions and limitations. The Android system does, however,
+enforce system version compatibility as expressed by the <code>minSdkVersion</code> attribute in the
+manifest. This attribute allows an application to specify the minimum system API with which it is
+compatible. For more information see <a href="#minsdkversion">Specifying Minimum System API
+Version</a>.</p>
+
+<h2 id="appversioning">Setting Application Version</h2>
+<p>To define the version information for your application, you set attributes in
+the application's manifest file. Two attributes are available, and you should
+always define values for both of them: </p>
+
+<ul>
+<li><code>android:versionCode</code> — An integer value that represents
+the version of the application code, relative to other versions.
+
+<p>The value is an integer so that other applications can programmatically
+evaluate it, for example to check an upgrade or downgrade relationship. You can
+set the value to any integer you want, however you should make sure that each
+successive release of your application uses a greater value. The system does not
+enforce this behavior, but increasing the value with successive releases is
+normative. </p>
+
+<p>Typically, you would release the first version of your application with
+versionCode set to 1, then monotonically increase the value with each release,
+regardless whether the release constitutes a major or minor release. This means
+that the <code>android:versionCode</code> value does not necessarily have a
+strong resemblance to the application release version that is visible to the
+user (see <code>android:versionName</code>, below). Applications and publishing
+services should not display this version value to users.</p>
+</li>
+<li><code>android:versionName</code> — A string value that represents the
+release version of the application code, as it should be shown to users.
+<p>The value is a string so that you can describe the application version as a
+<major>.<minor>.<point> string, or as any other type of
+absolute or relative version identifier. </p>
+
+<p>As with <code>android:versionCode</code>, the system does not use this value
+for any internal purpose, other than to enable applications to display it to
+users. Publishing services may also extract the <code>android:versionName</code>
+value for display to users.</p>
+</li>
+</ul>
+
+<p>You define both of these version attributes in the
+<code><manifest></code> element of the manifest file. </p>
+
+<p>Here's an example manifest that shows the <code>android:versionCode</code>
+and <code>android:versionName</code> attributes in the
+<code><manifest></code> element. </p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.package.name"
+ android:versionCode="2"
+ android:versionName="1.1">
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+ ...
+ </application>
+</manifest>
+</pre>
+
+<p>In this example, note that <code>android:versionCode</code> value indicates
+that the current .apk contains the second release of the application code, which
+corresponds to a minor follow-on release, as shown by the
+<code>android:versionName</code> string. </p>
+
+<p>The Android framework provides an API to let applications query the system
+for version information about your application. To obtain version information,
+applications use the
+{@link android.content.pm.PackageManager#getPackageInfo(java.lang.String, int)}
+method of {@link android.content.pm.PackageManager PackageManager}. </p>
+
+<h2 id="minsdkversion">Specifying Your Application's System API Requirements</h2>
+
+<p>If your application requires a specific minimum version of the Android
+platform, or is designed only to support a certain range of Android platform
+versions, you can specify those version requirements as API Level identifiers
+in the application's manifest file. Doing so ensures that your
+application can only be installed on devices that
+are running a compatible version of the Android system. </p>
+
+<p>To specify API Level requirements, add a <code><uses-sdk></code>
+element in the application's manifest, with one or more of these attributes: </p>
+
+<ul>
+<li><code>android:minSdkVersion</code> — The minimum version
+of the Android platform on which the application will run, specified
+by the platform's API Level identifier. </li>
+<li><code>android:targetSdkVersion</code> — Specifies the API Level
+on which the application is designed to run. In some cases, this allows the
+application to use manifest elements or behaviors defined in the target
+API Level, rather than being restricted to using only those defined
+for the minimum API Level.</li>
+<li><code>android:maxSdkVersion</code> — The maximum version
+of the Android platform on which the application is designed to run,
+specified by the platform's API Level identifier. <strong>Important:</strong> Please read the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+documentation before using this attribute. </li>
+</ul>
+
+<p>When preparing to install your application, the system checks the value of this
+attribute and compares it to the system version. If the
+<code>android:minSdkVersion</code> value is greater than the system version, the
+system aborts the installation of the application. Similarly, the system
+installs your application only if its <code>android:maxSdkVersion</code>
+is compatible with the platform version.</p>
+
+<p>If you do not specify these attributes in your manifest, the system assumes
+that your application is compatible with all platform versions, with no
+maximum API Level. </p>
+
+<p>To specify a minimum platform version for your application, add a
+<code><uses-sdk></code> element as a child of
+<code><manifest></code>, then define the
+<code>android:minSdkVersion</code> as an attribute. </p>
+
+<p>For more information, see the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+manifest element documentation and the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Levels</a> document.</p>
diff --git a/docs/html/tools/workflow/publishing_overview.jd b/docs/html/tools/workflow/publishing_overview.jd
new file mode 100755
index 0000000..ca0dca8
--- /dev/null
+++ b/docs/html/tools/workflow/publishing_overview.jd
@@ -0,0 +1,231 @@
+page.title=Publishing Overview
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>Quickview</h2>
+ <ul>
+ <li>Learn how to publish Android apps.</li>
+ <li>Find out how to prepare apps for release.</li>
+ <li>Learn how to release apps to users.</li>
+ </ul>
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#publishing-prepare">Preparing Your Application for Release</a></li>
+ <li><a href="#publishing-release">Releasing Your Application to Users</a>
+ <ol>
+ <li><a href="#publishing-market">Releasing on Google Play</a></li>
+ <li><a href="#publishing-website">Releasing on your own website</a></li>
+ <li><a href="#publishing-email">Releasing through email</a></li>
+ </ol>
+ </ol>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}tools/publishing/preparing.html">Preparing for
+ Release</a></li>
+ <li><a href="{@docRoot}tools/publishing/publishing.html">Publishing on Google Play</a></li>
+ </ol>
+</div>
+</div>
+
+<p>Publishing is the process that makes your Android applications available to users. When you
+publish an Android application you perform two main tasks:</p>
+
+<ul>
+ <li>You prepare the application for release.
+ <p>During the preparation step you build a release version of your application, which users can
+ download and install on their Android-powered devices.</p>
+ </li>
+ <li>You release the application to users.
+ <p>During the release step you publicize, sell, and distribute the release version of your
+ application to users.</p>
+ </li>
+</ul>
+
+<p>Usually, you release your application through an application marketplace, such as Google Play.
+However, you can also release applications by sending them directly to users or by letting users
+download them from your own website.</p>
+
+<p>Figure 1 shows how the publishing process fits into the overall Android <a
+href="{@docRoot}tools/workflow/index.html">application development process</a>.
+The publishing process is typically performed after you finish testing your application in a debug
+environment. Also, as a best practice, your application should meet all of your release criteria for
+functionality, performance, and stability before you begin the publishing process.</p>
+
+<img src="{@docRoot}images/publishing/publishing_overview.png" alt="Shows where the publishing
+ process fits into the overall development process" height="86" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Publishing is the last phase of the Android <a
+href="{@docRoot}tools/workflow/index.html">application development process</a>.
+</p>
+
+<h2 id="publishing-prepare">Preparing Your Application for Release</h2>
+
+<p>Preparing your application for release is a multi-step process that involves the following
+tasks:</p>
+
+<ul>
+
+ <li>Configuring your application for release.
+ <p>At a minimum you need to remove {@link android.util.Log} calls and remove the
+ <a href="{@docRoot}guide/topics/manifest/application-element.html#debug">android:debuggable</a>
+ attribute from your manifest file. You should also provide values for the
+ <code>android:versionCode</code> and <code>android:versionName</code> attributes, which are
+ located in the
+ <a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a>
+ element. You may also have to configure several other settings to meet Google Play
+ requirements or accomodate whatever method you're using to release your application.</p>
+ </li>
+ <li>Building and signing a release version of your application.
+ <p>The Android Development Tools (ADT) plugin and the Ant build script that are provided
+ with the Android SDK tools provide everything you need to build and sign a release version of
+ your application.</p>
+ </li>
+ <li>Testing the release version of your application.
+ <p>Before you distribute your application, you should thoroughly test the release version on at
+ least one target handset device and one target tablet device.</p>
+ </li>
+ <li>Updating application resources for release.
+ <p>You need to be sure that all application resources such as multimedia files and graphics
+ are updated and included with your application or staged on the proper production servers.</p>
+ </li>
+ <li>Preparing remote servers and services that your application depends on.
+ <p>If your application depends on external servers or services, you need to be sure they
+ are secure and production ready.</p>
+ </li>
+</ul>
+
+<p>You may have to perform several other tasks as part of the preparation process. For example, you
+will need to get a private key for signing your application, and you may need to get a Maps API
+release key if you are using the <a
+href="http://code.google.com/android/add-ons/google-apis/maps-overview.html">Google Maps external
+library</a>. You will also need to create an icon for your application, and you may want to prepare
+an End User License Agreement (EULA) to protect your person, organization, and intellectual
+property.</p>
+
+<p>When you are finished preparing your application for release you will have a signed
+<code>.apk</code> file that you can distribute to users.</p>
+
+<p>To learn how to prepare your application for release, see <a
+href="{@docRoot}tools/publishing/preparing.html">Preparing for Release</a> in the Dev Guide. This
+topic provides step-by-step instructions for configuring and building a release version of your
+application.</p>
+
+<h2 id="publishing-release">Releasing Your Application to Users</h2>
+
+<p>You can release your Android applications several ways. Usually, you release applications
+through an application marketplace, such as Google Play, but you can also release applications
+on your own website or by sending an application directly to a user. Google Play is the
+recommended marketplace for Android applications and is particularly useful if you want to
+distribute your applications to a large global audience. The other two release methods—server
+distribution and email distribution—are useful if you are releasing an application to a small
+group of users (for example, a work group in an enterprise environment), or if you do not want to
+make your application available to the general public.</p>
+
+<h3 id="publishing-market">Releasing Your Applications on Google Play</h3>
+
+<p>Google Play is a robust publishing platform that helps you publicize, sell, and distribute
+your Android applications to users around the world. When you release your applications through
+Google Play you have access to a suite of developer tools that let you analyze your sales,
+identify market trends, and control who your applications are being distributed to. You also have
+access to several revenue-enhancing features that are not available anywhere else, such as <a
+href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> and <a
+href="{@docRoot}guide/google/play/licensing.html">application licensing</a>. This rich array of tools
+and features, coupled with numerous end-user community features, makes Google Play the premier
+marketplace for selling and buying Android applications.</p>
+
+<p>Releasing your application on Google Play is a simple process that involves three basic
+ steps:</p>
+
+<div class="figure" style="width:275px">
+ <img src="{@docRoot}images/publishing/publishing_unknown_sources.png"
+ alt="Screenshot showing the graphical user interface element that allows unknown sources
+ to be installed" />
+ <p class="img-caption">
+ <strong>Figure 2.</strong> The <strong>Unknown sources</strong> setting lets you install
+ applications that are not published on Google Play .
+ </p>
+</div>
+
+<ul>
+ <li>Preparing promotional materials.
+ <p>To fully leverage the marketing and publicity capabilities of Google Play, you need to
+ create promotional materials for your application, such as screenshots, videos, graphics, and
+ promotional text.</p>
+ </li>
+ <li>Configuring options and uploading assets.
+ <p>Google Play lets you target your application to a worldwide pool of users and devices.
+ By configuring various Google Play settings, you can choose the countries you want to
+ reach, the listing languages you want to use, and the price you want to charge in each
+ country. You can also configure listing details such as the application type, category, and
+ content rating. When you are done configuring options you can upload your promotional materials
+ and your application as a draft (unpublished) application.</p>
+ </li>
+ <li>Publishing the release version of your application.
+ <p>If you are satisfied that your publishing settings are correctly configured and your
+ uploaded application is ready to be released to the public, you can simply click
+ <strong>Publish</strong > in the developer console and within minutes your application will be
+ live and available for download around the world.</p>
+ </li>
+</ul>
+
+<p>For information about Google Play, see <a
+href="{@docRoot}tools/publishing/publishing.html#market">Publishing on Google Play</a>. This
+topic provides an introduction to Google Play features and provides a step-by-step guide for
+distributing your applications on Google Play.</p>
+
+<h3 id="publishing-website">Releasing your application on your own website</h3>
+
+<p>If you do not want to release your application on an application marketplace like Google Play,
+you can release your application by making it available for download on your own website or server.
+To do this, you must first prepare your application for release (that is, you must build it for
+release and sign it). Then all you need to do is host the release-ready application on your website
+and provide a download link for the application. When users browse to your website with their
+Android-powered devices and download your application, the Android system will automatically start
+installing the application on the device. However, the installation process will start automatically
+only if the user has configured their device to allow the installation of non-Google Play
+applications.</p>
+
+<div class="figure" style="width:275px">
+ <img src="{@docRoot}images/publishing/publishing_via_email.png"
+ alt="Screenshot showing the graphical user interface users see when you send them an app"
+ height="453" />
+ <p class="img-caption">
+ <strong>Figure 3.</strong> Users can simply click <strong>Install</strong> when you send them
+ an application via email.
+ </p>
+</div>
+
+<p>By default, Android-powered devices allow users to install applications only if the applications
+have been downloaded from Google Play. To allow the installation of applications from other
+sources, users need to enable the <strong>Unknown sources</strong> setting on their devices, and
+they need to make this configuration change before they download your application to their
+device (see figure 2).</p>
+
+<p class="note"><strong>Note:</strong> Some network providers do not allow users to install
+applications from unknown sources.</p>
+
+<p>Although it is relatively easy to release your application on your own website, it can be
+inefficient and cumbersome. For example, if you want to monetize your application you will
+have to process and track all financial transactions yourself and you will not be able to use
+Google Play's in-app billing feature to sell in-app products. In addition, you will not be
+able to use the licensing feature to help prevent unauthorized installation and use of your
+application.</p>
+
+<h3 id="publishing-email">Releasing your application through email</h3>
+
+<p>The easiest and quickest way to release your application is to send it to a user through
+email. To do this, you prepare your application for release and then attach it to an email
+and send it to a user. When the user opens your email message on their Android-powered device
+the Android system will recognize the <code>.apk</code> and display an <strong>Install Now</strong>
+button in the email message (see figure 3). Users can install your application by touching the
+button.</p>
+
+<p class="note"><strong>Note:</strong> The <strong>Install Now</strong> button appears only if a
+user has configured their device to allow the installation of non-Google Play applications and
+they open your email with the native Gmail application.</p>
+
+<p>Releasing applications through email is convenient if you are sending your application to
+only a few trusted users, but it provides few protections from piracy and unauthorized
+distribution; that is, anyone you send your application to can simply forward it to someone else.
+else.
diff --git a/docs/html/tools/workflow/versioning.jd b/docs/html/tools/workflow/versioning.jd
new file mode 100644
index 0000000..e0b4435
--- /dev/null
+++ b/docs/html/tools/workflow/versioning.jd
@@ -0,0 +1,174 @@
+page.title=Versioning Your Applications
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Quickview</h2>
+
+<ul>
+<li>Your application <em>must</em> be versioned</a></li>
+<li>You set the version in the application's manifest file</li>
+<li>How you version your applications affects how users upgrade </li>
+<li>Determine your versioning strategy early in the development process, including considerations for future releases.</li>
+</ul>
+
+<h2>In this document</h2>
+
+<ol>
+<li><a href="#appversioning">Setting Application Version</a></li>
+<li><a href="#minsdkversion">Specifying Your Application's System API Requirements</a>
+</ol>
+
+
+<h2>See also</h2>
+
+<ol>
+<li><a href="{@docRoot}tools/publishing/preparing.html">Preparing to Publish Your Application</a></li>
+<li><a href="{@docRoot}tools/publishing/publishing.html#market">Publishing On Google Play</a></li>
+<li><a href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>Versioning is a critical component of your application upgrade and maintenance
+strategy. Versioning is important because:</p>
+
+<ul>
+<li>Users need to have specific information about the application version that
+is installed on their devices and the upgrade versions available for
+installation. </li>
+<li>Other applications — including other applications that you publish as
+a suite — need to query the system for your application's version, to
+determine compatibility and identify dependencies.</li>
+<li>Services through which you will publish your application(s) may also need to
+query your application for its version, so that they can display the version to
+users. A publishing service may also need to check the application version to
+determine compatibility and establish upgrade/downgrade relationships.</li>
+</ul>
+
+<p>The Android system does not use app version information to enforce
+restrictions on upgrades, downgrades, or compatibility of third-party apps. Instead, you (the
+developer) are responsible for enforcing version restrictions within your application or by
+informing users of the version restrictions and limitations. The Android system does, however,
+enforce system version compatibility as expressed by the <code>minSdkVersion</code> attribute in the
+manifest. This attribute allows an application to specify the minimum system API with which it is
+compatible. For more information see <a href="#minsdkversion">Specifying Minimum System API
+Version</a>.</p>
+
+<h2 id="appversioning">Setting Application Version</h2>
+<p>To define the version information for your application, you set attributes in
+the application's manifest file. Two attributes are available, and you should
+always define values for both of them: </p>
+
+<ul>
+<li><code>android:versionCode</code> — An integer value that represents
+the version of the application code, relative to other versions.
+
+<p>The value is an integer so that other applications can programmatically
+evaluate it, for example to check an upgrade or downgrade relationship. You can
+set the value to any integer you want, however you should make sure that each
+successive release of your application uses a greater value. The system does not
+enforce this behavior, but increasing the value with successive releases is
+normative. </p>
+
+<p>Typically, you would release the first version of your application with
+versionCode set to 1, then monotonically increase the value with each release,
+regardless whether the release constitutes a major or minor release. This means
+that the <code>android:versionCode</code> value does not necessarily have a
+strong resemblance to the application release version that is visible to the
+user (see <code>android:versionName</code>, below). Applications and publishing
+services should not display this version value to users.</p>
+</li>
+<li><code>android:versionName</code> — A string value that represents the
+release version of the application code, as it should be shown to users.
+<p>The value is a string so that you can describe the application version as a
+<major>.<minor>.<point> string, or as any other type of
+absolute or relative version identifier. </p>
+
+<p>As with <code>android:versionCode</code>, the system does not use this value
+for any internal purpose, other than to enable applications to display it to
+users. Publishing services may also extract the <code>android:versionName</code>
+value for display to users.</p>
+</li>
+</ul>
+
+<p>You define both of these version attributes in the
+<code><manifest></code> element of the manifest file. </p>
+
+<p>Here's an example manifest that shows the <code>android:versionCode</code>
+and <code>android:versionName</code> attributes in the
+<code><manifest></code> element. </p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.package.name"
+ android:versionCode="2"
+ android:versionName="1.1">
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+ ...
+ </application>
+</manifest>
+</pre>
+
+<p>In this example, note that <code>android:versionCode</code> value indicates
+that the current .apk contains the second release of the application code, which
+corresponds to a minor follow-on release, as shown by the
+<code>android:versionName</code> string. </p>
+
+<p>The Android framework provides an API to let applications query the system
+for version information about your application. To obtain version information,
+applications use the
+{@link android.content.pm.PackageManager#getPackageInfo(java.lang.String, int)}
+method of {@link android.content.pm.PackageManager PackageManager}. </p>
+
+<h2 id="minsdkversion">Specifying Your Application's System API Requirements</h2>
+
+<p>If your application requires a specific minimum version of the Android
+platform, or is designed only to support a certain range of Android platform
+versions, you can specify those version requirements as API Level identifiers
+in the application's manifest file. Doing so ensures that your
+application can only be installed on devices that
+are running a compatible version of the Android system. </p>
+
+<p>To specify API Level requirements, add a <code><uses-sdk></code>
+element in the application's manifest, with one or more of these attributes: </p>
+
+<ul>
+<li><code>android:minSdkVersion</code> — The minimum version
+of the Android platform on which the application will run, specified
+by the platform's API Level identifier. </li>
+<li><code>android:targetSdkVersion</code> — Specifies the API Level
+on which the application is designed to run. In some cases, this allows the
+application to use manifest elements or behaviors defined in the target
+API Level, rather than being restricted to using only those defined
+for the minimum API Level.</li>
+<li><code>android:maxSdkVersion</code> — The maximum version
+of the Android platform on which the application is designed to run,
+specified by the platform's API Level identifier. <strong>Important:</strong> Please read the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+documentation before using this attribute. </li>
+</ul>
+
+<p>When preparing to install your application, the system checks the value of this
+attribute and compares it to the system version. If the
+<code>android:minSdkVersion</code> value is greater than the system version, the
+system aborts the installation of the application. Similarly, the system
+installs your application only if its <code>android:maxSdkVersion</code>
+is compatible with the platform version.</p>
+
+<p>If you do not specify these attributes in your manifest, the system assumes
+that your application is compatible with all platform versions, with no
+maximum API Level. </p>
+
+<p>To specify a minimum platform version for your application, add a
+<code><uses-sdk></code> element as a child of
+<code><manifest></code>, then define the
+<code>android:minSdkVersion</code> as an attribute. </p>
+
+<p>For more information, see the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
+manifest element documentation and the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Levels</a> document.</p>
diff --git a/docs/html/training/advanced.jd b/docs/html/training/advanced.jd
new file mode 100644
index 0000000..7f9ddd4
--- /dev/null
+++ b/docs/html/training/advanced.jd
@@ -0,0 +1,11 @@
+page.title=Advanced Training
+
+@jd:body
+
+<p>Advanced Training contains a variety of classes that teach you best practices in Android
+development. These classes simplify the steps required to enhance your app with powerful
+platform features or effectively optimize your app performance.</p>
+
+<p>What you see now is still the beginning. We plan to add many more classes, expand and refine
+existing classes, re-organize, and build courses that help you enhance your apps using
+objective-oriented collections of classes.</p>
\ No newline at end of file
diff --git a/docs/html/training/backward-compatible-ui/index.jd b/docs/html/training/backward-compatible-ui/index.jd
index 7e27e68..f81b5a7 100644
--- a/docs/html/training/backward-compatible-ui/index.jd
+++ b/docs/html/training/backward-compatible-ui/index.jd
@@ -14,7 +14,7 @@
<ul>
<li>API level 5</li>
- <li><a href="{@docRoot}sdk/compatibility-library.html">The Android Support Package</a></li>
+ <li><a href="{@docRoot}tools/extras/support-library.html">The Android Support Package</a></li>
</ul>
<h2>You should also read</h2>
diff --git a/docs/html/training/basics/activity-lifecycle/index.jd b/docs/html/training/basics/activity-lifecycle/index.jd
index d278f04..127c1c2 100644
--- a/docs/html/training/basics/activity-lifecycle/index.jd
+++ b/docs/html/training/basics/activity-lifecycle/index.jd
@@ -21,7 +21,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/fundamentals/activities.html">Activities</a></li>
+ <li><a href="{@docRoot}guide/components/activities.html">Activities</a></li>
</ul>
diff --git a/docs/html/training/basics/activity-lifecycle/pausing.jd b/docs/html/training/basics/activity-lifecycle/pausing.jd
index 216d55e1..fa88beb 100644
--- a/docs/html/training/basics/activity-lifecycle/pausing.jd
+++ b/docs/html/training/basics/activity-lifecycle/pausing.jd
@@ -21,7 +21,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/fundamentals/activities.html">Activities</a>
+ <li><a href="{@docRoot}guide/components/activities.html">Activities</a>
</li>
</ul>
diff --git a/docs/html/training/basics/activity-lifecycle/recreating.jd b/docs/html/training/basics/activity-lifecycle/recreating.jd
index 941f1fd11..005a95b 100644
--- a/docs/html/training/basics/activity-lifecycle/recreating.jd
+++ b/docs/html/training/basics/activity-lifecycle/recreating.jd
@@ -23,7 +23,7 @@
Different Screens</a></li>
<li><a
href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime Changes</a></li>
- <li><a href="{@docRoot}guide/topics/fundamentals/activities.html">Activities</a>
+ <li><a href="{@docRoot}guide/components/activities.html">Activities</a>
</li>
</ul>
diff --git a/docs/html/training/basics/activity-lifecycle/starting.jd b/docs/html/training/basics/activity-lifecycle/starting.jd
index 1d328c7..c32968b 100644
--- a/docs/html/training/basics/activity-lifecycle/starting.jd
+++ b/docs/html/training/basics/activity-lifecycle/starting.jd
@@ -22,7 +22,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/fundamentals/activities.html">Activities</a></li>
+ <li><a href="{@docRoot}guide/components/activities.html">Activities</a></li>
</ul>
<h2>Try it out</h2>
diff --git a/docs/html/training/basics/activity-lifecycle/stopping.jd b/docs/html/training/basics/activity-lifecycle/stopping.jd
index 7dfc6d3..d56c921 100644
--- a/docs/html/training/basics/activity-lifecycle/stopping.jd
+++ b/docs/html/training/basics/activity-lifecycle/stopping.jd
@@ -21,7 +21,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/fundamentals/activities.html">Activities</a>
+ <li><a href="{@docRoot}guide/components/activities.html">Activities</a>
</li>
</ul>
@@ -37,7 +37,7 @@
</div>
<p>Properly stopping and restarting your activity is an important process in the activity lifecycle
-that ensures your users perceive that your app is always alive and doesn't loose their progress.
+that ensures your users perceive that your app is always alive and doesn't lose their progress.
There are a few of key scenarios in which your activity is stopped and restarted:</p>
<ul>
diff --git a/docs/html/training/basics/firstapp/building-ui.jd b/docs/html/training/basics/firstapp/building-ui.jd
index dae70a2..df8089f 100644
--- a/docs/html/training/basics/firstapp/building-ui.jd
+++ b/docs/html/training/basics/firstapp/building-ui.jd
@@ -19,7 +19,7 @@
<ol>
<li><a href="#LinearLayout">Use a Linear Layout</a></li>
- <li><a href="#TextInput">Add a Text Input Box</a></li>
+ <li><a href="#TextInput">Add a Text Field</a></li>
<li><a href="#Strings">Add String Resources</a></li>
<li><a href="#Button">Add a Button</a></li>
<li><a href="#Weight">Make the Input Box Fill in the Screen Width</a></li>
@@ -61,7 +61,7 @@
</div>
</div>
-<img src="{@docRoot}images/viewgroup.png" alt="" />
+<img src="{@docRoot}images/viewgroup.png" alt="" width="440" />
<p class="img-caption"><strong>Figure 1.</strong> Illustration of how {@link
android.view.ViewGroup} objects form branches in the layout and contain {@link
android.view.View} objects.</p>
@@ -130,12 +130,12 @@
-<h2 id="TextInput">Add a Text Input Box</h2>
+<h2 id="TextInput">Add a Text Field</h2>
-<p>To create a user-editable text box, add an {@link android.widget.EditText
+<p>To create a user-editable text field, add an {@link android.widget.EditText
<EditText>} element inside the {@link android.widget.LinearLayout <LinearLayout>}. The {@link
android.widget.EditText} class is a subclass of {@link android.view.View} that displays an editable
-text box.</p>
+text field.</p>
<p>Like every {@link android.view.View} object, you must define certain XML attributes to specify
the {@link android.widget.EditText} object's properties. Here’s how you should declare it
@@ -185,7 +185,8 @@
compiled, the SDK tools use the ID value, <code>edit_message</code>, to create a new identifier in
your project's {@code gen/R.java} file that is now assiciated with the {@link
android.widget.EditText} element. Once the resource ID is created, other references to the ID do not
-need the plus symbol. See the sidebox for more information about resource objects.</p></dd>
+need the plus symbol. This is the only attribute that may need the plus-symbol. See the sidebox for
+more information about resource objects.</p></dd>
<dt><a
href="{@docRoot}reference/android/view/View.html#attr_android:layout_width">{@code
@@ -202,12 +203,12 @@
<dt><a
href="{@docRoot}reference/android/widget/TextView.html#attr_android:hint">{@code
android:hint}</a></dt>
-<dd>This is a default string to display when the text box is empty. Instead of using a hard-coded
-string as the value, the value given in this example refers to a string resource. When you add the
-{@code
-"@string/edit_message"} value, you’ll see a compiler error because there’s no matching string
-resource by that name. You'll fix this in the next section by defining the string
-resource.</dd>
+<dd>This is a default string to display when the text field is empty. Instead of using a hard-coded
+string as the value, the {@code "@string/edit_message"} value refers to a string resource defined
+in a separate file. Because this value refers to an existing resource, it does not need the
+plus-symbol. However, because you haven't defined the string resource yet, you’ll see a compiler
+error when you add the {@code "@string/edit_message"} value. You'll fix this in the next section by
+defining the string resource.</dd>
</dl>
@@ -276,9 +277,9 @@
android.widget.Button} widgets have their widths set to
<code>"wrap_content"</code>.</p>
-<p>This works fine for the button, but not as well for the text box, because the user might type
+<p>This works fine for the button, but not as well for the text field, because the user might type
something longer and there's extra space left on the screen. So, it'd be nice to fill that width
-using the text box.
+using the text field.
{@link android.widget.LinearLayout} enables such a design with the <em>weight</em> property, which
you can specify using the <a
href="{@docRoot}reference/android/widget/LinearLayout.LayoutParams.html#weight">{@code
diff --git a/docs/html/training/basics/firstapp/creating-project.jd b/docs/html/training/basics/firstapp/creating-project.jd
index 5a89f2e..4fbfe34 100644
--- a/docs/html/training/basics/firstapp/creating-project.jd
+++ b/docs/html/training/basics/firstapp/creating-project.jd
@@ -23,9 +23,9 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}sdk/installing.html">Installing the
+ <li><a href="{@docRoot}sdk/installing/index.html">Installing the
SDK</a></li>
- <li><a href="{@docRoot}guide/developing/projects/index.html">Managing Projects</a></li>
+ <li><a href="{@docRoot}tools/projects/index.html">Managing Projects</a></li>
</ul>
@@ -42,8 +42,8 @@
<p class="note"><strong>Note:</strong> You should already have the Android SDK installed, and if
you're using Eclipse, you should have installed the <a
-href="{@docRoot}sdk/eclipse-adt.html">ADT plugin</a> as well. If you have not installed
-these, see <a href="{@docRoot}sdk/installing.html">Installing the Android SDK</a> and return here
+href="{@docRoot}tools/sdk/eclipse-adt.html">ADT plugin</a> as well. If you have not installed
+these, see <a href="{@docRoot}sdk/installing/index.html">Installing the Android SDK</a> and return here
when you've completed the installation.</p>
@@ -59,7 +59,7 @@
The resulting dialog should have a folder labeled <em>Android</em>. (If you don’t see the
<em>Android</em> folder,
then you have not installed the ADT plugin—see <a
-href="{@docRoot}sdk/eclipse-adt.html#installing">Installing the ADT Plugin</a>).</li>
+href="{@docRoot}tools/sdk/eclipse-adt.html#installing">Installing the ADT Plugin</a>).</li>
<li>Open the <em>Android</em> folder, select <em>Android Project</em> and click
<strong>Next</strong>.</li>
<li>Enter a project name (such as "MyFirstApp") and click <strong>Next</strong>.</li>
@@ -68,7 +68,7 @@
support older versions, but setting the build target to the latest version allows you to
easily optimize your app for a great user experience on the latest Android-powered devices.</p>
<p>If you don't see any built targets listed, you need to install some using the Android SDK
-Manager tool. See <a href="{@docRoot}sdk/installing.html#AddingComponents">step 4 in the
+Manager tool. See <a href="{@docRoot}sdk/installing/index.html#AddingComponents">step 4 in the
installing guide</a>.</p>
<p>Click <strong>Next</strong>.</p></li>
<li>Specify other app details, such as the:
@@ -87,7 +87,7 @@
<li><em>Minimum SDK</em>: Select <em>4 (Android 1.6)</em>.
<p>Because this version is lower than the build target selected for the app, a warning
appears, but that's alright. You simply need to be sure that you don't use any APIs that require an
-<a href="{@docRoot}guide/appendix/api-levels.html">API level</a> greater than the minimum SDK
+<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level</a> greater than the minimum SDK
version without first using some code to verify the device's system version (you'll see this in some
other classes).</p>
</li>
@@ -117,7 +117,7 @@
your app for the latest devices.</p>
<p>If you don't see any targets listed, you need to
install some using the Android SDK
-Manager tool. See <a href="{@docRoot}sdk/installing.html#AddingComponents">step 4 in the
+Manager tool. See <a href="{@docRoot}sdk/installing/index.html#AddingComponents">step 4 in the
installing guide</a>.</p></li>
<li>Execute:
<pre class="no-pretty-print">
diff --git a/docs/html/training/basics/firstapp/index.jd b/docs/html/training/basics/firstapp/index.jd
index 9ff5b18..43b289b 100644
--- a/docs/html/training/basics/firstapp/index.jd
+++ b/docs/html/training/basics/firstapp/index.jd
@@ -35,7 +35,7 @@
<li>Download the latest SDK tools and platforms using the SDK Manager.</li>
</ol>
-<p>If you haven't already done this setup, read <a href="{@docRoot}sdk/installing.html">Installing
+<p>If you haven't already done this setup, read <a href="{@docRoot}sdk/installing/index.html">Installing
the SDK</a>. Once you've finished the setup, you're ready to begin this class.</p>
<p>This class uses a tutorial format that incrementally builds a small Android app in order to teach
diff --git a/docs/html/training/basics/firstapp/running-app.jd b/docs/html/training/basics/firstapp/running-app.jd
index 43b8983..5105a3b 100644
--- a/docs/html/training/basics/firstapp/running-app.jd
+++ b/docs/html/training/basics/firstapp/running-app.jd
@@ -25,9 +25,9 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a></li>
- <li><a href="{@docRoot}guide/developing/devices/index.html">Managing Virtual Devices</a></li>
- <li><a href="{@docRoot}guide/developing/projects/index.html">Managing Projects</a></li>
+ <li><a href="{@docRoot}tools/device.html">Using Hardware Devices</a></li>
+ <li><a href="{@docRoot}tools/devices/index.html">Managing Virtual Devices</a></li>
+ <li><a href="{@docRoot}tools/projects/index.html">Managing Projects</a></li>
</ul>
@@ -85,7 +85,7 @@
<ol>
<li>Plug in your Android-powered device to your machine with a USB cable.
If you’re developing on Windows, you might need to install the appropriate USB driver for your
-device. For help installing drivers, see the <a href=”{@docRoot}sdk/oem-usb.html”>OEM USB
+device. For help installing drivers, see the <a href="{@docRoot}tools/extras/oem-usb.html">OEM USB
Drivers</a> document.</li>
<li>Ensure that <strong>USB debugging</strong> is enabled in the device Settings (open Settings
and navitage to <strong>Applications > Development</strong> on most devices, or select
@@ -116,7 +116,7 @@
<h2 id="Emulator">Run on the Emulator</h2>
<p>Whether you’re using Eclipse or the command line, you need to first create an <a
-href="{@docRoot}guide/developing/devices/index.html">Android Virtual
+href="{@docRoot}tools/devices/index.html">Android Virtual
Device</a> (AVD). An AVD is a
device configuration for the Android emulator that allows you to model
different device configurations.</p>
diff --git a/docs/html/training/basics/firstapp/starting-activity.jd b/docs/html/training/basics/firstapp/starting-activity.jd
index c548c1d..a8d32b6 100644
--- a/docs/html/training/basics/firstapp/starting-activity.jd
+++ b/docs/html/training/basics/firstapp/starting-activity.jd
@@ -31,7 +31,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}sdk/installing.html">Installing the
+ <li><a href="{@docRoot}sdk/installing/index.html">Installing the
SDK</a></li>
</ul>
@@ -42,7 +42,7 @@
<p>After completing the <a href="building-ui.html">previous lesson</a>, you have an app that
-shows an activity (a single screen) with a text box and a button. In this lesson, you’ll add some
+shows an activity (a single screen) with a text field and a button. In this lesson, you’ll add some
code to <code>MyFirstActivity</code> that
starts a new activity when the user selects the Send button.</p>
@@ -90,7 +90,7 @@
android.view.View} that was clicked)</li>
</ul>
-<p>Next, you’ll fill in this method to read the contents of the text box and deliver that text to
+<p>Next, you’ll fill in this method to read the contents of the text field and deliver that text to
another activity.</p>
@@ -290,8 +290,8 @@
}
</pre>
-<p>You can now run the app, type a message in the text box, press Send, and view the message on the
-second activity.</p>
+<p>You can now run the app, type a message in the text field, press Send, and view the message on
+the second activity.</p>
<img src="{@docRoot}images/training/firstapp/firstapp.png" />
<p class="img-caption"><strong>Figure 1.</strong> Both activities in the final app, running
diff --git a/docs/html/training/basics/fragments/communicating.jd b/docs/html/training/basics/fragments/communicating.jd
index e3e308f..3ac9873 100644
--- a/docs/html/training/basics/fragments/communicating.jd
+++ b/docs/html/training/basics/fragments/communicating.jd
@@ -19,7 +19,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a></li>
+ <li><a href="{@docRoot}guide/components/fragments.html">Fragments</a></li>
</ul>
<h2>Try it out</h2>
diff --git a/docs/html/training/basics/fragments/creating.jd b/docs/html/training/basics/fragments/creating.jd
index c4a9b46..0646230 100644
--- a/docs/html/training/basics/fragments/creating.jd
+++ b/docs/html/training/basics/fragments/creating.jd
@@ -21,7 +21,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a></li>
+ <li><a href="{@docRoot}guide/components/fragments.html">Fragments</a></li>
</ul>
<h2>Try it out</h2>
@@ -84,7 +84,7 @@
to {@link android.support.v4.app.Fragment#onPause()}.</p>
<p>More information about the fragment lifecycle and callback methods is available in the <a
-href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a> developer guide.</p>
+href="{@docRoot}guide/components/fragments.html">Fragments</a> developer guide.</p>
diff --git a/docs/html/training/basics/fragments/fragment-ui.jd b/docs/html/training/basics/fragments/fragment-ui.jd
index f906f46..4ec4de5 100644
--- a/docs/html/training/basics/fragments/fragment-ui.jd
+++ b/docs/html/training/basics/fragments/fragment-ui.jd
@@ -20,7 +20,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a></li>
+ <li><a href="{@docRoot}guide/components/fragments.html">Fragments</a></li>
<li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets and
Handsets</a></li>
</ul>
diff --git a/docs/html/training/basics/fragments/index.jd b/docs/html/training/basics/fragments/index.jd
index dcdcd31..bc93f43 100644
--- a/docs/html/training/basics/fragments/index.jd
+++ b/docs/html/training/basics/fragments/index.jd
@@ -23,7 +23,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a></li>
+ <li><a href="{@docRoot}guide/components/fragments.html">Fragments</a></li>
<li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets and
Handsets</a></li>
</ul>
diff --git a/docs/html/training/basics/fragments/support-lib.jd b/docs/html/training/basics/fragments/support-lib.jd
index e2166f5..ba10b78 100644
--- a/docs/html/training/basics/fragments/support-lib.jd
+++ b/docs/html/training/basics/fragments/support-lib.jd
@@ -17,12 +17,12 @@
</ol>
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}sdk/compatibility-library.html">Support Library</a></li>
+ <li><a href="{@docRoot}tools/extras/support-library.html">Support Library</a></li>
</ul>
</div>
</div>
-<p>The Android <a href="{@docRoot}sdk/compatibility-library.html">Support Library</a> provides a JAR
+<p>The Android <a href="{@docRoot}tools/extras/support-library.html">Support Library</a> provides a JAR
file with an API library that allow you to use some of the more recent Android APIs in your app
while running on earlier versions of Android. For instance, the Support Library provides a version
of the {@link android.app.Fragment} APIs that you can use on Android 1.6 (API level 4) and
diff --git a/docs/html/training/basics/intents/index.jd b/docs/html/training/basics/intents/index.jd
index c661d98..d94ff015 100644
--- a/docs/html/training/basics/intents/index.jd
+++ b/docs/html/training/basics/intents/index.jd
@@ -24,7 +24,7 @@
<li><a
href="http://android-developers.blogspot.com/2009/11/integrating-application-with-intents.html">
Integrating Application with Intents (blog post)</a></li>
- <li><a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent
Filters</a></li>
</ul>
@@ -32,7 +32,7 @@
</div>
<p>An Android app typically has several <a
-href="{@docRoot}guide/topics/fundamentals/activities.html">activities</a>. Each activity displays a
+href="{@docRoot}guide/components/activities.html">activities</a>. Each activity displays a
user interface that allows the user to perform a specific task (such as view a map or take a photo).
To take the user from one activity to another, your app must use an {@link
android.content.Intent} to define your app's "intent" to do something. When you pass an
diff --git a/docs/html/training/basics/intents/sending.jd b/docs/html/training/basics/intents/sending.jd
index bfd8f9b..f2a2cc3 100644
--- a/docs/html/training/basics/intents/sending.jd
+++ b/docs/html/training/basics/intents/sending.jd
@@ -166,7 +166,7 @@
starts in case you need to disable the feature that uses the intent before the user attempts to use
it. If you know of a specific app that can handle the intent, you can also provide a link for the
user to download the app (see how to <a
-href="{@docRoot}guide/publishing/publishing.html#marketintent">link to an app on Google
+href="{@docRoot}distribute/googleplay/promote/linking.html">link to your product on Google
Play</a>).</p>
diff --git a/docs/html/training/basics/network-ops/connecting.jd b/docs/html/training/basics/network-ops/connecting.jd
new file mode 100644
index 0000000..f70cf58
--- /dev/null
+++ b/docs/html/training/basics/network-ops/connecting.jd
@@ -0,0 +1,284 @@
+page.title=Connecting to the Network
+parent.title=Performing Network Operations
+parent.link=index.html
+
+trainingnavtop=true
+next.title=Managing Network Usage
+next.link=managing.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+
+
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#http-client">Choose an HTTP Client</a></li>
+ <li><a href="#connection">Check the Network Connection</a></li>
+ <li><a href="#AsyncTask">Perform Network Operations on a Separate Thread</a></li>
+ <li><a href="#download">Connect and Download Data</a></li>
+ <li><a href="#stream">Convert the InputStream to a String</a></li>
+
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}training/monitoring-device-state/index.html">Optimizing Battery Life</a></li>
+ <li><a href="{@docRoot}training/efficient-downloads/index.html">Transferring Data Without Draining the Battery</a></li>
+ <li><a href="{@docRoot}guide/webapps/index.html">Web Apps Overview</a></li>
+ <li><a href="{@docRoot}guide/components/fundamentals.html">Application Fundamentals</a></li>
+</ul>
+
+</div>
+</div>
+
+<p>This lesson shows you how to implement a simple application that connects to
+the network. It explains some of the best practices you should follow in
+creating even the simplest network-connected app.</p>
+
+<p>Note that to perform the network operations described in this lesson, your
+application manifest must include the following permissions:</p>
+
+<pre><uses-permission android:name="android.permission.INTERNET" />
+<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /></pre>
+
+
+
+<h2 id="http-client">Choose an HTTP Client</h2>
+
+<p>Most network-connected Android apps use HTTP to send and receive data.
+Android includes two HTTP clients: {@link java.net.HttpURLConnection} and Apache
+ {@link org.apache.http.client.HttpClient}. Both support HTTPS, streaming uploads and downloads, configurable
+timeouts, IPv6, and connection pooling. We recommend using {@link
+java.net.HttpURLConnection} for applications targeted at Gingerbread and higher. For
+more discussion of this topic, see the blog post <a
+href="http://android-developers.blogspot.com/2011/09/androids-http-clients.html"
+>Android's HTTP Clients</a>.</p>
+
+<h2 id="connection">Check the Network Connection</h2>
+
+<p>Before your app attempts to connect to the network, it should check to see whether a
+network connection is available using
+{@link android.net.ConnectivityManager#getActiveNetworkInfo getActiveNetworkInfo()}
+and {@link android.net.NetworkInfo#isConnected isConnected()}.
+Remember, the device may be out of range of a
+network, or the user may have disabled both Wi-Fi and mobile data access.
+For more discussion of this topic, see the lesson <a
+href="{@docRoot}training/network-ops/managing.html">Managing Network
+Usage</a>.</p>
+
+<pre>
+public void myClickHandler(View view) {
+ ...
+ ConnectivityManager connMgr = (ConnectivityManager)
+ getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
+ if (networkInfo != null && networkInfo.isConnected()) {
+ // fetch data
+ } else {
+ // display error
+ }
+ ...
+}</pre>
+
+<h2 id="AsyncTask">Perform Network Operations on a Separate Thread</h2>
+
+<p>Network operations can involve unpredictable delays. To prevent this from
+causing a poor user experience, always perform network operations on a separate
+thread from the UI. The {@link android.os.AsyncTask} class provides one of the
+simplest ways to fire off a new task from the UI thread. For more discussion of
+this topic, see the blog post <a
+href="http://android-developers.blogspot.com/2010/07/multithreading-for-
+performance.html">Multithreading For Performance</a>.</p>
+
+
+<p>In the following snippet, the <code>myClickHandler()</code> method invokes <code>new
+DownloadWebpageTask().execute(stringUrl)</code>. The
+<code>DownloadWebpageTask</code> class is a subclass of {@link
+android.os.AsyncTask}. <code>DownloadWebpageTask</code> implements the following
+{@link android.os.AsyncTask} methods:</p>
+
+ <ul>
+
+ <li>{@link android.os.AsyncTask#doInBackground doInBackground()} executes
+the method <code>downloadUrl()</code>. It passes the web page URL as a
+parameter. The method <code>downloadUrl()</code> fetches and processes the web
+page content. When it finishes, it passes back a result string.</li>
+
+ <li>{@link android.os.AsyncTask#onPostExecute onPostExecute()} takes the
+returned string and displays it in the UI.</li>
+
+
+ </ul>
+
+<pre>
+public class HttpExampleActivity extends Activity {
+ private static final String DEBUG_TAG = "HttpExample";
+ private EditText urlText;
+ private TextView textView;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+ urlText = (EditText) findViewById(R.id.myUrl);
+ textView = (TextView) findViewById(R.id.myText);
+ }
+
+ // When user clicks button, calls AsyncTask.
+ // Before attempting to fetch the URL, makes sure that there is a network connection.
+ public void myClickHandler(View view) {
+ // Gets the URL from the UI's text field.
+ String stringUrl = urlText.getText().toString();
+ ConnectivityManager connMgr = (ConnectivityManager)
+ getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
+ if (networkInfo != null && networkInfo.isConnected()) {
+ new DownloadWebpageText().execute(stringUrl);
+ } else {
+ textView.setText("No network connection available.");
+ }
+ }
+
+ // Uses AsyncTask to create a task away from the main UI thread. This task takes a
+ // URL string and uses it to create an HttpUrlConnection. Once the connection
+ // has been established, the AsyncTask downloads the contents of the webpage as
+ // an InputStream. Finally, the InputStream is converted into a string, which is
+ // displayed in the UI by the AsyncTask's onPostExecute method.
+ private class DownloadWebpageText extends AsyncTask<String, Void, String> {
+ @Override
+ protected String doInBackground(String... urls) {
+
+ // params comes from the execute() call: params[0] is the url.
+ try {
+ return downloadUrl(urls[0]);
+ } catch (IOException e) {
+ return "Unable to retrieve web page. URL may be invalid.";
+ }
+ }
+ // onPostExecute displays the results of the AsyncTask.
+ @Override
+ protected void onPostExecute(String result) {
+ textView.setText(result);
+ }
+ }
+ ...
+}</pre>
+
+<p>The sequence of events in this snippet is as follows:</p>
+<ol>
+
+ <li>When users click the button that invokes {@code myClickHandler()},
+ the app passes
+the specified URL to the {@link android.os.AsyncTask} subclass
+<code>DownloadWebpageTask</code>.</li>
+
+ <li>The {@link android.os.AsyncTask} method {@link
+android.os.AsyncTask#doInBackground doInBackground()} calls the
+<code>downloadUrl()</code> method. </li>
+
+ <li>The <code>downloadUrl()</code> method takes a URL string as a parameter
+and uses it to create a {@link java.net.URL} object.</li>
+
+ <li>The {@link java.net.URL} object is used to establish an {@link
+java.net.HttpURLConnection}.</li>
+
+ <li>Once the connection has been established, the {@link
+java.net.HttpURLConnection} object fetches the web page content as an {@link
+java.io.InputStream}.</li>
+
+ <li>The {@link java.io.InputStream} is passed to the <code>readIt()</code>
+method, which converts the stream to a string.</li>
+
+ <li>Finally, the {@link android.os.AsyncTask}'s {@link
+android.os.AsyncTask#onPostExecute onPostExecute()} method displays the string
+in the main activity's UI.</li>
+
+</ol>
+
+ <h2 id="download">Connect and Download Data</h2>
+
+ <p>In your thread that performs your network transactions, you can use
+ {@link java.net.HttpURLConnection} to perform a {@code GET} and download your data.
+ After you call {@code connect()}, you can get an {@link java.io.InputStream} of the data
+ by calling {@code getInputStream()}.
+
+ <p>In the following snippet, the {@link android.os.AsyncTask#doInBackground
+doInBackground()} method calls the method <code>downloadUrl()</code>. The
+<code>downloadUrl()</code> method takes the given URL and uses it to connect to
+the network via {@link java.net.HttpURLConnection}. Once a connection has been
+established, the app uses the method <code>getInputStream()</code> to retrieve
+the data as an {@link java.io.InputStream}.</p>
+
+<pre>
+// Given a URL, establishes an HttpUrlConnection and retrieves
+// the web page content as a InputStream, which it returns as
+// a string.
+private String downloadUrl(String myurl) throws IOException {
+ InputStream is = null;
+ // Only display the first 500 characters of the retrieved
+ // web page content.
+ int len = 500;
+
+ try {
+ URL url = new URL(myurl);
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setReadTimeout(10000 /* milliseconds */);
+ conn.setConnectTimeout(15000 /* milliseconds */);
+ conn.setRequestMethod("GET");
+ conn.setDoInput(true);
+ // Starts the query
+ conn.connect();
+ int response = conn.getResponseCode();
+ Log.d(DEBUG_TAG, "The response is: " + response);
+ is = conn.getInputStream();
+
+ // Convert the InputStream into a string
+ String contentAsString = readIt(is, len);
+ return contentAsString;
+
+ // Makes sure that the InputStream is closed after the app is
+ // finished using it.
+ } finally {
+ if (is != null) {
+ is.close();
+ }
+ }
+}</pre>
+
+<p>Note that the method <code>getResponseCode()</code> returns the connection's
+<a href="http://www.w3.org/Protocols/HTTP/HTRESP.html">status code</a>. This is
+a useful way of getting additional information about the connection. A status
+code of 200 indicates success.</p>
+
+<h2 id="stream">Convert the InputStream to a String</h2>
+
+<p>An {@link java.io.InputStream} is a readable source of bytes. Once you get an {@link java.io.InputStream},
+it's common to decode or convert it into a
+target data type. For example, if you were downloading image data, you might
+decode and display it like this:</p>
+
+<pre>InputStream is = null;
+...
+Bitmap bitmap = BitmapFactory.decodeStream(is);
+ImageView imageView = (ImageView) findViewById(R.id.image_view);
+imageView.setImageBitmap(bitmap);
+</pre>
+
+<p>In the example shown above, the {@link java.io.InputStream} represents the text of a
+web page. This is how the example converts the {@link java.io.InputStream} to
+a string so that the activity can display it in the UI:</p>
+
+<pre>// Reads an InputStream and converts it to a String.
+public String readIt(InputStream stream, int len) throws IOException, UnsupportedEncodingException {
+ Reader reader = null;
+ reader = new InputStreamReader(stream, "UTF-8");
+ char[] buffer = new char[len];
+ reader.read(buffer);
+ return new String(buffer);
+}</pre>
+
+
+
diff --git a/docs/html/training/basics/network-ops/index.jd b/docs/html/training/basics/network-ops/index.jd
new file mode 100644
index 0000000..b213c03
--- /dev/null
+++ b/docs/html/training/basics/network-ops/index.jd
@@ -0,0 +1,73 @@
+page.title=Performing Network Operations
+
+trainingnavtop=true
+startpage=true
+next.title=Connecting to the Network
+next.link=connecting.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+
+<h2>Dependencies and prerequisites</h2>
+<ul>
+ <li>Android 1.6 (API level 4) or higher</li>
+ <li>A device that is able to connect to mobile and Wi-Fi networks</li>
+</ul>
+
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}training/monitoring-device-state/index.html">Optimizing Battery Life</a></li>
+ <li><a href="{@docRoot}training/efficient-downloads/index.html">Transferring Data Without Draining the Battery</a></li>
+ <li><a href="{@docRoot}guide/webapps/index.html">Web Apps Overview</a></li>
+</ul>
+
+
+<h2>Try it out</h2>
+
+<div class="download-box">
+ <a href="{@docRoot}shareables/training/NetworkUsage.zip"
+class="button">Download the sample</a>
+ <p class="filename">NetworkUsage.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>This class explains the basic tasks involved in connecting to the network,
+monitoring the network connection (including connection changes), and giving
+users control over an app's network usage. It also describes how to parse and
+consume XML data.</p>
+
+<p>This class includes a sample application that illustrates how to perform
+common network operations. You can download the sample (to the right) and use it
+as a source of reusable code for your own application.</p>
+
+<p>By going through these lessons, you'll have the
+fundamental building blocks for creating Android applications that download
+content and parse data efficiently, while minimizing network traffic.</p>
+
+
+
+<h2>Lessons</h2>
+
+<dl>
+ <dt><b><a href="connecting.html">Connecting to the Network</a></b></dt>
+
+ <dd>Learn how to connect to the network, choose an HTTP client, and perform
+network operations outside of the UI thread.</dd>
+
+ <dt><b><a href="managing.html">Managing Network Usage</a></b></dt>
+
+ <dd>Learn how to check a
+device's network connection, create a preferences UI for controlling network
+usage, and respond to connection changes.</dd>
+
+ <dt><b><a href="xml.html">Parsing XML Data</a></b></dt>
+ <dd>Learn how to parse and consume XML data.</dd>
+
+</dl>
+
diff --git a/docs/html/training/basics/network-ops/managing.jd b/docs/html/training/basics/network-ops/managing.jd
new file mode 100644
index 0000000..33cb195
--- /dev/null
+++ b/docs/html/training/basics/network-ops/managing.jd
@@ -0,0 +1,445 @@
+page.title=Managing Network Usage
+parent.title=Performing Network Operations
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=Connecting to the Network
+previous.link=connecting.html
+next.title=Parsing XML Data
+next.link=xml.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+ <ol>
+ <li><a href="#check-connection">Check a Device's Network Connection</a></li>
+ <li><a href="#manage-usage">Manage Network Usage</a></li>
+ <li><a href="#prefs">Implement a Preferences Activity</a></li>
+ <li><a href="#pref-change">Respond to Preference Changes</a></li>
+ <li><a href="#detect-changes">Detect Connection Changes</a></li>
+</ol>
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}training/monitoring-device-state/index.html">Optimizing Battery Life</a></li>
+ <li><a href="{@docRoot}training/efficient-downloads/index.html">Transferring Data Without Draining the Battery</a></li>
+ <li><a href="{@docRoot}guide/webapps/index.html">Web Apps Overview</a></li>
+</ul>
+
+<h2>Try it out</h2>
+
+<div class="download-box">
+ <a href="{@docRoot}shareables/training/NetworkUsage.zip"
+class="button">Download the sample</a>
+ <p class="filename">NetworkUsage.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>This lesson describes how to write applications that have fine-grained
+control over their usage of network resources. If your application performs a
+lot of network operations, you should provide user settings that allow users
+to control your app’s data habits, such as how often your app syncs data,
+whether to perform uploads/downloads only when on Wi-Fi, whether to use data
+while roaming, and so on. With these controls available to them, users are much
+less likely to disable your app’s access to background data when they approach their
+limits, because they can instead precisely control how much data your app
+uses.</p>
+
+<p>For general guidelines on how to write apps that minimize the battery life
+impact of downloads and network connections, see
+<a href="{@docRoot}training/monitoring-device-state/index.html">Optimizing Battery Life</a>
+and <a href="{@docRoot}training/efficient-downloads/index.html">Transferring Data Without Draining the Battery</a>.
+
+<h2 id="check-connection">Check a Device's Network Connection</h2>
+
+<p>A device can have various types of network connections. This lesson
+focuses on using either a Wi-Fi or a mobile network connection. For the full
+list of possible network types, see {@link android.net.ConnectivityManager}.<p>
+
+<p>Wi-Fi is typically faster. Also, mobile data is often metered, which can get
+expensive.
+A common strategy for apps is to only fetch large data
+if a Wi-Fi network is available.</p>
+
+<p>Before you perform network operations, it's good practice to check the state of
+network connectivity. Among other things, this could prevent your app from inadvertently using
+the wrong radio. If a network connection is unavailable, your application
+should respond gracefully. To check the network connection, you typically use
+the following classes:</p>
+
+<ul>
+
+ <li>{@link android.net.ConnectivityManager}: Answers queries about the state
+of network connectivity. It also notifies applications when network
+connectivity changes. </li>
+
+ <li>{@link android.net.NetworkInfo}: Describes the status of a network
+interface of a given type (currently either Mobile or Wi-Fi).
+ </li>
+
+</ul>
+
+
+
+<p>This code snippet tests network connectivity for Wi-Fi and mobile. It
+determines whether these network interfaces are available (that is, whether
+network connectivity is possible) and/or connected (that is, whether network
+connectivity exists and if it is possible to establish sockets and pass
+data): </p>
+
+<pre>
+private static final String DEBUG_TAG = "NetworkStatusExample";
+...
+ConnectivityManager connMgr = (ConnectivityManager)
+ getSystemService(Context.CONNECTIVITY_SERVICE);
+NetworkInfo networkInfo = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
+boolean isWifiConn = networkInfo.isConnected();
+networkInfo = connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
+boolean isMobileConn = networkInfo.isConnected();
+Log.d(DEBUG_TAG, "Wifi connected: " + isWifiConn);
+Log.d(DEBUG_TAG, "Mobile connected: " + isMobileConn);
+</pre>
+
+<p>Note that you should not base decisions on whether a network is
+"available." You should always check {@link
+android.net.NetworkInfo#isConnected isConnected()} before performing network
+operations, since {@link android.net.NetworkInfo#isConnected isConnected()}
+handles cases like flaky mobile networks, airplane mode, and restricted
+background data.</p>
+
+<p>A more concise way of checking whether a network interface is available is as
+follows. The method {@link
+android.net.ConnectivityManager#getActiveNetworkInfo() getActiveNetworkInfo()}
+returns a {@link android.net.NetworkInfo} instance representing the first
+connected network interface it can find, or <code>null</code> if none if the
+interfaces is connected (meaning that an
+internet connection is not available):</p>
+
+<pre>
+public boolean isOnline() {
+ ConnectivityManager connMgr = (ConnectivityManager)
+ getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
+ return (networkInfo != null && networkInfo.isConnected());
+} </pre>
+
+<p>To query more fine-grained state you can use {@link
+android.net.NetworkInfo.DetailedState}, but this should seldom be necessary.</p>
+
+
+<h2 id="manage-usage">Manage Network Usage</h2>
+
+<p>You can implement a preferences activity that gives users explicit control
+over your app's usage of network resources. For
+example:</p>
+
+<ul>
+
+<li>You might allow users to upload videos only when the device is connected to a
+Wi-Fi network.</li>
+
+<li>You might sync (or not) depending on specific criteria such as network
+availability, time interval, and so on.</li>
+
+</ul>
+
+<p>To write an app that supports network access and managing
+network usage, your manifest must have the right permissions and
+intent filters.
+</p>
+
+<ul>
+ <li>The manifest excerpted below includes the following permissions:
+ <ul>
+
+ <li>{@link android.Manifest.permission#INTERNET
+android.permission.INTERNET}—Allows applications to open network
+sockets.</li>
+
+ <li>{@link android.Manifest.permission#ACCESS_NETWORK_STATE
+android.permission.ACCESS_NETWORK_STATE}—Allows applications to access
+information about networks.</li>
+
+ </ul>
+ </li>
+
+ <li>You can declare the intent filter for the
+{@link android.content.Intent#ACTION_MANAGE_NETWORK_USAGE} action (introduced in
+Android 4.0) to indicate that your application defines an activity that offers
+options to control data usage. {@link
+android.content.Intent#ACTION_MANAGE_NETWORK_USAGE} shows settings for managing
+the network data usage of a specific application. When your app has a settings activity
+that allows users to control network usage, you should declare this intent filter for that activity.
+In the sample application, this action is handled by the class
+<code>SettingsActivity</code>, which displays a preferences UI to let users
+decide when to download a feed.</li>
+
+</ul>
+
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.networkusage"
+ ...>
+
+ <uses-sdk android:minSdkVersion="4"
+ android:targetSdkVersion="14" />
+
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+
+ <application
+ ...>
+ ...
+ <activity android:label="SettingsActivity" android:name=".SettingsActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MANAGE_NETWORK_USAGE" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
+</pre>
+
+<h2 id="prefs">Implement a Preferences Activity</h2>
+
+<p>As you can see in the manifest excerpt above, the sample app's activity
+<code>SettingsActivity</code> has an intent filter for the {@link
+android.content.Intent#ACTION_MANAGE_NETWORK_USAGE} action.
+<code>SettingsActivity</code> is a subclass of {@link
+android.preference.PreferenceActivity}. It displays a preferences screen
+(shown in figure 1) that
+lets users specify the following:</p>
+
+<ul>
+
+ <li>Whether to display summaries for each XML feed entry, or just a link for
+each entry.</li>
+
+ <li>Whether to download the XML feed if any network connection is available,
+or only if Wi-Fi is available.</li>
+
+</ul>
+
+<img src="{@docRoot}images/training/basics/network-settings1.png" alt="Preferences panel" />
+
+<img src="{@docRoot}images/training/basics/network-settings2.png" alt="Setting a network preference" />
+<p class="img-caption"><strong>Figure 1.</strong> Preferences activity.</p>
+
+<p>Here is <code>SettingsActivity</code>. Note that it implements
+{@link android.content.SharedPreferences.OnSharedPreferenceChangeListener OnSharedPreferenceChangeListener}.
+When a user changes a preference, it fires
+{@link android.content.SharedPreferences.OnSharedPreferenceChangeListener#onSharedPreferenceChanged onSharedPreferenceChanged()},
+which sets {@code refreshDisplay} to true. This causes the display to refresh when the user
+returns to the main activity:</p>
+
+<pre>public class SettingsActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Loads the XML preferences file
+ addPreferencesFromResource(R.xml.preferences);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+
+ // Registers a listener whenever a key changes
+ getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+
+ // Unregisters the listener set in onResume().
+ // It's best practice to unregister listeners when your app isn't using them to cut down on
+ // unnecessary system overhead. You do this in onPause().
+ getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
+ }
+
+ // When the user changes the preferences selection,
+ // onSharedPreferenceChanged() restarts the main activity as a new
+ // task. Sets the the refreshDisplay flag to "true" to indicate that
+ // the main activity should update its display.
+ // The main activity queries the PreferenceManager to get the latest settings.
+
+ @Override
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+ // Sets refreshDisplay to true so that when the user returns to the main
+ // activity, the display refreshes to reflect the new settings.
+ NetworkActivity.refreshDisplay = true;
+ }
+}</pre>
+
+<h2 id="pref-change">Respond to Preference Changes</h2>
+
+<p>When the user changes preferences in the settings screen, it typically has
+consequences for the app's behavior. In this snippet, the app checks the
+preferences settings in {@code onStart()}. if there is a match between the setting and
+the device's network connection (for example, if the setting is {@code "Wi-Fi"} and the
+device has a Wi-Fi connection), the app downloads the feed and refreshes the
+display.</p>
+
+<pre>
+public class NetworkActivity extends Activity {
+ public static final String WIFI = "Wi-Fi";
+ public static final String ANY = "Any";
+ private static final String URL = "http://stackoverflow.com/feeds/tag?tagnames=android&sort=newest";
+
+ // Whether there is a Wi-Fi connection.
+ private static boolean wifiConnected = false;
+ // Whether there is a mobile connection.
+ private static boolean mobileConnected = false;
+ // Whether the display should be refreshed.
+ public static boolean refreshDisplay = true;
+
+ // The user's current network preference setting.
+ public static String sPref = null;
+
+ // The BroadcastReceiver that tracks network connectivity changes.
+ private NetworkReceiver receiver = new NetworkReceiver();
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Registers BroadcastReceiver to track network connection changes.
+ IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
+ receiver = new NetworkReceiver();
+ this.registerReceiver(receiver, filter);
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ // Unregisters BroadcastReceiver when app is destroyed.
+ if (receiver != null) {
+ this.unregisterReceiver(receiver);
+ }
+ }
+
+ // Refreshes the display if the network connection and the
+ // pref settings allow it.
+
+ @Override
+ public void onStart () {
+ super.onStart();
+
+ // Gets the user's network preference settings
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
+
+ // Retrieves a string value for the preferences. The second parameter
+ // is the default value to use if a preference value is not found.
+ sPref = sharedPrefs.getString("listPref", "Wi-Fi");
+
+ updateConnectedFlags();
+
+ if(refreshDisplay){
+ loadPage();
+ }
+ }
+
+ // Checks the network connection and sets the wifiConnected and mobileConnected
+ // variables accordingly.
+ public void updateConnectedFlags() {
+ ConnectivityManager connMgr = (ConnectivityManager)
+ getSystemService(Context.CONNECTIVITY_SERVICE);
+
+ NetworkInfo activeInfo = connMgr.getActiveNetworkInfo();
+ if (activeInfo != null && activeInfo.isConnected()) {
+ wifiConnected = activeInfo.getType() == ConnectivityManager.TYPE_WIFI;
+ mobileConnected = activeInfo.getType() == ConnectivityManager.TYPE_MOBILE;
+ } else {
+ wifiConnected = false;
+ mobileConnected = false;
+ }
+ }
+
+ // Uses AsyncTask subclass to download the XML feed from stackoverflow.com.
+ public void loadPage() {
+ if (((sPref.equals(ANY)) && (wifiConnected || mobileConnected))
+ || ((sPref.equals(WIFI)) && (wifiConnected))) {
+ // AsyncTask subclass
+ new DownloadXmlTask().execute(URL);
+ } else {
+ showErrorPage();
+ }
+ }
+...
+
+}</pre>
+
+<h2 id="detect-changes">Detect Connection Changes</h2>
+
+<p>The final piece of the puzzle is the {@link
+android.content.BroadcastReceiver} subclass, <code>NetworkReceiver</code>. When
+the device's network connection changes, <code>NetworkReceiver</code> intercepts
+the action {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION},
+determines what the network connection status is, and sets the flags
+<code>wifiConnected</code> and <code>mobileConnected</code> to true/false
+accordingly. The upshot is that the next time the user returns to the app, the
+app will only download the latest feed and update the display if
+<code>NetworkActivity.refreshDisplay</code> is set to <code>true</code>.</p>
+
+<p>Setting up a BroadcastReceiver that gets called unnecessarily can be a
+drain on system resources.
+The sample application registers the
+{@link android.content.BroadcastReceiver} {@code NetworkReceiver} in
+{@link android.app.Activity#onCreate(android.os.Bundle) onCreate()},
+and it unregisters it in
+{@link android.app.Activity#onDestroy onDestroy()}. This is more lightweight
+than declaring a {@code <receiver>} in the manifest. When you declare a
+{@code <receiver>} in the manifest, it can wake up your app at any time,
+even if you haven't run it for weeks. By registering and unregistering
+{@code NetworkReceiver} within the main activity, you ensure that the app won't
+be woken up after the user leaves the app.
+If you do declare a {@code <receiver>} in the manifest and you know exactly
+where you need it, you can use
+{@link android.content.pm.PackageManager#setComponentEnabledSetting setComponentEnabledSetting()}
+to enable and disable it as appropriate.</p>
+
+<p>Here is <code>NetworkReceiver</code>:</p>
+
+<pre>public class NetworkReceiver extends BroadcastReceiver {
+
+@Override
+public void onReceive(Context context, Intent intent) {
+ ConnectivityManager conn = (ConnectivityManager)
+ context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo networkInfo = conn.getActiveNetworkInfo();
+
+ // Checks the user prefs and the network connection. Based on the result, decides whether
+ // to refresh the display or keep the current display.
+ // If the userpref is Wi-Fi only, checks to see if the device has a Wi-Fi connection.
+ if (WIFI.equals(sPref) && networkInfo != null && networkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
+ // If device has its Wi-Fi connection, sets refreshDisplay
+ // to true. This causes the display to be refreshed when the user
+ // returns to the app.
+ refreshDisplay = true;
+ Toast.makeText(context, R.string.wifi_connected, Toast.LENGTH_SHORT).show();
+
+ // If the setting is ANY network and there is a network connection
+ // (which by process of elimination would be mobile), sets refreshDisplay to true.
+ } else if (ANY.equals(sPref) && networkInfo != null) {
+ refreshDisplay = true;
+
+ // Otherwise, the app can't download content--either because there is no network
+ // connection (mobile or Wi-Fi), or because the pref setting is WIFI, and there
+ // is no Wi-Fi connection.
+ // Sets refreshDisplay to false.
+ } else {
+ refreshDisplay = false;
+ Toast.makeText(context, R.string.lost_connection, Toast.LENGTH_SHORT).show();
+ }
+}</pre>
+
diff --git a/docs/html/training/basics/network-ops/xml.jd b/docs/html/training/basics/network-ops/xml.jd
new file mode 100644
index 0000000..b148257
--- /dev/null
+++ b/docs/html/training/basics/network-ops/xml.jd
@@ -0,0 +1,555 @@
+page.title=Parsing XML Data
+parent.title=Performing Network Operations
+parent.link=index.html
+
+trainingnavtop=true
+
+previous.title=Managing Network Usage
+previous.link=managing.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+
+
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#choose">Choose a Parser</a></li>
+ <li><a href="#analyze">Analyze the Feed</a></li>
+ <li><a href="#instantiate">Instantiate the Parser</a></li>
+ <li><a href="#read">Read the Feed</a></li>
+ <li><a href="#parse">Parse XML</a></li>
+ <li><a href="#skip">Skip Tags You Don't Care About</a></li>
+ <li><a href="#consume">Consume XML Data</a></li>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}guide/webapps/index.html">Web Apps Overview</a></li>
+</ul>
+
+<h2>Try it out</h2>
+
+<div class="download-box">
+ <a href="{@docRoot}shareables/training/NetworkUsage.zip"
+class="button">Download the sample</a>
+ <p class="filename">NetworkUsage.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>Extensible Markup Language (XML) is a set of rules for encoding documents in
+machine-readable form. XML is a popular format for sharing data on the internet.
+Websites that frequently update their content, such as news sites or blogs,
+often provide an XML feed so that external programs can keep abreast of content
+changes. Uploading and parsing XML data is a common task for network-connected
+apps. This lesson explains how to parse XML documents and use their data.</p>
+
+<h2 id="choose">Choose a Parser</h2>
+
+<p>We recommend {@link org.xmlpull.v1.XmlPullParser}, which is an efficient and
+maintainable way to parse XML on Android. Historically Android has had two
+implementations of this interface:</p>
+
+<ul>
+ <li><a href="http://kxml.sourceforge.net/"><code>KXmlParser</code></a>
+ via {@link org.xmlpull.v1.XmlPullParserFactory#newPullParser XmlPullParserFactory.newPullParser()}.
+ </li>
+ <li><code>ExpatPullParser</code>, via
+ {@link android.util.Xml#newPullParser Xml.newPullParser()}.
+ </li>
+</ul>
+
+<p>Either choice is fine. The
+example in this section uses <code>ExpatPullParser</code>, via
+{@link android.util.Xml#newPullParser Xml.newPullParser()}. </p>
+
+<h2 id="analyze">Analyze the Feed</h2>
+
+<p>The first step in parsing a feed is to decide which fields you're interested in.
+The parser extracts data for those fields and ignores the rest.</p>
+
+<p>Here is an excerpt from the feed that's being parsed in the sample app. Each
+post to <a href="http://stackoverflow.com">StackOverflow.com</a> appears in the
+feed as an <code>entry</code> tag that contains several nested tags:</p>
+
+<pre><?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" ...">
+<title type="text">newest questions tagged android - Stack Overflow</title>
+...
+ <entry>
+ ...
+ </entry>
+ <entry>
+ <id>http://stackoverflow.com/q/9439999</id>
+ <re:rank scheme="http://stackoverflow.com">0</re:rank>
+ <title type="text">Where is my data file?</title>
+ <category scheme="http://stackoverflow.com/feeds/tag?tagnames=android&sort=newest/tags" term="android"/>
+ <category scheme="http://stackoverflow.com/feeds/tag?tagnames=android&sort=newest/tags" term="file"/>
+ <author>
+ <name>cliff2310</name>
+ <uri>http://stackoverflow.com/users/1128925</uri>
+ </author>
+ <link rel="alternate" href="http://stackoverflow.com/questions/9439999/where-is-my-data-file" />
+ <published>2012-02-25T00:30:54Z</published>
+ <updated>2012-02-25T00:30:54Z</updated>
+ <summary type="html">
+ <p>I have an Application that requires a data file...</p>
+
+ </summary>
+ </entry>
+ <entry>
+ ...
+ </entry>
+...
+</feed></pre>
+
+<p>The sample app
+extracts data for the <code>entry</code> tag and its nested tags
+<code>title</code>, <code>link</code>, and <code>summary</code>.</p>
+
+
+<h2 id="instantiate">Instantiate the Parser</h2>
+
+<p>The next step is to
+instantiate a parser and kick off the parsing process. In this snippet, a parser
+is initialized to not process namespaces, and to use the provided {@link
+java.io.InputStream} as its input. It starts the parsing process with a call to
+{@link org.xmlpull.v1.XmlPullParser#nextTag() nextTag()} and invokes the
+<code>readFeed()</code> method, which extracts and processes the data the app is
+interested in:</p>
+
+<pre>public class StackOverflowXmlParser {
+ // We don't use namespaces
+ private static final String ns = null;
+
+ public List<Entry> parse(InputStream in) throws XmlPullParserException, IOException {
+ try {
+ XmlPullParser parser = Xml.newPullParser();
+ parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
+ parser.setInput(in, null);
+ parser.nextTag();
+ return readFeed(parser);
+ } finally {
+ in.close();
+ }
+ }
+ ...
+}</pre>
+
+<h2 id="read">Read the Feed</h2>
+
+<p>The <code>readFeed()</code> method does the actual work of processing the
+feed. It looks for elements tagged "entry" as a starting point for recursively
+processing the feed. If a tag isn't an {@code entry} tag, it skips it. Once the whole
+feed has been recursively processed, <code>readFeed()</code> returns a {@link
+java.util.List} containing the entries (including nested data members) it
+extracted from the feed. This {@link java.util.List} is then returned by the
+parser.</p>
+
+<pre>
+private List<Entry> readFeed(XmlPullParser parser) throws XmlPullParserException, IOException {
+ List<Entry> entries = new ArrayList<Entry>();
+
+ parser.require(XmlPullParser.START_TAG, ns, "feed");
+ while (parser.next() != XmlPullParser.END_TAG) {
+ if (parser.getEventType() != XmlPullParser.START_TAG) {
+ continue;
+ }
+ String name = parser.getName();
+ // Starts by looking for the entry tag
+ if (name.equals("entry")) {
+ entries.add(readEntry(parser));
+ } else {
+ skip(parser);
+ }
+ }
+ return entries;
+}</pre>
+
+
+<h2 id="parse">Parse XML</h2>
+
+
+<p>The steps for parsing an XML feed are as follows:</p>
+<ol>
+
+ <li>As described in <a href="#analyze">Analyze the Feed</a>, identify the tags you want to include in your app. This
+example extracts data for the <code>entry</code> tag and its nested tags
+<code>title</code>, <code>link</code>, and <code>summary</code>.</li>
+
+<li>Create the following methods:</p>
+
+<ul>
+
+<li>A "read" method for each tag you're interested in. For example,
+<code>readEntry()</code>, <code>readTitle()</code>, and so on. The parser reads
+tags from the input stream. When it encounters a tag named <code>entry</code>,
+<code>title</code>,
+<code>link</code> or <code>summary</code>, it calls the appropriate method
+for that tag. Otherwise, it skips the tag.
+</li>
+
+<li>Methods to extract data for each different type of tag and to advance the
+parser to the next tag. For example:
+<ul>
+
+<li>For the <code>title</code> and <code>summary</code> tags, the parser calls
+<code>readText()</code>. This method extracts data for these tags by calling
+<code>parser.getText()</code>.</li>
+
+<li>For the <code>link</code> tag, the parser extracts data for links by first
+determining if the link is the kind
+it's interested in. Then it uses <code>parser.getAttributeValue()</code> to
+extract the link's value.</li>
+
+<li>For the <code>entry</code> tag, the parser calls <code>readEntry()</code>.
+This method parses the entry's nested tags and returns an <code>Entry</code>
+object with the data members <code>title</code>, <code>link</code>, and
+<code>summary</code>.</li>
+
+</ul>
+</li>
+<li>A helper <code>skip()</code> method that's recursive. For more discussion of this topic, see <a href="#skip">Skip Tags You Don't Care About</a>.</li>
+</ul>
+
+ </li>
+</ol>
+
+<p>This snippet shows how the parser parses entries, titles, links, and summaries.</p>
+<pre>public static class Entry {
+ public final String title;
+ public final String link;
+ public final String summary;
+
+ private Entry(String title, String summary, String link) {
+ this.title = title;
+ this.summary = summary;
+ this.link = link;
+ }
+}
+
+// Parses the contents of an entry. If it encounters a title, summary, or link tag, hands them off
+// to their respective "read" methods for processing. Otherwise, skips the tag.
+private Entry readEntry(XmlPullParser parser) throws XmlPullParserException, IOException {
+ parser.require(XmlPullParser.START_TAG, ns, "entry");
+ String title = null;
+ String summary = null;
+ String link = null;
+ while (parser.next() != XmlPullParser.END_TAG) {
+ if (parser.getEventType() != XmlPullParser.START_TAG) {
+ continue;
+ }
+ String name = parser.getName();
+ if (name.equals("title")) {
+ title = readTitle(parser);
+ } else if (name.equals("summary")) {
+ summary = readSummary(parser);
+ } else if (name.equals("link")) {
+ link = readLink(parser);
+ } else {
+ skip(parser);
+ }
+ }
+ return new Entry(title, summary, link);
+}
+
+// Processes title tags in the feed.
+private String readTitle(XmlPullParser parser) throws IOException, XmlPullParserException {
+ parser.require(XmlPullParser.START_TAG, ns, "title");
+ String title = readText(parser);
+ parser.require(XmlPullParser.END_TAG, ns, "title");
+ return title;
+}
+
+// Processes link tags in the feed.
+private String readLink(XmlPullParser parser) throws IOException, XmlPullParserException {
+ String link = "";
+ parser.require(XmlPullParser.START_TAG, ns, "link");
+ String tag = parser.getName();
+ String relType = parser.getAttributeValue(null, "rel");
+ if (tag.equals("link")) {
+ if (relType.equals("alternate")){
+ link = parser.getAttributeValue(null, "href");
+ parser.nextTag();
+ }
+ }
+ parser.require(XmlPullParser.END_TAG, ns, "link");
+ return link;
+}
+
+// Processes summary tags in the feed.
+private String readSummary(XmlPullParser parser) throws IOException, XmlPullParserException {
+ parser.require(XmlPullParser.START_TAG, ns, "summary");
+ String summary = readText(parser);
+ parser.require(XmlPullParser.END_TAG, ns, "summary");
+ return summary;
+}
+
+// For the tags title and summary, extracts their text values.
+private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {
+ String result = "";
+ if (parser.next() == XmlPullParser.TEXT) {
+ result = parser.getText();
+ parser.nextTag();
+ }
+ return result;
+}
+ ...
+}</pre>
+
+<h2 id="skip">Skip Tags You Don't Care About</h2>
+
+<p>One of the steps in the XML parsing described above is for the parser to skip tags it's not interested in. Here is the parser's <code>skip()</code> method:</p>
+
+<pre>
+private void skip(XmlPullParser parser) throws XmlPullParserException, IOException {
+ if (parser.getEventType() != XmlPullParser.START_TAG) {
+ throw new IllegalStateException();
+ }
+ int depth = 1;
+ while (depth != 0) {
+ switch (parser.next()) {
+ case XmlPullParser.END_TAG:
+ depth--;
+ break;
+ case XmlPullParser.START_TAG:
+ depth++;
+ break;
+ }
+ }
+ }
+</pre>
+
+<p>This is how it works:</p>
+
+<ul>
+
+<li>It throws an exception if the current event isn't a
+<code>START_TAG</code>.</li>
+
+<li>It consumes the <code>START_TAG</code>, and all events up to and including
+the matching <code>END_TAG</code>.</li>
+
+<li>To make sure that it stops at the correct <code>END_TAG</code> and not at
+the first tag it encounters after the original <code>START_TAG</code>, it keeps
+track of the nesting depth.</li>
+
+</ul>
+
+<p>Thus if the current element has nested elements, the value of
+<code>depth</code> won't be 0 until the parser has consumed all events between
+the original <code>START_TAG</code> and its matching <code>END_TAG</code>. For
+example, consider how the parser skips the <code><author></code> element,
+which has 2 nested elements, <code><name></code> and
+<code><uri></code>:</p>
+
+<ul>
+
+<li>The first time through the <code>while</code> loop, the next tag the parser
+encounters after <code><author></code> is the <code>START_TAG</code> for
+<code><name></code>. The value for <code>depth</code> is incremented to
+2.</li>
+
+<li>The second time through the <code>while</code> loop, the next tag the parser
+encounters is the <code>END_TAG</code> <code></name></code>. The value
+for <code>depth</code> is decremented to 1.</li>
+
+<li>The third time through the <code>while</code> loop, the next tag the parser
+encounters is the <code>START_TAG</code> <code><uri></code>. The value
+for <code>depth</code> is incremented to 2.</li>
+
+<li>The fourth time through the <code>while</code> loop, the next tag the parser
+encounters is the <code>END_TAG</code> <code></uri></code>. The value for
+<code>depth</code> is decremented to 1.</li>
+
+<li>The fifth time and final time through the <code>while</code> loop, the next
+tag the parser encounters is the <code>END_TAG</code>
+<code></author></code>. The value for <code>depth</code> is decremented to
+0, indicating that the <code><author></code> element has been successfully
+skipped.</li>
+
+</ul>
+
+<h2 id="consume">Consume XML Data</h2>
+
+<p>The example application fetches and parses the XML feed within an {@link
+android.os.AsyncTask}. This takes the processing off the main UI thread. When
+processing is complete, the app updates the UI in the main activity
+(<code>NetworkActivity</code>).</p>
+<p>In the excerpt shown below, the <code>loadPage()</code> method does the
+following:</p>
+
+<ul>
+
+ <li>Initializes a string variable with the URL for the XML feed.</li>
+
+ <li>If the user's settings and the network connection allow it, invokes
+<code>new DownloadXmlTask().execute(url)</code>. This instantiates a new
+<code>DownloadXmlTask</code> object ({@link android.os.AsyncTask} subclass) and
+runs its {@link android.os.AsyncTask#execute execute()} method, which downloads
+and parses the feed and returns a string result to be displayed in the UI.</li>
+
+</ul>
+<pre>
+public class NetworkActivity extends Activity {
+ public static final String WIFI = "Wi-Fi";
+ public static final String ANY = "Any";
+ private static final String URL = "http://stackoverflow.com/feeds/tag?tagnames=android&sort=newest";
+
+ // Whether there is a Wi-Fi connection.
+ private static boolean wifiConnected = false;
+ // Whether there is a mobile connection.
+ private static boolean mobileConnected = false;
+ // Whether the display should be refreshed.
+ public static boolean refreshDisplay = true;
+ public static String sPref = null;
+
+ ...
+
+ // Uses AsyncTask to download the XML feed from stackoverflow.com.
+ public void loadPage() {
+
+ if((sPref.equals(ANY)) && (wifiConnected || mobileConnected)) {
+ new DownloadXmlTask().execute(URL);
+ }
+ else if ((sPref.equals(WIFI)) && (wifiConnected)) {
+ new DownloadXmlTask().execute(URL);
+ } else {
+ // show error
+ }
+ }</pre>
+
+<p>The {@link android.os.AsyncTask} subclass shown below,
+<code>DownloadXmlTask</code>, implements the following {@link
+android.os.AsyncTask} methods:</p>
+
+ <ul>
+
+ <li>{@link android.os.AsyncTask#doInBackground doInBackground()} executes
+the method <code>loadXmlFromNetwork()</code>. It passes the feed URL as a
+parameter. The method <code>loadXmlFromNetwork()</code> fetches and processes
+the feed. When it finishes, it passes back a result string.</li>
+
+ <li>{@link android.os.AsyncTask#onPostExecute onPostExecute()} takes the
+returned string and displays it in the UI.</li>
+
+ </ul>
+
+<pre>
+// Implementation of AsyncTask used to download XML feed from stackoverflow.com.
+private class DownloadXmlTask extends AsyncTask<String, Void, String> {
+ @Override
+ protected String doInBackground(String... urls) {
+ try {
+ return loadXmlFromNetwork(urls[0]);
+ } catch (IOException e) {
+ return getResources().getString(R.string.connection_error);
+ } catch (XmlPullParserException e) {
+ return getResources().getString(R.string.xml_error);
+ }
+ }
+
+ @Override
+ protected void onPostExecute(String result) {
+ setContentView(R.layout.main);
+ // Displays the HTML string in the UI via a WebView
+ WebView myWebView = (WebView) findViewById(R.id.webview);
+ myWebView.loadData(result, "text/html", null);
+ }
+}</pre>
+
+ <p>Below is the method <code>loadXmlFromNetwork()</code> that is invoked from
+<code>DownloadXmlTask</code>. It does the following:</p>
+
+ <ol>
+
+ <li>Instantiates a <code>StackOverflowXmlParser</code>. It also creates variables for
+a {@link java.util.List} of <code>Entry</code> objects (<code>entries</code>), and
+<code>title</code>, <code>url</code>, and <code>summary</code>, to hold the
+values extracted from the XML feed for those fields.</li>
+
+ <li>Calls <code>downloadUrl()</code>, which fetches the feed and returns it as
+ an {@link java.io.InputStream}.</li>
+
+ <li>Uses <code>StackOverflowXmlParser</code> to parse the {@link java.io.InputStream}.
+ <code>StackOverflowXmlParser</code> populates a
+ {@link java.util.List} of <code>entries</code> with data from the feed.</li>
+
+ <li>Processes the <code>entries</code> {@link java.util.List},
+ and combines the feed data with HTML markup.</li>
+
+ <li>Returns an HTML string that is displayed in the main activity
+UI by the {@link android.os.AsyncTask} method {@link
+android.os.AsyncTask#onPostExecute onPostExecute()}.</li>
+
+</ol>
+
+<pre>
+// Uploads XML from stackoverflow.com, parses it, and combines it with
+// HTML markup. Returns HTML string.
+private String loadXmlFromNetwork(String urlString) throws XmlPullParserException, IOException {
+ InputStream stream = null;
+ // Instantiate the parser
+ StackOverflowXmlParser stackOverflowXmlParser = new StackOverflowXmlParser();
+ List<Entry> entries = null;
+ String title = null;
+ String url = null;
+ String summary = null;
+ Calendar rightNow = Calendar.getInstance();
+ DateFormat formatter = new SimpleDateFormat("MMM dd h:mmaa");
+
+ // Checks whether the user set the preference to include summary text
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
+ boolean pref = sharedPrefs.getBoolean("summaryPref", false);
+
+ StringBuilder htmlString = new StringBuilder();
+ htmlString.append("<h3>" + getResources().getString(R.string.page_title) + "</h3>");
+ htmlString.append("<em>" + getResources().getString(R.string.updated) + " " +
+ formatter.format(rightNow.getTime()) + "</em>");
+
+ try {
+ stream = downloadUrl(urlString);
+ entries = stackOverflowXmlParser.parse(stream);
+ // Makes sure that the InputStream is closed after the app is
+ // finished using it.
+ } finally {
+ if (stream != null) {
+ stream.close();
+ }
+ }
+
+ // StackOverflowXmlParser returns a List (called "entries") of Entry objects.
+ // Each Entry object represents a single post in the XML feed.
+ // This section processes the entries list to combine each entry with HTML markup.
+ // Each entry is displayed in the UI as a link that optionally includes
+ // a text summary.
+ for (Entry entry : entries) {
+ htmlString.append("<p><a href='");
+ htmlString.append(entry.link);
+ htmlString.append("'>" + entry.title + "</a></p>");
+ // If the user set the preference to include summary text,
+ // adds it to the display.
+ if (pref) {
+ htmlString.append(entry.summary);
+ }
+ }
+ return htmlString.toString();
+}
+
+// Given a string representation of a URL, sets up a connection and gets
+// an input stream.
+private InputStream downloadUrl(String urlString) throws IOException {
+ URL url = new URL(urlString);
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setReadTimeout(10000 /* milliseconds */);
+ conn.setConnectTimeout(15000 /* milliseconds */);
+ conn.setRequestMethod("GET");
+ conn.setDoInput(true);
+ // Starts the query
+ conn.connect();
+ InputStream stream = conn.getInputStream();
+}</pre>
diff --git a/docs/html/training/basics/supporting-devices/languages.jd b/docs/html/training/basics/supporting-devices/languages.jd
index fcc95c2..d83fbca 100644
--- a/docs/html/training/basics/supporting-devices/languages.jd
+++ b/docs/html/training/basics/supporting-devices/languages.jd
@@ -97,6 +97,10 @@
</resources>
</pre>
+<p class="note"><strong>Note:</strong> You can use the locale qualifier (or any
+configuration qualifer) on any resource type, such as if you want to provide
+localized versions of your bitmap drawable. For more information, see <a
+href="{@docRoot}guide/topics/resources/localization.html">Localization</a>.
<h2 id="UseString">Use the String Resources</h2>
diff --git a/docs/html/training/basics/supporting-devices/platforms.jd b/docs/html/training/basics/supporting-devices/platforms.jd
index 0d4e7d9..04872a3 100644
--- a/docs/html/training/basics/supporting-devices/platforms.jd
+++ b/docs/html/training/basics/supporting-devices/platforms.jd
@@ -21,9 +21,9 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a></li>
+ <li><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">Android API Levels</a></li>
<li><a
-href="{@docRoot}sdk/compatibility-library.html">Android Support Library</a></li>
+href="{@docRoot}tools/extras/support-library.html">Android Support Library</a></li>
</ul>
</div>
</div>
@@ -34,7 +34,7 @@
versions as well.</p>
<p>The dashboard for <a
-href="http://developer.android.com/resources/dashboard/platform-versions.html">Platform Versions</a>
+href="http://developer.android.com/about/dashboards/index.html">Platform Versions</a>
is updated regularly to show the distribution of active
devices running each version of Android, based on the number of devices that visit the Google Play
Store. Generally, it’s a good practice to support about 90% of the active devices, while
@@ -42,7 +42,7 @@
<p class="note"><strong>Tip:</strong> In order to provide the best features and
functionality across several Android versions, you should use the <a
-href="{@docRoot}sdk/compatibility-library.html">Android Support Library</a> in your app,
+href="{@docRoot}tools/extras/support-library.html">Android Support Library</a> in your app,
which allows you to use several recent platform APIs on older versions.</p>
diff --git a/docs/html/training/camera/index.jd b/docs/html/training/camera/index.jd
index d209c7e..282bed8 100644
--- a/docs/html/training/camera/index.jd
+++ b/docs/html/training/camera/index.jd
@@ -21,7 +21,7 @@
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}guide/topics/media/camera.html">Camera</a></li>
- <li><a href="{@docRoot}guide/topics/fundamentals/activities.html">Activities</a></li>
+ <li><a href="{@docRoot}guide/components/activities.html">Activities</a></li>
</ul>
diff --git a/docs/html/training/camera/photobasics.jd b/docs/html/training/camera/photobasics.jd
index 3420918..8fa6d67b 100644
--- a/docs/html/training/camera/photobasics.jd
+++ b/docs/html/training/camera/photobasics.jd
@@ -25,7 +25,7 @@
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}guide/topics/media/camera.html">Camera</a></li>
- <li><a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent
Filters</a></li>
</ul>
diff --git a/docs/html/training/camera/videobasics.jd b/docs/html/training/camera/videobasics.jd
index 5fe1a3a..d011d09 100644
--- a/docs/html/training/camera/videobasics.jd
+++ b/docs/html/training/camera/videobasics.jd
@@ -24,7 +24,7 @@
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}guide/topics/media/camera.html">Camera</a></li>
- <li><a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent
Filters</a></li>
</ul>
diff --git a/docs/html/training/custom-views/create-view.jd b/docs/html/training/custom-views/create-view.jd
new file mode 100644
index 0000000..b0bc8b4
--- /dev/null
+++ b/docs/html/training/custom-views/create-view.jd
@@ -0,0 +1,281 @@
+page.title=Creating a View Class
+parent.title=Creating Custom Views
+parent.link=index.html
+
+trainingnavtop=true
+next.title=Custom Drawing
+next.link=custom-drawing.html
+
+@jd:body
+
+<div id="tb-wrapper">
+ <div id="tb">
+
+ <h2>This lesson teaches you to</h2>
+ <ol>
+ <li><a href="#subclassview">Subclass a View</a></li>
+ <li><a href="#customattr">Define Custom Attributes</a></li>
+ <li><a href="#applyattr">Apply Custom Attributes to a View</a></li>
+ <li><a href="#addprop">Add Properties and Events</a></li>
+ <li><a href="#accessibility">Design For Accessibility</a></li>
+ </ol>
+
+ <h2>You should also read</h2>
+ <ul>
+ <li><a href="{@docRoot}/guide/topics/ui/custom-components.html">Custom Components</a>
+ </li>
+ </ul>
+<h2>Try it out</h2>
+<div class="download-box">
+<a href="{@docRoot}shareables/training/CustomView.zip"
+class="button">Download the sample</a>
+<p class="filename">CustomView.zip</p>
+</div>
+ </div>
+</div>
+
+<p>A well-designed custom view is much like any other well-designed class. It encapsulates a
+specific set of
+functionality with an easy to use interface, it uses CPU and memory efficiently, and so forth. In
+addition to being a
+well-designed class, though, a custom view should:
+
+<ul>
+ <li>Conform to Android standards</li>
+ <li>Provide custom styleable attributes that work with Android XML layouts</li>
+ <li>Send accessibility events</li>
+ <li>Be compatible with multiple Android platforms.</li>
+</ul>
+
+<p>The Android framework provides a set of base classes and XML tags to help you create a view that
+ meets all of these
+ requirements. This lesson discusses how to use the Android framework to create the core
+ functionality of a view
+ class.</p>
+
+<h2 id="subclassview">Subclass a View</h2>
+
+<p>All of the view classes defined in the Android framework extend {@link android.view.View}. Your
+ custom view can also
+ extend {@link android.view.View View} directly, or you can save time by extending one of the
+ existing view
+ subclasses, such as {@link android.widget.Button}.</p>
+
+<p>To allow the <a href=”{@docRoot}guide/developing/tools/adt.html”>Android Developer Tools
+</a> to interact with your view, at a minimum you must provide a constructor that takes a
+{@link android.content.Context} and an {@link android.util.AttributeSet} object as parameters.
+This constructor allows the layout editor to create and edit an instance of your view.</p>
+
+<pre class="prettyprint">
+class PieChart extends View {
+ public PieChart(Context ctx, AttributeSet attrs) {
+ super(ctx, attrs);
+ }
+}
+</pre>
+
+<h2 id="customattr">Define Custom Attributes</h2>
+
+<p>To add a built-in {@link android.view.View View} to your user interface, you specify it in an XML element and
+control its
+appearance and behavior with element attributes. Well-written custom views can also be added and
+styled via XML. To
+enable this behavior in your custom view, you must:
+
+<ul>
+ <li>Define custom attributes for your view in a {@code
+ <declare-styleable>
+ } resource element
+ </li>
+ <li>Specify values for the attributes in your XML layout</li>
+ <li>Retrieve attribute values at runtime</li>
+ <li>Apply the retrieved attribute values to your view</li>
+</ul>
+
+<p>This section discusses how to define custom attributes and specify their values.
+ The next section deals with
+ retrieving and applying the values at runtime.</p>
+
+<p>To define custom attributes, add {@code
+ <declare-styleable>
+ } resources to your project. It's customary to put these resources into a {@code
+ res/values/attrs.xml} file. Here's
+ an example of an {@code attrs.xml} file:
+</p>
+
+<pre>
+<resources>;
+ <declare-styleable name="PieChart">
+ <attr name="showText" format="boolean" />
+ <attr name="labelPosition" format="enum">
+ <enum name="left" value="0"/>
+ <enum name="right" value="1"/>
+ </attr>
+ </declare-styleable>
+</resources>
+</pre>
+
+<p>This code declares two custom attributes, {@code showText} and {@code labelPosition}, that belong
+ to a styleable
+ entity named {@code PieChart}. The name of the styleable entity is, by convention, the same name as the
+ name of the class
+ that defines the custom view. Although it's not strictly necessary to follow this convention,
+ many popular code
+ editors depend on this naming convention to provide statement completion.</p>
+
+<p>Once you define the custom attributes, you can use them in layout XML files just like built-in
+ attributes. The only
+ difference is that your custom attributes belong to a different namespace. Instead of belonging
+ to the {@code
+ http://schemas.android.com/apk/res/android} namespace, they belong to {@code
+ http://schemas.android.com/apk/res/[your package name]}. For example, here's how to use the
+ attributes defined for
+ {@code PieChart}:
+ <p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:custom="http://schemas.android.com/apk/res/com.example.customviews">
+ <com.example.customviews.charting.PieChart
+ custom:showText="true"
+ custom:labelPosition="left" />
+</LinearLayout>
+</pre>
+
+ <p>In order to avoid having to repeat the long namespace URI, the sample uses an {@code
+ xmlns} directive. This
+ directive assigns the alias {@code custom} to the namespace {@code
+ http://schemas.android.com/apk/res/com.example.customviews}. You can choose any alias
+ you want for your
+ namespace.</p>
+
+ <p>Notice the name of the XML tag that adds the custom view to the layout. It is the fully
+ qualified name of the
+ custom view class. If your view class is an inner class, you must further qualify it with the name of the view's outer class.
+ further. For instance, the
+ {@code PieChart} class has an inner class called {@code PieView}. To use the custom attributes from this class, you would
+ use the tag {@code com.example.customviews.charting.PieChart$PieView}.</p>
+
+ <h2 id="applyattr">Apply Custom Attributes</h2>
+
+ <p>When a view is created from an XML layout, all of the attributes in the XML tag are read
+ from the resource
+ bundle and passed into the view's constructor as an {@link android.util.AttributeSet}.
+ Although it's
+ possible to read values from the {@link android.util.AttributeSet} directly, doing so
+ has some disadvantages:</p>
+
+ <ul>
+ <li>Resource references within attribute values are not resolved</li>
+ <li>Styles are not applied</li>
+ </ul>
+
+ <p>Instead, pass the {@link android.util.AttributeSet} to {@link
+ android.content.res.Resources.Theme#obtainStyledAttributes obtainStyledAttributes()}.
+ This method passes back a {@link android.content.res.TypedArray TypedArray} array of
+ values that have
+ already been dereferenced and styled.</p>
+
+ <p>The Android resource compiler does a lot of work for you to make calling {@link
+ android.content.res.Resources.Theme#obtainStyledAttributes obtainStyledAttributes()}
+ easier. For each {@code <declare-styleable>}
+ resource in the res directory, the generated R.java defines both an array of attribute
+ ids and a set of
+ constants that define the index for each attribute in the array. You use the predefined
+ constants to read
+ the attributes from the {@link android.content.res.TypedArray TypedArray}. Here's how
+ the {@code PieChart} class
+ reads its attributes:</p>
+
+<pre>
+public PieChart(Context ctx, AttributeSet attrs) {
+ super(ctx, attrs);
+ TypedArray a = context.getTheme().obtainStyledAttributes(
+ attrs,
+ R.styleable.PieChart,
+ 0, 0);
+
+ try {
+ mShowText = a.getBoolean(R.styleable.PieChart_showText, false);
+ mTextPos = a.getInteger(R.styleable.PieChart_labelPosition, 0);
+ } finally {
+ a.recycle();
+ }
+}
+</pre>
+
+ <p>Note that {@link android.content.res.TypedArray TypedArray} objects
+ are a shared resource
+ and must be recycled after use.</p>
+
+ <h2 id="addprop">Add Properties and Events</h2>
+
+ <p>Attributes are a powerful way of controlling the behavior and appearance of views, but
+ they can only be read
+ when the view is initialized. To provide dynamic behavior, expose a property getter and
+ setter pair for each
+ custom attribute. The following snippet shows how {@code PieChart} exposes a property
+ called {@code
+ showText}:</p>
+
+<pre>
+public boolean isShowText() {
+ return mShowText;
+}
+
+public void setShowText(boolean showText) {
+ mShowText = showText;
+ invalidate();
+ requestLayout();
+}
+</pre>
+
+ <p>Notice that {@code setShowText} calls {@link android.view.View#invalidate invalidate()}
+ and {@link android.view.View#requestLayout requestLayout()}. These calls are crucial
+ to ensure that the view behaves reliably. You have
+ to invalidate the view after any change to its properties that might change its
+ appearance, so that the
+ system knows that it needs to be redrawn. Likewise, you need to request a new layout if
+ a property changes
+ that might affect the size or shape of the view. Forgetting these method calls can cause
+ hard-to-find
+ bugs.</p>
+
+ <p>Custom views should also support event listeners to communicate important events. For
+ instance, {@code PieChart}
+ exposes a custom event called {@code OnCurrentItemChanged} to notify listeners that the
+ user has rotated the
+ pie chart to focus on a new pie slice.</p>
+
+ <p>It's easy to forget to expose properties and events, especially when you're the only user
+ of the custom view.
+ Taking some time to carefully define your view's interface reduces future maintenance
+ costs.
+ A good rule to follow is to always expose any property that affects the visible
+ appearance or behavior of
+ your custom view.
+
+ <h2 id="accessibility">Design For Accessibility</h2>
+
+ <p>Your custom view should support the widest range of users. This includes users with
+ disabilities that
+ prevent them from seeing or using a touchscreen. To support users with disabilities,
+ you should:</p>
+
+ <ul>
+ <li>Label your input fields using the {@code android:contentDescription} attribute
+ </li>
+ <li>Send accessibility events by calling {@link
+ android.view.accessibility.AccessibilityEventSource#sendAccessibilityEvent
+ sendAccessibilityEvent()} when
+ appropriate.
+ </li>
+ <li>
+ Support alternate controllers, such as D-pad and trackball</li>
+ </ul>
+
+ <p>For more information on creating accessible views, see
+ <a href=”{@docRoot}guide/topics/ui/accessibility/apps.html#custom-views”>
+ Making Applications Accessible</a> in the Android Developers Guide.
+ </p>
diff --git a/docs/html/training/custom-views/custom-drawing.jd b/docs/html/training/custom-views/custom-drawing.jd
new file mode 100644
index 0000000..8280237
--- /dev/null
+++ b/docs/html/training/custom-views/custom-drawing.jd
@@ -0,0 +1,284 @@
+page.title=Custom Drawing
+parent.title=Creating Custom Views
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Creating a View Class
+previous.link=create-view.html
+next.title=Making the View Interactive
+next.link=making-interactive.html
+
+@jd:body
+
+<div id="tb-wrapper">
+ <div id="tb">
+
+ <h2>This lesson teaches you to</h2>
+ <ol>
+ <li><a href="#ondraw">Override onDraw()</a></li>
+ <li><a href="#createobject">Create Drawing Objects</a></li>
+ <li><a href="#layoutevent">Handle Layout Events</a></li>
+ <li><a href="#draw">Draw!</a></li>
+ </ol>
+
+ <h2>You should also read</h2>
+ <ul>
+ <li><a href="{@docRoot}guide/topics/graphics/2d-graphics.html">
+ Canvas and Drawables</a></li>
+ </ul>
+<h2>Try it out</h2>
+<div class="download-box">
+<a href="{@docRoot}shareables/training/CustomView.zip"
+class="button">Download the sample</a>
+<p class="filename">CustomView.zip</p>
+</div>
+ </div>
+</div>
+
+<p>The most important part of a custom view is its appearance. Custom drawing can be easy or complex
+according to your
+application's needs. This lesson covers some of the most common operations.</p>
+
+<h2 id="overrideondraw">Override onDraw()</h2>
+
+<p>The most important step in drawing a custom view is to override the {@link
+android.view.View#onDraw(android.graphics.Canvas) onDraw()} method. The parameter to {@link
+android.view.View#onDraw(android.graphics.Canvas) onDraw()} is a {@link
+android.graphics.Canvas Canvas} object that the view can use to draw itself. The {@link
+android.graphics.Canvas Canvas}
+class defines methods for drawing text, lines, bitmaps, and many other graphics primitives. You can
+use these methods in
+{@link
+android.view.View#onDraw(android.graphics.Canvas) onDraw()} to create your custom user interface (UI).</p>
+
+<p>Before you can call any drawing methods, though, it's necessary to create a {@link
+android.graphics.Paint Paint}
+object. The next section discusses {@link android.graphics.Paint Paint} in more detail.</p>
+
+<h2 id="createobject">Create Drawing Objects</h2>
+
+<p>The {@link android.graphics} framework divides drawing into two areas:</p>
+
+<ul>
+<li><i>What</i> to draw, handled by {@link android.graphics.Canvas Canvas}</li>
+<li><i>How</i> to draw, handled by {@link android.graphics.Paint}.</li>
+</ul>
+
+<p>For instance, {@link android.graphics.Canvas Canvas} provides a method to draw a line, while
+{@link
+android.graphics.Paint Paint} provides methods to define that line's color. {@link
+android.graphics.Canvas Canvas} has a
+method to draw a rectangle, while {@link android.graphics.Paint Paint} defines whether to fill that
+rectangle with a
+color or leave it empty. Simply put, {@link android.graphics.Canvas Canvas} defines shapes that you
+can draw on the
+screen, while {@link android.graphics.Paint Paint} defines the color, style, font, and so forth of
+each shape you
+draw.</p>
+
+<p>So, before you draw anything, you need to create one or more {@link android.graphics.Paint Paint}
+objects. The {@code PieChart} example does this in a method called {@code init}, which is
+called from the
+constructor:</p>
+
+<pre>
+private void init() {
+ mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ mTextPaint.setColor(mTextColor);
+ if (mTextHeight == 0) {
+ mTextHeight = mTextPaint.getTextSize();
+ } else {
+ mTextPaint.setTextSize(mTextHeight);
+ }
+
+ mPiePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ mPiePaint.setStyle(Paint.Style.FILL);
+ mPiePaint.setTextSize(mTextHeight);
+
+ mShadowPaint = new Paint(0);
+ mShadowPaint.setColor(0xff101010);
+ mShadowPaint.setMaskFilter(new BlurMaskFilter(8, BlurMaskFilter.Blur.NORMAL));
+
+ ...
+</pre>
+
+
+<p>Creating objects ahead of time is an important optimization. Views are redrawn very frequently,
+and many drawing
+objects require expensive initialization. Creating drawing objects within your {@link
+android.view.View#onDraw(android.graphics.Canvas) onDraw()}
+method significantly
+reduces performance and can make your UI appear sluggish.</p>
+
+<h2 id="layouteevent">Handle Layout Events</h2>
+
+<p>In order to properly draw your custom view, you need to know what size it is. Complex custom
+views often need to
+perform multiple layout calculations depending on the size and shape of their area on screen. You
+should never make
+assumptions about the size of your view on the screen. Even if only one app uses your view, that app
+needs to handle
+different screen sizes, multiple screen densities, and various aspect ratios in both portrait and
+landscape mode.</p>
+
+<p>Although {@link android.view.View} has many methods for handling measurement, most of them do not
+need to be
+overridden. If your view doesn't need special control over its size, you only need to override one
+method: {@link
+android.view.View#onSizeChanged onSizeChanged()}.</p>
+
+<p>{@link
+android.view.View#onSizeChanged onSizeChanged()} is called when your view is first assigned a size,
+and again if the size of your view changes
+for any reason. Calculate positions, dimensions, and any other values related to your view's size in
+{@link
+android.view.View#onSizeChanged onSizeChanged()}, instead of recalculating them every time you draw.
+In the {@code PieChart} example, {@link
+android.view.View#onSizeChanged onSizeChanged()} is
+where the {@code PieChart} view calculates the bounding rectangle of the pie chart and the relative position
+of the text label
+and other visual elements.</p>
+
+<p>When your view is assigned a size, the layout manager assumes that the size includes all of the
+view's padding. You
+must handle the padding values when you calculate your view's size. Here's a snippet from {@code
+PieChart.onSizeChanged()}
+that shows how to do this:</p>
+
+<pre>
+ // Account for padding
+ float xpad = (float)(getPaddingLeft() + getPaddingRight());
+ float ypad = (float)(getPaddingTop() + getPaddingBottom());
+
+ // Account for the label
+ if (mShowText) xpad += mTextWidth;
+
+ float ww = (float)w - xpad;
+ float hh = (float)h - ypad;
+
+ // Figure out how big we can make the pie.
+ float diameter = Math.min(ww, hh);
+</pre>
+
+<p>If you need finer control over your view's layout parameters, implement {@link
+android.view.View#onMeasure onMeasure()}. This method's parameters are
+{@link android.view.View.MeasureSpec} values that tell you how big your view's
+parent wants your view to be, and whether that size is a hard maximum or just a suggestion. As an
+optimization, these
+values are stored as packed integers, and you use the static methods of
+{@link android.view.View.MeasureSpec} to
+unpack the information
+stored in each integer.
+
+<p>Here's an example implementation of {@link android.view.View#onMeasure onMeasure()}.
+ In this implementation, {@code PieChart}
+ attempts to make its area
+ big enough to make the pie as big as its label:</p>
+
+<pre>
+@Override
+protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ // Try for a width based on our minimum
+ int minw = getPaddingLeft() + getPaddingRight() + getSuggestedMinimumWidth();
+ int w = resolveSizeAndState(minw, widthMeasureSpec, 1);
+
+ // Whatever the width ends up being, ask for a height that would let the pie
+ // get as big as it can
+ int minh = MeasureSpec.getSize(w) - (int)mTextWidth + getPaddingBottom() + getPaddingTop();
+ int h = resolveSizeAndState(MeasureSpec.getSize(w) - (int)mTextWidth, heightMeasureSpec, 0);
+
+ setMeasuredDimension(w, h);
+}
+</pre>
+
+<p>There are three important things to note in this code:</p>
+
+<ul>
+ <li>The calculations take into account the view's padding. As mentioned earlier, this is the
+ view's
+ responsibility.
+ </li>
+ <li>The helper method {@link android.view.View#resolveSizeAndState resolveSizeAndState()} is
+ used to create the
+ final width and height values. This helper returns an appropriate
+ {@link android.view.View.MeasureSpec} value
+ by comparing the view's desired size to the spec passed into
+ {@link android.view.View#onMeasure onMeasure()}.
+ </li>
+ <li>{@link android.view.View#onMeasure onMeasure()} has no return value.
+ Instead, the method communicates its results by
+ calling {@link
+ android.view.View#setMeasuredDimension setMeasuredDimension()}. Calling this method is
+ mandatory. If you omit
+ this call, the {@link android.view.View} class throws a runtime exception.
+ </li>
+</ul>
+
+<h2 id="draw">Draw!</h2>
+
+<p>Once you have your object creation and measuring code defined, you can implement {@link
+ android.view.View#onDraw(android.graphics.Canvas) onDraw()}. Every view
+ implements {@link
+ android.view.View#onDraw(android.graphics.Canvas) onDraw()}
+ differently, but there are some common operations that most views
+ share:</p>
+
+<ul>
+ <li>Draw text using {@link android.graphics.Canvas#drawText drawText()}. Specify the typeface by
+ calling {@link
+ android.graphics.Paint#setTypeface setTypeface()}, and the text color by calling {@link
+ android.graphics.Paint#setColor setColor()}.
+ </li>
+ <li>Draw primitive shapes using {@link android.graphics.Canvas#drawRect drawRect()}, {@link
+ android.graphics.Canvas#drawOval drawOval()}, and {@link android.graphics.Canvas#drawArc
+ drawArc()}. Change
+ whether the shapes are filled, outlined, or both by calling {@link
+ android.graphics.Paint#setStyle(android.graphics.Paint.Style) setStyle()}.
+ </li>
+ <li>Draw more complex shapes using the {@link android.graphics.Path} class.
+ Define a shape by adding lines and curves to a
+ {@link
+ android.graphics.Path} object, then draw the shape using {@link
+ android.graphics.Canvas#drawPath drawPath()}.
+ Just as with primitive shapes, paths can be outlined, filled, or both, depending on the
+ {@link android.graphics.Paint#setStyle
+ setStyle()}.
+ </li>
+ <li>
+ Define gradient fills by creating {@link android.graphics.LinearGradient} objects. Call {@link
+ android.graphics.Paint#setShader setShader()} to use your
+ {@link android.graphics.LinearGradient} on filled
+ shapes.
+ <li>Draw bitmaps using {@link android.graphics.Canvas#drawBitmap drawBitmap()}.</li>
+</ul>
+
+<p>For example, here's the code that draws {@code PieChart}. It uses a mix of text, lines, and shapes.</p>
+
+<pre>
+protected void onDraw(Canvas canvas) {
+ super.onDraw(canvas);
+
+ // Draw the shadow
+ canvas.drawOval(
+ mShadowBounds,
+ mShadowPaint
+ );
+
+ // Draw the label text
+ canvas.drawText(mData.get(mCurrentItem).mLabel, mTextX, mTextY, mTextPaint);
+
+ // Draw the pie slices
+ for (int i = 0; i < mData.size(); ++i) {
+ Item it = mData.get(i);
+ mPiePaint.setShader(it.mShader);
+ canvas.drawArc(mBounds,
+ 360 - it.mEndAngle,
+ it.mEndAngle - it.mStartAngle,
+ true, mPiePaint);
+ }
+
+ // Draw the pointer
+ canvas.drawLine(mTextX, mPointerY, mPointerX, mPointerY, mTextPaint);
+ canvas.drawCircle(mPointerX, mPointerY, mPointerSize, mTextPaint);
+}
+</pre>
diff --git a/docs/html/training/custom-views/index.jd b/docs/html/training/custom-views/index.jd
new file mode 100644
index 0000000..0661c05
--- /dev/null
+++ b/docs/html/training/custom-views/index.jd
@@ -0,0 +1,79 @@
+page.title=Creating Custom Views
+
+trainingnavtop=true
+startpage=true
+next.title=Creating a View Class
+next.link=create-view.html
+
+@jd:body
+
+<div id="tb-wrapper">
+ <div id="tb">
+
+ <h2>Dependencies and prerequisites</h2>
+ <ul>
+ <li>Android 2.1 (API level 7) or higher</li>
+ </ul>
+
+ <h2>You should also read</h2>
+ <ul>
+ <li><a href="{@docRoot}/guide/topics/ui/custom-components.html">Custom Components</a>
+ </li>
+ <li><a href="{@docRoot}/guide/topics/ui/ui-events.html">Input Events</a></li>
+ <li><a href="{@docRoot}/guide/topics/graphics/prop-animation.html">Property
+ Animation</a></li>
+ <li><a href="{@docRoot}/guide/topics/graphics/hardware-accel.html">Hardware
+ Acceleration</a></li>
+ <li><a href="{@docRoot}guide/topics/ui/accessibility/index.html">
+ Accessibility</a> developer guide</li>
+ </ul>
+<h2>Try it out</h2>
+<div class="download-box">
+<a href="{@docRoot}shareables/training/CustomView.zip"
+class="button">Download the sample</a>
+<p class="filename">CustomView.zip</p>
+</div>
+ </div>
+</div>
+
+<p>
+The Android framework has a large set of {@link android.view.View} classes for
+interacting with the user and displaying various
+types of data. But
+sometimes your app has unique needs that aren’t covered by the built-in views. This class shows you
+how to create your
+own views that are robust and reusable.</p>
+
+<h2>Lessons</h2>
+
+<dl>
+<dt><b><a href="create-view.html">Creating a View Class</a></b></dt>
+<dd>Create a class that acts like a built-in view, with custom
+ attributes and support from the <a href="http://developer.android.com/sdk/eclipse-adt.html">ADT</a> layout editor.
+</dd>
+
+<dt><b><a href="custom-drawing.html">Custom Drawing</a></b></dt>
+<dd>Make your view visually distinctive using the Android graphics system.</dd>
+
+<dt><b><a href="making-interactive.html">Making the View Interactive</a></b></dt>
+<dd>Users expect a view to react smoothly and naturally to input gestures.
+ This lesson discusses how to use gesture detection, physics, and animation
+ to give your user interface a professional feel.
+</dd>
+
+<dt><b><a href="optimizing-view.html">Optimizing the View</a></b></dt>
+<dd>No matter how beautiful your UI is, users won't love it if it
+ doesn't run at a consistently high frame rate. Learn how to avoid common
+ performance problems, and how to use hardware acceleration to make your
+ custom drawings run faster.
+</dd>
+
+</dl>
+
+
+
+
+
+
+
+
diff --git a/docs/html/training/custom-views/making-interactive.jd b/docs/html/training/custom-views/making-interactive.jd
new file mode 100644
index 0000000..4e9d53a
--- /dev/null
+++ b/docs/html/training/custom-views/making-interactive.jd
@@ -0,0 +1,292 @@
+page.title=Making the View Interactive
+parent.title=Creating Custom Views
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Custom Drawing
+previous.link=custom-drawing.html
+next.title=Optmizing the View
+next.link=optimizing-view.html
+
+@jd:body
+
+<div id="tb-wrapper">
+ <div id="tb">
+
+ <h2>This lesson teaches you to</h2>
+ <ol>
+ <li><a href="#inputgesture">Handle Input Gestures</a></li>
+ <li><a href="#motion">Create Physically Plausible Motion</a></li>
+ <li><a href="#makesmooth">Make Your Transitions Smooth</a></li>
+ </ol>
+
+ <h2>You should also read</h2>
+ <ul>
+ <li><a href="{@docRoot}guide/topics/ui/ui-events.html">Input Events</a></li>
+ <li><a href="{@docRoot}guide/topics/graphics/prop-animation.html">Property Animation</a>
+ </li>
+ </ul>
+<h2>Try it out</h2>
+<div class="download-box">
+<a href="{@docRoot}shareables/training/CustomView.zip"
+class="button">Download the sample</a>
+<p class="filename">CustomView.zip</p>
+</div>
+ </div>
+</div>
+
+<p>Drawing a UI is only one part of creating a custom view. You also need to make your view respond
+to user input in a
+way that closely resembles the real-world action you're mimicking. Objects should always act in the
+same way that real
+objects do. For example, images should not immediately pop out of existence and reappear somewhere
+else, because objects
+in the real world don't do that. Instead, images should move from one place to another.</p>
+
+<p>Users also sense subtle behavior or feel in an interface, and react best to subtleties that
+mimic the real world.
+For example, when users fling a UI object, they should sense friction at the beginning that delays
+the motion, and then
+at the end sense momentum that carries the motion beyond the fling.</p>
+
+<p>This lesson demonstrates how to use features of the Android framework to add these real-world
+behaviors to your
+custom view.
+
+<h2 id="inputgesture">Handle Input Gestures</h2>
+
+<p>Like many other UI frameworks, Android supports an input event model. User actions are turned
+ into events that
+ trigger callbacks, and you can override the callbacks to customize how your application responds
+ to the user. The
+ most common input event in the Android system is <em>touch</em>, which triggers {@link
+ android.view.View#onTouchEvent(android.view.MotionEvent)}. Override this method to handle the
+ event:</p>
+
+<pre>
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ return super.onTouchEvent(event);
+ }
+</pre>
+
+<p>Touch events by themselves are not particularly useful. Modern touch UIs define interactions in
+ terms of gestures
+ such as tapping, pulling, pushing, flinging, and zooming. To convert raw touch events into
+ gestures, Android
+ provides {@link android.view.GestureDetector}.</p>
+
+<p>Construct a {@link android.view.GestureDetector} by passing in an instance of a class that
+ implements {@link
+ android.view.GestureDetector.OnGestureListener}. If you only want to process a few gestures, you
+ can extend {@link
+ android.view.GestureDetector.SimpleOnGestureListener} instead of implementing the {@link
+ android.view.GestureDetector.OnGestureListener}
+ interface. For instance, this code creates a class that extends {@link
+ android.view.GestureDetector.SimpleOnGestureListener} and overrides {@link
+ android.view.GestureDetector.SimpleOnGestureListener#onDown}.</p>
+
+<pre>
+class mListener extends GestureDetector.SimpleOnGestureListener {
+ @Override
+ public boolean onDown(MotionEvent e) {
+ return true;
+ }
+}
+mDetector = new GestureDetector(PieChart.this.getContext(), new mListener());
+</pre>
+
+<p>Whether or not you use {@link
+ android.view.GestureDetector.SimpleOnGestureListener}, you must always implement an
+ {@link android.view.GestureDetector.OnGestureListener#onDown onDown()} method that
+ returns {@code true}. This step is necessary because all gestures begin with an
+ {@link android.view.GestureDetector.OnGestureListener#onDown onDown()} message. If
+ you return {@code
+ false} from {@link android.view.GestureDetector.OnGestureListener#onDown onDown()}, as
+ {@link android.view.GestureDetector.SimpleOnGestureListener} does, the system assumes that
+ you want to ignore the
+ rest of the gesture, and the other methods of
+ {@link android.view.GestureDetector.OnGestureListener} never get called. The
+ only time you should
+ return {@code false} from {@link android.view.GestureDetector.OnGestureListener#onDown onDown()}
+ is if you truly want to ignore an entire gesture.
+
+ Once you've implemented {@link android.view.GestureDetector.OnGestureListener}
+ and created an instance of {@link android.view.GestureDetector}, you can use
+ your {@link android.view.GestureDetector} to interpret the touch events you receive in {@link
+ android.view.GestureDetector#onTouchEvent onTouchEvent()}.</p>
+
+<pre>
+@Override
+public boolean onTouchEvent(MotionEvent event) {
+ boolean result = mDetector.onTouchEvent(event);
+ if (!result) {
+ if (event.getAction() == MotionEvent.ACTION_UP) {
+ stopScrolling();
+ result = true;
+ }
+ }
+ return result;
+}
+</pre>
+
+<p>When you pass {@link android.view.GestureDetector#onTouchEvent onTouchEvent()} a touch event that
+ it doesn't
+ recognize as part of a gesture, it returns {@code false}. You can then run your own custom
+ gesture-detection
+ code.</p>
+
+<h2 id="motion">Create Physically Plausible Motion</h2>
+
+<p>Gestures are a powerful way to control touchscreen devices, but they can be counterintuitive and
+ difficult to
+ remember unless they produce physically plausible results. A good example of this is the <em>fling</em>
+ gesture, where the
+ user quickly moves a finger across the screen and then lifts it. This gesture makes sense if the UI
+ responds by moving
+ quickly in the direction of the fling, then slowing down, as if the user had pushed on a
+ flywheel and set it
+ spinning.</p>
+
+<p>However, simulating the feel of a flywheel isn't trivial. A lot of physics and math are required
+ to get a flywheel
+ model working correctly. Fortunately, Android provides helper classes to simulate this and other
+ behaviors. The
+ {@link android.widget.Scroller} class is the basis for handling flywheel-style <em>fling</em>
+ gestures.</p>
+
+<p>To start a fling, call {@link android.widget.Scroller#fling fling()} with the starting velocity
+ and the minimum and
+ maximum x and y values of the fling. For the velocity value, you can use the value computed for
+ you by {@link android.view.GestureDetector}.</p>
+
+<pre>
+@Override
+public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
+ mScroller.fling(currentX, currentY, velocityX / SCALE, velocityY / SCALE, minX, minY, maxX, maxY);
+ postInvalidate();
+}
+</pre>
+
+<p class="note"><strong>Note:</strong> Although the velocity calculated by
+ {@link android.view.GestureDetector} is physically accurate,
+ many developers feel
+ that using this value makes the fling animation too fast. It's common to divide the x and y
+ velocity by a factor of
+ 4 to 8.</p>
+
+<p>The call to {@link android.widget.Scroller#fling fling()} sets up the physics model for the fling
+ gesture.
+ Afterwards, you need to update the {@link android.widget.Scroller Scroller} by calling {@link
+ android.widget.Scroller#computeScrollOffset Scroller.computeScrollOffset()} at regular
+ intervals. {@link
+ android.widget.Scroller#computeScrollOffset computeScrollOffset()} updates the {@link
+ android.widget.Scroller
+ Scroller} object's internal state by reading the current time and using the physics model to calculate
+ the x and y position
+ at that time. Call {@link android.widget.Scroller#getCurrX} and {@link
+ android.widget.Scroller#getCurrY} to
+ retrieve these values.</p>
+
+<p>Most views pass the {@link android.widget.Scroller Scroller} object's x and y position directly to
+ {@link
+ android.view.View#scrollTo scrollTo()}. The PieChart example is a little different: it
+ uses the current scroll
+ y position to set the rotational angle of the chart.</p>
+
+<pre>
+if (!mScroller.isFinished()) {
+ mScroller.computeScrollOffset();
+ setPieRotation(mScroller.getCurrY());
+}
+</pre>
+
+<p>The {@link android.widget.Scroller Scroller} class computes scroll positions for you, but it does
+ not automatically
+ apply those positions to your view. It's your responsibility to make sure you get and apply new
+ coordinates often
+ enough to make the scrolling animation look smooth. There are two ways to do this:</p>
+
+<ul>
+ <li>Call {@link android.view.View#postInvalidate() postInvalidate()} after calling
+ {@link android.widget.Scroller#fling(int, int, int, int, int, int, int, int) fling()},
+ in order to
+ force a redraw. This
+ technique requires that you compute scroll offsets in {@link android.view.View#onDraw onDraw()}
+ and call {@link android.view.View#postInvalidate() postInvalidate()} every
+ time the scroll offset changes.
+ </li>
+ <li>Set up a {@link android.animation.ValueAnimator} to animate for the duration of the fling,
+ and add a listener to process animation updates
+ by calling {@link android.animation.ValueAnimator#addUpdateListener addUpdateListener()}.
+ </li>
+</ul>
+
+<p>The PieChart example uses the second approach. This technique is slightly more complex to set up, but
+ it works more
+ closely with the animation system and doesn't require potentially unnecessary view
+ invalidation. The drawback is that {@link android.animation.ValueAnimator}
+ is not available prior to API level 11, so this technique cannot be used
+on devices running Android versions lower than 3.0.</p>
+
+<p class="note"><strong>Note:</strong> {@link android.animation.ValueAnimator} isn't available
+ prior to API level 11, but you can still use it in applications that
+target lower API levels. You just need to make sure to check the current API level
+at runtime, and omit the calls to the view animation system if the current level is less than 11.</p>
+
+<pre>
+ mScroller = new Scroller(getContext(), null, true);
+ mScrollAnimator = ValueAnimator.ofFloat(0,1);
+ mScrollAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+ @Override
+ public void onAnimationUpdate(ValueAnimator valueAnimator) {
+ if (!mScroller.isFinished()) {
+ mScroller.computeScrollOffset();
+ setPieRotation(mScroller.getCurrY());
+ } else {
+ mScrollAnimator.cancel();
+ onScrollFinished();
+ }
+ }
+ });
+</pre>
+
+<h2 id="makesmooth">Make Your Transitions Smooth</h2>
+
+<p>Users expect a modern UI to transition smoothly between states. UI elements fade in and out
+ instead of appearing and
+ disappearing. Motions begin and end smoothly instead of starting and stopping abruptly. The
+ Android <a
+ href="{@docRoot}guide/topics/graphics/prop-animation.html">property animation
+ framework</a>, introduced in
+ Android 3.0, makes smooth transitions easy.</p>
+
+<p>To use the animation system, whenever a property changes that will affect your view's appearance,
+ do not change the
+ property directly. Instead, use {@link android.animation.ValueAnimator} to make the change. In
+ the following
+ example, modifying the
+ currently selected pie slice in PieChart causes the entire chart to rotate so that the selection
+ pointer is centered
+ in the selected slice. {@link android.animation.ValueAnimator} changes the rotation over a
+ period of several
+ hundred milliseconds,
+ rather than immediately setting the new rotation value.</p>
+
+<pre>
+mAutoCenterAnimator = ObjectAnimator.ofInt(PieChart.this, "PieRotation", 0);
+mAutoCenterAnimator.setIntValues(targetAngle);
+mAutoCenterAnimator.setDuration(AUTOCENTER_ANIM_DURATION);
+mAutoCenterAnimator.start();
+</pre>
+
+<p>If the value you want to change is one of the base {@link android.view.View} properties, doing
+ the animation
+ is even easier,
+ because Views have a built-in {@link android.view.ViewPropertyAnimator} that is optimized for
+ simultaneous animation
+ of multiple properties. For example:</p>
+
+<pre>
+animate().rotation(targetAngle).setDuration(ANIM_DURATION).start();
+</pre>
diff --git a/docs/html/training/custom-views/optimizing-view.jd b/docs/html/training/custom-views/optimizing-view.jd
new file mode 100644
index 0000000..1f489dd
--- /dev/null
+++ b/docs/html/training/custom-views/optimizing-view.jd
@@ -0,0 +1,176 @@
+page.title=Optimizing the View
+parent.title=Creating Custom Views
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Making the View Interactive
+previous.link=making-interactive.html
+
+@jd:body
+
+<div id="tb-wrapper">
+ <div id="tb">
+
+ <h2>This lesson teaches you to</h2>
+ <ol>
+ <li><a href="#less">Do Less, Less Frequently</a></li>
+ <li><a href="#accelerate">Use Hardware Acceleration</a></li>
+ </ol>
+
+ <h2>You should also read</h2>
+ <ul>
+ <li><a href=”{@docRoot}guide/topics/graphics/hardware-accel.html”>
+ Hardware Acceleration
+ </a>
+ </li>
+ </ul>
+<h2>Try it out</h2>
+<div class="download-box">
+<a href="{@docRoot}shareables/training/CustomView.zip"
+class="button">Download the sample</a>
+<p class="filename">CustomView.zip</p>
+</div>
+</div>
+ </div>
+
+
+<p>Now that you have a well-designed view that responds to gestures and transitions between states,
+you need to ensure
+that the view runs fast. To avoid a UI that feels sluggish or stutters during playback, you must
+ensure that your
+animations consistently run at 60 frames per second.</p>
+
+<h2 id="less">Do Less, Less Frequently</h2>
+
+<p>To speed up your view, eliminate unnecessary code from routines that are called frequently. Start
+by working on
+{@link android.view.View#onDraw onDraw()}, which will give you the biggest payback. In particular
+you should eliminate
+allocations in {@link android.view.View#onDraw onDraw()}, because allocations may lead to a garbage
+collection that
+would cause a stutter. Allocate objects during initialization, or between animations. Never make an
+allocation while an
+animation is running.</p>
+
+<p>In addition to making {@link android.view.View#onDraw onDraw()} leaner, you should also make sure
+it's called as
+infrequently as possible. Most calls to {@link android.view.View#onDraw onDraw()} are the result of
+a call to {@link
+android.view.View#invalidate() invalidate()}, so eliminate unnecessary calls to {@link
+android.view.View#invalidate()
+invalidate()}. When possible, call the four-parameter variant of {@link
+android.view.View#invalidate() invalidate()}
+rather than the version that takes no parameters. The no-parameter variant invalidates the entire
+view, while the
+four-parameter variant invalidates only a specified portion of the view. This approach allows draw calls to
+be more efficient and
+can eliminate unnecessary invalidation of views that fall outside the invalid rectangle.</p>
+
+<p>Another very expensive operation is traversing layouts. Any time a view calls {@link
+android.view.View#requestLayout()
+requestLayout()}, the Android UI system needs to traverse the entire view hierarchy to find out how
+big each view needs
+to be. If it finds conflicting measurements, it may need to traverse the hierarchy multiple times.
+UI designers
+sometimes create deep hierarchies of nested {@link android.view.ViewGroup ViewGroup} objects in
+order to get the UI to
+behave properly. These deep view hierarchies cause performance problems. Make your view hierarchies
+as shallow as
+possible.</p>
+
+<p>If you have a complex UI, you should consider writing a custom {@link android.view.ViewGroup
+ViewGroup} to perform
+its layout. Unlike the built-in views, your custom view can make application-specific assumptions
+about the size and
+shape of its children, and thus avoid traversing its children to calculate measurements. The
+PieChart example shows how
+to extend {@link android.view.ViewGroup ViewGroup} as part of a custom view. PieChart has child
+views, but it never
+measures them. Instead, it sets their sizes directly according to its own custom layout
+algorithm.</p>
+
+<h2 id="accelerate">Use Hardware Acceleration</h2>
+
+<p>As of Android 3.0, the Android 2D graphics system can be accelerated by the GPU (Graphics
+Processing Unit) hardware
+found in most newer Android devices. GPU hardware acceleration can result in a tremendous
+performance increase for many
+applications, but it isn't the right choice for every application. The Android framework
+gives you the ability to finely control which parts of your application are or are not
+hardware accelerated.</p>
+
+<p>See <a href="{@docRoot}guide/topics/graphics/hardware-accel.html">Hardware Acceleration</a>
+ in the Android Developers Guide for directions on how to enable acceleration at the
+ application, activity, or window level. Notice that in addition to the directions in
+ the developer guide, you must also set your application's target API to 11 or higher by
+ specifying {@code <uses-sdk
+ android:targetSdkVersion="11"/>} in your {@code AndroidManifest.xml} file.</p>
+
+<p>Once you've enabled hardware acceleration, you may or may not see a performance increase.
+Mobile GPUs are very good at certain tasks, such as scaling, rotating, and translating
+bitmapped images. They are not particularly good at other tasks, such as drawing lines or curves. To
+get the most out of GPU acceleration, you should maximize the number of operations that the GPU is
+good at, and minimize the number of operations that the GPU isn't good at.</p>
+
+<p>In the PieChart example, for instance, drawing the pie is relatively expensive. Redrawing the pie
+each time it's
+rotated causes the UI to feel sluggish. The solution is to place the pie chart into a child
+{@link android.view.View} and set that
+{@link android.view.View}'s
+<a href="{@docRoot}reference/android/view/View.html#setLayerType(int, android.graphics.Paint)">
+ layer type</a> to {@link android.view.View#LAYER_TYPE_HARDWARE}, so that the GPU can cache it as
+a static
+image. The sample
+defines the child view as an inner class of {@code PieChart}, which minimizes the amount of code
+changes that are needed
+to implement this solution.</p>
+
+<pre>
+ private class PieView extends View {
+
+ public PieView(Context context) {
+ super(context);
+ if (!isInEditMode()) {
+ setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ }
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ super.onDraw(canvas);
+
+ for (Item it : mData) {
+ mPiePaint.setShader(it.mShader);
+ canvas.drawArc(mBounds,
+ 360 - it.mEndAngle,
+ it.mEndAngle - it.mStartAngle,
+ true, mPiePaint);
+ }
+ }
+
+ @Override
+ protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+ mBounds = new RectF(0, 0, w, h);
+ }
+
+ RectF mBounds;
+ }
+</pre>
+
+<p>After this code change, {@code PieChart.PieView.onDraw()} is called only when the view is first
+shown. During the rest
+of the application's lifetime, the pie chart is cached as an image, and redrawn at different
+rotation angles by the GPU.
+GPU hardware is particularly good at this sort of thing, and the performance difference is
+immediately noticeable.</p>
+
+<p>There is a tradeoff, though. Caching images as hardware layers consumes video memory, which is a
+limited resource.
+For this reason, the final version of {@code PieChart.PieView} only sets its layer type to
+{@link android.view.View#LAYER_TYPE_HARDWARE}
+while the user is actively scrolling. At all other times, it sets its layer type to
+{@link android.view.View#LAYER_TYPE_NONE}, which
+allows the GPU to stop caching the image.</p>
+
+<p>Finally, don't forget to profile your code. Techniques that improve performance on one view
+might negatively affect performance on another.</p>
diff --git a/docs/html/training/design-navigation/ancestral-temporal.jd b/docs/html/training/design-navigation/ancestral-temporal.jd
index ab6a64d..33a75b2 100644
--- a/docs/html/training/design-navigation/ancestral-temporal.jd
+++ b/docs/html/training/design-navigation/ancestral-temporal.jd
@@ -22,7 +22,7 @@
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}design/patterns/navigation.html">Android Design: Navigation</a></li>
- <li><a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a></li>
+ <li><a href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a></li>
</ul>
</div>
@@ -58,7 +58,7 @@
<p>Applications generally don't have to worry about managing the <em>Back</em> button themselves;
-the system handles <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">tasks and
+the system handles <a href="{@docRoot}guide/components/tasks-and-back-stack.html">tasks and
the <em>back stack</em></a>, or the list of previous screens, automatically. The <em>Back</em>
button by default simply traverses this list of screens, removing the current screen from the list
upon being pressed.</p>
diff --git a/docs/html/training/design-navigation/wireframing.jd b/docs/html/training/design-navigation/wireframing.jd
index 6deceb1..42f892d 100644
--- a/docs/html/training/design-navigation/wireframing.jd
+++ b/docs/html/training/design-navigation/wireframing.jd
@@ -78,7 +78,7 @@
<li>What's the learning curve? Professional vector illustration tools may have a steep learning curve, while tools designed for wireframing may offer a smaller set of features that are more relevant to the task.</li>
</ul>
-<p>Lastly, the XML Layout Editor that comes with the <a href="{@docRoot}guide/developing/tools/adt.html">Android Development Tools (ADT)</a> plugin for Eclipse can often be used for prototyping. However, you should be careful to focus more on the high-level layout and less on visual design details at this point.</p>
+<p>Lastly, the XML Layout Editor that comes with the <a href="{@docRoot}tools/help/adt.html">Android Development Tools (ADT)</a> plugin for Eclipse can often be used for prototyping. However, you should be careful to focus more on the high-level layout and less on visual design details at this point.</p>
<h2 id="wireframe-digital">Create Digital Wireframes</h2>
@@ -120,6 +120,6 @@
<ul>
<li><a href="{@docRoot}guide/topics/ui/index.html">Developer's Guide: User Interface</a>: learn how to implement your user interface designs using the Android SDK.</li>
<li><a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a>: implement tabs, up navigation, on-screen actions, etc.
- <li><a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a>: implement re-usable, multi-pane layouts
- <li><a href="{@docRoot}sdk/compatibility-library.html">Support Library</a>: implement horizontal paging (swipe views) using <code>ViewPager</code></li>
+ <li><a href="{@docRoot}guide/components/fragments.html">Fragments</a>: implement re-usable, multi-pane layouts
+ <li><a href="{@docRoot}tools/extras/support-library.html">Support Library</a>: implement horizontal paging (swipe views) using <code>ViewPager</code></li>
</ul>
diff --git a/docs/html/training/displaying-bitmaps/index.jd b/docs/html/training/displaying-bitmaps/index.jd
index 6755c24..78371ad 100644
--- a/docs/html/training/displaying-bitmaps/index.jd
+++ b/docs/html/training/displaying-bitmaps/index.jd
@@ -13,7 +13,7 @@
<h2>Dependencies and prerequisites</h2>
<ul>
<li>Android 2.1 (API Level 7) or higher</li>
- <li><a href="{@docRoot}sdk/compatibility-library.html">Support Library</a></li>
+ <li><a href="{@docRoot}tools/extras/support-library.html">Support Library</a></li>
</ul>
<h2>Try it out</h2>
diff --git a/docs/html/training/displaying-bitmaps/process-bitmap.jd b/docs/html/training/displaying-bitmaps/process-bitmap.jd
index c1450b4..d1e346c 100644
--- a/docs/html/training/displaying-bitmaps/process-bitmap.jd
+++ b/docs/html/training/displaying-bitmaps/process-bitmap.jd
@@ -21,7 +21,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/practices/design/responsiveness.html">Designing for Responsiveness</a></li>
+ <li><a href="{@docRoot}guide/practices/responsiveness.html">Designing for Responsiveness</a></li>
<li><a
href="http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html">Multithreading
for Performance</a></li>
@@ -45,7 +45,7 @@
load is unpredictable and depends on a variety of factors (speed of reading from disk or network,
size of image, power of CPU, etc.). If one of these tasks blocks the UI thread, the system flags
your application as non-responsive and the user has the option of closing it (see <a
-href="{@docRoot}guide/practices/design/responsiveness.html">Designing for Responsiveness</a> for
+href="{@docRoot}guide/practices/responsiveness.html">Designing for Responsiveness</a> for
more information).</p>
<p>This lesson walks you through processing bitmaps in a background thread using
diff --git a/docs/html/training/efficient-downloads/efficient-network-access.jd b/docs/html/training/efficient-downloads/efficient-network-access.jd
index 0efad7d..1d3a8a5 100644
--- a/docs/html/training/efficient-downloads/efficient-network-access.jd
+++ b/docs/html/training/efficient-downloads/efficient-network-access.jd
@@ -142,7 +142,7 @@
<h2 id="DDMSNetworkTraffic">Use the DDMS Network Traffic Tool to Identify Areas of Concern</h2>
-<p>The Android <a href="{@docRoot}guide/developing/debugging/ddms.html">DDMS (Dalvik Debug Monitor Server)</a> includes a Detailed Network Usage tab that makes it possible to track when your application is making network requests. Using this tool, you can monitor how and when your app transfers data and optimize the underlying code appropriately.</p>
+<p>The Android <a href="{@docRoot}tools/debugging/ddms.html">DDMS (Dalvik Debug Monitor Server)</a> includes a Detailed Network Usage tab that makes it possible to track when your application is making network requests. Using this tool, you can monitor how and when your app transfers data and optimize the underlying code appropriately.</p>
<p>Figure 3 shows a pattern of transferring small amounts of data roughly 15 seconds apart, suggesting that efficiency could be dramatically improved by prefetching each request or bundling the uploads.</p>
diff --git a/docs/html/training/graphics/opengl/draw.jd b/docs/html/training/graphics/opengl/draw.jd
new file mode 100644
index 0000000..156ff70
--- /dev/null
+++ b/docs/html/training/graphics/opengl/draw.jd
@@ -0,0 +1,195 @@
+page.title=Drawing Shapes
+parent.title=Displaying Graphics with OpenGL ES
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Defining Shapes
+previous.link=environment.html
+next.title=Applying Projection and Camera Views
+next.link=projection.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#initialize">Initialize Shapes</a></li>
+ <li><a href="#draw">Draw a Shape</a></li>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL</a></li>
+</ul>
+
+<div class="download-box">
+ <a href="{@docRoot}shareables/training/OpenGLES.zip"
+class="button">Download the sample</a>
+ <p class="filename">OpenGLES.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>After you define shapes to be drawn with OpenGL, you probably want to draw them. Drawing shapes
+with the OpenGL ES 2.0 takes a bit more code than you might imagine, because the API provides a
+great deal of control over the graphics rendering pipeline.</p>
+
+<p>This lesson explains how to draw the shapes you defined in the previous lesson using the OpenGL
+ES 2.0 API.</p>
+
+
+<h2 id="initialize">Initialize Shapes</h2>
+
+<p>Before you do any drawing, you must initialize and load the shapes you plan to draw. Unless the
+structure (the original coordinates) of the shapes you use in your program change during the course
+of execution, you should initialize them in the {@link
+android.opengl.GLSurfaceView.Renderer#onSurfaceCreated onSurfaceCreated()} method of your renderer
+for memory and processing efficiency.</p>
+
+<pre>
+public void onSurfaceCreated(GL10 unused, EGLConfig config) {
+ ...
+
+ // initialize a triangle
+ mTriangle = new Triangle();
+ // initialize a square
+ mSquare = new Square();
+}
+</pre>
+
+
+<h2 id="draw">Draw a Shape</h2>
+
+<p>Drawing a defined shape using OpenGL ES 2.0 requires a significant amount of code, because you
+must provide a lot of details to the graphics rendering pipeline. Specifically, you must define the
+following:</p>
+
+<ul>
+ <li><em>Vertex Shader</em> - OpenGL ES graphics code for rendering the vertices of a shape.</li>
+ <li><em>Fragment Shader</em> - OpenGL ES code for rendering the face of a shape with colors or
+textures.</li>
+ <li><em>Program</em> - An OpenGL ES object that contains the shaders you want to use for drawing
+one or more shapes.</li>
+</ul>
+
+<p>You need at least one vertex shader to draw a shape and one fragment shader to color that shape.
+These shaders must be complied and then added to an OpenGL ES program, which is then used to draw
+the shape. Here is an example of how to define basic shaders you can use to draw a shape:</p>
+
+<pre>
+private final String vertexShaderCode =
+ "attribute vec4 vPosition;" +
+ "void main() {" +
+ " gl_Position = vPosition;" +
+ "}";
+
+private final String fragmentShaderCode =
+ "precision mediump float;" +
+ "uniform vec4 vColor;" +
+ "void main() {" +
+ " gl_FragColor = vColor;" +
+ "}";
+</pre>
+
+<p>Shaders contain OpenGL Shading Language (GLSL) code that must be compiled prior to using it in
+the OpenGL ES environment. To compile this code, create a utility method in your renderer class:</p>
+
+<pre>
+public static int loadShader(int type, String shaderCode){
+
+ // create a vertex shader type (GLES20.GL_VERTEX_SHADER)
+ // or a fragment shader type (GLES20.GL_FRAGMENT_SHADER)
+ int shader = GLES20.glCreateShader(type);
+
+ // add the source code to the shader and compile it
+ GLES20.glShaderSource(shader, shaderCode);
+ GLES20.glCompileShader(shader);
+
+ return shader;
+}
+</pre>
+
+<p>In order to draw your shape, you must compile the shader code, add them to a OpenGL ES program
+object and then link the program. Do this in your drawn object’s constructor, so it is only done
+once.</p>
+
+<p class="note"><strong>Note:</strong> Compiling OpenGL ES shaders and linking programs is expensive
+in terms of CPU cycles and processing time, so you should avoid doing this more than once. If you do
+not know the content of your shaders at runtime, you should build your code such that they only
+get created once and then cached for later use.</p>
+
+<pre>
+public Triangle() {
+ ...
+
+ int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexShaderCode);
+ int fragmentShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentShaderCode);
+
+ mProgram = GLES20.glCreateProgram(); // create empty OpenGL ES Program
+ GLES20.glAttachShader(mProgram, vertexShader); // add the vertex shader to program
+ GLES20.glAttachShader(mProgram, fragmentShader); // add the fragment shader to program
+ GLES20.glLinkProgram(mProgram); // creates OpenGL ES program executables
+}
+</pre>
+
+<p>At this point, you are ready to add the actual calls that draw your shape. Drawing shapes with
+OpenGL ES requires that you specify several parameters to tell the rendering pipeline what you want
+to draw and how to draw it. Since drawing options can vary by shape, it's a good idea to have your
+shape classes contain their own drawing logic.</p>
+
+<p>Create a {@code draw()} method for drawing the shape. This code sets the position and
+color values to the shape’s vertex shader and fragment shader, and then executes the drawing
+function.</p>
+
+<pre>
+public void draw() {
+ // Add program to OpenGL ES environment
+ GLES20.glUseProgram(mProgram);
+
+ // get handle to vertex shader's vPosition member
+ mPositionHandle = GLES20.glGetAttribLocation(mProgram, "vPosition");
+
+ // Enable a handle to the triangle vertices
+ GLES20.glEnableVertexAttribArray(mPositionHandle);
+
+ // Prepare the triangle coordinate data
+ GLES20.glVertexAttribPointer(mPositionHandle, COORDS_PER_VERTEX,
+ GLES20.GL_FLOAT, false,
+ vertexStride, vertexBuffer);
+
+ // get handle to fragment shader's vColor member
+ mColorHandle = GLES20.glGetUniformLocation(mProgram, "vColor");
+
+ // Set color for drawing the triangle
+ GLES20.glUniform4fv(mColorHandle, 1, color, 0);
+
+ // Draw the triangle
+ GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, vertexCount);
+
+ // Disable vertex array
+ GLES20.glDisableVertexAttribArray(mPositionHandle);
+}
+</pre>
+
+<p>Once you have all this code in place, drawing this object just requires a call to the
+{@code draw()} method from within your renderer’s {@link
+android.opengl.GLSurfaceView.Renderer#onDrawFrame onDrawFrame()} method. When you run the
+application, it should look something like this:</p>
+
+<img src="{@docRoot}images/opengl/ogl-triangle.png">
+<p class="img-caption">
+<strong>Figure 1.</strong> Triangle drawn without a projection or camera view.</p>
+
+<p>There are a few problems with this code example. First of all, it is not going to impress your
+friends. Secondly, the triangle is a bit squashed and changes shape when you change the screen
+orientation of the device. The reason the shape is skewed is due to the fact that the object’s
+vertices have not been corrected for the proportions of the screen area where the {@link
+android.opengl.GLSurfaceView} is displayed. You can fix that problem using a projection and camera
+view in the next lesson.</p>
+
+<p>Lastly, the triangle is stationary, which is a bit boring. In the <a href="motion.html">Adding
+Motion</a> lesson, you make this shape rotate and make more interesting use of the OpenGL ES
+graphics pipeline.</p>
\ No newline at end of file
diff --git a/docs/html/training/graphics/opengl/environment.jd b/docs/html/training/graphics/opengl/environment.jd
new file mode 100644
index 0000000..e1e2c8a
--- /dev/null
+++ b/docs/html/training/graphics/opengl/environment.jd
@@ -0,0 +1,223 @@
+page.title=Building an OpenGL ES Environment
+parent.title=Displaying Graphics with OpenGL ES
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Displaying Graphics with OpenGL ES
+previous.link=index.html
+next.title=Defining Shapes
+next.link=shapes.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#manifest">Declare OpenGL ES Use in the Manifest</a></li>
+ <li><a href="#activity">Create an Activity for OpenGL ES Graphics</a></li>
+ <li><a href="#glsurfaceview">Build a GLSurfaceView Object</a></li>
+ <li><a href="#renderer">Build a Renderer Class</a></li>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL</a></li>
+</ul>
+
+<h2>Try it out</h2>
+
+<div class="download-box">
+ <a href="{@docRoot}shareables/training/OpenGLES.zip"
+class="button">Download the sample</a>
+ <p class="filename">OpenGLES.zip</p>
+</div>
+
+</div>
+</div>
+
+
+<p>In order to draw graphics with OpenGL ES in your Android application, you must create a
+view container for them. One of the more straight-forward ways to do this is to implement both a
+{@link android.opengl.GLSurfaceView} and a {@link android.opengl.GLSurfaceView.Renderer}. A {@link
+android.opengl.GLSurfaceView} is a view container for graphics drawn with OpenGL and {@link
+android.opengl.GLSurfaceView.Renderer} controls what is drawn within that view. For more information
+about these classes, see the <a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL ES</a>
+developer guide.</p>
+
+<p>{@link android.opengl.GLSurfaceView} is just one way to incorporate OpenGL ES graphics into your
+application. For a full-screen or near-full screen graphics view, it is a reasonable choice.
+Developers who want to incorporate OpenGL ES graphics in a small portion of their layouts should
+take a look at {@link android.view.TextureView}. For real, do-it-yourself developers, it is also
+possible to build up an OpenGL ES view using {@link android.view.SurfaceView}, but this requires
+writing quite a bit of additional code.</p>
+
+<p>This lesson explains how to complete a minimal implementation of {@link
+android.opengl.GLSurfaceView} and {@link android.opengl.GLSurfaceView.Renderer} in a simple
+application activity.</p>
+
+
+<h2 id="manifest">Declare OpenGL ES Use in the Manifest</h2>
+
+<p>In order for your application to use the OpenGL ES 2.0 API, you must add the following
+declaration to your manifest:</p>
+
+<pre>
+<uses-feature android:glEsVersion="0x00020000" android:required="true" />
+</pre>
+
+<p>If your application uses texture compression, you must also declare which compression formats
+you support so that devices that do not support theses formats do not try to run your
+application:</p>
+
+<pre>
+<supports-gl-texture android:name="GL_OES_compressed_ETC1_RGB8_texture" />
+<supports-gl-texture android:name="GL_OES_compressed_paletted_texture" />
+</pre>
+
+<p>For more information about texture compression formats, see the
+<a href="{@docRoot}guide/topics/graphics/opengl.html#textures">OpenGL</a> developer guide.</p>
+
+
+<h2 id="activity">Create an Activity for OpenGL ES Graphics</h2>
+
+<p>Android applications that use OpenGL ES have activities just like any other application that has
+a user interface. The main difference from other applications is what you put in the layout for your
+activity. While in many applications you might use {@link android.widget.TextView}, {@link
+android.widget.Button} and {@link android.widget.ListView}, in an app that uses OpenGL ES, you can
+also add a {@link android.opengl.GLSurfaceView}.</p>
+
+<p>The following code example shows a minimal implementation of an activity that uses a
+{@link android.opengl.GLSurfaceView} as its primary view:</p>
+
+<pre>
+public class OpenGLES20 extends Activity {
+
+ private GLSurfaceView mGLView;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Create a GLSurfaceView instance and set it
+ // as the ContentView for this Activity.
+ mGLView = new MyGLSurfaceView(this);
+ setContentView(mGLView);
+ }
+}
+</pre>
+
+<p class="note"><strong>Note:</strong> OpenGL ES 2.0 requires Android 2.2 (API Level 8) or higher,
+so make sure your Android project targets that API or higher.</p>
+
+
+<h2 id="glsurfaceview">Build a GLSurfaceView Object</h2>
+
+<p>A {@link android.opengl.GLSurfaceView} is a specialized view where you can draw OpenGL ES
+graphics.
+It does not do much by itself. The actual drawing of objects is controlled in the {@link
+android.opengl.GLSurfaceView.Renderer} that you set on this view. In fact, the code for this object
+is so thin, you may be tempted to skip extending it and just create an unmodified {@link
+android.opengl.GLSurfaceView} instance, but don’t do that. You need to extend this class in
+order to capture touch events, which is covered in the <a href="#touch.html">Responding to Touch
+Events</a> lesson.</p>
+
+<p>The essential code for a {@link android.opengl.GLSurfaceView} is minimal, so for a quick
+implementation, it is common to
+just create an inner class in the activity that uses it:</p>
+
+<pre>
+class MyGLSurfaceView extends GLSurfaceView {
+
+ public MyGLSurfaceView(Context context){
+ super(context);
+
+ // Set the Renderer for drawing on the GLSurfaceView
+ setRenderer(new MyRenderer());
+ }
+}
+</pre>
+
+<p>When using OpenGL ES 2.0, you must add another call to your {@link android.opengl.GLSurfaceView}
+constructor, specifying that you want to use the 2.0 API:</p>
+
+<pre>
+// Create an OpenGL ES 2.0 context
+setEGLContextClientVersion(2);
+</pre>
+
+<p class="note"><strong>Note:</strong> If you are using the OpenGL ES 2.0 API, make sure you declare
+this in your application manifest. For more information, see <a href="#manifest">Declare OpenGL ES
+Use
+in the Manifest</a>.</p>
+
+<p>One other optional addition to your {@link android.opengl.GLSurfaceView} implementation is to set
+the render mode to only draw the view when there is a change to your drawing data using the
+{@link android.opengl.GLSurfaceView#RENDERMODE_WHEN_DIRTY GLSurfaceView.RENDERMODE_WHEN_DIRTY}
+setting:</p>
+
+<pre>
+// Render the view only when there is a change in the drawing data
+setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
+</pre>
+
+<p>This setting prevents the {@link android.opengl.GLSurfaceView} frame from being redrawn until you
+call {@link android.opengl.GLSurfaceView#requestRender requestRender()}, which is more
+efficient for this sample app.</p>
+
+
+<h2 id="renderer">Build a Renderer Class</h2>
+
+<p>The implementation of the {@link android.opengl.GLSurfaceView.Renderer} class, or renderer,
+within an application that uses OpenGL ES is where things start to get interesting. This class
+controls
+what gets drawn on the {@link android.opengl.GLSurfaceView} with which it is associated. There are
+three methods in a renderer that are called by the Android system in order to figure out what and
+how to draw on a {@link android.opengl.GLSurfaceView}:</p>
+
+<ul>
+ <li>{@link android.opengl.GLSurfaceView.Renderer#onSurfaceCreated onSurfaceCreated()} -
+Called once to set up the view's OpenGL ES environment.</li>
+ <li>{@link android.opengl.GLSurfaceView.Renderer#onDrawFrame onDrawFrame()} - Called for each
+redraw of the view.</li>
+ <li>{@link android.opengl.GLSurfaceView.Renderer#onSurfaceChanged onSurfaceChanged()} - Called if
+the geometry of the view changes, for example when the device's screen orientation changes.
+ </li>
+</ul>
+
+<p>Here is a very basic implementation of an OpenGL ES renderer, that does nothing more than draw a
+gray background in the {@link android.opengl.GLSurfaceView}:</p>
+
+<pre>
+public class MyGL20Renderer implements GLSurfaceView.Renderer {
+
+ public void onSurfaceCreated(GL10 unused, EGLConfig config) {
+ // Set the background frame color
+ GLES20.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
+ }
+
+ public void onDrawFrame(GL10 unused) {
+ // Redraw background color
+ GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
+ }
+
+ public void onSurfaceChanged(GL10 unused, int width, int height) {
+ GLES20.glViewport(0, 0, width, height);
+ }
+}
+</pre>
+
+<p>That’s all there is to it! The code examples above create a simple Android application that
+displays a gray screen using OpenGL. While this code does not do anything very interesting, by
+creating these classes, you have laid the foundation you need to start drawing graphic elements with
+OpenGL.</p>
+
+<p class="note"><strong>Note:</strong> You may wonder why these methods have a {@link
+javax.microedition.khronos.opengles.GL10} parameter, when you are using the OpengGL ES 2.0 APIs.
+These method signatures are simply reused for the 2.0 APIs to keep the Android framework code
+simpler.</p>
+
+<p>If you are familiar with the OpenGL ES APIs, you should now be able to set up a OpenGL ES
+environment in your app and start drawing graphics. However, if you need a bit more help getting
+started with OpenGL, head on to the next lessons for a few more hints.</p>
diff --git a/docs/html/training/graphics/opengl/index.jd b/docs/html/training/graphics/opengl/index.jd
new file mode 100644
index 0000000..23a734a
--- /dev/null
+++ b/docs/html/training/graphics/opengl/index.jd
@@ -0,0 +1,75 @@
+page.title=Displaying Graphics with OpenGL ES
+trainingnavtop=true
+next.title=Building an OpenGL ES Environment
+next.link=environment.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Dependencies and prerequisites</h2>
+<ul>
+ <li>Android 2.2 (API Level 8) or higher</li>
+ <li>Experience building an <a href="{@docRoot}training/basics/firstapp/index.html">Android
+app</a></li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL</a></li>
+</ul>
+
+<h2>Try it out</h2>
+
+<div class="download-box">
+ <a href="{@docRoot}shareables/training/OpenGLES.zip"
+class="button">Download the sample</a>
+ <p class="filename">OpenGLES.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>The Android framework provides plenty of standard tools for creating attractive, functional
+graphical user interfaces. However, if you want more control of what your application draws on
+screen, or are venturing into three dimensional graphics, you need to use a different tool. The
+OpenGL ES APIs provided by the Android framework offers a set of tools for displaying high-end,
+animated graphics that are limited only by your imagination and can also benefit from the
+acceleration of graphics processing units (GPUs) provided on many Android devices.</p>
+
+<p>This class walks you through the basics of developing applications that use OpenGL, including
+setup, drawing objects, moving drawn elements and responding to touch input.</p>
+
+<p>The example code in this class uses the OpenGL ES 2.0 APIs, which is the recommended API version
+to use with current Android devices. For more information about versions of OpenGL ES, see the <a
+href="{@docRoot}guide/topics/graphics/opengl.html#choosing-version">OpenGL</a>
+developer guide.</p>
+
+<p class="note"><strong>Note:</strong> Be careful not to mix OpenGL ES 1.x API calls with OpenGL
+ES 2.0 methods! The two APIs are not interchangeable and trying to use them together only results in
+frustration and sadness.</p>
+
+
+<h2>Lessons</h2>
+
+<dl>
+ <dt><b><a href="environment.html">Building an OpenGL ES Environment</a></b></dt>
+ <dd>Learn how to set up an Android application to be able to draw OpenGL graphics.</dd>
+
+ <dt><b><a href="shapes.html">Defining Shapes</a></b></dt>
+ <dd>Learn how to define shapes and why you need to know about faces and winding.</dd>
+
+ <dt><b><a href="draw.html">Drawing Shapes</a></b></dt>
+ <dd>Learn how to draw OpenGL shapes in your application.</dd>
+
+ <dt><b><a href="projection.html">Applying Projection and Camera Views</a></b></dt>
+ <dd>Learn how to use projection and camera views to get a new perspective on your drawn
+objects.</dd>
+
+ <dt><b><a href="motion.html">Adding Motion</a></b></dt>
+ <dd>Learn how to do basic movement and animation of drawn objects with OpenGL.</dd>
+
+ <dt><b><a href="touch.html">Responding to Touch Events</a></b></dt>
+ <dd>Learn how to do basic interaction with OpenGL graphics.</dd>
+</dl>
diff --git a/docs/html/training/graphics/opengl/motion.jd b/docs/html/training/graphics/opengl/motion.jd
new file mode 100644
index 0000000..6888235
--- /dev/null
+++ b/docs/html/training/graphics/opengl/motion.jd
@@ -0,0 +1,92 @@
+page.title=Adding Motion
+parent.title=Displaying Graphics with OpenGL ES
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Applying Projection and Camera Views
+previous.link=projection.html
+next.title=Responding to Touch Events
+next.link=touch.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#rotate-gl1">Rotate a Shape</a></li>
+ <li><a href="#cont-render">Enable Continuous Rendering</a></li>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL</a></li>
+</ul>
+
+<div class="download-box">
+ <a href="http://developer.android.com/shareables/training/OpenGLES.zip"
+class="button">Download the sample</a>
+ <p class="filename">OpenGLES.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>Drawing objects on screen is a pretty basic feature of OpenGL, but you can do this with other
+Android graphics framwork classes, including {@link android.graphics.Canvas} and
+{@link android.graphics.drawable.Drawable} objects. OpenGL ES provides additional capabilities for
+moving and transforming drawn objects in three dimensions or in other unique ways to create
+compelling user experiences.</p>
+
+<p>In this lesson, you take another step forward into using OpenGL ES by learning how to add motion
+to a shape with rotation.</p>
+
+
+<h2 id="rotate">Rotate a Shape</h2>
+
+<p>Rotating a drawing object with OpenGL ES 2.0 is relatively simple. You create another
+transformation matrix (a rotation matrix) and then combine it with your projection and
+camera view tranformation matrices:</p>
+
+<pre>
+private float[] mRotationMatrix = new float[16];
+public void onDrawFrame(GL10 gl) {
+ ...
+ // Create a rotation transformation for the triangle
+ long time = SystemClock.uptimeMillis() % 4000L;
+ float angle = 0.090f * ((int) time);
+ Matrix.setRotateM(mRotationMatrix, 0, mAngle, 0, 0, -1.0f);
+
+ // Combine the rotation matrix with the projection and camera view
+ Matrix.multiplyMM(mMVPMatrix, 0, mRotationMatrix, 0, mMVPMatrix, 0);
+
+ // Draw triangle
+ mTriangle.draw(mMVPMatrix);
+}
+</pre>
+
+<p>If your triangle does not rotate after making these changes, make sure you have commented out the
+{@link android.opengl.GLSurfaceView#RENDERMODE_WHEN_DIRTY GLSurfaceView.RENDERMODE_WHEN_DIRTY}
+setting, as described in the next section.</p>
+
+
+<h2 id="cont-render">Enable Continuous Rendering</h2>
+
+<p>If you have diligently followed along with the example code in this class to this point, make
+sure you comment out the line that sets the render mode only draw when dirty, otherwise OpenGL
+rotates the shape only one increment and then waits for a call to {@link
+android.opengl.GLSurfaceView#requestRender requestRender()} from the {@link
+android.opengl.GLSurfaceView} container:</p>
+
+<pre>
+public MyGLSurfaceView(Context context) {
+ ...
+ // Render the view only when there is a change in the drawing data
+ //setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); // comment out for auto-rotation
+}
+</pre>
+
+<p>Unless you have objects changing without any user interaction, it’s usually a good idea have this
+flag turned on. Be ready to uncomment this code, because the next lesson makes this call applicable
+once again.</p>
diff --git a/docs/html/training/graphics/opengl/projection.jd b/docs/html/training/graphics/opengl/projection.jd
new file mode 100644
index 0000000..2a91093
--- /dev/null
+++ b/docs/html/training/graphics/opengl/projection.jd
@@ -0,0 +1,152 @@
+page.title=Applying Projection and Camera Views
+parent.title=Displaying Graphics with OpenGL ES
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Drawing Shapes
+previous.link=draw.html
+next.title=Applying Projection and Camera Views
+next.link=projection.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#projection">Define a Projection</a></li>
+ <li><a href="#camera-view">Define a Camera View</a></li>
+ <li><a href="#transform">Apply Projection and Camera Transformations</a></li>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL</a></li>
+</ul>
+
+<div class="download-box">
+ <a href="{@docRoot}shareables/training/OpenGLES.zip"
+class="button">Download the sample</a>
+ <p class="filename">OpenGLES.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>In the OpenGL ES environment, projection and camera views allow you to display drawn objects in a
+way that more closely resembles how you see physical objects with your eyes. This simulation of
+physical viewing is done with mathematical transformations of drawn object coordinates:</p>
+
+<ul>
+ <li><em>Projection</em> - This transformation adjusts the coordinates of drawn objects based on
+the width and height of the {@link android.opengl.GLSurfaceView} where they are displayed. Without
+this calculation, objects drawn by OpenGL ES are skewed by the unequal proportions of the view
+window. A projection transformation typically only has to be calculated when the proportions of the
+OpenGL view are established or changed in the {@link
+android.opengl.GLSurfaceView.Renderer#onSurfaceChanged
+onSurfaceChanged()} method of your renderer. For more information about OpenGL ES projections and
+coordinate mapping, see <a
+href="{@docRoot}guide/topics/graphics/opengl.html#coordinate-mapping">Mapping Coordinates for Drawn
+Objects</a>.</li>
+ <li><em>Camera View</em> - This transformation adjusts the coordinates of drawn objects based on a
+virtual camera position. It’s important to note that OpenGL ES does not define an actual camera
+object, but instead provides utility methods that simulate a camera by transforming the display of
+drawn objects. A camera view transformation might be calculated only once when you establish your
+{@link android.opengl.GLSurfaceView}, or might change dynamically based on user actions or your
+application’s function.</li>
+</ul>
+
+<p>This lesson describes how to create a projection and camera view and apply it to shapes drawn in
+your {@link android.opengl.GLSurfaceView}.</p>
+
+
+<h2 id="projection">Define a Projection</h2>
+
+<p>The data for a projection transformation is calculated in the {@link
+android.opengl.GLSurfaceView.Renderer#onSurfaceChanged onSurfaceChanged()}
+method of your {@link android.opengl.GLSurfaceView.Renderer} class. The following example code
+takes the height and width of the {@link android.opengl.GLSurfaceView} and uses it to populate a
+projection transformation {@link android.opengl.Matrix} using the {@link
+android.opengl.Matrix#frustumM Matrix.frustumM()} method:</p>
+
+<pre>
+@Override
+public void onSurfaceChanged(GL10 unused, int width, int height) {
+ GLES20.glViewport(0, 0, width, height);
+
+ float ratio = (float) width / height;
+
+ // this projection matrix is applied to object coordinates
+ // in the onDrawFrame() method
+ Matrix.frustumM(mProjMatrix, 0, -ratio, ratio, -1, 1, 3, 7);
+}
+</pre>
+
+<p>This code populates a projection matrix, {@code mProjMatrix} which you can then combine with a
+camera view transformation in the {@link android.opengl.GLSurfaceView.Renderer#onDrawFrame
+onDrawFrame()} method, which is shown in the next section.</p>
+
+<p class="note"><strong>Note:</strong> Just applying a projection transformation to your
+drawing objects typically results in a very empty display. In general, you must also apply a camera
+view transformation in order for anything to show up on screen.</p>
+
+
+<h2 id="camera-view">Define a Camera View</h2>
+
+<p>Complete the process of transforming your drawn objects by adding a camera view transformation as
+part of the drawing process. In the following example code, the camera view transformation is
+calculated using the {@link android.opengl.Matrix#setLookAtM Matrix.setLookAtM()} method and then
+combined with the previously calculated projection matrix. The combined transformation matrices
+are then passed to the drawn shape.</p>
+
+<pre>
+@Override
+public void onDrawFrame(GL10 unused) {
+ ...
+
+ // Set the camera position (View matrix)
+ Matrix.setLookAtM(mVMatrix, 0, 0, 0, -3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
+
+ // Calculate the projection and view transformation
+ Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mVMatrix, 0);
+
+ // Draw shape
+ mTriangle.draw(mMVPMatrix);
+}
+</pre>
+
+
+<h2 id="#transform">Apply Projection and Camera Transformations</h2>
+
+<p>In order to use the combined projection and camera view transformation matrix shown in the
+previews sections, modify the {@code draw()} method of your graphic objects to accept the combined
+transformation matrix and apply it to the shape:</p>
+
+<pre>
+public void draw(float[] mvpMatrix) { // pass in the calculated transformation matrix
+ ...
+
+ // get handle to shape's transformation matrix
+ mMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uMVPMatrix");
+
+ // Apply the projection and view transformation
+ GLES20.glUniformMatrix4fv(mMVPMatrixHandle, 1, false, mvpMatrix, 0);
+
+ // Draw the triangle
+ GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, vertexCount);
+ ...
+}
+</pre>
+
+<p>Once you have correctly calulated and applied the projection and camera view transformations,
+your graphic objects are drawn in correct proportions and should look like this:</p>
+
+
+<img src="{@docRoot}images/opengl/ogl-triangle-projected.png">
+<p class="img-caption">
+<strong>Figure 1.</strong> Triangle drawn with a projection and camera view applied.</p>
+
+
+<p>Now that you have an application that displays your shapes in correct proportions, it's time to
+add motion to your shapes.</p>
diff --git a/docs/html/training/graphics/opengl/shapes.jd b/docs/html/training/graphics/opengl/shapes.jd
new file mode 100644
index 0000000..98381cc
--- /dev/null
+++ b/docs/html/training/graphics/opengl/shapes.jd
@@ -0,0 +1,153 @@
+page.title=Defining Shapes
+parent.title=Displaying Graphics with OpenGL ES
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Building an OpenGL ES Environment
+previous.link=environment.html
+next.title=Drawing Shapes
+next.link=draw.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#triangle">Define a Triangle</a></li>
+ <li><a href="#square">Define a Square</a></li>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL</a></li>
+</ul>
+
+<div class="download-box">
+ <a href="{@docRoot}shareables/training/OpenGLES.zip"
+class="button">Download the sample</a>
+ <p class="filename">OpenGLES.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>Being able to define shapes to be drawn in the context of an OpenGL ES view is the first step in
+creating your high-end graphics masterpiece. Drawing with OpenGL ES can be a little tricky without
+knowing a few basic things about how OpenGL ES expects you to define graphic objects.</p>
+
+<p>This lesson explains the OpenGL ES coordinate system relative to an Android device screen, the
+basics of defining a shape, shape faces, as well as defining a triangle and a square.</p>
+
+
+<h2 id="triangle">Define a Triangle</h2>
+
+<p>OpenGL ES allows you to define drawn objects using coordinates in three-dimensional space. So,
+before you can draw a triangle, you must define its coordinates. In OpenGL, the typical way to do
+this is to define a vertex array of floating point numbers for the coordinates. For maximum
+efficiency, you write these coordinates into a {@link java.nio.ByteBuffer}, that is passed into the
+OpenGL ES graphics pipeline for processing.</p>
+
+<pre>
+class Triangle {
+
+ private FloatBuffer vertexBuffer;
+
+ // number of coordinates per vertex in this array
+ static final int COORDS_PER_VERTEX = 3;
+ static float triangleCoords[] = { // in counterclockwise order:
+ 0.0f, 0.622008459f, 0.0f, // top
+ -0.5f, -0.311004243f, 0.0f, // bottom left
+ 0.5f, -0.311004243f, 0.0f // bottom right
+ };
+
+ // Set color with red, green, blue and alpha (opacity) values
+ float color[] = { 0.63671875f, 0.76953125f, 0.22265625f, 1.0f };
+
+ public Triangle() {
+ // initialize vertex byte buffer for shape coordinates
+ ByteBuffer bb = ByteBuffer.allocateDirect(
+ // (number of coordinate values * 4 bytes per float)
+ triangleCoords.length * 4);
+ // use the device hardware's native byte order
+ bb.order(ByteOrder.nativeOrder());
+
+ // create a floating point buffer from the ByteBuffer
+ vertexBuffer = bb.asFloatBuffer();
+ // add the coordinates to the FloatBuffer
+ vertexBuffer.put(triangleCoords);
+ // set the buffer to read the first coordinate
+ vertexBuffer.position(0);
+ }
+}
+</pre>
+
+<p>By default, OpenGL ES assumes a coordinate system where [0,0,0] (X,Y,Z) specifies the center of
+the {@link android.opengl.GLSurfaceView} frame, [1,1,0] is the top right corner of the frame and
+[-1,-1,0] is bottom left corner of the frame. For an illustration of this coordinate system, see the
+<a href="{@docRoot}guide/topics/graphics/opengl.html#coordinate-mapping">OpenGL ES</a> developer
+guide.</p>
+
+<p>Note that the coordinates of this shape are defined in a counterclockwise order. The drawing
+order is important because it defines which side is the front face of the shape, which you typically
+want to have drawn, and the back face, which you can choose to not draw using the OpenGL ES cull
+face feature. For more information about faces and culling, see the <a
+href="{@docRoot}guide/topics/graphics/opengl.html#faces-winding">OpenGL ES</a> developer guide.</p>
+
+
+<h2 id="square">Define a Square</h2>
+
+<p>Defining triangles is pretty easy in OpenGL, but what if you want to get a just a little more
+complex? Say, a square? There are a number of ways to do this, but a typical path to drawing such a
+shape in OpenGL ES is to use two triangles drawn together:</p>
+
+<img src="{@docRoot}images/opengl/ccw-square.png">
+<p class="img-caption">
+ <strong>Figure 1.</strong> Drawing a square using two triangles.</p>
+
+<p>Again, you should define the vertices in a counterclockwise order for both triangles that
+represent this shape, and put the values in a {@link java.nio.ByteBuffer}. In order to avoid
+defining the two coordinates shared by each triangle twice, use a drawing list to tell the
+OpenGL ES graphics pipeline how to draw these vertices. Here’s the code for this shape:</p>
+
+<pre>
+class Square {
+
+ private FloatBuffer vertexBuffer;
+ private ShortBuffer drawListBuffer;
+
+ // number of coordinates per vertex in this array
+ static final int COORDS_PER_VERTEX = 3;
+ static float squareCoords[] = { -0.5f, 0.5f, 0.0f, // top left
+ -0.5f, -0.5f, 0.0f, // bottom left
+ 0.5f, -0.5f, 0.0f, // bottom right
+ 0.5f, 0.5f, 0.0f }; // top right
+
+ private short drawOrder[] = { 0, 1, 2, 0, 2, 3 }; // order to draw vertices
+
+ public Square() {
+ // initialize vertex byte buffer for shape coordinates
+ ByteBuffer bb = ByteBuffer.allocateDirect(
+ // (# of coordinate values * 4 bytes per float)
+ squareCoords.length * 4);
+ bb.order(ByteOrder.nativeOrder());
+ vertexBuffer = bb.asFloatBuffer();
+ vertexBuffer.put(squareCoords);
+ vertexBuffer.position(0);
+
+ // initialize byte buffer for the draw list
+ ByteBuffer dlb = ByteBuffer.allocateDirect(
+ // (# of coordinate values * 2 bytes per short)
+ drawOrder.length * 2);
+ dlb.order(ByteOrder.nativeOrder());
+ drawListBuffer = dlb.asShortBuffer();
+ drawListBuffer.put(drawOrder);
+ drawListBuffer.position(0);
+ }
+}
+</pre>
+
+<p>This example gives you a peek at what it takes to create more complex shapes with OpenGL. In
+general, you use collections of triangles to draw objects. In the next lesson, you learn how to draw
+these shapes on screen.</p>
diff --git a/docs/html/training/graphics/opengl/touch.jd b/docs/html/training/graphics/opengl/touch.jd
new file mode 100644
index 0000000..c058a59
--- /dev/null
+++ b/docs/html/training/graphics/opengl/touch.jd
@@ -0,0 +1,145 @@
+page.title= Responding to Touch Events
+parent.title=Displaying Graphics with OpenGL ES
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Adding Motion
+previous.link=motion.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#listener">Setup a Touch Listener</a></li>
+ <li><a href="#angle">Expose the Rotation Angle</a></li>
+ <li><a href="#rotate">Apply Rotation</a></li>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL</a></li>
+</ul>
+
+<div class="download-box">
+ <a href="http://developer.android.com/shareables/training/OpenGLES.zip"
+class="button">Download the sample</a>
+ <p class="filename">OpenGLES.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>Making objects move according to a preset program like the rotating triangle is useful for
+getting some attention, but what if you want to have users interact with your OpenGL ES graphics?
+The key to making your OpenGL ES application touch interactive is expanding your implementation of
+{@link android.opengl.GLSurfaceView} to override the {@link
+android.opengl.GLSurfaceView#onTouchEvent onTouchEvent()} to listen for touch events.</p>
+
+<p>This lesson shows you how to listen for touch events to let users rotate an OpenGL ES object.</p>
+
+
+<h2 id="listener">Setup a Touch Listener</h2>
+
+<p>In order to make your OpenGL ES application respond to touch events, you must implement the
+{@link android.opengl.GLSurfaceView#onTouchEvent onTouchEvent()} method in your
+{@link android.opengl.GLSurfaceView} class. The example implementation below shows how to listen for
+{@link android.view.MotionEvent#ACTION_MOVE MotionEvent.ACTION_MOVE} events and translate them to
+an angle of rotation for a shape.</p>
+
+<pre>
+@Override
+public boolean onTouchEvent(MotionEvent e) {
+ // MotionEvent reports input details from the touch screen
+ // and other input controls. In this case, you are only
+ // interested in events where the touch position changed.
+
+ float x = e.getX();
+ float y = e.getY();
+
+ switch (e.getAction()) {
+ case MotionEvent.ACTION_MOVE:
+
+ float dx = x - mPreviousX;
+ float dy = y - mPreviousY;
+
+ // reverse direction of rotation above the mid-line
+ if (y > getHeight() / 2) {
+ dx = dx * -1 ;
+ }
+
+ // reverse direction of rotation to left of the mid-line
+ if (x < getWidth() / 2) {
+ dy = dy * -1 ;
+ }
+
+ mRenderer.mAngle += (dx + dy) * TOUCH_SCALE_FACTOR; // = 180.0f / 320
+ requestRender();
+ }
+
+ mPreviousX = x;
+ mPreviousY = y;
+ return true;
+}
+</pre>
+
+<p>Notice that after calculating the rotation angle, this method calls {@link
+android.opengl.GLSurfaceView#requestRender requestRender()} to tell the
+renderer that it is time to render the frame. This approach is the most efficient in this example
+because the frame does not need to be redrawn unless there is a change in the rotation. However, it
+does not have any impact on efficiency unless you also request that the renderer only redraw when
+the data changes using the {@link android.opengl.GLSurfaceView#setRenderMode setRenderMode()}
+method, so make sure this line is uncommented in the renderer:</p>
+
+<pre>
+public MyGLSurfaceView(Context context) {
+ ...
+ // Render the view only when there is a change in the drawing data
+ <strong>setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);</strong>
+}
+</pre>
+
+<h2 id="angle">Expose the Rotation Angle</h2>
+
+<p>The example code above requires that you expose the rotation angle through your renderer by
+adding a public member. Since the renderer code is running on a separate thread from the main user
+interface thread of your application, you must declare this public variable as {@code volatile}.
+Here is the code to do that:</p>
+
+<pre>
+public class MyGLRenderer implements GLSurfaceView.Renderer {
+ ...
+ public volatile float mAngle;
+</pre>
+
+
+<h2 id="rotate">Apply Rotation</h2>
+
+<p>To apply the rotation generated by touch input, comment out the code that generates an angle and
+add {@code mAngle}, which contains the touch input generated angle:</p>
+
+<pre>
+public void onDrawFrame(GL10 gl) {
+ ...
+ // Create a rotation for the triangle
+ // long time = SystemClock.uptimeMillis() % 4000L;
+ // float angle = 0.090f * ((int) time);
+ <strong>Matrix.setRotateM(mRotationMatrix, 0, mAngle, 0, 0, -1.0f);</strong>
+
+ // Combine the rotation matrix with the projection and camera view
+ Matrix.multiplyMM(mMVPMatrix, 0, mRotationMatrix, 0, mMVPMatrix, 0);
+
+ // Draw triangle
+ mTriangle.draw(mMVPMatrix);
+}
+</pre>
+
+<p>When you have completed the steps described above, run the program and drag your finger over the
+screen to rotate the triangle:</p>
+
+<img src="{@docRoot}images/opengl/ogl-triangle-touch.png">
+<p class="img-caption">
+<strong>Figure 1.</strong> Triangle being rotated with touch input (circle shows touch
+location).</p>
diff --git a/docs/html/training/id-auth/index.jd b/docs/html/training/id-auth/index.jd
index 361e6cf..140545c 100644
--- a/docs/html/training/id-auth/index.jd
+++ b/docs/html/training/id-auth/index.jd
@@ -14,7 +14,7 @@
<h2>Requirements and prerequisites</h2>
<ul>
<li>Android 2.0 (API level 5) or higher</li>
- <li>Experience with <a href="{@docRoot}guide/topics/fundamentals/services.html">Services</a></li>
+ <li>Experience with <a href="{@docRoot}guide/components/services.html">Services</a></li>
<li>Experience with <a href="http://oauth.net/2/">OAuth 2.0</a></li>
</ul>
diff --git a/docs/html/training/implementing-navigation/ancestral.jd b/docs/html/training/implementing-navigation/ancestral.jd
index 495b45d..ac35e64 100644
--- a/docs/html/training/implementing-navigation/ancestral.jd
+++ b/docs/html/training/implementing-navigation/ancestral.jd
@@ -22,7 +22,7 @@
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}training/design-navigation/ancestral-temporal.html">Providing Ancestral and Temporal Navigation</a></li>
- <li><a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a></li>
+ <li><a href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a></li>
<li><a href="{@docRoot}design/patterns/navigation.html">Android Design: Navigation</a></li>
</ul>
@@ -87,7 +87,7 @@
<p>When the current activity belongs to a task from a different application—for example if it was reached via an intent from another application—pressing <em>Up</em> should create a new task for the application with a synthesized back stack. This approach is described in <a href="{@docRoot}design/patterns/navigation.html">Android Design: Navigation</a> and the {@link android.support.v4.app.TaskStackBuilder} class reference.</p>
-<p>The {@link android.support.v4.app.NavUtils} and {@link android.support.v4.app.TaskStackBuilder} classes in the <a href="{@docRoot}sdk/compatibility-library.html">Android Support Package</a> provide helpers for implementing this behavior correctly. An example usage of these two helper classes is below:</p>
+<p>The {@link android.support.v4.app.NavUtils} and {@link android.support.v4.app.TaskStackBuilder} classes in the <a href="{@docRoot}tools/extras/support-library.html">Android Support Package</a> provide helpers for implementing this behavior correctly. An example usage of these two helper classes is below:</p>
<pre>
{@literal @}Override
diff --git a/docs/html/training/implementing-navigation/index.jd b/docs/html/training/implementing-navigation/index.jd
index da61c81..ebb4995 100644
--- a/docs/html/training/implementing-navigation/index.jd
+++ b/docs/html/training/implementing-navigation/index.jd
@@ -15,7 +15,7 @@
<ul>
<li>API level 14</li>
<li>Understanding of fragments and Android layouts</li>
- <li><a href="{@docRoot}sdk/compatibility-library.html">The Android Support Package</a></li>
+ <li><a href="{@docRoot}tools/extras/support-library.html">The Android Support Package</a></li>
<li><a href="{@docRoot}training/design-navigation/index.html">Designing Effective Navigation</a></li>
</ul>
@@ -23,7 +23,7 @@
<ul>
<li><a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a></li>
- <li><a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a></li>
+ <li><a href="{@docRoot}guide/components/fragments.html">Fragments</a></li>
<li><a href="{@docRoot}training/multiscreen/index.html">Designing for Multiple Screens</a></li>
</ul>
diff --git a/docs/html/training/implementing-navigation/lateral.jd b/docs/html/training/implementing-navigation/lateral.jd
index d9ba5c9..76acf03 100644
--- a/docs/html/training/implementing-navigation/lateral.jd
+++ b/docs/html/training/implementing-navigation/lateral.jd
@@ -119,7 +119,7 @@
<h2 id="horizontal-paging">Implement Horizontal Paging (Swipe Views)</h2>
-<p>Horizontal paging, or swipe views, allow users to <a href="{@docRoot}design/patterns/swipe-views">swipe</a> horizontally on the current screen to navigate to adjacent screens. This pattern can be implemented using the {@link android.support.v4.view.ViewPager} widget, currently available as part of the <a href="{@docRoot}sdk/compatibility-library.html">Android Support Package</a>. For navigating between sibling screens representing a fixed number of sections, it's best to provide the {@link android.support.v4.view.ViewPager} with a {@link android.support.v4.app.FragmentPagerAdapter}. For horizontal paging across collections of objects, it's best to use a {@link android.support.v4.app.FragmentStatePagerAdapter}, which destroys fragments as the user navigates to other pages, minimizing memory usage.</p>
+<p>Horizontal paging, or swipe views, allow users to <a href="{@docRoot}design/patterns/swipe-views">swipe</a> horizontally on the current screen to navigate to adjacent screens. This pattern can be implemented using the {@link android.support.v4.view.ViewPager} widget, currently available as part of the <a href="{@docRoot}tools/extras/support-library.html">Android Support Package</a>. For navigating between sibling screens representing a fixed number of sections, it's best to provide the {@link android.support.v4.view.ViewPager} with a {@link android.support.v4.app.FragmentPagerAdapter}. For horizontal paging across collections of objects, it's best to use a {@link android.support.v4.app.FragmentStatePagerAdapter}, which destroys fragments as the user navigates to other pages, minimizing memory usage.</p>
<p>Below is an example of using a {@link android.support.v4.view.ViewPager} to swipe across a collection of objects.</p>
diff --git a/docs/html/training/implementing-navigation/temporal.jd b/docs/html/training/implementing-navigation/temporal.jd
index f36991f..1c41732 100644
--- a/docs/html/training/implementing-navigation/temporal.jd
+++ b/docs/html/training/implementing-navigation/temporal.jd
@@ -22,7 +22,7 @@
<h2>You should also read</h2>
<ul>
<li><a href="{@docRoot}training/design-navigation/ancestral-temporal.html">Providing Ancestral and Temporal Navigation</a></li>
- <li><a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a></li>
+ <li><a href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a></li>
<li><a href="{@docRoot}design/patterns/navigation.html">Android Design: Navigation</a></li>
</ul>
@@ -32,7 +32,7 @@
<p><em>Temporal navigation</em> is navigation to previously visited screens. Users can visit previous screens by pressing the device <em>Back</em> button. This user interface pattern is described further in <a href="{@docRoot}training/design-navigation/ancestral-temporal.html">Providing Ancestral and Temporal Navigation</a> in <em>Designing Effective Navigation</em> and in <a href="{@docRoot}design/patterns/navigation.html">Android Design: Navigation</a>.</p>
-<p>Android handles basic <em>Back</em> navigation for you (see <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back Stack</a> for details on this behavior). This lesson discusses a number of cases where applications should provide specialized logic for the <em>Back</em> button.</p>
+<p>Android handles basic <em>Back</em> navigation for you (see <a href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a> for details on this behavior). This lesson discusses a number of cases where applications should provide specialized logic for the <em>Back</em> button.</p>
<h2 id="back-fragments">Implement <em>Back</em> Navigation with Fragments</h2>
diff --git a/docs/html/training/improving-layouts/optimizing-layout.jd b/docs/html/training/improving-layouts/optimizing-layout.jd
index 0eaf199..520ce56 100644
--- a/docs/html/training/improving-layouts/optimizing-layout.jd
+++ b/docs/html/training/improving-layouts/optimizing-layout.jd
@@ -44,8 +44,8 @@
android.widget.GridView}.</p>
<p>In this lesson you'll learn to use <a
-href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a> and <a
-href="{@docRoot}guide/developing/tools/layoutopt.html">Layoutopt</a> to examine and optimize your
+href="{@docRoot}tools/help/hierarchy-viewer.html">Hierarchy Viewer</a> and <a
+href="{@docRoot}tools/help/layoutopt.html">Layoutopt</a> to examine and optimize your
layout.</p>
@@ -53,7 +53,7 @@
<h2 id="Inspect">Inspect Your Layout</h2>
<p>The Android SDK tools include a tool called <a
-href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a> that allows
+href="{@docRoot}tools/help/hierarchy-viewer.html">Hierarchy Viewer</a> that allows
you to analyze your layout while your application is running. Using this tool helps you discover
bottlenecks in the layout performance.</p>
diff --git a/docs/html/training/index.jd b/docs/html/training/index.jd
index 8bf32bb..3c67af9 100644
--- a/docs/html/training/index.jd
+++ b/docs/html/training/index.jd
@@ -1,18 +1,14 @@
-page.title=Orientation to Android Training
+page.title=Android Training
page.metaDescription=Android Training provides a collection of classes that aim to help you build great apps for Android. Each class explains the steps required to solve a problem or implement a feature using code snippets and sample code for you to use in your apps.
@jd:body
-<div class="figure" style="width:450px;margin-top:-30px">
- <img src="{@docRoot}images/training/training-prof.png" alt="" />
-</div>
-
<p>Welcome to Android Training. Here you'll find a collection of classes that aim to help you
build great apps for Android, using best practices in a variety of framework topics.</p>
<p>Each class explains the steps required to solve a problem or implement a feature using code
snippets and sample code for you to use in your apps.</p>
-<p>What you see now is just the beginning. We plan to add many more classes, expand and refine
-existing classes, and build Training Courses that help you enhance your apps using
-objective-oriented collections of classes.</p>
+<p>This first section is focused on teaching you the bare essentials. If you're a new developer
+on Android, you should walk through each of these classes, beginning with
+<a href="{@docRoot}training/basics/firstapp/index.html">Building Your First App</a>.</p></a>
diff --git a/docs/html/training/managing-audio/index.jd b/docs/html/training/managing-audio/index.jd
index 3aa2d88..0f7bbfd 100644
--- a/docs/html/training/managing-audio/index.jd
+++ b/docs/html/training/managing-audio/index.jd
@@ -19,7 +19,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/fundamentals/services.html">Services</a></li>
+ <li><a href="{@docRoot}guide/components/services.html">Services</a></li>
</ul>
</div>
diff --git a/docs/html/training/monitoring-device-state/battery-monitoring.jd b/docs/html/training/monitoring-device-state/battery-monitoring.jd
index 6e25df8..c963a18 100644
--- a/docs/html/training/monitoring-device-state/battery-monitoring.jd
+++ b/docs/html/training/monitoring-device-state/battery-monitoring.jd
@@ -21,7 +21,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
</ul>
</div>
diff --git a/docs/html/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html/training/monitoring-device-state/connectivity-monitoring.jd
index 98ba63c..11a05e1 100644
--- a/docs/html/training/monitoring-device-state/connectivity-monitoring.jd
+++ b/docs/html/training/monitoring-device-state/connectivity-monitoring.jd
@@ -24,7 +24,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
</ul>
</div>
diff --git a/docs/html/training/monitoring-device-state/docking-monitoring.jd b/docs/html/training/monitoring-device-state/docking-monitoring.jd
index 82d655e..3787a55 100644
--- a/docs/html/training/monitoring-device-state/docking-monitoring.jd
+++ b/docs/html/training/monitoring-device-state/docking-monitoring.jd
@@ -23,7 +23,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
</ul>
</div>
diff --git a/docs/html/training/monitoring-device-state/index.jd b/docs/html/training/monitoring-device-state/index.jd
index 61f7176..585b669 100644
--- a/docs/html/training/monitoring-device-state/index.jd
+++ b/docs/html/training/monitoring-device-state/index.jd
@@ -13,12 +13,12 @@
<h2>Dependencies and prerequisites</h2>
<ul>
<li>Android 2.0 (API level 5) or higher</li>
- <li>Experience with <a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a></li>
+ <li>Experience with <a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a></li>
</ul>
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/fundamentals/services.html">Services</a>
+ <li><a href="{@docRoot}guide/components/services.html">Services</a>
</ul>
</div>
diff --git a/docs/html/training/monitoring-device-state/manifest-receivers.jd b/docs/html/training/monitoring-device-state/manifest-receivers.jd
index 0b79ce6..d4aeed3 100644
--- a/docs/html/training/monitoring-device-state/manifest-receivers.jd
+++ b/docs/html/training/monitoring-device-state/manifest-receivers.jd
@@ -21,7 +21,7 @@
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
</ul>
</div>
diff --git a/docs/html/training/multiple-apks/api.jd b/docs/html/training/multiple-apks/api.jd
index 3492245..1a2593a 100644
--- a/docs/html/training/multiple-apks/api.jd
+++ b/docs/html/training/multiple-apks/api.jd
@@ -33,7 +33,7 @@
<!-- other docs (NOT javadocs) -->
<h2>You should also read</h2>
<ul>
- <li><a href="http://developer.android.com/guide/market/publishing/multiple-apks.html">Multiple APK
+ <li><a href="http://developer.android.com/guide/google/play/publishing/multiple-apks.html">Multiple APK
Support</a></li>
<li><a
href="http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html">
@@ -57,7 +57,7 @@
platform, naturally you want your application to take advantage of new features on new devices,
without sacrificing backwards compatibility. It may seem at the outset as though multiple APK
support is the best solution, but this often isn’t the case. The <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html#ApiLevelOptions">Using Single APK
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html#ApiLevelOptions">Using Single APK
Instead</a> section of the multiple APK developer guide includes some useful information on how to
accomplish this with a single APK, including use of our support library. You can also learn how to
write code that runs only at certain API levels in a single APK, without resorting to
@@ -85,7 +85,7 @@
<p>Start off by creating a simple chart to quickly determine how many APKs you need, and what API
range each APK covers. For handy reference, the <a
-href="{@docRoot}resources/dashboard/platform-versions.html">Platform Versions</a> page of the
+href="{@docRoot}about/dashboards/index.html">Platform Versions</a> page of the
Android Developer website provides data about the relative number of active devices running a given
version of the Android platform. Also, although it sounds easy at first, keeping track of which set
of API levels each APK is going to target gets difficult rather quickly, especially if there’s going
@@ -153,10 +153,10 @@
their creation at the following links:</p>
<ul>
<li><a
-href="{@docRoot}guide/developing/projects/projects-eclipse.html#SettingUpLibraryProject">Setting up
+href="{@docRoot}tools/projects/projects-eclipse.html#SettingUpLibraryProject">Setting up
a library project (Eclipse)</a></li>
<li><a
-href="{@docRoot}guide/developing/projects/projects-cmdline.html#SettingUpLibraryProject">Setting up
+href="{@docRoot}tools/projects/projects-cmdline.html#SettingUpLibraryProject">Setting up
a library project (Command line)</a></li>
</ul>
@@ -279,7 +279,7 @@
<p>
Now, let’s further assume that the Red APK has some requirement on it that the other two don’t.
-<a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a> page of
+<a href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a> page of
the Android Developer guide has a whole list of possible culprits. For the
sake of example, let’s assume that red requires a front-facing camera. In fact, the entire point of
the red APK is to combine the front-facing camera with sweet new functionality that was added in API
@@ -296,7 +296,7 @@
<p> In order to keep all your APKs on separate "tracks", it’s important to have a good version code
scheme. The recommended one can be found on the <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html#VersionCodes">Version Codes</a> area of
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html#VersionCodes">Version Codes</a> area of
our developer guide. Since the example set of APKs is only dealing with one of 3 possible
dimensions, it would be sufficient to separate each APK by 1000, set the first couple digits to the
minSdkVersion for that particular APK, and increment from there. This might look like:</p>
diff --git a/docs/html/training/multiple-apks/index.jd b/docs/html/training/multiple-apks/index.jd
index d92c106..1f2fee8 100644
--- a/docs/html/training/multiple-apks/index.jd
+++ b/docs/html/training/multiple-apks/index.jd
@@ -23,7 +23,7 @@
<!-- related docs (NOT javadocs) -->
<h2>You should also read</h2>
<ul>
- <li><a href="http://developer.android.com/guide/market/publishing/multiple-apks.html">Multiple APK
+ <li><a href="http://developer.android.com/guide/google/play/publishing/multiple-apks.html">Multiple APK
Support</a></li>
</ul>
diff --git a/docs/html/training/multiple-apks/multiple.jd b/docs/html/training/multiple-apks/multiple.jd
index b30068f..25938da 100644
--- a/docs/html/training/multiple-apks/multiple.jd
+++ b/docs/html/training/multiple-apks/multiple.jd
@@ -33,7 +33,7 @@
<!-- other docs (NOT javadocs) -->
<h2>You should also read</h2>
<ul>
- <li><a href="http://developer.android.com/guide/market/publishing/multiple-apks.html">Multiple APK
+ <li><a href="http://developer.android.com/guide/google/play/publishing/multiple-apks.html">Multiple APK
Support</a></li>
</ul>
@@ -54,7 +54,7 @@
take advantage of the space of large screens but still work on small ones, to use new Android API
features or visual textures available on cutting edge devices but not abandon older ones. It may
seem at the outset as though multiple APK support is the best solution, but this often isn’t the
-case. The <a href="{@docRoot}guide/market/publishing/multiple-apks.html#ApiLevelOptions">Using
+case. The <a href="{@docRoot}guide/google/play/publishing/multiple-apks.html#ApiLevelOptions">Using
Single APK Instead</a> section of the multiple APK guide includes some useful information on how to
accomplish all of this with a single APK, including use of our <a
href="http://android-developers.blogspot.com/2011/03/fragments-for-all.html">support library</a>,
@@ -182,10 +182,10 @@
their creation at the following links:</p>
<ul>
<li><a
-href="{@docRoot}guide/developing/projects/projects-eclipse.html#SettingUpLibraryProject">Setting up
+href="{@docRoot}tools/projects/projects-eclipse.html#SettingUpLibraryProject">Setting up
a library project (Eclipse)</a></li>
<li><a
-href="{@docRoot}guide/developing/projects/projects-cmdline.html#SettingUpLibraryProject">Setting up
+href="{@docRoot}tools/projects/projects-cmdline.html#SettingUpLibraryProject">Setting up
a library project (Command line)</a></li>
</ul>
@@ -329,7 +329,7 @@
Purple ≥ Red ≥ Green ≥ Blue
</p><p>
Why allow all the overlap? Let’s pretend that the Purple APK has some requirement on it that the
-other two don’t. The <a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a> page
+other two don’t. The <a href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a> page
of the Android Developer guide has a whole list of possible culprits. For the sake of example,
let’s assume that Purple requires a front-facing camera. In fact, the entire point of Purple is to
use entertaining things with the front-facing camera! But, it turns out, not all API 11+ devices
@@ -345,7 +345,7 @@
<p> In order to keep all your APKs on separate "tracks", it’s important to have a good version code
scheme. The recommended one can be found on the <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html#VersionCodes">Version Codes</a> area of
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html#VersionCodes">Version Codes</a> area of
our developer guide. It’s worth reading the whole section, but the basic gist is for this set of
APKs, we’d use two digits to represent the minSDK, two to represent the min/max screen size, and 3
to represent the build number. That way, when the device upgraded to a new version of Android,
diff --git a/docs/html/training/multiple-apks/screensize.jd b/docs/html/training/multiple-apks/screensize.jd
index ac679a7..ea793db 100644
--- a/docs/html/training/multiple-apks/screensize.jd
+++ b/docs/html/training/multiple-apks/screensize.jd
@@ -34,7 +34,7 @@
<!-- other docs (NOT javadocs) -->
<h2>You should also read</h2>
<ul>
- <li><a href="http://developer.android.com/guide/market/publishing/multiple-apks.html">Multiple APK
+ <li><a href="http://developer.android.com/guide/google/play/publishing/multiple-apks.html">Multiple APK
Support</a></li>
<li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></li>
</ul>
@@ -56,7 +56,7 @@
naturally you want your application to take advantage of all the available space on larger devices,
without sacrificing compatibility or usability on the smaller screens. It may seem at the outset as
though multiple APK support is the best solution, but this often isn’t the case. The <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html#ApiLevelOptions">Using Single APK
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html#ApiLevelOptions">Using Single APK
Instead</a> section of the multiple APK developer guide includes some useful information on how to
accomplish this with a single APK, including use of our support library. You should also read the
guide to <a href="{@docRoot}guide/practices/screens_support.html">supporting multiple screens</a>,
@@ -130,10 +130,10 @@
their creation at the following links:</p>
<ul>
<li><a
-href="{@docRoot}guide/developing/projects/projects-eclipse.html#SettingUpLibraryProject">Setting up
+href="{@docRoot}tools/projects/projects-eclipse.html#SettingUpLibraryProject">Setting up
a library project (Eclipse)</a></li>
<li><a
-href="{@docRoot}guide/developing/projects/projects-cmdline.html#SettingUpLibraryProject">Setting up
+href="{@docRoot}tools/projects/projects-cmdline.html#SettingUpLibraryProject">Setting up
a library project (Command line)</a></li>
</ul>
@@ -227,7 +227,7 @@
</table>
<p>
Now, let’s further assume that the Red APK has some requirement on it that the other two don’t. The
-<a href="{@docRoot}guide/appendix/market-filters.html">Filters on Google Play</a> page of the Android
+<a href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a> page of the Android
Developer guide has a whole list of possible culprits. For the sake of example, let’s assume that
red requires a front-facing camera. In fact, the entire point of the red APK is to use the extra
available screen space to do entertaining things with that front-facing camera. But, it turns out,
@@ -243,7 +243,7 @@
<p> In order to keep all your APKs on separate "tracks", it’s important to have a good version code
scheme. The recommended one can be found on the <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html#VersionCodes">Version Codes</a> area of
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html#VersionCodes">Version Codes</a> area of
our developer guide. Since the example set of APKs is only dealing with one of 3 possible
dimensions, it would be sufficient to separate each APK by 1000 and increment from there. This
might look like:</p>
diff --git a/docs/html/training/multiple-apks/texture.jd b/docs/html/training/multiple-apks/texture.jd
index 497d6b8..70ad1e0 100644
--- a/docs/html/training/multiple-apks/texture.jd
+++ b/docs/html/training/multiple-apks/texture.jd
@@ -33,7 +33,7 @@
<!-- other docs (NOT javadocs) -->
<h2>You should also read</h2>
<ul>
- <li><a href="http://developer.android.com/guide/market/publishing/multiple-apks.html">Multiple APK
+ <li><a href="http://developer.android.com/guide/google/play/publishing/multiple-apks.html">Multiple APK
Support</a></li>
</ul>
@@ -49,10 +49,10 @@
devices, naturally you want your application look its best on each individual device, regardless of
the fact they don’t all support the same set of GL textures. It may seem at the outset as though
multiple APK support is the best solution, but this often isn’t the case. The <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html#ApiLevelOptions">Using Single APK
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html#ApiLevelOptions">Using Single APK
Instead</a> section of the multiple APK developer guide includes some useful information on how to
accomplish this with a single APK, including how to <a
-href="{@docRoot}guide/market/publishing/multiple-apks.html#TextureOptions">detect supported texture
+href="{@docRoot}guide/google/play/publishing/multiple-apks.html#TextureOptions">detect supported texture
formats at runtime</a>. Depending on your situation, it might be easier to bundle all formats with
your application, and simply pick which one to use at runtime.</p>
@@ -113,10 +113,10 @@
their creation at the following links:</p>
<ul>
<li><a
-href="{@docRoot}guide/developing/projects/projects-eclipse.html#SettingUpLibraryProject">Setting up
+href="{@docRoot}tools/projects/projects-eclipse.html#SettingUpLibraryProject">Setting up
a library project (Eclipse)</a></li>
<li><a
-href="{@docRoot}guide/developing/projects/projects-cmdline.html#SettingUpLibraryProject">Setting up
+href="{@docRoot}tools/projects/projects-cmdline.html#SettingUpLibraryProject">Setting up
a library project (Command line)</a></li>
</ul>
diff --git a/docs/html/training/multiscreen/index.jd b/docs/html/training/multiscreen/index.jd
index a986cef..23f6564 100644
--- a/docs/html/training/multiscreen/index.jd
+++ b/docs/html/training/multiscreen/index.jd
@@ -15,12 +15,12 @@
<ul>
<li>Android 1.6 or higher (2.1+ for the sample app)</li>
<li>Basic knowledge of <a
-href="http://developer.android.com/guide/topics/fundamentals/activities.html">Activities</a> and
-<a href="http://developer.android.com/guide/topics/fundamentals/fragments.html">Fragments</a></li>
+href="http://developer.android.com/guide/components/activities.html">Activities</a> and
+<a href="http://developer.android.com/guide/components/fragments.html">Fragments</a></li>
<li>Experience building an Android <a
href="http://developer.android.com/guide/topics/ui/index.html"> User Interface</a></li>
<li>Several features require the use of the <a
-href="{@docRoot}sdk/compatibility-library.html">support library</a></li>
+href="{@docRoot}tools/extras/support-library.html">support library</a></li>
</ul>
<h2>You should also read</h2>
@@ -59,7 +59,7 @@
of reusable code for your own application.</p>
<p class="note"><strong>Note:</strong> This class and the associated sample use the <a
-href="{@docRoot}sdk/compatibility-library.html">support library</a> in order to use the {@link
+href="{@docRoot}tools/extras/support-library.html">support library</a> in order to use the {@link
android.app.Fragment} APIs on versions lower than Android 3.0. You must download and add the
library to your application in order to use all APIs in this class.</p>
diff --git a/docs/html/training/multiscreen/screensizes.jd b/docs/html/training/multiscreen/screensizes.jd
index bf19b08..a34c3d5 100644
--- a/docs/html/training/multiscreen/screensizes.jd
+++ b/docs/html/training/multiscreen/screensizes.jd
@@ -348,7 +348,7 @@
<p class="img-caption"><strong>Figure 4.</strong> <code>button.png</code></p>
<p>And then run it through the <ode
-href="{@docRoot}guide/developing/tools/draw9patch.html"><code>draw9patch</code></a> utility of the
+href="{@docRoot}tools/help/draw9patch.html"><code>draw9patch</code></a> utility of the
SDK (which is located in the <code>tools/</code> directory), in which you can mark the areas that
should be stretched by drawing pixels along the left and top borders. You can also mark the area
that should hold the content by drawing pixels along the right and bottom borders, resulting in
diff --git a/docs/html/training/sharing/index.jd b/docs/html/training/sharing/index.jd
index 9ee5e29..c2e8dbc 100644
--- a/docs/html/training/sharing/index.jd
+++ b/docs/html/training/sharing/index.jd
@@ -14,7 +14,7 @@
<h2>Dependencies and prerequisites</h2>
<ul>
<li>Android 1.0 or higher (greater requirements where noted)</li>
- <li>Experience with <a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and
+ <li>Experience with <a href="{@docRoot}guide/components/intents-filters.html">Intents and
Intent Filters</a></li>
</ul>
diff --git a/docs/html/training/sharing/receive.jd b/docs/html/training/sharing/receive.jd
index 9c932b1..7ec3def 100644
--- a/docs/html/training/sharing/receive.jd
+++ b/docs/html/training/sharing/receive.jd
@@ -23,7 +23,7 @@
<!-- other docs (NOT javadocs) -->
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intents and
Intent Filters</a></li>
</ul>
@@ -48,7 +48,7 @@
lesson, you create intent filters in order to be able to receive intents with this action. You
define an intent filter in your manifest, using the
<code><a
-href="{@docRoot}guide/topics/intents/intents-filters.html#ifs"><intent-filter></a></code>
+href="{@docRoot}guide/components/intents-filters.html#ifs"><intent-filter></a></code>
element. For example, if your application handles receiving text content, a single image of any
type, or multiple images of any type, your manifest would look like:</p>
@@ -73,7 +73,7 @@
</pre>
<p class="note"><strong>Note:</strong> For more information on intent filters and intent resolution
-please read <a href="{@docRoot}guide/topics/intents/intents-filters.html#ifs">Intents and Intent
+please read <a href="{@docRoot}guide/components/intents-filters.html#ifs">Intents and Intent
Filters</a></p>
<p>When another application tries to share any of these things by constructing an intent and passing
diff --git a/docs/html/training/sharing/send.jd b/docs/html/training/sharing/send.jd
index afb0e34..741c017 100644
--- a/docs/html/training/sharing/send.jd
+++ b/docs/html/training/sharing/send.jd
@@ -22,7 +22,7 @@
<!-- other docs (NOT javadocs) -->
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and
+ <li><a href="{@docRoot}guide/components/intents-filters.html">Intents and
Intent Filters</a></li>
</ul>
diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs
new file mode 100644
index 0000000..77a6837
--- /dev/null
+++ b/docs/html/training/training_toc.cs
@@ -0,0 +1,685 @@
+<ul id="nav">
+
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/index.html">
+ <span class="en">Get Started</span>
+ </a>
+ </div>
+
+ <ul>
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/basics/firstapp/index.html">
+ <span class="en">Building Your First App</span>
+ </a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/basics/firstapp/creating-project.html">
+ <span class="en">Creating an Android Project</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/firstapp/running-app.html">
+ <span class="en">Running Your Application</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/firstapp/building-ui.html">
+ <span class="en">Building a Simple User Interface</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/firstapp/starting-activity.html">
+ <span class="en">Starting Another Activity</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/index.html">
+ <span class="en">Managing the Activity Lifecycle</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/starting.html">
+ <span class="en">Starting an Activity</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/pausing.html">
+ <span class="en">Pausing and Resuming an Activity</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/stopping.html">
+ <span class="en">Stopping and Restarting an Activity</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/recreating.html">
+ <span class="en">Recreating an Activity</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/supporting-devices/index.html">
+ <span class="en">Supporting Different Devices</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/languages.html">
+ <span class="en">Supporting Different Languages</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/screens.html">
+ <span class="en">Supporting Different Screens</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/platforms.html">
+ <span class="en">Supporting Different Platform Versions</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/fragments/index.html">
+ <span class="en">Building a Dynamic UI with Fragments</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/basics/fragments/support-lib.html">
+ <span class="en">Using the Support Library</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/fragments/creating.html">
+ <span class="en">Creating a Fragment</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/fragments/fragment-ui.html">
+ <span class="en">Building a Flexible UI</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/fragments/communicating.html">
+ <span class="en">Communicating with Other Fragments</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/intents/index.html">
+ <span class="en">Interacting with Other Apps</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/basics/intents/sending.html">
+ <span class="en">Sending the User to Another App</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/intents/result.html">
+ <span class="en">Getting a Result from the Activity</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/intents/filters.html">
+ <span class="en">Allowing Other Apps to Start Your Activity</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+
+ </ul>
+ </li><!-- end basic training -->
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/advanced.html">
+ <span class="en">Advanced Training</span>
+ </a>
+ </div>
+ <ul>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/location/index.html">
+ <span class="en">Making Your App Location Aware</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/basics/location/locationmanager.html">
+ <span class="en">Using the Location Manager</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/location/currentlocation.html">
+ <span class="en">Obtaining the Current Location</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/location/geocoding.html">
+ <span class="en">Displaying a Location Address</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/network-ops/index.html">
+ <span class="en">Performing Network Operations</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/basics/network-ops/connecting.html">
+ <span class="en">Connecting to the Network</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/network-ops/managing.html">
+ <span class="en">Managing Network Usage</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/network-ops/xml.html">
+ <span class="en">Parsing XML Data</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/efficient-downloads/index.html">
+ <span class="en">Transferring Data Without Draining the Battery</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/efficient-network-access.html">
+ <span class="en">Optimizing Downloads for Efficient Network Access</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/regular_updates.html">
+ <span class="en">Minimizing the Effect of Regular Updates</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/redundant_redundant.html">
+ <span class="en">Redundant Downloads are Redundant</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/connectivity_patterns.html">
+ <span class="en">Modifying Patterns Based on the Connectivity Type</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/cloudsync/index.html">
+ <span class="en">Syncing to the Cloud</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/cloudsync/aesync.html">
+ <span class="en">Syncing with App Engine</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/cloudsync/backupapi.html">
+ <span class="en">Using the Backup API</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/multiscreen/index.html">
+ <span class="en">Designing for Multiple Screens</span>
+ <span class="es">Cómo diseñar aplicaciones para varias pantallas</span>
+ <span class="ja">複数画面のデザイン</span>
+ <span class="ko">Designing for Multiple Screens</span>
+ <span class="ru">Designing for Multiple Screens</span>
+ <span class="zh-CN">针对多种屏幕进行设计</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/multiscreen/screensizes.html">
+ <span class="en">Supporting Different Screen Sizes</span>
+ <span class="es">Cómo admitir varios tamaños de pantalla</span>
+ <span class="ja">さまざまな画面サイズのサポート</span>
+ <span class="ko">다양한 화면 크기 지원</span>
+ <span class="ru">Supporting Different Screen Sizes</span>
+ <span class="zh-CN">支持各种屏幕尺寸</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/multiscreen/screendensities.html">
+ <span class="en">Supporting Different Screen Densities</span>
+ <span class="es">Cómo admitir varias densidades de pantalla</span>
+ <span class="ja">さまざまな画面密度のサポート</span>
+ <span class="ko">Supporting Different Screen Densities</span>
+ <span class="ru">Supporting Different Screen Densities</span>
+ <span class="zh-CN">支持各种屏幕密度</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/multiscreen/adaptui.html">
+ <span class="en">Implementing Adaptive UI Flows</span>
+ <span class="es">Cómo implementar interfaces de usuario adaptables</span>
+ <span class="ja">順応性のある UI フローの実装</span>
+ <span class="ko">Implementing Adaptive UI Flows</span>
+ <span class="ru">Implementing Adaptive UI Flows</span>
+ <span class="zh-CN">实施自适应用户界面流程</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/improving-layouts/index.html">
+ <span class="en">Improving Layout Performance</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/improving-layouts/optimizing-layout.html">
+ <span class="en">Optimizing Layout Hierarchies</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/improving-layouts/reusing-layouts.html">
+ <span class="en">Re-using Layouts with <include/></span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/improving-layouts/loading-ondemand.html">
+ <span class="en">Loading Views On Demand</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/improving-layouts/smooth-scrolling.html">
+ <span class="en">Making ListView Scrolling Smooth</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/managing-audio/index.html">
+ <span class="en">Managing Audio Playback</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/managing-audio/volume-playback.html">
+ <span class="en">Controlling Your App?s Volume and Playback</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/managing-audio/audio-focus.html">
+ <span class="en">Managing Audio Focus</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/managing-audio/audio-output.html">
+ <span class="en">Dealing with Audio Output Hardware</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/monitoring-device-state/index.html">
+ <span class="en">Optimizing Battery Life</span>
+ <span class="es">Cómo optimizar la duración de la batería</span>
+ <span class="ja">電池消費量の最適化</span>
+ <span class="ko">Optimizing Battery Life</span>
+ <span class="ru">Optimizing Battery Life</span>
+ <span class="zh-CN">优化电池使用时间</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/monitoring-device-state/battery-monitoring.html">
+ <span class="en">Monitoring the Battery Level and Charging State</span>
+ <span class="es">Cómo controlar el nivel de batería y el estado de carga</span>
+ <span class="ja">電池残量と充電状態の監視</span>
+ <span class="ko">Monitoring the Battery Level and Charging State</span>
+ <span class="ru">Monitoring the Battery Level and Charging State</span>
+ <span class="zh-CN">监控电池电量和充电状态</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/monitoring-device-state/docking-monitoring.html">
+ <span class="en">Determining and Monitoring the Docking State and Type</span>
+ <span class="es">Cómo determinar y controlar el tipo de conector y el estado de la conexión</span>
+ <span class="ja">ホルダーの装着状態とタイプの特定と監視</span>
+ <span class="ko">Determining and Monitoring the Docking State and Type</span>
+ <span class="ru">Determining and Monitoring the Docking State and Type</span>
+ <span class="zh-CN">确定和监控基座对接状态和类型</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/monitoring-device-state/connectivity-monitoring.html">
+ <span class="en">Determining and Monitoring the Connectivity Status</span>
+ <span class="es">Cómo determinar y controlar el estado de la conectividad</span>
+ <span class="ja">接続状態の特定と監視</span>
+ <span class="ko">Determining and Monitoring the Connectivity Status</span>
+ <span class="ru">Determining and Monitoring the Connectivity Status</span>
+ <span class="zh-CN">确定和监控网络连接状态</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/monitoring-device-state/manifest-receivers.html">
+ <span class="en">Manipulating Broadcast Receivers On Demand</span>
+ <span class="es">Cómo manipular los receptores de emisión bajo demanda</span>
+ <span class="ja">オンデマンドでのブロードキャスト レシーバ操作</span>
+ <span class="ko">Manipulating Broadcast Receivers On Demand</span>
+ <span class="ru">Manipulating Broadcast Receivers On Demand</span>
+ <span class="zh-CN">根据需要操作广播接收器</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/custom-views/index.html">
+ <span class="en">Creating Custom Views</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/custom-views/create-view.html">
+ <span class="en">Creating a Custom View Class</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/custom-views/custom-drawing.html">
+ <span class="en">Implementing Custom Drawing</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/custom-views/making-interactive.html">
+ <span class="en">Making the View Interactive</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/custom-views/optimizing-view.html">
+ <span class="en">Optimizing the View</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/search/index.html">
+ <span class="en">Adding Search Functionality</span>
+ </a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/search/setup.html">
+ <span class="en">Setting up the Search Interface</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/search/search.html">
+ <span class="en">Storing and Searching for Data</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/search/backward-compat.html">
+ <span class="en">Remaining Backward Compatible</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/id-auth/index.html">
+ <span class="en">Remembering Users</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/id-auth/identify.html">
+ <span class="en">Remembering Your User</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/id-auth/authenticate.html">
+ <span class="en">Authenticating to OAuth2 Services</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/id-auth/custom_auth.html">
+ <span class="en">Creating a Custom Account Type</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/sharing/index.html">
+ <span class="en">Sharing Content</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/sharing/send.html">
+ <span class="en">Sending Content to Other Apps</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/sharing/receive.html">
+ <span class="en">Receiving Content from Other Apps</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/sharing/shareaction.html">
+ <span class="en">Adding an Easy Share Action</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/camera/index.html">
+ <span class="en">Capturing Photos</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/camera/photobasics.html">
+ <span class="en">Taking Photos Simply</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/camera/videobasics.html">
+ <span class="en">Recording Videos Simply</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/camera/cameradirect.html">
+ <span class="en">Controlling the Camera</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/multiple-apks/index.html">
+ <span class="en">Maintaining Multiple APKs</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/multiple-apks/api.html">
+ <span class="en">Creating Multiple APKs for Different API Levels</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/multiple-apks/screensize.html">
+ <span class="en">Creating Multiple APKs for Different Screen Sizes</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/multiple-apks/texture.html">
+ <span class="en">Creating Multiple APKs for Different GL Textures</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/multiple-apks/multiple.html">
+ <span class="en">Creating Multiple APKs with 2+ Dimensions</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/backward-compatible-ui/index.html">
+ <span class="en">Creating Backward-Compatible UIs</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/abstracting.html">
+ <span class="en">Abstracting the New APIs</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/new-implementation.html">
+ <span class="en">Proxying to the New APIs</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/older-implementation.html">
+ <span class="en">Creating an Implementation with Older APIs</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/using-component.html">
+ <span class="en">Using the Version-Aware Component</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/enterprise/index.html">
+ <span class="en">Developing for Enterprise</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/enterprise/device-management-policy.html">
+ <span class="en">Enhancing Security with Device Management Policies</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/monetization/index.html">
+ <span class="en">Monetizing Your App</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/monetization/ads-and-ux.html">
+ <span class="en">Advertising without Compromising User Experience</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/design-navigation/index.html">
+ <span class="en">Designing Effective Navigation</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/design-navigation/screen-planning.html">
+ <span class="en">Planning Screens and Their Relationships</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/design-navigation/multiple-sizes.html">
+ <span class="en">Planning for Multiple Touchscreen Sizes</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/design-navigation/descendant-lateral.html">
+ <span class="en">Providing Descendant and Lateral Navigation</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/design-navigation/ancestral-temporal.html">
+ <span class="en">Providing Ancestral and Temporal Navigation</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/design-navigation/wireframing.html">
+ <span class="en">Putting it All Together: Wireframing the Example App</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/implementing-navigation/index.html">
+ <span class="en">Implementing Effective Navigation</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/lateral.html">
+ <span class="en">Implementing Lateral Navigation</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/ancestral.html">
+ <span class="en">Implementing Ancestral Navigation</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/temporal.html">
+ <span class="en">Implementing Temporal Navigation</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/descendant.html">
+ <span class="en">Implementing Descendant Navigation</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/tv/index.html">
+ <span class="en">Designing for TV</span>
+ </a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/tv/optimizing-layouts-tv.html">
+ <span class="en">Optimizing Layouts for TV</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/tv/optimizing-navigation-tv.html">
+ <span class="en">Optimizing Navigation for TV</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/tv/unsupported-features-tv.html">
+ <span class="en">Handling Features Not Supported on TV</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/displaying-bitmaps/index.html">
+ <span class="en">Displaying Bitmaps Efficiently</span>
+ </a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/load-bitmap.html">
+ <span class="en">Loading Large Bitmaps Efficiently</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/process-bitmap.html">
+ <span class="en">Processing Bitmaps Off the UI Thread</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/cache-bitmap.html">
+ <span class="en">Caching Bitmaps</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/display-bitmap.html">
+ <span class="en">Displaying Bitmaps in Your UI</span>
+ </a></li>
+ </ul>
+ </li>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/accessibility/index.html">
+ <span class="en">Implementing Accessibility</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/accessibility/accessible-app.html">
+ <span class="en">Developing Accessible Applications</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/accessibility/service.html">
+ <span class="en">Developing Accessibility Services</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot
+?>training/graphics/opengl/index.html">
+ <span class="en">Displaying Graphics with OpenGL ES</span>
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/environment.html">
+ <span class="en">Building an OpenGL ES Environment</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/shapes.html">
+ <span class="en">Defining Shapes</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/draw.html">
+ <span class="en">Drawing Shapes</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/projection.html">
+ <span class="en">Applying Projection and Camera Views</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/motion.html">
+ <span class="en">Adding Motion</span>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/touch.html">
+ <span class="en">Responding to Touch Events</span>
+ </a>
+ </li>
+ </ul>
+ </li>
+
+
+ </ul>
+ </li>
+</ul><!-- nav -->
+
+<script type="text/javascript">
+<!--
+ buildToggleLists();
+ changeNavLang(getLangPref());
+//-->
+</script>
diff --git a/docs/html/training/tv/optimizing-layouts-tv.jd b/docs/html/training/tv/optimizing-layouts-tv.jd
index 49c278c..a6db052 100644
--- a/docs/html/training/tv/optimizing-layouts-tv.jd
+++ b/docs/html/training/tv/optimizing-layouts-tv.jd
@@ -50,7 +50,7 @@
<ul>
<li>Put on-screen navigational controls on the left or right side of the screen and save the
vertical space for content.</li>
- <li>Create UIs that are divided into sections, by using <a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a>
+ <li>Create UIs that are divided into sections, by using <a href="{@docRoot}guide/components/fragments.html">Fragments</a>
and use view groups like {@link android.widget.GridView} instead
of {@link android.widget.ListView} to make better use of the
horizontal screen space.</li>
@@ -157,7 +157,7 @@
</p>
<p>
-To get the best scaling results for images, provide them as <a href="{@docRoot}guide/developing/tools/draw9patch.html">
+To get the best scaling results for images, provide them as <a href="{@docRoot}tools/help/draw9patch.html">
9-patch image</a> elements if possible.
If you provide low quality or small images in your layouts, they will appear pixelated, fuzzy, or grainy. This
is not a good experience for the user. Instead, use high-quality images.
diff --git a/docs/html/videos/index.jd b/docs/html/videos/index.jd
deleted file mode 100644
index 7f5df78..0000000
--- a/docs/html/videos/index.jd
+++ /dev/null
@@ -1,355 +0,0 @@
-videos=true
-page.title=Videos
-@jd:body
-
-<script src="http://swfobject.googlecode.com/svn/trunk/swfobject/swfobject.js" type="text/javascript"></script>
-<script src="{@docRoot}assets/jquery-history.js" type="text/javascript"></script>
-<script type="text/javascript">
-// for debugging in FF, so other browsers ignore the console commands.
-var console;
-if (!console) console = { 'log': function() {} };
-
-/* This 'playlist' object defines the playlist IDs for each tab.
- * Each name inside 'playlist' corresponds to class names for the tab that the playlists belong to (eg: "googleioTab" and "googleioBox" divs).
- * Each string in 'ids' is the ID of a YouTube playlist that belongs in the corresponding tab.
- */
-var playlists = {
- 'googleio' : {
- 'ids': ["734A052F802C96B9"]
- },
- 'about' : {
- 'ids': ["D7C64411AF40DEA5","611F8C5DBF49CEC6"]
- },
- 'developertips' : {
- 'ids': ["43E15866EF0033A2"]
- },
- 'developersandbox' : {
- 'ids': ["77426907BBAD558E"]
- }
-};
-
-/* Some playlists include the title in the description meta-data, so we need to account for this when building the thumbnail lists, so we don't show the title twice
- * This string is read via indexOf(), so multiple IDs need only be comma-separated in this string.
- */
-var playlistsWithTitleInDescription = "734A052F802C96B9";
-
-/* This 'featured' object defines the Feature Videos list.
- * Each playlist ID is paired with a custom video description.
- */
-var featured = {
-// Android Development Tools
- 'Oq05KqjXTvs' : "The team behind the Android Development Tools demonstrate several powerful features for app development, including new capabilities in the Eclipse layout editor.",
-// Android UIs for phones and tablets
- 'WGIU2JX1U5Y' : "This talk from the Android UI team explains several design patterns that the team recommends you use when designing your application for screens of all sizes.",
-// Android Protips
- 'twmuBbC_oB8' : "In this talk, you'll learn how to create a well polished app that abides by several key virtues, using advanced development techniques and some lesser known APIs."
-};
-
-/* When an event on the browser history occurs (back, forward, load),
- * load the video found in the URL hash
- */
-$(window).history(function(e, hash) {
- if (location.href.indexOf("#v=") != -1) {
- videoId = location.href.split("#v=");
- clickVideo(videoId[1]); // click the link with a matching class
- }
-});
-
-/* Load a video into the player box.
- * @param id The YouTube video ID
- * @param title The video title to display in the player box (character escaped)
- * @param autoplay Whether to automatically play the video
- */
-function loadVideo(id, title, autoplay) {
- if($("." + id).hasClass("noplay")) {
- //console.log("noplay");
- autoplay = false;
- $("." + id).removeClass("noplay");
- }
- swfobject.embedSWF('http://www.youtube.com/v/' + id + '&rel=1&border=0&fs=1&autoplay=' +
- (autoplay?1:0), 'player', '500', '334', '9.0.0', false, false, {allowfullscreen: 'true'});
- $("#videoPlayerTitle").html("<h2>" + unescape(title) + "</h2>");
-
- $.history.add('v=' + id); // add the current video to the browser history
- document.getElementById("doc-content").scrollTop = 0; // scroll the window to the top
-}
-
-/* Draw all videos from a playlist into a 'videoPreviews' list
- * @param data The feed data returned from the youtube request
- */
-function renderPlaylist(data) {
- var MAX_DESC_LENGTH = 390; // the length at which we will trim the description
- var feed = data.feed;
- var entries = feed.entry || [];
- var playlistId = feed.yt$playlistId.$t;
-
- var ul = $('<ul class="videoPreviews" />');
-
- // Loop through each entry (each video) and add it to the 'videoPreviews' list
- for (var i = 0; i < entries.length; i++) {
- var entry = entries[i];
-
- var title = entry.title.$t;
- var id = entry.media$group.yt$videoid.$t;
- var thumbUrl = entry.media$group.media$thumbnail[0].url;
- var fullDescription = entry.media$group.media$description.$t;
- var playerUrl = entry.media$group.media$content[0].url;
-
- // Check whether this playlist includes the video title inside the description meta-data, so we can remove it
- if (playlistsWithTitleInDescription.indexOf(playlistId) != -1) {
- var lines = fullDescription.split("\n");
- // If the first line includes the first 17 chars from the title, let's use the title from the description instead (because it's a more complete title)
- // This accounts for, literally, "Google I/O 2009 -", which is (so far) the min AND max for properly identifying a title in the only playlist with titles in the description
- if (lines[0].indexOf(title.slice(0,16)) != -1) {
- h3Title = "<h3>" + lines[0] + "</h3>";
- if (lines[2].length < 30) lines = lines.slice(3); // also, if the second line is very short (the speaker name), slice it out too
- else lines = lines.slice(1); // otherwise, slice after the first line
- }
- fullDescription = lines.join("");
- }
-
- var shortDescription = fullDescription.substr(0, MAX_DESC_LENGTH);
- shortDescription += shortDescription.length == MAX_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
-
- var img = $('<img src="' + thumbUrl + '" width="120" height="90"/>');
- var a = $('<a class="' + id + '" href="#" onclick="loadVideo(\'' + id + '\',\'' + escape(title) + '\',true); return setSelected(this);" />');
- var pShortDescription = $('<p class="short">' + shortDescription + '</p>');
- var pFullDescription = $('<p class="full">' + fullDescription + '</p>');
- var h3Title = "<h3>" + title + "</h3>";
- var pToggle = "<p class='toggle'><a href='#' onclick='return toggleDescription(this)'><span class='more'>more</span><span class='less'>less</span></a></p>";
- var li = $('<li/>');
-
- li.append(a);
- a.append(img).append(h3Title).append(pShortDescription);
-
- // Add the full description and "more/less" toggle, if necessary
- if (fullDescription.length > MAX_DESC_LENGTH) {
- a.append(pFullDescription);
- li.append(pToggle);
- }
-
- ul.append(li);
- }
-
- // Now add the 'videoPreviews' list to the page, and be sure we put it in the right tab
- // This is the part that allows us to put multiple playlists in one tab
- for (var x in playlists) {
- var ids = playlists[x].ids;
- for (var i in ids) {
- if (ids[i] == playlistId) {
- $("#"+x+"Box").append(ul);
- break;
- }
- }
- }
-}
-
-/* Draw a featured video into the existing 'videoPreviews' list
- * @param data The video data returned from the youtube request
- */
-function renderFeatured(data) {
- var MAX_TITLE_LENGTH = 48;
- var entry = data.entry || [];
- var id = entry.media$group.yt$videoid.$t;
- var description = featured[id];
- var title = entry.title.$t;
- var thumbUrl = entry.media$group.media$thumbnail[0].url;
- var playerUrl = entry.media$group.media$content[0].url;
-
- var ellipsis = title.length > MAX_TITLE_LENGTH ? "..." : "";
-
- var h3Title = "<h3>"+ title.substr(0,MAX_TITLE_LENGTH) + ellipsis + "</h3>";
- var img = $('<img src="' + thumbUrl + '" width="120" height="90"/>');
- var p = $('<p>' + description + '</p>');
- var a = $('<a class="' + id + '" href="#" onclick="loadVideo(\'' + id + '\',\'' + title + '\',true); return setSelected(this);" />');
- var li = $("<li/>");
-
- a.append(h3Title).append(img).append(p);
- li.append(a);
-
- $("#mainBodyRight .videoPreviews").append(li);
-}
-
-/* Request the playlist feeds from YouTube */
-function showPlaylists() {
- for (var x in playlists) {
- var ids = playlists[x].ids;
- for (var i in ids) {
- var script = "<script type='text/javascript' src='http://gdata.youtube.com/feeds/api/playlists/"
- + ids[i] +
- "?v=2&alt=json-in-script&max-results=50&callback=renderPlaylist'><\/script>";
- $("body").append(script);
- }
- }
-}
-
-/* Request the featured videos from YouTube */
-function showFeatured() {
- for (var id in featured) {
- var script = "<script type='text/javascript' src='http://gdata.youtube.com/feeds/api/videos/"
- + id +
- "?v=2&alt=json-in-script&callback=renderFeatured'><\/script>";
- $("body").append(script);
- }
-}
-
-/* Reveal a tab (playlist) box
- * @param name The name of the tab
- */
-function showBox(name) {
- $("#"+name+"Box").addClass("selected").siblings().removeClass("selected");
- $("#"+name+"Tab").addClass("selected").siblings().removeClass("selected");
- return false;
-}
-
-/* Highlight a video thumbnail, including all duplicates that there may be
- * @param link The link <a> object that was clicked
- */
-function setSelected(link) {
- var videoId = $(link).attr("class");
- if (videoId.indexOf("selected") != -1) { // this means this video is already selected and playing, so bail out
- return false;
- }
- $(".videoPreviews .selected").removeClass("selected");
- $("a." + videoId).addClass("selected").each( function (i) {
- if ($(this).is(":hidden")) {
- var boxName = $(this).parent().parent().parent().attr("id").split("Box");
- $("#"+boxName[0]+"Tab a").click();
- }
- });
- return false;
-}
-
-/* Reveal and hide the long/short descriptions for a video in the playlist
- * @param link The link <a> object that was clicked
- */
-function toggleDescription(link) {
- var aToggle = $(link);
- $("span", aToggle).toggle();
- var aDescription = $(">a", aToggle.parent().parent());
- $("p.short", aDescription).toggle();
- $("p.full", aDescription).toggle();
- if ($("span.less", aToggle).is(":visible")) {
- aDescription.css("height", "auto");
- } else {
- aDescription.css("height", "90px");
- }
- return false;
-}
-
-/* Add actions to the page onload event so that we load a video right away */
-addLoadEvent(function () {
- // if there's a video url in the hash, click that video
- if (location.href.indexOf("#v=") != -1) {
- var videoId = location.href.split("#v=");
- clickVideo(videoId[1]);
- } else { // otherwise, click the default video
- clickDefaultVideo();
- }
-});
-
-
-var clickVideoAttempts = 0; // Used with clickVideo()
-
-/* Click a video in order to load it and select it
- * @param videoId The ID of the video to click
- */
-function clickVideo(videoId) {
- if (!isAlphaNumeric(videoId)) {
- clickDefaultVideo();
- return;
- }
-
- if ($("." + videoId).length != 0) { // if we find the video, click it and return
- $("." + videoId).addClass("noplay"); // add class to indicate we should NOT autoplay (class removed by loadVideo)
- $("." + videoId + ":first").click();
- return;
- } else { // if we don't find it, increment clickVideoAttempts
- console.log("video NOT found: " + videoId);
- clickVideoAttempts++;
- }
-
- // if we don't find it after 20 attempts (2 seconds), click the first feature video
- if (clickVideoAttempts > 10) {
- console.log("video never found, clicking default...");
- clickVideoAttempts = 0;
- clickDefaultVideo();
- } else { // try again after 100 milliseconds
- setTimeout('clickVideo("' + videoId + '")', 100);
- }
-}
-
-/* returns true if the provided text is alphanumeric, false otherwise
- TODO: move this to the dev site js library */
-function isAlphaNumeric(text){
- var regex=/^[0-9A-Za-z]+$/; //^[a-zA-z]+$/
- if(regex.test(text)){
- return true;
- } else {
- console.log("Bogus video ID");
- return false;
- }
-}
-
-/* Click the default video that should be loaded on page load (the first video in the featured list) */
-function clickDefaultVideo() {
- if ($("#mainBodyRight .videoPreviews a:first").length != 0) {
- var videoId = $("#mainBodyRight .videoPreviews a:first").attr("class");
- $("." + videoId).addClass("noplay"); // add class to indicate we should NOT autoplay (class removed by loadVideo)
- $("." + videoId + ":first").click();
- return;
- } else { // if we don't find it, increment clickVideoAttempts
- console.log("default video NOT found");
- clickVideoAttempts++;
- }
-
- // if we don't find it after 50 attempts (5 seconds), just fail
- if (clickVideoAttempts > 50) {
- console.log("default video never found...");
- } else { // try again after 100 milliseconds
- setTimeout('clickDefaultVideo()', 100);
- }
-}
-</script>
-
- <div id="mainBodyFixed">
-
- <div id="mainBodyLeft" class="videoPlayer" >
- <div id="videoPlayerBox">
- <div id="videoBorder">
- <div id="videoPlayerTitle"></div>
- <div id="objectWrapper">
- <object id="player"></object>
- </div>
- </div>
- </div>
- </div><!-- end mainBodyLeft -->
-
- <div id="mainBodyRight" class="videoPlayer">
- <h2>Featured Videos</h2>
- <ul class="videoPreviews"></ul>
- </div><!-- end mainBodyRight -->
-
- <ul id="videoTabs">
- <li id="aboutTab" class="selected"><a onclick="return showBox('about');" href="#">About the Platform</a></li>
- <li id="developertipsTab"><a onclick="return showBox('developertips');" href="#">Developer Tips</a></li>
- <li id="googleioTab"><a onclick="return showBox('googleio');" href="#">Google I/O Sessions</a></li>
- <li id="developersandboxTab"><a onclick="return showBox('developersandbox');" href="#">Developer Sandbox</a></li>
- </ul>
-
- <div id="videos">
- <div id="aboutBox" class="selected"></div>
- <div id="developertipsBox"></div>
- <div id="googleioBox"></div>
- <div id="developersandboxBox"></div>
- </div>
-
- </div><!-- end mainBodyFixed -->
-
-<script type="text/javascript">
-// Initialization actions
-showFeatured(); // load featured videos
-showPlaylists(); // load playlists
-</script>
-
-
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 750c6dc..a3ec6c3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -561,14 +561,14 @@
if (expandedOneU != null) {
SizeAdaptiveLayout.LayoutParams params =
new SizeAdaptiveLayout.LayoutParams(expandedOneU.getLayoutParams());
- params.minHeight = rowHeight;
- params.maxHeight = rowHeight;
+ params.minHeight = minHeight;
+ params.maxHeight = minHeight;
adaptive.addView(expandedOneU, params);
}
if (expandedLarge != null) {
SizeAdaptiveLayout.LayoutParams params =
new SizeAdaptiveLayout.LayoutParams(expandedLarge.getLayoutParams());
- params.minHeight = rowHeight+1;
+ params.minHeight = minHeight+1;
params.maxHeight = maxHeight;
adaptive.addView(expandedLarge, params);
}
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
index 85156998..e84e912 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -442,7 +442,9 @@
mScreenOn = true;
mDelayedShowingSequence++;
if (DEBUG) Log.d(TAG, "onScreenTurnedOn, seq = " + mDelayedShowingSequence);
- notifyScreenOnLocked(showListener);
+ if (showListener != null) {
+ notifyScreenOnLocked(showListener);
+ }
}
}
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index beeea8e..756a3df 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -3608,6 +3608,10 @@
});
}
} else {
+ if (mKeyguardMediator != null) {
+ // Must set mScreenOn = true.
+ mKeyguardMediator.onScreenTurnedOn(null);
+ }
synchronized (mLock) {
mScreenOnFully = true;
}
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java
index 17957d2..c40abb7 100644
--- a/services/java/com/android/server/am/ActivityRecord.java
+++ b/services/java/com/android/server/am/ActivityRecord.java
@@ -129,6 +129,7 @@
private boolean inHistory; // are we in the history stack?
void dump(PrintWriter pw, String prefix) {
+ final long now = SystemClock.uptimeMillis();
pw.print(prefix); pw.print("packageName="); pw.print(packageName);
pw.print(" processName="); pw.println(processName);
pw.print(prefix); pw.print("launchedFromUid="); pw.print(launchedFromUid);
@@ -161,8 +162,30 @@
if (results != null) {
pw.print(prefix); pw.print("results="); pw.println(results);
}
- if (pendingResults != null) {
- pw.print(prefix); pw.print("pendingResults="); pw.println(pendingResults);
+ if (pendingResults != null && pendingResults.size() > 0) {
+ pw.print(prefix); pw.println("Pending Results:");
+ for (WeakReference<PendingIntentRecord> wpir : pendingResults) {
+ PendingIntentRecord pir = wpir != null ? wpir.get() : null;
+ pw.print(prefix); pw.print(" - ");
+ if (pir == null) {
+ pw.println("null");
+ } else {
+ pw.println(pir);
+ pir.dump(pw, prefix + " ");
+ }
+ }
+ }
+ if (newIntents != null && newIntents.size() > 0) {
+ pw.print(prefix); pw.println("Pending New Intents:");
+ for (int i=0; i<newIntents.size(); i++) {
+ Intent intent = (Intent)newIntents.get(i);
+ pw.print(prefix); pw.print(" - ");
+ if (intent == null) {
+ pw.println("null");
+ } else {
+ pw.println(intent.toShortString(false, true, false, true));
+ }
+ }
}
if (pendingOptions != null) {
pw.print(prefix); pw.print("pendingOptions="); pw.println(pendingOptions);
@@ -199,14 +222,20 @@
pw.print(prefix); pw.print("thumbHolder="); pw.println(thumbHolder);
if (launchTime != 0 || startTime != 0) {
pw.print(prefix); pw.print("launchTime=");
- TimeUtils.formatDuration(launchTime, pw); pw.print(" startTime=");
- TimeUtils.formatDuration(startTime, pw); pw.println("");
+ if (launchTime == 0) pw.print("0");
+ else TimeUtils.formatDuration(launchTime, now, pw);
+ pw.print(" startTime=");
+ if (startTime == 0) pw.print("0");
+ else TimeUtils.formatDuration(startTime, now, pw);
+ pw.println();
}
if (lastVisibleTime != 0 || waitingVisible || nowVisible) {
pw.print(prefix); pw.print("waitingVisible="); pw.print(waitingVisible);
pw.print(" nowVisible="); pw.print(nowVisible);
pw.print(" lastVisibleTime=");
- TimeUtils.formatDuration(lastVisibleTime, pw); pw.println("");
+ if (lastVisibleTime == 0) pw.print("0");
+ else TimeUtils.formatDuration(lastVisibleTime, now, pw);
+ pw.println();
}
if (configDestroy || configChangeFlags != 0) {
pw.print(prefix); pw.print("configDestroy="); pw.print(configDestroy);
@@ -525,7 +554,13 @@
*/
final void deliverNewIntentLocked(int callingUid, Intent intent) {
boolean sent = false;
- if (state == ActivityState.RESUMED
+ // We want to immediately deliver the intent to the activity if
+ // it is currently the top resumed activity... however, if the
+ // device is sleeping, then all activities are stopped, so in that
+ // case we will deliver it if this is the current top activity on its
+ // stack.
+ if ((state == ActivityState.RESUMED || (service.mSleeping
+ && stack.topRunningActivityLocked(null) == this))
&& app != null && app.thread != null) {
try {
ArrayList<Intent> ar = new ArrayList<Intent>();
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index babd7e9..73bfe8e 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -4042,7 +4042,9 @@
// token.
wtoken.startingData = ttoken.startingData;
wtoken.startingView = ttoken.startingView;
+ wtoken.startingDisplayed = ttoken.startingDisplayed;
wtoken.startingWindow = startingWindow;
+ wtoken.reportedVisible = ttoken.reportedVisible;
ttoken.startingData = null;
ttoken.startingView = null;
ttoken.startingWindow = null;
@@ -4336,14 +4338,15 @@
if (DEBUG_APP_TRANSITIONS) Slog.v(
TAG, "Setting dummy animation on: " + wtoken);
- wtoken.mAppAnimator.setDummyAnimation();
+ if (!wtoken.startingDisplayed) {
+ wtoken.mAppAnimator.setDummyAnimation();
+ }
mOpeningApps.remove(wtoken);
mClosingApps.remove(wtoken);
wtoken.waitingToShow = wtoken.waitingToHide = false;
wtoken.inPendingTransaction = true;
if (visible) {
mOpeningApps.add(wtoken);
- wtoken.startingDisplayed = false;
wtoken.startingMoved = false;
// If the token is currently hidden (should be the
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index f94bacd..2b48783 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -587,7 +587,7 @@
}
public boolean hasAppShownWindows() {
- return mAppToken != null ? mAppToken.firstWindowDrawn : false;
+ return mAppToken != null && (mAppToken.firstWindowDrawn || mAppToken.startingDisplayed);
}
boolean isIdentityMatrix(float dsdx, float dtdx, float dsdy, float dtdy) {
diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java
index f2dd335f..109161a 100644
--- a/services/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/java/com/android/server/wm/WindowStateAnimator.java
@@ -896,10 +896,14 @@
//Slog.i(TAG, "Not applying alpha transform");
}
- if (WindowManagerService.localLOGV) Slog.v(
+ if (WindowManagerService.localLOGV && (mShownAlpha == 1.0 || mShownAlpha == 0.0)) Slog.v(
TAG, "computeShownFrameLocked: Animating " + this +
- ": " + mWin.mShownFrame +
- ", alpha=" + mTransformation.getAlpha() + ", mShownAlpha=" + mShownAlpha);
+ " mAlpha=" + mAlpha +
+ " self=" + (selfTransformation ? mTransformation.getAlpha() : "null") +
+ " attached=" + (attachedTransformation == null ? "null" : attachedTransformation.getAlpha()) +
+ " app=" + (appTransformation == null ? "null" : appTransformation.getAlpha()) +
+ " screen=" + (screenAnimation ? mService.mAnimator.mScreenRotationAnimation.getEnterTransformation().getAlpha()
+ : "null"));
return;
} else if (mWin.mIsWallpaper &&
(mAnimator.mPendingActions & WindowAnimator.WALLPAPER_ACTION_PENDING) != 0) {